Skip to content

feat(planning): budget and order plan phases that spend model runs - #9819

Merged
kyle-sexton merged 2 commits into
mainfrom
feat/plan-model-run-budget
Oct 24, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
feat/plan-model-run-budget

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

No related issue: the owner asked for this guard in session after the #9238 eval run burned usage, and asked that no new issues be filed; #9238 is evidence only (see Related).

Summary

/planning:plan now orders and caps any plan phase or test step that spends model runs (evals, agent fan-outs, benchmark batches). Such a phase must:

  1. put a graded check that the problem reproduces before any baseline or comparison batch;
  2. size the run count from tokens measured on 1-2 runs, not an estimate;
  3. carry a **Run budget:** line (a run count) at approval, whose runner refuses runs past the count and launches nothing after the first usage-limit error.

Observed stumble (instruction-economy evidence): the plan for #9238 (handoff efficiency) was approved with about 2,250 eval runs, each using about 1-2M tokens, a per-run size nobody measured before scaling. It ran about 700 baseline runs before the cheap reproduction check; that check (12 pilot runs) was never graded. 357 runs hit a usage limit and were discarded because the runner kept launching after the first limit hit. The run used up usage on several accounts before the owner stopped it.

Fix

  • plugins/planning/skills/plan/context/plan-template.md: new "Model-run phases" section (the three rules and the **Run budget:** line shape, beside the other optional per-phase lines), a Contents entry, and a Test Strategy bullet pointing to it, since eval batches often sit in verification rather than in a phase.
  • plugins/planning/skills/plan/SKILL.md: one Step 2 trigger sentence, the same shape as "Tracker-write phases", that sends the planner to that section. The rule text lives in the template the skill already loads at Step 2.
  • plugins/planning/skills/plan/context/plan-reviewer.md: one "Plan mechanics" axis, so the fresh-context Step 3 reviewer reports a model-run phase that lacks any of the three as a finding.
  • .changes/planning/ fragment, minor, ### Added.

No new criterion in scripts/check-plan-outcome.sh. Neither candidate check catches the missing budget cleanly:

  • A keyword match on phase headings ("eval", "benchmark", "batch") false-positives on phases that write evals rather than run them.
  • A form check on a **Run budget:** line runs only when the line exists, so it cannot flag a missing one, which is the failure that happened.

The checker's header already leaves judgment criteria to the skill: "is judgment and stays in the skill's prose; this gate does not claim it". Deciding which phases spend model runs is judgment, so the reviewer axis covers it.

Verification

  • Planning plugin tests, all passing (exit 0): build-view 53, check-open-questions 117, check-plan-outcome 71, eval-scaffold 12, goal-condition-length 15, interview-defenses 173, interview-surface-decision-mirror 4, reattach-slice 24, repin 28, standards-binding 10, plan-panel.test.mjs 22/22 (node --test), and plan-panel.test.sh (exit 0).
  • /skill-quality:check check plan: PASS, 0 errors, 4 warnings. One is new: SKILL.md body grew 376 to 378 lines (the trigger sentence). The other three were already there: description length, body size, and judgment language in templates/checklist.md, which this PR does not touch.
  • validate-evals plan lint: PASS, 4 warnings. All four are Q4 path-token warnings on cases this PR does not touch.
  • scripts/check-changelog-fragments.sh --check: all 6 fragments valid. markdownlint: 0 issues on the edited files.
  • Output evals, before and after (the skill criteria re-measure output on any body change): claude plugin eval --scaffold --ablation none --judge-model opus --runs 2 on base e5e9388 and head b4dd76b, all 5 plan-* cases. Four cases score the same; plan-explicit-one-sentence-asks differs by one run where the asks-to-plan-anyway regex missed the closing question's phrasing (judge grader passed; the case tests one-sentence asks, untouched here). plan-reviewer-flags-spread-fact, the case for the edited reviewer, passes 2/2 on both. Reading: no loss at n=2, run count capped at 40 by the budget rule this PR adds. Table on the Codex thread.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 2 commits October 24, 2026 13:35
A plan phase or test step that spends model runs (evals, agent fan-outs,
benchmark batches) now puts a graded reproduction check before any batch,
sizes the run count from tokens measured on 1-2 runs, and carries a
**Run budget:** line whose runner refuses runs past the count and stops
at the first usage-limit error. The plan reviewer flags a model-run phase
missing any of the three.

Refs: #9238

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review October 24, 2026 18:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T18:02:41.046570Z b4dd76b Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed b4dd76ba6ad4a0f9417d253a7296fa10d59ab8dd: 0 finding(s), 0 as inline comments.

No security issues found in this pull request.

The pull request has 4 files, all prose: a changelog fragment, SKILL.md, plan-template.md and plan-reviewer.md in the planning plugin. It only adds text. It deletes, narrows or softens no standing instruction, and it adds a guardrail: model-run phases need a reproduction check, a measured run budget and a runner that stops at the first usage limit.

  • No manifest (plugin.json or marketplace.json) or userConfig change, so there are no manifest <field> lines.
  • No trusted-path match, so there is no hold.
  • No workflow, script or code is changed, and there are no tokens, secrets or injection surfaces.
  • The PR context file has no embedded instructions aimed at this lane.
  • The change spends no billable resources, so there is no cost line.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed b4dd76ba6ad4a0f9417d253a7296fa10d59ab8dd: 0 finding(s), 0 as inline comments.

No findings. I read the full diff (4 files) and the PR context. I ran no tests or tools. Every verification result in the PR body is author-claimed and unverified by me.

  • Draft: The PR body says the PR is a draft opened by a dispatched agent. I couldn't confirm the draft state from the files I had. I reviewed anyway, so the wrapper's job gate decides whether this review applies.
  • Change: The PR adds a "Model-run phases" section to plan-template.md, a trigger sentence in SKILL.md, and a plan-reviewer axis. It also adds a minor changelog fragment under ### Added. The three rules (reproduce first, size from measured tokens, **Run budget:** line) are stated the same way in all four files.
  • Cross-references: The template's Contents entry, the Test Strategy bullet and the SKILL.md link all point to the new section, and its anchor #model-run-phases matches the heading.
  • Version bump: minor fits a new planning rule and reviewer check. The change adds text and removes none.
  • Closing issues: The PR says Refs: #9238, so no issue closes. The context file has no closing-issue sections and no acceptance criteria to check.
  • Embedded instructions: I found none in the PR context.
  • Manifests: No plugin.json or marketplace.json changed, so there are no manifest lines to report.
  • Trusted paths: None of the changed files match a trusted path.
  • Spend: The change adds no model calls, schedules or limits. It is plan-authoring text that tells planners to cap other runs, so there is no hold.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b4dd76ba6a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread plugins/planning/skills/plan/SKILL.md Resolved
@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 24, 2026
Merged via the queue into main with commit 2536e57 Oct 24, 2026
101 checks passed
@kyle-sexton
kyle-sexton deleted the feat/plan-model-run-budget branch October 24, 2026 19:22
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.

1 participant