From 962075962c07d31922ba27a22a91a7cc9ac31645 Mon Sep 17 00:00:00 2001 From: kattsushi Date: Wed, 26 Aug 2026 18:26:55 -0600 Subject: [PATCH] fix(react-router): allow archived consolidation evidence --- scripts/verify-react-router-consolidation.mjs | 5 +++ ...verify-react-router-consolidation.test.mjs | 40 +++++++++++++++++++ 2 files changed, 45 insertions(+) diff --git a/scripts/verify-react-router-consolidation.mjs b/scripts/verify-react-router-consolidation.mjs index 37fe5d40..ee874d96 100644 --- a/scripts/verify-react-router-consolidation.mjs +++ b/scripts/verify-react-router-consolidation.mjs @@ -49,6 +49,9 @@ const VALID_DISPOSITIONS = new Set([ ]) const VALIDATOR_FIXTURE_ROOT = "scripts/fixtures/react-router-consolidation/" const HISTORICAL_CHANGE_ROOT = "openspec/changes/consolidate-react-remix-into-router/" +const ARCHIVED_CHANGE_PATTERN = + /^openspec\/changes\/archive\/\d{4}-\d{2}-\d{2}-consolidate-react-remix-into-router\// +const CANONICAL_SPEC_ROOT = "openspec/specs/react-router-major-consolidation/" const SKIPPED_SCAN_PATHS = new Set([ LEDGER, "scripts/verify-react-router-consolidation.mjs", @@ -58,6 +61,8 @@ const SKIPPED_SCAN_PATHS = new Set([ const isAllowedHistoricalPath = (file) => (file !== "pnpm-lock.yaml" && SKIPPED_SCAN_PATHS.has(file)) || file.startsWith(HISTORICAL_CHANGE_ROOT) || + ARCHIVED_CHANGE_PATTERN.test(file) || + file.startsWith(CANONICAL_SPEC_ROOT) || file.startsWith(VALIDATOR_FIXTURE_ROOT) const fail = (failures) => { diff --git a/scripts/verify-react-router-consolidation.test.mjs b/scripts/verify-react-router-consolidation.test.mjs index aefa80a9..d76ba132 100644 --- a/scripts/verify-react-router-consolidation.test.mjs +++ b/scripts/verify-react-router-consolidation.test.mjs @@ -152,6 +152,46 @@ test("retired verification allows only the migration ledger, change history, val assert.equal(result.exitCode, 0, result.output) }) +test("retired verification allows the dated consolidation archive and canonical consolidation spec", async (context) => { + const root = await fixture() + context.after(() => rm(root, { recursive: true, force: true })) + await retireFixture(root) + await writeFixtureFile( + root, + "openspec/changes/archive/2026-08-26-consolidate-react-remix-into-router/evidence.md", + "Historical @effectify/react-remix 7.18.2 evidence\n", + ) + await writeFixtureFile( + root, + "openspec/specs/react-router-major-consolidation/spec.md", + "Canonical packages/react/remix and react-remix-example history\n", + ) + + const result = await verify(root, "retired") + + assert.equal(result.exitCode, 0, result.output) +}) + +const unrelatedHistoricalPaths = { + "similarly named archive": + "openspec/changes/archive/2026-08-26-consolidate-react-remix-into-router-followup/evidence.md", + "similarly named spec": "openspec/specs/react-router-major-consolidation-followup/spec.md", +} + +for (const [name, file] of Object.entries(unrelatedHistoricalPaths)) { + test(`retired verification rejects a ${name}`, async (context) => { + const root = await fixture() + context.after(() => rm(root, { recursive: true, force: true })) + await retireFixture(root) + await writeFixtureFile(root, file, "Historical @effectify/react-remix 7.18.2 evidence\n") + + const result = await verify(root, "retired") + + assert.notEqual(result.exitCode, 0, result.output) + assert.match(result.output, new RegExp(file.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"))) + }) +} + test("the retired expectation reports retained transitional surfaces", async (context) => { const root = await fixture() context.after(() => rm(root, { recursive: true, force: true }))