1const path = new URL("../docs/application-origin-migration.md", import.meta.url);2const source = await Deno.readTextFile(path);34function assert(condition: unknown, message: string): asserts condition {5 if (!condition) throw new Error(message);6}78Deno.test("origin migration playbook retains the complete repeatable safety contract", () => {9 for (10 const boundary of [11 "service workers",12 "Cache Storage",13 "IndexedDB",14 "OPFS",15 "permissions",16 "WebAuthn",17 "manifest identity",18 ]19 ) {20 assert(source.includes(boundary), `origin playbook omitted ${boundary}`);21 }22 for (let index = 1; index <= 12; index++) {23 const id = `ORIGIN-${String(index).padStart(2, "0")}`;24 assert(source.includes(`- [ ] \`${id}\``), `origin checklist omitted ${id}`);25 }26 assert(source.includes("## Partial migration and rollback"), "rollback section is missing");27 assert(source.includes("offline users"), "offline-user retirement case is missing");28 assert(29 source.includes("Never put an account secret") &&30 source.includes("never copies account secrets"),31 "cross-origin secret-copy prohibition is missing",32 );33});