Repository navigation
Description
Problem or Motivation
src/devops_cli/roadmap/ is one flat package of 63 files. The jobs show as name prefixes: refine*, stage*, implement*, intake*, and the stores. The largest files are refine.py (2,438 lines), intake.py (1,445), stage.py (1,412), implement_step.py (1,330) and run.py (1,304). A reader cannot see from the folder which files belong to one job, and a change to one job touches files that sit among the files of the others.
Proposed Solution & Architectural Design
- Make one subpackage for each job (
intake,refine,stage,implement) and one for the stores. Move the files with git so that history follows. - Split a file over 1,000 lines only where it has two clear parts. Do not split a file just for its size.
- Change every import. Keep the names that other packages import through the package
__init__, so that the Service and the commands change as little as possible. - Do not change behavior. The test suite is the proof.
- Do not start this before the pull requests that change the stage and refine files are merged. Several are open: feat(roadmap): the stage job verifies its plan with a model #3182, and the plans for feat(roadmap): the stage job probes the premise at the staging commit and returns an item whose premise is false #3011, fix(roadmap): the stage job requires devops ci test verify commands and mirrored test paths #3015, fix(roadmap): the stage job refuses a plan whose group reads a path that a later group creates #3017 and feat(roadmap): the stage job maps each acceptance criterion of the issue to a task group #3019. A move now would conflict with all of them.
Open question for the refine step: whether the test folder tests/roadmap/ should mirror the new layout. The test rules in docs/TESTING.md and tests/invariants may name the paths.
Target Subsystem
src/devops_cli/roadmap/, the imports of it, and tests/roadmap/.
Existing Tool Considered
ruff and the editor can rewrite imports, and git mv keeps history. No tool decides the grouping. The cost is about 120k tokens and 6 hours to build, and nothing to keep. The risk is a merge conflict with open work, which is why it waits.
Proposed design
Problem statement
The roadmap package is one flat folder of 63 files. The job files and the store files are mixed, so a reader cannot see which files belong to one job, and a change to one job touches files among the files of other jobs. The change moves each job's modules into its own subpackage and the stores into one, with no behavior change.
Acceptance criteria
Requirement: Job subpackages
The roadmap package SHALL place each job module under intake/, refine/, stage/, or implement/, and each store module under stores/.
Scenario: Job and store modules have subpackages
- WHEN A test lists the top level of src/devops_cli/roadmap/ and its subpackages.
- THEN No top-level module name starts with intake, refine, stage, or implement, and every store module is under stores/.
Requirement: Caller imports
Every import of a moved module inside src/ and tests/ SHALL use the new module path.
Scenario: No old module path remains
- WHEN A test runs
! git grep -n 'from devops_cli.roadmap import \(store\|github_store\|intake\|refine\|stage\|implement_step\)' src/ tests/. - THEN The search finds no match.
Requirement: Package docstring kept
The devops_cli.roadmap package SHALL keep its module docstring and SHALL NOT gain re-exports of the moved modules.
Scenario: Package init stays a docstring
- WHEN A test parses src/devops_cli/roadmap/init.py.
- THEN The module body holds only the docstring, with no import or assignment.
Requirement: History follows the move
The change SHALL move each file with git mv so that its history follows it.
Scenario: Git log follows a moved file
- WHEN A test runs git log --follow on a moved module path.
- THEN The log includes the commits that touched the file before the move.
Requirement: Test tree mirrors source tree
The tests/roadmap/ tree SHALL mirror the new src/devops_cli/roadmap/ subpackages, with test files named after behaviour rather than one per source module.
Scenario: Roadmap test files mirror source subpackages
- WHEN A test lists the test files for each new roadmap subpackage.
- THEN The tests for intake, refine, stage, implement and stores sit in tests/roadmap//, and no test file is named after a source module.
Requirement: Behavior is unchanged
The change SHALL not alter runtime behavior.
Scenario: Full test suite passes
- WHEN The full test suite runs with uv run pytest.
- THEN Every test passes with no change to a behavior assertion.
Existing Tool Considered
No open tool or library decides the grouping. git mv keeps history and produces clean R100 renames, and ruff or the editor rewrites the import lines; the grouping itself is a person's judgement. Building the move costs about 120k tokens and 6 hours, and keeping it costs nothing.
Key questions
- Which package layout groups the roadmap modules?: Use intake/, refine/, stage/, implement/ and stores/ under src/devops_cli/roadmap/. The file prefixes already name the jobs, and the store modules (store.py, github_store.py, memory_store.py) form the stores group. (best practice) [sources: src/devops_cli/roadmap/init.py:1, src/devops_cli/roadmap/store.py, src/devops_cli/roadmap/github_store.py, src/devops_cli/roadmap/memory_store.py]
- Chosen: One subpackage for each job and one for stores. The module prefixes name the jobs, and the three store modules share one role.
- Rejected: Keep the flat package. It hides the job boundary and keeps 63 files in one folder.
- Rejected: Group by layer. The issue groups by job, not by layer.
- Should tests/roadmap/ mirror the new layout?: Yes. tests/roadmap/ mirrors src/devops_cli/roadmap/ at full depth, as the earlier test-tree migration did, but a test file is named after the behaviour it checks, not after one source module. (best practice) [sources: docs/TESTING.md:90, openspec/changes/archive/2026-10-31-1313-tests-mirror-source-tree/proposal.md:9]
- Chosen: Mirror the source tree. docs/TESTING.md:90 and the archived test-tree change set the mirror as the layout.
- Rejected: Keep the test tree flat. It breaks the documented layout and hides the job boundary.
- Rejected: Mirror only job subpackages. The stores are a subpackage too, so a partial mirror is inconsistent.
- Should a module over 1,000 lines split in this change?: No. Move each module whole, as a rename with no edit to its body, and split only a module that already shows two independent public parts. The earlier test-tree move did the same: R100 renames with no edits to file bodies. (best practice) [sources: openspec/changes/archive/2026-10-31-1313-tests-mirror-source-tree/proposal.md:9]
- Chosen: Move whole unless two clear parts exist. A mechanical rename keeps the diff and the merge conflict small, as the archived test-tree move did.
- Rejected: Split every file over 1,000 lines. The issue rejects a split for size alone, and a split would hide the move in the diff.
- Rejected: Split only the largest file. Size alone is not a clear part boundary.
- How does the change keep callers stable?: Update each caller's import to the new module path. The package init.py holds only a docstring and exports no name, and every caller imports a submodule (
from devops_cli.roadmap import store as roadmap_store), so there is no public name to re-export; the callers are the commands, github, survey and tests modules that the search lists. (best practice) [sources: src/devops_cli/roadmap/init.py:1, src/devops_cli/commands/roadmap.py:45, src/devops_cli/github/issues.py:25, src/devops_cli/survey/intake.py:9, tests/support/roadmap.py:25]- Chosen: Update each caller's module path. The package exports no name, so the callers import submodules and only their path changes.
- Rejected: Re-export the moved modules from init.py. It adds an export layer the package does not have and leaves two import paths for one module.
- Rejected: Leave the callers unchanged. The old module paths would no longer resolve.
- Should the move use git mv?: Yes. Move each file with git mv so that git records a rename and git log --follow keeps the history, as the archived test-tree move did. (best practice) [sources: openspec/changes/archive/2026-10-31-1313-tests-mirror-source-tree/proposal.md:35]
- Chosen: Use git mv. Git records a rename and git log --follow keeps the history.
- Rejected: Copy and delete. Git sees a new file and a deleted file, so history is harder to follow.
Fit
Fits in one pull request.
Suspected block
None.
Activity
devops-cli-service commentedon Nov 2, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
refactorprefix of the title gives the type.(roadmap)scope of the title gives the scope.No behavior change, explicit merge-conflict risk, and no user-facing impact make this low urgency.Improves navigability of a 63-file flat package but changes no user-visible behavior.Moving 63 files, updating all imports, and coordinating with open PRs takes about 6 hours.Both refactor the roadmap package, but #1026 moves config constants into the package while the candidate splits the package into subpackages.devops-cli-service commentedon Nov 2, 2026
Status set to Ready at fd0cc2f (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
refactor/3187-group-the-job-modules-in-subpackages, draft pull request #3322. The pull request plans the item and closes no issue.The task groups, with the tokens of the inputs of each step, for a budget of 40000 tokens:
stores/: 16771 tokensintake/: 16782 tokensrefine/: 16732 tokensstage/: 16822 tokensimplement/: 16724 tokensThe plan run made 3 model request(s), and used 227315 input tokens and 22968 output tokens. The model made no tool call.
A model review of the plan found these points. They stop no draft, and a person judges them:
otherat groups 4 and 5, and specs: The plan moves only five stage modules and two implement modules. Many more top-level modules start withstageorimplement, so the planned invariant test fails. The plan also leaves their imports unrewritten. Evidence: "from devops_cli.roadmap.stage_form import form_problems"docs(openspec): plan #3187 group the roadmap job modules in subpackag…
fix(openspec): accept every Verification line of an active plan (#3809)
devops-cli-service commentedon Nov 7, 2026
Released in v0.77.2: https://github.com/dan-petty/devops-cli/releases/tag/v0.77.2
devops-cli-service commentedon Nov 7, 2026
Live since 2026-11-07 06:18 UTC