RFC 0013: SQLite State Snapshot Command#20
Conversation
|
Codex review: found issues before merge. Reviewed June 22, 2026, 1:49 PM ET / 17:49 UTC. Summary Reproducibility: not applicable. this is a feature RFC rather than a bug report. The merge blocker is source-verifiable from the added frontmatter and the repository RFC lifecycle docs. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review findings
Review detailsBest possible solution: Keep this PR open as the RFC discussion vehicle until maintainers accept a scoped direction, choose or create the implementation issue, and update the frontmatter before merge. Do we have a high-confidence way to reproduce the issue? Not applicable; this is a feature RFC rather than a bug report. The merge blocker is source-verifiable from the added frontmatter and the repository RFC lifecycle docs. Is this the best way to solve the issue? No for merging as-is; the maintainable path is RFC acceptance first, then accepted metadata and an implementation issue before landing the document. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: not found in the target repository. Codex review notes: model internal, reasoning high; reviewed against bab3348050f7. Label changesLabel justifications:
Evidence reviewedWhat 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
|
|
@clawsweeper re-review Updated the PR body with final-head RFC proof, including head SHA, diff stat, frontmatter, line count, and git diff --check output. The maintainer-discussion thread remains pending maintainer-side Discord action/access, and acceptance metadata is intentionally unchanged while draft. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated the RFC and PR body to current head |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated the RFC and PR body to current head What changed:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review Updated the RFC and PR body to current head What changed:
|
|
🦞🧹 I asked ClawSweeper to review this item again. |
Summary
This RFC proposes a narrow core
openclaw snapshotcommand for the host-sync contract:Scout/Lobster-style hosts persist OpenClaw by syncing files when they are saved. Live SQLite files are not a safe sync boundary:
state/openclaw.sqlitemay be incomplete withoutstate/openclaw.sqlite-walagents/<agentId>/agent/openclaw-agent.sqlitemay be incomplete without its WAL*.sqlite-wal,*.sqlite-shm, and*.sqlite-journalare process-local SQLite sidecars, not durable artifactsThe command provides the missing translation step: ask SQLite to materialize a clean DB artifact, verify it, write a manifest, and publish the completed artifact set into a sync-owned location. That completed artifact write is what the host should sync.
Current Pilot Checkpoint
Before maintainers accept this RFC or land the core command, we are exercising the same artifact-boundary idea in Microsoft Scout/Lobster for about one week through the Lobster-owned snapshot plugin path.
That pilot is not a replacement for the core command proposal. It is the operational evidence checkpoint for it. The pilot should tell us:
manifest.jsonanddatabase.sqlitesnapshot artifacts while ignoring live SQLite files, temp files, and sidecarsopenclaw snapshotcommand, a host-owned plugin command, or bothThe linked OpenClaw PRs therefore remain implementation proofs while this pilot runs.
Phase 1 Shape
The Phase 1 command can stay small:
This does not choose a replacement database, add cloud storage, or implement failover. Hosts still own upload, retention, routing, encryption, and restore timing.
Memory-search is intentionally not a Phase 1 named target. Today it is owned by the per-agent database-first store, so Phase 1 protects it through
openclaw snapshot create --agent <agentId>. A future memory-search-only artifact needs a separate design: either a dedicated owner database or a true logical export. It should not be presented as memory-only while snapshotting the full per-agent database.WAL Bundle Position
Ryan's scaling concern is addressed as a gated Phase 2, not as part of the initial snapshot command. Phase 1 should measure whether full snapshots are actually too large, too slow, or too infrequent for hosted deployments.
If those metrics justify it, Phase 2 can add ordered WAL-bundle artifacts anchored to a verified full snapshot. Object storage, retention policy, failover, multiple delta encodings, and pruning policy stay out unless maintainers greenlight more.
Roadmap
Phase 1: snapshot command and pilot evidence
openclaw snapshot create|verify|restore|list,--target global,--agent <agentId>, manifest/hash verification, and restore proof.Phase 2: WAL bundles, greenlight required
full snapshot + ordered WAL bundles -> verified local SQLite databasewith staging/publish semantics, invalid-chain rejection, and simple compaction into a new full snapshot generation.Future dedicated targets, including any memory-search-only target, should require an explicit owner database or logical export contract before becoming a public command shape.
Scope
This is an RFC only. It does not change OpenClaw runtime behavior, add storage configuration, or implement backup/restore commands. The linked OpenClaw PRs are draft implementation proofs for the proposed direction while the Scout/Lobster pilot gathers evidence.
Validation
rfcs/0000-template.mdshape.openclaw backup createandopenclaw backup verifyexist; no restore/snapshot/failover command currently owns this workflow.git diff --check origin/main...HEADpassed at head6e4615948d376581cbf0e74343b08e0a5f4c61b1.Real behavior proof
Behavior or issue addressed:
This PR adds the draft RFC text for SQLite-safe state snapshots, database-first OpenClaw targets, host-safe sync artifacts, a Microsoft Scout/Lobster pilot checkpoint, and a gated WAL-bundle follow-up. The visible behavior is the final RFC document rendered by GitHub from the PR head.
Real environment tested:
Windows scratch checkout of
openclaw/rfcsat PR head6e4615948d376581cbf0e74343b08e0a5f4c61b1, using Git/GitHub CLI terminal checks. This is documentation/RFC proof, not runtime OpenClaw behavior proof.Exact steps or command run after this patch:
git rev-parse HEADgit show --stat --oneline --no-renames HEADgit diff --check origin/main...HEADEvidence after fix:
git diff --check origin/main...HEADproduced no output and exited successfully.Observed result after fix:
The final PR head contains one RFC Markdown file with draft metadata, a core
openclaw snapshotcommand proposal, explicit safe-sync artifact framing, unsafe SQLite sync input examples, Phase 1 targets limited to global and per-agent databases, a memory-search-only target deferred to future dedicated design, a Microsoft Scout/Lobster one-week pilot checkpoint, a metrics-gated Phase 2 WAL-bundle model, and no whitespace errors fromgit diff --check.What was not tested:
No runtime OpenClaw behavior was tested in this RFC PR. Runtime evidence should come from the Microsoft Scout/Lobster pilot and the linked OpenClaw implementation/stress PRs. Acceptance metadata (
status: acceptedandissue) is intentionally not set while the RFC remains draft.RFC Lifecycle
maintainer-discussion