Repository navigation
Description
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.mdfor phrase pairs declared for_SHAREDor 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.mdholds 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_problemsreturns 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.mdholdsfrom references or from a probe lineandtasks.mddeclaresfrom a tool of the plan run or from a probe line - THEN
phrase_problemsreturns 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.mdfile holdsfrom references or from a probe line - THEN
phrase_problemsreturns 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-checkand one declared pair - THEN
phrase_problemsreturns 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
_SHAREDpair - THEN
phrase_problemsreturns 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.mdis 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_problemsinsrc/devops_cli/roadmap/plan_phrases.py.src/devops_cli/roadmap/plan_check.pycalls 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.mdthat 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
_SHAREDlist 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.
- Chosen: The pair code span in
- 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]
- Chosen: Share four consecutive words. The docs(openspec): plan #3304 Ask the plan for a count of a claimed set #3963 pair shares the five words
or from a probe line, so the check catches it. - Rejected: Exact equality only. The docs(openspec): plan #3304 Ask the plan for a count of a claimed set #3963 variant differs, so the check misses the defect.
- Rejected: Edit distance. It needs a threshold and more code for no better result.
- Chosen: Share four consecutive words. The docs(openspec): plan #3304 Ask the plan for a count of a claimed set #3963 pair shares the five words
- Which files of the change folder does the check read?:
proposal.md,tasks.mdand everyspecs/*/spec.mdof the change folder. (best practice) [sources: docs/roadmap/plan-recheck.md:15, docs/roadmap/plan-check.md:26]- Chosen: All three artifacts. The divergence of docs(openspec): plan #3304 Ask the plan for a count of a claimed set #3963 is between the tasks, and the spec scenarios can hold a variant too.
- Rejected:
tasks.mdonly. A variant in a proposal or a spec scenario stays hidden. - Rejected:
proposal.mdonly. A variant in a task stays hidden.
- 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
dan-petty commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.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.It prevents a known failure mode in prompt-rule plans and reduces manual review load, but it covers one specific error class.The body states roughly 4k tokens and 1 hour of elapsed time to build the check.Both concern the devops roadmap plan-check command, but 3201 created the command while the candidate adds a specific phrase-consistency check to it.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 447f024 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
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
_SHAREDpair format and ondevops roadmap plan-check, so it is project-specific. No ADR rejects a tool for this need.Tool: none found
Lacks:
_SHAREDpair form in tasks.mdSearches run:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Released in v0.147.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.147.0
devops-cli-service commentedon Nov 15, 2026
Live since 2026-11-15 01:03 UTC