Repository navigation
fix(fanout): move rotation cursor to canonical store - #957
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 30, 2026, 6:33 AM ET / 10:33 UTC. ClawSweeper reviewWhat this changesThe branch stores each target-fanout mode’s rotation cursor in the authenticated ExactReviewQueue Durable Object, removes the sweep workflow’s Git cursor publication, and makes selected post-side-effect Git bookkeeping writes best-effort. Merge readiness⛔ Blocked until real behavior proof from a real setup is added - 5 items remain This PR addresses a real fanout-coverage failure by moving the rotation cursor off Git-backed state, but it should remain open until the dashboard Worker endpoint is deployed and the full scheduled path is proven against that deployment. Likely related people: Priority: P1 Review scores
Verification
How this fits togetherTarget fanout selects repositories for scheduled ClawSweeper review work and advances a per-mode cursor so cycles cover the full configured fleet. The workflow now reads and writes that cursor through the dashboard Worker, which authenticates requests and forwards them to ExactReviewQueue Durable Object storage before dispatch results are published. flowchart LR
A[Scheduled target fanout] --> B[Live repository inventory]
B --> C[Authenticated cursor endpoint]
C --> D[ExactReviewQueue Durable Object]
D --> E[Repository selection]
E --> F[Workflow dispatches]
E --> G[Cursor revision update]
G --> D
Decision needed
Why: The code deliberately fails open when the endpoint is unavailable, so CI can pass while the deployed workflow continues the same non-rotating behavior that this PR is intended to fix. Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Deploy the dashboard Worker endpoint before enabling the updated scheduled workflow, then capture a redacted real run showing an authenticated cursor revision advances across two fanout executions while repository dispatch still succeeds. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the prior workflow required a Git-backed cursor publication after dispatch, and the reported rejected publication leaves the persisted cursor unchanged for later cycles. A current deployed reproduction of the new Worker endpoint and two sequential scheduled fanout runs is still needed. Is this the best way to solve the issue? Unclear until rollout evidence is available. Moving this small coordination record to the existing canonical Durable Object is a narrow maintainable fix, but it is only the best solution if the Worker endpoint is deployed before the workflow relies on it and the fail-open behavior is observed in a real run. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against d199482415e0. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Summary
clawsweeper-stateinto authenticated ExactReviewQueue Durable Object KVGET/PUT /internal/state/cursors/<mode>with optimistic monotonic revisionsrepair:publish-maincursor stepRoot cause
The scheduled fanout dispatched its selected repositories and then ran a mandatory Git publication for
results/target-fanout-cursors/**. Run https://github.com/openclaw/clawsweeper/actions/runs/30533320020 reached that final step, but GitHub rejected theclawsweeper-statepush withfatal error in commit_refs. The workflow therefore left the previous cursor in Git. Every later cycle hydrated that same cursor and selected the same head-of-list repositories, so nominal queue capacity did not translate into fleet coverage.The cursor is now a small Durable Object record keyed by mode. A write includes the revision read before dispatch; a stale writer receives
409 fanout_cursor_revision_conflictinstead of silently overwriting a newer cursor. If either read or write fails, fanout emits a prominent warning and continues. Dispatched work remains valid even when cursor persistence is unavailable.Remaining
clawsweeper-statewritersjobs/**and command ledgerjobs/**andresults/**jobs/**,results/**,notifications/**, and report stateYes, writers to
openclaw/clawsweeper-statestill remain, so that repository cannot be archived yet. This PR removes the live fanout dependency that is blocking fleet coverage, but the strict rows above still need canonical owners before archival.Proof
node --test test/repair/target-fanout.test.ts test/state-writer-workflow.test.ts test/sweep-workflow.test.ts test/dashboard-worker.test.ts— 369 passedpnpm run format:check— cleanpnpm run build:all— cleanpnpm run lint— all four linters clean/Users/steipete/.claude/skills/autoreview/scripts/autoreview --mode local— clean, no accepted/actionable findings/Users/steipete/.claude/skills/autoreview/scripts/autoreview --mode branch --base origin/main— clean, no accepted/actionable findingspnpm run checkpassed static checks, formatting, builds, lint, and coverage thresholds, but the full macOS run still exits on five unchanged Linux Landlock containment tests. Their generated Python runtime resolveslibc.capset, which is unavailable on macOS; this branch does not touch that runtime or test file.Coverage trajectory
With 138 configured repositories, the 20-repository hot cursor can traverse the fleet in seven 15-minute cycles (about 105 minutes), and the 12-repository normal cursor can traverse it in 12 hourly cycles. Normal fanout can again offer its configured 600 review candidates per hour instead of repeatedly feeding the same repositories. At the observed 127 completed reviews/hour, a static 3,260-item untracked backlog has an ideal drain time of roughly 26 hours; real convergence will vary with new intake, eligible open-item distribution, and queue health.
Deployment
The dashboard Worker must be redeployed so the new Durable Object endpoint is live. Until that redeploy, the merged workflow would still dispatch selected repositories and warn instead of failing, but cursor rotation would restart from the safe default each cycle and would not persist.