Skip to content

Commit b392ff7

Browse files
docs(spec): the security-catalog migration entry and the D6 gloss stop saying a permission set holds one name per deployment (#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 #33388 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:安全目录覆盖迁移条目(`security-catalog-environment-overlay-refused`)的 `reason` 开头不再说「岗位、权限集、能力每个部署一个名字」,改为该条目真正的主题「环境目录和包从不共持一个名字」;ADR-0146 D6 分类依据的注释改为「安全目录不接受覆盖」;权限集指南的单持有者清单补上「环境」,「授予按名字指向权限集」改为「按包和名字」。 - 为什么改:#32742 之后权限集名字按命名空间持有,原句对权限集已不成立;#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 #33384, added to the card by the seat): - the one-holder list #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 #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>
1 parent 0e9ff94 commit b392ff7

4 files changed

Lines changed: 18 additions & 7 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the security-catalog overlay migration entry says the environment catalog and a package never hold one name, not that a permission set holds one name per deployment
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
The `security-catalog-environment-overlay-refused` semantic migration entry's `reason` opened "Positions, permission sets and capabilities hold one name per deployment", which stopped being true for permission sets when a permission-set name became one holder per namespace (ADR-0150 D2/D9). It now opens with the entry's own subject: the environment catalog and a package never hold one name. Its `id`, `surface`, `replacement` and `acceptanceCriteria` are unchanged, and so is the cold-boot refusal it records. The `adr_0146_d6_security_catalog` gloss on `OverrideClassificationBasis` now says the security catalog takes no override, and the permission sets guide lists the environment among a name's one-holder cases and says a grant names its set by its package and name. No schema, rule or runtime behaviour changes.

‎content/docs/permissions/permission-sets.mdx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ as a projection is retired, its object is no longer registered, and no data
421421
route serves it (ADR-0131 D3). Studio's All metadata area lists the catalog
422422
(`/studio/~all/metadata/permission?scope=environment`; Setup's old
423423
`/apps/setup/metadata/permission` address redirects there), a grant
424-
names its set by name (`sys_user_permission_set.permission_set`), and a write
424+
names its set by its package and name (`sys_user_permission_set.permission_set_package`
425+
and `permission_set`), and a write
425426
goes through the metadata door (`PUT` or `DELETE /api/v1/meta/permission/:name`),
426427
which requires `manage_metadata` — and, under a `group` or `isolated` tenancy
427428
posture, the platform operator. This has three author-visible consequences:
@@ -441,7 +442,8 @@ posture, the platform operator. This has three author-visible consequences:
441442
has one holder per namespace: packages of two namespaces may each ship a set
442443
of one name, each granted by its own package and name, while two packages of
443444
one namespace, a package with no namespace, a platform package (`base`,
444-
`system`, `sys`) and the platform-requested `guest_portal` keep one holder.
445+
`system`, `sys`), the environment and the platform-requested `guest_portal`
446+
keep one holder.
445447
Positions and capabilities keep one name per deployment. Every other set
446448
(one authored in this system, a clone, or one saved into a writable runtime package) is edited in place: the edit
447449
lands on its one stored definition.

‎packages/spec/src/kernel/customization-package.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,8 @@ export type OverrideCondition =
249249
/**
250250
* Where a classification comes from:
251251
* - `adr_0146_d2_listed` — named in D2's "Which types" list;
252-
* - `adr_0146_d6_security_catalog` — D6: one name per deployment (permission
253-
* sets, positions, capabilities);
252+
* - `adr_0146_d6_security_catalog` — D6: the security catalog takes no override
253+
* (permission sets, positions, capabilities);
254254
* - `adr_0146_d10_extended` — D10: objects are extended, never replaced;
255255
* - `adr_0126_code_only` — D2 and D6: the types ADR-0126 §3 places outside the
256256
* regimes as code gain no override channel;

‎packages/spec/src/migrations/entries/semantic/18.security-catalog-environment-overlay-refused.ts‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,8 @@ export const entry: SemanticMigration = {
2424
+ 'package. Nothing is adopted: an item the environment needs under its own name is re-created '
2525
+ 'under a name no package holds',
2626
reason:
27-
'Positions, permission sets and capabilities hold one name per deployment, and a package '
28-
+ 'registering a name the environment catalog already holds was already refused on a hot '
29-
+ 'install. A cold boot now refuses it too, right after the stored rows load: the stored row '
27+
'The environment catalog and a package never hold one name: a package registering a name '
28+
+ 'the environment catalog already holds was already refused on a hot install. A cold boot now refuses it too, right after the stored rows load: the stored row '
3029
+ 'used to be served in place of the package\'s definition, with only a collision warning. '
3130
+ 'Rows like this exist on deployments that saved over a package-held name before the packaged '
3231
+ 'locks refused such saves, and over the security plugin\'s own sets, which it declares only '

0 commit comments

Comments
 (0)