Skip to content

feat(roadmap): record the reference hits of a stage case in the replay #3412

Closed

Description

@dan-petty

Problem or Motivation

devops roadmap eval stage --replay runs the recorded plans through check_proposal and reads no git, as the docstring of src/devops_cli/roadmap/stage_eval_cases.py states: "A replay cannot assume a deep clone, so it reads no git."

The reference check of #3373 reads the hits that the job probes from the staging commit. The replay has no such hits, so it passes an empty list and cannot judge the new check. A plan that misses a reference hit passes the replay after #3373 lands.

The golden set is the measure that keeps the stage gates honest (#3028). A gate that the replay cannot judge leaves the check without a regression case.

Proposed Solution & Architectural Design

  • Add a references key to facts.json of each stage case: the paths of the files that hold the old module path or its dotted name, or an empty list.
  • Give PlanUnderTest of src/devops_cli/roadmap/stage_eval_gates.py the recorded paths, and pass them to check_proposal.
  • Add one case that moves a module and leaves a string literal in tests/, with a missing_path defect and the gate paths.
  • A case with no references key reads an empty list, so every existing case keeps its verdict.

Target Subsystem

src/devops_cli/roadmap/stage_eval_cases.py, src/devops_cli/roadmap/stage_eval_gates.py, tests/fixtures/roadmap_eval/stage/

Existing Tool Considered

The case schema and the replay already carry the facts of a case in facts.json, so the change extends that file and adds no new tool. The cost is about 3k tokens and 45 minutes.

Proposed design

Problem statement

The replay of the stage golden set cannot judge the reference check of #3373. The check reads the reference hits that the job probes from the staging commit, and the replay passes none. A plan that misses a reference hit passes the replay. The change records the hits in each case and passes them to check_proposal.

Acceptance criteria

Requirement: A case records its reference hits

The facts.json of a stage case SHALL hold a references key that lists the paths of the files that hold the old module path or its dotted name.

Scenario: Recorded hits reach the plan

  • WHEN the replay loads a case whose facts.json holds two reference paths
  • THEN PlanUnderTest.of_case holds the same two paths in its references field.

Requirement: The replay passes the reference hits to the check

The paths gate SHALL pass the reference hits of the case to check_proposal.

Scenario: The check receives the hits

  • WHEN the replay runs the paths gate on a case with two recorded reference paths
  • THEN check_proposal receives the same two paths as its reference hits.

Requirement: A case with no reference hits keeps its verdict

A case whose facts.json has no references key SHALL read an empty list.

Scenario: An existing case replays as before

  • WHEN the replay runs the whole golden set with a case that has no references key
  • THEN that case reads an empty list and the report lists no failure for it.

Requirement: The golden set holds a missed reference hit

The golden set SHALL hold a case that moves a module and leaves a string literal in tests/, with a missing_path defect and the gate paths.

Scenario: The replay catches the missed reference

  • WHEN the replay runs the new case
  • THEN the paths gate refuses the plan and the report marks the defect caught.

Existing Tool Considered

No alternatives check has run. The change builds no new tool: the case schema and the replay already carry the facts of a case in facts.json, and the change extends that file. The written cost is about 3k tokens and 45 minutes.

Key questions

  • Where does a stage case record its reference hits?: In facts.json, as a references tuple on CaseFacts. That file holds what the gates need of the tree, as tracked and capabilities do. (best practice) [sources: src/devops_cli/roadmap/stage_eval_cases.py, openspec/changes/3308-the-plan-check-compares-a-number/design.md]
    • Chosen: facts.json as CaseFacts.references. The facts file already holds what the gates need of the tree, and a case with no field reads a default.
    • Rejected: case.json. case.json holds the review of the plan, not the facts of the tree.
    • Rejected: A new references.json in each case folder. It adds a file to about 165 case folders, and no rule needs it.
  • What does a case with no references key read?: An empty tuple, from a field default. Every existing case keeps its verdict. (best practice) [sources: src/devops_cli/roadmap/stage_eval_cases.py, openspec/changes/3308-the-plan-check-compares-a-number/tasks.md]
    • Chosen: A field with an empty default. A recorded case keeps no hits, and an empty list leaves its verdict as it is.
    • Rejected: A required field. It fails every existing case until each facts.json gets the key.
  • How do the recorded hits reach check_proposal?: Add a references field to PlanUnderTest with an empty default. Set it from case.facts.references in of_case, and pass it from _path_gate. (best practice) [sources: src/devops_cli/roadmap/stage_eval_gates.py, openspec/changes/3308-the-plan-check-compares-a-number/tasks.md]
    • Chosen: A references field on PlanUnderTest. The gate takes a PlanUnderTest, and a reply has no hits, so the field has an empty default.
    • Rejected: Read case.facts.references in _path_gate. _path_gate takes a PlanUnderTest and never sees the case.
  • Which case does the golden set add?: One case that moves a module and leaves a string literal in tests/. It holds a missing_path defect with the gate paths and names the test file that holds the old path. (best practice) [sources: src/devops_cli/roadmap/stage_eval_cases.py]
    • Chosen: A new case with a string literal in tests/. The check reads a hit outside the changed paths, and no recorded case has one.
    • Rejected: Reuse a case that holds a missing_path defect. Those cases record no reference hit, so the check cannot refuse them.
  • Does the replay read git?: No. A replay cannot assume a deep clone, so it reads no git. The case files hold what the gates need. [sources: src/devops_cli/roadmap/stage_eval_cases.py, docs/ROADMAP_WORKFLOW.md:254]
  • What does the paths gate pass to check_proposal today?: The proposal, the known capabilities, the tree and the requirement names. It passes no reference hits, so the change waits on feat(roadmap): Require a move plan to cover each reference #3373. [sources: src/devops_cli/roadmap/stage_eval_gates.py, src/devops_cli/roadmap/stage_change.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3373

Alternatives check of 2026-11-06: none.
Tool: none found.

Activity

  1. added
    type/feature
    source/agent
    scope/roadmap
    on Nov 4, 2026
  2. added
    status/new
    value/medium
    effort/low
    on Nov 4, 2026
  3. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

    • Priority: P2-Medium. The replay cannot judge the reference check, so a regression in that gate has no golden-set case, but no user-facing feature is blocked.
    • Value: Medium. Closes a coverage gap for one gate in the golden set, keeping the stage checks honest.
    • Effort: Low. The body states the cost is about 3k tokens and 45 minutes, touching two source files and one fixture.
    • Related: feat(roadmap): the stage eval records the constants that a plan cites #3390, which asks for a different change. Both add a new recorded field to facts.json so the replay can judge a specific gate, but #3390 records constant values while this records file paths that hold an old module name.
  4. added
    priority/p2-medium
    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 1643cc7 (see proposed design in issue body).

  6. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Tool: none found

    Lacks:

    • The issue asks for an extension of the repository's own stage-case schema: a references key in each case's facts.json, a references field on PlanUnderTest, and a pass-through in the paths gate of stage_eval_gates.py. No external tool supplies that schema.
    • No tool can judge the reference check of feat(roadmap): Require a move plan to cover each reference #3373 inside devops roadmap eval stage --replay; the replay must feed the recorded reference paths into the project's own check_proposal.
    • The nearest external candidate, pytest-regressions, records and compares data files for regression tests; it neither records file paths that hold an old module path nor hands them to a plan-check gate, and the golden-set replay here is a bespoke CLI path, not a pytest run.

    Searches run:

    • pytest-regressions data file regression golden set snapshot
    • tool to check references to a renamed python module path in files
    • pytest-regressions package
    • snapshot testing CLI golden set replay tool
    • pytest-regressions

    Sources:

    Checked on 2026-11-06. A person decides what this means for the item. The check changes no label and closes no issue.

  7. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 9, 2026
  8. removed
    status/in-review
    on Nov 9, 2026
  9. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor
  10. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-09 10:07 UTC

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/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions