Repository navigation
Description
Problem or Motivation
The stage job never reads back the files that it pushes. No module under src/devops_cli/roadmap/stage/ imports plan_read. So #3981 pushed three manifest groups that the reader refuses, and only the advisory Plan Check job (.github/workflows/pr-title.yml:100-155) showed it. The stage attempt that wrote the plan got no failure. fix-plan got it.
The writer also accepts texts that the reader refuses. Two other groups that StageProposal and form_problems accept fail read_change with 'has both verify and process': a process that ends with 'verify that uv run devops ci docs passes' (_INLINE_VERIFY, src/devops_cli/roadmap/plan_read.py:63-65), and an implementation that holds the process mark (_split_process, plan_read.py:307-311).
A check needs a bound. A new failure class with no entry in RETRY_AFTER waits as ci_infra, 1 hour (src/devops_cli/roadmap/failure.py:174-181). _record_failures counts only plan_defect toward CONST_ROADMAP_STAGE_PLAN_DEFECT_LIMIT (src/devops_cli/roadmap/stage/stage.py:3094-3096). A stop in _settle comes before _keep (stage.py:1254-1258), so each retry is a full plan run, up to 21 planner calls (stage.py:1221-1232).
Proposed Solution & Architectural Design
- In
_Planner._settle, afteropenspec validatepasses (stage.py:1866-1868), read the rendered files withread_change. - Text error, back to the model. A
PlanReadErrormeans that the reader cannot parse a text._settlereturns a refusal of the new gateread(READ_GATEinsrc/devops_cli/roadmap/stage/stage_findings.py, the name that plan-recheck uses) with the reader reason, asVALIDATE_GATEdoes. The reply goes back to the model through the gate returns (roadmap.stage.gate_returns, at mostCONST_ROADMAP_STAGE_GATE_RETURNS_CEILING= 3). When the returns run out, the item fails withplan_defect, which waits 1 hour and counts toward the limit of 3, as today. - Fact mismatch, stop. The read succeeds, but a group (title, kind, reads, changes, creates, test, implementation, verify, process, documentation), the unchanged references or the criteria differ from
file_facts(proposal)(fix(roadmap): write and read the kind of each plan task group #5205). The specs are not compared, because_restoredputs back base scenarios that the proposal does not hold (fix(roadmap): a MODIFIED block that omits a scenario fails #4310). A mismatch is a defect of the writer or of the reader, and the model cannot fix it._settleraisesRoadmapPlanReadBackError(aRoadmapStageError) that names each group and field that differ, with no text of the plan. The model gets no return. The comparison is a pure function,plan_read.read_back_problems(files, proposal). - Bound. New class
plan_unreadable.CLASS_BY_EXCEPTIONmapsRoadmapPlanReadBackErrorto it, beforeRoadmapStageError.ACTION_BY_CLASSgiveswait.RETRY_AFTERgives 6 hours._record_failurescountsplan_unreadablewithplan_defecton the same body, so the third failure on one body returns the item to New with the comment that lists the differences. One item thus costs at most 3 plan runs on one body, at least 6 hours apart. The stage result line has the classplan_unreadable, so the stage job, which wrote the plan, gets the failure. - fix-plan.
revisegoes through the same_settle, so fix-plan pushes no plan that the reader misreads. A revision that fails the read-back gives the result of fix(roadmap): fix-plan records the true result of each attempt #5213 with the classplan_unreadableon the line:regatedwhen a gated plan exists (that plan passed the read-back in its own_settle), elsefailed. The attempt uses one of the 2 attempts on the head (CONST_ROADMAP_FIX_PLAN_HEAD_ATTEMPTS), so one head writes at most 2 such lines. - Dry run. The
pushcondition offix_plan_request_conditions(src/devops_cli/lang/en/messages.py) adds that the pushed plan reads back. The stage conditionmodel_correction('the change fails its checks') stays true, because the read is one of the checks. - Documents, written as merged: the module docstring of
stage.py(Refused plans),docs/ROADMAP_WORKFLOW.md(the class table at lines 189-209, the waits in the rowstage.failed_*, the rowstage.plan_defects),docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md:44('one of the 19FailureClassvalues' becomes 20),k8s/README.mditem 15 (the waits of the classes),docs/roadmap/stage.mdanddocs/roadmap/job-success.md(the class on afix_planline).
Target Subsystem
Roadmap: the stage planner (src/devops_cli/roadmap/stage/stage.py) and the failure taxonomy (src/devops_cli/roadmap/failure.py).
Existing Tool Considered
The fix reuses read_change and file_facts (#5205), the gate-return loop, RETRY_AFTER and the defect count of the stage job. It adds no library. A second copy of the reader marks in form_problems was considered and rejected: the reader is the one parser that decides, so the read gate cannot drift from it. Cost to build (estimate): 0.8 M tokens and 3 hours elapsed. Keep: one in-process read of each settled reply, a few milliseconds. Fix: about 0.2 M tokens for each mismatch that the check reports.
Acceptance Criteria
-
uv run pytest tests/roadmap/stage/test_roadmap_stage_plan.py::test_a_reply_whose_text_the_reader_refuses_goes_back_to_the_modelpasses for the two real texts above (inline verify at the end of aprocess; process mark in animplementation). The second reply passes, and the item is staged. -
uv run pytest tests/roadmap/stage/test_roadmap_stage_plan.py::test_a_valid_plan_of_each_kind_passes_the_read_backpasses forbehavior,manifestandother. -
uv run pytest tests/roadmap/test_roadmap_plan_read.py::test_read_back_problems_names_each_fact_that_differspasses with one case for each compared fact, and gives no problem for a pair that differs only in the specs that_restoredadds. -
uv run pytest tests/roadmap/stage/test_roadmap_stage_failure_class.py::test_a_read_back_error_has_the_class_plan_unreadablepasses. -
uv run pytest tests/roadmap/stage/test_roadmap_stage_retry_after.py::test_plan_unreadable_waits_six_hourspasses. -
uv run pytest tests/roadmap/stage/test_roadmap_stage_plan_defect_limit.py::test_plan_unreadable_counts_toward_the_limitpasses: the third failure on one body returns the item to New with the comment. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_revision_that_does_not_read_back_is_not_pushedpasses in two cases. With no gated plan, the result isfailedwith the classplan_unreadable, and no push occurs. With a gated plan, the result isregatedwith that class, and only the gated plan is pushed. -
uv run pytest tests/commands/test_roadmap_step_fix_plan.py::test_the_dry_run_makes_no_request_and_lists_the_reads_and_the_writesgives the push condition with the read-back. -
uv run devops ci test tests/roadmap/test_roadmap_failure.py tests/roadmap/stage tests/roadmap/steps tests/prometheus/test_implement_failure_labels.pypasses. -
uv run devops ci fail-to-pass --base origin/mainshows that each new test above fails on the base and passes on the head, except the guardtest_a_valid_plan_of_each_kind_passes_the_read_back, which passes on both. 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: for each open plan PR head and each plan PR closed in the last 14 days that the reader reads, the read-back check (read, render with one date, read,
read_back_problems) on the branch. The table shows 0 fact mismatches and lists each text error. A script under.data/agent/scratch/makes it. After the merge, the stage result lines withclass=plan_unreadableover 7 days add one row (0 expected). -
uv run devops docs checkpasses.
Files
- src/devops_cli/roadmap/stage/stage.py
- src/devops_cli/roadmap/stage/stage_findings.py
- src/devops_cli/roadmap/plan_read.py
- src/devops_cli/roadmap/plan_recheck.py (imports
READ_GATE) - src/devops_cli/roadmap/failure.py
- src/devops_cli/exceptions/roadmap.py
- src/devops_cli/lang/en/messages.py
- tests/roadmap/stage/test_roadmap_stage_plan.py
- tests/roadmap/stage/test_roadmap_stage_failure_class.py
- tests/roadmap/stage/test_roadmap_stage_retry_after.py
- tests/roadmap/stage/test_roadmap_stage_plan_defect_limit.py
- tests/roadmap/test_roadmap_plan_read.py
- tests/roadmap/test_roadmap_failure.py
- tests/roadmap/steps/test_roadmap_fix_plan.py
- tests/commands/test_roadmap_step_fix_plan.py
- docs/ROADMAP_WORKFLOW.md
- docs/adr/0019-a-decision-step-asks-jev-short-closed-questions-about-evidence-that-tools-extract.md
- docs/roadmap/stage.md
- docs/roadmap/job-success.md
- k8s/README.md (item 15)
- openspec/specs/roadmap-failure-taxonomy/spec.md
- openspec/specs/roadmap-stage/returns/spec.md
Dependencies
The stage job leaves this item out until that issue closes. This item needs file_facts and the explicit kind of the reader fix, and the results of the fix-plan fix. The PRs change stage.py, messages.py and the same documents.
Related
#3981, #4060, #4491, #4802, #4310, #3065.
Source: #5211
Activity
dan-petty commentedon Nov 12, 2026
the stage job calls read_change on the rendered plan files before pushing and fails if the reader cannot parse themas the change that both ask for.Both items ask the stage to read back each plan with read_change before the push and fail on a parse error.A person closes one of the two if that is so.chore(main): release 0.156.0 (#5856)
devops-cli-service commentedon Nov 15, 2026
Released in v0.156.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.156.0
devops-cli-service commentedon Nov 15, 2026
Live since 2026-11-15 16:55 UTC