Repository navigation
fix(spec)!: a book audience names one gate, and a gated book claims its pages by name - #37870
objectstack-fleet[bot] wants to merge 7 commits into
Conversation
… by catch-all Claude-Session: https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 4 package(s): 14 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 4 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin d645b0b557090a2d1213c054ed6a3c90c2c75c6c && git checkout d645b0b557090a2d1213c054ed6a3c90c2c75c6c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 29e0c4bf5f6ca597b9d94a6c987db2a0cf6f7a8b dc85e540745a89771114cb8810b27dcab6d9ee55 && git checkout -B drift-repro 29e0c4bf5f6ca597b9d94a6c987db2a0cf6f7a8b && git merge --no-ff dc85e540745a89771114cb8810b27dcab6d9ee55
node scripts/docs-audit/affected-docs.mjs --json 29e0c4bf5f6ca597b9d94a6c987db2a0cf6f7a8b
|
…le table Claude-Session: https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K Co-authored-by: Claude <noreply@anthropic.com>
|
Test Core (4/10) on head
The other red, Check Changeset, is the DELIBERATE CORRECTION of Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: Read: card #37613 with its five comments (claim 7212725896, amendment 7214987476), the PR body and file list, the net diff against ① Derived judgments
② Semver levelClause-②: yes (narrowing) — on the PR body and on
③ Boundary flags
④ Design judgment
No must-fix, no should-fix.
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA
|
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head b999885 · card #37613 · area s2-data · 2026-11-27T09:51ZL1 checklist
Tier: H. Landing: hand-off to the maintainer follows this record. |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Tier H hand-off · 2026-11-27T09:53Z · head b999885 · approver 维护者速读
|
…-mu5jxy # Conflicts: # content/docs/deployment/cli.mdx # content/docs/deployment/validating-metadata.mdx # content/docs/getting-started/build-with-claude-code.mdx # content/docs/ui/react-pages.mdx
|
repo:objectstack#2 · os-sales · session_01L6bhgTbkZmKG1Moic2iU5K Test UI (13/16) on head
Test Core (5/10) on the same head: one timeout outside this PR. Generated by Claude Code |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA Contract reviewServed-tier: MERGE-ONLY DELTA on record 7215110573 (PASS at ① Derived judgments
② Semver levelClause-②: yes (narrowing) — on the PR body and on
③ Boundary flags
④ Design judgmentThe narrowing against the published spec on The conflict resolution itself is the right one: each side added to the same registry-derived number, and the resolved value is the sum the registry gives, checked by the drift gate. No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA 席位核对 — ACCEPT · head dc85e54 · card #37613 · area s2-data · 2026-11-27T10:55ZRe-covers the ACCEPT 7215203264 (head b999885) on the merge head; the Tier H hand-off 7215226753 stands. L1 checklist
Tier: H. Landing: the maintainer's approval, as handed off in 7215226753. |
Requested by Sales · project thread
Fixes #37613
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — no
skills/page teaches the book audience forms;content/docs/ui/doc-pages.mdxdocuments both refusals in this changeDELIBERATE CORRECTION:
.changeset/36029-book-audience-system-permission.md(pending, from #37591). Its sentence "an object that also carriespermissionSetstill parses as the older, non-strict{ permissionSet }arm with the other key dropped, as before." is false after this PR and now reads "and an object that also carriespermissionSetis refused too: an audience names one gate."Check Changesetis red on this by design until the seat's record confirms it.维护者速读
include: '*'把所有文档都揽进来,os validate/os build/os lint和 Studio、REST、MCP 保存时都会报错,因为它会把不属于任何包的文档也藏起来。'*',测试就会变红。What changes
@objectstack/spec— an audience names one gate.BookAudienceSchema's{ permissionSet }arm now declaressystemPermissiononly to refuse it (z.never, messageBOOK_AUDIENCE_ONE_GATE), and the{ systemPermission }arm moves from.strict()tostrictObjectwith aguidanceentry forpermissionSet, so the union's chosen branch prints the same prescription. Rendered bydefineStack:{ permissionSet, label }still parses to{ permissionSet }exactly as before, and{ systemPermission, label }is still refused as before. Regenerated:content/docs/references/system/book.mdx. New upgrade-guide entrybook-audience-two-gates-and-catch-all-claim-refused(ADR-0087 D3, notice only).@objectstack/lint—book-gated-catch-all-include(error).validateBookAudienceClaimsrefuses a book whoseaudienceis{ permissionSet }or{ systemPermission }with a group whoseincludeis the catch-all (a glob of*alone:'*','**'). Namespace globs, tag includes and pinnedpagespass;'org'/'public'/ no audience are out of scope. Registeredgatingon all three commands and on the runtime publish gate forbookwrites.@objectstack/setup,@objectstack/studio— N4. Each package getssrc/manual-claims-docs.test.ts: it calls the plugin's ownstart()with a capturing manifest service, so it reads the docs and the book the package really registers, and resolves them with the spec'sresolveDocAudiences. Every registered doc must carry exactly the manual's audience, and a control doc bound to no package must stayorg. Wiring that came with it: atestscript,**/*.test.tsdropped fromtsconfig.json'sexcludesotypecheckreads the tests (check:type-check-coverage), and avitest.config.tsaliasing@objectstack/spec/systemand@objectstack/platform-objects/appsto source (check:test-source-alias).packages/spec/liveness/book.json— N5.namegoes back to2026-09-27(its evidence did not change in feat(spec): a book audience can name a capability, so Setup and Studio docs open only for callers who can open those apps #37591);audiencemoves to2026-11-27, re-closed here against both refusals.content/docs/ui/doc-pages.mdxnames both refusals where it already teaches the forms.Decided in the thread (small, listed per the standing rule):
defineStackparses a book at definition time, and{ permissionSet: 'xy_admin', systemPermission: 'setup.access' }comes out as{ permissionSet: 'xy_admin' }(probe against the builtdistofmain@adb65d16). So for a TS config, the documented authoring path, every authoring rule receives the value with the key already gone, whatever its input tier (authoring-rules.ts§ "Whatnormalizeddoes NOT buy" says the same). Only the runtime save door hands the rules the authored body. A lint rule would therefore miss the main path; the parse refusal reachesdefineStack,os validateand the/metasave alike.{ permissionSet }arm. A strict arm refuses every stray key, and a stored book row is kept verbatim (protocol-save.ts: "Every other type keeps its body verbatim"), so nothing proves no stored{ permissionSet }audience carries some other stray key. The narrow form refuses only the pair the card names. The pair cannot have been meaningful in any stable release:{ systemPermission }first shipped in19.0.0-next.0(2026-11-26T19:13Z, after feat(spec): a book audience can name a capability, so Setup and Studio docs open only for callers who can open those apps #37591 merged at 18:15Z);latestis18.6.0. A repo and hotcrm grep finds no audience with both keys (hotcrm's one gated book is{ permissionSet }claimingcrm_admin_*).audienceAllowsreadspermissionSetfirst, so such a row keeps the set gate it has today. The read-time diagnostics pass (metadata-diagnostics.ts) parses with the same schema, so Studio shows it as invalid; its next save is refused with the fix named.gating(error) and also runs at the runtime publish door, because a Studio, REST or MCP author of a book has no other door."systemPermission": { "not": {} }on the set arm, the same shape everyretiredKeytombstone already emits (this schema's owngroups[].translationsamong them).Why
Card #37613, three review follow-ups of #37591 / #37663: an audience written with both keys was accepted and silently gated on the set alone (an admin manual opening to a different group than its author meant); the authoring rule "a gated book never claims by
include: '*'" was taught by the ADR-0046 §6.7 amendment and enforced nowhere; and nothing held the Setup and Studio docs to their manuals' name prefix.Tests
Local runs on head
8143254075. The two later heads are docs only: thebook-gated-catch-all-includerow invalidating-metadata.mdx, and the author-time rule count83→84in the four CLI transcripts (check:docs-transcript-driftgreen locally).CI on head
b9998850: every check green except Check Changeset, the DELIBERATE CORRECTION declared above. Test Core (4/10) failed once on a driver-sql timeout outside this diff (PR comment 7213999688) and passed on re-run.packages/specsrc/system src/migrations src/shared src/kernel: 191 files, 5601 passed.book.test.ts52/52 (2 new: the two-gate refusal in both key orders with the prescription text; every shape accepted before still accepted,{ permissionSet, label }still stripped).packages/lintfull suite: 241 files, 9749 passed.validate-book-audience-claims.test.ts9/9: positive and negative pin per gated form,'**', ungated audiences, map-shapedbooks, the three commands, and the runtime gate refusing a catch-all book write while passing a named claim.authoring-rule-wiring.test.tsgreen with the new entry.packages/apps/setup,packages/apps/studio: 2/2 each;typecheckgreen in both and inpackages/lint.check:generated(spec): all 14 current after--fixregeneratedbook.mdxonly.check:liveness,check:strictness-ledgergreen inside it.check:adr-0087-registrationgreen (registered).check:test-source-alias,check:type-check-coverage,check:doc-authoring,check:changeset-fixed, console-intercept disarm: green. eslint on every touched TS file: clean.rest,runtime, dogfood andui/suites (CI carries them; the only cross-package fixtures naming a catch-all are REST's catch-all control book, which is served through a stub, not a lint run).Ablations (each restored, tree clean after)
systemPermissionfield removed →book.test.ts1 red (the two-gate refusal), 51 pass.include: 'setup_*'→'*'→ the control-doc pin red ("the manual claims a doc bound to no package").setup_overviewrenamedadmin_overview→ the claim pin red ("admin_overview is not claimed by setup_manual").Acceptance notes
packages/lint, the pins,liveness/book.json, andbook.zod.ts"only if the lint route cannot reach the authored value" — it cannot (above). Also touched:packages/apps/{setup,studio}(the N4 pins, their wiring),packages/spec/src/migrations/entries/semantic/(the ADR-0087 entry this narrowing owes),content/docs/ui/doc-pages.mdx, the rule row incontent/docs/deployment/validating-metadata.mdx, the rule count in four CLI transcripts, the regeneratedbook.mdx, and the pending36029changeset (DELIBERATE CORRECTION above). The claim's declarations wereClause-②: no/Metadata-protocol: none; this PR declaresyes (narrowing)/narrowed.permissionSet" line, because branch ranking prefers an unknown-key branch (union-branch-policy.ts); the bullet under it carries the whole fix.Verification
Read first:
packages/spec/src/system/book.zod.ts(BOOK_AUDIENCE_ONE_GATE,BookAudienceSchema), thenpackages/lint/src/validate-book-audience-claims.ts, thenpackages/apps/setup/src/manual-claims-docs.test.ts.Two-minute check:
pnpm --filter @objectstack/lint exec vitest run src/validate-book-audience-claims.test.ts(9 passed) andpnpm --filter @objectstack/setup test(2 passed).Tier H:
Clause-②: yes (narrowing)onpackages/spec/src. Contract review at CONTRACT_REVIEW_TIER owed by the seat; not self-reviewed here.Human Minimum
packages/specholds no runtime logic.pnpm lintpasses (eslint on every touched file).main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgTbkZmKG1Moic2iU5K
Generated by Claude Code