Repository navigation
fix(doctor): analyze SQLite databases after offline compaction - #119901
clawsweeper[bot] wants to merge 2 commits into
Conversation
|
Codex review: needs historical verification review before merge. Reviewed August 24, 2026, 1:52 PM ET / 17:52 UTC. ClawSweeper reviewWhat this changesThe PR adds Regression provenancePossible regression — probable (reviewed change; failure trace). No predecessor PR is attributed. Merge readiness⛔ Blocked until a maintainer resolves historical verification - 9 items remain The PR’s compaction sequence is coherent, but it does not repair the linked Doctor migration path: current Priority: P1 Review scores
Verification
How this fits togetherDoctor has both normal health repairs and explicit session/state SQLite maintenance commands. Agent database migrations can write schema and indexes during normal Doctor repair, while the shared compactor performs checkpoint and VACUUM work for explicit maintenance flows. flowchart LR
A[Doctor repair] --> B[Agent schema repair]
B --> C[Agent database migration]
D[Explicit session or state maintenance] --> E[Shared offline compactor]
E --> F[Checkpoint and VACUUM]
F --> G[Planner statistics and final checkpoint]
C -. currently bypasses .-> G
Decision needed
Why: The branch adds a potentially expensive, fallible maintenance step in a shared compactor, while current normal Doctor migration reaches a different owner boundary; choosing the intended coverage is a maintainer policy decision. Before merge
Findings
Agent review detailsSecurityNone. PR surfaceSource +3, Tests +7, Docs +1. Total +11 across 3 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: 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: Refresh planner statistics immediately after the actual Doctor-owned agent schema/index migration, then cover normal Do we have a high-confidence way to reproduce the issue? Yes, by source: normal Is this the best way to solve the issue? No. The compactor change is internally coherent, but it is not the best fix for the linked migration report because the normal Doctor migration path bypasses it. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3c2667ca40f1. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (6 earlier review cycles)
|
|
🦞🧹
This is fix-only; I will not merge this PR. Re-review progress:
|
792e4db to
6f9eb81
Compare
|
🦞✅ Source: Why human review is needed: What the maintainer can do as a next step: I added |
|
Superseded by #134062. The patch here runs full Closing this PR to keep one canonical repair for #119884. The distinct post-compaction proposal remains tracked in #119739. |
Fixes #119884.
The shared doctor-only SQLite compactor will run one-shot
ANALYZEafter successful VACUUM/checkpoint work, then checkpoint again before reporting success. This refreshes persisted planner statistics for migrated agent databases without adding periodic runtime maintenance, configuration, schema changes, or weakening existing busy, integrity, ownership, quarantine, and permission guards.Regression coverage extends the historical v1 agent-database import path and verifies that
sqlite_stat1exists after migration and compaction. Thanks to @gucasbrg for the report and reproduction context.