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
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
schema: spec-driven
created: 2026-11-14
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Design

## Decisions

- **Write the names on one `Adds:` line under the line of the kind and the files of the group, each name in a code span and separated by a comma.**: `group_text` already writes one structured line per group, and the plan reader already reads the kind and the files from that line, so one writer and one reader hold the fact and the stage prompt asks for one more line of the same shape.
- **Parse the line once in `TaskGroup.added_names` and `adds_problem` of `src/devops_cli/roadmap/step_files.py`.**: The plan reader and the implement job both read `parse_task_groups`, so one parser decides the names for both and two parsers cannot disagree about one plan.
- **Hold the names in the `adds` field of `StageGroup`, which `render_change` writes and `read_change` reads back.**: `file_facts` compares the reply of the model with the files of the change folder, and a fact that no field holds is lost in that comparison.
- **Add the `adds` field, write the line, and name the field in `roadmap_stage_change.md` and `roadmap_stage_split.md` in one group.**: Two prompt tests compare each prompt with the fields of `StageGroup` (`test_a_stage_prompt_names_each_kind_and_each_field_of_a_group` and `test_the_keys_of_a_group_in_the_prompts_are_the_fields_of_a_group`), so a field with no prompt line fails them and a prompt line with no field fails them too.
- **Refuse a malformed `Adds:` line in `read_change`, and refuse `adds` on a group that is not a behavior group in the schema of `StageGroup`.**: `check_proposal` takes a validated `StageProposal`, so the schema judges the reply of the model and the reader judges a hand-written file; the plan check reports the refusal of the reader as a read problem of `tasks.md`.
- **Keep `false_premises` and change it to read `TaskGroup.added_names`, delete `added_guard` with its two patterns, and delete its table test and the guard-add fixtures that read the prose rule in the same group.**: One function holds the check and three test modules hold its cases, so the prose rule and every test that reads it go together and the verify command of the group passes.
- **Keep the check for a behavior group only, and keep the return to New with the definition line.**: A group of another kind adds no product guard, and a person needs the definition line to judge the return.

## Rejected alternatives

- **Keep the prose rule of `added_guard` and add more add verbs and words to it.**: `src/devops_cli/roadmap/premise.py:def added_guard` reads a fixed list of add verbs and the word guard or check directly before one code span, so a task that writes the guard with no such word names no added identifier, and a task that names a guard beside the change returns the item for no defect.
- **Write the names in YAML front matter of the group or of the change folder.**: The reader of `src/devops_cli/roadmap/plan_read.py` reads markdown lines of the group text and no parser of the plan reads front matter, so a second parser would decide the names and the stage prompt would ask for a form that the writer does not hold.
- **Read the names from the reply of the model only, and write no line in `tasks.md`.**: The implement job reads the plan at the branch tip through `parse_task_groups` of `src/devops_cli/roadmap/step_files.py`, so a name that no line of the tasks file holds is not there for it.
- **Add the `adds` field in one group and change the stage prompts in a later group.**: `tests/roadmap/stage/test_roadmap_stage_kind.py:def test_a_stage_prompt_names_each_kind_and_each_field_of_a_group` and `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:def test_the_keys_of_a_group_in_the_prompts_are_the_fields_of_a_group` read `StageGroup.model_fields` against both prompts, so the field alone fails them and the prompt alone fails them too.
- **Add a test that a behavior group whose `Adds:` line names an undefined guard runs the group, with no other guard in the task text.**: The base runs such a group already, because `added_guard` finds no guard in its prose, so the test passes on the base and proves nothing about the `Adds:` line; the plan's test names the defined guard `_delivery_title` in the task text as well, so the base returns the item and the test fails on the base.
- **Leave the guard-add fixtures of `tests/roadmap/implement/test_roadmap_implement_checkpoint.py` and `tests/roadmap/implement/test_roadmap_implement_typed_result.py` as they are, and let them keep the prose rule.**: `read_file` of both modules shows a behavior group whose task text says `Add the guard _delivery_title` with no `Adds:` line, so once the prose rule goes `false_premises` reads no name and `test_the_check_withdraws_the_checkpoint_of_group_one` and `test_typed_result_a_return_to_new_writes_returned_as_its_last_mark` fail.

## Unchanged references

- `src/devops_cli/roadmap/implement/implement_run.py` (import): The module imports `false_premises`, which stays, and never names `added_guard`, so the deletion leaves it as it is.
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Proposal

## Why

The plan of #3417 decides the guard premise check of the implement job from the prose of a task: an add verb, the word guard or check, and one code span. A task that names the guard some other way adds nothing the rule reads, and a sentence that names a guard without adding it can return the item to New for no defect (#3453). The plan already holds the names that a behavior group adds in the code spans of its tasks, and no field of the plan records them, so the implement job guesses them from the sentence.

## What Changes

- Add `ADDS_LINE`, `TaskGroup.added_names` and `adds_problem` to `src/devops_cli/roadmap/step_files.py`, so the plan reader and the implement job read the identifiers of the `Adds:` line of a group from one parser.
- Give `StageGroup` the field `adds` in `src/devops_cli/roadmap/stage/stage_change.py`, write the `Adds:` line in `group_text`, and refuse the field on a `manifest` group and an `other` group.
- Name the `adds` field and the `Adds:` line in `src/devops_cli/ai/tasks/roadmap_stage_change.md` and `src/devops_cli/ai/tasks/roadmap_stage_split.md`, because both prompt tests compare the prompts with the fields of `StageGroup`.
- Read the line in `_group` of `src/devops_cli/roadmap/plan_read.py`, and raise `PlanReadError` for a name outside a code span.
- Read `TaskGroup.added_names` in `false_premises` of `src/devops_cli/roadmap/premise.py`, delete `added_guard`, `_ADD_VERB`, `_GUARD_SPAN` and their table test, and give the `Adds:` line to the behavior-group fixtures of `tests/roadmap/implement/test_roadmap_implement_job.py`, `tests/roadmap/implement/test_roadmap_implement_checkpoint.py` and `tests/roadmap/implement/test_roadmap_implement_typed_result.py`.
- State the line and the refusal in `docs/roadmap/plan-check.md`.
- The change fits one pull request.

## Capabilities

### New Capabilities

None.

### Modified Capabilities

- `roadmap-stage/task-groups`: A behavior group writes the identifiers that it adds, The stage prompts ask for the identifiers that a group adds
- `roadmap-plan-check`: The plan reader reads the identifiers that a group adds
- `roadmap-implement-step/inputs`: A task group exposes the identifiers that it adds
- `roadmap-implement-job/stops`: The job checks the premise of a behavior group at the branch tip

## Impact

- Code: `src/devops_cli/roadmap/step_files.py`, `src/devops_cli/roadmap/stage/stage_change.py`, `src/devops_cli/lang/en/messages.py`, `src/devops_cli/roadmap/plan_read.py`, `src/devops_cli/roadmap/premise.py`, `src/devops_cli/roadmap/implement/implement_run.py`
- Documents: `src/devops_cli/ai/tasks/roadmap_stage_change.md`, `src/devops_cli/ai/tasks/roadmap_stage_split.md`, `docs/roadmap/plan-check.md`
- Tests: `tests/roadmap/test_roadmap_step_files.py`, `tests/roadmap/stage/test_roadmap_stage_content.py`, `tests/roadmap/stage/test_roadmap_stage_kind.py`, `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py`, `tests/roadmap/test_roadmap_plan_read.py`, `tests/roadmap/test_premise.py`, `tests/roadmap/implement/test_roadmap_implement_job.py`, `tests/roadmap/implement/test_roadmap_implement_checkpoint.py`, `tests/roadmap/implement/test_roadmap_implement_typed_result.py`

## Feasibility

- The probes name the moved modules: "The path `src/devops_cli/roadmap/stage_change.py` is no file at the root of the staging commit. These files of the commit are candidates: `src/devops_cli/roadmap/stage/stage_change.py`. Commit bff2f14f 2026-11-06 refactor(roadmap): group the job modules in subpackages (#3897) deleted or renamed it." and "The path `src/devops_cli/roadmap/implement_run.py` is no file at the root of the staging commit. These files of the commit are candidates: `src/devops_cli/roadmap/implement/implement_run.py`. Commit bff2f14f 2026-11-06 refactor(roadmap): group the job modules in subpackages (#3897) deleted or renamed it." Both modules sit at the new paths, so the plan names the new paths and the issue is no false premise.
- The probes give "The path `src/devops_cli/roadmap/plan_read.py` is a file of the staging commit." and "The path `src/devops_cli/roadmap/step_files.py` is a file of the staging commit."
- The prose rule that the issue names is at the staged commit: `read_file` of `src/devops_cli/roadmap/premise.py` showed `src/devops_cli/roadmap/premise.py:def added_guard` and `src/devops_cli/roadmap/premise.py:def false_premises`, and `false_premises` calls `added_guard(task.text)` for each task of the group. The staged `_ADD_VERB` already holds `introduce`, so the example of the issue that a task with `introduce` misses the rule is not the failure at this commit; the rule still decides from prose and can both miss a guard and return the item for a sentence that only names one, and the plan removes it for the `Adds:` line.
- `src/devops_cli/roadmap/step_files.py:class TaskGroup` holds `number`, `title`, `tasks`, `text` and `line` only, and `src/devops_cli/roadmap/step_files.py:91:def code_spans(text: str) -> tuple[str, ...]:` with `src/devops_cli/roadmap/step_files.py:36:KIND_LINE: re.Pattern[str] = re.compile(r"^Kind: (?P<kind>\w+)\.", re.M)` show that one structured line of a group has a reader already.
- `src/devops_cli/roadmap/stage/stage_change.py:class StageGroup` holds no `adds` field, and `src/devops_cli/roadmap/stage/stage_change.py:2954:def group_text(index: int, group: StageGroup) -> str:` writes the kind and the files on one line from the message `stage_group_files`, which is staged as `Kind: {kind}. Reads: {reads}. Changes: {changes}.`
- `src/devops_cli/roadmap/stage/stage_change.py:621:def _other_problems(group: StageGroup) -> list[str]:` refuses no `adds`: that is the defective text that group 2 quotes in its test.
- The review finding is right, and group 4 now changes both files. `read_file` of `tests/roadmap/implement/test_roadmap_implement_checkpoint.py` and of `tests/roadmap/implement/test_roadmap_implement_typed_result.py` showed the fixture of `tests/roadmap/implement/test_roadmap_implement_checkpoint.py:class TestAGuardThatTheBranchTipDefines` and of `tests/roadmap/implement/test_roadmap_implement_typed_result.py:class TestTypedResultOfAReturn`, and each of their task texts says `Add the guard _delivery_title` with no `Adds:` line. Once the prose rule goes, `false_premises` reads no name for those two groups and the two tests fail, so group 4 adds the line `Adds: _delivery_title` to each of the two fixtures and runs both modules in its verify.
- `search_code` for `Add the guard` gave three test modules with a guard-add task: `tests/roadmap/test_premise.py`, `tests/roadmap/implement/test_roadmap_implement_checkpoint.py` and `tests/roadmap/implement/test_roadmap_implement_typed_result.py`. `search_code` for `added_guard` gave one test module, `tests/roadmap/test_premise.py`. Group 4 changes all three, so no test module is left reading the deleted rule.
- The finding on the missing split prompt is fixed: `list_files` of `src/devops_cli/ai/tasks` shows `roadmap_stage_split.md`, and `tests/roadmap/stage/test_roadmap_stage_kind.py:def test_a_stage_prompt_names_each_kind_and_each_field_of_a_group` and `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:def test_the_keys_of_a_group_in_the_prompts_are_the_fields_of_a_group` read both prompts against the fields of `StageGroup`, so group 2 changes both prompts, both test modules and the field together.
- The finding on the order of group 2 is fixed: the `adds` field and the two prompts land in one group, so the group runs `tests/roadmap/stage/test_roadmap_stage_prompt_rules.py` as its verify and no group leaves the two prompt tests failing.
- The finding on the contrived test is fixed: `tests/roadmap/implement/test_roadmap_implement_job.py:def _guard_tasks` builds a group whose first task fails on the base, and each of the three new tests now fails on the base. The group with the `Adds:` line `_delivery_title` names no guard in its task text, so the base runs it and the return fails the test. The group with no `Adds:` line says to add a check beside the guard `_delivery_title`, which the base prose rule matches, so the base returns the item and the run fails the test. The group with `Adds:` `_missing_guard` names the defined guard `_delivery_title` in its task text, so the base returns the item and the run fails the test.
- The finding on the import is fixed: `tests/roadmap/test_premise.py:10:from devops_cli.roadmap.premise import added_guard, definition_lines` imports the deleted function, so group 4 deletes that import, the table test `test_a_task_adds_a_guard_only_when_the_identifier_follows_the_guard_word` and the `pytest` import that only that test uses, in the same group as the deletion.
- `src/devops_cli/roadmap/implement/implement_run.py:884:def _check_premise(self, group: TaskGroup) -> bool:` keeps its place and its return to New with the definition line, and `read_change` of `src/devops_cli/roadmap/plan_read.py` keeps the one place that reads a group.
- `read_spec` of `roadmap-implement-job/stops` gave the base requirement "The job checks the premise of a behavior group at the branch tip" with four scenarios, and the modified requirement keeps all four names.
- Precondition of `false_premises` in `src/devops_cli/roadmap/premise.py`: a checkout of the repository, because it reads the definitions at the branch tip with `git grep`; the job calls it on the checkout of the runner.
- Precondition of `definition_lines` in `src/devops_cli/roadmap/premise.py`: a checkout of the repository, because it reads the definitions of a commit through `git grep`.
- `read_change` takes a mapping of the change files, so it needs no checkout, no client and no network.
- The plan introduces no new program. `uv run devops ci test` and `uv run devops ci docs` run in the runner image, which holds `uv`, `devops`, `pytest` and `git`, under the pod settings `readOnlyRootFilesystem: true`, `runAsNonRoot: true`, `allowPrivilegeEscalation: false`, `capabilities.drop: ALL` and `seccompProfile: RuntimeDefault`; the tests write only under `tmp_path`. A failed test is class `test` with action `repair`.
- The live run `uv run devops roadmap eval stage --limit 5` needs a client of the model provider and a network to it, and its failure is class `provider` with action `retry`; the replay `uv run devops roadmap eval stage --replay` calls no model and needs no network.
- The first check of the implementation is `uv run devops ci test tests/roadmap/test_roadmap_step_files.py`, which fails on the base because `TaskGroup.added_names` does not exist.

## Existing Tool Considered

No open tool parses the plan files of this repository, and the change extends the project's own parsers: `code_spans` of `src/devops_cli/roadmap/step_files.py` and the kind line of `src/devops_cli/roadmap/plan_read.py`. The written cost is about 4,000 tokens to build and test, about 1,000 tokens to keep, and about 1 hour elapsed. The change deletes the internal code `added_guard`, `_ADD_VERB` and `_GUARD_SPAN` of `src/devops_cli/roadmap/premise.py`.

## Dependencies

None.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## MODIFIED Requirements

### Requirement: The job checks the premise of a behavior group at the branch tip
Before the job runs a behavior group, the job SHALL read the identifiers of the `Adds:` line of the group through `TaskGroup.added_names` of `src/devops_cli/roadmap/step_files.py`, and SHALL return the item to New with the definition line when the branch tip defines one of them. The job SHALL use no rule of a task text. The job SHALL read the kind of the group from `TaskGroup.is_behavior` of `src/devops_cli/roadmap/step_files.py`, and a group of another kind SHALL run with no check.

#### Scenario: A task adds a guard that the base already runs
- **WHEN** A behavior group holds an `Adds:` line with `_delivery_title`, and the branch tip defines `_delivery_title`
- **THEN** The job runs no group step, writes no group file, makes no group commit, and comments the definition line with the return to New.

#### Scenario: A task adds a guard that the base lacks
- **WHEN** A behavior group holds an `Adds:` line with `_missing_guard`, and the branch tip defines no `_missing_guard`
- **THEN** The job runs the group and commits the file that the group writes.

#### Scenario: A group that is not behavior adds a defined name
- **WHEN** A group whose kind is not behavior names the guard `_delivery_title`, which the branch tip defines, and holds no `Adds:` line
- **THEN** The job returns no item to New and runs the group.

#### Scenario: The guard premise fails after a checkpoint
- **WHEN** groups 1 and 2 passed and were pushed as checkpoints, and the `Adds:` line of a behavior group 3 names a guard that the branch tip defines
- **THEN** the job runs no step for group 3, withdraws the checkpoints as for a `premise` request, and returns the item to New
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## ADDED Requirements

### Requirement: A task group exposes the identifiers that it adds
`TaskGroup.added_names` of `src/devops_cli/roadmap/step_files.py` SHALL give the identifiers of the `Adds:` line of the group, each once, in file order, and SHALL give no name for a group with no such line.

#### Scenario: A task group with two added identifiers
- **WHEN** a group holds `Adds:` with `_delivery_title` and `_publish` in code spans
- **THEN** `TaskGroup.added_names` gives the two names in that order
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## ADDED Requirements

### Requirement: The plan reader reads the identifiers that a group adds
`read_change` SHALL set the `adds` field of a `StageGroup` from the `Adds:` line of its group, in file order. It SHALL raise `PlanReadError` when the line holds a name outside a code span or holds no code span, and SHALL read a group with no `Adds:` line with an empty `adds`.

#### Scenario: A change folder with an Adds line
- **WHEN** the tasks file of a `behavior` group holds `Adds:` with `_delivery_title` in a code span
- **THEN** `read_change` returns that group with `adds` equal to the one name `_delivery_title`

#### Scenario: A malformed Adds line
- **WHEN** a group holds `Adds:` with `_delivery_title` and no code span
- **THEN** `read_change` raises `PlanReadError` with the reason of the line
Loading