Repository navigation
Description
Problem
tests/invariants/test_roadmap_eval_fixtures.py tests only implement fixtures under tests/fixtures/roadmap_eval/implement/.
No invariant test checks the 63 stage golden cases under tests/fixtures/roadmap_eval/stage/.
When tests move to new directories, stage golden cases keep outdated file paths.
For example, fixture good-3410 still cites tests/roadmap/test_roadmap_stage_prompt_rules.py, which now lives at tests/roadmap/stage/test_roadmap_stage_prompt_rules.py.
Stage gates must then keep compatibility shims for deleted paths.
Also, invalid schema entries in stage fixtures are not detected until a full replay runs.
Expected
Add invariant tests for tests/fixtures/roadmap_eval/stage/ in tests/invariants/test_roadmap_eval_fixtures.py.
Verify that every stage case loads against StageCase and CaseFacts schemas.
Verify that every golden plan loads against StageProposal (src/devops_cli/roadmap/stage/stage_change.py).
Verify that the paths named in plan.json match existing files or valid created files.
Verify that the total byte size of tests/fixtures/roadmap_eval/stage/ stays below a size limit.
Acceptance criteria
-
uv run pytest tests/invariants/test_roadmap_eval_fixtures.py -k stage- all stage fixtures load against schema and stay below the size cap. - Stale module paths in
tests/fixtures/roadmap_eval/stage/are detected before merge.
Feasibility
I read tests/invariants/test_roadmap_eval_fixtures.py and src/devops_cli/roadmap/stage/stage_eval_cases.py.
stage_eval_cases.py defines StageCase, CaseFacts, and load_cases.
The schemas and loader already exist.
The invariant test will load each directory under tests/fixtures/roadmap_eval/stage/ and assert schema validity.
Existing tool considered
Existing pydantic models CaseFacts and StageProposal. No new library is needed.
Cost
Build: about 25k tokens and 1.5 hours (test module, fixture path updates). Keep: about 1k tokens per quarter. Fix: about 4k tokens and 0.25 hours.
Related
Part of #3027. Related to #3347.
Alternatives check of 2026-11-30: not-applicable.
Class: test, no model call.
Tool: none found.
Proposed design
Problem statement
The invariant suite checks only the implement fixtures under tests/fixtures/roadmap_eval/implement/, and no invariant test checks the 63 stage golden cases under tests/fixtures/roadmap_eval/stage/. A test module move leaves an old path in a good case's plan or facts. A stage gate then keeps a compatibility shim for the deleted path. An invalid schema entry in a stage fixture waits for a full replay to appear. Add stage invariant tests for loading, plan paths, good-case paths and a size cap. Correct the stale paths that the new tests find.
Acceptance criteria
Requirement: Stage cases load against their schema
The invariant suite SHALL load every case folder under tests/fixtures/roadmap_eval/stage/ with the stage load_cases loader, so that each case validates against StageCase and CaseFacts.
Scenario: The committed stage set loads
- WHEN the stage invariant test calls
load_casesontests/fixtures/roadmap_eval/stage/ - THEN
load_casesreturns oneStageCasefor each case folder and raises noConfigurationError
Requirement: A case folder holds a case.json
The invariant suite SHALL require each folder under tests/fixtures/roadmap_eval/stage/ that holds an issue.txt, a plan.json or a facts.json to hold a case.json too.
Scenario: A case folder misses its case.json
- WHEN a folder under the stage root holds
plan.jsonand holds nocase.json - THEN the stage invariant test fails and names the folder
Requirement: A plan breaks the reply schema with no kind defect
The invariant suite SHALL require StageProposal to accept the plan.json of each case that has no defect with the gate kind.
Scenario: A plan breaks the reply schema with no kind defect
- WHEN
StageProposal.model_validateraises for a case that has no defect with the gatekind - THEN the stage invariant test fails and names the case and the validation error
Requirement: A kind defect keeps its refused plan
The invariant suite SHALL require StageProposal to refuse the plan.json of each case that has a defect with the gate kind.
Scenario: A kind case loads against the reply schema
- WHEN a case has a defect with the gate
kindandStageProposal.model_validateaccepts its plan - THEN the stage invariant test fails and names the case
Requirement: A plan names only existing, tracked, created, change-folder or missing paths
The invariant suite SHALL require each path that a group of plan.json names in reads, changes, a task code span or verify to exist in the repository, to be in case.facts.tracked, to be in the creates of a group, to be in case.change_files(), or to be in the paths of a missing_path defect.
Scenario: A plan names a path that no record holds
- WHEN a path of a group's reads, changes, task code span or verify is absent from the repository, from
facts.tracked, from every group'screates, fromchange_files()and from everymissing_pathdefect - THEN the stage invariant test fails and names the case and the path
Requirement: A good case names only current paths
The invariant suite SHALL require each tests/ or src/ path in the plan.json and in facts.tracked of a case whose verdict is good to exist in the repository, unless a group of the plan lists it in creates.
Scenario: A module moved after a good case was recorded
- WHEN
facts.trackedand the plan ofgood-3410nametests/roadmap/test_roadmap_stage_prompt_rules.pyand the repository holds onlytests/roadmap/stage/test_roadmap_stage_prompt_rules.py - THEN the stage invariant test fails and names the case and the stale path
Requirement: The good cases name current paths
Each case whose verdict is good SHALL name only current tests/ or src/ paths in its plan.json and facts.json, except for a path that a group lists in creates.
Scenario: The corrected good cases are checked
- WHEN the stage invariant test reads the plan and
facts.trackedofgood-3410and each other good case - THEN each
tests/orsrc/path in the plan orfacts.trackedexists or is listed in a group'screates
Requirement: The stage set stays below its size cap
The invariant suite SHALL require the total byte size of the files under tests/fixtures/roadmap_eval/stage/ to stay below 2500000 bytes.
Scenario: The stage set grows past the cap
- WHEN the sum of the sizes of the files under the stage root reaches 2500000 bytes
- THEN the stage invariant test fails and states the measured size and the cap
Requirement: The stage tests are selected by -k stage
The invariant suite SHALL put the word stage in the name of each new test, so that uv run pytest tests/invariants/test_roadmap_eval_fixtures.py -k stage selects them.
Scenario: The stage selection runs
- WHEN a person runs
uv run pytest tests/invariants/test_roadmap_eval_fixtures.py -k stage - THEN pytest selects the stage tests, runs them and reports no failure
Existing Tool Considered
The alternatives check of 2026-11-30 recorded not-applicable for this test-class item and named no tool; see the alternatives block in the issue body.
The open, maintained tools that cover the need are pytest==9.2.0 (pyproject.toml:109) and pydantic==2.14.4 (pyproject.toml:15). The project's CaseFacts and StageCase (src/devops_cli/roadmap/stage/stage_eval_cases.py:176,203) validate the fixtures. StageProposal (src/devops_cli/roadmap/stage/stage_change.py) validates the plans. tests/roadmap/stage/test_roadmap_stage_eval_cases.py:167 already asserts the plan-schema rule. They lack a repository-tree check, the group creates rule of path_problems (src/devops_cli/roadmap/stage/stage_paths.py:663) and a size cap. The invariant module adds about 40 lines for these. The written cost is about 25k tokens and 1.5 hours to build, about 1k tokens per quarter to keep, and about 4k tokens and 0.25 hours to fix.
Key questions
- Which module defines
StageCase,CaseFactsand the stage loader, and how does the invariant module import a loader today?:src/devops_cli/roadmap/stage/stage_eval_cases.pyholdsCASES_DIRECTORY(:78),NO_COMMIT(:82),CaseFacts(:176),StageCase(:203) andload_cases(:286). The invariant module imports the implement loader attests/invariants/test_roadmap_eval_fixtures.py:12and readsFIXTURESat :15. The stage tests import the stage loader under the aliasload_stage_cases.tests/roadmap/stage/test_roadmap_stage_eval_cases.py:97already loads the set with that loader. [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py:78, src/devops_cli/roadmap/stage/stage_eval_cases.py:176, src/devops_cli/roadmap/stage/stage_eval_cases.py:203, src/devops_cli/roadmap/stage/stage_eval_cases.py:286, tests/invariants/test_roadmap_eval_fixtures.py:12, tests/invariants/test_roadmap_eval_fixtures.py:15, tests/roadmap/stage/test_roadmap_stage_eval_cases.py:97] - Must every
plan.jsonload againstStageProposal?: No. A plan fails the reply schema exactly when a defect of the case names the gatekind(src/devops_cli/roadmap/stage/stage_eval_cases.py:17-19). The invariant fails whenStageProposalrefuses a plan of a case with nokinddefect. It also fails whenStageProposalaccepts a plan of a case with akinddefect. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py:17, src/devops_cli/roadmap/stage/stage_eval_cases.py:19, tests/roadmap/stage/test_roadmap_stage_eval_cases.py:167, src/devops_cli/roadmap/stage/stage_change.py]- Rejected: Validate every plan with no exemption. The recorded
kindcases break the reply schema on purpose, so this assertion fails on the committed set. - Chosen: Fail only when no defect names the gate
kind. This is the rule thatstage_eval_cases.pystates, and it keeps thekindcases in the set.
- Rejected: Validate every plan with no exemption. The recorded
- Which paths may a plan name?: A path that a group names in
reads,changes, a task code span orverifyis valid in five cases. It exists in the repository.facts.trackedholds it. A group lists it increates. It is incase.change_files(). Amissing_pathdefect names it. This is the rule ofpath_problems(src/devops_cli/roadmap/stage/stage_paths.py:663-704). It skips a path the tree holds, a path a group creates, and a path of the plan's own change folder. (best practice) [sources: src/devops_cli/roadmap/stage/stage_paths.py:663, src/devops_cli/roadmap/stage/stage_paths.py:675, src/devops_cli/roadmap/stage/stage_paths.py:681, src/devops_cli/roadmap/stage/stage_paths.py:692, src/devops_cli/roadmap/stage/stage_paths.py:696, src/devops_cli/roadmap/stage/stage_paths.py:293, tests/fixtures/roadmap_eval/stage/good-3410-the-stage-gate-proves-a-negative/plan.json:252]- Rejected: Accept only tracked paths and the change folder. The
good-3410plan liststests/fixtures/roadmap_eval/stage/3372-the-stage-plan-of-a-module/plan.jsonandtests/roadmap/test_roadmap_stage_negative_search.pyin a group'screates(plan.json:252-257). Neither is infacts.trackednor inchange_files(), so this check fails on the committed set. - Chosen: Accept existing, tracked, created, change-folder and missing paths. It is the rule of
path_problems, and the committed set holds all five kinds of path.
- Rejected: Accept only tracked paths and the change folder. The
- How does the invariant detect a stale module path?: It requires each
tests/orsrc/path in theplan.jsonand infacts.trackedof a good case to exist in the repository. A group'screateslist is the only exception. A good case has no defect and every gate must accept it (src/devops_cli/roadmap/stage/stage_eval_cases.py:28). Its recorded plan and tree must name today's files. A reviewed case records the tree of its base commit and the review that judged it (stage_eval_cases.py:47). Itsfacts.trackedmay name a pre-move path:3372-the-stage-plan-of-a-moduleand both reviewed3410cases do. Rewriting them would change the recorded evidence. The rule flags the stage paths ofgood-3264andgood-3410and the deleted snapshot pathtests/ai/__snapshots__/test_ai_client_style_request.ambringood-2491,good-2735andgood-2739. The change corrects all of them. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py:28, src/devops_cli/roadmap/stage/stage_eval_cases.py:47, src/devops_cli/roadmap/stage/stage_eval_cases.py:55, tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-exchange-of-the/facts.json:55, tests/fixtures/roadmap_eval/stage/good-2735-the-subprocess-environment-guard-accepts-less/facts.json:54, tests/fixtures/roadmap_eval/stage/good-2739-the-subprocess-environment-guard-accepts-gh/facts.json:55, tests/fixtures/roadmap_eval/stage/3372-the-stage-plan-of-a-module/facts.json:3, tests/roadmap/stage/test_roadmap_stage_eval_cases.py:108]- Rejected: Check every case's
facts.tracked.3372and both reviewed3410cases record the pre-move tree of their base commit. The check fails on the committed set unless their plans and reviews are rewritten. - Chosen: Check only the good cases. Only a good case must pass every gate today, and the stale paths that drive a shim sit in the good cases' plans and facts.
- Rejected: Compare
plan.jsonwithfacts.jsononly. Both files hold the same old path, so the check passes ongood-3410and detects nothing.
- Rejected: Check every case's
- What size cap should the stage set keep?: 2500000 bytes, summed over the files of
tests/fixtures/roadmap_eval/stage/. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py:33, src/devops_cli/roadmap/stage/stage_eval_cases.py:58, tests/roadmap/stage/test_roadmap_stage_eval_cases.py:108, tests/invariants/test_roadmap_eval_fixtures.py:18]- Rejected: 1500000 bytes. The recorded
about 1 MBandabout 165 filesofstage_eval_cases.py:58describe the 37-case set of 2026-11-01 (:33-37). The set now holds 63 cases, so the recorded size scales to about 1.7 MB. 1.5 MB leaves too little room. - Chosen: 2500000 bytes. About 50% above the scaled 1.7 MB, it leaves room for the 63-case set and still catches a doubling.
- Rejected: No cap. The issue asks for a size limit, and the implement invariant already holds one (
tests/invariants/test_roadmap_eval_fixtures.py:18).
- Rejected: 1500000 bytes. The recorded
- How does the acceptance criterion select the new stage tests?: Each new test name holds the word
stage, astest_the_stage_....-k stagematches a test name, so no marker is necessary. No name of the module holds the wordstagetoday. (best practice) [sources: tests/invariants/test_roadmap_eval_fixtures.py:133, tests/invariants/test_roadmap_eval_fixtures.py:157, tests/invariants/test_roadmap_eval_fixtures.py:202, tests/invariants/test_roadmap_eval_fixtures.py:211]- Chosen: Put
stagein each test name.-k stagematches a test name, and no name of the module holds the wordstagetoday. - Rejected: Add a
stagepytest marker. The criterion runs-k stage, which selects by name and not by marker.
- Chosen: Put
- Which open, maintained tool or library covers the need?:
pytest==9.2.0(pyproject.toml:109) andpydantic==2.14.4(pyproject.toml:15) are open, maintained and already pinned. The project'sCaseFactsandStageCase(src/devops_cli/roadmap/stage/stage_eval_cases.py:176,203) validate the fixtures.StageProposal(src/devops_cli/roadmap/stage/stage_change.py) validates the plans.tests/roadmap/stage/test_roadmap_stage_eval_cases.py:167already asserts the plan-schema rule. They lack a repository-tree check, the groupcreatesrule ofpath_problems(src/devops_cli/roadmap/stage/stage_paths.py:663) and a size cap. The invariant module adds about 40 lines for these. (best practice) [sources: pyproject.toml:15, pyproject.toml:109, src/devops_cli/roadmap/stage/stage_eval_cases.py:176, src/devops_cli/roadmap/stage/stage_eval_cases.py:203, src/devops_cli/roadmap/stage/stage_change.py, src/devops_cli/roadmap/stage/stage_paths.py:663, tests/roadmap/stage/test_roadmap_stage_eval_cases.py:167, tests/invariants/test_roadmap_eval_fixtures.py:211]- Chosen: Use
pytestand the existingpydanticmodels. Both are open, maintained and already in the project. - Rejected: Build a new validator library. The existing models and the invariant module cover the need with about 40 lines.
- Chosen: Use
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
testprefix of the title gives the type.invariants, and .github/labels.yml declares no scope/invariants label. Add the label to the file to give the scope to this item.It prevents stale paths and invalid schema entries from reaching merge but does not fix a current breakage.It catches fixture drift and invalid entries before a full replay run, saving developer time.The body estimates about 1.5 hours to add the test module and update fixture paths.Both concern the stage golden set under tests/fixtures/roadmap_eval/stage/, but #3028 created the fixtures and eval command while the candidate adds invariant tests that validate those fixtures against schemas and check path existence.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 3181b22 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: not-applicable
Class: test. The check makes no search and no model call for an item of this class.
Tool: none found
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 18, 2026
Owner question: The inputs of the step of the task group "Correct the pre-move paths of the good-3264 plan" hold 65128 tokens, over the budget of 64000 tokens, also after the model split the groups once. Split the group or raise the budget of the step?
Options
Recommendation: Split the group: the plan check keeps the budget of the step.
Evidence
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.
dan-petty commentedon Nov 24, 2026
Split the group.
devops-cli-service commentedon Nov 26, 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 30, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.