Skip to content

feat(roadmap): Require a rejected alternative with a fact #3257

Closed

Description

@dan-petty

Problem

A staged design.md often restates the issue and gives no reason for the chosen design. The plan fixes of 2026-11-02 found this in at least three plans (#3225 review, #3168, #3205), and each fix agent had to write the rejected alternatives by hand. In several plans the issue's own design was wrong, and a design that states why not the nearest alternative would have shown it:

Proposed change

  1. design.md must hold a part ## Alternatives (or Rejected options) with at least one option, each with one fact from the repository or a command output, not an opinion.
  2. check_proposal refuses a design with no such part, or with an alternative that has no fact (no path:line, no quoted output and no number).
  3. The model verification pass receives the part and may return a plan for an alternative whose fact is contradicted by the repository.

Acceptance criteria

  1. A test shows that a design with no ## Alternatives part is refused, and that one with a fact passes.
  2. A test shows that an alternative with no fact (only a sentence of opinion) is refused.
  3. The planner prompt names the part and the rule, and the test(roadmap): check the planner prompt against its rules #3210 test passes.
  4. A replay case from docs(openspec): plan #2742 Bound prewarm model label cardinality #3163 or docs(openspec): plan #2877 Read check runs only in the implement watch #3168 is in the golden set.

Related: #3200, #3246, #3253.

Dependencies

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

A staged design.md often restates the issue and gives no reason for the chosen design. The design already renders a ## Rejected alternatives part from StageProposal.rejected, but the list may be empty and an entry may hold only an opinion. The plan fixes of 2026-11-02 found this in three plans, and in #3163 and #3168 the missing alternative hid a wrong premise. This change makes the stage check refuse a decision with no rejected alternative, and refuses an alternative whose evidence is no fact, before the implementation starts.

Acceptance criteria

Requirement: A decision needs a rejected alternative

The stage check check_proposal SHALL refuse a proposal that holds at least one decision and an empty rejected list.

Scenario: A design states a decision and no alternative

  • WHEN A staged StageProposal holds one decision and rejected is empty
  • THEN check_proposal returns a problem that names the decision and the ## Rejected alternatives part of design.md

Requirement: An alternative with a repository fact passes

The stage check SHALL accept a rejected alternative whose evidence holds one fact, a path:line, a quoted command output or a number.

Scenario: The evidence cites a path and a line

  • WHEN A proposal with one decision holds a rejected alternative whose evidence is src/devops_cli/roadmap/stage/stage_change.py:2355
  • THEN check_proposal returns no problem for the rejected alternatives

Requirement: An alternative with only an opinion is refused

The stage check SHALL refuse a rejected alternative whose evidence holds no path:line, no quoted command output and no number.

Scenario: The evidence is one sentence of opinion

  • WHEN A proposal with one decision holds a rejected alternative whose evidence is This option is worse.
  • THEN check_proposal returns a problem that names that alternative

Requirement: The design file holds the rejected alternatives

render_change SHALL write each rejected alternative and its evidence under the ## Rejected alternatives part of design.md.

Scenario: A plan with a rejected alternative is rendered

  • WHEN render_change renders a proposal whose rejected list holds one alternative with its evidence
  • THEN design.md holds a ## Rejected alternatives part with that alternative and its evidence

Requirement: The planner prompt and the config state the rule

The stage prompt roadmap_stage_change.md and the design rule of openspec/config.yaml SHALL state that a plan with a decision gives at least one rejected alternative with one fact.

Scenario: The prompt and the config hold the rule

  • WHEN A test reads src/devops_cli/ai/tasks/roadmap_stage_change.md and openspec/config.yaml
  • THEN Both texts hold the rule and ## Rejected alternatives, and test_the_top_level_keys_of_the_reply_are_the_fields_of_the_proposal passes

Requirement: The verification prompt names the rejected alternatives

The verification prompt roadmap_stage_verify.md SHALL name the rejected alternatives of the plan and the false_premise finding for a fact that the repository contradicts.

Scenario: The verification prompt holds the rule

  • WHEN A test reads src/devops_cli/ai/tasks/roadmap_stage_verify.md and builds VerificationInput.payload of a plan with a rejected alternative
  • THEN The text names rejected and false_premise, and the payload holds the rejected list

Requirement: The golden set holds a case from #3168

The stage replay golden set SHALL hold one case from #3168 whose recorded plan states a decision and no rejected alternative with a fact.

Scenario: The replay runs the new case

  • WHEN uv run devops roadmap eval stage --replay runs the golden set
  • THEN The content gate reports the alternatives defect of the new case

Existing Tool Considered

OpenSpec (https://github.com/Fission-AI/OpenSpec, MIT, maintained, last activity 2026-11-05) gives each change a design.md and validates a change with openspec validate --strict. It lacks a check that a rejected alternative carries one fact from the repository or a command output (a path:line, a quoted output or a number), a refusal of a decision with no rejected alternative at the proposal check, the planner-prompt rule, the verification-prompt rule for a fact that the repository contradicts, and the replay case. The repository builds those parts in content_problems of src/devops_cli/roadmap/stage/stage_change.py, while render_change and the devops openspec new scaffold already write the ## Rejected alternatives part. Written cost to build, keep and fix that code: about 60k tokens, about 15k tokens a year, and about one day.

Key questions

  • Where does check_proposal live, and what role does it have?: check_proposal is defined at src/devops_cli/roadmap/stage/stage_change.py:2355. It is the check that the stage job runs on a reply, and the replay's paths gate calls it, so one rule set judges the job and the replay. [sources: src/devops_cli/roadmap/stage/stage_change.py:2355, docs/ROADMAP_WORKFLOW.md:339, docs/roadmap/plan-check.md:26]
  • Which file holds the stage planner prompt?: src/devops_cli/ai/tasks/roadmap_stage_change.md. docs/ROADMAP_WORKFLOW.md:341 names it as the stage prompt and as a file that a change of the stage check must treat as a check of the stage job. [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, docs/ROADMAP_WORKFLOW.md:341]
  • Which test does test(roadmap): check the planner prompt against its rules #3210 add, and where does it live?: test_the_top_level_keys_of_the_reply_are_the_fields_of_the_proposal in tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:96. At line 99 it compares the - key: bullets of the prompt with the fields of StageProposal. The change adds no key, so it passes. [sources: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:96, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py:99, openspec/changes/3253-map-all-issue-requirements-to-a/proposal.md:46]
  • Which test files hold the tests of the stage check?: The tests sit in tests/roadmap/stage/, among them test_roadmap_stage_content.py, test_roadmap_stage_form.py and test_roadmap_stage_prompt_rules.py. test_roadmap_stage_security.py is the model for a content rule that needs a part of design.md, with one test of the refusal, one of the passing plan and one of the rendered part. [sources: tests/roadmap/stage/test_roadmap_stage_content.py, tests/roadmap/stage/test_roadmap_stage_form.py, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py, tests/roadmap/stage/test_roadmap_stage_security.py:18]
  • Which module holds the new alternatives check?: Put the check in content_problems of src/devops_cli/roadmap/stage/stage_change.py, as a _rejected_problems helper called beside _security_problems. check_proposal runs content_problems as the content gate, so the job and the replay judge it together. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:1795, src/devops_cli/roadmap/stage/stage_change.py:1817, src/devops_cli/roadmap/stage/stage_form.py:1]
    • Chosen: content_problems in stage_change.py. It holds the text rules of a plan, and the security rule is the same shape: a _security_problems helper that refuses a plan with no part and passes a plan with one.
    • Rejected: stage_form.py. That module judges the form of the tasks, the verify commands and the new test files, not the prose of the design.
    • Rejected: A new module stage_alternatives.py. One more module for one rule adds a file to keep and to route into the gate list.
  • What counts as one fact for an alternative?: A path:line, a quoted command output, or a number. The check refuses an option whose evidence holds none of the three. (best practice) [sources: openspec/config.yaml:32, AGENTS.md:10, src/devops_cli/ai/tasks/roadmap_stage_change.md:17]
  • Which heading does the alternatives part have?: ## Rejected alternatives, the heading that _design_file renders and that scaffold_design writes. The check reads proposal.rejected, so the change adds no second heading name. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:2636, src/devops_cli/openspec/scaffold.py:89, tests/openspec/test_openspec_new.py:101]
    • Chosen: Keep ## Rejected alternatives. The renderer and the devops openspec new scaffold already write it, and every active change folder uses it, so the part has one name in the repository.
    • Rejected: Rename it to ## Alternatives. No code writes that name, so every rendered design and the scaffold would change for a rename that judges no plan.
    • Rejected: Accept ## Alternatives, ## Rejected options and ## Rejected alternatives. The model writes no heading at all: render_change writes the part from proposal.rejected, so extra names would judge nothing.
  • Must every plan hold a rejected alternative, or only a plan that states a decision?: A plan with at least one decision must hold at least one rejected alternative with a fact; a plan with no decision may hold none. Every alternative that a plan holds still needs one fact. (best practice) [sources: tests/fixtures/roadmap_eval/stage/good-2739-the-subprocess-environment-guard-accepts-gh/plan.json:18, tests/fixtures/roadmap_eval/stage/good-2739-the-subprocess-environment-guard-accepts-gh/plan.json:19, src/devops_cli/roadmap/stage/stage_eval_cases.py:25, tests/roadmap/stage/test_roadmap_stage_eval_gates.py:358]
    • Chosen: Require one only when the plan holds a decision. A decision is the chosen design that needs a reason. good-2739 is a merged plan with no decision and no alternative, and the golden set says every gate must accept a good plan.
    • Rejected: Require one for every plan. It refuses the merged plan of good-2739, whose decisions and rejected are both empty, and so fails the replay's rule that no gate refuses a good plan.
  • Does the verification pass receive the rejected alternatives, and what must change?: The job already passes the whole proposal: stage.py gives change.proposal.model_dump(mode="json") and VerificationInput.payload puts it under plan. The verification prompt names the decisions and not the rejected alternatives, so the change is the prompt: it SHALL name rejected and the false_premise finding for a fact that the repository contradicts. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py:1660, src/devops_cli/roadmap/stage/stage_verify.py:219, src/devops_cli/ai/tasks/roadmap_stage_verify.md:1, src/devops_cli/ai/tasks/roadmap_stage_verify.md:10]
    • Chosen: Update the verification prompt only. The payload already holds the rejected list, and the prompt is the missing part: it names the decisions but not the alternatives, so the reviewer is not told to check the fact.
    • Rejected: Add a field to the verification request. The whole proposal is already in plan, so a second field would repeat it.
    • Rejected: Leave the pass unchanged. A contradicted fact then stays a finding that no rule asks the reviewer to make.
  • Which gate of the replay judges the new rule?: The content gate calls content_problems, and the paths gate calls check_proposal, which calls content_problems too. A case names the new defect with the gate content and the type other, as the feat(roadmap): Require a security section for sensitive plans #3247 security case does. [sources: src/devops_cli/roadmap/stage/stage_eval_gates.py:237, src/devops_cli/roadmap/stage/stage_eval_gates.py:337, src/devops_cli/roadmap/stage/stage_eval_gates.py:213, tests/fixtures/roadmap_eval/stage/3247-a-plan-that-changes-security-md/case.json:22]
  • Which replay case is added, and does the golden set already hold one from docs(openspec): plan #2742 Bound prewarm model label cardinality #3163 or docs(openspec): plan #2877 Read check runs only in the implement watch #3168?: The set holds no case from docs(openspec): plan #2742 Bound prewarm model label cardinality #3163 or docs(openspec): plan #2877 Read check runs only in the implement watch #3168. Add one from docs(openspec): plan #2877 Read check runs only in the implement watch #3168, whose plan merged as pull request docs(openspec): plan #2877 Read check runs only in the implement watch #3168, with a decision and no rejected alternative with a fact. Its case names one other defect with the gate content, and the plan is the reply that the plan pull request first held, before the fix added the six alternatives. (best practice) [sources: openspec/changes/archive/2026-11-03-2916-one-function-decides-when-any-draft/proposal.md:48, src/devops_cli/roadmap/stage/stage_eval_cases.py:44, tests/fixtures/roadmap_eval/stage/3247-a-plan-that-changes-security-md/case.json:22]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 2, 2026
  2. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    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 fixes a recurring design-quality gap found in at least three plans but does not block a release.
    • Value: Medium. It catches wrong design choices earlier and reduces manual fix work for each plan.
    • Effort: Medium. It needs a check_proposal rule, a planner prompt update, two tests, and a golden-set replay case.
    • Related: feat(roadmap): map all issue requirements to a group #3253, which asks for a different change. Both enforce plan quality in the roadmap pipeline, but the candidate requires a factual alternatives section in design.md while #3253 maps issue requirements to task groups.
  3. added
    priority/p2-medium
    status/ready
    and removed
    status/new
    on Nov 2, 2026
  4. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

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

  5. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    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:

    x

  6. added
    status/new
    and removed
    status/ready
    on Nov 2, 2026
  7. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

    • The change-proposal layer the repository already adopted: each change holds its proposal prose in a design.md artifact, so a required part of the design has a declared home instead of free-form text.
    • Schema/config-driven validation of a change (openspec validate --strict), so a proposal that breaks the declared schema is refused.
    • Project rules for proposals live in openspec/config.yaml (for example the task-group rule), which is where a required ## Alternatives part can be declared and enforced for every change.

    Lacks:

    • No check that a rejected alternative carries one fact from the repository or a command output (a path:line, quoted output or a number): validate --strict reads no proposal prose, so an opinion-only alternative passes.
    • No refusal of a design that has no alternatives part at the proposal-validation level; the repository's own heading test is what enforces a section today.
    • No planner-prompt rule naming the part and the fact requirement, and no model-verification pass that may return a plan for a contradicted alternative.
    • No replay case in the golden set; the two new tests and the test(roadmap): check the planner prompt against its rules #3210 test stay in the repository's own check_proposal.

    Searches run:

    • tool that checks a design document has a rejected alternatives section
    • OpenSpec change proposal validation required sections schema
    • design doc alternatives section linter
    • openspec proposal validation
    • OpenSpec
    • alternatives section design document validator
    • architecture decision record tool alternatives considered check
    • openspec cli validate strict
    • markdown linter require heading section presence rule vale
    • spec-driven development toolkit design alternatives validation

    Sources:

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

  9. 18 remaining items

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

    @devops-cli-service
    Contributor

    Cleared the stop at push by the rule digest: the runner image changed since the stop, from sha256:f1ce1c28a0fb50a6cf668e7ecf2621ed6cc538620968deaa787eba30d51e5881 to sha256:393d04a07a0962a6e3a13174e6fca704b3a020f52570d1ef80cb8770a6322db9, and the class ci_infra of the stop is one that a new attempt can fix. The item is Ready again, and the Service takes it in the next round. The Service clears at most 2 for each class and 6 for each item by digest. A stop of another class, a new stop on this image, and a stop over a limit wait for a comment implement: retry.

  11. added 3 commits that reference this issue on Nov 14, 2026
  12. added
    status/planned
    and removed
    status/ready
    on Nov 14, 2026
  13. dan-petty commented on Nov 20, 2026

    @dan-petty
    OwnerAuthor

    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.

  14. added
    status/in-progress
    status/in-review
    and removed
    status/planned
    status/in-progress
    on Nov 23, 2026
  15. removed
    status/in-review
    on Nov 23, 2026
  16. devops-cli-service commented on Nov 23, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-23 04:05 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/mediumpriority/p2-mediumscope/roadmaptype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions