Repository navigation
refactor: decompose ClawSweeper orchestration into focused workflows - #998
Conversation
|
/review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 6:00 AM ET / 10:00 UTC. ClawSweeper reviewWhat this changesThe PR moves GitHub context, media-proof handling, review/apply ledgers, label synchronization, maintainer assist, retry logic, and link presentation from the monolithic orchestrator into nine focused TypeScript modules while retaining the public command surface. Merge readinessThis active PR appears to be a coherent, behavior-preserving orchestration refactor rather than obsolete work. The extracted modules are explicitly composed through typed dependency boundaries, the supplied current-head command proof covers the critical review/apply safety paths, and no discrete patch defect was found; keep it open for normal maintainer landing review because of its automation scope. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper turns GitHub item context into Codex review reports and, in separate guarded workflows, labels, repair work, or apply decisions. The changed orchestrator composes these modules and passes their outputs to reports and GitHub mutation boundaries. flowchart LR
GitHub[GitHub items and activity] --> Context[Context collection]
Context --> Review[Review workflows]
Review --> Ledgers[Review and apply receipts]
Ledgers --> Labels[Label synchronization]
Labels --> Apply[Guarded apply and repair paths]
Apply --> Outcomes[Reports and GitHub mutations]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve the existing public commands and fail-closed mutation behavior, then land this refactor with its current command-level proof and a fresh review of the exact head. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal refactor rather than a reported user bug; the relevant verification is preservation of existing review and apply workflows through focused command-level proof. Is this the best way to solve the issue? Yes: retaining the public command surface while isolating complete workflows behind explicit dependency boundaries is a maintainable solution, provided the documented guarded behavior remains intact. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8ee77751965b. 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
|
|
ClawSweeper status: review started. I am starting a fresh review of this pull request: refactor: decompose ClawSweeper orchestration into focused workflows This is item 1/1 in the current shard. Shard 0/1. This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking. Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted. |
…penclaw#998) Co-authored-by: Peter Steinberger <[email protected]>
Summary
Reduce
src/clawsweeper.tsfrom 25,173 lines to 19,923 lines (5,250 lines / 20.9% smaller) by moving complete workflows behind explicit, typed dependency boundaries:src/clawsweeper-github-context.ts: bounded REST/GraphQL pagination and exact activity cursors.src/clawsweeper-media-proof.ts: bounded image/video proof extraction and inspection.src/clawsweeper-review-ledger.tsandsrc/clawsweeper-apply-ledger.ts: immutable review/apply receipts, mutation observation, and business idempotency.src/clawsweeper-label-sync.ts: all advisory, priority, rating, status, bulk-filer, proof, and stale-protection labels through the existing observed-mutation boundary.src/clawsweeper-assist.ts: isolated maintainer-assist generation, exact artifact binding, and write-token publication.src/clawsweeper-failed-review-retry.ts: exact-source retry state, dispatch checkpoints, exhaustion, and immutable retry receipts.src/clawsweeper-links.tsandsrc/clawsweeper-close-reasons.ts: repository link and close-reason presentation.The existing public
src/clawsweeper.tsexports and command surface remain unchanged. Unused orchestration imports and bindings were removed.Real behavior proof
Ran the actual standalone package command
pnpm run local-reviewand integrated--local-rangeagainst committed local fixtures. Both succeeded with 0 GitHub calls, 0 leaked GitHub credentials, web search disabled, read-only Codex sandbox, and isolated GitHub config.Real repair workflow proof against canonical issue
openclaw/openclaw#98276and generated PRopenclaw/openclaw#117144verifies direct exact-item Worker hydration (recordCount: 1) and all merge controls remain fail closed: generated autofix mergefalse, replacement PR auto-mergefalse, fallback replacement auto-mergefalse. Authorized ClawSweeper-service merges remain separately permitted; generated issue PR creation continues to usegpt-5.6-sol/xhigh.Focused command-level tests execute real bounded retry dispatch, immutable receipt publication, source-revision changes, assist artifact binding, label mutation sync, and offline review:
The independent fresh precommit review performed further command-level verification: No actionable findings. All 142 targeted tests passed, including offline review, credential isolation, retry checkpoints, ledger idempotency, and label synchronization.
Review disposition
No accepted or actionable findings remain. The refactor is rebased on the independently reviewed production changed-gate fix from #997.