Skip to content

feat(roadmap): a tests unit pushes failing tests behind a gate #5520

Not planned

Description

@dan-petty

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, semaphore agent. Due: a Planned item (G1 merged), or a Staged item on the continue path, in the effort pass, with no tests.checked_sha and 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 when tests.checked_sha is 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 plan until 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 plan on 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

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-replay runs on a diff that changes only test files
  • THEN the report sets needs_proof to 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_sha equal to the pushed commit and tests.files with 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_sha that 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 plan on 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-pass with a new --require-replay flag. 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-pass with --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-pass unchanged. 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.
  • 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]
  • Which code runs the static checks and the old tests of the gate?: The gate reuses the implement job's scoped checks. scoped_checks builds the pre-push and static rows. run_scoped_checks runs them and stops at the first failure. The gate passes the old test modules as the tests argument 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 the open step for a branch with no pull request. The commit carries [skip ci] only when a pull request is open. The open step 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 open step. The push behavior and its tests exist. The open step 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.
  • Where does the tests unit write tests.checked_sha and tests.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 in plan, and a person sets on. The open and review rows follow this rule. The unit records mode plan in its result line until E3 sets another mode. (best practice) [sources: k8s/devops/configmap.example.yaml, docs/CLUSTER.md]
    • Chosen: Mode plan by default. Each new row of the Service starts in plan until a person sets on. E3 owns the live mode.
    • Rejected: Mode on by default. It takes the mode that E3 owns and starts pushes before the decision.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3105, #5505, #5506, #5517, #5518, #6521

Activity

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

    @dan-petty
    OwnerAuthor
  4. added
    priority/p2-medium
    on Nov 13, 2026
  5. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    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:

    • Kills injected mutants to prove tests fail on faulty code
    • Reports surviving mutants as evidence of weak tests
    • Runs the pytest suite for each mutant
    • Exits non-zero so CI can gate on it

    Lacks:

    • No check that a new test fails on the base commit
    • No Coder step that writes the new tests
    • No branch push or [skip ci] handling
    • No roadmap unit, semaphore, claim or checked_sha state
    Searches (10)

    Tools considered:

    Searches run:

    • pytest plugin verify new tests fail before fix passes after, results: 5
    • tool that checks a new test fails on the base commit fail-to-pass gate, results: 5
    • mutation testing verify tests catch bugs mutmut cosmic-ray python, results: 5
    • "fail-to-pass" test validation open source tool github, results: 5
    • pytest-testmon, results: 5
    • mutmut mutation testing, results: 5
    • github action run new tests against base commit expect failure test-first, results: 5
    • swebench harness FAIL_TO_PASS PASS_TO_PASS test validation script, results: 5
    • mutmut github boxed, results: 5
    • "fails-to-pass" tests tool repository CI gate new tests must fail on base, results: 5

    Sources:

    A person decides what this check of 2026-11-17 means for the item.

  6. devops-cli-service commented on Nov 18, 2026

    @devops-cli-service
    Contributor

    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.

  7. devops-cli-service commented on Nov 19, 2026

    @devops-cli-service
    Contributor

    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.

  8. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    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.

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

    @devops-cli-service
    Contributor

    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.

  10. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    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:

    • pytest plugin require new tests fail on base commit CI gate test-first verification, results: 5
    • tool that verifies a new test fails on the base commit before the fix (fail-to-pass gate), results: 5
    • SWE-bench FAIL_TO_PASS PASS_TO_PASS test specification run_evaluation harness, results: 5
    • tdd-guard enforce test driven development blocks code written before failing test, results: 5
    • swebench, results: 5
    • mutmut, results: 5
    • fail-to-pass pytest plugin, results: 5
    • tdd-guard, results: 5
    • test-first CI gate new test must fail, results: 5
    • SWE-bench harness, results: 5

    Sources:

  11. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    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.

  12. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    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.

  13. removed
    status/new
    on Nov 30, 2026
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/highpriority/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