fix: close housekeeping foundation review findings

This commit is contained in:
2026-08-26 19:16:34 +02:00
parent ebc263da35
commit 08f8d54888
21 changed files with 593 additions and 46 deletions
@@ -50,6 +50,48 @@ describe("validateMigrationEntries", () => {
expect(issues).toContain("REBUILD requires targetPath: /admin");
});
it("rejects a discovery surface mismatch for the same legacy path", () => {
expect(
validateMigrationEntries(
[page("/admin")],
[{ ...entry("/admin"), surface: "mod" }],
),
).toEqual([
"surface mismatch for legacyPath /admin: expected admin, received mod",
]);
});
it("rejects a discovery source file mismatch for the same legacy path", () => {
expect(
validateMigrationEntries(
[page("/admin")],
[
{
...entry("/admin"),
sourceFile: "src/app/admin/renamed/page.tsx",
},
],
),
).toEqual([
"sourceFile mismatch for legacyPath /admin: expected src/app/admin/page.tsx, received src/app/admin/renamed/page.tsx",
]);
});
it("rejects removal with a non-null target", () => {
expect(
validateMigrationEntries(
[page("/admin")],
[
{
...entry("/admin"),
decision: "REMOVE",
targetPath: "/admin/system/legacy",
},
],
),
).toEqual(["REMOVE requires null targetPath: /admin"]);
});
it("enforces migration safety evidence", () => {
const issues = validateMigrationEntries(
[page("/admin")],