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

## Decisions

- **Keep the worker choice of `devops ci test` and change no file under `src/devops_cli/commands/`.**: `src/devops_cli/config/defaults.py:469:DEFAULT_CI_TEST_SERIAL_MAX_FILES: Final[int] = 12` and `src/devops_cli/config/defaults.py:470:DEFAULT_CI_TEST_NARROWED_WORKERS: Final[int] = 4` record the measured choice of #1669, and the full suite keeps addopts' workers (`pyproject.toml:205:addopts = "-n logical --dist worksteal`). The long run comes from six whole-set replays, so the plan does not reverse that decision.
- **Share one report through a module-scoped fixture and add one parametrized item per case.**: Six tests each called `replay_all` over the whole list, so the module replayed the set six times. The fixture shares one report, and the item per case lets xdist distribute the cases and names the failing case.
- **Put the no-poll rule in the implement prompt, not in the shell policy.**: `src/devops_cli/roadmap/implement/implement_step.py:def _tune` sets no command timeout and no polling loop, so the sleep calls are the model's choice. The prompt states the rule and a test holds it.
- **Add no completion-event service and no harness change.**: The shell tool call already returns one result per command, so a service would add a dependency for no need.
- **State the eval score of the prompt change in the implement pull request.**: `docs/ROADMAP_WORKFLOW.md:400:A change to the implement prompt` requires the score on the base and on the branch with one model, and the live command needs the gateway, so a person runs it.

## Rejected alternatives

- **Pass -n auto to every `devops ci test` run.**: The measured choice of #1669 runs a selection of up to `src/devops_cli/config/defaults.py:469:DEFAULT_CI_TEST_SERIAL_MAX_FILES: Final[int] = 12` test modules serially, because worker start-up costs more than it saves for a few modules, and `pyproject.toml:205:addopts = "-n logical --dist worksteal` already gives the full suite its workers.
- **Add a completion-event service or a polling loop to the runner harness.**: `src/devops_cli/roadmap/implement/implement_step.py:def _tune` gives the shell its allowed commands and its environment and sets no command timeout, so a shell call already returns one result when its command exits.
- **Refuse sleep code inside a program that the shell runs.**: The shell policy admits the documented programs and their arguments (`src/devops_cli/roadmap/implement/implement_step.py:467:allowed_commands=list(IMPLEMENT_SHELL_PROGRAMS),`), so matching sleep text inside a program would refuse other probes; the prompt rule removes the choice with no shell change.
- **Keep the six whole-set replays and rely on xdist to spread them.**: A narrowed run of one test module runs serially, as `docs/TESTING.md:158:runs serially for up to` records, so xdist spreads nothing and the module still replays the set six times.
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Proposal

## Why

The eval gate test module replays the whole golden set six times, so a narrowed devops ci test run exceeds the five-minute budget of AGENTS.md rule 5, and the implement agent waits with shell sleep calls that spend tokens and keep the runner pod alive. The change cuts the replay to one per module, gives each case its own test item, and tells the agent that a shell call returns when its command ends (#4079).

## What Changes

- `tests/roadmap/stage/test_roadmap_stage_eval_gates.py` computes the whole-set replay once in a module-scoped fixture and gives each case its own parametrized test item.
- `src/devops_cli/ai/tasks/roadmap_implement_step.md` says that a shell call returns when its command ends and forbids polling with sleep, time.sleep and a repeated tail.
- `tests/roadmap/implement/test_roadmap_implement_prompt.py` holds the test of the no-poll rule.
- `docs/TESTING.md` records the replay rule next to the worker choice of `devops ci test`.
- The spec deltas add the replay rule to roadmap-stage-eval and the no-poll rule to roadmap-implement-step.
- The change fits one pull request.

## Capabilities

### New Capabilities

None.

### Modified Capabilities

- `roadmap-stage-eval`: The replay of the golden set runs once per test module
- `roadmap-implement-step`: The implement prompt forbids polling

## Impact

- Documents: `src/devops_cli/ai/tasks/roadmap_implement_step.md`, `docs/TESTING.md`
- Tests: `tests/roadmap/stage/test_roadmap_stage_eval_gates.py`, `tests/roadmap/implement/test_roadmap_implement_prompt.py`

## Feasibility

- Probes confirm the two cited files: "The path `tests/roadmap/stage/test_roadmap_stage_eval_gates.py` is a file of the staging commit." and "The path `src/devops_cli/ai/tasks/roadmap_implement_step.md` is a file of the staging commit."
- The eval gate module replays the whole case list six times, in `tests/roadmap/stage/test_roadmap_stage_eval_gates.py:def test_every_gate_still_refuses_every_known_bad_plan_it_must`, `tests/roadmap/stage/test_roadmap_stage_eval_gates.py:def test_each_good_plan_passes_every_gate`, `tests/roadmap/stage/test_roadmap_stage_eval_gates.py:def test_no_defect_waits_for_a_gate_once_the_gates_of_3012_to_3017_are_built`, `tests/roadmap/stage/test_roadmap_stage_eval_gates.py:def test_the_counts_of_each_type_are_the_baseline_that_a_change_of_a_gate_beats`, `tests/roadmap/stage/test_roadmap_stage_eval_gates.py:def test_the_replay_runs_the_check_of_the_job_so_a_spec_rule_that_refuses_all_fails_it` and `tests/roadmap/stage/test_roadmap_stage_eval_gates.py:def test_a_rule_of_the_check_that_stops_refusing_fails_the_replay_of_its_defects`.
- The set holds 49 case directories: list_files of `tests/fixtures/roadmap_eval/stage` returned 49 entries. Each of the 49 stays and is replayed; none is removed, restricted or allowlisted, because the replay must judge every case. The refine block states 69 cases, so the plan repeats no case total.
- The count that `load_cases` returns is unverified, because no read-only tool runs it. The first group's verify runs the module, whose shape test compares the collected case items with the list that `load_cases` returns, and the group stops when the two differ.
- The narrowed run of one test module runs serially: `src/devops_cli/commands/ci.py:def _narrowed_workers` picks the worker count of a narrowed run. `src/devops_cli/config/defaults.py:469:DEFAULT_CI_TEST_SERIAL_MAX_FILES: Final[int] = 12` bounds the serial selection, and `src/devops_cli/config/defaults.py:470:DEFAULT_CI_TEST_NARROWED_WORKERS: Final[int] = 4` gives the workers above it.
- The full suite keeps its workers: `pyproject.toml:205:addopts = "-n logical --dist worksteal` and `docs/TESTING.md:158:runs serially for up to`. pytest-xdist is already a dev dependency: `pyproject.toml:99:"pytest-xdist==3.8.0",`.
- The issue says ci test runs pytest serially by default; that holds only for a narrowed run of up to 12 test modules. The full suite keeps addopts' worker count, so the plan adds no worker flag and changes no file under `src/devops_cli/commands/`.
- The harness needs no change: `src/devops_cli/roadmap/implement/implement_step.py:def _tune` gives the shell its allowed commands, its denied operators and its environment, and sets no command timeout and no polling loop, so a shell call returns one result when its command exits. `src/devops_cli/roadmap/implement/implement_step.py:550:coder = Coder[None](instructions=instructions, repo_context=False, sub_agents=False)` builds that agent.
- The issue says a shell sleep command violates the repository rules; no rule names a shell sleep. The applicable rules are the five-minute budget at `AGENTS.md:13:5. **Pass the checks.**`, the ban on a test that bounds elapsed time at `docs/TESTING.md:142:No test bounds elapsed wall-clock time from above.`, and the polling rule at `docs/SDLC.md:328:Never poll in rapid or sub-minute intervals.`
- `load_cases` needs a checkout of the repository: its argument is REPO_ROOT / CASES_DIRECTORY, and `src/devops_cli/roadmap/stage/stage_eval_cases.py:70:CASES_DIRECTORY: Final[Path] = Path("tests/fixtures/roadmap_eval/stage")` names the folder under the checkout.
- `replay_all` needs a checkout of the repository: `src/devops_cli/roadmap/stage/stage_eval_gates.py:419:table = registry if registry is not None else registry_table(Path.cwd())` reads the registry table from the working tree.
- `replay_case` needs a checkout of the repository: each case reads its staged tree from the checkout, so the shared report reads that tree once for the whole set.
- The first checks against the real system are `uv run devops ci test tests/roadmap/stage/test_roadmap_stage_eval_gates.py`, `uv run devops ci test tests/roadmap/implement/test_roadmap_implement_prompt.py` and `uv run devops ci docs`, one after each group.
- The prompt change carries the merge condition of `docs/ROADMAP_WORKFLOW.md:400:A change to the implement prompt`: the pull request gives the score of `devops roadmap eval implement` on the base and on the branch with one model. That command needs a client of the model gateway and a network, so a person runs it and the pull request states both totals.
- find_issues with the terms 'replay_all eval gate test' returned the open items #4113, #3343 and #3266 beside this item, and none of their titles names the eval gate test module. find_issues with the terms 'roadmap_implement_step prompt polling' returned no open item. The context lists no overlap, so the plan takes no dependency.

## Existing Tool Considered

pytest-xdist 3.8.0 covers parallel test execution. It is already a dev dependency (`pyproject.toml:99:"pytest-xdist==3.8.0",`) and addopts already runs it (`pyproject.toml:205:addopts = "-n logical --dist worksteal`). The change adds a module-scoped fixture and a parametrization in the eval gate test, and builds no runner.

## Dependencies

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

### Requirement: The implement prompt forbids polling
The implement prompt SHALL state that a shell call returns when its command ends, and MUST forbid polling with `sleep`, `time.sleep` or a repeated `tail`.

#### Scenario: The prompt holds the no-poll rule
- **WHEN** A test reads `src/devops_cli/ai/tasks/roadmap_implement_step.md`
- **THEN** The prompt says that a shell call returns when its command ends, and names sleep, time.sleep and a repeated tail as ways not to poll.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## ADDED Requirements

### Requirement: The replay of the golden set runs once per test module
The eval gate test module SHALL compute the replay of the golden set once in a module-scoped fixture, and SHALL give each case of the set its own parametrized test item.

#### Scenario: One item for each case
- **WHEN** A test reads the parametrize mark of the case test in the eval gate test module
- **THEN** The mark's values are the list that load_cases returns, so pytest collects one item for each case.

#### Scenario: The report tests share one replay
- **WHEN** A test reads the source of the eval gate test module
- **THEN** The whole-set replay_all call sits in the module-scoped fixture, and no report test calls replay_all itself.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Tasks

## 1. Compute the golden-set replay once in the eval gate test module

Reads: `tests/roadmap/stage/test_roadmap_stage_eval_gates.py`, `src/devops_cli/roadmap/stage/stage_eval_gates.py`, `src/devops_cli/roadmap/stage/stage_eval_cases.py`. Changes: `tests/roadmap/stage/test_roadmap_stage_eval_gates.py`.

- [ ] 1.1 In `tests/roadmap/stage/test_roadmap_stage_eval_gates.py`, add a module-level list of cases from `load_cases` and a module-scoped report fixture that calls `replay_all` on the whole list once. Change the six report tests to read the fixture's report, keep the registry-count test, and add one parametrized test per case that reads that case's replay from the shared report. Add a shape test that the whole-set `replay_all` call sits in the module-scoped fixture and that the parametrize mark holds the loaded cases; build the searched text from parts so the shape test does not count itself
- Verification: `$ uv run devops ci test tests/roadmap/stage/test_roadmap_stage_eval_gates.py` passes

## 2. State in the prompt that a shell call returns when its command ends

Reads: `src/devops_cli/ai/tasks/roadmap_implement_step.md`, `tests/roadmap/implement/test_roadmap_implement_prompt.py`, `docs/ROADMAP_WORKFLOW.md`. Changes: `src/devops_cli/ai/tasks/roadmap_implement_step.md`, `tests/roadmap/implement/test_roadmap_implement_prompt.py`.

- [ ] 2.1 In `tests/roadmap/implement/test_roadmap_implement_prompt.py`, write `test_the_prompt_says_a_shell_call_returns_when_its_command_ends` for `src/devops_cli/ai/tasks/roadmap_implement_step.md`; it fails because the prompt holds no such rule
- Verification: `$ uv run devops ci test tests/roadmap/implement/test_roadmap_implement_prompt.py` fails on the base
- [ ] 2.2 In `tests/roadmap/implement/test_roadmap_implement_prompt.py`, write the failing test first: it reads the prompt and asserts the sentence that a shell call returns when its command ends, and that the prompt names `sleep`, `time.sleep` and a repeated `tail` as forbidden. In `src/devops_cli/ai/tasks/roadmap_implement_step.md`, add that rule to the runner rules of the prompt, beside the paragraph that gives the shell
- Verification: `$ uv run devops ci test tests/roadmap/implement/test_roadmap_implement_prompt.py` passes

## 3. Record the replay rule in the testing document

Reads: `docs/TESTING.md`, `tests/roadmap/stage/test_roadmap_stage_eval_gates.py`. Changes: `docs/TESTING.md`.

- [ ] 3.1 In `docs/TESTING.md`, add a bullet to the section that holds the worker choice: a test module that replays a shared set computes the replay once in a module-scoped fixture and gives each case its own parametrized item, so a narrowed run stays inside the budget and xdist can distribute the cases
- Verification: `$ uv run devops ci docs` passes
- [ ] 3.2 In `docs/TESTING.md`, add the replay rule to the section that holds the worker choice
- Verification: `$ uv run devops ci docs` passes

## Workflow follow-up

- Pending a person: review the diff in tuicr (tuicr -r <base>..HEAD).
Loading