Repository navigation
skills(ui): pages.md Routing model teaches the doc navigation item; eval 4 expects it - #22303
Conversation
… eval 4 expects it
The published skill said "There is no dedicated `doc` nav-item type yet, so
use a `url` item pointing at `/docs/...`" while `@objectstack/spec` declares
the `doc` navigation item (`{ type: 'doc', doc }` / `{ type: 'doc', book }`)
and the console renders it. The Routing model paragraph and its example now
teach the declared item; eval 4's expected output and assertions pin the
`doc` item and refuse the `url` answer. Paid inside the token ratchet by
deleting the former-page-types sentence the Page Types lead restates.
Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CXydFDyiQwNbGFkmwrcRQq
Contract reviewServed-tier: Reviewed in-seat by the skills seat 1 (dispatching seat; this session is served at the contract-review tier, read off ① Derived judgments
② Semver levelNone. Published skill text and one eval; no package content, API or schema. ③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
维护者速读(终稿)席位:skills 席 1, 改了什么:发布给每个客户项目的 Studio 作者技能( 为什么改:技能文本说错一句话就是产品缺陷(北极星第 4 条):入口文件说有 风险与代价(含回滚):发布技能包有 token 棘轮: 席位意见:同意合入,席内契约复核 PASS。席位自己核过:新段落的每个从句都有源码出处(两种目标与两键同给、受众门禁、 你要做的:用授权账号( Generated by Claude Code |
Fixes #22291
Clause-②: no
The Studio author's page skill (
skills/objectstack-ui/rules/pages.md, shipped to every project bynpx skills add) told the author in its Routing model section that "There is no dedicateddocnav-item type yet, so use aurlitem pointing at/docs/NAME", with aurlexample, while@objectstack/specdeclares thedocnavigation item (packages/spec/src/ui/app.zod.ts:108names'doc'inNavItemVariant;DocNavItemSchemaat:715with the contract documented at:676-714), the console renders it at the.objectui-shapina58626c88(packages/layout/src/NavigationRenderer.tsxcase 'doc'at lines 498 and 917,packages/app-shell/src/views/nav-menu-renderer.tsx:281,packages/app-shell/src/hooks/useNavDocTargetCheck.ts), andSKILL.md's Navigation Item Types table already lists it. Eval 4 ofskills/objectstack-ui/evals/views-apps-actions-pages.jsonpinned the wrong answer (type: 'url'pointing at/docs/crm_user_guide). This PR teaches the declared item and makes the eval expect it. #22271 and PR #22287 are landed references (PR #22287 rewrotepages.mdtoday and left 1 token of headroom); objectui#11197 is the console-side reference. None of them is addressed here.Premise re-checked on
origin/mainat238222d8cd(this branch's base, PR #22287's merge commit): the sentence sits atpages.md:361-362(the card read it at line 375 onfbcbcf124f, before PR #22287 moved it), theurlexample at:366, eval 4 unchanged; thedoccontract is at the lines above (the card's:681-686doc comment is now:676-714). Premise valid.What changes (two files, nothing else)
skills/objectstack-ui/rules/pages.md— Routing model: the paragraph becomes "To surface a doc inside an app, add adocnavigation item (aurlitem is for an external or custom URL):doc: 'NAME'opens that page,book: 'BOOK'opens the book at its first readable page (both: that page in that book). It inherits the docs audience gate, andos buildrefuses a target the package lacks (docs/nav-target):" and the example line becomes{ id: 'nav_help', type: 'doc', doc: 'crm_user_guide', label: 'User Guide', icon: 'book-open' }. Every clause is read from the source: the two targets and the both-keys case fromDocNavItemSchema's doc comment andrequiredOneOf(['book', 'doc']); the audience gate from the same comment (ADR-0046 §6.7); the existence check frompackages/cli/src/utils/collect-docs.ts(lintDocNavTargets, ruledocs/nav-target, severityerror); theurlitem's use fromUrlNavItemSchema.url("Target external URL") andSKILL.md's table row ("External or custom URL"). The surrounding true lines (the global/docs/NAMEroute paragraph, the*.mdlink rewriting, the Live instances note) are untouched.skills/objectstack-ui/evals/views-apps-actions-pages.json— eval 4: theexpected_outputtail becomes "surfaced by atype: 'doc'nav item (doc: 'crm_user_guide').";must_containswaps"/docs/"for"type: 'doc'";must_not_containgains"type: 'url'". Measured, not assumed:"/docs/"was a dead assertion —"src/docs/"is in the samemust_containand contains/docs/as a substring, so under the eval README's string-check semantics it could never fail on its own; with thedocitem a correct answer carries no/docs/route at all (the item names the doc, the platform owns the route), so the entry is swapped for the live pin rather than kept beside it (adding instead of swapping would overshoot the eval's 1505 ceiling by 7 bytes). Eval 4's prompt (a record page plus a user guide linked from the nav) needs nourlitem, checked against the whole eval file; evals 1-3 and 5-6 are untouched.Ratchet readings (
scripts/check-skills-token-ratchet.mjs, convention ceil(utf8 bytes / 4); measured on238222d8cdbefore and on this PR's head2bdf0f6317after)skills/objectstack-ui/rules/pages.mdskills/objectstack-ui/evals/views-apps-actions-pages.jsonskills/*/SKILL.md(10 files)skills/objectstack-uiauthored bundle (9 priced files)No ceiling moves, no re-wrap counted (the new paragraph is wrapped once, as new text), no new file. The new Routing block is 477 bytes against the 329 it replaces (+148);
pages.mdhad 6 bytes of headroom, so the difference is paid inside the file by one deletion:pages.md)dashboard,form,record_detail,record_review,overview,blank) were removed from the enum because they never shipped a renderer." (169 bytes)PageTypeSchemahas exactly five values — only types with a dedicated renderer are authorizable (ADR-0049 enforce-or-remove)" — and the five-row table;record_detailstays named in the Disambiguation sentence (eval 4'smust_not_containstill reads it there). The six former names as a list are the one thing not restated verbatim: a tombstone of removed values, not an authoring instruction —PageTypeSchemarefuses any of them at parse with the five legal values in the error. Flagged here for the reviewer.docnav-item type yet, so use aurlitem pointing at/docs/NAME:" and theurlexample linedocexample (the budget the card names)Controls (against the built
@objectstack/specdist at the head;NavigationItemSchema.safeParse){ id: 'nav_help', type: 'doc', doc: 'crm_user_guide', label: 'User Guide', icon: 'book-open' }→success: true, parsed as{"type":"doc","doc":"crm_user_guide",…};book: 'crm_manual'alone → success; both keys → success.docnavigation item needs a target: setbook(opens that book at its first readable page),doc(opens that page), or both (that page in that book's context).";doc: 'docs/crm_user_guide'anddoc: 'crm_user_guide.md'→ "A doc target is a doc NAME — the source filename stem in lowercase snake_case"; aurlkey on adocitem → "Unrecognized key(s) on thisdocnavigation item:url. Did you meanurl→type: 'url' (with url)?".{ type: 'url', url: '/docs/crm_user_guide' }still parses (success: true,target: '_self'defaulted): nothing on the platform refuses it, which is why the skill text was the only thing steering an author to it — the card's responsibility reading holds.docitem to/docs/DOC,/docs/BOOKor/docs/BOOK/DOC(resolveDocHref,NavigationRenderer.tsx:752) and hides an entry whose target the member may not read (nav-menu-renderer.tsx:281).navigation:fragment, not anos:checkblock, socheck:skill-examplesis not its control and was not marked.Gates (derived on this tree by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat2bdf0f6317: 23 families, identical to the PM's list derived on238222d8cd; every exit code captured before any pipe;--ranreconciliation: "23 derived, 23 run, 0 NOT-MEASURED, 0 UNRUN")node scripts/check-skills-token-ratchet.mjs(+--self-test, 65 cases)pnpm check:skill-identifier-liveness·check:skill-compatibility·check:skill-frame-syncpnpm check:doc-authoring·check:corpus-claim-drift·check:nul-bytesnode scripts/check-doc-route-spelling.mjs --advisory(+--self-test)pnpm --filter @objectstack/lint run check:doc-formula-expressionsturbo run build --filter=@objectstack/lint --concurrency=2underscripts/pm/os-verify-lock.sh(VERDICT command-exit 0, 4 tasks, lock held 99 s)node scripts/check-ci-filter-parity.mjs·check-closing-keyword-parity.mjs(+--self-test) ·check-comment-mask-corpus.mjspnpm check:agent-test-spelling·check:cross-package-test-inputs·check:driver-memory-census·check:gitlink-declared·check:pm-governed-merges·check:refd-timer-probe·check:role-word·check:watch-hint-literalNot run locally, CI's own: the type-check lanes and
pnpm lint(no TypeScript or source file moves; the diff is two files underskills/). No changeset: the diff publishes nothing from a released package (skills/**is in no package'sfiles), soskip-changesetis the declaration.Acceptance notes (not filed; carrier named)
"/docs/"in eval 4'smust_containwas subsumed by"src/docs/"(substring), so it had never been able to fail on its own — repaired here by the swap above, recorded so the reviewer can see the mechanism rather than infer it. No other eval in the twoobjectstack-uieval files carries an entry subsumed by a sibling entry (read, not grepped).UrlNavItemSchema.urlis described as "Target external URL" while the console resolves an internal path through it andSKILL.md's table says "External or custom URL" — a describe-text observation with no behaviour behind it; not a finding class, noted only. Carrier: none.维护者速读(草稿)
改了什么 — 发布给每个客户项目的 Studio 作者技能(
skills/objectstack-ui/rules/pages.md)「Routing model」一段原来写着「还没有专门的doc导航项类型,用url项指向/docs/…」,示例也是url项;而 spec 早已声明doc导航项(doc打开一页,book打开一本书的第一可读页,两键同给即该书中的该页,继承文档受众门禁),控制台在当前 pin 已渲染,SKILL.md 的导航项类型表也已列出。本 PR 把这一段和示例改成教doc项(并带一句url项仍用于外部或自定义地址、os build会拒绝包里不存在的目标),评测 4 的预期输出与断言改为要求type: 'doc'、拒绝type: 'url'。为什么改 — 技能文本说错一句话就是产品缺陷(北极星第 4 项):入口文件说有
doc类型,规则文件说没有,AI 作者照规则文件写url项,平台有类型化入口却没人用,文档受众门禁也被绕开(url项不继承它);评测把错答案钉成了标准答案。平台没有任何一处拒绝指向/docs/的url项,所以只有改技能文本这一条路。风险与代价(含回滚) — 发布技能包有 token 棘轮:
pages.md只剩 1 token 余量,新段落比旧段落多 148 字节,靠删除「Page Types」里被开头句重述的一句(「以前路线图类型(六个名字)已从枚举移除」,169 字节)付账,净 −5 token,落在 5686/5692;评测文件 +3 token,恰好 1505/1505;上限未动、无换行凑数、无新文件。唯一不是逐字重述的信息是那六个旧类型名,spec 枚举会在解析时响亮拒绝它们并列出五个合法值,record_detail仍在消歧句里。风险:AI 作者把doc目标写成路径或文件名 —— spec 拒绝并给出正确拼写;写了包里没有的名字 ——os build的docs/nav-target拒绝。回滚:只动两个 markdown/json 文件,revert 即可,无代码、无 changeset。席位意见 —
你要做的 — 核对 Routing model 新段落的措辞与删除的那一句;认可则 APPROVE 这个 draft PR,由你或授权审批落地(
skills/**为 Tier H)。Generated by Claude Code