feat(loop): execution-grounded Max-Mode candidate selection (ADR 0064)#59
Merged
Merged
Conversation
Max-Mode picked the winning candidate with an LLM judge of the diffs — the exact judge-of-code ceiling protoAgent ADR 0064 targets (a judge rewards plausible-looking code; only running it discriminates). New `_select_candidate`: when a pre-PR gate (`local_gate_cmd`) is configured, prefer candidates whose gate actually PASSES — run the candidates, don't just judge them. The existing `_judge_candidates` then only breaks ties among the PASSING set (quality among the correct), or decides when no gate is configured / none pass. With no gate, behavior is unchanged (straight to the judge). This is the board-side (P2) realization of protoAgent ADR 0064's coder: the board's own worktree + `local_gate_cmd` are the verifier substrate, so no cross-plugin import / substrate mismatch (board candidates are worktree diffs, not module strings). - `_select_candidate` + `_candidate_diff_indices`; `_dispatch_max_mode` calls it. - 5 tests (prefer passing gate; judge only among passing; fall back when none pass; no-gate uses judge + never runs the gate; None when no diff). 201 pass. - Version 0.24.0 → 0.25.0 (lockstep). Implements protoAgent#1440 P2. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
There was a problem hiding this comment.
QA Audit — PR #59 | feat(loop): execution-grounded Max-Mode candidate selection (ADR 0064)
VERDICT: WARN (non-blocking — CI still running)
CI Status
- test: queued
Diff Review
- New
_select_candidatein loop.py: execution-grounded selection — prefers candidates whoselocal_gate_cmdactually passes, delegating to the LLM judge only for tie-breaking, fallback, or when no gate is configured. Clean additive change; no-gate path is an early return to_judge_candidatespreserving exact existing behavior. - New
_candidate_diff_indiceshelper: best-effort cheap name-only diff check (stage_all + git diff --cached --name-only). Correctly used as a pre-filter before running the gate. _dispatch_max_modeupdated:_judge_candidates→_select_candidate. Docstring updated to reflect ADR 0064.- Version bump 0.24.0 → 0.25.0, README docs updated with execution-grounded config note.
Observations
- LOW: clawpatch structural review unavailable (HTTP 500 — repo not in cache). Manual review only; no cross-file bugs detected from diff.
- LOW:
_candidate_diff_indicescallsstage_allon every candidate worktree and never unstages. Harmless in practice (losers are reaped, winner is promoted), but a comment noting the intentional leak would help future readers. - LOW:
_run_local_gateis gathered concurrently — if a gate hangs, all candidates wait. The existingcoder_timeoutwatchdog may cover this, but worth confirming_run_local_gatehas its own timeout. - INFO: Index remapping in the tie-break path (
passing[j]) is correct —_judge_candidatesreturns an index into the sublist, andpassing[j]recovers the original worktree index.
— Quinn, QA Engineer
|
Submitted COMMENT review on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The board-side (P2) realization of protoAgent ADR 0064 (
coder: execution-grounded code-solve).Problem
Max-Mode (
max_mode_n > 1) builds a feature N ways in parallel, then_judge_candidatespicks the winner with an LLM judge of the diffs ("Which candidate best satisfies the acceptance criteria? Reply with the number"). That's the exact judge-of-code ceiling ADR 0064 targets — a judge rewards plausible-looking code and can't catch subtle wrongness; only running the candidates discriminates.Change
New
_select_candidate: when a pre-PR gate (local_gate_cmd) is configured, prefer candidates whose gate actually passes — run the candidates, don't just judge them. The existing_judge_candidatesthen only:With no
local_gate_cmd, behavior is unchanged (straight to the judge) — so this is purely additive and opt-in via the gate you already configure.No cross-plugin import / substrate mismatch: the board's own worktree +
local_gate_cmdare the verifier substrate (board candidates are worktree diffs, not module strings), so it realizes ADR 0064's principle natively rather than calling protoAgent'scoder_solve.Tests
_select_candidate+_candidate_diff_indices;_dispatch_max_modecalls it. 5 new tests (prefer passing gate; judge only among passing; fall back when none pass; no-gate uses judge and never runs the gate; None when no diff). 201 pass, ruff check + format clean. Version 0.24.0 → 0.25.0 (lockstep).Implements protoLabsAI/protoAgent#1440 P2.
🤖 Generated with Claude Code