Repository navigation
fix(update): bind rollback backups to verified snapshot bytes - #162383
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: blocked before merge. Reviewed October 1, 2026, 12:23 AM ET / 04:23 UTC. ClawSweeper reviewWhat this changesThe PR records rollback backup hashes and lengths from the verified SQLite snapshot publisher instead of rereading the published pathname, and adds mutation coverage and update documentation. Merge readiness⛔ Blocked before merge - 2 items remain This remains a useful, focused fix: current main and the latest release still recertify the published pathname. No actionable introduced defect was found. Likely related people: steipete (routing candidate; medium confidence). Priority: P2 Review scores
Verification
How this fits togetherOpenClaw snapshots databases before update migrations and retains backup metadata for rollback. Restore checks the retained snapshot bytes before replacing live databases. flowchart TD
A[Existing databases] --> B[Verified snapshot publisher]
B --> C[Published snapshots]
B --> D[Verified hash and length]
D --> E[Rollback metadata]
C --> F[Restore verification]
E --> F
F --> G[Restore or refuse]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -2, Tests +55, Docs +6. Total +59 across 7 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep snapshot verification authoritative for backup metadata while demonstrating that released updaters can complete the update with the candidate. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the failure path: change the published snapshot after verification but before the caller rehashes it, and baseline metadata certifies the changed bytes. The PR reports failing baseline regressions; this review did not execute them. Is this the best way to solve the issue? Yes. Returning the publisher's already-verified content facts is the narrow repair and preserves the existing restore checks and metadata shape. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d7b029347fd0. 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
|
|
Merged via squash auto-merge.
|
What Problem This Solves
Rollback metadata can certify database bytes changed after snapshot verification because the backup caller hashes the published pathname again.
User Impact
Rollback stays bound to the bytes the snapshot owner actually verified. Later same-size mutation or replacement is rejected, and each backup avoids one redundant full-file hash read. No schema, retention, timeout, or operator configuration changes.
Why This Change Was Made
Return the existing verified SHA-256 and length from the snapshot publisher and consume those facts in backup metadata. Every source, integrity, publication, durability, authority, and restore check remains enabled. Remove one stale Doctor test assertion for the already-retired postMigrationGenerations field; its foreign-write refusal and data-preservation assertions remain intact.
The installed updater must contain this change for its own backups to benefit. Candidate Doctor calls use candidate code; an unchanged older driver retains its existing capture path.
Evidence
c074824a) updated to exact candidate9c08901390217bf4f34152a4b25fecf4b915d2c9, tree18c4c7c0f49145885526b60cb3f887be37d80566, on Linux/Node 24.19.0. Real build, staging, Doctor and retained canary phases completed; native status succeeded/finished with zero active runs. Both agents, 1,024 sessions, 8,192 transcript events, 20,000 plugin-state rows, three installed plugins and workspace contents were preserved. Wall 182.846 s; this compatibility cell is not a speedup comparison. Testbox run.