Repository navigation
feat(core, objectql, metadata, metadata-protocol, plugin-security): a permission-set name is held once per namespace, judged by one predicate (ADR-0150 child B) - #32742
Conversation
… that drops only the removed slot MetadataManager.unregisterInMemory drops a registry slot and deletes from no loader; it is announced as a registry-only removal. A peer that hears a removal naming a package drops that package's slot only, so another package's in-memory item of the name keeps answering. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CawaYjvvL4WiQcQHTy
… kept per package and never deletes a stored row A permission projector event names the package its row landed in. The echo reads and registers that row at that address, judges every other echo slot by its own row, and removes a gone slot from memory only. A binding read that fails keeps the package the existing slot names. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CawaYjvvL4WiQcQHTy
…3 refusal, and the lock names every declarer The security catalog reads a set two packages' metadata-service slots hold as a refusal naming both, and a stored column reads its own package's slot. The packaged-set lock names every package that declares the name, and its registry-less read goes to each holder. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CawaYjvvL4WiQcQHTy
… per namespace, judged by one predicate permissionSetHoldersMeet (@objectstack/core) is the one predicate the registry's package door, its item seam and the metadata save door ask. Two packages of two namespaces each hold their own set of a name; a holder in a shareable platform namespace, a package with no namespace, the environment and the platform-requested guest_portal keep one holder. The registry remembers every claimant of a name. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CawaYjvvL4WiQcQHTy
… to the holder it reads confers nothing, and the boot report lists it A grant whose permission_set_package names a package that no longer serves its set is read by the resolution rule (ADR-0150 D8 R1). Where that reading lands on a package another stored grant of the same user, set and organization is bound to, the stale grant confers nothing: the bound grant, with its validity window, grants that holder's set. The authorization resolver says it once per process, and the catalog reference boot report lists every such grant per organization. One rule, two readers (staleGrantBesideBoundGrant). Also pins row 9 of 6816011109 through this change's doors: a second holder of a platform (sys) set is refused, also while the holder is disabled, and a column-less grant of a name two namespaces hold, one disabled, confers what main answers. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CawaYjvvL4WiQcQHTy
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
… no address read through the doors A platform (sys) package arriving beside a disabled holder of a permission-set name is refused at the install gate, the item seam and the save door, as the disabled-platform order already was. holdsPlatformPermissionSet for a context holding the name with no address follows the one platform holder: true while it is enabled, false while it is disabled, the second holder refused in both. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
…DR-0150 child B) Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
…wo namespaces, and two doubles keep the engine's contract The phase-1 pin "a second package holding an anchor's set name is refused" installed two packages of two namespaces, which this change admits. It now keeps the refusal for a package with no namespace, and a TO row pins two namespaces' sets: both held, the anchor's environment binding of the name refused naming both, nothing granted through it, the rest of the anchor still granted. The row-9 grant double routes findOne through assertEngineFindOnePredicate (ledger updated), and the echo boot-pass double applies the caller's limit. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
📓 Docs Drift CheckThis PR changes 5 package(s): 53 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 14 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 62 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 6a5b6a286cb4a7bdb3511d750086dbbc6578911f && git checkout 6a5b6a286cb4a7bdb3511d750086dbbc6578911f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0 a79fe6e12ea8157d2a722505ca81e19ef1ef5a09 && git checkout -B drift-repro 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0 && git merge --no-ff a79fe6e12ea8157d2a722505ca81e19ef1ef5a09
node scripts/docs-audit/affected-docs.mjs --json 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0
|
… namespaces hold, over the real registry A real ObjectQL engine and SchemaRegistry: two packages of two namespaces each register their own shared_reader through the item seam. The organization administrator naming the in-boundary holder is admitted by the gate, kept by the package stamp and granted by the authorization resolver as that holder's set alone; naming the holder outside the boundary is refused 403 on it; naming no package is refused 403 naming both; a one-holder set is stamped and granted. Both administrator variants. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
…ads inside its package's namespace (#31698) A stored reference whose package column names a package that no longer serves the set is read by the resolution rule inside that package's namespace only. A holder outside it (another namespace's package, a package with no namespace, the environment's own set) is refused, naming that holder, and confers nothing. The boot report lists such grants on a line of their own, with the holder and the fix. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
Brings #32739, whose cluster signal stamps `packageId` through its own `mutationEventPackage`. This branch's projector-event stamp for `permission` is renamed `projectorEventPackage`, moved beside it in `protocol-mutation-package.ts`, and now stamps through the same `boundPackageOf` reading; the event field keeps #32739's docblock with one paragraph on the projector event. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
|
epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i Contract review + epic red-line read · 2026-11-12T14:51ZHead-sha: Epic red lines
Declarations. Clause-② yes (widening) matches in body and changeset. FROM→TO tables match the code: the install door, item seam and save door admit; Merge hazard with #32497. It is in the stored-column arm of Before landing (text and declarations only, rides the main-merge push, no code round)
Nits → follow-up #32753 (parked per 6824949405)
Measured at head (dependency closure built): objectql registry-reading 17/17; core Generated by Claude Code |
`Metadata-protocol: added` takes at least `minor` on every package the diff moves, so `@objectstack/metadata` and `@objectstack/plugin-security` move to `minor`. The save door's 422 refusal sentence now states the namespace rule; the changeset gains its FROM → TO row, and the kept refusals read "same envelope". Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
|
epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i Contract review delta (merge-forward) + epic red-line read · 2026-11-12T15:06ZHead-sha: Merge-forward test (the PR's diff against its old merge base, compared with its diff against main): the only code that differs is the #32739 conflict. Main now owns The four should-fix items from 6826951220 are discharged in the changeset and body: the save door's 422 sentence has its FROM → TO row, and "unchanged sentence" now reads "same envelope"; Generated by Claude Code |
|
epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i ACCEPT · 2026-11-12T15:33ZHead-sha:
Land: ready + auto-merge. Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43249280139 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
…reads as before; the save door keeps a stored set's name (#31698) - A stored package column bounds the stale reading to its package's namespace only where the registry knows that namespace. A column of a package with none (not installed, authored at runtime, or declaring none) reads as an unbound row, as on `main` (ADR-0150 D8 R1); two holders there are still refused, naming both. - The save door admits a second namespace's set of a name only beside a shipped set: a set another package stores keeps its name (422 NAMESPACE_CONFLICT), since the registry keeps one entry per stored set of a name. Pins: the unknown-package columns move to CONTROLs (core catalog and resolver, plugin-security address, suggestion and boot report), a two-holder unknown-column refusal, and a stored-holder save-door refusal over the real composition. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
…bounded stale column Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
…ed state directly (#31698) The column-less arm of the catalog's permission read now asks the holder the resolution rule answered whether its package is disabled, as `holdsPlatformPermissionSet` does, instead of reading it from the item's package stamp alone. Pinned with a stamped and an unstamped item. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
The cluster removal now carries both #32560's `packagelessOnly` and this branch's `registryOnly`: a received removal reads all three fields, a registry-only one deletes no loader copy, and every other removal goes to `removeNodeLocalCopies` with the whole removal, as on `main`. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
|
epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i Contract review delta + epic red-line read · 2026-11-12T18:45ZHead-sha:
Measured at head:
The card thread also reports: 87/87 gates, full locked dogfood exit 0, and CI green on this head. Nits (for #32780, no extra round):
Generated by Claude Code |
Brings #32497 in. The stored-column arm of the permission-set read keeps #32497's disabled-holder check first (a column naming a disabled holder confers nothing), then this branch's metadata-slot read, then the namespace-bounded stale reading. Where the registry holds the name nowhere, a disabled package included, the metadata read keeps this branch's two-holder refusal. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9
|
epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i Merge-forward read + ACCEPT · 2026-11-12T19:34ZHead-sha:
Land: ready + auto-merge. Generated by Claude Code |
origin/main 1ec547f, with #32742 (a permission-set name held once per namespace) and #32793. No textual conflict. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgUJAvdCcvoqdsFGVz8
…page say one holder per namespace (objectstack-ai#33384) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTb7VngXcrRUydhcV2b3MnX)_ Fixes objectstack-ai#32758 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:权限集 `name` 字段的 describe 不再说「在环境的安全目录里唯一」,改成「权限集按 (包, 名字) 识别,每个命名空间一个持有者」;参考文档那一行重新生成;权限集指南里「权限集、岗位、能力每个部署一个名字」改成权限集按命名空间、岗位和能力仍按部署。 - 为什么改:objectstack-ai#32742(2026-11-12 合入)让两个不同命名空间的包可以各持有同名权限集,这两处文字从那时起就是错的;技能包 `skills/objectstack-platform/SKILL.md` 已经按 (包, 名字) 讲,没有改。 - 风险与回滚:只改说明文字,不动 schema、规则或运行时;spec patch changeset。回滚即 revert。 - 先看:`packages/spec/src/security/permission.zod.ts` 里 `name` 的 describe;其次 `content/docs/permissions/permission-sets.mdx` 改动的那一段。 - 两分钟验证:`grep -n "one holder per namespace" content/docs/references/security/permission.mdx`,预期 `name` 行命中一次,且与 `permission.zod.ts` 的 describe 逐字一致。 - 需要你做的:无,席位落地。 ## What changes - `packages/spec/src/security/permission.zod.ts`: the `name` `describe()` and its JSDoc line. FROM "Permission set name, unique within the security catalog the environment serves (lowercase snake_case)" TO "Permission set name (lowercase snake_case). A set is identified by its package and name: a name has one holder per namespace, so packages of two namespaces may each hold a set of one name, while two packages of one namespace, a package with no namespace, a platform package (base, system, sys), the environment and the platform-requested guest_portal share one set of it". The holder list is the one objectstack-ai#32742's save-door sentence and `permissionSetHoldersMeet` (`@objectstack/core`) state. The `//` comment above the field gains one line pointing at ADR-0150 D2/D9 and that predicate. `SnakeCaseIdentifierSchema` and the field are unchanged. - `content/docs/references/security/permission.mdx`: the generated `name` row, regenerated (`pnpm gen:schema && pnpm gen:docs` in `packages/spec`). No other generated file carries the string; `json-schema/` is untracked build output. - `content/docs/permissions/permission-sets.mdx` (the "set shipped in code cannot be edited" bullet): FROM "A set is never overridden under its own name, not even from `.custom`: permission sets, positions and capabilities hold one name per deployment (ADR-0146 D6)." TO: the set is still never overridden under its own name, now for the reason that holds (a permission set takes no override, ADR-0146 D6, and a set of the shipped set's name saved into the pair is refused `403 NOT_OVERRIDABLE`); a permission set is identified by its package and name (ADR-0150 D2), one holder per namespace, with the one-holder cases listed; positions and capabilities keep one name per deployment. - `.changeset/32758-permission-set-name-describe.md`: `@objectstack/spec` patch, since the describe ships in spec `dist`. ## Why PR objectstack-ai#32742 (merged 2026-11-12, `5defbfeb`) made a permission-set name one holder per namespace: two packages of two namespaces may each hold a set of one name, judged by `permissionSetHoldersMeet`. Both texts still said one name per deployment. **The `.custom` sentence, measured against objectstack-ai#32742.** The order asked whether "a set is never overridden under its own name, not even from `.custom`" is still true. The pair's namespace is `NAMESPACE_custom` (the base's namespace plus `_custom`), a different namespace from its base, so the name rule alone would admit a second set there. A probe on this head (the real protocol over the real `ObjectQL` engine and an in-memory driver, the harness of `protocol-custom-override-bare-slot-envelope.test.ts`; base `com.example.showcase`, namespace `showcase`, shipping `showcase_reader`; pair created by `ensureCustomizationPackage`, namespace `showcase_custom`) answered: | Write | Answer | | --- | --- | | Save `showcase_reader` into the pair, no `overrides` | `403 NOT_OVERRIDABLE` ("provided by a managed package and is sealed against in-place edits. Clone it under a new name…") | | Save it into the pair with `overrides: { package: BASE, basedOn: '1.0.0' }` | `403 NOT_OVERRIDABLE` ("a permission takes no override (ADR-0146 D6)…") | | Save it with no package | `403 NOT_OVERRIDABLE` (sealed) | | Save it into the base | `403 ITEM_LOCKED` | After the refused pair save, the base's set still read "Shipped label". So the point stays true and is kept; only its reason changed. The probe was a scratch file, deleted before the commit. ## Tests - No behaviour changes, so no test is added and nothing is ablated. The old describe string is pinned nowhere (`git grep` on `origin/main`: only the source, the generated row and released CHANGELOGs). - On `854b36e4`: `pnpm --filter @objectstack/spec typecheck` exit 0; `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/security/permission`: Test Files 4 passed (4), Tests 164 passed (164). ## Acceptance notes Outside this card's surface, present-tense "one name per deployment" for permission sets remains in: - `packages/spec/src/migrations/entries/semantic/18.security-catalog-environment-overlay-refused.ts` (`reason`: "Positions, permission sets and capabilities hold one name per deployment"). A migration entry's text, left alone per the order; in the report's `open_questions`. - `packages/spec/src/kernel/customization-package.ts:251-252` (the `adr_0146_d6_security_catalog` basis: "D6: one name per deployment (permission sets, positions, capabilities)"). It describes ADR-0146 D6's basis as written; in `open_questions`. - `packages/objectql/src/registry.ts:2818` and `:2880` (the boot and hot-install refusal sentences for an environment item against a package holder). The environment still meets every holder, so the refusal stays right, but its reason says an assignment names a permission set by its bare name. - `packages/spec/src/contracts/security-service.ts:419` (`PlatformBaselineSetContribution.name`, "unique in the security catalog"). A platform-baseline set lives in a platform namespace, which keeps one holder, so this stays true for what it describes. - ADR-0048's 2026-10-08 addendum and ADR-0146 D6 text, and the dogfood comments `showcase-security.ts:32` / `showcase-d7-default-profile.dogfood.test.ts:65`: decision records and test comments, not touched. `skills/objectstack-platform/SKILL.md:125` already teaches that permission sets "are identified by package and name", and `:129` that a permission set is never overridden; no skills change. ## Verification On `854b36e4`: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 103 commands. 102 exit 0. `pnpm --filter @objectstack/spec run check:generated` exited 1 in the loop because `check:test-typecheck`'s `tsc -p` died without diagnostics while other gates ran beside it; run alone after the loop it exited 0 ("All 14 generated artifacts are up to date"). `pnpm check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET: it needs every package's `dist`; only the spec, lint, objectql and client closures were built), so it is NOT MEASURED here and left to CI. `--ran` reconciliation: "103 derived famil(ies) accounted for — 102 run, 1 NOT-MEASURED". `node scripts/check-nul-bytes.mjs` exit 0. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5nvMv3rqz7e8UKwxD9 Co-authored-by: Claude <noreply@anthropic.com>
…p saying a permission set holds one name per deployment (objectstack-ai#33445) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XNWAtCgQojxw26B4VzapMZz)_ Fixes objectstack-ai#33388 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:安全目录覆盖迁移条目(`security-catalog-environment-overlay-refused`)的 `reason` 开头不再说「岗位、权限集、能力每个部署一个名字」,改为该条目真正的主题「环境目录和包从不共持一个名字」;ADR-0146 D6 分类依据的注释改为「安全目录不接受覆盖」;权限集指南的单持有者清单补上「环境」,「授予按名字指向权限集」改为「按包和名字」。 - 为什么改:objectstack-ai#32742 之后权限集名字按命名空间持有,原句对权限集已不成立;objectstack-ai#33384 改了 describe 和指南主段,这里收掉剩下的三处文字。 - 风险与回滚:只改说明文字和注释,不动 schema、规则、迁移条目的 id/surface/replacement 或运行时;spec patch changeset。回滚即 revert。 - 先看:`packages/spec/src/migrations/entries/semantic/18.security-catalog-environment-overlay-refused.ts` 的 `reason` 开头两行;其次 `content/docs/permissions/permission-sets.mdx` 的两处改动。 - 两分钟验证:`git grep -n "hold one name per deployment" -- packages/spec/src`,预期零命中。 - 需要你做的:无,席位落地。 ## What changes - `packages/spec/src/migrations/entries/semantic/18.security-catalog-environment-overlay-refused.ts`, `reason` only. FROM "Positions, permission sets and capabilities hold one name per deployment, and a package registering a name the environment catalog already holds was already refused on a hot install." TO "The environment catalog and a package never hold one name: a package registering a name the environment catalog already holds was already refused on a hot install." The rest of `reason` and every other field (`id`, `surface`, `replacement`, `acceptanceCriteria`) are byte-identical. - `packages/spec/src/kernel/customization-package.ts`, the `adr_0146_d6_security_catalog` line of the `OverrideClassificationBasis` doc comment. FROM "D6: one name per deployment (permission sets, positions, capabilities)" TO "D6: the security catalog takes no override (permission sets, positions, capabilities)". Comment only. - `content/docs/permissions/permission-sets.mdx` (review N4/N5 of objectstack-ai#33384, added to the card by the seat): - the one-holder list objectstack-ai#33384 added now names the environment: "…a platform package (`base`, `system`, `sys`), the environment and the platform-requested `guest_portal` keep one holder", the same list and order as the `PermissionSetSchema.name` describe; - the "One authoritative store" paragraph: FROM "a grant names its set by name (`sys_user_permission_set.permission_set`)" TO "a grant names its set by its package and name (`sys_user_permission_set.permission_set_package` and `permission_set`)", matching "each granted by its own package and name" below it and the grant object's (package, name) key. - `.changeset/33388-security-catalog-entry-reason.md`: `@objectstack/spec` patch, since the entry's `reason` ships in spec `dist` (`dist/migrations/index.{js,mjs}`) and in the generated upgrade guide. ## Why Since PR objectstack-ai#32742 a permission-set name has one holder per namespace, so "permission sets hold one name per deployment" is false in present tense. The migration entry's subject (an environment-wide row and a package never share a name) still holds, so the reason now opens with that. ADR-0146 D6's reason a permission set takes no override is unchanged, so the gloss names it instead of the old name rule. ## Tests - No behaviour changes, so no test is added and nothing is ablated. Neither old sentence is pinned: on `origin/main`, `git grep "one name per deployment"` hits `packages/spec/src` only at the two edited lines and at `permission.zod.ts:1209` (positions and capabilities, still true), and no test asserts either edited text (the test hits are refusal sentences of other types, comments and one test title; see Acceptance notes). - Projections: every projection of the entry is gitignored. After `turbo run build --filter=@objectstack/spec…`, the regenerated `packages/spec/src/migrations/registry.ts` and `packages/spec/dist/migrations/index.{js,mjs}` carry the new sentence and no longer carry the old one. Nothing to commit. - On `ab082955`: `pnpm --filter @objectstack/spec typecheck` exit 0; `pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/migrations src/kernel/customization-package`: Test Files 6 passed (6), Tests 263 passed (263) (lock VERDICT command-exit 0). ## Acceptance notes Left as they are, outside this card's surface: - `packages/objectql/src/registry.ts:2818` and `:2880` (the cold-boot and hot-install refusal sentences of `SecurityCatalogNameConflictError`) still say "Positions, permission sets and capabilities each hold one name per deployment: an assignment names a position or a permission set by its bare name". The refusals stay right where they fire for a permission set (an environment item, co-owners of one namespace, a platform holder), but the stated reason no longer is, since a grant carries `permission_set_package`. Runtime text in `@objectstack/objectql`; reported to the seat. - ADR-0048's 2026-10-08 addendum, ADR-0146 D6 text (`:263`, `:472`), and test comments (`showcase-security.ts:32`, `showcase-d7-default-profile.dogfood.test.ts:65`, `protocol-boot-hydration-scoped.test.ts:217`) and the `served-override.test.ts:70` test title: decision records and comments, not touched. - Released `packages/spec/CHANGELOG.md` entries carry the old sentence: release-owned, not touched. ## Verification On `ab082955`: `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 103 commands, run one by one with `timeout 900`, each exit code captured before any pipe. - 101 exited 0 in the loop. - `pnpm --filter @objectstack/spec run check:skill-examples` exited 3 in the loop (PREREQUISITE NOT MET: `packages/client-react/dist` held no declarations). After building the client and client-react closures it exited 0 ("344 prose examples type-check across 3 surface(s)"). - `pnpm check:dual-build-cjs-loads` exited 3 (PREREQUISITE NOT MET: it needs every package's `dist`; only the spec, lint, objectql, client and client-react closures were built), so it is NOT MEASURED here and left to CI. - `--ran` reconciliation: "103 derived famil(ies) accounted for — 102 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)". - Also run: `pnpm --filter @objectstack/spec check:generated` exited 1 only because `check:test-typecheck`'s `tsc -p` died "without diagnostics" under load; `check:test-typecheck` alone then exited 0 (52 files / 240 errors / 131 pinned signatures held). The other 13 artifacts read up to date, so nothing checked in moves. `node scripts/check-nul-bytes.mjs` exit 0. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [ ] 3. No formatter ran; `pnpm lint` passes. (No formatter ran; `pnpm lint` is CI's run, not run locally.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed (none checked in moves; see Verification). - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [ ] The *Before Submitting* list in CONTRIBUTING.md is done. (Left to the seat's review.) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5prrsuzKUWCmEzwMEb Co-authored-by: Claude <noreply@anthropic.com>
…ission set holds one name per namespace (objectstack-ai#33463) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDZYUbJbnXUTqZoZ56k4czR)_ Fixes objectstack-ai#33389 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`SecurityCatalogNameConflictError` 的两段报错文字(热安装与冷启动)不再说「岗位、权限集、能力每个部署一个名字」,改成「岗位和能力每个部署一个名字,权限集每个命名空间一个持有者」,并列出仍只有一个持有者的情形;措辞与 objectstack-ai#33384 落地的 describe 一致。 - 为什么改:objectstack-ai#32742 之后权限集按 (包, 名字) 识别,两个不同命名空间的包可以各持有同名权限集,旧句子从那时起就是错的;拒绝本身一直只在 `permissionSetHoldersMeet` 判定相遇时触发,没有错。 - 风险与回滚:只改报错文字和一段代码注释,不动规则、错误码(`NAMESPACE_CONFLICT`)或状态码(422);`@objectstack/objectql` patch changeset。回滚即 revert。 - 先看:`packages/objectql/src/registry.ts` 新增的 `SECURITY_CATALOG_NAME_RULE` 常量,以及它在 `coldBootConflictMessage` 与 `SecurityCatalogNameConflictError` 构造函数里的两处引用。 - 两分钟验证:`grep -n "A permission set holds one name per" packages/objectql/src/registry.ts`,预期恰命中常量一行;`grep -n "Positions, permission sets and capabilities each" packages/objectql/src/registry.ts` 预期零命中。 - 需要你做的:无,席位落地。 ## What changes - `packages/objectql/src/registry.ts`: - New module constant `SECURITY_CATALOG_NAME_RULE`, the one rule sentence both wordings of `SecurityCatalogNameConflictError` state: "Positions and capabilities each hold one name per deployment. A permission set holds one name per namespace: packages of two namespaces may each hold a set of one name, while two packages of one namespace, a package with no namespace, a platform package (`base`, `system`, `sys`), the environment and the platform-requested `guest_portal` share one set of it." This is the holder list of the permission set `name` describe that objectstack-ai#33384 landed (`packages/spec/src/security/permission.zod.ts`), in the same words. - `coldBootConflictMessage` (the cold-boot refusal): FROM "Positions, permission sets and capabilities each hold one name per deployment: an assignment names a position or a permission set by its bare name, so with two holders the environment's stored item would be served in place of the package's definition." TO the rule sentence, then "Under that rule the environment's item and the package's share one definition of the name, so with two holders the environment's stored item would be served in place of the package's definition." - The hot-install message in the `SecurityCatalogNameConflictError` constructor: FROM "Positions, permission sets and capabilities each hold one name per deployment: an assignment names a position or a permission set by its bare name, with no package to tell two definitions apart, so with two holders which definition grants would depend on registration order." TO the rule sentence, then "Under that rule PACKAGE and each holder named here share one definition of the name, with nothing to tell two definitions of it apart, so with two holders which definition grants would depend on registration order." - The comment in `SchemaRegistry.registerItem` that explains why the three security catalog types are refused ("an assignment names a position or a permission set with no package context") now says a position or a capability is named with no package context and a permission set's name has one holder per namespace (ADR-0150 D2/D9, `permissionSetHoldersMeet`). - `.changeset/33389-security-catalog-conflict-text.md`: `@objectstack/objectql` patch. No rule changes. The doors, `permissionSetHoldersMeet` and the envelope (`NAMESPACE_CONFLICT`, `422`) are untouched; the head and the remedy of each message are unchanged. ## Tests No test pinned the old sentence: `git grep` on `0c2aeb9643` for "Positions, permission sets and capabilities", "assignment names a", "no package to tell" and "served in place of the package" found only `registry.ts` itself, a docs page, an ADR, a migration entry and comments (listed under Acceptance notes); no assertion in objectql, runtime, plugin-security, cloud-connection, metadata-protocol or dogfood reads either sentence. No new pin is added: the refusal prose has no consumer that parses it, and the existing suites already assert the envelope (`code` and `status`) and the holders. Local readings at `2a6c935f7e`, under `os-verify-lock`: - objectql build closure, then `vitest run` on `registry-security-catalog-namespace`, `protocol-permission-set-name-registry-reading`, `registry-security-catalog-names-held-by`, `manifest-service-residual-security-seal` and `environment-overlay-five-types`: 5 files, 103 tests passed. objectql typecheck, including `check:test-typecheck`: OK. - `protocol-boot-hydration-scoped`, `package-scoped-exact-qualifier` and `registry-namespace-install-gate`: 3 files, 314 tests passed. - eslint `--no-inline-config` on `registry.ts`: exit 0. ## Acceptance notes Other places that say a permission set holds one name per deployment, read on `0c2aeb9643` and left alone, each for the reason given: - `packages/metadata-protocol/src/protocol-save-door-refusals.ts` (the save door's `Security catalog name conflict` refusal): already says "A permission set holds one name per namespace" with the same holder list. Nothing to change. - `packages/spec/src/migrations/entries/semantic/18.security-catalog-environment-overlay-refused.ts` (`reason`: "Positions, permission sets and capabilities hold one name per deployment"): an ADR-0087 migration entry describing a v18 change, in `packages/spec`, outside this lane. objectstack-ai#33384 raised it as an open question. - `packages/spec/src/kernel/customization-package.ts:252` (the `adr_0146_d6_security_catalog` basis): describes ADR-0146 D6 as written. - `packages/objectql/src/security-catalog-namespace.ts` module header: its first section states the original rule and its own "The narrowing: a permission set is one name per namespace" section already states the ADR-0150 narrowing. - Test comments, not assertions: `packages/objectql/src/protocol-boot-hydration-scoped.test.ts:217`, `packages/qa/dogfood/test/showcase-security.ts:32`, `packages/qa/dogfood/test/showcase-d7-default-profile.dogfood.test.ts:65`. - `content/docs/permissions/delegated-administration.mdx:69` ("an assignment names a position or set, and the gate resolves the name in the security catalog"): a description of the delegated-admin gate, not of the holder rule. - Decision records (ADR-0048 addendum, ADR-0131, ADR-0146 D6): not touched. ## Verification Derived gates at `2a6c935f7e`: `dispatch-gates --commands` gave 65 families. 64 exited 0. `check:dual-build-cjs-loads` exited 3, a prerequisite not met because only the objectql closure was built, so it is NOT MEASURED; CI Build Core covers it. `dispatch-gates --ran` reconciles 65 of 65. The CI check-runs on this pull are the authority for every gate family. --- _Generated by [Claude Code](https://claude.ai/code/session_016WV4cyrFFk86Jqf7Mp5Rzw)_ <!-- signed: domain:server#5 · os-elon-musk · session_016WV4cyrFFk86Jqf7Mp5Rzw --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #31698
Clause-②: yes (widening) — two packages of two namespaces may each hold a permission set of one name, each granted, cloned, activated and read by its own (package, name), where the first holder ships its set (the save door keeps a name another package stores at one holder); co-owners of one namespace, a package with no namespace, a holder in a shareable platform namespace (
base,system,sys), the platform-requestedguest_portal, the environment's own set and a built-in name keep one holder, refused with today's envelope; the save door's 422 sentence now states the namespace rule (row below).Metadata-protocol: added
Skills-docs: follow-up owed — #32758: packages/spec/src/security/permission.zod.ts (the
namedescribe still reads "unique within the security catalog the environment serves"); skills/objectstack-platform/SKILL.md already teaches that permission sets are identified by package and name; content/docs/permissions/permission-sets.mdx:430 rides the same cardNarrowing: no — per ruling 6764881683 and the epic read 6764938596 (#31973's precedent): first-party co-owner pairs 0, cross-namespace pairs 0 (step-0 census at
45f0f81f; re-counted statically on this head: crm shipscrm_*andguest_portal, showcase shipsshowcase_*, todo and multi-package ship none). This covers the name rule. A name another package STORES stays at one holder at the save door, as onmain(row in What changes), so that row is unchanged, not narrowed. Every refusal that stays keeps its envelope; the save door's 422 sentence tail changes to state the namespace rule (row in What changes). The stored-column rule (a stale package column read inside that package's namespace only) is this PR's declared hardening, listed under What changes, with its moved pins under Tests.维护者速读
base/system/sys平台命名空间里的持有者、guest_portal、环境自己的集和内置名照旧只许一个持有者。packages/core/src/permission-set-holders.ts(唯一谓词),packages/objectql/src/registry.ts的securityCatalogHoldersOtherThan,packages/plugins/plugin-security/src/security-catalog-echo.ts。pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/protocol-permission-set-name-registry-reading.test.ts,预期 18/18 通过,其中 CONTROLcrm + hr三道门都放行,sys + crm、base + crm、guest_portal三道门都拒绝。What changes
permissionSetHoldersMeet(@objectstack/core) is the ONE predicate that judges two package holders of a permission-set name. The registry's package door, its item seam and the metadata save door (permissionSetNameCollisionRefusal) all ask it; nothing else spells it. The registry's claim for a name becomes a set of claimants.main)SecurityCatalogNameConflictError422 NAMESPACE_CONFLICT422 NAMESPACE_CONFLICT422 NAMESPACE_CONFLICT, unchanged: the registry keeps one entry per stored set of a name, so a second stored set would take the first one's place there; the package duplicate door lists that set infailed[], as onmain. Kept apart per package by #32780sys+crm,crm+sys,base+crm(either order, holder enabled or disabled)guest_portalheld bycrm, arriving fromhrcrm; co-owners of one namespace; the environment's own set; a built-in name422 NAMESPACE_CONFLICT, envelope unchanged), after the holders and the remedy (protocol-save-door-refusals.ts)base,system,sys), a package with no namespace, the environment, or a name the platform requests by spelling share one set of it, and a set another package stores holds its name. See ADR-0150 D2."409 RESOURCE_CONFLICTnaming both (#32162, #32164); a grant with nopermission_set_packageconfers nothingThe difference from the sibling
namespacedHoldersMeet(N3 condition 2), measured on the predicates themselves and pinned at all three doors:namespacedHoldersMeetpermissionSetHoldersMeetcrm+hr(CONTROL)sys+crmbase+crmguest_portal,crm+hrcrmOwed rows closed before two holders of one name can exist (each carried on #31698):
mainalready (metadata-protocol: a bare by-name read of an action name that two packages bind to two different objects is refused, naming both (ADR-0150 D3; after #31697) #32244'spackageScopedRefusalOfin both catches; fix(metadata-protocol, cli)!: a package-less item of a name two packages hold is refused at both exact addresses for every narrowed type, and the layered read judges its exact address (ADR-0150 D4) #32566).deleted—MetadataManager.unregisterInMemorydrops one registry slot and deletes from no loader; a peer that hears a removal naming a package drops that package's slot only.staleGrantBesideBoundGrant, one rule read by the authorization resolver and the catalog reference boot report).not-held-by-qualifier, naming that holder) and confers nothing. A column of a package with no namespace the registry knows (not installed, authored at runtime, or declaring none) has none to bound the reading, and reads as onmain(D8 R1): one holder grants, two are refused naming both. The catalog's stored-column arm is the one place this is judged; the activation ledger keeps switching that holder off (a switch-off is never read as none), and the catalog reference boot report lists each such grant on a line of its own, with the holder and the fix.Tests
packages/objectql/src/protocol-permission-set-name-registry-reading.test.ts— one predicate, three doors over the real composition (ObjectQLPlugin+ real protocol +SchemaRegistry): CONTROLcrm + hradmitted at all three;sys + crm,crm + sys,base + crm,guest_portal, no-namespace refused at all three; the predicate table against the sibling; the shared namespaces equal the registry's shareable ones; two admitted claims each released by their own uninstall.mainwith fix(objectql, metadata-protocol)!: by-name doors judge a name's holders over the served set, so a disabled package's item is not a holder (ADR-0150 D3) #32497 on it (2f80f2897, merge commita79fe6e12): a second holder beside asysholder is refused at every door in both orders, the other holder disabled or the platform holder disabled;holdsPlatformPermissionSetfor a name with no address follows the one platform holder (true while enabled, false while disabled, the second holder refused in both); a column-less grant of a namecrmandhrhold,hrdisabled, confers nothing, and the disabled holder's bound grant is never re-targeted (CONTROLs: each bound grant confers its own set). Green there: objectqlprotocol-permission-set-name-registry-reading.test.ts18/18, core 3362/3362.security-catalog.test.ts,resolve-authz-context.grant-set-by-name.test.ts; plugin-securitysecurity-catalog-echo.test.ts,packaged-permission-set-lock.test.ts,catalog-reference-report.test.ts; metadatametadata-manager-cluster.test.ts.org-admin-grant-two-holders.real-registry.test.ts, both administrator variants): the in-boundary holder named is admitted, stamped with that package and granted alone; the holder outside the boundary is refused 403 (condition (a)); no package named is refused 403 naming both; CONTROL a one-holder set. Nothing is stored on a refusal.stale-grant-package-namespace.real-registry.test.ts, real engine and registry, grants stored through the write path): the set moved to a co-owner of the namespace is read there (CONTROL); the set's holder in another namespace confers nothing and is listed by the boot report with that holder. Unit pins in coresecurity-catalog.test.tsandresolve-authz-context.grant-set-by-name.test.ts, plugin-securitycatalog-reference-report.test.ts,permission-set-address.test.ts,suggested-audience-bindings.test.ts.68516172d), asholdsPlatformPermissionSetdoes, rather than through the item's package stamp alone: coresecurity-catalog.test.ts, a disabled holder's set is not served with its item stamped or unstamped (CONTROL: enabled, it grants).e6552b344), read FROM (3f931144b) → TO: a column of a package the registry does not know, or with no namespace, FROM refused TO read as an unbound row, as onmain. Each is now a CONTROL: coresecurity-catalog.test.ts(com.acme.gone) andresolve-authz-context.grant-set-by-name.test.ts(com.acme.gone); plugin-securitypermission-set-address.test.ts(GONE),suggested-audience-bindings.test.ts(s_gone, ands_no_namespaceadded) andcatalog-reference-report.test.ts(g_unknown). The suggestion TO pin's other-namespace column is now a package that declares a namespace (com.example.ops). Added: ⛔ a column of a package the registry does not know, on a name two packages hold, is refused naming both, and nothing is picked (coresecurity-catalog.test.ts); ⛔crmstores its set andhrsaves one of the name: the save door answers422 NAMESPACE_CONFLICTnamingcrm, andcrm's set stays served atcrm(objectqlprotocol-permission-set-name-registry-reading.test.ts, real composition).packages/qa/dogfood/test/stored-reference-package-column.dogfood.test.tsandwall-package-doors-refusal.dogfood.test.ts, 30/30 on this branch merged withmain2f80f2897(a79fe6e12).security-catalog-permission-sets-by-package.test.ts): "a second package holding an anchor's set name is refused" installed two packages of two namespaces, which this change admits. It keeps the refusal for a package with no namespace (unchanged), and a TO row pins two namespaces' sets of the name: both held; theeveryoneanchor's environment binding of the name is refusedambiguous-in-environmentnaming both, grants nothing through it, and the rest of the anchor still grants.Acceptance notes
includeDisabledPackages: trueat those two reads). fix(objectql, metadata-protocol)!: by-name doors judge a name's holders over the served set, so a disabled package's item is not a holder (ADR-0150 D3) #32497 landed first (0763bf6ec); on this branch merged with it, the row-9 pins are green, and withhrdisabled a column-less grant of a namecrmandhrhold confers nothing. That is N3 condition 3 read in the "fix(objectql, metadata-protocol)!: by-name doors judge a name's holders over the served set, so a disabled package's item is not a holder (ADR-0150 D3) #32497 lands first" order.3f931144b(run 43249280139, record on this PR): two dogfood CONTROLs failed on this PR's own rules and are fixed ine6552b344(see Tests). (1) A column of a package not installed was refused; it now reads as onmain. (2) AfterPOST /packages/:id/duplicateinto a package of another namespace, the save door admitted the copy of a set the source package stores, and the registry's one entry per stored set of a name then served the copy in the source's place. The save door now keeps a name another package stores at one holder, as onmain. Keeping two packages' stored sets of one name apart in the registry is metadata-protocol, objectql: stored permission sets of one name in two packages are kept per package in the registry, so the save door can admit a second namespace's stored set #32780 (removal heal, lock classification, boot hydration order), filed under objectql: narrow the phase-1 one-holder refusal from environment to namespace for permission set (ADR-0150 child B, permission set family) #31698 and parked per 6824949405.main, andmainis merged (f7a0fe0ea, merge commit66844aa33, thenaf90f307c, merge commit2d7153592, then776474e8b, merge commita75461f30, then2f80f2897(with fix(objectql, metadata-protocol)!: by-name doors judge a name's holders over the served set, so a disabled package's item is not a holder (ADR-0150 D3) #32497), merge commita79fe6e12; the PR was in conflict at37f7bcf6a). The conflict ataf90f307cwas with fix(metadata-protocol, metadata): the cluster metadata-mutation signal names the row's package, so replicas converge per package (ADR-0150 D4) #32739, which added amutationEventPackage(packageId)of its own for the cluster signal: this PR's projector-event stamp forpermissionis renamedprojectorEventPackage, sits beside it inprotocol-mutation-package.ts, and stamps through the sameboundPackageOfreading. The conflict at776474e8bwas with metadata: in-process bare action reads disagree with the protocol on package-less holders, and a bare removal beside one package takes every slot (ADR-0150 D3/D4, follow-up of #32365) #32560 inpackages/metadata/src/metadata-manager.ts: the cluster removal now carries both metadata: in-process bare action reads disagree with the protocol on package-less holders, and a bare removal beside one package takes every slot (ADR-0150 D3/D4, follow-up of #32365) #32560'spackagelessOnlyand this PR'sregistryOnly; a received removal reads all three fields, a registry-only one deletes no loader copy, and every other removal goes toremoveNodeLocalCopieswith the whole removal, as onmain(metadatametadata-manager-cluster.test.tsgreen). The real-engine door pin for an organization administrator naming one of two holders (gate + seam + reader) is in (see Tests).main, andmainis merged (2f80f2897, merge commita79fe6e12). Both editresolvePermissionScopedinpackages/core/src/security/security-catalog.ts. In the stored-column arm, fix(objectql, metadata-protocol)!: by-name doors judge a name's holders over the served set, so a disabled package's item is not a holder (ADR-0150 D3) #32497's disabled-holder check comes first (a column naming a disabled holder confers nothing and is never re-targeted), then this PR's metadata-slot read, then the namespace-bounded stale reading. Where the registry holds the name nowhere, a disabled package included, the metadata read keeps this PR's two-holder refusal.os doctorsays nothing. The fix the refusal itself names isos migrate stored-references bind.Metadata-protocol: addedtakes at leastminoron every package the diff moves (AGENTS.md Post-Task 3), so@objectstack/metadataand@objectstack/plugin-securityareminor, as are core, objectql and metadata-protocol.claude/project-thread-26yakz, resumed fromclaude/project-thread-xsgo56@fddb44aa(the claim amendment 6821966485 names xsgo56; the epic seat restates it).Verification
See the report comment for the gate list, exit codes and ablations.
Human Minimum
packages/specholds no runtime logic.pnpm lintpasses. (no formatter ran;pnpm lintis CI's run)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched: n/a)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9