Repository navigation
refactor: shrink ClawSweeper entrypoint by 77% with focused subsystems - #1005
Conversation
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 12:48 PM ET / 16:48 UTC. ClawSweeper reviewWhat this changesThis PR splits ClawSweeper’s large CLI entrypoint into focused TypeScript modules for review, apply, context hydration, reporting, dashboard/audit, and command operations while preserving the existing public command surface. Merge readinessThis PR’s prior trailing-whitespace blocker is resolved on the current head, and the reviewed extraction keeps the CLI entrypoint as the composition layer for the existing review, apply, report, and audit workflows. The patch is structurally sound from read-only inspection and includes current real-command proof, but it remains a large automation refactor that should stay open for the in-progress required checks and maintainer landing review. Priority: P3 Review scores
Verification
How this fits togetherClawSweeper’s CLI gathers GitHub item context, runs Codex-backed review, renders durable reports, and conditionally coordinates guarded apply actions. This refactor moves those responsibilities into focused modules while the entrypoint continues to wire commands, state, and workflow safeguards together. flowchart LR
A[GitHub items and workflow events] --> B[Context hydration]
B --> C[Review command workflow]
C --> D[Decision and report orchestration]
D --> E[Dashboard and audit state]
D --> F[Guarded apply decisions]
F --> G[GitHub actions and ledger]
H[CLI command dispatch] --> B
H --> C
H --> F
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the focused module boundaries, land only after the current checks complete on this head, and preserve the existing local-review, ledger, lease, and create-only repair safeguards demonstrated in the PR proof. Do we have a high-confidence way to reproduce the issue? Not applicable: this PR is a structural refactor rather than a report of failing existing behavior. Its body provides a high-confidence after-change command exercise for the affected local-review paths. Is this the best way to solve the issue? Yes. Separating the existing orchestration responsibilities into factory-backed modules is a maintainable way to reduce the entrypoint’s coupling while retaining the established command and safeguard boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f43618fd2cae. LabelsLabel 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
HistoryReview history (2 earlier review cycles) |
8d5fa13 to
ca5f97a
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…penclaw#1005) Co-authored-by: Peter Steinberger <[email protected]>
Problem
src/clawsweeper.tshad grown to 14,216 lines, mixing command dispatch, report formatting, dashboard state, GitHub hydration, review execution, apply mutation, and retry coordination. The resulting cross-coupled entrypoint made the behavior difficult to understand, review, and change safely.Changes
src/clawsweeper.tsfrom 14,216 to 3,277 lines: 10,939 lines removed from the entrypoint (76.9%).--local-range.gpt-5.6-sol/xhigh, with merge and auto-merge disabled.Real behavior proof
The actual
pnpm run local-reviewcommand and local-range reviewer were exercised against a committed temporary Git repository. The same proof also generated issue/self-heal jobs and evaluated their real execution gates:{"actualPackageCommand":"pnpm run local-review","standaloneReviewSucceeded":true,"localRangeReviewSucceeded":true,"committedFilesReviewed":2,"commitsReviewed":1,"gitHubCalls":0,"leakedGitHubCredentials":0,"webSearchDisabled":true,"sandbox":"read-only","isolatedGitHubConfig":true,"generatedAutofixMergeAllowed":false,"legacyAutofixMergeAllowed":false,"legacyIssueMergeAllowed":false,"postFlightAutofixMergeAllowed":false,"replacementPrAutoMergeAllowed":false,"singleItemHydration":true}Every extracted multiline template was also compared with the original entrypoint's literal contents; all matched exactly.
Verification
pnpm run check/reviewon the uncommitted changes and committed branchGenerated OpenClaw PR openclaw/openclaw#117443 remains open with auto-merge disabled.