Repository navigation
Description
Problem or Motivation
render_change does not write builds_own or creates_lines (src/devops_cli/roadmap/plan_read.py:9-11). The reader sets builds_own to false (plan_read.py:496-512) and gives each created path 1 line (plan_read.py:393, 409). So when plan-check, plan-recheck, implement or fix-plan judge a read plan:
- the cost rule of AGENTS.md rule 3 does not run (
src/devops_cli/roadmap/stage/stage_change.py:1825-1829); - the size measure counts too few tokens (
measure_groups,stage_change.py:2892-2915; callersplan_check.py:529and the budget check of_gated).
A read plan can pass checks that the same plan failed at write time. In the golden set, plan 3247 setsbuilds_own, and 4 groups have other line estimates. fix(roadmap): write and read the kind of each plan task group #5205 lists both fields inFIELDS_NOT_IN_FILES.
Proposed Solution & Architectural Design
builds_own: the writer adds one fixed sentence at the end of## Existing Tool Consideredofproposal.mdwhen the field is true. The reader sets the field when the sentence is there and removes it fromexisting_tool. The sentence is written only for true, so its absence is the value false.creates_lines: the writer adds one line under the files line of a group that creates a path:New lines:<n>, .... The(new)mark does not change, so the other parsers of the mark still work:created_paths(plan_read.py:256-266),group_files(plan_read.py:269-287),src/devops_cli/roadmap/implement/implement_amend.py:150-153andsrc/devops_cli/roadmap/planned.py:110-122._READSmatches only the files line (re.M,$).- A created path with no
New lines:entry (a plan written before this change) reads as 1 line, as today. Its end is refactor(roadmap): end the kind inference of the plan reader #5218, which writes the value 1 into each old plan with the form edit ofplan_rewrite.py, whatever the gate result, and then refuses a missing entry. - Remove
builds_ownandcreates_linesfromFIELDS_NOT_IN_FILES.
Target Subsystem
Roadmap: the stage writer and the plan reader.
Existing Tool Considered
No open tool holds these fields: the plan Markdown is the format of this project, and OpenSpec has no field for them. Cost to build (estimate): 0.6 M tokens and 2 hours elapsed. Keep: none. Fix: about 0.1 M tokens.
Acceptance Criteria
-
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_builds_own_reads_backand::test_created_line_estimates_read_backpass. -
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_the_fields_that_no_file_holdsholdsFIELDS_NOT_IN_FILEStosummary,pull_request_bodyandweakened_checks, and::test_no_fact_is_lostpasses. -
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_each_golden_plan_reads_backgivesbuilds_owntrue for plan 3247. -
uv run devops ci test tests/roadmap/implement/test_roadmap_implement_amend.py tests/roadmap/stage tests/roadmap/test_roadmap_plan_check.pypasses, with the snapshots updated. -
uv run devops ci fail-to-pass --base origin/mainshows thattest_builds_own_reads_back,test_created_line_estimates_read_backandtest_the_fields_that_no_file_holdsfail on the base and pass on the head. The PR cites the run. - Validation table in a PR comment, as in fix(roadmap): write and read the kind of each plan task group #5205: the read on origin/main and on the branch of each open plan PR head and each plan PR closed in the last 14 days, with
builds_ownand the sum of the line estimates. No head that origin/main reads is refused on the branch. The fixtures intests/fixtures/roadmap/plan_heads/read with the same values as on the base. -
uv run devops docs checkpasses.
Files
- src/devops_cli/roadmap/stage/stage_change.py
- src/devops_cli/roadmap/plan_read.py
- src/devops_cli/lang/en/messages.py
- tests/roadmap/test_roadmap_plan_read.py
- tests/roadmap/stage/snapshots/test_roadmap_stage_plan.ambr and the fixtures that hold a rendered group with a created path
- docs/roadmap/plan-check.md
- openspec/specs/roadmap-plan-check/spec.md
Dependencies
-
chore(roadmap): hold incremental stage and implement work #6521 (hold: incremental work on the stage, implement and fix-checks jobs waits for the re-architecture)
-
fix(roadmap): the implement row logs why it leaves out a plan #5216
The stage job leaves this item out until that issue closes. The earlier PRs of this set change stage_change.py, plan_read.py and messages.py, and this item needs FIELDS_NOT_IN_FILES and the property tests of the reader fix.
Related
#3201, #3490, AGENTS.md rule 3.
Source: #5211
Alternatives check of 2026-11-22: none.
Tool: none found.
Reason: Searches returned no open tool that stores a builds-own cost flag or per-created-path line estimates in a plan file and reads them back; OpenSpec, the project's spec layer, has no such field.
Lacks:
- No field for a builds-own cost flag
- No per-created-path line estimates
- No read back into the cost rule and size measure
Proposed design
Problem statement
Do not build this item until #5216 and #6521 close. render_change does not write builds_own or creates_lines. The reader sets builds_own false and gives each created path 1 line. A read plan then shows less cost than the writer recorded. The cost rule of AGENTS.md rule 3 does not run, and the size measure counts too few tokens. This item writes both values into the plan files and reads them back.
Acceptance criteria
Requirement: True builds_own is written
render_change SHALL write the line This change builds its own tool. as the last line of ## Existing Tool Considered in proposal.md when builds_own is true.
Scenario: A true builds_own is written
- WHEN A test calls
render_changefor a stage proposal withbuilds_owntrue. - THEN The
## Existing Tool Consideredsection ofproposal.mdends with the lineThis change builds its own tool.
Requirement: False builds_own is not written
render_change SHALL write no line This change builds its own tool. when builds_own is false.
Scenario: A false builds_own is not written
- WHEN A test calls
render_changefor a stage proposal withbuilds_ownfalse. - THEN The rendered
proposal.mdholds no lineThis change builds its own tool.
Requirement: True builds_own is read
read_change SHALL set builds_own true and SHALL remove the line This change builds its own tool. from existing_tool when proposal.md holds that line.
Scenario: A plan with the builds-own line
- WHEN A test calls
read_changeon a renderedproposal.mdwhose## Existing Tool Consideredsection ends with that line. - THEN The returned
builds_ownis true and the returnedexisting_toolholds no lineThis change builds its own tool.
Requirement: Missing builds_own line reads false
read_change SHALL set builds_own false when proposal.md holds no line This change builds its own tool.
Scenario: A plan with no builds-own line
- WHEN A test calls
read_changeon a renderedproposal.mdof a proposal withbuilds_ownfalse. - THEN The returned
builds_ownis false.
Requirement: Created-line estimates are written
render_change SHALL write one New lines: line below the Changes: line of each group that creates a path.
Scenario: A group with created paths and line estimates
- WHEN A test calls
render_changefor a group with two created paths and theircreates_linesvalues. - THEN The group in
tasks.mdholds oneNew lines:line with each created path in a code span and its value.
Requirement: The (new) mark stays on the Changes line
render_change SHALL keep the (new) mark on the Changes: line of each created path.
Scenario: The mark of a created path
- WHEN A test calls
render_changefor a group with a created path. - THEN The
Changes:line of the group marks the created path(new).
Requirement: No New lines line without created paths
render_change SHALL write no New lines: line for a group that creates no path.
Scenario: A group with no created path
- WHEN A test calls
render_changefor a group with nocreatespaths. - THEN The group in
tasks.mdholds noNew lines:line.
Requirement: Created-line estimates are read
read_change SHALL set creates_lines of a group from its New lines: line.
Scenario: A plan with New lines entries
- WHEN A test calls
read_changeon atasks.mdwhose group holds aNew lines:line with two paths. - THEN The group's
creates_linesequals the two path and value pairs of that line.
Requirement: Missing created-line estimate reads one
read_change SHALL give one line to each created path that has no New lines: entry.
Scenario: A created path with no estimate
- WHEN A test calls
read_changeon a group that marks a path(new)and holds noNew lines:entry for that path. - THEN The group's
creates_linesgives that path the value 1.
Requirement: Round trip keeps both fields
A render_change followed by a read_change SHALL keep builds_own and each creates_lines value.
Scenario: The round-trip property test
- WHEN
tests/roadmap/test_roadmap_plan_read.py::test_no_fact_is_lostruns over the stage proposals. - THEN Each read proposal has the same
builds_ownand the samecreates_linesvalues as the proposal that the test rendered.
Requirement: file_facts keeps both fields
file_facts SHALL keep the builds_own and creates_lines values of the proposal that it reads.
Scenario: A proposal with a true builds_own and a line estimate
- WHEN A test calls
file_factson a proposal withbuilds_owntrue and a created path with 40 lines. - THEN The returned proposal has
builds_owntrue and gives the created path 40 lines.
Requirement: The fields leave FIELDS_NOT_IN_FILES
FIELDS_NOT_IN_FILES SHALL hold only summary, pull_request_body and weakened_checks.
Scenario: The fields that no file holds
- WHEN
tests/roadmap/test_roadmap_plan_read.py::test_the_fields_that_no_file_holdsruns. - THEN The set equals
summary,pull_request_bodyandweakened_checks.
Requirement: Golden plan 3247 reads builds_own
The golden plan 3247 SHALL read back with builds_own true.
Scenario: Golden plan 3247
- WHEN
tests/roadmap/test_roadmap_plan_read.py::test_each_golden_plan_reads_backreads plan 3247. - THEN The read proposal has
builds_owntrue.
Requirement: Plan-head fixtures still read
read_change SHALL read each folder in tests/fixtures/roadmap/plan_heads/ with builds_own false and the value 1 for each created path.
Scenario: The plan-head fixtures read as before
- WHEN A test calls
read_changeon each folder intests/fixtures/roadmap/plan_heads/. - THEN Each read gives
builds_ownfalse and the value 1 for each created path.
Requirement: Affected roadmap suites pass
The stage, plan-check, implement-amend and plan-read suites SHALL pass with the updated snapshots.
Scenario: The affected roadmap tests
- WHEN
uv run devops ci test tests/roadmap/test_roadmap_plan_read.py tests/roadmap/implement/test_roadmap_implement_amend.py tests/roadmap/stage tests/roadmap/test_roadmap_plan_check.pyruns. - THEN The command exits 0.
Requirement: New reader tests fail on the base
The new reader tests SHALL fail on origin/main and pass on the branch.
Scenario: The fail-to-pass run
- WHEN
uv run devops ci fail-to-pass --base origin/mainruns fortest_builds_own_reads_back,test_created_line_estimates_read_backandtest_the_fields_that_no_file_holds. - THEN The command reports each of the three tests as failed on the base and passed on the branch.
Requirement: Docs check passes
docs/roadmap/plan-check.md SHALL pass uv run devops docs check after it names the New lines: line and the builds-own line.
Scenario: The docs check
- WHEN
uv run devops docs checkruns. - THEN The command exits 0.
Existing Tool Considered
The alternatives check of 2026-11-22 in the issue body records verdict none and names no tool; the block gives the reason and the Lacks: list. The plan Markdown is this project's own format. The proposal adds the two fields to the plan Markdown in stage_change.py and reads them in plan_read.py. Cost to build: 0.6 M tokens and 2 hours elapsed. Cost to keep: none. Cost to fix: about 0.1 M tokens.
Key questions
- How does a plan file record that the change builds its own tool?:
render_changewritesThis change builds its own tool.as the last line of## Existing Tool Consideredinproposal.mdwhenbuilds_ownis true.read_changesetsbuilds_owntrue when the line is present.read_changeremoves the line fromexisting_tool. A missing line gives false. (best practice) [sources: src/devops_cli/roadmap/stage/stage_change.py:729, src/devops_cli/roadmap/plan_read.py:496, AGENTS.md]- Chosen: A fixed line at the end of the section. The reader already parses that section. The absence of the line gives false with no new marker.
- Rejected: A hidden HTML comment marker. It adds a second marker and hides the cost mark from the proposal text.
- Rejected: A key in the
.openspec.yamlof the change folder. It changes the schema of the change folder and each reader of that file.
- How does a plan file record the line estimate of each created path?:
render_changewrites oneNew lines:line below theChanges:line of each group that creates a path. The line holds each created path in a code span and its integer line count, separated by,. The writer keeps the(new)mark on theChanges:line.read_changesetscreates_linesfrom that line. (best practice) [sources: src/devops_cli/roadmap/plan_read.py:110, src/devops_cli/roadmap/plan_read.py:387, src/devops_cli/roadmap/planned.py:110, src/devops_cli/roadmap/implement/implement_amend.py:150]- Chosen: One
New lines:line underChanges:. It keeps theChanges:line and the(new)mark unchanged for the other parsers. - Rejected: The count inside the
(new)mark. It changes every parser that matches the mark:created_paths,group_files, the amend check andplanned. - Rejected: A per-group block of front matter. It changes the task format and needs a new parser.
- Chosen: One
- What does the reader give for a created path with no
New lines:entry?:read_changegives 1 line to each created path that has noNew lines:entry. This keeps every plan written before this change readable. refactor(roadmap): end the kind inference of the plan reader #5218 writes 1 into each old plan and then refuses a missing entry. This item leaves the migration to refactor(roadmap): end the kind inference of the plan reader #5218. (best practice) [sources: src/devops_cli/roadmap/plan_read.py:393, src/devops_cli/roadmap/plan_read.py:409]- Chosen: Give 1 line now. It keeps every plan written before this change readable and matches the reader today.
- Rejected: Refuse a missing entry now. It refuses every plan written before this change.
- Rejected: Write 1 into old plans in this item. It adds the migration that refactor(roadmap): end the kind inference of the plan reader #5218 owns to this item.
- Does the added
New lines:line change theReads:line that_READSmatches?:_READSmatches theReads:line withre.Mand$. The addedNew lines:line does not match it. The reader still finds theReads:line. [sources: src/devops_cli/roadmap/plan_read.py:110] - Do the other parsers of the
(new)mark still work?:created_paths,group_files, the amend check andplannedread the(new)mark on theChanges:line. This change leaves that line and the mark unchanged. The other parsers still work. [sources: src/devops_cli/roadmap/plan_read.py:387, src/devops_cli/roadmap/planned.py:110, src/devops_cli/roadmap/implement/implement_amend.py:150] - Which fields leave
FIELDS_NOT_IN_FILES?:builds_ownandcreates_linesleaveFIELDS_NOT_IN_FILES. The set then holdssummary,pull_request_bodyandweakened_checks. (best practice) [sources: src/devops_cli/roadmap/plan_read.py:140, tests/roadmap/test_roadmap_plan_read.py]- Chosen: Remove both fields. The plan files now hold both values. The reader reports no loss for them.
- Rejected: Keep both fields. The reader would still report a loss for values that the plan files hold.
- How does the pull request show that the stored plan heads still read?: A test reads each folder in
tests/fixtures/roadmap/plan_heads/and assertsbuilds_ownfalse and the value 1 for each created path. The pull request cites that test run. A read of each open plan pull request head and each plan pull request closed in the last 14 days stays review evidence in the pull request comment. It needs live GitHub data. (best practice) [sources: tests/roadmap/test_roadmap_plan_read.py]- Chosen: Read the stored fixtures offline. The test runs offline. The fixtures hold the plan heads that exist.
- Rejected: Read each open and recently closed plan pull request head. It needs live GitHub data and a person. It cannot be an offline criterion.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
Watched files
A commit on the default branch that changes one of these files starts the next refine round.
src/devops_cli/roadmap/plan_read.pysrc/devops_cli/roadmap/stage/stage_change.py
Activity
dan-petty commentedon Nov 12, 2026
Both fix fields the stage writer does not persist into plan files, but #5205 targets the kind field and this candidate targets builds_own and creates_lines.devops-cli-service commentedon Nov 16, 2026
Alternatives check: none
Reason: Searches found spec-driven planning tools (OpenSpec, GitHub spec-kit) whose proposal/plan files hold prose, structure and task checklists, but none has a field for a "builds own tool" cost flag or per-path created-line estimates. The plan Markdown is this project's own format, and the project's reader/writer is the only thing that can persist these two fields, so no open tool covers the need.
Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-16. 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
Refine cannot set this item to Ready at 0857ee5 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/stage/stage_change.py,src/devops_cli/roadmap/plan_read.py,src/devops_cli/lang/en/messages.py.devops-cli-service commentedon Nov 17, 2026
Refine cannot set this item to Ready at 4d085f1 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
The next refine round also looks at the item again when a commit on the default branch changes one of these files:
src/devops_cli/roadmap/plan_read.py,src/devops_cli/roadmap/stage/stage_change.py,src/devops_cli/lang/en/messages.py.devops-cli-service commentedon Nov 18, 2026
Owner question: How does the pull request show that existing plan heads still read? (a person decides)
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
dan-petty commentedon Nov 20, 2026
Frozen on 2026-11-20. The stage, implement and fix-checks jobs grade under 60%, so the owner rule asks for a re-architecture before more fixes inside the current design (tracker #6519). This item is incremental work on those jobs, so its Dependencies section now names #6521 first. Stage and implement leave this item while #6521 is open. When the experiments of #6519 decide, a person closes #6521 (this item can then continue) or closes this item as not planned.
devops-cli-service commentedon Nov 21, 2026
Owner question: See the first point of Open questions in the section Proposed design of the body.
Options
Recommendation: Decide the question: only a person can answer it.
Evidence
devops-cli-service commentedon Nov 21, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies and Watched files in the section Proposed design of the body.