Skip to content

fix(doctor): remove failed unsealed recovery captures - #189249

Merged
roboclaw-bot merged 1 commit into
mainfrom
roboclaw/doctor-unsealed-capture-cleanup
Oct 31, 2026
Merged

roboclaw-bot merged 1 commit into
mainfrom
roboclaw/doctor-unsealed-capture-cleanup

Conversation

@roboclaw-bot

@roboclaw-bot roboclaw-bot commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #189225

What Problem This Solves

Failed fresh standalone Doctor recovery captures leave unsealed copies that later retention does not retire.

User Impact

Doctor removes its own incomplete attempt once backup work has settled and maintenance authority remains current. It preserves every previous sealed recovery set, final-name publication evidence, and attempts with uncertain work or ownership. Existing abandoned captures remain protected; this does not introduce a historical orphan sweep.

Why This Change Was Made

The original-capture producer already owns a fresh exclusive directory and its retained pin. Standalone Doctor now opts into disposal at that owner using its outer live-custody guard, which remains valid when the capture's private deadline expires. Generic updater captures keep their existing policy. Cleanup failures preserve both errors in the error graph.

Evidence

  • RED on main 8b1efb47c130: actual Doctor caller and capture-owner tests both find the failed unsealed directory still present. GREEN: that attempt is absent while the previous sealed manifest and database remain intact.
  • Both full touched files pass: 36 capture-owner / 6 Doctor tests, including generic-update opt-out, uncertain child, revoked cleanup authority, possible final manifest publication, and last-sealed recovery controls. The new physical safety regression took 7.982 s in the initial full pass. Final error-chain correction passes its narrow replay; the combined final safety/timer wrapper took 30.78 s.
  • Targeted production/test noEmit types, core lint, formatting, and diff checks pass. Timeouts, nice and ionice were used. No containers or full product build; an installed-package upgrade and the reporter's multi-GB state were not exercised under this focused-only task. Exact-head main CI completed successfully; the separate security-review workflow also passed. No prepare or merge was invoked.
  • pr-simplify: one producer-owned disposal path with the existing pin; no global retention relaxation, new store, public config, or deletion of a sealed original. Net production +23, regression +93, exactly allocated for the two actual boundaries and distinct preservation controls; docs +5.
  • Fresh independent shared Codex autoreview, P0–P2, covers final commit ea3671a19ba2 against parent 8b1efb47c130, with intact committed capture/caller sources and owner context: scoped-clean, zero findings. All six changed files were assessed; the reviewer did not execute tests. A separate complete-candidate review also passed. The final pass filled a surrounding-source limitation in the first per-commit assessment.
  • Regression allocation is verified exactly from this commit. The repository-wide local test-line ratchet reached its 60-second bound without a verdict; CI supplies that full-repository gate.

Work sessions

Co-authored-by: steipete [email protected]

@clawsweeper

clawsweeper Bot commented Oct 31, 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 commands Command implementations size: S labels Oct 31, 2026
@roboclaw-bot
roboclaw-bot marked this pull request as ready for review October 31, 2026 09:22
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge.

What this changes

This PR removes a failed standalone Doctor capture when its work has settled and maintenance ownership remains valid.

Example: A standalone Doctor capture fails after writing incomplete backup payloads.

  • Before: The failed directory remains, and automatic retention excludes it because it has no sealed manifest.
  • After: Doctor removes that fresh attempt while preserving previous sealed captures and attempts with uncertain ownership, work, or final publication.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) The patch is focused and source review found no discrete defect, but required Doctor upgrade compatibility remains unproven.
Proof confidence 🦪 silver shellfish (2/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Partial
User problem: Failed Doctor captures accumulate incomplete recovery copies that automatic retention never removes.
Reason: The maintainer-authored direction has clear disk-space value and appropriately uses Related for the broader report.

Merge readiness

⛔ Blocked before merge - 1 item remains

Keep open: this maintainer-authored PR addresses a concrete capture leak still present on main; no introduced code defect was found.

Priority: P2
Reviewed head: ea3671a19ba2f78a246bb063fba1c7408986ba02

Before merge

  • Add data-model compatibility proof - The review found that existing stored data may not work after upgrade. Show that existing data still loads and works with this change.

Findings

None.

Tests

  • Missing end-to-end proof: Supply an installed latest-stable-to-candidate Doctor run showing failed-attempt disposal while existing settings, databases, and sealed recovery copies remain intact.
Agent review details

How this fits together

Doctor captures configuration, databases, and declared plugin resources before repair; the capture producer publishes a recovery manifest or reports failure to Doctor.

flowchart TD
  A[Doctor repair] --> B[Maintenance ownership]
  B --> C[Original capture producer]
  C --> D[Database and file backups]
  D --> E[Published recovery manifest]
  D --> F[Capture failure]
  F --> G[Settlement and ownership checks]
  G --> H[Remove fresh incomplete attempt or retain evidence]
Loading

Technical review

Best possible solution:

Keep disposal at the existing capture producer, limited to its settled fresh attempt under current maintenance custody.

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

Current main retains failed attempts and excludes unsealed captures from automatic retention; supplied regressions report base failure and head success, but this read-only review ran no reproduction.

Is this the best way to solve the issue?

The change fixes the leak at its producer with existing ownership and settlement contracts, without broadening historical retention or creating another cleanup owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Failed original-capture retention changes intended behavior with a stated reason (e47d0ce: Preserve original configuration and database evidence before updates or repairs, including incomplete capture diagnostics.)
  • Interrupted manifest publication keeps the original intent (a86dd38: Retain incomplete publication evidence instead of retiring potentially useful recovery originals.)
  • Doctor capture deadline and settlement keeps the original intent (40172b9: Bound capture duration while awaiting owned work settlement before continuing repair.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Jason (Json): Raw commit 1d99689 adds src/commands/doctor-original-capture.ts:199 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 1d99689ccf81; files: src/commands/doctor-original-capture.ts)
  • Dallin Romney: Raw commit 0492dc8 adds src/commands/doctor-original-capture.ts:25 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 0492dc8828a5; files: src/commands/doctor-original-capture.ts)

PR surface

Source +23, Tests +93, Docs +5, Other +2. Total +123 across 6 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 24 1 +23
Tests 2 94 1 +93
Docs 1 5 0 +5
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 6 125 2 +123

Review metrics

Metric Value Why it matters
Production versus regression growth Production +24/−1; tests +94/−1 The small producer change is supported by distinct caller-wiring and physical preservation controls using existing fixtures.

Labels

Label changes:

  • add P2: Repeated failed captures can consume substantial disk space, while this PR remains a focused cleanup repair.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Label justifications:

  • P2: Repeated failed captures can consume substantial disk space, while this PR remains a focused cleanup repair.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.

Rank-up moves

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

  • Record the latest-stable-to-candidate Doctor compatibility run with prior recovery copies and user state preserved.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 31, 2026, 5:39 AM ET / 09:39 UTC.

@roboclaw-bot
roboclaw-bot merged commit f25487c into main Oct 31, 2026
235 checks passed
@roboclaw-bot
roboclaw-bot deleted the roboclaw/doctor-unsealed-capture-cleanup branch October 31, 2026 10:09
@roboclaw-bot

Copy link
Copy Markdown
Collaborator Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant