Repository navigation
Description
Problem or Motivation
#5205 keeps one old-form path in the reader: a group with no Kind: line gets its kind by inference. #5217 keeps another: a created path with no New lines: entry reads as 1 line. The project is alpha, so an old path goes and no shim stays (AGENTS.md). The inference is also weak: a case-first group that changes a path under src/ reads as behavior even when the writer meant manifest. It then gets the behavior-only gates (src/devops_cli/roadmap/stage/stage_paths.py:602, 651-653; src/devops_cli/roadmap/stage/stage_change.py:1270-1273, 1758-1767) and loses the manifest verify rule (src/devops_cli/roadmap/stage/stage_form.py:92-112).
The mechanical rewrite of the project cannot remove the old form as it is:
plan-recheck --confirmwrites only the records with the resultrewrite(src/devops_cli/commands/roadmap.py:930-934).- A folder gets
rewriteonly when the rewritten plan passes every gate andopenspec validate(src/devops_cli/roadmap/plan_recheck.py:376-386). - At 8fdeea0, 18 active folders of open issues read. Only 3428, 3443 and 3445 pass the gates, and 2742 already has
Kind:lines. The other 14 fail a gate that does not depend on the form (spec-delta, content, paths, eval-replay or security): 3075, 3244, 3253, 3296, 3318, 3320, 3391, 3394, 3427, 3429, 3446, 3485, 3574 and 3991. 3075 and 3244 also create paths.
So a form rewrite through the result rewrite leaves 14 folders in the old form, and a strict reader then refuses folders that main reads today. A check through plan-recheck does not show this, because the command applies the rewrite in memory before it reads (plan_recheck.py:345-348).
Proposed Solution & Architectural Design
Do as #3556 and #3912 did for the old verification form, with a form edit that does not depend on the gates.
plan_rewrite.form_edits(root, files)gives the form edits alone: for each group with noKind:line, the line with the kind of the inference of fix(roadmap): write and read the kind of each plan task group #5205; for each created path with noNew lines:entry, the value 1. A form edit changes no fact: the reader gives the same proposal before and after it.plan_recheckapplies the form edits in memory before the read, and records them asformon the record of each folder of an open issue that reads with them, whatever its gate result.rewrite_planholds them too, so arewriterecord writes both.--confirmwritesformof each record andrewriteof eachrewriterecord (src/devops_cli/commands/roadmap.py). The module docstring ofplan_recheck.pyanddocs/roadmap/plan-recheck.mdsay so.- In this PR,
uv run devops roadmap plan-recheck --source <checkout> --confirmwrites the form edits of each active folder on main in the old form. The edit changes only the files line and adds one line, so a task line that an implement branch ticks does not conflict. - The reader then refuses a group with no
Kind:line and a created path with no estimate. The reason names the folder and the commanddevops roadmap plan-recheck --source <checkout> --confirm, which writes the form edits on a checkout of main. - Open plan heads in the old form. No person or workstation pushes to a bot plan branch, and no agent closes one. A head leaves the old form when fix-plan pushes a revision or a gated plan (the writer of fix(roadmap): write and read the kind of each plan task group #5205), or when the owner merges or closes it in the review that each plan PR gets. A folder that the owner merges after this PR gets its form edits from step 5 in an agent PR on main. Start condition: the validation table shows no open plan PR head in the old form, so fix-plan and implement never meet a head that the new reader refuses.
Target Subsystem
Roadmap: the plan reader (src/devops_cli/roadmap/plan_read.py) and the mechanical rewrite (src/devops_cli/roadmap/plan_rewrite.py, src/devops_cli/roadmap/plan_recheck.py).
Existing Tool Considered
plan_rewrite.py and devops roadmap plan-recheck --confirm (#3556, #3832) are the mechanical rewrite of the project. This issue gives them a write path for form edits. No other tool is needed. 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_rewrite.py::test_a_group_with_no_kind_line_gets_the_inferred_kindand::test_a_created_path_with_no_estimate_gets_one_linepass. -
uv run pytest tests/roadmap/test_roadmap_plan_rewrite.py::test_a_form_edit_changes_no_factpasses for each fixture oftests/fixtures/roadmap/plan_heads/and each old-form folder of the rewrite: the read of the edited files equals the read that the base reader gave of the old files, kept as a snapshot. -
uv run pytest tests/roadmap/test_roadmap_plan_recheck.py::test_a_folder_that_fails_a_gate_gets_its_form_editspasses: anew-planfolder that reads getsform, and--confirmwrites it. -
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_a_group_with_no_kind_line_is_a_read_errorand::test_a_created_path_with_no_estimate_is_a_read_errorpass, and the reason names the folder and the command. -
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_a_plan_head_reads_with_its_kindsreads the form edit of each fixture with the kinds of fix(roadmap): write and read the kind of each plan task group #5205. - Raw-file check, by a script under
.data/agent/scratch/: for each active folder of an open issue thatread_changeof origin/main reads,read_changeof the raw files on the branch reads it with the same facts. At 8fdeea0 that is 18 folders. A PR comment gives the count on the base of the PR, 0 refused and 0 changed facts. -
uv run devops roadmap plan-recheck --source <checkout> --jsonon the branch gives noreadrefusal that origin/main does not give. -
uv run devops ci fail-to-pass --base origin/mainshows that the two read-error tests andtest_a_folder_that_fails_a_gate_gets_its_form_editsfail on the base and pass on the head. Each new test imports a new name inside its body, so the module collects on the base. The PR cites the run. - Validation table in a PR comment: each open plan PR head and each plan PR closed in the last 14 days, with the read on origin/main and on the branch and a column for the old form. No open head holds the old form.
-
uv run devops ci test tests/roadmapanduv run devops docs checkpass.
Files
- src/devops_cli/roadmap/plan_rewrite.py
- src/devops_cli/roadmap/plan_recheck.py
- src/devops_cli/commands/roadmap.py (the write of
form) - src/devops_cli/roadmap/plan_read.py
- src/devops_cli/lang/en/messages.py
- tests/roadmap/test_roadmap_plan_rewrite.py
- tests/roadmap/test_roadmap_plan_read.py
- tests/roadmap/test_roadmap_plan_recheck.py
- the command test of
plan-recheck --confirm - openspec/changes//tasks.md (the form edits)
- docs/roadmap/plan-recheck.md
- docs/roadmap/plan-check.md
- openspec/specs/roadmap-plan-check/spec.md
- openspec/specs/roadmap-plan-recheck/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): plan files keep the cost mark and line estimates #5217
The stage job leaves this item out until that issue closes. The start condition of the solution must also hold before the work starts.
Related
Source: #5211
Alternatives check of 2026-11-22: not-applicable.
Class: refactor, no search.
Tool: none found.
Proposed design
Problem statement
The plan reader infers a group kind and a created-path line count. #5205 and #5217 keep these old-form paths. The inference gives a wrong kind to a case-first group that changes a path under src/. That group gets behavior-only gates and loses the manifest verify rule. A strict reader would refuse 14 active folders that main reads today, because plan-recheck --confirm writes only folders whose rewrite passes every gate. The change writes form edits alone, then makes the reader strict.
Acceptance criteria
Requirement: Form edit writes a missing kind
plan_rewrite.form_edits SHALL write the kind that the #5205 inference gives into each group that has no Kind: line.
Scenario: test_a_group_with_no_kind_line_gets_the_inferred_kind
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_rewrite.py::test_a_group_with_no_kind_line_gets_the_inferred_kindruns. - THEN The test passes and the edited group holds the inferred kind.
Requirement: Form edit writes a missing estimate
plan_rewrite.form_edits SHALL write New lines: 1 for each created path that has no New lines: entry.
Scenario: test_a_created_path_with_no_estimate_gets_one_line
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_rewrite.py::test_a_created_path_with_no_estimate_gets_one_lineruns. - THEN The test passes and the edited created path holds
New lines: 1.
Requirement: Form edit changes no fact
A form edit SHALL leave the proposal that the reader gives unchanged.
Scenario: test_a_form_edit_changes_no_fact
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_rewrite.py::test_a_form_edit_changes_no_factruns for each fixture oftests/fixtures/roadmap/plan_heads/and each old-form folder of the rewrite. - THEN The read of the edited files equals the read that the base reader gave of the old files, kept as a snapshot.
Requirement: A folder that fails a gate gets form edits
plan_recheck SHALL apply the form edits in memory before the read and record them as form on each open-issue folder that reads with them, whatever its gate result.
Scenario: test_a_folder_that_fails_a_gate_gets_its_form_edits
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_recheck.py::test_a_folder_that_fails_a_gate_gets_its_form_editsruns. - THEN A
new-planfolder that reads getsform, and--confirmwrites it.
Requirement: Confirm writes form and rewrite edits
devops roadmap plan-recheck --confirm SHALL write the form edits of each record and the rewrite edits of each rewrite record, and the module docstring and docs/roadmap/plan-recheck.md SHALL state this.
Scenario: test_confirm_writes_form_and_rewrite
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_recheck.py::test_confirm_writes_form_and_rewriteruns. - THEN The test passes and the checkout holds both the form edits and the rewrite edits.
Requirement: A group with no kind line is a read error
The plan reader SHALL refuse a group with no Kind: line and name the folder and the command devops roadmap plan-recheck --source <checkout> --confirm in the reason.
Scenario: test_a_group_with_no_kind_line_is_a_read_error
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_a_group_with_no_kind_line_is_a_read_errorruns. - THEN The test passes and the reason names the folder and the command.
Requirement: A created path with no estimate is a read error
The plan reader SHALL refuse a created path with no New lines: entry and name the folder and the command in the reason.
Scenario: test_a_created_path_with_no_estimate_is_a_read_error
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_a_created_path_with_no_estimate_is_a_read_errorruns. - THEN The test passes and the reason names the folder and the command.
Requirement: A plan head reads with its kinds
read_change SHALL read each plan-head fixture after its form edit with the kinds of #5205.
Scenario: test_a_plan_head_reads_with_its_kinds
- WHEN
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_a_plan_head_reads_with_its_kindsruns. - THEN Each fixture reads with the expected kinds.
Requirement: Raw files keep the same facts
The branch SHALL read the raw files of each active old-form folder with the same facts as read_change of origin/main.
Scenario: raw-file form comparison
- WHEN A script under
.data/agent/scratch/reads each active old-form folder on the branch and onorigin/main. - THEN The PR comment gives the count, 0 refused and 0 changed facts.
Requirement: Plan-recheck adds no read refusal
uv run devops roadmap plan-recheck --source <checkout> --json SHALL report no read refusal on the branch that origin/main does not report.
Scenario: plan-recheck read refusal comparison
- WHEN
uv run devops roadmap plan-recheck --source <checkout> --jsonruns on the branch and onorigin/main. - THEN The branch has no read refusal that
origin/maindoes not have.
Requirement: New tests fail on the base and pass on the head
uv run devops ci fail-to-pass --base origin/main SHALL show that the two read-error tests and test_a_folder_that_fails_a_gate_gets_its_form_edits fail on the base and pass on the head.
Scenario: fail-to-pass run
- WHEN
uv run devops ci fail-to-pass --base origin/mainruns after each new test imports a new name inside its body. - THEN The command shows that the three tests fail on the base and pass on the head, and the PR cites the run.
Requirement: Validation table shows no open head in the old form
The PR comment SHALL list each open plan PR head and each plan PR closed in the last 14 days with its read on origin/main, its read on the branch and its old-form state.
Scenario: validation table
- WHEN A script under
.data/agent/scratch/lists each open plan PR head and each plan PR closed in the last 14 days with its read onorigin/main, its read on the branch and its old-form state. - THEN The PR comment gives the table, and no open head holds the old form.
Requirement: Roadmap tests and docs check pass
uv run devops ci test tests/roadmap and uv run devops docs check SHALL pass.
Scenario: roadmap test and docs check
- WHEN
uv run devops ci test tests/roadmapanduv run devops docs checkrun. - THEN Both commands pass.
Existing Tool Considered
The alternatives check of 2026-11-22 in the issue body gives not-applicable for a refactor and names no tool. The change therefore uses the project's own plan_rewrite.py and devops roadmap plan-recheck --confirm. It adds a form-edit write path to them. The written cost to build is 0.6 M tokens and 2 hours elapsed. The cost to fix is about 0.1 M tokens, and the cost to keep is none.
Key questions
- Should
plan_rewrite.form_editsbe a separate function from the gate rewrite?: Yes. Addplan_rewrite.form_edits(root, files). It returns only the missingKind:line and the missingNew lines:edit.plan_recheckapplies it before the read and records it whatever the gate result. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py, src/devops_cli/roadmap/plan_recheck.py, docs/roadmap/plan-recheck.md]- Chosen: Separate
form_editsfunction. It letsplan_recheckrecord form edits without a passing gate. - Rejected: Embed form edits in
rewrite_plan. A folder that fails a gate gets no form edit, so 14 active folders keep the old form. - Rejected: No form edits; make the reader strict. The strict reader refuses active folders that
mainreads today.
- Chosen: Separate
- Should
plan_recheckrecord form edits on a folder that fails an unrelated gate?: Yes.plan_recheckapplies the form edits in memory before the read. It recordsformon each open-issue folder that reads with them, whatever its gate result. (best practice) [sources: src/devops_cli/roadmap/plan_recheck.py, src/devops_cli/commands/roadmap.py, docs/roadmap/plan-recheck.md]- Chosen: Record
formfor each open-issue folder that reads. It removes the old form without a gate result. - Rejected: Record
formonly forrewriterecords. 14 active folders fail an unrelated gate and keep the old form. - Rejected: Record
formfor every folder. A closed issue folder needs no write, and the issue says open issues only.
- Chosen: Record
- Should
devops roadmap plan-recheck --confirmwrite bothformandrewriteedits?: Yes. It writes theformedits of each record and therewriteedits of eachrewriterecord. The module docstring anddocs/roadmap/plan-recheck.mdsay so. (best practice) [sources: src/devops_cli/commands/roadmap.py, src/devops_cli/roadmap/plan_recheck.py, docs/roadmap/plan-recheck.md]- Chosen: Write both
formandrewrite. It writes the form edits of a folder that fails a gate and the gate rewrite of arewritefolder. - Rejected: Write
rewriteonly. It leaves 14 active folders in the old form. - Rejected: Write
formonly. It drops the gate rewrite thatplan-recheckalready writes.
- Chosen: Write both
- Should the plan reader refuse a group with no
Kind:line?: Yes. The reader refuses the group and names the folder and the commanddevops roadmap plan-recheck --source <checkout> --confirmin the reason. This ends the inference and the old path. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/stage/stage_paths.py, src/devops_cli/roadmap/stage/stage_form.py, AGENTS.md]- Chosen: Refuse the group. It ends the inference and the old path.
- Rejected: Keep the inference. It keeps a wrong kind for a case-first group under
src/and gives behavior-only gates. - Rejected: Warn and infer. A warning leaves the wrong kind in the proposal.
- Should the plan reader refuse a created path with no
New lines:entry?: Yes. The reader refuses the path and names the folder and the command in the reason. This ends the default of 1 line and tells the writer. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/plan_rewrite.py]- Chosen: Refuse the path. It ends the default of 1 line and tells the writer.
- Rejected: Keep the default of 1 line. It keeps the old path and gives no signal to the writer.
- Rejected: Warn and use 1 line. A warning leaves the old path in the plan.
- What value does a form edit write for a created path with no estimate?: The form edit writes
New lines: 1. The old reader used 1, so the fact does not change. (best practice) [sources: src/devops_cli/roadmap/plan_read.py, src/devops_cli/roadmap/plan_rewrite.py]- Chosen: Write
New lines: 1. It is the value that the old reader used, so the fact does not change. - Rejected: Write
New lines: 0. It changes the fact and can fail a gate. - Rejected: Ask a person. The old reader gives 1, so the value is known.
- Chosen: Write
- Should a form edit change only the form lines and add one line?: Yes. The form edit changes only the form line and adds one line. It leaves each task line unchanged, so a task line that an implement branch ticks does not conflict. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py, docs/roadmap/plan-recheck.md]
- Chosen: Edit only the form lines and add one line. A task line that an implement branch ticks does not conflict.
- Rejected: Rewrite the whole plan. It conflicts with a task line that an implement branch ticks.
- Rejected: Ask a person. The form edit is mechanical and changes no fact.
- How does the change keep open plan heads readable while the reader becomes strict?: The PR writes form edits to each active folder on
main.fix-planwrites the new form on a revision or a gated plan. The start condition is that no open plan PR head is in the old form. The owner merges or closes each such head. (best practice) [sources: docs/roadmap/plan-recheck.md, src/devops_cli/roadmap/plan_recheck.py, src/devops_cli/commands/roadmap.py]- Chosen: Write form edits on main and clear open heads first. It keeps 0 heads broken and removes the old form from active folders.
- Rejected: Ship the strict reader alone. It refuses active folders that
mainreads today and breaks plan heads. - Rejected: Keep the inference for open heads. It keeps the old path and the wrong kind.
- Which open, maintained tool or library covers the need?: The alternatives check of 2026-11-22 in the issue body gives
not-applicablefor a refactor and names no tool. The change uses the project's ownplan_rewrite.pyanddevops roadmap plan-recheck --confirm. The written cost to build is 0.6 M tokens and 2 hours elapsed. The cost to fix is about 0.1 M tokens, and the cost to keep is none. (best practice) [sources: src/devops_cli/roadmap/plan_rewrite.py, src/devops_cli/roadmap/plan_recheck.py, src/devops_cli/commands/roadmap.py]- Chosen: Use the project rewrite. It is the existing mechanical rewrite and needs a write path for form edits.
- Rejected: Use an external tool or library. The alternatives check found no tool for the internal plan form.
- Rejected: Build a new rewrite. The project already holds
plan_rewrite.pyandplan-recheck --confirm.
Fit
Fits in one pull request.
Suspected block
An open plan PR head in the old form. The owner merges or closes each such head, or fix-plan pushes a revision or a gated plan.
Activity
dan-petty commentedon Nov 12, 2026
Both work on the plan reader's Kind handling; #5205 adds the Kind line writing and reading, this candidate removes the old inference fallback that #5205 left behind.dan-petty commentedon Nov 12, 2026
Scope note from #5205 (PR #5262), 2026-11-12:
Kind: documentation.line (ef3ecb7), and it reads on main today. To keep every head that reads today readable (owner rule: validate against the Service plan PRs; 0 heads broken), PR fix(roadmap): write and read the kind of each plan task group #5262 reads a word that is no kind as the old form, by inference, and does not refuse it. Its test istest_a_word_that_is_no_kind_reads_as_the_old_form.Kind:word that is no kind, with a reason that names the word and the known kinds; (2) in the rewrite of old plans throughplan_rewrite.py, replace such a word with the kind that the inference gives, before the refusal ships._scenario_problemscounts the tests ofbehaviorgroups only, not the cases ofmanifestgroups. Check it here or file it.devops-cli-service commentedon Nov 16, 2026
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-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.
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
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.