Enforce stale core contracts in the worker without native startup I/O

This commit is contained in:
Jonathan Sykes
2026-10-08 10:05:38 +08:00
parent 57edb410c3
commit 97eb31e732
7 changed files with 40 additions and 13 deletions

View File

@@ -45,3 +45,10 @@ test('removing group membership retains the old tab URL even if the physical fil
const previous=manifest(),current=manifest();current.groups.core.files=['/index.html'];
assert.ok(core.retained(current,previous).has('/a.js?v=a'));
});
test('stale app core requires every feature contract to match the new shell',()=>{
const old={files:{'/app.js':{h:'old'}},groups:{core:{contract:1,files:['/app.js']},extra:{contract:1,files:[]}}};
const next=structuredClone(old);next.files['/app.js'].h='new';next.groups.extra.contract=2;
assert.equal(core.fallback(next,old,'/app.js'),null);next.groups.extra.contract=1;assert.equal(core.fallback(next,old,'/app.js'),'/app.js?v=old');
});