Repository navigation
fix(doctor): preserve unresolved findings for each repair outcome - #117448
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 11:31 AM ET / 15:31 UTC. ClawSweeper reviewWhat this changesThe branch changes Doctor repair aggregation so each unvalidated check retains its original finding while successfully validated repairs use their post-repair findings. Merge readinessKeep this PR open for maintainer review. Current Priority: P1 Review scores
Verification
How this fits togetherDoctor runs registered health checks, may repair their findings, and then renders unresolved findings back to the operator. The repair flow sits between per-check execution and the Doctor contribution renderer, so its remaining-finding list determines whether an unresolved warning is visible. flowchart LR
A[Registered Doctor checks] --> B[Per-check detection]
B --> C[Repair attempt]
C --> D{Validation completed?}
D -->|Yes| E[Post-repair findings]
D -->|No| F[Original unresolved findings]
E --> G[Doctor result renderer]
F --> G
Decision needed
Why: The patch is technically sound on the inspected execution path, but the PR carries the repository's protected Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +108. Total +112 across 2 files. View PR surface stats
Review metricsNone. Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Merge the per-check aggregation repair after the designated maintainer confirms the protected-label review, so every unresolved Doctor finding reaches the existing structured renderer while validated repairs remain clean. Do we have a high-confidence way to reproduce the issue? Yes. Current source shows that the contribution renderer consumes Is this the best way to solve the issue? Yes. Selecting the authoritative result per check at the aggregation boundary is narrower and more maintainable than changing renderers or asking each individual health check to duplicate fallback findings. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7bcbe743bd42. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
Addressed all ClawSweeper rank-up moves in the updated PR body with exact current-main versus PR-head output from the real registered Workspaces Doctor check and unchanged Doctor command renderer; the failed/skipped repair now visibly preserves its warning. @clawsweeper re-review |
|
Maintainer decision: accept the canonical per-check Doctor repair outcome refactor. The updated PR body now includes exact current-main versus PR-head output from the real registered Workspaces Doctor check, proves the skipped repair warning is visible, and verifies that the protected workspace database remains untouched; full required CI and all review gates are green. |
|
Merged via squash.
|
…117448) Co-authored-by: Peter Steinberger <[email protected]>
Root cause
The Doctor repair owner discarded each check's original finding when a repair was skipped, failed, unavailable, or could not be validated. Aggregate repair counters also hid these unresolved findings when another check in the same batch succeeded.
Fix
Select the authoritative findings while each individual check's repair outcome is still available: use post-repair findings only after that same check completes validation; otherwise preserve its original findings. Existing caller contracts, check order, configuration threading, and repair counts remain unchanged.
Verification
Real registered Doctor repair: exact before/after console proof
Ran Node v24.18.0 against current
main(71a59512ba476df3328cf485d84748121cf341f2) and this exact PR head (b408623e10754e6155b4661aded28d764fc574d1). The isolated fixture contains a real retired-Workspaces fingerprint at<STATE_DIR>/workspaces/workspaces.sqliteand deliberately configures that same directory as the active agent workspace. The actual productionCORE_HEALTH_CHECKSregistry selectscore/doctor/removed-workspaces-state; the actual productionrunCoreContributionHealth(...)Doctor command path performs detection, safely skips the destructive repair, and renders the final structured result. No mocked check, repair, consumer, or Gateway is involved.Exact commands:
Current
main:Exact PR head:
Therefore the unchanged, real Doctor consumer previously emitted no structured console outcome after the real owner safely skipped repair; the exact PR head preserves and renders the unresolved warning while leaving the protected workspace database untouched. Network calls are denied and counted; both runs observed zero attempts. Fixture paths are redacted; no credentials or user state are read.
Rank-up move response