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.
| Case | Input JSON |
|---|---|
| Base test | {"portableReference":false,"helperBundled":false,"editableTemplate":true} |
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.
| Path | Output JSON |
|---|---|
| Faulty path | {"isolatedReady":true,"originalResult":6} |
| Required path | {"isolatedReady":false,"reason":"missing-helper"} |
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);}
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.
- Load only declared package materials
- Run the initial isolated output
- Edit and regenerate from retained source
Do not scan host dependencies or execute arbitrary supplied projects.
| Condition | Input JSON | Expected 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} |
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.