Add core snapshot CLI#94717
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed June 19, 2026, 2:10 AM ET / 06:10 UTC. Summary PR surface: Source +285, Tests +253. Total +538 across 7 files. Reproducibility: not applicable. as a bug reproduction; this is a feature PR. The PR body reports source tests against a real SQLite database, but it does not show packaged Review metrics: 2 noteworthy metrics.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Resolve and accept the provider base first, then merge a documented Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction; this is a feature PR. The PR body reports source tests against a real SQLite database, but it does not show packaged Is this the best way to solve the issue? Unclear as merge-ready. The CLI wiring is plausible, but the best solution still needs an accepted provider base, maintainer approval of the public command contract, documentation, and real CLI proof. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against afd9cb0c1056. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +285, Tests +253. Total +538 across 7 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
592e0c5 to
3d1a406
Compare
4fdd1ef to
d8c5d9a
Compare
|
@clawsweeper re-review Restacked on the rebased #94694 head and updated the PR body to frame |
|
🦞🧹 I asked ClawSweeper to review this item again. |
d8c5d9a to
a341086
Compare
|
Closing this stack slice in favor of the consolidated core snapshot PR: #94805. We collapsed the previous PR1-4 chain into one reviewable feature PR so reviewers can evaluate the provider, CLI, named targets, and safe-sync artifact proof together. The stress harness remains a separate follow-up in #94967. |
Summary
openclaw snapshotCLI surface, not a plugin/extension command.snapshot create,snapshot list,snapshot verify, andsnapshot restoreto the local SQLite snapshot provider from PR 1.snapshotin the core command descriptor catalog, lazy command registry, and command startup policy.Stack
Scope
This PR keeps snapshot explicit and opt-in, but core-owned. It does not make every OpenClaw SQLite database automatically durable, does not add object storage, does not add scheduling, and does not change the runtime database choice.
The point is narrower: give operators and Scout/Lobster-style hosts a command surface that can produce and verify the completed artifact set. Hosts should sync that artifact set, not live
*.sqlite,*.sqlite-wal,*.sqlite-shm, or*.sqlite-journalchurn. WAL bundles remain a metrics-gated Phase 2 after the full snapshot command is proven.Verification
node scripts/run-vitest.mjs run src/commands/snapshot.test.ts src/snapshot/snapshot-provider.test.ts src/cli/program/register.snapshot.test.ts- passed, 3 files / 13 testsnode scripts/run-vitest.mjs run src/cli/program/register.backup.test.ts src/cli/program/subcli-descriptors.test.ts- passed, 2 files / 8 testsnode_modules\.bin\oxlint src\commands\snapshot.ts src\commands\snapshot.test.ts src\snapshot src\cli\program\register.snapshot.ts src\cli\program\register.snapshot.test.ts src\cli\program\core-command-descriptors.ts src\cli\program\command-registry-core.ts src\cli\command-catalog.ts- passedgit diff --check- passedReal behavior proof
Behavior or issue addressed:
Core
openclaw snapshotcommand handlers can create, list, verify, and restore SQLite-safe snapshot artifacts. This is the CLI proof layer for the safe sync artifact boundary and the database-first SQLite target model from #94646.Real environment tested:
Windows source checkout at
C:\src\openclaw-snapshot-pr1, Node/Vitest source harness, core Commander registration tests, and snapshot command functions backed by a realnode:sqlitedatabase.Exact steps or command run after this patch:
node scripts/run-vitest.mjs run src/commands/snapshot.test.ts src/snapshot/snapshot-provider.test.ts src/cli/program/register.snapshot.test.tsnode scripts/run-vitest.mjs run src/cli/program/register.backup.test.ts src/cli/program/subcli-descriptors.test.tsnode_modules\.bin\oxlint src\commands\snapshot.ts src\commands\snapshot.test.ts src\snapshot src\cli\program\register.snapshot.ts src\cli\program\register.snapshot.test.ts src\cli\program\core-command-descriptors.ts src\cli\program\command-registry-core.ts src\cli\command-catalog.tsgit diff --checkEvidence after fix:
git diff --checkcompleted with no whitespace errors.Observed result after fix:
The core
snapshotcommand group is registered withcreate,list,verify, andrestore. The command functions create a snapshot from a real SQLite database, list it, verify manifest/hash/integrity, restore it, and read the restored row successfully.What was not tested:
Full packaged CLI execution was not tested in this PR; the source harness covers command registration and command behavior directly. Cloud/object-store snapshot repositories, friendly target names for global/per-agent DBs, backup integration, file-sync host integration, SQLite-aware WAL bundles, and failover integration remain follow-up work.