Repository navigation
perf(update): avoid duplicate snapshot integrity scans - #162996
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, 8:25 PM ET / October 2, 2026, 00:25 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR removes a duplicate SQLite snapshot validation pass, adds transformed-output rejection coverage and updater documentation, and inherits a merged UI test readiness correction. Merge readiness⛔ Blocked before merge - 2 items remain Keep open: the optimization remains useful and is absent from current main. No actionable introduced correctness defects were found. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw prepares private SQLite snapshots for update rehearsals and recovery backups. Source databases enter this subsystem, and verified standalone database files leave it for migration checks or backup publication. flowchart TD
A[Source databases] --> B[Validate source]
B --> C[Create private snapshot]
C --> D[Apply required transformations]
D --> E[Validate final staging image]
E --> F[Verify bytes and publish]
F --> G[Update rehearsal or recovery backup]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -1, Tests +63, Docs +9. Total +71 across 4 files. View PR surface stats
Review metricsNone. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain full source and final-staging validation while eliminating the intermediate scan, with published-updater qualification confirming the existing upgrade and recovery guarantees. Do we have a high-confidence way to reproduce the issue? Not applicable to a discrete bug: source inspection confirms the duplicate validation work, and the body supplies paired worker measurements; this read-only review ran no tests or benchmarks. Is this the best way to solve the issue? Yes: removing the intermediate pass is a focused simplification because equivalent final validation still precedes publication and exact-byte checks remain intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1c739851e6ad. LabelsLabel changes: No label 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
History |
Apply the existing fixture correction from dd2a7ba (#162869). The picker can be visible while its controls still await catalog hydration; assert readiness before interacting. Co-authored-by: Vincent Koc <[email protected]>
|
Merged via squash.
|
* perf(update): avoid duplicate snapshot integrity scans * test(ui): inherit model picker readiness fix Apply the existing fixture correction from 9ba56c1 (openclaw#162869). The picker can be visible while its controls still await catalog hydration; assert readiness before interacting. Co-authored-by: Vincent Koc <[email protected]> --------- Co-authored-by: Vincent Koc <[email protected]>
What Problem This Solves
Updates with large databases spend avoidable time validating their private snapshots.
User Impact
User impact: update snapshot preparation does less work while preserving full integrity checks, source data, and existing backup and rollback guarantees.
The published 2026.9.7 updater selects its own snapshot worker, so installing this candidate does not improve its initial snapshot on that first upgrade. Updaters that select the staged candidate's worker can use this implementation. No schema, retention, or configuration changes are required.
Why This Change Was Made
Remove the intermediate integrity and caller-validation pass over transformed output. The source still receives full validation, and the final private staging image is fully validated before publication. All byte hashes, file identities, schema-version comparisons, durability checks, authority guards, and failure cleanup remain.
Evidence
Exact-head CI succeeded for
eaee973bf7f14fddce91375a56935bfe9cdfb5bb(recorded October 2, 2026).Three alternating paired trials per worker mode used the same two synthetic indexed SQLite databases totaling 131.24 MiB. These are local warm-filesystem measurements including worker startup, not complete update timings.
Backup timing varied substantially and does not establish an end-to-end backup speedup. Every measured run reduced integrity and foreign-key checks from six each to four each. All 12 outputs passed data, sparse-ID, index, integrity, foreign-key, version, lease, registry-path, and backup-digest checks; both source hashes remained unchanged.
pnpm test src/infra/sqlite-snapshot.test.ts --maxWorkers=1: 43 passed, two platform skips; 30.49 s command wall. The three added corruption cases totaled 537 ms.git diff --checkpassed. Fresh independent P2 review found no actionable findings.CI per-file durations were not recoverable from the bounded selected changed/boundary logs or artifacts; local costs are retained. The benchmark capsule initially omitted a runtime support file; that harness-only setup error was corrected before measurement.
The shared Linux comparison ran six warm, unchanged-tree source updates in A,B,B,A,A,B order (n=3 each), using the same logical synthetic corpus, including 5,000 retained subagent runs:
The median was 20.958 s / 3.1% lower observed. All six passed native restart, readiness, settlement at exit, and data-preservation checks. Downtime medians were effectively unchanged: 157.058 → 156.603 s. Warming and dependency-time variance confound attribution; this is neither per-PR causal evidence nor a cold-update claim. Four source-path fixes apply together; package fingerprinting was measured separately.
Exact runtime builds passed for A (
ee0b30ef65203430572ce6397f419fbadc1367af) and corrected B. Both reused identical verified declaration/AI prerequisites from full builds of A and preceding B (39a785f2df931f5e8f2795201b04c911bfe9849e); corrected B's full declarations were not rebuilt. Each update advanced to a new commit with an unchanged source tree. Preparation was outside timing; no updater timeout or declaration override was supplied. Three untimed harness setup failures (canonical profile paths, private HOME permissions, and systemd WorkingDirectory display parsing) were corrected before timing; no timed update attempt was replayed.Published first-hop limitation: The single published 2026.9.7 → corrected B attempt failed after 216.596 s; published → A failed after 216.787 s with the same installed-driver error:
SQLite journal state changed while copying. B built successfully, but the shipped driver selected its own snapshot worker and failed before candidate Doctor/config/plugin/canary validation or activation. Both attempts settled with zero active runs, preserved all seeded data and schema 19, and retained the original source/runtime. Neither attempt proves candidate acceptance. A progress-only CI cell passed in 505.845 s with fresh two-agent state, plugins disabled, providers/channels skipped, and no Doctor seeding; it does not replace populated combined-B first-hop or failure-recovery proof.This head also carries Vincent Koc’s model-control readiness fixture correction from #162869. Earlier affected runs failed on the premature assertion; the corrected test passed on main, and this exact refreshed head's CI succeeded.