Skip to content

feat(loop): execution-grounded Max-Mode candidate selection (ADR 0064)#59

Merged
mabry1985 merged 1 commit into
mainfrom
execution-grounded-candidate-select
Jun 30, 2026
Merged

feat(loop): execution-grounded Max-Mode candidate selection (ADR 0064)#59
mabry1985 merged 1 commit into
mainfrom
execution-grounded-candidate-select

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

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_candidates picks 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_candidates then only:

  • breaks ties among the passing set (quality among the correct), or
  • decides when no gate is configured, or when none pass (judge the diffs, as before).

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_cmd are the verifier substrate (board candidates are worktree diffs, not module strings), so it realizes ADR 0064's principle natively rather than calling protoAgent's coder_solve.

Tests

_select_candidate + _candidate_diff_indices; _dispatch_max_mode calls 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

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>
@protoquinn

protoquinn Bot commented Jun 30, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@mabry1985 mabry1985 merged commit 416c88b into main Jun 30, 2026
1 check passed
@mabry1985 mabry1985 deleted the execution-grounded-candidate-select branch June 30, 2026 07:59

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_candidate in loop.py: execution-grounded selection — prefers candidates whose local_gate_cmd actually 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_candidates preserving exact existing behavior.
  • New _candidate_diff_indices helper: 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_mode updated: _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_indices calls stage_all on 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_gate is gathered concurrently — if a gate hangs, all candidates wait. The existing coder_timeout watchdog may cover this, but worth confirming _run_local_gate has its own timeout.
  • INFO: Index remapping in the tie-break path (passing[j]) is correct — _judge_candidates returns an index into the sublist, and passing[j] recovers the original worktree index.

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jun 30, 2026

Copy link
Copy Markdown

Submitted COMMENT review on protoLabsAI/projectBoard-plugin#59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant