Repository navigation
fix(updates): avoid repeated private snapshot integrity scans - #174928
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review in progressClawSweeper is reviewing this revision. This supersedes any previous blocked status. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR skips duplicate integrity scans for eligible private SQLite snapshots while retaining final verification and early checks before potentially destructive work. Example: Capture a WAL-backed database with auto_vacuum=NONE, user_version=7, and records at row IDs 71 and 81.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR provides a useful optimization that current main still lacks, with no introduced correctness or security defect identified. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherUpdate and backup callers pass SQLite files to the shared snapshot owner, which acquires a private image, normalizes journaling, verifies it, and publishes a standalone snapshot with content evidence. flowchart TD
A[Update and backup callers] --> B[Private SQLite acquisition]
B --> C[Eligibility and early checks]
C --> D[Journal normalization]
D --> E[Final integrity and foreign keys]
E --> F[Verified snapshot publication]
Technical reviewBest possible solution: Retain the narrow eligibility guard and final publication verification, then complete the existing exact-head CI gate. Do we have a high-confidence way to reproduce the issue? Current-main source shows eligible private images receiving both source and final integrity passes; this review did not execute target code. Is this the best way to solve the issue? The change removes redundant work in the existing owner while preserving early admission wherever callbacks, compaction, or FULL auto-vacuum could change the evidence being checked. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9285ef2266ef. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +12, Tests +245, Other +2. Total +259 across 4 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
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 October 16, 2026, 9:46 PM ET / October 17, 2026, 01:46 UTC. |
|
Merged via explicitly authorized admin squash with attributed pre-existing CI failures.
|
…aw#174928) * fix(updates): avoid repeated private snapshot integrity scans * fix(ci): classify native SQLite snapshot maintenance
What Problem This Solves
Fixes repeated full integrity scans while preparing private SQLite update snapshots, including stopped captures with committed WAL data.
User Impact
Eligible private snapshots perform one integrity and foreign-key pass instead of two. FULL auto-vacuum databases, transforms, compaction, caller validators, and native online backups retain their existing checks. No migration, configuration, or operator action is required.
Why This Change Was Made
The snapshot owner already checks the final private image before publication. It can defer the earlier check when the input is privately owned, row IDs are preserved, no transform or validator runs, and SQLite reports NONE or INCREMENTAL auto-vacuum.
FULL auto-vacuum stays excluded: switching journal mode can commit an auto-vacuum operation that removes a malformed freelist. Its early check must reject that corruption before normalization can erase the evidence. Native admission, source-generation/SHM guards, content hashes, publication checks, and cleanup remain unchanged.
The dialect ratchet now recognizes the existing snapshot module as the native SQLite artifact owner. Its PRAGMAs admit and normalize SQLite files; update backup callers attach PostgreSQL exports through a separate owner. No PostgreSQL query, schema, or migration contract changes. Only engine-maintenance constructs receive this scoped classification; consumer PRAGMAs and mechanical/design growth still fail, as four added ratchet cases verify.
Evidence
eb4a1585fed6e9bb61a95564c7351605d7e8fb0c.git diff --checkpass.517c862a1cdfd8da281c8b894a4108d727a8118eis terminal: 41 passed, 27 skipped, 2 failed. All admitted changed-node tests, production/test types, lint, and security-fast passed; the SQLite dialect subcheck also passed. The workflow is failed, not green.src/cli/update-cli/update-command-service-maintenance-native.test-support.ts:52; the second failure is its aggregate gate. Main commit e849b9252142 changed that closed mock without updating its export-preservation/isolation contract. The fixture, mocked target, scanner, guard, resolver, baseline and dependency inputs are byte-identical between tested mergeb1049a4cdd662c044a0062898be820d77877f2efand its main parent8919729f0484e743af1a956f20f880bdba79a185. This requires native inherited-failure admission; it is not a passing-CI claim or a reason to alter snapshot behavior.Scope and remaining work
Runtime delta: +15/-3, net +12 lines. The growth is the native auto-vacuum admission guard that allows removing a duplicate integrity/FK pass without losing corruption refusal. Tooling adds two lines to classify that existing engine owner; tests add 245 lines. No new cache or alternate acquisition path.
Separate follow-ups remain: active-WAL generation observations still perform their existing family hashes; live/non-stopped backups still acquire before-generation, backup, and after-generation images. Those costs are distinct from the stopped snapshot path fixed here. Doctor's first migration-backup registration also rehashes an owner-created snapshot; carrying the snapshot's content evidence into that registration needs its own lifecycle proof.