Repository navigation
feat(update): retain compatible package rollback and safe recovery admission - #140339
fuller-stack-dev merged 136 commits into
Conversation
Related: #124396 Persist exact operational records in the existing shared machine-state owner, with revision fencing, observed effects, candidate handoffs, serving proofs, and history-preserving checkpoint carry-forward. Refuse new admission and diagnostic completion while operational recovery remains pending. Integration checkpoint: package descriptors, terminal pair retention, checkpoint publication discovery, and matching-runtime replay still require the coordinated producer and finalizer consumers. Focused recovery/history/CLI tests: 75 passed; typechecking, focused lint, and independent P0-P2 review passed. Production unused-export checks remain blocked by the unfinished consumer integration. (cherry picked from commit 5037c12fe8528136d7b32e6804230db23af63c10)
(cherry picked from commit 9d8bbc7bcabec9ae5fddbcb8fcc88935136fc49c)
(cherry picked from commit b1d10c113bdf6d2ff8eae0c8d7bbb0af6318f418)
Related: #124396 Capture digest-bound config, plugin payload, service files and SQLite state. Restore compatible newer work with three-way preservation, preserving FTS and row identities, while refusing incompatible changes before publication. Integrate the existing recovery owner for immutable plan references, exact record/logical-data binding, two-copy sealing, interrupted preparation and resource reconciliation. Keep live SQLite reads artifact-preserving. Integration checkpoint: 34 focused tests, core/core-test typing, scoped type-aware lint and independent P0-P2 review pass. The full changed-file gate still identifies absent real production consumers; finalizer lifecycle and recovery admission/replay wiring remain coordinated follow-ups. No complete whole-state rollout or containment claim is made here. (cherry picked from commit ec216121b2a8e6214576709fd0774eff28e0ae0a)
Bind source content, physical identity and absence again after all resource copies so service and environment preimages cannot silently become stale before manifest publication. Recheck owner-held exclusion before returning. Three regressions reproduce edited, same-byte recreated and newly-created service resources on the previous implementation. All 37 focused checkpoint and real recovery integration tests pass, along with production/test typing, scoped lint and fresh P0-P2 independent review. The full changed-file gate still fails on missing production consumers in the existing checkpoint/recovery/verifier stack. This additive integration commit changes no public API and does not claim complete rollback or landing. Related: #124396 (cherry picked from commit 85976a48ca3858cabab3de19c53c274614e5d90f)
Detect existing checkpoint restore families before any writable admission when the canonical shared database is missing. Treat locators as evidence requiring reconciliation, never as mutation authority. Keep first-install admission and existing pending-recovery checks intact. Four real CLI negative controls reproduced new history database creation. All 65 focused recovery and CLI tests pass; production/test typechecks, scoped lint and independent P0-P2 review pass. Full changed gate still flags missing production consumers in the unfinished stack. Private integration checkpoint; no full replay or retention claim. (cherry picked from commit 324bcd2d1c09d39b66442d56951177f9cdf0e459)
(cherry picked from commit 4936cbfefd95f71934c3de75c31324d2e48b3616)
(cherry picked from commit f855a3ed6fa757a7797e1dc6f03468ce73fd5644)
(cherry picked from commit 2c4a077dbeeae6db9a03d9939fa469a396363371)
(cherry picked from commit c24926024c64a7c718f1d1df15ab3a3b3c07d73c)
|
🦞👀 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 real behavior proof before merge. Reviewed September 9, 2026, 10:55 PM ET / September 10, 2026, 02:55 UTC (Revision 3). ClawSweeper reviewWhat this changesThe branch adds guarded update admission, package rollback coordination, native service ownership checks, SQLite writer exclusion, and suppression of unrequested restart notices. Warning SQLite table change This PR modifies persisted SQLite tables in Merge readiness⛔ Blocked before merge - 9 items remain Keep open: this owner-assigned PR contains distinct recovery work, but executor authority does not reach the actual rollback mutations. The latest notice correction addresses the reported preservation failure at its producer; installed acceptance remains pending. Priority: P2 Review scores
Verification
How this fits togetherThe updater takes a candidate package and the installation’s existing configuration, databases, and managed Gateway service through validation, activation, and recovery. Its outcome determines which runtime serves users and whether installation state remains usable. flowchart TD
A[Update request and candidate] --> B[Admission and executor ownership]
B --> C[Validate configuration and databases]
C --> D[Activate package and converge plugins]
D --> E[Verify Gateway readiness]
E --> F{Recovery compatible?}
F -->|Yes| G[Restore and verify previous package]
F -->|No| H[Preserve state and report recovery needed]
Decision needed
Why: They expand a published SDK entrypoint, while the stated delivery discusses update recovery rather than the permanent plugin contract. Before merge
Findings
Agent review detailsSecurityNone. PR surfacePR surface statistics unavailable: the file list is incomplete. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep rollback compatibility-gated, carry the original executor check into every final package mutation, and establish installed preservation and recovery without replaying unrequested work. Do we have a high-confidence way to reproduce the issue? Yes, from source: original-helper loss during rollback’s awaited integrity/path reads invalidates the executor, yet the subsequent package renames receive no live guard. This review did not execute that scenario. Is this the best way to solve the issue? Not yet: the existing package mutation owner is the right boundary, but checking authority only around its asynchronous transaction cannot prevent effects after authority is lost. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8054674868f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
(cherry picked from commit ee2bf95f44d624f258a8fbe2f9fe4cd4ef38b6b6)
(cherry picked from commit 5c81b9caf154334fa65d17d298417bedf5e5208e)
…140274) * feat(update): verify served agent turns are persisted Related: #124396 * fix: verify update serving and persistence on the final Gateway boot * fix: retire advisory inference after durable update verification * test: align Doctor update controls with boot-bound verification * fix(test): accept release subpages in docs route shape (cherry picked from commit 20673ed) --------- Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit cbd5419)
|
A merged follow-up, #146865, improves the misleading inspection-unavailable diagnostic when the main process has stopped but observed tasks remain in the unit's cgroup. It reports the remaining task count and asks the owner to stop those children before retrying. The refusal remains unchanged: this does not alter safe package rollback or admission behavior. This is a diagnostic follow-up only; #140339 remains merged. |
What Problem This Solves
A failed update can leave a replaced package, a stopped or unhealthy Gateway, and an unfinished update record. Recovery must not restore an incompatible package, repeat application work, or treat a stale process or service identity as authority to mutate the installation.
Why This Change Was Made
Retains staged package activation and compatibility-checked package rollback, with executor and writer exclusion, child settlement, native service identity checks, and truthful update outcomes. Full-state checkpoint capture/replay and migration-crossing rollback are explicitly deferred.
Rollback rechecks schema and configuration compatibility before restoring the previous generation. Unknown or changed state refuses unsafe restoration. Existing unsupported checkpoint-recovery records block mutable updates and remain unchanged; this delivery does not convert or retire them.
User Impact
Evidence
8cc90fe5) has 182 passing focused cases across 16 files, covering async Gateway history, state/agent ownership, schema-error preservation, SQLite snapshots, cancellation and cleanup. Skipped and filtered cases are not counted. Its independent nine-file review, with nine whole caller contracts, is scoped-clean.591e2fdehead restored the exact baseline package and native readiness but failed strict workspace/durable-queue preservation. That failure and its runtime/fault remain retained. The correctedceb0674aartifact has now passed strict installed rollback and preservation acceptance; source tests were not substituted for it.ceb0674aartifact: compatible package rollback and upgrade; refusal after changed configuration, changed agent schema, or unverified state; and read-only refusal of an unsupported pending record. Native identity, readiness, child settlement, config/workspace preservation, canonical cron/transcript rows and unsolicited durable work are checked. The original accepted rollback, four normalized-setup cases and the pending-only continuation use identical verified candidate and baseline archives. Earlier setup and product failures remain preserved; no failed receipt was relabeled.openclaw/ci-gate. The previous Android third-party test failure remains historical; Android passes on this head without a test change. Full-state checkpoint and migration-crossing rollback remain deferred, and old full-state installed results are not current proof.Contributor credit remains with Jason Sy (@fuller-stack-dev). The SDK compatibility prerequisite retains Peter Steinberger's upstream attribution (#142708).