Uh oh!
There was an error while loading. Please reload this page.
fix(scripts): make check-cli-command-ids' literal-declaration self-test able to fail - #12759
Merged
Merged
Conversation
…st able to fail The case pinning that ROOT_DIR_WATCH_HINTS is spelled as a source literal searched the WHOLE file for a needle it spelled inline, so `includes` found that needle in the assertion itself. Rewriting the declaration into the computed form the case exists to reject left the self-test fully green -- 38 of 38 cases passing -- while `extractWatchHints` recovered no hint at all and the gate went unnameable by every dispatch brief. Scope the search to the declaration statement and derive the needle from the declared values. Assembling the needle alone is not sufficient here: unlike check-objectql-double-limit.mjs, this file spells the hint a third time in the runtime-value case below, so a whole-file search finds that copy and stays green on the computed form. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PfaSTikked61BkcsB5Rn69
This was referenced Aug 27, 2026
os-zhuang
marked this pull request as ready for review
August 27, 2026 17:17
os-zhuang
enabled auto-merge
August 27, 2026 17:17
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes#12472
check-cli-command-ids --self-testcarried a case pinning thatROOT_DIR_WATCH_HINTSisspelled as a source literal rather than computed. The case could not fail: it searched
the whole file for a needle it spelled inline, so
includesfound that needle in theassertion rather than in the declaration, and the case was satisfied by its own text.
Reproduced before fixing, on
origin/mainat168941ceaRewriting only the declaration into the computed form the case exists to reject:
Not one case reddened. That confirms the card's reading of the neighbouring case too: it
asserts the array's runtime value, which the computed form still satisfies, so it does
not close the gap.
The harm is real, not theoretical
Measured against the extractor itself (
extractWatchHintsinscripts/pm/dispatch-gates.mjs):["scripts/**"][]So the computed form really does leave the gate unnameable by every dispatch brief. The
self-test's own copies of the hint cannot stand in for the declaration, because
extractWatchHintsrunsmaskSelfTests(maskComments(source))and blanks the wholeselfTestbody before scanning.Why this does not use the assembled-needle shape from its sibling
The card suggests the remedy landed in
scripts/check-objectql-double-limit.mjs— assemblethe needle so the searched byte sequence exists nowhere but the declaration. Measured
insufficient here, on disk. That file spells its hint exactly twice (declaration,
assertion), so un-spelling the assertion leaves the declaration as the only copy. This file
spells it a third time, in the runtime-value case just below. Applying the
assembled-needle remedy alone on top of a computed declaration:
Still cannot fail. So the fix scopes the search to the declaration statement and derives
the needle from the declared values — scope is the fix, the derived needle is the hygiene.
Being generic over
ROOT_DIR_WATCH_HINTSrather than pinning one string, it also grows withthe declaration. A companion case asserts the declaration statement is located exactly once,
so the pin cannot silently judge nothing.
The declaration stays a literal, as the ruling requires; nothing in this change makes it
computed.
Ablation, both directions, on disk
Mutation and restore each proved on disk by anchor counts, and the restore leg additionally
by
git hash-objectagainst the HEAD blob plus an emptygit diff HEAD.1 of 39 case(s) failed—the declaration is spelled as a LITERAL in this source, not computed,SELFTEST_EXIT=1check-cli-command-ids self-test: 39 cases pass,git diff HEADemptyNo build step is involved: this gate is run directly from source by
node, so there is nodist/for a stale artifact to hide in.Sibling survey
scripts/check-parse-guard.mjsis still cleared, and for a slightly stronger reason thanthe card states: it carries no own-source
readFileSync(fileURLToPath(import.meta.url))pinat all, so it has no assertion of this shape to be phantom. Swept all 13 gates carrying the
ROOT_DIR_WATCH_HINTSidiom — exactly two carry an own-source pin(
check-cli-command-ids.mjs, fixed here, andcheck-objectql-double-limit.mjs, whose hintis spelled once). No third gate has grown the shape, so nothing is widened into this PR.
Gates
Re-derived for the actual diff with
node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack(no path arguments — the script takes its own change set from the merge base); it named the
same families as the dispatch brief, adding none. Union run against
c20665400, the finalcommit, all green:
Both convention-triggered ledger obligations were run and are satisfied without a new row —
this change adds no population root and moves no spelling:
check-ci-filter-parity.mjsfirst reportedPREREQUISITE NOT MET(it importsyaml, absentfrom a fresh worktree);
pnpm installwas run and it then passed — recorded here because thefirst reading measured nothing and must not be read as either colour.
Repo-wide
pnpm lintis left to CI, which runs the farm exactly once regardless.skip-changeset: the only file touched isscripts/check-cli-command-ids.mjs, a repo-rootgate script that is not part of any published package, so nothing ships to a consumer.
Generated by Claude Code