Skip to content

metadata-protocol: rolling back or reverting a package's own permission set is refused as sealed while a package of another namespace ships a set of that name #34401

Closed

Description

@objectstack-fleet

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

Filing gate: ① reproducible defect (class a), read from code, with the mechanism measured on a sibling site. Follow-up owed by #34226 (hand-off 6912108122 on #34359).

Blocked-by: #34359 (until it lands, a package cannot store its own permission set N beside another namespace's shipped N, so these sites have no input).

Locations (head b054ae27 of #34359)

  • packages/metadata-protocol/src/protocol-package-commits.ts#revertCommit, restore limb, lines 1657-1660: host.restoreWriteFor(type, name, commitPackageId, host.isArtifactBacked(it.type, it.name), 'protocol.revertCommit').
  • packages/metadata-protocol/src/protocol-package-commits.ts#rollbackMetaItemUnaudited, line 2139 (const artifactBacked = host.isArtifactBacked(singularType, request.name)), passed to restoreWriteFor at line 2234 with rollbackPackageId.
  • Shared derivation: packages/metadata-protocol/src/protocol-class-head.ts#restoreWriteFor, line 216. Both sites hand it a name-wide artifactBacked, so it answers override-artifact for a package's own set.
  • Not refused today, same shape: revertCommit's removal limb, lines 1484-1485, also derives its intent from isArtifactBacked alone. The store admits that removal anyway, because SysMetadataRepository#assertDeleteAllowed lets an override-artifact delete through for a supportsOverlay type, and permission is one. The hand-off counted three refused sites; two of them refuse.

Symptom

An admin of package hr rolls back hr's own permission set N to an earlier version, or reverts or rolls back an hr commit that edited it, while package crm of another namespace ships a set N. The item rollback answers 403 NOT_OVERRIDABLE ("provided by a managed package and is sealed"), and a commit revert lists N in failed[]. In both cases N keeps its current version. The earlier version should be restored.

How it was found

Read from code. The mechanism was measured on the sibling site that #34359 fixed. There, undoLandedPromotions called restoreVersion for hr's own N with a name-wide override-artifact intent. That ablation leg (U1 on #34359) went red: the store's assertAllowed refuses an override-artifact put for permission, which is not allowEnvironmentOverlay. Both sites above reach the same restoreVersion with the same intent. The two sites themselves: read, not measured.

reach: POST /api/v1/meta/:type/:name/rollback (rollbackMetaItem), POST /packages/:id/commits/:commitId/revert (revertCommit) and POST /packages/:id/rollback (rollbackToPackageCommit, which calls revertCommit). Read, not measured through these doors.

Acceptance

Package crm (namespace crm) ships N. hr (namespace hr) saved its own N at v1 and edited it to v2. Each case runs in both registration orders: crm's set registered before the other packages install, and after.

  1. Rolling back permission/N bound to hr to v1 restores v1, and hr's grant confers v1. FROM: 403 NOT_OVERRIDABLE.
  2. Reverting the hr commit that edited N restores v1, and rollbackToPackageCommit to the earlier commit does too. FROM: N in failed[] with NOT_OVERRIDABLE.
  3. With crm AND fin shipping N, cases 1 and 2 still restore. Every shipper is judged, not the first found.
  4. CONTROLs stay refused exactly as before, with code and status asserted: a rollback or revert of a row bound to no package, to crm, to crm's customization pair (another namespace, judged by the override write gate) and to a co-owner of crm's namespace; and, with fin also shipping, a row bound to a co-owner of fin's namespace.
  5. One verdict decides it: the same isOwnPermissionSetWrite the save, publish and undo paths use (protocol-packaged-base-refusal.ts, line 206). Narrowing the artifactBacked that restoreWriteFor receives is likely the one place to do it. Each narrowed site gets an ablation leg that goes red.
  6. Declaration: Clause-②: yes (widening): a rollback, a commit revert or a package rollback of a package's own permission set N, refused 403 NOT_OVERRIDABLE while a package of another namespace ships N, now restores; nothing the doors accepted is refused. Metadata-protocol: none, patch.

Related

#34226 (the card), #34359 (the save, publish and undo half; its PR body lists this as out of scope).

Dedupe: gh api -X GET search/issues -f q='repo:objectstack-ai/objectstack is:issue revertCommit permission NOT_OVERRIDABLE' 13 hits, none open on this shape (#6563 is the closed object intent fix this site descends from). q='repo:objectstack-ai/objectstack is:issue restoreWriteFor isArtifactBacked' 0 hits. q='repo:objectstack-ai/objectstack is:issue rollback permission set sealed package name' 46 hits; the only open match is #34226 itself, plus the #31527 epic.

Activity

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

    @objectstack-fleet
    ContributorAuthor

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

    Note from PR #34359's L1 R1 round (measured at b054ae27, dev report 6917728377 on #34226), same root as this card:

    • The delete and draft-discard door is NOT refused for a package's own permission set beside another namespace's shipped set: deleteMetaItem derives override-artifact from the name-wide artifactBacked (protocol-diff-delete-load.ts :642, :851), but assertDeleteAllowed admits it for a supportsOverlay type. hr deleting its own active N and discarding its own N draft both answered success: true in both registration orders.
    • Its receipt is wrong, though: the delete answers "Customization overlay deleted (package=com.qa.hr) — permission/N reset to artifact default." with reset: true. hr ships no N, so nothing of hr's is reset to a default; hr's set is gone and crm's N is untouched. The message and the flag read the same name-wide artifactBacked (:642, read at :802 and in the receipt).
    • Fold it into this card's fix: the one verdict that narrows the restore intent should also decide the delete receipt's reset and its text. Acceptance addition: the delete of hr's own N answers reset: false with a plain "deleted" receipt, in both registration orders; CONTROL: deleting the environment's or crm's customization of crm's N still answers reset: true.
  3. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · p2 (kept) · pm:blocked · 2026-11-16T13:52Z

    ⛔ Not a claim.

    Blocked-by: #34359

    Rolling back or reverting a package's own permission set is refused as sealed while another namespace's package ships a set of the same name. The body carries Blocked-by: #34359, which lets a package store its own set beside another namespace's, so these sites have no input until it lands. p2 as filed.

  4. added
    pm:blocked
    on Nov 16, 2026
  5. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: unlock → pm:queue · 2026-11-16T15:50Z

    ⛔ Not a claim.

    Card #34401 was parked on PR #34359, which merged at 14:31Z. Back to the queue for its lane, with the grade unchanged.

  6. added
    pm:queue
    and removed
    pm:blocked
    on Nov 16, 2026
  7. objectstack-fleet commented on Nov 16, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    Claim: PM loop round 1 (area o2-D, repo:objectstack#2; large card, built in its own card thread)
    Session: session_01ADHkmRXuRn93HphKp7kXEz
    Thread session: session_01ADHkmPhrvD6HH5p4xPZ2jX
    Account: os-steve
    Branch: claude/project-thread-jaiwnp
    Worktree: the card thread's own checkout
    Domain: domain:server
    Seat: repo:objectstack#2
    File surface: packages/metadata-protocol/src/protocol-package-commits.ts (revertCommit restore and removal limbs, rollbackMetaItemUnaudited), packages/metadata-protocol/src/protocol-class-head.ts (restoreWriteFor, only if the narrowing belongs there), packages/metadata-protocol/src/protocol-packaged-base-refusal.ts (reuse of isOwnPermissionSetWrite, no change to its verdict), the #34226 pin file packages/plugins/plugin-security/src/packaged-permission-set-lock-gate.test.ts (a new top-level describe), .changeset/ (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default judgment tier, effort: high
    Clause-②: yes (widening)
    Metadata-protocol: none
    Responsibility: #34359 (the save, publish and undo half; this card is the rollback and revert half it listed as out of scope)
    Thread-read: 6921359721
    Premise: holds (on origin/main bdd5176 both sites hand restoreWriteFor the name-wide isArtifactBacked; read, the card's reach is read-only)
    Serial constraints cleared: Blocked-by #34359 merged 2026-11-16T14:31Z. Open PR #34238 touches packages/metadata-protocol/src/sys-metadata-repository.ts, which this card reads but is not expected to change; if the fix needs it, the thread stops and re-intersects. No other open PR touches the surface on the deepened read at 23:25Z. Re-check by git merge-tree before the first push.
    Pre-claim lane: domain:server (metadata-protocol); large-card trigger (Clause-② yes, declared on the card's acceptance 6) ⇒ own card thread, owes a contract-tier L2 review.
    Pre-claim deps: Blocked-by: #34359 is merged; the card was unlocked to pm:queue (6921359721).
    Prior rulings read: ADR-0150 D2/D9 (a permission set is (package, name)), ADR-0126 / ADR-0131 D4 and D6 (the managed seal), ADR-0146 D6 and D11 named by the scan; the one verdict the card names is #34359's isOwnPermissionSetWrite; thread: #34226, #34359; repo: objectstack-ai/objectstack

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

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    File surface amended (claim 6932589826, card thread session_01ADHkmPhrvD6HH5p4xPZ2jX, branch claude/project-thread-jaiwnp), on the building thread's read before its first push:

    • added packages/metadata-protocol/src/protocol-diff-delete-load.ts: the receipt text of deleteMetaItem only. Comment 6917777398 on this card folds the delete receipt into this card: when hr deletes its own N while another namespace ships N, the receipt says an overlay was deleted and reset to the artifact default. The same verdict decides the receipt. The delete intent and sys-metadata-repository.ts are not changed. reset stays true, because DeleteMetaItemResponseSchema defines reset === true as "a row was deleted"; the PR body states this deviation from the comment.
  10. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmPhrvD6HH5p4xPZ2jX
    os-dev-report

    {
      "issue": 34401,
      "status": "done",
      "branch": "claude/project-thread-jaiwnp",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/34550",
      "head": "bf5dccdba2",
      "premise_still_valid": true,
      "files_changed": [
        ".changeset/34401-own-permission-set-restore.md",
        "packages/metadata-protocol/src/protocol-class-head.ts",
        "packages/metadata-protocol/src/protocol-diff-delete-load.ts",
        "packages/plugins/plugin-security/src/packaged-permission-set-lock-gate.test.ts"
      ],
      "gates": "dispatch-gates --ran at bf5dccdba2: 74 derived, 74 run, 0 NOT-MEASURED (3 first-pass exit-3 prerequisites re-run to exit 0 after git fetch --unshallow and pnpm build VERDICT 0). os-verify-lock VERDICT command-exit 0: metadata-protocol and plugin-security typecheck; plugin-security test 274 files 6883 passed/45 skipped; metadata-protocol test 346 passed/9 skipped files, 22968 passed/45 skipped. Target file 71/71. Ablations: R1 restoreWriteFor narrowing removed 8 failed; D1 delete receipt narrowing removed 4 failed (first D1 attempt a refused no-op); both restored blob == HEAD. CI: in_progress at report time.",
      "line_budget": "n/a (no skills/** or governed surface touched)",
      "deviations": [
        "Comment 6917777398 asked reset:false for the delete of hr's own N; DeleteMetaItemResponseSchema defines reset===true as 'a row was deleted', so reset stays true and only the receipt text changes (recorded on claim amendment 6932622107).",
        "Delete write intent and revertCommit's removal limb left on isArtifactBacked alone: the store admits both, so the change is unobservable and unablatable.",
        "Test file: the #34226 composition hoisted to module scope unchanged (whitespace-only move) so the new top-level describe shares it; the fake engine keys non-sys_metadata rows by id and exposes historyRows."
      ],
      "security_findings": "none",
      "api_writes": "2 — relay pr_create (#34550), this comment",
      "mcp_calls": "5 — issue_read x3, pull_request_read x1 (get_files #34238), ToolSearch load excluded; no write tools"
    }
  11. objectstack-fleet commented on Nov 17, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz

    PR #34550 at bf5dccdba: L1 ACCEPT 6934373228, TIER_DEFAULT contract record 6934375284 (PASS), landing 6934397905 (ready, auto-merge armed).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugdomain:serverpriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions