Skip to content

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

Merged
objectstack-fleet[bot] merged 20 commits into
mainfrom
claude/project-thread-26yakz
Nov 12, 2026
Merged

objectstack-fleet[bot] merged 20 commits into
mainfrom
claude/project-thread-26yakz

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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-requested guest_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 name describe 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 card

Narrowing: 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 ships crm_* and guest_portal, showcase ships showcase_*, 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 on main (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.

维护者速读

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.

What FROM (main) TO (this PR)
Install of a package of another namespace declaring a permission-set name a package holds refused, SecurityCatalogNameConflictError installed; both claims kept, each released by its own uninstall
A package of another namespace registering a set of that name at the item seam refused registered
Save, publish or restore of a set of that name into a package of another namespace, the name's holder shipping its set 422 NAMESPACE_CONFLICT saved
The same, where another package stores a set of the name (for example, a package duplicated into another namespace) 422 NAMESPACE_CONFLICT 422 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 in failed[], as on main. Kept apart per package by #32780
sys + crm, crm + sys, base + crm (either order, holder enabled or disabled) refused refused, same envelope
guest_portal held by crm, arriving from hr refused refused, same envelope
A package with no namespace beside crm; co-owners of one namespace; the environment's own set; a built-in name refused refused, same envelope
The save door's refusal sentence (422 NAMESPACE_CONFLICT, envelope unchanged), after the holders and the remedy (protocol-save-door-refusals.ts) "Positions, permission sets and capabilities each hold one name per deployment: … See ADR-0048." "A permission set holds one name per namespace: two packages of one namespace, a platform package (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."
Bare read, grant, clone or activation of a name two packages hold, naming no package (unreachable) 409 RESOURCE_CONFLICT naming both (#32162, #32164); a grant with no permission_set_package confers nothing

The difference from the sibling namespacedHoldersMeet (N3 condition 2), measured on the predicates themselves and pinned at all three doors:

pair sibling namespacedHoldersMeet permissionSetHoldersMeet
crm + hr (CONTROL) do not meet: both admitted do not meet: both admitted
sys + crm do not meet meet: refused, same envelope
base + crm do not meet meet: refused, same envelope
guest_portal, crm + hr do not meet meet: refused, same envelope
no namespace + crm meet meet: refused, same envelope

Owed rows closed before two holders of one name can exist (each carried on #31698):

  • 6776956342 row 1 — the security catalog reads a set two packages' metadata-service slots hold as a refusal naming both; a stored column reads its own package's slot.
  • row 2 — the packaged-set lock names every package that declares the name; its registry-less read goes to each holder.
  • row 3 and epic note 6776737317 — the security-catalog echo is kept per package: a permission projector event names the package its row landed in, every other echo slot is judged by its own row, a gone slot is removed from memory only.
  • row 4 — closed on main already (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's packageScopedRefusalOf in 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).
  • 6781866663 R1 — a binding read that fails keeps the package the existing slot names.
  • the package-less watcher deleted — MetadataManager.unregisterInMemory drops one registry slot and deletes from no loader; a peer that hears a removal naming a package drops that package's slot only.
  • the stale-slot drop removing storage — the echo never deletes a stored row.
  • N1 / N2 / N3 — the save-door collision refusal asks the predicate; the registry claim is a set; one predicate, both doors.
  • 6816011109 row 9 — pinned through this PR's doors (see Tests).
  • A grant whose package no longer serves its set confers nothing where another grant of the same user, set and organization is bound to the holder it reads; the bound grant and its validity window grant that set (staleGrantBesideBoundGrant, one rule read by the authorization resolver and the catalog reference boot report).
  • 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 (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 on main (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): CONTROL crm + hr admitted 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.
  • Row 9 (N3 condition 3), re-taken against main 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 on it (2f80f2897, merge commit a79fe6e12): a second holder beside a sys holder is refused at every door in both orders, the other holder disabled or the platform holder disabled; holdsPlatformPermissionSet for 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 name crm and hr hold, hr disabled, confers nothing, and the disabled holder's bound grant is never re-targeted (CONTROLs: each bound grant confers its own set). Green there: objectql protocol-permission-set-name-registry-reading.test.ts 18/18, core 3362/3362.
  • Core security-catalog.test.ts, resolve-authz-context.grant-set-by-name.test.ts; plugin-security security-catalog-echo.test.ts, packaged-permission-set-lock.test.ts, catalog-reference-report.test.ts; metadata metadata-manager-cluster.test.ts.
  • An organization administrator grants a set two namespaces hold, over the real registry (plugin-security 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.
  • A stored column reads inside its package's namespace (plugin-security 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 core security-catalog.test.ts and resolve-authz-context.grant-set-by-name.test.ts, plugin-security catalog-reference-report.test.ts, permission-set-address.test.ts, suggested-audience-bindings.test.ts.
  • Pins this hardening moves, read FROM → TO (the stored-column rule, ADR-0150 D8 R1): FROM "a stale package column reads as a reference with no package" TO "…within that package's namespace, where the registry knows it". The stale-column pins in the five files above now name a package of the holder's namespace, and a TO pin beside each reads a package of another namespace as a refusal.
  • The column-less arm asks the resolved holder's disabled state directly (68516172d), as holdsPlatformPermissionSet does, rather than through the item's package stamp alone: core security-catalog.test.ts, a disabled holder's set is not served with its item stamped or unstamped (CONTROL: enabled, it grants).
  • Pins moved after the merge-queue failure (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 on main. Each is now a CONTROL: core security-catalog.test.ts (com.acme.gone) and resolve-authz-context.grant-set-by-name.test.ts (com.acme.gone); plugin-security permission-set-address.test.ts (GONE), suggested-audience-bindings.test.ts (s_gone, and s_no_namespace added) and catalog-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 (core security-catalog.test.ts); ⛔ crm stores its set and hr saves one of the name: the save door answers 422 NAMESPACE_CONFLICT naming crm, and crm's set stays served at crm (objectql protocol-permission-set-name-registry-reading.test.ts, real composition).
  • The two dogfood files the queue ran (path-skipped on PR CI): packages/qa/dogfood/test/stored-reference-package-column.dogfood.test.ts and wall-package-doors-refusal.dogfood.test.ts, 30/30 on this branch merged with main 2f80f2897 (a79fe6e12).
  • A phase-1 pin this change moves, read FROM → TO (plugin-security 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; the everyone anchor's environment binding of the name is refused ambiguous-in-environment naming both, grants nothing through it, and the rest of the anchor still grants.

Acceptance notes

Verification

See the report comment for the gate list, exit codes and ablations.

Human Minimum

  • 1. Schemas start as Zod; packages/spec holds no runtime logic.
  • 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)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset.
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched: n/a)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English.
  • The Before Submitting list in CONTRIBUTING.md is done. (local subset per the report; the full farm is CI's)

Generated by Claude Code

🤖 Generated with Claude Code

https://claude.ai/code/session_01L6bhgW9bnkZxxN5KiRaPi9

… 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
… 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
@github-actions github-actions Bot added size/xl documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 12, 2026
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 5 package(s): @objectstack/core, @objectstack/metadata-protocol, @objectstack/metadata, @objectstack/objectql, @objectstack/plugin-security, touching 87 documentable anchor(s). ⚠️ 3 changed file(s) yielded no anchor (packages/core/src/index.ts, packages/core/src/security/index.ts, packages/objectql/src/security-catalog-namespace.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

53 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0.

⛔ 14 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 3 changed file(s) yielded no anchor (packages/core/src/index.ts, packages/core/src/security/index.ts, packages/objectql/src/security-catalog-namespace.ts) — pages documenting those are invisible to this run
  • 1 cross-cutting symbol(s) contributed no route anchor: userId (5 routes)
  • 4 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 62 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 6a5b6a286cb4a7bdb3511d750086dbbc6578911f — the merge of head a79fe6e12ea8157d2a722505ca81e19ef1ef5a09 into base 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 2f80f2897a4c484c9ff445d268ab83e1ce16a6d0 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

… 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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

Contract review + epic red-line read · 2026-11-12T14:51Z

Head-sha: 37f7bcf6abb03a187df895a4c4e5ea74ed976f16 (merge base with main: cac0f1a). Scope: all non-test source in the diff, plus the pins. Reviewed-by: session_01L6bhgXQnNkXTT1Wu7i7Y3i.
Verdict: PASS-with-nits. No must-fix.

Epic red lines

  1. Resolution never loosened: PASS. Admission happens only where two addresses exist; the stored-column rule only tightens.
  2. Ambiguity reported, never guessed: PASS. Two metadata slots or two holders give a refusal naming both (security-catalog.ts ~764-783). Lock, echo and ledger act per holder.
  3. Independently releasable: PASS. Additive. Positions, capabilities, the environment and built-ins keep one holder; declared.

Declarations. Clause-② yes (widening) matches in body and changeset. FROM→TO tables match the code: the install door, item seam and save door admit; sys / base / guest_portal / no-namespace / co-owner rows stay refused. One predicate: permissionSetHoldersMeet (packages/core/src/permission-set-holders.ts:52) has three callers, the registry (package door and item seam via securityCatalogHoldersOtherThan) and the save door. Nothing else spells it. Ruling A (6824698376) holds on this head: servable() gates both the registry item and the new metadata-slot read, so a disabled holder's bound grant confers nothing and is not re-targeted (row-9 pins :353-420). Every stored-column reader goes through storedPermissionSetScope into the one catalog arm; no bypass reader found; it fails closed when the column's package is missing or has no namespace.

Merge hazard with #32497. It is in the stored-column arm of resolvePermissionScoped (security-catalog.ts ~682-721). Whichever PR lands second keeps the disabled-holder check ahead of the slot read and re-takes the row-9 pins.

Before landing (text and declarations only, rides the main-merge push, no code round)

  1. The save door's 422 sentence tail changes (protocol-save-door-refusals.ts ~467-472: "one name per deployment … See ADR-0048" becomes "one name per namespace … See ADR-0150 D2"). The envelope (NAMESPACE_CONFLICT, 422) does not change. Add a FROM→TO row and drop "unchanged in envelope and sentence" from the body and changeset.
  2. Skills-docs: follow-up owed names its card: spec, docs: the permission-set name describe and the permission-sets page say one name per namespace #32758 (spec describe permission.zod.ts:1207-1208 and content/docs/permissions/permission-sets.mdx:430).
  3. Changeset levels: @objectstack/metadata and @objectstack/plugin-security are moved by the diff but take patch. Under AGENTS.md Post-Task 3, a Metadata-protocol: added kind takes at least minor on a moved package. Raise them, or cite the changeset gate's verdict.
  4. The body states that "Narrowing: no" covers the name rule, and that the stored-column rule is the declared hardening (the moved pins in five files carry FROM→TO).

Nits → follow-up #32753 (parked per 6824949405)

  • protocol-permission-set-name-registry-reading.test.ts:326 pins PERMISSION_SET_SHARED_NAMESPACES against [...RESERVED_NAMESPACES, 'sys'] and not against the registry's isShareableNamespace, so a change to that function alone would not go red.
  • catalog-reference-report.ts ~366: a stale column refused as ambiguous lands in the generic "does not resolve" bucket instead of the "outside namespace" line. It confers nothing either way.
  • security-catalog-echo.ts:317: the tenant-authored check asks the lock by bare name. With two holders, an environment-authored set bound to another namespace's package may classify as packaged. This is not verified; it needs a pin.

Measured at head (dependency closure built): objectql registry-reading 17/17; core security-catalog + grant-set-by-name 67/67; metadata cluster 61/61; plugin-security, 8 files, 171/171.
Ablations (each reverted): A, the predicate without the shared-namespace and guest_portal lines: 8 of 17 red. B, the save door with a plain namespace compare: 6 of 17 red. C, the item seam given no namespace: 2 red. D, the namespace check removed from the stored-column arm: core 2 of 67 and plugin-security 5 of 106 red.
Not checked: CI runs (the gate is on the landing head).


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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

Contract review delta (merge-forward) + epic red-line read · 2026-11-12T15:06Z

Head-sha: 3f931144b13df25d26b1f28ba13549d281f66358. Since the reviewed head (record 6826951220) there are two commits: a merge of main f7a0fe0, and one commit that touches only the changeset. Size: 36 files, +2434 −315 (2749 lines). Reviewed-by: session_01L6bhgXQnNkXTT1Wu7i7Y3i.
Verdict: PASS.

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 mutationEventPackage(packageId) in protocol-mutation-package.ts, so the PR's type-gated helper is renamed projectorEventPackage(type, packageId) and returns mutationEventPackage(packageId) for permission (with a stated binding) and {} otherwise. The six call sites (item save, commit, restore, rollback, the permission landing door, layered) are renamed one for one. The one change in meaning: the projector event's packageId now passes through main's boundPackageOf, so an empty id or the package-less 'sys_metadata' sentinel reads as null (no package), where the old helper passed the value through. That agrees with how the catalog echo reads a package-less row and confers nothing more. The red lines are unchanged.

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"; Skills-docs: follow-up owed — #32758; @objectstack/metadata and @objectstack/plugin-security are minor (Post-Task 3); and the body says "Narrowing: no" covers the name rule, with the stored-column rule as the declared hardening.
Measured by the card thread at this head: closure build and type-check of the 5 packages exit 0; metadata-protocol 22786, metadata 1884, core 3353, plugin-security 6524 (45 skipped), objectql 22/22. CI is the landing gate.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

ACCEPT · 2026-11-12T15:33Z

Head-sha: 3f931144b13df25d26b1f28ba13549d281f66358 · Tier S (no governed path in the diff; 36 files, +2434 −315 = 2749 lines, below 3000).

Land: ready + auto-merge.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 12, 2026 15:34
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 12, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43249280139 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Dogfood Regression Gate (2/3) — 失败步骤: Boot example apps and exercise real user flows

    @objectstack/dogfood:test:  FAIL   isolated  test/stored-reference-package-column.dogfood.test.ts > security and sharing references name the package that holds them (SQL driver, one database file) > C
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: expected '{"authenticated":true,"userId":"nfDoZ…' to be '{"authenticated":true,"userId":"nfDoZ…' // Object.is equality
    @objectstack/dogfood:test:  FAIL   isolated  test/wall-package-doors-refusal.dogfood.test.ts > [ADR-0131 D3 · #15204 W3] single (CONTROL): the refusal is inert > a `manage_metadata` holder below the o
      ↳ 失败原因: @objectstack/dogfood:test: AssertionError: {"success":false,"error":{"code":"PERMISSION_DENIED","message":"Managing packages requires the `manage_metadata` capability.","httpStatus":403}}: expected 40
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • test/stored-reference-package-column.dogfood.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • test/wall-package-doors-refusal.dogfood.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 5 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

Contract review delta + epic red-line read · 2026-11-12T18:45Z

Head-sha: a75461f301b09338339d4b28c5a6b0f48a709e6b. Delta from 6827316611: the merge-queue fix round (e6552b3, 6bc24b4), the hardening (6851617), and a merge of main at 776474e. Reviewed-by: session_01L6bhgXQnNkXTT1Wu7i7Y3i.
Verdict: PASS-with-nits. No must-fix.

  • Fix 1: the stored column of an unknown package. PASS. Only a column whose package the registry knows, with a namespace, bounds the read (security-catalog.ts ~625-643). Any other column falls back to the same unbound read as main (~720-725), so this adds no path.
    • Pins: security-catalog.test.ts ~532-539. With one holder the read resolves. With two holders it is refused ambiguous-in-environment, naming both. Also resolve-authz-context.grant-set-by-name.test.ts ~345-356: with two holders and an unknown column, the grant confers nothing. Ablating the guard turns 2 pins red.
    • Ruling A (6824698376) holds on a real registry. With crm and hr holding, an unknown, no-namespace or null column confers nothing, whether both are enabled or either one is disabled. A column naming the disabled holder confers nothing and is never re-targeted. The enabled holder's bound grant keeps its own set.
  • Fix 2: the save door and a stored set. PASS. The one new clause refuses where another package already stores a set of the name (protocol-save-door-refusals.ts ~425-461). The writer's own row is excluded. The install door and the item seam are unchanged, and a probe confirms both still admit. The sentence matches the body and the changeset. Pin plus CONTROL: protocol-permission-set-name-registry-reading.test.ts ~294-312. Ablating the clause turns it red.
  • Hardening. PASS. The column-less arm asks isPackageDisabled(outcome.holder.packageId) before servable() (~764). Pin ~322-332 covers a stamped item, an unstamped item, and an enabled CONTROL. Ablation turns exactly the unstamped case red.
  • Merge. A faithful union. The one conflict is in metadata-manager.ts. The removal record keeps both of 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's packagelessOnly checks and this PR's registryOnly check (~440-450). The receive seam skips loader copies only for registryOnly, and otherwise hands the removal to removeNodeLocalCopies as main does (~4291-4298). The origin-side carry and announce both survive.
  • Hazard 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. A trial merge conflicts in security-catalog.ts only, in the same two hunks as before; e6552b3 adds one comment line in hunk 1. Resolved as recorded on 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, that build type-checks and core src/security passes (71 files, 1386 tests).
  • Red lines 1–3 hold for this delta. Fix 1 restores main's answer, and fix 2 keeps main's 422. A refusal confers nothing and never picks a holder. There is still one predicate.

Measured at head:

  • core security-catalog + grant-set-by-name: 68/68
  • objectql registry-reading: 18/18
  • metadata-manager-cluster: 72/72
  • plugin-security (stale-grant and org-admin on a real registry, catalog-reference-report, permission-set-address, suggested-audience-bindings): 116/116

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):

  1. Option (b) has one consequence the body does not state and no pin covers. Once a second namespace's set of a name is saved beside crm's shipped set, crm's own save of that name is refused 422 naming hr, and so is a third namespace's. Nothing is conferred and nothing is written. Add a sentence and a pin, or carry it on 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.
  2. In that case the remedy text tells crm to "rename it in package hr", which reads oddly to the original holder.

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

epic:#31527#1 · os-sales · session_01L6bhgXQnNkXTT1Wu7i7Y3i

Merge-forward read + ACCEPT · 2026-11-12T19:34Z

Head-sha: a79fe6e12ea8157d2a722505ca81e19ef1ef5a09 · Tier S (36 files, +2509 −316 = 2825 lines against main, below 3000).

Land: ready + auto-merge.


Generated by Claude Code

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 5defbfe Nov 12, 2026
70 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-26yakz branch November 12, 2026 20:29
os-sales pushed a commit that referenced this pull request Nov 12, 2026
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
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

objectql: narrow the phase-1 one-holder refusal from environment to namespace for permission set (ADR-0150 child B, permission set family)

2 participants