Repository navigation
Description
Problem
The stage job succeeds in 47% of graded attempts (7 days to 2026-11-20). That is under the 60% band, so the owner rule asks for a re-architecture (#6519). Stage runs in the Service image, with read-only tools that cap each answer and with no shell. It returns one strict StageProposal object with one schema retry. About 20 gates run after the run, so the model never sees their results. Each refused plan starts a new run with no history.
Change
Run stage as a Coder agent in the runner image (#6417):
- The agent writes the plan files itself. It runs
devops openspec new,devops openspec checkandopenspec validatein its shell. - The cheap plan checks run inside the loop as output validators, so the model sees a refusal and fixes it.
- A refused plan continues the same conversation.
- Delete the hand-written stage read tools.
Add no new gate, cap or screen.
Acceptance
- A test finds the stage agent built on
Coderwith the stock shell and no hand-written read tools. - 30 or more stage attempts on this version are graded. Every attempt counts.
Dependencies
- feat(k8s): run the stage job in the runner image #6417
- build(deps): move pydantic-ai to 2.68 and its retry parts #5098
Source: #6519
Alternatives check of 2026-11-20: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
The stage job succeeds in 47% of graded attempts in the 7 days to 2026-11-20. That is under the 60% band, so the owner rule asks for a re-architecture (#6519). Stage runs in the Service image with read-only tools, no shell and one strict StageProposal reply. The model never sees the plan checks, and each refused plan starts a new run. This item runs stage as a stock Coder agent in the runner image after #6417 and #5098, runs the plan checks in the loop, continues the same conversation after a refusal, and removes the hand-written stage read tools. The 30-attempt grade goes to a follow-up issue.
Acceptance criteria
Requirement: Stage agent uses stock Coder
The stage plan step SHALL build its agent from the stock Coder of pydantic-ai-harness 0.71.
Scenario: The stage step builds a Coder agent
- WHEN A test runs the stage plan step with the scripted model of
tests/support/model_script.py. - THEN The step builds a
Coderagent frompydantic-ai-harnessand sends it the plan prompt.
Requirement: Stage agent uses the stock Coder tool list
The stage agent MUST use the stock tool list of Coder, including its shell, and MUST hold no hand-written stage read tool.
Scenario: The tool list holds the stock shell and no stage read tool
- WHEN A test builds the tool list of the stage agent.
- THEN The list equals the stock tool list of
Coderand the stage module exposes no hand-written stage read tool.
Requirement: Plan checks use RequireVerification
The stage step SHALL run the plan checks through RequireVerification of pydantic-ai-harness 0.71.
Scenario: The verification list holds the plan checks
- WHEN A test builds the verification configuration of the stage step.
- THEN The configuration holds
devops openspec check,openspec validateanddevops roadmap plan-recheck --source . --branch HEAD.
Requirement: A refused plan continues the same conversation
The stage step SHALL return each RequireVerification refusal to the same agent conversation.
Scenario: The agent fixes a refused plan in one conversation
- WHEN A test gives the stage step a first plan that fails a plan check and a second plan that passes.
- THEN The step opens one agent conversation, sends the refusal text to it, and ends with the passing plan.
Requirement: Stage prompt names the plan commands
The stage prompt MUST name devops openspec new, devops openspec check, openspec validate and devops roadmap plan-recheck --source . --branch HEAD.
Scenario: The stage prompt lists the plan commands
- WHEN A test builds the stage prompt.
- THEN The prompt holds the four command lines.
Requirement: Stage result comes from the written change
The stage step SHALL build its StageProposal from the files of the change folder that the agent wrote.
Scenario: The written change folder becomes the proposal
- WHEN A test runs the stage step with an agent that writes a change folder.
- THEN The step reads the files of that folder with
read_changeofsrc/devops_cli/roadmap/plan_read.pyand returns theStageProposalit gives.
Existing Tool Considered
The alternatives check in the issue body records not-applicable on 2026-11-20 and names no external tool. The change uses the open, maintained pydantic-ai-harness 0.71 that the repository already installs. Its Coder gives the stock shell agent, and its RequireVerification gives the in-loop plan checks. The library lacks the stage prompt, the plan-check command list, the StageProposal read-back and the removal of the hand-written stage read tools; this item adds those.
Key questions
- Which open, maintained tool or library covers the need?: The alternatives check in the issue body records
not-applicableon 2026-11-20 and names no external tool. The change uses the openpydantic-ai-harness0.71 that the repository already installs. ItsCodergives the stock shell agent, and itsRequireVerificationgives the in-loop plan checks. The library lacks the stage prompt, the plan-check command list, theStageProposalread-back and the removal of the hand-written stage read tools; this item adds those. (best practice) [sources: pyproject.toml:41, src/devops_cli/roadmap/tools.py, tests/support/model_script.py, src/devops_cli/roadmap/plan_read.py]- Chosen: Use pydantic-ai-harness 0.71. The repository already uses its Coder, and it gives the in-loop verification.
- Rejected: Build a custom stage harness. The installed library already gives the agent shell and the verification loop.
- Where do the cheap plan checks run?: In the agent loop through
RequireVerificationofpydantic-ai-harness0.71. The checks aredevops openspec check,openspec validateanddevops roadmap plan-recheck --source . --branch HEAD. A refusal returns to the same conversation. (best practice) [sources: src/devops_cli/roadmap/plan_check.py:530, tests/roadmap/test_roadmap_plan_recheck.py, tests/support/model_script.py]- Chosen: RequireVerification of pydantic-ai-harness 0.71. The installed upstream library gives the in-loop verification and returns a refusal to the same conversation.
- Rejected: Custom output validators. The installed library already gives the loop, so custom code adds cost.
- Rejected: run_command with ShellRefusal. The stock Coder shell replaces this policy path.
- How does the stage step build its
StageProposalafter the agent writes the files?: It reads the files of the written change folder withread_changeofsrc/devops_cli/roadmap/plan_read.py. The gates keep theStageProposalshape. (best practice) [sources: src/devops_cli/roadmap/plan_read.py:647, src/devops_cli/roadmap/stage/stage_change.py:701, src/devops_cli/roadmap/plan_check.py:530]- Chosen: Read the change folder with read_change. read_change takes the files of a change folder as text and returns the plan in the shape that the gates read.
- Rejected: Parse the model reply. The agent writes the files, so the reply is no longer the source of the plan.
- How does the item check the 60% band?: A follow-up issue grades 30 or more stage attempts on the released version. This item delivers the code and adds no measurement. (best practice) [sources: CONTEXT.md, docs/roadmap/job-success.md]
- Chosen: Defer the grade to a new issue. The attempts need the release and elapsed time, and a pull request cannot deliver them.
- Rejected: Grade the attempts in this item. The item cannot wait for 30 released attempts inside one pull request.
- Which pull request order and base does the item use?: One pull request from
main, after feat(k8s): run the stage job in the runner image #6417 and build(deps): move pydantic-ai to 2.68 and its retry parts #5098 merge. The item does not stack on feat(k8s): run the stage job in the runner image #6417. (best practice) [sources: CONTEXT.md, k8s/devops/cronjob-stage.yaml:87]- Chosen: Build from main after feat(k8s): run the stage job in the runner image #6417 and build(deps): move pydantic-ai to 2.68 and its retry parts #5098. The item delivers one pull request, and the stage job reaches the runner image in feat(k8s): run the stage job in the runner image #6417.
- Rejected: Stack on the feat(k8s): run the stage job in the runner image #6417 branch. The item has its own dependencies and delivers one pull request from the default branch.
- What does the stage planner use today?: A read-only toolbox with no shell and no write tool. The
baseset has nine tools;extendedaddsreferences,read_issueandfind_issues; each set hasread_comment. [sources: src/devops_cli/roadmap/stage/stage_tools.py:1] - Which image does the stage Job run today?: The Service image.
k8s/devops/cronjob-stage.yaml:87namesghcr.io/dan-petty/devops-cli/service; feat(k8s): run the stage job in the runner image #6417 moves the stage Job to the runner image. [sources: k8s/devops/cronjob-stage.yaml:87, docs/ROADMAP_WORKFLOW.md:455] - How does the stage agent get its shell?: It uses the stock shell of
Coderin the runner image. The item adds no shell policy, no cap and no screen. (best practice) [sources: src/devops_cli/roadmap/tools.py, src/devops_cli/roadmap/implement/implement_shell_policy.py:126]- Chosen: Use the stock Coder shell. The stock Coder shell replaces the policy path, and the item adds no new cap.
- Rejected: Add
openspectoSHELL_PROGRAMS. The stock Coder shell already gives the command, so this adds a second policy path.
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 20, 2026
The stage job fails 53% of graded attempts, an increased error rate in a core pipeline stage.Both target running stage in the runner image, but #6417 switches the k8s Job template while the candidate re-architects the agent to a Coder with in-loop validation and conversation continuation.devops-cli-service commentedon Nov 20, 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.
fix(roadmap): bootstrap only the runner Jobs, after tier 1 (#6517)
dan-petty commentedon Nov 20, 2026
Owner decisions (2026-11-20, direct answers), after a scoping pass of this item:
mainafter feat(roadmap): run implement and fix-checks as prepare/agent/publish phases #3702 part B merges, not stacked.publishmodule of B pushes. Today stage pushes with plain git from the agent tree, which is safe only while the agent has no shell (feat(roadmap): run the implement agent shell in a real sandbox #2695).RequireVerificationof pydantic-ai-harness (0.71, installed). The checks aredevops openspec check,openspec validateanddevops roadmap plan-recheck --source . --branch HEAD. This replaces three parts of the refined design above: the custom output validators,run_commandwithShellRefusal, and the addition ofopenspectoSHELL_PROGRAMS. The agent is stockCoder(notslots.py).src/devops_cli/roadmap/steps/review.py, feat(roadmap): a review job gives each bot PR its verdict #5969) already gives each bot pull request, a plan included, one verdict. It runs in modeplannow. A check of the verify pass that the review step does not make goes to the review step, in its own issue.devops-cli-service commentedon Nov 21, 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.
feat(k8s): run the stage job in the runner image (#6572)
refactor(roadmap): run fix-checks as prepare, agent and publish phases (
devops-cli-service commentedon Nov 21, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
fix(roadmap): a moved re-stage branch stops the plan push
fix(roadmap): a moved re-stage branch stops the plan push
dan-petty commentedon Nov 24, 2026
Split issue #6705 replaced this item. Pull request #6883 merged #6705 into
mainin commit 4431302. The change ran the stage agent on stock Coder with the required verification checks. This item closes as not planned per AGENTS.md Rule 2.