Skip to content

feat(roadmap): pass declared issue dependencies to stage prompt context #4008

Closed

Description

@dan-petty

Problem or Motivation

devops roadmap stage prepares the prompt context for src/devops_cli/ai/tasks/roadmap_stage_change.md. It adds overlaps and metric_senders to the request. But it adds no issue dependencies to the request. The prompt tells the model to write #<number>: <reason> in dependencies for an issue that must be delivered first. The model does not get the declared issue dependencies in structured form. It must find them in unstructured issue text, and frequently omits them.

Proposed Solution & Architectural Design

Read the declared issue dependencies from the item body with body_dependencies(item.body). Pass the list of dependency issues as issue_dependencies in the prompt request dictionary. Include the issue number and the title of each dependency issue. Instruct the model in roadmap_stage_change.md to read issue_dependencies and format each entry as #<number>: <reason>. Add tests in tests/roadmap/stage/test_roadmap_stage_plan.py to confirm that the context holds the declared issue dependencies.

Target Subsystem

SDLC, Git & PR Governance

Existing Tool Considered

Prompt template src/devops_cli/ai/tasks/roadmap_stage_change.md and src/devops_cli/roadmap/stage/stage.py. The change builds this feature directly in devops_cli.roadmap.stage. It costs about 12,000 tokens to implement, 3,000 tokens per year to maintain, and about 2 hours of elapsed time.

Standards Compliance

  • I confirm this proposal aligns with AGENTS.md engineering principles (cyclomatic complexity <= 10, nesting <= 5, zero bare exceptions, tests that cover the changed lines).
  • I am willing to submit a pull request implementing this feature with accompanying tests.

Proposed design

Problem statement

The stage job asks the model to write the dependencies of a plan as #<number>: <reason>. The request gives the model the open pull requests and the other senders of a cited metric. It gives no structured list of the issues that the item body declares as its dependencies. The request also cuts the body to a token limit, so a long body loses its Dependencies section. The model then omits a dependency or writes a wrong one.

Acceptance criteria

Requirement: The request holds each declared dependency

The stage request SHALL hold issue_dependencies as one entry for each issue that the body of the item declares as a dependency, with the number and the title of the issue.

Scenario: Two declared dependencies

  • WHEN The body of the item names #12 and #34 in its Dependencies section, and the store holds both issues as closed items with a title
  • THEN The request holds issue_dependencies with the entry {"number": 12, "title": "fix(roadmap): the first dependency"} and the entry {"number": 34, "title": "fix(roadmap): the second dependency"}, in the order of the body

Requirement: An unknown dependency keeps its number

The entry of a declared dependency MUST hold the title when the store holds the issue and MUST hold no title key otherwise.

Scenario: An issue that the store lacks

  • WHEN The body of the item names #99 in its Dependencies section, and the store holds no issue 99
  • THEN The entry is {"number": 99} and holds no title key

Requirement: An item with no dependency sends no key

The stage request MUST omit issue_dependencies when the body of the item declares no dependency.

Scenario: No dependency in the body

  • WHEN The body of the item has no Dependencies section
  • THEN The request holds no issue_dependencies key

Requirement: The prompt tells the model to use the declared dependencies

The prompt roadmap_stage_change.md SHALL tell the model to read issue_dependencies and to write one dependencies entry for each as #<number>: <reason>.

Scenario: The stage prompt

  • WHEN A test loads the prompt of the task stage
  • THEN The prompt holds issue_dependencies and #<number>: <reason>

Existing Tool Considered

No alternatives check has run. The change builds its own code in src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_request.py and the prompt src/devops_cli/ai/tasks/roadmap_stage_change.md. It costs about 12,000 tokens to build, 3,000 tokens per year to keep and fix, and about 2 hours of elapsed time. No open, maintained tool or library covers the need: the need is one field of an internal prompt request.

Key questions

  • Which function reads the issue numbers that the body of an item declares as its dependencies?: body_dependencies in src/devops_cli/roadmap/refine/refine.py returns them. src/devops_cli/roadmap/stage/stage.py imports it and calls it in _Judge._dependency, which leaves out an item whose declared dependency is open. [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/refine/refine.py]
  • Does the model already read the whole body of the item, with its Dependencies section?: No. The request holds body cut to CONST_ROADMAP_STAGE_BODY_MAX_TOKENS tokens or a share of the model window. A long body loses its Dependencies section, so the model needs the structured list. [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/config/constants.py]
  • How does the stage request carry the declared dependencies?: A new issue_dependencies field of StageRequest holds one entry for each declared dependency. An entry is a mapping with number and, when the store holds the issue, title. The key is left out when the body declares no dependency, as overlaps and metric_senders are. (best practice) [sources: src/devops_cli/roadmap/stage/stage_request.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]
    • Chosen: A mapping with the number and the title. The model needs the number and the title to write a reason, and the entries stay typed for the check and the tests.
    • Rejected: The numbers only. The model would need a read for each title, and the base toolset has no GitHub tool.
    • Rejected: One text of #<number>: <title> lines. The model writes the reason, and a text loses the number as a typed field.
  • Where does the job get the title of each dependency issue?: plan_stage gives the planner a lookup over the store that the round already reads, so the plan makes no GitHub request. An issue that the store does not hold gets an entry with the number only. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stores/store.py]
    • Chosen: A lookup over the store of the round. The round reads the store already, so a title costs no request and adds no failure path.
    • Rejected: A GitHub read for each dependency. It adds one request and one failure path for each dependency of each item.
    • Rejected: The read_issue tool of the model. The tool is only in the extended toolset, and the request must hold the data before the model answers.
  • Does the check of the plan require a dependencies entry for each declared dependency?: No. The stage job leaves out an item whose declared dependency is open, so a planned item has only delivered dependencies, or issues that the store does not hold. A required entry would make the model state that a delivered issue must come first. (best practice) [sources: src/devops_cli/roadmap/stage/stage.py, src/devops_cli/roadmap/stage/stage_change.py]
    • Chosen: No new rule in check_proposal. The job already leaves out an item whose declared dependency is open, so no entry is due.
    • Rejected: One entry for each declared dependency. It forces a false statement about a delivered issue, and the model cannot know the state of an issue outside the store.
  • Which test file holds the assertion on the prompt?: tests/roadmap/stage/test_roadmap_stage_prompt_rules.py holds the rules of the stage prompts, and the stage prompt names it as the verify of a prompt change. The request assertions go in tests/roadmap/stage/test_roadmap_stage_plan.py, as the issue says. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, tests/roadmap/stage/test_roadmap_stage_prompt_rules.py]
    • Chosen: The prompt assertion in test_roadmap_stage_prompt_rules.py. That file holds the rules of the stage prompts, and the stage prompt names it as the verify of a prompt change.
    • Rejected: Both assertions in test_roadmap_stage_plan.py. The prompt rule belongs with the other rules of the stage prompts.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

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

Activity

  1. added
    source/agent
    type/feature
    scope/roadmap
    status/new
    value/medium
    effort/low
    on Nov 7, 2026
  2. dan-petty commented on Nov 7, 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/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 reduces frequent omissions of dependencies in generated plans but does not block other work.
    • Value: Medium. It gives the model structured dependency data it currently must infer from prose, improving plan quality.
    • Effort: Low. The body states about 2 hours: read dependencies, add a field to the request dict, update one prompt template, and add tests.
    • Related: feat(roadmap): record and check plan dependencies #3224, which asks for a different change. Both handle issue dependencies in the stage workflow, but the candidate feeds them into the prompt input while #3224 records them in the plan output and checks them.
  3. added
    priority/p2-medium
    on Nov 7, 2026
  4. added
    status/ready
    and removed
    status/new
    on Nov 8, 2026
  5. devops-cli-service commented on Nov 8, 2026

    @devops-cli-service
    Contributor

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

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

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: One search for tools that read issue dependencies from an issue body returned only unrelated MDN pages. The need is one new field, issue_dependencies, in the stage prompt request. The project already has body_dependencies to read the declared dependencies, so the work is a few lines in the project's own code plus a prompt edit. No external tool or library covers it.

    Tool: none found

    Lacks:

    • No external tool adds a field to this project's internal stage prompt request
    • No external tool edits the roadmap_stage_change.md prompt

    Searches run:

    • parse issue dependencies from GitHub issue body "Depends on" library structured list, results: 5

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

  7. added
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 14, 2026
  8. removed
    status/in-review
    on Nov 15, 2026
  9. devops-cli-service commented on Nov 15, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-15 00:23 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/lowpriority/p2-mediumscope/roadmapsource/agenttype/featurevalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions