Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/verify-react-router-consolidation.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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) => {
Expand Down
40 changes: 40 additions & 0 deletions scripts/verify-react-router-consolidation.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }))
Expand Down
Loading