Skip to content

fix(update): settle a completed package receipt whose filesystem device id changed instead of blocking future updates - #166394

Merged
steipete merged 2 commits into
mainfrom
upd/upd-receipt-device-id-reconcile
Oct 7, 2026
Merged

steipete merged 2 commits into
mainfrom
upd/upd-receipt-device-id-reconcile

Conversation

@steipete

@steipete steipete commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes initial openclaw update admission refusing an already completed package-update receipt after a Linux filesystem remount changes its saved device numbers. Closes #166135. Thanks @neilofneils404 for the report and detailed filesystem observations.

User Impact

Completed device-drift receipts can pass package admission without their retired helper. Refreshed receipts preserve the journal format understood by published CLI versions. Changed inodes or installation keys, active operations, and non-Linux device mismatches still refuse admission. Existing missing/replaced lease recovery policy is unchanged; no configuration, dependency, or journal schema changes are required.

Why This Change Was Made

The journal is a cross-version persisted contract: adding an intent kind would make older strict readers reject a receipt written by the new updater. Reconciliation therefore stays private to the journal owner, retains the original completion phase and intent kind, and refreshes only verified identities (including the existing replacement identity for settled receipts). Existing lease identities are refreshed only when the canonical path and inodes still match; no missing store is provisioned and no lease authority is revived.

The original schema and completion predicate remain unchanged. The existing rollback transaction revalidates inode, canonical path, ownership, installation key, completion facts, and the exact original record before committing. After commit, a warning reports filesystem device id changed; receipt identities refreshed. The reason is not stored as a new journal variant. Active custody, shared filesystem, snapshot, and immutable-recovery guards remain unchanged.

Evidence

  • The cross-version regression failed on the previous PR head for both unlink-helper and superseded-by-manual-install: the raw persisted intent was replaced. It now asserts that the original persisted kind and fields, including an existing settlement detail, survive reconciliation; only an existing settlement replacement identity changes. The schema and shared completion implementation match origin/main.
  • Final remount suite: 7/7 cases passed three times with node scripts/run-vitest.mjs src/infra/package-update-activation-remount.test.ts --maxWorkers=1. Wall times: 37.74, 12.59, 24.58 seconds; actual test times: 4.243, 3.907, 11.921 seconds. Covers completed/settled receipts, repeated remounts, idempotence, next-update preparation, and inode/key/active/non-Linux refusals.
  • Importer and wrapper inventory/closure proof: 510 tests passed, 54 existing platform-gated cases skipped; 31 suites passed and 3 skipped across four groups, 238.17 seconds wall time. Synthetic metadata proof ran locally on macOS with isolated state; no live Btrfs remount was performed.
  • node scripts/check-changed.mjs: passed, including production/test types, lint, dead exports, storage guards, and import cycles.
  • The previously observed P1 reviewer isolation failure remains unresolved; no clean managed-review verdict is claimed. Maintainer review of this head is still required.
  • Existing slow proof: the post-core admission process test took 51.96 seconds and exercises several real child-process boundaries. It was retained. Hosted CI timings for the new head are not yet available.

Recognize completed package publication receipts before rejecting historical filesystem device IDs. Reconcile only matching inode, canonical installation, ownership, and retirement facts; preserve strict active custody checks and record the completed reconciliation reason.

Closes #166135. Thanks @neilofneils404 for the report and filesystem evidence.
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M labels Oct 7, 2026
@steipete
steipete marked this pull request as ready for review October 7, 2026 02:24
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 7, 2026
@clawsweeper

clawsweeper Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed October 6, 2026, 11:06 PM ET / October 7, 2026, 03:06 UTC (Revision 2).

ClawSweeper review

What this changes

The PR refreshes verified filesystem identities in completed Linux package-update receipts while preserving their completion intent, and adds regression coverage and recovery documentation.

Merge readiness

⛔ Blocked before merge - 3 items remain

This PR remains necessary: current main still rejects completed receipts with changed device IDs. The revised head fixes the new-intent compatibility defect, but the previously reported dry-run mutation remains unresolved.

Priority: P0
Reviewed head: 973f937c2a94a4115fc4fa204d06e167aea7a842

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused compatibility repair and useful regressions provide value, but preview mutation and cross-version recovery coverage still block readiness.
Proof confidence 🌊 off-meta tidepool Not applicable: Ordinary external-contributor proof is exempt for this member-authored PR. Reported synthetic macOS tests exercise the journal owner, but the independent persisted-state gate remains incomplete: no published-driver × candidate recovery or older-reader after-reconciliation result is supplied.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Ordinary external-contributor proof is exempt for this member-authored PR. Reported synthetic macOS tests exercise the journal owner, but the independent persisted-state gate remains incomplete: no published-driver × candidate recovery or older-reader after-reconciliation result is supplied.
Evidence reviewed 9 items Pinned introduced patch: The merge-base-to-head diff introduces receipt reconciliation, its unconditional admission call, the remount regression suite, and documentation. Review used the introduced delta rather than endpoint drift; the supplied test merge is stale and was not used to claim removal of main behavior.
Dry-run reaches the writer: Initial CLI admission calls assertUpdatePackageActivationAdmission before the dry-run execution branch, without passing preview intent. Its wrapper calls assertNoPendingPackageActivation, whose continuation reader now invokes readForAdmission. Device drift reaches transition, which updates descriptor JSON and increments the retained receipt revision.
Prior finding remains: The previous completed review raised dry-run receipt mutation. Inspection of the exact earlier head through GitHub shows the same unconditional transition in readForAdmission; the current head changes persisted intent handling but does not introduce a preview guard. Local earlier-blob inspection failed with a Git object retrieval HTTP 403, so the authorized GitHub source read supplied this comparison.
Findings 1 actionable finding [P2] Keep receipt reconciliation out of dry-run admission
Security None None.

How this fits together

Package-update admission checks retained publication receipts before OpenClaw begins another update. The journal owner validates installation identity and completion facts, then either admits the update or reports pending recovery.

flowchart TD
  A[Update or preview request] --> B[Package admission]
  C[Retained SQLite receipt] --> B
  B --> D[Validate identity and completion]
  D --> E[Refresh completed Linux receipt]
  D --> F[Refuse unsafe or unfinished receipt]
  E --> G[Continue update planning]
Loading

Before merge

  • Keep receipt reconciliation out of dry-run admission (P2) - With a completed Linux receipt whose saved device IDs differ, openclaw update --dry-run reaches this transition through initial package admission. The transition rewrites the retained descriptor and increments its revision even though the invocation only previews an update. This was raised in the previous review and remains unresolved; preserving the old intent kind fixes compatibility but does not prevent the write. Carry preview intent through admission, validate using reconciled facts without persisting them, and reserve the transaction for an actual update.
  • Resolve merge risk (P1) - Published-driver × candidate recovery and older-reader compatibility remain unverified for the rewritten retained receipt; current-reader synthetic tests do not establish that an existing v2026.9.8 installation can recover and complete its next update.
  • Complete next step (P2) - Propagate preview intent through package admission and prevent receipt persistence during dry-run, with a regression at the CLI admission boundary.

Findings

  • [P2] Keep receipt reconciliation out of dry-run admission — src/infra/package-update-activation-journal.ts:395-403
Agent review details

Security

None.

PR surface

Source +139, Tests +142, Docs +9. Total +290 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 148 9 +139
Tests 1 142 0 +142
Docs 1 9 0 +9
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 299 9 +290

Review metrics

Metric Value Why it matters
Production versus regression coverage production +139, tests +142 net lines Production growth implements guarded receipt reconciliation; the regression suite covers identity refusals and intent preservation but omits preview admission.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #166135
Summary: This PR is the explicit implementation candidate for the reported completed-receipt device mismatch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge-risk options

Maintainer options:

  1. Verify retained-receipt upgrades (recommended)
    Exercise a published updater and the candidate against copied completed receipt state, then demonstrate older-reader compatibility and successful next-update preparation.

Technical review

Best possible solution:

Keep reconciliation in the journal owner, validate previews without persisting repairs, and preserve usable receipts across published-version upgrade and recovery paths.

Do we have a high-confidence way to reproduce the issue?

Yes, source establishes the path: a completed Linux receipt with device drift reaches journal reconciliation during CLI dry-run admission and commits a revision. No runtime reproduction was executed in this read-only review.

Is this the best way to solve the issue?

The journal-owner repair is appropriate, and preserving existing intent kinds is safer than extending the persisted format. The unconditional write during preview must be separated from actual-update reconciliation.

Full review comments:

  • [P2] Keep receipt reconciliation out of dry-run admission — src/infra/package-update-activation-journal.ts:395-403
    With a completed Linux receipt whose saved device IDs differ, openclaw update --dry-run reaches this transition through initial package admission. The transition rewrites the retained descriptor and increments its revision even though the invocation only previews an update. This was raised in the previous review and remains unresolved; preserving the old intent kind fixes compatibility but does not prevent the write. Carry preview intent through admission, validate using reconciled facts without persisting them, and reserve the transaction for an actual update.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against d46d56281639.

Labels

Label changes:

No label changes.

Label justifications:

  • P0: The linked report establishes a blocked update path with a retired recovery helper and no demonstrated in-product recovery.
  • merge-risk: 🚨 compatibility: The patch rewrites retained cross-version recovery state, and published-updater and older-reader compatibility evidence remains incomplete.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: Ordinary external-contributor proof is exempt for this member-authored PR. Reported synthetic macOS tests exercise the journal owner, but the independent persisted-state gate remains incomplete: no published-driver × candidate recovery or older-reader after-reconciliation result is supplied.

Evidence

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/infra/package-update-activation-remount.test.ts --maxWorkers=1.
  • [P1] node scripts/run-vitest.mjs src/cli/update-dry-run-state.process.test.ts --maxWorkers=1.
  • [P1] node scripts/check-changed.mjs.
  • [P1] git diff --check.

What I checked:

  • Pinned introduced patch: The merge-base-to-head diff introduces receipt reconciliation, its unconditional admission call, the remount regression suite, and documentation. Review used the introduced delta rather than endpoint drift; the supplied test merge is stale and was not used to claim removal of main behavior. (src/infra/package-update-activation-journal.ts:385, 973f937c2a94)
  • Dry-run reaches the writer: Initial CLI admission calls assertUpdatePackageActivationAdmission before the dry-run execution branch, without passing preview intent. Its wrapper calls assertNoPendingPackageActivation, whose continuation reader now invokes readForAdmission. Device drift reaches transition, which updates descriptor JSON and increments the retained receipt revision. (src/cli/update-cli/update-command.ts:112, 973f937c2a94)
  • Prior finding remains: The previous completed review raised dry-run receipt mutation. Inspection of the exact earlier head through GitHub shows the same unconditional transition in readForAdmission; the current head changes persisted intent handling but does not introduce a preview guard. Local earlier-blob inspection failed with a Git object retrieval HTTP 403, so the authorized GitHub source read supplied this comparison. (src/infra/package-update-activation-journal.ts:395, 0e2f09ebb260)
  • Current main still needs the repair: At the pinned fetched main revision, admission still uses the strict journal read before recognizing completion; it has no completed-device-drift reconciliation path. No merged replacement fixing this request is established by the supplied related context. (src/infra/package-update-activation.ts:68, d46d56281639)
  • Compatibility repair and remaining evidence gap: The current reconciliation preserves the original phase and intent, updating replacementIdentity only for an existing settlement intent. The new test reads raw persisted intent and checks preservation of its fields, including settlement detail. This resolves the earlier new-intent defect, but uses the current reader and synthetic rewritten metadata rather than a published-driver-to-candidate upgrade and older-reader recovery transcript. (src/infra/package-update-activation-remount.test.ts:109, 973f937c2a94)
  • Captured validation evidence: The supplied PR body reports seven remount scenarios passing three times, broader owner/caller tests, and check-changed passing. It explicitly identifies the environment as isolated macOS synthetic metadata proof and says no live Btrfs remount was performed. These checks were not executed during this read-only review. (973f937c2a94)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add CLI-admission regression coverage proving dry-run preserves receipt bytes and revision while actual updates reconcile device drift.
  • Record redacted published-driver × candidate recovery and older-reader compatibility evidence for the refreshed receipt.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-07T02:30:09.872Z sha 0e2f09e :: blocked before merge. :: [P2] Keep receipt reconciliation out of dry-run admission

Keep the published completion intents and schema unchanged when refreshing verified receipt identities. Emit the reconciliation reason as a warning after commit. Keep reconciliation private to the journal owner and retain existing lease recovery policy.

Add raw persisted-intent regression coverage for completed and settled receipts, including preservation of existing settlement detail.
@steipete
steipete merged commit 2d26ebd into main Oct 7, 2026
131 checks passed
@steipete
steipete deleted the upd/upd-receipt-device-id-reconcile branch October 7, 2026 03:29
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 7, 2026
RomneyDa pushed a commit that referenced this pull request Oct 7, 2026
…ce id changed instead of blocking future updates (#166394)

Closes #166135

Reported by @neilofneils404.

Backport notes (release/2026.10.1): adapted the journal conflict to the
release identity API (packageActivationIdentity(..., true) and
privatePackageActivationIdentity(..., true|false) instead of the main-only
"parent"/"control"/"journal" roles), dropped the main-only
recovery-lease-missing intent check and recordPreviousCopy, and added only
the optional descriptor/completedInstallKey parameters to transition().
The remount test uses supersedeStalePackageActivation (release name for
settlePendingPackageActivation) and omits the main-only intent detail field.

(cherry picked from commit 2d26ebd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Completed package-update receipt blocks updates after filesystem device ID changes (Linux/Btrfs)

1 participant