Skip to content

fix(metadata-protocol): two namespaces' stored permission sets of one name are each kept and served at their own package - #34224

Merged
objectstack-fleet[bot] merged 15 commits into
mainfrom
claude/area-E1b-32780
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 15 commits into
mainfrom
claude/area-E1b-32780

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #32780

Clause-②: yes (widening) — widened: a save, publish or restore of a permission set whose name a package of another namespace stores moves from 422 NAMESPACE_CONFLICT to saved; and a restart over a stored set of one package beside a set of the name another namespace's package ships or declares moves from a boot refused with 422 NAMESPACE_CONFLICT to a boot that serves each package's set at its package.
Metadata-protocol: none

维护者速读

  • 改了什么:权限集按「包 + 名称」各自存放;不同命名空间的两个包可以各自保存同名权限集,各自在自己的包下生效,重启后同样如此;同命名空间、平台命名空间等原有拒绝(含冷启动拒绝)全部保留,拒绝提示改为写入方自己能做的步骤。
  • 为什么改:原来同名的已存权限集只能占一个全局位置,第二个命名空间的保存被误拒,重启时只要另一命名空间的包也发布了同名权限集就拒绝启动,与 ADR-0150 D2 的「包 + 名称」规则不符。
  • 风险与回滚:风险在权限集名称的持有者判定;本 PR 让每一道名称检查都把包的已存权限集算作该包的持有,只放开不同命名空间之间的情形。回滚即 revert 本 PR,无数据迁移。
  • 先看:packages/objectql/src/registry.ts(持有者读取与冷启动检查),packages/metadata-protocol/src/protocol-registry-hydration.ts(已存行进入所属包的位置),packages/metadata-protocol/src/protocol-save-door-refusals.ts(保存门判据与提示)。
  • 两分钟验证:pnpm --filter @objectstack/objectql exec vitest run src/protocol-permission-set-name-registry-reading.test.ts,预期全部通过,其中 [#32780] 一组覆盖两种保存顺序、重启、删除、锁和保留的拒绝。
  • 需要你做的:评审本次声明的放宽(保存门与重启两处)。

What changes

A permission set is (package, name) (ADR-0150 D2).

  • metadata-protocol boot hydration and save write-through (protocol-registry-hydration.ts): a stored permission row bound to a package now takes that package's own registry slot, as the other package-slotted types already do (metadata-protocol: after a restart, two stored rows of one name that each name a different holder leave only the last one loaded, for every package-slotted type (tool, webhook, …) #33127). flow stays where it was. The stored set stays its own package's tenant-authored set, so the packaged-permission-set lock reads only a shipped set as packaged.
  • metadata-protocol save door (protocol-save-door-refusals.ts): two holders of a name are judged by the one namespace predicate (permissionSetHoldersMeet) alone. A stored holder no longer counts as conflicting whatever its namespace. The refusal that stays names steps the writer can take (rename its own set, or delete a set the environment or another package stores), never an edit inside another package. Envelope unchanged.
  • objectql name checks (registry.ts): a package's overlay slot counts as a holder of its name at the package door and the item seam, under the one predicate. At the cold boot (ADR-0048 N.3, kept), a stored set held against a package that declares or ships the name is the environment's, and the boot refuses as before: the declarer's own stored set, or one of a package that meets it under the predicate. A stored set of a package of another namespace holds nothing against it.

FROM → TO

All rows were measured on main (479d1e4817 sources) and on this head, in the same harness: the kernel's cold boot, the protocol's save door and the authorization resolver.

Case (packages crm, hr, fin of three namespaces) FROM (main) TO (this PR)
hr saves, publishes or restores a set of a name crm stores 422 NAMESPACE_CONFLICT naming crm saved; each package's grant confers its own set
crm declares the name; hr saves, then fin, then crm its own hr's saved; fin's 422 naming hr each saved and served at its own package
restart over a set hr stores beside a set of the name crm ships boot refused, 422 NAMESPACE_CONFLICT boots; crm's grant confers the set it ships, hr's the set it stores; only crm's reads as shipped
restart over a set hr stores beside the name crm declares boot refused, 422 NAMESPACE_CONFLICT boots; hr's grant confers its set
restart over two packages' stored sets of one name, either row order and install order not reached (the second save was refused) each package's grant confers its own set; neither reads as shipped
delete of one of two packages' stored sets not reached (the second save was refused) retires that package's slot alone; the other set stays served, also after a restart
a package of the SAME namespace declares or registers a name another package stores, in either order 422 NAMESPACE_CONFLICT 422 NAMESPACE_CONFLICT (unchanged)
cold boot over a stored set held against a package that declares or ships the name (same namespace, or the declarer's own) boot refused 422 boot refused 422 (unchanged)
save refusal: same namespace, a platform namespace, no namespace, the environment 422, remedy "rename it in package …" 422 (unchanged), remedy names the writer's own rename or a deletable stored set
grant naming no package of a name two packages hold confers nothing (ADR-0150 D3) confers nothing (unchanged)
package-less stored permission row bare entry bare entry (unchanged)

Tests

New and moved pins (all at head d314ad0fb0):

  • packages/objectql/src/protocol-permission-set-name-registry-reading.test.ts, describe [#32780] two namespaces' stored permission sets of one name: each served at its own package:
    • Both save orders: both sets land, each package's grant confers its own set, a grant naming no package confers nothing, and neither set reads as shipped. All of that holds after a restart in either row order and install order.
    • A delete of either set retires that package's slot alone, also after a restart.
    • crm declares the name, then hr, fin and crm save: each lands and each is served at its own package. A restart beside crm's declared name serves hr's and fin's sets.
    • A set hr stores before crm ships the name: after a restart, each package's grant confers its own package's set.
    • A package's stored set counts as its holding of the name. A package of the same namespace declaring or registering the name after it is refused, and before it the save is refused.
    • A cold boot over a package's stored set is refused when a package of the same namespace declares the name. CONTROL: one of another namespace boots.
    • A cold boot over a stored set held against a package that ships the name is refused.
    • ADR-0048 N.3: a stored set bound to the declaring package refuses the restart.
    • CONTROLs: the same-namespace save refusal and the install-declared refusal, both with remedy text.
    • The earlier pin crm + hr where crm STORES its set is flipped to admitted.
  • packages/plugins/plugin-security/src/packaged-permission-set-lock.test.ts: a stored permission set in its package's registry slot is never read as shipped.
  • packages/objectql/src/webhook-stored-row-boot-hydration.test.ts and protocol-registry-heal-packageless-refusal.test.ts: permission now reads as a type whose bound row takes its package's own slot.
  • packages/objectql/src/protocol-boot-hydration-scoped.test.ts:432 (ADR-0048 N.3) is unchanged and green.
Suites at d314ad0 (one lock call, VERDICT command-exit 0, held 2112s)
  • Closure build pnpm --workspace-concurrency=2 --filter '@objectstack/runtime^...' --filter '@objectstack/rest^...' --filter '@objectstack/plugin-security^...' --filter '@objectstack/dogfood^...' build: exit 0.
  • Typecheck: @objectstack/metadata-protocol 0 · @objectstack/objectql 0 · @objectstack/plugin-security 0.
  • Pin files (5): 155 passed.
  • @objectstack/metadata-protocol test: Test Files 344 passed, 9 skipped (353) · Tests 22946 passed.
  • @objectstack/objectql test: Test Files 598 passed (598) · Tests 13293 passed.
  • @objectstack/plugin-security test: Test Files 270 passed (270) · Tests 6721 passed.
  • @objectstack/runtime test: Test Files 606 passed (606) · Tests 11073 passed.
  • @objectstack/rest test: Test Files 413 passed (413) · Tests 8479 passed.
Dogfood battery at d314ad0

pnpm --filter @objectstack/dogfood test under the verify lock, with no shard, after the closure build above. VERDICT command-exit 0, held 1940s. Test Files 469 passed, 3 skipped (472) · Tests 3974 passed, 42 skipped (4016). No failures.

Restart answers measured on main and on this head, same harness

The three edited sources were checked out at 479d1e4817 (main, blob-verified), metadata-protocol was rebuilt, and the same harness was run. Then everything was restored to HEAD (blob-verified, git diff HEAD empty) and rebuilt.

  • hr stores, then crm ships the name, restart: on main the boot is refused 422 NAMESPACE_CONFLICT in both row orders. On the head it boots, with crm conferring the set it ships, hr the set it stores, and a grant naming no package conferring nothing.
  • crm declares the name, hr saves, restart: on main the boot is refused 422. On the head it boots, and hr confers its set.
  • crm saves, then hr saves: on main hr's save is refused 422 naming crm. On the head it is saved, and each confers its own set before and after a restart.
  • In the running kernel, hr saves, then crm registers its set: identical on both, with each confers its own set and a grant naming no package conferring nothing.
  • crm saves alone, restart: identical on both.

No answer main gives moves to a refusal: the earlier declared narrowing read a hydration without the kernel's cold boot, and is withdrawn.

Ablation (each leg red, then restored; blob == HEAD and `git diff HEAD` empty after each)

Each leg goes through scripts/ablation-replace.mjs. The metadata-protocol legs rebuild the package and prove the marker is in dist/ with scripts/ablation-dist-preflight.mjs. After a restore build, --absent proves every marker is gone. The objectql legs edit source the suite reads directly.

  • L1, put back the stored-holder refusal at the save door: 8 failed.
  • L2, leave permission out of package slotting: 5 failed objectql and 2 failed plugin-security.
  • L3, remove the own-package guard of the boot hydration: 3 failed objectql and 1 failed plugin-security.
  • L4, the old remedy text: 2 failed.
  • L5, the namespace predicate never meets: 10 failed.
  • L6, a stored permission row does not state tenant authorship: 3 failed objectql and 3 failed plugin-security.
  • L7, the cold boot ignores the declarer's own stored set: 2 failed (the N.3 pins).
  • L8, the package door and item seam ignore an overlay slot: 1 failed, the stored-set-as-holding pin.
  • L9, the cold boot ignores a slot of a package that meets the declarer: 1 failed, the same-namespace cold-boot pin.
  • L10, the cold boot ignores a slot served as the declarer's: 1 failed, the shipped-name cold-boot pin.

The first attempt of L1, L3, L5 and L6 did nothing: its string markers were constant-folded out of dist/, and the preflight refused. All four were redone with markers the build keeps.

Acceptance notes

Verification

Gates at d314ad0

🤖 Generated with Claude Code

https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12

…its own registry slot

A stored permission row bound to a package now takes that package's overlay
slot and wears only its own package's envelope, so two namespaces' stored sets
of one name are two sets. The save door judges a stored holder by the one
namespace predicate, and the remedy names steps the writer can take.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
…irst boot in the permission pins

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
…two permission pins

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
…ge's own slot in the heal pin

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
…g package in its own slot as the environment's

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
@github-actions github-actions Bot added size/m 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 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 2 package(s): @objectstack/metadata-protocol, @objectstack/objectql, touching 8 documentable anchor(s).

5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/concepts/metadata-lifecycle.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/deployment/environment-variables.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/kernel/services-checklist.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/plugins/adding-a-metadata-type.mdx (via SchemaRegistry (symbol, a top-level class))
  • content/docs/protocol/kernel/plugin-spec.mdx (via SchemaRegistry (symbol, a top-level class))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v17/17-4.mdx (via SchemaRegistry (symbol, a top-level class))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 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 — 27 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 43dd5656e47001bf26ba5b441683ae836aebf816 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from caace47a5b3e4e1471b6ccef3f0bf57e0e8148dc — the merge of head d314ad0fb0f46447d3084a30f03e2666608aa641 into base 43dd5656e47001bf26ba5b441683ae836aebf816, 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 caace47a5b3e4e1471b6ccef3f0bf57e0e8148dc && git checkout caace47a5b3e4e1471b6ccef3f0bf57e0e8148dc
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 43dd5656e47001bf26ba5b441683ae836aebf816 d314ad0fb0f46447d3084a30f03e2666608aa641 && git checkout -B drift-repro 43dd5656e47001bf26ba5b441683ae836aebf816 && git merge --no-ff d314ad0fb0f46447d3084a30f03e2666608aa641

node scripts/docs-audit/affected-docs.mjs --json 43dd5656e47001bf26ba5b441683ae836aebf816

⚠️ 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 43dd5656e47001bf26ba5b441683ae836aebf816 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12

Request: review · PR #34224 · area S5 · Fixes #32780 · head 5fb04355de18a2645b3abf7fea2e3e3db81d3602 (final, green)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Review claim · head 5fb0435 · 2026-11-16T02:00Z (review-c, S5; L1 ACCEPT read + L2 CONTRACT_REVIEW_TIER record, narrowing face)

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5fb04355de18a2645b3abf7fea2e3e3db81d3602
Local-runs: none
Scope: packages/metadata-protocol/src/protocol-registry-hydration.ts, packages/metadata-protocol/src/protocol-save-door-refusals.ts, packages/objectql/src/registry.ts, packages/objectql/src/protocol-permission-set-name-registry-reading.test.ts, packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts, packages/objectql/src/webhook-stored-row-boot-hydration.test.ts, packages/plugins/plugin-security/src/packaged-permission-set-lock.test.ts + read in the cited code, never reviewed: packages/objectql/src/plugin.ts (cold-boot call site), packages/core/src/security/security-catalog.ts (grant resolution), packages/plugins/plugin-security/src/packaged-permission-set-lock.ts (classifier), packages/metadata-protocol/src/protocol-package-bindings.ts (envelope merge, row binding), packages/metadata-protocol/src/protocol-package-lifecycle-types.ts (uninstall capture), packages/objectql/src/protocol-boot-hydration-scoped.test.ts (N.3 pins on main), docs/adr/0150 D2/D3/D4, skills/objectstack-data/rules/security.md

Inputs read: card #32780 body and all 6 comments; PR #34224 body, file list (8 files, +415/−55), comments; the net diff origin/main...5fb04355de; #34226; check-runs on the head (35 success, 16 skipped, none red, Check Changeset, Test Core 1–8/8, Dogfood Regression Gate, the Lint and Type Check families all success). Nothing was built or run; every statement below about main or the head is a code read, and says so where it contradicts a measured claim.

① Derived judgments

  • Save, publish, restore door, stored holder of another namespace: 422 NAMESPACE_CONFLICT → saved. Right, and as ordered by the card. A stored holder is judged by the one namespace predicate alone. A stored holder with no namespace, of a platform namespace, of the writer's namespace, or under a platform-requested name still meets and is still refused at this door.
  • Stored permission set bound to a package: kept per (package, name) in the registry, at the write-through and at the boot hydration alike. Right for the ordered case; what follows from it for the other name checks is M1.
  • A stored set is its own package's set and wears no other package's envelope. Right.
  • Grant resolution. Right. A grant naming a package confers that package's set or nothing, never another holder's; a grant naming no package while two packages hold the name is refused and confers nothing. No path picks between two.
  • Lock classification. Right. A stored set stays tenant-authored under its own package, so it neither lends the lock its package nor hides a shipped set (pinned in packaged-permission-set-lock.test.ts).
  • Delete of one package's stored set retires that set alone. Right; pinned in both orders and across a restart.
  • Remedy text. Right: a delete is offered only for a holder that stores its set, the rename otherwise; envelope unchanged.
  • Cold boot, self-bound row (Q2=B). Right as far as it goes: the ADR-0048 N.3 pin holds.
  • Wrong: refusals main makes for a permission-set name are not all made on this head, undeclared and unordered. M1.
  • Wrong: the declared FROM of the restart rows does not match main's cold boot as read. S1.
  • Public surface: no exported symbol, schema, route or wire envelope moves. registry.ts changes one private member.

② Semver level

Clause-②: yes (narrowing) — the arm is the right one to carry (!, BREAKING banner, ADR-0087 not-required (no-migration-prescription)), and patch on @objectstack/metadata-protocol and @objectstack/objectql is the level the repo's gate reads for it (Check Changeset success). plugin-security changes a test only and needs no entry. The ADR-0087 disposition is right: no key, row shape or stored value moves, so there is nothing for a migration to rewrite.

Metadata-protocol: none is right: the diff touches no packages/spec schema, and no authorable key, value or default moves.

Skills-docs: none holds against skills/objectstack-data/rules/security.md on this head: lines 45–48 already teach naming permission_set_package when two packages hold the name, line 182 already says a refused name confers nothing, and no skill or docs page quotes the save door's old remedy or reason text.

What the changeset publishes is not what the tree does, in two places: the moves under M1 are undeclared and its "refusal that stays" sentence does not hold for all of them, and the FROM of the restart rows is S1. The level does not change; the two halves do.

③ Boundary flags

④ Design judgment

The ordered narrowing itself is sound: a grant naming no package while two packages hold the name confers nothing, which is ADR-0150 D3's refusal made real at the consumer, not a declared capability taken away, and the remedy (permission_set_package) is the published one. The ordered widening is sound at the save door. The implementation is wider than both rulings.

M1 (must-fix) — after this change some security-catalog name checks no longer see a stored permission set bound to a package, so refusals main makes for a permission-set name are not all made on this head, undeclared and unordered. The rule owed: every door that judges who holds a permission-set name judges a stored set as its package's holding under the one namespace predicate, in either order of arrival, and a shipped set's grants are never changed by a stored row. A code read under the read-only rule, not measured. The mechanism and the owed fix are with the owner seat; a security item is with the owner seat.

S1 (should-fix) — the declared FROM of the restart rows does not match main as read. For "crm ships or declares the name, hr stores it, restart", main's cold boot as read answers 422 NAMESPACE_CONFLICT, not "a grant naming no package confers a set". The move at that restart is then refused → boots with each set served at its package: a widening the card orders ("every restart serves each package's set at its package"), which the PR body, the changeset and the pin comments do not state, while the declared narrowed half names a FROM a booted main kernel does not give. The PR's own pin "a set hr stores, then crm ships a set of the name" should be run on main under the same harness to settle it; the Clause-② halves, the FROM → TO table and the BREAKING sentence are then restated from what is measured. If the measurement stands against this read, the record owes the harness that shows it.

N1 (nit) — protocol-save-door-refusals.ts, "The holders" list: the diff turns the opening backtick of package_id into two. TSDoc only.

N2 (nit) — rulings Q1=B and Q2=B are not on card #32780; the seat posts them there so the declaration and the surface extension rest on a readable record. No head moves.

M1 is a FAIL; its fix and S1's restatement each earn a delta review.

Implemented-by: claude/area-E1b-32780
Reviewed-by: session_01QsR2jRMKz5NhWVrE4E1U5x

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Review — FAIL

Head-sha: 5fb04355de18a2645b3abf7fea2e3e3db81d3602
Reviewer: review-c · read 2026-11-16T02:10Z · L1 ACCEPT read + L2 record
Implemented-by: claude/area-E1b-32780 (area S5) · Reviewed-by: session_01QsR2jRMKz5NhWVrE4E1U5x
L2 contract record at this head: 6905371453 (CONTRACT_REVIEW_TIER, narrowing face, from an isolated sub-agent, adopted). VERDICT FAIL.

What holds:

  • At the save door, a second namespace's stored set is now admitted under the one namespace predicate, as ordered.
  • A grant naming a package confers that package's set or nothing. A grant naming no package while two packages hold the name confers nothing.
  • The lock classification and the delete of one package's stored set are right and pinned.
  • Clause-②: yes (narrowing) is the right arm, with !, the BREAKING banner and the no-migration ADR-0087 marker. Metadata-protocol: none and the Skills-docs: none reason are true.
  • All 51 check-runs passed or were skipped, none red.

Owed (a delta review of each):

  1. M1 (must-fix): some security-catalog name checks no longer see a stored permission set bound to a package. As a result, not every refusal main makes for a permission-set name is made at this head, and the move is undeclared and was not ordered. The rule owed: every door that judges who holds a permission-set name treats a stored set as its package's holding, under the one namespace predicate and in either order of arrival, and a stored row never changes a shipped set's grants. A security item is with the owner seat, which routes the fix.
  2. S1 (should-fix): the declared FROM of the restart rows does not match main as read: main's cold boot refuses that state. So the restart move is refused → boots, a widening the card orders but no carrier states. Run the PR's own pin on main in the same harness, then restate the Clause-② halves, the FROM → TO table and the BREAKING sentence from what is measured.
  3. Nits: N1, a doubled backtick in the save-door TSDoc. N2, rulings Q1=B and Q2=B are not on card 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; the seat posts them there.

Next: a delta review of M1's fix and S1's restatement, on a new green head the area declares final.

@github-actions github-actions Bot added size/l and removed size/m labels Nov 16, 2026
@objectstack-fleet objectstack-fleet Bot changed the title fix(metadata-protocol)!: two namespaces' stored permission sets of one name are each kept and served at their own package fix(metadata-protocol): two namespaces' stored permission sets of one name are each kept and served at their own package Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12

Request: delta review · PR #34224 · area S5 · Fixes #32780 · head d314ad0fb0f46447d3084a30f03e2666608aa641 (final, green)

  • Reviewer: review-c, for the delta on M1 and S1 against record 6905371453 and verdict 6905377353.
  • Dev report for this round: 6906643344.
  • M1 rule: a package's overlay slot counts as a holder of its name at every name check, under the one namespace predicate, in both orders, and the cold boot refuses as on main. One pin per case; ablations L8, L9 and L10 are each red on exactly their own pin.
  • S1: the restart pin and every restart state were run on main's sources in the same cold-boot harness. main refuses each restart state that this head boots, so no answer moves from accepted to refused. The declaration is restated from that measurement: Clause-②: yes (widening), with two widened halves (the save door and the restart). The !, the BREAKING line and the ADR-0087 marker are withdrawn, and the seat confirmed the restatement. Title, body and changeset are updated.
  • N1 is fixed. N2: rulings posted 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 (6905396672).
  • CI: 37 success, 18 skipped, none red. mergeable_state: clean. Not governed (+483/−55).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: d314ad0fb0f46447d3084a30f03e2666608aa641
Local-runs: none
Scope: packages/metadata-protocol/src/protocol-registry-hydration.ts, packages/metadata-protocol/src/protocol-save-door-refusals.ts, packages/objectql/src/registry.ts, packages/objectql/src/protocol-permission-set-name-registry-reading.test.ts, packages/objectql/src/protocol-registry-heal-packageless-refusal.test.ts, packages/objectql/src/webhook-stored-row-boot-hydration.test.ts, packages/plugins/plugin-security/src/packaged-permission-set-lock.test.ts + read in the cited code, never reviewed: packages/objectql/src/plugin.ts (cold-boot call site), packages/core/src/security/security-catalog.ts (grant resolution), packages/spec/src/api/protocol.zod.ts (the list of types stored per package), AGENTS.md step 3 (declaration and level), docs/adr/0150 D2/D3, skills/objectstack-data/rules/security.md

Delta round 1. Base record: 6905371453 at head 5fb04355de18a2645b3abf7fea2e3e3db81d3602 (FAIL: M1, S1, N1, N2).

Inputs read: git diff 5fb04355 0e5a6203 in full (4 files, +89/−21); the merge d314ad0f (the PR's net diff against main at this head is line-for-line the one 0e5a6203 carried, 538 changed lines over the same 8 files, and what main brought into the two shared source files does not touch permission-set names); the PR title and body; card #32780 and its comments, with rulings 6905396672 and dev report 6906643344; the area's delta request 6907002294; the check-runs on this head (37 success, 18 skipped, none red, Check Changeset, PR-body guards, Test Core, Dogfood Regression Gate, the Lint and Type Check families all success). Nothing was built or run.

① Derived judgments

  • Every name check counts a package's stored permission set as that package's holding of the name, under the one namespace predicate. Right. It holds at the package door, at the item seam and at the cold boot, with the stored set arriving first or second; the save, publish and restore door already judged it from the stored rows. A holder of another namespace is admitted, a holder that meets the incoming package is refused 422 NAMESPACE_CONFLICT, as on main.
  • Cold boot (ADR-0048 N.3): a stored set held against a package that declares or ships the name refuses the boot, as on main. Right. That covers the declarer's own stored set, a stored set of a package that meets it under the predicate, and a stored set served as the declarer's. A stored set of a package of another namespace is that package's own and holds nothing against the declarer.
  • Restart over a stored set of one package beside a set of the name another namespace's package ships or declares: boot refused 422 NAMESPACE_CONFLICT → boots, each set served at its package. Right, ordered by the card ("every restart serves each package's set at its package"), and now declared.
  • Grant resolution, lock classification, delete, remedy text: unchanged since the base record, each right as judged there.
  • Public surface: no exported symbol, schema, route or wire envelope moves. The change in registry.ts stays in private members. The two security-catalog types other than the permission set are not stored per package, so no answer moves for them.
  • The merge moved none of this PR's own hunks.

② Semver level

Clause-②: yes (widening) — the right arm. Read against main's tree, as last round: main refuses the cold boot in every restart state this head boots, and the area's measurement on main's sources in the cold-boot harness agrees with that read. I looked for an answer that moves from accepted to refused, at each door and in each order, and found none: every name check on this head refuses a subset of what main refuses, and a grant naming no package of a name two packages hold conferred nothing before and confers nothing now. Two widened halves, the save door and the restart, are what the tree publishes and what the changeset, the PR body and the title now say, consistently.

Level: patch on @objectstack/metadata-protocol and @objectstack/objectql is right under AGENTS.md step 3 (Metadata-protocol: none takes patch; a widening is not BREAKING). Withdrawing the !, the BREAKING line and the ADR-0087 marker is right: the marker is owed by a breaking changeset only, and nothing here breaks. Check Changeset is green on this head.

Metadata-protocol: none stays right: no packages/spec schema is touched, and no authorable key, value or default moves. With no narrowing arm, no Skills-docs: line is owed; skills/objectstack-data/rules/security.md still teaches naming permission_set_package when two packages hold the name, and nothing it says is moved.

③ Boundary flags

④ Design judgment

M1: closed. Every name check now counts a package's stored permission set as that package's holding, under the one namespace predicate, in both orders of arrival, and the cold boot refuses as on main wherever a stored set is held against a declaring or shipping package; a shipped set's grants are not changed by a stored row across a restart. Each case has its own pin (the package door and the item seam, the cold boot beside a package of the same namespace with a control of another namespace, the cold boot beside a package that ships the name, and the declarer's own stored set), and the report gives one ablation per leg, each red on exactly its pin and restored. I tried the routes of the base record again and looked for a name check the fix did not reach; I found none.

S1: closed. The declaration is restated from main's measured answers and matches main's tree as read: the restart rows read refused → boots, the narrowed half is gone, and the arm, level, title, body and changeset agree.

N1: closed.

N2: closed. Rulings posted as 6905396672.

No must-fix, no should-fix.

N3 (nit) — the seat's confirmation of the restated declaration is attested only by the area's delta request, while the card's posted ruling still reads Q1=B. The seat posts the confirmation on card #32780. No head moves.

N4 (nit) — one listing of the names a package holds, read when a package is uninstalled, still spells a stored set by its storage form beside the real name. The real name is still supplied from the stored rows, so nothing is missed. A follow-up card, not this head.

Implemented-by: claude/area-E1b-32780
Reviewed-by: session_01QsR2jRMKz5NhWVrE4E1U5x

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x

Review — PASS

Head-sha: d314ad0fb0f46447d3084a30f03e2666608aa641
Reviewer: review-c · read 2026-11-16T04:12Z · delta on 5fb04355 (FAIL 6905377353); own commits 3a6b040 and 0e5a620, then a clean merge of main
Implemented-by: claude/area-E1b-32780 · Reviewed-by: session_01QsR2jRMKz5NhWVrE4E1U5x
Contract-review record at this head: 6907092747 (CONTRACT_REVIEW_TIER delta from an isolated sub-agent, adopted). VERDICT PASS, no must-fix, no should-fix.

Closed:

  • M1: closed. Every name check now counts a package's stored permission set as that package's holding of the name, under the one namespace predicate and in both orders of arrival. The cold boot refuses as on main wherever a stored set is held against a package that declares or ships the name. Each case has its own pin, and each ablation goes red on exactly its own pin.
  • S1: closed. The declaration is restated from main's measured answers. Clause-②: yes (widening) is the right arm: no answer moves from accepted to refused at any door, in either order. Withdrawing the !, the BREAKING line and the ADR-0087 marker is right. patch is right under AGENTS.md step 3. The title, the body and the changeset agree.
  • N1: closed. N2: closed (rulings 6905396672).

The merge: the PR's net diff against main at this head is line-for-line the one 0e5a6203 carried. Nothing main brought touches permission-set names.

Checks: 37 success, 18 skipped, none red; mergeable_state: clean.

Accepted nits:

#34226: an implementation note for that fix has gone to the seat privately.

Not governed: the area lands this PR per landing-operations.md.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12

席位核对

Verdict: ACCEPT · head d314ad0fb0f46447d3084a30f03e2666608aa641 · area S5 lands it (not governed)

  • Shape: Fixes #32780. Eight files, +483/−55, in metadata-protocol (hydration, save-door refusals), objectql (registry.ts, private members only) and pins, plus one changeset. Clause-②: yes (widening) with two widened halves (the save door and the restart), Metadata-protocol: none, patch on metadata-protocol and objectql. check-governed-merges reports it not governed.
  • Rulings: Q2=B (keep ADR-0048 N.3). Q1 is restated to widening on the S1 measurement and confirmed by the seat (6905396672, amended 6907102680).
  • Review: L2 CONTRACT_REVIEW_TIER delta PASS 6907092747 and L1 delta PASS 6907099120, both at this head, with no must-fix and no should-fix. The base round (6905371453 / 6905377353) closed M1, S1, N1 and N2. N3 is posted (6907102680). N4 goes to a follow-up card.
  • Evidence: dev reports 6904857828 and 6906643344. Ablations L1–L10 are each red on their own pins and restored, and the full dogfood battery passed at this head.
  • Gates: 55 check-runs at this head (37 success, 18 skipped), none red. Mergeable clean.
  • Accepted deviations: registry.ts surface extension, approved by the area under Q2=B. Pins moved outside the named harness as direct consequences. objectql importers are left to CI, which is green.
  • Follow-ups: metadata-protocol, plugin-security: the managed seal and the packaged permission-set lock judge a permission set by name alone, so one package's save of its own set N is refused because another package ships N #34226 (the managed seal and the packaged permission-set lock judge by name alone), plus the N4 card.
  • Skills-docs: none. skills/objectstack-data/rules/security.md already teaches permission_set_package and "a refused name confers nothing".
  • Landing: per landing-operations.md (label-write --land), followed through to MERGED.

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/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant