Repository navigation
refactor: modularize ClawSweeper and preserve validated fix checkouts - #979
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 2:18 PM ET / 18:18 UTC. ClawSweeper reviewWhat this changesThis PR extracts ClawSweeper’s decision, review-comment, reference, rating, type, and command-dispatch helpers into focused modules while changing repair reviews to use a read-only Codex sandbox and preserve already-validated target checkouts. Merge readinessKeep this PR open for normal merge review. Its copied current-head control/treatment transcript is meaningful real-behavior proof for the checkout-preservation fix, but this review checkout could not materialize the complete 12-file diff from its unreachable promisor remote, so the broad extraction still needs a fresh full-diff review before landing. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s CLI turns GitHub item data into review, repair, and apply-lane decisions, then records workflow outcomes in its action ledger. The changed repair path runs validation and a Codex review against a target checkout before it can create a proposed fix PR. flowchart LR
A[GitHub item and repair job] --> B[Repair validation]
B --> C[Validated target checkout]
C --> D[Read-only Codex review]
D --> E[Checkout binding check]
E --> F[Fix PR decision]
G[CLI command] --> H[Command registry]
H --> I[Action ledger finalization]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the checkout-preservation safeguard together with the modularization only after a reviewer with all current-head blobs verifies that the extracted modules preserve the entrypoint’s prior APIs, command failure semantics, and repair-lane behavior. Do we have a high-confidence way to reproduce the issue? Yes, with medium confidence: the PR body provides a concrete current-main control using the actual repair-review function, and current source confirms that GitHub Actions selects a writable review sandbox. This read-only checkout could not independently rerun or fully inspect the PR-head harness. Is this the best way to solve the issue? Yes for the reported checkout mutation: a read-only review sandbox plus explicit reuse of completed validation targets the observed post-validation cache write without widening repair authority. Full-diff review is still needed to establish that the accompanying module extraction is the safest way to carry it. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3637a9424ec2. 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
HistoryReview history (1 earlier review cycle)
|
|
@clawsweeper re-review |
…claw#979) Co-authored-by: Peter Steinberger <[email protected]>
Summary
src/clawsweeper.tsmonolith into focused modules for shared types, automation policy, strict decision parsing, fence-aware review Markdown, durable review comments, same-repository PR reference extraction, PR ratings, and safe command dispatch. The entrypoint drops to 28,910 lines while retaining its public API and existing close/repair safety gates.if/elseladder with an own-property-checked command registry that preserves asynchronous execution, unknown-command failures, and action-ledger finalization.pnpm check:changed, rewrote ignored TypeScript build caches, and trippedtarget checkout changed after validationbefore PR publication. Reviews now default to a genuinely read-only sandbox and reuse the validation proof that already passed.CLAWSWEEPER_ALLOW_MERGE=0, generated PRs do not receive automerge authority, and comment routing still requires manual merge.Production evidence
/reviewreturnedstatus: clean; the subsequent checkout-binding check failed solely after the review reran the changed gate and rewrote.artifacts/tsgo-cache/test-root.tsbuildinfo.gpt-5.6-solwithxhighreasoning on the 32-vCPU trusted execution runner.okfornode dist/clawsweeper.js checkand preserves the expectedError: Unknown command: definitely-not-a-commandfailure for an unregistered command.Validation
pnpm run check: https://github.com/openclaw/clawsweeper/actions/runs/30653677687 (green; Linux production runner, full coverage suite, builds, lint, format checks).The extracted modules preserve existing behavior, command dispatch handles synchronous and asynchronous commands correctly, and the focused builds and relevant tests pass. No actionable regressions were identified in the changed files.origin/main...abc389bcca75f3c03abef29fa1ca72b5556ce176:The extracted modules preserve existing behavior, command dispatch maintains the previous CLI semantics, and the repair-review changes enforce the intended read-only validation boundary. Focused tests, workflow tests, formatting checks, and TypeScript compilation passed.Both independent local Codex reviews had every PR blob available and inspected the complete current-head diff; they were not limited by the exact-review worker's partial-clone sandbox.Current-head real runtime proof
Executed on current head
abc389bcca75f3c03abef29fa1ca72b5556ce176using the actualrunCodexReviewfunction from bothorigin/mainand the compiled PR-head executor. A real local Git target checkout contained a tracked source file and ignored.artifacts/tsgo-cache/test-root.tsbuildinfo; its validation gate ran before each real review invocation. The harness executed a separate Codex subprocess, returned a real structured clean review, and compared the tracked/index plus ignored-cache checkout binding before and after review.Control, actual current-main executor under
GITHUB_ACTIONS=true:Treatment, actual compiled executor on PR head
abc389bcca75f3c03abef29fa1ca72b5556ce176:The actual current-main executor reproduces the precise failing production transition (
clean reviewfollowed by changed ignored checkout state); the actual current-head executor preserves the exact validated checkout and returns a clean review. The model/reasoning flags are carried through the real review invocation. No generated OpenClaw issue PR is granted automerge authority.