Repository navigation
Description
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
- Add an arm option to
devops roadmap eval implement. Offline, on the implement golden set: arm A is implement as today. Arm B runs a tests pass first, then implement with those tests. - The tests gate: the static checks pass, each new test fails by an assertion on the base, and the old tests pass.
- Measures: test strength (feat(roadmap): new tests of an implementation are checked for strength #3051), the share of the tests that implement leaves unchanged, and implement success.
- Use the A/A pass and the decision rules of E1. The tests job leaves mode
planonly on equal or better success. - A live arm, if one runs later, uses the trial mechanism of feat(roadmap): trial a model tier on a share of a job's attempts #5177.
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
- 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-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-runon 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
bon 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
aand for armb, and the unchanged-test share for armb.
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
bimplement success lower than arma. - 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
bimplement success equal to arma. - 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 verdictpartly; the block'sLacks:list gives what the tool lacks. The eval reuses the project's replay insrc/devops_cli/ci/fail_to_pass.pyfor 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'stests/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 ofimplement_scoped_ci.pyand the fixture'stests_passcommands 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?:
--armwith the valuesaandbdefaults toa, 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}, defaulta. 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.
- Chosen:
- 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:75andCHANGELOG.mdrecord 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.pyon 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]- Chosen: Reuse the strength check from feat(roadmap): new tests of an implementation are checked for strength #3051. It is in the tree and gives the strength measure that the item names.
- Rejected: Add a new strength metric. It duplicates the existing check. It adds code to keep.
- How does the eval measure the share of tests that implement leaves unchanged?: Only arm
bhas a tests pass output to compare, so the eval records the share for armb: it reads thepath::nameof every test that the tests pass wrote with the AST reader ofimplement_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. Armawrites 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::nametest 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.
- Chosen: Compare the
- How does the eval decide the mode of the tests job?: The eval compares the implement success of arm
bwith armaon the same golden set after the A/A pass, and it keeps the tests job in modeplanunless armbis 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 ofplanonly 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
planunless armbis 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
planafter any run. It ignores the arm comparison and the item's gate. - Rejected: Require arm
bto beat arma. The stricter rule ofdocs/ROADMAP_WORKFLOW.md:457applies to a change of the implement prompt or tool set, not to the pipeline's tests job.
- Chosen: Keep
- 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 undereval/implementin the data directory aswrite_reportdoes 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 implementreads 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-casesis archived with its fixture tasks ticked, andCHANGELOG.mdrecords 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/epiclabel, 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.
Activity
dan-petty commentedon Nov 13, 2026
Both work on 'devops roadmap eval implement'; #3030 delivers the base eval command and fixtures, while this candidate adds a new arm option that runs a tests pass before implement.devops-cli-service commentedon Nov 17, 2026
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:
Lacks:
Searches (8)
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.
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.
dan-petty commentedon Nov 30, 2026
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.