fix(types,docs): refuse actions by name on the page node, teach the shape that draws (objectui#7926) - #8870
Conversation
…he shape that draws
`PageNodeSchema` never declared `actions` and `PageRenderer` never read it, but
`BaseSchema` is `.passthrough()`, so an authored array parsed green and drew
nothing — measured through the real `SchemaRenderer`: 0 buttons for
`actions: [{type:'button',label:'Add Product'}, …]`, 2 for the same buttons in
`body`. Three passages of `content/docs/guide/layout.md` taught that document.
The key is now an ADR-0049 `retirementTombstone` arm carrying the remedy, with
`actions?: never` as its TypeScript twin. One key by name, NOT `.strict()` on the
node: a census of 91 authored `page`-tagged objects (blind spot 8) found only
`actions` and `breadcrumbs` surviving passthrough on a real page node, and
`page-app-dashboard-spec-parity.test.ts` pins the node staying open to unknown
renderer props.
The three passages are rewritten onto `body` and pinned by their RENDERED result,
so "docs edited but still draws nothing" fails. `page:header`'s action-id channel
(objectui#7182) is untouched and asserted still present.
Ruling: objectui#7926 comment 5596252247 (summon #20, decision batch #107 item 2,
option A). B and C refused.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
…ty ledger `page-app-dashboard-spec-parity.test.ts` keeps a ledger of objectui-only keys on `PageNodeSchema` — keys the spec does not declare and BaseSchema does not own — and the refusal arm added for objectui#7926 is one. It went red with `expected [ 'actions' ] to deeply equal []`. Registered rather than exempted, with the distinction spelled out: this is not a local CAPABILITY, it is a local REFUSAL. The behaviour is owned by `page-actions-refusal-7926.test.ts`; this row owns the fact that the key is declared at all. Found by running the tests that READ the edited file, not only the gates of the package that changed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
PM 评审 —— PR #8870(卡 #7926):通过,已翻 ready、auto-merge 已武装
⭐⭐ 「那 23 个不是这个节点上的 23 个键」—— 这一句是整份交付的核心普查在写拒绝之前跑,带盲区读数(91 个 page 节点读到,8 个读不出的站点逐一列名并给理由)。⭐ 一个没有盲区读数的 0 不是测出来的 0 —— 这里给的不是 0,是 8。 然后是关键判断:23 个未声明键活过了 passthrough,但按每个站点「是什么」判定、而不是按它匹配到的 ⇒ 拒绝是「按名字拒绝一个键」,⛔ 不是把节点改成 ⭐ 这正是裁决要求「先普查」的字面理由 ——「so a strict refusal does not take a living key with it」。 普查不是仪式,它当场救下了一条钉子。
⭐⭐ 枚举当场抓到一个失败,而那正是它存在的理由broad leg 跑出: dev 自己的话:「a test that READS the file this PR edited, in a package whose own gates were all green, and it is not a doc gate — the three doc gates run before it are documented as blind to this question.」 ⇒ 这是本班第三次「一条测试读了你改的那个文件」(前两次:PR #8857 被合并队列踢出、PR #8864 的 修法也对:把拒绝臂登记进台账(registered,⛔ 不是 exempted,commit 里写了为什么),然后在最终头上把 两条钉子都在,而且渲染钉是推导出来的渲染钉不硬编码那三段,而是从页面推导(heading 匹配 ⭐ 没有那两个对照,「至少一个按钮」这条断言无法因为它存在的理由而失败。 契约钉子同样带正向对照(同一文档去掉 Clause-②
|
✅ 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
|
…crumbs changeset to minor Contract-review patch round (PR comment 5611939627, objectui#8871), F1-F4, docs/changeset/comments only: - F1: "two of the three carry no `type`" was wrong for one of the two undercounted sites. `layout.md:207`'s literal DOES carry `type: 'page'` — it was missed because it sits inside a markdown `typescript` fence, a fence language PR #8870's census (json fences + TS/TSX AST + raw JSON files) never reads, not because it lacks a `type` key. `:676` was already correctly described (a `json`-fenced, untagged fragment). Corrected in all six locations: the PR body, this changeset, both `layout.zod.ts` docblocks, and both refusal test docblocks. - F2: changeset bump corrected `patch` -> `minor` per the PM's ruling — this card carries `Clause-2: yes`, unlike objectui#7926's `Clause-2: no`, so its `patch` does not transfer. Cites the precedents that share this card's clause-2 reading instead (objectui#5905 both changesets, #4919, #5453 — all `minor`). Also adds the TS-face clause: `tsc` previously accepted `breadcrumbs` too, through `BaseSchema`'s `[key: string]: any` (base.ts:467), before this narrowed both faces together. - F3: `\.breadcrumb\b`'s stale "10 files" control number re-measured at head: 16 files tree-wide, 13 under `packages/`. The pin itself asserts `> 3`, so it was never at risk — only the prose was stale. - F4: confirmed `page-app-dashboard-spec-parity.test.ts`'s pin now sits at `:229` (was `:203`), present and passing; no file this round controls cited the stale line number. No schema face, assertion or behaviour moved — verified by diff (every changed line in the two zod/test files is inside a `/** ... */` comment). `check:doc-fences` ledger unchanged before/after (227 docs, 80 files / 89 blocks, exit 0) since none of the touched files fall under its scan population. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
…the census blind spot correctly (objectui#8871) Second patch round on the contract-review record (PR comment 5612273040). Comments, docblocks and changeset prose only: over layout.ts, zod/layout.zod.ts and page-breadcrumbs-refusal-8871.test.ts, changed lines that are not comment lines = 0 (grep exit 1), against a firing control of 35 changed lines in the two source files. F1 - the seventh site. The body of 'no passage authors or declares breadcrumbs any more' still said objectui#7926's census "filtered on type: 'page'" and that the Schema API block "declared the member with no type in scope". Re-verified on the base: guide/layout.md:199 opens a ```typescript fence, :201 IS type: 'page', :207 declares the member and the fence closes :225 - so that block was invisible to the census by FENCE LANGUAGE, not by a missing type key. :680/:682 is the json-fenced fragment that never writes type; :533/:535/:537 is the one site both instruments see. PR #8870's own body states the population: every git-tracked JSON file, every json fence in .md/.mdx, every TS/TSX object literal via the TypeScript AST. A wrap-tolerant sweep over all 7198 tracked files finds no eighth site: five fingerprints of the wrong claim, one file each before, zero after, with the corrected phrase as a firing control at 19 files / 27 occurrences unchanged and an impossible token silent at 0. F3 - the frame. Round 1 pasted a head reading into base-framed sentences and left layout.ts at the old number, so the twin faces disagreed. Re-derived, exit codes captured before any pipe: on base 93127bd, \.breadcrumbs is exit 1 tree-wide against 12 files (10 under packages/) for \.breadcrumb\b; at head those read 16 and 13 and \.breadcrumbs turns exit 0 over 4 files / 6 lines, every hit one of this branch's own four files quoting the probe string; the tree-scoped pin's eight exclusions put head back at exit 1. All four sites now state the frame in one sentence. No assertion changed. F2 - the precedent list. Read at source: objectui#5905 carries an explicit Clause-②: yes and both its changesets are minor; objectui#4919 (minor) has no Clause-② spelling anywhere and its card pre-dates that spelling; objectui#5453 (minor) has no declaration and its own ACCEPT record measured the narrowing as "not consumer-visible". The changeset now credits #5905 alone for the clause reading and the other two for the level only. The minor level does not move. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Jmxdo7bmeqCQHLSfmLVX9w
Fixes #7926
Maintainer ruling 5596252247 (director seat, summon #20, decision batch #107 item 2, verbatim
「其他同意」) → option A. Two steps, one card: the layout guide teaches the shape that
draws, and the
pagenode refuses the undeclaredactionskey instead of lettingBaseSchema's.passthrough()carry it to a wrapper that draws nothing. B (declare +render — a fourth
actionsshape) and C (docs only, schema keeps swallowing it) wererefused and are not reopened here.
What was wrong
PageNodeSchemanever declaredactions;PageRenderernever read it.git grep -ni action packages/components/src/renderers/layout/page.tsxreturns only thePageVariableActionBridgeimport and its render — with
schema.title/schema.pageType(3 hits, same file) as the litcontrol. Through the real
SchemaRenderer, apagenode carryingactions: [{type:'button',label:'Add Product'}, …]drew 0 buttons and the label appearednowhere in the DOM; the SAME two buttons in
bodydrew 2. Three passages ofcontent/docs/guide/layout.mdtaught exactly that document.What changed
packages/types/src/zod/layout.zod.tsPageNodeSchema.actionsis now an ADR-0049retirementTombstonearm — refused by name, with the remedy in the messagepackages/types/src/layout.tsactions?: never, sotscrefuses it at the authoring sitecontent/docs/guide/layout.mdbody; theSchema APIblock's phantomactions?: SchemaNode[]row removedpackages/types/src/__tests__/page-actions-refusal-7926.test.tspackages/components/src/__tests__/guide-layout-page-buttons-7926.test.tsx.changeset/7926-page-node-refuses-actions.md@object-ui/types: patch(accept-set change)⭐ The census came first, as the ruling required
Measured on
8fda00905BEFORE the refusal was written, over every git-tracked JSON file, every```jsonfence in.md/.mdx, and every TS/TSX object literal (TypeScript AST, so keys areread rather than grepped):
type: 'page'string it matches, only two undeclared keys sit on a real SDUIpageNODE:actions— 3 sites, all of them thelayout.mdpassages this PR rewrites. (The card said"three passages"; a raw grep for
"actions"on that file returns four, and:257is"actions": ["edit", "delete"]on apage-headernode — the READ action-id channel,objectui#7182. It is untouched, and the contract pin's lit control asserts it is still there.)
breadcrumbs— 1 site. No reader either (git grep '\.breadcrumbs' packages/→ 0, exit 1,with
breadcrumbsingular at 5 read sites as the firing control). objectui#7926 does not ruleon it, so it still parses; see 验收备注.
Every other key belongs to a different declaration that merely spells
type: 'page': navitems (
pageName,href,badge,labelKey,requiredPermissions), specpageLIST VIEWS(
pageName+ emptycolumns),registerMetadataResourcerows (domain,listColumns,anchors,create*). None of them is parsed byPageNodeSchema.⇒ The refusal is one key by name, ⛔ not
.strict()on the node.page-app-dashboard-spec-parity.test.ts:203pins the node staying open ("the component envelopestill passes unknown renderer props through"); a strict node would have taken that living pin
with it. The contract pin restates the fact from this card's side.
Pins (the two the ruling names)
page-actions-refusal-7926.test.ts: the key is declared (anundeclared key on a passthrough object is kept in silence, which was the whole defect), the
issue lands at path
actions, and the message carriesbody+page:headerrather thanzod's generic
expected never. Positive control: the same document withoutactionsparses green.
guide-layout-page-buttons-7926.test.tsx: the three passages areDERIVED from the page (sections whose heading matches
/action/icarrying atype: "page"fence), rendered through the real
SchemaRendererand the real renderers, and each must drawat least one button whose text is non-empty; the labels the passages teach (
Add Product,Export,Edit,Delete,New Order) must reach the DOM. Live controls both ways: theretired shape draws
[]and does not containAdd Product; the same two buttons inbodydraw both. Without those, "at least one button" could not fail for the reason it exists.
Tests and gates — the enumeration, not just "the package I changed"
content/docs/**is onci.yml's exclusion list for the full-run decision onpull_request, so a green PR page is not evidence these ran. They were run here.Files touched →
content/docs/guide/layout.md,packages/types/src/zod/layout.zod.ts,packages/types/src/layout.ts, plus two new pins and one comment correction inpackages/components/src/__tests__/page-dom-leak-whitelist-7933.test.tsx.Readers of
content/docs/guide/layout.md, derived bygit grep -ln 'guide/layout'— allrun:
packages/layout/src/__tests__/{guide-layout-app-shell-doc, guide-layout-sidebar-nav-doc, app-shell-branding-title-surfaces, app-shell-not-a-component-key, readme-registration-keys},scripts/__tests__/{component-node-vocabulary-7434, doc-version-claims},scripts/check-doc-snippet-types.mjs.Readers of the whole
content/docstree — also run:packages/types/src/__tests__/action-callback-retired-7068,packages/core/src/registry/__tests__/component-deprecation-declaration,packages/core/src/evaluator/__tests__/rowPredicateCanon.schemaCatalog,packages/react/src/__tests__/LazyPluginLoader.jsdocExample,packages/plugin-dashboard/src/__tests__/readme-dashboard-examples-spec-valid,examples/schema-catalog/test/deprecated-component-types,packages/vscode-extension/src/__tests__/export-to-react-preamble, and the wholescripts/__tests__/suite (which owns every doc gate's own tests).Readers of the types layout mirror — the whole
packages/typessuite, which is wherezod-mirror-parity,page-app-dashboard-spec-parity,layout-default-jsdoc-7361,strict-authoring-face-8345andundeclared-but-consumed-keys-6150live.Declared narrowing
packages/components' full suite was not run; its source diff is zero bytes (the onlycomponents file added is a new test), so no existing components test can change verdict from
this PR's components diff. What can move is the doc file and the types accept-set, so the
components legs actually run are: the new pin,
page-dom-leak-whitelist-7933andtext-variant-align-6942(the only two components tests that reachPageNodeSchema/safeValidateSchema), the seven components tests that readcontent/docs, and all ofpackages/components/src/renderers/layout/. Full farm is CI's.pnpm lint(eslint . --no-inline-config) is CI's repo-level run. A targeted run over the fourchanged source files: 4 files, 0 errors, 0 warnings, exit 0.
eslint.config.jsdeclares noparserOptions.project/projectService(0 occurrences), i.e. type-aware linting is off,so this diff cannot move the verdict of any file it did not touch.
What actually ran, and what it said
All at
353997f51unless noted.⭐ That failure is the whole point of the enumeration. It is a test that READS the file this PR
edited, in a package whose own gates were all green, and it is not a doc gate — the three doc
gates run before it are documented as blind to this question. It is fixed in
353997f51byregistering the refusal arm in the ledger (registered, not exempted — the commit says why), and
packages/types/was then re-run whole at the final head: 163 files, 3193 tests, all passed. Thenon-types legs of the broad run were not re-run, because the ledger commit changes one test file
inside
packages/typesand nothing outside it.Also run: a control-byte self-scan over every file in the diff
(
grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]'→ exit 1, clean) beyondcheck:control-bytes.Ablation — from the committed tree, proven on disk, restored by state
scripts/ablation-dist-preflight.mjsis an objectstack script and does not exist here, so theequivalent is spelled out and the no-rebuild claim is argued rather than assumed: the pin imports
../zod/layout.zod.js, a RELATIVE specifier inside the same package, so vitest resolves it fromSOURCE and no
dist/copy stands between the mutation and the run. The script carriestrap restore EXIT INT TERMwith an ABSOLUTE path derived fromgit rev-parse --show-toplevel,and restores with
git checkout HEAD -- PATH(⛔ never a baregit checkout --, which takes theindex the mutation may have polluted).
⭐ The 8 that stayed green are the point of the split: removing the schema refusal does not move
the docs, the positive control, or the
body-remedy leg — so the three that went red nameexactly the mechanism removed, and nothing broader.
One bounded in-place correction
packages/components/src/__tests__/page-dom-leak-whitelist-7933.test.tsx's docblock stated"
actionsis declared nowhere onPageNodeSchema" and "Whetherpageshould ever GROW anactionsread point is a separate, open capability question (objectui#7926)". This PR makesboth sentences false, so they are corrected in the same change rather than left as a false
claim pointing at this card. The correction is comment-only (
git diffon that file touches noexecutable line), and it adds the reason the sibling pin is still exactly right: it RENDERS
rather than parses, so it keeps measuring the DOM outcome for a document the validator now
rejects — a host can hand
SchemaRenderera node that never went throughsafeParse.Clause-② — measured
no, not inheritedThe ruling says
no— a pull-back to the already-declaredPageNodeSchema.Probed rather than quoted:
Zero new exports; the barrels and the manifest are byte-identical.
PAGE_ACTIONS_REFUSALismodule-local. The only surface movement is a member on an already-published schema going from
"undeclared but accepted" to "declared and refused" — a narrowing, which is the shape the ruling
described. ⇒
Clause-②: no, and noneeds:contract-reviewlabel is owed.验收备注 — out of scope, filed or reported
PageNodeSchema.bodyis array-only while its only reader accepts an object. Measured:PageNodeSchema.safeParse({type:'page', body:{type:'container',…}})→Invalid input: expected array, received object, whileFlatContent(page.tsx:266) readsArray.isArray(content) ? content : [content]and renders it. Four fences on this very pagestill teach the object form. Already filed — objectui#8310, open (found by a targeted REST
read over the 100 most recent
package: typescards, numbers 8037-8865). ⛔ Not fixed here: the threepassages this card owns were rewritten onto the array form, the others are objectui#8310's.
breadcrumbson thepagenode has no reader. Same class as this card, one surface over.git grep '\.breadcrumbs' packages/→ 0 (exit 1), firing controlbreadcrumbsingular → 5read sites. It is authored once, in this page's "Detail Page with Actions" fence, and declared
in the
Schema APIblock. Not filed: a dedup read that could reach the card range where aprior filing would sit was not available at this seat — both targeted REST windows (100 rows
each) stop above number 8037, and the known-hit control (this card itself) fell outside both. Handed to
the PM to file rather than filed blind. ⛔ Deliberately left parsing, and the contract pin says
so out loud so a later retirement is a decision rather than an accident.
actionType: "editRecord"/"deleteRecord"are not inaction:button's registeredinputsenum (['script','url','modal','flow','api']). Pre-existing on the passage this cardmoved verbatim; noted, not filed — no reproduction beyond the enum mismatch was attempted.
Fences honoured
⛔
page:header's action-id channel (objectui#7182) untouched — and asserted still present.⛔ objectui#7469 (app node) and objectui#7693 (alert-dialog fixtures) untouched.
⛔ No other node gained a strict refusal.
🤖 Generated with Claude Code
https://claude.ai/code/session_01611D6ZaRaMmwTNQmSbk8MH
Generated by Claude Code