Repository navigation
Description
Problem or Motivation
The plan in pull request #3322 (for #3187) moves 50 modules of src/devops_cli/roadmap/. Its first version planned to rewrite the imports of each caller and did not name the other references to a module. A string does not follow an import.
The tree has 37 quoted module targets in 12 test files, such as devops_cli.roadmap.implement_run in a monkeypatch.setattr call and in a caplog logger name. It also has five snapshot files keyed by the path of a test module, and the docstring of src/devops_cli/roadmap/__init__.py names devops_cli.roadmap.store. A move that rewrites only imports leaves each of these broken, and the tests fail after the implement step.
The plan's Impact named about 30 files. grep -rln 'devops_cli\.roadmap' src tests --include='*.py' | grep -v '^src/devops_cli/roadmap/' finds 173 files, so a reader cannot see the work from the plan.
Proposed Solution & Architectural Design
- When a plan moves or renames a module, the stage probe uses the
referencestool on the old module path and on its dotted name, and lists each hit insrc/andtests/, including a string literal and a snapshot path. check_proposalrequires each such hit to appear in a groupchangeslist or in the design as left unchanged.- The stage prompt names a quoted target, a logger name and a snapshot file as references that an import rewrite does not update.
- A move plan gives a verification that searches
src/andtests/for the old dotted name, and not only forfrom <old> import.
This differs from #3324, which scans the references of a removed entity. This issue scans the references of a moved path.
Target Subsystem
src/devops_cli/roadmap/stage_references.py, src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md
Existing Tool Considered
git grep and the existing references tool find a dotted name in an import and in a string. No new tool is needed. The cost is about 10k tokens and 1 hour.
Proposed design
Problem statement
A stage plan that moves 50 modules rewrites imports only. String literals, logger names and snapshot paths still name the old module, and the tests fail after the move. The plan's Impact list names about 30 files, but 173 files mention the package. A reader cannot see the full work.
Acceptance criteria
Requirement: Probe both names of a moved module
The stage prompt SHALL require the references tool on the old module path and on its dotted name when a plan moves a module.
Scenario: The prompt names both searches
- WHEN The stage prompt is read.
- THEN It holds the
referencestool, the old module path and the dotted name.
Requirement: List each reference hit
The stage reply SHALL list each reference hit in src/ and tests/ for a moved module.
Scenario: A string literal names the old module
- WHEN A move plan lists a reference in a string literal under
tests/. - THEN The parsed
StageProposalholds aStageReferencefor that test path.
Requirement: Refuse an uncovered reference
check_proposal SHALL refuse a reference that no group changes and that the design does not leave unchanged.
Scenario: A reference is missing from the plan
- WHEN A reference names
tests/roadmap/test_x.py, no group lists that path inchanges, and the reference is not unchanged. - THEN
check_proposalreturns a problem that namestests/roadmap/test_x.py.
Requirement: Accept a changed reference
check_proposal SHALL accept a reference when a group lists its path in changes.
Scenario: A group changes the reference file
- WHEN A reference names
tests/roadmap/test_x.pyand one group lists that path inchanges. - THEN
check_proposalreturns no reference problem for that path.
Requirement: Unchanged reference in the design
The design SHALL record each unchanged reference with its path and a reason.
Scenario: A snapshot stays keyed by the old module
- WHEN A reply marks
tests/snapshots/roadmap/test_x.ambras unchanged with a reason. - THEN The rendered
design.mdholds that path and that reason.
Requirement: Prompt names non-import references
The stage prompt SHALL name a quoted target, a logger name and a snapshot file as references that an import rewrite does not update.
Scenario: The prompt lists the reference kinds
- WHEN The stage prompt is read.
- THEN It holds the words
quoted target,logger nameandsnapshot file.
Requirement: Verification for a moved module
The stage prompt SHALL require a move plan to give a verification that searches src/ and tests/ for the old dotted name.
Scenario: The prompt states the verification
- WHEN The stage prompt is read.
- THEN It holds the
! git grepform, the old dotted name and bothsrc/andtests/.
Existing Tool Considered
No alternatives check has run. git grep and the existing references stage tool cover the search need. They lack a structured coverage check, so the change adds that check. The written cost is about 10k tokens and 1 hour.
Key questions
- Which tool finds the references of a moved module?: Use
git grepthrough the existingreferencesstage tool. It already searches every file of the staged commit and keeps files from each group, including tests and snapshots. No new scanner is needed. (best practice) [sources: src/devops_cli/roadmap/stage_references.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen: Existing
referencestool. It runsgit grep -n -Fover the staged commit and keeps source, test, spec, document and change files. - Rejected: New AST scanner. It misses string literals and snapshot paths and adds code to build and keep.
- Rejected: Import-only rewrite. A string does not follow an import, so it leaves broken references.
- Chosen: Existing
- How does the plan record a reference that it leaves unchanged?: Add a structured
StageReferenceentry toStageProposal. Each entry holds the path, its kind, anunchangedflag and a reason._design_filerenders each unchanged entry indesign.md.check_proposalreads the flag and does not parse free text. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, src/devops_cli/ai/tasks/roadmap_stage_change.md]- Chosen: Structured reference list. A field is exact, and the design renders it from the same data.
- Rejected: Free-text decision. A path in a decision is hard to check and easy to miss.
- Rejected: Separate unchanged list. It splits one reference into two lists that can disagree.
- Where does
check_proposalget the reference hits?: The stage reply carries the hits from thereferencestool in thereferenceslist.check_proposalchecks that list against the groupchangesand the unchanged entries. It runs no git, because the replay reads no git. (best practice) [sources: src/devops_cli/roadmap/stage_change.py, docs/ROADMAP_WORKFLOW.md:253, src/devops_cli/roadmap/stage_references.py]- Chosen: Structured list in the reply. The job and the replay check the same reply without a git call.
- Rejected: Re-run
git grepincheck_proposal. The replay reads no git, so the gate would fail on a recorded plan. - Rejected: Parse
feasibilitytext. The text is free form and a path is easy to miss.
- Which verification proves that the old dotted name is gone?: Use the
! git grep -n -F '' src/ tests/form in the groupverify. It fails when any file still names the old module, including a string literal or a snapshot key. A search forfrom importis not enough. (best practice) [sources: src/devops_cli/ai/tasks/roadmap_stage_change.md, src/devops_cli/roadmap/stage_references.py]- Chosen:
! git grepon the old dotted name. The stage prompt allows this form, and it fails on any remaining literal. - Rejected:
! git greponfrom import. It misses string literals, logger names and snapshot paths. - Rejected: No verification. A broken reference then reaches the implement step.
- Chosen:
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
devops-cli-service commentedon Nov 3, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
It improves plan correctness for module moves but does not block current work.Both add reference scanning to the stage probe, but #3324 targets a removed entity while this targets a moved or renamed module path.docs(openspec): plan #3187 group the roadmap job modules in subpackag…
devops-cli-service commentedon Nov 3, 2026
Status set to Ready at c343f14 (see proposed design in issue body).
devops-cli-service commentedon Nov 3, 2026
Staged: branch
feat/3373-the-stage-plan-of-a-module, draft pull request #3379. 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:
The plan run made 3 model request(s), and used 226324 input tokens and 12488 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 group 3: The plan addsreferencestoStageProposalbut never adds areferencesbullet to the reply-keys section of the prompt. The existing test then fails after group 1, and group 3 would not fix it. Evidence: "assert sorted(bullets) == sorted(StageProposal.model_fields)"otherat what_changes: The plan promises messages in the roadmap message catalogue. No group changes or creates a catalogue file, and group 2 puts the message text instage_change.py, so the task is missing or the plan contradicts itself. Evidence: "Add the stage messages for the reference problems to the roadmap message catalogue."docs(openspec): plan #3373 with a probed reference check
docs(openspec): align the plan #3373 impact list with its groups
docs(openspec): plan #3373 Require a move plan to cover each reference (
feat(roadmap): refuse a what_changes item that names no group path (#…
[-]feat(roadmap): the stage plan of a module move finds the references that an import rewrite misses[/-][+]feat(roadmap): Require a move plan to cover each reference[/+]dan-petty commentedon Nov 6, 2026
The job shortened the title of this item. The summary had 82 characters, and the limit is 60. The type and the scope stay.
feat(roadmap): the stage plan of a module move finds the references that an import rewrite missesfeat(roadmap): Require a move plan to cover each referencedevops-cli-service commentedon Nov 8, 2026
Released in v0.91.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.91.0
devops-cli-service commentedon Nov 8, 2026
Live since 2026-11-08 17:21 UTC
feat(roadmap): record the reference hits of a stage case in the replay (