Repository navigation
fix(update): stop runtime retention from hard-linking released activation journals that block later package swaps - #187549
Conversation
Copy owner-private retained runtime files instead of changing recovery link counts and ctime. Inspect multiply linked completed receipts read-only and archive their original bytes under a fresh update fence; keep in-flight recovery and writer admission strict. Prove successful activation, runtime retention, and a second package swap, including already-affected installations and an in-flight negative control. Thanks to @zigit for the root-cause analysis and inode evidence. Fixes #187468
|
🦞👀 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 SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: blocked before merge. What this changesThis PR copies private retained-runtime files and archives multiply linked completed activation journals so later package updates can proceed. Example: A completed npm-global update leaves operation.sqlite with nlink=2.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this PR open: it addresses a source-verifiable recovery gap that remains on main, preserves unfinished-recovery protections, and has no discrete correctness finding. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherRuntime retention preserves files needed by updater workers; package activation consumes staged packages and recovery journals to publish installations or settle completed recovery. flowchart LR
A[Installed runtime files] --> B[Runtime retention]
B --> C[Private retained runtime]
D[Activation journal] --> E[Completion inspection]
E --> F[Fenced evidence archival]
F --> G[Next package activation]
Technical reviewBest possible solution: Keep prevention in runtime materialization and completed-evidence handling in the existing activation owner, preserving strict unfinished recovery and the documented older-updater recovery route. Do we have a high-confidence way to reproduce the issue? Current source exposes both failure paths, and the added regressions exercise them through real filesystem and activation owners; no target code was executed during this read-only review. Is this the best way to solve the issue? The patch is a focused complete repair using existing owners: prevent private-file link mutation, inspect only completed shared journals, and archive under current update authority. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4e846533cd2b. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +32, Tests +119, Docs +7. Total +158 across 6 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel 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 Reviewed October 29, 2026, 5:40 AM ET / 09:40 UTC. |
…tion journals that block later package swaps (openclaw#187549) Runtime retention hard-linked the released package activation journal into its payload (nlink 1 -> 2), so the next update's package-swap preflight, which requires single-link publication-recovery objects, refused every subsequent update and rolled back. Retention now copies owner-private runtime files, and the activation owner archives completed journals that already carry an extra link (bytes preserved, warning logged) so affected installs heal on their next update. In-flight recovery keeps the nlink=1 safety check. Fixes openclaw#187468. Root-cause analysis by @zigit.
Fixes #187468
What Problem This Solves
Fixes npm-global updates getting stuck at package-swap when runtime retention has added a hard link to recovery evidence left by a completed update.
User Impact
An updater containing this repair automatically archives an already multiply linked completed receipt, reports a warning, and continues updating. The original journal bytes are preserved. In-flight recovery still requires
nlink=1. This fix must be present in the installed updater; the documentation retains the Doctor recovery steps for older updaters.Why This Change Was Made
Runtime retention now copies owner-private files, including private recovery modules inside
dist, instead of changing their link count and ctime. Package activation remains the lifecycle owner: its settlement reader can inspect a multiply linked journal only to establish completion, cannot admit a writer, and archives completed evidence under a fresh live update fence. Admission and preparation consume that same completed-evidence contract, including the existing warning fallback when archival is unavailable.Current main already excludes recovery controls beside the package (#162246). A clean two-update sequence therefore passed before this change. The remaining producer gap was private files within the retained runtime, and the recovery gap was admission rejecting an already linked completed receipt before it could inspect completion. The regressions distinguish those cases rather than attributing the existing exclusion to this PR.
Thanks to @zigit for the cross-machine root-cause analysis and inode evidence in the issue report.
Evidence
nlink=1, unchanged inode/ctime, byte-preserving archival, and successful activation of the next version. A separate negative control preserves and refuses multiply linked in-flight recovery.d207f65438410ecfc78789133d870773428bcf23: two regression cases fail (private source becomesnlink=2; linked completed journal refuses admission), and the in-flight safety case passes.git diff --check, and madge pass (0 cycles).check:changed/ SQLite inventory omitted under the campaign's local gate budget; PR CI supplies broad validation. No remote lease used.Production: +51/-19 lines (net +32). Regression tests: +119 lines. Documentation: +8/-1 lines.