Skip to content

fix(roadmap): end fix-plan at a time budget with a result line - #5380

Merged
dan-petty merged 4 commits into
mainfrom
fix/5363-fix-plan-time-budget
Nov 13, 2026
Merged

dan-petty merged 4 commits into
mainfrom
fix/5363-fix-plan-time-budget

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The step fix-plan had no time budget, and a Job that ran it wrote no line until the attempt ended. When the Job deadline came first, Kubernetes stopped the pod: no result line, no comment, no count, and the attempt mark still started the 6-hour wait.

The new setting roadmap.fix_plan.time_budget_seconds (default 3600) starts with each call. The planner starts no plan run and no review run once the budget is spent. The attempt then ends with the result and the class timeout, pushes nothing, keeps plan/needs-fix, and comments the open findings and the counts. Each review logs one fix-plan progress: line. The command writes the round lines and the result line to stderr while it runs, so the log of a Job keeps them. A test holds the default, plus a margin of 1200 s for one more run and the push, below the deadline of each CronJob template of devops k8s run-job.

Closes #5363

Change: openspec/changes/archive/2026-11-13-5363-fix-plan-time-budget/

The step fix-plan had no time budget, and a Job that ran it wrote no
line until the attempt ended. When the Job deadline came first, the pod
stopped with no result line, no comment and no count, and the attempt
mark still started the 6-hour wait.

The new setting roadmap.fix_plan.time_budget_seconds (default 3600)
starts with each call. The planner starts no plan run and no review run
once it is spent. The attempt then ends with the result and the class
timeout, pushes nothing, keeps plan/needs-fix, and comments the open
findings and the counts. Each review logs one "fix-plan progress:" line.
The command writes the round lines and the result line to stderr while
it runs, so a Job log keeps them. The default ends before the deadline
of each CronJob template of devops k8s run-job, with a margin of one
model run and the push.
The issue asks for no push of a half revision. The first test stops the
attempt before the plan run, so no revision existed. The new test lets
the planner write a revision and spends the budget in that run: the step
pushes nothing, starts no review of the revision, and the result line
holds result=timeout, class=timeout and step=plan. The spec delta gets
the same scenario.

The stage document now names the step gate also, because the budget can
end before the plan run that replaces a head that the checks refuse.
@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 Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Checks and evidence (review and publish of #5363)

  • uv run devops ci fail-to-pass --base origin/main: 5 new tests fail on the base and pass on the head, 0 errored, exit 0.
    • test_a_spent_budget_ends_the_attempt_with_a_timeout_comment_and_no_push (AttributeError: type object 'FixPlanResult' has no attribute 'TIMEOUT')
    • test_a_budget_that_ends_after_the_plan_run_pushes_no_revision (same error; added in review)
    • test_each_review_of_an_attempt_logs_one_progress_line (assert [] == [...])
    • test_confirm_writes_the_progress_and_the_result_lines_to_stderr (assert (0, 0) == (1, 1))
    • test_the_fix_plan_time_budget_ends_before_the_deadline_of_each_job_template (AttributeError: 'RoadmapFixPlanConfig' object has no attribute 'time_budget_seconds')
  • uv run devops ci test tests/roadmap/steps tests/commands/test_roadmap_step_fix_plan.py tests/invariants/test_k8s_manifests.py tests/roadmap/test_job_result.py: 119 passed.
  • The builder also ran tests/roadmap/stage and the changed src modules: 3669 passed, 1 skipped. mypy (strict) on the 13 changed src files: no issues.
  • Static rows lint, format, docs, openspec, domain, constructs, test-tree, swallowed-failures, startup-imports: pass.
  • uv run devops docs generate: a second run gives no diff.

Render diff. No path under k8s/ changes (git diff --stat origin/main -- k8s is empty). There is no kustomize or Helm render difference, no restart, and Argo CD applies nothing. The new setting has a default (3600), so ConfigMap devops-cli-config needs no change.

Review fixes.

  • Added a test for a budget that ends after the plan run: the planner wrote a revision, no review of it starts, and the step pushes nothing. The spec delta has the same scenario.
  • docs/roadmap/stage.md now names the step gate also, because the budget can end before the plan run that replaces a head that the checks refuse.

Release. Needed. The Service runs the row fix_plan from its image, and a fix-plan Job runs the same image. After the release rolls the image, a person checks Loki for roadmap job result: job=fix_plan ... result=timeout ... class=timeout before the Job deadline, and one fix-plan progress: line for each review.

Limit. The budget is cooperative. It stops the attempt only before the next plan run or review run. A model request or a wait that does not return is out of its reach (39 minutes with no span on #5350). #5379 tracks that.

…est moves

The clock fixture also routes time.sleep, and the wait for each git
child process calls it in a loop. Its monotonic reading thus moved with
the real time of each git command: 338 s on a fast host, and past the
600 s budget on the CI runner, so the attempt ended at the review of
the head. The budget tests now replace only the monotonic reading of
the clock seam, as tests/telemetry/test_roadmap_stage_steps.py does.

The new setting also gets its row in the limit table of the roadmap
jobs and its variable in the list of later settings.
@dan-petty
dan-petty force-pushed the fix/5363-fix-plan-time-budget branch from 42c0691 to 76b4e0a Compare November 13, 2026 07:42
@dan-petty

Copy link
Copy Markdown
Owner Author

CI fix round 1 (head 76b4e0ae0)

The first CI run failed 3 tests in the Tests & Coverage shards 2 and 4:

  • tests/roadmap/steps/test_roadmap_fix_plan_budget.py::test_a_spent_budget_ends_the_attempt_with_a_timeout_comment_and_no_push and ::test_a_budget_that_ends_after_the_plan_run_pushes_no_revision: the attempt ended timeout at step=review, before the review of the head. Cause: the clock fixture also routes time.sleep, and the wait for each git child process calls it in a loop (6770 waits of up to 0.05 s in one local run, 338 s in total). The monotonic reading thus moved with the real time of each git command and went past the 600 s budget on the CI runner. The budget tests now replace only the monotonic reading of the clock seam, as tests/telemetry/test_roadmap_stage_steps.py already does.
  • tests/roadmap/test_roadmap_limit_classes.py::test_every_numeric_limit_of_the_roadmap_jobs_has_a_class: the new default DEFAULT_ROADMAP_FIX_PLAN_TIME_BUDGET_SECONDS had no row. Added as setting.
  • tests/security/test_config_declarations.py::test_the_variables_are_those_before_one_for_each_read_option_that_had_none_and_later_ones: the new variable DEVOPS_CLI_ROADMAP_FIX_PLAN_TIME_BUDGET_SECONDS was not in the list of later settings. Added.

Local proof: uv run devops ci test tests/roadmap tests/security tests/invariants: 9634 passed, 1 skipped, 1 failed. The 1 failure is tests/roadmap/project_review/test_review_facts.py::test_the_facts_of_a_version_window (lizard fact skipped): the worktree venv has no review extra (import lizard fails), and this change does not touch that code. uv run devops ci fail-to-pass --base origin/main: 7 tests fail on the base and pass on the head, 0 errored.

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 07:49
@dan-petty
dan-petty merged commit 20468f4 into main Nov 13, 2026
24 checks passed
@dan-petty
dan-petty deleted the fix/5363-fix-plan-time-budget branch November 13, 2026 11:31
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.127.1](v0.127.0...v0.127.1)
(2026-11-13)


### Bug Fixes

* **ci:** alarm at 360 s, one P0 issue, shards by recorded time
([#5377](#5377))
([2abd6ff](2abd6ff))
* **github:** read the plan diff and the release files from the merge
base ([#5401](#5401))
([c54e14c](c54e14c))
* **infra:** turn off the Ansible color of every playbook run
([#5381](#5381))
([5bafb1a](5bafb1a)),
closes [#5352](#5352)
* install-tools --check passes an older openspec binary
([#5355](#5355))
([625c89d](625c89d))
* **k8s:** allow only the Ingress origins in Open WebUI
([#5357](#5357))
([fdab229](fdab229))
* **pr:** count only the latest run of each check
([#5393](#5393))
([634dc91](634dc91))
* **review:** drop the fixed gateway URL of the review dry run
([#5399](#5399))
([0666d3d](0666d3d))
* **review:** review a pull request at the merge base of its base branch
([#5387](#5387))
([351ba2a](351ba2a)),
closes [#5346](#5346)
* **roadmap:** end fix-plan at a time budget with a result line
([#5380](#5380))
([20468f4](20468f4)),
closes [#5363](#5363)
* **roadmap:** refine skips an item that changed during the write
([#5392](#5392))
([a863dda](a863dda))
* **roadmap:** stage writes RENAMED and REMOVED spec deltas
([#5367](#5367))
([4abbbd2](4abbbd2))
* **roadmap:** title the delivery by the summary of its plan
([#5376](#5376))
([10e1069](10e1069))

---
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): fix-plan ends at the Job deadline with no result line

1 participant