Skip to content
Astera Technology

Define the storage quantity a quotation meters

Separate logical content, one stored copy and all stored copies.

Download complete case notes and answer keys ↓

Set the decision and its input

One synthetic object has eighty logical units, thirty measured stored units after compression, and two stored copies. The three declared bases yield eighty, thirty and sixty. A quotation saying only “storage” has not selected one of those quantities.

Filled local test worksheet
CaseInput JSON
Base test{"basis":"all-stored-copies","logical":80,"stored":30,"copies":2}
Download editable CSV ↓

Run the supplied comparison

The local model uses the supplied measured sizes; it does not estimate a real compression ratio or bill a provider. Replica counts describe stored bytes under this quote rule, not independent recovery domains.

Faulty and required outputs
PathOutput JSON
Faulty path{"basis":"all-stored-copies","measuredUnits":80}
Required path{"basis":"all-stored-copies","measuredUnits":60}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';
const smallWhole=(x,max)=>Number.isSafeInteger(x)&&x>=0&&x<=max;

const run=function run(i,corrected=true){
    if(!['logical','one-stored-copy','all-stored-copies'].includes(i.basis)||![i.logical,i.stored,i.copies].every(x=>smallWhole(x,1000000)))return {held:true};
    const quantities={logical:i.logical,'one-stored-copy':i.stored,'all-stored-copies':i.stored*i.copies};
    return {basis:i.basis,measuredUnits:corrected?quantities[i.basis]:i.logical};
  };
const cases=[{"input":{"basis":"all-stored-copies","logical":80,"stored":30,"copies":2},"corrected":false,"expected":{"basis":"all-stored-copies","measuredUnits":80}},{"input":{"basis":"all-stored-copies","logical":80,"stored":30,"copies":2},"corrected":true,"expected":{"basis":"all-stored-copies","measuredUnits":60}},{"input":{"basis":"one-stored-copy","logical":80,"stored":30,"copies":2},"corrected":true,"expected":{"basis":"one-stored-copy","measuredUnits":30}},{"input":{"basis":null,"logical":80,"stored":30,"copies":2},"corrected":true,"expected":{"held":true}}];
for(const test of cases){const actual=await run(test.input,test.corrected);assert.deepEqual(actual,test.expected);console.log(actual);}
Download runnable example ↓

Choose from the boundary evidence

One-copy mode yields thirty even with two copies. An absent metering definition is held before a comparison is presented.

  1. Name the metered layer
  2. Use its supplied size evidence
  3. Apply the copy rule

Keep an unknown size basis unresolved; do not invent compressed sizes.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
one stored copy basis{"basis":"one-stored-copy","logical":80,"stored":30,"copies":2}{"basis":"one-stored-copy","measuredUnits":30}
missing metering definition{"basis":null,"logical":80,"stored":30,"copies":2}{"held":true}
Download editable CSV ↓

How much is measured under the base all-copies rule?

Show the worked answer

Sixty: two measured copies of thirty. Eighty is logical size and cannot be substituted for that quote basis.

Related resources