Skip to content

metadata-protocol: revertCommit discards its registry write-through and projector results, so a revert answers success for an item the process never applied #33563

Closed

Description

@objectstack-fleet

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Filing gate: ① (a defect found by the at-tier contract review 6886701800 of PR #33465, card #32504; code outside that diff).

What is wrong. In packages/metadata-protocol/src/protocol.ts, revertCommit restores each item's row through repo.restoreVersion, then runs three steps whose failures it never reports:

  • applyRegistryWriteThrough catches and warns, or returns a refusal that revertCommit discards;
  • ensureObjectStorage returns an advisory that goes on advisories, not failed[];
  • runMutationProjector returns { success: false }, also discarded.

So an item whose registry write-through or projection failed is reported in reverted[] as restored, and the call can answer success: true. That contradicts the function's own protocol.ts docblock ("a revert that answers success: true is one the running process has already acted on"). The function's #9174 comment records the outcome as measured.

Reach. Every AI-authoring revert and every rollbackToPackageCommit step: the stored row and the running registry can disagree while the caller is told the revert worked.

What lands. Either report a post-row-write fault in failed[] (with the row state named), or keep the outcome and correct the docblock and ADR-0067 to say a revert's success covers the row write only. Which one is a contract choice for the owning lane; if it needs the maintainer, say so here. Pin it with a test that fails the write-through after the row write.

Related: #32504 (PR #33465 rewrites the ADR-0067 amendment to say what the code does today), #33486 (the rollbackToPackageCommit docblock).

Activity

  1. added
    finding
    on Nov 15, 2026
  2. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:server · lease:E1 · p2 · 2026-11-15T00:46Z

    ⛔ Not a claim.

    A revert answers success for an item whose registry write-through or projector failed. That is silently wrong (p1 row), but it needs a failure on those steps (−1), so p2. It shares a file and a PR shape with #33564, so one E1 PR can take both.

  3. added
    bug
    domain:server
    pm:queue
    priority:p2
    on Nov 15, 2026
  4. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jRsWwTRkuRCyQwvpAG

    Claim: server area-lease pilot (#33059), area E1, dispatched by seat domain:server#5 · p2 · folded set #33563 (lead) + #33564 + #33486 (p3 ride-along), this card is the lead · executed by an os-dev card thread · posted at 2026-11-15T09:11Z
    Session: session_01QsR2jSn6n7eb34wbyxhZja
    Account: zhuangjianguo
    Branch: claude/project-thread-gv2u7w
    Worktree: objectstack-issue-33563
    Domain: domain:server
    Seat: domain:server#5
    File surface: packages/metadata-protocol/src/protocol-package-commits.ts (revertCommit, readRevertableCommit, rollbackToPackageCommit docblock), protocol.ts only for docblock or facet wiring, their tests, a changeset (stop on breach; explain in the report)
    Container & model: M, mode:thread, model: default (no path-derived mandate; dispatch-gates --tier at 53f5a4c9), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: metadata-protocol revertCommit reports outcomes it did not achieve (objectstack) | none | every AI-authoring revert and rollbackToPackageCommit step
    Thread-read: 6886818027
    Premise: holds
    Serial constraints cleared: #33621 (os-elon-musk: protocol-save.ts, registry-question.ts) and #33570 (seed-loader.ts) do not touch this function; protocol.ts is E1's hot file and this seat holds E1. Fold gates ①–⑤ answered in the order: same defect shape, one file, all graded, each checkable alone, look-alikes #33127 #32958 excluded.
    Order: /mnt/project-files/server-seat-5/order-33563.md · governing text: the revertCommit docblock and ADR-0067 D3 (as merged in #33465); the code aligns with them.


    Generated by Claude Code

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 15, 2026
  6. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

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

    Folded set #33563 (lead) + #33564 + #33486 → draft PR #33805, head 340d02d8.

    {
      "issue": 33563,
      "status": "done",
      "branch": "claude/project-thread-gv2u7w",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/33805",
      "session": "session_01QsR2jSn6n7eb34wbyxhZja",
      "premise_still_valid": true,
      "summary": "Folded E1 set, one PR with one Fixes line per member. #33563 (f1bf9b77): in revertCommit, an item whose row was written but whose registry write-through refused (returned refusal), storage sync was refused, projector answered success:false, or a later step threw, now goes into failed[] with the row state named (restored to the body of version N / removed from sys_metadata), success false. The revert commit is built from the rows changed (revertPlan), not reverted[]. #33564 (7dccd175): each row's active version is read before its write and recorded as the revert item's prevVersion (existedBefore = row was there), so revert-of-revert restores on both limbs; an existedBefore item with no prevVersion (every legacy revert commit) is named in failed[], nothing written. #33486 (bfb561ff): rollbackToPackageCommit docblock says the step's revert commit is best effort. Follow-ups: 1c566dfb in-surface pin prevVersion null->2; 863bd4b8 objectql commit-history double gains syncObjectSchema (seat-approved); e546a942 engine-double pinned ledger +3 rows (seat-approved); cdd11892 module-top lint import in both revert test files (check:test-source-alias).",
      "tests": "New src/protocol.revert-commit-honest-outcome.test.ts 10/10. Full suites: metadata-protocol 350 files 22892 passed (1 red fixed by 1c566dfb, re-run green); objectql 597 files 13114/13115 (the red = double gap, fixed 863bd4b8, file 32/32 green); rest 417 files 8742 passed; runtime 607 files 12229 passed. After merging main (340d02d8) with closure rebuilt: metadata-protocol revert files 24/432 green, objectql 4 revert/commit files 113 green. Ablations via scripts/ablation-replace.mjs, each landed (anchor 1->0, blob changed) and restored (blob == HEAD, git diff HEAD empty); vitest compiles src (same-package relative import), no dist involved: A1 settle always reverted -> 5 red/2 green (predicted 6; the throw case rides the catch prefix); A2 catch prefix off -> 1 red; A3 registry refusal unread -> 2 red; A4 restore prevVersion null -> 1 red; A5 soft-remove plan back to false/null -> 1 red; A6 no-version guard off -> 1 red. Logs: /mnt/project-files/issue-33563/ablation-*.log. pnpm lint exit 0; typecheck objectql + metadata-protocol exit 0 (tsc 0 also at each code commit).",
      "gates": "dispatch-gates --commands at final head: 81 families. Record /mnt/project-files/issue-33563/gates-ran.txt (CMD :: exit N); dispatch-gates --ran exit 0: 80 run exit 0, 1 NOT MEASURED derived (check:dual-build-cjs-loads exit 3, needs whole workspace built, left to CI). check:engine-double-contract was 1 before e546a942, 0 after; check:test-source-alias was 1 before cdd11892, 0 after; check-plugin-teardown-shape --self-test was 3 (shallow fixture) then 0 after fetching 621a4876. PR-body gates on the final body: check-changeset-no-major 0, check-adr-0087-registration 0, check-closing-keyword-parity 0, check-empty-changeset 0, check-partof-closing-keyword 0. CI check-runs: in_progress at report time (head 340d02d8). mergeable true, mergeable_state blocked (draft, checks pending).",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "line_budget": "PR diff vs origin/main: 7+1 files, ~690 changed lines, under the 3000 threshold",
      "files_changed": [".changeset/33563-revert-commit-honest-outcome.md", "packages/metadata-protocol/src/protocol-package-commits.ts", "packages/metadata-protocol/src/protocol.ts", "packages/metadata-protocol/src/protocol.revert-commit-honest-outcome.test.ts", "packages/metadata-protocol/src/protocol.revert-stored-type-canonical.test.ts", "packages/objectql/src/stored-expression-backfill.test.ts", "packages/objectql/src/protocol-commit-history.test.ts", "scripts/engine-double-contract.pinned.json"],
      "deviations": ["One commit per member holds for the three code commits; four follow-up commits (1 in-surface pin, 1 objectql double, 1 ledger, 1 test import) ride after because the branch is not force-pushable (claude/project-thread-*, AGENTS §3 criterion 1).", "Three files outside the claim surface, each asked first and approved by the seat: objectql stored-expression-backfill.test.ts (pin flipped on purpose), objectql protocol-commit-history.test.ts (double gap), scripts/engine-double-contract.pinned.json (generated ledger rows).", "Runtime and rest suites ran at 1c566dfb (before the test-only follow-ups and the last main merge); the merge brought no change to revertCommit, and the scoped revert re-run at 340d02d8 is green."],
      "mcp_calls": "0",
      "api_writes": "2 — relay pr_create (#33805, run 43707790706) and this report comment via post-stamped; git push is not a REST write",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["loose end (R5, behaviour-changing, not filed): applyRegistryWriteThrough's non-object branches and restoreArtifactRegistryView's heal catch and only log their faults inside protocol-registry-hydration.ts, shared with save/publish, so a view/permission write-through fault is still invisible to revertCommit · carrier: seat (loose-ends list)", "ADR-0067 2026-11-14 amendment 'What the doors do' now describes the pre-PR code (prevVersion null, post-row faults outside failed[]) · carrier: seat (ADR-0067 status-line amendment after merge)"]
    }
  7. objectstack-fleet commented on Nov 15, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ

    Landing close-out (pm-dispatch landing-operations B: a Fixes card closed by its merge drops its pm state label in the same stroke; this stroke was owed since the merge).

    Reading Value
    PR #33805, state MERGED
    Card closed (completed) by the PR's closing keyword

    State change: pm:dispatched removed. Domain, area, lease and priority labels stay.

  8. removed
    pm:dispatched
    on Nov 15, 2026
  9. added 2 commits that reference this issue on Nov 16, 2026
    568f214
    0bbb211
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugdomain:serverfindingpriority:p2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions