Repository navigation
Description
Split from #3972.
Problem: The implement runner keeps trying to edit a test file outside the Changes: list after that test fails. diff_scope forbids the edit. The runner loops until it reaches LimitReached and blocks the item. Why deferred: The stage path check in #3972 now requires the test in the plan. This removes the reported deadlock. The early-stop guard is separate runtime behavior and needs its own design and tests. Acceptance criteria: - The implement runner SHALL stop the step when an invariant test fails on a file outside the Changes: list. - The stop SHALL name the failing test and the path outside Changes:. - The stop SHALL not spend the remaining token budget on edit attempts. - An offline test SHALL cover a failing invariant test outside Changes:.
Proposed design
Problem statement
The implement runner keeps trying to edit a test file outside the Changes: list after that test fails. diff_scope forbids the edit, so the runner loops until LimitReached and blocks the item. The step spends its remaining token budget on edit attempts that cannot succeed. This change stops the step early and names the failing test and path.
Acceptance criteria
Requirement: Stop on out-of-scope invariant test
The implement runner SHALL stop the step when an invariant test fails on a file outside the Changes: list.
Scenario: Invariant test outside Changes: stops the step
- WHEN the step exit check reports a failing invariant test whose file is not in the group's
Changes:list and is not the change'stasks.md - THEN the step ends with a stop result and starts no fix step
Requirement: Stop names the test and path
The stop SHALL name the failing test and the path outside Changes:.
Scenario: Stop evidence names the failing test and its path
- WHEN the guard stops a step for an out-of-scope test failure
- THEN the stop result holds the test identifier and its file path, and the item comment shows both
Requirement: Stop spends no further tokens
The stop SHALL not spend the remaining token budget on edit attempts.
Scenario: No model request follows the stop
- WHEN the guard stops a step for an out-of-scope test failure
- THEN the step makes no model request after the stop and the recorded token spend does not increase
Requirement: Offline test covers the guard
An offline test SHALL cover a failing invariant test outside Changes:.
Scenario: Offline test feeds a failing invariant test outside Changes:
- WHEN the offline test supplies a step result with a failing invariant test whose file is outside
Changes: - THEN the runner returns the stop with the test and path and makes no fix attempt
Existing Tool Considered
No check has run. No open, maintained tool or library covers this need: the early-stop guard is internal to the implement runner. The change adds a guard to src/devops_cli/roadmap/implement/implement_step.py and one offline test. Written cost: about 20k to 30k tokens to build, about 2k tokens per later change to keep, and one day elapsed.
Key questions
- Where does the implement runner compare a diff with the
Changes:list?: The eval propertydiff_scopeinsrc/devops_cli/roadmap/implement/implement_eval_properties.pycompares the diff with theChanges:line of the group and allows the change'stasks.md. [sources: src/devops_cli/roadmap/implement/implement_eval_properties.py, docs/ROADMAP_WORKFLOW.md:390, openspec/changes/archive/2026-11-01-3030-implement-fixtures-eval/design.md:9] - Where does the implement runner raise a stop?:
run_stepandrun_fix_stepinsrc/devops_cli/roadmap/implement/implement_step.pyraise the stop.LimitReachedinsrc/devops_cli/exceptions/ai_pydantic.pyis the stop for a spent budget. [sources: src/devops_cli/roadmap/implement/implement_step.py, src/devops_cli/exceptions/ai_pydantic.py:67, docs/ERRORS.md:80, openspec/changes/archive/2026-11-05-3568-implement-step-budgets-and-attempts/proposal.md:12] - How does the runner find the path of a failing test?: The runner parses the test output of the step exit check. It maps each failing test to its file and compares that file with the
Changes:list. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:390, src/devops_cli/roadmap/implement/implement_step.py, src/devops_cli/roadmap/implement/implement_eval_properties.py]- Chosen: Parse the test output at the exit check. The exit check already runs the tests, so the runner reads the failing node IDs and maps them to files with no new command.
- Rejected: Block edits to paths outside
Changes:at the tool boundary. A write guard stops the edit but does not name the failing test or stop the step. - Rejected: Run a separate invariant-test command. It duplicates the exit check and adds a command to keep.
- What stop kind does the guard raise?: The guard raises a false-premise stop. It returns the item to New with the failing test and path as evidence. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/implement/implement_step.py]
- Chosen: False premise returns the item to New. The plan does not permit the fix. fix(roadmap): stage includes perimeter tests for network policies #3972 makes the stage job require the test in the plan, so a new plan fixes the cause.
- Rejected: Blocked stop waits for
implement: retry. A retry runs the same plan and repeats the loop. - Rejected:
LimitReached. It is the current bad behavior and spends the budget.
- When does the guard run relative to the fix step?: The guard runs at the step exit check, as soon as a test fails, and before the fix step starts. (best practice) [sources: CONTEXT.md, docs/ROADMAP_WORKFLOW.md:390, src/devops_cli/roadmap/implement/implement_step.py]
- Chosen: At the step exit check, before the fix step. It stops before the model spends tokens on an edit that
diff_scopeforbids. - Rejected: After the
diff_scopeproperty fails. The model already made the forbidden edit and spent the tokens. - Rejected: At plan parse. The failing test is known only at runtime.
- Chosen: At the step exit check, before the fix step. It stops before the model spends tokens on an edit that
- Which paths does the guard treat as allowed?: The guard allows the group's
Changes:paths and the change'stasks.md, asdiff_scopedoes. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:390, openspec/changes/archive/2026-11-01-3030-implement-fixtures-eval/design.md:9]- Chosen: The
Changes:paths and the change'stasks.md. It matchesdiff_scope, which allows thetasks.mdof the change. - Rejected: Only the
Changes:paths. It would stop a valid tick oftasks.md.
- Chosen: The
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-09: none.
Tool: none found.
Activity
devops-cli-service commentedon Nov 7, 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.The guard prevents wasted token budget and a blocked item, but #3972 removes the reported deadlock.The change makes the implement runner stop cleanly on an invariant test failure outside the plan.The change needs new runtime behavior, design decisions and an offline test.Both items address a test outside the Changes list. #3972 adds that test to the stage plan; this item stops the implement step when the test fails.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 1f03ee3 (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Alternatives check: none
Reason: One search for an early-stop guard for coding agents returned only unrelated MDN pages. The need is runner-internal: parse the exit-check test output, compare the failing file with the group's
Changes:list, and raise a false-premise stop. No open tool covers that, and no ADR rejects one.Tool: none found
Lacks:
Searches run:
Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.
dan-petty commentedon Nov 12, 2026
Evidence from #1928 (plan PR #5140, 2026-11-12): the implement job stopped on an invariant test whose fix is outside the plan paths, and the stop got the wrong class.
[[tool.mypy.overrides]]entry, sotest_suppressions_stay_under_their_ceilingsfailed: "[[tool.mypy.overrides]]: 2 > ceiling 1". The fix is a stubtypings/pytrec_eval.pyi, and the plan does not nametypings/.types, because the TYPES rule ofsrc/devops_cli/roadmap/failure.py:281 matches the word "mypy" in the name of the suppression kind. TYPES maps to the action repair (failure.py:122). A repair turn can change only the plan paths, so it could not fix the cause. Loki: "job=implement item=refactor(ai): rank the benchmark with numpy and pytrec-eval #1928 result=stopped success=false class=types repair_rounds=1 tokens=6541201 seconds=2079".plan_defect(action amend), because the fix needs a path outside theChanges:list. When this item stops the step early on such a test, the stop should record that class, so that nobody retries the same plan.Related: #5253 (the ceiling message names the wrong file) and #5251 (a rejected plan keeps the implement record of its item).
devops-cli-service commentedon Nov 17, 2026
Released in v0.169.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.169.4
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 06:41 UTC