Repository navigation
Description
Friction
This is step 7 of 8 of the OpenSpec adoption decided in issue #1753 and docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md. After the switch, a plan's behavior is written as spec-delta requirements with scenarios (WHEN and THEN), but the in-cluster refine job still proposes acceptance criteria as {description, verification}. A person or agent has to translate every refined proposal into the shape the change folder takes, and refine says nothing about the question the project now asks of every plan.
AcceptanceCriterioninsrc/devops_cli/roadmap/refine.pyis{description, verification},check_readyrequires both to be non-empty, the renderer writes- Criterion N: ...with aVerification:line under "### Acceptance criteria", andsrc/devops_cli/ai/tasks/roadmap_refine_proposal.mdtells the model to reply with exactly those two keys.- AGENTS.md (Open Tools Before Internal Code, delivered by docs(agents): building internal code instead of using an open tool needs a written cost in tokens, maintenance, fixes and time #1833) and the feature request form require the existing open tool to be named, or the written cost of building instead. docs(agents): building internal code instead of using an open tool needs a written cost in tokens, maintenance, fixes and time #1833 left the refine prompts and the builder and reviewer briefs out, because asking it changes the structured reply of the refine job.
- The refine job writes
## Proposed designinto the issue and keeps its own prompt and reply schema until step 8. This step changes only the shape of the reply and the question it answers; it does not call OpenSpec.
Evidence
The ADR's Design (Readiness, closing and the roadmap jobs) assigns both changes to this step. The criteria shape is the one OpenSpec's spec delta takes (### Requirement: with #### Scenario: and WHEN/THEN lines), and the project's openspec/config.yaml (scaffold item) tells authors to write only scenarios a test under tests/ can assert offline. The existing-tool wording is the one in AGENTS.md and .github/ISSUE_TEMPLATE/feature_request.yml ("Existing Tool Considered": the tool and what it lacks, or the cost of building, which is the tokens to implement, maintain and fix until it matches the tool, plus the elapsed time).
Feasibility to confirm in the change's proposal: where the builder and reviewer briefs that #1833 names live (they are not under src/devops_cli/ai/tasks/ at the time of writing), and that the reply schema change reaches every reader of RefinementProposal.
Existing tool considered
The change reshapes an existing Pydantic reply model and prompts; no new machinery is built. Reading the reply back through OpenSpec (openspec validate --strict) is the next item. Nothing here duplicates an open tool.
The change
src/devops_cli/roadmap/refine.py:AcceptanceCriterionbecomes{requirement, when, then}(extra="forbid"kept), andcheck_readyrequires all three to be non-empty. The reply gains a field that carries the answer to the existing-tool question (the open tool and what it lacks, or the written cost of building), named in the proposal; whether an empty answer makes the item not ready is decided there, consistent with the feature request form, which requires the field.- The renderer of
## Proposed designwrites each criterion with OpenSpec's requirement, scenario, WHEN and THEN headings and wording, so the plan has the shape agents write into a spec delta, and renders the existing-tool answer under its own heading. src/devops_cli/ai/tasks/roadmap_refine_proposal.md: the reply keys arerequirement,whenandthenand the new field, in plain Markdown as the project requires for prompts. The existing-tool question is added to the refine prompts (roadmap_refine_proposal.mdandroadmap_refine_research.md, so research looks for the tool) and to the builder and reviewer briefs.devops docs generate --sync-readmefor any generated reference the change touches.
What it deletes
The description and verification keys of the criterion, their prompt text and the renderer's Criterion N and Verification: lines. No parser or alias for the old keys is kept (pre-1.0, no backwards compatibility).
Tests
tests/forrefine.py(the existing refine tests, found withgrep -rln "AcceptanceCriterion\|check_ready" tests): the model rejectsdescriptionorverification, accepts{requirement, when, then},check_readyfails on an empty field, and the rendered proposal contains the OpenSpec headings and WHEN/THEN wording and the existing-tool section.- A prompt test (the existing prompt loading tests use
load_task_prompt()) asserts the reply keys named inroadmap_refine_proposal.mdequal the model's fields, so the prompt and the schema cannot drift. - Tests double only process edges: no model call is made; the model's reply is a fixture.
Dependencies
Depends on the item titled "feat(sdlc): replace task files with OpenSpec change folders" (the switch), because the shape it renders is the one the change folder takes only after the switch.
Planning record: this item is planned as a change folder.
Acceptance criteria
- A refine reply with
{requirement, when, then}criteria and the existing-tool answer validates, and a reply with the old keys is rejected. - The proposal written into the issue shows requirements, scenarios with WHEN and THEN, and the existing-tool answer.
- The refine prompts and the builder and reviewer briefs ask the existing-tool question, and the prompt's reply keys equal the model's fields.
- No reference to
descriptionorverificationas criterion keys remains insrc/, prompts or tests. devops cipasses.
Proposed design
Problem statement
The refine job proposes acceptance criteria as {description, verification}, but after the OpenSpec switch the plan's behavior is written as spec-delta requirements with WHEN and THEN scenarios. A person or agent must translate every refined proposal into the shape the change folder takes. The refine job also does not ask the existing-tool question that AGENTS.md and the feature request form require of every plan. This step changes the criterion shape to {requirement, when, then}, adds the existing-tool answer to the reply, updates the prompts and briefs, and renders OpenSpec headings in the proposal written into the issue.
Acceptance criteria
- Criterion 1: A refine reply with {requirement, when, then} criteria and the existing-tool answer validates, and a reply with the old description or verification keys is rejected.
Verification: Run the refine model tests: a fixture reply with {requirement, when, then} passes Pydantic validation; a fixture with description or verification raises a validation error. - Criterion 2: The proposal rendered into the issue shows each criterion with OpenSpec Requirement, Scenario, WHEN and THEN headings, and the existing-tool answer under its own heading.
Verification: Run the renderer test: the output of render_proposal_section contains '### Requirement', '#### Scenario', 'WHEN', 'THEN' and the existing-tool section heading for a valid proposal fixture. - Criterion 3: The refine prompts (roadmap_refine_proposal.md and roadmap_refine_research.md) and the builder and reviewer briefs ask the existing-tool question, and the prompt's reply keys equal the model's fields.
Verification: Run the prompt-loading test: the keys named in roadmap_refine_proposal.md equal the fields of RefinementProposal and AcceptanceCriterion; grep the briefs for the existing-tool question text. - Criterion 4: No reference to description or verification as criterion keys remains in src/, prompts or tests.
Verification: Run grep -rn 'description|verification' src/devops_cli/roadmap/refine.py src/devops_cli/ai/tasks/ tests/ and confirm no hit names them as AcceptanceCriterion fields. - Criterion 5: devops ci passes.
Verification: Run uv run devops ci and confirm all checks report passing status.
Key questions
- Where do the builder and reviewer briefs that docs(agents): building internal code instead of using an open tool needs a written cost in tokens, maintenance, fixes and time #1833 names live?: They are not under src/devops_cli/ai/tasks/ per the issue body. The ADR states docs(agents): building internal code instead of using an open tool needs a written cost in tokens, maintenance, fixes and time #1833 left them out because adding the question changes the refine reply schema. Their exact paths must be located during implementation. [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]
- Does the reply schema change reach every reader of RefinementProposal?: RefinementProposal is defined and consumed within src/devops_cli/roadmap/refine.py: check_ready, render_proposal_section, validate_proposal, next_step_of and the model call all read it. No other module in the context imports it. [sources: src/devops_cli/roadmap/refine.py]
- Does an empty existing-tool answer make the item not ready?: Yes. The feature request form requires the field, and the issue body states the decision is made consistent with that form. check_ready will require the field to be non-empty. (proposed) [sources: docs/adr/0010-openspec-is-the-spec-and-change-proposal-layer.md]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 22, 2026
Intake placed this item to the backlog: at intake only a critical fix goes into a release; a release start pulls Ready items in, P0 features first.
The candidate introduces a new feature to refine criteria as requirements with WHEN and THEN, and includes the existing tool question.This change is part of a larger OpenSpec adoption plan and impacts roadmap refinement but does not address an immediate issue or bug.Improves the clarity and structure of roadmap items, aiding in better planning and execution of changes.Requires modifications to multiple files including refine logic, prompts, and rendering logic, but no new machinery is built.dan-petty commentedon Oct 28, 2026
Status set to Ready at 4da1e34 (see proposed design in issue body).