Repository navigation
Description
Problem or Motivation
Each implement step writes its tests and its code in one run, so a weak test can pass with weak code. D6 of the approved pipeline split design (tracker #5482) adds a tests unit that pushes failing tests behind a gate, after E3.
Proposed Solution & Architectural Design
- Unit
tests, semaphoreagent. Due: a Planned item (G1 merged), or a Staged item on the continue path, in the effort pass, with notests.checked_shaand no claim. - Steps: scaffold of kind
delivery; the Coder writes the n.1 tests of each group; the tests gate; the push. - The tests gate: the static checks pass, each new test fails by an assertion on the base, and the old tests pass.
- The push goes to a branch with no PR, or carries
[skip ci]on an open PR. - It writes
tests.{checked_sha, files}. Implement is due whentests.checked_shais on the branch. Implement narrows through the feat(roadmap): Run implement as Argo Workflow with per-group resubmit #3105 seam. - The unit uses the two-container template of feat(roadmap): the model container of a unit holds no credential #5506.
- Mode
planuntil E3 decides.
Target Subsystem
Roadmap Service and roadmap jobs (src/devops_cli/roadmap/, the tests unit).
Acceptance Criteria
- Test first: the gate refuses a new test that passes on the base. The test fails on the base.
- A test: a push on an open PR carries
[skip ci]. - Live proof: after the merge and the release, the unit runs as the App in mode
planon the next 3 Planned items. A comment on this issue gives the result lines, the gate verdicts, and the share of tests that implement leaves unchanged (target 95 % or more).
Existing Tool Considered
The pydantic-ai-harness Coder, implement_test_form.py and devops ci fail-to-pass exist. Build: 300,000 to 500,000 agent tokens and 1 to 1.5 days.
Related
Tracker #5482, Phase 7. Depends on #5517, #5518, #5505 and #3105. #3051, #4011.
Source: #5482
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Alternatives check of 2026-11-23: partly.
Tool: SWE-bench/SWE-bench (https://github.com/SWE-bench/SWE-bench), MIT, last activity 2026-09-18, maintained.
Reason: Searches found SWE-bench, whose FAIL_TO_PASS and PASS_TO_PASS harness already replays each new test on the base commit and keeps old tests green, so it covers the gate's core. It is a Docker benchmark harness with no scoped static checks, push or roadmap state. mutmut, already in use, kills mutants but never proves a new test fails on the base.
Covers:
- Requires each new test to fail on the base and pass on the head
- Keeps the old tests passing through the PASS_TO_PASS list
- Per-test status parsed from the test logs
Lacks:
- No branch push, so no [skip ci] commit message
- No scoped static checks of the changed files
- Benchmark instance specs and Docker, not a roadmap job record or plan mode
Proposed design
Problem statement
Each implement step writes its tests and its code in one run, so a weak test can pass with weak code. This item adds a tests unit that writes the new tests first and pushes them only behind a gate. The gate requires passing scoped static checks, a base replay that shows each new test does not pass on the base, and passing old tests. The unit records tests.checked_sha and tests.files, and implement is due only when that SHA is on the item branch. The unit runs in mode plan until E3 decides. Do not start the item before #6521 and the other dependencies close.
Acceptance criteria
Requirement: Tests-only diff replay
devops ci fail-to-pass SHALL replay the changed tests on the base tree when the diff changes only test files and the caller passes --require-replay.
Scenario: A tests-only diff with the flag
- WHEN
devops ci fail-to-pass --require-replayruns on a diff that changes only test files - THEN the report sets
needs_proofto true and holds the base outcome of each changed test
Requirement: New test passes on base
The tests gate SHALL refuse a change whose new test passes on the base commit.
Scenario: A new test passes on the base
- WHEN the base replay reports a new test as passed on the base commit
- THEN the gate returns a typed stop that names the test file, and the unit pushes nothing
Requirement: New test does not pass on base
The tests gate SHALL accept a new test that fails in the call phase, or errors at collection or setup, on the base commit.
Scenario: A new test errors at collection on the base
- WHEN the base replay reports a new test as errored at collection or setup on the base commit
- THEN the gate reports the test as proof and the unit continues to the push
Requirement: Failing old test
The tests gate SHALL refuse a change whose old test module fails on the branch.
Scenario: An old test fails on the branch
- WHEN a scoped run of the old test modules fails on the branch
- THEN the gate returns a typed stop that names the failing old test
Requirement: Failing static check
The tests gate SHALL refuse a change whose scoped static check fails.
Scenario: A static check fails
- WHEN a scoped static check of the changed files fails
- THEN the gate returns a typed stop that names the check
Requirement: Skip ci on an open pull request
The push of the tests unit MUST put [skip ci] in the commit message when the branch has an open pull request.
Scenario: Push with an open pull request
- WHEN the tests unit pushes the new tests to a branch with an open pull request
- THEN the commit message holds
[skip ci], and a push to a branch with no pull request holds no[skip ci]
Requirement: Checked SHA and test files
The tests unit SHALL write tests.checked_sha and tests.files to the job record of the item after its push.
Scenario: Job record after the tests push
- WHEN the tests unit ends with a push
- THEN the job record holds
tests.checked_shaequal to the pushed commit andtests.fileswith each test file it pushed
Requirement: Implement due on the checked SHA
The implement row SHALL report due only when tests.checked_sha is on the item branch.
Scenario: Checked SHA is on the item branch
- WHEN the job record holds a
tests.checked_shathat is an ancestor of the head of the item branch - THEN the implement row reports due, and it reports not due when the SHA is absent or not on the item branch
Requirement: Tests row due for a Planned item
The tests row SHALL report due for a Planned item that is in the effort pass, has no claim and has no tests.checked_sha.
Scenario: A Planned item with no claim and no checked SHA
- WHEN a Planned item is in the effort pass, holds no owner label and its job record holds no
tests.checked_sha - THEN the tests row reports due, and it reports not due when the item holds a claim or a checked SHA
Requirement: Tests row on a Staged item
The tests row SHALL report due for a Staged item that is on the continue path in the effort pass, has no claim and has no tests.checked_sha.
Scenario: A Staged item on the continue path
- WHEN a Staged item on the continue path is in the effort pass, holds no owner label and its job record holds no
tests.checked_sha - THEN the tests row reports due, and it reports not due when the item holds a claim or a checked SHA
Requirement: Mode plan by default
The tests unit SHALL run in mode plan until E3 sets another mode.
Scenario: No mode set for the tests unit
- WHEN the tests unit runs and the settings name no mode for it
- THEN the result line records mode
plan
Requirement: Pending a person after the merge
The owner MUST run the tests unit as the App in mode plan on the next 3 Planned items after the merge and the release.
Scenario: Live proof after the release
- WHEN the change has merged and released, and the owner runs the tests unit as the App in mode
planon the next 3 Planned items - THEN a comment on this issue gives the result lines, the gate verdicts, and the share of tests that implement leaves unchanged, which is 95 % or more
Existing Tool Considered
The alternatives check in the issue body gives SWE-bench/SWE-bench (https://github.com/SWE-bench/SWE-bench) the verdict partly, and the block lists what the tool covers and lacks. The change fills the three gaps that the block's Lacks: list names: scoped static checks of the changed files, a branch push that carries [skip ci] on an open pull request, and a roadmap job record with mode plan. It builds no new replay harness, because it reuses devops ci fail-to-pass for the base replay and the old-test list. The issue records the build cost as 300,000 to 500,000 agent tokens and 1 to 1.5 days.
Key questions
- Which command checks that each new test does not pass on the base commit?: The gate reuses
devops ci fail-to-passwith a new--require-replayflag. The flag forces the base replay when the diff changes no source code. The replay checks out the base tree with the head tests overlaid. It reports the status of each changed test. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py, docs/TESTING.md, tests/ci/test_fail_to_pass.py]- Chosen: Reuse
devops ci fail-to-passwith--require-replay. The replay, its base worktree, its JUnit reader and its tests exist. One flag forces the proof for a tests-only diff. - Rejected: Reuse
devops ci fail-to-passunchanged. It passes with no replay when the diff changes no source code, so it would not check the new tests. - Rejected: New base runner in the tests unit. It duplicates the replay and its tests, and the two copies drift.
- Rejected: mutmut mutation gate. It kills injected mutants. It does not show that a new test does not pass on the base commit.
- Chosen: Reuse
- Which base outcomes prove that a new test does not pass?: A call-phase failure proves it. A collection or setup error also proves it, because the test cannot import or set up the new code. A pass and a teardown error prove nothing. These are the classes of
devops ci fail-to-pass(proves_fix, fix(ci): count a test that errors on base as fail-to-pass proof #6372). The gate adds no second rule. The issue says 'fails by an assertion', which is narrower: a new test targets code that does not exist yet, so it usually errors at collection. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py, tests/ci/test_fail_to_pass.py]- Chosen: Use the failure classes of
devops ci fail-to-pass.proves_fixaccepts a call-phase failure and a collection or setup error, and it rejects a pass and a teardown error (fix(ci): count a test that errors on base as fail-to-pass proof #6372). The gate needs no second rule. - Rejected: Require an assertion failure only. The new test targets code that does not exist yet, so it usually errors at collection. This rule would refuse most new tests.
- Rejected: Accept any non-passing status. A teardown error comes after the call phase ran, so it proves nothing (fix(ci): count a test that errors on base as fail-to-pass proof #6372).
- Chosen: Use the failure classes of
- Which code runs the static checks and the old tests of the gate?: The gate reuses the implement job's scoped checks.
scoped_checksbuilds thepre-pushandstaticrows.run_scoped_checksruns them and stops at the first failure. The gate passes the old test modules as thetestsargument and leaves out the new test files. (best practice) [sources: src/devops_cli/roadmap/implement/implement_scoped_ci.py]- Chosen: Reuse the implement scoped checks. The rows, the command timeout, the log capture and the stop at the first failure exist and are tested.
- Rejected: New gate code in the tests unit. It duplicates the checks and their tests, and the two copies drift.
- Rejected: Run the whole suite. The module's docstring records that a Job of 2 CPUs cannot run the whole suite in the command time limit.
- Which roadmap step does the push of the new tests?: The unit reuses the implement job's lease push,
_push_with_lease. It reuses theopenstep for a branch with no pull request. The commit carries[skip ci]only when a pull request is open. Theopenstep refuses a head with[skip ci]. (best practice) [sources: tests/roadmap/steps/test_roadmap_step_open.py, tests/roadmap/stage/test_roadmap_stage_job_entry.py]- Chosen: Reuse the implement lease push and the
openstep. The push behavior and its tests exist. Theopenstep already refuses a[skip ci]head. - Rejected: Reuse a shared push step. The stage test names the shared push step as later work, so it is not available at this commit.
- Rejected: New push code in the tests unit. It adds a second push path to keep, and the two paths drift.
- Chosen: Reuse the implement lease push and the
- Where does the tests unit write
tests.checked_shaandtests.files?: The unit writes them in the hidden job record block of the issue body. The other roadmap jobs use the same block. The tests row reads the record for its due state. The implement row reads it to start. (best practice) [sources: docs/adr/0016-labels-hold-the-roadmap-items-fields.md, docs/ROADMAP_WORKFLOW.md]- Chosen: Hidden job record block of the issue body. The issue body holds the job record of an item, and each job already reads and writes it (ADR 0016).
- Rejected: A file on the branch. It makes a commit for each state change, and the state is not visible before the branch exists.
- Rejected: A Valkey key alone. A due mark has a TTL. It is never the only copy of a decision (ADR 0021).
- Which mode does the tests unit run in until E3 decides?: The unit runs in mode
plan. Each new row of the Service starts inplan, and a person setson. Theopenandreviewrows follow this rule. The unit records modeplanin its result line until E3 sets another mode. (best practice) [sources: k8s/devops/configmap.example.yaml, docs/CLUSTER.md]- Chosen: Mode
planby default. Each new row of the Service starts inplanuntil a person setson. E3 owns the live mode. - Rejected: Mode
onby default. It takes the mode that E3 owns and starts pushes before the decision.
- Chosen: Mode
Fit
Fits in one pull request.
Suspected block
None.
Activity
dan-petty commentedon Nov 13, 2026
Both add a gate before a push in the roadmap pipeline, but #3043 changes the implement job to run scoped CI, while the candidate adds a new tests unit that writes and gates tests before implement runs.devops-cli-service commentedon Nov 17, 2026
Alternatives check: in-use
Reason: Searches found no tool that runs a roadmap tests unit; mutmut only partly covers the gate, proving tests fail on injected faults rather than that each new test fails on the base commit.
The repository already uses this tool.
Tool: boxed/mutmut (https://github.com/boxed/mutmut), BSD-3-Clause, last activity 2026-11-07, maintained.
Covers:
Lacks:
Searches (10)
Tools considered:
Searches run:
Sources:
A person decides what this check of 2026-11-17 means for the item.
devops-cli-service commentedon Nov 18, 2026
Refine cannot set this item to Ready at 86358b6 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/implement/implement_step.py.devops-cli-service commentedon Nov 19, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 23, 2026
The result in the alternatives block of the issue body changed. Before this check:
in-use, tool https://github.com/boxed/mutmut. A person decides what the new result means for the item.Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 27, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30), before the hold #6521 closes. This item adds or extends a gate, refusal, screen, cap, limit, retry, result line, shell allowlist, tool catalog or plan-shape rule of the stage, implement or fix-checks job. #6519 found that 263 of about 900 issues in four weeks added such rules and none replaced the engine. Stage now runs on stock Coder (grade 60 on 30 graded attempts), where the agent reads the repository, runs the checks in its loop and has a real shell; implement follows (#6527). The code paths that this item names have also moved. If the failure class still shows in graded attempts, file a new item from that evidence. Closed as not planned; a person may reopen it.