Repository navigation
fix(doctor): retain interrupted capture publication evidence - #166495
Conversation
|
🦞👀 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 7, 2026, 4:02 AM ET / 08:02 UTC (Revision 4). ClawSweeper reviewWhat this changesDoctor and update recovery preserve interrupted capture publications as incomplete evidence and delegate exclusive file publication directly to fs-safe. Merge readiness⛔ Blocked before merge - 2 items remain This PR still addresses a current-main recovery defect. No actionable code findings remain; the required published-updater compatibility result is still pending. Priority: P2 Review scores
Verification
How this fits togetherDoctor and the updater capture original configuration and database state before repairs. Recovery discovery presents those captures for inspection, while retirement removes only eligible sealed standalone Doctor copies. flowchart TD
A[Original configuration and databases] --> B[Doctor and update capture]
B --> C[Exclusive filesystem publication]
C --> D{Partial manifest remains?}
D -->|Yes| E[Retain incomplete evidence]
D -->|No| F[Validate sealed capture]
F --> G[Recovery inspection or eligible retirement]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -3, Tests +9, Docs +5. Total +11 across 8 files. View PR surface stats
Review metricsNone. 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 one filesystem publication owner and conservatively retain interrupted captures without granting restoration authority, backed by successful fresh-state and published-upgrade evidence. Do we have a high-confidence way to reproduce the issue? Yes, from source: on current main, a final-plus-partial manifest can fail inventory reading or qualify for expired standalone retirement. This review did not execute that path. Is this the best way to solve the issue? Yes. A shared conservative seal classifier and direct use of the dependency's publication owner address the violated invariant without accepting hard links as restore points. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 191ebcef6aa1. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat 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
History |
|
The remaining Revision 2 ask looks narrower than re-proving the fs-safe syscall layer. I wrote a bounded validation contract here: The split is:
That seems to match the review request without duplicating fs-safe's already-merged AWS/Linux seccomp proof or inventing another compatibility harness. I also re-audited the current patch itself: the shared pending-seal classifier is conservative, metadata access checks seal completion before and after reads, and Doctor retirement re-checks pending seal immediately before Source-reviewed only; I did not execute the Linux/runtime lane. |
|
Merged via squash.
|
…w#166495) * fix(doctor): retain interrupted capture publication evidence * style(doctor): brace capture recovery conditions
What Problem This Solves
Fixes recovery discovery hiding healthy captures, and standalone Doctor retirement deleting interrupted captures, when publication stops after creating the destination but before removing the source name.
Closes #166246. Closes #166466.
Why This Change Was Made
Main already received fs-safe 0.24.2 through #166457. Both pre-repair publication sites now call fs-safe directly, removing the duplicate unsupported-rename adapter introduced by #166425. Native
autoowns the exclusive link/unlink fallback;requireremains fail-closed.A remaining
manifest.json.partialmeans publication is incomplete. Discovery lists it beside healthy captures without granting a sealed manifest reference; baseline reuse and forward-resolution validation refuse it; automatic retirement retains it. This applies equally to exact hard-link pairs, copied finals from the earlier adapter, and contradictory names. No name is removed and no pair is accepted as a restore point. Snapshot/payload pairs without a manifest remain incomplete evidence. Existing manifest digests, scope, directory identity, outcome binding, payload integrity, and hard-link rejection remain in force.User Impact
Doctor can retain pre-repair captures on Linux filesystems that reject
RENAME_NOREPLACE, using the upstream fallback. Interrupted captures remain available for manual inspection instead of disappearing from discovery or being deleted after 30 days. Ordinary expired sealed standalone captures keep their existing retirement policy. No configuration, database schema, or capture format changes are needed.Thanks @MertBasar0 for the reproduction and recovery-window analysis.
Evidence
pnpm test src/infra/update-database-backup.test.ts src/cli/update-cli/status.recovery.test.ts --maxWorkers=1passed all 52 tests (366.45 seconds including compiled-worker preparation). The regression states cover both manifest and snapshot/payload link windows, copied finals, and mismatched names. Existing symlink, external-hardlink, scope, and binding refusals remain covered.pnpm changed:lanes --json: core, core tests, documentation.pnpm check:changedpassed, including core typechecking, all 27 test typecheck groups, full core lint, dead-export scans, runtime import cycles, and the applicable guards.0e6d3975d38084f1850588f3f950a56919f89215; no admin exception is needed.renameat2(RENAME_NOREPLACE)returnsEINVAL, while plainrenameat2,rename, andlinksucceed.pnpm openclaw doctor --fix --non-interactiveexited 0 and printedPre-repair state retained for manual recovery at …/manifest.jsonin every case below. Every payload SHA-256 and size matched the manifest; successful publication left one link and no partial manifest.openclaw update status --jsonretained all bytes, inodes, and link counts; all three appeared as incomplete without recovery references, while two healthy sealed captures stayed visible.copyPluginSourceFilecaptured and hashed 64 MiB through the copied descriptor in 3.55 s.stracerecorded successfulFICLONE; inodes differed (131/132), free space was unchanged at cloning, and destination mutation left source bytes unchanged while the remaining extents stayed shared. The mount was released.2026.9.8→ exact candidate head0e6d3975d380, update exit 0 in 650.837 s, finished state, readiness HTTP 200, running version verified, and durable/incognito session postchecks passed. The original 1125-second envelope was retained. The informational publication-recovery command did not indicate a failure. The released driver lacks modern original-capture lineage, so its documented missing-lineage notice remains; the standalone Doctor capture cases above all succeeded. Candidate tarball integrity/import-graph checks passed; SHA-256b0e1cdb3109c1151e147f3f119ca8eae01869301761016d6543eaa38b06f42e9.copied.fd; no call-site change needed. Real XFS clone and copied-descriptor hashing proof passed.