Repository navigation
fix: avoid update failures when header snapshot cleanup is denied - #195487
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: needs maintainer review before merge. What this changesThis PR makes nested candidate SQLite header probes preserve their result when disposable snapshot cleanup fails. Example: Candidate inspection reads user_version 7 from a closed WAL database, but removing its private header snapshot returns EACCES.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR closes a concrete gap in candidate update cleanup policy, and source review found no introduced correctness defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherCandidate update workers inspect existing databases and prepare rehearsal copies; SQLite header readers return version metadata, while the snapshot owner handles private-file cleanup and retries. flowchart TD
A[Candidate update worker] --> B[Version inspection or rehearsal]
B --> C[SQLite header probe]
C --> D[Private snapshot when required]
D --> E[Read metadata and close database]
E --> F[Existing cleanup owner]
F --> G[Result and warning]
F --> H[Retained cleanup retry]
Technical reviewBest possible solution: Carry the existing candidate-only cleanup policy through both header probes while preserving strict defaults, fatal read failures, and existing retry custody. Do we have a high-confidence way to reproduce the issue? Current-main source directly exposes the fatal cleanup path, and the supplied regression uses a closed WAL database plus EACCES removal injection; this read-only review executed no target code. Is this the best way to solve the issue? This is a focused completion of the existing candidate policy: it changes the owning header consumer and its two candidate callers without adding another cleanup owner or weakening validation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7c7a4d5db4ad. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +32, Tests +119, Other +2. Total +153 across 7 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 8, 2026, 8:10 PM ET / November 9, 2026, 01:10 UTC. |
…enclaw#195487) * fix: keep candidate header cleanup failures warning-only * refactor: isolate SQLite header inspection * fix: load candidate header inspector lazily --------- Co-authored-by: roboclaw-bot <[email protected]>
* fix(update): include cold archives in candidate snapshots Co-authored-by: steipete <[email protected]> * fix(update): preserve file archives in rehearsal snapshots Co-authored-by: steipete <[email protected]> * fix(update): preserve source WAL state during archive inventory Classify cold archive SQL under its existing candidate-state subprocess owner. Preserve incomplete WAL source families so header inspection retains private cleanup custody. Co-authored-by: steipete <[email protected]> --------- Co-authored-by: steipete <[email protected]> Release adaptation: the baseline does not contain the #195487 header-cleanup suite. Keep that unrelated suite absent; carry the new incomplete-WAL inventory assertions into the existing inventory suite instead. Add a per-change 214-line allocation for the source regression, chunk fallback, and WAL preservation tests. No schema, updater protocol, authority, or archive-integrity changes. Companion audit at 9e917f0: - #200733 is selected as the next dependency-closure repair: missing archives must warn instead of blocking updates, and Windows copies must not share live read-only inode attributes. Do not qualify this intermediate checkpoint alone. - #200076 and #200930 are independent cold-history performance changes, not prerequisites for this snapshot repair. - #201009, #200994, #200866, #200577, #200805, #200802, and #200732 overlap only adjacent update documentation and independent repair flows; not prerequisites. Proof on base 309067b: - New production-subprocess regression: 4/4 fail before, 4/4 pass after. - Cold archives, chunks, and inventory: 31/31 pass after. - Additional budget/cleanup/import siblings: 46/47 pass. Configured-cache containment fails identically on the unchanged base at budget.test.ts:737; retained as an independent failure, not weakened or repaired here. - Targeted lint and format, documentation links, SQLite worker ratchet, and test-line ratchet pass. SQLite T1 counts remain 170; compatibility 15. - Worker typecheck was blocked at dependency custody, without guard bypass. Parent canonical core typecheck, typed lint (five files), and formatting passed with its owned dependencies. Full installed-upgrade/FRV proof remains pending the assembled candidate, including selected companion #200733. (cherry picked from commit 802e3f7) Co-authored-by: RomneyDa <[email protected]> Co-authored-by: vincentkoc <[email protected]>
Backport of a35b92c. Release adaptation: keep inspection in existing readonly-location module; thread cleanupFailure warn to both candidate callers, retain strict default and source recovery behavior. Exclude module relocation, snapshot-policy move and allocation metadata. Co-authored-by: RomneyDa <[email protected]> (cherry picked from commit 2a531caf36c15180522cfca9c9b41eebb310b297)
Related: #195409, #195396
What Problem This Solves
Fixes candidate update checks and rehearsals failing when a nested SQLite header probe reads successfully but cannot remove its private snapshot.
User Impact
Candidate updates continue with a warning for disposable header-snapshot cleanup failures. Read, acquisition, validation, identity, and native read-close errors still fail; Doctor and other default callers retain strict cleanup. Persistent cleanup failures can leave temporary directories for later cleanup.
Why This Change Was Made
Pass the existing candidate-only
cleanupFailure: "warn"policy through both nested header probes. Reuse the existing warning logger and directory owner, retaining bounded removal retries and later cleanup custody. Cleanup warnings preserve the successful result or original read error.Header inspection now lives in a small sibling module, with all callers and mocks migrated. Snapshot preparation stays within its local size budget: 660 counted lines against a 700-line limit. The shared source-read timeout remains 30 seconds. Both candidate operations load this inspector lazily at their execution boundary, avoiding mixed static/dynamic imports in production bundles.
Evidence
toBe(original).e06817494243; those results are earlier-head evidence.git diff --checkpass with normal local size enforcement. No tests or limits were weakened. The snapshot-preparation module remains 660 counted lines.GIT_NO_LAZY_FETCH=1(6,588,953 lines / 6,589,023 ceiling). No inherited-debt grant or scalar change.INEFFECTIVE_DYNAMIC_IMPORTbuild guard. Main's latest full run is still active; the last completed full run passed PostgreSQL 2/3 and compact-small-20, and its UI failure was an unrelated motion assertion. The guard and build configuration are unchanged.e06817494243121291f8fb43a87b77848269b6f0to the final staged repair committed as1c5c7427851a42d332241d2d214f012667c6ca81completed P0–P3, scoped-clean, no actionable findings. Static review; CI subsequently passed the runtime-build step. Local ClawSweeper is unavailable; no hosted review comment was requested.