Repository navigation
Description
Problem
#6705 adds the stock Coder agent for the separate phases of stage. Until #6814 is live, CronJob roadmap-stage runs --phase all in one container that holds the App key, so production keeps the old stage engine. After that, the old engine has no use in a stage Job, but other code still uses it:
- the custom tools, the toolbox, the gate returns, the gate extension and the schema retry (
stage_tools.py,stage_toolbox.py); - the fix-plan row (
run.py) anddevops roadmap step fix-plan; - the golden-set evals (
stage_eval_run.py); - the round mode of stage, and
--phase allwith--job-item.
Change
- Delete the old stage engine and its tests.
- Move fix-plan and the golden-set evals to the
Coderagent of refactor(roadmap): the stage agent is stock Coder #6705, or delete them where the new design makes them unnecessary. - Refuse
--phase allwith--job-item, so that a stage Job always runs the separate phases.
Acceptance criteria
- A test of the stage agent finds
Coderwith the stock capabilities,RequireVerificationand no custom tool. This is the second criterion of refactor(roadmap): the stage agent is stock Coder #6705. - The custom engine code and its tests are gone.
- One live stage Job, one fix-plan run and one eval run pass after the deletion.
Dependencies
- refactor(roadmap): the stage agent is stock Coder #6705
- refactor(k8s): run the stage Job as three containers #6814
Source
Source: #6705
Alternatives check of 2026-11-23: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
The stage Job still runs the old stage engine until #6814 splits it. After the split, the old engine has no use in a stage Job. But fix-plan, the golden-set evals and the round mode still call it. This change deletes the old engine and moves the stage golden set to the stock Coder agent. It deletes fix-plan and the verify golden set. It refuses the modes that would run the old planner.
Acceptance criteria
Requirement: stage-agent-runs-stock-coder
The stage agent SHALL run on the stock Coder agent with RequireVerification and SHALL offer no custom stage tool.
Scenario: Stage agent toolset
- WHEN the test
tests/roadmap/stage/test_roadmap_stage_agent.pybuilds the agent of a stage run - THEN the test finds
Coderwith the stock capabilities andRequireVerification. The tools offered are exactly the stock tools, with nodelegate_taskand no custom stage tool.
Requirement: custom-stage-engine-removed
The stage package MUST hold no stage_tools.py, stage_toolbox.py, stage_eval_compare.py, StageTools, ToolboxClient or gate_extension, and no tracked file SHALL import one of them.
Scenario: Ban on the old engine modules
- WHEN the ban check that
tests/invariants/test_source_tree.pyruns walks the tracked files undersrc/andtests/, apart from the helper that holds the ban - THEN the ban finds none of these six names:
stage_tools.py,stage_toolbox.py,stage_eval_compare.py,StageTools,ToolboxClientandgate_extension. It also finds no file that imports one of them.
Requirement: phase-all-refused-with-job-item
The stage command MUST refuse the resolved phase all together with --job-item, including when --phase is omitted and defaults to all.
Scenario: Refused flag pair
- WHEN a test runs
devops roadmap stage --phase all --job-item 6846 --confirmand the same command with--phaseomitted - THEN both commands exit non-zero and each message names the phase
all,--job-itemand the separate phasesprepare,agentandpublish.
Requirement: stage-round-mode-removed
The stage command MUST refuse a model run (--plan or --confirm) that names no --job-item, so that the old round planner is unreachable.
Scenario: Refused round mode
- WHEN a test runs
devops roadmap stage --confirmwith no--job-item - THEN the command exits non-zero and its message names
--job-itemand the phasesprepare,agentandpublish.
Requirement: fix-plan-removed
The repository MUST hold no fix_plan row, no devops roadmap step fix-plan command and no steps/fix_plan.py.
Scenario: Fix-plan command gone
- WHEN a test runs
devops roadmap step fix-plan --item 6846 - THEN the command exits non-zero as an unknown command. The ban in
tests/invariants/test_source_tree.pyfinds noFixPlanRecordKey, nosrc/devops_cli/roadmap/steps/fix_plan.pyand nofix_planrow insrc/devops_cli/roadmap/run.py.
Requirement: verify-golden-set-removed
The repository MUST hold no devops roadmap eval verify command and no stage_verify_eval.py.
Scenario: Verify eval gone
- WHEN a test runs
devops roadmap eval verify - THEN the command exits non-zero as an unknown command, and the ban in
tests/invariants/test_source_tree.pyfinds nosrc/devops_cli/roadmap/stage/stage_verify_eval.py.
Requirement: stage-golden-set-runs-on-coder
devops roadmap eval stage MUST run each case on the Coder agent with RequireVerification and MUST score the resulting plan with the existing plan-check gates.
Scenario: Stage golden-set agent
- WHEN a test builds the golden-set run of
devops roadmap eval stage - THEN the run builds
CoderwithRequireVerification, offers only the stock tools, and scores the plan with the existing stage-eval gates.
Requirement: Pending a person after the merge
A person MUST run the live stage Job of each phase and one devops roadmap eval stage run after the merge, and both MUST pass.
Scenario: Live proof after the merge
- WHEN a person runs the live stage Job of
prepare,agentandpublish, and runsdevops roadmap eval stage - THEN each phase of the Job passes and the eval command exits 0.
Existing Tool Considered
The alternatives check in the issue body records not-applicable for a refactor with no search and names no tool. The change keeps the Coder agent of pydantic-ai-harness that #6705 added. Coder lacks a custom stage tool and a model review pass. RequireVerification runs the three checks, and publish reruns them. The plan builds no replacement engine, so the cost to build, keep and fix one is zero tokens and zero elapsed time.
Key questions
- Does the fix-plan row and
devops roadmap step fix-planmove to theCoderagent, or are they deleted?: Delete them. The new stage agent andpublishrun no model review pass. A staged plan never getsverdict/fix-plan. The step calls the old planner'srevise_planand review. This item deletes that planner and review. (best practice) [sources: src/devops_cli/roadmap/steps/fix_plan.py, src/devops_cli/roadmap/run.py, src/devops_cli/roadmap/stage/stage_job_phases.py, tests/roadmap/stage/test_roadmap_stage_agent.py, tests/commands/test_roadmap_step_fix_plan.py]- Chosen: Delete fix-plan. The new design sets no
verdict/fix-plan. The step calls the planner and review that this item deletes. - Rejected: Move fix-plan to the Coder agent. The new stage agent has no model review pass. The label that selects the step never appears. A moved step needs a new producer, which is outside this item.
- Rejected: Keep fix-plan on the old engine. The engine it calls goes. The step would keep the code that this item removes.
- Chosen: Delete fix-plan. The new design sets no
- Do the golden-set evals move to the
Coderagent, or are they deleted?: Move the stage golden set toCoderand delete the verify golden set. The stage set measures the stage prompt and checks. The new agent has a new prompt and three checks. The verify set scores a review pass that the new design does not run. Deletestage_eval_compare.pywith the toolbox. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_run.py, src/devops_cli/roadmap/stage/stage_verify_eval.py, src/devops_cli/roadmap/stage/stage_eval_compare.py, tests/roadmap/stage/test_roadmap_stage_agent.py]- Chosen: Move the stage set to Coder and delete the verify set. The stage set measures the stage prompt and checks, which this change keeps. The verify set scores a review pass that no longer exists.
- Rejected: Move both golden sets to Coder. The verify set measures the old review pass. It has nothing to score.
- Rejected: Delete both golden sets. The stage set is the measure of a stage prompt or check change. The project keeps that measure.
- Rejected: Keep both on the old engine. The old engine goes. The modules would keep the code that this item removes.
- How does the code prove that the old stage engine is gone?: Add a ban check that
tests/invariants/test_source_tree.pyruns, with its helper intests/gate/tree_checks/source_tree.py. The ban walks the tracked files undersrc/andtests/, apart from the helper. It fails on six names:stage_tools.py,stage_toolbox.py,stage_eval_compare.py,StageTools,ToolboxClientandgate_extension. It also fails on an import of one of them. (best practice) [sources: tests/invariants/test_source_tree.py, tests/gate/tree_checks/source_tree.py, docs/TESTING.md]- Chosen: Ban in tests/invariants/test_source_tree.py. It holds each retired rule as a ban and the path rules over
src/andtests/. - Rejected: Ban in tests/invariants/test_architectural_invariants.py. Its subject is suppression ceilings and workflow permissions, not the source-tree layout.
- Rejected: No test; the deletion shows in the diff. A later change can bring a module back with no failure.
- Rejected: A grep in CI. The project runs its invariants as tests. A separate grep is a second gate.
- Chosen: Ban in tests/invariants/test_source_tree.py. It holds each retired rule as a ban and the path rules over
- How does the stage command refuse the modes that would still run the old planner?: Refuse them in
_refuse_phase_optionsat the start ofstage_cmd, before the store opens or a job item is read. Refuse the resolved phaseallwith--job-item, including the default phase. Refuse a--planor--confirmrun with no--job-item. The message names both flags and the phasesprepare,agentandpublish. refactor(k8s): run the stage Job as three containers #6814 must add--phaseto the Job args thatstage_submit.pybuilds. (best practice) [sources: src/devops_cli/commands/roadmap_jobs.py:534, src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/stage/stage_submit.py]- Chosen: Refuse in _refuse_phase_options before any work. The pair is refused before the store opens or a job item is read, so no work is lost. The same check covers the default phase and the round mode.
- Rejected: Refuse inside the phase runner. The Job would start and hold the App key before the refusal.
- Rejected: Keep the round mode and run the phases in one process. It rebuilds the kept-plan cache and the single-process flow that refactor(k8s): run the stage Job as three containers #6814 splits.
- Rejected: Keep the round mode on a plain client with no toolbox. It keeps the gate returns, the gate extension and the schema retry. The old engine would stay.
- Which items must be delivered before this one?: Only refactor(k8s): run the stage Job as three containers #6814. refactor(roadmap): the stage agent is stock Coder #6705 is delivered.
stage_agent.pybuildsCoderwithRequireVerification, andtests/roadmap/stage/test_roadmap_stage_agent.pychecks it. refactor(k8s): run the stage Job as three containers #6814 is not live: CronJobroadmap-stagestill runs--phase allin one container that holds the App key. The Service passes no--phase. [sources: src/devops_cli/roadmap/stage/stage_agent.py, tests/roadmap/stage/test_roadmap_stage_agent.py, k8s/devops/cronjob-stage.yaml, src/devops_cli/roadmap/stage/stage_submit.py] - Where does the live verification of the deletion go?: Keep it as the acceptance criterion
Pending a person after the merge. After the merge and the deployment of refactor(k8s): run the stage Job as three containers #6814, a person runs the live stage Job of each phase. The person also runs onedevops roadmap eval stagerun. Both pass. No fix-plan run remains, because the step is deleted. No offline test shows the live Job. The deletion merges with its offline tests. (best practice) [sources: src/devops_cli/roadmap/stage/stage_submit.py, tests/roadmap/stage/test_roadmap_stage_agent.py]- Chosen: Post-merge live criterion. The live check needs the deployed split of refactor(k8s): run the stage Job as three containers #6814. The deletion can merge with offline tests.
- Rejected: New deferred issue. The live check is a post-merge proof of this item, not a separate part of the code.
- Rejected: Offline test. No offline test shows a live stage Job and the deployed split.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
k8s/devops/cronjob-stage.yamlsrc/devops_cli/roadmap/stage/stage_submit.py
Activity
dan-petty commentedon Nov 23, 2026
Both work on the stage engine refactor; #6704 delivers the phase-based stage, while the candidate deletes the old engine after that split is live.docs(openspec): plan #6705 Fix the review defects of the stage agent …
devops-cli-service commentedon Nov 23, 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.
devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.
dan-petty commentedon Nov 28, 2026
Audit evidence: custom code against open tools, 2026-11-28, devops-cli at
d0bc3dffa. The audit ranks this replacement first of 27. Its verdict is "replace, as decided" (ADR 0036, #6705).The custom engine
src/devops_cli/roadmap/stage/stage_tools.py(511 lines), withStageToolsat:121.stage_toolbox.py(358 lines), withToolboxClientat:104and the schema-violation retry at:320.gate_extensionreturns atstage.py:1576and:2037-2049.stage/has 24,189 lines.tests/roadmap/stagehas 2,018 tests.Breakage (bugs created after 2026-10-28)
165 roadmap bugs name stage or plan. About 30 of them hit the engine mechanics:
The other ~135 are plan-form rules. The
publishchecks keep them, as ADR 0036 decides.Tool facts (read 2026-11-28)
pyproject.toml:41.Risk: fix-plan and the golden-set runs still call the old engine (the "Bad" list of ADR 0036). #6814 must land first.
Recommendation of the audit: add no feature to the old engine before this deletion. The owner direction of 2026-11-27 (close comment of #7489) rejects more custom code where an open tool solves the problem.
devops-cli-service commentedon Nov 28, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.