Repository navigation
Commit d38ceba
docs(spec): the permission set name describe and the permission sets page say one holder per namespace (#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 #32758
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 改了什么:权限集 `name` 字段的 describe 不再说「在环境的安全目录里唯一」,改成「权限集按 (包, 名字)
识别,每个命名空间一个持有者」;参考文档那一行重新生成;权限集指南里「权限集、岗位、能力每个部署一个名字」改成权限集按命名空间、岗位和能力仍按部署。
- 为什么改:#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 #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 #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 #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>1 parent 9ba2d4c commit d38ceba
4 files changed
Lines changed: 26 additions & 6 deletions
File tree
- .changeset
- content/docs
- permissions
- references/security
- packages/spec/src/security
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
434 | 434 | | |
435 | 435 | | |
436 | 436 | | |
437 | | - | |
438 | | - | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
439 | 446 | | |
440 | 447 | | |
441 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | | - | |
| 122 | + | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1203 | 1203 | | |
1204 | 1204 | | |
1205 | 1205 | | |
1206 | | - | |
1207 | | - | |
1208 | | - | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
1209 | 1212 | | |
1210 | 1213 | | |
1211 | 1214 | | |
| |||
0 commit comments