Skip to content

fix(roadmap): Refuse a spec delta on root documents #3212

Closed

Description

@dan-petty

What happened

The replay of the stage golden set (devops roadmap eval stage --replay) shows two gaps in the rule that refuses a spec delta that a change does not need (_needs_no_spec in src/devops_cli/roadmap/stage_change.py). The rule fires only when every path in changes is under tests/, .github/workflows/, docs/ or openspec/. Two recorded plans carry a delta that openspec/config.yaml forbids, and the rule does not refuse them:

What should happen

The rule also treats a document at the root (*.md outside src/) as a path that needs no spec delta. A change to pyproject.toml needs a decision: a setting of a tool is no behavior that a consumer sees, but a dependency or an entry point is.

Acceptance criteria

Found by #3208. The cases are in tests/fixtures/roadmap_eval/stage/2526-the-five-defect-fixes-merged-on and tests/fixtures/roadmap_eval/stage/2163-coverage-measures-branches-and-ci-keeps.

Existing Tool Considered

No open tool covers this project-specific rule. The change extends a prefix tuple and one test. Cost to build: about 15k tokens and 1 hour. To keep: nothing new.

Scope from #3282

src/devops_cli/ai/knowledge_base/ also counts as documents. PR #3211 for #3106 generated specs/knowledge-base-manual/spec.md for a change of manuals.

  1. Add src/devops_cli/ai/knowledge_base/, with its trailing slash, to _NO_SPEC_PREFIXES (src/devops_cli/roadmap/stage_change.py:100).
  2. No general .md rule applies under src/. A .md file under src/devops_cli/ai/tasks/ changes model behavior, so it stays observable and keeps its spec delta.
  3. Add the path to the sentence on skip_specs at line 12 of src/devops_cli/ai/tasks/roadmap_stage_change.md. The test test_the_prompt_lists_the_paths_that_the_check_takes_for_unobserved (tests/roadmap/test_roadmap_stage_prompt_rules.py:288) holds the prompt and the gate to one list, and the parametrized test after it covers the refusal. So no new prompt-and-gate test is necessary.
  4. MODIFY the requirement Refuse a spec delta that the changed paths do not need (openspec/specs/roadmap-stage/spec.md:787) to name the new prefixes, and keep its scenarios.
  5. Cases: a plan that changes only src/devops_cli/ai/knowledge_base/example.md and a test path needs no spec delta. The same plan with a spec delta is refused.
  6. The README.md case of test_the_check_wants_a_spec_delta_for_a_path_outside_the_list (test_roadmap_stage_prompt_rules.py:297) must change, because this issue adds the root documents. Tests go in that module or in another tests/roadmap/test_roadmap_stage_*.py module. tests/roadmap/test_stage_change.py does not exist.

The recorded cases that match the new paths are 2526 (needs-fix) and 3174 (reject). No good case changes only the new paths with a spec delta.

No rule refuses skip_specs: true. _needs_no_spec (stage_change.py:503) and the refusal at line 534 refuse only a spec delta. The title of #3282 was wrong on this point.

Cost of this part: about 4,000 tokens and 30 minutes.

Proposed design

Problem statement

The stage job accepts a spec delta on a plan that changes only root documents or knowledge-base manuals. The replay then records a defect that the path rule misses. The issue also asks how to judge a pyproject.toml change: a tool setting is no consumer behavior, but a dependency or an entry point is.

Acceptance criteria

Requirement: Root documents need no spec delta

The stage check SHALL refuse a spec delta when every changed path is a document at the root outside src/.

Scenario: Root documents with a delta

  • WHEN A plan changes only SECURITY.md and CONTRIBUTING.md and gives a spec delta.
  • THEN The check reports These paths need no spec delta.

Requirement: Knowledge-base manuals need no spec delta

The stage check SHALL treat src/devops_cli/ai/knowledge_base/ as a path that needs no spec delta.

Scenario: Knowledge-base file and test path with a delta

  • WHEN A plan changes only src/devops_cli/ai/knowledge_base/example.md and a path under tests/, and gives a spec delta.
  • THEN The check reports These paths need no spec delta.

Requirement: Knowledge-base manuals accept no spec delta

The stage check SHALL accept a plan with no spec delta when every changed path is under src/devops_cli/ai/knowledge_base/ or tests/.

Scenario: Knowledge-base file and test path without a delta

  • WHEN A plan changes only src/devops_cli/ai/knowledge_base/example.md and a path under tests/, and sets skip_specs: true.
  • THEN The check reports no problem about a spec delta.

Requirement: A task prompt under src stays observable

The stage check MUST accept a spec delta when a changed .md file under src/ is not under src/devops_cli/ai/knowledge_base/.

Scenario: Task prompt with a delta

  • WHEN A plan changes only src/devops_cli/ai/tasks/roadmap_stage_change.md and gives a spec delta.
  • THEN The check reports no problem about a spec delta that the paths do not need.

Requirement: Prompt lists the no-spec paths

The stage prompt SHALL name root documents and src/devops_cli/ai/knowledge_base/ in its skip_specs sentence.

Scenario: Prompt and gate hold one list

  • WHEN The test compares the prompt sentence with the paths that _needs_no_spec accepts.
  • THEN The prompt names every no-spec path that the check accepts.

Requirement: The requirement names the new paths

The change MUST MODIFY the requirement Refuse a spec delta that the changed paths do not need to name root documents and src/devops_cli/ai/knowledge_base/, and keep its scenarios.

Scenario: OpenSpec validation of the change

  • WHEN uv run devops openspec check validates the change.
  • THEN The MODIFIED requirement names the new paths and keeps its scenarios.

Requirement: Replay judges the root-document case

The stage replay MUST judge case 2526 with the gate paths and remove its reason from case.json.

Scenario: Replay of case 2526

  • WHEN The stage replay runs the golden set.
  • THEN Case 2526 has the gate paths and no reason in case.json.

Requirement: The outside-list test uses an observable path

The test test_the_check_wants_a_spec_delta_for_a_path_outside_the_list MUST use an observable src/ path in place of README.md.

Scenario: README is a root document

  • WHEN The test checks a path outside the no-spec list.
  • THEN The test names a path under src/ that is not under src/devops_cli/ai/knowledge_base/.

Existing Tool Considered

No alternatives check has run. No open, maintained tool covers this project-specific rule. The change extends our own code. It costs about 4,000 tokens and 30 minutes for the knowledge-base scope. It costs about 15k tokens and 1 hour for the full rule extension. It adds nothing new to keep.

Key questions

  • Which changed paths need no spec delta?: A path needs no spec delta under tests/, .github/workflows/, docs/, openspec/ or src/devops_cli/ai/knowledge_base/. A .md file at the root outside src/ also needs no spec delta. A .md file under any other src/ path stays observable. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:100, src/devops_cli/roadmap/stage_change.py:503, src/devops_cli/ai/tasks/roadmap_stage_change.md:12, openspec/specs/roadmap-stage/spec.md:787, tests/roadmap/test_roadmap_stage_prompt_rules.py:288]
    • Chosen: Add a root-document predicate and the knowledge-base prefix. It covers root documents and the manual prefix, and it keeps a prompt under src/ observable.
    • Rejected: Treat every .md file as no-spec. A task prompt under src/devops_cli/ai/tasks/ changes model behavior, so it stays observable.
    • Rejected: List each root document by name. A new root document would need a code change, and the issue asks for *.md outside src/.
  • Should pyproject.toml count as a path that needs no spec delta?: No. The path-only rule cannot tell a tool setting from a dependency or an entry point. Keep pyproject.toml observable and defer case 2163 to a diff-aware rule. (best practice) [sources: pyproject.toml, src/devops_cli/roadmap/stage_change.py:503, src/devops_cli/roadmap/stage_change.py:507]
    • Chosen: Keep pyproject.toml observable and defer case 2163. A dependency or an entry point changes consumer behavior, and the stage check sees paths only.
    • Rejected: Add pyproject.toml to _NO_SPEC_PREFIXES. It would hide a dependency or an entry-point change that a consumer observes.
    • Rejected: Parse pyproject.toml in the stage check. The stage check receives paths, not the diff, so it cannot decide from a tool setting.
  • Does the rule refuse skip_specs: true?: No. _needs_no_spec and the refusal at line 534 run only when skip_specs is false and the plan gives a spec delta. [sources: src/devops_cli/roadmap/stage_change.py:503, src/devops_cli/roadmap/stage_change.py:534]
  • Which living requirement changes?: MODIFY the requirement Refuse a spec delta that the changed paths do not need in openspec/specs/roadmap-stage/spec.md. Name the root-document rule and src/devops_cli/ai/knowledge_base/. Keep its scenarios. [sources: openspec/specs/roadmap-stage/spec.md:787]
  • Where do the tests go, and does the prompt need a new test?: Put the tests in tests/roadmap/test_roadmap_stage_prompt_rules.py or another tests/roadmap/test_roadmap_stage_*.py module. Extend test_the_prompt_lists_the_paths_that_the_check_takes_for_unobserved and the parametrized refusal test. Add no new prompt-and-gate test. tests/roadmap/test_stage_change.py does not exist. (best practice) [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py:288, tests/roadmap/test_roadmap_stage_prompt_rules.py:297, tests/roadmap/test_roadmap_stage_eval_gates.py:384]
    • Chosen: Extend the existing prompt and refusal tests. The existing test holds the prompt and the gate to one list, and the parametrized test covers the refusal.
    • Rejected: Add a new prompt-and-gate test. It would duplicate the existing test that holds the prompt and the gate to one list.
    • Rejected: Create tests/roadmap/test_stage_change.py. That module does not exist, and the issue puts the tests in tests/roadmap/test_roadmap_stage_*.py.
  • Which replay case changes for the root-document rule?: Case 2526 gets the gate paths. Remove its reason from case.json. [sources: tests/roadmap/test_roadmap_stage_eval_gates.py:384]
  • How does the check detect a root document?: A helper _is_no_spec_path returns true for a path under _NO_SPEC_PREFIXES. It also returns true for a path that ends with .md and does not start with src/. _needs_no_spec uses that helper for every changed path. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:100, src/devops_cli/roadmap/stage_change.py:503, src/devops_cli/ai/tasks/roadmap_stage_change.md:12]
    • Chosen: Use a helper with a suffix and a src/ guard. It states the root-document rule once and keeps the src/ exception.
    • Rejected: Add a regular expression to _NO_SPEC_PREFIXES. The tuple holds literal prefixes, and a regular expression would change its meaning.
    • Rejected: Add every root document name. A new root document would need a code change.
  • Which existing test case must change because README.md becomes a no-spec path?: The README.md case of test_the_check_wants_a_spec_delta_for_a_path_outside_the_list must use an observable path under src/ in place of README.md. [sources: tests/roadmap/test_roadmap_stage_prompt_rules.py:297, src/devops_cli/roadmap/stage_change.py:100]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 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.

    • 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. A validation gap that lets two plans through with an unnecessary spec delta; incorrect but not blocking.
    • Value: Medium. Fixes two recorded defects in the stage gate without changing user-facing behaviour.
    • Effort: Low. Extends a prefix tuple and adds one test; the candidate estimates about one hour.
    • Related: fix(roadmap): the stage job refuses a spec delta that the changed paths do not need #3013, which asks for a different change. Both modify the _needs_no_spec rule in stage_change.py; #3013 built it for tests/, .github/workflows/, docs/, openspec/, the candidate adds root documents.
  3. dan-petty commented on Nov 2, 2026

    @dan-petty
    OwnerAuthor

    Addition for the refine step, from fixing plan pull request #3157 (plan for #2670). The no-spec rule _NO_SPEC_PREFIXES (src/devops_cli/roadmap/stage_change.py:66) lists tests/, .github/workflows/, docs/ and openspec/. It has no root documents either, so a plan whose only changed path is SECURITY.md can carry a spec delta and pass the gate, although the planner prompt already says that documents get no delta. This issue should list the root documents (SECURITY.md, README.md, CONTRIBUTING.md, ARCHITECTURE.md, AGENTS.md, CONTEXT.md, RELEASE_CYCLE.md) next to pyproject.toml, and the prompt test from #3210 holds the prompt and the gate to the same list. Replay case: the first plan of #3157 (a valkey-endpoint delta on a SECURITY.md change).


    Generated by Claude Code

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

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 4571d5f until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.

    • The proposal has no problem statement, no acceptance criterion with its requirement, scenario, WHEN and THEN, or no answer to the existing-tool question. State the problem, the requirements with their scenarios, and the open tool that covers the need or the cost of building it.
  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 46cf288 (see proposed design in issue body).

    Moved to new items: #3491.

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Tool: none found

    Lacks:

    • OpenSpec validates a change and requires skip_specs: true for a zero-delta change, but it does not refuse a spec delta when the changed paths need none.
    • No open tool maps path prefixes (tests/, docs/, root *.md, src/devops_cli/ai/knowledge_base/) to whether a spec delta is required.
    • CI path filters such as GitLab rules:changes can run or skip a job by changed path, but they do not judge whether a spec delta is needed.
    • The rule is project-specific: it extends _NO_SPEC_PREFIXES, _needs_no_spec and the stage prompt in src/devops_cli/roadmap/stage_change.py, which no external tool covers.

    Searches run:

    • openspec spec delta validation tool require spec delta for changed paths
    • spec-driven development tool that checks whether a change needs a spec update based on file paths
    • tool that requires documentation or spec updates based on changed file paths rule configuration

    Sources:

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

  8. changed the title [-]fix(roadmap): the stage job refuses a spec delta on a change of root documents[/-] [+]fix(roadmap): Refuse a spec delta on root documents[/+] on Nov 6, 2026
  9. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

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

    • Before: fix(roadmap): the stage job refuses a spec delta on a change of root documents
    • After: fix(roadmap): Refuse a spec delta on root documents
    • Source of the summary: the background model
  10. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    The stage job stopped. The inputs of the step of the task group "Refuse a spec delta on a root document and a manual" hold 66770 tokens, over the budget of 64000 tokens, also after the model split the groups once. A person decides how to split the item. The job stages the item again when a person runs it with --item 3212.

    The task groups:

    1. Refuse a spec delta on a root document and a manual: 66770 tokens
    2. Align the plan check test with the new problem text: 21110 tokens
    3. Judge the recorded defect of case 2526: 20190 tokens
  11. added
    status/in-progress
    and removed
    status/ready
    on Nov 8, 2026
  12. added
    status/in-review
    and removed
    status/in-progress
    on Nov 8, 2026
  13. removed
    status/in-review
    on Nov 8, 2026
  14. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor
  15. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-08 22:36 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/roadmaptype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions