Guard stale app execution against feature contract changes

This commit is contained in:
Jonathan Sykes
2026-10-08 09:18:51 +08:00
parent 3505dc3c0e
commit c4a512bea6
7 changed files with 143 additions and 8 deletions

View File

@@ -54,3 +54,10 @@ test('missing current app uses verified same-contract N-1 offline through the co
test('an incompatible previous core never executes against the new shell',async()=>{
const f=fixture({previous:true,contract:2});await assert.rejects(f.root.AppBootstrap.ready,/hash/);assert.equal(f.root.appRuns,undefined);
});
test('a feature contract change also prevents stale core execution',async()=>{
const f=fixture({previous:true});f.root.Lazy.manifest.groups['feature:test']={contract:2,files:[]};
const state=await f.held.get('/__ytp_asset_state').json();state.previous.groups['feature:test']={contract:1,files:[]};f.held.set('/__ytp_asset_state',Response.json(state));
await assert.rejects(f.root.AppBootstrap.ready,/hash/);assert.equal(f.root.appRuns,undefined);
});