Repository navigation
fix(update): preserve recovery receipts across progress updates - #156298
Conversation
Reconcile pending markers against terminal update outcomes and retain unresolved sets after their owners exit. Restore declared database inventories while leaving live SQLite sidecars under the online restore owner, and expose recovery guidance in update status.
Reconcile pending markers against terminal update outcomes and retain unresolved sets after their owners exit. Restore declared database inventories while leaving live SQLite sidecars under the online restore owner, and expose recovery guidance in update status.
Extract receipt schemas and codec from the retained atomic-update capture design. Preserve operational evidence without exposing it in public status/CLI exports. Original capture design: afaf382. Shared receipt contract observed sha256 6b96f176c84bc36be59ed0d836cdd26b8f97a885108d842a3571fd28c3e6b383.
|
🦞👀 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. Reviewed September 23, 2026, 4:22 AM ET / 08:22 UTC (Revision 2). ClawSweeper reviewWhat this changesPreserves private update recovery receipts across ledger writes and removes them from public status, history, and final CLI JSON output. Merge readiness✅ Ready for maintainer review This remains a useful, bounded prerequisite absent from current main. No introduced correctness or security defect was found, and the wrapper-inventory repair preserves the previously reviewed product code. Priority: P2 Review scores
Verification
How this fits togetherThe update ledger stores progress and recovery information from update processes in SQLite. Gateway history requests and CLI reports read that ledger through public projections. flowchart TD
A[Update progress and recovery receipts] --> B[Validate and bound ledger data]
B --> C[Private SQLite update ledger]
C --> D[Internal recovery readers]
C --> E[Remove private receipts]
E --> F[Gateway status and history]
E --> G[CLI JSON output]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +143, Tests +396, Other +1. Total +540 across 11 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Technical reviewBest possible solution: Keep receipt persistence in the existing ledger and public filtering in one shared projection, while leaving capture and restoration execution with their separate owners. Do we have a high-confidence way to reproduce the issue? Yes, at the storage boundary: seed a valid receipt in origin_json and mutate unrelated progress; current main's schema drops the unrecognized receipt. This was source-verified, not executed during review. Is this the best way to solve the issue? Yes. Extending the existing codec and using one public projection addresses the loss and exposure paths without a parallel store or public protocol expansion. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 01457af6876f. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash auto-merge.
|
Integrate the read-only status consumer extracted from original #145169 source f6feb6b, retaining Peter Steinberger capture design provenance from #144005 (afaf382). Compose landed receipt schema #156298, retain the corrected parser import, validate durable identity even with terminal outcomes, and include the shared driver schema in native wrapper materialization.
…claw#156298) * fix(update): restore pre-migration state during rollback * fix(update): preserve recovery admission and import boundaries * fix(update): preserve recovery sets and restore directory state Reconcile pending markers against terminal update outcomes and retain unresolved sets after their owners exit. Restore declared database inventories while leaving live SQLite sidecars under the online restore owner, and expose recovery guidance in update status. * fix(update): retain transaction-scoped recovery captures * fixup! fix(update): restore pre-migration state during rollback * fix(update): clear copied process leases after state restoration * fix(update): protect finalization and settle recovery owners * fix(update): align recovery handoff and lifecycle proof * test(update): assert native rollback supervisor stops * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fix(update): restore pre-migration state during rollback * fix(update): preserve recovery admission and import boundaries * fix(update): preserve recovery sets and restore directory state Reconcile pending markers against terminal update outcomes and retain unresolved sets after their owners exit. Restore declared database inventories while leaving live SQLite sidecars under the online restore owner, and expose recovery guidance in update status. * fix(update): retain transaction-scoped recovery captures * fixup! fix(update): restore pre-migration state during rollback * fix(update): clear copied process leases after state restoration * fix(update): protect finalization and settle recovery owners * fix(update): align recovery handoff and lifecycle proof * test(update): assert native rollback supervisor stops * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fixup! fix(update): align recovery handoff and lifecycle proof * fix: preserve newer state before update rollback * test: declare recovery fixture authority receiver * fix(update): defer migrated recovery terminal publication * fix(update): clear recovery claims after failed settlement * fix(test): load finalization fixture stubs from files * fix(update): preserve finalizer failure through recovery settlement * wip: parked capture-series working tree (2026-09-12) * fix(update): stop capture retirement when executor ownership ends Pass the filesystem owner current authority at every final removal effect. Prove revocation preserves the next artifact with real executor leases. Remove unused integration exports and keep bridge tests on public inputs. * style(update): align integrated recovery code with lint rules * fix(update): carry recovery authority through current config owners * test(update): preserve fixture and recovery schema ownership * refactor(config): retain guard and test ownership within CI limits * fix(update): preserve recovery through published-driver and terminal boundaries * test(update): bind deferred completion to private current runtime * test(update): declare runtime prerequisites and preserve terminal recovery * fix(update): preserve captures through legacy Doctor finalization * fix(update): reuse capture after migrated driver adoption * fix(update): protect managed cutover and settle legacy capture retirement * fix(state): use worker-thread loader for source lease heartbeats * fix(update): retain restoration failures and align process fixtures * test(sqlite): align worker custody and snapshot cleanup fixtures * fix(state): preserve lease renewal through transient contention Integrate the reviewed allocation prerequisite and align update transport, cutover, and executable Windows cleanup fixtures with their current owners. * fix(update): complete retained package transaction only once Reconcile the child-owned package-completion correction qualified in combined candidate c0640f4f. Keep early failure retention before service recovery and skip duplicate terminal completion. Preserve original child/predecessor ancestry; SQLite predecessor corrections remain with their existing owner. * fix(update): keep caller-owned SQLite snapshots private Reconcile the openclaw#144005 b425cc predecessor against immutable c064 correction: retain earlier live-owner admission, bypass single-flight only for explicit worker staging, and keep staging out of the asynchronous-token API. The three e93/openclaw#145169 process-cleanup branding hunks remain child-owned; context-adjusted composition reconstructs c064 SQLite exactly. Pinned backup generation unchanged. Source-only; no standalone landing or runtime claim. * fix(update): refuse restored-field collisions during no-loss preparation Retain candidate-owned Workshop fields rather than overwriting acknowledged facts with baseline attribution. Add three collision regressions and pin test-private coordinator and state selectors. Native SQLite leaf regression: three collision failures before, five controls pass after. Full exported preparation and installed/native qualification remain separate gates. * fix(state): refuse Workshop row identity shadowing during recovery * test(state): keep recovery lifecycle coordinators task-private * fix(state): remove owned migration scratch after authority loss * fix(update): include recovery receipt schema in wrapper extracts --------- Co-authored-by: Peter Steinberger <[email protected]>
Related: #144005 and #145169
What Problem This Solves
Fixes recovery receipts being discarded or altered when a later update-ledger mutation rewrites a run, while preventing private recovery details from leaking through public update history and JSON output.
User Impact
Existing recovery evidence remains intact across ledger updates and reopen. Public status/history and final CLI JSON retain their existing wire contract without exposing private capture receipts. Malformed or oversized operational receipts refuse before replacing the stored row; no database migration or operator action is required.
This is only the durable-receipt persistence and private/public projection predecessor. It does not implement capture production, newer-data generation, restoration, installed update acceptance, or completion of the original Atomic update program.
Why This Change Was Made
The ledger now validates and preserves typed operational receipts separately from expendable, redacted diagnostics within the existing 16 KiB origin budget. A shared pure projection removes private receipts at all affected public presentation boundaries without changing the retained record.
This narrow extraction (ten product/test files plus one required wrapper-inventory entry) preserves the original source ancestry and credits Peter Steinberger's capture design from #144005. The remaining generation/capture/restore outcomes stay with their dedicated existing owners, including #145169.
Evidence
76 distinct affected cases passed on the exact source: receipt persistence/refusal/reopen (12), existing ledger integration (27), gateway status/history (15), and CLI progress/JSON (22).
Both new public-consumer regressions failed with a deliberate raw-export control and passed with projection. Tests cover retained row equality, malformed and oversized refusal, zero/one-byte remaining budgets, and the closed public wire schema.
Complete audits and independent API review covered production, every test/helper/setup/teardown in all three touched test files, and the source-resolution/private-helper setup boundary. No actionable P0–P2 findings remained; no old tests were removed, skipped, or weakened.
Physical SQLite-open instrumentation verified task-private handoff and state/coordinator paths across actual parent/helper processes. No live Gateway or live update store was used.
Affected native TypeScript, formatting, and lint passed. Hosted CI 35835138214 passed on
748ef9efdf132b24c0c5729d52be8fcd112719dc(137 successful jobs, 17 skipped). The local dependency graph was not full lockfile qualification; the hosted run supplies that check.Recorded wall time: receipt file 2.77 s; both full consumer files 14.84 s. The new gateway case took 3.568 s to exercise the real ledger/reader-worker and drain path; the CLI presentation case took 0 ms. CI timing will be recorded when available.
CI repair: the extracted-wrapper test exposed a missing source-inventory entry for the new receipt schema. Added that single entry without changing any product/test source or assertion. The production extraction, pinned dependency materializer, and full runtime-import closure failed before the fix and passed afterward (4.50 s red / 6.54 s green; 1,363 resolved files, zero SQLite opens). Independent API review found no actionable P0–P2 defects in the repair. The repaired-head CI run above passed, including the previously failing wrapper check; exact-head ClawSweeper review also found no actionable findings.