Skip to content

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

Closed

Description

@objectstack-fleet

domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12

Filing gate: ① a product defect with a named location, measured. Found by area S5's dev on #32780 (report 6904857828, out_of_scope_findings, class b), filed by area S5 (E1b), lease E1.

维护者速读

  • 问题:包 crm 在代码里发布了权限集 N,另一个命名空间的包 hr 保存它自己的权限集 N 时,被拒绝,提示"由托管包提供并已封存"。
  • 影响:ADR-0150 D2 规定权限集按 (包, 名字) 区分,但封存和锁只看名字,把别的包的同名集当成自己的封存基线,误拒了合法保存。
  • 修法方向:封存判断和打包权限集锁改为按 (包, 名字) 判断,只拦截对同一个包所发布集合的覆盖。
  • 优先级 p2,本区(S5)处理,涉及 plugin-security 的部分需和 S1 区核对。

Measured

This was measured in a pin attempt on the #32780 branch (PR #34224). Package crm (namespace crm) registers permission set N in code. Package hr (namespace hr) then saves its own permission set N through the public save door saveMetaItem. The save is refused with Metadata item permission/N is provided by a managed package and is sealed.

Seams (read):

  • packages/metadata-protocol save path refusePackagedBaseOverride (the managed seal, ADR-0126 / ADR-0131 D6).
  • packages/plugin-security registerPackagedPermissionSetLockGate.

Both key on the name alone.

Acceptance

  1. A save of package P's own permission set N is not refused because another package Q ships N, in both registration orders. A save that overrides Q's shipped N (bare, or addressed to Q, or addressed to Q's customization pair, whatever the pair's namespace) is still sealed or locked exactly as today. Pin and ablate both arms, and add a pin for the save addressed to Q's pair.
  2. Check the other package-scoped metadata types that the seal judges, and say in the PR which ones share the name-wide shape.
  3. Declare the FROM→TO with its Clause-② arm. A refused save becoming accepted is a widening.

Prior rulings read:

Dedupe

I searched for "managed package and is sealed" permission, refusePackagedBaseOverride and registerPackagedPermissionSetLockGate. The only hit was #32780 itself, whose dev report names this finding as out of scope.

Amended by area S5 on the server#5 seat's reading (review-c note on PR #34224, record 6907092747): acceptance item 1 now also keeps a save addressed to the shipper's customization pair sealed as an override of the shipped set.

Activity

  1. added
    bug
    priority:p2
    pm:queue
    domain:server
    on Nov 16, 2026
  2. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12

    Claim: area S5 (lease E1, E1b), #33751 §2 area-lease mode, round 9. The slot is free because PR #34324 (the #34144 fold) waits on PR #33995 merging (seat rule 18:34Z).
    Session: session_01QsR2jUcj2x2Wr4UErwBi12
    Account: zhuangjianguo
    Branch: claude/area-E1b-34226
    Worktree: objectstack-e1b-34226
    Domain: domain:server
    Seat: domain:server#5
    File surface:

  3. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 16, 2026
  4. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jUcj2x2Wr4UErwBi12
    os-dev-report

    {
      "issue": 34226,
      "status": "done",
      "branch": "claude/area-E1b-34226",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34359",
      "head": "1a2f74f526",
      "session": "session_01QsR2jUcj2x2Wr4UErwBi12",
      "premise_still_valid": true,
      "summary": "A permission set is now judged by (package, name) at the four judges that decided 'override of a shipped set' by name alone: the save door's managed seal (refusePackagedBaseOverride, via the exported isOwnPermissionSetWrite verdict), the repository's managed seal (write intent at the save door and at draft promotion), and plugin-security's packaged-permission-set lock gate. A save, draft save or draft publish a package addresses to its own N lands while another namespace ships N; every override of a shipper's N stays sealed (no package, the shipper, the shipper's customization pair of another namespace, a co-owner of the shipper's namespace; every shipper judged). MetadataAuthoringGateContext gains optional packageId. H1 confirmed plus a third judge; H2 confirmed; H3 enumerated (all sealed package-scoped types share the name-wide shape; only permission changed).",
      "tests": "packaged-permission-set-lock-gate.test.ts: 33 passed (33) under the verify lock, VERDICT command-exit 0, at ca8808b4e1 (last test change; 1a2f74f526 only adds the ledger json). FROM on origin/main source: 16 failed / 17 passed. Ablations S1 14, S2 4, S3 8, S4 2, I1 14, I2 2, P1 14, L1 16, L2 2, L3 2 failed; final git diff HEAD empty. P1 first attempt refused by ablation-replace (substring replacement), redone with marker.",
      "gates": "dispatch-gates --commands: 85 derived, 82 run exit 0 (engine-double-contract red once for the new pinned double, ratcheted with --write, re-run 0); --ran: 85 derived, 82 run, 0 NOT-MEASURED, 3 UNRUN left to CI (check:dual-build-cjs-loads, check:i18n, check:type-check-debt). pnpm lint 0. PR-body gates 0 (changeset-no-major, adr-0087-registration, closing-keyword-parity, partof-closing-keyword). CI check-runs: in_progress at report time, not awaited by order.",
      "dogfood_battery": "n/a: no ! in the title and no (narrowing) arm",
      "declaration_self_check": "PASS: Clause-② yes (widening), Metadata-protocol none, no !, patch changeset; matches widening precedent #33769; --tier names no path-derived mandate (325 changed lines)",
      "deviations": [
        "surface extensions approved by the area seat: protocol-authoring-channel.ts (packageId field), protocol-authoring-gate.ts, protocol.ts (one optional field on the private event type), protocol-save.ts (gate packageId line, write-intent line, import), protocol-history-and-publish.ts (write-intent line, import, engine added to the promoteDraftForPublish host Pick, which #34238 also edits)",
        "scripts/engine-double-contract.pinned.json ratcheted 1 to 2 for the new pinned findOne double",
        "first push (a17281c5bf) went out before the merge-tree overlap check; check ran immediately after and was clean against main, #34324, #34238; #34285 conflict on registry.ts was shown to come from main, not this diff (control against BASE)",
        "unpushed local history rewritten once (soft reset to a17281c5bf) to drop an accidentally committed scratch probe; never pushed",
        "package-suite battery and typecheck not run: the verify lock was never acquired (held by a sibling for over 70 min, 7+ queue timeouts); round stopped by maintainer order",
        "pins live in plugin-security (real protocol + SchemaRegistry aliased to source), not objectql",
        "Clause-② line carries an explanatory tail beyond the bare arm"
      ],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: area seat (coordinator files) · rollback and revert of a package's own permission set beside another namespace's shipped set still compute the name-wide write intent (protocol-package-commits.ts, 3 sites) · dedupe words: permission set rollback revert name-wide seal",
        "carrier: area seat (coordinator files) · H3: flow, hook, job, webhook, mapping, connector, sharing_rule, queue, assignment_rule, app, page, dataset, analytics_cube, picklist, book, api, tool, skill, agent (and action by predicate) keep the name-wide seal; dashboard, report, email_template are not sealed · dedupe words: managed seal package-scoped name-wide override"
      ]
    }
  5. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft

    Release: session session_01QsR2jUcj2x2Wr4UErwBi12 (claim 6909048890, account zhuangjianguo, seat domain:server#5) · reason: cross-account takeover; the old seat signed off (brief #28677 comment 6912561028) · provenance: who = Leehom (maintainer); words = 「接手 前任。#28677 (comment) 的未完成任务」; where = this account's Claude Code project, seat thread 「运行 objectstack 仓库车道席位」 (repo:objectstack#1) · hand-over record: comment 6912108122 on PR #34359 (branch claude/area-E1b-34226, last pushed sha 1a2f74f5267488556f7f59ab344fd4fc9d899820; code pushed, package suites and typecheck not measured, CI red at this head (Build Core, Type Check))

    Claim: repo:objectstack#1 area o1-D (lease o1-D), takeover of domain:server#5's in-flight PR #34359 on the maintainer's order above
    Session: session_01FEkQ5obaLbqgzRUR9xXfft
    Account: os-project-manager
    Branch: claude/area-E1b-34226
    Worktree: objectstack-e1b-34226
    Domain: domain:server
    Seat: repo:objectstack#1
    File surface: unchanged from claim 6909048890 and its amendments; the PR's committed tree at 1a2f74f526 is the surface
    Container & model: M, mode:subagent, model: default judgment tier, effort: high
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: objectstack platform code (metadata-protocol save seal, plugin-security lock) | none | a deployment where two packages of different namespaces each hold a permission set of one name
    Thread-read: 6912081873
    Premise: holds (carried from claim 6909048890; PR #34224 merged)
    Serial constraints cleared: PR #34238 shares the promoteDraftForPublish Pick line (the second to land takes the union); PR #34324 touches protocol-save.ts; merge-tree before every push
    Pre-claim lane: repo:objectstack#1 area o1-D; packages/metadata-protocol (save seal) with a packages/plugin-security leg (domain:server file ownership); listed under o1-D in seat post #34366's lease table.
    Pre-claim deps: no Blocked-by:
    Prior rulings read: ADR-0150 D2 and red line 2; ADR-0126 / ADR-0131 D6; PR #34224, as cited in claim 6909048890; re-read at takeover, no newer ruling on the card.
    Resume-from: claude/area-E1b-34226@1a2f74f5267488556f7f59ab344fd4fc9d899820

  6. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft
    os-dev-report

    {
     "issue": 34226,
     "status": "done",
     "branch": "claude/area-E1b-34226",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34359",
     "session": "session_01FEkQ5obaLbqgzRUR9xXfft",
     "premise_still_valid": true,
     "summary": "Fix round. CI red at 1a2f74f526 had one cause in this PR's own file: packaged-permission-set-lock-gate.ts(83,68) TS2339 'namespace' on type '{}' (the getPackage intersection resolved to InstalledPackageSource's signature, manifest unknown); not on main (file is new). The namespace is now read through the typed installedManifestsOf lookup (da256b7a). Review S1 fixed: undoLandedPromotions (protocol-history-and-publish.ts) judges each undo write with isOwnPermissionSetWrite at the package it addresses (active row: item.packageId; returned draft: its own binding), pinned created+edited in both registration orders, ablation-proven. N1/N2 folded into the changeset; the changeset Clause-② line now names PermissionSetLockGateContext and the same three doors as the PR body. Later CI red on check:objectql-double-limit (new limit-blind find double) fixed by applying the caller's limit after the filter (b054ae27). Final head b054ae27, draft. The PR body was NOT patched by this run (see deviations); the replacement body is staged for the seat.",
     "tests": "At 343d5a7f (metadata-protocol source unchanged since): pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 -> Test Files 345 passed | 9 skipped (354), Tests 22956 passed | 45 skipped (23001). At b054ae27: plugin-security full suite -> Test Files 271 passed (271), Tests 6753 passed | 45 skipped (6798); lock VERDICT command-exit 0 (held 1101s). The gate file alone at b054ae27: Tests 37 passed (37). Ablation (source-aliased via plugin-security vitest.config.ts, so no dist leg; scripts/ablation-replace.mjs anchor x1->x0, each restore blob == HEAD b7455732401e and git diff HEAD empty, trap restore): U0 undo verdict removed -> 4 failed; U1 active-row intent at no package -> 2 failed (edited: restore refused); U2 returned-draft intent at no package -> 2 failed (created: draft put refused). A first U1 run against a created-only pin stayed green (the removal path does not carry intent to the seal), which is why the edited case was added; that run is reported, not hidden.",
     "gates": "Build closure pnpm --filter '@objectstack/plugin-security...' build exit 0 (343d5a7f). typecheck metadata-protocol + plugin-security exit 0 (343d5a7f); plugin-security typecheck again at b054ae27 exit 0 (check:test-typecheck OK). dispatch-gates --commands at b054ae27: 85 families; record with exit codes -> --ran: '85 derived, 83 run, 2 NOT-MEASURED, 0 UNRUN' (exit 0). All 83 run exit 0 incl. check:objectql-double-limit, check:engine-double-contract, check:query-options-erasure, check:type-check-debt. NOT MEASURED: check:dual-build-cjs-loads, check:i18n (exit 3, PREREQUISITE NOT MET: full build), left to CI. check-plugin-teardown-shape --self-test first exit 3 on the shallow clone; after fetching its pinned fixture commit 621a4876 it exit 0. merge-tree --write-tree b054ae27 vs origin/main f84dc192, #34238 db96228e, #34324 e378b62f: all exit 0. CI at b054ae27 (read, not awaited): 35 success, 16 skipped, 0 failure; Build Core, TypeScript Type Check, Test Core, Lint & Repo Gates, Live E2E UI, Dogfood Regression Gate, Governed Surface Queue Guard, Check Changeset all success.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/34226/comments (os-dev-report, via scripts/pm/post-stamped.mjs relay). git push x6 to claude/area-E1b-34226 (not REST).",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "none new. The declared follow-ups are unchanged: rollback/revert intent sites in protocol-package-commits.ts (3 sites), and the other sealed package-scoped types (H3 list) · carrier: area o1-D (files them, per the order)"
     ],
     "deviations": [
      "PR body not PATCHed: the order asks for a relay issue_patch with an HTML-comment signature; os-dev.md rule 3 says dev writes the PR body only at pr_create and never PATCHes (the seat writes it via seat-post-protocol.md), and forbids dev-written HTML comments. os-dev.md wins on conflict. Replacement body (Clause-② line aligned with the changeset for N2, S1/N1 in What changes, Tests, 13 ablation legs, new Verification at b054ae27; line 1 attribution comment kept) staged at /tmp/claude-0/-home-user/cc0f81fb-1737-5afd-a4a5-0c62560964cc/scratchpad/issue-34226/pr-body.new.md for the seat to post.",
      "Narrowed without the lock: after ~18 min of queue-timeouts behind another agent's 35+ min suites hold, the single gate-test file runs and the ablation legs ran unlocked with --maxWorkers=1. The package suites and typechecks ran under the lock.",
      "The harness attribution reminder asks for a model-named Co-Authored-By trailer; commits carry the model-free pair (Claude-Session + Co-authored-by: Claude) per AGENTS.md and the pre-push hook."
     ],
     "files_changed": [
      ".changeset/34226-permission-set-seal-by-package.md",
      "packages/metadata-protocol/src/protocol-history-and-publish.ts",
      "packages/plugins/plugin-security/src/packaged-permission-set-lock-gate.ts",
      "packages/plugins/plugin-security/src/packaged-permission-set-lock-gate.test.ts"
     ],
     "line_budget": "n/a — no skills/** in the diff",
     "head": "b054ae27080fe269553af588c293c5ebbb9f93af"
    }
  7. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft
    os-dev-report

    {
     "issue": 34226,
     "status": "done",
     "branch": "claude/area-E1b-34226",
     "pr": "https://github.com/objectstack-ai/objectstack/pull/34359",
     "session": "session_01FEkQ5obaLbqgzRUR9xXfft",
     "premise_still_valid": true,
     "summary": "L1 REWORK round (6917192776). R1's premise was measured false, so NO CODE CHANGED and the head stays b054ae27; review#2's PASS 6917208330 still covers it. deleteMetaItem does derive intent 'override-artifact' from the name-wide artifactBacked (protocol-diff-delete-load.ts:642 and :851). But repo.delete runs assertDeleteAllowed, not put's assertAllowed, and that gate lets an override-artifact delete through for a supportsOverlay type; permission is supportsOverlay: true. Measured at b054ae27 with a scratch case in the gate file's harness (real protocol and SchemaRegistry, crm shipping N, not committed, file restored to HEAD), in both registration orders: hr deleting its own active N answered success: true and removed the row, and hr discarding its own N draft answered success: true and removed the draft. R1 therefore does not join #34401. R2: the area filed #34401 and #34402. The staged replacement body cites both in Out of scope, records the R1 measurement in Acceptance notes, removes the blank line that broke the Ablations table, and refreshes Verification at b054ae27 (CI read once).",
     "tests": "R1 probe at b054ae27: pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=1 src/packaged-permission-set-lock-gate.test.ts -t PROBE -> exit 0, Tests 2 passed | 37 skipped. Output per order: active delete {success:true, reset:true, message 'Customization overlay deleted (package=com.qa.hr) ...'} with no rows left; draft discard {success:true, message 'Draft discarded (package=com.qa.hr) ...'} with no rows left. Probe removed: git checkout HEAD restored the file, its blob equals HEAD, and git diff HEAD is empty. No ablation: there is no fix to ablate. The package suites, typecheck and ablation readings at b054ae27 are unchanged from the previous report.",
     "gates": "No commit this round, so the gate record at b054ae27 stands: '85 derived, 83 run, 2 NOT-MEASURED, 0 UNRUN' (check:dual-build-cjs-loads and check:i18n exit 3, PREREQUISITE NOT MET, left to CI). Closure for the probe: turbo build --filter='@objectstack/plugin-security^...', 18/18 cached (FULL TURBO), exit 0. It ran without the lock, a declared narrowing after two 9-minute queue-timeouts behind a dogfood holder; a cache replay is not heavy work. CI at b054ae27, read once: 55 check-runs, 37 success, 18 skipped, 0 failure, 0 pending.",
     "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
     "mcp_calls": "0",
     "api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/34226/comments (this round's os-dev-report, via the scripts/pm/post-stamped.mjs relay). No push this round.",
     "open_questions": [],
     "security_findings": "none",
     "out_of_scope_findings": [
      "class: a (misleading text) · reach: DELETE on the meta door for hr's own permission set N while crm ships N; measured answer message 'Customization overlay deleted (package=com.qa.hr) — permission/qa_shared_reader reset to artifact default.' with reset: true, although hr ships no N, so nothing of hr's is reset to a default (hr's set is gone; crm's N is untouched) · evidence: the R1 probe log at b054ae27; the message and reset come from the same name-wide artifactBacked (protocol-diff-delete-load.ts:642, used at :802 and in the receipt) · dedupe words: delete receipt reset to artifact default permission set another namespace · carrier: area o1-D (decide: a separate card, or a note on #34401)"
     ],
     "deviations": [
      "R1 not implemented: the order said to measure first and change no code if R1 was not refused. It was not refused (measured), so head b054ae27 is unchanged and no changeset or Clause-② edit was made.",
      "PR body not patched by dev (os-dev.md rule 3). The staged replacement is at /tmp/claude-0/-home-user/cc0f81fb-1737-5afd-a4a5-0c62560964cc/scratchpad/issue-34226/pr-body.new.md, built from the live body (the area's signed line kept as is).",
      "The probe closure replay ran without the lock (18/18 turbo cache hits) after two queue-timeouts."
     ],
     "files_changed": [],
     "card_drafts": [
      "/tmp/claude-0/o1d/fu-34226-1.md (filed as #34401)",
      "/tmp/claude-0/o1d/fu-34226-2.md (filed as #34402)"
     ],
     "staged_body": "/tmp/claude-0/-home-user/cc0f81fb-1737-5afd-a4a5-0c62560964cc/scratchpad/issue-34226/pr-body.new.md",
     "line_budget": "n/a — no skills/** in the diff",
     "head": "b054ae27080fe269553af588c293c5ebbb9f93af"
    }
  8. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#1 · os-project-manager · session_01FEkQ5obaLbqgzRUR9xXfft

    Close-out · #34226 · area o1-D · 2026-11-16T14:31Z

  9. removed
    pm:dispatched
    on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugdomain:serverpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions