Repository navigation
Description
Problem
The stage agent is a custom engine: its own tools and toolbox (stage_tools.py, stage_toolbox.py), gate returns, a gate extension and a schema retry. The owner decided that stage runs on stock Coder with upstream RequireVerification (#6528 comment 7053539044).
Change
- The stage agent is stock
CoderwithLocalWorkspaceandRequireVerificationwith the checksdevops openspec check,openspec validateanddevops roadmap plan-recheck --source . --branch HEAD. The checks cover the Markdown plan files (exempt_paths=()). - The agent has a real shell. The agent phase holds no GitHub credential.
- The proposal comes from the change folder that the agent wrote. The agent writes the PR body candidate in the same run.
- A run that ends unverified records
plan_defect, andpublishstops the item on that value. - Delete the custom tools, the toolbox, the gate returns, the gate extension and the schema retry.
devops roadmap stagetakes--phase prepare|agent|publish|alland--work, andallstays the default, so the CronJob does not change until feat(roadmap): add the three-container runner Job, policy and log reads #3700.
Acceptance criteria
- A test of the stage agent finds
Coderwith the stock capabilities,RequireVerificationwith the three checks, and no custom tool. - The custom engine code and its tests are gone.
Related
- refactor(roadmap): run stage on Coder in the runner image #6528, and the split item for the phases, which comes first.
Source
Source: #6528
Alternatives check of 2026-11-22: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
The stage planner is a custom engine. It has its own tools, toolbox, gate returns, gate extension and schema retry. It duplicates the coding-agent capability of the pydantic-ai harness. The change replaces it with the stock Coder agent, LocalWorkspace and RequireVerification, and it deletes the custom engine.
Acceptance criteria
Requirement: Stock Coder stage agent
The stage agent MUST use the stock Coder capability with LocalWorkspace and MUST add no custom tool.
Scenario: Stage agent capability list
- WHEN A test builds the stage agent with a checkout and a stub model.
- THEN The capabilities of the agent hold
CoderandLocalWorkspace, and no capability comes from the removed stage toolbox.
Requirement: Verification of the plan files
The stage agent MUST use RequireVerification with the checks devops openspec check, openspec validate and devops roadmap plan-recheck --source . --branch HEAD, and MUST exempt no path.
Scenario: Verification check list
- WHEN A test builds the stage agent.
- THEN The
RequireVerificationcapability holds these three checks in this order, and itsexempt_pathsis empty.
Requirement: Unverified run records plan_defect
A stage agent run that ends without a passing verification MUST record the failure class plan_defect on the item.
Scenario: Agent run that fails verification
- WHEN A test runs the agent phase with a stub
Coderthat ends unverified. - THEN The job record of the item holds
plan_defect.
Requirement: Publish stops on plan_defect
The publish phase MUST stop the item when the job record holds plan_defect.
Scenario: Publish after an unverified run
- WHEN A test runs
devops roadmap stage --phase publishon an item whose record holdsplan_defect. - THEN The command exits 1 and pushes no branch.
Requirement: Proposal from the written change folder
The stage job MUST read the proposal from the change folder that the agent wrote and MUST take the pull request body from the candidate of the same run.
Scenario: Plan written by the agent
- WHEN A test runs the agent phase on a stub checkout that writes
openspec/changes/6705-stage-agent/proposal.mdand a body candidate. - THEN The publish phase reads the proposal of that folder and the pull request body from the candidate of the run.
Requirement: Custom engine removed
The change MUST delete the custom stage tools, toolbox, gate returns, gate extension and schema retry.
Scenario: Removed modules and settings
- WHEN A test imports the stage package and loads the settings.
- THEN
devops_cli.roadmap.stage.stage_toolsanddevops_cli.roadmap.stage.stage_toolboxdo not import, androadmap.stageholds nogate_returns,gate_return_extensionsorverify_repair_roundskey.
Requirement: Default phase stays all
devops roadmap stage MUST keep all as its default phase, so CronJob roadmap-stage runs the whole stage with no change until #3700.
Scenario: Stage command with no phase
- WHEN A test calls
devops roadmap stage --job-item 6705 --confirmwith no--phaseand a stub for each phase. - THEN The command runs
prepare, thenagent, thenpublish.
Requirement: No GitHub credential in the agent phase
The agent phase MUST run with no GitHub credential.
Scenario: Agent phase environment
- WHEN A test builds the agent phase with a job environment that holds
GITHUB_TOKEN. - THEN The environment of the agent phase holds no
GITHUB_TOKENand noGH_TOKENvalue.
Existing Tool Considered
The pydantic-ai harness covers the need. Its Coder, LocalWorkspace and RequireVerification capabilities replace the custom stage engine, and src/devops_cli/roadmap/implement/implement_step.py already uses Coder and LocalWorkspace. The alternatives check of 2026-11-22 in the issue body records not-applicable for this refactor and names no tool, so it names no cover and no lack. The harness holds no project check: the change gives RequireVerification the three commands, and it keeps no custom tool.
Key questions
- Which tool supplies the stage agent and its verification?: The pydantic-ai harness supplies
CoderwithLocalWorkspace, andRequireVerificationsupplies the checks. The implement step already usesCoderandLocalWorkspace, so the stage agent uses the same code path. (best practice) [sources: src/devops_cli/roadmap/implement/implement_step.py, src/devops_cli/ai/knowledge_base/devops_cli/libraries/pydantic_ai_harness.md:35, docs/ROADMAP_WORKFLOW.md:453]- Chosen: Stock
Coderfrom the pydantic-ai harness. The owner decided it, and the implement step already uses it. - Rejected: Keep the custom stage engine. It duplicates the harness and adds tools, gate returns and a schema retry to keep.
- Rejected: Write a new stage engine. It repeats the cost that this refactor removes.
- Chosen: Stock
- Which commands does
RequireVerificationrun, and which paths does it exempt?: The body gives the three checks from the owner decision in refactor(roadmap): run stage on Coder in the runner image #6528:devops openspec check,openspec validateanddevops roadmap plan-recheck --source . --branch HEAD.exempt_paths=()covers the Markdown plan files. The image holds the pinned OpenSpec and a Node runtime, soopenspec validateruns in the job. (best practice) [sources: docs/CLUSTER.md:52, docs/ROADMAP_WORKFLOW.md:453]- Chosen: Three checks with
exempt_paths=(). The checks cover the Markdown plan files, so a plan defect fails the run. - Rejected: One combined check. It hides which check failed, so the agent repairs less.
- Rejected: Exempt the change folder. The plan files escape the checks, so an unverified plan can pass.
- Chosen: Three checks with
- How does the job record an unverified run, and what stops the item?: The job records the class
plan_defecton the item. Thepublishphase stops the item on that value, with exit 1. The stage row waits an hour for aplan_defectitem and counts the run towardroadmap.stage.plan_defect_limit. [sources: src/devops_cli/config/settings.py:1391, src/devops_cli/roadmap/stage/stage_job.py, docs/CLUSTER.md:100, CONTEXT.md] - Which code holds the custom engine that the change deletes?: The issue names
stage_tools.pyandstage_toolbox.py. The gate returns, the gate extension and the schema retry live in the stage job. The settingsroadmap.stage.gate_returns,gate_return_extensions,verify_repair_roundsandverify_repair_rounds_ceilinggo with them, and so does the seed filesrc/devops_cli/roadmap/stage/stage_finding_classes.json. [sources: src/devops_cli/roadmap/stage/stage_job.py, src/devops_cli/roadmap/stage/stage.py, src/devops_cli/config/settings.py:1391, docs/CLUSTER.md:52, docs/ENV_VARS.md:276] - Does the agent phase get a GitHub credential?: No. The
agentphase holds no GitHub credential. Thepreparephase reads the item and thepublishphase pushes with the Service token. The prompt gives the agent the issue text thatprepareread. (best practice) [sources: docs/CLUSTER.md:52, docs/ROADMAP_WORKFLOW.md:453]- Chosen: No credential in the agent phase. The agent runs no GitHub request, so no token sits in a shell that the agent controls.
- Rejected: A read-only token. It adds a credential to a shell that the agent controls.
- Rejected: The Service token. It gives the agent write access that the stage job does not need.
- Which item delivers the phase split, and does it come before this one?: The split item for the phases comes first. It delivers
--phase prepare|agent|publish|alland--work. The body gives no number, so refine must add that number todependencies. This issue keepsallas the default phase, so CronJobroadmap-stagedoes not change until feat(roadmap): add the three-container runner Job, policy and log reads #3700. [sources: docs/CLUSTER.md:52, docs/CLUSTER.md:100]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 21, 2026
Both items change the stage or implement agent tooling, but the candidate replaces the stage agent with stock Coder while 3148 adds read-only code tools to the implement agent.refactor(roadmap): stage pushes the plan commit on the phases (#6710)
devops-cli-service commentedon Nov 22, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
19 remaining items
feat(roadmap): the agent phase of stage holds no GitHub credential
feat(roadmap): publish of the stage Job checks the plan in its one push
feat(roadmap): the stage command takes a phase and a run folder
docs(roadmap): the phases of the stage Job and the measured checks
docs(roadmap): leave ADR 0030 within its word limit
docs(adr): ADR 0036 records the stage agent on stock Coder
chore(openspec): archive 6705-stage-agent-stock-coder
refactor(roadmap): catch AgentRunError and DevOpsCLIError in stage agent
devops-cli-service commentedon Nov 23, 2026
Released in v0.201.6: https://github.com/dan-petty/devops-cli/releases/tag/v0.201.6
devops-cli-service commentedon Nov 23, 2026
Live since 2026-11-23 17:12 UTC