diff --git a/src/adapters/cache-storage/public-response-cache-adapter.ts b/src/adapters/cache-storage/public-response-cache-adapter.ts index 26fc4450..743ee6c2 100644 --- a/src/adapters/cache-storage/public-response-cache-adapter.ts +++ b/src/adapters/cache-storage/public-response-cache-adapter.ts @@ -866,10 +866,19 @@ export function createPublicResponseCacheAdapter( unreadableOwnedCacheCount += 1; continue; } + // 02-05. The marker only claims staging finished; `verified` means + // every entry is still present and matches, as activation checks. + const candidate = await verifyReleaseCandidate( + cache, + marker.value.assets, + policy, + dependencies.crypto, + undefined, + ); candidates.push( Object.freeze({ releaseRegistryId: marker.value.releaseRegistryId, - verified: true, + verified: candidate.kind === "VERIFIED", entryCount: marker.value.entryCount, }), ); diff --git a/tests/unit/public-response-cache.test.ts b/tests/unit/public-response-cache.test.ts index e0b2c0aa..7204eba6 100644 --- a/tests/unit/public-response-cache.test.ts +++ b/tests/unit/public-response-cache.test.ts @@ -208,12 +208,23 @@ describe("public response Cache Storage adapter", () => { ); expect(payloadIndex).toBeGreaterThanOrEqual(0); cache.responses.splice(payloadIndex, 1); + const candidates = async () => { + const inspection = await adapter.admin.inspect(); + return inspection.ok ? inspection.value.releaseCandidates : null; + }; + // 02-05. inspect() does not report the marker's claim as verified. + expect(await candidates()).toEqual([ + { releaseRegistryId: "evicted-release", verified: false, entryCount: 1 }, + ]); // A marker is a claim, not evidence: restaging must repair. expect(await adapter.admin.stageRelease(manifest)).toMatchObject({ ok: true, }); expect(fetches).toBe(2); + expect(await candidates()).toEqual([ + { releaseRegistryId: "evicted-release", verified: true, entryCount: 1 }, + ]); expect( await adapter.admin.activateRelease( manifest.releaseRegistryId,