Skip to content

fix(roadmap): the stage job blocks a plan that needs another open item's plan #3418

Closed

Description

@dan-petty

Problem or Motivation

The stage job planned #3388 against a base that lacks the behavior its premise names. The plan of PR #3396 says "The stage check reads constant claims from the prose of a plan." The base does not do this. git grep -n "stage_constants\|constant_claims" 6c15a64a -- src tests finds nothing, and src/devops_cli/roadmap/stage_constants.py is absent.

The prose scan is only planned by #3308. The plan folder openspec/changes/3308-the-plan-check-compares-a-number/ is on main, and the issue stays Planned. That plan also creates src/devops_cli/roadmap/stage_constants.py and tests/roadmap/test_roadmap_stage_constants.py, the same new files that the plan of #3388 creates.

The stage job recorded no dependency: refine.blocked_by is null. An implement step would create a file that the plan of #3308 owns, or it would fail on the missing prose scan.

Reproduction Steps

  1. Read the base at 6c15a64a, the merge base of origin/main and the plan branch.
  2. Run git grep -n "stage_constants\|constant_claims" 6c15a64a -- src tests and see no match.
  3. Run git cat-file -e 6c15a64a:src/devops_cli/roadmap/stage_constants.py and see that the path does not exist.
  4. Read the plan of feat(roadmap): the stage plan states constant claims in a structured field #3388 in openspec/changes/3388-the-stage-plan-states-constant-claims/ and see that it creates the same new module and test module.

Expected vs Actual Behavior

Expected: the stage job finds that the premise names behavior that only another open plan creates, returns the item with that dependency, and adds no plan.

Actual: the stage job plans the item with Dependencies: None, and the plan creates files that the plan of #3308 also creates.

Proposed Solution & Architectural Design

  • In the premise check of src/devops_cli/roadmap/stage_probe.py, when a cited behavior or path is absent at the staging commit, search the plan folders of open items under openspec/changes/. A plan folder that names the same path or requirement is a dependency.
  • When the check finds a dependency, the stage job returns the item with the open item's number instead of planning it. Record the number in blocked_by so refine and stage leave the item until the other item closes.
  • In check_proposal or stage_paths, refuse a plan that lists a path in creates that another open plan also lists in creates.
  • Add tests in tests/roadmap/test_roadmap_stage_plan.py for a plan that needs an open plan's module and for a plan that creates a path another open plan creates.

Target Subsystem

src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/refine.py

Existing Tool Considered

The stage job already reads the plan folders of openspec/changes/ for the stage context. No open tool detects a dependency between two planned items. The change extends that read: about 6,000 tokens to build and test, about 1,000 tokens per month to keep and fix, and about 3 hours elapsed. The change deletes no internal code.

Source: #3396

Proposed design

Problem statement

The stage job plans an item against a staging commit that lacks behavior that another open item's plan creates. The job records no dependency. An implement step then creates files that the other plan owns, or it fails on the missing behavior. The fix makes the stage job detect the open plan, return the item with a dependency, and refuse a plan that creates a path that another open plan creates.

Acceptance criteria

Requirement: Open plan dependency from a missing cited item

The stage job SHALL detect a dependency when a cited item is absent at the staging commit and an open plan names it.

Scenario: Missing path named by an open plan

Requirement: Recorded dependency stops staging

The stage job SHALL record the open item's number in blocked_by and return the item to New when it finds the dependency.

Scenario: Dependency found before the model call

Requirement: Stage leaves a recorded open dependency

The stage job SHALL leave out an item whose blocked_by record names an open item.

Scenario: Recorded dependency is open

Requirement: Closed dependency stops no staging

The stage job MUST stage an item whose blocked_by record names only closed items.

Scenario: Recorded dependency is closed

Requirement: Overlapping create path is refused

The stage job SHALL refuse a plan that lists a path in creates that an open item's plan also lists in creates.

Scenario: Two plans create the same module

Requirement: Closed plan is no dependency

The stage job MUST ignore a plan folder whose item is closed or archived when it detects a dependency or an overlapping create.

Scenario: Closed plan names the same path

  • WHEN A closed item's plan lists the cited path in creates.
  • THEN The stage job records no dependency on that item and accepts the reply.

Existing Tool Considered

No alternatives check has run. No open, maintained tool detects a dependency between two planned items. The change extends the stage job's existing read of openspec/changes/. The written cost is about 6,000 tokens to build and test, about 1,000 tokens per month to keep and fix, and about 3 hours elapsed. The change deletes no internal code.

Key questions

  • How does the stage job find a cited path or identifier that the staging commit lacks?: probe_premise runs git cat-file, git grep and git log at the staging commit. It returns the missing paths and identifiers in Probe.missing. [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage.py]
  • How does the stage job know which items are open and which have a plan on the default branch?: The store holds each item's open or closed state. read_stage_selection reads the change folders on the default branch with read_planned_changes. [sources: src/devops_cli/roadmap/stage.py]
  • Where does the roadmap record blocked_by, and what waits on it?: RefinedItem.blocked_by holds the open item numbers. NextStep.BLOCKED waits until every item in that record closes. [sources: src/devops_cli/roadmap/refine.py, tests/roadmap/test_roadmap_refine.py]
  • How does a rendered plan mark a path that it creates?: The Changes: line of a task group puts (new) after the code span of each path in creates. [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_plan.py]
  • How should the stage job match a missing cited item to an open plan?: Search the full text of each open plan folder for the missing path or identifier. The folder holds the path and the requirement in one place. (best practice) [sources: src/devops_cli/roadmap/stage_probe.py, src/devops_cli/roadmap/stage_change.py, CONTEXT.md]
    • Chosen: Search the full plan folder text. The plan folder is the record and already holds the path and the requirement. No new parser is needed.
    • Rejected: Read only the creates lists. A plan can name a behavior in a requirement without a file path.
    • Rejected: Read only the spec requirement names. A plan can create a path that no requirement name states.
  • How should the stage job get the plan folders of open items?: Pass the open item numbers and their plan folders from read_stage_selection into the planner and the premise probe. (best practice) [sources: src/devops_cli/roadmap/stage.py, src/devops_cli/roadmap/refine.py]
    • Chosen: Pass open item plan folders from the selection. The store already knows the open state. The job reads the plan folders once for the round.
    • Rejected: Read every folder under openspec/changes/. A closed or archived item's plan can cause a false dependency.
    • Rejected: Read each issue on GitHub during the probe. It adds a remote read for each item and makes the probe non-local.
  • Where should the stage job record a dependency it finds?: Record the open item number in blocked_by and return the item to New. Refine and stage already wait on an open item in that record. (best practice) [sources: src/devops_cli/roadmap/refine.py, src/devops_cli/roadmap/stage.py]
    • Chosen: Use blocked_by and NextStep.BLOCKED. Refine already stops an item until each open blocker closes. Stage can read the same record.
    • Rejected: Post only a return comment. A comment does not stop the next stage or refine round.
    • Rejected: Add a stage-only dependency record. It duplicates the existing wait rule and needs a second reader.
  • Where should the check for an overlapping creates path run?: Run it in check_proposal with the open plan paths that the round read. A refused reply goes back to the model once. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/roadmap/stage_paths.py, src/devops_cli/roadmap/stage.py]
    • Chosen: In check_proposal. It already collects rule failures and sends them back to the model once.
    • Rejected: In stage_paths alone. stage_paths checks the staged tree, not another plan.
    • Rejected: In the prompt only. A prompt rule cannot refuse a reply.
  • How should the stage job read the creates paths of an open plan?: Parse the (new) marks in the open plan's tasks.md. That file is the rendered record of the plan's task groups. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, tests/roadmap/test_roadmap_stage_plan.py]
    • Chosen: Parse the (new) marks in tasks.md. The rendered plan already marks each created path. The job needs no new file.
    • Rejected: Treat every path in the plan folder as created. A plan reads and changes paths that it does not create.
    • Rejected: Add a JSON manifest to each plan folder. It changes the plan format and needs a migration for plans on the default branch.

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. A real defect that wastes implementation work and creates file conflicts, but a person can close the bad plan as a workaround.
    • Value: Medium. Prevents failed implementations and file-ownership conflicts between concurrent plans.
    • Effort: Medium. The body estimates about 6,000 tokens and 3 hours for build, test, and integration across four files.
    • Related: feat(roadmap): record and check plan dependencies #3224, which asks for a different change. Both items concern plan dependencies, but #3224 records and reports a dependency list in an already-created plan, while the candidate detects the dependency at stage time and refuses to plan the item.
  3. added
    priority/p2-medium
    on Nov 4, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 4, 2026
  5. devops-cli-service commented on Nov 4, 2026

    @devops-cli-service
    Contributor

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

  6. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 5, 2026
  7. removed
    status/in-progress
    owner/agent
    on Nov 5, 2026
  8. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor
  9. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-05 12:32 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