Repository navigation
Description
What happened
On 2026-10-30 the implement Job devops-cli-runner-20261030-185232-83ce ran #2745 with the 0.22.6 image. The agent fixed _write_content and added tests. The job formatted the test file (#2791 works). Then the step stopped at group 1, and the job discarded all of the work:
uv run ruff check -- src/devops_cli/config/settings.py src/devops_cli/config/write_history.py tests/config/test_config_file_mode.py exited with status 1.
unused-import: `pytest` imported but unused (tests/config/test_config_file_mode.py:7)
Found 2 errors.
The agent could not run ruff check itself: its call of a program outside the allowlist was refused. So the agent could not know the error. The step also gives the agent no turn after the check, so one unused import costs the whole group. A step that ticks its tasks and fails a static check should get one turn to fix what the check reports, as a step with unticked tasks gets the tick turn (#2721).
What should happen
- After the checks of a step fail on
ruff checkormypy --strict, the job gives the agent one extra turn with the failure text, the same way as the tick turn. The checks run again after the turn. - When the checks still fail after the turn, the step stops with the first failure, as it does today.
- The turn may change only files that the step changed. The restore of
tasks.mdand the other exit checks run again after it.
Evidence
- Job
devops-cli-runner-20261030-185232-83ceand the stop comment on fix(config): config files and their copies keep the mode of the file, never 0644 #2745 at 18:57 UTC. _static_failureand_exit_failureinsrc/devops_cli/roadmap/implement_step.py;_tick_turnis the model for the extra turn.
Acceptance criteria
- A step whose code has an unused import ends done after the extra turn removes it. A test shows this with a scripted model.
- A step whose code still fails after the extra turn stops with the first failure.
- The extra turn happens at most once per step.
- The
roadmap-implement-stepspec names the turn. -
uv run devops cipasses.
Proposed design
Problem statement
An implement step that writes code failing ruff check or mypy --strict stops immediately and discards all work. The agent cannot run ruff check itself because it is not on the shell allowlist, so it cannot see the error. The step gives no turn after the static check fails, so one unused import costs the whole group. The step needs one extra turn to fix a static check failure, the same way the tick turn handles unticked tasks.
Acceptance criteria
Requirement: Static fix turn resolves a lint error
A step whose code has a static check failure SHALL end done when the extra turn removes the failure.
Scenario: Step with an unused import
- WHEN the agent code has an unused import and the static fix turn removes it
- THEN the step ends done and the commit is made
Requirement: Static fix turn does not mask a persistent failure
A step whose code still fails the static check after the extra turn SHALL stop with the first failure.
Scenario: Step with a type error that the turn does not fix
- WHEN the agent code has a mypy error and the static fix turn does not remove it
- THEN the step stops with the mypy failure text
Requirement: Static fix turn is bounded to one
The static fix turn SHALL happen at most once per step.
Scenario: Step with a persistent static failure
- WHEN the static fix turn runs and the check still fails
- THEN no second static fix turn is given and the step stops
Requirement: Spec names the turn
The roadmap-implement-step spec SHALL name the static fix turn.
Scenario: Spec file is read after the change
- WHEN the spec is read
- THEN the spec names the static fix turn and its rule
Requirement: CI passes
uv run devops ci SHALL pass.
Scenario: CI runs on the change
- WHEN uv run devops ci is run
- THEN all checks pass
Existing Tool Considered
No check has run. No open, maintained tool or library covers this need. It is internal step-runner logic of devops-cli: the implement step must give its agent one bounded turn with the failure text and re-run the checks. The written cost is about 120 lines of new and changed code in implement_step.py, about 80 lines of tests, and about 5 lines of spec, roughly 1500 tokens to build and a small ongoing cost to keep and fix the one new function.
Key questions
- Where in the step flow does the static fix turn run?: After _exit_failure returns a static check failure, before the step stops. This matches the tick turn pattern in _attempt. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1035, src/devops_cli/roadmap/implement_step.py:1011]
- Chosen: After _exit_failure in _attempt. Matches the tick turn pattern; the turn is a recovery step, not part of the check sequence
- Rejected: Inside _exit_failure. Mixes the check and the recovery; _exit_failure is also called by _tick_turn and would need the turn logic there too
- Rejected: Before _exit_failure. The failure is not known until _exit_failure runs; the turn needs the failure text
- What does the turn message contain?: The failure text from _static_failure, which holds the command and the tool output. The agent needs the exact error to fix it. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:888]
- Chosen: The full failure text from _static_failure. The agent sees the exact ruff or mypy error and can fix it; matches the tick turn message that names the unticked tasks
- Rejected: A summary of the error. Loses the file and line the agent needs
- Rejected: Only the file and line. Loses the rule name and the message the agent needs to understand the fix
- What files may the static fix turn change?: Only the files that the step changed, as listed by _stage. The turn may not add new files or modify files outside the step scope. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:925, src/devops_cli/roadmap/implement_step.py:1011]
- Chosen: Only the files the step changed. The issue states the turn may change only files the step changed; limits the blast radius
- Rejected: Any file in the checkout. Too broad; the agent could change unrelated code
- Rejected: Only tasks.md. Too narrow; the agent needs to change the source file that has the lint error
- How is the foreign-change check done for the static fix turn?: Compare the tree after the turn against the tree before, and verify that only the files the step changed differ. This reuses the pattern of _foreign_change with the changed files as the allowed set. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1000]
- Chosen: Reuse the _foreign_change pattern with the changed files as the allowed set. Consistent with the tick turn check; the changed files are the allowed set instead of tasks.md
- Rejected: No foreign-change check. The agent could change unrelated files; the step would commit them
- Does the static fix turn happen at most once per step?: Yes. The turn happens at most once, the same as the tick turn. A second failure stops the step. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:1011, src/devops_cli/roadmap/implement_step.py:1045]
- Chosen: At most once. The issue says one extra turn; the tick turn is the model; a bounded turn keeps the step predictable
- Rejected: Multiple times until it passes. Unbounded; the agent could loop; the step could exceed its token budget
- What runs after the static fix turn?: The full _exit_failure runs again: _restore_tasks, _stage, _format_failure, _verification_failure, and _static_failure. The issue states the restore of tasks.md and the other exit checks run again after the turn. (best practice) [sources: src/devops_cli/roadmap/implement_step.py:910, src/devops_cli/roadmap/implement_step.py:1011]
- Chosen: Full _exit_failure. The issue states the restore and the other exit checks run again; the turn may have changed tasks.md or other files
- Rejected: Only _static_failure. Skips the restore and the other checks; a change to tasks.md or a format issue would go undetected
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Oct 30, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.Work is discarded on a common lint error, but the agent can avoid the trigger and no user-facing feature is broken.Prevents loss of completed work on a single unused import or type error, but only affects the internal agent workflow.Requires a new turn loop, re-running checks, file-change scoping, a spec update, and a scripted-model test.Both address a static check failure stopping an implement step, but #2789 lets the job apply ruff format while the candidate gives the agent a turn to fix ruff check or mypy errors.devops-cli-service commentedon Oct 30, 2026
Status set to Ready at 524db95 (see proposed design in issue body).
chore(main): release 0.22.7 (#2798)