Repository navigation
Description
Split from #6011.
ProblemThe review step devops roadmap step review gives one bot pull request its verdict. No Job starts the step. The runner template devops-cli-runner runs three phase containers: prepare, agent and publish. The admission policy roadmap-service-jobs rejects a runner Job without these containers and their --phase and --work flags. The review command does not accept --phase or --work, and run_review mixes GitHub API calls, require_runner, LLM calls and discard writes in one process. No single container holds both the App key and the AI key. A review Job cannot start until the review step is split into the three phases.## Why deferredThe current issue adds the watch-row due rule for a review. The Job launch and the phase split are a separate change. The due rule is a prerequisite and can land first.## Acceptance criteria- devops roadmap step review accepts --phase prepare, --phase agent, --phase publish and --work <dir>.- The prepare phase clones the repository and writes the review input under --work.- The agent phase runs the review judge and writes the verdict under --work. It holds no App key.- The publish phase reads the verdict, writes the verdict label and the comment, and pushes the discard branch. It holds the App key.- The launcher reads the due reviews from WatchRoundResult.review_due and starts devops roadmap step review --pull <n> --head <head> as a runner Job.- The launcher adds --confirm when roadmap.review.mode is on, omits it when the mode is plan, and creates no Job when the mode is off.- The Job name holds the pull number and the head SHA, so a repeated create for the same head gets a 409.- The Job gets the clone that a discard deletes the branch from and the App credential of one repository through require_runner.- ADR 0021 section 8 gets the row review. The row names the step job, the Job name key and the mode. The row fix-plan names verdict/fix-plan.- The launcher starts the review step for a closed pull request whose item holds the review.discard mark of its head.- uv run devops roadmap step review --pull 12 --head <40-char sha> --confirm outside a runner exits 1 and its JSON result line names the stop that require_runner gives.
Proposed design
Problem statement
devops roadmap step review gives one bot pull request its verdict in one process. The runner template devops-cli-runner runs three phase containers, and the admission policy roadmap-service-jobs rejects a Job without them. The review command accepts no --phase or --work, and run_review mixes GitHub calls, the LLM call and discard writes. The change splits the review step into the phases prepare, agent and publish, and it records the step in ADR 0021 section 8. The Job launch waits on the watch-row due rule and is deferred.
Acceptance criteria
Requirement: Phase and work options
devops roadmap step review SHALL accept --phase prepare, --phase agent, --phase publish and --work <dir>.
Scenario: The command takes each phase value
- WHEN A test parses
--pull 12 --head <40-char sha> --phase agent --work <tmp>with the review command builder - THEN the parse succeeds and the parsed options hold the phase
agentand the work directory<tmp>.
Requirement: Prepare writes the review input
The prepare phase SHALL clone the repository and write the review input under --work.
Scenario: Prepare fills the work directory
- WHEN A test runs the
preparephase with a fake clone and an empty temporary work directory - THEN the work directory holds the review input file and the command exits 0 with one JSON result line.
Requirement: Agent holds no App key
The agent phase SHALL run the review judge and write the verdict under --work, and it MUST hold no App key.
Scenario: The agent phase runs with no App key
- WHEN A test runs the
agentphase with the App key unset and a prepared work directory - THEN the phase writes the verdict file under the work directory, exits 0, and the environment of the judge process holds no App key.
Requirement: Publish writes the verdict
The publish phase SHALL read the verdict, write the verdict label and the comment, and push the discard branch, and it MUST hold the App key.
Scenario: Publish posts the verdict and the branch
- WHEN A test runs the
publishphase with a verdict in the work directory and a fake GitHub session - THEN the session gets one label write, one comment write and one push of the discard branch.
Requirement: Stop outside a runner
The review step MUST exit 1 with a JSON result line that names the stop of require_runner when no runner environment holds it.
Scenario: A run outside a runner stops
- WHEN A test runs
devops roadmap step review --pull 12 --head <40-char sha> --confirmwith no runner environment - THEN the command exits 1 and its JSON result line holds the stop that
require_runnergives.
Requirement: ADR 0021 section 8 row
ADR 0021 section 8 SHALL hold the row review with the step job and its mode, and the row fix-plan SHALL name verdict/fix-plan.
Scenario: The docs check reads the ADR
- WHEN The change runs
uv run devops ci --check --only docs - THEN the command reports the
docsrow as passed and names no failure.
Existing Tool Considered
No alternatives check has run. The need is to run the review step as three phase containers of one runner Job. The Kubernetes Job API, through the client that the project already uses, and the phased step pattern of devops roadmap step fix-checks cover the execution and the --phase and --work flags. No open tool splits run_review into phases, so the change builds that split. The written cost is about 60k tokens and about 2 days of elapsed time to build, keep and fix the split until it matches the fix-checks phase pattern.
Key questions
- Which pattern does
devops roadmap step reviewuse for its three phases?: It reuses the phase pattern ofdevops roadmap step fix-checks: one command with--phaseand--work, and one function for each phase. It adds no new phase framework. (best practice) [sources: src/devops_cli/commands/roadmap_step_fix_checks.py, k8s/devops/roadmap-service/admissionpolicy.yaml]- Chosen: Reuse the fix-checks phase pattern. The admission policy already accepts this shape, and one pattern serves each step job.
- Rejected: Build a new phase framework. It puts a second fix on a fix, and AGENTS.md rule 2 forbids that.
- Rejected: Keep
run_reviewin one process. The admission policy rejects a runner Job whose containers hold no--phaseand--work.
- Which phase holds the GitHub App key?: Only
publishholds the App key.preparegets the installation token of one repository, andagentgets the AI key and no GitHub credential. (best practice) [sources: tests/roadmap/implement/test_roadmap_implement_token_isolation.py, k8s/devops/cronjob-runner.yaml, k8s/devops/roadmap-service/admissionpolicy.yaml]- Chosen: App key in
publishonly. The judge writes nothing to GitHub, and a leaked agent pod then holds no App key. - Rejected: App key in each phase. It gives the credential to the process that runs the model.
- Rejected: App key in
prepareandpublish.prepareonly clones, and the installation token of one repository covers the clone.
- Chosen: App key in
- How do the three phases exchange the review input and the verdict?: Through files under
--work:preparewrites the review input,agentreads it and writes the verdict, andpublishreads the verdict. The phases share no memory, because each runs in its own container. (best practice) [sources: k8s/devops/cronjob-runner.yaml, src/devops_cli/commands/roadmap_step_fix_checks.py]- Chosen: Files under
--work. Each phase is a separate container, so no process memory crosses the phase boundary. - Rejected: One process for the three phases. The admission policy starts one container for each phase.
- Chosen: Files under
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 27, 2026
Both make a roadmap step run as a phased runner Job, but #2913 covers the implement step while this covers the review step.devops-cli-service commentedon Nov 28, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.