Skip to content

feat(roadmap): check prompt and config phrase consistency in plan-check #4039

Closed

Description

@dan-petty

Problem or Motivation

When devops roadmap stage plans a change that updates prompt files and config rules (or adds phrase tests such as _SHARED in tests/roadmap/stage/test_roadmap_stage_prompt_rules.py), the planner can generate differing text variants across artifacts. For example, in PR #3963, Task 1.2 used from references or from a probe line while Task 1.1, Task 2.1, and _SHARED pinned from a tool of the plan run or from a probe line.

devops roadmap plan-check verifies token sizes and path existence, but does not check for internal consistency of quoted strings across proposal.md, tasks.md, and spec.md. The plan passes all static plan gates, but later fails when the implementation executes test_the_prompt_and_the_document_keep_the_same_phrase_of_a_rule.

Proposed Solution & Architectural Design

Add a consistency check in devops roadmap plan-check for plans that modify roadmap_stage_*.md and test_roadmap_stage_prompt_rules.py.

  • Scan tasks.md for phrase pairs declared for _SHARED or prompt tests.
  • Verify that tasks, proposal, and spec scenarios use the identical quoted character sequence.
  • Report any text divergence before the plan pull request merges.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

check_proposal and devops roadmap plan-check already validate proposal and change folder structure. No open tool checks cross-artifact phrase consistency within custom OpenSpec change folders. Building this check requires ~4k tokens and 1 hour of elapsed time.

Standards Compliance

  • I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
  • I am willing to submit a pull request implementing this feature with accompanying tests.

Proposed design

Problem statement

A plan can quote the same rule phrase with different text in tasks.md, proposal.md and the spec deltas. The static plan gates pass. The implementation then fails test_the_prompt_and_the_document_keep_the_same_phrase_of_a_rule. devops roadmap plan-check must report the divergence before the plan pull request merges.

Acceptance criteria

Requirement: Declared pair

plan-check SHALL take the phrase of each _SHARED pair that a change folder declares in tasks.md as a declared phrase.

Scenario: A declared pair gives no problem

  • WHEN tasks.md holds the code span ("openspec/config.yaml", "gives a count from a tool of the plan run or from a probe line") and no artifact quotes a variant of it
  • THEN phrase_problems returns an empty list.

Requirement: Divergent variant

plan-check SHALL report a problem when a code span of the change folder shares at least four consecutive words with a declared phrase and differs from it.

Scenario: The variant of PR #3963

  • WHEN proposal.md holds from references or from a probe line and tasks.md declares from a tool of the plan run or from a probe line
  • THEN phrase_problems returns one problem that names both spans.

Requirement: Spec delta

plan-check MUST read each spec delta of the change folder.

Scenario: A variant in a spec delta scenario

  • WHEN a scenario of a specs/*/spec.md file holds from references or from a probe line
  • THEN phrase_problems returns one problem that names that file.

Requirement: Unrelated span

plan-check SHALL report no problem for a code span that shares fewer than four consecutive words with every declared phrase.

Scenario: An unrelated code span

  • WHEN the change folder holds the code span devops roadmap plan-check and one declared pair
  • THEN phrase_problems returns an empty list.

Requirement: Command output

devops roadmap plan-check MUST print each phrase problem with the other problems.

Scenario: The command reports the divergence

  • WHEN the change folder holds a divergent variant
  • THEN the output holds the declared phrase, the divergent span and the path of the file.

Requirement: No pair

plan-check SHALL report no phrase problem for a change folder that declares no _SHARED pair.

Scenario: A plan with no phrase pair

  • WHEN the change folder holds no code span in the form of a _SHARED pair
  • THEN phrase_problems returns an empty list.

Requirement: Documentation

The page docs/roadmap/plan-check.md MUST name the phrase check with the stage gates.

Scenario: The page lists the check

  • WHEN the page docs/roadmap/plan-check.md is read
  • THEN it names the phrase check of the change folder.

Existing Tool Considered

No check has run. No open, maintained tool or library covers phrase consistency across the artifacts of an OpenSpec change folder. check_proposal and devops roadmap plan-check check paths and the spec delta, and neither compares quoted phrases. The written cost is about 4k tokens to build, keep and fix the check, and about 1 hour of elapsed time.

Key questions

  • Where does the phrase check live?: A new pure function phrase_problems in src/devops_cli/roadmap/plan_phrases.py. src/devops_cli/roadmap/plan_check.py calls it and prints its problems with the stage-gate problems. (best practice) [sources: src/devops_cli/roadmap/plan_check.py, docs/roadmap/plan-check.md:26, docs/ROADMAP_WORKFLOW.md:316]
    • Chosen: New module called by plan-check. The rule stays pure and easy to test. plan-check already prints the problems of the stage gates.
    • Rejected: Inside check_proposal. It obliges the plan to state the stage eval score before and after, and it enlarges this item.
    • Rejected: Inline in plan_check.py. It mixes the rule with the command, and the unit test must read files.
  • Which text declares a phrase pair?: The second quoted string of each code span in tasks.md that holds a pair of the form ("<document>", "<phrase>"). (best practice) [sources: openspec/changes/archive/2026-11-07-3304-add-a-set-count-to-every/tasks.md:16, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:443]
    • Chosen: The pair code span in tasks.md. The archived task holds the pair in that exact form, and the plan writes it.
    • Rejected: The _SHARED list of the test file at the staged commit. The change folder does not hold the new list, because the test file changes at implement time.
    • Rejected: Every code span of the change folder. It reports many spans that are no rule phrase, such as a command name.
  • How does the check tell a divergent variant from a different sentence?: A code span is a variant when it shares at least four consecutive words with a declared phrase and is not equal to it. (best practice) [sources: openspec/config.yaml, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:473]
  • Which files of the change folder does the check read?: proposal.md, tasks.md and every specs/*/spec.md of the change folder. (best practice) [sources: docs/roadmap/plan-recheck.md:15, docs/roadmap/plan-check.md:26]
  • Does the check run on every plan or only on a plan that changes the prompt or the phrase test?: Every plan. A plan that declares no pair gets no problem. (best practice) [sources: src/devops_cli/roadmap/plan_check.py]
    • Chosen: Every plan. It keeps no path list, and it catches a pair that names another document.
    • Rejected: A path gate on the prompt and the phrase test. It adds a second list to keep and to test.
  • What does a phrase problem name?: The declared phrase, the divergent span and the path of the file that holds the span. (best practice) [sources: docs/roadmap/plan-check.md:26]
    • Chosen: Both spans and the path. The author finds the divergent text and the fix at once.
    • Rejected: The pair only. The author must search the change folder for the variant.
    • Rejected: The file only. The author must compare the texts by hand.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 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 catches a recurring phrase-divergence error class that currently fails only at test-execution time, but it is one specific check, not a pipeline blocker.
    • Value: Medium. It prevents a known failure mode in prompt-rule plans and reduces manual review load, but it covers one specific error class.
    • Effort: Low. The body states roughly 4k tokens and 1 hour of elapsed time to build the check.
    • Related: feat(roadmap): add a plan-check command for a plan pull request #3201, which asks for a different change. Both concern the devops roadmap plan-check command, but 3201 created the command while the candidate adds a specific phrase-consistency check to it.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: Two searches found no open tool that compares quoted phrases across the proposal, tasks and spec deltas of an OpenSpec change folder. The results were generic Markdown and Docker pages. The check depends on this repo's _SHARED pair format and on devops roadmap plan-check, so it is project-specific. No ADR rejects a tool for this need.

    Tool: none found

    Lacks:

    • cross-artifact quoted-phrase consistency check
    • reading the _SHARED pair form in tasks.md
    • integration with devops roadmap plan-check

    Searches run:

    • check consistency of quoted strings across markdown files OpenSpec change proposal tasks spec lint, results: 5
    • OpenSpec validate change cross-artifact consistency analyze tool, results: 5

    Checked on 2026-11-10. 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 15, 2026
  8. removed
    status/in-review
    on Nov 15, 2026
  9. devops-cli-service commented on Nov 15, 2026

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

    @devops-cli-service
    Contributor

    Live since 2026-11-15 01: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/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