Repository navigation
docs(skills): point two published member counts at their declarations instead of numbers (objectui#12588) - #12591
Conversation
… a number The data-integration guide said the published DataSource has 38 members. The declaration in packages/types/src/data.ts never bore that number out, and every member added or retired moves it further. Replace the count with a pointer to the declaration, in the shape the same section already uses for its optional members, so the sentence cannot drift. One line changed; the guide keeps its line count. Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
…f a number The testing guide's auth-provider example said AuthClient declares ~38 methods. The declaration in packages/auth/src/types.ts has 39 at the branch base, and every method added or retired moves the number again. Point at the declaration instead, keeping the comment's teaching claim that the provider reaches only one of those methods on this path. Same shape as the DataSource sentence in the data-integration guide. One line changed; the guide keeps its line count. Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: PR #12591 (card #12588). Net diff against the merge base ① Derived judgmentsThe data-integration.md line: right.
The testing.md line: the pointer half right, the reach half wrong.
Spot-checks of the Acceptance-notes counts, each against its declaration at the head:
Gates. Check-runs on the head, read at 2026-10-16T01:39Z: 30 success (Lint, Type Check, Repo Gates, Line Citation Gate, Governed Surface Queue Guard, the three Changeset gates, Build Docs, Build & E2E, Test (dist pins), all 16 Test shards and the Test aggregate, label), 3 skipped (dependabot and the coverage pair), and 1 still in progress, Spec Main Shape Gate. No failure. The earlier head ② Semver levelNo changeset owed: ③ Boundary flags
Implemented-by: VERDICT: FAIL |
…nd stub both The auth-provider example in the testing guide said the provider reaches one AuthClient method on its path. It reaches two: getSession on mount, and listOrganizations once a user is set. On the old one-member stub the second call threw inside refreshOrganizations and was reported as a console.warn; the example passed with that warning, not because one member was enough. The comment now names both members, with no count, and the stub types listOrganizations against AuthClient['listOrganizations'] the way getSession already is, resolving to an empty list so the organization load ends there. The line saying the example has the shape of the auth package's own AuthProvider.test.tsx is dropped: that file's createMockClient stubs its members with untyped vi.fn(), so it does not check a resolved value the way this example does, and the file is not something a reader of the published guide can open. The guide keeps its line count: the dropped line pays for the stub's line. Claude-Session: https://claude.ai/code/session_01JZnppgHRp4sREcouhkQYDB Co-authored-by: Claude <noreply@anthropic.com>
Contract reviewServed-tier: PR #12591 (card #12588), round 3: does this head discharge the FAIL record ① Derived judgmentsdata-integration.md (unchanged since
testing.md, the "Auth provider testing" fence: right, and it discharges the FAIL.
PR body measured claims, spot-checked: 36 = 6 + 30, right; 39, right; " Acceptance-notes counts, spot-checked at the head: "the nine keys" — Gates. Check-runs on the head, read at 2026-10-16T02:03Z: 29 success — Repo Gates, Lint, Type Check, Build Docs, Build & E2E, Test (dist pins), all 16 Test shards and the Test aggregate, Line Citation Gate, Governed Surface Queue Guard, Changeset Declaration, Changeset Claim Re-read, Changeset Fixed Group Check, label; 3 skipped (dependabot and the coverage pair); 1 still in progress at that reading, Spec Main Shape Gate, which the diff (prose under ② Semver levelNo changeset is owed: ③ Boundary flags
Implemented-by: VERDICT: PASS |
维护者速读改了什么:给使用者 agent 读的已发布技能指南里,有两处关于接口的说法与代码不符,本 PR 把它们改成代码实际的样子,不再写死任何数字。两个文件的行数都不变:514 行和 370 行。
为什么改:
风险与代价(含回滚):
席位意见:建议批准。
你要做的:用 席位核对
Generated by Claude Code |
|
Pre-landing check ·
Generated by Claude Code |
Fixes #12588
Clause-②: no
What changed
Two published skill guides each made a claim about an interface that the code does not bear out. Each is replaced with what the code says, and no count stands in for the old numbers.
skills/objectui/guides/data-integration.md, in the caveat above the teaching fence of theDataSource interfacesection (one line):DataSourcehas 38 members and the excerpt is what makes this section readable"data.tslists every publishedDataSourcemember and the excerpt is what makes this section readable"skills/objectui/guides/testing.md, in the "Auth provider testing" example:AuthClientdeclares ~38 methods and the provider reaches ONE of them on this path." After: "Of every methodAuthClientdeclares inpackages/auth/src/types.ts, this path reachesgetSessionon mount andlistOrganizationsonce a user is set; an empty list ends the organization load there."listOrganizations, typed againstAuthClient['listOrganizations']the waygetSessionalready is, and resolving to an empty list.@object-ui/auth's own AuthProvider.test.tsx uses." is dropped. That file'screateMockClientstubs its members with untypedvi.fn(), so it does not check a stub's resolved value the way this example does (measured below). The file is also not one a reader of the published guide can open.The
DataSourcefence is still a deliberately simplified teaching copy, and the same paragraph still namespackages/types/src/data.tsas the real declaration. The auth example still teaches the same typing discipline: each stub is typed against its ownAuthClientmember, and the widening happens once, in a named place.No number stands in for either old one. A count goes stale every time a member is added or retired, and that is how both of these went wrong. The data-integration wording takes the shape PR #12586 already gave the optional-member sentence of the same section ("
data.tslists every optional member").Why
DataSourceinterface inpackages/types/src/data.tshas 36 members at base3eb3ec138a(TypeScript AST, overloads counted once): 6 required and 30 optional. The guide said 38. The section's later sentence "Six members are required" holds, so it is unchanged.AuthClientinterface inpackages/auth/src/types.tshas 39 members, all function-typed. The guide said about 38.packages/auth/src/AuthProvider.tsx, the mount effect'sloadSessioncallsclient.getSession(). Once a user is set, the "Load organizations once user is authenticated" effect runsrefreshOrganizations, which callsclient.listOrganizations(). On the old one-member stub that second call threw inside thetry, and the provider reported it withconsole.warn. The example passed with that warning, not because one member was enough. An empty list returns fromrefreshOrganizationsbeforegetActiveOrganizationorsetActiveOrganization, andrefreshActiveMembermakes no client call while no organization is active.Measured with uncommitted scratch files in
packages/auth(deleted before the commit)Run from the repo root with
pnpm exec vitest run --maxWorkers=2 --reporter=verbose, under the shared verify lock, exit 0,Test Files 2 passed (2),Tests 3 passed (3).@object-ui/authresolves topackages/auth/srcthrough the root vitest alias.console.warnandconsole.error:getSession calls = 1 · listOrganizations calls = 1 · console.warn calls = 0 · console.error calls = 0.console.warnis called with"[AuthProvider] Failed to load organizations:"andTypeError: client.listOrganizations is not a function.tsc -p tsconfig.test.jsoninpackages/authexits 0, with--listFilesconfirming it read the scratch files. It shows three things. The verbatim fence type-checks against the built@object-ui/auth. AcreateMockClient-style override,getSession: vi.fn().mockResolvedValue(42), is accepted. The fence's style,vi.fntyped withAuthClient['getSession']resolving to42, is refused (an@ts-expect-errorline that would fail if it compiled).Line budget (
skills/**)3eb3ec138a7b2bb22f71skills/objectui/guides/data-integration.mdskills/objectui/guides/testing.mdSKILL.mdunderskills/(one file,skills/objectui/SKILL.md)git diff --numstatagainst the base: data-integration.md +1/−1; testing.md +6/−6 (five comment lines rewritten in place, one stub line added, one line dropped).Governed surface and changeset
skills/**is a governed surface (Tier H).node scripts/check-governed-queue-guard.mjs --teston the two files answersGOVERNEDwith exit 3, which is the code it uses for a governed diff that has no approval yet. This PR stays a draft until an authorized approver leaves an APPROVED review. After that, the claiming seat marks it ready.skills/ships in no npm package, and no file underpackages/changed.node scripts/check-changeset-presence.mjsagrees ("no changeset is owed", exit 0), andnode scripts/check-changeset-no-major.mjsexits 0.Verification (local, at
7b2bb22f71)Each exit code was captured to a file before any pipe. The quoted text is the verdict line the gate printed.
node scripts/check-skills-paths.mjscheck-skills-paths: OK (89/90 stated path(s) resolve across 20 guide file(s); 1 baselined).node scripts/check-skill-examples.mjs --self-testcheck-skill-examples self-test: 60 cases passnode scripts/check-skill-examples.mjs, after building its derived closureEvery marked skill example holds up against the built types.(18 of 18 ts fences judged, 70 JSON fences parsed; closure build 29 of 29 successful)node scripts/check-skill-eval-tokens.mjs --self-test, then the main runEvery must_contain token is taught by its own skill bundle.node scripts/check-doc-json-fences.mjsEvery judged JSON node document on the scan surface passes the strict authoring face.node scripts/check-control-bytes.mjscheck-control-bytes: OK (scanned 8984 tracked text file(s); skipped 93 binary).node scripts/check-new-cross-file-line-citations.mjsVERDICT new-cross-file-line-citations: 0 new citation(s)node scripts/check-changeset-presence.mjsNo source or published contract of a released package changed in this range, so no changeset is owed.node scripts/check-changeset-no-major.mjsEvery major is the synchronized onenode scripts/check-governed-queue-guard.mjs --test(the two files above)GOVERNED(expected)Skill-guide reader tests: 14 files. These are the test files that name
data-integration, plus every test that walksskills/. I ran them withpnpm exec vitest run --maxWorkers=2from the repo root, under the shared verify lock:Test Files 14 passed (14),Tests 464 passed (464).The "Auth provider testing" fence carries no example-gate marker, so
check-skill-examplesdoes not judge it. The scratch run above is what measured it.Acceptance notes
packages/auth/src/__tests__/AuthProvider.test.tsx: the comment increateMockClientsays "AuthClientdeclares ~38 methods; this double implements the eight the provider reaches on the paths under test". Measured:AuthClienthas 39. The double's literal names 7 members (signIn,signUp,signOut,getSession,forgotPassword,resetPassword,updateUser) plus theoverridesspread, and the file never mentionslistOrganizations. This is the same family as this card, but it is a test-file comment no user of the published guide reaches. Noted only:packages/authis not edited here.skills/objectui/**at3eb3ec138a, each measured against the declaration it counts and cited by quoted text. All hold, and none is touched:DataSourcehas 6 required.QueryParamshas 9.QueryResulthas 7.ComponentMetaplus the fiveRegistryComponentMetaExtras(11 + 5).ComponentInputControlTypehas 11 arms.ComponentInputhas 14 members, 8 of themnevertombstones.Pickhas 7 keys.ganttkeys are the required ones": specGanttConfigSchemahas 3 required keys.BreakpointNamehas 6 arms andBreakpointColumnMaphas 6 members.EXPRESSION_BINDABLE_TEXT_KEYS_BY_COMPONENThas 4 distinct keys.ExpressionCachehasmaxSize = 1000.No gate re-derives any of these counts, so each can drift the way the two changed ones did.
维护者速读(草稿)
改了什么
给使用者 agent 读的已发布技能指南里,有两处关于接口的说法与代码不符。本 PR 把它们改成代码实际的样子,不再写死任何数字。
data-integration.md:原文「DataSource接口有 38 个成员」,改为「完整的成员清单在data.ts」。只改一行,仍是 514 行。testing.md的认证测试示例:原注释说「AuthClient大约有 38 个方法,provider 在这条路径上只用到其中一个」。实际用到两个:挂载时调用getSession,用户登录后再调用listOrganizations。注释现在直接点名这两个方法,示例里的测试替身也补上listOrganizations,返回空列表。另外删掉一句「这和@object-ui/auth自己的 AuthProvider.test.tsx 写法一致」:实测不一致,而且读者也看不到那个文件。文件仍是 370 行。为什么改
两个数字都是错的:实测
DataSource有 36 个成员,AuthClient有 39 个方法。数字本身也会过期。「只用到一个」也是错的:按旧示例写的测试虽然能通过,但会打出一条「组织加载失败」的警告,读者照抄就会把这个隐患带进自己的项目。新示例实测通过,而且没有任何警告。风险与代价(含回滚)
只改文档和示例代码,不改任何包,不发 npm 包,不需要 changeset。风险极低:示例多了一行替身,读者照抄得到的是一个不报警告的测试。回滚只需 revert 对应的提交。
席位意见
你要做的
skills/**属于受管面。请看一眼这两个文件的 diff,同意就留一条 APPROVED review,之后由席位翻 ready 并加入合并队列。不同意或想换措辞,在 PR 上留言即可。Generated by Claude Code