Skip to content

fix(doctor): continue past skipped legacy audit-log recovery instead of stopping as a refusal - #145376

Merged
steipete merged 2 commits into
mainfrom
steipete/upd-audit-skip-not-refusal
Sep 12, 2026
Merged

steipete merged 2 commits into
mainfrom
steipete/upd-audit-skip-not-refusal

Conversation

@steipete

@steipete steipete commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #145340

Additional instructions

Keep Allow edits from maintainers enabled so maintainers can help update the branch.

What Problem This Solves

Fixes an issue where users running openclaw update repair would stop before later repairs when Doctor deliberately preserved a legacy audit archive. A checkpointless scrubbed raw archive, exhausted checkpoint capacity, or a non-append archive change was incorrectly reported as a migration refusal.

Why This Change Was Made

The audit owner now distinguishes completed, skipped, and refused sources. The existing receipt writer records an advisory skip without halting later Doctor steps. Unsafe recovery failures still refuse, and an older skipped generation still blocks later generations of the same logical audit source. Warnings from a failed claim restoration cannot be hidden by a prior skip.

Doctor also carries warnings from skipped receipts into its updater result, so postUpdate.doctor.warnings includes the preserved-archive warning. The internal skip outcome preserves the existing public plugin warning contract. Archive bytes, checkpoint limits, retention, and recovery semantics remain unchanged.

User Impact

Doctor and update finalization can continue with the skip warning recorded. The warning links to recovery guidance and repeats until the archive is resolved. Thanks to @robertemetz-afk for the report and preserved-history evidence.

Successful finalization does not mean the companion's historical records were imported. There is no existing supported sanitized-only import path. Historical reconciliation requested in #145340 remains a separate design decision; this change fixes the finalization blockage and preserves its recovery inputs.

Evidence

  • Pre-fix runner regression: all three skip cases failed with expected skipped, received refused; the unsafe recovery control passed.
  • Exact-head CI passed all 393 regular test files in the requested suites: 71 state-migration files, 252 Doctor files, and 70 update-CLI files. The Windows-only audit test was skipped on Linux. All four new audit cases passed, including true-refusal preservation.
  • Doctor IPC regression: the skipped warning was missing before the collector fix; all seven IPC tests pass afterward. The completed branch passed P1 autoreview with no actionable findings.
  • Fresh Docker proof passed against the exact source tree of f29896e4e4b: published 2026.9.3 update exit 0; candidate repair exit 0 with status: "warning" and the audit warning in postUpdate.doctor.warnings; standalone Doctor exit 0; /readyz 200 with ready: true and no failing conditions. Shared schema advanced 16 → 17. Both 6,750-byte archive hashes stayed identical and all 45 sanitized records were preserved. Candidate tarball SHA-256: 580e8aa71a056e5cc9a8393af983be18c38b6e593af429e5242a959560166cd8.
  • The first Docker attempt exposed the dropped JSON warning; its strict assertion was retained unchanged for the successful run.
  • node scripts/check-changed.mjs passed, including core/test types, lint, repository guards, and dead-export checks. Documentation link audit: 13,455 links, zero broken.
  • Exact-head CI is green. The merge ref contains 87504f7ec9e and the submitted head.
  • The broad local run hit a 120-second timeout in the unchanged exec/TUI caller-mode test; the same test passed in exact-head CI in 19.9 seconds. The local run was stopped after CI coverage was verified. No timeout was raised and no assertion or baseline was weakened.
  • All six E2E files outside the regular CI selection passed locally: 51 tests, including legacy Doctor migration, newer-schema refusal, state-directory diagnostics, sandbox warnings, config migration, and staged repair isolation. The repository runner completed the required full build before execution.

No production data was used. No changelog, configuration option, dependency, schema, protocol, or persistent recovery policy was changed.

ClawSweeper review

The completed September 12 00:22 UTC review of f29896e4e4b4a53de71365d0f019d7b7d1adf82c found no actionable defects and listed no before-merge or Rank-up moves. No fixups or skips are needed. Historical-record reconciliation remains separate from this finalization fix.

Preserve audit archive ambiguity, checkpoint capacity, and append-order
safeguards as warning-bearing skips so later Doctor and update repairs run.
Keep unsafe recovery and agent ownership refusals blocking, and document
that successful finalization does not reconcile the preserved audit history.

Refs #145340.

Co-authored-by: robertemetz-afk <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 11, 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 docs Improvements or additions to documentation size: M maintainer Maintainer-authored PR labels Sep 11, 2026
@steipete
steipete marked this pull request as ready for review September 11, 2026 22:58
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 11, 2026
@clawsweeper

clawsweeper Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 11, 2026, 8:32 PM ET / September 12, 2026, 00:32 UTC (Revision 5).

ClawSweeper review

What this changes

Doctor treats safely preserved legacy audit archives as warning-bearing skips, continues later repairs, and includes those warnings in update results and recovery documentation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, bounded fix absent from current main and the latest release. No actionable patch defects were found; historical audit reconciliation remains separate from the finalization repair.

Priority: P1
Reviewed head: f29896e4e4b4a53de71365d0f019d7b7d1adf82c

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful regression coverage and concrete upgrade observations; no actionable correctness or security defect was found.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (live_output): The captured Docker observations exercise published 2026.9.3 updating to the candidate and the changed Doctor/update-repair path, reporting successful completion with the audit warning, healthy readiness, and unchanged archives. Raw Testbox logs could not be independently reread because their storage host is blocked; the workflow's cancelled status is not treated as a passing assertion.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured Docker observations exercise published 2026.9.3 updating to the candidate and the changed Doctor/update-repair path, reporting successful completion with the audit warning, healthy readiness, and unchanged archives. Raw Testbox logs could not be independently reread because their storage host is blocked; the workflow's cancelled status is not treated as a passing assertion.
Evidence reviewed 9 items Current main and release still contain the defect: Fetched main and v2026.9.4 share audit-owner blob 759347b8c81325b2cb33473a8d5170d5314067b4. Checkpointless whitespace returns an incomplete result with a warning, without the recoverable disposition needed to prevent a refusal.
Introduced safety classification: The three advisory exits preserve their existing guards. Failed restoration remains refused, cleanup warnings can upgrade a skip to refusal, and incomplete generations still block later generations of the same logical source.
Receipt and updater integration: The receipt owner gives blocking warnings precedence over an explicit skip. The serial migration runner halts only on refused receipts, and the health flow now forwards skipped-receipt warnings through existing updater IPC.
Findings None None.
Security None None.

How this fits together

Doctor migrates legacy state before update finalization continues. The audit migration owner checks archive safety and returns receipts that determine whether later repairs proceed and which warnings reach the updater.

flowchart TD
  A[Update repair or Doctor] --> B[Inspect legacy audit archives]
  B --> C{Recovery outcome}
  C -->|Completed| D[Continue later repairs]
  C -->|Safely skipped| E[Preserve archive and warning]
  E --> D
  C -->|Unsafe recovery| F[Stop with refusal]
  D --> G[Update result with warnings]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +38, Tests +137, Docs +23. Total +198 across 7 files.

View PR surface stats
Area Files Added Removed Net
Source 4 70 32 +38
Tests 2 138 1 +137
Docs 1 23 0 +23
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 231 33 +198

Review metrics

None.

Stored data model

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

Technical review

Best possible solution:

Keep safe audit skips advisory within the existing migration owner, preserve recovery inputs, and track historical reconciliation separately in #145340.

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

Yes: current main turns the documented checkpointless-whitespace archive warning into a refused receipt and stops later migration steps. This review established that path from source without executing it.

Is this the best way to solve the issue?

Yes: classifying safe non-outcomes at the audit owner and forwarding their warnings repairs finalization without bypassing archive ambiguity checks or introducing another recovery mechanism.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 6cb7280a4e85.

Labels

Label justifications:

  • P1: The fix unblocks later Doctor repairs and update finalization for a documented production archive condition.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured Docker observations exercise published 2026.9.3 updating to the candidate and the changed Doctor/update-repair path, reporting successful completion with the audit warning, healthy readiness, and unchanged archives. Raw Testbox logs could not be independently reread because their storage host is blocked; the workflow's cancelled status is not treated as a passing assertion.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured Docker observations exercise published 2026.9.3 updating to the candidate and the changed Doctor/update-repair path, reporting successful completion with the audit warning, healthy readiness, and unchanged archives. Raw Testbox logs could not be independently reread because their storage host is blocked; the workflow's cancelled status is not treated as a passing assertion.

Evidence

What I checked:

  • Current main and release still contain the defect: Fetched main and v2026.9.4 share audit-owner blob 759347b8c81325b2cb33473a8d5170d5314067b4. Checkpointless whitespace returns an incomplete result with a warning, without the recoverable disposition needed to prevent a refusal. (src/infra/state-migrations.audit-logs.ts:343, 6cb7280a4e85)
  • Introduced safety classification: The three advisory exits preserve their existing guards. Failed restoration remains refused, cleanup warnings can upgrade a skip to refusal, and incomplete generations still block later generations of the same logical source. (src/infra/state-migrations.audit-logs.ts:596, f29896e4e4b4)
  • Receipt and updater integration: The receipt owner gives blocking warnings precedence over an explicit skip. The serial migration runner halts only on refused receipts, and the health flow now forwards skipped-receipt warnings through existing updater IPC. (src/infra/state-migrations.messages.ts:66, f29896e4e4b4)
  • Behavioral regression coverage: The new migration cases exercise all three skips through autoMigrateLegacyState, verify a later exec-approvals migration, repeat the migration, and compare preserved archive bytes. A mixed skip/unsafe-restoration case retains refusal. IPC coverage checks warning propagation only after successful Doctor completion. These tests were source-reviewed, not executed during this read-only review. (src/infra/state-migrations.audit-skips.test.ts:18, f29896e4e4b4)
  • Captured real upgrade proof: The supplied full PR body, captured under sourceRevision 15a3f57ec48d182015f8f1a62310143a3574ac2902f420e08662ecce61d53c41, reports a fresh Docker rehearsal using published 2026.9.3 and the exact candidate source: update and repair exit 0, warning status with postUpdate.doctor.warnings, standalone Doctor exit 0, readiness HTTP 200, unchanged archive hashes, and 45 preserved companion records. Candidate tarball SHA-256 is 580e8aa71a056e5cc9a8393af983be18c38b6e593af429e5242a959560166cd8. The linked Testbox run is https://github.com/openclaw/openclaw/actions/runs/34657266518. (f29896e4e4b4)
  • Proof corroboration limitation: GitHub reports the Testbox workflow and its interactive Run Testbox step as cancelled; that workflow conclusion does not independently establish the claimed Docker assertions. Fetching its raw logs was blocked at the storage-host network boundary. The supplied runtime observations remain the proof basis; no fresh execution was performed.

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • TheAngryPit: 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 (4 earlier review cycles)
  • reviewed 2026-09-11T23:05:22.456Z sha 7c4e0b3 :: blocked before merge. :: none
  • reviewed 2026-09-11T23:21:39.812Z sha f29896e :: blocked before merge. :: none
  • reviewed 2026-09-11T23:38:34.647Z sha f29896e :: needs maintainer review before merge. :: none
  • reviewed 2026-09-12T00:22:57.372Z sha f29896e :: needs maintainer review before merge. :: none

Include advisory skipped receipts in the Doctor result sent to the updater,
so successful finalization reports the preserved legacy audit archive warning.
Keep failed Doctor runs from publishing successful migration advisories.

Refs #145340.

Co-authored-by: robertemetz-afk <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. proof: sufficient ClawSweeper judged the real behavior proof convincing. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 11, 2026
@steipete
steipete merged commit db26660 into main Sep 12, 2026
209 checks passed
@steipete
steipete deleted the steipete/upd-audit-skip-not-refusal branch September 12, 2026 00:35
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 12, 2026
…of stopping as a refusal (openclaw#145376)

Doctor and `openclaw update repair` no longer stop when a legacy audit-log archive is deliberately skipped (checkpointless raw archive, exhausted checkpoint capacity, or a rewritten archive). The skip is recorded as a warning with recovery guidance and later repairs run.

The audit migration owner keeps unsafe recovery failures blocking, preserves the archives and generation ordering, and forwards skipped-receipt warnings through Doctor into update results. Historical-record reconciliation remains a separate design decision.

Validated by runner and Doctor IPC regressions, published 2026.9.3 updater-to-candidate Docker observations, and green exact-head CI.

Fixes openclaw#145340. Thanks to @robertemetz-afk for reporting the problem and providing preserved-history evidence.

Co-authored-by: robertemetz-afk <[email protected]>
steipete added a commit that referenced this pull request Sep 17, 2026
…150425)

Doctor now quarantines a config-audit archive that changed other than by append and continues later repairs. Check checkpoint integrity before parsing, preserve existing SQLite rows and sanitized history, and keep repeat runs quiet. Empty checkpointless raw archives cannot erase retained sanitized companions.

Portable backups exclude quarantined raw bytes and their derivatives through the shared audit-path classifier, preserving local originals and sanitized archive content. This completes the backup privacy boundary across discovery, tar exclusion, and volatile filtering.

Reported by an Ubuntu operator on Discord using OpenClaw 2026.9.3. Related: #145376.

Validation: exact-head CI passed; 135 focused tests, changed checks, and build passed in the fix lane. Published 2026.9.3 driver proof demonstrated exit 1 to exit 0, preserved history, later repairs, and quiet repeats. The fix lane's broad local backup-suite diagnostic was incomplete; hosted CI is the completed full gate. The scoped Codex review and current-head ClawSweeper review have no actionable findings.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 18, 2026
…penclaw#150425)

Doctor now quarantines a config-audit archive that changed other than by append and continues later repairs. Check checkpoint integrity before parsing, preserve existing SQLite rows and sanitized history, and keep repeat runs quiet. Empty checkpointless raw archives cannot erase retained sanitized companions.

Portable backups exclude quarantined raw bytes and their derivatives through the shared audit-path classifier, preserving local originals and sanitized archive content. This completes the backup privacy boundary across discovery, tar exclusion, and volatile filtering.

Reported by an Ubuntu operator on Discord using OpenClaw 2026.9.3. Related: openclaw#145376.

Validation: exact-head CI passed; 135 focused tests, changed checks, and build passed in the fix lane. Published 2026.9.3 driver proof demonstrated exit 1 to exit 0, preserved history, later repairs, and quiet repeats. The fix lane's broad local backup-suite diagnostic was incomplete; hosted CI is the completed full gate. The scoped Codex review and current-head ClawSweeper review have no actionable findings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. proof: sufficient ClawSweeper judged the real behavior proof convincing. 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.

[Bug]: update repair blocked by checkpointless scrubbed config-audit archive; supported recovery needed

1 participant