Repository navigation
fix(repair): route repair, automerge and intake lanes on typed fields, not prose - #1775
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThe branch routes repair, automerge, issue intake and worker execution using structured fields instead of interpreting explanatory prose. Example: An operator reads a response with hold=proof and reason “Security wording in a proof review.”
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR remains useful on current main, and no actionable patch defect was found. The recorded routing decisions preserve independent final-action gates. Priority: P2 Before mergeNone. FindingsNone. Provenance
Agent review detailsHow this fits togetherClawSweeper turns model reviews and authorized operator commands into repair jobs, human pauses and guarded GitHub actions. These changes affect the routing between those inputs and the final action checks. flowchart TD
A[Model review report] --> B[Typed verdict producer]
B --> C[Comment router]
D[Authorized operator command] --> C
C --> E[Human pause]
C --> F[Repair and intake workers]
C --> G[Final action checks]
F --> G
G --> H[Guarded GitHub actions]
Technical reviewBest possible solution: Keep model judgments authoritative through typed producer fields while retaining authorization, freshness and final-action checks. Do we have a high-confidence way to reproduce the issue? Yes, from source: base routing chooses approval and guidance from English phrases, allowing equivalent review decisions to route differently with different wording. This read-only review did not execute target code. Is this the best way to solve the issue? Yes: producer-owned fields remove competing semantic decisions while preserving structural validation and independent final-action gates. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e4c173aeed28. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 8, 2026, 8:04 PM ET / October 9, 2026, 00:04 UTC (Revision 2). |
…mes, replacement-bound superseded closes
97f4d95 to
f3b5a93
Compare
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
What
Repair, automerge, issue-implementation intake, and repair-worker validator/executor lanes now route on typed fields. They no longer match English prose written by the review model, the Codex repair worker, or ClawSweeper itself. (Pre-model selection for spam, gitcrawl and PR intake is in a separate PR.)
Producer change: a small typed attribute. Every PR
needs-humanverdict marker now carrieshold=<cause> findings=<count>. The producer issrc/clawsweeper-review-comment-automation.ts; theNeedsHumanHoldtype is insrc/review-comment-markers.ts.holdnames the producer branch:normalization_failed,review_identity,maintainer_decision,review_failed,security,proof,not_opted_in(the review is ready but the PR has no repair-loop label),blocked, orundecided.maintainer_decisionandproofare set only when that hold is the single Before-merge item. Otherwise the hold isblocked, and a decision that also has security attention issecurity.findingsis the typed review-finding count. It is 0 for failed or unnormalized reviews.Removed judges and their typed replacements:
comment-router-core.tsisCanonicalLandingNeedsHumanTextandmissingProofNeedsHumanReason(prose: "no repair lane is needed", "land … canonical", "missing … proof") →needsHumanHoldAllowsAutomergeOptIn({hold, findings, liveVerification}). Callers:classifyNeedsHuman)@clawsweeper approve(classifyMaintainerApprovedAutomerge)maintainerApprovalAppliesToExactHeadReview)approvedMissingProofNeedsHuman), whose description note is now keyed onhold=proofexecute-fix-artifact.tsmaintainerApprovedNeedsHumanComment), which now parses the marker instead of running a regex over the body.trustedCommentHasPriorityFinding([P0-3]token in the Findings prose) → thefindings>0attribute. The verdict-less "comment has P findings → repair" fallback is deleted.humanReviewJustificationandhumanReviewNextAction(keyword wording pickers) →humanReviewGuidance(hold).issueImplementationBlockerClassandisHardIssueImplementationBlocker(regex over ClawSweeper blocker strings) → the code that writes each blocker sets its class:blockHardin the intake, andissue_implementation_blocker_classon router refusals.comment-router.tsissueImplementationSecuritySignal(keyword grep of the issue title and body) →hasSecuritySignal, which checks explicit labels, ClawSweeper markers and CVE/GHSA IDs.issue-implementation-intake.tssecuritySensitiveTextfallback andliveSecuritySensitiveText→ the typedSecurity ReviewStatus:line only. A missing or unknown status fails closed as a hard blocker.finalize-open-prs.tsisSecurityRoutedActionreason regex →route_securityorclassification === "security_sensitive".review-results.ts: the needs_human security reason regex,isFixFirstBlockedCloseAction,isUnavailableNeedsHumanAction,allowsSelfCanonicalCurrentMainCloseout,allowsHistoricalCanonicalForCloseout, the codex_review evidence/reviewregex and the closeout credit regex → typed action, status, classification and candidate refs, plus presence in the preflight item list. The applicator gates do not change: blocked closes are not executed, andfixed_by_candidatestill requirescandidate_fix.apply-result.tsnormalizeClassification(substring matching over classification, close_reason and reason) → the typed classification, or else a fixed action→classification table. An unknown value fails closed. The covering-PR label checks now use exact policy constants (PROOF_SUFFICIENT_LABEL,PROOF_OVERRIDE_LABEL, theneeds_proofstatus label, the F rating label) instead of regex or substring matches.execute-fix-validation.tsfeatureSignalkeyword regex and the docs/config/tests/src path-role rules → count caps only: 8likely_filesand 4affected_surfaces, configurable by env.execute-fix-artifact.tsexecutableReplacementFixArtifact/shouldPromoteNeedsHumanReplacement(a regex over worker prose that promotedneeds_humantoreplace_uneditable_branch) → the worker's typedrepair_strategyis final.execute-fix-github.tssupersededReplacementSources(regex overbranch_update_blockersprose) → the first same-repo source PR, plus each source whoseclose_supersededaction names no other fix or canonical PR.prompts/repair/autonomous.mdandsrc/repair/run-worker.tsnow say what the typed fields must carry instead of which words to write. Only the repair-worker prompt changed, soREVIEW_POLICY_VERSIONis not bumped; a bump would invalidate every stored review.Test fixture:
scripts/e2e/implementation-backfill.mjsreports now carry the## Security Reviewsection that the renderer always writes. Docs:docs/pr-review-comments.md(marker attributes) anddocs/repair/auto-update-prs.md(approval rule). Changelog:changelog.d/repair-lanes-typed-routing.md.Why
Maintainer rule (LLM systems): code must not judge LLM work with regex or keyword classifiers. The model judges; code validates structure and enforces hard boundaries. This PR covers these code-judge inventory items from Batch D:
isCanonicalLandingNeedsHumanText/missingProofNeedsHumanReason(core ~826–844)trustedCommentHasPriorityFinding(core ~2363)humanReviewJustification/humanReviewNextAction(core ~3352)issueImplementationSecuritySignal/securitySensitiveText(router ~3062, intake ~1439)Proof
Live comments with legacy markers. I built main (c48313d) and this branch. I sent the 8 real ClawSweeper review comments in
/tmp/rules-slice/c*.mdthroughparseTrustedAutomationandmaintainerAutomergeOptInApprovesNeedsHumanon both builds. All 8 got the same intent (7clawsweeper_needs_human, 1clawsweeper_auto_repair), and opt-in approval wasfalseon both. Legacy needs-human comments stay paused.Saved real reports. I rendered
prompt-rest,prompt-lean,prompt-dumpandasync-proof/{base,branch}with both builds. The intent did not change. The branch marker adds the typed cause:hold=review_identity findings=0as saved, andhold=normalization_failed findings=0when given a lease identity (these older reports do not normalize on current main).Tests for consumer-visible behavior:
blockedholds are never waived. Legacy markers fail closed.not_opted_in,blocked,proofandmaintainer_decision. A decision plus another blocker givesblocked. A decision with security attention givessecurity.pnpm run check(once, on the rebased head): static checks, format, build:all and lint all passed. The changed-coverage test run had 6,953 passes and 2 failures in files this PR does not touch. Both pass in isolation:test/review-git-acquisition.test.ts(the known unshallow lock flake) andtest/apply-runtime-budget.test.ts(a 14.6 s hung-command timeout under load). An earlier run found one real break,scripts/e2e/implementation-backfill.mjsreports with no Security Review section, which now fail closed. I fixed it by giving the fixture the typedStatus: not_applicablethat real reports always render.Production automerge e2e (
node scripts/e2e/automerge-container.mjs --scenario all --fixture all, Docker): all 28 scenarios pass on both fixtures.node scripts/e2e/endor-automerge.mjspasses too. The first CI run failedapprove-intent-persistencefor two reasons. (1) The router command builder incomment-router.tscopied a fixed list of fields and droppedneeds_human_hold/review_findings, so every opt-in approval failed closed. (2) The e2e fixture still emitted a legacy prose-only marker. Both are fixed.Needs maintainer call
None open. The decisions taken in review are listed under Merge Danger.
Codex review dispositions
hold=proofonly when proof is the single blocker.findings=0for those reviews.@clawsweeper approvecaller still passedreason. Fix: it passes the typed hold and findings.close_supersedednamed a differentcandidate_fix. Fix: only closes with no candidate or canonical ref are bound to the replacement. Test added and prompt clarified.test/pr-proof-automation.test.ts, where I kept main's new N/A-proof expectation and rewrote the proof-hold test to use real mock-only proof.Merge Danger
@clawsweeper approvewaiveshold=not_opted_in,hold=maintainer_decisionandhold=proofwhenfindings=0.maintainer_decisionandproofare set only when that hold is the one Before-merge item; otherwise the hold isblocked, which cannot be waived.hold=securityand the integrity holds (review_identity,normalization_failed,review_failed) are never waived.apply-result.ts.blockedno longer auto-approves on opt-in.needs_humanrepair strategies to replacement PRs.credit_notes.