Skip to content

feat(roadmap): devops roadmap implement runs one task group of a staged change in one 128k context with the pydantic-ai-harness Coder #2664

Description

@dan-petty

Problem or Motivation

Parent: #2661. No command runs one task group of a staged change in one bounded context. An agent session runs the whole change with the whole repository in context.

Proposed Solution & Architectural Design

devops roadmap implement --item N --group n [--source <checkout>] [--dry-run] runs one step and writes nothing to GitHub. A person runs it in a worktree, and the job (sub-issue 2) runs it for each group.

The engine:

  • A new dependency, pydantic-ai-harness[coder], pinned at one version as pydantic-ai is, with a knowledge base note.
  • One pydantic-ai Agent with the capabilities LocalWorkspace(<checkout>), Coder() and the spend capability of the construction point of refactor(ai): Replace PydanticAgent with pydantic-ai Agent #2489. Until that lands, the step records spend as refine_investigation.py does. The allowlist of the shell tool is git, uv, ruff, mypy, openspec and devops. Any other program is refused. The model is get_task_model("implement"): a new task ai.tasks.implement in AITasksConfig, default model devops-coder with context_window 128000.
  • The budget: UsageLimits caps the requests of a run (CONST_ROADMAP_IMPLEMENT_MAX_REQUESTS, 80) and its tool calls. ToolOutputLimits cuts each tool result. The step refuses to start when its inputs measure over ai.tasks.implement.context_window minus the reserve for turns, and says so. A run that reaches a limit ends as stopped, with pydantic-ai's error class as the reason.

The inputs of the step, and nothing else: the instructions (roadmap_implement_step.md: write the failing test first, change only what the group names, keep the rules of AGENTS.md that apply to code, tick each task when its work is done, run the verification command, and stop when it passes), the item's title, problem statement and acceptance criteria, the change's proposal.md, design.md and tasks.md, the one group, and the group's named files packed with ai/context_packer.py. The agent reads more with its tools inside the budget.

The exit of the step, judged by the job and not by the model:

  • The group's verification command passes when the job runs it after the agent returns.
  • ruff check, ruff format --check and mypy --strict pass on the changed files.
  • Every task of the group is ticked in tasks.md, and no task of another group changed.
  • Then the job commits the worktree as <group title> (#N). Otherwise the step reports stopped with the reason and the agent's last message, and the worktree is reset to the last commit.

The report is a structured StepOutcome (done or stopped, the reason, the commit, the requests and tokens spent), printed as a table or JSON.

Target Subsystem

src/devops_cli/roadmap/implement_step.py, src/devops_cli/commands/roadmap.py, src/devops_cli/ai/tasks/roadmap_implement_step.md, src/devops_cli/config/settings.py (the task), pyproject.toml, src/devops_cli/ai/knowledge_base/devops_cli/libraries/.

Existing Tool Considered

pydantic-ai-harness Coder and LocalWorkspace, and pydantic-ai UsageLimits. The project builds the step's inputs, exit checks and report, and no agent loop. The Claude Agent SDK, the Copilot coding agent, OpenHands, SWE-agent and Aider are rejected on the parent. Estimated cost: about 800 lines of code and tests, around 300k tokens of agent work and one day of elapsed time, plus upkeep across the 0.x releases of the harness.

Key questions

  • Which model serves the step? devops-coder (qwen3-coder:30b on ollama-48gib-fast, OLLAMA_CONTEXT_LENGTH 128000). The route gets max_input_tokens: 128000 in the gateway so that an oversized prompt is refused before the backend.
  • Is one attempt enough? Yes for this item. A stopped step waits on a person. A retry policy is the job's decision (sub-issue 2).
  • Is the shell tool safe? The allowlist admits the project's tools only, the step runs in a checkout with no credential in its environment, and the runner (sub-issue 3) adds the limits of the pod.

Acceptance criteria

  • With the model faked as a pydantic-ai FunctionModel and git at the process edge, a step on a group whose fake writes the test and the code ends done, with one commit and the tasks ticked.
  • A step whose verification fails after the agent returns ends stopped, commits nothing and resets the worktree.
  • A step whose inputs measure over the window refuses to start and names the measure.
  • A shell call to a program outside the allowlist is refused, and the run goes on.
  • uv run devops ci passes, and devops docs generate --sync-readme is run.

Source: #2661

Activity

  1. added
    source/agent
    type/feature
    status/new
    value/high
    effort/medium
    on Oct 29, 2026
  2. dan-petty commented on Oct 29, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. Adds a new devops roadmap implement command with a pydantic-ai-harness Coder step.
    • Priority: P2-Medium. Core pipeline step that the job (sub-issue 2) depends on, but not a defect or security gap.
    • Value: High. Gives users a bounded-context command that implements one task group and verifies the result.
    • Effort: Medium. About 800 lines of code and tests, one day of elapsed time, plus new dependency upkeep.
    • Related: feat(roadmap): devops roadmap stage writes the change of a Ready item in context-sized task groups and opens its draft pull request #2654, which asks for a different change. Both are roadmap pipeline commands; #2654 stages and sizes task groups, the candidate implements one group with the Coder agent.
  3. added
    priority/p2-medium
    on Oct 29, 2026
  4. removed
    status/new
    on Oct 30, 2026
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-mediumsource/agenttype/featurevalue/high

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions