Skip to content

feat(roadmap): eval implement compares a separate tests pass #5517

Not planned

Description

@dan-petty

Problem or Motivation

Each implement step writes its tests (n.1) and its code (n.2) in one run. D6 of the approved pipeline split design (tracker #5482) lets a tests job push failing tests behind a tests gate, but only after E3 shows equal or better implement success.

Proposed Solution & Architectural Design

Target Subsystem

Roadmap Service and roadmap jobs (src/devops_cli/roadmap/implement/, the eval commands).

Acceptance Criteria

  • Test first: arm B runs the tests gate on fixture outputs and refuses a new test that passes on the base. The test fails on the base.
  • A comment on this issue gives the A/A result, then the measures of each arm and the decision.
  • No live proof applies: this item is an offline eval. feat(roadmap): a tests unit pushes failing tests behind a gate #5520 has the live proof.

Existing Tool Considered

The pydantic-ai-harness Coder (the engine of implement), pydantic-evals and devops ci fail-to-pass. Build: 200,000 to 400,000 agent tokens and 1 day. Model spend: approved by the owner from the A/A pass.

Related

Tracker #5482, Phase 7. Depends on #5516 and #3051. #5520, #3105, #5177.

Source: #5482

Dependencies

Alternatives check of 2026-11-30: partly.
Tool: SWE-bench/SWE-bench (https://github.com/SWE-bench/SWE-bench), MIT, last activity 2026-09-18, maintained.
Reason: The searches found SWE-bench, whose harness runs FAIL_TO_PASS and PASS_TO_PASS tests on a base and a head. It gives the tests gate in part, but it has no tests pass, arm comparison or A/A pass.

Covers:

  • Runs named tests on a base and a head tree
  • Checks that old tests still pass
  • Reports each instance outcome and a log

Lacks:

  • No tests pass before the implement step
  • No arm A against arm B comparison
  • No test strength, unchanged-test share or A/A pass
  • No decision rule for the tests job mode

Proposed design

Problem statement

The implement eval must compare arm A (implement as today) with arm B (a tests pass first, then implement) on the implement golden set. It must add the tests gate: the static checks pass, each new test fails by an assertion on the base, and the old tests pass. It must measure test strength, the share of tests that implement leaves unchanged, and implement success. It must run the A/A pass and apply the E1 decision rule to the tests job's mode. The item is an offline eval and waits on #6521.

Acceptance criteria

Requirement: Arm option

devops roadmap eval implement SHALL accept --arm with the values a and b, and it MUST use arm a when the option is absent.

Scenario: Default arm

  • WHEN The test invokes devops roadmap eval implement --dry-run on one fixture with no arm option.
  • THEN The test asserts that the dry-run text names arm a.

Requirement: Tests pass and gate before implement

Arm b SHALL run the tests pass, then the tests gate, then the implement step, and the implement step MUST receive the tests that the tests pass wrote.

Scenario: Arm B order

  • WHEN The test runs arm b on one fixture with a fake tests pass, a fake tests gate and a fake implement step.
  • THEN The test asserts that the tests pass ran first, the tests gate second and the implement step third, and that the implement step received the paths of the tests that the tests pass wrote.

Requirement: Tests gate rejects a passing new test

The tests gate SHALL refuse a new test that passes on the base commit.

Scenario: New test passes on base

  • WHEN The test runs the tests gate on a fixture output whose new test passes on the base.
  • THEN The test asserts that the gate returns a failure and names the passing test.

Requirement: Tests gate rejects an errored new test

The tests gate SHALL refuse a new test that errors on the base commit instead of failing an assertion.

Scenario: New test errors on base

  • WHEN The test runs the tests gate on a fixture output whose new test errors on the base.
  • THEN The test asserts that the gate returns a failure and names the errored test.

Requirement: Tests gate accepts a valid test-first output

The tests gate SHALL pass only when the static checks pass, each new test fails by an assertion on the base, and the old tests pass.

Scenario: Valid test-first output

  • WHEN The test runs the tests gate on a fixture output with passing static checks, a new test that fails by assertion on the base, and passing old tests.
  • THEN The test asserts that the gate returns a pass.

Requirement: Arm measures

The eval SHALL record the strength report of the existing strength check and implement success for each arm, and for arm b the share of the tests that the tests pass wrote which the implement step leaves unchanged.

Scenario: Measures in the result

  • WHEN The test runs both arms on a fixture golden set with a fake model.
  • THEN The test asserts that the result record holds the strength report and implement success for arm a and for arm b, and the unchanged-test share for arm b.

Requirement: A/A pass first

The eval SHALL run the A/A pass before it compares arm a and arm b.

Scenario: A/A pass order

  • WHEN The test runs the eval on the golden set with a fake model.
  • THEN The test asserts that the A/A pass completes before the arm comparison starts.

Requirement: Lower success keeps plan

The eval SHALL keep the tests job in mode plan when arm b has lower implement success than arm a.

Scenario: Lower implement success

  • WHEN The test runs the decision rule with arm b implement success lower than arm a.
  • THEN The test asserts that the decision keeps the tests job in mode plan.

Requirement: Equal success leaves plan

The eval SHALL leave mode plan when arm b has equal or better implement success than arm a.

Scenario: Equal implement success

  • WHEN The test runs the decision rule with arm b implement success equal to arm a.
  • THEN The test asserts that the decision leaves mode plan.

Requirement: Result record

The eval SHALL write the A/A result, the strength report and implement success of each arm, the unchanged-test share of arm b, and the decision to its result record.

Scenario: Result record fields

  • WHEN The test runs the eval on the golden set with a fake model.
  • THEN The test asserts that the result record holds the A/A result, the strength report and implement success for each arm, the unchanged-test share for arm b, and the decision.

Requirement: Pending a person after the merge

A person MUST post the A/A result, the strength report and implement success of each arm, the unchanged-test share of arm b, and the decision as a comment on the issue after the eval run.

Scenario: Result comment

  • WHEN The eval run ends and its result record is available.
  • THEN A person posts the A/A result, the strength report and implement success of each arm, the unchanged-test share of arm b, and the decision as a comment on the issue.

Existing Tool Considered

The alternatives block of 2026-11-23 names SWE-bench/SWE-bench (https://github.com/SWE-bench/SWE-bench), MIT, last activity 2026-09-18, maintained, with the verdict partly; the block's Lacks: list states what the tool lacks. The eval reuses the project's replay of src/devops_cli/ci/fail_to_pass.py for the tests gate and adds the arm comparison, the A/A pass, the three measures and the decision rule as code. The written cost of that code is 200,000 to 400,000 agent tokens and 1 day.

Key questions

  • Which open, maintained tool covers the tests gate, and what does it lack?: The alternatives block of 2026-11-23 names SWE-bench/SWE-bench (https://github.com/SWE-bench/SWE-bench), MIT, last activity 2026-09-18, maintained, with the verdict partly; the block's Lacks: list gives what the tool lacks. The eval reuses the project's replay in src/devops_cli/ci/fail_to_pass.py for the tests gate and adds the arm comparison, the A/A pass, the three measures and the decision rule as code. The written cost of that code is 200,000 to 400,000 agent tokens and 1 day. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py:1, .github/workflows/fail-to-pass.yml:1, docs/adr/0004-ci-is-the-authoritative-gate.md]
    • Chosen: Reuse the project's replay and add the eval code. The replay already produces each changed test's outcome on the base with the head's tests overlaid. The alternatives block finds no tool that covers the arm comparison and the measures.
    • Rejected: Adopt the SWE-bench harness. The block of 2026-11-23 gives what it lacks, and it binds the eval to its own instance spec, Docker and task repository.
    • Rejected: Build a new replay. It duplicates the replay in src/devops_cli/ci/fail_to_pass.py, which already separates an assertion failure from an error and refuses a replay that could not run.
  • How does the eval implement the tests gate?: The eval reuses the replay of src/devops_cli/ci/fail_to_pass.py: it checks out the base tree as a detached worktree with the tests pass output's tests/ overlaid and runs the changed test files, and its JUnit report gives each new test's outcome. The gate passes only when each new test's outcome is a failed assertion in the call phase, so it refuses a test that passes and a test that errors; the replay's own rule also counts a collection or setup error as proof (fix(ci): count a test that errors on base as fail-to-pass proof #6372), so the gate reads the outcome and does not take the replay's verdict alone. The static rows of implement_scoped_ci.py and the fixture's tests_pass commands cover the static checks and the old tests. ADR 0004 makes CI the authoritative gate. (best practice) [sources: src/devops_cli/ci/fail_to_pass.py:1, src/devops_cli/ci/fail_to_pass.py:19, src/devops_cli/roadmap/implement/implement_scoped_ci.py:11, docs/ROADMAP_WORKFLOW.md:446, docs/adr/0004-ci-is-the-authoritative-gate.md]
    • Chosen: Reuse the replay and read its per-test outcome. The replay already overlays the head's tests on the base and reports each test as failed, errored or passed. ADR 0004 makes that replay the project's gate.
    • Rejected: Take the replay's verdict as the gate. The replay counts a collection or setup error on base as proof (fix(ci): count a test that errors on base as fail-to-pass proof #6372), and the gate must refuse a test that errors instead of failing an assertion.
    • Rejected: Write a new replay. It duplicates the worktree overlay, the JUnit report and the could-not-run rule of the existing replay.
  • What shape does the arm option take?: --arm with the values a and b defaults to a, so an existing invocation keeps today's behaviour. (best practice) [sources: src/devops_cli/commands/roadmap_eval_implement.py:110, docs/commands/roadmap.md:480]
    • Chosen: --arm {a,b}, default a. It matches the option style of the command. It keeps today's behaviour when the option is absent.
    • Rejected: A boolean --tests-first. It names only one arm. It makes the default an implicit arm.
    • Rejected: A required --arm. It breaks every existing invocation, including the recorded eval runs.
  • Is feat(roadmap): new tests of an implementation are checked for strength #3051 still a dependency?: No. The strength check is in the tree and runs all three parts (the assertion scan, the mutation run and the coverage delta) at src/devops_cli/roadmap/implement/implement_strength.py; docs/roadmap/implement.md:75 and CHANGELOG.md record its delivery with feat(roadmap): Check the strength of the new tests (#3051) #5770. feat(roadmap): new tests of an implementation are checked for strength #3051 is no dependency. [sources: src/devops_cli/roadmap/implement/implement_strength.py:1, src/devops_cli/roadmap/implement/implement_strength.py:27, docs/roadmap/implement.md:75, CHANGELOG.md:1941]
  • How does the eval measure test strength?: The eval runs the existing strength check of implement_strength.py on the tree of each arm and records its report: the assertion scan of the new test files, the mutation run and the coverage delta. It adds no second strength metric. (best practice) [sources: src/devops_cli/roadmap/implement/implement_strength.py:1, src/devops_cli/roadmap/implement/implement_scoped_ci.py:19]
  • How does the eval measure the share of tests that implement leaves unchanged?: Only arm b has a tests pass output to compare, so the eval records the share for arm b: it reads the path::name of every test that the tests pass wrote with the AST reader of implement_test_names.py, reads the same names after the implement step, and records the count of names that both sets hold over the count that the tests pass wrote. Arm a writes its tests in the implement run, so it has no such share and the record marks it not applicable. (best practice) [sources: src/devops_cli/roadmap/implement/implement_test_names.py:1, src/devops_cli/roadmap/implement/implement_step.py:154, docs/ROADMAP_WORKFLOW.md:447]
    • Chosen: Compare the path::name test names before and after the implement step. It measures the tests that implement changes. It uses the AST reader that the step already uses for its lost-test check and needs no line-level diff.
    • Rejected: Compare test file content. It counts an unrelated edit in a test file as a changed test.
    • Rejected: Count only new test files. It ignores edits to the tests that the tests pass wrote.
  • How does the eval decide the mode of the tests job?: The eval compares the implement success of arm b with arm a on the same golden set after the A/A pass, and it keeps the tests job in mode plan unless arm b is equal or better. That is the project's before-and-after rule for an eval change (AW-E1: the same set on the base and on the branch, with both arms pinned to one model) and the item's E1 bar. The mode moves out of plan only with the live proof and enough attempts for a grade, which a later item supplies. (best practice) [sources: docs/guidelines/agentic-jobs.md:49, docs/guidelines/agentic-jobs.md:258, docs/ROADMAP_WORKFLOW.md:457, docs/SELF_IMPROVEMENT.md:1016]
    • Chosen: Keep plan unless arm b is equal or better on the same set. It applies the project's before-and-after rule of the same set on both arms and the item's E1 bar.
    • Rejected: Leave plan after any run. It ignores the arm comparison and the item's gate.
    • Rejected: Require arm b to beat arm a. The stricter rule of docs/ROADMAP_WORKFLOW.md:457 applies to a change of the implement prompt or tool set, not to the pipeline's tests job.
  • How does the eval record the A/A result and the decision?: The eval writes the A/A result, the strength report and implement success of each arm, the unchanged-test share of arm b, and the decision to its result record, which it writes as JSON under eval/implement in the data directory as write_report does today. A test with a fake model asserts the fields. A person posts the record as the issue comment after the run. (best practice) [sources: src/devops_cli/roadmap/implement/implement_eval_run.py:1, docs/ROADMAP_WORKFLOW.md:453]
    • Chosen: Write a result record and post it as a comment. The test can assert the record with a fake model. The run needs no GitHub write in the test.
    • Rejected: Post the comment from the eval command. It adds a network write to the eval. It makes the offline test depend on GitHub.
    • Rejected: Defer the run to the live item. This item is the offline eval. The live proof is a separate item.
  • Does a live proof apply to this item?: No. devops roadmap eval implement reads no GitHub state, writes none and pushes nothing, and it makes its own scratch clone; the live proof rule (AW-J6) applies to a job or a changed step that makes live calls against the cluster and real branches and pull requests. This item is the offline eval; the item body names feat(roadmap): a tests unit pushes failing tests behind a gate #5520 for the live proof. [sources: docs/ROADMAP_WORKFLOW.md:453, docs/commands/roadmap.md:470, docs/guidelines/agentic-jobs.md:116]
  • Is test(roadmap): add 26 cases to the implement golden set #5516 still a dependency?: No. The change 2026-11-25-5516-implement-golden-cases is archived with its fixture tasks ticked, and CHANGELOG.md records the 67 new cases of the implement golden set. The golden set is in the tree, so test(roadmap): add 26 cases to the implement golden set #5516 is delivered and no longer a dependency. [sources: openspec/changes/archive/2026-11-25-5516-implement-golden-cases/tasks.md:16, CHANGELOG.md:400]
  • Which dependencies remain?: chore(roadmap): hold incremental stage and implement work #6521 only. It is a hold issue with no sub-issue and no type/epic label, so it holds the item back until a person lifts the hold; test(roadmap): add 26 cases to the implement golden set #5516 and feat(roadmap): new tests of an implementation are checked for strength #3051 are delivered. [sources: docs/roadmap/refine.md:24, openspec/changes/archive/2026-11-25-5516-implement-golden-cases/tasks.md:16, CHANGELOG.md:1941]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521

Activity

  1. added
    source/agent
    on Nov 13, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    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: partly

    Reason: Searches found the SWE-bench harness, which validates fail-to-pass and pass-to-pass tests offline, so it covers the tests gate; it lacks arm comparison, test-strength and unchanged-test measures.

    Tool: SWE-bench/SWE-bench (https://github.com/SWE-bench/SWE-bench), MIT, last activity 2026-09-18, maintained.

    Covers:

    • Validates new tests fail on the base commit
    • Runs pass-to-pass checks for the old tests
    • Offline golden-set evaluation with per-instance results

    Lacks:

    • No A/A pass or arm decision rules
    • No test-strength or unchanged-test measure
    • Bound to SWE-bench instance spec, not this eval command
    Searches (8)

    Tools considered:

    Searches run:

    • pydantic-evals LLM evaluation framework compare two variants, results: 5
    • tool that checks new tests fail on base commit pass after fix fail-to-pass validation, results: 5
    • "pydantic-evals" github, results: 5
    • SWE-bench fail-to-pass test validation harness github, results: 5
    • mutation testing tool measure test strength python mutmut cosmic-ray, results: 5
    • inspect_ai evaluation framework compare two agent configurations epochs, results: 5
    • "SWE-bench" harness FAIL_TO_PASS validation package, results: 5
    • promptfoo eval compare prompt variants assertions, 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.

  7. 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.

  8. 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.

  9. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Premise check after the release of the hold #6521 (2026-11-30): its tests-job gate is the consumer, and #5520 (the tests unit) is closed as not planned. The Coder step writes tests and code in one run. Closed as not planned (AGENTS.md rule 2); a person may reopen it, or file a new item from fresh evidence.

  10. 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/mediumpriority/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