Repository navigation
fix: keep doctor lint from migrating shared state - #124110
fuller-stack-dev merged 1 commit into
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 4:45 AM ET / 08:45 UTC. ClawSweeper reviewWhat this changesThis PR changes doctor lint checks to read existing shared SQLite state without creating or migrating it, while leaving runtime and repair writes unchanged. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open for maintainer review and exact-head CI. The patch uses the existing read-only SQLite lifecycle at each affected owner boundary; no blocking correctness or security defect was found. Priority: P1 Review scores
Verification
How this fits togetherDoctor lint collects health findings from Gateway-owned shared state such as heartbeat, task, pairing, approval, and workspace records. Its diagnostics feed terminal or JSON output and must not contend with or migrate a live Gateway database. flowchart LR
A[Doctor lint request] --> B[Health check selection]
B --> C[State-owning diagnostic readers]
C --> D{Database exists?}
D -->|Yes| E[Read-only SQLite snapshot]
D -->|No| F[Safe empty diagnostic state]
E --> G[Health findings JSON]
F --> G
Decision needed
Why: The protected maintainer label covers a cross-cutting shared-state lifecycle change whose final ownership and landing scope require human sign-off. Before merge
Agent review detailsSecurityNone. PR surfaceSource +183, Tests +171. Total +354 across 24 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: Keep the store-specific read-only seams and existing writable runtime/repair paths, then merge only after exact-head CI and the documented schema-7 full-lint proof remain valid. Do we have a high-confidence way to reproduce the issue? Yes: current main’s heartbeat detector calls the writable reader, and the PR body supplies a concrete schema-7 before/after command path; this read-only review did not execute it. Is this the best way to solve the issue? Yes: routing each diagnostic through its owning read-only state seam uses the existing lifecycle contract and avoids a process-wide write switch or rollback workaround. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5d601233df88. LabelsLabel 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
|
|
Maintainer owner review complete at ClawSweeper rank-up moves are satisfied: exact-head required CI is green, and the five owner-specific non-migrating readers are approved as the canonical diagnostic boundary. The copied schema-7 behavior proof remains unchanged: full |
|
Merged via squash.
|
Related: #119583
What Problem This Solves
Fixes an issue where operators running
openclaw doctor --lint --all --jsonagainst an existing environment could have the supposedly read-only command open the shared SQLite database through writable owners and migrate it. During a candidate-runtime preflight, that can make the still-running older gateway unable to read its own durable state.Why This Change Was Made
Every lint check now reads existing state through its owning non-creating, non-migrating SQLite seam: heartbeat scratch, exec approvals, workspace setup, task/task-flow status, and device pairing. Ordinary runtime and explicit repair paths retain their existing writable migration behavior. A process-wide write switch or post-hoc rollback was rejected because either can expose partially migrated state or turn diagnostics into hidden write failures.
User Impact
Operators can run the documented read-only doctor lint flow on older shared-state schemas without advancing the schema, creating a database, or adding WAL/SHM artifacts. Normal gateway startup, repair, pairing, approvals, and workspace/task persistence continue to migrate and write as before.
Evidence
72e67904be8b17985b18893ece68fccaea50cb59): heartbeat-only and full--alllint advancedPRAGMA user_versionfrom 7 to 8 and changed the database digest.a620205caa18c09559efbe16800c6328074ed0cf: full--lint --all --jsonreturned parseable JSON while schema version, seeded rows, database SHA-256, and state-directory inventory remained identical; no WAL/SHM appeared (98.1s check execution).oxlintfor all changed files: 0 warnings/errors.oxfmt --checkandgit diff --check: passed.Production LOC: +226/-43 (net +183). This growth is the explicit owner boundary needed to preserve diagnostic output across five independent stores without changing ordinary writable callers. Tests: +176/-5.
AI-assisted: yes. I reviewed the owner paths, reproduction, generated diff, and validation results.