Skip to content

feat(plan): add a Size forecast line to the plan - #772

Open
dean0x wants to merge 9 commits into
mainfrom
feat/771-plan-size-forecast
Open

dean0x wants to merge 9 commits into
mainfrom
feat/771-plan-size-forecast

Conversation

@dean0x

@dean0x dean0x commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner

Summary

/plan gives no size forecast, so the user does not see the expected scope of a change before /implement starts. This change adds one plain, script-readable forecast line to the plan's Implementation Plan section, so the expected scope is visible before implementation begins.

Changes

  • The plan's Implementation Plan section ends with one plain, script-readable line: Size forecast: files a-b, added a-b, removed a-b, commits a-b.
  • The Phase 10 instruction that every Plan prompt carries asks the agent that reports the steps for the line, so the single Plan agent of the standard and lean levels also gets it.
  • Gate 2 shows the line only when it has the documented shape, else says it is absent. The artifact keeps the one line Gate 2 showed and no other copy. The run report shows it or says why it is absent.
  • /implement takes EXECUTION_PLAN as its setup context and leaves the line out of it, so no agent reads it as a limit.
  • docs/commands.md documents the format and the reading rule. One guard pins it in every build: one shape, on the Phase 10 instruction line, with plain copies counted too.

Breaking Changes

None expected.

Known Limits

  • No runtime parser and no comparison with the real result (out of scope).
  • The /plan and /implement prompts grow by the measured bytes. The ceilings rise, with the reason recorded below.

Byte Ceilings

No safe cut exists: the Cancel line of Error Handling is a stop rule that is never cut, and the Closes rendering line is a pinned output contract. A ceiling may move either way; each description gives the old value, the new value and the reason.

Ceiling Old New Change Reason
command-plan-max 32,620 33,310 +690 Size forecast line (Phase 10 instruction clause, Gate 2 shape check and absence rule, artifact clause, report bullet)
command-plan-curation-off-max 31,016 31,706 +690 same
command-plan-compliance-off-max 32,475 33,165 +690 same
command-plan-both-off-max 30,871 31,561 +690 same
command-implement-max 41,816 41,855 +39 EXECUTION_PLAN leaves the Size forecast line out (+33); the Phase 2 setup context is EXECUTION_PLAN (+6)
command-implement-curation-off-max 39,954 39,993 +39 same
command-implement-compliance-off-max 43,865 43,904 +39 same
command-implement-both-off-max 42,003 42,042 +39 same

Planning Notes

  • Planning depth: normal. Raise signal: a new parseable artifact format. At Gate 0 the requester first asked for depth small, then agreed to normal.
  • The Synthesize planning template drops its File Estimate line. The gap analysis found that it duplicates the files count of the new line, and no test pins it. The template's context-risk check still uses the file count of the steps.
  • The line has four ranges, while the issue asks for three numbers: added and removed lines are split, so a reader sees both. Gate 2 approved this shape.

Testing

  • The CI full suite on the PR head is the full-suite evidence.
  • The local full suite failed only on test timeouts in hook test files this change does not touch (tests/eager-memory-refresh.test.ts, tests/shell-hooks.test.ts, tests/queue-append.test.ts, tests/shell-hooks-tracker.test.ts). Each file passed alone.
  • One CI job failed once on a temporary-folder cleanup race in tests/capture-hooks.test.ts and passed on re-run.

Related Issues

Closes #771

The planner forecasts the size of the whole change right after its steps, in one plain line: Size forecast: files a-b, added a-b, removed a-b, commits a-b. The steps row of Phase 10 defines the shape once. Gate 2, the artifact's Implementation Plan item and the run report only name it. The artifact keeps the latest Plan run's line when it fits the shape and leaves it out otherwise, and the report says why it is absent. The full-level synthesis keeps the line in place of the file estimate.

docs/commands.md documents the format and the reading rule. A guard pins the shape, its sample range swaps, the doc literal and the sites that must not name it, in all four plan builds, with known-bad probes. The four /plan size ceilings rise by the measured 542 bytes each, with no headroom.

Part of #771.
The plan document step now takes the Implementation Plan without its Size forecast line, so no Code, Test or Evaluate agent reads the forecast as a limit. The four implement goldens copy that line byte for byte and change in this commit. The four implement ceilings rise by 33 bytes each to the measured size. A guard pins the strip in all four implement builds, with a removal probe.

Part of #771
The planning synthesis template gives no Size forecast line when the steps report has none, so Synthesize does not make one up. A guard pins the slot as the last line of the Implementation Plan, with probes.
The shape was only in the steps row of the focus table, so the single Plan agent at standard and lean could lose it. It now sits in the Phase 10 instruction that each Plan prompt is built from, scoped to the agent that reports the steps, as one plain line right after them. Gate 2 shows the steps report's line only when it fits the shape, else its absence; the artifact keeps the one line Gate 2 showed (latest Plan run) and no other copy, or none.

The guard pins the shape's location, counts the plain literal as well as the backticked span, and has one known-bad probe per new check. The four plan ceilings follow the measured sizes.

Refs #771
The plan document step leaves the Size forecast line out of EXECUTION_PLAN,
but Phase 2 named the whole plan document as setup context, and the Code
spawns take their plan from setup context. The forecast could reach a Code
agent as a budget. Setup context is now EXECUTION_PLAN, else the issue body
or conversation. PR_DESCRIPTION_GUIDANCE and TEST_PLAN reach their readers
through their own captures, so no Code agent loses an input.

The plan-facts guard pins the new sentence once in all four implement
builds, with one removal probe. The four implement goldens and ceilings
move by 6 bytes each (41,855 / 39,993 / 43,904 / 42,042).

The eight #771 ratchet descriptions now state the current rule: a value may
move either way, and its description and the PR give the old value, the new
value and the reason. The implement descriptions carry the new numbers.

Task: resolve-batch-b
@dean0x

dean0x commented Nov 6, 2026 •

Copy link
Copy Markdown
Owner Author

Review and resolution

Head: 37fffcd. This comment is edited in place for each new head. Since 1f0368d: the changelog entry states the final ceiling raises (+690 and +39), from an independent intent check.

Review

This change is prompt text, a format guard and byte ceilings. An independent two-lens audit replaced a full code review: one lens read the prompt text as an agent runs it, and one lens read the format test and the ratchets.

  • No CRITICAL or HIGH finding. 7 MEDIUM and 6 LOW findings.
  • MEDIUM, all fixed:
    • The shape was only in a table cell, so the single Plan agent of the standard and lean levels could lose it. The shape is now in the Phase 10 instruction that every Plan prompt carries.
    • Gate 2 had no shape check and no absent rule. It now shows the line only when it fits the shape, else says it is absent.
    • A full run could double the line. The artifact now keeps the one line Gate 2 showed and no other copy.
    • The planner was not told to write a plain line. The instruction now says one plain line, with no bullet, bold or backticks.
    • The whole plan document could reach a Code agent through the Phase 2 setup context. The setup context is now EXECUTION_PLAN, which leaves the line out.
    • Eight ceiling descriptions stated a rule that contradicted their raise. They now state that a value may move either way, with the old value, the new value and the reason.
    • The guard counted only backticked copies, anywhere in the build. It now also counts plain copies, pins the shape to the Phase 10 instruction line, and has one known-bad probe per check.
  • LOW: one is part of the guard fix above. Five are left for later, because none has an observed fault: a redundant clause (replaced by the rewrite), how the strip finds the line, byte counts in the changelog entry, the dropped File Estimate line, and exact-prose pins.

Resolution

Fixed 7
Left for later 5
Duplicate 1
False positive, by design, escalated 0
Regression tests added 3

Final byte growth: /plan +690 per build, /implement +39 per build. The PR body table gives each ceiling.

Verification

  • Build, typecheck and the focused guard, ceiling and golden tests pass.
  • Test plan: 9 of 10 verified (6 by CI, 3 by a text walk of the compiled prompt). The tenth is the local full-suite run.
  • The local full suite failed only on test timeouts under load, in files this change does not touch: tests/queue-append.test.ts, tests/shell-hooks-tracker.test.ts and tests/decisions/ledger-ops.test.ts (earlier also tests/eager-memory-refresh.test.ts and tests/shell-hooks.test.ts). Each file passes alone.
  • CI passes at 37fffcd. At 1f0368d, one job first failed on a temporary-folder cleanup race in tests/capture-hooks.test.ts, outside this change, and passed on re-run.

@dean0x
dean0x marked this pull request as ready for review November 6, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

/plan: add a size forecast line to the final plan

1 participant