test(gates): give the two document-count pins an in-file positive control (objectui#7914) - #7943
Merged
Merged
Conversation
…trol (objectui#7914) Both pins read a workflow header that carries no count today, so each asserted `[] toEqual []` exactly once. They passed, and they would have passed identically with the pattern deleted, reversed, or narrowed back to adjacency — which is why objectui#7888 had to demonstrate its own widening out of band, in a PR description this repository does not hold. Carries the third copy's control block (`check-links-workflow.test.ts`, objectui#7825) onto both twins verbatim in structure: a `rotted` array asserted `not.toEqual([])` and a `legitimate` array asserted `toEqual([])`. The pattern is lifted to module scope so the pin and its control read one definition rather than two that can drift; its source is unchanged character for character, and all three copies still hold one identical pattern. Fixtures include numbers that are CORRECT TODAY (the gates print 227 document(s) and 188 doc file(s)) and are rejected anyway — the rule governs the writing, not one wrong figure — and the measured false positive of the pre-objectui#7888 pattern, which read `#7448 documents the rule` as `["7448 documents"]`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3
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 free
to 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 #7914
Clause-②: no— the fixtures live inside the two test files. No schema accept/reject behaviour moves, and no gate's scanned population moves: nothing here is a new scan surface.The defect, reproduced
Both count pins read a workflow header that carries no document count today, so each asserted
[] toEqual []exactly once. They passed — and they would have passed identically with the pattern deleted, reversed, or narrowed back to adjacency. That is why objectui#7888 had to demonstrate its own widening out of band, in a pull request description this repository does not hold.This is not inferred. In every ablation below the two pins (
its header states the population and never counts it) stayed green while the pattern was broken underneath them. Only the two new controls went red.The shape carried, not invented
scripts/__tests__/check-links-workflow.test.ts— the third copy — already carries this control: arottedarray assertednot.toEqual([])and alegitimatearray assertedtoEqual([]). That block is carried onto both twins verbatim in structure, naming and assertion wording. That file is not touched; neither is any workflow header, nor either gate script.The pattern is lifted to module scope (
POPULATION_COUNT+documentCounts, the third copy's names) so each pin and its control read one definition rather than two free to drift. Its source is unchanged character for character:One distinct pattern across all three copies, before and after.
NOTBEHINDabove stands in for the two characters that open a negative lookbehind. They are spelled as a placeholder on purpose: GitHub's body sanitizer strips that byte pair even inside a fenced code block, so writing the literal here would have published a different regex than the one in the files — which this pull request read back and caught after its first publish. Read the real literal in the source; it is byte-identical in all three copies.Every control proves it can fail — three directions, both files
Each direction mutates the pattern in both test files at once, proves the mutation landed on disk (anchor count 1 to 0, injected marker present, non-empty
git diff --stat), runs vitest from the repo root, then restores. Exit codes captured by redirect-then-read, never through a pipe.(?:[A-Za-z][\w-]*\s+){0,2}— the objectui#7888 regressionNOTBEHINDabove) — the false-positive directionEach failure names the pin and the surface it reads, not merely
expected [] to deeply equal [...]:The lookbehind figure
[ '7448 documents' ]is the exact false positive objectui#7914 reported, reproduced here rather than quoted. Measured against the pre-objectui#7888 pattern recovered from797b39f68^:Both halves of objectui#7888's finding, in one reading: the old pattern invented a count from an issue reference, and missed a real one behind a single adjective.
Restores, proven by state — never by an exit code
Restore is
git checkout HEAD -- ABSOLUTE_PATH(never a baregit checkout -- PATH, which reads the index the first checkout just wrote), driven from atrap ... EXIT INT TERMwithREPO_ROOTresolved absolutely before any mutation. After each of the three directions:Identical blob hashes after all three, and
git status --porcelainempty at the end.The direction that matters most: a number that is CORRECT TODAY
A control that only rejects stale figures waves the same trap through on the day the figure happens to be right — which is the day it starts rotting. Both gates were run to get their live verdict lines, and those live numbers are fixtured as rotted:
Applying the pattern read back out of the committed file:
227and188are exactly right today and are rejected anyway. The rule governs the writing, not one wrong number. The adjacency ablation lands its fence-side failure on this very fixture, so the claim is enforced, not merely stated.Readings — all at
403755fd4, the final commitnpx vitest run scripts/__tests__RUN v4.1.10 /home/user/objectui-issue-7914— 107 test files, 3222 tests passed, 180.73stsc -p tsconfig.scripts.json --listFilespnpm lint:rootpnpm lint:coverage46/46 packages linted, 0 with outstanding errorspnpm type-check:coverage45/46 via type-check, 0 known-broken;42/42 packages compile their testspnpm check:control-bytesscanned 6407 tracked text file(s); skipped 85 binarypnpm check:vi-mock-specifiers4336 tracked source file(s), 2613 test-namedpnpm check:vi-mock-inherit132 call site(s) judged (132 inherit, 0 auto-mocked)pnpm check:shell-escape-residue206 file(s) and 1309 fenced block(s) examinedpnpm check:entry-guard69 scripts/ file(s) — no entry guard outside the baselinepnpm check:doc-fences227 document(s)pnpm check:doc-typesScanned 188 doc file(s)The vitest run is from the repository root —
RUN v4.1.10 /home/user/objectui-issue-7914with 107 files, not apnpm --filterinvocation that would silently runapps/consoleinstead (objectui#3378).pnpm check:skill-examplesreturned EXIT=2 — NOT MEASURED, neither red nor green. Its own words:PRECONDITION NOT MET (exit 2) — the example program was NOT run: the packages it resolves against are not built. It is outside this diff's gate family in any case: this change adds noskills/content, and the only link between them is a prose mention of this file's name in a comment insidecheck-skill-examples.test.ts, which passed as part of the 107-file run.Changeset
node scripts/check-changeset-presence.mjs— EXIT=0, quoted verbatim rather than reasoned about:No changeset is owed — not even an empty one.
Scope
Two files,
scripts/__tests__/check-doc-fence-languages.test.tsandscripts/__tests__/check-doc-component-types.test.ts. No workflow header, no gate script, and no edit to the third copy. objectui#7901, the coverage half, is out of scope here and remains open — it was deliberately sequenced behind this card so its census is computed with an instrument that can now be shown to go red.Worked by an os-dev agent seat, session
https://claude.ai/code/session_01KbJQ1y1J12nZxYzFWhP8Q3.Generated by Claude Code
Generated by Claude Code