Repository navigation
fix(metadata-protocol): two namespaces' stored permission sets of one name are each kept and served at their own package - #34224
Conversation
…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
…wn package Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
…rt pin Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
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
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
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 27 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 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
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12 Request: review · PR #34224 · area S5 · Fixes #32780 · head
|
|
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) |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Contract reviewServed-tier: Inputs read: card #32780 body and all 6 comments; PR #34224 body, file list (8 files, +415/−55), comments; the net diff ① Derived judgments
② Semver levelClause-②: yes (narrowing) — the arm is the right one to carry (
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 judgmentThe 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 ( M1 (must-fix) — after this change some security-catalog name checks no longer see a stored permission set bound to a package, so refusals S1 (should-fix) — the declared FROM of the restart rows does not match N1 (nit) — 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: VERDICT: FAIL |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Review — FAILHead-sha: What holds:
Owed (a delta review of each):
Next: a delta review of M1's fix and S1's restatement, on a new green head the area declares final. |
…e at every security-catalog name check Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
…start answers Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12
|
domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12 Request: delta review · PR #34224 · area S5 · Fixes #32780 · head
|
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Contract reviewServed-tier: Delta round 1. Base record: 6905371453 at head Inputs read: ① Derived judgments
② Semver levelClause-②: yes (widening) — the right arm. Read against Level:
③ Boundary flags
④ Design judgmentM1: 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 S1: closed. The declaration is restated from 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: VERDICT: PASS |
|
domain:server#5 · zhuangjianguo · session_01QsR2jRMKz5NhWVrE4E1U5x Review — PASSHead-sha: Closed:
The merge: the PR's net diff against Checks: 37 success, 18 skipped, none red; Accepted nits:
#34226: an implementation note for that fix has gone to the seat privately. Not governed: the area lands this PR per |
|
domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12 席位核对Verdict: ACCEPT · head
|
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_CONFLICTto 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 with422 NAMESPACE_CONFLICTto a boot that serves each package's set at its package.Metadata-protocol: none
维护者速读
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-protocolboot 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).flowstays 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-protocolsave 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.objectqlname 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(479d1e4817sources) and on this head, in the same harness: the kernel's cold boot, the protocol's save door and the authorization resolver.crm,hr,finof three namespaces)hrsaves, publishes or restores a set of a namecrmstores422 NAMESPACE_CONFLICTnamingcrmcrmdeclares the name;hrsaves, thenfin, thencrmits ownhr's saved;fin's422naminghrhrstores beside a set of the namecrmships422 NAMESPACE_CONFLICTcrm's grant confers the set it ships,hr's the set it stores; onlycrm's reads as shippedhrstores beside the namecrmdeclares422 NAMESPACE_CONFLICThr's grant confers its set422 NAMESPACE_CONFLICT422 NAMESPACE_CONFLICT(unchanged)422422(unchanged)422, remedy "rename it in package …"422(unchanged), remedy names the writer's own rename or a deletable stored setTests
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:crmdeclares the name, thenhr,finandcrmsave: each lands and each is served at its own package. A restart besidecrm's declared name serveshr's andfin's sets.hrstores beforecrmships the name: after a restart, each package's grant confers its own package's set.crm + hr where crm STORES its setis 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.tsandprotocol-registry-heal-packageless-refusal.test.ts:permissionnow 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)
pnpm --workspace-concurrency=2 --filter '@objectstack/runtime^...' --filter '@objectstack/rest^...' --filter '@objectstack/plugin-security^...' --filter '@objectstack/dogfood^...' build: exit 0.@objectstack/metadata-protocol0 ·@objectstack/objectql0 ·@objectstack/plugin-security0.@objectstack/metadata-protocoltest: Test Files 344 passed, 9 skipped (353) · Tests 22946 passed.@objectstack/objectqltest: Test Files 598 passed (598) · Tests 13293 passed.@objectstack/plugin-securitytest: Test Files 270 passed (270) · Tests 6721 passed.@objectstack/runtimetest: Test Files 606 passed (606) · Tests 11073 passed.@objectstack/resttest: Test Files 413 passed (413) · Tests 8479 passed.Dogfood battery at d314ad0
pnpm --filter @objectstack/dogfood testunder 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-protocolwas rebuilt, and the same harness was run. Then everything was restored toHEAD(blob-verified,git diff HEADempty) and rebuilt.hrstores, thencrmships the name, restart: onmainthe boot is refused422 NAMESPACE_CONFLICTin both row orders. On the head it boots, withcrmconferring the set it ships,hrthe set it stores, and a grant naming no package conferring nothing.crmdeclares the name,hrsaves, restart: onmainthe boot is refused422. On the head it boots, andhrconfers its set.crmsaves, thenhrsaves: onmainhr's save is refused422namingcrm. On the head it is saved, and each confers its own set before and after a restart.hrsaves, thencrmregisters its set: identical on both, with each confers its own set and a grant naming no package conferring nothing.crmsaves alone, restart: identical on both.No answer
maingives 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. Themetadata-protocollegs rebuild the package and prove the marker is indist/withscripts/ablation-dist-preflight.mjs. After a restore build,--absentproves every marker is gone. Theobjectqllegs edit source the suite reads directly.permissionout of package slotting: 5 failedobjectqland 2 failedplugin-security.objectqland 1 failedplugin-security.objectqland 3 failedplugin-security.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
objectql/src/registry.tsis in scope per the seat's rulings (6905396672). It changes only private members: the holder reading at the package door and item seam, and the cold-boot check.Verification
Gates at d314ad0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 77 families. 74 were run locally, each exit 0. Left to CI:check:dual-build-cjs-loads,check:i18n,check:type-check-debt. The--ranreconciliation reads "77 derived, 74 run, 0 NOT-MEASURED, 3 UNRUN" and names those three.node scripts/check-adr-0087-registration.mjs --base origin/main: "this PR adds no declared-breaking changeset".check-changeset-no-major(PR body simulated): exit 0.node scripts/check-nul-bytes.mjs: OK.pnpm check:engine-double-contract: exit 0.dispatch-gates --tier: no path-derived mandate, 538 changed lines, under the 3000 human-merge threshold.git merge-tree --write-treeof this head againstorigin/main(43dd5656e4), PR fix(metadata-protocol): a position saved active through the meta save door carries its renamed holders at once #34181 (07fd6c86de) and PR fix(metadata-protocol)!: the diff door refuses a bare two-holder name and compares one holder by ?package= #34147 (624b7ff393) all exit 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jUcj2x2Wr4UErwBi12