Skip to content

fix(roadmap): return unbuildable premise items during stage #4131

Closed

Description

@dan-petty

Problem Description

When devops roadmap stage plans an issue whose premise cannot be built as written, the stage job creates a compensating proposal rather than returning the item.

In issue #3326, the issue requested using spec requirement names in staged criteria. The stage planner recognized in feasibility that this cannot be built as written because #3019 and #3180 require character-for-character copies of person-written criteria. Instead of returning the issue to status/new with evidence per Rule 2 of AGENTS.md, the planner created a compensating plan. The plan duplicated the tasks of issue #3391 under a fabricated requirement name and opened draft pull request #4122.

Reproduction Steps

  1. Select an issue whose expected behavior contradicts established architectural rules.
  2. Run devops roadmap stage <issue>.
  3. Inspect the generated proposal in openspec/changes/<issue>-<slug>/proposal.md.
  4. Observe that the feasibility section records that the item cannot be built as written, but the job opens a draft pull request with compensating tasks.

Expected vs Actual Behavior

Expected: When the feasibility check or stage probe confirms that an item cannot be built as written, devops roadmap stage returns the item to status/new with evidence (devops roadmap return <issue> --comment "<evidence>"), opens no pull request, and stops.
Actual: The stage planner generates compensating proposals that alter the requirement or address a different issue, and opens a plan pull request.

Environment Diagnostics

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

Logs, Traces, or Terminal Output

The expected output of the issue, a requirement title in place of the issue's criterion, cannot be built as written. ... so the plan keeps the copy and the fold and refuses the entry that no person wrote.
The item repeats the defect of the open item #3391, whose change openspec/changes/3391-refuse-criteria-entries-not-in-the/ plans the same refusal...

Proposed design

Problem statement

The devops roadmap stage job writes a compensating plan when an item cannot be built as written. The plan changes the item's acceptance criteria and repeats another item's work, and the job opens a draft pull request. The stage job must return the item to status/new with evidence, open no pull request and stop.

Acceptance criteria

Requirement: Return on a false premise

The stage job SHALL return the item to status/new with the evidence when the feasibility check finds that the item cannot be built as written.

Scenario: Feasibility check finds a false premise

  • WHEN the feasibility check records that the premise contradicts an ADR in force, a spec requirement or a delivered change
  • THEN the job runs devops roadmap return <issue> --comment "<evidence>" and writes no change folder

Requirement: No pull request on a return

The stage job SHALL push no branch and open no pull request when it returns an item.

Scenario: Returned item leaves no branch

  • WHEN the stage job returns the item
  • THEN origin holds no branch for the item and GitHub holds no draft pull request that plans it

Requirement: No compensating plan

The stage job MUST NOT write a task that changes the item's acceptance criteria or delivers another item's work.

Scenario: Plan would repeat another item

  • WHEN the plan would repeat the tasks of an open item under a new requirement name
  • THEN the job returns the item, names the other item's number in the evidence, and writes no change folder

Requirement: Probe uses the return path

The stage probe SHALL use the same return path as the feasibility check when it finds a false premise.

Scenario: Stage probe finds a false premise

  • WHEN the stage probe finds that the premise cannot be built as written
  • THEN the job returns the item with the probe output as evidence and opens no pull request

Requirement: Evidence names the conflict

The return comment SHALL name the ADR, the spec requirement or the item that the premise contradicts.

Scenario: Evidence names the source of the conflict

  • WHEN the job returns the item
  • THEN the comment on the issue names at least one of the ADR, the spec requirement or the item number

Requirement: Stop after the return

The stage job SHALL stop after the return and run no further step.

Scenario: No step runs after a return

  • WHEN the job returns the item
  • THEN the job records the return as its result and runs no plan, push or pull request step

Requirement: Status after a return

The return SHALL set the item's Status label to status/new.

Scenario: Returned item is New

  • WHEN the job returns the item
  • THEN the item carries the label status/new

Existing Tool Considered

No alternatives check has run. No open, maintained tool or library covers the need: the fix is control flow inside the project's own devops roadmap stage job. The change builds its own code. Written cost: about 40,000 tokens to build the return path and its tests, about 20,000 tokens for each later fix, and about 2 days elapsed.

Key questions

  • Where does the stage job decide to return the item?: At the feasibility check, before it writes the change folder or pushes a branch. (best practice) [sources: CONTEXT.md]
    • Chosen: Feasibility gate before the plan. It costs no plan tokens and leaves no branch or pull request to clean up.
    • Rejected: Discard the plan after the probe. It spends the plan budget and can leave a pushed branch.
    • Rejected: Keep the compensating plan. It changes the acceptance criteria and repeats another item's work, which the issue reports as the defect.
  • Which command returns the item, and what does its comment hold?: The existing devops roadmap return <issue> --comment "<evidence>" command, with evidence that names the conflict. (best practice) [sources: CONTEXT.md]
    • Chosen: The existing devops roadmap return command. It already sets status/new and writes the comment, so the fix adds no command.
    • Rejected: A new devops roadmap stage return command. It duplicates a command that does the same work.
    • Rejected: Close the issue and open a new one. It loses the history of the item.
  • Which findings count as a false premise?: A contradiction with an ADR in force, with a spec requirement or with a delivered change, and a plan that repeats an open item's tasks. (best practice) [sources: CONTEXT.md]
    • Chosen: Any feasibility or probe verdict that states the item cannot be built as written. It covers every conflict that the check already reports.
    • Rejected: Only a contradiction with an ADR. It misses a spec requirement and a repeated item.
    • Rejected: Only the probe output. The feasibility check already sees the conflict before the plan costs tokens.
  • Do the feasibility check and the probe share one return path?: Yes. One function returns the item, and both callers use it. (best practice) [sources: CONTEXT.md]
    • Chosen: One shared return function. Both paths keep the same evidence, label and stop.
    • Rejected: A separate path for each check. The two paths drift, and one keeps the compensating plan.
  • How does the job tell a false premise from a hard plan?: The feasibility check and the probe report a flag with the evidence, and the job returns the item when the flag is set. (best practice) [sources: CONTEXT.md]
    • Chosen: A flag with the evidence. A test sets the flag and asserts the return.
    • Rejected: A keyword match in the plan text. It is brittle and misses a conflict that other words state.
  • What Status does a returned item carry?: The Status label status/new. [sources: CONTEXT.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Alternatives check of 2026-11-10: none.
Tool: none found.

Owner decision 2026-11-13

The premise step of the triage unit (#5508) judges the premise before research. The stage premise probe becomes a guard only. This item keeps its scope: every return writer calls apply_return. Source: tracker #5482, Phase 5.

  • Live proof: after the merge and the release, the next stage return runs as the App through apply_return. A comment gives the result line and the return comment.

Activity

  1. added
    source/agent
    type/bug
    scope/roadmap
    status/new
    value/medium
    effort/medium
    on Nov 8, 2026
  2. dan-petty commented on Nov 8, 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. The stage job creates incorrect compensating plans and opens draft pull requests with fabricated content, which is a correctness defect in the core workflow.
    • Value: Medium. It prevents the stage job from generating wrong plans and draft pull requests, but a person can manually close the draft and return the item as a workaround.
    • Effort: Medium. The fix requires modifying the stage planning pipeline to check the feasibility result and return the item instead of proceeding to create a compensating plan.
    • Related: feat(roadmap): the stage job probes the premise at the staging commit and returns an item whose premise is false #3011, which asks for a different change. Both items deal with returning unbuildable items during stage, but #3011 adds a mechanical probe before the model call, while the candidate fixes the job's action when the model's feasibility section already records that the item cannot be
  3. added
    priority/p2-medium
    on Nov 8, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 9, 2026
  5. devops-cli-service commented on Nov 9, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The searches returned only unrelated documentation pages (MDN web/extension docs) and named no open, maintained tool or library that stages issues, checks feasibility and returns an unbuildable item. The need is control flow inside the project's own devops roadmap stage job — a feasibility gate that calls devops roadmap return instead of writing a compensating plan — which the issue itself already describes as its own code, so no external tool covers it.

    Tool: none found

    Lacks:

    • No external tool performs the project's feasibility-to-return decision inside devops roadmap stage
    • Returning the item with devops roadmap return --comment and setting status/new is the project's own command
    • Suppressing the change folder, branch and draft pull request on a false premise is project-specific control flow

    Searches run:

    • OpenSpec change proposal feasibility gate before planning, results: 5
    • automated issue triage tool return unbuildable issue to backlog instead of opening pull request, results: 5
    • OpenSpec Fission-AI spec-driven development change proposal tool, results: 5

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

  7. dan-petty commented on Nov 12, 2026

    @dan-petty
    OwnerAuthor

    Scope update from the Service step jobs plan (#5014).

    The owner asked on 2026-11-12 for a separate job for each step that the Service jobs run the same way every time. This issue is the return-writer item of that plan. The plan is extract-first: each repeated step becomes one module and one command (devops roadmap step <name>) that every caller uses, and then the steps that cost most move to their own Jobs.

    Proposed title: fix(roadmap): every return writer calls apply_return

    Problem (plan evidence)

    Six writers return an item to New, and only 2 use apply_return (src/devops_cli/roadmap/return_item.py:55). The others are stage.py:2707, :2733, :2774, :2800 and :2859; refine.py:3248; implement_run.py:865 and :1162. Each sets the comment, the Status and the record keys in its own order. #4131 adds the stage premise return, which is one more path.

    Added scope

    Keep the #4131 scope and add: every return writer calls apply_return (comment first, then the Status through the Status writer, then the record keys, with a read-back). One close function closes a draft and deletes its branch with a lease on the judged tip. PR #4978 changes return_item.py, so start after it merges.

    Cost: about 0.8M tokens and 1 agent-day.

    Added acceptance

    • Tests: each caller posts the comment before it sets the Status.
    • With the write-stop harness, a stop after the comment and a second run post no second comment.
    • A structural test fails when a module other than return_item.py sets the Status New.
    • The fix(roadmap): return unbuildable premise items during stage #4131 acceptance stays.

    Merge first

  8. added
    owner/agent
    status/in-review
    and removed
    status/ready
    on Nov 16, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 16, 2026
  10. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor
  11. devops-cli-service commented on Nov 16, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-16 03:02 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/roadmapsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions