Skip to content
Astera Technology

Apply runtime configuration without bundle edits

Execute a runtime reader beside an embedded build-time constant.

Download complete case notes and answer keys ↓

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.

Filled local test worksheet
CaseInput JSON
Base test{"runtimeFile":"{\"target\":\"siteB\"}"}
Download editable CSV ↓

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.

Faulty and required outputs
PathOutput JSON
Faulty path{"target":"siteA","bundleEdited":false}
Required path{"target":"siteB","bundleEdited":false}
Download editable CSV ↓
Complete local Node24.14.1 programme
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);}
Download runnable example ↓

Choose from the boundary evidence

A later siteC file yields siteC. Missing runtime input is held, without an undeclared siteA fallback.

  1. Identify the reading mechanism
  2. Execute with the supplied file
  3. Compare actual destinations

Editing the bundle is not a runtime-configuration test.

Editable boundary inputs and outputs
ConditionInput JSONExpected output JSON
later runtime destination{"runtimeFile":"{\"target\":\"siteC\"}"}{"target":"siteC","bundleEdited":false}
runtime file absent{"runtimeFile":null}{"held":true}
Download editable CSV ↓

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.

Related resources