Skip to content

fix: restore apply backlog throughput - #925

Merged
steipete merged 1 commit into
mainfrom
fix/backlog-throughput
Jul 29, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/backlog-throughput

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Summary

  • keep the apply proof, proof-ledger publisher, and mutation jobs on canonical Worker records plus mutable state without materializing the entire immutable ledger/v1 and assets blob archive
  • give operator workflow_dispatch runs a run-unique concurrency group, so scheduled review, hot-intake, or audit traffic cannot supersede a plain dispatched sweep before its first job starts
  • preserve every existing close gate, including packet/source-revision freshness, live policy checks, and the bounded fresh PR close-coverage proof

Root cause

The 128-item audit in #920 was not blocked by packet age or the 20-close mutation budget. Scheduled apply runs did not reach candidate selection.

In https://github.com/openclaw/clawsweeper/actions/runs/30384546731, the read-only proof job restored the canonical Worker record snapshot, then entered Hydrate generated state at 18:00:22Z. With no blob-cache hit it tried to materialize the full immutable ledger/assets archive and stayed there until the 60-minute job timeout cancelled it at 18:57:58Z; Apply close proposals was skipped. The same failure repeated on current main in https://github.com/openclaw/clawsweeper/actions/runs/30406246536 from 23:01:38Z until cancellation at 00:01:06Z.

Meanwhile, all scheduled OpenClaw apply runs share the workflow-level clawsweeper-apply-openclaw/openclaw group. GitHub retains only one pending member of a concurrency group, so the continuing 15-minute schedule replaced waiting successors. Runs such as https://github.com/openclaw/clawsweeper/actions/runs/30404568524 therefore ended with zero jobs. The one close noted around the #920 audit was not evidence of apply throughput: #920 records item 109065 as manually closed before the 128-row table was captured.

The apply policy itself already has the right split. Canonical high-confidence packets remain actionable only while their stored revision matches live state, and apply rechecks labels, authorship, locks, activity, relations, and reason-specific policy before mutation. Only duplicate/superseded PRs require a fresh bounded close-coverage proof. Candidate inventory prioritizes already-authorized fast closes and reserves two proof-required candidates per cycle. This PR leaves all of those rules unchanged.

Expected drain rate

The default remains 20 fresh closes per successful apply run. Of the #920 audit, 93 items do not require the duplicate-PR coverage proof and fit in about five full cycles. The table contains 35 duplicate/superseded PRs; at the existing two-proof reserve they need at most 18 successful proof cycles. Even at one completed cycle per hour, that is under a day rather than months, while any changed or newly blocked item still skips safely.

Dispatch concurrency

All non-apply operator dispatches without exact item inputs now use clawsweeper-operator-dispatch-<run_id>. This also fixes the same supersession trap for operator-dispatched hot-intake and audit runs. Exact-item dispatches retain their per-item coalescing, manual apply/comment-sync dispatches were already run-unique, and scheduled background lanes still coalesce.

Proof

  • mise exec node@24 -- pnpm run build:all
  • mise exec node@24 -- node --test test/sweep-workflow.test.ts test/state-writer-workflow.test.ts test/worker-state-blobs.test.ts — 104 passed
  • mise exec node@24 -- pnpm run format and format:check — clean
  • mise exec node@24 -- pnpm run check — static checks, build, format, and lint passed; exhaustive coverage then hit seven unrelated baseline macOS failures (five Linux capset/Landlock cases, one /var vs /private/var assertion, and one dashboard repository-name casing assertion)
  • mise exec node@24 -- actionlint .github/workflows/sweep.yml — only the workflow's existing ShellCheck notices and two repo-native queue: max extension diagnostics
  • ~/.claude/skills/autoreview/scripts/autoreview --mode local — clean, no accepted/actionable findings

@steipete
steipete requested a review from a team as a code owner July 29, 2026 00:44
@steipete
steipete merged commit eaeed67 into main Jul 29, 2026
10 checks passed
@steipete
steipete deleted the fix/backlog-throughput branch July 29, 2026 00:50
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant