Skip to content

refactor(infra): simplify audit recovery write progress - #157141

Merged
vincentkoc merged 3 commits into
mainfrom
refactor/audit-recovery-pending-owner
Nov 29, 2026
Merged

vincentkoc merged 3 commits into
mainfrom
refactor/audit-recovery-pending-owner

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

This maintainer-requested cleanup removes unreachable pending-write handling from legacy audit recovery's sequential writer.

User Impact

No user-visible change is intended. Audit recovery, installed-update behavior, journal formats, and durability ordering remain unchanged.

Why This Change Was Made

Interrupted writes are already reconciled by the restoration caller; new scrub writes start with zero progress. The sequential writer now keeps one private progress copy and updates it at the existing persisted-intent and post-write/fsync boundaries.

Evidence

The signed integration candidate preserves the shared audit-recovery writer and covers interrupted restoration with both committed and pending progress. All 39 tests in the audit-log suite passed on Node 24.22.1, including both restoration cases. Formatting and the diff check passed for both changed files. Candidate CI tracks this revision.

The unmodified published [email protected] updater installed this exact candidate over a half-restored audit archive with a pending journal. The installed files and build identity matched the candidate tarball. Before a standalone Doctor run, the fixture found exactly one expected event, the recovered sanitized bytes, the original raw file identity and size with scrubbed contents, and no remaining recovery sidecars. After Doctor, the complete recovered state matched the first observation.

The Docker suite exited 0. The outer artifact exporter exited 1 on a private receipt. The retained Docker stdout matched its recorded SHA-256 (d962b575c5c9c0dec85298bfbfbfa9ae908897e347a1c3c0e019e03e9527ae74) and contains the three post-assertion success markers. The individual raw JSON receipts were unavailable outside the container.

Earlier evidence on the original revision

  • Complete audit-recovery and audit-log suites: original 30/30 and final candidate 30/30 passed with identical augmented test bytes and ordered case identities. This is PASS/PASS characterization, not a bug RED. The rollback fixture retains committed-half coverage and adds pending-restoration coverage.
  • One-worker wrapper wall times, including compiler preparation: recovery 35.757s original / 34.660s final; audit logs 26.742s original / 26.386s final. These are measurements, not a performance claim. Per-file CI timing is not available yet.
  • All 31 selected stages are accounted for. The original aggregate failed lint after removing the prelude exposed existing accumulating spreads. The reviewed private-copy remedy passed targeted lint, formatting, diff checks, and core production types; 22 earlier successful stages and eight remaining guards were retained. The unchanged core-test typecheck was not repeated.
  • Fresh scoped P0-P2 review found no actionable issues.
  • Earlier installed-update attempts: all five configured Testbox attempts on the original revision failed. The first stopped because the private launcher compared pnpm --version with the manifest's version-plus-integrity pin. The second stopped during source sync. The instrumented third recorded a killed remote-manifest subprocess followed by Blacksmith's two-minute checksum-sync timeout; the cause of the killed subprocess is not established. The first three never reached packaging or updater execution. The fourth passed canonical candidate packaging, then stopped at the plugin-registry clean-source guard before the installed updater ran. Attempt five also stopped during source sync before its remote proof program started: targeted sync timed out, then the native completion watchdog stopped the fallback. Those five attempts did not verify installed recovery.
  • Exact-head CI run 35979195841 completed successfully for fc9e09d2bf96cc58db9a52e81c823f77f4184e44. That CI run covered the original revision. The separate installed-updater result for the integrated candidate is recorded above. The fixture used synthetic state and did not simulate physical power loss.

@vincentkoc vincentkoc self-assigned this Sep 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 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.

@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: 🦞 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 24, 2026
@clawsweeper

clawsweeper Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR removes redundant pending-write handling, updates a private progress copy, and extends interrupted audit-restoration coverage.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The pinned implementation is focused and source-supported, but its meaningful fixture coverage does not complete the required installed-update acceptance.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Refactor · Worth it: Yes
Reason: The requested cleanup removes unreachable duplicate handling from a sensitive recovery path with a small production reduction. It preserves the established output and durability contract.

Merge readiness

⛔ Needs changes before merge - 1 item remains

Keep open under the maintainer-authored guard. No actionable defect was found in the pinned diff, but later main changes substantially altered the same recovery owner.

Priority: P3
Reviewed head: fc9e09d2bf96cc58db9a52e81c823f77f4184e44

Before merge

  • Complete next step - Resolve the GitHub-reported conflicts against current main, preserving its shared recovery writer and current test ownership.

Findings

None.

Tests

  • Missing end-to-end proof: The published updater must install the integrated candidate over seeded interrupted audit state, recover before standalone Doctor, and preserve post-Doctor idempotence; existing evidence is PASS/PASS characterization rather than a failing regression.
Agent review details

How this fits together

Doctor imports legacy audit logs into SQLite and sanitizes their archived files. Recovery journals let interrupted archive writes finish safely without losing audit records.

flowchart TD
  A[Legacy audit archives] --> B[Doctor migration]
  B --> C[Validate recovery journal]
  C --> D[Reconcile interrupted write]
  D --> E[Sequential archive writer]
  E --> F[Persist progress and sync bytes]
  F --> G[Recovered records and sanitized archive]
Loading

Technical review

Best possible solution:

Apply any remaining cleanup to current main's shared recovery writer while preserving journal bytes, durability ordering, and interrupted-state recovery.

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

Not applicable: this PR proposes a refactor, and its reported PASS/PASS checks characterize existing recovery behavior rather than reproduce a defect.

Is this the best way to solve the issue?

Unclear for current main: the pinned cleanup is sound, but later main consolidated writes into the reconciliation helper, so the final integration should use that owner.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0f56d2e3d9b8.

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

PR surface

Source -10, Tests +14. Total +4 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 3 13 -10
Tests 1 33 19 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 36 32 +4

Labels

Label changes:

No label changes.

Label justifications:

  • P3: This is a behavior-preserving internal cleanup with no reported current user failure.
  • merge-risk: 🚨 compatibility: The changed writer handles interrupted legacy state during Doctor recovery, and the required published-updater compatibility run remains incomplete.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

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 (3 earlier review cycles)
  • reviewed 2026-09-24T08:18:53.726Z sha fc9e09d :: blocked before merge. :: none
  • reviewed 2026-09-24T09:18:45.405Z sha fc9e09d :: blocked before merge. :: none
  • reviewed 2026-09-24T10:27:04.962Z sha fc9e09d :: blocked before merge. :: none

Reviewed October 8, 2026, 5:03 PM ET / 21:03 UTC (Revision 4).

@vincentkoc
vincentkoc marked this pull request as ready for review September 24, 2026 09:06
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Sep 24, 2026
@clawsweeper clawsweeper Bot added status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 8, 2026
@vincentkoc
vincentkoc merged commit 652611b into main Nov 29, 2026
136 checks passed
@vincentkoc
vincentkoc deleted the refactor/audit-recovery-pending-owner branch November 29, 2026 02:03
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 29, 2026
…line

* commit '652611b9d924c754ac7a18d0081cce6e1ec765df': (527 commits)
  refactor(infra): simplify audit recovery write progress (#157141)
  fix: show restart blockers in service logs (#207879)
  test(infra): exercise group identity in session roundtrip (#207671)
  test(infra): exercise live owner expiry policy (#207672)
  feat: let Knowledge learn from your Gmail through Composio (#207266)
  test: stop the history-worker overload test from failing CI on slow runners (#207862)
  test(auth): assert SecretRef plaintext is absent from storage (#207698)
  chore(doctor): hold expired doctor migrations as removal-pending (#207865)
  fix: show ended one-time automations in History (#201280)
  chore(release): update appcast for 2026.11.11 (#207504)
  fix: let updates back up deeply nested databases (#207756)
  fix(telegram): stop resending earlier messages to the model on every turn in DM topics (#207684)
  feat(workboard): choose which sessions appear on a board (#207781)
  fix: acknowledge updates when the Gateway first becomes ready (#207819)
  chore: stop the cron recovery test from failing CI on slow runners (#207837)
  fix: queue follow-ups when session creation reuses an active chat (#207800)
  feat(clawrouter): consume qualified native memory embeddings (#191874)
  fix: save the account for main-session prompts and converted reminders (#207776)
  test(infra): measure worker Buffer storage directly (#207663)
  feat(workboard): hide sessions and filter subagents per board (#207744)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
…line

* commit 'c876514dc21154a07f3755320495d2a93584b46b': (538 commits)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  fix: verify chat Stop recovery after dashboard pairing (#207888)
  test(activity): check midnight refresh against the elapsed window (#207859)
  test(ui): use one persisted message ID in queued-image handoff (#207861)
  test(agents): release configured MCP fixture resources (#207716)
  fix(workboard): clear CI failures in the session filter editor (#207858)
  perf(ai): reduce allocation in OpenAI Responses streams (#207889)
  chore: stop the Workboard resident-owner CLI test from failing on main (#207898)
  test(agents): isolate endpoint-based overflow classification (#207688)
  chore(doctor): record why the root defaultModel migration stays (#207890)
  refactor(infra): simplify audit recovery write progress (#157141)
  fix: show restart blockers in service logs (#207879)
  test(infra): exercise group identity in session roundtrip (#207671)
  test(infra): exercise live owner expiry policy (#207672)
  feat: let Knowledge learn from your Gmail through Composio (#207266)
  test: stop the history-worker overload test from failing CI on slow runners (#207862)
  test(auth): assert SecretRef plaintext is absent from storage (#207698)
  chore(doctor): hold expired doctor migrations as removal-pending (#207865)
  fix: show ended one-time automations in History (#201280)
  ...
vincentkoc added a commit that referenced this pull request Nov 29, 2026
* commit '2194d14488091e2047d2f87ebbb093212f30840e': (540 commits)
  fix: stop reporting a child worker as finished when the Gateway loses contact (#207713)
  fix: keep the Activity visibility test stable at midnight (#207847)
  perf(agents): reuse prepared tool catalog executors (#207900)
  fix: show the Gateway command default beside host rules in Devices (#207887)
  fix: verify chat Stop recovery after dashboard pairing (#207888)
  test(activity): check midnight refresh against the elapsed window (#207859)
  test(ui): use one persisted message ID in queued-image handoff (#207861)
  test(agents): release configured MCP fixture resources (#207716)
  fix(workboard): clear CI failures in the session filter editor (#207858)
  perf(ai): reduce allocation in OpenAI Responses streams (#207889)
  chore: stop the Workboard resident-owner CLI test from failing on main (#207898)
  test(agents): isolate endpoint-based overflow classification (#207688)
  chore(doctor): record why the root defaultModel migration stays (#207890)
  refactor(infra): simplify audit recovery write progress (#157141)
  fix: show restart blockers in service logs (#207879)
  test(infra): exercise group identity in session roundtrip (#207671)
  test(infra): exercise live owner expiry policy (#207672)
  feat: let Knowledge learn from your Gmail through Composio (#207266)
  test: stop the history-worker overload test from failing CI on slow runners (#207862)
  test(auth): assert SecretRef plaintext is absent from storage (#207698)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 29, 2026
)

* refactor(infra): simplify audit recovery write progress

* test(infra): cover pending audit restoration in the audit log suite
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant