Skip to content

feat(roadmap): a failed verification command gets a repair round #3577

Closed

Description

@dan-petty

Problem or Motivation

Only a failed ruff, mypy or hook, and a missing tick, get a repair round today. A failed verification command (a lost or failing test) stops the step at once, though the agent has the failure text and could fix it. Examples: #2570, #2531, #2524, #2469. Split from #3053.

Proposed Solution & Architectural Design

  • A verification command that exits 1 gives the agent one round with the class (test, types, lint), the evidence and a diagnosis hint.
  • The turn may change the files of the step only, as the turn for a static check does.
  • A failure of class plan_defect or premise_false still stops at once.
  • Acceptance: a replay where the first attempt fails its verification command and the second passes ends done, and the trace shows both attempts.

Target Subsystem

src/devops_cli/roadmap/implement_step.py (_extra_ask, _exit_failure).

Existing Tool Considered

pydantic-ai gives ModelRetry for output validation. The step already has the turn for a static check; this change extends it to one more kind of failure: about 40000 tokens to build, 2000 each quarter to keep, 8000 to fix one miss, about 3 hours.

Source: #3053

Proposed design

Problem statement

A failed verification command stops the implement step at once. A lost test also stops the step with no repair turn. The agent has the failure text and can fix the failure. This change gives one repair round to a failed verification command and to a lost test. A plan defect and a false premise still stop at once.

Acceptance criteria

Requirement: Verification failure gets a repair turn

When a verification command that is not a negative search exits 1, the step SHALL give the agent one repair turn with the command's class, its masked output and a diagnosis hint.

Scenario: The repair turn makes the verification pass

  • WHEN The first attempt fails a verification command with exit 1 and the repair turn makes the command pass.
  • THEN The step ends done, and the trace holds one attempt for the failure and one attempt for the repair.

Requirement: Lost test gets a repair turn

When the step loses a test that existed at the base commit and the test is not recorded, the step SHALL give one repair turn that may restore or edit the test file.

Scenario: The repair turn restores a lost test

  • WHEN A step removes a test from a test file that existed at the base commit, and the repair turn restores the test.
  • THEN The step ends done, and the trace holds one attempt for the lost test and one attempt for the repair.

Requirement: Plan defect and false premise stop at once

A failure of class plan_defect or premise_false MUST stop the step with no repair turn.

Scenario: A plan defect gets no repair turn

  • WHEN The step fails with class plan_defect or premise_false.
  • THEN The step stops, and the trace records no repair attempt.

Requirement: Repair turn changes only step files

The repair turn for a failed verification command or a lost test MUST change only the files of the step and the change's tasks.md.

Scenario: The repair turn edits an outside file

  • WHEN The repair turn changes a file that the step did not change.
  • THEN The step stops, and the reason names the paths that the turn changed.

Existing Tool Considered

No alternatives check has run. pydantic-ai ModelRetry covers model output validation. It does not cover a failed shell verification command or a lost test, and it cannot limit the changed files to the step. The project extends the existing _extra_ask and _repair_rounds path. The written cost is about 40000 tokens to build, 2000 each quarter to keep, 8000 to fix one miss, and about 3 hours.

Key questions

  • Should a failed verification command get a repair turn?: Yes. Extend _extra_ask and _repair_rounds so a verification command that exits 1 gets one bounded repair turn. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1496, src/devops_cli/roadmap/failure.py, tests/roadmap/test_roadmap_implement_step_repair.py, docs/ERRORS.md:83]
    • Chosen: Extend the existing repair rounds. The step already counts rounds and checks the changed files, so one new failure with repair paths reuses the path.
    • Rejected: Build a pydantic-ai ModelRetry loop. ModelRetry handles tool and output validation, not the exit status of a shell verification command.
    • Rejected: Keep the immediate stop. The agent has the failure text and can fix a failing test.
  • Should a lost test also get a repair turn?: Yes. _exit_failure must carry the lost test files as repair_paths so _extra_ask gives the turn. (best practice) [sources: src/devops_cli/roadmap/implement_step.py, src/devops_cli/roadmap/implement_test_names.py, tests/roadmap/test_roadmap_implement_step_repair.py]
    • Chosen: Give a lost test a repair turn. The lost test is a failure that the agent can fix, and the reply records the case.
    • Rejected: Keep the current stop with class TESTS_LOST. _exit_failure returns no repair_paths, so the agent gets no turn.
  • Which files may a repair turn change?: Only the files that the step changed, plus the change's tasks.md. (best practice) [sources: src/devops_cli/roadmap/implement_step.py, tests/roadmap/test_roadmap_implement_step_repair.py]
    • Chosen: Limit the turn to the step files. _foreign_change already compares the checkout with the tree before the turn.
    • Rejected: Allow the whole checkout. A repair turn could hide an unrelated edit or a stray file.
  • Which failures must stop at once?: A failure of class plan_defect or premise_false stops at once with no repair turn. (best practice) [sources: src/devops_cli/roadmap/failure.py, src/devops_cli/roadmap/implement_step.py]
    • Chosen: Stop plan_defect and premise_false at once. No attempt can fix a wrong plan or a false premise.
    • Rejected: Give every failure a repair turn. A repair turn would spend tokens on a failure that it cannot fix.
  • How does the step assign the class of a failed verification command?: The step reads the effective program of the command after uv run: pytest is test, mypy is types, and ruff is lint; another allowed command uses the verification class. (best practice) [sources: src/devops_cli/roadmap/implement_shell_policy.py, src/devops_cli/roadmap/implement_step.py, src/devops_cli/roadmap/failure.py]
    • Chosen: Class from the command program. The program is stable and the allowlist already admits it.
    • Rejected: Class from the command output. The output is model-visible and can name another tool.
    • Rejected: One generic verification class. The issue names test, types and lint as distinct classes.
  • Should the change add a new repair-round setting?: No. Reuse roadmap.implement.repair_rounds, as the static-check turn does. (best practice) [sources: src/devops_cli/roadmap/implement_step.py, src/devops_cli/config/settings.py]
    • Chosen: Reuse the existing setting. The step already counts rounds and names the setting in a spent stop.
    • Rejected: Add a verification setting. The issue asks for one more failure kind, not a new budget.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-07: in-use.
The item already names this tool.
Tool: pydantic/pydantic-ai (https://github.com/pydantic/pydantic-ai), MIT, last activity 2026-11-07, maintained.

Activity

  1. added
    source/agent
    on Nov 5, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 5, 2026
  3. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It saves tokens on failed verification commands but the step still completes without it.
    • Value: Medium. It prevents token loss when a test or type check fails, but the work is not blocked.
    • Effort: Medium. The mechanism exists for static checks; this extends it to one more failure class.
    • Related: fix(roadmap): a step gets one turn to fix a ruff check or mypy failure of its own code #2795, which asks for a different change. Both add a repair round in implement_step.py, but #2795 targets static checks and the candidate targets verification command failures.
  4. added
    priority/p2-medium
    on Nov 5, 2026
  5. dan-petty commented on Nov 5, 2026

    @dan-petty
    OwnerAuthor

    This item now holds acceptance criterion 2 of #3098, which is closed as superseded: "A replay with a removed pinned test restores and edits the test in a repair step."

    The body of this item names a lost test and #2570, but its acceptance line names only a verification command. The two paths differ on origin/main at cfcbd3d. _exit_failure returns _Failure(lost, klass=FailureClass.TESTS_LOST) with no repair_paths, so _extra_ask gives no turn. So the plan of this item must also give a lost test a repair turn, and add a test for this case. #3490 holds a removal that the plan records.

  6. added
    status/ready
    and removed
    status/new
    on Nov 6, 2026
  7. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at bd65ef6 (see proposed design in issue body).

  8. 12 remaining items

  9. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Stopped at group 2.

    Failure class: tests_lost.
    Action taken: none.
    Action left: wait: wait for a person.

    Step Status Attempts Tokens in/out Last failing command
    group 1 done 2 2879360/19018 pytest on base: tests/roadmap/implement/test_roadmap_implement_verification_class.py
    group 2 stopped 1 8116980/31098 -

    Reason:

    The agent removed tests that existed at the start of the step. A step may add tests. It may remove or rename a test only when the plan on the default branch names it in `## Weakened checks`.
    tests/roadmap/implement/test_roadmap_implement_step_attempts.py: test_a_failed_verification_command_gets_no_round_and_names_no_rounds
    tests/roadmap/implement/test_roadmap_implement_step_repair.py: test_a_failed_verification_command_gets_no_extra_turn
    

    Last message of the agent (a claim that no check verified): Group 2 is done and both of its tasks are ticked. What I changed: - src/devops_cli/roadmap/implement/implement_step.py: added _CommandStop, let _command_failure and commands_failure collect a failed command into an optional stops list, and added _verification_failure so a verification command that exits 1 (and is no negative search) carries the step's changed paths, verification=True and the class from verification_class. _Failure has the new verification field; _extra_ask returns no turn for plan_defect/premise_false, picks implement_verification_turn for a verification failure, and the nested template choice is a match. - src/devops_cli/lang/en/messages.py: added implement_verification_turn (with {failure}, {removed} and a {class_note}) and implement_verification_turn_class, and reworded implement_stop_repair_turn_changed to name “the failure”. - tests/roadmap/implement/test_roadmap_implement_step_attempts.py: rewrote the old immediate-stop case as test_a_failed_verification_command_gets_one_round_and_ends_done; it ticks no task in the first turn, the verification command fails once, the repair turn rewrites the test, the step ends done, and the trace holds a failed test attempt and a passed one. It also asserts the repair message names the class. - tests/roadmap/implement/test_roadmap_implement_step_repair.py: updated the two foreign-change reasons to the new sentence and renamed/gave repair_rounds=0 to `test_a_failed_v

    The job discarded this work. The diff is cut to 20000 characters. Read it before you retry:

    diff --git a/openspec/changes/3577-a-failed-verification-command-gets-a/tasks.md b/openspec/changes/3577-a-failed-verification-command-gets-a/tasks.md
    index 9ed997951..f93028d49 100644
    --- a/openspec/changes/3577-a-failed-verification-command-gets-a/tasks.md
    +++ b/openspec/changes/3577-a-failed-verification-command-gets-a/tasks.md
    @@ -13,9 +13,9 @@ Kind: behavior. Reads: `src/devops_cli/roadmap/implement/implement_shell_policy.
     
     Kind: behavior. Reads: `src/devops_cli/roadmap/implement/implement_step.py`, `src/devops_cli/roadmap/implement/implement_shell_policy.py`, `src/devops_cli/roadmap/implement/implement_wip.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/implement/test_roadmap_implement_step_attempts.py`, `tests/roadmap/implement/test_roadmap_implement_step_repair.py`, `tests/support/implement_step.py`. Changes: `src/devops_cli/roadmap/implement/implement_step.py`, `src/devops_cli/lang/en/messages.py`, `tests/roadmap/implement/test_roadmap_implement_step_attempts.py`, `tests/roadmap/implement/test_roadmap_implement_step_repair.py`.
     
    -- [ ] 2.1 Change `test_a_failed_verification_command_gets_no_round_and_names_no_rounds` in `tests/roadmap/implement/test_roadmap_implement_step_attempts.py` to `test_a_failed_verification_command_gets_one_round_and_ends_done`: the first turn writes a test file and a source file of the temporary checkout and ticks no task, the exit check runs the group's verification command and it exits 1, the repair turn rewrites the test file so the command passes, the step ends done, and the trace holds a failed attempt of class `test` and a passed attempt
    +- [x] 2.1 Change `test_a_failed_verification_command_gets_no_round_and_names_no_rounds` in `tests/roadmap/implement/test_roadmap_implement_step_attempts.py` to `test_a_failed_verification_command_gets_one_round_and_ends_done`: the first turn writes a test file and a source file of the temporary checkout and ticks no task, the exit check runs the group's verification command and it exits 1, the repair turn rewrites the test file so the command passes, the step ends done, and the trace holds a failed attempt of class `test` and a passed attempt
       - Verification: `$ uv run devops ci test tests/roadmap/implement/test_roadmap_implement_step_attempts.py tests/roadmap/implement/test_roadmap_implement_step_repair.py` fails on the base
    -- [ ] 2.2 In `src/devops_cli/roadmap/implement/implement_step.py`, add `_CommandStop` with the argv of the command, its exit status and its negative flag, and let `_command_failure` append the stop to an optional `stops` list while it still returns the reason; give `commands_failure` the same optional list, after `verifified`. In `_exit_failure`, pass `stops` to the `commands_failure` call and, when the first stop is exit 1 of a command that is no negative search, build `_Failure(early, frozenset(changed), veriffication=True, klass=veriffication_class(stop.argv))`. Add the field `veriffication` to `_Failure`, add `implement_verification_turn` to `src/devops_cli/lang/en/messages.py` with the `{failure}` and `{removed}` placeholders of `implement_repair_turn`, and reword the head of `implement_stop_repair_turn_changed` to `The extra turn for the failure changed files that the step had not changed: {paths}.`. Choose `implement_verification_turn` in `_extra_ask` for `failure.veriffication`, and return None there for the class `plan_defect` and `premise_false` before the repair paths are read. In `tests/roadmap/implement/test_roadmap_implement_step_repair.py`, update the two expected reasons that hold the old sentence, in `test_an_extra_turn_that_changes_a_file_the_step_did_not_change_stops_the_step` and `test_an_extra_turn_that_writes_a_new_file_stops_the_step`, to the reworded sentence. Rename `test_a_failed_verification_command_gets_no_extra_turn` to `test_a_failed_verification_command_gets_no_extra_turn_when_no_round_is_left` and give it `config(roadmap={"implement": {"repair_rounds": 0}})`, so its assertions on the stop and on the two requests stay. In `tests/roadmap/implement/test_roadmap_implement_step_attempts.py`, rewrite the case named `test_a_failed_verification_command_gets_no_round_and_names_no_rounds` as `test_a_failed_verification_command_gets_one_round_and_ends_done`: set `config(roadmap={"implement": {"repair_rounds": 1}})`, answer the verification command with exit 1 on its first run and 0 after, script a first turn that writes a test file and a source file of the temporary checkout and ticks no task, then `say("Done.")`, a repair turn that rewrites the test file, then `say("Fixed the test.")`; assert `outcome.status is StepStatus.DONE`, `outcome.reason == ""`, `outcome.requests == 4`, and the attempts `(1, "failed", "repair", "test")` and `(2, "passed", "stop")` with `1 failed` in the first evidence
    +- [x] 2.2 In `src/devops_cli/roadmap/implement/implement_step.py`, add `_CommandStop` with the argv of the command, its exit status and its negative flag, and let `_command_failure` append the stop to an optional `stops` list while it still returns the reason; give `commands_failure` the same optional list, after `verifified`. In `_exit_failure`, pass `stops` to the `commands_failure` call and, when the first stop is exit 1 of a command that is no negative search, build `_Failure(early, frozenset(changed), veriffication=True, klass=veriffication_class(stop.argv))`. Add the field `veriffication` to `_Failure`, add `implement_verification_turn` to `src/devops_cli/lang/en/messages.py` with the `{failure}` and `{removed}` placeholders of `implement_repair_turn`, and reword the head of `implement_stop_repair_turn_changed` to `The extra turn for the failure changed files that the step had not changed: {paths}.`. Choose `implement_verification_turn` in `_extra_ask` for `failure.veriffication`, and return None there for the class `plan_defect` and `premise_false` before the repair paths are read. In `tests/roadmap/implement/test_roadmap_implement_step_repair.py`, update the two expected reasons that hold the old sentence, in `test_an_extra_turn_that_changes_a_file_the_step_did_not_change_stops_the_step` and `test_an_extra_turn_that_writes_a_new_file_stops_the_step`, to the reworded sentence. Rename `test_a_failed_verification_command_gets_no_extra_turn` to `test_a_failed_verification_command_gets_no_extra_turn_when_no_round_is_left` and give it `config(roadmap={"implement": {"repair_rounds": 0}})`, so its assertions on the stop and on the two requests stay. In `tests/roadmap/implement/test_roadmap_implement_step_attempts.py`, rewrite the case named `test_a_failed_verification_command_gets_no_round_and_names_no_rounds` as `test_a_failed_verification_command_gets_one_round_and_ends_done`: set `config(roadmap={"implement": {"repair_rounds": 1}})`, answer the verification command with exit 1 on its first run and 0 after, script a first turn that writes a test file and a source file of the temporary checkout and ticks no task, then `say("Done.")`, a repair turn that rewrites the test file, then `say("Fixed the test.")`; assert `outcome.status is StepStatus.DONE`, `outcome.reason == ""`, `outcome.requests == 4`, and the attempts `(1, "failed", "repair", "test")` and `(2, "passed", "stop")` with `1 failed` in the first evidence
       - Verification: `$ uv run devops ci test tests/roadmap/implement/test_roadmap_implement_step_attempts.py tests/roadmap/implement/test_roadmap_implement_step_repair.py` passes
     
     ## 3. State the rounds line in the step and command cases
    diff --git a/src/devops_cli/lang/en/messages.py b/src/devops_cli/lang/en/messages.py
    index a11cac78c..498437786 100644
    --- a/src/devops_cli/lang/en/messages.py
    +++ b/src/devops_cli/lang/en/messages.py
    @@ -3233,7 +3233,7 @@ class RoadmapMessages:
             "that is ticked, and runs the scoped checks again."
         )
         implement_stop_repair_turn_changed: str = (
    -        "The extra turn for the static check changed files that the step had not changed: {paths}."
    +        "The extra turn for the failure changed files that the step had not changed: {paths}."
         )
         implement_paths_more: str = " and {count} more"
         implement_model_call_model: str = "model {model}"
    @@ -3354,6 +3354,12 @@ class RoadmapMessages:
             "A static check of your group failed:\n\n{failure}\n\nFix what the check reports. Change "
             "only the files that you changed.{removed} Then reply with one short message."
         )
    +    implement_verification_turn: str = (
    +        "A verification command of your group failed{class_note}:\n\n{failure}\n\nFix what the "
    +        "command reports. Change only the files that you changed.{removed} Then reply with one "
    +        "short message."
    +    )
    +    implement_verification_turn_class: str = " (class `{klass}`)"
         implement_restored_tasks: str = (
             "Restored the tasks.md of the change {change}. A step only ticks the tasks of its own "
             "group."
    diff --git a/src/devops_cli/roadmap/implement/implement_step.py b/src/devops_cli/roadmap/implement/implement_step.py
    index 3d86c9ecd..f8979a326 100644
    --- a/src/devops_cli/roadmap/implement/implement_step.py
    +++ b/src/devops_cli/roadmap/implement/implement_step.py
    @@ -140,6 +140,7 @@ from devops_cli.roadmap.implement.implement_shell_policy import (
         fill_prompt,
         read_verification,
         shown,
    +    verification_class,
     )
     from devops_cli.roadmap.implement.implement_shell_refusal import ShellRefusal
     from devops_cli.roadmap.implement.implement_strays import stray_files, unplanned_paths
    @@ -1155,6 +1156,16 @@ def _tick_group(source: Path, inputs: StepInputs) -> str | None:
         return None
     
     
    +@dataclass(frozen=True)
    +class _CommandStop:
    +    """A command that did not pass, as the exit check records it (#3577): the `argv` of the
    +    process, its exit status and whether it is a negative search, which passes on exit 1."""
    +
    +    argv: tuple[str, ...]
    +    status: int
    +    negative: bool = False
    +
    +
     def _command_failure(
         source: Path,
         argv: Sequence[str],
    @@ -1163,11 +1174,13 @@ def _command_failure(
         negative: bool = False,
         trace: ImplementTrace | None = None,
         verified: list[VerifiedCommand] | None = None,
    +    stops: list[_CommandStop] | None = None,
     ) -> str | None:
         """Run `argv` in the checkout. None when it exits 0, else why the step stops. A `negative`
         search passes on exit 1 (git found no match), and a match (exit 0) is why it stops. With a
         `trace`, the run is a `check` event: its exit status, or none for a timeout (#3032). With
    -    `verified`, the run is added to it with its masked, bounded output (#3042)."""
    +    `verified`, the run is added to it with its masked, bounded output (#3042). With `stops`, a
    +    command that did not pass is added to it (#3577)."""
         limit = load_settings().roadmap.implement.command_timeout_seconds
         try:
             done = run_subprocess(list(argv), cwd=source, quiet=True, timeout=limit)
    @@ -1183,6 +1196,8 @@ def _command_failure(
             )
         if done.returncode == (1 if negative else 0):
             return None
    +    if stops is not None:
    +        stops.append(_CommandStop(tuple(argv), done.returncode, negative))
         if negative and done.returncode == 0:
             return MESSAGES.roadmap.implement_stop_search_found.format(
                 command=named, output=_tail(done)
    @@ -1197,12 +1212,14 @@ def commands_failure(
         commands: Iterable[str],
         trace: ImplementTrace | None = None,
         verified: list[VerifiedCommand] | None = None,
    +    stops: list[_CommandStop] | None = None,
     ) -> str | None:
         """Run each of `commands` in the checkout, in order: None when all exit 0, else why the first
         that did not stops the run. A command whose program is not on the allowlist does not run. A
         command that starts with `!` runs only as the negative search of `read_negative_search`,
         and passes when it finds nothing (#3263). The step runs the verification commands of a group,
    -    from the tasks as they were before the run."""
    +    from the tasks as they were before the run. With `stops`, the command that did not pass is
    +    added to it (#3577)."""
         for command in commands:
             named = shown(command, CONST_ROADMAP_IMPLEMENT_VERIFY_CHARS)
             found = read_verification(command)
    @@ -1211,7 +1228,13 @@ def commands_failure(
                     command=named, reason=found
                 )
             failure = _command_failure(
    -            source, found.argv, named, negative=found.negative, trace=trace, verified=verified
    +            source,
    +            found.argv,
    +            named,
    +            negative=found.negative,
    +            trace=trace,
    +            verified=verified,
    +            stops=stops,
             )
             if failure is not None:
                 return failure
    @@ -1397,14 +1420,16 @@ def _stage(source: Path) -> list[str]:
     
     @dataclass(frozen=True)
     class _Failure:
    -    """Why the step stops, and, for a failed static check or hook, the paths that the step changed:
    -    the files that an extra turn for that failure may change (#2795). `repair_paths` is None for
    -    a failure that gets no such turn. `hook` says that a hook of the project failed (#3043).
    +    """Why the step stops, and, for a failed check that the agent may repair, the paths that the
    +    step changed: the files that an extra turn for that failure may change (#2795).
    +    `repair_paths` is None for a failure that gets no such turn. `hook` says that a hook of the
    +    project failed (#3043). `verification` says that a verification command failed (#3577).
         `klass` is the class of the failure, when the check that failed knows its cause (#3476)."""
     
         reason: str
         repair_paths: frozenset[str] | None = None
         hook: bool = False
    +    verification: bool = False
         klass: FailureClass | None = None
     
     
    @@ -1621,6 +1646,24 @@ def _plan_failure(source: Path, inputs: StepInputs, keeper: WipKeeper) -> _Failu
         return None
     
     
    +def _verification_failure(
    +    early: str, stops: Sequence[_CommandStop], changed: Sequence[str]
    +) -> _Failure:
    +    """The failure of the verification commands (#3577). A command that exits 1 and is no negative
    +    search is a failure that the agent may repair in the files that the step changed, with the class
    +    of its program. Any other failure, and a command that was refused before it ran, gets no repair
    +    paths, so no extra turn follows."""
    +    stop = stops[0] if stops else None
    +    if stop is None or stop.status != 1 or stop.negative:
    +        return _Failure(early)
    +    return _Failure(
    +        early,
    +        frozenset(changed),
    +        verification=True,
    +        klass=verification_class(stop.argv),
    +    )
    +
    +
     def _exit_failure(
         source: Path, inputs: StepInputs, keeper: WipKeeper, log: ToolCallLog
     ) -> _Failure | None:
    @@ -1660,11 +1703,12 @@ def _exit_failure(
             if inputs.preset.step_gates == "ruff-mypy"
             else None
         )
    +    stops: list[_CommandStop] = []
         early = format_failure or commands_failure(
    -        source, inputs.group.verification_commands, log.trace, log.verified
    +        source, inputs.group.verification_commands, log.trace, log.verified, stops
         )
         if early:
    -        return _Failure(early)
    +        return _verification_failure(early, stops, changed)
         form = _test_form_failure(source, inputs, log.trace)
         if form is not None:
             return form
    @@ -1828,19 +1872,34 @@ def _matches_base(source: Path, base: str, name: str) -> bool:
     
     
     def _extra_ask(failure: _Failure | None, log: ToolCallLog) -> _Ask | None:
    -    """The extra turn that a failed static check or hook earns, or None. No turn asks for a tick:
    -    the job ticks the group when its checks pass (#3488). The message names the stray files that
    -    the step deleted, and why (#3092). A failure with no repair paths, as a group that changed no
    -    file (`plan_defect`), gets no turn: no attempt can fix it (#3053). The caller counts the turns
    -    against `repair_rounds`."""
    -    if failure is None or failure.repair_paths is None:
    +    """The extra turn that a failed verification command, static check or hook earns, or None. A
    +    failure of the class `plan_defect` or `premise_false` gets no turn, whatever paths it holds: no
    +    attempt can fix it (#3053). No turn asks for a tick: the job ticks the group when its checks
    +    pass (#3488). The message names the stray files that the step deleted, and why (#3092). A
    +    failure with no repair paths gets no turn. The caller counts the turns against
    +    `repair_rounds`."""
    +    if failure is None or failure.klass in (FailureClass.PLAN_DEFECT, FailureClass.PREMISE_FALSE):
    +        return None
    +    if failure.repair_paths is None:
             return None
         texts = MESSAGES.roadmap
         removed = texts.implement_removed_note.format(paths=log.removed_text()) if log.removed else ""
    -    template = texts.implement_hook_turn if failure.hook else texts.implement_repair_turn
    +    class_note = (
    +        texts.implement_verification_turn_class.format(klass=failure.klass.value)
    +        if failure.verification and failure.klass is not None
    +        else ""
    +    )
    +    match failure:
    +        case _Failure(verification=True):
    +            template = texts.implement_verification_turn
    +        case _Failure(hook=True):
    +            template = texts.implement_hook_turn
    +        case _:
    +            template = texts.implement_repair_turn
         message = template.format(
             failure=mask_secrets(failure.reason)[:CONST_ROADMAP_IMPLEMENT_REASON_CHARS],
             removed=removed,
    +        class_note=class_note,
         )
         return _Ask(message, failure.repair_paths, texts.implement_stop_repair_turn_changed)
     
    diff --git a/tests/roadmap/implement/test_roadmap_implement_step_attempts.py b/tests/roadmap/implement/test_roadmap_implement_step_attempts.py
    index bcc21f36e..bab1ec48d 100644
    --- a/tests/roadmap/implement/test_roadmap_implement_step_attempts.py
    +++ b/tests/roadmap/implement/test_roadmap_implement_step_attempts.py
    @@ -15,14 +15,14 @@ from pathlib import Path
     import pytest
     
     from devops_cli.roadmap.explain import render_trace
    -from devops_cli.roadmap.implement.implement_step import run_step
    +from devops_cli.roadmap.implement.implement_step import StepStatus, run_step
     from devops_cli.roadmap.implement.implement_trace import (
         ImplementTrace,
         TraceEvent,
         TraceEventKind,
         decode,
     )
    -from tests.support.fakes.process import ProcessAnswer, ProcessFake
    +from tests.support.fakes.process import ProcessAnswer, ProcessCall, ProcessFake
     from tests.support.fakes.roadmap_store import InMemoryRoadmapStore
     from tests.support.implement_step import (
         CHECK,
    @@ -47,6 +47,10 @@ FIRST = tool_calls(
         write_call(TASKS_PATH, TICKED),
     )
     FIX = tool_calls(write_call("tests/test_sample.py", TEST_BODY))
    +WORK = tool_calls(
    +    write_call("tests/test_sample.py", BAD_TEST),
    +    write_call("src/sample.py", SHOUT_CODE),
    +)
     
     
     @pytest.fixture
    @@ -136,20 +140,47 @@ def test_a_failure_that_stays_ends_the_last_attempt_with_stop_and_names_the_roun
         assert first
     
     
    -def test_a_failed_verification_command_gets_no_round_and_names_no_rounds(
    -    store: InMemoryRoadmapStore, checkout: Path, programs: ProcessFake
    +def test_a_failed_verification_command_gets_one_round_and_ends_done(
    +    store: InMemoryRoadmapStore,
    +    checkout: Path,
    +    programs: ProcessFake,
    +    config: Callable[..., Path],
     ) -> None:
    -    programs.answer(
    -        lambda call: command_text(call) == CHECK,
    -        ProcessAnswer(returncode=1, stdout="1 failed"),
    -    )
    -    script = ModelScript(FIRST, say("Done."))
    +    config(roadmap={"implement": {"repair_rounds": 1}})
    +    runs = 0
     
    -    trace, reason, requests = _run(store, checkout, script)
    +    def answer(call: ProcessCall) -> ProcessAnswer:
    +        nonlocal runs
    +        runs += 1
    +        return ProcessAnswer(returncode=1 if runs == 1 else 0, stdout="1 failed\n")
     
    -    assert "repair_rounds" not in reason
    -    assert requests == 2
    -    assert [(a["number"], a[

    The item is Blocked, and the job will not run it. Fix the cause. Then comment implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits of roadmap.implement.digest_clears_per_class and roadmap.implement.digest_clears_per_item allow it.

  10. added
    status/blocked
    and removed
    status/in-progress
    on Nov 16, 2026
  11. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-implement-devops-cli-3577-5c3229 ended: succeeded.
    Image digest: sha256:014636e1131ac1400a333cf938c841f3ffff1b3a7deb8b63b92cb8920cd31745

    The last lines of its log:

    Tool call: run_command, started: uv run pytest tests/roadmap/project_review/test_review_facts.py -k test_the_facts_of_a_version_window ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git diff --stat
    Tool call: run_command, started: git diff src/devops_cli/roadmap/implement/implement_step.py
    Tool call: run_command, program git, ok.
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: grep -rn RoadmapMessages\\|messages.roadmap tests/invariants tests/roadmap/test_roadmap_* 2>/dev/null ...
    Tool call: run_command, started: grep -rn unused.*message\\|message.*unused tests/ src/devops_cli/lang/ --include=<masked> ...
    Tool call: run_command, program grep, ok.
    Tool call: run_command, program grep, ok.
    Tool call: run_command, started: grep -n <masked> src/devops_cli/ai/tasks/roadmap_implement_step.md
    Tool call: run_command, program grep, ok.
    Tool call: run_command, started: git diff tests/roadmap/implement/test_roadmap_implement_step_attempts.py tests/roadmap/implement/test_roadmap_implement_step_repair.py src/devops_cli/lang/en/me ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: uv run devops ci openspec
    Tool call: run_command, started: uv run devops ci constructs
    Tool call: run_command, program uv, ok.
    Tool call: run_command, program uv, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: run_command, started: git diff openspec/changes/3577-a-failed-verification-command-gets-a/tasks.md
    Tool call: run_command, program git, ok.
    Tool call: run_command, started: git status --short
    Tool call: run_command, started: uv run devops ci test tests/roadmap/implement/test_roadmap_implement_step_attempts.py ...
    Tool call: run_command, program git, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run devops ci openspec
    Tool call: run_command, program uv, ok.
    Tool call: edit_file, ok.
    Tool call: run_command, started: uv run ruff check src/devops_cli/roadmap/implement/implement_step.py
    Tool call: run_command, started: uv run mypy --strict src/devops_cli/roadmap/implement/implement_step.py
    Tool call: run_command, program uv, ok.
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: uv run devops ci test tests/roadmap/implement/test_roadmap_implement_step_attempts.py ...
    Tool call: run_command, program uv, ok.
    Tool call: run_command, started: git status --short
    Tool call: run_command, program git, ok.
    Failure class tests_lost. Action left: wait.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    
  12. removed
    owner/service
    on Nov 16, 2026
  13. added
    status/in-review
    and removed
    status/blocked
    on Nov 16, 2026
  14. removed
    status/in-review
    on Nov 16, 2026
  15. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 14:50 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions