Skip to content

refactor(update): reuse one recovery ledger observation - #188081

Merged
vincentkoc merged 2 commits into
mainfrom
fix/update-recovery-prepared-run-20261030
Oct 30, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
fix/update-recovery-prepared-run-20261030

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

Recovery status reread the same run ledger during capture admission, receipt validation and final classification. Later reads bypassed the caller-selected ledger reader, so one projection could combine different observations or silently query the default state store.

User Impact

Each sealed capture uses one ledger observation throughout status inspection. A missing run stays missing; an unavailable selected reader becomes directory-only unreadable evidence. Filesystem seals, generation bindings and forward-recovery receipts are still validated before they influence status. This projection does not grant restore or cleanup authority.

Why This Change Was Made

Carry the fact from the capture reader through the existing status owner. Remove repeated database reads and the obsolete catch around pure classification. There is no cache, alternate store, fallback reader, schema change or public configuration change.

Evidence

  • Four regressions fail against the preceding inventory fix: hidden default-store reads, selected-reader failure handling and repeated forward-receipt ledger reads.
  • The production candidate at 91716af passed all 24 recovery-status tests in its native PR checkout (37.55s; wrapper 40.72s), plus core typechecking. Production files are byte-identical at the updated head. Exact-head CI at ccdf227 passed: run 41002164560, including all three PostgreSQL conformance shards. The previously failing five-family baseline case passed in 68.16s; the healthy/broken/restored configuration and retained-byte assertions ran against PostgreSQL.
  • Strict stale-receipt, partial-seal, generation and link checks remain covered. Current-head independent scoped review and exact-head ClawSweeper review found no actionable issue.
  • No live installation, repair or recovery was performed.

Production delta: -3 lines; tests: +36 lines with a dedicated allocation. Release-note context is recorded here; CHANGELOG.md remains release-owned.

Proof boundary: validation uses the real-filesystem status harness with a selected ledger reader. A shipped-CLI trace using a nondefault history engine remains a named follow-up; no live repair or recovery is claimed.

Initial CI caught a stale PostgreSQL sibling expectation for deliberately malformed configuration: it expected the old classification-time ambiguous result. The test-only follow-up now requires exact directory-only unreadable evidence containing the configuration refusal, exercises healthy/broken/restored configuration, and verifies retained anchor and manifest bytes. The accepted auto request was retired before updating the branch; the failed run is not waived or claimed green.

@vincentkoc vincentkoc self-assigned this Oct 30, 2026
@clawsweeper

clawsweeper Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added cli CLI command changes size: S labels Oct 30, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 30, 2026 03:55
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc enabled auto-merge (squash) October 30, 2026 03:58
@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR carries one selected ledger observation through recovery-capture validation and status classification.

Example: Run openclaw update status --json with a retained PostgreSQL capture and malformed configuration.

  • Before: Capture inspection can query the default ledger before the selected failure reader reports the configuration error.
  • After: The capture becomes directory-only unreadable evidence without querying a fallback ledger.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) A focused, source-supported repair with no findings; supplied proof remains in-process and exact-head PostgreSQL validation is pending.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate: supplied evidence covers the real-filesystem status harness, while the shipped-CLI nondefault-engine trace remains an acknowledged follow-up.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Recovery guidance can combine different ledger observations or consult the default store after the selected engine becomes unavailable.
Reason: The maintainer-authored direction restores the existing selected-reader contract with less production code and no new configuration or persisted format.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR fixes inconsistent recovery-status ledger observations with no actionable findings; exact-head PostgreSQL checks remain in progress.

Priority: P2
Reviewed head: ccdf227e0b47701d3aa3c5a17358ce19d1508d8b

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: A shipped-CLI trace using a nondefault history engine is explicitly deferred; supplied validation exercises the filesystem/status harness.
Agent review details

How this fits together

Update status combines retained capture manifests with update-run history to produce recovery guidance; this read-only projection does not authorize restoration or cleanup.

flowchart TD
  A[Update status command] --> B[Selected ledger reader]
  A --> C[Capture inventory]
  B --> C
  C --> D[Manifest and receipt validation]
  D --> E[Recovery classification]
  E --> F[JSON or terminal guidance]
Loading

Technical review

Best possible solution:

Carry the selected ledger result through the existing reader and classifier while retaining filesystem and receipt validation.

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

Current-main source shows the selected reader being bypassed during inventory and receipt validation; supplied regressions cover absent, failed and unavailable observations, but no target code was executed during this review.

Is this the best way to solve the issue?

This is the smallest complete fix: reuse the existing observation, preserve known absence, and remove redundant reads and their obsolete classification catch.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 098188527dab.

Provenance checked

  • Recovery receipt and terminal classification changes intended behavior with a stated reason (c7ee253: Validate retained manifests, terminal outcomes and forward-generation receipts through read-only status inspection.)
  • Selected history engine and malformed configuration keeps the original intent (945f6dd: Read the configured PostgreSQL ledger and preserve visible recovery evidence when configuration cannot be parsed.)
  • Per-capture unreadable evidence keeps the original intent (ddd5383: Keep damaged captures from hiding healthy neighbors without attaching trusted identity to rejected evidence.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Vincent Koc: Raw commit ddd5383 adds src/infra/update-recovery-backup-status.ts:27 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: ddd53830227b; files: src/infra/update-recovery-backup-status.ts)
  • Peter Steinberger: Raw commit 945f6dd adds src/infra/update-recovery-backup-status.ts:28 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 945f6dde06e2; files: src/infra/update-recovery-backup-status.ts)

PR surface

Source -3, Tests +36, Other +2. Total +35 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 49 52 -3
Tests 2 46 10 +36
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 2 0 +2
Total 5 97 62 +35

Labels

Label changes:

  • add P2: Recovery-status inspection can mix ledger observations or bypass the selected failure reader, affecting diagnostic accuracy without changing restoration or cleanup authority.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: Recovery-status inspection can mix ledger observations or bypass the selected failure reader, affecting diagnostic accuracy without changing restoration or cleanup authority.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-30T04:00:31.555Z sha 91716af :: needs maintainer review before merge. :: none

Reviewed October 30, 2026, 12:33 AM ET / 04:33 UTC (Revision 2).

@vincentkoc
vincentkoc disabled auto-merge October 30, 2026 04:16
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Please review ccdf227. The follow-up changes only the PostgreSQL recovery-status expectation and its test allocation; production files are byte-identical to 91716af. The malformed-configuration case now requires directory-only unreadable evidence, checks healthy/broken/restored configuration, and verifies retained anchor and manifest bytes. Fresh CI run 41002164560 is still running its PostgreSQL and browser bootstrap jobs; those results are not claimed passing. Current-head scoped source review found no actionable issue. The shipped-CLI trace remains a documented follow-up.

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@vincentkoc
vincentkoc merged commit 445e566 into main Oct 30, 2026
151 checks passed
@vincentkoc
vincentkoc deleted the fix/update-recovery-prepared-run-20261030 branch October 30, 2026 04:48
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 31, 2026
)

* refactor(update): reuse one recovery ledger observation

* test(update): cover PostgreSQL recovery inspection refusal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli CLI command changes P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: S 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