Skip to content
Astera Technology

Rebuild a pack without the original workstation

Test declared helper resolution and editable-source regeneration in an isolated map.

Download complete case notes and answer keys ↓

Set the decision and its input

The supplied app references a helper at /original-workstation/helper.js. A synthetic original environment supplies it and returns6 for input3; that does not prove an isolated pack works. The repaired loader only reads the supplied package map, so the base missing helper is held. No real filesystem is inspected.

Filled local test worksheet
CaseInput JSON
Base test{"portableReference":false,"helperBundled":false,"editableTemplate":true}
Download editable CSV ↓

Run the supplied comparison

A complete pack uses a relative helper and editable template. It runs the initial ×2 output6, recompiles the template for ×3 and actually regenerates9. Compiled or rendered output without template source cannot complete that required regeneration.

Faulty and required outputs
PathOutput JSON
Faulty path{"isolatedReady":true,"originalResult":6}
Required path{"isolatedReady":false,"reason":"missing-helper"}
Download editable CSV ↓
Complete local Node24.14.1 programme
import assert from 'node:assert/strict';

const run=function run(i,corrected=true){
    const files=new Map([['app.js','module.exports=require("'+(i.portableReference?'./helper.js':'/original-workstation/helper.js')+'");']]);
    if(i.helperBundled)files.set('./helper.js','module.exports=x=>x*2;');
    if(i.editableTemplate)files.set('template.src','module.exports=x=>x*{{factor}};');
    const outside=new Map([['/original-workstation/helper.js','module.exports=x=>x*2;']]);
    const load=(name,allowOutside)=>{const source=files.get(name)??(allowOutside?outside.get(name):undefined);if(source===undefined)throw new Error('missing-helper');const module={exports:{}};Function('module','require',source)(module,n=>load(n,allowOutside));return module.exports;};
    if(!corrected)return {isolatedReady:true,originalResult:load('app.js',true)(3)};
    let original;try{original=load('app.js',false)(3);}catch{return {isolatedReady:false,reason:'missing-helper'};}
    if(!files.has('template.src'))return {isolatedReady:false,reason:'missing-editable-template',originalResult:original};
    files.set('./helper.js',files.get('template.src').replace('{{factor}}','3'));
    return {isolatedReady:true,originalResult:original,regeneratedResult:load('app.js',false)(3)};
  };
const cases=[{"input":{"portableReference":false,"helperBundled":false,"editableTemplate":true},"corrected":false,"expected":{"isolatedReady":true,"originalResult":6}},{"input":{"portableReference":false,"helperBundled":false,"editableTemplate":true},"corrected":true,"expected":{"isolatedReady":false,"reason":"missing-helper"}},{"input":{"portableReference":true,"helperBundled":true,"editableTemplate":true},"corrected":true,"expected":{"isolatedReady":true,"originalResult":6,"regeneratedResult":9}},{"input":{"portableReference":true,"helperBundled":true,"editableTemplate":false},"corrected":true,"expected":{"isolatedReady":false,"reason":"missing-editable-template","originalResult":6}}];
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

The complete isolated boundary produces6 then9. The compiled-only boundary runs6 but is held as missing-editable-template. All source strings and maps are fixed synthetic material.

  1. Load only declared package materials
  2. Run the initial isolated output
  3. Edit and regenerate from retained source

Do not scan host dependencies or execute arbitrary supplied projects.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
complete isolated regeneration pack{"portableReference":true,"helperBundled":true,"editableTemplate":true}{"isolatedReady":true,"originalResult":6,"regeneratedResult":9}
rendered or compiled output only{"portableReference":true,"helperBundled":true,"editableTemplate":false}{"isolatedReady":false,"reason":"missing-editable-template","originalResult":6}
Download editable CSV ↓

Does the base original-environment result6 establish replaceability?

Show the worked answer

No. The isolated helper is missing. Supply resolvable package materials and prove the required source edit regenerates the output without the original environment.

Related resources

Custom software development →