Skip to content

Commit 5c49f1b

Browse files
committed
release(ui-merge): gate self-tests stop reading the deleted pin scripts as live specimens (objectstack#25711, WIP)
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0149BHSXfCdQywGaLdpRAtWe
1 parent b35ec35 commit 5c49f1b

3 files changed

Lines changed: 43 additions & 29 deletions

File tree

‎scripts/check-empty-changeset.mjs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ const SELF_TEST_BATTERIES = Object.freeze({
694694
'The second consumer: where THIS SELF-TEST runs (#6509)': 12,
695695
'Parser unit rows': 8,
696696
'THE FIX (#7004): comments and quoted bump values': 12,
697-
'The family reads one block one way (#7004)': 25,
697+
'The family reads one block one way (#7004)': 20, // the objectui digest's five cases left with it (objectstack#25711)
698698
'Missing input is a failure, never a pass (#4690)': 1,
699699
});
700700

@@ -2085,12 +2085,11 @@ function selfTest() {
20852085
'scripts/check-changeset-no-major.mjs',
20862086
'scripts/check-empty-changeset.mjs',
20872087
'scripts/check-adr-0087-registration.mjs',
2088-
'scripts/objectui-changeset-digest.mjs',
20892088
];
20902089
const literals = new Map();
20912090
for (const rel of FAMILY) {
20922091
const path = join(REPO_ROOT, rel);
2093-
assert(existsSync(path), `family: ${rel} must exist — it is one of the four readers of a changeset frontmatter block`);
2092+
assert(existsSync(path), `family: ${rel} must exist — it is one of the family's readers of a changeset frontmatter block`);
20942093
const src = existsSync(path) ? readFileSync(path, 'utf8') : '';
20952094
const found = src.match(/\/\^\\s\*\["'\]\?.*?\/\.exec\(/g) ?? [];
20962095
// Anti-vacuous-green (#6983): an extraction that stops matching yields
@@ -2102,13 +2101,13 @@ function selfTest() {
21022101
const distinct = new Set(literals.values());
21032102
assert(
21042103
distinct.size === 1,
2105-
`family: all four changeset frontmatter parsers must use a byte-identical entry regex — found ${distinct.size} distinct spellings: ${JSON.stringify([...literals])}`,
2104+
`family: every changeset frontmatter parser in the family must use a byte-identical entry regex — found ${distinct.size} distinct spellings: ${JSON.stringify([...literals])}`,
21062105
);
21072106
// And the shared spelling must actually be the comment-aware one, so this
21082107
// block cannot go green on four identically-STALE copies.
21092108
assert(
21102109
[...distinct][0]?.includes('(?:\\s+#.*)?'),
2111-
'family: the shared entry regex must carry the `(?:\\s+#.*)?` trailing-comment arm — four identical copies of the OLD anchor would satisfy the agreement check above while re-opening #7004',
2110+
'family: the shared entry regex must carry the `(?:\\s+#.*)?` trailing-comment arm — identical copies of the OLD anchor would satisfy the agreement check above while re-opening #7004',
21122111
);
21132112
for (const rel of FAMILY) {
21142113
const src = existsSync(join(REPO_ROOT, rel)) ? readFileSync(join(REPO_ROOT, rel), 'utf8') : '';

‎scripts/pm/dispatch-gates.mjs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12662,9 +12662,10 @@ function discoverFamiliesPass(tree) {
1266212662
// is refused for a self-test because a module's population describes the
1266312663
// gate's WORK, which a `--self-test` invocation does not perform. A file
1266412664
// the self-test OPENS is the opposite case — the self-test is the run, and
12665-
// that read is the run's own input. The live specimen is this card's:
12666-
// `scripts/objectui-changeset-digest.mjs` stages its copy inside
12667-
// `--self-test`, and skipping self-tests here would close nothing.
12665+
// that read is the run's own input. The card's specimen was
12666+
// `scripts/objectui-changeset-digest.mjs`, which staged its copy inside
12667+
// `--self-test` (gone with the objectui pin, objectstack#25711); skipping
12668+
// self-tests here would have closed nothing.
1266812669
for (const target of readProgramTargetsInSource(f, source, (t) => trackedSet.has(t))) {
1266912670
if (entry.reads.includes(target)) continue;
1267012671
entry.reads.push(target);

‎scripts/pm/dispatch-gates.self-test.mjs‎

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2799,18 +2799,21 @@ export function selfTest({ tier = 'full' } = {}) {
27992799
);
28002800
// The card's sharpest specimen, both ends. DEPARTURE alone would stay green
28012801
// on a mask that emptied the file, so the ARRIVAL half names a live shell
2802-
// script whose hint is spelled in CODE and must survive.
2803-
const liveBumpSrc = readFileSync(nodePath.join(ROOT, 'scripts/bump-objectui.sh'), 'utf8');
2804-
t(
2805-
'LIVE: the file the card measured no longer offers the path its `#` comments merely NAME',
2806-
!extractWatchHints(liveBumpSrc, 'scripts/bump-objectui.sh', { tree: hintTree }).includes(
2807-
'docs/releases-maintenance.md',
2802+
// script whose hint is spelled in CODE and must survive. The file the card
2803+
// measured (`scripts/bump-objectui.sh`) left the tree with the objectui pin
2804+
// (objectstack#25711); `with-fleet.sh` is the same shape — its header NAMES
2805+
// the relay's op list in `#` comments, and no line of its code reads it.
2806+
const liveCommentSrc = readFileSync(nodePath.join(ROOT, 'scripts/pm/with-fleet.sh'), 'utf8');
2807+
t(
2808+
'LIVE: a shell script no longer offers the path its `#` comments merely NAME',
2809+
!extractWatchHints(liveCommentSrc, 'scripts/pm/with-fleet.sh', { tree: hintTree }).includes(
2810+
'scripts/pm/fleet-write/ops.mjs',
28082811
),
28092812
);
28102813
t(
28112814
'…non-vacuously: that path IS spelled in the file, inside a `#` comment, and the unmasked control still reads it',
2812-
extractWatchHints(liveBumpSrc, 'scripts/bump-objectui.sh.mjs', { tree: hintTree }).includes(
2813-
'docs/releases-maintenance.md',
2815+
extractWatchHints(liveCommentSrc, 'scripts/pm/with-fleet.sh.mjs', { tree: hintTree }).includes(
2816+
'scripts/pm/fleet-write/ops.mjs',
28142817
),
28152818
);
28162819
// ⭐ LIVE RECOVERY (#16744): the site the card named, both ends. The `.mjs`
@@ -8441,22 +8444,33 @@ export function selfTest({ tier = 'full' } = {}) {
84418444
readEdges.length > 0,
84428445
);
84438446

8444-
// The card's own specimen, end to end and by name. ⛔ Not "some family
8445-
// matches": the miss was THIS family scoring `silent` for THIS path.
8446-
const digestEntry = liveDiscovery.byCheck.get('check:objectui-changeset');
8447-
const STAGED_GATE = 'scripts/check-adr-0087-registration.mjs';
8447+
// The card's own specimen, end to end. The card's family —
8448+
// `check:objectui-changeset`, whose digest staged a copy of the ADR-0087 gate
8449+
// — left the tree with the objectui pin (objectstack#25711), so the specimen
8450+
// is now every live read edge the family's hints do NOT cover: each must
8451+
// reach its family through the program-text key, named by the reader. ⛔ Not
8452+
// "some edge exists": the miss was a family scoring `silent` for a path only
8453+
// this key can supply, so the case reads exactly those paths, and fails when
8454+
// there are none left to read.
8455+
const keyOnlyReads = readEdges.filter(([check, r]) => {
8456+
const entry = liveDiscovery.byCheck.get(check);
8457+
return (
8458+
entry.readEdge?.get(r) === 'program-text' &&
8459+
!(entry.hints ?? []).some((h) => hintCovers(h, r)) &&
8460+
!(entry.files ?? []).some((f) => hintCovers(f, r))
8461+
);
8462+
});
84488463
t(
8449-
`the staged gate reaches the family that runs a copy of it (${coveringKey(digestEntry, STAGED_GATE)?.via ?? 'no key'})`,
8450-
coveringKey(digestEntry, STAGED_GATE)?.key === STAGED_GATE &&
8451-
coveringKey(digestEntry, STAGED_GATE)?.via === 'program text read by scripts/objectui-changeset-digest.mjs',
8464+
`the live tree has read edges no watch hint covers, which is why the key is needed (${keyOnlyReads.length})`,
8465+
keyOnlyReads.length > 0,
84528466
);
8453-
// …and green for the RIGHT reason. `extractWatchHints` masks self-tests, so
8454-
// the staging literal is not a hint and cannot supply this lead — the case
8455-
// above would otherwise pass on a key it is not testing.
8467+
const unkeyed = keyOnlyReads.filter(([check, r, by]) => {
8468+
const key = coveringKey(liveDiscovery.byCheck.get(check), r);
8469+
return key?.key !== r || key?.via !== `program text read by ${by}`;
8470+
});
84568471
t(
8457-
'and no watch hint of that family covers it, which is why the key was needed',
8458-
!(digestEntry.hints ?? []).some((h) => hintCovers(h, STAGED_GATE)) &&
8459-
!(digestEntry.files ?? []).some((f) => hintCovers(f, STAGED_GATE)),
8472+
`each of them reaches its family through the program-text key, naming the reader (${unkeyed.map(([c, r]) => `${c} <- ${r}`).join(' · ') || 'all keyed'})`,
8473+
unkeyed.length === 0,
84608474
);
84618475

84628476
// Reconstruction: `entry.reads` is what the scan says over the family's own

0 commit comments

Comments
 (0)