Skip to content

refactor(roadmap): split the roadmap commands by kind #3186

Open

Description

@dan-petty

Problem or Motivation

src/devops_cli/commands/roadmap.py holds all twelve top-level commands in 920 lines, but the eval commands have their own files. The commands are of three kinds, and one flat list mixes them:

  • Pipeline jobs: intake, refine, alternatives, stage, implement, run.
  • Item operations: claim, release, return, explain, inbox.
  • Evaluations: the eval group.

The description of the group says "Read and write the roadmap on GitHub, its source of truth: issues, their labels and milestones". It no longer says that the group runs the plan and implement pipeline. #1359 would add a thirteenth command, onboard.

Proposed Solution & Architectural Design

Open question for the refine step: whether the help tests, the generated command reference and the MCP tool list depend on the module that holds a command. A snapshot or a test that reads the module path would need an update.

Target Subsystem

src/devops_cli/commands/roadmap.py and the new files next to it.

Existing Tool Considered

No open tool splits a Typer command module. The change is a move of existing code with no new behavior. The cost is about 60k tokens and 3 hours to build, and nothing to keep. The existing tests are the proof that the behavior is the same.

Alternatives check of 2026-11-05: not-applicable.
Class: refactor, no search.
Tool: none found.

Proposed design

Problem statement

The devops roadmap Typer group holds all top-level commands in one 920-line module. This mixes pipeline jobs, item operations and sub-apps. The change moves the commands into modules by kind. It keeps every command name, option and output unchanged. It also makes the group help name the plan and implement pipeline.

Acceptance criteria

Requirement: Roadmap group entry point

The module src/devops_cli/commands/roadmap.py SHALL create the roadmap Typer app and register the job commands, the item commands and the eval, review and step sub-apps.

Scenario: Import the group app

  • WHEN A test imports devops_cli.commands.roadmap.app and reads its registered command names and sub-app names.
  • THEN The test asserts that every command and sub-app name that the base commit registers is still registered.

Requirement: Job commands in the job module

The job commands intake, refine, alternatives, retitle, consolidate, stage, implement and run SHALL be defined in src/devops_cli/commands/roadmap_jobs.py.

Scenario: Job command module

  • WHEN A test imports devops_cli.commands.roadmap.app and reads the callback of each job command.
  • THEN The test asserts that each callback has module equal to devops_cli.commands.roadmap_jobs.

Requirement: Item commands in the item module

The item commands claim, release, return, explain, inbox and plan-check SHALL be defined in src/devops_cli/commands/roadmap_items.py.

Scenario: Item command module

  • WHEN A test imports devops_cli.commands.roadmap.app and reads the callback of each item command.
  • THEN The test asserts that each callback has module equal to devops_cli.commands.roadmap_items.

Requirement: Shared helpers in one module

The helpers _open_store, _target, _exit_on_failure, _one_mode and _refuse SHALL be defined in src/devops_cli/commands/roadmap_shared.py and imported by the job and item modules.

Scenario: Shared helper imports

  • WHEN A test imports devops_cli.commands.roadmap_shared and reads the source of the job and item modules.
  • THEN The test asserts that each helper is defined in roadmap_shared and that roadmap_jobs and roadmap_items import each helper from that module.

Requirement: Command names, options and help unchanged

Every roadmap command SHALL keep its name, parameters, defaults and help text after the split.

Scenario: Command metadata comparison

  • WHEN A test reads the Typer app and compares each command's parameter names, defaults and help strings with the values recorded at the base commit.
  • THEN The test asserts that every value is equal.

Requirement: Group help names the pipeline

The roadmap group help SHALL name the plan and implement pipeline.

Scenario: Group help text

  • WHEN A test reads HELP.roadmap.app or runs devops roadmap --help.
  • THEN The test asserts that the text names the plan and implement pipeline.

Requirement: Command behavior unchanged

The split SHALL NOT change the runtime behavior of any roadmap command.

Scenario: Existing roadmap tests

  • WHEN The test suite runs the existing roadmap command tests.
  • THEN The tests pass with no change to their expected command results.

Existing Tool Considered

The alternatives check in the issue body records not-applicable for class refactor and names no tool. No open, maintained tool splits a Typer command module. The body gives the cost of this move as about 60k tokens and 3 hours to build, and nothing to keep. The existing tests are the proof that the behavior stays the same.

Key questions

  • Does a help test, the generated command reference or the MCP tool list read the module that holds a command?: The cited context names no test or generator that reads the module path. The command reference is a generated document built from the command matrix. The help strings come from HELP.roadmap. The split keeps the app object and the help strings. A test that asserts a callback's module would need an update. [sources: CONTEXT.md, src/devops_cli/commands/roadmap.py]
  • Which module holds the retitle, consolidate and plan-check commands?: Put retitle and consolidate in src/devops_cli/commands/roadmap_jobs.py. They call job planners and models. Put plan-check in src/devops_cli/commands/roadmap_items.py. It checks one pull request of an item. (best practice) [sources: src/devops_cli/commands/roadmap.py]
    • Chosen: Job module for retitle and consolidate; item module for plan-check. The code calls job planners for retitle and consolidate, and plan-check inspects one pull request.
    • Rejected: Leave all three in the group module. It keeps the group module large and defeats the split.
    • Rejected: Put all three in the item module. Retitle and consolidate are jobs with model planners, not item operations.
  • Where do the shared helpers live?: Put _open_store, _target, _exit_on_failure, _one_mode and _refuse in src/devops_cli/commands/roadmap_shared.py. The job and item modules import them from there. (best practice) [sources: src/devops_cli/commands/roadmap.py]
    • Chosen: A shared module roadmap_shared.py. It gives one import path and no circular import between the job and item modules.
    • Rejected: Keep the helpers in roadmap.py. The job and item modules would import the group module and create a cycle.
    • Rejected: Duplicate the helpers in each module. It creates two copies of the same behavior and invites drift.
  • Does the split keep the eval, review and step sub-apps?: Yes. The group module keeps the existing eval, review and step sub-apps. The split changes only where the top-level commands live. [sources: src/devops_cli/commands/roadmap.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

#3011, #3015, #3017, #3019

Activity

  1. added
    type/refactor
    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/refactor. The refactor prefix of the title gives the type.
    • Scope: scope/roadmap. The (roadmap) scope of the title gives the scope.
    • Priority: P3-Low. No behavior change and no user-facing impact; it is a maintenance improvement.
    • Value: Medium. Improves maintainability of the commands module but changes no user-visible behavior.
    • Effort: Medium. The body estimates about 3 hours and 60k tokens to move code and extract shared helpers.
    • Related: refactor(roadmap): group the job modules in subpackages #3187, which asks for a different change. Both reorganize roadmap code structure, but the candidate splits commands/roadmap.py while #3187 groups the roadmap/ job implementation files into subpackages.
  3. added
    priority/p3-low
    on Nov 2, 2026
  4. devops-cli-service commented on Nov 2, 2026

    @devops-cli-service
    Contributor

    Refine cannot set this item to Ready at fd0cc2f 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.
  5. devops-cli-service commented on Nov 5, 2026

    @devops-cli-service
    Contributor

    Alternatives check: not-applicable

    Class: refactor. The check makes no search and no model call for an item of this class.

    Tool: none found

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

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

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

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/p3-lowscope/roadmapstatus/readytype/refactorvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions