import { describe, expect, it } from "vitest"; import { createHousekeepingRegistry } from "../foundation/registry"; import { HOUSEKEEPING_MANIFESTS } from "../manifests"; import { discoverLegacyPages } from "../migration/discover-legacy-pages"; import { HOUSEKEEPING_MIGRATION_MATRIX } from "../migration/matrix"; import { HOUSEKEEPING_ROUTE_HANDLERS } from "../route-handlers"; import { verifyHousekeepingRuntimeParity } from "./parity"; describe("Housekeeping runtime parity", () => { const report = verifyHousekeepingRuntimeParity( HOUSEKEEPING_MIGRATION_MATRIX, createHousekeepingRegistry(HOUSEKEEPING_MANIFESTS), HOUSEKEEPING_ROUTE_HANDLERS, ); it("closes all 137 discovered migration rows against the runtime", () => { expect(discoverLegacyPages()).toHaveLength(137); expect(report).toEqual({ discovered: 137, mapped: 137, verified: 137, removed: 2, unresolved: [], capabilityGaps: [], handlerGaps: [], }); }); it("keeps every retained target under /ase with concrete parity evidence", () => { for (const row of HOUSEKEEPING_MIGRATION_MATRIX) { if (row.decision === "REMOVE") { expect(row.targetPath, row.legacyPath).toBeNull(); expect(row.status, row.legacyPath).toBe("REMOVED"); expect(row.parityEvidence, row.legacyPath).toContain( `runtime-parity:${row.legacyPath}`, ); continue; } expect(row.targetPath, row.legacyPath).toMatch(/^\/ase(?:\/|$)/); expect(row.status, row.legacyPath).toBe("VERIFIED"); expect(row.parityEvidence, row.legacyPath).toContain( `runtime-parity:${row.legacyPath}`, ); } }); });