Repository navigation
Description
Problem or Motivation
A bot PR gets the ready mark when its checks pass. No reviewer looks at the diff against the issue, the plan and the project rules. #3049 planned a devops review call inside the implement job, with a repair round for high findings. #2867 planned a model evaluator that marks a draft ready. D7 of the approved pipeline split design (tracker #5482) replaces both with one review unit. The review unit posts a COMMENT review and never approves. Watch reads its verdict as a draft reason only after E4.
Proposed Solution & Architectural Design
- A unit runs
devops reviewon each ready delivery PR head that has noreview.headequal to that head. Event:ready_for_review. Semaphoreagent. At most 3 rounds for each PR. - It also checks plan conformance: each task is ticked, and each acceptance criterion of the issue has a change or a test.
- It posts a COMMENT review and writes
review.{head, round, verdict}in the record. It never approves. Only a person merges. - Watch reads a failed verdict as a draft reason only after E4 (feat(roadmap): measure the precision of the review unit on 30 PRs #5522) shows 80 % precision or more on 30 PRs. Until then, the unit runs in shadow.
- The review spend is one model correlation for each ready PR head (ADR 0005: tools find the issues, the model correlates).
- The unit writes the job result line of feat(review): each review session writes a job result line #5170.
Target Subsystem
Roadmap Service and roadmap jobs (src/devops_cli/roadmap/, src/devops_cli/review/).
Acceptance Criteria
- Test first: a diff with a seeded high-severity finding gives a failed verdict and a COMMENT review, and no approval. The test fails on the base.
- A test: a head that has a
review.headrecord gets no second review. - A test: the fourth round of one PR is refused.
- Live proof: after the merge and the release, the unit runs as the App in shadow on the ready delivery PRs of 14 days. A comment on this issue gives the result lines and the verdicts.
Existing Tool Considered
devops review (ADR 0005) and the GitHub pull request reviews API (event COMMENT) cover the need. A review check run is deferred until E4. Build: 300,000 to 500,000 agent tokens and 1 day.
Related
Tracker #5482, Phase 7. Depends on #5024 and #5170. It replaces #3049 and #2867. #5522, #5505.
Source: #5482
Alternatives check of 2026-11-30: in-use.
The repository already uses this tool.
Tool: dan-petty/devops-cli (https://github.com/dan-petty/devops-cli), MIT, last activity 2026-12-01, maintained.
Reason: Searches found no separate open tool. The project's own devops-cli already runs the devops roadmap step review with the review record and job result line. The ready trigger, COMMENT review writer, plan conformance check and shadow mode are missing.
Covers:
- Runs the existing review step with one model correlation
- Item job record holds review key, rounds and verdict
- Writes one job result line for each attempt
Lacks:
- No ready_for_review trigger under the agent semaphore
- No pull request review writer with event COMMENT
- No deterministic plan conformance check
- No shadow mode of roadmap.review.mode
Proposed design
Problem statement
Add one review unit for each ready delivery pull request, and keep it in shadow until E4 measures it. A ready bot pull request gets only its checks, and no review compares its diff with the issue, the plan and the project rules. The unit runs the existing devops roadmap step review, checks plan conformance, posts a COMMENT review, records the verdict, and never approves. Only a person merges. The 14-day live proof is a person step after the merge.
Acceptance criteria
Requirement: Ready event starts one review
The review unit SHALL run devops roadmap step review once for a ready delivery pull request head and issue text that review.key does not name.
Scenario: New ready head
- WHEN A
pull_requestready_for_reviewevent names a delivery pull request whose head and issue textreview.keydoes not name. - THEN The unit runs one review under the
agentsemaphore, writesreview.pull,review.head,review.key,review.roundsandreview.verdictin the item job record, and posts one COMMENT review.
Requirement: COMMENT review writer
The review unit SHALL post one pull request review with event COMMENT and SHALL NOT send an APPROVE review.
Scenario: Post the review
- WHEN The unit posts the review for a judged head.
- THEN The GitHub client sends one
POST /repos/{owner}/{repo}/pulls/{n}/reviewswithevent=COMMENTand sends no request withevent=APPROVE.
Requirement: No second review for the same head
The review unit SHALL NOT review again a head and issue text that review.key names, when no new fact changed.
Scenario: Repeated ready event
- WHEN A second
ready_for_reviewevent names a head and issue text thatreview.keyalready names, with no new fact. - THEN The unit makes no model call, posts no second COMMENT review, and leaves
review.roundsunchanged.
Requirement: Round cap
The review unit SHALL refuse a review when review.rounds for the pull request reaches roadmap.review.rounds, 3 by default.
Scenario: Fourth round
- WHEN A delivery pull request holds
review.roundsequal to 3 and a new head has no matchingreview.key. - THEN The unit returns
capped, posts one comment for a person, makes no model call, and writes no new round.
Requirement: High finding fails the review
The review unit MUST give needs fix, post a COMMENT review and send no APPROVE review for a high-severity finding.
Scenario: Seeded high finding
- WHEN A test diff holds a seeded high-severity finding and the unit runs the review.
- THEN The test fails on the base commit; with the unit the verdict is
needs fix, the review is a COMMENT review, and the client sends no APPROVE review.
Requirement: Plan conformance tasks
The review unit SHALL fail plan conformance when a task in the change tasks.md is not ticked.
Scenario: Unticked task
- WHEN The change
tasks.mdhas an unticked task and the unit runs plan conformance. - THEN Plan conformance returns failed, the verdict is
needs fix, and the COMMENT review names the unticked task.
Requirement: Plan conformance criteria
The review unit SHALL fail plan conformance when an acceptance criterion of the issue has no requirement in the change spec delta that quotes its text and no test file in the pull request diff that names the criterion.
Scenario: Unmapped criterion
- WHEN An acceptance criterion of the issue has no requirement in the change spec delta that quotes its text, and the pull request diff holds no test file that names the criterion.
- THEN Plan conformance returns failed, the verdict is
needs fix, and the COMMENT review names the unmapped criterion.
Requirement: Shadow mode
The review unit SHALL post its COMMENT review and write its verdict in the shadow mode of roadmap.review.mode without changing draft readiness.
Scenario: Shadow failed verdict
- WHEN The unit runs in the mode
shadowand writes aneeds fixverdict. - THEN The unit posts the COMMENT review, writes the verdict and no verdict label, and the draft or ready state of the pull request stays unchanged.
Requirement: Job result line
The review unit SHALL write one job result line through log_job_result with the job review for each judged or failed attempt.
Scenario: Result line for one head
- WHEN The unit completes a review attempt for one pull request head.
- THEN One JSON result line names the job
review, the item, the round, the verdict and the model call count.
Requirement: One model correlation for each head
The review unit SHALL make at most one model correlation call for each head and issue text.
Scenario: Model call count
- WHEN The unit reviews one new head and issue text with the model.
- THEN The unit makes one model call for that head and issue text and no second call for the same pair.
Requirement: Pending a person after the merge
After the merge and the release, the owner SHALL observe the unit in shadow on the ready delivery pull requests for 14 days and record the result.
Scenario: Shadow observation
- WHEN After the merge and the release, the unit runs as the App in shadow on the ready delivery pull requests for 14 days.
- THEN A comment on the issue gives the result lines and the verdicts.
Existing Tool Considered
The alternatives check of 2026-11-23 in the issue body records in-use for dan-petty/devops-cli (MIT, maintained); that block is the source for what the tool covers and lacks. The unit uses the existing devops roadmap step review and adds the missing parts: a ready_for_review trigger under the agent semaphore, a pull request review writer with event COMMENT, the plan conformance check, and the shadow mode. The issue estimates 300,000 to 500,000 agent tokens and 1 day for the missing unit.
Key questions
- How does the unit start on a ready delivery pull request?: The Service subscribes to the
pull_requestready_for_reviewevent and runs the review unit for that event under theagentsemaphore. The unit callsdevops roadmap step reviewfor the head. (best practice) [sources: src/devops_cli/roadmap/run.py, src/devops_cli/roadmap/steps/review.py, CONTEXT.md]- Chosen: Webhook event under the
agentsemaphore. The Service already routes subscribed events, and the semaphore keeps the model work bounded. - Rejected: Polling row of the Service. A poll reads every open pull request and reviews a ready head later than the event.
- Chosen: Webhook event under the
- How does the unit post the review?: The unit posts a pull request review with event COMMENT through a new client method for
POST /repos/{owner}/{repo}/pulls/{n}/reviews. The existingcomment_on_pullwrites an issue comment, so the review writer is new. The unit sends no APPROVE event. (best practice) [sources: src/devops_cli/github/client.py:676, src/devops_cli/roadmap/steps/comment.py]- Chosen: Pull request reviews API with event COMMENT. The issue asks for a COMMENT review, and the reviews API is the only way to post a review.
- Rejected: An issue comment on the pull request.
comment_on_pullwrites an issue comment, not a review. - Rejected: An APPROVE review. An approval would make the bot a merge gate; only a person merges.
- Where does the unit keep the reviewed head, round and verdict?: It keeps
review.pull,review.head,review.key,review.roundsandreview.verdictin the item job record, the hidden block at the end of the issue body. The record holds the state across reruns; the COMMENT review is the visible result. (best practice) [sources: src/devops_cli/roadmap/steps/review.py, src/devops_cli/roadmap/stores/store.py, CONTEXT.md]- Chosen: Item job record in the issue body. The existing review step records
review.pull,review.key,review.roundsandreview.verdictthere. - Rejected: Pull request review body. A review body is not durable state and cannot stop a second review.
- Rejected: A label. A label cannot hold a head SHA, a round and a verdict.
- Chosen: Item job record in the issue body. The existing review step records
- Which record key stops a second review for the same head?: The unit keeps
review.key, the existing value<pull>:<head>:<text hash>. A changed issue text on the same head is a new fact and gets a new review. The unit also writesreview.headfor the issue's record. (best practice) [sources: src/devops_cli/roadmap/steps/review.py]- Chosen: Keep
review.keyand addreview.head. The step already keys the model call by pull request, head and issue-text hash, so a changed text is judged again. - Rejected: Use a bare
review.headonly. A head alone would suppress the review of a head whose issue text changed.
- Chosen: Keep
- How does the unit count the 3-round cap?: It reuses
review.roundswithreview.pull. The unit increments the count only when it writes a verdict. The cap isroadmap.review.rounds, 3 by default. A repeated event for the same head and issue text writes no verdict and spends no round. At the cap the unit returnscapped, posts one comment for a person and makes no model call. (best practice) [sources: src/devops_cli/roadmap/steps/review.py]- Chosen: Reuse
review.roundsandroadmap.review.rounds. The step already counts the verdicts of one pull request and caps them at the setting. - Rejected: Count one round for each event. A repeated event would spend a round and could refuse a valid new head.
- Rejected: Add a second counter. A second counter would drift from the count that the step's cap reads.
- Chosen: Reuse
- How does plan conformance decide that each task is ticked and each acceptance criterion has a change or a test?: The check is deterministic. The unit fails when the change
tasks.mdhas an unticked task. The unit also fails when an acceptance criterion of the issue has no requirement in the change spec delta that quotes its text and no test file in the pull request diff that names the criterion. The COMMENT review names the missing task or criterion. (best practice) [sources: src/devops_cli/roadmap/steps/review.py, src/devops_cli/roadmap/steps/ready.py, src/devops_cli/roadmap/steps/review_facts.py]- Chosen: Deterministic check of
tasks.md, the spec delta and the diff test files. The check is repeatable and names the missing item. - Rejected: Ask the model to judge each criterion. A model verdict is not repeatable and cannot show a missing task tick or test file.
- Chosen: Deterministic check of
- How does a high-severity finding decide the verdict?: The unit uses the existing review facts and adds a rule: a high-severity finding gives
needs fixbefore the model call. The evidence names the finding. The model still correlates the other facts. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, src/devops_cli/roadmap/steps/review.py, src/devops_cli/roadmap/steps/review_facts.py]- Chosen: A rule on the high-severity finding before the model. The finding is a tool fact, and the rule makes the verdict repeatable.
- Rejected: Let the model weigh the finding. The same finding would get different verdicts across runs.
- What is shadow mode?: It is the
shadowmode ofroadmap.review.mode. The unit reads the facts, asks the model, posts the COMMENT review and writes the record, but writes no verdict label and changes no draft or ready state. The modeonwrites the label and takes the next action; the modeoffsends no request. (best practice) [sources: src/devops_cli/roadmap/steps/review.py, CONTEXT.md]- Chosen: The
shadowmode ofroadmap.review.mode. One setting decides the step's behavior, andshadowisonwithout the label write and the next action. - Rejected: A separate boolean setting. A second setting allows contradictory states.
- Rejected: Reuse the mode
off.offsends no request, so it posts no COMMENT review and records no verdict.
- Chosen: The
- Does the unit approve or merge a pull request?: No. The unit posts a COMMENT review only and sends no APPROVE event. A
mergeableverdict marks a draft ready for review in the modeon, and only a person merges. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/steps/review.py]- Chosen: COMMENT review only. CONTEXT.md says a person merges, and the issue says the unit never approves.
- Rejected: APPROVE review. An approval would make the bot a merge gate.
- How does the unit write the job result line?: It calls
log_job_resultwith the jobreviewfor each judged or failed attempt. The line holds the item, the round, the verdict and the model call count. The existing step logs one result line for each judged or failed attempt, and the unit keeps that call. [sources: src/devops_cli/roadmap/job_result.py:272, src/devops_cli/roadmap/steps/review.py]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
devops reviewon the diff before marking PR ready #3049, which may ask for the same change. The model namesRunning 'devops review' on each ready delivery PR, checking plan conformance, and posting findings in the PRas the change that both ask for.The candidate explicitly replaces #3049 and delivers the same result: 'devops review' on ready PRs with plan-conformance check and findings posted.A person closes one of the two if that is so.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: Web searches returned nothing usable on this niche need, but the project's own
devops review(ADR 0005) already produces tool-backed findings and a verdict on a diff; the roadmap unit around it, plan conformance, round cap and record writes do not exist.The repository already uses this tool.
Tool: dan-petty/devops-cli (https://github.com/dan-petty/devops-cli), MIT, last activity 2026-11-17, maintained.
Covers:
Lacks:
Searches (5)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Owner question: When does the unit leave shadow mode? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.