Repository navigation
Description
Problem or Motivation
Parent: #2653. No command makes a Ready item Staged. An agent does each step by hand, and nothing sizes the task groups of a change to a context budget.
Proposed Solution & Architectural Design
devops roadmap stage [--repo] [--item N] [--filter family=value]... [--limit N] [--step-tokens N] [--dry-run | --plan | --confirm].
Selection:
--filteris repeatable,family=valueover the label familiesstatus,priority,type,valueandeffort. Values of one family are OR, and families are AND. The default isstatus=ready priority=p0-critical priority=p1-high type=bug.- Left out: an item with
needs-split, a Blocked or started item, an item whose author is not trusted (CONST_ROADMAP_TRUSTED_AUTHORS, because the model reads the body), an item whose "Dependencies" names an open issue, and a held item: a pushed branch of the form<type>/<issue>-<slug>exists, a worktree of the clone holds one, or an open pull request names the issue (the rule ofworktree_add.py). --limit(default 3) caps a run.--itemstages the one item it names when it is open and Ready.
Per item, in the job's clone (the model lane's model-clone), on a worktree of that clone so that its HEAD stays on the default branch:
- Fetch, and make the branch
<type>/<issue>-<slug>atorigin/<default>:typefrom the Conventional Commit type of the title,slugfrom the title (branch_form.py). - One
chat_structuredcall withai.for_task("analysis")and the promptroadmap_stage_change.md. Inputs: the title, the refined body (problem statement, acceptance criteria, key questions, and the alternatives block when present), the output ofopenspec list --specs, the repository map and the files the body cites, within the task's context window. Reply: the proposal (Why, What Changes, Feasibility, Existing Tool Considered, withskip_specswhen the change is not observable), the spec deltas (reuse a capability, a Purpose on a new one), the design (decisions and rejected alternatives), andtasks.mdas groups. A group holds its failing test, its implementation, its documentation regeneration and one verification command, and names the files it reads and changes. The reply also gives a pull request title whose summary is at most 60 characters. - The job measures each group with tiktoken: the group's named files, packed with
ai/context_packer.py, plus the change folder and the item. A group over--step-tokens(defaultroadmap.stage.step_tokens, 40000) goes back to the model once with the measure and the ask to split it. A group still over budget stops the item: a comment names the group and its measure, the record keepsstage.needs_split, and a person decides. The budget is the inputs of one implementation step. The rest of the 128k window is for tool output and the model's turns. openspec validate <change> --strictwhen theopenspecbinary is onPATH. A failed validation goes back to the model once, and a second failure stops the item. Without the binary the job says so in the pull request comment, and the OpenSpec gate of CI judges it.- Commit as the App, push with
-u origin, and open the draft withdevops pr create --title <title> --body <body>. The body is the permanent what and why of the proposal, and it starts withPlans #<issue>. It holds no closing keyword: whoever lands the code rewrites it toCloses #<issue>. - One comment on the issue with the marker
devops roadmap stage: the branch, the pull request, the groups with their measures, and the budget. The job record keepsstage.branch,stage.pr,stage.shaandstage.groups. The Status label is unchanged.
Reconcile, each run: a staged branch whose item is closed, and whose commits past origin/<default> are all the App's, loses its draft pull request and its branch, so no remote branch stays without an open pull request (docs/ROUTINE_TASKS.md).
Errors: a model call that fails skips its item, and the run fails after the others, naming each. Rejected credentials stop the run. A push that GitHub refuses stops the item with the reason. --dry-run makes no request. A text that looks like a secret in a body is refused, as intake does.
Target Subsystem
src/devops_cli/roadmap/ (new stage.py), src/devops_cli/commands/roadmap.py, src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/git/, CONTEXT.md (the terms "Staged" and "Step"), README.
Existing Tool Considered
OpenSpec for the change and its validation, worktree_add.py and branch_form.py for the branch, devops pr create for the draft, tiktoken for the measure, and ai/context_packer.py for the packing. The job builds the selection, one structured call, the measure loop and the writes, in refine's shape. Estimated cost: about 1,400 lines of code and tests, around 400k tokens of agent work and two days of elapsed time, plus upkeep when OpenSpec's schema changes.
Key questions
- Why a draft pull request for a plan with no code? Every remote branch needs an open pull request (docs/ROUTINE_TASKS.md), and a plan-only draft with
Plans #Nand no closing keyword is the agreed form.devops pr check-readinessblocks it until the archive is added, and the job never marks it ready. - Why does Status stay Ready? Started means in progress, in review or done. A staged item has no code yet. The draft pull request is the visible link.
- What is the budget measured against? The inputs of one implementation step: the step's instructions, the item, the change folder and the group's packed files. 40000 tokens leaves most of a 128k window for tool output and turns. The setting is tunable.
Acceptance criteria
- With GitHub, git and the model faked at their edges, a run on a Ready P1 bug makes the branch, writes a valid change with groups under budget, pushes one commit by the App, opens a draft whose body starts with
Plans #N, comments once and records the keys. - An item that is held, Blocked, started,
needs-split, untrusted, or with an open dependency is left out, and the plan says why. - A group over budget after one split stops the item with a comment and
stage.needs_split. - The staged branch and draft of a closed item are removed when every commit past the default branch is the App's, and kept when any other commit exists.
--dry-runmakes no request and lists the requests a run makes.uv run devops cipasses, anddevops docs generate --sync-readmeis run.
Source: #2653
Activity
dan-petty commentedon Oct 29, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The title uses the 'feat' prefix and the body defines a new command with selection, AI calls, validation, and PR creation.It automates a manual multi-step process but does not block a release or fix a defect.It replaces a hand-run agent sequence with one command that sizes work to a context budget and opens a draft PR.It spans branch creation, structured AI calls, tiktoken measurement, openspec validation, PR creation, and reconciliation logic.devops roadmap refine) #744, which asks for a different change.Both are roadmap pipeline steps; #744 produces Ready items via 'refine', while this candidate consumes Ready items via 'stage'.chore(main): release 0.18.0 (#2685)