chore(scripts): retire the deJsxClosingTags workaround in check-vi-mock-inherit - #8133
Conversation
…ck-inherit The shared masker `scripts/js-comment-mask.mjs` has known since objectui#6891 (PR #7880) that a `/` whose immediately preceding byte is `<` opens no regex, so this gate's local length-preserving rewrite of JSX closing tags no longer changes any reading. Re-measured on this base rather than trusting the card's older figure: walking all 1763 `vi.mock` call sites in 4380 tracked sources with every specifier judged, the RAW mask (rewrite NOT applied) yields 0 sites whose argument list does not balance; the same walk against a copy of the masker with objectui#6891's rule reverted yields 6 in 6 files, one of them the covered `@object-ui/react` site the header names, so the 0 is a live reading and not a collapsed walk. `pnpm check:vi-mock-inherit` is byte-identical before and after this commit. Removed: `JSX_CLOSING_TAG`, `deJsxClosingTags`, its call in `findCallSites` (a pure substitution -- the rewritten source was only ever the input to `scanSource`/`blank`), the test's import of it, and its two unit cases. The two behavioural cases stay and pass with no rewrite in the gate at all; they are the evidence the removal changed nothing. The header section keeps its measured history in the past tense and now records objectui#6891 as closed -- and states explicitly that only the `<` `/` half is closed, the other half being objectui#7882, still open. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
|
Standing down on
Every other check on Generated by Claude Code |
|
Armed — squash auto-merge enabled and the PR is in the merge queue,
On MERGED: content probe on re-fetched Generated by Claude Code |
|
LANDED — merged at 2026-09-06T18:26:32Z as Content probe on re-fetched
#7883 closed by the Generated by Claude Code |
Fixes #7883
Retires the local
deJsxClosingTagsworkaround inscripts/check-vi-mock-inherit.mjs, now that the shared maskerscripts/js-comment-mask.mjsdecides for itself that a SLASH whose immediately preceding byte is LT opens no regex (objectui#6891, PR #7880).LT,GTandSLASHfor the bracket characters. "the LT-SLASH half" means a slash immediately preceded by a left angle bracket; "a JSX closing tag" is the six-byteLT SLASH div GTform.1. The two re-measurements, re-taken on this base
Base
origin/maine920343de, both readings taken before any edit, because the card's figure was measured oncf7f2af6eand a premise older than the merge is unverified.(a) Raw-mask walk. Two copies of the gate were made outside the tree — one pristine, one with the single line
const dejsxed = deJsxClosingTags(source);replaced byconst dejsxed = source;— and everyvi.mockcall site in the tree was walked through the gate's ownfindCallSites, with the full set of observed specifiers passed ascoveredso that every site reaches the delimiter walk:main)The third row is the control that makes the second row a reading rather than a broken walk. Its six sites are five
@object-ui/componentsmocks underpackages/app-shell/src/console/organizations/__tests__/pluspackages/plugin-dashboard/src/__tests__/ObjectDataTable.cells.test.tsxat line 24 — the covered@object-ui/reactsite the gate's header names by name. The header's historical figure was SEVEN in five files; the tree has moved since, so the header keeps its own number in the past tense and today's control reading is reported here rather than written over it.(b) The gate's verdict, with and without the rewrite.
Both runs print, verbatim:
2. The removal
Gone from
scripts/check-vi-mock-inherit.mjs: theJSX_CLOSING_TAGconstant, thedeJsxClosingTagsexport and its docblock, and the call infindCallSites.The call site was a pure substitution, traced before deleting:
dejsxedhad exactly three uses, all adjacent —scanSource(dejsxed)andblank(dejsxed, comment). It was never returned, never used for an offset of its own, and nothing downstream indexes it; the rewrite was length-preserving precisely so thatmaskedkept indexing the original. So the three lines collapse toscanSource(source)/blank(source, comment).COVERED_SPECIFIERSis untouched, and no other logic in the gate moved. A repo-widegit grepfor both names now returns only three prose mentions, all deliberately past tense.3. The test split
scripts/__tests__/check-vi-mock-inherit.test.ts:neutralises the tag while PRESERVING LENGTH...andleaves a SLASH that is not a closing tag alone..., plus the import ofdeJsxClosingTags.THE CONSEQUENCE: a covered factory returning JSX is READ, not skippedand...and a FROZEN factory returning JSX is still caught. These two are the evidence that the removal changed nothing, so deleting them would have thrown away the removal's own proof.the mis-mask is GONE..., which reads the mask directly on the raw source.describetitle and its docblock now describe the present — the shared masker handles a JSX closing tag itself, this gate rewrites nothing before masking, and these three cases pin that. The pin's "written the other way up ... has been turned over" history stays, in the past tense.4. The header rewrite
The section
## js-comment-mask reads a JSX closing tag as a regex literal(heading spelled with backticks in the source) becomes## js-comment-mask USED to read a JSX closing tag as a regex literal, rewritten to the past tense as measured history. ⛔ Nothing was deleted from it: the seven undelimitable sites in five files, one of them a covered@object-ui/reactsite, and the reason the shared module was fixed all stay. Its closing pointer now marks objectui#6891 as CLOSED and cites its pull request, number 7880, instead of pointing at it as an open filing. (Written that way round on purpose: a closing keyword sitting immediately before a hash-number reference is what the merge-time parser acts on, and only the first line of this body is meant to close anything.)objectui#8117 was checked, since it is a reader of exactly this rewrite: the anti-exemption pin reddens on a quoted string ending in a test-file extension followed by a comma or a closing bracket, backticks included. The header's one such name is still in parentheses, so the pin is unaffected — re-run explicitly (
there is NO per-file exception list anywhere in the gate, 1 passed) and the pin's own pattern applied by hand to the new gate source returns no match. ⛔ The pin's assertion is not touched here.deJsxClosingTagsas an already-exported helper for blanking comments before running the pin's pattern. That helper no longer exists after this PR. The rest of that paragraph is unaffected — the sharedjs-comment-maskis what actually does comment blanking, and it is still exported.5. Positive control — the two behavioural cases are still load-bearing
With the workaround gone, are those two cases still pinning anything, or do they now pass for free? Mutated
scripts/js-comment-mask.mjsin the working tree so the objectui#6891 rule stops firing (probe only — that file is not in this PR's diff):Result, running only those two cases:
Both RED, both for the right reason: the phantom regex swallows the closing parenthesis, so the call site cannot be delimited. Restore was performed under a
trap ... EXIT INT TERMwith absolute paths and is proven, not assumed:Re-run after restore: the same two cases,
2 passed | 65 skipped, exit 0.6. The caveat — ⛔ this PR does not claim the masker is correct on JSX
objectui#6891 closed only the LT-SLASH half. A slash after a right brace or after GT still opens a phantom — the self-closing tag, and a slash in JSX text. That half is objectui#7882 and is still open. The retired rewrite never covered it either (its pattern matched closing tags only), which is exactly why removing it loses no coverage — not because the problem is gone. That statement is now written into the gate's header and into the test's docblock as well, so the next reader of either file gets it without needing this PR.
7. Gates
All run on the final HEAD,
038c5afee. Exit codes captured by redirect-then-capture, never through a pipe.pnpm check:vi-mock-inheritpnpm exec vitest run scripts/__tests__/check-vi-mock-inherit.test.ts scripts/__tests__/js-comment-mask-jsx-6891.test.ts scripts/__tests__/check-vi-mock-specifiers.test.tsTest Files 3 passed (3),Tests 129 passed (129)pnpm exec vitest run scripts/__tests__/Test Files 113 passed (113),Tests 3370 passed (3370)pnpm check:vi-mock-specifierspnpm type-check:scriptspnpm lint:rootpnpm check:control-bytesgrep -naPcontrol-byte self-scan of both changed pathsnode scripts/check-changeset-presence.mjsnode scripts/check-governed-queue-guard.mjs --teston both pathspnpm check:entry-guardpnpm check:unreferenced-sourcesLive E2E (informational)is red on every branch today for an upstream reason (objectui#7990 / objectstack#16186) and is not this PR's.Session reference, as prose so it survives a body edit:
session_01FhBNJcLRZLe8M87VcUgpKr.🤖 Generated with Claude Code
https://claude.ai/code/session_01FhBNJcLRZLe8M87VcUgpKr
Generated by Claude Code