Repository navigation
Description
Problem or Motivation
The fix-plan step logs results that did not occur, and it loses work.
- Unreadable plan. On
PlanReadErrorthe step drops the reason. Its line says that a review found 0 findings before and 0 after, and that the comment listed 0. But no review ran, and the step did not read the comment (src/devops_cli/roadmap/steps/fix_plan.py:584-593, 610). The class isplan_defect, the attempt uses 1 of the 2 attempts on the head, and the line counts against thefix_plangrade. Job fix-plan-validate-4963 logged this line after 90 s. - Failed repair.
revise_planbuildsPlanRevision(failure)with nobefore(src/devops_cli/roadmap/stage/stage.py:2584-2589). A run oftest_a_failed_plan_run_records_the_attempt_and_writes_nothing_elselogsopen=1in the review and then 'found 0 open finding(s) before the repair'. - Failure before the review. The gate returns run out (
stage.py:1449-1458), or the model call of the new first reply fails (stage.py:1403-1405). The line then reports a review that did not run. - Stop before the review. A false premise, an open blocker or a head over the budget logs 0 before and 0 after (
stage.py:1297-1302)._failuregivesplan_defecttoBlocked(fix_plan.py:467-473). - Lost gated plan. When the checks refuse the head,
_gatedgets a new plan from the planner (stage.py:1386-1406). With no open finding,revisereturns it with no repair (stage.py:1312-1313), and_settlepushes only whenbeforeis not 0 (fix_plan.py:498-500). The plan is also lost when the repair or the review after the gate fails or goes over the budget (stage.py:1316-1317, 1323, 2584-2589). Live case: Job fix-plan-validate-4917 ran 2,387 s and 7,567,057 tokens (plan_calls 3, gate_returns 2) and endedclearedwith no push. docs(openspec): plan #4472 Size narrowed test workers by collected tests #4917 lost the label and keeps a plan that the current checks refuse. - False success.
clearedwith no push is a success (src/devops_cli/roadmap/job_result.py:76). A repair that gives the same plan, with a second review that finds 0, also endsclearedand pushes. - Screen. When
stage.verify_screenacts,_reviewskips the model review (stage.py:1679-1680), so the head review counts 0. - Stale documents.
k8s/README.mditem 23 and thefix-planrow of ADR 0021 section 8 ('With no such finding, one model review') say that the step reviews the head only when no comment lists a finding (fix(roadmap): fix-plan compares the revision with a review of the head #5150 changed that).docs/ROADMAP_WORKFLOW.md:143lists four results. The dry-run conditions (fix_plan_request_conditionsinsrc/devops_cli/lang/en/messages.py) push only on fewer open findings.
Proposed Solution & Architectural Design
Change fix_plan.py and the revise path of stage.py in one PR.
- Read before the marks. The step reads the head plan after the fetch and the branch check, and before the attempt marks. On
PlanReadErrorthe result isunreadable: the step writesfix_plan.atandfix_plan.result, and it does not add tofix_plan.attempts. It logs one WARNING with the path and the reason (masked withredact_text, cut to 500 characters) and adds 1 todevops_cli_roadmap_fix_plan_totalwithresult=unreadable. It writes noroadmap job result:line, because the defect is in the writer or the reader and not in fix-plan, so thefix_plangrade does not change. fix(roadmap): stage reads each plan back before the push #5214 charges such a defect to the stage job. The 6-hour wait offix_plan.atspaces the reads, so a release that fixes the reader reads the plan at the next due round. A read error does not go to the planner, because the planner needs aStageProposal. - One pass (fix(roadmap): fix-plan compares the revision with a review of the head #5150).
beforeis the open findings of the review of the head in this attempt.afteris the open findings of the last review of the revision in this attempt. The findings of the last plan comment have their own count,comment. They go to the planner only with a finding of the head review, as today. No result compares the comment with a review. - Keep the gated plan.
PlanRevisiongetsgated: StagedChange | Noneandreviewed: bool. The planner keeps the gated head and the open findings of the head review in attributes, and the except block ofrevise_plancopies both into the failed revision.gatedis set when the gated head is not the same plan as the read head. - Same plan.
same_plan(a, b)is true whenrender_changegives the same files for both, with one target and one date. So theKind:line, the date and the fields that no file holds are no change. - Results, in this order:
stopped: a false premise, an open blocker or a head over the budget stops the item before a gated plan exists. The line hasstop=premise|blocked|over_budget(namesoflog_job_result) and the classpremise_falsefor a false premise. The label stays, and the step posts one fix-plan comment with the evidence. It does not return the item to New: ADR 0021 section 8 rule 1 lets a row write only its own record keys and its own marked comments, and the Status is not a key of fix-plan. A person decides.failed: a model call or the gate fails before a gated plan exists, or a step after the gate fails andgatedis None. The line has the class of theStageFailure. No push, and the label stays.revisedorcleared: a repair ran, the revision is not the same plan as the gated head, andafteris less thanbefore. The step pushes the revision. The result isclearedwhenafteris 0 (the label goes), elserevised.regated: else, whengatedis set. The step pushes the gated plan. The label goes only when the head review ran,beforeis 0 and no step failed. A failure after the gate keeps its class on the line, for exampleresult=regated class=provider.dismissed: else, when the head review ran andbeforeis 0. No push. The label goes. The comment lists each finding of the last plan comment as dismissed.unchanged: else. No push. The label stays.
A stop of the Service ends the attempt with no push, as today.
- Lines and counts. The attempt line has one template for each path: stopped before the review (with the stop), failed before the review (step, class, masked reason), failed after the review (the same, and
before), and reviewed (before, andafterwhen a review of a revision ran). The result line has the counts ofStageAttempt(plan_calls,gate_returns,verify_rounds,tokens,seconds) andcomment,beforeonly when the head review ran, andafteronly when a review of a revision ran. A line leaves out a count that the attempt cannot measure and never writes 0 for it, which is the rule of fix(roadmap): leave out changed intake candidates and count plan calls #5166. A success line that lacks a count ofFIRST_PASS_LIMITSis no first pass (_is_first_pass,src/devops_cli/roadmap/job_grade_report.py:318-322), so a missing count never adds a first pass. - Grades.
SUCCESS_RESULTS[FIX_PLAN]stays{revised, cleared}.regated,dismissed,unchanged,stoppedandfailedare no success, because none of them repaired a finding of the review of the same pass. - Screen.
_reviewgets a flag that skips the screen, and the head review of fix-plan sets it. - Comments. New texts for
regated,dismissedandstopped. - Dry run.
fix_plan_requests(src/devops_cli/roadmap/request_plan.py:859-905) lists the read of the head before the attempt marks, the marks of an unreadable head, and the new conditions of the push and of the label. - Documents, written as merged: the module docstring of
fix_plan.py, the docstrings ofrevise,revise_planandPlanRevision, the comment onSUCCESS_RESULTS, thefix-planrow of ADR 0021 section 8 (Work: the head review runs in each attempt, and the results and their pushes; Marker: the read of the head comes before the marks, and an unreadable head writes onlyfix_plan.atandfix_plan.result),docs/roadmap/job-success.md(rowfix_plan),docs/roadmap/stage.md(The fix-plan step),docs/ROADMAP_WORKFLOW.md:142-143(the values offix_plan.result, and the keys of an unreadable head),k8s/README.mditem 23, the description ofdevops_cli_roadmap_fix_plan_total(src/devops_cli/telemetry/instruments.py:349) anddocs/TELEMETRY.md. - Known limit. A revision that is not the same plan as the gated head and whose review counts fewer findings is
revisedorcleared, also when only review variance lowered the count (fix(roadmap): fix-plan compares the revision with a review of the head #5150). No string rule separates the two cases:whereof a finding is free text, and a quote can come from the issue or a cited file (src/devops_cli/roadmap/stage/stage_verify.py:88-97, 298-312).same_planremoves the identical case here. feat(roadmap): fix-plan asks if each finding still holds #5215 adds a decision check of each finding of the head review on the revision.
Target Subsystem
Roadmap: the step fix-plan (src/devops_cli/roadmap/steps/fix_plan.py) and the revise path of the stage planner (src/devops_cli/roadmap/stage/stage.py).
Existing Tool Considered
No open tool holds the result rules of this step. The fix uses render_change, log_job_result and redact_text of the project. Cost to build (estimate): 1.2 M tokens and 4 hours elapsed. Keep: the new tests add about 20 s to CI. Fix: about 0.2 M tokens for each wrong result.
Acceptance Criteria
-
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_an_unreadable_head_writes_no_result_line_and_uses_no_attempt: the result isunreadable, the WARNING namestasks.mdand the reason, noroadmap job result:line occurs,fix_plan.attemptsdoes not change,fix_plan.atis written, no model call occurs, and the counter hasresult=unreadable. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_an_unreadable_head_waits_six_hours: a selection less than 6 hours later leaves the item out. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_failed_repair_keeps_the_findings_of_the_head_review(setup oftest_a_failed_plan_run_records_the_attempt_and_writes_nothing_else): the line givesbefore=1and names the step and the class. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_gate_failure_before_the_review_has_no_review_counts: the gate returns run out, the result isfailed, and the line has nobeforeand noafter. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_stop_before_the_review_is_stopped_with_its_namepasses for a false premise (classpremise_false), an open blocker and a head over the budget. The label stays, and one fix-plan comment holds the evidence. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_gated_plan_is_pushed_when_the_repair_fails: the checks refuse the head, the new reply passes, the review finds 1, and the repair raisesAIClientError. The result isregatedwith classprovider, one commit is pushed, and the label stays. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_gated_plan_that_differs_is_pushed_after_a_clean_review: the result isregated, one commit is on the latest main, the label goes, and theregatedcomment is posted. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_repair_that_returns_the_same_plan_is_unchanged:before=1, the planner returns the head plan, and the second review finds 0. The result isunchanged, no push occurs,success=false, and the label stays. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_a_clean_head_with_listed_findings_is_dismissedreplacestest_a_head_plan_with_no_open_finding_loses_the_label_and_gets_no_commit: no commit, the label goes, the result isdismissed,success=false, and the comment lists the listed findings. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py::test_the_head_review_does_not_take_the_screenpasses with the screen in modeonand the bandcontinue. -
uv run pytest tests/roadmap/test_job_result.py::test_fix_plan_counts_only_a_pushed_repair_as_successpasses. -
uv run pytest tests/roadmap/steps/test_roadmap_fix_plan.py -k replaypasses on real fixtures intests/fixtures/roadmap_fix_plan/: the head of docs(openspec): plan #4472 Size narrowed test workers by collected tests #4917 at ba8cc66 and the stage comment of fix(ci): a narrowed ci test runs many slow tests serially #4472 (the checks refuse the head, and the review is clean) endregatedwith a push, neverclearedwith no push. The heads of docs(openspec): plan #2968 Emit inbox gauges and add the inbox panel #4963 (9c4b2cf) and docs(openspec): plan #4697 Keep one metric stream per workload #5032 (7fd165f) with the comments of feat(roadmap): Emit inbox gauges, add panel, show digest line #2968 and fix(telemetry): keep one metric stream per workload #4697 read, and the head review runs. -
uv run pytest tests/commands/test_roadmap_step_fix_plan.py::test_the_dry_run_makes_no_request_and_lists_the_reads_and_the_writeslists the read of the head before the marks and the new conditions. -
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 these guards, which pass on both:test_an_unreadable_head_waits_six_hours(the base writesfix_plan.atbefore the read,fix_plan.py:579),test_fix_plan_counts_only_a_pushed_repair_as_success, and the replay cases of docs(openspec): plan #2968 Emit inbox gauges and add the inbox panel #4963 and docs(openspec): plan #4697 Keep one metric stream per workload #5032. 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:
uv run devops roadmap step fix-plan --pull <n>with no--confirm(no model call, no write) on origin/main and on the branch, for each open plan PR: selected, or the reason that leaves it out. After the merge, the App Jobs of the repair of docs(openspec): plan #2968 Emit inbox gauges and add the inbox panel #4963, docs(openspec): plan #4697 Keep one metric stream per workload #5032 and docs(openspec): plan #4472 Size narrowed test workers by collected tests #4917 add their rows. -
uv run devops docs generateleaves no diff, anduv run devops docs checkpasses.
Files
- src/devops_cli/roadmap/steps/fix_plan.py
- src/devops_cli/roadmap/stage/stage.py
- src/devops_cli/roadmap/job_result.py (the comment on the success rule)
- src/devops_cli/roadmap/request_plan.py
- src/devops_cli/lang/en/messages.py
- src/devops_cli/telemetry/instruments.py
- tests/roadmap/steps/test_roadmap_fix_plan.py
- tests/roadmap/steps/test_roadmap_fix_plan_comment.py
- tests/roadmap/test_job_result.py
- tests/commands/test_roadmap_step_fix_plan.py
- tests/fixtures/roadmap_fix_plan/ (the real heads and comments)
- docs/adr/0021-the-roadmap-service-is-a-webhook-router-cluster-pods-run-the-roadmap-jobs-and-valkey-holds-their-shared-state.md (section 8, the fix-plan row)
- docs/roadmap/job-success.md
- docs/roadmap/stage.md
- docs/ROADMAP_WORKFLOW.md
- docs/TELEMETRY.md
- k8s/README.md (item 23)
- openspec/specs/roadmap-stage/fix-plan/spec.md
Dependencies
The stage job leaves this item out until that issue closes (body_dependencies, src/devops_cli/roadmap/refine/refine.py:1119-1128). The replay fixtures of the two unreadable heads need the reader fix, and both PRs change messages.py.
Related
#5061, #5104, #5150, #5164, #4845, #4917, #4472, #4963, #5032. ADR 0021 section 8. #5166 and #5168 also change stage.py, job_result.py and docs/roadmap/job-success.md: #5166 starts after #5216 of this set merges, and #5168 after #5166.
Source: #5211
Activity
dan-petty commentedon Nov 12, 2026
The step loses plans, reports false success, and logs incorrect results, which corrupts the roadmap workflow.Both concern the fix-plan step created by #5061, but #5061 adds the step while the candidate fixes its result-recording and data-loss defects.devops-cli-service commentedon Nov 13, 2026
Released in v0.125.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.125.0
devops-cli-service commentedon Nov 13, 2026
Live since 2026-11-13 00:46 UTC