Repository navigation
fix(update): reuse engine classification from backup generations - #184559
Conversation
Classify automatic backup databases from the private generation image instead of capturing another engine-only image. Keep generation failures manual, engine failures fatal, and PostgreSQL fingerprinting behind whole-inventory custody admission. Stopped and manual original SQLite captures do not gain generation work. Validation: independent source review and scoped autoreview P0-P2 clean; pinned formatting, privacy and diff checks pass. Normal hook refused its stale formatter donor; scoped bypass follows separate formatting proof. Focused runtime, types and lint require exact-head hosted CI. Real WAL operation-count and mixed-engine custody regressions are included; no elapsed-time or physical-I/O claim.
|
🦞👀 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 reuses engine classification from the database-generation image instead of acquiring a separate classification image during automatic update backups. Example: Automatically back up state/openclaw.sqlite with committed rows retained in its WAL.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR removes redundant backup work that remains on main, and source review found no actionable code defect. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe update backup worker receives the discovered database inventory, captures verified recovery images, and returns snapshot metadata and generation fingerprints used by rollback admission. flowchart TD
A[Update driver] --> B[Backup worker]
B --> C[Physical generation observation]
C --> D[Engine classification and generation]
D --> E[Inventory custody admission]
E --> F[Verified recovery capture]
F --> G[Snapshot metadata and rollback attribution]
Technical reviewBest possible solution: Carry the existing generation image's classification through backup capture while preserving strict engine validation, custody admission, and rollback attribution. Do we have a high-confidence way to reproduce the issue? Source establishes the redundant acquisition: main classifies each database through readBackupEngine and then acquires a generation image that independently classifies it; no target code was executed during this read-only review. Is this the best way to solve the issue? The change follows the existing owners and removes the redundant acquisition without a cache or competing classification policy; each additional branch preserves a distinct failure or custody contract. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 9302c1147252. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +72, Tests +299. Total +371 across 5 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 HistoryReviewed October 26, 2026, 8:12 AM ET / 12:12 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…nclaw#184559) * fix(update): reuse backup engine observations Classify automatic backup databases from the private generation image instead of capturing another engine-only image. Keep generation failures manual, engine failures fatal, and PostgreSQL fingerprinting behind whole-inventory custody admission. Stopped and manual original SQLite captures do not gain generation work. Validation: independent source review and scoped autoreview P0-P2 clean; pinned formatting, privacy and diff checks pass. Normal hook refused its stale formatter donor; scoped bypass follows separate formatting proof. Focused runtime, types and lint require exact-head hosted CI. Real WAL operation-count and mixed-engine custody regressions are included; no elapsed-time or physical-I/O claim. * test(update): preserve real worker logging coverage * test(update): count generation observations at their owner * test(update): avoid shadowed generation path binding
What Problem This Solves
Automatic update backups acquire a private database image to identify its storage engine, then acquire another image for the before-capture generation check. That generation image already contains the authoritative engine classification. Reacquiring a large SQLite family adds avoidable copying and verification work.
User Impact
Healthy automatic SQLite capture removes one engine-only private image per database. Before/after generation checks, full snapshot integrity, WAL handling, inventory checks, and rollback admission remain intact. Stopped and manual original SQLite captures do not gain generation work.
The backup executor must contain this change. Upgrading to it does not replace an older installed driver's own capture implementation; no elapsed-time or physical-I/O saving is claimed.
Why This Change Was Made
The physical generation owner now returns its captured engine fact separately from the fallible local generation result. Backup reuses that classification, while PostgreSQL fingerprinting remains after whole-inventory custody admission. Invalid engine metadata stays fatal; unavailable generations retain the existing manual-recovery warning. A failed acquisition without an engine fact still uses the existing classification-only reader once. Generic missing-database generations remain null and retained recovery sidecars still refuse.
The added production code carries an existing producer fact and separates PostgreSQL completion from local observation; it adds no cache, schema, runtime option, or rollback capability.
Evidence
git diff --checkpassed.764b029cd3df67d4fc446577d59c2fccc1b2fa7dpassed all 168 tests across the eight owning/sibling files: backup-engine 9, backup 35, generations 26, restore 19, Git candidate 51, worker imports 1, loader runtime 10, and worker budget 17. The previously failing lint job is green. The complete CI run and published requiredopenclaw/ci-gatesubsequently passed at this exact head.[email protected]/ release157d8c2bc3ea2fa183afdc11088e69690bf8e64eand candidate89c02954831c80cfbb78bd79db40930a260955d5, failed on unresolved cron partition selection after candidate Doctor passed. That run is evidence of a shared compatibility blocker, not an executed result for this PR.Inherited Compatibility Failure / Follow-up
Preserve the pre-relocation cron selector through the updater/candidate snapshot owner, with explicit compatibility for older published drivers. Source inspection shows that the published snapshot transport omits the original state/config selectors before the candidate migrates a relocated copy. Physical source paths cannot safely substitute for that fact in config-only overrides. Actual partition counts and absent-versus-invalid binding status in the failed cell remain UNKNOWN because its diagnostics were redacted/truncated. Do not infer a path binding or single-partition choice, change cron selection policy, write live state, or bump the schema. This separate contract repair is not included here. The frozen-base compatibility cell, using candidate
881caa4fd1945dc1d642165eceaed282b5922123with the same published baseline/scenario/harness, reproduced the identicalcandidate-doctor-lint/heartbeat-retirement-inspectionfailure. The engine-observation change does not touch cron transport or migration. Maintainer landing assessment records this inherited failure alongside green exact-head required CI and 168 passing tests. This PR's own upgrade cell remains unrun; no successful upgrade, deployment, elapsed-time improvement, or physical-I/O saving is claimed.Related scheduling fix: #184527