Skip to content

refactor(update): specialize triage and retained recovery validation - #159358

Merged
steipete merged 1 commit into
mainfrom
steipete/update-ledger-deslop
Sep 27, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/update-ledger-deslop

Conversation

@steipete

@steipete steipete commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Removes unused local repair-loop behavior and redundant update-report/recovery code while preserving the updater's existing contracts.

User Impact

No user-visible change. Published updater behavior is unchanged: installed drivers still run first, candidate lazy-import exports and worker messages stay intact, and retained recovery records keep the same admission rules. No new environment variables, schemas, protocols, dependencies, or migration steps.

Why This Change Was Made

  • A2 removes nine public-code literals already supplied by SKIPPED_UPDATE_OUTCOMES and an orphan recovery comment; accepted report identifiers stay the same.
  • A3 specializes embedded triage to its sole production caller's documented one-turn limit. Post-turn validation, score regression rejection, unchanged-score explanation, tool-budget exhaustion, and improved/turn-budget outcomes remain. Runtime loading now follows initial validation. The released worker budget schema is unchanged: the 2026.9.6 worker's start path returns unavailable, and the documented 2026.9.4 candidate-worker contract remains intact.
  • A5 removes the unused unrestored mode. The sole retained-descriptor caller passes restored mode in both 2026.9.4 and current source; settled restoration and partial-history refusal keep the same semantics.

A4 is dropped because the two best-effort ledger writes preserve fault isolation. If the first write fails once, the second can still save the missing rollback outcome. Terminal settlement records the original failure facts, but does not recreate a missing rollback receipt. Coalescing them would change that observable contract. The existing command-settlement test now covers the write fault and checks both evidence pieces and the original failed outcome/cause.

A1 and the pre-release checkpoint-row question are excluded. No delegated worker turn handling or Windows probe changes.

Evidence

Production LOC delta: −31 (109 added − 140 deleted, excluding tests/test support). Tests: +85 net lines.

Independent Codex review is scoped-clean through P2. pnpm update:compat:check passed for pinned releases 2026.9.1–2026.9.6. git diff --check passed. node scripts/check-changed.mjs --dry-run selected core/coreTests, and the complete runnable node scripts/check-changed.mjs passed (all typecheck graphs, scoped lint, ratchets, dead-export scans and guards).

Each file below ran with pnpm test <file> --maxWorkers=1:

Test file Passed Local wall seconds CI test seconds
src/infra/update-repair-agent.test.ts 18 10.52 0.085
src/cli/update-cli/update-command-run.test.ts 42 603.82 23.769
src/infra/update-run-recovery.test.ts 54 677.23 6.544
src/infra/update-failure-public-identifiers.test.ts 19 432.04 0.001
src/commands/triage-run.test.ts 44 673.42 6.972
src/infra/update-triage-resolution.test.ts 66 149.43 0.103
src/infra/update-run-diagnostics.test.ts 4 247.58 0.301
src/infra/update-repair-protocol.test.ts 7 20.33 0.003

Local wall measurements are from a heavily loaded host. CI test seconds are the sum of Vitest-reported per-case milliseconds from run 36290575245; they exclude compilation, imports and setup. Existing worker compilation/cache validation, real storage fixtures and process/signal cases dominate the longer files. The added terminal fault case took 1.18 s and has no new process boot, timer or polling. The repair-agent timer tests use fake timers. The E2E fixture's local budget type was adapted while retaining the released-parent maxTurns: 1; that release-only file/local-provider E2E was not run.

CI passed for exact head 26a53007e93db680616ede28358ce5c6a199ebad: successful CI run. Independent review found no introduced code defect. Native review artifacts validated READY with zero findings; OPENCLAW_PR_GATES_REMOTE=github scripts/pr prepare-run 159358 completed without changing the head or pushing. Its github_pending stamp remains distinct from CI proof; the subsequent bounded exact-head CI watcher returned GREEN. ClawSweeper re-review was requested with the lane/control evidence below.

Published-driver × candidate proof

Candidate Baseline Scenario LIVE LANE_EXIT Lease
PR head 26a53007e93d 2026.9.6 base 0 0 tbx_01m3gj8aednkjgw9gtyc8fr3vm
PR head 26a53007e93d 2026.9.4 recovery-cleanup 0 1 tbx_01m3ghsqbqad3fvhrza2z9g2gk
Clean main control aad795bf312a 2026.9.4 recovery-cleanup 0 1 tbx_01m3gn914fc8pdacxeqhzjb131
PR head 26a53007e93d 2026.9.4 base (coordinator-approved substitute for A5) 0 0 tbx_01m3grxkmh390vzfp5cggtth5z

The 2026.9.4 recovery-cleanup failure is pre-existing on main and is tracked by a separate coordinator-owned fix: both the PR and clean-main control fail identically at assert-recovery-migration with ENOENT for agents/ops/agent/openclaw-agent.sqlite.

The coordinator approved 2026.9.4/base as substitute published-driver proof for A5, alongside the passing focused retained-preparation decoder test; recovery-cleanup itself remains failed, not waived or described as passing. All four lane and control leases were stopped. Their delegated Actions runs are 2026.9.6 base, PR recovery-cleanup, clean-main control, and 2026.9.4 base substitute. The wrapper exit can be zero when the piped lane fails; the table uses the actual LANE_EXIT.

The earlier local disk and source-freezing blockers are resolved. No merge has been requested or attempted.

Release note: none (internal).

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes commands Command implementations size: M labels Sep 27, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 27, 2026
@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 27, 2026, 3:12 AM ET / 07:12 UTC (Revision 6).

ClawSweeper review

What this changes

This branch limits embedded update triage to one repair turn, removes duplicate failure identifiers, narrows retained recovery validation, and extends settlement and decoder tests.

Merge readiness

✅ Ready for maintainer review

Current main does not contain this cleanup, and the branch retains distinct value. Review found no actionable introduced defect; source comparison supports the claimed worker and retained-record compatibility.

Priority: P3
Reviewed head: 26a53007e93db680616ede28358ce5c6a199ebad

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused cleanup has relevant contract coverage and recorded update-lane evidence, with no actionable introduced defect found.
Proof confidence 🐚 platinum hermit (4/6) Not applicable: The repository state identifies this as a member-authored internal refactor, so the external-contributor proof gate does not apply. The PR body records published-driver base lanes and a failed recovery-cleanup lane matched by a clean-main control; source comparison establishes unchanged retained-record admission without migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies this as a member-authored internal refactor, so the external-contributor proof gate does not apply. The PR body records published-driver base lanes and a failed recovery-cleanup lane matched by a clean-main control; source comparison establishes unchanged retained-record admission without migration.
Evidence reviewed 9 items Introduced repair change: The pinned PR delta replaces the local multi-turn loop with one turn while retaining post-turn validation, deadline checks, and current-owner checks.
Current-main necessity: Fetched current main still contains the generic multi-turn repair loop, so this branch's central cleanup has not landed.
Documented one-turn entry point: The CLI documentation specifies at most one embedded triage turn, and the production triage command is the direct caller of the refactored loop.
Findings None None.
Security None None.

How this fits together

The installed updater records update outcomes and recovery state. Operator triage reads that state, validates the installation with Doctor, and may run a bounded repair turn.

flowchart TD
A[Installed updater] --> B[Update history]
B --> C[Recovery admission]
B --> D[Operator triage]
D --> E[Doctor validation]
E --> F{Repair needed}
F --> G[One repair turn]
G --> H[Recorded outcome]
C --> H
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source -31, Tests +85. Total +54 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 7 109 140 -31
Tests 6 162 77 +85
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 13 271 217 +54

Review metrics

None.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/infra/update-repair-agent.ts. Migration or upgrade compatibility proof is recorded; maintainers should verify it before merge.

Technical review

Best possible solution:

Keep the one-turn triage flow in the existing update owner while preserving the published worker schema, equivalent retained-record admission, and independent failure and rollback ledger writes.

Do we have a high-confidence way to reproduce the issue?

Not applicable: this PR proposes an internal refactor rather than reporting a current bug; source and tests identify the affected contracts.

Is this the best way to solve the issue?

Yes: the branch specializes the documented one-turn caller without changing the published worker schema or the accepted retained-record states.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 53b95fd0bef8.

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is internal update cleanup with no intended user-visible change or identified urgent defect.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository state identifies this as a member-authored internal refactor, so the external-contributor proof gate does not apply. The PR body records published-driver base lanes and a failed recovery-cleanup lane matched by a clean-main control; source comparison establishes unchanged retained-record admission without migration.

Evidence

What I checked:

Likely related people:

  • Dallin Romney: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jason (Json): Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-27T03:07:01.206Z sha 26a5300 :: blocked before merge. :: none
  • reviewed 2026-09-27T03:13:44.332Z sha 26a5300 :: blocked before merge. :: none
  • reviewed 2026-09-27T04:37:42.066Z sha 26a5300 :: blocked before merge. :: none
  • reviewed 2026-09-27T06:03:14.921Z sha 26a5300 :: blocked before merge. :: none
  • reviewed 2026-09-27T06:57:40.203Z sha 26a5300 :: needs maintainer review before merge. :: none

@steipete
steipete marked this pull request as ready for review September 27, 2026 03:09
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Sep 27, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Please review the updated published-driver evidence for head 26a5300:

  • 2026.9.6 / base / LIVE=0: LANE_EXIT=0, lease tbx_01m3gj8aednkjgw9gtyc8fr3vm.
  • 2026.9.4 / base / LIVE=0: LANE_EXIT=0, lease tbx_01m3grxkmh390vzfp5cggtth5z. The coordinator explicitly approved this substitute published-driver cell for A5, alongside the passing retained-preparation decoder test.
  • 2026.9.4 / recovery-cleanup / LIVE=0: LANE_EXIT=1 on this PR, lease tbx_01m3ghsqbqad3fvhrza2z9g2gk. The identical cell also fails on clean main aad795b, lease tbx_01m3gn914fc8pdacxeqhzjb131, at assert-recovery-migration with ENOENT for agents/ops/agent/openclaw-agent.sqlite. This is pre-existing on main and tracked by a separate coordinator-owned fix; the failed cell remains visible in the PR body.

All four leases are stopped. The PR body links the lane runs and includes all 254 focused tests, local wall times, and CI test-case times. Compatibility and complete changed-file checks passed; independent review is scoped-clean through P2. A4 remains dropped to preserve fault-isolated failure/rollback evidence. No stored schema, worker message contract, or effective retained-state admission rule changes.

@clawsweeper

clawsweeper Bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@steipete
steipete merged commit cb02570 into main Sep 27, 2026
332 of 333 checks passed
@steipete
steipete deleted the steipete/update-ledger-deslop branch September 27, 2026 07:41
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes commands Command implementations P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant