Repository navigation
Description
Problem
stage_criteria.py maps each item of an Acceptance criteria list to a group (#3180). An issue also holds other requirements: "What should happen" bullets, a named caller, a named file. A plan that drops one is not caught. Evidence from 2026-11-02:
- docs(openspec): plan #2916 One function decides draft readiness #3170: the plan dropped a caller (
devops pr ready) that the issue body names. - docs(openspec): plan #2777 Label the stage and implement pull requests #3169: the issue text hid a read of the old state (title and held labels) before the update, and the plan had no task for it.
- docs(openspec): plan #2947 Raise the alternatives first-pass limit to 20 #3174: the refine block of the issue said that the setting lives in
configmap.example.yaml, which has no such key. - docs(openspec): plan #2919 stuck-item age metrics and alert #3171: a design claim (the threshold as a setting) had no task, and a spec requirement had no data path (the item number in the message).
- docs(openspec): plan #2916 One function decides draft readiness #3170: a scenario had no mechanism that a test can produce ("when its author says so").
Proposed change
- Extract the other requirement lines of the issue (bullets under the refined sections, and each named path, command or caller) into a list in the context, with an ID.
- Require
## Criteria(or a new## Coveragepart) to map each ID to a group or to a stated reason, as for the acceptance criteria. - Add a check that a design decision (a line that starts with "Decision" or a numbered choice) has a task that names it, and that a scenario's
WHENclause names an input a test can set. - The model verification pass receives the list.
Acceptance criteria
- A test shows that a plan that omits a named caller of the issue is refused with the caller named.
- A test shows that a plan that maps every line passes.
- The extraction and mapping are in the same module as the acceptance-criteria code, and the prompt is updated (test(roadmap): check the planner prompt against its rules #3210 test passes).
- A replay case from docs(openspec): plan #2916 One function decides draft readiness #3170 or docs(openspec): plan #2777 Label the stage and implement pull requests #3169 is in the golden set.
Related: #3180, #3182, #3200, #3246.
Dependencies
- chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
Proposed design
Problem statement
The staging planner maps only the acceptance criteria of an issue to task groups. A plan can drop other requirement lines: a named caller, a path, a command, a design decision. The change extracts these lines into the plan context with stable IDs. The plan must map each ID to a group or to a stated reason. The validator refuses a plan that leaves one out.
Acceptance criteria
Requirement: Requirement extraction
The staging context builder SHALL list each requirement line of the issue body with a stable ID.
Scenario: Named caller is listed
- WHEN An issue body names
devops pr readyin a bullet under a refined section. - THEN The context holds a requirement with kind
command, textdevops pr readyand IDREQ-001.
Requirement: Coverage mapping
The plan validator SHALL refuse a plan that gives no coverage entry for an extracted requirement ID.
Scenario: Unmapped requirement is refused
- WHEN The issue holds three requirement lines and the plan gives coverage for two.
- THEN Validation returns one problem that names
REQ-003and its text.
Requirement: Omitted caller
The plan validator MUST name the omitted caller in the error of a refused plan.
Scenario: Omitted caller is named
- WHEN The issue names
devops pr readyand the plan gives no coverage entry for its ID. - THEN The error message holds
devops pr ready.
Requirement: Complete coverage
The plan validator SHALL accept a plan that gives a group number or a stated reason for each requirement ID.
Scenario: Full coverage passes
- WHEN The plan gives a coverage entry for every extracted ID.
- THEN No coverage problem is returned.
Requirement: Decision line coverage
The plan validator SHALL refuse a plan that gives no coverage entry for a Decision: line of the issue.
Scenario: Decision without coverage is refused
- WHEN The issue holds the line
Decision: use a stable IDand the plan gives no coverage entry for it. - THEN Validation returns a problem that quotes
Decision: use a stable ID.
Requirement: Scenario WHEN input
The plan validator SHALL refuse a scenario whose WHEN clause names a person's intent and no settable input.
Scenario: Vague WHEN is refused
- WHEN A spec delta scenario has the WHEN clause
its author says so. - THEN Validation returns a problem that quotes
its author says so.
Requirement: Coverage line in tasks
The change renderer SHALL list each requirement ID with its group or its reason in the ## Criteria section of tasks.md.
Scenario: Coverage line is rendered
- WHEN The plan gives coverage for
REQ-001with group 1. - THEN
tasks.mdholds one line that starts withREQ-001and names group 1.
Requirement: Split keeps coverage
The split reply SHALL carry the coverage list with the new group numbers.
Scenario: Split renumbers coverage
- WHEN A plan over the budget is split and the reply gives group 2 for
REQ-001. - THEN
tasks.mdnames group 2 forREQ-001.
Requirement: Prompt names the coverage key
The stage prompt SHALL name the coverage key and the requirement IDs.
Scenario: Prompt holds the coverage key
- WHEN The
roadmap_stage_changeprompt is loaded. - THEN It holds
coverageandREQ-.
Existing Tool Considered
No alternatives check has run. markdown-it-py parses the issue body and OpenSpec checks the shape of a spec delta. Neither one maps the task groups of a plan to the requirement lines of an issue. The change builds that mapping in stage_criteria.py: about 45,000 tokens to build, 12,000 tokens per year to keep, 8,000 tokens to fix until stable, and about 3 engineer-days.
Key questions
- Does the stage return text
placeholderstate why the premise fails?: No. The repository countsplaceholderas a filler text, and the plan schema has nopremise_failedkey, so the return gives no evidence. [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/roadmap/stage_change.py] - Where does the extracted requirement list live, and how do its IDs form?: A
requirementslist in the plan context and in the reply. The IDs areREQ-001,REQ-002in source order. Each item holdsid,kind,textandsource_line. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_criteria.py, tests/roadmap/test_roadmap_stage_plan.py]- Chosen: Structured context list with deterministic IDs. It gives the plan and the validator one stable key, and a test asserts it offline.
- Rejected: Free text in the prompt only. The validator cannot name a missing requirement without a stable key.
- Rejected: Parse the issue again in the validator. It duplicates the extraction and can give a different result.
- Which issue lines count as a requirement, and which
kinddoes each get?: Each bullet under a refined section, each backticked repository path, each backtickeddevopscommand, and eachDecision:line. The kinds arebullet,path,commandanddecision. The acceptance-criteria list, the headings and the job record are left out. (best practice) [sources: src/devops_cli/roadmap/stage_criteria.py, tests/roadmap/test_roadmap_stage_text_lines.py]- Chosen: Deterministic Markdown and token scan. It is testable offline and it matches the examples of the issue.
- Rejected: Model extraction. It is not deterministic and it adds a model call to every plan.
- Rejected: Bullets only. It misses the named callers, paths and commands that the issue cites.
- Where does the plan map each requirement ID?: In the existing
## Criteriasection oftasks.md, from a newcoveragelist in the reply. The reply gives a group number orpending-personwith a reason for each ID. (best practice) [sources: tests/roadmap/test_roadmap_stage_plan.py, src/devops_cli/roadmap/stage_criteria.py]- Chosen: Extend the existing
## Criteriasection. The plan already holds the acceptance-criteria map there, so one section keeps the check and the reader in one place. - Rejected: Add a new
## Coveragesection. It adds a second place to keep in sync and a second parser path.
- Chosen: Extend the existing
- How does the validator decide that a scenario WHEN clause names no settable input?: It refuses a clause that holds a phrase of a person's intent (
says so,decides,wants,approves) and no backticked literal, path or value. It accepts every other clause. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_specs.py]- Chosen: Refuse a person-intent phrase with no settable input. It refuses the
when its author says socase and it refuses no clause that names a value, a path or a literal. - Rejected: Refuse every clause with no backticked literal. It refuses valid clauses that name a state, such as
a plan maps every extracted ID. - Rejected: Model judgement. It is not deterministic and it cannot be a gate.
- Chosen: Refuse a person-intent phrase with no settable input. It refuses the
- Which module holds the extraction and the mapping?:
stage_criteria.py, next to the acceptance-criteria code, so the plan check and the validator read one function. (best practice) [sources: src/devops_cli/roadmap/stage_criteria.py, src/devops_cli/roadmap/stage_change.py]- Chosen: Extend
stage_criteria.py. It reuses the heading and list parse and the cut of the refine block that the module already has. - Rejected: A new module. It splits one issue-body parse over two modules and adds an import cycle risk.
- Chosen: Extend
- Does the split reply carry the coverage list?: Yes.
StageSplitholds thecoveragelist again, as it holdscriteria, because a split moves the group numbers. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_plan.py]- Chosen: The split reply gives the list again. The group numbers change in a split, and a stale number maps a requirement to the wrong group.
- Rejected: Keep the numbers of the first reply. A split renumbers the groups, so the old numbers name other groups.
- Which open, maintained tool covers the extraction and the mapping?: markdown-it-py parses the body and OpenSpec checks the spec-delta shape. Neither maps plan groups to issue requirements, so the mapping stays in
stage_criteria.py. (best practice) [sources: src/devops_cli/roadmap/stage_criteria.py, tests/support/openspec_scenarios.py]- Chosen: Extend the roadmap code with markdown-it-py. markdown-it-py is already a dependency of the module and it gives the token stream that the extraction needs.
- Rejected: Add an external coverage library. No maintained library covers issue-to-plan coverage, and a new dependency adds cost.
- Rejected: Use OpenSpec alone. OpenSpec checks a spec delta, not the coverage of the issue lines by a plan.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-06: partly.
Tool: itsallcode/openfasttrace (https://github.com/itsallcode/openfasttrace), GPL-3.0, last activity 2026-11-01, maintained.
Activity
devops-cli-service commentedon Nov 2, 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 improves plan completeness but does not block a release or fix a critical defect.Plans that drop a named caller or design decision cause rework, so broader coverage has real user value.Requires new extraction logic, a mapping check, prompt updates, and golden-set replay tests.Both map issue requirements to task groups, but #3019 covers only acceptance criteria while the candidate adds other bullets, named callers, design decisions, and scenario checks.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at 8b47ae2 (see proposed design in issue body).
devops-cli-service commentedon Nov 2, 2026
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
9 remaining items
wip: 2 of 2 tasks of group 1, Extract the requirement lines of the is…
devops-cli-service commentedon Nov 7, 2026
Stopped at group 1.
Failure class:
limit_reached.Action taken: none.
Action left:
raise_limit: raise the limit that the run went over.Reason:
Last message of the agent (a claim that no check verified): Now I'll implement
RequirementLineandrequirement_lines.The item is Blocked, and the job will not run it. Fix the cause. Then comment
implement: retry. The Service clears the stop on its own when a new runner image rolls out, but only if a retry can fix the class of the stop and the limits ofroadmap.implement.digest_clears_per_classandroadmap.implement.digest_clears_per_itemallow it.The job kept 2 work-in-progress commits on the branch
feat/3253-map-all-issue-requirements-to-aon origin. The last is03b5eeb6687acd374ebd37170567a00e639d1d1f. The job discarded only the work after it. The next run continues from it and does the tasks that are not ticked.devops-cli-service commentedon Nov 7, 2026
The runner Job devops-cli-runner-20261107-184136-051a ended: succeeded.
Image digest: sha256:9a1af5a95b44197c2568d011d53c1b9a84748cf35f9721e302fe56d860d9ae06
The last lines of its log:
docs(openspec): plan #3253 Map each issue requirement to a group
feat(roadmap): Extract the requirement lines of the issue (#3253)
docs(openspec): plan #3253 Map each issue requirement to a group (#4035)
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
dan-petty commentedon Nov 30, 2026
Triage under #6519 (owner instruction of 2026-11-30). This item adds or extends a hand-written gate, refusal, context block or plan-shape rule of the stage or implement job. #6519 found that 263 of about 900 issues in four weeks added gates and none replaced the engine; stage now runs on stock Coder, where the agent reads the repository itself and runs the OpenSpec checks in its loop. The code paths that this item names have also moved (for example
src/devops_cli/roadmap/stage/stage_change.py). If the failure class still shows in graded attempts (plan_defect), file a new item from that evidence. Closed as not planned.