Repository navigation
Description
Problem Description
The plan recheck rewrite appends a duplicate verification line instead of rewriting an existing line that lacks the command marker.
Pull request #3912 (#3596) established that verification commands in tasks.md must start with $ . Any code span without $ is treated as prose.
In src/devops_cli/roadmap/plan_rewrite.py, _verification checks group.verification_commands. When an existing plan contains verification commands without the $ prefix (such as - Verification: uv run devops ci ... passes), group.verification_commands returns an empty tuple.
Because group.verification_commands is empty, _verification does not skip the group. Instead, it generates a new command from Changes: and inserts a second Verification: line below task 0. The original unmarked line remains. The resulting task has two verification lines, and later tasks still have unmarked commands.
Reproduction Steps
- Create a
tasks.mdwhere tasks have- Verification:uv run devops ci test tests/...fails on the basewithout the$mark. - Run
devops roadmap plan-recheck --confirmon the change. - Inspect
tasks.md. - Observe that task 1 now has two
Verification:lines, and subsequent tasks remain unmarked.
Expected vs Actual Behavior
Expected: plan_rewrite.py inspects existing Verification: lines. If a line holds a code span without $ , it updates that line to prepend $ .
Actual: plan_rewrite.py appends a second Verification: line and leaves the other tasks unmarked.
Proposed Solution
In src/devops_cli/roadmap/plan_rewrite.py, add a rewrite rule for existing Verification: lines:
Scan lines of the group for - Verification: and check code spans. If the command code span lacks $ , rewrite the span to prepend $ .
Target Subsystem
Roadmap Automation & Planning
Proposed design
Problem statement
The plan recheck appends a duplicate Verification: line when tasks.md holds a verification command without the $ marker. The rewrite must mark the existing command in place. It must not add a second line or leave later tasks unmarked.
Acceptance criteria
Requirement: Mark existing verification commands
The plan rewrite SHALL prepend $ to the code span of each existing Verification: line that lacks the marker.
Scenario: Unmarked verification line is rewritten
- WHEN A task group has
- Verification:uv run devops ci test tests/test_x.pypasses. - THEN
devops roadmap plan-recheck --confirmwrites- Verification:$ uv run devops ci test tests/test_x.pypassesand adds no secondVerification:line.
Requirement: Mark all unmarked verification lines
The rewrite MUST mark every existing Verification: line without $ in all task groups of the change.
Scenario: Several unmarked lines are rewritten
- WHEN
tasks.mdhas two task groups, and each group has aVerification:line without$. - THEN
devops roadmap plan-recheck --confirmprepends$to both code spans and leaves no unmarkedVerification:line.
Requirement: Keep marked verification commands
The rewrite SHALL leave an existing Verification: line that already starts its code span with $ unchanged.
Scenario: Marked verification line is not changed
- WHEN A task group has
- Verification:$ uv run devops ci test tests/test_x.pypasses. - THEN The rewrite leaves the code span and the surrounding text on that line unchanged.
Requirement: Do not duplicate a verification line
The rewrite MUST NOT add a generated Verification: line to a task group that has an existing Verification: line after the marking pass.
Scenario: Existing line prevents a generated duplicate
- WHEN A task group has one
Verification:line without$and aChanges:line that names a test file. - THEN The rewritten task group has exactly one
Verification:line.
Requirement: Change only verification code spans
The rewrite SHALL change only the command code span on an existing Verification: line when it adds the $ marker.
Scenario: Other code spans stay unchanged
- WHEN A task group has a non-verification code span without
$and aVerification:line without$. - THEN The rewrite marks only the command code span and leaves the non-verification code span as it was.
Existing Tool Considered
No alternatives check has run. No open, maintained tool or library covers this repository-specific rewrite of tasks.md. The change edits existing code in src/devops_cli/roadmap/plan_rewrite.py; it adds no dependency. The cost is one small edit to _verification and its tests.
Key questions
- What marks a verification command in
tasks.md?: A code span on aVerification:line that starts with$. [sources: src/devops_cli/roadmap/plan_rewrite.py] - How should the rewrite handle an existing
Verification:line without the$marker?: Rewrite the line in place before_verificationchecksgroup.verification_commands. Prepend$to the command code span. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py:138, src/devops_cli/roadmap/plan_rewrite.py:172]- Chosen: Rewrite the existing line in place. It fixes the root cause and prevents a duplicate line.
- Rejected: Skip groups that have any
Verification:line. It leaves the command unmarked, so Plan Check still fails. - Rejected: Keep appending a generated line. It creates two lines and leaves later tasks unmarked.
- How should
_verificationavoid a duplicate after the marking pass?: Skip a group when its lines contain an existingVerification:line, not only whengroup.verification_commandsis non-empty. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py:138]- Chosen: Check the group lines for
Verification:. It catches a line that the marking pass just fixed. - Rejected: Keep checking
group.verification_commands. The parsed group still holds the old empty tuple, so a duplicate line is added. - Rejected: Track marked groups separately. It adds state that the line check gives for free.
- Chosen: Check the group lines for
- Which code span on an unmarked
Verification:line should get the$marker?: The first code span on the line, which holds the command. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py]- Chosen: Mark the first code span. The verification template puts the command in the first code span.
- Rejected: Mark every code span. It can mark a path or an example that is not the command.
- Rejected: Mark the last code span. It can miss the command when the line has more than one span.
- Should the rewrite preserve the rest of an existing
Verification:line?: Yes. Change only the command code span and keep the surrounding prose. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py]- Chosen: Edit only the command code span. It keeps the group-specific wording and makes the smallest change.
- Rejected: Regenerate the whole line. It loses the original wording and can change a person's text.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-09: none.
Tool: none found.
Activity
devops-cli-service commentedon Nov 7, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
The bug corrupts rewritten plans with duplicate Verification lines and leaves other tasks unmarked.The fix makes plan-recheck rewrite existing verification commands correctly for roadmap users.The fix needs a scan of Verification lines, code-span updates and tests.Both items concern plan-recheck rewriting of plans, but #3556 adds the rewrite and the candidate fixes unmarked Verification lines.dan-petty commentedon Nov 7, 2026
Pull request #3951 shows this defect. The pull request contains
tasks.mdwith verification commands that lack the$prefix. The CI jobPlan Checkfailed with:Because
plan_rewrite.pyskips groups that already contain aVerification:line,devops roadmap plan-recheck --confirmcould not repair the plan. Adding the$prefix to each verification command code span in PR #3951 resolved the failure and made all CI checks pass.devops-cli-service commentedon Nov 8, 2026
Status set to Ready at 1f03ee3 (see proposed design in issue body).
devops-cli-service commentedon Nov 9, 2026
Alternatives check: none
Reason: Searches for a tool that rewrites or normalizes code spans in Markdown files returned only generic Markdown and shell-style documentation, with no open tool or library that inspects
Verification:lines in this repository'stasks.mdand prepends$. The need is a repository-specific rewrite insidesrc/devops_cli/roadmap/plan_rewrite.py, and none of the project ADRs names or rejects such a tool.Tool: none found
Lacks:
- Verification:lines in the project'stasks.mdformat$marker to the command code span of an existing verification lineVerification:line generated fromChanges:Searches run:
Sources:
Checked on 2026-11-09. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 17, 2026
Released in v0.169.4: https://github.com/dan-petty/devops-cli/releases/tag/v0.169.4
devops-cli-service commentedon Nov 17, 2026
Live since 2026-11-17 06:41 UTC