Repository navigation
docs(skills): teach BaseSchema in the two published node fences - #8104
Conversation
The published `skills/objectui` tree taught `UIComponent`, a name `@object-ui/types` does not export, in five places. Each becomes `BaseSchema` — the exported object half a renderer receives. The two fenced interface blocks are also made true of what a reader accepts: `hidden` / `disabled` take the boolean-or-ExpressionWire wire `packages/types/src/base.ts` declares, the `events` element type becomes the exported `ActionSchema` (`ActionDef` is `@object-ui/core`'s, not `@object-ui/types`'), `children` keeps the object half with a note that the real slot is wider, and each fence carries one abridged note naming `packages/types/src/base.ts` as the full member list. `props` stays with a comment naming the node kind that reads it (`element:*`). Both files are line-neutral. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox
|
ACCEPT — governed in-seat review of PR #8104, head Implemented-by: Verified in a detached compare worktree at the PR head, not from the report:
Ruling on the open question — A. Out-of-scope finding objectui#8103 ( Landing regime: governed ( Generated by Claude Code |
维护者速读事情:对外发布的 objectui 技能包里有五处把「一个组件节点」叫作 改了什么:五处改名为您裁定的 没动什么: 席位意见:建议合并。受管面( Generated by Claude Code |
Fixes #8065
The published
skills/objectuitree taughtUIComponent— a name@object-ui/typesexports nowhere — in five places. Each becomesBaseSchema, the maintainer's ruled name for "a component node" (ruling 5556352576 on objectui#7434). The two fenced interface blocks additionally take the option-2 ruling recorded on objectui#8092 as amended: the test for a member is not "is it on the TS interface" but "does a real reader accept it on the wire", so a member a reader accepts stays with a comment naming the node kind, and the abridged rest is pointed atpackages/types/src/base.ts.AGENTS.mdrecords that GitHub's body sanitizer eats tag-shaped fragments even inside backticks and fenced blocks; this PR is entirely about type declarations, so a literal rendering would collapse both columns of the tables into the same string and a table written to show a change would read as "nothing changed".Surface
skills/objectui/guides/architecture.mdskills/objectui/rules/protocol.mdLine- or token-pinned in this repo? Measured: no. No ratchet or budget script names either file — the four scripts that mention them (
check-doc-links.mjs,check-skills-paths.test.ts,check-doc-component-types.mjs,check-skill-eval-tokens.mjs) count neither lines nor tokens of them, andscripts/check-skill-eval-tokens.mjsmeasures evalmust_containtokens against the bundle, not file size. Every edit is a one-line-for-one-line replacement anyway, so both files are line-neutral in fact as well as by budget.Governed verdict, quoted from the gate:
⇒ This PR stays a draft. ⛔ Not flipped ready, not enqueued, no auto-merge, no approval sought.
改前 → 改后 —
skills/objectui/guides/architecture.md, fence at 21-47// @object-ui/types— abridged; the full BaseSchema member list is packages/types/src/base.tsinterface UIComponentinterface BaseSchemapackages/types/src/base.ts:70exportsBaseSchema;UIComponentis exported by nothing (0 files underpackages/types/src, live control:BaseSchemain 98)type/idbase.tsdeclares both identicallyVisual properties (mapped directly to Shadcn props)Config envelope — read only by element:* renderers; see rules/protocol.mdpackages/components/src/renderers/basic/readProps.ts:69readsschema.propsfor theelement:*family, called atelements.tsx:76 · 142 · 201 · 369. The other half is stated in the renderer's own source atpackages/react/src/SchemaRenderer.tsx:1519-1528: those keys "are spread as React props and never hoisted onto the node, so a renderer that reads its config fromschema— every family exceptelement:*'sreadProps()— drops them without a word." The old comment taught the opposite and was the trap; the key itself is realbind/classNamebase.ts:248(bind), andclassNameidenticalhidden?: stringhidden?: boolean OR ExpressionWirepackages/types/src/base.ts:376— spelled the way that file spells it.ExpressionWireis a real export (packages/types/src/index.ts:119, declaredpackages/types/src/expression.ts:67as a string OR the CEL envelope object), so the taught line is now a superset-free restatement rather than a narrowingdisabled?: stringdisabled?: boolean OR ExpressionWirepackages/types/src/base.ts:412ActionDefActionSchemaActionDefis@object-ui/core's (declaredpackages/core/src/actions/ActionRunner.ts:113), not@object-ui/types' — and this fence names@object-ui/types.ActionSchemais exported from there:packages/types/src/crud.ts:40, barrelpackages/types/src/index.ts:383. ⛔ The line's semantics are untouched: whether theeventsbag is the action system at all is objectui#7945's open question and is not pre-empted herechildren?: array-of-UIComponentchildren?: array-of-BaseSchemaplus commentobject half; the real slot also admits primitivesBaseSchemafor node-slot positions,SchemaNodeonly where the union is genuinely correct.SchemaNodeis written nowhere new — neither file introduces the name today (git grep -n SchemaNode -- skills/is empty), so the fence keeps the object half and the comment plus the abridged note carry the fact that the real slot (packages/types/src/base.ts:260) is widerschema: UIComponentschema: BaseSchema改前 → 改后 —
skills/objectui/rules/protocol.md, fence at 48-62interface UIComponentinterface BaseSchemaplus trailingabridged — full member list: packages/types/src/base.tspropertiesplus its hoisting commentpackages/react/src/SchemaRenderer.tsx:1057-1068hoists every key of a config-bagpropertiesonto the node (type/idexcepted) before the renderer runs, so every namespace reads it — not a narrower node kind. This file's own 「Rule: Keys Live on the Node」 documents it with a measured table, which is the second half of the amended testpropsplus itselement:*commentelement:* config envelope — NOT a general bag) and the same rule in this file documents ithidden?: stringhidden?: boolean OR ExpressionWirepackages/types/src/base.ts:376disabled?: stringdisabled?: boolean OR ExpressionWirepackages/types/src/base.ts:412ActionDefActionSchemachildren?: array-of-UIComponentchildren?: array-of-BaseSchemaplus commentobject nodes; real slot is widerThe prose above each fence — "Every node in the UI tree follows this shape — enforce it on every input." and "Every UI component node MUST follow this shape:" — stays, and is now true of the lines shown.
Every kept member type-checks as written
Compiled against the built
@object-ui/typesd.ts (pnpm exec tsc --ignoreConfig --noEmit --strict --skipLibCheck --moduleResolution bundler), a program that assigns every member both fences keep onto a realBaseSchema—type·id·properties·props·bind·className·hidden: true·disabledas a template string ·children— plus anExpressionWirein both its string and its CEL-envelope form and a Record from event name to array-of-ActionSchema: exit 0. (propsandpropertiesare admitted byBaseSchema's index signature atpackages/types/src/base.ts:464, which is the TS-side half of why the wire test, not the interface test, is the right one.)The reverse direction is deliberately not claimed, and the compiler says why: assigning a real
BaseSchemato the fence's shape fails withType 'SchemaNode | SchemaNode[]' is not assignable to type 'BaseSchema[] | undefined' — Type 'null' is not assignable. That is the measured narrowing thechildrencomment and the abridged note both declare.Gates — every exit captured before any pipe, on head
d999e94bpnpm check:skill-examplesMarked: 13 ts fence(s) (floor 13), 70 json fence(s) (floor 70)·Semantic phase: 13 of 13 ts fence(s) judged, 0 failed·JSON phase: 70 fence(s) parsed, 0 failed. Marked-fence count before this change: 13 ts / 70 json. After: 13 ts / 70 json — unchanged. Neither edited fence carries the opt-in marker, and none was added (see below)pnpm check:skill-eval-tokensRed under the chosen oracle: 0 (0 beyond the baseline). No eval namesUIComponent: over all 99 distinctmust_containtokens in the 11 eval files, that token does not appear, so this rename edits nothing an eval grades. Reported, not edited, per the dispatchpnpm check:skills-paths88/89 stated path(s) resolve across 20 guide file(s); 1 baselined(unchanged; the newpackages/types/src/base.tsmentions sit inside fences, which that gate reads by design as worked examples rather than prose claims — and the path exists either way)pnpm check:doc-fencesevery TypeScript block in 227 document(s) is fenced ts/tsx/typescriptnode scripts/check-governed-queue-guard.mjs --test PATH PATHnode scripts/check-changeset-presence.mjs2 file(s) changed, 0 of them published source of a package the release covers … ✅ No source or published contract of a released package changed in this range, so no changeset is owed.This repo has noskip-changesetlabel; the gate's own verdict is followed, so no changeset file is addedpnpm exec vitest run scripts/__tests__/component-node-vocabulary-7434.test.tsTest Files 1 passed (1) · Tests 4 passed (4).skills/**is outside that pin's corpus today: its scan surface isDOCS_ROOT = 'content/docs'plus eachpackages/NAME/README.md(scripts/__tests__/component-node-vocabulary-7434.test.ts:78 · 93), and its docblock names onlydocs/**andAGENTS.mdas the load-bearing exclusions. ⛔ Not extended here — that is objectui#8093's subjectpnpm lint(through the shared verify lock, acquired once, held 4m18s, waited 0s)Tasks: 47 successful, 47 total— exit 0. Warnings only, all pre-existingno-explicit-anyin package sourceEvery one of the above was captured as
cmd > FILE 2>&1; EXIT=$?— no exit code was read through a pipe.Why no opt-in marker was added to either fence
The dispatch permits adding one only if the block compiles against the built d.ts and that is shown. It does not, and the measurement is the reason to leave it alone:
node scripts/check-skill-examples.mjs --measure(which judges every candidate, marked or not) reports both fencesFAILon both trees, because each is a bare interface fragment that imports nothing — before this change withTS2304: Cannot find name 'ActionDef'and'UIComponent', after it withTS2304: Cannot find name 'ExpressionWire'and'ActionSchema'. The difference matters and is the point of the change: the pre-change names could not be imported from@object-ui/typesat all, while all three post-change names are real exports of it and resolve the moment an import line exists. Adding that import line to earn a marker would be a net-positive-lines expansion of a governed file, which this flight is not scoped to make.The pre-change measurement was taken by restoring both files to
d3499b31under atrap-guarded restore, confirming the mutation on disk by anchored counts (UIComponent3 + 2,ActionDef1 + 1), running the measurement, and restoring withgit checkout HEAD -- ABSOLUTE_PATH; the restore is proven bygit diff HEADbeing empty and both blob hashes matching the HEAD blobs (dfb1bd49,3d5cf0fa), not by the command's exit code.验收备注
Noted and deliberately not filed — none clears the admission threshold on its own, and each belongs to a card that already exists:
ActionSchemais marked@deprecatedin its own docblock (packages/types/src/crud.ts, "UseUIActionSchema… for new code"). The ruling namedActionSchemaexplicitly and this PR follows it verbatim; the alternative (UIActionSchema) is a semantics choice about what theeventsbag is, which is objectui#7945's question. Recorded so whoever rules that card sees the trade rather than rediscovering it.eventsshape has no reader at all, re-measured on this tree:git grep -nE '\??\.events\b' -- 'packages/*/src' 'apps/*/src'returns nothing, and the onlyeventsmember declared anywhere inpackages/typesisEventableSchema.events(packages/types/src/api-types.ts:282), which is an array ofUIEventHandler— not a Record keyed by event name at all. Both readings are objectui#7945's subject and it ispm:awaiting-maintainer; ⛔ this flight does not pre-empt it, and the line's shape is left exactly as it was apart from the element type.props,eventsand anyActionDefreference". The dispatch's ruling section, written at 15:3xZ after the objectui#8092 amendment, replaces that with the reader test — a member a reader accepts stays with the node kind named. This PR follows the later text. Recorded here so the two do not read as a contradiction in six weeks.packages/types/README.mdandcontent/docs/api/schema-reference.mdwere already repaired by PR docs(types,api): name the component nodeBaseSchemaand pin the vocabulary #8064 and are untouched here.Filed, because it does clear the threshold and is outside this PR's ruled file surface:
skills/objectui/guides/plugin-development.md:219-228teaches a plugin node interface that hand-rollsBaseSchema's members instead of extending it and declareshidden/disabledas plain strings, so a copied declaration refuseshidden: trueand the CEL envelope that the shipped renderer accepts. Same class, fourth surface. Unassigned,findingonly; dedup run over 383 open issues with a live control.维护者速读(草稿)
我们发布给客户和 AI 的技能包里,有两段"每个 UI 节点长什么样"的接口示例。它们教的接口名
UIComponent在真实代码里根本不存在——@object-ui/types从来没有导出过这个名字。也就是说,任何人(尤其是 AI)照着抄,写出来的类型是编译不过去的,而这份技能包恰恰是模型在写 ObjectUI 页面时实际读的那一份。这次把五处名字改成
BaseSchema——维护者在 objectui#7434 上已经拍板的正式名字,也是代码里真实导出的那一个。同时按 objectui#8092 上记录的裁定,把两段接口块里"写着但不成立"的行改成成立的:hidden/disabled原来写成纯字符串,而渲染器实际接受布尔值和 CEL 表达式对象;events里引用的元素类型是另一个包的私有名字,换成了@object-ui/types真正导出的那个。有两个键被留下了,而不是删掉:
props和properties。判据不是"TS 接口上有没有",而是"线上有没有真实的读取方"——properties由渲染器逐键提升到节点上、所有命名空间都读得到;props只有element:*这一族读,其余全族静默丢弃。这两个事实都在代码里逐行核实过(PR 正文列了文件行号),并且把"哪一族读它"写进了注释,所以照抄的人不会再掉进"卡片渲染成空框"那个坑。没有做的三件事,都是刻意的:不动
events这个通道到底是不是动作系统(那是 objectui#7945,正等维护者裁);不把接口扩写成全部二十一个成员(没有门禁看着的接口副本就是漂移发生器,这正是这一族卡要防的事),只加一句"这是节选,完整清单在packages/types/src/base.ts";不给这两段代码块加编译门禁标记(实测它们作为片段编译不过,加标记要先加 import 行,那是给受管文件净增行数)。两个文件都是行数中性的,一行换一行。风险面很小:改的是纯文档,没有任何运行时代码,门禁全绿(含全仓 lint 47/47)。因为命中受管面
skills/**,这个 PR 停在 draft 等人工合并,没有翻 ready、没有入队、没有挂 auto-merge。顺手量到并另立了一张卡(objectui#8103):同一个技能包的插件开发指南里,还有第三段同类的接口示例。席位意见:
🤖 Generated with Claude Code
https://claude.ai/code/session_019RfFHiRCSs3JXLK4cwcfox
Generated by Claude Code