Skip to content

test(roadmap): the stage replay judges no module-test or caller gate #4506

Not planned

Description

@dan-petty

Problem Description

uv run devops roadmap eval stage --replay judges neither the module-test gate (#3414) nor the caller gate (#3307). The replay builds StagedTree(self.facts.tracked) in src/devops_cli/roadmap/stage/stage_eval_cases.py, with no checkout, no file reader and no search. record_module_tests then records no test, and StagedTree.callers returns no file. So a change to either gate gives the same replay output before and after, and the golden set cannot show that a change keeps a defect that the gate caught, or stops a false refusal.

Reproduction Steps

  1. Run uv run devops roadmap eval stage --replay on a commit before fix(roadmap): the module-test and caller gates refuse correct plans #4467 and on the commit of fix(roadmap): the module-test and caller gates refuse correct plans #4467.
  2. Compare the two outputs.

Expected vs Actual Behavior

Expected: the replay judges each gate that the stage job runs, so a gate change shows in the score. A case can hold the files that the gate reads (the test files and the modules), or a recorded search.

Actual: the two outputs are the same. In the 36 stored refused replies of 2026-11-10 and 2026-11-11, the change of #4467 moved the module-test problems from 35 to 19 and the caller problems from 26 to 4, and the replay showed none of it.

Environment Diagnostics

  • DevOps CLI Version: 0.110.0
  • Execution Environment: Local Workstation

Logs, Traces, or Terminal Output

Good plans that every gate accepts: 5 of 5.
Result: every gate refuses what it must refuse.

Pre-Submission Checklist

  • I have verified that no sensitive credentials, private keys, or internal tokens are contained in this issue report.
  • I have checked existing issues and pull requests to ensure this is not a duplicate.

Dependencies

Alternatives check of 2026-11-20: not-applicable.
Class: test, no search.
Tool: none found.

Proposed design

Problem statement

The stage replay builds a tree from tracked paths only. The tree holds no file text and no search. The module-test gate and the caller gate return no problem. A change to either gate gives the same replay output before and after. The replay cannot show that a change keeps a caught defect or stops a false refusal.

Acceptance criteria

Requirement: Case facts hold gate files

The CaseFacts model SHALL hold optional files and search fields for the file text and search hits that the gates read.

Scenario: A case records a module and its test

  • WHEN A case's facts.json holds file text for src/example.py and tests/test_example.py and a search hit for the module import.
  • THEN The loaded case returns both file texts and the search hit.

Requirement: Replay tree reads recorded callers

StagedTree.callers SHALL read the recorded file text when the tree holds no checkout.

Scenario: The caller gate reads a recorded caller

  • WHEN A case records src/example.py with a call to helper and src/helper.py that defines helper, and the replay builds its tree.
  • THEN tree.callers("helper") returns src/example.py.

Requirement: Module-test gate uses recorded search

The replay SHALL pass the case search to record_module_tests so that the module-test gate reports a missing test.

Scenario: A behavior group omits the test of its module

  • WHEN A case records a behavior group that changes src/example.py and records tests/test_example.py as a search hit for the module import, but no group names that test.
  • THEN The replay reports the module-test problem for src/example.py.

Requirement: Caller gate uses recorded files

The replay SHALL pass the recorded file text to the caller gate so that the gate reports a caller that the plan does not update.

Scenario: A changed symbol has a caller

  • WHEN A case records src/example.py that calls the changed symbol and src/helper.py that defines it, and the plan changes that symbol but does not name src/example.py.
  • THEN The replay reports the caller problem for src/example.py.

Requirement: Old cases stay valid

A case with no files and no search SHALL load and replay with the same empty file text and search as before.

Scenario: A case from before the change

  • WHEN A stored case holds no files and no search and names no module-test or caller defect.
  • THEN load_cases returns the case with empty files and search, and the replay result is unchanged.

Requirement: Good gate case passes

A good case that records its module, its test and its callers SHALL pass the module-test gate and the caller gate.

Scenario: A good plan names its test and callers

  • WHEN A good case records src/example.py, tests/test_example.py, and a caller file, and its groups name the test and the caller.
  • THEN The replay reports no module-test problem and no caller problem.

Existing Tool Considered

The alternatives check in the issue body records not-applicable for this test-class item: it makes no search and found no tool. The need is the repository's own stage-eval fixture format and replay loop, so the change builds its own code. The written cost is about 10,000 to 20,000 tokens to build, keep and fix that code, and about 2 to 3 days of elapsed time.

Key questions

  • Where does the replay build the tree for a case?: StageCase.tree() in src/devops_cli/roadmap/stage/stage_eval_cases.py builds StagedTree(self.facts.tracked) and then adds the change files. It passes no file reader and no search. [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py]
  • Why does StagedTree.callers return no file in the replay?: StagedTree.callers returns [] when its source or reader is None. Otherwise it runs git grep in the checkout and reads the matched files. A replay tree has neither a checkout nor a reader. [sources: src/devops_cli/roadmap/stage/stage_paths.py]
  • How should the replay provide file text and search hits?: Add optional files and search fields to CaseFacts. Build StagedTree with the recorded file text as its text map. Add a search callable to StageCase that returns the recorded hits. The replay reads no git and stays deterministic. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py, src/devops_cli/roadmap/stage/stage_paths.py]
    • Chosen: Record file text and search hits in the case. It keeps the replay offline and deterministic.
    • Rejected: Check out the base commit for each case. It needs a deep clone, is slow, and breaks offline replay.
    • Rejected: Stub the gate results. The replay would not judge the gate.
  • How should the replay pass search to the module-test gate?: Add a search callable to StageCase. Pass it to record_module_tests in the same place that the stage job passes its search callable. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py, src/devops_cli/roadmap/stage/stage_paths.py, src/devops_cli/roadmap/stage/stage.py]
    • Chosen: Use the case search callable. It matches the live stage job and lets a gate change show.
    • Rejected: Precompute module tests in the case. A gate change would not show.
  • Should a case that lacks recorded gate data fail to load?: No. The new files and search fields default to empty. Old cases and cases without these gates load and replay as before. A case that records a module-test or caller defect needs its data, or the replay fails the case because the gate refuses nothing. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py]
    • Chosen: Default the new fields to empty. It keeps old cases valid and avoids a large fixture rewrite.
    • Rejected: Fail to load a case with no gate data. It would reject old cases and cases that do not use these gates.
  • Which files must a case record for the caller gate?: Record the changed module and each file under src/ that calls a changed function. The case author takes that list from the live gate trace. StagedTree.callers reads only recorded file text. (best practice) [sources: src/devops_cli/roadmap/stage/stage_eval_cases.py, src/devops_cli/roadmap/stage/stage_paths.py]
    • Chosen: Record the changed module and the caller files. It gives the gate the callers it needs and keeps the case small.
    • Rejected: Record only the changed module. Callers outside the module stay invisible.
    • Rejected: Record every tracked Python file. The case grows large and the replay slows.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#6521

Activity

  1. added
    source/agent
    type/test
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 11, 2026
  2. dan-petty commented on Nov 11, 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 golden set cannot verify gate changes, but the gates themselves work in production, so this is a quality gap not a user-facing defect.
    • Value: Medium. It closes a blind spot in the regression set for two live gates, but does not change user-facing behaviour.
    • Effort: Medium. The replay needs a file reader and a search step for two gates, plus updated fixtures and golden expectations.
    • Related: feat(roadmap): record the reference hits of a stage case in the replay #3412, which asks for a different change. Both items fix a replay that cannot judge a gate because it lacks infrastructure, but #3412 adds reference-hit recording while this adds file reader and search for module-test and caller gates.
  3. added
    priority/p2-medium
    on Nov 11, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 11, 2026
  5. devops-cli-service commented on Nov 11, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 9087b39 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 11, 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-11. A person decides what this means for the item. The check changes no label and closes no issue.

  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. added
    status/new
    and removed
    status/ready
    on Nov 26, 2026
  9. devops-cli-service commented on Nov 26, 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. 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.

  11. 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/testvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions