Repository navigation
feat(state): snapshot+journal record hydration (phase 2) - #874
Conversation
…rnal deltas (state-repo retirement, phase 2) canonical records now export via snapshot+journal (per-repo gzip snapshot streamed to R2 via multipart with keep-two pruning and authenticated trigger/latest/range endpoints — 32MiB range proxying since R2 bindings cannot presign; measured: 603MB/34,459-file openclaw-openclaw tree → 124.9MiB snapshot, typical deltas 44-87KiB); hydrate-state gains CLAWSWEEPER_RECORDS_SOURCE=worker mode (Actions-cached snapshot + since-revision deltas, byte-identical on-disk layout, loud fail-closed git fallback when the snapshot store is unavailable); cursor-resumable git→canon backfill workflow (workflow_dispatch per repo); tree-based parity verifier as the cutover gate. Defaults stay git; R2 bucket provisioning (clawsweeper-state-snapshots) is the one pending manual step.
|
Codex review: needs real behavior proof before merge. Reviewed July 26, 2026, 2:20 PM ET / 18:20 UTC. ClawSweeper reviewWhat this changesThis PR adds an opt-in Worker-backed snapshot-and-journal transport for hydrating generated state records, with Git retained as the default source. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 9 items remain Keep this PR open until the new production R2 dependency is provisioned and the Worker-backed path has real after-fix proof. The implementation deliberately preserves Git as the default, but the branch’s own deployment contract says the required Priority: P2 Review scores
Verification
How this fits togetherClawSweeper workflows hydrate generated review records before review and apply jobs use them. This PR adds an optional path that reads per-repository snapshots and journal deltas from the authenticated dashboard Worker and its R2-backed snapshot store instead of the state Git checkout. flowchart LR
A[Generated state records] --> B[Git state checkout]
B --> C[Hydrate generated state]
D[Authenticated dashboard Worker] --> E[Snapshot and journal records]
F[R2 snapshot bucket] --> D
E --> C
C --> G[Review and apply workflows]
Decision needed
Why: The missing resource is external deployment state rather than a repository-only repair, and it determines whether this otherwise opt-in path can be safely deployed. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Provision the R2 bucket first, then attach redacted real-runtime proof showing a snapshot export, Worker-mode hydration with journal replay, and a successful Git-versus-Worker parity check before merging. Do we have a high-confidence way to reproduce the issue? No high-confidence live reproduction is included. The deployment failure mode is source-reproducible: the added R2 binding requires the bucket named in Is this the best way to solve the issue? No, not yet: retaining Git as the default is a sensible compatibility boundary, but the deployment resource and real end-to-end proof must precede a safe merge of the Worker binding. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 439f425ec76d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
…rnal deltas (state-repo retirement, phase 2) (openclaw#874) canonical records now export via snapshot+journal (per-repo gzip snapshot streamed to R2 via multipart with keep-two pruning and authenticated trigger/latest/range endpoints — 32MiB range proxying since R2 bindings cannot presign; measured: 603MB/34,459-file openclaw-openclaw tree → 124.9MiB snapshot, typical deltas 44-87KiB); hydrate-state gains CLAWSWEEPER_RECORDS_SOURCE=worker mode (Actions-cached snapshot + since-revision deltas, byte-identical on-disk layout, loud fail-closed git fallback when the snapshot store is unavailable); cursor-resumable git→canon backfill workflow (workflow_dispatch per repo); tree-based parity verifier as the cutover gate. Defaults stay git; R2 bucket provisioning (clawsweeper-state-snapshots) is the one pending manual step.
Summary
Phase 2 moves canonical record hydration behind an opt-in Worker-backed snapshot+journal transport while keeping Git as the default source.
Per-repository gzip snapshots are streamed to R2 with multipart upload and keep-two pruning. Authenticated Worker endpoints trigger exports, expose the latest snapshot, and serve byte ranges through a 32 MiB proxy because R2 bindings cannot presign downloads. The measured
openclaw-openclawtree was 603 MB across 34,459 files and compressed to a 124.9 MiB snapshot; typical journal deltas were 44–87 KiB.hydrate-statenow supportsCLAWSWEEPER_RECORDS_SOURCE=worker, using an Actions-cached snapshot plussince-revisiondeltas while preserving the byte-identical on-disk record layout. Snapshot-store unavailability takes the loud, fail-closed Git fallback path. A cursor-resumableworkflow_dispatchworkflow backfills Git records into canonical Worker storage one repository at a time, and a tree-based parity verifier is the cutover gate.Contracts
items/andclosed/record layout remains byte-identical after hydration.clawsweeper-state-snapshotsR2 bucket is the one pending manual deployment step.Proof