Repository navigation
refactor: split review orchestration and unblock safe repair validation - #1000
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 1, 2026, 7:30 AM ET / 11:30 UTC. ClawSweeper reviewWhat this changesThis PR extracts ClawSweeper’s review planning, execution, status/context, close-decision, metadata, related-item, and review-comment workflows into focused modules, while accepting safe trusted validation gates and correcting Linux child-process containment accounting. Merge readinessThis PR remains necessary: current main lacks both the trusted validation-hint handling and the corrected containment accounting. The updated body includes current-head runtime output for the affected paths, and the focused diff adds regression coverage; no discrete correctness defect surfaced. Wait for the two current workflow checks before landing. Likely related people: Peter Steinberger (high confidence) for recent repair-validation and review-orchestration work; Martin Cleary (high confidence) for the original containment supervisor. Priority: P2 Review scores
Verification
How this fits togetherClawSweeper’s review lane gathers GitHub context, asks Codex for a proposal, and records or presents a decision; its repair lane validates generated fixes inside a contained process before it can create a replacement PR. This change reorganizes the review orchestration while preserving its external entrypoint and adjusts the repair validation path that feeds automated issue-fix workers. flowchart LR
A[GitHub items and PR state] --> B[Review planning]
B --> C[Review runtime]
C --> D[Decision and report workflows]
D --> E[Review comments and labels]
F[Generated repair artifact] --> G[Trusted validation selection]
G --> H[Linux process containment]
H --> I[Create-only repair PR]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the focused safety fixes and module extraction only after the current-head required checks complete successfully, preserving the existing external entrypoint and PR-create-only repair boundary. Do we have a high-confidence way to reproduce the issue? Yes. The PR body provides current-head terminal output for the actual containment and local-review paths, and the added tests encode the formatter-hint and adopted-child cases against the real implementation. Is this the best way to solve the issue? Yes. Extracting focused workflows while preserving the public entrypoint is a maintainable way to reduce orchestration complexity; the validation filter remains narrow and keeps unsafe or uncovered commands fail-closed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 1c9cb5dc6dd2. 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)
|
…on (openclaw#1000) * refactor: split review orchestration and unblock safe repair validation * fix: preserve fail-closed validation process and command guards --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
report metadata, related-item context, and review-comment/lease workflows out of the main
ClawSweeper entrypoint.
src/clawsweeper.tsdrops from 19,923 to 14,216 lines in thischange (down from roughly 32,347 lines before the ongoing decomposition), while all 184
existing public exports remain available.
pnpm format <files>validation hints: discard only those narrow mutating hints when atrusted changed-file gate or replacement validation is already present; retain fail-closed
rejection without trusted coverage and for shell injection or explicit write flags.
manager helpers as background processes. Still reject genuinely surviving detached children.
pnpm run local-review/--local-range, credential scrubbing,read-only model execution, explicit service-only merge authorization, and create-only
generated OpenClaw/autofix/replacement PRs.
Real behavior evidence
Current reviewed head:
c5279a11f2ef039046bdab0506ffcab28743821f.Actual embedded Linux containment runtime output (the production Python supervisor is
imported directly; the three scenarios exercise its real child-reaping function):
{"containment":[{"scenario":"transient_helper_before_primary_exit","background_processes":0},{"scenario":"helper_outlived_primary_between_polls","background_processes":1},{"scenario":"still_running_background_helper","background_processes":1}],"selectedCommands":["pnpm check:changed"],"rejectedUnsafeCommands":4}This proves short-lived pre-exit helpers are accepted, descendants that outlive their primary
remain fail-closed, the real formatter hint resolves to
pnpm check:changed, and newline,carriage-return, tab, and write-flag command injection are rejected.
Actual
pnpm run local-reviewcurrent-head package-command output (normal review plus--local-range, using an isolated checkout and fake Codex executable):{"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,"postFlightAutofixMergeAllowed":false,"replacementPrAutoMergeAllowed":false,"fallbackReplacementAutoMergeAllowed":false}Production issue worker https://github.com/openclaw/clawsweeper/actions/runs/30695663337
repeatedly failed with
unsafe validation command: pnpm format extensions/active-memory/....The new regression reproduces that exact model hint and proves the trusted
pnpm check:changedgate executes instead.Production OpenClaw PR repair https://github.com/openclaw/clawsweeper/actions/runs/30695391258
produced an execution artifact reporting
validation command left 1 background process(es) after exit. The new containment regressions distinguish a successfully reaped child,an already-reaped child, and a genuinely surviving child.
The actual
pnpm run local-reviewpackage command succeeds on both a normal local review and--local-rangeagainst a disposable repository with zero GitHub calls, zero leakedcredentials, web search disabled, and a read-only sandbox.
Live gate proof confirms generated autofix, legacy issue/autofix, unknown repair, and
replacement PRs cannot merge; only explicitly authorized ClawSweeper-service automerge can.
All 184 historical
dist/clawsweeper.jsexports remain present after extraction.Validation
pnpm run build:allpnpm run lint:srcpnpm run lint:repairpnpm run lint:scriptspnpm run check:active-surfacepnpm run check:limitsnode --test test/clawsweeper.test.ts test/clawsweeper-action-ledger.test.tsnode --test test/repair/process-tree-containment.test.ts test/repair/target-validation.test.tsnode --test test/repair/cluster-workflow-security.test.ts test/repair/comment-router-core.test.ts test/repair/issue-implementation-intake.test.ts/reviewon the uncommitted change and again on the committed branch.Generated OpenClaw issue-fix workers continue to use
gpt-5.6-solwithxhighreasoning andremain strictly PR-create-only (
CLAWSWEEPER_ALLOW_MERGE=0).