Skip to content

feat(roadmap): the plan check pairs each new spec scenario with a test task #3423

Closed

Description

@dan-petty

Problem or Motivation

A spec delta can add a scenario that no task tests, and the plan still passes. The plan of PR #3400 (for #3394) adds the scenario "A What Changes line below the least length" to the MODIFIED requirement "A plan text is no placeholder". No task in its tasks.md adds a test for that line, yet devops openspec check and every check of the pull request pass.

Issue #3321 asks for a check that refuses a scenario with no test, but its acceptance criteria limit the rule to a scenario that names a function or a file. The scenario above names only what_changes and PLAN_FIELD_MIN_CHARS, so the rule as written still passes it. A scenario that names no code still needs a test under tests/ to assert it.

Proposed Solution & Architectural Design

  1. In check_proposal of src/devops_cli/roadmap/stage_change.py, pair each scenario of every new or modified requirement with a task of a behavior group. A task matches when its test names the scenario or the requirement, or when its verify command runs the test module that the plan changes.
  2. Refuse the plan with the scenario name and its requirement when no task matches it. Accept a scenario that names a function or a file through the rule of feat(roadmap): refuse a self-named or untested plan #3321, and accept a scenario that a test asserts without naming it when the plan adds one behavior test task for each new scenario.
  3. Add a test in tests/roadmap/test_roadmap_stage_form.py that refuses a delta whose scenario names only a field, with a task that tests another rule, and that accepts the same delta once a task names the scenario.

Target Subsystem

src/devops_cli/roadmap/stage_change.py (check_proposal), tests/roadmap/test_roadmap_stage_form.py.

Existing Tool Considered

No open, maintained tool covers this repository-specific plan rule. The change extends the existing check_proposal scenario scan, which #3321 starts, and adopts no new dependency. It builds about 3k tokens to implement, about 1k tokens per year to keep and fix, and about half a working day of elapsed time. It deletes no internal code.

Source: #3321

Proposed design

Problem statement

The plan check accepts a spec delta whose scenario no task tests. The plan of PR #3400 adds the scenario A What Changes line below the least length to a MODIFIED requirement, and no task adds a test for it, yet every check passes. The check of #3321 refuses only a scenario that names a function or a file, so a scenario that names a field still passes. The check must pair each new scenario with a task of a behavior group and refuse the plan when no task covers it.

Acceptance criteria

Requirement: A scenario with no covering task is refused

The plan check SHALL refuse a spec delta whose scenario no behavior group covers, and the problem SHALL name the scenario and its requirement.

Scenario: The scenario of the plan of #3400

  • WHEN A plan modifies a requirement, adds the scenario A What Changes line below the least length, and its only behavior group tests another rule.
  • THEN check_proposal returns one problem that holds the scenario name and the requirement name.

Requirement: A test task that names the scenario covers it

A behavior group SHALL cover a scenario when its test text holds the scenario name or the requirement name.

Scenario: The test task names the scenario

  • WHEN A plan states the scenario A What Changes line below the least length and a behavior group whose test text holds that name.
  • THEN check_proposal returns no problem for the scenario.

Requirement: A verify command that runs the changed test module covers the scenario

A behavior group SHALL cover a scenario when its verify command runs a test module that the group changes or creates.

Scenario: The verify command runs the new test module

  • WHEN A behavior group changes a path under src/, creates tests/roadmap/test_roadmap_stage_content.py, and its verify is uv run devops ci test tests/roadmap/test_roadmap_stage_content.py.
  • THEN check_proposal returns no problem for the scenario.

Requirement: A scenario of the base spec needs no new task

The plan check MUST exempt a scenario whose name the base spec of the capability already holds.

Scenario: A modified requirement restates a tested scenario

  • WHEN A plan restates in a MODIFIED requirement a scenario that openspec/specs/roadmap-stage/spec.md already holds.
  • THEN check_proposal returns no problem for that scenario.

Requirement: The stage prompt states the rule

The stage prompt SHALL state that each scenario of a spec delta needs a behavior group whose task covers it.

Scenario: The prompt holds the rule

  • WHEN A test reads the text of roadmap_stage_change.md.
  • THEN The text holds a sentence that asks for a task that covers each new scenario.

Requirement: The replay judges the rule

The replay SHALL judge a recorded plan whose scenario no task covers, under the paths gate.

Scenario: The recorded plan is refused

  • WHEN The replay runs the case that holds a plan with a scenario that no task covers.
  • THEN The replay reports one defect with the gate paths and the problem text as its message.

Existing Tool Considered

No alternatives check has run on this issue. No open, maintained tool covers this repository-specific plan rule: check_proposal judges a plan of this repository against the form of its own OpenSpec change. The change extends the existing check_proposal and adds no dependency. It builds its own code, at a written cost of about 3k tokens to implement, about 1k tokens per year to keep and fix, and about half a working day of elapsed time. It deletes no internal code.

Key questions

  • Which module holds the new rule?: A new module src/devops_cli/roadmap/stage_scenarios.py holds scenario_problems, and check_proposal calls it as it calls the other rule families. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_form.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage_criteria.py]
    • Chosen: A new module stage_scenarios.py. Each rule family of the plan sits in its own module, and check_proposal composes them.
    • Rejected: Inline in check_proposal. stage_change.py already holds the reply schema, the render and the measure, and the rule would grow it further.
  • How does a behavior task cover a scenario?: A behavior group covers a scenario when its test text holds the scenario name or the requirement name, or when its verify command runs a test module that the group changes or creates. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, docs/ROADMAP_WORKFLOW.md:259]
    • Chosen: A name match or the changed test module. The model may assert a scenario in a new test module and name it nowhere.
    • Rejected: A name match only. A correct plan whose verify runs its new test module would be refused.
    • Rejected: One behavior test task for each new scenario. The plan of docs(openspec): plan #3394 Check every plan text for a placeholder #3400 holds one behavior test task, so the count would accept it and the defect stays.
  • Does a scenario that the base spec already holds need a task?: No. The check exempts a scenario whose name the base spec of the capability already holds. (best practice) [sources: openspec/changes/3394-the-plan-check-refuses-a-placeholder/specs/roadmap-stage/spec.md, openspec/specs/roadmap-stage/spec.md, docs/ROADMAP_WORKFLOW.md:259]
    • Chosen: Exempt the scenarios of the base spec. A MODIFIED requirement restates every scenario of the requirement, so a valid plan would otherwise be refused.
    • Rejected: Require a task for every listed scenario. Every plan that restates a tested scenario fails, and the replay fails when it refuses a good plan.
  • How does the check learn the scenario names of the base specs?: check_proposal gets a new keyword-only argument that holds the scenario names of each base spec by capability and requirement, and the code that builds requirements fills it. (best practice) [sources: src/devops_cli/roadmap/stage_change.py]
    • Chosen: A new keyword-only argument. The existing requirements argument holds requirement names only, and a separate argument keeps its value type.
    • Rejected: Extend requirements to hold scenario names. It changes the value type of an argument that the eight caller modules pass.
  • Where do the new problem texts live?: In MESSAGES.roadmap in src/devops_cli/lang/en/messages.py, with the other stage_problem_* texts that stage_change.py formats. [sources: src/devops_cli/lang/en/messages.py, src/devops_cli/roadmap/stage_change.py]
  • Does the stage prompt state the new rule?: Yes. The prompt roadmap_stage_change.md states that each scenario of a spec delta needs a behavior group whose task covers it. (best practice) [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py, tests/roadmap/test_roadmap_stage_form.py]
    • Chosen: State the rule in the prompt. The model writes the plan, and a refusal costs one more turn of the model.
    • Rejected: Leave the prompt unchanged. The model repeats the reply that the check refuses, and the item stalls.
  • How does the replay judge the new rule?: A case file holds a plan with a scenario that no task covers, and the replay reports the defect under the paths gate as spec_delta_wrong with the problem text as its message. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:259, src/devops_cli/roadmap/stage_eval_cases.py]
    • Chosen: Add the case under the paths gate. check_proposal is the paths gate, and a spec delta defect has the type spec_delta_wrong.
    • Rejected: Change no case file. No test shows that the rule catches the defect, and the replay lists no defect for it.
  • What does the pull request state about the model score?: The body states the score of the same model before and after the change, and names the model. [sources: docs/ROADMAP_WORKFLOW.md:260]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3321

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

Activity

  1. added
    source/agent
    on Nov 4, 2026
  2. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 4, 2026
  3. 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/feature. The feat prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. It improves plan-check correctness but does not fix a production failure.
    • Value: Medium. It catches untested scenarios that would otherwise pass all gates.
    • Effort: Low. The body estimates about half a working day and 3k tokens to implement.
    • Related: feat(roadmap): map all issue requirements to a group #3253, which asks for a different change. Both ensure plan coverage of requirements, but #3253 maps all issue requirements to groups while this pairs spec scenarios with test tasks.
  4. added
    priority/p2-medium
    on Nov 4, 2026
  5. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  6. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 89682e4 (see proposed design in issue body).

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Tool: none found

    Lacks:

    • No tool pairs each scenario of a spec delta with a task of the plan's behavior group.
    • OpenSpec, the spec layer the project already adopts (ADR 0010), validates the form of a spec delta and its requirements and scenarios, but has no rule that a scenario needs a covering test task; its check passes the plan of PR docs(openspec): plan #3394 Check every plan text for a placeholder #3400.
    • No tool matches a scenario to a task by the scenario name, the requirement name, or a verify command that runs the changed test module.
    • No tool knows the project's base specs, so no tool exempts a scenario that the base spec of the capability already holds.
    • The need is a rule of this repository's own check_proposal over its own change format, so it must be written in src/devops_cli/roadmap/stage_change.py rather than adopted as a dependency.

    Searches run:

    • OpenSpec validate spec delta scenario tasks coverage check
    • tool that checks every spec scenario has a corresponding test
    • openspec cli validate change proposal scenarios
    • pytest-bdd undefined step definitions
    • OpenSpec spec driven development
    • behave BDD scenario coverage test
    • openspec validate strict scenarios requirements

    Sources:

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

  8. added
    owner/service
    on Nov 14, 2026
  9. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 14, 2026
  10. removed
    owner/service
    on Nov 14, 2026
  11. removed
    status/in-review
    on Nov 14, 2026
  12. devops-cli-service commented on Nov 14, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-14 15:02 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