Skip to content

test(roadmap): Derive stage golden set case counts from fixtures #3445

Open

Description

@dan-petty

Problem or Motivation

tests/roadmap/test_roadmap_stage_eval_cases.py pins the size of the stage golden set with literals: len(cases) == 42, len(good) == 3, len(EVALUATED_PULLS) == 39, and a literal set of 39 pull numbers. A plan that adds a golden case must edit the set and the three numbers in that test. No prompt asks the planner to do it, and no gate refuses a plan that leaves the test out.

The plan of PR #3436 for #3411 is the case. Its group 3 adds a case for the new What Changes rule, and the first plan named only tests/roadmap/test_roadmap_stage_eval_run.py in the group's changes. An implementer who followed that plan would add the case and leave the count test failing. The review of the plan found the omission.

Proposed Solution & Architectural Design

Derive the counts from the fixtures and keep one statement of the intended set. Compare the set of reviewed pulls in the fixtures with EVALUATED_PULLS and drop the separate hard-coded counts, or compute each count from that set. The test keeps its guard against an accidental removal of a case, and a new case needs one edit.

Add a test in tests/roadmap/test_roadmap_stage_eval_cases.py that loads a temporary set with one more case and asserts that the count check accepts it.

Target Subsystem

tests/roadmap/test_roadmap_stage_eval_cases.py

Existing Tool Considered

No tool. The change edits one pytest module over the fixtures and deletes no product code. The cost is about 300 tokens to build, keep and fix, and 10 minutes.

Source: #3436

Dependencies

Alternatives check of 2026-11-30: not-applicable.
Class: test, no model call.
Tool: none found.

Proposed design

Problem statement

The stage golden set test pins its case counts with literals. A plan that adds a case must edit the set and the numbers, and no prompt or gate catches a plan that omits this edit. The change derives the counts from the fixtures and keeps EVALUATED_PULLS as the one statement of the intended reviewed pulls.

Acceptance criteria

Requirement: Derived counts

The stage golden set test SHALL derive the expected total and good counts from the loaded cases and SHALL compare the reviewed pulls in the fixtures with EVALUATED_PULLS.

Scenario: Counts derive from the fixtures

  • WHEN uv run pytest tests/roadmap/stage/test_roadmap_stage_eval_cases.py -q runs at the repository head
  • THEN The count test passes and asserts that the reviewed pull set of the fixtures equals EVALUATED_PULLS and that the total equals the size of that set plus the number of good cases.

Requirement: Reviewed pull guard

The count helper SHALL fail and name the pull when the fixtures omit a pull that EVALUATED_PULLS holds.

Scenario: Missing reviewed case

  • WHEN a test copies the fixtures to tmp_path, removes one case whose pull is in EVALUATED_PULLS, and calls the count helper with EVALUATED_PULLS
  • THEN The helper raises AssertionError and its message holds the number of the removed pull.

Requirement: Additional case accepted

The count helper SHALL accept a fixture set with one more reviewed case when the intended pull set holds the new pull.

Scenario: One more case

  • WHEN a test copies the fixtures to tmp_path, adds a case with pull 9999, and calls the count helper with EVALUATED_PULLS | {9999}
  • THEN The helper returns with no assertion error and the test passes, so no literal count needs an edit.

Existing Tool Considered

The alternatives check of 2026-11-30 in the issue body gives the verdict not-applicable (class: test, no model call) and names no tool. No open, maintained tool or library covers this need, because the change edits one pytest module over fixtures and deletes no product code. The written cost to build instead is about 300 tokens to build, keep and fix, and 10 minutes.

Key questions

  • Which path holds the stage golden set count test, and where is EVALUATED_PULLS defined?: The module is tests/roadmap/stage/test_roadmap_stage_eval_cases.py. The path in the body, tests/roadmap/test_roadmap_stage_eval_cases.py, is stale. The module defines EVALUATED_PULLS at line 51 and asserts the total, good and reviewed counts as literals. The body gives 42, 3 and 39, and the triage comment of 2026-11-30 gives 63, 6 and 56, so no count number goes into the plan. [sources: tests/roadmap/stage/test_roadmap_stage_eval_cases.py, tests/roadmap/stage/test_roadmap_stage_eval_cases.py:51]
  • How should the test keep the intended reviewed pull set while it derives the counts?: Keep EVALUATED_PULLS as the single statement of the intended reviewed pulls. Compare the reviewed pulls in the fixtures with it. Derive the total as len(EVALUATED_PULLS) + len(good) and the good count from the loaded cases. Delete the literal total, good and reviewed counts. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_eval_cases.py:51]
    • Chosen: Keep EVALUATED_PULLS and derive the counts. It keeps one statement of the intended reviewed set and catches an accidental removal of a reviewed case.
    • Rejected: Derive all counts from the fixtures alone. The fixtures alone cannot tell an accidental removal of a reviewed case from an intended one.
    • Rejected: Keep the literal counts. A new case still needs edits to the set and to three numbers.
  • Should the count check be a module-level helper that the new test calls?: Yes. Extract the reviewed-set comparison and the count derivation into a module-level helper, check_case_counts(cases, intended). The helper takes the loaded cases and the intended pull set. The count test and the new test call it. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_eval_cases.py]
    • Chosen: Module-level helper. The new test can call the same check with a temporary set, and one copy of the assertions stays.
    • Rejected: Duplicate the assertions in the new test. The two copies can drift apart.
    • Rejected: Test the count check only through pytest. It cannot pass a temporary set to the count check.
  • Does load_cases read a plain directory that a test can copy?: Yes. load_cases takes the case directory, and the stage cases live in tests/fixtures/roadmap_eval/stage. A test copies that directory to tmp_path and loads the copy. [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py, openspec/specs/roadmap-stage-eval/spec.md:276]
  • How should the new test add one case without changing the repository fixtures?: Copy the case directory to tmp_path with shutil.copytree. Copy one case whose verdict is not good to a new folder and set its pull to 9999 in its case.json. Load the set with load_cases(tmp_path / "stage"). Call the helper with EVALUATED_PULLS | {9999}. (best practice) [sources: tests/roadmap/stage/test_roadmap_stage_eval_cases.py, src/devops_cli/roadmap/stage/stage_eval_cases.py, docs/TESTING.md:74]
    • Chosen: Temporary copied case set under tmp_path. It exercises the loader on a temporary set, and the repository fixtures stay unchanged.
    • Rejected: A permanent extra case. It changes the golden set to test the test.
    • Rejected: A hand-built list of case objects. It does not exercise the loader on a temporary set.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/test
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/test. The test prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. The friction already caused a missed edit in PR #3436 and will recur with every new case, but it is not a correctness or security gap.
    • Value: Medium. It removes a multi-edit step that a planner or implementer can skip, preventing a failing test on every case addition.
    • Effort: Low. The body estimates about 300 tokens and 10 minutes to edit one pytest module.
    • Related: test(roadmap): a golden set of plan cases and a scoring command for the stage job #3028, which asks for a different change. Both concern the stage golden set and its test file, but #3028 creates the set and scoring command while this candidate changes how the count assertion in the test derives its expected value.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 53cffca (see proposed design in issue body).

  6. changed the title [-]test(roadmap): the stage golden set derives its case count from the fixtures[/-] [+]test(roadmap): Derive stage golden set case counts from fixtures[/+] on Nov 6, 2026
  7. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    The job shortened the title of this item. The summary had 61 characters, and the limit is 60. The type and the scope stay.

    • Before: test(roadmap): the stage golden set derives its case count from the fixtures
    • After: test(roadmap): Derive stage golden set case counts from fixtures
    • Source of the summary: the background model
  8. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    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-07. A person decides what this means for the item. The check changes no label and closes no issue.

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

    @devops-cli-service
    Contributor

    Staged: branch test/3445-derive-stage-golden-set-case-counts, draft pull request #4174. The pull request plans the item and closes no issue.

    The task groups, with the tokens of the inputs of each step, for a budget of 64000 tokens:

    1. Derive the stage golden set counts and test a temporary set: 10314 tokens

    The default branch changed these paths that the plan names, after the commit that the planner read. Read the commits before you judge the plan:

    The runs of the planner and the review made 45 model request(s), and used 2833351 input tokens and 95552 output tokens. The tool calls, in order:

    1. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py"})
    2. read_spec({"capability":"roadmap-stage-eval"})
    3. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py","start_line":193,"end_line":300})
    4. search_code({"text":"EVALUATED_PULLS"})
    5. search_code({"text":"test_the_set_holds_the_48_plans_and_five_good_ones"})
    6. search_code({"text":"roadmap_eval/stage"})
    7. search_code({"text":"len(cases)"})
    8. search_code({"text":"== 53"})
    9. read_file({"path":"tests/invariants/test_roadmap_eval_fixtures.py"})
    10. read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":1,"end_line":120})
    11. read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":200,"end_line":330})
    12. read_file({"end_line":200,"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":120})
    13. list_files({"directory":"tests/fixtures/roadmap_eval/stage"})
    14. references({"name":"test_the_set_holds_the_48_plans_and_five_good_ones"})
    15. references({"name":"EVALUATED_PULLS"})
    16. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py","start_line":40,"end_line":80})
    17. list_files({"directory":"tests/roadmap/stage"})
    18. list_files({"directory":"tests/fixtures/roadmap_eval/stage"})
    19. read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":200,"end_line":330})
    20. search_code({"text":"ci test"})
    21. read_file({"path":"tests/fixtures/roadmap_eval/stage/3411-a-what-changes-item-that-names/case.json"})
    22. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py","start_line":100,"end_line":220})
    23. read_file({"end_line":200,"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":100})
    24. read_file({"path":"tests/support/paths.py"})
    25. read_spec({})
    26. references({"name":"EVALUATED_PULLS"})
    27. references({"name":"test_the_set_holds_the_48_plans_and_five_good_ones"})
    28. read_spec({"capability":"roadmap-stage-eval"})
    29. read_spec({"capability":"roadmap-stage-eval","requirement":"The golden set holds the plans with their defects"})
    30. read_spec({"capability":"roadmap-stage-eval","requirement":"The golden set holds a test-only group that delivers its criterion and the same plan without the code"})
    31. search_code({"text":"len(cases) >= 10"})
    32. read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_cases.py","start_line":60,"end_line":80})
    33. search_code({"text":"check_case_counts"})
    34. search_code({"text":"class GroupKind"})
    35. search_code({"text":"kind: GroupKind"})
    36. search_code({"text":"\"other\""})
    37. read_file({"end_line":500,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":420})
    38. read_file({"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":1,"end_line":140})
    39. search_code({"text":"def _other_problems"})
    40. read_file({"end_line":230,"path":"src/devops_cli/roadmap/stage/stage_form.py","start_line":140})
    41. read_file({"end_line":620,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":500})
    42. search_code({"text":"skip_specs"})
    43. search_code({"text":"helper"})
    44. list_files({"directory":"tests/invariants"})
    45. read_file({"path":"tests/invariants/test_roadmap_eval_fixtures.py"})
    46. git_log({"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py"})
    47. search_code({"text":"bff2f14fd"})
    48. read_file({"end_line":400,"path":"tests/roadmap/stage/test_roadmap_stage_eval_cases.py","start_line":220})
    49. search_code({"text":"48"})
    50. read_spec({"capability":"roadmap-stage-eval","requirement":"The replay of the golden set runs once per test module"})
    51. search_code({"text":"twin_of"})
    52. search_code({"text":"weakened_checks"})
    53. search_code({"text":"Weakened"})
    54. search_code({"text":"def count"})
    55. search_code({"text":"len(good)"})
    56. search_code({"text":"EVALUATED"})
    57. search_code({"text":"53"})
    58. search_code({"text":"five good"})
    59. search_code({"text":"test_each_good_plan_passes_every_gate"})
    60. search_code({"text":"len(good) == 5"})
    61. search_code({"text":"== 5"})
    62. read_file({"end_line":140,"path":"tests/roadmap/stage/test_roadmap_stage_eval_gates.py","start_line":90})
    63. search_code({"text":"len(cases)"})
    64. search_code({"text":"len(EVALUATED_PULLS)"})
    65. read_file({"path":"openspec/changes/archive/2026-11-08-3343-the-stage-probe-checks-defecttype-membership/.openspec.yaml"})
    66. read_file({"path":"openspec/changes/archive/2026-11-08-3343-the-stage-probe-checks-defecttype-membership/proposal.md"})
    67. search_code({"text":"CRITERION_DROPPED"})
    68. search_code({"text":"criterion_dropped"})
    69. read_file({"path":"tests/invariants/test_source_tree.py","start_line":1,"end_line":120})
    70. read_issue({"number":3445})
    71. search_code({"text":"allowlist"})
    72. read_file({"path":"tests/fixtures/roadmap_eval/stage/2491-a-refused-jwt-exchange-of-the/case.json"})
    73. read_file({"path":"tests/fixtures/roadmap_eval/stage/good-2491-a-refused-jwt-exchange-of-the/case.json"})
    74. read_file({"path":"tests/fixtures/roadmap_eval/stage/3410-the-eval-field-group-is-dropped/case.json"})
    75. search_code({"text":"class StageCriterion"})
    76. search_code({"text":"criteria_problems"})
    77. search_code({"text":"stage_problem_criteria"})
    78. read_file({"end_line":200,"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":1})
    79. search_code({"text":"allowlisted with a reason"})
    80. search_code({"text":"stays in"})
    81. search_code({"text":"class Sentence"})
    82. search_code({"text":"Sentence ="})
    83. read_file({"end_line":380,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":320})
    84. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_gates.py","start_line":100,"end_line":110})

    Tool calls: git_log=1 (empty=0), list_files=4 (empty=0), read_file=29 (empty=0), read_issue=1 (empty=0), read_spec=6 (empty=0), references=4 (empty=0), search_code=39 (empty=5)

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

  10. 5 remaining items

  11. added
    status/blocked
    and removed
    status/in-progress
    on Nov 8, 2026
  12. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261108-181935-dd89 ended: succeeded.
    Image digest: sha256:ddccbdfaab813837281f4060ada1a28e5e2ea6e0139dbd71e160f2f4c567f623

    The last lines of its log:

    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: git status --short
    Tool call: shell, started: ls tests/gate/tree_checks
    Tool call: shell, program ls, ok.
    Tool call: shell, program git, ok.
    Tool call: shell, started: uv run devops ci --check --only ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: grep -n -B4 -A12 error\[ /home/devops/.data/agent/worktrees/w-3445/.pydantic-ai-harness/shell/3255451570aa438f9bef52d84acf9fa4/output.log ...
    Tool call: shell, program grep, ok.
    Tool call: shell, started: grep -n -i -E warning|error|help: /home/devops/.data/agent/worktrees/w-3445/.pydantic-ai-harness/shell/3255451570aa438f9bef52d84acf9fa4/output.log ...
    Tool call: shell, program grep, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: uv run devops ci --check --only ...
    Tool call: shell, program uv, ok.
    Tool call: shell, started: cat .ast-grep/rules/test-function-has-assertion.yml
    Tool call: shell, program cat, ok.
    Tool call: shell, started: git grep -n -e <masked> -- ...
    Tool call: shell, started: git grep -n -e <masked> -- ...
    Tool call: shell, program git, ok.
    Tool call: shell, program git, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run devops ci --check --only ...
    Tool call: shell, started: uv run ruff check tests/roadmap/stage/test_roadmap_stage_eval_cases.py
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/stage/test_roadmap_stage_eval_cases.py ...
    Tool call: shell, started: uv run devops ci --check --only ...
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git diff
    Tool call: shell, program git, ok.
    Tool call: shell, started: git grep -n -e holds_the_49 -e ...
    Tool call: shell, program git, ok.
    Failure class tests_lost. Action left: wait.
    ✓ Took 0 item(s) to a ready pull request, stopped 1.
    Elapsed: 8m 1s
    
  13. removed
    owner/service
    on Nov 8, 2026
  14. added 2 commits that reference this issue on Nov 8, 2026
  15. 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.

  16. dan-petty commented on Nov 30, 2026

    @dan-petty
    OwnerAuthor

    Triage under #6519 (2026-11-30): this item changes one test module (the stage golden set counts), not a gate or a job rule. The hold line is removed from its Dependencies so that it can continue. The counts in tests/roadmap/stage/test_roadmap_stage_eval_cases.py are still literals (63, 6, 56).

  17. added
    status/new
    and removed
    status/blocked
    on Nov 30, 2026
  18. added
    status/ready
    and removed
    status/new
    on Nov 30, 2026
  19. devops-cli-service commented on Nov 30, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  20. added
    status/blocked
    and removed
    status/ready
    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/lowpriority/p2-mediumscope/roadmapsource/agentstatus/blockedtype/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions