Set the decision and its input
The synthetic bundle embeds siteA. Its supplied runtime JSON requests siteB. A constant reader keeps siteA despite that file. The repaired reader uses config.target during execution and produces siteB without changing bundle source.
| Case | Input JSON |
|---|---|
| Base test | {"runtimeFile":"{\"target\":\"siteB\"}"} |
Run the supplied comparison
The fixed local readers actually execute. This establishes the supplied mechanism, not a real hosting platform’s capabilities or permission to change every live setting.
| Path | Output JSON |
|---|---|
| Faulty path | {"target":"siteA","bundleEdited":false} |
| Required path | {"target":"siteB","bundleEdited":false} |
import assert from 'node:assert/strict';
const run=function run(i,corrected=true){
if(i.runtimeFile===null)return {held:true};let config;try{config=JSON.parse(i.runtimeFile);}catch{return {held:true,reason:'invalid-json'};}if(typeof config?.target!=='string'||!config.target)return {held:true};
const source=corrected?'return config.target;':'return "siteA";';
return {target:Function('config',source)(config),bundleEdited:false};
};
const cases=[{"input":{"runtimeFile":"{\"target\":\"siteB\"}"},"corrected":false,"expected":{"target":"siteA","bundleEdited":false}},{"input":{"runtimeFile":"{\"target\":\"siteB\"}"},"corrected":true,"expected":{"target":"siteB","bundleEdited":false}},{"input":{"runtimeFile":"{\"target\":\"siteC\"}"},"corrected":true,"expected":{"target":"siteC","bundleEdited":false}},{"input":{"runtimeFile":null},"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);}
Choose from the boundary evidence
A later siteC file yields siteC. Missing runtime input is held, without an undeclared siteA fallback.
- Identify the reading mechanism
- Execute with the supplied file
- Compare actual destinations
Editing the bundle is not a runtime-configuration test.
| Condition | Input JSON | Expected output JSON |
|---|---|---|
| later runtime destination | {"runtimeFile":"{\"target\":\"siteC\"}"} | {"target":"siteC","bundleEdited":false} |
| runtime file absent | {"runtimeFile":null} | {"held":true} |
Can the runtime file change the embedded constant reader?
Show the worked answer
No. It still returns siteA. Choose and test a package whose reader uses the declared runtime input.