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
Build the delivery kind of devops roadmap step scaffold after #5499 and #6521. The plan branch is gone after the plan PR merges, and the implement job must make the delivery branch and the Coder stubs. Offline tests cover the ref, the stubs, the two arms and the resume rule; the live proof is a person step after the release.
Acceptance criteria
Requirement: Delivery branch ref
The delivery scaffold SHALL create 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 # 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 job SHALL call the delivery scaffold in its prepare phase before the first task group and SHALL make no ref create call of its own.
Scenario: Scaffold runs in prepare
- WHEN A test runs the implement job for a Planned item with a fake GitHub client and a fake scaffold step.
- THEN The recorded calls hold the delivery scaffold with
--kind deliveryin the prepare phase before 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.
Requirement: Pending a person after the merge
After the release, the implement job SHALL run the delivery scaffold as the App on the next Planned item and SHALL write the result line as a comment on this issue.
Scenario: Live proof after the release
- WHEN The release that holds this change is out and a Planned item is next.
- THEN The implement job runs
devops roadmap step scaffold --kind deliveryas the App, and a comment on this issue gives the result line.
Existing Tool Considered
Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, maintained: the alternatives check of 2026-11-23 in the issue body gives 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 and adds only the behavior that the check says the tool lacks: it creates the ref at the origin/main head, writes the stubs, adds --stub-arm and applies 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/. feat(roadmap): scaffold makes, resumes or adopts the item branch #5499 adds the delivery scaffold as a step in that folder.parse_task_groupsatsrc/devops_cli/roadmap/step_files.py:216readstasks.mdand gives the task paths. The implement job phases are insrc/devops_cli/roadmap/implement/implement_run.py; its prepare phase holds the App token and its agent phase makes no GitHub call. [sources: src/devops_cli/roadmap/step_files.py:216, src/devops_cli/roadmap/implement/implement_run.py, src/devops_cli/roadmap/steps/watch.py, CONTEXT.md] - How does the delivery scaffold create the branch ref with no commit?: It calls the GitHub git refs API through the in-process GitHub client of the project. It creates
refs/heads/<type>/<issue>-<slug>at the SHA of theorigin/mainhead. It makes no local commit and no push. The prepare phase of the implement job holds the App token, so the scaffold runs there. (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, src/devops_cli/roadmap/implement/implement_run.py]- 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 prepare phase 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 job calls GitHub in process.
- Which branch name and base does the delivery scaffold use?: The branch is
<type>/<issue>-<slug>. The type comes from the issue title, and the slug comes from the change folderopenspec/changes/<issue>-<slug>/. The base is theorigin/mainhead at the run. (best practice) [sources: CONTEXT.md]- Chosen: The branch form in
CONTEXT.md. 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.
- Chosen: The branch form in
- 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_groupsatsrc/devops_cli/roadmap/step_files.py:216. 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:216, 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. 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.
- Where does the implement job call the delivery scaffold?: The implement job calls the delivery scaffold in its prepare phase, before the first task group. The prepare phase holds the App token. The agent phase makes no GitHub call. The job makes no ref create call of its own. (best practice) [sources: src/devops_cli/roadmap/implement/implement_run.py, 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: Prepare phase. The prepare phase holds the App token, and the agent phase must make no GitHub call.
- Rejected: Agent phase. The agent phase holds no GitHub credential and makes no GitHub call.
- Rejected: Each task group. One scaffold before the first group gives the same ref and stubs to every group.
- How does the proposal prove the delivery scaffold in the live implement job?: Offline tests cover the ref, the stubs, the two arms, the resume rule and the prepare call. The live proof is the acceptance criterion
Pending a person after the merge. After the release, a person checks the next Planned item and comments the result line on the issue. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md]- Chosen: Keep the live proof as a pending person acceptance criterion. Offline tests cannot show the App token, the real
origin/mainhead and a real Planned item, and the proof is after delivery. - Rejected: Make the live proof a person question. It does not change the pre-build plan, so it is a step after delivery.
- Rejected: Defer the live proof to a separate issue. The rule writes a post-release live proof as an acceptance criterion named
Pending a person after the merge.
- Chosen: Keep the live proof as a pending person acceptance criterion. Offline tests cannot show the App token, the real
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.
dan-petty commentedon Nov 30, 2026
Premise check after the release of the hold #6521 (2026-11-30):
devops roadmap step scaffoldwas deleted in 90cf4f6 (#6664); delivery branches now come fromimplement_phases.pyandopen_row.py. Closed as not planned (AGENTS.md rule 2); a person may reopen it, or file a new item from fresh evidence.