Skip to content

Commit 538bec7

Browse files
committed
test(scripts): W1 reports a witness that was never consulted as a red case, not a crash (#22485)
Claude-Session: https://claude.ai/code/session_01VZqqwTj2wsihZEbfT6yyYN Co-authored-by: Claude <noreply@anthropic.com>
1 parent b6d3751 commit 538bec7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎scripts/check-adr-0087-registration.mjs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6407,7 +6407,7 @@ function selfTest() {
64076407
git(['commit', '-qm', 'base'], dir);
64086408
return { dir, w };
64096409
};
6410-
const ids = (witness) => (witness.json ? projectedMigrationIds(witness.json) : null);
6410+
const ids = (witness) => (witness?.json ? projectedMigrationIds(witness.json) : null);
64116411

64126412
// W1, THE PIN: a withdrawn id no longer false-reds. HEAD's registry dropped
64136413
// `withdrawn-one`; a stale committed copy -- the shape the deleted file had --
@@ -6425,7 +6425,7 @@ function selfTest() {
64256425
assert(p1.length === 0, `W1: a withdrawn migration id must NOT red the gate -- got: ${p1.join('|')}`);
64266426
assert(
64276427
JSON.stringify(ids(used)) === JSON.stringify(['kept-one']),
6428-
`W1: the witness is generated from HEAD's registry (only \`kept-one\`), not read from the stale copy -- got ${JSON.stringify(ids(used))} ${used?.problem ?? ''}`,
6428+
`W1: the gate consulted the GENERATED witness, built from HEAD's registry (only \`kept-one\`), never the stale copy -- got ${used === null ? 'no witness consulted at all' : `${JSON.stringify(ids(used))} ${used.problem ?? ''}`}`,
64296429
);
64306430

64316431
// W2: the witness describes HEAD, never the working tree. An uncommitted edit

0 commit comments

Comments
 (0)