Repository navigation
Description
Problem
The stage comment gives a token figure for each group. That figure goes stale when the plan or its named files change, and no gate measures it again. plan_check.py has no token measure. The step refuses only above window minus reserve: 128000 - 40000 = 88000 (implement_step.py:321-322). So a plan over the stage budget of 40000 can start a run. This hurts the implement job, which spends the input tokens, and the person who reads the figure.
Group 1, stage comment against the current plan. Each current figure is approximate and leaves out the prompt (1810 tokens) and the tool schemas:
- fix(models): make clean-default model fields required #2636: 5150, now about 25778.
- fix(k8s): Add loki.url config key for k8s logs #2651: 5687, now about 12835.
- fix(hardening): add guardrails to hardening surfaces #2526: 3798, now about 60701. This is over the budget of 40000.
- feat(roadmap): stage requires an eval replay task when a plan edits the stage prompt or gates #3331: 31191, now about 43832. This is over the budget of 40000.
Plan pull request #3339 for #3331 holds a commit of a person that changes the plan. Nobody checked the commits of the other 3 plans, so the cause of those rises is not proved.
named_files gives 0 files for #3320 groups 2 to 4 and for #3368 group 1 in the tree of 2026-11-04T15:06Z. The docstring of _read_tokens (stage_change.py:927) says that the step ignores a file that only Reads: lists. This is a stated design.
No figure shows the size of a first request. implement_trace.py encode drops the oldest events first, with a limit of 8192 characters. The #2636 record holds 77 events and drops 154, and its run made 116 requests. So the gap between a stage figure and a first request is not measured.
Expected
plan-check measures each group of the current plan with measure_groups, the function of the stage job. It reports a group over the budget and a group that packs no file. It reads the budget from the setting roadmap.stage.step_tokens of the stage job. src/devops_cli/config/defaults.py:785 and k8s/devops/configmap.example.yaml:66 give 64000, but all 18 stage comments of the window 2026-11-03T15:05Z to 2026-11-04T15:05Z state 40000. So the deployed value is 40000 (inferred). With 64000, neither figure above is over the budget.
The run record holds the size of the first request of a step, so a person can compare the stage figure with the model. The same gate can then refuse an over-budget plan at implement, through #3393.
Open question for the plan: must the step read the files of the Reads: line? This reverses a stated design, and no evidence shows that it lowers the cost. This issue does not require it.
Acceptance criteria
plan-checkcallsmeasure_groups. A test holds that the figure ofplan-checkequals the figure of the stage job for the same plan.- A test:
plan-checkprints each group over the budget. - A test:
plan-checkprints each group with 0 packed files. - A test: the run record of a fixture step holds the size of its first request.
- A test: a fixture step with more events than the trace limit keeps the size of its first request, and its trace has a
droppedcount above 0.
Existing tool considered
Project code covers the need: measure_groups and _read_tokens (stage_change.py:924-956), count_tokens, rules_sections, named_files and packed_file. No outside tool knows the step inputs of this project.
Dependencies
- fix(roadmap): the plan reader reports each bad plan with no crash #3482:
plan-checkcan measure only a plan thatread_changecan read.
Activity
dan-petty commentedon Nov 4, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(roadmap)scope of the title gives the scope.Stale token figures can let over-budget plans start a run, but a stage gate already exists at a higher threshold, so this is a meaningful but non-blocking gap.It gives a person a current token figure per group before a run starts, reducing wasted implement runs and stale stage comments.It wires measure_groups into plan-check, adds two report branches, and records first-request size in the run record, with five acceptance tests.Both concern token budget measurement per plan group; #3265 fixed the measure function so stage and Job agree, while the candidate adds a new reporting step in plan-check that calls that measure and flags over-budget or empty groups.devops-cli-service commentedon Nov 5, 2026
Released in v0.62.7: https://github.com/dan-petty/devops-cli/releases/tag/v0.62.7
devops-cli-service commentedon Nov 5, 2026
Live since 2026-11-05 19:48 UTC