Skip to content

fix(roadmap): the stage job refuses a spec delta that the changed paths do not need #3013

Closed

Description

@dan-petty

What happened

About 14 of 37 plans carry a spec delta on a change that needs none (2977, 2979, 2980, 2983, 2985, 2986, 2987, 2994: tests, CI and document changes with skip_specs false) or put it in the wrong capability or ADD a requirement that the base spec already has (2976, 2981, 2987, 2993, 2997, 3002). check_proposal only checks that skip_specs agrees with the specs list. It does not look at the changes paths, and the model gets only the capability names.

What should happen

  • check_proposal refuses skip_specs: false when every changes path is under tests/, .github/workflows/, docs/ or openspec/.
  • It refuses an ADDED requirement whose name exists in the base spec of that capability.
  • The input holds the purpose and the requirement names of each capability.

Acceptance criteria

Source

An evaluation on 2026-11-01 of the 37 docs(openspec): plan #N pull requests (35 merged, 2 open) found 34 that need fixes and 1 to reject. The per-PR reviews are in the comments of tracker #3005's thread and in .data/agent/scratch/plan-review.json of the owner's workstation. Related: #3005 (the kind of a task group: test for behavior, a repeatable check for other changes).

Proposed design

Problem statement

The stage job's check_proposal function does not check whether a spec delta is needed based on the changed file paths. It also does not check for duplicate requirement names against the base spec. About 14 of 37 recent plans carry an unnecessary or incorrect spec delta. The model input lacks the capability purpose and requirement names, so the model cannot choose correctly.

Acceptance criteria

Requirement: Refuse unnecessary spec delta

check_proposal SHALL refuse skip_specs: false when every changes path is under tests/, .github/workflows/, docs/, or openspec/.

Scenario: All paths are non-spec paths

  • WHEN A proposal has skip_specs: false and all changes paths start with tests/, .github/workflows/, docs/, or openspec/
  • THEN check_proposal returns a problem stating that no spec delta is needed

Requirement: Refuse duplicate requirement

check_proposal SHALL refuse an ADDED requirement whose name exists in the base spec of that capability.

Scenario: Added requirement name matches base spec

  • WHEN A spec delta ADDs a requirement whose name already appears in openspec/specs//spec.md
  • THEN check_proposal returns a problem naming the duplicate requirement

Requirement: Model input includes capability details

The model input SHALL include the purpose and the requirement names of each capability.

Scenario: Input contains capability names and purposes

  • WHEN The stage job builds the model input for a proposal
  • THEN The input contains the purpose text and the list of requirement names for each capability

Requirement: Unit tests for both refusals

Both refusal checks SHALL have unit tests that assert the problem text.

Scenario: Unit tests pass

  • WHEN The test suite runs the unit tests for the path-prefix refusal and the duplicate-requirement refusal
  • THEN Both tests pass and assert the expected problem text

Requirement: Model receives problem text

The model SHALL receive the problem text when check_proposal refuses a proposal.

Scenario: Problem text is sent back to the model

  • WHEN check_proposal returns a problem for a proposal
  • THEN The existing retry mechanism sends the problem text to the model

Requirement: Replay of #2977 is refused

A replay of the plan of #2977 SHALL be refused by check_proposal.

Scenario: Replay test

Existing Tool Considered

No check has run. No open, maintained tool or library covers the need to validate whether a spec delta is needed based on changed file paths and to check for duplicate requirement names against a base spec. The project builds this validation in check_proposal.

Key questions

  • What path prefixes indicate that no spec delta is needed?: tests/, .github/workflows/, docs/, openspec/ (best practice) [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md]
    • Chosen: tests/, .github/workflows/, docs/, openspec/. The body states these four prefixes. They cover all non-spec-change paths in this repository.
    • Rejected: Only tests/ and docs/. Too narrow. .github/workflows/ and openspec/ changes also do not need a spec delta.
  • How does check_proposal detect a duplicate requirement name?: It reads the base spec file openspec/specs//spec.md, extracts the requirement names (the heading text of each requirement), and compares them against the names in the ADDED section of the spec delta. A match is a problem. (best practice) [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md, CONTEXT.md]
    • Chosen: Compare requirement heading names against the base spec. The base spec is the living specification. A requirement with the same name already exists there, so ADDing it is a no-op or an error.
    • Rejected: Compare the full requirement text. Too strict. A requirement can be modified (MODIFIED) with the same name but different text. Only the name matters for the duplicate check.
  • Where is check_proposal implemented?: It is a pure function in the stage job module, called by plan_stage. The archived change fix(roadmap): the stage job refuses a plan that names a path that does not exist #3010 shows it takes the reply and the tree, and appends problems to its list. The exact source file path needs investigation. [sources: openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md, openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md]
  • How does the model receive the problem text on refusal?: The existing retry mechanism handles it. check_proposal appends the problem to its list, and the planner sends the violation back to the model for one correction (max_retries=1). A second failure stops the item through the existing stage_invalid error. [sources: openspec/changes/archive/2026-10-30-2772-stage-group-files/design.md, openspec/changes/archive/2026-11-01-3010-stage-refuses-missing-paths/design.md]
  • What does the model input need to include for each capability?: The purpose text and the list of requirement names. This lets the model choose the correct capability and avoid ADDing a requirement that already exists. (best practice) [sources: CONTEXT.md]
    • Chosen: Purpose and requirement names. The body states this. The purpose tells the model what the capability is for. The requirement names let it avoid duplicates.
    • Rejected: Capability names only (current behavior). Insufficient. The model cannot judge whether a spec delta is needed or whether a requirement name is a duplicate.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 1, 2026
  2. dan-petty commented on Nov 1, 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/bug. The fix prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P2-Medium. Twelve plans carry wrong spec deltas, but the plans still open and a person can fix them; no blocker is named.
    • Value: Medium. It stops 14 of 37 plans from shipping an incorrect spec delta, reducing review waste.
    • Effort: Medium. Two new refusals, an input-context change for capability names, and unit tests are needed.
    • Related: fix(roadmap): the stage job refuses a plan that names a path that does not exist #3010, which asks for a different change. Both fix the stage job refusal logic, but 3010 checks that named paths exist while the candidate checks that a spec delta is needed and does not duplicate a base-spec requirement.
  3. added
    priority/p2-medium
    on Nov 1, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 1, 2026
  5. devops-cli-service commented on Nov 1, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Staged: branch fix/3013-the-stage-job-refuses-a-spec, draft pull request #3177. 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 40000 tokens:

    1. Refuse a spec delta that the changed paths do not need: 23754 tokens
    2. Refuse an added requirement that the base spec already has: 25148 tokens
    3. Give the model the purpose and the requirement names of each capability: 24301 tokens
    4. Refuse the replay of the plan of docs(openspec): plan #2116 use PATH stand-ins for scanner tests #2977: 6436 tokens

    The plan run made 16 model request(s), and used 491991 input tokens and 8071 output tokens. The tool calls, in order:

    1. search_code({"text":"check_proposal"})
    2. search_code({"text":"skip_specs"})
    3. repo_map({"directory":"src"})
    4. search_code({"text":"def check_proposal"})
    5. search_code({"text":"stage_invalid"})
    6. read_file({"path":"src/devops_cli/roadmap/stage_change.py"})
    7. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":80,"end_line":420})
    8. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":183,"end_line":420})
    9. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":268,"end_line":400})
    10. search_code({"text":"check_proposal("})
    11. search_code({"text":"capabilities"})
    12. list_files({"directory":"src/devops_cli/ai/tasks"})
    13. list_files({"directory":"tests/roadmap"})
    14. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":200,"end_line":400})
    15. search_code({"text":"check_proposal"})
    16. read_file({"path":"src/devops_cli/roadmap/stage_change.py","start_line":286,"end_line":360})
    17. search_code({"text":"capabilit"})
    18. file_symbols({"path":"src/devops_cli/roadmap/stage.py"})
    19. file_symbols({"path":"src/devops_cli/roadmap/stage_eval_gates.py"})
    20. read_file({"path":"src/devops_cli/roadmap/stage.py","start_line":640,"end_line":770})
    21. read_file({"path":"src/devops_cli/roadmap/stage_eval_gates.py","start_line":1,"end_line":145})
    22. file_symbols({"path":"src/devops_cli/roadmap/stage_eval_cases.py"})
    23. read_file({"path":"tests/roadmap/test_roadmap_stage_eval_cases.py","start_line":1,"end_line":60})
  7. removed
    status/ready
    on Nov 2, 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/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions