Skip to content

feat(roadmap): start the review step as a Job from the watch row #6011

Description

@dan-petty

Problem

The step devops roadmap step review (#5969) gives one bot pull request its verdict, but no job starts it. Bot pull requests still wait for a person until a job runs the step for each open bot pull request (owner, 2026-11-16: about 20 bot pull requests a day fail checks or are otherwise not mergeable).

Expected behavior

  • The launcher of feat(roadmap): the watch row starts fix-checks Jobs #5027 starts devops roadmap step review --pull <n> --head <head> as a runner Job: with --confirm when roadmap.review.mode is on, without it when the mode is plan, and no Job when the mode is off.
  • The watch row (src/devops_cli/roadmap/watch_row.py) makes the review due for an open bot pull request whose checks all passed and whose head has no verdict yet (review.key), and for a draft that a fix step marked ready. A pull request with verdict/mergeable is not due again until a person merges it or the issue changes.
  • A verdict/fix-implementation with no due fix (the diff does not do what the plan asks, with all checks green) gets a fix step or waits for a person. Decide which, and record it.
  • ADR 0021 section 8 gets the row review. The merge of the pull request is the approval of the row.
  • The Job of the step has the clone that a discard deletes the branch from, and the App credential of one repository (require_runner).

Related

Source: #5969

Alternatives check of 2026-11-24: none.
Tool: none found.
Reason: The searches returned only unrelated documentation pages and no review or workflow tool, and the issue's own alternatives check names none. The need is the project's own watch-row routing and Job launcher for its review step, which no general tool provides.

Lacks:

  • Due rule for a green bot pull request with no verdict
  • Per-head Job name so a repeated create gets 409
  • Mode plan, on and off gating the --confirm flag
  • Clone and one-repository App credential through require_runner
  • ADR 0021 section 8 row review

Proposed design

Problem statement

The review step gives one bot pull request its verdict, but the watch row does not make a review due, so no launcher can start the step. This change adds the due rule that identifies a green bot pull request with no verdict, a repaired delivery draft, and the states that must wait. The Job launch waits on the phased runner and is deferred to a new issue.

Acceptance criteria

Requirement: Review due for a green bot pull

The watch row SHALL make a review due for an open bot pull request with passing checks and no review verdict.

Scenario: Green bot pull with no verdict

  • WHEN review_due runs with a WatchState of an open bot pull request whose checks are _passing_checks(), whose labels hold no verdict label, and whose review_head is empty
  • THEN review_due returns true

Requirement: No review for a mergeable verdict

The watch row SHALL NOT make a review due for a pull request that holds verdict/mergeable.

Scenario: Mergeable verdict holds

  • WHEN review_due runs with a WatchState whose labels hold verdict/mergeable and whose checks are _passing_checks()
  • THEN review_due returns false

Requirement: No review for a head with a verdict

The watch row SHALL NOT make a review due for a head that review.key already names.

Scenario: Head with a recorded verdict

  • WHEN review_due runs with a WatchState whose review_head equals its head_sha
  • THEN review_due returns false

Requirement: No review and no fix for a fix-implementation verdict

The watch row SHALL leave a verdict/fix-implementation pull request whose checks pass to a person, with no review due and no fix due.

Scenario: Fix-implementation verdict with green checks

  • WHEN review_due and fix_checks_check run with a WatchState whose labels hold verdict/fix-implementation and whose checks are _passing_checks()
  • THEN review_due returns false and fix_checks_check returns None

Requirement: Review due for a repaired delivery draft

The watch row SHALL make a review due for a delivery draft that a fix Job repaired and whose checks pass.

Scenario: Repaired draft is green

  • WHEN review_due runs with a WatchState of a delivery draft whose fix_checks_result is repaired and whose checks are _passing_checks()
  • THEN review_due returns true

Requirement: The watch row reports a due review

The watch row SHALL report each due review in WatchRoundResult.review_due.

Scenario: Round reports a due review

  • WHEN watch_round runs with a fake store and a fake GitHub session that returns one open bot pull request with passing checks and no verdict
  • THEN the result's review_due tuple holds that pull number

Requirement: The due_steps route stays unchanged

The change MUST keep the current due_steps route for a green bot pull request with no verdict label and an empty review_head.

Scenario: Green bot pull keeps its route

  • WHEN due_steps runs with a WatchState of an open bot pull request whose checks are _passing_checks(), whose labels hold no verdict label, and whose review_head is empty
  • THEN due_steps returns (DueStep.READY,)

Existing Tool Considered

The alternatives check of 2026-11-24 in the issue body gives the verdict none and names no tool. The block lists under Lacks: the due rule, the per-head Job name, the mode gating, the clone and one-repository App credential, and the ADR 0021 row. This proposal does the due rule with a new pure function review_due and the WatchState fields. It defers the other lacks to the new issue for the phased review Job. Written cost to build, keep and fix the due rule: about 150 changed lines in one module and its tests; an estimated 50k tokens to build, about 5k tokens a month to keep and fix, and about 4 hours elapsed.

Key questions

  • Where does the review due rule live?: In a new pure function review_due in src/devops_cli/roadmap/steps/watch.py, with new WatchState fields review_head and fix_checks_result. The function leaves due_steps unchanged. (best practice) [sources: src/devops_cli/roadmap/steps/watch.py:97, src/devops_cli/roadmap/steps/watch.py:331, tests/roadmap/steps/test_roadmap_due_steps.py:41-60, tests/roadmap/steps/test_roadmap_due_steps.py:332-355]
    • Chosen: New pure function review_due. It keeps the existing exact routes of due_steps and gives one pure test.
    • Rejected: Extend due_steps with DueStep.REVIEW. It breaks the existing exact assertions at tests/roadmap/steps/test_roadmap_due_steps.py:41-60 and :332-355.
    • Rejected: Rules in watch_row._evaluate_pull. It gives no pure test and a second router for one state.
  • What does the watch row do for a verdict/fix-implementation with passing checks and no due fix?: It waits for a person. review_due returns false and fix_checks_check returns no check, so no review Job and no fix Job start. The verdict label and the step comment hold the ask. (best practice) [sources: src/devops_cli/roadmap/steps/watch.py, src/devops_cli/roadmap/watch_row.py, src/devops_cli/roadmap/fix_checks_row.py]
    • Chosen: Wait for a person. A fix Job with an empty due has nothing to repair and would repeat on the same head.
    • Rejected: Start a fix Job. No step exists for that cause, and the Job would loop.
  • What does due_steps currently return for a green bot pull request with no verdict label and an empty review_head?: It returns (DueStep.READY,). [sources: tests/roadmap/steps/test_roadmap_due_steps.py:41-60, tests/roadmap/steps/test_roadmap_due_steps.py:332-355]
  • Does devops roadmap step review accept --phase and --work?: No. review_cmd rejects --phase and --work with exit code 2, and run_review mixes GitHub API calls, require_runner, LLM calls and discard writes in one process. [sources: src/devops_cli/commands/roadmap_step_review.py:52-94, src/devops_cli/roadmap/steps/review.py:788-850]
  • Why is the review Job launch deferred?: The runner template now runs three phase containers and the admission policy rejects a Job without them. The review command does not accept the phase flags, so a review Job cannot start until the review step is split into prepare, agent and publish. [sources: src/devops_cli/k8s/cluster_job.py:268-272, k8s/devops/roadmap-service/admissionpolicy.yaml:88-91, src/devops_cli/commands/roadmap_step_review.py:52-94]
  • What does the Confirm outside a runner criterion do in the current code?: The current review_cmd calls require_runner only when roadmap.review.mode is on, and it catches DevOpsCLIError with print_error(..., safe=True) without a JSON result line. [sources: src/devops_cli/commands/roadmap_step_review.py:84-93, src/devops_cli/config/defaults.py:1284]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7426

Activity

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

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 16, 2026
  4. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    Facts from the build of the step (#5969) for this item:

    • The step writes nothing in the mode plan, also no review.key. So in the mode plan each call on the same head asks the model again. The launcher must start at most one review Job for each head (for example, a key of the pull request and the head in the Job name, so a second create gets 409).
    • With --confirm in the mode on, the command calls require_runner and gives the step the delete of a branch (OriginGit.push with a lease) in the clone model-clone or in --source.
    • A needs-fix verdict with no due fix (due is empty in the JSON result: unresolved threads, an incomplete change, or a model verdict on a green delivery) has no fix step yet.
    • ADR 0021 section 2 still names plan/needs-fix in the row fix-plan; feat(roadmap): the PR review gate scores each bot PR #5968 renamed the label to verdict/fix-plan. The amendment that adds the row review can correct it.
  5. dan-petty commented on Nov 16, 2026

    @dan-petty
    OwnerAuthor

    Facts from #6024 (PR #6035) for this item:

    • The rules of the step run on each call, so the trigger may call the step again on a judged head: only the model call is saved (review.key, review.source), and a verdict that the record and the label hold writes nothing.
    • A discard of the model alone only labels and comments; a person decides the close. Only a discard of a rule closes and returns the item, and no rule gives one yet. Whether the cap of verdicts gives such a discard is a decision of the owner for this item.
    • A closed pull request with the mark review.discard of its head is work for the step: a call ends the discard (delete of the branch if it is there, return of the item). The trigger should start the step for such a pull request too.
    • A wait on CI infrastructure ends after roadmap.review.infra_wait_hours (6) from its first recorded wait, whatever the cadence of the trigger.
  6. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (10)

    Searches run:

    • open source tool automatically review bot pull requests and route fixes, results: 5
    • automate triage of bot pull requests mergeability checks job, results: 5
    • Mergify automerge bot pull requests when checks pass, results: 5
    • PR-Agent qodo open source automated pull request review github action, results: 5
    • reviewdog open source pull request review comments tool, results: 5
    • github pull request automation label merge verdict open source project policy-bot, results: 5
    • Renovate bot dependency update pull requests automerge, results: 5
    • qodo-ai/pr-agent GitHub repository, results: 5
    • Danger JS pull request automation, results: 5
    • Mergify, results: 5

    Sources:

  7. added
    status/ready
    and removed
    status/new
    on Nov 18, 2026
  8. 5 remaining items

  9. added
    status/new
    and removed
    status/in-progress
    on Nov 25, 2026
  10. added
    status/ready
    and removed
    status/new
    on Nov 27, 2026
  11. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  12. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  13. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  14. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 18:59 UTC

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