Skip to content

fix(roadmap): a rejected plan leaves its evidence on the issue #3503

Closed

Description

@dan-petty

Problem

When a person rejects a plan pull request, the evidence stays on the closed pull request. The issue gets only the comment returned per agent request. Refine then sets the issue to Ready again and can restate the false premise. So an item reads Ready while its evidence shows that nobody can build it as written. A person or an agent who reads only the issue does not see this.

These 4 issues read status/ready at 2026-11-04T17:30Z:

The stage job does not repeat these 4 plans today. devops roadmap explain gives held by a pushed branch for #3076. #3049, #2754 and #2740 first fail the title rule (98, 61 and 72 characters, limit 60). A repeat needs a deleted branch, as for #3388 after PR #3396.

The evidence comments ask a person to run devops roadmap return <n> --comment "<evidence>" --confirm, because the command "fails with 401 in an agent session". Nobody verified this 401 for this issue. If return works, it delivers the evidence with no new code. Frequency is low: in the window 2026-11-03T15:05Z to 2026-11-04T15:05Z, only PR #3396 closed unmerged.

The 4 issues need a separate action now. AGENTS.md rule 2 applies to them: return them with the evidence, or close them as rejected. This item does not do that.

Expected

The issue holds the reason for the rejection. Refine and the stage job read that reason as an input. The stage job takes the item again only after its body or a cited file changes. The branch of a closed plan pull request does not hold the item for good: the job deletes the branch, or it ignores the branch when the plan pull request is closed.

Acceptance criteria

Existing tool considered

The block_paths record and _cited_code_changed of src/devops_cli/roadmap/refine.py (lines 245 and 1574) cover the "changed since" check. devops roadmap return --comment (src/devops_cli/roadmap/return_item.py) delivers evidence to the issue. issue_holder (src/devops_cli/git/worktree_add.py:442) is the branch hold to change. No outside tool covers this flow.

Related

Related: #3387, #3418, #3388, #3049, #3076, #2754, #2740

Proposed design

Problem statement

When a person rejects a plan pull request, the evidence stays on the closed pull request. The issue gets only the comment returned per agent request. Refine then sets the issue Ready again and can restate the false premise. So an item reads Ready while its evidence shows that nobody can build it as written. A person or an agent who reads only the issue does not see this.

Acceptance criteria

Requirement: Rejection evidence on the item

The stage job SHALL copy the newest comment that a person wrote on a closed unmerged plan pull request to the item body, in a marked block.

Scenario: A closed plan pull request leaves its evidence

  • WHEN a plan pull request closes unmerged and its newest comment of a person holds at least the set length
  • THEN the item body holds the marked block with that comment and the number of the pull request

Requirement: A one-word comment is no evidence

The stage job SHALL skip a comment shorter than the set length and SHALL copy the newest comment that reaches the set length.

Scenario: A verdict word is skipped

  • WHEN the newest comment of a person on the closed plan pull request is rejected
  • THEN the block holds the comment before it, and the block holds no one-word verdict

Requirement: The block leaves out the body hash

The body hash that the jobs compare MUST leave out the rejection block and its record line.

Scenario: A written block keeps the body hash

  • WHEN the stage job writes the rejection block to the item body
  • THEN body_hashes returns the body hash that it returned before the write

Requirement: Both requests carry the block

The refine request and the stage request SHALL hold the rejection block under the key plan_rejection.

Scenario: Both requests hold the evidence

  • WHEN the item body holds the rejection block
  • THEN the plan_rejection key of each request holds the block text and the pull request number

Requirement: The stage job waits for a change

The stage job SHALL leave out an item with a rejection block until its body hash or a cited path changes.

Scenario: An unchanged item stays out

  • WHEN a stage round reads an item whose body hash and cited paths did not change since the block
  • THEN the job leaves the item out, and devops roadmap explain names the closed pull request

Requirement: A change releases the item

The stage job SHALL take the item after its body changes, and the branch of the closed plan pull request MUST NOT hold it.

Scenario: The branch of a closed plan pull request holds nothing

  • WHEN a person changes the body of an item whose plan pull request closed unmerged, and only the App wrote to its branch
  • THEN the stage round takes the item, and the job deletes the branch from origin

Requirement: The copy needs no agent session

The stage job SHALL write the rejection evidence with the store's comment call and MUST NOT run devops roadmap return.

Scenario: The copy runs no subprocess

  • WHEN the stage job copies the evidence of a closed plan pull request
  • THEN the store's comment call writes the block, and no subprocess runs devops roadmap return

Existing Tool Considered

No alternatives check has run on this item. No open, maintained tool or library covers this flow. The flow copies the review comment of a closed plan pull request onto its issue. It gates the stage job on the body hash and the cited paths, and it frees the branch. The change builds on the repository's own code: block_paths and _cited_code_changed in src/devops_cli/roadmap/refine.py, devops roadmap return in src/devops_cli/roadmap/return_item.py, and issue_holder in src/devops_cli/git/worktree_add.py. Written cost: about 80,000 tokens to build the copy, the block, the two requests and the branch rule. About 15,000 tokens each year keep and fix that code. The elapsed time is about 3 days.

Key questions

  • Which code holds an item that a pushed branch names?: issue_holder in src/devops_cli/git/worktree_add.py reads the pushed branches, and the stage job leaves out the item that it names. Refine records the same wait as a block path. [sources: src/devops_cli/git/worktree_add.py, src/devops_cli/roadmap/stage.py, openspec/changes/archive/2026-10-29-2714-planned-items/proposal.md]
  • How does refine read a stage return today?: _stage_return reads the newest comment after refine's last comment that holds the stage marker, and only when the item holds no staged branch. _returned_wait then puts the item on a person after a second return on the same body. [sources: src/devops_cli/roadmap/refine.py, openspec/specs/roadmap-refine/spec.md]
  • Which actor copies the rejection evidence to the issue?: The stage job copies the evidence with the store's own comment call. No agent session runs devops roadmap return. (best practice) [sources: src/devops_cli/roadmap/return_item.py, src/devops_cli/roadmap/refine.py, CONTEXT.md]
    • Chosen: The stage job's store call. It runs in the Service with the App token, so the unverified 401 of an agent session cannot stop it, and it needs no new command.
    • Rejected: devops roadmap return run by an agent. Nobody verified the 401 of the command in an agent session, and each rejection needs an agent session.
    • Rejected: A person runs devops roadmap return by hand. It puts the evidence on the issue only when a person acts, and the item reads Ready until then.
  • Which comment of the closed pull request is the evidence?: The evidence is the newest comment that a person wrote and that holds at least 40 characters. (best practice) [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/trust.py]
  • What ends the wait on a rejected plan?: A change of the body hash or of a cited path ends the wait. A reply comment does not end it, because the evidence is the input that the round needs. (best practice) [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/body_hash.py]
    • Chosen: Body hash or cited path change. It is the check that _cited_code_changed and body_hashes already make, and the issue asks for it.
    • Rejected: Any new comment. A comment that does not change the body leaves the false premise in place.
    • Rejected: A person's label change. It needs a person for each rejected plan and records no reason.
  • What does the job do with the branch of the closed plan pull request?: The job deletes the branch when only the App wrote to it. (best practice) [sources: openspec/specs/roadmap-stage/spec.md, src/devops_cli/git/worktree_add.py]
    • Chosen: Delete the branch when only the App wrote to it. The stage job already deletes the staged branch of a closed item under the same rule, and the name is free for the next plan.
    • Rejected: Ignore the branch when its pull request is closed. The branch stays on origin and the next plan meets a name that exists.
  • Which job reads the closed plan pull request?: The stage round reads it, in the selection that already calls issue_holder for each Ready item. (best practice) [sources: CONTEXT.md, src/devops_cli/roadmap/stage.py]
    • Chosen: The stage round. It reads every Ready item each round and already asks why a branch holds it.
    • Rejected: A new row on the status lane. It adds a schedule row, settings and Service wiring for an event that the stage round already sees.

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/medium
    on Nov 4, 2026
  2. dan-petty commented on Nov 4, 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 state inconsistency misleads readers of the issue, but the frequency is low with one affected PR in the observed window.
    • Value: Medium. It prevents a roadmap item from appearing Ready when its evidence shows the premise is false, which protects downstream agents and people.
    • Effort: Medium. It needs changes to the return flow, the stage job branch rule, and the refine job, plus five specified tests.
    • Related: feat(roadmap): Stage items whose draft plan fails the check #3387, which asks for a different change. Both address the stage job being blocked by a branch hold, but #3387 fixes replacement of a failing draft plan while this item fixes evidence transfer and branch release after a PR is closed unmerged.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 5, 2026
  5. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

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

    Moved to new items: #3707.

  6. added
    status/in-review
    and removed
    status/ready
    on Nov 6, 2026
  7. added 2 commits that reference this issue on Nov 6, 2026
  8. removed
    status/in-review
    on Nov 6, 2026
  9. devops-cli-service commented on Nov 6, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-06 03:21 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