Skip to content

fix(roadmap): plan-check measures each task group - #3669

Merged
dan-petty merged 5 commits into
mainfrom
fix/3499-plan-check-measures-each-group
Nov 5, 2026
Merged

dan-petty merged 5 commits into
mainfrom
fix/3499-plan-check-measures-each-group

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

devops roadmap plan-check had no token measure, so a plan above the stage budget roadmap.stage.step_tokens could start a run. It now measures each task group with measure_groups, the function of the stage job. It reports a group-over-budget problem for a group above the budget and a group-no-files problem for a group that changes a file and packs none. The stage job and plan-check build the shared text with one function, shared_texts, from the issue body with no record block, so the two figures are equal. The run record also keeps the input tokens of the first request of each step in implement.spend, so a person can compare a stage figure with what the model received.

Closes #3499

Change: openspec/changes/archive/2026-11-05-3499-plan-check-measures-each-group/

…ach step

The step reports the input tokens of its first model reply, and implement.spend holds them for each step, apart from the trace that drops its oldest events. Refs #3499.
plan-check measures each group with measure_groups on the head commit. It reports a group above roadmap.stage.step_tokens and a group that changes a file that exists and packs none. The stage job and plan-check build the shared text with one function, and checkout_at moves to clone_git. Refs #3499.
@dan-petty dan-petty added type/bug Defect, regression, or incorrect runtime behavior scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 5, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Review finding fixed

A review found that plan-check measured the raw GitHub body of the issue. That body ends with the record block of the jobs. The stage job measures item.body, which has no record block. So the figure of plan-check was too high and could give a false group-over-budget problem. I confirmed this before the fix: with a record block of about 600 tokens at the end of the body, the budget of 8597 tokens gave a figure of 9209 tokens. The two review items were the same defect.

Fix (commit fix(roadmap): plan-check measures the issue body with no record block): plan_check calls split_record once. It gives the same body to the gates and to the size measure, as the store gives it to the stage job. Two new tests in tests/roadmap/test_roadmap_plan_check.py use an issue body that has text and a record block. One test sets the budget one token below the stage figure and checks the figure in the message. The other test sets the budget to the stage figure and checks that there is no problem. Both tests failed on the code before the fix.

Fail-to-pass run

uv run devops ci fail-to-pass --base origin/main ended with exit 0 on the head of this branch:

  • 3 tests failed on the base: the spend holds the size of the first request of each step, the outcome of a step holds the input tokens of its first request, and the run with more events than the bound keeps those sizes.
  • 2 test files errored on the base at collection: tests/roadmap/test_roadmap_plan_check.py and tests/roadmap/test_roadmap_stage_eval_run.py. They need shared_texts and the moved checkout_at, which the base does not have.
  • 13 other tests in the changed files passed on the base.

Full uv run devops ci on the final code

All checks pass except test and coverage:

The OpenSpec change is archived in the last commit. The branch is a fast-forward of origin/main at f6d57ecd.

@dan-petty
dan-petty marked this pull request as ready for review November 5, 2026 17:43
@dan-petty
dan-petty merged commit 3791bd9 into main Nov 5, 2026
23 checks passed
@dan-petty
dan-petty deleted the fix/3499-plan-check-measures-each-group branch November 5, 2026 18:09
dan-petty pushed a commit that referenced this pull request Nov 5, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.62.7](v0.62.6...v0.62.7)
(2026-11-05)


### Bug Fixes

* **ai:** a hosted gateway call is priced, not counted local
([#3663](#3663))
([acdc8a9](acdc8a9))
* **roadmap:** plan-check measures each task group
([#3669](#3669))
([3791bd9](3791bd9))
* **roadmap:** the jobs trust the items of the two bots
([#3664](#3664))
([41a362d](41a362d))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Defect, regression, or incorrect runtime behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): plan-check measures each group of the current plan

1 participant