Repository navigation
fix(update): settle a completed package receipt whose filesystem device id changed instead of blocking future updates - #166394
Conversation
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.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed October 6, 2026, 11:06 PM ET / October 7, 2026, 03:06 UTC (Revision 2). ClawSweeper reviewWhat this changesThe 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 Review scores
Verification
How this fits togetherPackage-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]
Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +139, Tests +142, Docs +9. Total +290 across 4 files. View PR surface stats
Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest 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:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d46d56281639. LabelsLabel changes: No label changes. Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
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.
…ce id changed instead of blocking future updates (openclaw#166394) Closes openclaw#166135 Reported by @neilofneils404.
…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)
What Problem This Solves
Fixes initial
openclaw updateadmission 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
unlink-helperandsuperseded-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 matchorigin/main.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.node scripts/check-changed.mjs: passed, including production/test types, lint, dead exports, storage guards, and import cycles.