Repository navigation
fix(storage): publish sandbox, worktree, and GitHub authority receipts - #168025
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: needs maintainer review before merge. What this changesThis PR publishes committed sandbox, worktree, and GitHub publication facts before observers and preserves known write outcomes after reply loss. Example: A worktree run-lease admission commits, but its ordinary worker reply is lost.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR provides useful, maintainer-directed storage correctness work; the previous wrapper-inventory and conflict blockers are resolved, and no introduced defect remains identified. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherExisting SQLite domain writers accept registry and publication mutations and emit exact committed row facts or deletion tombstones through the shared publication and worker-settlement owners. flowchart TD
A[Registry and publication callers] --> B[Existing domain writers]
B --> C[SQLite transaction]
C --> D[Committed receipt]
D --> E[Fact installation]
E --> F[Observers and worker reply]
D --> G[Native settlement recovery]
Technical reviewBest possible solution: Land exact committed-fact publication through the existing owners while preserving their live authority and unknown-outcome safeguards. Do we have a high-confidence way to reproduce the issue? Current-main source lacks the added fact producers and rejects lost run-lease replies even after completed settlement; supplied baseline controls target those paths, but this read-only review ran no code. Is this the best way to solve the issue? The change fixes the existing producers, reuses shared postcommit ordering, and retains final guards rather than treating incomplete receipts as authorization. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d12658c4c9dd. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1029, Tests +495, Docs +32, Other +2. Total +1558 across 37 files. Added test files: 1. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 9, 2026, 9:38 PM ET / October 10, 2026, 01:38 UTC (Revision 5). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
openclaw#168025) * fix(sandbox): publish committed registry facts * fix(storage): publish worktree and GitHub authority receipts * fix(storage): preserve claim types and portable receipt proof * refactor(storage): keep receipt production on domain owners * fix(scripts): include registry publications in wrapper inventory * test(worktrees): expect committed admission recovery
What Problem This Solves
Sandbox, worktree, and GitHub publication mutations did not consistently publish their committed authority facts. Worker acknowledgments and shared lifecycle notifications could omit the changed rows, private publication transitions, or deletion tombstones.
User Impact
Internal correctness foundation; no public API, schema, stored-byte, retention, or permission change. Existing dispatch, cleanup, and publication guards remain in place. Confirmed commits survive ordinary reply loss without replaying the write.
Why This Change Was Made
The existing owners capture exact postimages or tombstones from already-selected rows or
RETURNING, using the shared postcommit contract to install all facts before observers. Pending worker writes remain fenced through native settlement, and newer native publications supersede late receipts. Publication facts retain content digests without materializing title/body/next-action text; oversized worktree receipts preserve commit evidence and distinguish an unavailable recovery result.Other processes must route writes through the Gateway or hold offline custody while it is stopped. This change adds no foreign-commit probes or schema checks.
Writer coverage and retained boundaries
Exact typed row deltas do not certify arbitrary raw SQL, trigger/cascade effects, unmanaged transactions, or generic lease writers. Complete sandbox runtime-ID and protecting session/placement sets, worktree provisioned-chunk/pending/template facts, and personal credential-selection/profile-merge publication remain incomplete or with their existing owners and validators. No final guard is removed; no cross-store exclusion or native-to-worker migration is claimed.
Evidence
WORKTREE_RECORD_COLUMNSexport private. No SDK migration is required.RETURNINGprojections.Production delta: +1,257 / −228 lines. Tests: +515 / −28. Docs: +79 / −48. The new per-family code supplies capture, exact-key installation, pending/settlement handling, and supersession through the shared receipt primitives.
Focused test execution costs
The one-worker Node owner command took 409.57 s including compilation/import and cleanup. Per-file summed test execution times were: sandbox registry 57.59 s; worktree registry-publication 0.28 s, migration 6.76 s, run-end worker 19.70 s, run-lease store 4.33 s; GitHub personal lifecycle 80.78 s, shared events 13.15 s, and SQLite materialization 4.35 s. The slow existing sandbox/lifecycle fixtures exercise actual worker admission, native settlement, and deletion authority; helper-only tests cannot replace those boundaries. CI seconds are pending the PR run.
All three baseline negative controls fail on unchanged producer kernels for missing facts (empty sandbox/worktree observer maps and undefined publication request/lifecycle facts), and pass with the candidate producers.
Shared workload, attribution, and statement-gate disposition
Isolated Testbox proof, provider
blacksmith-testbox, leasetbx_01m4heemayve5bb5cqynwvex9k: three alternating baseline/candidate pairs, with CPU-idle preflight, synthetic provider, source-map instrumentation, exact source/file hashes, and successful workload receipts. Baseline31c35d5f5b093b7f84e7fbd1a6107f8b17454b67; candidate784c73666007b9112ae2bcb4bb9ebcfe37690272. Lease stopped and verified completed.Raw warmed median is red: 1,035.3 → 1,059.4 statements/turn (+24.1, +2.33%); it is not represented as a raw gate pass. First-turn median decreases 1,806 → 1,799; every duration ratio is ≤1.5. Applying the same-statements-per-operation allowance for this internal receipt-owner refactor: all nine changed operations are statement-neutral, their SQL shapes differ only in terminal
RETURNINGprojections, and all six remote strict-window traces contain zero changed-owner SQL, zero receipt-installer request stacks, and zero sandboxRegistry/worktrees/githubPublication commands. No new PR-caused hot requests were found.database.prepareWritesession-row-factssession.maintenance.readsession.entry.readsessionRows.sharedFactssession.entry.patch.commitEach of the six isolated runs recorded one rejected
database is lockedstatement during connect on both baseline and candidate; all workload receipts still completed. Failed executions are recorded separately from successful-statement totals.The retained async stack ends at the writer queue, so this is attributed to unchanged admission variance rather than claiming a proven timer origin. The shared workload does not demonstrate a speedup. Seven earlier shared-host macOS pairs also passed their workload receipts but had higher raw strict-window medians (first 2,169 → 2,300; warmed 1,061.6 → 1,088.8); those results are retained, not discarded as passing evidence. The isolated run followed a wrapper staging stall before upload and an expired idle lease; the successful native route fetched and independently hash-verified both exact commits.
Published-driver × candidate update cell: passed on
dbc76f2eaf7aaa89920aa4fb6edb4df0e36ac2c6, using published2026.9.9; completed in 268.52 seconds with phasefinishedand readiness HTTP 200. Receipt changes are process-local; the installed updater needs no migration.Landing corrections
The wrapper extraction inventory now includes both new registry-publication modules. This fixes the five import-closure failures in the initial CI run; all 17 tests in
test/scripts/eager-import-closure.test.tspassed locally in 140.06 seconds.The existing lost-admission-reply cases now verify recovery of a completed native receipt: the exact worktree ID and token survive pending cleanup, the Git guard stays live until release, and incumbent ownership remains intact. Unknown settlement still rejects and retains custody. All 23 tests passed with
pnpm test src/agents/worktrees/run-lease.test.ts --maxWorkers=1in 170.43 seconds; targeted lint and formatting passed. Both corrections received scoped independent review with no P0/P1 findings. Pre-conflict head CI passed in 451 seconds elapsed.The required single alternating baseline/candidate pair passed on pre-conflict head
dbc76f2eaf7aaa89920aa4fb6edb4df0e36ac2c6against baseline31c35d5f5b093b7f84e7fbd1a6107f8b17454b67: all-thread successful SQL statements from startup through shutdown fell from 22,394 to 22,250 (−144). Main-thread statements were 2,548 → 2,513; worker-thread statements 19,400 → 19,291; helper-process statements stayed 446. Each side had one rejected statement, excluded consistently from successful totals. The published-driver update cell also passed. Pre-conflict head Testbox proof run; a runner portal-sync timeout was nonfatal after the successful proof.Main was merged with a merge commit (no rebase), producing
d6a328a6e29c76ab2e24882eedda88aa75bff33f. The only manual resolutions preserve both additions in the worker-access documentation and retain the correct inventory source line. Source code merged automatically. Formatting, all 14,943 internal documentation links, andgit diff --checkpassed. Runtime proofs above are reused for this conflict-only push; the exact-head CI watcher reports green for run 38012076206.