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
2 changes: 1 addition & 1 deletion docs/roadmap/implement.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ For each item, the job does these things in order:
3. It regenerates the documentation and archives the change, each step only where the default branch of the target declares it in `.devops/roadmap.toml` (`[implement.steps]` with `docs = true` and `archive = true`). The Job reads the file from the default branch, so an edit of the checkout adds or removes no step. A default branch with no file declares no step. A step that the Job skips has a line in its comment on the pull request. devops-cli declares both steps.
4. It runs the scoped checks: the pre-push stage of the hooks, the `devops ci` rows `constructs`, `docs` and `openspec`, and the tests that cover the changed files. A failed check gets a fix step. A stop here still pushes the commits that passed, and the draft stays a draft.
5. It pushes.
6. It sets the title and the body of the pull request: the title of the issue, and a body that `build_body` of `pull_form` builds. The body is the Why of the archived proposal, the line `Closes #<issue>`, then the line `Change:` with the archived folder, or the active folder when the project declares no archive step. The job cuts no text. A Why that does not fit in the 1,000 characters, or that holds a closing keyword, gives way to the title of the issue. A body that breaks the form stops the item at the step `pull request`, before the job writes it. It adds the labels of the new title and removes the labels of the staging title that do not fit. A refused label is a comment on the pull request.
6. It sets the title and the body of the pull request. The title has the type and the declared scope of the title of the issue, and the summary of the plan: the text after `docs(openspec): plan #<issue>` in the subject of the commit that adds the change folder, without the end `(#<pull>)` of a squash merge. That subject is the title of the plan pull request, so the title names the change that the branch makes, and not the goal of the issue. The summary of the title of the issue stands in when that commit has no plan title, or when the form refuses the title with the summary of the plan. The job also writes this title when it opens the draft of a Planned item. The body is one that `build_body` of `pull_form` builds. The body is the Why of the archived proposal, the line `Closes #<issue>`, then the line `Change:` with the archived folder, or the active folder when the project declares no archive step. The job cuts no text. A Why that does not fit in the 1,000 characters, or that holds a closing keyword, gives way to the title of the issue. A body that breaks the form stops the item at the step `pull request`, before the job writes it. It adds the labels of the new title and removes the labels of the staging title that do not fit. A refused label is a comment on the pull request.
7. It watches the checks of the pull request, and runs a fix step for each failed check. The setting `roadmap.implement.repair_rounds` bounds the rounds. A fix step may change only the paths that the plan names and the files of the change folder (the repair scope). A failed check whose log names no path of the repair scope gets no fix step: the job makes no model request, and it stops the item as Blocked with a reason that names the check and the repair scope.
8. It asks `draft_readiness` and stops with the reason on a refusal, then marks the pull request ready.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
schema: spec-driven
created: 2026-11-13
skip_specs: false
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Design

## Decisions

- **The source is the commit that adds the change folder.** The stage job commits the plan with the plan title (`stage.py`, `_git(path, "commit", "-q", "-m", change.title, ...)`), the step `fix-plan` writes it again as one commit with the plan title, and a squash merge writes the title of the plan pull request and the end `(#<pull>)`. So the newest commit of `HEAD` that adds `openspec/changes/<issue>-*/proposal.md` holds the current plan title on a staged branch, on a Planned branch and on the retry of either. The read is local: it sends no request to GitHub.
- **The path glob uses `:(glob)`**, so `*` matches in one folder only, and `<issue>-` with its hyphen does not match a longer issue number.
- **The type and the scope stay the ones of the issue.** The plan title has the type `docs(openspec)`, which the delivery must not keep (#2714). `delivery_title` keeps its scope rule (#2800).
- **The issue summary stands in** when the subject holds no plan title, for example a plan that a person committed with another subject, or when the form refuses the title with the plan summary. The stage schema limits a plan summary to 47 characters, so only a person's longer plan title can be refused. The title of the issue then gives the old behavior, and a title that the form refuses still stops the item.
- **The summary keeps its first letter as the plan wrote it.** The check `Semantic PR title` accepts a capital letter (#4980 had `Fix check-readiness ...`), and a change of case would break a name such as `OpenSpec`.

## Rejected alternatives

- **The first bullet of "What Changes"** (the design of #4127): the bullets are full sentences. For #3785 the first bullet has 169 characters and for #4697 188, over the limit of 60, so the job would fall back to the issue title in the very case of #5341.
- **The title of the plan pull request through `stage.pr`**, as `devops roadmap retitle` does: on a Staged item (#4980) the plan pull request becomes the delivery pull request. After the first write of the delivery title it holds no plan title, so a retry would go back to the issue title. It also costs a GitHub request.
- **A new record key with the plan summary**: the stage job would write it, but the step `fix-plan` and a person's edit of the plan title would not change it, and the items that are staged now have no such key.
- **A model call that writes the title**: the plan already holds a checked summary, and a model call costs tokens and gives a title that no check ties to the plan.
- **A type from the changed paths** (#4127): it is a different decision with its own design, and #5341 asks only for the summary. It stays open in #4127.
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Proposal: #5341

## Why

The implement job copies the summary of the issue title into the title of the delivery pull request, and the squash commit and the changelog line take that title (#5341). An issue title often states a goal, and the plan often states a smaller change. For #3785 the issue title is `fix(k8s): find the source of the <gpu-node> host crashes`, but #5336 only removes a profiler exclusion. Its squash commit and its changelog line say that the change found the source of the crashes. The plan of each item already has a short summary of the change: the stage job writes it in the title of the plan pull request, `docs(openspec): plan #<issue> <summary>`.

## What Changes

- Add `plan_summary` to `src/devops_cli/roadmap/stage/stage_change.py`, beside `staging_title`: it reads the summary of the plan of an item from the subject of the commit that adds its change folder. It removes the end `(#<pull>)` that GitHub adds to a squash commit. It gives None for a subject that is no plan title of the item.
- Give `delivery_title` an optional `summary`, the summary of the plan. The title keeps the type and the declared scope of the issue title. With no `summary`, the title keeps the summary of the issue title.
- Add `_plan_summary` to `src/devops_cli/roadmap/implement/implement_run.py`: one `git log -1 --diff-filter=A` on `HEAD` for `openspec/changes/<issue>-*/proposal.md`. On a staged branch that commit is the commit of the stage job. On the default branch it is the squash commit of the plan pull request.
- `_delivery_title` uses the summary of the plan when the form accepts the title. Else it uses the summary of the issue title, and a title that the form refuses still stops the item. The body keeps `Closes #<issue>`.
- Add tests with the real issue titles and plan subjects of #5336, #5324, #5355 and #4980, and tests of a Staged item, a Planned item and a plan summary that the form refuses.
- Update `docs/roadmap/implement.md`, step 6.
- The change carries a spec delta: the title of the delivery pull request is behavior that a person and release-please observe.
- The type of the title stays the type of the issue. #4127 asks also for a type from the changed paths. This change does not do that part, and it does not close #4127.
- The change fits one pull request.

## Capabilities

### New Capabilities

None.

### Modified Capabilities

- `roadmap-implement-job/pull-request`: The pull request that delivers the code has the type of the issue, The summary of the delivery title comes from the plan

## Impact

- Code: `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/roadmap/implement/implement_run.py`
- Documents: `docs/roadmap/implement.md`
- Tests: `tests/roadmap/stage/test_roadmap_stage_title.py`, `tests/roadmap/implement/test_roadmap_implement_job.py`, `tests/support/roadmap_implement.py`
- Release: the implement job runs in the runner image, and `release.yml` builds that image only when release-please makes a release. The fix takes effect after the next release.

## Feasibility

- `git show origin/main:src/devops_cli/roadmap/implement/implement_run.py` at `f299667c9`: `_delivery_title` calls `delivery_title(self.target.item.title, declared)`, and `delivery_title` in `stage_change.py` keeps `issue_title.partition(":")[2]` as the summary. The job reads no part of the plan for the title.
- `devops gh api repos/dan-petty/devops-cli/pulls/<n>` for #5336, #5324, #5355 and #4980: each title is the title of its issue (#3785, #4697, #5107 with the undeclared scope `tools` removed, and #2530).
- `git log --diff-filter=A --format=%s origin/main -- openspec/changes/<change>/proposal.md` gives the plan titles: `docs(openspec): plan #3785 Remove the profiler exclusion of the <gpu-node> node (#5182)`, `docs(openspec): plan #4697 Keep one metric stream for each workload (#5283)` and `docs(openspec): plan #5107 Read the OpenSpec version on PATH in the check (#5333)`. The first commit of #4980 is the stage commit `docs(openspec): plan #2530 Fix readiness files and merged monitor output`. Each summary states the change, and the stage schema limits it to 47 characters, under the 60 of the title.
- Later commits change the folder and do not add it: the plan fix `docs(openspec): plan #3785 name the renamed profiler test (#5310)` changes `proposal.md`, so `--diff-filter=A` skips it. The step `fix-plan` writes the plan as one new commit with the plan title (`src/devops_cli/roadmap/steps/fix_plan.py`, `_push`).
- The first "What Changes" bullet is no usable title: for #3785 it has 169 characters, over the limit of 60. So the job uses the summary of the plan title, which the issue calls the summary of the plan.
- A miss of `git log -1 --diff-filter=A` with the path glob takes about 2.5 s on the 1,657 commits of `origin/main`, and a hit takes 0.14 s. The job calls it at most twice in a run.
- `.github/workflows/release.yml`: the job `runner-image` runs only `if: needs.release-please.outputs.release_created == 'true'`, so a merge alone does not change the runner Jobs.

## Existing Tool Considered

- No tool reads the summary of a plan from the project's own plan title. `devops roadmap retitle` already reads a plan summary from the title of the plan pull request (`retitle._plan_title`), through `stage.pr` and a GitHub request. The implement job cannot use that source: on a Staged item the plan pull request becomes the delivery pull request, so after the first title write it holds no plan title.
- commitizen (MIT) checks and writes Conventional Commit messages, but it does not read an OpenSpec plan or a squash subject.
- Cost to build: about 40,000 tokens to write and test, about 2,000 tokens a year to keep, 1 hour of elapsed time. The change deletes no internal code: `delivery_title` stays and gets one optional argument.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## MODIFIED Requirements

### Requirement: The pull request that delivers the code has the type of the issue
The job SHALL set the title of the pull request of a Staged or a Planned item to the type and the scope of the issue title and the summary of the plan. Before it writes the title, the job SHALL check it with the form of the pull request and SHALL stop the item when the form refuses it. The job SHALL leave out the scope when `.github/labels.yml` on the default branch declares no label `scope/<scope>`. The job SHALL set the title in the same call that sets the body `Closes #<issue>`.

#### Scenario: A Staged item
- **WHEN** the title of the issue is `fix(roadmap): the job drops a comment`, the commit of the staged branch that adds the change folder has the subject `docs(openspec): plan #1 Keep the last comment of a thread`, and the job finishes the change
- **THEN** the title of the pull request becomes `fix(roadmap): Keep the last comment of a thread`

#### Scenario: An issue that states a goal and a plan that states a smaller change
- **WHEN** the title of issue 3785 is `fix(k8s): find the source of the <gpu-node> host crashes` and its plan commit has the subject `docs(openspec): plan #3785 Remove the profiler exclusion of the <gpu-node> node (#5182)`
- **THEN** the title of the pull request is `fix(k8s): Remove the profiler exclusion of the <gpu-node> node`

#### Scenario: A summary at the limit
- **WHEN** the item has no plan title and the summary of the title of the issue is 60 UTF-16 code units
- **THEN** the form accepts the title, and the job writes it unchanged

#### Scenario: A long summary
- **WHEN** the item has no plan title and the summary of the title of the issue is 61 UTF-16 code units
- **THEN** the job stops the item, and the title of the pull request is not written

#### Scenario: A summary of emoji over the limit
- **WHEN** the item has no plan title and the summary of the title of the issue is 40 emoji of one code point each, which is 80 UTF-16 code units
- **THEN** the job stops the item, and the title of the pull request is not written

#### Scenario: A scope that no label declares
- **WHEN** the title of the issue is `fix(floor): the job drops a comment` and `.github/labels.yml` declares no `scope/floor`
- **THEN** the title of the pull request is `fix: the job drops a comment`

## ADDED Requirements

### Requirement: The summary of the delivery title comes from the plan
The summary of the plan SHALL be the text after `docs(openspec): plan #<issue>` and one space in the subject of the newest commit of the branch that adds `proposal.md` to a folder `openspec/changes/<issue>-<slug>/`, without the end `(#<pull>)` that a squash merge adds. The job SHALL use the whole summary of the title of the issue when that subject holds no such text, or when the form of the pull request refuses the title with the summary of the plan.

#### Scenario: A Planned item
- **WHEN** the commit on `main` that adds the change folder of item 1 has the subject `docs(openspec): plan #1 Keep the last comment of a thread (#4)`
- **THEN** the job opens the draft with the title `fix(roadmap): Keep the last comment of a thread`, and writes the same title when it finishes the change

#### Scenario: No plan title
- **WHEN** the commit that adds the change folder has the subject `fix(roadmap): plan` and the title of the issue is `fix(roadmap): the job drops a comment`
- **THEN** the title of the pull request is `fix(roadmap): the job drops a comment`, the title of the issue

#### Scenario: A plan summary that the form refuses
- **WHEN** the summary of the plan has 64 characters, and the title of the issue is `fix(roadmap): the job drops a comment`
- **THEN** the title of the pull request is `fix(roadmap): the job drops a comment`, and the job does not stop the item
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Tasks

## 1. The delivery title takes the summary of the plan

Kind: behavior. Reads: `src/devops_cli/roadmap/pull_form.py`, `src/devops_cli/roadmap/stage/stage.py`. Changes: `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/roadmap/implement/implement_run.py`, `tests/roadmap/stage/test_roadmap_stage_title.py`, `tests/roadmap/implement/test_roadmap_implement_job.py`, `tests/support/roadmap_implement.py`.

- [x] 1.1 Write the failing tests: `test_the_delivery_title_names_the_change_of_the_plan_and_not_the_goal_of_the_issue` with the real titles and plan subjects of #5336, #5324, #5355 and #4980, `test_a_subject_that_is_no_plan_title_of_the_item_gives_no_summary` and `test_no_plan_summary_keeps_the_summary_of_the_issue` in `tests/roadmap/stage/test_roadmap_stage_title.py`. Add the fixture `plan_subject` and the option `subject` of `push_staged_branch` and `merge_plan` to `tests/support/roadmap_implement.py`.
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_title.py`
- [x] 1.2 Write the failing tests `test_the_title_of_a_staged_item_names_the_change_of_its_plan`, `test_the_title_of_a_planned_item_names_the_change_of_its_merged_plan` and `test_a_plan_summary_that_the_form_refuses_gives_way_to_the_summary_of_the_issue` in `tests/roadmap/implement/test_roadmap_implement_job.py`.
- Verification: `$ uv run devops ci test tests/roadmap/implement/test_roadmap_implement_job.py`
- [x] 1.3 Add `plan_summary` and the argument `summary` of `delivery_title` to `src/devops_cli/roadmap/stage/stage_change.py`.
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_title.py`
- [x] 1.4 Add `_plan_summary` to `src/devops_cli/roadmap/implement/implement_run.py`, and make `_delivery_title` use the summary of the plan when the form accepts the title.
- Verification: `$ uv run devops ci test tests/roadmap/implement/test_roadmap_implement_job.py`

## 2. Documents

Kind: documents. Changes: `docs/roadmap/implement.md`.

- [x] 2.1 Describe the title of the delivery pull request in step 6 of `docs/roadmap/implement.md`.
- Verification: `$ uv run devops ci docs`

## Workflow follow-up

- A Conventional Commit type from the changed paths of the plan stays in #4127.
- Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).
Loading