Skip to content

feat(roadmap): Run devops review on the diff before marking PR ready #3049

Closed as not planned

Description

@dan-petty

What happened

The job marks a pull request ready when the checks pass. No reviewer looks at the diff against the issue, the plan and the project rules. The draft evaluator (#2867) is planned, but the review tools the project already has are not used by the job.

What should happen

  • After the last group, the job runs devops review on the diff and a plan-conformance check (every task ticked, every criterion delivered). Findings of a high severity go back as a repair round. Remaining findings are posted in the PR comment.
  • This is the seam that feat(roadmap): Add a draft PR evaluator for issue and rules #2867 uses for its model verdict.

Acceptance criteria

  • A diff with a seeded high-severity finding is repaired or blocks the ready mark in a replay test.
  • The PR comment lists the review findings with their disposition.
  • The review call budget per item is stated and enforced.
  • The ready mark waits for both the checks and the review.

Related: tracker for this set (filed with it), #2908 (issue workflow), #2867 (draft PR evaluator), #3005 (task kind), #3010 to #3015 (plan gates), #2919 (stuck-item metrics), #2953 (Ollama parser).

Alternatives check of 2026-11-04: partly.
Tool: The-PR-Agent/pr-agent (https://github.com/The-PR-Agent/pr-agent), MIT, last activity 2026-11-04, maintained.

Proposed design

Problem statement

The implement job marks a pull request ready when the CI checks pass. No review of the diff happens before that mark. The project has devops review and a tick check, but the job calls neither on the diff. The runner pod holds no review tools and no sandbox, so the build waits on #3041 and #2695. The plan then gates the ready mark through draft_readiness.extra_checks with --no-group-analysis.

Acceptance criteria

Requirement: Review before the ready mark

The implement job SHALL run devops review on the pull request diff after the last task group and before gh pr ready.

Scenario: Review runs on the diff

  • WHEN The last task group of the change is done and the CI checks pass
  • THEN The job runs devops review on the diff before it calls gh pr ready

Requirement: No diff text to a model

The implement job MUST run the review with --no-group-analysis, so no diff text goes to a model group.

Scenario: The review command line

  • WHEN The job builds the devops review command
  • THEN The command holds --no-group-analysis and the review sends no code region to a model

Requirement: A review that cannot run stops the item

The implement job SHALL stop the item when the review tools do not run, and SHALL NOT treat that review as clean.

Scenario: No sandbox on the host

  • WHEN The review exits with the error that the review tools did not run
  • THEN The job stops the item with a reason that names the missing tool and marks the item Blocked

Requirement: Review stops have their own failure class

The implement job MUST record a stop of the review with a failure class that a retry cannot clear.

Scenario: Missing tool gives the review class

  • WHEN The review stops because a tool is missing or the budget is spent
  • THEN The stop comment names the review failure class and the item waits for implement: retry or a new runner image

Requirement: A high-severity finding is repaired or blocks

The implement job SHALL repair a high-severity finding in one repair round or SHALL NOT mark the pull request ready.

Scenario: Seeded high-severity finding

  • WHEN A replay test seeds a high-severity finding in the diff of the last task group
  • THEN The job repairs the finding in one repair round, or it does not mark the pull request ready

Requirement: Findings in the pull request comment

The implement job SHALL post each review finding and its disposition in the pull request comment.

Scenario: Findings with dispositions

  • WHEN The review completes with one or more findings
  • THEN The pull request comment lists each finding with its disposition: repaired, suppressed or blocking

Requirement: Review call budget

The implement job MUST enforce a budget of two devops review runs for each item.

Scenario: A third review run is needed

  • WHEN The job needs a third devops review run for the item
  • THEN The job stops the review and marks the item Blocked with the reason that the budget was exceeded

Requirement: Plan-conformance check

The implement job SHALL report each acceptance criterion of the change that no ticked task in tasks.md covers, and SHALL NOT mark the pull request ready while one is open.

Scenario: A criterion with no ticked task

  • WHEN The change tasks.md has no ticked task for one acceptance criterion
  • THEN The job reports the criterion and does not mark the pull request ready

Requirement: Ready mark waits for the checks and the review

The implement job SHALL call gh pr ready only when the CI checks pass and the review holds no unresolved high-severity finding.

Scenario: Checks pass but a finding is open

  • WHEN The CI checks pass and the review holds an unresolved high-severity finding
  • THEN The job does not mark the pull request ready

Existing Tool Considered

The-PR-Agent/pr-agent (https://github.com/The-PR-Agent/pr-agent), MIT, last activity 2026-11-04, maintained. The check gave the verdict partly. The tool reviews the diff and posts a pull request comment. It lacks findings from tools, advisories, version facts or a rule pack, which ADR 0005 requires. It lacks the project rule pack and severity policy table. It lacks the plan-conformance check, the repair round and the two-run budget. It does not gate gh pr ready. The project builds this wiring itself. The written cost is about 150,000 tokens to build, about 30,000 tokens per quarter to keep and fix, and about four working days.

Key questions

  • Why can the implement job not run devops review today?: The runner image installs only git, ca-certificates, curl and jq. NOT_IN_RUNNER marks bwrap, semgrep, gitleaks, osv-scanner, kube-linter and trivy as absent in that pod. SECURITY.md rule 7 makes the review fail closed with no sandbox, so the job gets an error and never a finding. [sources: src/devops_cli/roadmap/runner_tools.py, k8s/devops/cronjob-runner.yaml, SECURITY.md]
  • What must be delivered before this item can be built?: The runner image must carry the review tools (feat(roadmap): the implement agent can use the project's development tools #3041). The pod must run a sandbox that bubblewrap can start in for user 1000 (feat(roadmap): run the implement agent shell in a real sandbox #2695). The build then targets draft_readiness.extra_checks and the failure taxonomy. [sources: src/devops_cli/roadmap/runner_tools.py, k8s/devops/cronjob-runner.yaml]
  • Which seam does the review gate use?: The review result goes into draft_readiness.extra_checks. The implement job and devops pr ready already ask it after completeness and the checks. (best practice) [sources: CONTEXT.md]
    • Chosen: draft_readiness.extra_checks. CONTEXT.md gives draft readiness an extra check after completeness and the checks, and both callers ask it.
    • Rejected: ready_to_mark. The plan of docs(openspec): plan #2916 One function decides draft readiness #3170 deletes ready_to_mark and moves the ready decision to draft_readiness.
    • Rejected: A new gate beside gh pr ready. It duplicates draft readiness, and devops pr ready would not see the review.
  • Which model group does the review use, and does diff text leave the cluster?: No model group. The job passes --no-group-analysis, so no code region goes to a model and the status lane stays model-free. (best practice) [sources: CONTEXT.md, docs/adr/0005-review-findings-come-from-tools-not-models.md, SECURITY.md]
    • Chosen: --no-group-analysis. The status lane calls no model, and ADR 0005 lets a model change no finding, so the model stage adds no finding.
    • Rejected: The analysis model group. It sends the code region of each finding off the cluster and bills it, and SECURITY.md rule 13 needs that stated.
    • Rejected: A hosted review service. It sends the diff off the cluster and reads neither the rule pack nor the severity policy table.
  • How does the job class a stop from the review?: The review stops get their own failure class. A retry cannot clear them. The item stays Blocked until a person comments implement: retry or a new runner image rolls out. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/failure.py]
    • Chosen: A new failure class for the review stops. The class must match a cause that a retry cannot clear, and the taxonomy has one action for each class.
    • Rejected: Reuse ci_infra with action retry. A retry cannot clear a missing tool or a spent budget, so the item would retry without end.
  • What does the plan-conformance check verify?: It reuses the existing tick check for the task ticks. It adds criterion coverage: it reports each acceptance criterion that no ticked task in tasks.md covers. (best practice) [sources: CONTEXT.md, docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]
    • Chosen: Reuse the tick check and add criterion coverage. The tick check exists already, and CONTEXT.md makes tasks.md the checklist of the change.
    • Rejected: Build a second tick check. _unticked_failure already stops on an unticked task, so a second check duplicates it.
    • Rejected: openspec validate alone. It checks structure and ticks, and it reports no criterion that the change misses.
  • What happens when a high-severity finding is found?: The finding goes back as one repair round. A finding that stays open after that round blocks the ready mark. (best practice) [sources: CONTEXT.md, docs/adr/0005-review-findings-come-from-tools-not-models.md]
    • Chosen: One repair round, then block. CONTEXT.md gives the implement job at most one fix step, and ADR 0005 accepts a patch only when the tools and the mapped tests pass.
    • Rejected: Block at once. The job gets no chance to fix a fixable finding.
    • Rejected: Post the finding only. It contradicts the criterion that a high-severity finding is repaired or blocks.
  • What is the review call budget for each item?: Two devops review runs for each item: the first run and the re-run after the repair round. The status lane calls no model, so the budget bounds tool runs. (best practice) [sources: CONTEXT.md]
    • Chosen: Two runs, the repair re-run included. It matches the at-most-one-fix-step rule, and a count of runs is simple to enforce.
    • Rejected: One run. The repair round could not confirm its fix, so a repaired finding would block the ready mark.
    • Rejected: A time-based budget. The runner pod gives no wall-clock guarantee, so a count of runs is easier to hold.
  • Which findings block the ready mark?: A high-severity finding that stays open. Severity comes from the rule metadata and the policy table. Only a tool run, a suppression or a person's verdict changes the state of a finding. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md, CONTEXT.md]
    • Chosen: An open high-severity finding blocks. ADR 0005 takes severity from the rule metadata and the policy table, so the block is a check and not a model.
    • Rejected: Every open finding blocks. A low-severity finding would stop a ready mark that the checks pass.
  • What is the seam that feat(roadmap): Add a draft PR evaluator for issue and rules #2867 uses for its model verdict?: The review session holds the findings and their states, and feat(roadmap): Add a draft PR evaluator for issue and rules #2867 reads them. The model output stays apart from the findings and changes no finding. (best practice) [sources: docs/adr/0005-review-findings-come-from-tools-not-models.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 1, 2026
  2. dan-petty commented on Nov 1, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It gates PR readiness on review but is a planned enhancement, not a defect fix.
    • Value: Medium. It adds a quality gate that catches missed criteria and rule breaks before a PR is marked ready.
    • Effort: Medium. It integrates an existing tool into the job, adds a repair round, posts findings, and enforces a call budget.
    • Related: feat(roadmap): Add a draft PR evaluator for issue and rules #2867, which asks for a different change. Both concern marking a draft PR ready, but the candidate delivers the devops review invocation and finding posts, while #2867 delivers the model verdict that uses this review as its seam.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 1, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at aad0115 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Staged: branch feat/3049-the-implement-job-reviews-its-own, draft pull request #3183. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:

    1. Add the review budget setting and the review step messages: 13618 tokens
    2. Review the diff and check plan conformance before the ready mark: 16257 tokens
    3. Post the findings and their disposition in the pull request comment: 17943 tokens
    4. Document the review gate: 12139 tokens

    The plan run made 10 model request(s), and used 262885 input tokens and 3841 output tokens. The tool calls, in order:

    1. list_files({"directory":"src/devops"})
    2. search_code({"text":"gh pr ready"})
    3. list_files({"directory":""})
    4. search_code({"text":"ready_to_mark"})
    5. list_files({"directory":"src"})
    6. list_files({"directory":"src/devops_cli/roadmap"})
    7. read_file({"path":"src/devops_cli/roadmap/implement_run.py"})
    8. file_symbols({"path":"src/devops_cli/roadmap/implement_run.py"})
    9. file_symbols({"path":"src/devops_cli/roadmap/implement_pull.py"})
    10. read_file({"path":"src/devops_cli/roadmap/implement_run.py","start_line":440,"end_line":720})
    11. read_file({"path":"src/devops_cli/roadmap/implement_run.py","start_line":505,"end_line":900})
    12. read_file({"end_line":900,"path":"src/devops_cli/roadmap/implement_run.py","start_line":574})
    13. read_file({"end_line":880,"path":"src/devops_cli/roadmap/implement_run.py","start_line":642})
  7. dan-petty commented on Nov 2, 2026

    @dan-petty
    OwnerAuthor

    returned per agent request

  8. removed
    status/ready
    on Nov 2, 2026
  9. 3 remaining items

  10. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 3f3103a (see proposed design in issue body).

  11. dan-petty commented on Nov 2, 2026

    @dan-petty
    OwnerAuthor

    returned per agent request

  12. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: The-PR-Agent/pr-agent (https://github.com/The-PR-Agent/pr-agent)

    • License: MIT
    • Last activity: 2026-11-04
    • Maintained: yes

    Covers:

    • Runs an automated review of the pull request diff, both as a GitHub Action on pull request events and as a CLI command (pr-agent --pr_url ... review) that a job can call.
    • Reads the pull request description as context for the review, so the diff is reviewed against the stated intent.
    • Writes the review output back to the pull request as a comment/review, which is where the item wants the findings posted.

    Lacks:

    • Findings come from a model, not from anchors such as pinned tools, advisories, confirmed version facts or a rule pack, which ADR 0005 requires and which the item's replay test needs.
    • No project rule pack or severity policy table, so severities and blocking decisions are not taken from the project's own rules.
    • No plan-conformance check: it does not verify that every task in the change's tasks.md is ticked or that every acceptance criterion is delivered.
    • No repair round that sends a high-severity finding back and re-runs the review, and no per-item review call budget of two runs.
    • Does not gate gh pr ready; wiring the review and the plan check into the implement job's ready mark stays project work.

    Searches run:

    • open source automated pull request review tool LLM diff review
    • Qodo PR-Agent open source code review GitHub action
    • tool checks pull request implements every acceptance criterion and tasks ticked before merge

    Sources:

    Checked on 2026-11-04. A person decides what this means for the item. The check changes no label and closes no issue.

  13. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Plan pull request #3183 closed with no merge. The job waits for an edit of the text of this item, or for a commit that changes a file that the reason names.

    The reason, from the last comment of dan-petty on the pull request:

    Plan-fix check for #3049: the item cannot be built as written. I did not change the plan. A person should run devops roadmap return 3049 --comment "<this comment>" --confirm (it fails with 401 in an agent session).

    The premise is "the implement job runs devops review on the diff". The job runs in the runner pod. In that pod devops review can run no tool, so it can never give a finding. All evidence below is on origin/main 46ab396.

    1. The runner image holds no sandbox and no review tool. The runner stage of Dockerfile (lines 53-58) installs git, ca-certificates, curl, jq only. NOT_IN_RUNNER in src/devops_cli/roadmap/runner_tools.py names bwrap, semgrep, gitleaks, osv-scanner, kube-linter and trivy (I imported it: all six are True). The reason for the scanners is _SCANNER: "A scanner on PATH also fails tests that pass in the gate (test(floor): every test sees the same tokenizer cache, mounts, process table, PATH and programs on every host, and no skip depends on the host #2165). The runner does the same as the gate."
    2. The review fails closed without the sandbox. SECURITY.md rule 6: "A host that fails the check fails closed: no tool runs, in the sandbox or outside it." I ran devops review branch --base <base> --no-group-analysis on a one-file diff on a host with no bwrap (same state as the runner). Output: "The review tools did not run: bubblewrap (/usr/bin/bwrap) is not installed ..." then "The review tool semgrep is not installed on this host", exit code 1. So the job would get an error, not a finding. A gate that treats this as "no finding" never fires. A gate that treats it as a failure blocks every item. Both are code that works around the premise.
    3. A pod cannot start the sandbox. k8s/devops/cronjob-runner.yaml sets runAsNonRoot, capabilities.drop: [ALL], seccompProfile: RuntimeDefault. Issue feat(roadmap): run the implement agent shell in a real sandbox #2695 records that under this profile unshare --user fails with "Operation not permitted" for user 1000. I read this; I did not run it in a pod.
    4. A model cannot supply the finding. ADR 0005: model output "has no field that can create, move, re-rate or change the state of a finding". run_group_analysis (review/analysis.py:1480) only explains findings that tools admitted. With no tool there is no group, so no model call.
    5. Plan conformance is already enforced. "Every task ticked" is checked by _unticked_failure (implement_step.py:788, stop text implement_stop_unticked) and by openspec validate --archived. I unticked one task of an archived change in a scratch copy: "✗ 1 incomplete task (0/1 completed)". The check runs in devops openspec check. "Every criterion delivered" has no stated mechanism (my review, finding 4).

    Security question (SECURITY.md rule 13). A review with the model stage sends the code region of each finding to the model of the analysis task. If that is a hosted group, the code leaves the cluster and is billed. The runner pod may reach the gateway (port 4000) and public HTTPS (networkpolicy.yaml). Any new plan must say which model group the review uses and that it sends diff text to it. --no-group-analysis sends none.

    Other plans on main that change the same code (the three findings of my review that stay true).

    What a new plan needs first: a runner (or another place) where the review tools can run, from #3041 and #2695. After that, #3049 can be planned again against draft_readiness.extra_checks and the failure taxonomy.

    I leave the pull request as it is. Not verified: the sandbox in a real runner pod, and a review with the model stage (no gateway here).

    🤖 Generated with Claude Code

    https://claude.ai/code/session_01PeiMDoPafqUWqpk1WxhaYW

  14. added
    status/new
    and removed
    status/ready
    on Nov 6, 2026
  15. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 34010d6 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.

    The next refine round also looks at the item again when a commit on the default branch changes one of these files: src/devops_cli/roadmap/runner_tools.py, k8s/devops/cronjob-runner.yaml.

  16. changed the title [-]feat(roadmap): the implement job reviews its own diff with `devops review` before it marks the pull request ready[/-] [+]feat(roadmap): Run `devops review` on the diff before marking PR ready[/+] on Nov 6, 2026
  17. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 98 characters, and the limit is 60. The type and the scope stay.

    • Before: feat(roadmap): the implement job reviews its own diff with devops review before it marks the pull request ready
    • After: feat(roadmap): Run devops review on the diff before marking PR ready
    • Source of the summary: the background model
  18. added
    status/ready
    and removed
    status/new
    on Nov 9, 2026
  19. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 28356ed (see proposed design in issue body).

  20. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor

    The owner approved the roadmap pipeline split on 2026-11-13 (tracker #5482). Decision D7 replaces the scope of this item:

    I close this item as not planned, because #5521 replaces it.

  21. removed
    status/ready
    on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions