Repository navigation
Description
Problem or Motivation
After a plan PR merges, delete_branch_on_merge deletes the plan branch, and the implement Job makes its own branch. D1 of the approved pipeline split design (tracker #5482) runs scaffold of kind delivery first in the tests unit. E2 needs test and module stubs from tasks.md as Coder input.
Proposed Solution & Architectural Design
- Add
--kind deliverytodevops roadmap step scaffold(feat(roadmap): scaffold makes, resumes or adopts the item branch #5499), with the same resume rule. - For a Planned item, create
<type>/<issue>-<slug>at the latestorigin/mainhead, with no commit. - Write test and module stubs from
tasks.mdin the worktree for the Coder. Arm A writes plain stubs. Arm B adds a header comment (for E2). Scaffold commits no stub. - Until the tests unit ships, the implement Job calls it first. Then the structural test of feat(roadmap): scaffold makes, resumes or adopts the item branch #5499 covers the implement modules too: no implement module other than
steps/scaffold.pycreates the delivery branch ref.
Target Subsystem
Roadmap Service and roadmap jobs (src/devops_cli/roadmap/steps/, src/devops_cli/roadmap/implement/).
Acceptance Criteria
- Test first: a Planned item gets a branch ref with no commit and one stub for each task path. The test fails on the base.
- A test: arm B adds the header comment, and arm A does not.
- Live proof: after the merge and the release, the implement Job runs scaffold of kind
deliveryas the App on the next Planned item. A comment on this issue gives the result line.
Existing Tool Considered
The GitHub git refs API and the OpenSpec tasks reader exist. Build: 150,000 to 300,000 agent tokens and 0.5 day.
Related
Tracker #5482, Phase 7. Depends on #5499. #5519, #5520.
Source: #5482
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Alternatives check of 2026-11-23: in-use.
The repository already uses this tool.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-23, maintained.
Reason: Searches found no tool that creates a delivery branch ref and writes test and module stubs; OpenSpec, already the project's change layer, supplies the tasks.md checklist and its reader, which the scaffold reuses.
Covers:
- Writes the tasks.md implementation checklist per change
- Reads and parses a change's task list
- Validates and archives change proposals
Lacks:
- Creates the branch ref at the origin/main head
- Writes empty or header test and module stubs
- Resume rule and the --stub-arm choice
- Keeps stubs untracked with no commit
Proposed design
Problem statement
A plan pull request merges, and delete_branch_on_merge deletes the plan branch. The implement job then makes its own branch. D1 of the approved pipeline split design (tracker #5482) runs a scaffold of kind delivery first in the tests unit. E2 needs test and module stubs from tasks.md as Coder input. This item adds the delivery kind to devops roadmap step scaffold. The step creates the branch ref at the origin/main head with no commit, and it writes the stubs. The live proof after the release goes to a separate issue.
Acceptance criteria
Requirement: Delivery branch ref
The delivery scaffold SHALL create the branch ref refs/heads/<type>/<issue>-<slug> at the origin/main head and SHALL make no commit.
Scenario: Ref at the origin/main head
- WHEN A test runs
devops roadmap step scaffold --kind deliveryfor a Planned item with a fake GitHub client, in a checkout whoseorigin/mainhead is one commit. - THEN The fake records one ref create call for
refs/heads/<type>/<issue>-<slug>at that SHA, andgit rev-parse HEADgives the same SHA after the run.
Requirement: Resume rule
A second run of the delivery scaffold SHALL create no ref and write no stub when the ref and the stub files exist.
Scenario: Second run changes nothing
- WHEN A test runs the delivery scaffold twice for one Planned item with a fake GitHub client.
- THEN The second run records no ref create call, each stub file keeps its bytes, and the command exits 0.
Requirement: Stub for each task path
The delivery scaffold SHALL write one stub file for each repository path that a task of the change names in backticks.
Scenario: Test stub and module stub
- WHEN The
tasks.mdof the change namessrc/app/foo.pyin one task andtests/app/test_foo.pyin another, and a test runs the delivery scaffold with a fake GitHub client. - THEN The checkout holds
src/app/foo.pyandtests/app/test_foo.py.
Requirement: Arm A plain stub
Arm A SHALL write each stub as an empty file.
Scenario: Arm A writes empty files
- WHEN A test runs the delivery scaffold with
--stub-arm a. - THEN Each stub file exists and has zero bytes.
Requirement: Arm B header
Arm B MUST write the line # TODO(#<issue>): implement <path> as the first line of each Python stub.
Scenario: Arm B writes the header
- WHEN A test runs the delivery scaffold with
--stub-arm bfor issue 5518 and the pathsrc/app/foo.py. - THEN The first line of
src/app/foo.pyis# TODO(#5518): implement src/app/foo.py.
Requirement: No stub commit
The delivery scaffold SHALL leave each stub untracked and SHALL make no commit.
Scenario: Stubs stay untracked
- WHEN A test runs the delivery scaffold and then
git status --porcelainin the checkout. - THEN Each stub shows the
??status, and the branch ref still points at theorigin/mainhead.
Requirement: Implement job uses the scaffold
The implement run SHALL get the delivery branch from the scaffold step and SHALL make no ref create call of its own.
Scenario: Scaffold runs before the first group
- WHEN A test runs the implement job for a Planned item with a fake GitHub client.
- THEN The recorded calls hold the delivery scaffold with
--kind deliverybefore the first group step, and the job makes no ref create call.
Requirement: One writer of the delivery ref
No module of src/devops_cli/roadmap/implement/ SHALL create a git ref.
Scenario: The implement modules create no ref
- WHEN A test reads each module of
src/devops_cli/roadmap/implement/for a call that creates a git ref. - THEN No module holds such a call, so the delivery ref comes only from
src/devops_cli/roadmap/steps/scaffold.py.
Existing Tool Considered
Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-17, maintained, is the tool of the alternatives check of 2026-11-17 in the issue body, with the verdict in-use. The issue body gives what the tool covers and lacks. The proposal uses the OpenSpec tasks reader for the task list. It adds only what OpenSpec lacks: the delivery branch ref at the origin/main head, the test and module stubs, the --stub-arm choice and the resume rule. The issue body gives the written cost of that code: 150,000 to 300,000 agent tokens and 0.5 day.
Key questions
- Which modules hold the delivery scaffold, the stub paths and the implement job?: The roadmap step modules live in
src/devops_cli/roadmap/steps/, and the issue namessteps/scaffold.pyas the module of the scaffold step. feat(roadmap): scaffold makes, resumes or adopts the item branch #5499 adds that step. The stub paths come fromparse_task_groupsinsrc/devops_cli/roadmap/step_files.py, which readstasks.md. The implement job runs fromsrc/devops_cli/roadmap/implement/implement_run.py. [sources: src/devops_cli/roadmap/steps/watch.py, src/devops_cli/roadmap/step_files.py:211, src/devops_cli/roadmap/implement/implement_run.py] - How does the delivery scaffold create the branch ref with no commit?: The scaffold asks the GitHub client of the project for one git ref at the SHA of the
origin/mainhead. It makes no local commit and no push. (best practice) [sources: CONTEXT.md, docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md]- Chosen: GitHub git refs API through the in-process client. It creates a ref at a SHA with no local commit and no push, and the step already holds the App token.
- Rejected: Push of a local branch. A push needs a commit, and it changes the checkout.
- Rejected:
gh apisubprocess. It adds a process and gives no typed result, and the step calls GitHub in process.
- Which branch name and base does the delivery scaffold use?: The name comes from the shared branch form in
src/devops_cli/git/branch_form.py, with the type of the issue title and the slug of the change folderopenspec/changes/<issue>-<slug>/. The base is theorigin/mainhead at the run. (best practice) [sources: src/devops_cli/git/branch_form.py:54, CONTEXT.md]- Chosen: One shared branch name function. The implement job and the scaffold give the same name, so no second rule drifts.
- Rejected: Build the name in the scaffold. Two rules for one name can differ.
- How does the scaffold find the stub paths, and where does it write the stubs?: It reads the tasks of the change with
parse_task_groupsinsrc/devops_cli/roadmap/step_files.py, and it takes each repository path that a task names in backticks. It writes each stub under the checkout path that the caller gives it. (best practice) [sources: src/devops_cli/roadmap/step_files.py:211, CONTEXT.md]- Chosen: Paths of the tasks in
tasks.md.tasks.mdis the checklist of the change and the Coder input, and the step reader already parses it. - Rejected: Glob the spec deltas. A spec delta holds no file path.
- Rejected: Let the Coder write the stubs. E2 needs the stubs before the Coder runs.
- Chosen: Paths of the tasks in
- How does a run pick arm A or arm B, and what does arm B write?: The step takes
--stub-arm {a,b}with defaulta. Arm A writes an empty file. Arm B writes# TODO(#<issue>): implement <path>as the first line of each Python stub. A run names the arm on its command line. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/steps/watch.py]- Chosen:
--stub-armoption on the step. One command tests both arms offline, and the experiment needs no config change. - Rejected: Setting in
.github/roadmap.tomlonly. A test then needs a config change to reach arm B. - Rejected: A second scaffold command. A roadmap step is one module and one command.
- Chosen:
- What does a second run of the delivery scaffold do?: A second run creates no ref when the branch exists on
origin, and it writes no stub when the file exists. It exits 0. (best practice) [sources: CONTEXT.md]- Chosen: Create only when absent. GitHub state is the first marker, so a second run is safe and keeps the commits of the implement job.
- Rejected: Move the ref to the
origin/mainhead. It would drop the commits that the implement job made.
- Does the delivery scaffold commit the stubs?: No. The scaffold leaves each stub untracked and makes no commit. The implement job commits the work of a task group after its checks pass. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement_run.py]
- Chosen: Leave each stub untracked. The scaffold only prepares the worktree, and the implement job owns the commits.
- Rejected: Commit the stubs in the scaffold. A commit on the delivery branch before the first group hides the untracked state that E2 reads.
- How does the proposal prove the delivery scaffold in the live implement job?: It does not. The live proof waits on the release of this item and on the next Planned item, and only those outside events settle it. A separate issue holds the live proof, and offline tests cover the branch ref, the stubs, the arms and the resume rule. (best practice) [sources: CONTEXT.md]
- Chosen: Defer the live proof to a separate issue. The rest of the item is workable offline, so the item can reach Ready without the live proof.
- Rejected: Keep the live proof in this item. No offline test shows the App token, the real
origin/mainhead and a real Planned item.
- What holds this item before it starts?: The item needs feat(roadmap): scaffold makes, resumes or adopts the item branch #5499 for the
--kind deliveryoption and chore(roadmap): hold incremental stage and implement work #6521 for the re-architecture of the stage, implement and fix-checks jobs. Waiting on another item is a dependency, not a block. [sources: CONTEXT.md]
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both work in the roadmap implement area, but the candidate adds a scaffold delivery kind while #2665 defines the implement job that would call it.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: Searches found no tool that scaffolds a delivery branch and stubs; OpenSpec already supplies the tasks.md task list that names the stub paths, but it creates no ref and writes no files.
The repository already uses this tool.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-17, maintained.
Covers:
Lacks:
--kind deliveryscaffold step or resume ruleSearches (8)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Owner question: Who gives the live proof after the release? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
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.
devops-cli-service commentedon Nov 22, 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.