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-15
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Design

## Decisions

- **The class of a failed verification command comes from its program, read after `uv run` by a new `verification_class`: `pytest` is test, `mypy` is types, `ruff` is lint, and the row after `devops ci` gives the same three.**: The program is a stable part of the command line that `read_verification` already admits, while the output is model-visible and can name another tool.
- **A command whose program names no class, such as `uv run devops docs check`, still gets the turn, and its message states a class only when the program names one.**: The issue gives a repair round to a verification command that exits 1, and a command with no class is still a failure that the agent can repair; the class only labels the message.
- **`commands_failure` keeps its `str | None` result, and `_command_failure` records the argv, the exit status and the negative flag in an optional stop list that `_exit_failure` passes in.**: The exact-reason assertions read the reason as a string, and `verification_class` needs the argv of the command that failed, which only `_command_failure` holds.
- **One repair path set serves every new turn: the files that the step changed. `_foreign_change` already compares the checkout with the tree before the turn and allows the change's tasks file.**: A repair turn may change only the work of the step, so an unrelated edit or a stray file still stops the step and the reason names the paths.
- **The change reuses `roadmap.implement.repair_rounds` and adds no setting.**: The issue asks for one more kind of failure with a repair round, not for a second budget, and the spent stop already names that setting.
- **`_extra_ask` returns None for the class `plan_defect` and `premise_false` before it reads the repair paths.**: No attempt can repair a wrong plan or a false premise, and the rule then holds even if a later stop site gives such a failure repair paths.
- **A lost test gets the class `tests_lost`, the changed paths and its own message, and the failure is built where the staged paths are known.**: The lost test is a failure that the agent can repair in the test file that it changed, and the tests check already names the file and its tests.
- **The message of a foreign change in a turn says `the failure` instead of `the static check`, and the two cases that assert the old sentence move in the same group.**: The turn now serves a verification command and a lost test too, and one message keeps one stop text; the same group owns the message and its cases, so no step sees a failing test it did not write.
- **The case of the repair turn writes its files and ticks no task in its first turn.**: The wip keeper runs the verification of each freshly ticked task before the next model request, so a tick in the first turn would spend the command's first run on the keeper and the exit check would already pass.
- **The trace gets no new event: `_trace_attempt` already records one attempt for each turn with its class.**: The acceptance criterion asks that the trace shows both attempts, which the existing attempt event already gives.
- **A case that asserts an exact stop reason sets `roadmap.implement.repair_rounds=0` and expects `rounds_spent(0)`, because a failure that now carries repair paths reports a spent round even when no round is left.**: `_repair_rounds` sets `spent` from the ask alone, and the stop appends the line that names the spent rounds, so the reason of every such stop grows by that line.
- **The lost-test cases of `tests/roadmap/implement/test_roadmap_implement_step_tests_kept.py` run with no repair round, except the case that shows the lost-test repair turn, which runs with one.**: Each case keeps its own subject, such as the reason, the request count or the kept commit, and a case that shows a turn keeps the one turn that it tests.
- **The living spec of `roadmap-implement-step/exit-checks` stays unchanged in this change, because `openspec archive` writes it from the delta of this change.**: No task group may change a path under `openspec/specs/`; the archive is the only writer of the living spec.

## Rejected alternatives

- **Build a pydantic-ai `ModelRetry` loop for a failed verification command.**: `ModelRetry` validates a tool call or a model output. The exit status of a shell command is no model output, and `ModelRetry` cannot limit the files that the next turn changes, which `_foreign_change` does in `src/devops_cli/roadmap/implement/implement_step.py`.
- **Read the class of a failed verification command from its output.**: The output is model-visible and can name another tool, while the program is a stable part of the command line that `read_verification` already checks in `src/devops_cli/roadmap/implement/implement_shell_policy.py`.
- **Add a second setting for verification repair rounds.**: The step counts its turns against `roadmap.implement.repair_rounds`, whose default is 3 in `src/devops_cli/config/defaults.py`, and a second budget splits one limit.
- **Make `commands_failure` return the failure object with its class and paths.**: The exact-reason assertions compare its result with a string in `tests/roadmap/implement/test_roadmap_implement_step_own_text.py` and `tests/roadmap/implement/test_roadmap_implement_command.py`, so that change would touch code outside this step.
- **Let each exact-reason case run its repair rounds and repeat the last scripted reply.**: The script repeats its last reply, so the stop would name three spent rounds and cost three requests per case; the cases assert a reason and a request count that this change does not make, so they set the budget to 0 instead.
- **Let the first turn of the repair-turn case tick the task, and make the fake command fail twice.**: The keeper runs the verification of a fresh tick before each model request, so the number of runs before the exit check depends on the requests and on the tasks file's mtime; a case that ticks no task has one run at the exit check.
- **Keep the immediate stop of a failed verification command.**: The agent holds the failure text after the command run, as it does for a failed static check that already earns a turn, and the issue names four stops of this kind (#2570, #2531, #2524, #2469).
Loading