Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/ROADMAP_WORKFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ These are all the keys of the job record, by the job that writes them:
| Retitle | `retitle.skipped` | A hash of the title, the body and the `stage.pr` mark that the retitle job read when it left an Item with a long title or an unlisted title type (a person's edit, no plan title, no usable reply of the model, or a type with no correction). The job writes it once, with one log line that names the reason, and does not select the Item again while the hash holds. A change to the title, the body or `stage.pr` selects the Item again; a comment does not |
| Consolidate | `consolidate.declined` | The ids of the groups that a person declined for the Item as the anchor, joined by commas, written by `devops roadmap consolidate --decline <group-id> --confirm`. A group id follows its members, so a group whose members changed is a new group |
| Claim | `claim.replaced_status` | The Status that the Item held before an agent claimed it, restored when the claim is released |
| Scaffold | `scaffold.branch` | The branch that the scaffold step made, resumed or adopted for the Item (#5499). The step applies four resume rules: `resumed` when an App-only branch exists on origin; `held` when the branch holds a commit of a person or an agent; `adopted` when an App-only branch exists and the record does not name it; `created` when no branch exists (created with the git refs API and no commit) |
| Stage | `stage.branch`, `stage.pr`, `stage.sha` | The staged branch, its draft pull request and its last commit |
| Stage | `stage.needs_split`, `stage.file_cap` | The group over the budget, and the cap of that measure. The task groups with their size are in the plan-state comment of the plan pull request, and in no key (#6197) |
| Stage | `stage.ready` | The plan pull request that the Service has seen leave the draft state |
Expand Down
19 changes: 0 additions & 19 deletions docs/commands/roadmap.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 0 additions & 9 deletions docs/roadmap/stage.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,15 +157,6 @@ A pushed branch with no mark is never an orphan, because a person or another age

A stage Job judges the mark of its own item at any age when the check-out of the item (`stage.job`) names the Job: no other run publishes that item. So the pod that the Job controller runs again after an eviction removes the branch of the pod before it, and plans and stages the item in the same run ([The stage Job](#the-stage-job)).

### The scaffold step and resume rules

The scaffold step (`devops roadmap step scaffold`) manages the topic branch on `origin` (#5499). The step applies four resume rules:

- `resumed`: An App-only branch for the item exists on `origin`. The step resumes on this existing branch.
- `held`: A branch exists on `origin` and holds a commit of a person or an agent other than the App. The step leaves the branch alone and marks the item `held`.
- `adopted`: An App-only branch exists on `origin` but the item record does not name it. The step adopts the branch and records `scaffold.branch`.
- `created`: No branch exists on `origin`. The step creates the branch reference at `origin/main` with the GitHub git refs API and no initial commit.

### The verify screen

The verify screen is the decision point `stage.verify_screen` of [ADR 0020](../adr/0020-a-decision-point-is-a-unit-of-a-workflow-with-a-resolver-chain-and-a-rule-goes-before-a-decision-model.md), before the model review of the stage job. It is pilot 1 of the decision steps of [ADR 0019](../adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md). Code builds a digest of the plan: the criteria of the issue, the groups, the paths that the repository does not hold, and whether the verify command of a group names a test file. One request asks the decision model nine yes/no questions about it, one for each defect type. The cuts of the questions are data, in `src/devops_cli/roadmap/stage/jev_screen_cuts.json`, with the model, the day and the numbers of their fit. The point has no rule, because no rule is proven on the golden set.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schema: spec-driven
created: 2026-11-21
skip_specs: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Design

## Decisions

- The record key goes with the step. The stage job keeps an App-only branch of a Ready item by its `stage.pending` mark, which the stage job writes, so the rule of the orphan cleanup stays.
- `GitHubClient.create_ref` goes too: after the step, no code calls it.

## Rejected alternatives

- Keep the step for a person to run: no flow needs a branch with no commit, and the first push of a job makes the branch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Proposal: #6654

## Why

`devops roadmap step scaffold` makes the branch of an item on GitHub through the refs API, with no commit (#5499). No Job, Service row, manifest or workflow runs it; only its CLI registration names it. The first push of a job makes the branch. Closes #6654.

## What Changes

- Delete the step (`roadmap/steps/scaffold.py`), its command, its registration, its help text and its tests.
- Delete the record key `scaffold.branch` (`ScaffoldRecordKey`). The stage job resumes an App-only branch of a Ready item by its `stage.pending` mark alone, as no code writes `scaffold.branch` now. A record that still holds the key keeps it as the key of another version.
- Delete `GitHubClient.create_ref`, which only the step called, and its test.
- Delete the section of the step in `docs/roadmap/stage.md` and its row in `docs/ROADMAP_WORKFLOW.md`, and generate the reference again.

The command goes, so the change carries a spec delta.

## Capabilities

- `roadmap-stage/scaffold`: REMOVED each requirement of the step. The requirement 'The orphan cleanup keeps an App-only branch of a Ready item' stays: it is a rule of the stage job.

## Impact

`devops roadmap step scaffold` no longer exists. No automation called it. The change fits one pull request.

## Feasibility

- `git grep` over `src`, `tests`, `docs`, `openspec/specs`, `k8s` and `.github` found the readers: the registration, the help text, the record key in `stores/store.py` and `stage/stage.py`, `GitHubClient.create_ref`, the two documents, the spec and the tests. No manifest or workflow names the step.
- ADR 0021 names neither the step nor its resume rule, so no line of its Status History changes.

## Existing Tool Considered

The change deletes code. `git push` makes a branch, so no tool is needed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
## REMOVED Requirements

### Requirement: Create the item branch with no commit
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: The plain branch form with the change-folder slug
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: Resume on an App-only branch that the record names
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: Adopt an App-only branch that the record does not name
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: Hold a branch that a person or an agent wrote
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: One result line with the four results
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: A dry run sends no request
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: Only the scaffold module creates the plan branch ref
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.

### Requirement: The documents state the resume rule
**Reason**: The scaffold step is gone (#6654). No Job, Service row, manifest or workflow ran it.
**Migration**: None. The first push of a job makes the item branch.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Tasks

## 1. Behavior

- [x] 1.1 A command test shows that `devops roadmap step scaffold` is no command
- Verification: `$ uv run devops ci test tests/commands/test_roadmap_step.py`
- [x] 1.2 Delete the step, its command, its help text, its record key, `GitHubClient.create_ref` and their tests
- Verification: `$ uv run devops ci test tests/commands/test_roadmap_step.py tests/roadmap/stage tests/invariants/test_roadmap_workflow_doc.py`

## 2. Documents

- [x] 2.1 Delete the section of the step in `docs/roadmap/stage.md` and its row in `docs/ROADMAP_WORKFLOW.md`, and generate the reference again
- Verification: `$ uv run devops ci docs`

- Pending a person: review the diff in tuicr (tuicr -r <base>..HEAD).
65 changes: 1 addition & 64 deletions openspec/specs/roadmap-stage/scaffold/spec.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,13 @@
# roadmap-stage/scaffold Specification

## Purpose
How the scaffold step creates, resumes, adopts or holds the item branch for roadmap stage runs, and keeps App-only branches from being deleted.
How the stage job keeps the App-only branch of a Ready item when it judges the `stage.pending` mark of that item.

## Requirements

### Requirement: Create the item branch with no commit
The scaffold step SHALL create the item branch ref at the head of `origin/main` and add no commit when no branch names the item.

#### Scenario: No branch names the item
- **WHEN** the item has no branch on origin and the record holds no branch
- **THEN** the step creates one ref at the head of `origin/main`, writes `scaffold.branch` and writes the result `created`

### Requirement: The plain branch form with the change-folder slug
The scaffold step SHALL name the branch `<type>/<issue>-<slug>` with the slug of the change folder and no `-<i>` suffix.

#### Scenario: One candidate makes the branch
- **WHEN** `roadmap.<job>.candidates` is 1 and the change folder is `add-the-widget`
- **THEN** the branch name is `<type>/<issue>-add-the-widget`, built by `branch_form.branch_name`, and `branch_form.py`, `parse_branch` and `worktree_add.py` are unchanged

### Requirement: Resume on an App-only branch that the record names
The scaffold step SHALL resume on a branch that names the item when only the App wrote to it past `origin/main` and the record names that branch.

#### Scenario: The record names an App-only branch
- **WHEN** a branch names the item, each commit past `origin/main` has the App author, and the record holds that branch
- **THEN** the step writes the result `resumed`, keeps `scaffold.branch` and creates no ref

### Requirement: Adopt an App-only branch that the record does not name
The scaffold step SHALL adopt an App-only branch that names the item when the record holds no branch, and write that branch to `scaffold.branch`.

#### Scenario: An App-only branch with no record entry
- **WHEN** an App-only branch names the item and the record holds no `scaffold.branch`
- **THEN** the step writes the result `adopted` and records the branch name in `scaffold.branch`

### Requirement: Hold a branch that a person or an agent wrote
The scaffold step SHALL write the result `held` and change nothing when the branch holds a commit of a person or an agent past `origin/main`.

#### Scenario: The branch holds a commit of a person
- **WHEN** the branch holds a commit past `origin/main` whose author is not the App
- **THEN** the step writes the result `held` with the holder, writes no record key and makes no git or GitHub write

### Requirement: One result line with the four results
The scaffold step MUST write one JSON result line with `job=scaffold` and one result of `created`, `resumed`, `adopted` or `held`.

#### Scenario: A held branch ends the run
- **WHEN** the step ends with the result `held`
- **THEN** the line holds `job=scaffold` and `result=held`, and the step exits 0

### Requirement: A dry run sends no request
The scaffold step MUST send no request to GitHub or git when it runs with `--dry-run`.

#### Scenario: A dry run on an item with no branch
- **WHEN** the step runs with `--dry-run`
- **THEN** the fake GitHub client counts zero requests, the step writes no record key and the step creates no ref

### Requirement: Only the scaffold module creates the plan branch ref
No module of the roadmap stage SHALL create the plan branch ref other than `src/devops_cli/roadmap/steps/scaffold.py`.

#### Scenario: The structural test reads the stage modules
- **WHEN** the test reads each module under `src/devops_cli/roadmap/stage/` and `src/devops_cli/roadmap/steps/`
- **THEN** no module other than `steps/scaffold.py` calls the client method that posts to `POST /repos/{owner}/{repo}/git/refs`

### Requirement: The orphan cleanup keeps an App-only branch of a Ready item
The stage job MUST NOT delete an App-only branch of a Ready item when it judges a `stage.pending` mark.

#### Scenario: An orphan mark on a Ready item with an App-only branch
- **WHEN** a Ready item holds a `stage.pending` mark older than 1 hour and its branch holds only App commits
- **THEN** the job makes no delete of the branch

### Requirement: The documents state the resume rule
`docs/roadmap/stage.md` and `docs/ROADMAP_WORKFLOW.md` SHALL state the resume rule of the scaffold step.

#### Scenario: A test reads the two documents
- **WHEN** the test reads `docs/roadmap/stage.md` and `docs/ROADMAP_WORKFLOW.md`
- **THEN** each document names the four results `created`, `resumed`, `adopted` and `held`, and `docs/ROADMAP_WORKFLOW.md` lists the record key `scaffold.branch`
2 changes: 0 additions & 2 deletions src/devops_cli/commands/roadmap_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from devops_cli.commands.roadmap_step_open import open_cmd
from devops_cli.commands.roadmap_step_ready import ready_cmd
from devops_cli.commands.roadmap_step_review import review_cmd
from devops_cli.commands.roadmap_step_scaffold import scaffold_cmd
from devops_cli.commands.roadmap_step_watch import watch_cmd
from devops_cli.core.cli import new_typer
from devops_cli.lang import HELP
Expand All @@ -25,5 +24,4 @@
step_app.command("open", help=HELP.roadmap.step_open)(open_cmd)
step_app.command("ready", help=HELP.roadmap.step_ready)(ready_cmd)
step_app.command("review", help=HELP.roadmap.step_review)(review_cmd)
step_app.command("scaffold", help=HELP.roadmap.step_scaffold)(scaffold_cmd)
step_app.command("watch", help=HELP.roadmap.step_watch)(watch_cmd)
74 changes: 0 additions & 74 deletions src/devops_cli/commands/roadmap_step_scaffold.py

This file was deleted.

12 changes: 0 additions & 12 deletions src/devops_cli/github/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,18 +561,6 @@ def find_open_pull(
return _read_as(OpenPullRequest, item, path=endpoint)
return None

def create_ref(self, repo: str, *, ref: str, sha: str) -> dict[str, Any]:
"""Create a git reference in `repo` (POST /repos/{owner}/{repo}/git/refs) (#5499)."""
path = _repo_path(repo, "git/refs")
payload = {"ref": ref, "sha": sha}
answer = self._session.rest("POST", path, body=payload)
if not isinstance(answer, dict):
raise GitHubUnreadError(
f"GitHub's answer to POST {path} is not an object: {type(answer).__name__}",
details={"path": path},
)
return answer

def create_draft_pull(
self, repo: str, *, title: str, body: str, head: str, base: str
) -> CreatedPull:
Expand Down
Loading