Skip to content

fix(roadmap): Detect obsolete spec requirements on command rename #3287

Closed

Description

@dan-petty

Problem or Motivation

When an issue renames or removes a CLI command (such as #3185 moving intake-eval to eval intake), the stage planner generates an added requirement stating that the command MUST NOT exist under the old name or alias.
However, existing capability specs under openspec/specs/<capability>/spec.md often contain multiple requirements that specify the old command syntax (for example, in PR #3228, five requirements in roadmap-intake-duplicates specified devops roadmap intake-eval SHALL...).

Because devops roadmap stage does not detect that the living spec references a command being removed:

  1. The planner generates only added requirements and omits modified requirements for the existing spec entries.
  2. When the change proposal archives, the living spec contains contradictory requirements: one requirement stating the old command must not exist, and existing requirements stating the old command shall execute.
  3. Review finding 2 on PR docs(openspec): plan #3185 move intake-eval under roadmap eval #3228 noted: "After the archive the living spec says both that intake-eval SHALL run each case and that it MUST NOT exist."

Proposed Solution & Architectural Design

  1. In src/devops_cli/roadmap/stage_references.py, prioritize specs references when an issue cites command moves or renames, ensuring references in openspec/specs/ are explicitly surfaced to the planner.
  2. Update src/devops_cli/ai/tasks/roadmap_stage_change.md to instruct the planner that when a command is removed or renamed, every requirement in the capability spec that specifies the old command must be updated under modified.
  3. In src/devops_cli/roadmap/stage_change.py (or stage_eval_gates.py), add a validation check in check_proposal: when an added requirement asserts that a command or option must not exist, verify that no un-modified requirement in the referenced capability still specifies that command name.

Target Subsystem

src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_references.py, src/devops_cli/ai/tasks/roadmap_stage_change.md

Existing Tool Considered

_spec_problems and check_proposal in stage_change.py already validate capability names, purpose lengths, and requirement keywords. Adding a check for obsolete command references in unchanged requirements prevents contradictory living specs without external tools. Cost to build: about 6,000 tokens and 45 minutes.

Proposed design

Problem statement

The stage planner can add a requirement that a CLI command MUST NOT exist. An unmodified base requirement of the same capability can still name that command. The archive then leaves two contradictory requirements in the living spec. The #3228 case is repaired in roadmap-intake-duplicates, but no check stops the next rename. This change adds a prompt rule and a deterministic check to check_proposal. It also lists spec files first in a references answer.

Acceptance criteria

Requirement: Spec files come first in a references answer

The references answer SHALL list a file under openspec/specs/ before a file under src/ when both hold the requested name.

Scenario: A command name exists in a spec and in source

  • WHEN The tool references answers the name devops roadmap intake, which openspec/specs/roadmap-intake-duplicates/spec.md and src/devops_cli/roadmap/intake.py both hold.
  • THEN The answer lists the line of openspec/specs/roadmap-intake-duplicates/spec.md before the line of src/devops_cli/roadmap/intake.py.

Requirement: The prompt requires a modified requirement for a renamed command

The stage prompt SHALL require a modified requirement for each base requirement that names a command or option that the issue removes or renames.

Scenario: The prompt states the rename rule

  • WHEN A test reads src/devops_cli/ai/tasks/roadmap_stage_change.md.
  • THEN The text holds a rule that names modified, a command or option removal or rename, and each base requirement that names the old name.

Requirement: A stale base requirement is refused

check_proposal SHALL return a problem when an ADDED requirement says a command or option MUST NOT exist and an unmodified base requirement names it.

Scenario: An added removal leaves a base requirement unchanged

  • WHEN A proposal adds a requirement that devops roadmap intake-eval MUST NOT exist, and the base texts hold an unmodified requirement that names it.
  • THEN check_proposal returns a problem that names devops roadmap intake-eval and that base requirement.

Requirement: A complete removal update is accepted

check_proposal SHALL return no stale-command problem when every base requirement that names a removed command or option is in modified and omits the name.

Scenario: The planner updates every stale requirement

  • WHEN A proposal adds a removal requirement for devops roadmap intake-eval and lists each base requirement that names it in modified with text that omits the name.
  • THEN check_proposal returns no problem about devops roadmap intake-eval.

Requirement: An option removal is checked

The stale-reference check SHALL treat an option such as --old in the same way as a command.

Scenario: An added requirement removes an option

  • WHEN A proposal adds a requirement that --old MUST NOT exist, and an unmodified base requirement names --old.
  • THEN check_proposal returns a problem that names --old.

Requirement: The check needs the base requirement texts

check_proposal SHALL run the stale-reference check only when the caller passes the base requirement texts.

Scenario: A caller passes no base texts

  • WHEN A proposal adds a requirement that devops roadmap intake-eval MUST NOT exist, and the caller passes no requirement_texts.
  • THEN check_proposal returns no problem about devops roadmap intake-eval.

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers a check of this repository's own spec delta. The project extends _spec_problems and check_proposal in src/devops_cli/roadmap/stage_change.py. Build cost: about 8,000 tokens and 1 hour.

Key questions

  • Does the reported contradiction still exist in the living spec at the staging commit?: No. openspec/specs/roadmap-intake-duplicates/spec.md names devops roadmap intake-eval only in the requirement that says it MUST NOT exist. The requirements that named it as a command to run now name devops roadmap eval intake. The check is still missing, so the change tests it against constructed base texts. [sources: openspec/specs/roadmap-intake-duplicates/spec.md, src/devops_cli/roadmap/stage_change.py]
  • Where does the stale-command check run?: Add the check to check_proposal in src/devops_cli/roadmap/stage_change.py. The stage job and the replay both call this function, so one rule covers both paths. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, docs/ROADMAP_WORKFLOW.md:275]
    • Chosen: Add the check to check_proposal. The stage job and the replay both call it, so one rule covers both paths.
    • Rejected: Add the check only to stage_eval_gates.py. The stage job would not refuse a bad reply before the replay.
    • Rejected: Add the rule only to the prompt. The model can ignore the rule, and no check stops the bad plan.
  • How does check_proposal read the base requirement texts?: Add an optional requirement_texts keyword to check_proposal. stage_specs.py fills it from the base specs. When the caller passes no texts, the check skips, so the replay keeps its inputs. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_specs.py, docs/ROADMAP_WORKFLOW.md:275]
    • Chosen: Add an optional requirement_texts keyword. It keeps requirements for names, and a caller with no texts skips the check.
    • Rejected: Change requirements to hold texts. It breaks the duplicate-name check and every caller.
    • Rejected: Read the specs inside check_proposal. The function gets no repository root, and the replay uses a thinned tree.
  • How does the check find a removed command or option?: Extract spans that start with devops or -- from an ADDED requirement whose text says MUST NOT or SHALL NOT. A small regular expression does the work, with no model call. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: A small regular expression. It is deterministic, offline and easy to test.
    • Rejected: A model call. The gate runs in the stage job and the replay with no model.
    • Rejected: A full CLI parser. It cannot read a prose requirement and adds no value.
  • Which base requirements must change?: Every base requirement that names the removed command or option must appear in modified, and its new text must omit the name. An unmodified requirement is a problem. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: Check the unmodified requirements and the new text. A modified text that keeps the old name still contradicts the removal.
    • Rejected: Check only the unmodified requirements. It misses a modified text that keeps the old name.
    • Rejected: Check only the modified requirements. It misses the original defect.
  • Should specs come first in _GROUPS?: Put specs first in _GROUPS in src/devops_cli/roadmap/stage_references.py. When the character budget runs out, the answer then keeps the spec file before the source file. (best practice) [sources: src/devops_cli/roadmap/stage_references.py]
    • Chosen: Put specs first. A reader sees the living spec of the command before its code, and the change is one line.
    • Rejected: Keep the current order. The answer lists source and test files before the living spec, which the issue asks to change.
    • Rejected: Detect a rename in the issue text. reference_answer receives no issue text, so it adds coupling and a new path to test.
  • What does the change say about the stage eval score?: The pull request states the replay score of the same model before and after, as docs/ROADMAP_WORKFLOW.md asks. The score does not move, because the check needs base texts that no case holds. (best practice) [sources: docs/ROADMAP_WORKFLOW.md:275, docs/ROADMAP_WORKFLOW.md:276]
    • Chosen: State the replay score before and after, with no new case. The check needs base texts that no case holds, so the score does not move.
    • Rejected: Add a golden-set case with gate none. It lowers the share of defects that a gate judges and covers nothing.
    • Rejected: Extend the case facts with base spec texts. The replay reads no code and no git, and the facts hold a thinned tree.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    type/bug
    scope/roadmap
    priority/p2-medium
    source/agent
    status/new
    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.

    • Priority: P2-Medium. Contradictory living specs are a correctness defect but do not block builds or expose security risks.
    • Value: Medium. Preventing contradictory spec requirements preserves the integrity of the living spec for all downstream consumers.
    • Effort: Medium. Three files change and a new validation rule is added, but the candidate estimates about 45 minutes of work.
    • Related: feat(roadmap): Add requirement text to the stage context #3246, which asks for a different change. Both address the #3228 contradictory-spec case, but #3246 adds requirement text to the stage context while the candidate adds a post-hoc validation check and a planner prompt update.
  3. added
    status/ready
    and removed
    status/new
    on Nov 3, 2026
  4. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    The stage job returned the item to New. The premise of the issue does not hold at the staging commit, so the job planned no change and opened no pull request.

    Evidence:

    placeholder

  6. added
    status/new
    and removed
    status/ready
    status/new
    on Nov 3, 2026
  7. 31 remaining items

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

    @devops-cli-service
    Contributor

    The runner Job devops-cli-runner-20261107-114512-bb94 ended: succeeded.
    Image digest: sha256:a12d8a3601a2f9803ba6a7f77fe19fdcc27a4de30944a1e65fc19d08808e9eff

    The last lines of its log:

    Tool call: shell, started: uv run devops ci docs
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops roadmap plan-check 3961 ...
    Tool call: shell, program uv, ok.
    Tool call: read_file, ok.
    Tool call: shell, started: git diff
    Tool call: shell, program git, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run devops ci test tests/commands/test_roadmap_plan_check_cmd.py
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run ruff check src/devops_cli/roadmap/plan_check.py tests/roadmap/test_roadmap_plan_check.py ...
    Tool call: shell, started: uv run devops openspec check
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: git grep -n <masked> -- src ...
    Tool call: shell, program git, ok.
    Tool call: shell, started: git status --porcelain
    Tool call: shell, program git, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_plan_recheck.py
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_plan_read.py
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_plan_check.py
    Tool call: shell, started: uv run mypy --strict src/devops_cli/roadmap/plan_check.py
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: read_file, ok.
    Tool call: read_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: edit_file, ok.
    Tool call: shell, started: uv run ruff check src/devops_cli/roadmap/plan_check.py tests/roadmap/test_roadmap_plan_check.py ...
    Tool call: shell, started: uv run devops ci test tests/roadmap/test_roadmap_plan_check.py
    Tool call: shell, program uv, ok.
    Tool call: shell, program uv, ok.
    Tool call: shell, started: uv run devops ci test tests/commands/test_roadmap_plan_check_cmd.py
    Tool call: shell, program uv, ok.
    ✓ Took 1 item(s) to a ready pull request, stopped 0.
    Elapsed: 1h 8m 14s
    
  9. removed
    owner/service
    on Nov 7, 2026
  10. removed
    status/in-review
    on Nov 7, 2026
  11. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-07 18:03 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/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