Skip to content

fix(roadmap): measure a task group by the files its step reads - #2847

Merged
dan-petty merged 7 commits into
mainfrom
fix/2838-stage-split-more-asks
Oct 31, 2026
Merged

dan-petty merged 7 commits into
mainfrom
fix/2838-stage-split-more-asks

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The stage job measured a task group with more tokens than its implement step reads. Four P1 bugs (#2735, #2739, #2147, #2747) stopped on this and waited for a person.

This pull request fixes the cause. It does not build the second split ask that the issue asks for. A split moves files between groups, and it cannot make one file smaller. One file, src/devops_cli/config/constants.py, counted 38159 tokens in the old measure and 1847 in the step. The issue criteria for a second ask and a stop after the last ask are replaced by the fix of the measure.

What changes:

  • The measure parses the text of a group with the parser of the step. It counts the files that the tasks name in code spans, each packed to at most CONST_ROADMAP_IMPLEMENT_FILE_MAX_TOKENS tokens, as the step packs them. A file that only the Reads: line lists adds no token, as the step does not read it.
  • The new module roadmap/step_files.py holds the parser, named_files and packed_file. The step and the stage job use the same code.
  • The stop record gets the key stage.file_cap. A stage.needs_split record counts only when it holds the file cap of now. The records of the four items come from the old measure, so the default plan takes them without a person. --item still overrules a record.

Closes #2838

…hem (#2838)

The stage measure packed each file to the step budget, so constants.py counted 38159 tokens where the step reads 1847. One shared packed_file now serves the measure and the step.
The measure counted the files of reads and changes. The step reads the
files that its tasks name. A stop record from the old measure also kept
the items out. The measure now parses the group as the step does, and the
record names the file cap of its measure.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Oct 31, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and review findings.

Fail-to-pass: uv run devops ci fail-to-pass --base origin/main reports 5 tests that fail on the base, and 2 test files that error on the base because they import the new module. The new tests are in tests/roadmap/test_roadmap_stage_measure.py, test_roadmap_stage_selection.py and test_roadmap_stage_apply.py.

Full uv run devops ci: all checks pass except test. The one failed test is tests/commands/test_scan_outcomes_and_gating.py::test_scan_report_skips_named_scanners. The devcontainer has kube-linter on PATH, and the test passes on GitHub (issue #2165). The test check took 187 s. Coverage is 93.86%.

Live check: uv run devops roadmap stage --plan on 2026-10-31 with this code lists #2147, #2735 and #2739 under "To stage". Their largest groups are 3083, 2833 and 3699 tokens. The setting roadmap.stage.limit is 3, so #2747 waits for the next round. On the base, the same command left out all four items. This meets the criterion "at least three of the four items are stageable".

Findings of the review, all fixed:

  • Stale stage.needs_split records kept the four items out of the default plan. Fixed with the record key stage.file_cap. Tests: selection and apply.
  • The change did not match the issue text. The folder is now 2838-stage-measure-step-files, the title says what the code does, and the body and the issue say that the second ask is replaced.
  • Blocker of the measure: it counted reads and changes, while the step reads the files that its tasks name. The measure now uses the parser of the step. Tests: a file that no task names costs nothing, and a file that a task names counts though reads omits it.
  • The Workflow follow-up tracking line is gone from tasks.md. A test now checks that the section of files of the step holds the text that the measure counts.
  • The measure test now checks fixed bounds in place of an oracle built from the same function.
  • The module and function texts are wrapped, and they hold no issue number.

Open point for a person: the prompt roadmap_stage_change.md calls reads the paths that the step reads, but the step reads only the files that its tasks name in code spans. A model that lists a file only in reads gets a file that the step does not open. This was so before this change.

@dan-petty
dan-petty marked this pull request as ready for review October 31, 2026 07:25
@dan-petty
dan-petty merged commit 2f3986a into main Oct 31, 2026
19 checks passed
@dan-petty
dan-petty deleted the fix/2838-stage-split-more-asks branch October 31, 2026 11:17
dan-petty pushed a commit that referenced this pull request Oct 31, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.26.0](v0.25.0...v0.26.0)
(2026-10-31)


### Features

* **k8s:** preview requests in dry run for cluster commands
([#2839](#2839))
([b6de1a4](b6de1a4)),
closes [#2238](#2238)
* **pr:** preview requests in dry run for pr commands
([#2835](#2835))
([2a9b746](2a9b746)),
closes [#2234](#2234)


### Bug Fixes

* **k8s:** enforce the window of each gateway deployment
([#2843](#2843))
([2ff7d9f](2ff7d9f)),
closes [#2825](#2825)
* **roadmap:** measure a task group by the files its step reads
([#2847](#2847))
([2f3986a](2f3986a)),
closes [#2838](#2838)
* **tests:** replace real test sleeps with clock
([#2169](#2169))
([#2833](#2833))
([506f769](506f769))

---
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 Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): the stage job stops an item whose task group is a few percent over the budget after one split

1 participant