Skip to content

fix(roadmap): Use spec requirement names in staged criteria #3326

Closed as not planned

Description

@dan-petty

Problem Description

When devops roadmap stage constructs the ## Criteria section of tasks.md, it can fold raw multi-line markdown headings and scenario bodies from the issue refinement block into single-line strings (for example: ### Requirement: ... #### Scenario: ... : group 2). Additionally, the names of requirements in the criteria can diverge from the requirement titles declared in the spec delta (specs/.../spec.md).

Reproduction Steps

  1. Run devops roadmap stage <issue> on an issue where acceptance criteria contain markdown headings or scenarios.
  2. Inspect openspec/changes/<issue>-<slug>/tasks.md.
  3. Observe single-line folded headings and scenario text under ## Criteria instead of clean requirement names.

Expected vs Actual Behavior

Expected: Each line in ## Criteria cleanly names the requirement and its group (for example: - The sandbox deploy tool publishes no env parameter: group 2).
Actual: Markdown headings and scenario bodies are collapsed into long, unformatted single lines.

Environment Diagnostics

  • DevOps CLI Version: 0.48.3
  • Python Version: 3.14.10
  • OS & Architecture: Linux x86_64
  • Execution Environment: DevContainer

Logs, Traces, or Terminal Output

## Criteria

- ### Requirement: Sandbox deploy omits env The `sandbox_deploy` MCP tool SHALL not publish the `env` parameter. #### Scenario: Published sandbox deploy schema - **WHEN** The test generates the MCP tools and reads the schema of `sandbox_deploy`. - **THEN** The schema has no `env` property.: group 2

Source: #3283

Alternatives check of 2026-11-06: partly.
Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-05, maintained.

Proposed design

Problem statement

devops roadmap stage accepts a criteria entry that matches no acceptance criterion of the issue. The command writes that entry into ## Criteria in tasks.md as one folded line. A pasted heading or scenario body then reaches the change. The stage proposal check must refuse such an entry and name it. The lines keep the issue's acceptance criteria as an exact copy, as #3019 requires.

Acceptance criteria

Requirement: Unmatched criteria entry is refused

The stage proposal check SHALL report a criteria problem when a criteria entry matches no acceptance criterion of the issue.

Scenario: Pasted requirement heading

  • WHEN The refine block gives a criteria entry that is a pasted ### Requirement: ... block, and no acceptance criterion of the issue has that text.
  • THEN criterion_problems returns one problem, and check_gates reports it under ProposalGate.CRITERIA.

Requirement: Exact copy passes

The stage proposal check SHALL accept a criteria entry whose text equals one acceptance criterion of the issue character for character.

Scenario: Criterion copied from the issue

  • WHEN The refine block gives a criteria entry that copies one acceptance criterion of the issue character for character.
  • THEN criterion_problems returns no problem for that entry.

Requirement: Problem names the entry

The criteria problem MUST hold the text of the unmatched criteria entry.

Scenario: Message content

  • WHEN The stage proposal check refuses an unmatched criteria entry.
  • THEN The problem text holds the text of that entry.

Existing Tool Considered

OpenSpec (https://github.com/Fission-AI/OpenSpec), MIT, last activity 2026-11-05, maintained, and recorded as the project's spec and change-proposal layer by docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md. The alternatives check gives it partly. It covers the spec and change layer. It owns the spec delta with the requirement titles and the #### Scenario: blocks, and it validates them. It lacks three things. It does not build the ## Criteria section of tasks.md. It does not map a requirement to its group. It does not reconcile a criterion name against a requirement title, and it does not refuse a criteria entry that matches no acceptance criterion of the issue. That mapping and check stay in devops roadmap stage.

Key questions

  • Should the ## Criteria lines name the spec delta requirement titles instead of the issue's acceptance criteria?: No. Keep the exact copy. criterion_problems matches each criteria entry against the issue's acceptance criteria by equal text after the same whitespace collapse (feat(roadmap): the stage job maps each acceptance criterion of the issue to a task group #3019). A requirement title breaks that match. Refuse an entry that matches no acceptance criterion. Then no pasted heading reaches ## Criteria. (best practice) [sources: openspec/changes/archive/2026-11-02-3019-the-stage-job-maps-each-acceptance/design.md, src/devops_cli/roadmap/stage_criteria.py:89, openspec/changes/3328-the-stage-probe-checks-prompt-reply/design.md]
  • Where does the check for an unmatched criteria entry belong?: In criterion_problems in src/devops_cli/roadmap/stage_criteria.py, next to the missing-entry check. check_gates already routes that function under ProposalGate.CRITERIA (src/devops_cli/roadmap/stage_change.py:907). Add one message under the criteria gate in src/devops_cli/lang/en/messages.py. One function then keeps one source of truth for the match. (best practice) [sources: src/devops_cli/roadmap/stage_criteria.py:89, src/devops_cli/roadmap/stage_change.py:907, src/devops_cli/lang/en/messages.py:3539, openspec/changes/3328-the-stage-probe-checks-prompt-reply/design.md]
    • Chosen: Extend criterion_problems. It already holds the exact-text match against the issue criteria.
    • Rejected: Add a new check in stage_change.py. It splits the match logic across two modules and reads the criterion list twice.
    • Rejected: Add an instruction to the stage prompt only. A prompt gives no enforcement, so the entry can still be accepted.
  • Does the fold of a multi-line entry into one line need a change?: No. The check refuses an entry that is no acceptance criterion. A pasted heading or scenario body then never reaches the fold. Keep the one-line fold and the fixed Group <n>: prefix, which fix(roadmap): the stage renders a verify command that the implement step does not read #3262 and fix(roadmap): a text of the plan cannot add a group or a section #3289 designed. (best practice) [sources: src/devops_cli/roadmap/stage_change.py:1170, src/devops_cli/lang/en/messages.py:3558, tests/roadmap/test_roadmap_stage_text_lines.py:149, CHANGELOG.md:710]
    • Chosen: Keep the one-line fold. Each criterion is one line of the issue, the line starts with a fixed word, and the refused entry never reaches the fold.
    • Rejected: Render the entry as markdown. It writes headings into a list of criteria and reverses the one-line design.
  • Which open, maintained tool or library covers the need?: OpenSpec (https://github.com/Fission-AI/OpenSpec) is the project's recorded spec and change-proposal layer (ADR 0010). It covers the spec and change layer: it owns the spec delta with the requirement titles and the #### Scenario: blocks, and it validates them. It does not build ## Criteria, map a requirement to its group, or refuse a criteria entry that matches no acceptance criterion of the issue. That mapping and check stay in devops roadmap stage. (best practice) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]
    • Chosen: Use OpenSpec for the spec layer and keep the criteria mapping and check in devops roadmap stage. ADR 0010 records OpenSpec as the one spec and change-proposal layer, and OpenSpec does not build the ## Criteria section or match a criterion against the issue.
    • Rejected: Build a spec-delta parser in the roadmap command. ADR 0010 makes OpenSpec the spec layer, so a second parser adds code to keep that the tool already covers.

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/low
    on Nov 3, 2026
  2. dan-petty commented on Nov 3, 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.
    • Value: Medium.
    • Effort: Low.
  3. added
    priority/p2-medium
    on Nov 3, 2026
  4. devops-cli-service commented on Nov 3, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at 7df9244 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. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Alternatives check: partly

    Tool: Fission-AI/OpenSpec (https://github.com/Fission-AI/OpenSpec)

    • License: MIT
    • Last activity: 2026-11-05
    • Maintained: yes

    Covers:

    • OpenSpec is the spec and change-proposal layer that owns the spec delta (specs/<capability>/spec.md), so the canonical requirement titles and #### Scenario: blocks that the criteria should name come from it rather than from re-parsing raw markdown in the roadmap command.
    • It parses and validates those deltas, so a heading or scenario that does not follow the spec format is caught at the spec layer instead of being folded into a one-line string.
    • It already provides the change folder (openspec/changes/<issue>-<slug>/) whose tasks.md the stage command writes, so the criteria can be derived from the same records.

    Lacks:

    • It does not build the ## Criteria section of tasks.md: mapping each requirement to its group (for example : group 2) stays in devops roadmap stage.
    • The folding of multi-line markdown headings and scenario bodies into one line comes from the roadmap command's own markdown handling, which this library does not replace.
    • It does not reconcile divergent criteria names against the requirement titles of the delta; that comparison is still the issue's work.

    Searches run:

    • OpenSpec CLI show --json requirements spec delta
    • Fission-AI OpenSpec tool parse spec.md requirement headers
    • OpenSpec CLI "openspec show" json requirements
    • OpenSpec spec driven development CLI
    • openspec cli
    • markdown requirement parser python
    • openspec validate show requirements as json
    • openspec instructions json requirements
    • openspec github spec delta

    Sources:

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

  6. changed the title [-]fix(roadmap): stage formats criteria names from canonical spec requirements[/-] [+]fix(roadmap): Use spec requirement names in staged criteria[/+] on Nov 6, 2026
  7. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

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

    • Before: fix(roadmap): stage formats criteria names from canonical spec requirements
    • After: fix(roadmap): Use spec requirement names in staged criteria
    • Source of the summary: the background model
  8. dan-petty commented on Nov 6, 2026

    @dan-petty
    OwnerAuthor

    Returned to New under AGENTS.md rule 2: the item cannot be built as written. Two reviewers read the code of origin/main on 2026-11-06 and agreed.

    Evidence

    The reported fold is the designed behavior since PR #3289 (41929c3, 2026-11-02): criteria_section writes Group {n}: {criterion} with the criterion folded to one line (stage_change.py:1165-1180, messages.py:3479). The issue log shows the old format ...: group 2. The expected output (a short requirement name) conflicts with the rule of #3019/#3180: a criterion is the issue's list item copied character for character, and criterion_problems matches it by equal text (stage_criteria.py:1-14, :89-115; prompt roadmap_stage_change.md line 44). A requirement title would break that match. The prompt already says to give no entry for the list in the refine block. What is still true: a probe shows that an entry that matches no issue criterion (for example a pasted ### Requirement ... block) is accepted and rendered as one long line, because criterion_problems checks only missing entries, not extra ones.

    Re-scope for refinement

    As written ('name criteria from the spec requirement titles') it cannot be built without breaking the exact-copy match that #3019 built. The folding is the output of #3289. Re-scope to the real gap: refuse a criteria entry whose text is not an acceptance criterion of the issue (a small addition to criterion_problems in stage_criteria.py, with a ProposalGate.CRITERIA message). Return to New with this evidence and the re-scope; a person or the refine job restates the issue (the body has no problem statement or criteria).

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

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at c714551 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.

    • Which open, maintained tool or library covers the need? (missing verified source)
  10. added
    status/ready
    and removed
    status/new
    on Nov 7, 2026
  11. devops-cli-service commented on Nov 7, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Staged: branch fix/3326-use-spec-requirement-names-in-staged, draft pull request #4122. 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 64000 tokens:

    1. Give the paths gate the issue body of a mapped plan: 25886 tokens
    2. Refuse a criteria entry that no person wrote: 31151 tokens
    3. State the refusal in the stage prompt: 25328 tokens

    The runs of the planner and the review made 65 model request(s), and used 4882991 input tokens and 85576 output tokens. The tool calls, in order:

    1. read_file({"path":"src/devops_cli/roadmap/stage/stage_criteria.py"})
    2. read_spec({"capability":"roadmap-stage","requirement":"An unmapped criterion is refused"})
    3. list_files({"directory":"src/devops_cli/roadmap/stage"})
    4. list_files({"directory":"tests/roadmap/stage"})
    5. read_file({"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":170,"end_line":400})
    6. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_criteria.py"})
    7. search_code({"text":"stage_problem_criterion"})
    8. search_code({"text":"## Criteria"})
    9. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/proposal.md"})
    10. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/tasks.md"})
    11. read_issue({"number":3391})
    12. read_issue({"number":3326})
    13. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/specs/roadmap-stage/spec.md"})
    14. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/design.md"})
    15. read_file({"path":"src/devops_cli/lang/en/messages.py","start_line":3630,"end_line":3680})
    16. search_code({"text":"criterion_problems("})
    17. read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_gates.py"})
    18. read_file({"end_line":260,"path":"src/devops_cli/roadmap/stage/stage_eval_gates.py","start_line":150})
    19. read_file({"end_line":1210,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1100})
    20. git_log({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the"})
    21. find_issues({"terms":"criteria entry"})
    22. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_text_lines.py","start_line":120,"end_line":170})
    23. read_issue({"number":4081})
    24. read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md"})
    25. read_file({"path":"src/devops_cli/roadmap/plan_check.py","start_line":340,"end_line":410})
    26. search_code({"text":"criteria"})
    27. search_code({"text":"An issue with no such list gets an empty list"})
    28. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_prompt_rules.py","start_line":1,"end_line":80})
    29. read_spec({"capability":"roadmap-stage","requirement":"The replay judges the criteria gate on plans with a criteria list"})
    30. search_code({"text":"def _self_acceptance_problems"})
    31. read_file({"end_line":900,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":820})
    32. search_code({"text":"CONST_ROADMAP_REFINE_START_MARKER: Final"})
    33. search_code({"text":"def criteria_section"})
    34. read_file({"end_line":1570,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1544})
    35. read_file({"end_line":3056,"path":"src/devops_cli/config/constants.py","start_line":3046})
    36. read_file({"end_line":330,"path":"tests/roadmap/stage/test_roadmap_stage_eval_gates.py","start_line":270})
    37. search_code({"text":"def _with_criteria"})
    38. references({"name":"unmapped criterion"})
    39. read_file({"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":180,"end_line":420})
    40. list_files({"directory":"src/devops_cli/roadmap/stage"})
    41. search_code({"text":"_path_gate"})
    42. search_code({"text":"issue_body"})
    43. read_file({"path":"src/devops_cli/roadmap/stage/stage_eval_gates.py","start_line":140,"end_line":260})
    44. read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":860,"end_line":960})
    45. read_file({"path":"tests/roadmap/stage/test_roadmap_stage_eval_gates.py","start_line":240,"end_line":420})
    46. search_code({"text":"def check_proposal"})
    47. search_code({"text":"stage_problem_criterion"})
    48. read_file({"end_line":1300,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1195})
    49. read_file({"end_line":3680,"path":"src/devops_cli/lang/en/messages.py","start_line":3630})
    50. read_file({"path":"src/devops_cli/roadmap/stage/stage_criteria.py","start_line":30,"end_line":60})
    51. read_file({"path":"src/devops_cli/config/constants.py","start_line":3040,"end_line":3060})
    52. search_code({"text":"def criteria_section"})
    53. read_file({"path":"src/devops_cli/ai/tasks/roadmap_stage_change.md","start_line":35,"end_line":70})
    54. list_files({"directory":"openspec/changes/3391-refuse-criteria-entries-not-in-the"})
    55. find_issues({"terms":"criteria entry"})
    56. list_files({"directory":"openspec/changes/3391-refuse-criteria-entries-not-in-the/specs"})
    57. read_issue({"number":3391})
    58. read_spec({"capability":"roadmap-stage"})
    59. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/specs/roadmap-stage/spec.md"})
    60. read_spec({"capability":"roadmap-stage","requirement":"The replay judges the criteria gate on plans with a criteria list"})
    61. read_spec({"capability":"roadmap-stage","requirement":"An unmapped criterion is refused"})
    62. search_code({"text":"stage_criteria_line"})
    63. search_code({"text":"criteria_section"})
    64. read_file({"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1535,"end_line":1585})
    65. search_code({"text":"def _criteria"})
    66. search_code({"text":"stage_criteria_line|Group \\{group\\}"})
    67. read_file({"end_line":470,"path":"src/devops_cli/roadmap/plan_read.py","start_line":400})
    68. search_code({"text":"\"criteria\""})
    69. search_code({"text":"two active changes"})
    70. search_code({"text":"never modify"})
    71. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/design.md"})
    72. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/proposal.md"})
    73. read_issue({"number":4081})
    74. read_issue({"number":3326})
    75. read_issue({"number":4069})
    76. read_file({"end_line":1200,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":1130})
    77. search_code({"text":"\"verdict\": \"good\""})
    78. search_code({"text":"def _gate_problems"})
    79. search_code({"text":"_one_line"})
    80. read_file({"path":"tests/fixtures/roadmap_eval/stage/3173-a-plan-for-an-alert-rule/case.json"})
    81. read_file({"path":"tests/fixtures/roadmap_eval/stage/3247-a-plan-that-changes-security-md/case.json"})
    82. read_file({"end_line":420,"path":"src/devops_cli/roadmap/stage/stage_eval_gates.py","start_line":255})
    83. read_file({"end_line":420,"path":"src/devops_cli/roadmap/plan_check.py","start_line":340})
    84. search_code({"text":"An unmatched criteria entry"})
    85. search_code({"text":"paths gate reads the body"})
    86. find_issues({"terms":"3391"})
    87. read_file({"end_line":870,"path":"src/devops_cli/roadmap/stage/stage_change.py","start_line":790})
    88. search_code({"text":"_PLAN_CHECK_FILE"})
    89. search_code({"text":"PROMPT_RULE_TEST"})
    90. git_log({"path":"src/devops_cli/roadmap/stage/stage_criteria.py"})
    91. git_log({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the"})
    92. search_code({"text":"3326"})
    93. search_code({"text":"is no file at the root of the staging commit"})
    94. search_code({"text":"These files of the commit are candidates"})
    95. search_code({"text":"_gate_problems("})
    96. read_file({"end_line":540,"path":"src/devops_cli/roadmap/plan_check.py","start_line":480})
    97. read_file({"path":"openspec/changes/3391-refuse-criteria-entries-not-in-the/tasks.md"})
    98. find_issues({"terms":"3180"})
    99. search_code({"text":"#3180"})
    100. search_code({"text":"check_proposal("})
    101. search_code({"text":"criteria"})
    102. callers({"symbol":"criterion_problems"})
    103. read_file({"end_line":165,"path":"tests/roadmap/stage/test_roadmap_stage_text_lines.py","start_line":110})
    104. search_code({"text":"issue_body="})
    105. read_file({"end_line":2330,"path":"tests/roadmap/stage/test_roadmap_stage_plan.py","start_line":2195})
    106. search_code({"text":"## Criteria"})
    107. read_file({"end_line":120,"path":"src/devops_cli/roadmap/stage/stage_constants.py","start_line":1})

    Tool calls: callers=1 (empty=0), find_issues=4 (empty=0), git_log=3 (empty=0), list_files=5 (empty=0), read_file=44 (empty=0), read_issue=7 (empty=0), read_spec=5 (empty=0), references=1 (empty=0), search_code=37 (empty=2)

    The stage job read the open pull requests and their files in 1 GraphQL request(s).

  13. dan-petty commented on Nov 8, 2026

    @dan-petty
    OwnerAuthor

    This issue is closed as not planned.

    1. The requested change cannot be built as written. Rule 2 of AGENTS.md specifies that no compensating code must be written. Acceptance criteria must copy the text that a person wrote in the issue body character for character, as required by feat(roadmap): the stage job maps each acceptance criterion of the issue to a task group #3019 and feat(roadmap): map each acceptance criterion to a group #3180.
    2. The underlying defect (folded headings and scenario text from refine blocks reaching tasks.md) is resolved by issue fix(roadmap): Refuse criteria entries not in the issue body #3391 and change openspec/changes/3391-refuse-criteria-entries-not-in-the/ on main.
    3. Pull request docs(openspec): plan #3326 Refuse criteria entries no person wrote #4122 is closed because it duplicated the tasks of fix(roadmap): Refuse criteria entries not in the issue body #3391 and added duplicate requirements to circumvent ADR 0010.
  14. removed
    status/ready
    on Nov 8, 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/lowpriority/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