test(types): pin the filter-builder doc WIDENING, seeded from the doc itself (objectui#8774) - #9069
Conversation
…a copy of it After objectui#7562 the published doc (`content/docs/components/complex/filter-builder.mdx`) is the AUTHORITY for this authoring surface, but the pins bound the enum to a hard-coded `DOCUMENTED_FOURTEEN` constant and the doc-reading pin asserted only doc superset-of fourteen. Of the two ways the authority can move, one was guarded and one was not: - doc NARROWS (a member removed) -> the superset pin reddens. - doc WIDENS (a member added) -> nothing reddened. Widening is the direction objectui#7562 came from: the doc published fourteen members while the mirror accepted seven, and no instrument said so. Measured by the ceiling reviewer's ablation Leg E, not reasoned. The population is now TAKEN from the doc (`documentedTypes()` parses the `type?:` union out of the doc's `interface FilterField` block), so `the accept set is EXACTLY the published doc` compares the enum against the authority rather than against a copy of it, and fails in both directions with a direction-specific message. A doc-seeded pin has its own failure mode -- a reader that silently matches nothing turns the pin vacuous in the same stroke -- so every reader throws on absence, and a floor test drives both throws with the doc's own two-member `logic` union as its positive control. No accept set moves: doc and mirror were measured to agree on all fourteen members, in both directions, before and after. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
Contract reviewPR #9069 · card #8774 · round 1 · 2 changed files · head reviewed Charter read from objectstack Arbiter applied: 「我们的项目以 objectstack 协议为准,文档应该以实际实现为准。协议不正确的应该先修改协议。」 — with the card-specific wrinkle that director ruling batch #88 made Every reading below was taken in a fresh clone of the head ( ① Derived judgments, one by one
② Semver against the changeset
③ Dev flags,
|
Provenance — carriers cleared, landingClause-② contract review: Reviewer ran at Independence — NOT self-review: Eighth reviewer today to read the same-session test from the charter text, again stating plainly that both subagents share the parent session and that independence rests on context isolation plus tier.
|
| check | reading |
|---|---|
| ① in-seat clause-② review PASS on record, 同形, ceiling tier | ✅ record 5626314039 on the head |
② check-clause2-carriers.mjs --pair 9069 |
rc 0 — both carriers agree |
② check-widening-tells.mjs --declaration yes --files |
rc 0 |
| ③ every check on the head, ⛔ not a required subset | 35 check runs, 32 success + 3 skipped, 0 failed, 0 pending; total_count 35 = array length 35 |
| governed surface | --pr objectstack-ai/objectui#9069 → 0 of 2 paths hit the register ⇒ NOT governed |
| mergeability | mergeable: true, mergeable_state: clean |
⭐ The reviewer tested the direction the dev had not, and falsified two claims
- The mirror-only mutation. The dev proved a doc-only widening reddens. The reviewer ran the opposite — widening the mirror past the doc (zod blob
41a9ec1e→268c3bc0) — RED, with the message "mirror widened past the authority". Both directions now measured. - Falsified (item 6): the
logiccontrol is a single-line union, so it cannot catch a first-line-only reader, which is what the docblock claims it guards. Wrong as stated; harmless in effect, because that failure mode is caught by the zero-members throw plus the equality pin (measured RED 3/44). - Inaccurate (item 7):
docUnionMembersstrips comments after locating the;, so a;inside a union-row comment truncates the parse to 8 members and produces a misleading "mirror widened" diagnosis. Fails loud and in the safe direction, but the diagnosis lies. - Miscount (item 11): "three new tests" is two new plus one rewritten (
it(21→23).
It also re-derived the member sets with its own independent fence-scoped parser: DOC = ZOD = TS = the same 14 in the same order, all four set differences empty, zero duplicates — and reproduced the changeset census exactly (60 commits / 61 changesets / 60 empty / 1 named outlier).
⚖️ On my own Clause-②: yes
The reviewer judged it over-conservative and correct: check-widening-tells --declaration no on this diff returns NOT MEASURED (no declared surface covers tests or changesets), so the yes bought the only coverage available. That is the right reading of a routing bit, and it settles the question I raised in the claim comment.
The three owed corrections — ⛔ not ridden in
All three are non-blocking and the charter gives this seat two moves on a subagent verdict: adopt verbatim, or void entirely. A repair round would move the head and void a PASS in order to fix a docblock sentence and a parser edge case. ⇒ Adopted and landing, with the three filed as a follow-up card so item 7 in particular — a real weakness in the new reader, not just prose — does not disappear with this thread.
Both carriers stripped in this same act; PR flipped ready and enqueued. ⛔ Base is not hand-merged.
Generated by Claude Code
|
Fixes #8774
The gap
Director ruling batch #88 (objectui#7562) made
content/docs/components/complex/filter-builder.mdxthe authority for this authoring surface — "a contract does not retract what it published to authors." PR #8766 aligned the zod mirror and the TS twin to its fourteentypemembers. But the pins bound the enum to a hard-codedDOCUMENTED_FOURTEENconstant, and the doc-reading pin asserted only doc ⊇ fourteen. Of the two ways the authority can move, one was guarded and one was not:Widening is the direction objectui#7562 came from: the doc published fourteen while the mirror accepted seven, and no instrument said so.
The change
One file —
packages/types/src/__tests__/filter-builder-mirror-6939.test.ts— plus its changeset.documentedTypes()parses thetype?:union out of the doc'sinterface FilterFieldblock. The population is taken from the authority, never copied beside it. A list maintained in the pin file can only ever confirm the mirror it was copied from, which is the failure mode being fixed. The hard-codedDOCUMENTED_FOURTEENis gone; the literal fourteen still exist in the file asRULED+select+DOC_ONLY_TYPES, which is the doc ⊇ pin's floor, and in theexpectTypeannotation on the TS twin.the accept set is EXACTLY the published doc, member for membernow compares the enum against that population and fails in both directions, each with its own message: the doc growing a member the mirror refuses says the doc is the authority and the mirror follows, as its own reviewable change — do not narrow the doc; the mirror growing a member the doc never published says the mirror widened past the authority.every member the published doc offers, the mirror ACCEPTS— the behavioural half..optionsis introspection of the enum; this is a realsafeParseper doc-published member.the doc reader has a floor— a doc-seeded pin has its own failure mode: the reader silently matches nothing and the two pins above go vacuous in the same stroke that made them doc-driven. Three legs: the doc's own two-memberlogicunion as the positive control, a non-empty and duplicate-free population, and both "block renamed" / "key renamed" paths asserted to throw rather than return an empty set.Leg E, reproduced as the firing control
Run against the final head
db804c0c8, doc mutated on disk and hash-verified, restored and the restore proved.The failure message the firing leg printed:
Why each control can fire in the region it tests. The negative control is the same mutation against the previous instrument, so it measures the instrument and not the mutation — and it came back green, which is the hole. The firing control is a doc-only change in exactly the direction the new pin claims to catch. The floor's positive control is the same reader over a different block whose answer is fixed by the ruling at exactly two members, so a reader that matched nothing, matched the wrong interface, or stopped at the first line of a multi-line union returns something that is not
['and','or']; it is independent of thetype?:block it vouches for, so the thing being measured cannot be what satisfies it.Second ablation — the floor itself. Renaming
interface FilterFieldin the doc (blob0384d4e→b339a04, restored,git diff HEAD0 lines) turned the run red withError: content/docs/…/filter-builder.mdx: no \interface FilterField {` block` — 3 failed | 41 passed. A vacuous reader would have left that green.The doc-vs-mirror reading, run for real
No divergence today. Doc 14, mirror 14,
doc \ mirrorempty andmirror \ docempty. So the stop-and-report branch does not apply and nothing was widened, narrowed or edited on either face. The doc file is byte-identical atBASEand atHEAD(blob0384d4e2511a4a0acd1b4b233c65f36120a367d5both) — this PR does not touch it.Changeset level, from this repo's own precedent
.changeset/8774-filter-builder-doc-widening-pin.md, empty frontmatter — declared as releasing nothing.Measured rather than assumed. Over the last 1200 commits touching
packages/*/src/__tests__/*, 60 commits changed nothing but test files under a packagesrc/plus their changeset. 60 of the 61 changesets they carried had empty frontmatter; exactly one declared a bump —.changeset/7344-handler-string-any-mirrors.md(@object-ui/types: minor), whose own text says "The accept set of published validators moves", i.e. its level was set by a published move, not by the test file. That discriminator is exactly what is absent here: no accept set moves.The closest precedent by content is
.changeset/8458-parity-header-pairs-figure.md— same package, same directory, same reasoning, quoted: "It sits undersrc/, so the presence gate counts it, but nothing published moves: the package's buildtsconfig.jsonexcludes**/__tests__/**and itsfileslist isdistonly, so the file never reaches a consumer." Both halves re-derived on my own base:packages/types/tsconfig.jsonexcludecontains**/__tests__/**, andfilesis["dist", "README.md", "CHANGELOG.md", "LICENSE"].The gate agrees, in its own words:
✅ … Every one of them has an EMPTY frontmatter — declared as releasing nothing, which is the explicit exemption and a complete answer to this gate.The rule is also the gate's own header: "No carve-out for test files undersrc/. A change confined tosrc/__tests__/is answered by the empty-frontmatter exemption, in one line."Tests
pnpm exec vitest run packages/types/src/__tests__/filter-builder-mirror-6939.test.ts--reporter=verbosepnpm exec vitest run packages/types/underos-verify-lock.shVERDICT command-exit 0— 171 files, 3370 passedpnpm --filter @object-ui/types run type-checktsc -p tsconfig.test.json --listFilesnames this file among 637 program files, so the green covers itpnpm exec eslint --format json <the pin file>errorCount: 0,warningCount: 0— counts read from the JSON report, not from grepped textcheck:control-bytesnode scripts/check-control-bytes.mjsgrep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'on both changed filescheck:changeset-presencenode scripts/check-changeset-presence.mjscheck:changeset-no-majornode scripts/check-changeset-no-major.mjscheck:new-line-citationsnode scripts/check-new-cross-file-line-citations.mjsnode scripts/check-governed-queue-guard.mjs --teston both pathsEvery
rcabove was captured to a file before any pipe. The repo-widepnpm lint/ fullpnpm testare CI's runs, not narrowed away here.One boundary, stated rather than left as an absence
The remedy this pin prints — the doc is the authority, so the mirror follows — has exactly one exception, and it is written into the message: a spelling a later ruling retired from this doc (the way objectui#4814 retired
owner) reappearing in it is a doc regression, not a widening, and the doc edit is what gets reverted. Worth knowing thatpackages/types/src/__tests__/owner-retired-contract-twins.test.tsnames the three shrunk doc unions in prose only and reads no.mdxat runtime, so before this PR nothing pinned the doc half of that retirement for this page. It does now, as a side effect:'owner'returning to the doc reddens the new equality pin.Scope
⛔ Not re-litigating batch #88. ⛔ No accept set moves, neither face of the mirror was touched, and the doc was not edited. ⛔ The PR stays draft — landing is the seat's act.
needs:contract-reviewis hung to match the card's carrier.🤖 Generated with Claude Code
https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
Generated by Claude Code