You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
finding(test-infra): check-vi-mock-inherit's anti-exemption pin reddens on its own header PROSE — naming a swept test file in the docblock matches its exemption-array pattern #8117
Surfaced while sweeping @object-ui/plugin-form for #6892 (slice 5, PR #8116). Filed unassigned, deliberately not fixed there — changing this pin's assertion is a change to a gate's own test, not part of a specifier sweep.
What was measured
scripts/__tests__/check-vi-mock-inherit.test.ts carries the assertion that keeps the exemption swamp out:
there is NO per-file exception list anywhere in the gate
It implements that by reading the whole of scripts/check-vi-mock-inherit.mjs as text and asserting it does not match
/\.test\.tsx?['"`]\s*[,\]]/
i.e. "a quoted string ending in .test.ts or .test.tsx, followed by a comma or a closing bracket" — the shape a hand-written array of exempt file paths would have.
The character class includes the backtick, and the file it scans is a gate whose header docblock is, by design, the ledger every slice of #6892 writes its sweep into. Naming a converted test file the way that docblock names everything else —
* `ObjectView.expandFls-7429.test.tsx`, landed by objectui#7429
— matches the pattern exactly. The pin goes red on prose, with a diff that shows the entire 900-line source as the "received" value and no indication of which line did it.
Measured on PR #8116: the pin passed at 69 of 69, then a one-sentence header record naming a swept file reddened it. Rewriting the comma as an em dash made it green again, with no change to the gate's behaviour, no change to the assertion, and no change to what the assertion is actually about.
The failure is unreadable. The assertion is not.toMatch, so the report prints the whole scanned source as "received" and never says where the match was. Locating it needs a separate grep -nP with the pattern copied out of the test by hand.
The direction of the risk is the bad one. A pin that reddens on innocent prose gets weakened by the next person it annoys — which is the same failure mode the gate's own header warns about for exemption tables.
Not a proposal, but the shape of the repair is small
The assertion wants to see code, not comments. The gate already exports the masking helper it uses for exactly this distinction (deJsxClosingTags plus the shared js-comment-mask), and the gate's own scanner blanks comments before it judges anything. Running the pin's regular expression over the comment-blanked source would keep every bit of its teeth against a real exemption array while making the header docblock unreachable. An alternative — asserting on the module's exports rather than its text — is a larger change and probably a worse one, since the point is to catch a literal array someone adds.
Either way this is a decision about a gate's test, so it is filed rather than folded into a sweep.
Surfaced while sweeping
@object-ui/plugin-formfor #6892 (slice 5, PR #8116). Filed unassigned, deliberately not fixed there — changing this pin's assertion is a change to a gate's own test, not part of a specifier sweep.What was measured
scripts/__tests__/check-vi-mock-inherit.test.tscarries the assertion that keeps the exemption swamp out:It implements that by reading the whole of
scripts/check-vi-mock-inherit.mjsas text and asserting it does not matchi.e. "a quoted string ending in
.test.tsor.test.tsx, followed by a comma or a closing bracket" — the shape a hand-written array of exempt file paths would have.The character class includes the backtick, and the file it scans is a gate whose header docblock is, by design, the ledger every slice of #6892 writes its sweep into. Naming a converted test file the way that docblock names everything else —
— matches the pattern exactly. The pin goes red on prose, with a diff that shows the entire 900-line source as the "received" value and no indication of which line did it.
Measured on PR #8116: the pin passed at 69 of 69, then a one-sentence header record naming a swept file reddened it. Rewriting the comma as an em dash made it green again, with no change to the gate's behaviour, no change to the assertion, and no change to what the assertion is actually about.
Why it is worth a card rather than a shrug
vi.mockfactories freeze a workspace package's export surface — the per-specifier sweep worklist #6892 —@object-ui/componentsat 27,@object-ui/plugin-gridat 25,@object-ui/app-shellat 23,@object-ui/permissionsat 23 — will be writing that kind of sentence into that file.not.toMatch, so the report prints the whole scanned source as "received" and never says where the match was. Locating it needs a separategrep -nPwith the pattern copied out of the test by hand.Not a proposal, but the shape of the repair is small
The assertion wants to see code, not comments. The gate already exports the masking helper it uses for exactly this distinction (
deJsxClosingTagsplus the sharedjs-comment-mask), and the gate's own scanner blanks comments before it judges anything. Running the pin's regular expression over the comment-blanked source would keep every bit of its teeth against a real exemption array while making the header docblock unreachable. An alternative — asserting on the module's exports rather than its text — is a larger change and probably a worse one, since the point is to catch a literal array someone adds.Either way this is a decision about a gate's test, so it is filed rather than folded into a sweep.
Generated by Claude Code