Skip to content

feat(loop): blocking review gate — adversarial findings gate the merge edge (v0.30.0)#70

Merged
mabry1985 merged 1 commit into
mainfrom
feat/blocking-review-gate
Jul 6, 2026
Merged

feat(loop): blocking review gate — adversarial findings gate the merge edge (v0.30.0)#70
mabry1985 merged 1 commit into
mainfrom
feat/blocking-review-gate

Conversation

@mabry1985

Copy link
Copy Markdown
Contributor

M5 of the codified-delivery-loop plan (protoAgent docs/plans/codified-delivery-loop.md). Turns review from advisory (review_dispatch) into a gate, mirroring the CI-bounce machinery it sits next to.

The loop

  1. After open_review, run the host's adversarial code-review workflow (protoAgent ADR 0077) on the PR — reached via runtime.state.STATE.workflow_run (published by the workflows plugin; no plugin import), with the configured a2a reviewer as the fallback runner.
  2. Parse the findings convention (graph.review.findings, lazy import). Blocking = severity blocker/major, verdict ≠ refuted.
  3. Blocking findings → stored on the bead (comment), injected into the retry prompt with the reviewed diff (the same carry-the-lesson levers as the CI bounce), label changes-requested, requeue. Bounded by review_fix_max (mirrors ci_fix_max; same-tier — findings are fixable, not a capability ceiling).
  4. Budget exhausted → flag_blocked ("needs human review"). Never a silent merge — and never a silent pass: an unrunnable gate leaves review-pending set and the PR reconcile retries it next poll; a host without the findings parser sends the gate loudly inert.

Sub-states & reconcile

  • Labels review-pending / changes-requested (managed by store.set_review_substate, one at a time, findings comment attached).
  • _reconcile_prs: finishes an interrupted gate (pending on an in_review PR), clears the bounce budget on MERGED/CLOSED, and logs a human-override merge (merged with changes-requested still set) instead of pretending it didn't happen.

Sequencing (ADR 0064)

The gate is one call post-open_review — when execution-grounded candidate selection lands on the board face, moving it after test-passing selection is a one-line move.

Config

review_gate (default false), review_workflow (code-review), review_fix_max (2). review_dispatch stays as the advisory alternative; the gate takes precedence when both are on.

Tests

7 new (test_loop.py): bounce carries findings into _build_prompt, clean/minor/refuted pass, exhaustion blocks without requeue, unrunnable leaves pending, config parse, PR-url parse. Full suite 289 passed, ruff clean. v0.30.0 lockstep.

🤖 Generated with Claude Code

…e edge (v0.30.0)

Turns review from advisory (review_dispatch) into a GATE (plan M5), mirroring
the CI-bounce machinery:

- After open_review, run the host's adversarial code-review workflow
  (ADR 0077, via runtime.state.STATE.workflow_run — no plugin import) on the
  PR; the configured a2a reviewer is the fallback runner. Parse the findings
  convention (graph.review.findings, imported lazily; absent → the gate goes
  inert loudly, never guesses at prose).
- Blocking findings (blocker/major, not refuted) → findings stored on the
  bead (_comment via set_review_substate), injected into the retry prompt
  with the reviewed diff (the same carry-the-lesson levers as the CI bounce),
  label changes-requested, requeue — bounded by review_fix_max (mirrors
  ci_fix_max, same-tier: findings are fixable, not a capability ceiling).
- Exhaustion → flag_blocked ('needs human review') — never a silent merge.
- Sub-states ride as labels: review-pending / changes-requested. The PR
  reconcile finishes an interrupted gate (review-pending on an in_review PR)
  and calls out a human-override merge (changes-requested still set).
- Call-site is a single method invocation post-open_review, so attaching it
  after ADR 0064's test-passing candidate selection is a one-line move.

Config: review_gate (default false), review_workflow (code-review),
review_fix_max (2). 7 new tests (bounce/budget/exhaustion/unrunnable/config/
url-parse); 289 passed; ruff clean.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@protoquinn

protoquinn Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

@mabry1985 mabry1985 merged commit 3132094 into main Jul 6, 2026
1 check failed
@mabry1985 mabry1985 deleted the feat/blocking-review-gate branch July 6, 2026 07:50

@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 #70 | feat(loop): blocking review gate — adversarial findings gate the merge edge (v0.30.0)

VERDICT: WARN (CI queued — non-terminal; approve-on-green policy promotes to APPROVED once test passes and no blocking threads remain)


CI Status

  • test: ⏳ queued

Diff Review

  • Adds _review_gate to loop.py (~140 lines): runs host's adversarial code-review workflow post-open_review, parses findings, bounces on blocker/major (bounded by review_fix_max), exhausts to flag_blocked — mirrors the CI bounce pattern faithfully.
  • _reconcile_prs gains resume logic for interrupted gates (in_review + review-pending) and cleanup/override-logging on MERGED/CLOSED.
  • New config: review_gate (default false — safe opt-in), review_workflow (code-review), review_fix_max (2).
  • _parse_pr_url regex helper extracts (pr_number, owner/name) from GitHub PR URLs — guarded for non-GitHub inputs.

Observations

  • LOW: clawpatch structural review returned zero findings — the gate reuses existing CI-bounce levers (_ci_feedback, _ci_prior_diff) and the pattern is consistent with the surrounding code.
  • LOW (Gap): diff truncated at 532 of 532 lines — store.py changes (labels, set_review_substate), config parsing, and test files not fully visible. PR description confirms 289 passing and 7 new tests.
  • INFO: CI test still queued — the approve-on-green policy will promote this review to APPROVED automatically once all checks settle terminal-green. No action needed from the author on this pass.

— Quinn, QA Engineer

@protoquinn

protoquinn Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

mabry1985 pushed a commit that referenced this pull request Jul 6, 2026
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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