Skip to content

Infra CI3 C1: time budgets that fail, read from real runs #782

Closed

Description

@jparker2006

Parent

Ticket C1 of spec #780 (Infra; no milestone, ADR 0010).

What to build

Every CI and Privacy job fails when it runs past about 1.5x its measured p95, so an overrun is a red bug, not an hour of lost minutes.

  • A script reads the last completed runs (default 150, as the audit did; latest attempt) from the CI bench's collected jobs, takes each job's p95 and writes its budget: 1.5x p95, rounded up to a whole minute, at least 5 minutes. Traced and planted runs get their own budget from their own runs. Each row keeps the p95, sample count and window it came from.
  • Each job's timeout-minutes in the CI and Privacy workflows is set from that table, replacing today's 60 and 90 minute limits.
  • A check fails when a job in either workflow has no row, or a timeout that differs from its row, so a new job can't arrive without a budget. It runs in the bench workflow, which already runs on CI workflow changes.
  • No retries and no wider limits: a job too slow for its budget is a bug to fix or a budget to re-read from newer runs, in its own PR.

Owned paths

  • tools/ci-bench/budgets.py (new: reads p95, writes the table, checks the workflows)
  • tools/ci-bench/budgets.tsv (new: one row per job)
  • tools/ci-bench/test_budgets.py (new)
  • .github/workflows/ci.yml (shared: each job's timeout-minutes line only)
  • .github/workflows/privacy.yml (shared: each job's timeout-minutes line only)
  • .github/workflows/ci-bench.yml (shared: one step that runs the budget check and its tests)
  • tools/ci-bench/README.md (shared: a new Budgets section only)

Relies on: nothing

Links

Acceptance criteria

Proof

CI3-B: red first, the check on a workflow fixture with a job that has no budget and one with a wrong timeout; then the table from real runs and a run using it.

Activity

  1. added
    ready-for-agent
    on Nov 15, 2026
  2. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: start checked, branch room/782-ci3-c1-time-budgets

  3. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    Builder question (C1, data window). I'm building budgets.py, its check and its tests now. The first criterion has a gap: the table must come from real runs after #743 and #761 merged. #779 merged at 2026-11-15T23:33:42Z. Since then there has been 1 completed ci.yml run (a main-light push) and 1 privacy.yml run. Before the merge, ci.yml ran about 16 times an hour.

    Some jobs run rarely, so even 150 post-merge runs leave them with few or no samples: toolkit-nightly runs once a night, and traced/planted runs are the nightly run plus PRs that touch the tracer or planted.py.

    Options:

    • A. Wait for the default 150 completed runs per workflow after 23:33:42Z (about 10 hours at the old rate), then read the table. A job or mode with fewer than 5 samples in that window is read from its own last 150 runs with no start bound, and its row's window and count say so.
    • B. Same as A, but only from the post-merge window. A job or mode with too few samples gets no row, and the check stays red until it has some.
    • C. Read now from the last 150 runs, before the merges. This doesn't meet criterion 1.

    Recommendation: A. None of the rare jobs (toolkit-nightly, traced/planted lanes, which use one shard) changed shape in #743 or #761. Until this is answered I'll push the script, check and tests, red first. I won't hand back until the table is read.

  4. added
    needs-info
    on Nov 15, 2026
  5. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: asked the orchestrator
    The builder's data-window question (options A, B and C, recommending A): #782 (comment)

  6. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    Orchestrator ruling: option A. Read the table from the default 150 completed runs per workflow after #743 and #761 merged (after 2026-11-15T23:33:42Z). A job or mode with fewer than 5 samples in that window is read from its own last 150 runs with no start bound, and its row states that window and its sample count. This keeps criterion 1 for every job whose shape the two merges changed and is honest about the rare ones; it changes no interface or scope. Push the script, check and tests now, red first, and hand back once the table is read. If any rare job turns out to have changed shape in #743 or #761, say so and ask again before reading it from the older window.

  7. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    Builder question 2 (C1, exact path). .github/workflows/ci-bench.yml runs on pull requests that change .github/workflows/ci.yml, but not on ones that change .github/workflows/privacy.yml. So a Privacy job could get a new or wider timeout without the budget check running. I own one step in that file. The smallest fix is one more line under on.pull_request.paths:

           - '.github/workflows/ci.yml'
    +      - '.github/workflows/privacy.yml'
           - '.github/workflows/ci-bench.yml'

    Options: A. widen my ci-bench.yml ownership to this one line. B. leave it out and record it as a gap in the PR. Recommendation: A. Without it, the third criterion holds for Privacy only when some other bench path changes in the same PR.

  8. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: asked the orchestrator
    The builder's question 2, widening its .github/workflows/ci-bench.yml ownership by one paths line (a workflow file, so not a delegated grant): #782 (comment)

  9. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    Orchestrator ruling: question 2, option A granted. Add the one line .github/workflows/privacy.yml to on.pull_request.paths in .github/workflows/ci-bench.yml, nothing else in that workflow. A workflow change is pushed as Jake's account, not the App. Record the grant in the PR's Facts.

  10. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    Builder question 3 (C1, rare jobs whose shape changed). As the ruling asked, I'm raising this before reading the table. #743 (merge 126dca1) changed the shape of three ci.yml jobs that run only when a PR touches their paths, so they may have fewer than 5 samples among the first 150 post-merge runs:

    • release: now a 3-shard matrix (release (1..3)). Before, it was one job.
    • launch-fleet: a new 4-shard job. Before, it was the skills (launch-fleet) leg.
    • skills: lost its slowest leg (launch-fleet) and its matrix.skill == 'launch-fleet' && 60 || 30 timeout.

    #761 (merge 23f3080) changed no workflow line. Privacy runs on every PR, so it won't need the fallback.

    Falling back to runs from before the merge would give these three jobs budgets based on the old shape: wider for release and skills, and no samples at all for launch-fleet, whose job name didn't exist before.

    Options:

    • A. For these three jobs only, never fall back to runs before the merge. If they have fewer than 5 samples in the 150-run window, read their own last 150 runs created after 2026-11-15T23:33:42Z, with no 150-run workflow cap. I'd wait for that many to exist before handing back.
    • B. Fall back as the ruling says, and accept the old-shape budgets until a re-read.
    • C. Lower the minimum to 3 samples for these three jobs.

    Recommendation: A. Only post-merge runs are this shape. The script, check and tests are pushed on room/782-ci3-c1-time-budgets. No PR yet: I hand back once the table is read.

  11. jparker2006 commented on Nov 15, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: asked the orchestrator
    The builder's question 3, the fallback window for release, launch-fleet and skills, whose shape #743 changed: #782 (comment)

  12. added a commit that references this issue on Nov 16, 2026
  13. 11 remaining items

  14. added 2 commits that reference this issue on Nov 16, 2026
  15. jparker2006 commented on Nov 16, 2026

    @jparker2006
    MemberAuthor

    Builder question 5 (C1, exact paths: three tests pin the old timeouts). The table is read and applied, as ruled on question 4. There are 23 rows, and every changed line in ci.yml is a timeout-minutes line; privacy.yml was already 5.

    Three existing tests outside my owned paths assert the old 60/90/30 values, so CI and the pre-push hook fail. The applied commit is local. The branch is pushed up to the commit before the change.

    File Assertion Fails with
    .github/actions/docs-only/test_toolkit.py:51 rust and rust-export keep planted == 'true' && 90 || 60 1 failure
    .github/actions/docs-only/test_workflow.py:66-70 (test_launch_fleet_retains_the_legacy_rust_suite_budget) launch-fleet 60, skills 30, release 60 3 subtests
    .github/workflows/ci.test.mjs:44-61 (Rust and web lanes allow 90 minutes only when the plan plants) the four lanes evaluate to 90 when planted, else 60 rust: planted="true", 56 !== 90

    Each pins a value that budgets.tsv and its check now own. Updating each to the new numbers would copy the table's inventory into three more places, which the test rule (#687) forbids.

    Smallest change I propose: delete only the timeout assertions and keep the rest of each test.

    • test_toolkit.py: delete line 51, the one assertIn(" timeout-minutes: ...") line in the loop.
    • test_workflow.py: delete test_launch_fleet_retains_the_legacy_rust_suite_budget (5 lines). Its only claim is the timeouts.
    • ci.test.mjs: in that test, delete the timeout lookup and the planted loop (lines 52-59). Keep the job-exists, needs and planted output assertions, and rename the test Rust and web lanes read the plan's planted output.

    The budget check already fails on a lane whose traced or normal timeout differs from its row (test_traced_and_normal_budgets_are_each_checked), so nothing loses coverage.

    Options: A. grant those three exact edits. B. update the expected values in place instead (three copies of the table). Recommendation: A.

    One more fact for the record, already handled inside my owned paths. Two runs created after 23:33:42Z, both pull_request, still ran the old workflow: no launch-fleet job, an unsharded release and a skills (launch-fleet) leg. Counted, they would have set skills at 44 minutes and release at 37. For the three shape-changed jobs, a run now counts only if it lists every job of today's workflow (148 runs). That gives skills 5, release 21 and launch-fleet 14. It was proved red first.

  16. added
    needs-info
    on Nov 16, 2026
  17. jparker2006 commented on Nov 16, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: asked the orchestrator
    The builder's question 5, deleting three old-timeout assertions outside #782's paths (one under .github/workflows/), which J110's allowance does not cover: #782 (comment)

  18. jparker2006 commented on Nov 16, 2026

    @jparker2006
    MemberAuthor

    Orchestrator ruling: question 5, option A granted. Make exactly the three edits described: delete the one timeout assertion line in .github/actions/docs-only/test_toolkit.py; delete test_launch_fleet_retains_the_legacy_rust_suite_budget in test_workflow.py; and in .github/workflows/ci.test.mjs delete only the timeout lookup and the planted loop, keeping the job-exists, needs and planted output assertions and renaming the test as proposed. Each deleted assertion pins a value budgets.tsv and its check now own, so the pull request names its keeper for each (test_traced_and_normal_budgets_are_each_checked), as the test rule requires. ci.test.mjs is a test file, not a workflow, so it is pushed as usual. Record the grant in Facts.

  19. removed
    needs-info
    on Nov 16, 2026
  20. added 5 commits that reference this issue on Nov 16, 2026
  21. jparker2006 commented on Nov 16, 2026

    @jparker2006
    MemberAuthor

    launch-fleet: archived

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions