Repository navigation
refactor: modularize ClawSweeper and make autofix fast and merge-safe - #993
Conversation
|
/review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 1:25 AM ET / 05:25 UTC. ClawSweeper reviewWhat this changesThis PR extracts ClawSweeper review and presentation logic into focused modules, scopes repair-state hydration to one record, and makes repair/automerge authorization default-deny with live label rechecks. Merge readinessKeep this PR open for maintainer review. The previous CRLF parsing blocker is addressed on the current head, and the supplied terminal proof exercises the repaired merge-gate paths, but this is a 29-file, 21,783-line automation refactor whose current-head checks and merge-policy review should complete before landing. Priority: P1 Review scores
Verification
How this fits togetherClawSweeper reads repository records and GitHub state to review items, route repair jobs, and optionally finalize authorized repair PRs. This change sits between durable repair-job storage, GitHub Actions workers, and post-flight merge handling, affecting review latency and whether a repaired PR can be merged. flowchart LR
A[Durable repair job] --> B[Repair worker workflow]
B --> C[Target resolver]
B --> D[Merge authorization gate]
D --> E[Codex repair execution]
E --> F[Post-flight policy recheck]
F --> G[Open PR or authorized merge]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the default-deny repair gate and modular extraction, then land only after current-head validation completes and a maintainer confirms the revised automerge contract is acceptable for existing repair jobs. Do we have a high-confidence way to reproduce the issue? Not applicable. This PR is a refactor and automation hardening change; its PR body provides a current-head terminal replay of the affected workflow paths rather than a user-reported failure reproduction. Is this the best way to solve the issue? Yes. Centralizing target resolution and making merge permission default-deny with repeated live-label checks is a narrower, safer direction than preserving the prior inherited merge setting. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a80c24ebf2f1. 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 (3 earlier review cycles)
|
|
/review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
/review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
…openclaw#993) * refactor: modularize ClawSweeper and harden autofix repair lanes * fix: deny merge authority for unclassified repair jobs * fix: preserve CRLF repair job authorization --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
pnpm run local-reviewcommand and ClawSweeper's full--local-rangereview continue to inspect committed local history without using GitHub, exposing credentials, enabling network access, or weakening the read-only sandbox.CLAWSWEEPER_ALLOW_MERGE=1while repairing the autogenerated autofix-only PR fix(ci): package runtime resources in dist artifact openclaw#117144. The run was cancelled before execution could merge; the PR remains open and has no auto-merge request.repair_mode: autofix|automerge, migrate legacy existing jobs without losing their maintainer instructions, follow explicit maintainer mode changes, restore missing jobs as repair-only by default, reject unknown repair modes, strip merge permission from autofix jobs inside the worker, and capture workflow gates through a fail-closed helper.clawsweeper:automergelabel. Recheck mode and labels on the execution runner and immediately before merge. Replacement and execution-time fallback PRs are never merged by post-flight: leave them open for a fresh current-head ClawSweeper review. Compare labels case-insensitively and rejectsecurity,beta-blocker,release-blocker,maintainer,clawsweeper:autofix,clawsweeper:autogenerated,clawsweeper:human-review,clawsweeper:manual-only,clawsweeper:merge-ready, and every ClawSweeper security/maintainer/product-review advisory label.automerge-*.mdjobs can enter explicit live-label authorization, and issue/self-heal/unknown jobs are always repair-only without a GitHub lookup. Preserve LF and legacy CRLF frontmatter, quoted YAML values, authorized live-label automerge job restoration, and clean skips for stale archived dispatches. Reject duplicate mode declarations and unsafe item numbers, and retain the exact original audit/dashboard Markdown formatting so operational health sections remain recoverable.gpt-5.6-solwithxhighreasoning.Current-head real runtime proof
Executed the real built package command
pnpm run local-reviewagainst a fresh two-commit Git checkout, then called the actual built full local-range review entrypoint against the same checkout. A sentinelghexecutable would fail and record any network access; the spawned reviewer received intentionally planted GitHub tokens so credential isolation could be observed directly. Then executed the actual workflow merge-gate shell script against jobs rendered by the production comment router, starting from the same unsafeCLAWSWEEPER_ALLOW_MERGE=1observed in production; replayed paused and unauthorized service PR labels; migrated a real legacy rendered job; rendered and parsed production audit health markers; and invoked the shared production target resolver for both the source issue and generated PR.{"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,"unknownRepairJobMergeAllowed":false,"explicitServiceAutomergeAllowed":true,"crlfServiceAutomergeAllowed":true,"quotedYamlServiceAutomergeAllowed":true,"missingArchivedRepairSkipped":true,"authorizedServiceRepairRestored":true,"pausedServiceMergeAllowed":false,"maintainerReadyMergeAllowed":false,"protectedServiceMergeAllowed":false,"crlfProtectedServiceMergeAllowed":false,"advisoryServiceMergeAllowed":false,"unauthorizedServiceMergeAllowed":false,"legacyRepairModeMigrated":true,"legacyFlatJobsSupported":true,"auditMarkersRoundTrip":true,"issueRecordScope":"openclaw-openclaw#98276","autofixRecordScope":"openclaw-openclaw#117144","selfHealRecordScope":"openclaw-openclaw#117144","singleItemHydration":true,"postFlightAutofixMergeAllowed":false,"postFlightLatePauseMergeAllowed":false,"postFlightExplicitServiceAutomergeAllowed":true,"replacementCanonicalSourceBound":true,"replacementPrAutoMergeAllowed":false,"fallbackReplacementAutoMergeAllowed":false,"maintainerAuthorizationRefreshed":true}This is an executable production-path replay: the generated OpenClaw autofix job is denied merge authority without a GitHub lookup, an explicitly authorized ClawSweeper-service automerge job retains merge authority after a live-label check, paused or unauthorized PRs fail closed, and both repair jobs target one canonical Worker record rather than downloading the entire repository.
Validation
main.pnpm run checkpassed independently on an AWS Crabbox runner: 2,902 tests, 2,894 passed, zero failed, eight expected skips; lint, static checks, format, sparse-checkout validation, and coverage gates all passed.pnpm run build:allpassed.pnpm run check:staticpassed, including active-surface, dashboard-boundary, automation-limit, and full-tree formatting checks.pnpm run lintpassed for source, repair, dashboard, and scripts/tests.node /tmp/clawsweeper-focused-modules-proof.mjs.dlsym(..., capset): symbol not found); full Linux CI remains the final platform-appropriate gate.mainbase: clean; 171 additional focused tests plus real approval-persistence, resume-persistence, and completed-verdict source-drift end-to-end scenarios passed, with no actionable findings.[P1] Deny merge for unrecognized job filenamesfinding. The execution gate now starts withallow_merge=0and authorizes only an existingautomerge-*.mdjob after explicit mode and live-label checks; production-path proof and regression cases cover inbox, legacy flat, and stuck-outbox unknown filenames without invoking GitHub./reviewconfirmed that unknown job filenames fail closed, explicitly authorized automerge still works, and legacy issue/self-heal compatibility remains intact; all nine focused workflow-security tests passed./reviewinspected the new child commit against the already-reviewed parent and PR base, passed all nine focused security tests, and independently exercised the real execution script across authorized automerge, disabled-request, autofix, issue, self-heal, and unknown filename cases; no actionable findings remained.[P1] Normalize CRLF before parsing repair-job frontmattercompatibility finding. Both authorization-frontmatter parsers now normalize a terminal carriage return before matching boundaries or fields; production-path proof and focused tests show authorized legacy CRLF automerge remains enabled while protected CRLF jobs still fail closed./reviewverified the CRLF finding fix: authorized legacy CRLF automerge succeeds, protected CRLF jobs and unknown filenames remain fail-closed, LF behavior is unchanged, and all nine focused workflow-security tests pass./reviewverified both CRLF-normalizing AWK parsers against the already-reviewed parent and PR base; authorized/protected labels and unknown-job merge restrictions remained correct, with all nine workflow-security tests passing and no actionable findings.