Repository navigation
fix(#5320): record planned-phase plan count on Plan:/Current Plan: documents - #5424
Open
davdittrich wants to merge 1 commit into
Open
davdittrich wants to merge 1 commit into
davdittrich wants to merge 1 commit into
Conversation
davdittrich
requested review from
Solvely-Colin,
davesienkowski,
jeremymcs and
trek-e
as code owners
October 14, 2026 20:38
davdittrich
force-pushed
the
fix/5320-planned-phase-plan-label
branch
3 times, most recently
from
October 15, 2026 08:38
c68c73c to
ae26865
Compare
trek-e
reviewed
Oct 17, 2026
trek-e
left a comment
Collaborator
There was a problem hiding this comment.
Merge conflict with next — blocks review and merge.
git merge-tree --write-tree origin/next <PR head> against next @ f7efbf110a reports conflicts in:
tests/fixtures/compact-content-benchmark-baseline.json
Please bring the branch current with next and resolve the conflict(s). The substantive review resumes once the PR is mergeable. This notice is about the conflict only; it does not retire any open finding from earlier reviews.
…Plan: documents begin-phase --plans on a planned phase left the Plan:/Current Plan: line without the plan count. Record it, validate --plans strictly, keep replan progress only within the same phase, and fail a planned phase with no plan line instead of silently no-opping. Emitted-Drift-Ack-Growth: plan-phase.md — 13b now documents the new non-zero exit of planned-phase when no plan line exists; callers need it to handle the abort
davdittrich
force-pushed
the
fix/5320-planned-phase-plan-label
branch
from
October 17, 2026 18:13
35db850 to
3005ba1
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix PR
Linked Issue
Fixes #5320
What was broken
state.planned-phase --plans Nexited 0 without recording the plan count when STATE.md carried aPlan:/Current Plan:Current Position line instead ofTotal Plans in Phase:.Plan:and a bareStatus: Readystayed stale and frontmatterprogress.total_planswas not updated.What this fix does
plannedPhaseCorenow writesPlan: A of N in current phase(and the legacyCurrent Plan:spelling) through the existing Current Position writer, moves a bareReadystatus toReady to execute, and reportsPlan/Current Planinupdatedonly when that line changed. A same-phase replan keeps the executed-plan counter (2 of 5becomes2 of 6); a different phase resets it, and a total below the executed count fails before any write. When--planshas no line to land on, it exits non-zero before any write; reruns on an already-planned document still exit 0.--plansaccepts only plain non-negative safe integers.Root cause
The count was written only through the
Total Plans in Phaselabel, and the Current Position call never receivedplan/currentPlan.Readyis not a known template default, so Status was treated as executor-authored and left alone.Testing
How I verified the fix
npm run build:lib && node --test tests/state-transition.test.cjs tests/state.test.cjs tests/state-document.test.cjs. The new#5320tests intests/state.test.cjsrun the public CLI on the issue fixture and check the JSON result, the on-disk body and the derived frontmatter. They also cover the legacyCurrent Plan:-only document andadvance-planafterwards, replan progress, rerun idempotency, no place to record, and--plans abc/--plans -1. The red tests failed on unmodifiednext.Regression test added?
Platforms tested
Runtimes tested
Checklist
Fixes #NNN— PR will be auto-closed if missingconfirmed-buglabelnpm test).changeset/fragment added if this is a user-facing fix (npm run changeset -- --type Fixed --pr <NNN> --body "...") — orno-changeloglabel appliedBreaking changes
state planned-phase --plans Nnow exits non-zero, writing nothing, when STATE.md## Current Positionhas none ofPlan:,Current Plan:orTotal Plans in Phase:. It previously exited 0 with nothing recorded. The error names the line to add.--plansvalues such as-1,3.5and3abcare now rejected.