Repository navigation
fix(update): unblock repair after filesystem device remapping - #170046
Conversation
Let the journal owner qualify matching inodes and consistent device maps for settlement only. Use that path from public repair and the separate helper, verify newer manual installs, and preserve the original recovery evidence. Normal update admission and unfinished rollback remain strict. Mirror the upstream internal TransactionRecipes export cleanup from 4cdac89 to keep the required unused-export checks clean. Fixes #169352 Fixes #169050
|
🦞👀 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. What this changesThis PR lets update repair settle device-remapped journals for an installed candidate or a verified newer manual installation while preserving recovery evidence. Example: A retained 2026.9.9 operation records device 57, the filesystem now reports device 32, and a manual 2026.10.1 installation is live.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 2 items remain Keep this PR open: it addresses an evidenced update-recovery failure, but the earlier unverified previous-generation settlement finding remains unresolved. Priority: P1 Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe package-activation owner receives repair requests, persisted journals, and filesystem observations; it acquires current executor ownership and produces a durable settlement and preserved evidence archive. flowchart TD
A[Update repair CLI] --> C[Package activation owner]
B[Separate recovery helper] --> C
D[Journal and filesystem identities] --> C
C --> E[Current executor ownership]
E --> F[Package and launcher verification]
F --> G[Settlement and evidence archive]
Technical reviewBest possible solution: Use projected identities consistently and preserve refusal or verified retirement whenever the previous generation remains installed. Do we have a high-confidence way to reproduce the issue? Reported device/inode comparisons establish the current-main refusal, and source tracing establishes the retained previous-generation bypass; this read-only review ran no target code. Is this the best way to solve the issue? Sharing mapping in the journal owner is appropriate, but all recovery selectors must consume that mapping consistently before relinquishing unfinished recovery. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 6112e37e00f3. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +20, Tests +87, Docs +11. Total +118 across 9 files. Added test files: 0. 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. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 12, 2026, 2:33 PM ET / 18:33 UTC (Revision 2). |
Remove the helper-only settlement entry point and forwarding wrapper, reuse projected identities and the live-package guard, and share custody completion and archive reporting. Keep remount-only helper restrictions and the publication-owner return contract intact.
…rift (#170046) (2026.10.5 backport) After a reboot or remount changed the device number (btrfs, APFS renumbering) with every inode intact, the strict journal identity check rejected recovery before settlement could run, blocking every later update. The journal owner now provides a settlement-only remount validation shared by openclaw update repair and the recovery helper: repair settles the installed candidate or verifies a newer manual install and archives the superseded operation. Normal update admission stays strict. Fixes #169352, #169050. Backport notes: companion of #169410 (previous commit). Production code applied as on main. Conflict resolution: the sealed helper's remount branch again omits the FreeBSD selectPackageActivationNativeRoots() call (not on 2026.10.5, see #168775/#168942); the public-repair test file keeps the branch's existing obsolete-recovery tests and archival-refusal cases and adds main's two remounted-journal regressions. Extracted-from: c66da3d
…rift (openclaw#170046) After a reboot or remount changed the device number (btrfs, APFS renumbering) with every inode intact, the strict journal identity check rejected recovery before settlement could run, blocking every later update. The journal owner now provides a settlement-only remount validation shared by openclaw update repair and the recovery helper: repair settles the installed candidate or verifies a newer manual install and archives the superseded operation. Normal update admission stays strict. Production net +20 LOC after removing the helper-only path and duplicate identity checks. Fixes openclaw#169352, openclaw#169050.
|
Related Linux case, if anyone hits the repair path again after this fix: 2026.9.36 on a npm-global Linux install (not the macOS device:inode drift reported here) still refuses with a different predicate: Full environment, journal dump and repro sequence: #170031 (comment) The distinction worth noting: recovery refuses ~53s after the request, and |
What Problem This Solves
Fixes package-update recovery that stays blocked after a reboot or remount changes filesystem device numbers, including an old operation left behind by a newer manual installation.
Fixes #169352. Fixes #169050.
User Impact
openclaw update repaircan settle the installed candidate or a verified newer manual installation and archive the old operation. It preserves the live package, retained package trees, helper, and journal evidence. Normal update admission remains strict, and unfinished rollback remains owned by its recovery path.Older installed updaters still need the separately installed recovery helper or the documented manual upgrade first; downloading a candidate cannot repair the already-running old updater.
Why This Change Was Made
The journal owner now validates matching journal inodes under a consistent, bidirectional device mapping for settlement inspection of prepared, publishing, publication-complete, and superseded records. In-process repair and the separate helper share that owner. Remapped handles can only durably settle and archive; they cannot republish or restore, rewrite the descriptor, or change publication facts.
A newer manual replacement uses the existing manifest, inventory, entry-target, launcher, and current-authority verification before the existing supersession/archive path. Recorded identities remain historical evidence. No configuration, schema, dependency, or persisted-format changes.
The follow-up deletes the helper-only
settleRemountedPackageActivationentry point and the extrasettlePendingPackageActivation→settlePackageActivationforwarding layer. The sealed helper now calls the shared settlement operation with its operation ID. It also removes the duplicate publication custody/archive completion block, the separate untouched-preparation identity guard, and repeated previous/candidate device projections. These deletions remove 42 net production lines from the reviewed head while retaining the helper remount restriction and all integrity, authority, callback, and warning contracts.Evidence
Follow-up verification at
8eb11dc7cf93bf2e8c21271140ef3dc1359f3b8b: 97 tests passed across seven focused files, including all 22 public-repair tests and all 5 adapter/store tests. The combined command completed in 382.85 s; the public CLI file took 99.89 s wall time (about 57 s test time), and the infra group took 138.20 s wall time (about 108 s test time). Production and infra-test typechecks, changed-file lint, and independent Codex review passed. Madge: 0 cycles; runtime import check: 0 cycles. The importer run passed the tooling group (46 tests), infra group (287 tests, 66 existing skips), and 10 process tests, then stopped on the same pre-existing 120 s post-core subprocess timeout recorded below. Its setup counters were 138.4 s for fixture preparation, 34.1 s for publication, and 61.5 s for the first healthy child. The fallback command passed eight CLI files (109 tests, 277.93 s wall time), including a repeated runtime-preview file. The final coverage audit identified the unreached retained-executor file, which then passed all 14 tests (144.06 s wall time). All 40 selected importer files were reached. Excluding the repeated runtime-preview run, the focused and importer runs total 553 passed, 66 existing skips, and that one known timeout. The broad importer command exited nonzero; the focused and continuation commands passed. The failed test was not rerun.Additional existing slow-test evidence from the follow-up: the declaration build/cache case took 58.212 s, bounded-plugin declaration selection 46.650 s, and missing-receipt cases 38.513 s and 31.208 s. These perform real compiler/build work. The lifetime test “preserves version-1 launcher receipts and reads completion through status after helper removal” took 60.503 s (15.387 s in the original-head run); it combines real repair/retirement with a cold CLI-status import. The repair-ledger cases accumulated 163.393 s. These cases passed unchanged; no timeout, retry, assertion, or skip was added.
Original-head evidence follows.
The two new public-repair regressions fail on the original main code with
Package publication journal does not match its installation, then pass with this change. They cover a remapped publishing journal with the candidate installed and a remapped publication-complete journal replaced by a manual 2026.10.1 installation, including preservation of both live and archived trees.node scripts/run-vitest.mjs src/cli/update-cli/update-repair-package-activation.test.ts --maxWorkers=1: 22 passed, 111.38 s wall time, about 28 s test time. Cold shared compiler preparation dominates the remaining time.Final independent Codex review found no actionable P0–P2 findings. The importer campaign ran all 40 selected files: 548 tests passed and 66 existing tests were skipped, with one pre-existing cold subprocess composition timing out under concurrent host load. Its original main implementations then passed in 58.2 s of test time; the current implementations passed in 84.3 s under the same isolated command. The original 120 s timeout remains recorded; no timeout, assertion, or retry policy was changed, and the diagnostic passes are not presented as a timeout fix. CI timings are not available yet.
check:changedpassed the growth, ownership, dependency, formatting, documentation, production typecheck, and all 28 test type graphs before detecting the unused internalTransactionRecipesexport. This patch mirrors the one-line cleanup already landed in main as 4cdac89. The failed and remaining steps were resumed individually: unused-export scans, production typecheck, lint, and all remaining guards passed. The full command did not exit successfully on that run. An earlier Node 26 launch crashed with SIGILL during source planning; the completed proof used supported Node 24. Both direct adapter/store consumer files passed (5 tests). Madge reports zero import cycles.Pre-existing tooling cost:
write-unified-entry-dts.test.tstook 155.43 s of test time; its build/cache/restore case took 83.965 s, bounded-plugin selection 39.305 s, and compiler-failure preservation 31.618 s. These exercise real repeated declaration/runtime builds and a consumer typecheck. The staged package-runtime build/load case inmanaged-handoff-build-config.test.tstook 59.842 s (62.763 s for the file), building the real standalone runtime and exercising isolated recovery commands. Both suites passed unchanged; the repair-ledger suite also accumulated 137.902 s across its existing cases. These costs are recorded under the campaign exception for pre-existing slow suites.Production: +163/-143 lines (net +20). Tests: +103/-16 lines (net +87). Docs: +17/-6 lines. The production growth adds newer-install verification and shared journal mapping; the follow-up removes superseded entry points and duplicate settlement logic.