Repository navigation
fix(spec)!: a book audience names one gate, and a gated book claims its pages by name - #37870
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. |
…and the search gates that need no caller, also at publish (objectstack-ai#37971) repo:objectstack#1 · os-elon-musk · session_016WV4cwPhGV4g9p1BGQaZbP Fixes objectstack-ai#37307 Clause-②: yes (narrowing) Metadata-protocol: narrowed Skills-docs: objectstack-ai#37310 (amendment 7221575164: the five rule ids and their fixes) Premise corrected: card objectstack-ai#37307 item 3 ("follow the refuse-or-warn verdict the `ai_context` row took") conflicts with ADR-0161 K4; K4 wins, so this rule is `gating` at publish (refuses), not advisory. Seat 1 ruling on this PR: keep gating (seat record: objectstack-ai#37307 comment 7221816104). Ruling-ref: `docs/adr/0161-knowledge-platform-boundary-platform-owns-assembly-sync-split-record-return-knowledge-source-is-a-governed-type.md` K4 — "It defines no object, extends none, and is refused when the object or a named field does not exist (the lint and `os validate` checks are row 4)." and "An object whose package is disabled, that the API exposure refuses for search, or that is a system object without `enable.aiReadable`, and a field the author may not query, each refuse the save with a coded refusal that names the object or the field. A packaged item meets the gates that need no principal in `os validate` and at publish (row 4)." ## 维护者速读 - 用户能看到什么变化:写应用包的作者和用 AI 搭建的作者,在 `os validate` 和发布知识源时,就能看到知识源写错的对象名、字段名,或指向不允许检索的对象(API 不开放检索、系统对象未开放 AI 读取),报错写明是哪个对象、哪个字段。 - 为什么做:属于「知识平台」专题第三阶段第 4 行,让知识源的错误在发布前暴露,而不是等到检索时才发现「怎么搜不到」。 - 出错会怎样:带这几类错误的知识源,发布会被拒(以前能发布,但对象不存在时无内容可索引、字段写错时该字段读不到、对象不开放检索时永远搜不到);已存储的知识源不受影响,可以直接撤回本改动。 - 要你做什么:无。 ## What changes ADR-0161 K4, row 4: a knowledge source is checked against the objects it names, by `os validate` / `build` / `lint` and by the runtime publish gate, with one set of rule ids and messages. - **`packages/lint/src/validate-knowledge-source.ts`** (new): `validateKnowledgeSource`, five rule ids, exported from `packages/lint/src/index.ts`. - `knowledge-source-object-unknown` — **error**. `source.object` names no object of the stack, of a package of its artifact (`packages[]`), or at the door of the objects the host serves. Under a stated package closure it is worded for the closure with `closureDependencyRemedy`; at the door with no closure (the whole collection the host serves) it is an error too, and an empty served collection is no universe. On the CLI, while the manifest declares a dependency the artifact does not carry, it is a **warning** with the hedge (the build cannot see that package's objects; the publish judges the source against the closure, which holds them), the `flow-trigger-unknown-object` split. The ladder `validateObjectReferences` uses: a known platform object (`isPlatformProvidedObjectName`) is not judged when the stack does not carry its definition; a platform-prefixed name no known package registers is a **warning**. - `knowledge-source-field-unknown` — **error**. A `source.content` / `source.metadataFields` member names no field of the object: declared (the stack's own extensions folded in, `objectsAsServed`) or addressable without a declaration (`injectedColumnsFor`: `id`, which the driver provisions, and the injected system columns). - `knowledge-source-object-not-searchable` — **error**. `canServeApiOperation(enable, 'search')` is false (the admission module's gate 2): `enable.apiEnabled: false`, an `enable.apiMethods` list that does not grant `list` (search derives from it; `search` itself is a retired list value the parse strips), or one that grants `list` beside `enable.searchable: false`. With no `apiMethods` list, `searchable: false` does not refuse it. The fix prescribed: keep `apiEnabled` true and, where the object declares `apiMethods`, include `list` with `searchable` not false; or index another object. - `knowledge-source-system-object-not-ai-readable` — **error**. A `sys_` object for which `isAiReadExposed` is false (the admission module's gate 3). - `knowledge-source-field-never-indexed` — **warning**. A member names a credential-class field (`isMaskedOnReadFieldType`, the spec declaration the service's withheld set asks) or an `internal: true` field. The index never carries either (K5). This addition goes past the Execution row, under ADR-0078. - **`authoring-rules.ts`**: one entry, `tier: 'gating'`, all three commands, `surfaces: CLI_AND_RUNTIME`, `runtimeTypes: ['knowledge_source']`, with the package scope passed through, and `wholeCollection` set at the door when no scope is stated. - **`runtime-gate.ts`**: `knowledge_source: 'knowledgeSources'`. - **`rule-explanations.ts`**: one `os explain` entry for each of the five ids. - **`packages/spec/src/migrations/entries/semantic/19.knowledge-source-publish-refuses-missing-references-and-gated-objects.ts`**: the upgrade-guide entry. `check:adr-0087-registration` requires it: `Metadata-protocol: narrowed` refuses `no-migration-prescription` outright. This file is outside the claim's declared file surface. - **Changeset** `.changeset/37307-knowledge-source-references.md`: `@objectstack/lint` minor, `@objectstack/spec` patch, BREAKING, registered disposition. ### The at-publish verdict: refuse, not advise, against the `ai_context` precedent The `ai_context` row (`validateAiContext`) is advisory at publish. Its reason is that a pack still reads what resolves (ADR-0160 D1). This row departs from it, for three reasons. ADR-0161 K4 says an item "is refused when the object or a named field does not exist (the lint and `os validate` checks are row 4)". It also says that "a packaged item meets the gates that need no principal in `os validate` and at publish". And each of the four errors defeats retrieval (a missing object leaves nothing to index, a missing field indexes no text for that member, a gated object is never searched for a caller the service judges), so the card's severity section (all four are errors) has the same reading. The rule is therefore `gating`: its errors refuse the publish (422 with the rule id, path, message and hint), and its warnings ride the 2xx `advisories`. The card's sentence "follow the refuse-or-warn verdict the `ai_context` row took" and its severity section cannot both hold. The ADR text decides between them, and the departure is stated in the rule header, the registry entry and the runtime-gate row. What this narrows at publish, measured on the code paths: - For a non-system author with the knowledge service mounted, the save door already refuses the two gates `403` (`authoredKnowledgeSourceRefusal`), before this gate runs. Where no author judgement is reached, the publish is now refused `422`: a host with no knowledge service, or a system-context write. - A missing object or a missing field is now refused at publish. The save admission accepted a missing object (`canServeApiOperation(undefined)` is true, and with no security service the field gate is masked-only). - `os validate` / `build` / `lint` exit 1 on the same source. Declarations: the claim expected `Clause-②: no` / `Metadata-protocol: none`. The measured reading is `Clause-②: yes (narrowing)`, because five new exports widen `@objectstack/lint`'s public surface and a new refusal narrows the accept set, and `Metadata-protocol: narrowed`, because a requirement is tightened. So the lint bump is `minor` and the title carries `!`. ## Tests `packages/lint/src/validate-knowledge-source.test.ts` (44 cases): - every Acceptance family through `runAuthoringRules('validate')`: a missing object, content field or metadata field; `apiEnabled: false`; an `apiMethods` list that does not grant search; `searchable: false`; a `sys_` object without `aiReadable`. Each prints exactly one finding, with its rule id, severity, path, and the object or field named. A clean source prints none. - the credential-class and `internal` warnings. - the same families at the door (`runRuntimeAuthoringRules` with `type: 'knowledge_source'`). Errors land in `errors` (refused) and warnings in `advisories`, and the face (rule, severity, where, message, hint) equals the `os validate` face. - closure wording and remedy under `packageScope`, with a non-vacuous control: declaring the dependency clears it. - injected columns, stack extensions, artifact `packages[]`, a known platform object skipped, an unknown platform-prefixed name as a warning, `list` granting `search`. - `metadataFields: ['id']` and `content: ['id']` resolve (CLI and door); `enable.searchable: false` with no `apiMethods` list is clean. - the object-unknown split: on the CLI a warning while the manifest declares a dependency `packages[]` does not carry, an error when every declared dependency is carried or none is declared; against the whole collection an error beside the same unseen dependency; an empty served collection at the door judges no object. - `explainRule` answers all five ids. <details><summary>Readings (lint suite at 73441db; the head 3ea6b3c adds only the four docs transcript counts)</summary> - `pnpm --filter @objectstack/lint exec vitest run --maxWorkers=2` (with spec and lint rebuilt, then lint `typecheck`): lock VERDICT command-exit 0, **Test Files 243 passed (243), Tests 9836 passed (9836)**; typecheck exit 0 (`check:test-typecheck` included; `tsc -p tsconfig.test.json --listFiles` lists the new test file, 1 hit). - `pnpm --filter @objectstack/spec exec vitest run src/migrations` after the spec build: 5 files, 206 tests passed. - Ablation, one per new pin, each with the anchor proven on disk by `scripts/ablation-replace.mjs`, a trap restore, and `git diff HEAD` empty after restore. Every leg went red: the runtime-gate row removed (12 red); the object-unknown error made a warning (3); the API gate off (6); the system-object gate off (2); the withheld warning off (4); the injected-column merge off (1); the artifact `packages[]` resolution off (1); the closure branch off (1); the platform-object skip off (1); the stack extensions not folded (1). - Public door: `objectstack validate` in `examples/app-showcase` exits 0 with zero `knowledge-source-*` findings, so the shipped corpus is clean. The same command with `content` mutated to `['title', 'notez', 'secret_note']` exits 1 with two `knowledge-source-field-unknown` findings at `knowledgeSources[0].source.content[1]` and `[2]`, and the file is restored. `objectstack explain knowledge-source-object-unknown` and `objectstack explain knowledge-source-system-object-not-ai-readable` both answer. - Full dogfood battery (`pnpm --filter @objectstack/dogfood test`, lock VERDICT command-exit 1, head 73441db): Test Files 14 failed / 476 passed / 3 skipped (493); Tests 20 failed / 4113 passed / 79 skipped (4212). The failures were 17 `Test timed out in 5000ms`, 2 hook timeouts, the cascading `already has a live bootStack kernel` errors, and 1 assertion inside a timed-out file. None names a `knowledge-source-*` rule. The 14 failed files re-run alone on the same head: **14 passed (14), 164 passed (164)**, VERDICT command-exit 0. Read as shared-box contention, not this diff. </details> <details><summary>Rework readings (review 7221784031: M1, S1, S2, N1, N2; head 8301509)</summary> - At 15b32e6, under the lock (VERDICT command-exit 0): `turbo run build --filter='@objectstack/lint...'` 5/5 tasks; the lint suite **Test Files 244 passed (244), Tests 9856 passed (9856)**; spec `src/migrations` 5 files, 206 tests passed; `check:docs-transcript-drift` exit 0 against the built registry (4 declared values, 87). - At 2677e83 (only the test file changed after 15b32e6), a declared narrowing run outside the lock after three lock queue-timeouts behind another seat's dogfood battery: the knowledge-source file 44 passed (44); `pnpm --filter @objectstack/lint typecheck` exit 0 (`check:test-typecheck` included). - Ablations, each anchor proven by `scripts/ablation-replace.mjs` with a trap restore and `git diff HEAD` empty after: the `injectedColumnsFor` existence check off (2 red, `id` among them); the CLI dependency hedge off (2 red); the whole-collection reading off in the rule (1 red); the registry's `wholeCollection` pass set false (1 red); the empty-universe skip off (2 red). - After merging origin/main (bfc0dd0, no lint or transcript file touched): `check:docs-transcript-drift` exit 0 (87; objectstack-ai#37986 still open), `check-adr-0087-registration` exit 0, `check:nul-bytes` exit 0, `overlap-check` VERDICT clean. </details> <details><summary>Derived gates (dispatch-gates --commands, then --ran)</summary> - 94 families derived at 73441db, all run locally. 90 exited 0. Of the rest: `check:docs-transcript-drift` was red (four CLI transcripts printed 85 author-time rules, and this rule makes 86); the four counts were fixed in 3ea6b3c, and the gate now exits 0 (4 declared values equal the derived count). `check:exported-any` returned exit 3 while the dogfood build was rebuilding `packages/spec/dist`; re-run after that build, it exits 0. `check:dual-build-cjs-loads` returned exit 3 because the `studio`, `client-react` and `scenarios` dist are not built here: NOT MEASURED, CI. `check:type-check-debt` returned exit 3 on a lock queue-timeout (another seat's hold): NOT MEASURED, CI. - The docs commit derived 23 more families. 22 exit 0. `check:skill-examples` returned exit 3 because the `client-react` dist is not built: NOT MEASURED, CI. - `check:api-surface` and `check:docs` exit 0 after the spec rebuild. `overlap-check` VERDICT clean before every push; objectstack-ai#37910 and objectstack-ai#37870 merge cleanly. objectstack-ai#37870 bumps the same four transcript counts, so whichever lands second needs 87. </details> ## Acceptance notes - The search gate follows the exposure derivation: `apiMethods: ['get', 'list']` **grants** `search` (`list` grants it unless `enable.searchable` is false). The save-door refusal text in `service-knowledge` (`admitAuthoredSource`, `object-api-not-served`) reads "its `enable.apiMethods` list does not include `search`". For `searchable: false` with `list` granted, that wording names the wrong cause. Wording only; the PM files it as a card with the S2 wording. - On the CLI, a platform object the stack does not carry (for example `sys_user`) is not judged, because its declaration is not in hand. The publish door judges it against the live definition. - Fences held: the spec predicates and the admission module are unchanged, there is no adapter work for objectstack-ai#37306, and there is no unknown-adapter refusal for objectstack-ai#37479. ## Verification Read first, by risk: 1. `packages/lint/src/authoring-rules.ts`, the `validateKnowledgeSource` entry (`tier: 'gating'` on the publish door is the narrowing). 2. `packages/lint/src/validate-knowledge-source.ts`, the object ladder and the two gates. 3. `.changeset/37307-knowledge-source-references.md`. Two-minute check: in `examples/app-showcase/src/ai/task-notes.knowledge-source.ts`, change `content: ['title', 'notes']` to `['title', 'notez']` and run `pnpm exec objectstack validate` in `examples/app-showcase`. Expected: exit 1 and `rule: knowledge-source-field-unknown at knowledgeSources[0].source.content[1]`. Unchanged, the showcase validates with zero `knowledge-source-*` findings. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cwPhGV4g9p1BGQaZbP --------- Co-authored-by: Claude <noreply@anthropic.com>
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