Purpose (protocol): fewer CI builds per package #43

Open
opened 2026-11-22 16:09:39 +00:00 by uranus · 2 comments
Member

Purpose (protocol): fewer CI builds per package.

DECIDED 2026-11-22 "we also need a protocol for fewer builds" (Raf). That we need one is decided. Which rules go in is Raf's pick, in one menu.

Context (Supervisor, 17:03 local): 37 forge runs were waiting (martha 8, ci-images 14, sponsors 12, realm 3). host00's load was 15-41 on 4 cores, and a build box is rented on demand for the backlog.

The measurement and the proposal are in the first comment. No workflow edit and no new check are made under this issue. Each rule Raf picks that needs a workflow change becomes its own package.

Refs macula-io/martha#1046

Purpose (protocol): fewer CI builds per package. DECIDED 2026-11-22 "we also need a protocol for fewer builds" (Raf). That we need one is decided. Which rules go in is Raf's pick, in one menu. Context (Supervisor, 17:03 local): 37 forge runs were waiting (martha 8, ci-images 14, sponsors 12, realm 3). host00's load was 15-41 on 4 cores, and a build box is rented on demand for the backlog. The measurement and the proposal are in the first comment. No workflow edit and no new check are made under this issue. Each rule Raf picks that needs a workflow change becomes its own package. Refs macula-io/martha#1046
Author
Member

Fewer CI builds: what today cost, and five rules to pick from

Raf, 2026-11-22: "we also need a protocol for fewer builds". That we need one is DECIDED. Which rules go in is Raf's pick, from the list below.

Today, measured (forge, 2026-11-22 00:00Z to 16:08Z, read only)

Source: GET /repos/<o>/<r>/actions/runs and /actions/tasks for every repo whose Actions are on (15 had runs). Raw data and scripts: ~/.claude/sessions/uranus-fewer-builds/ (data/, pull.py, pullruns.py, an2.py).

  • A run is one workflow on one commit. A job is a task a runner picked up.
  • Job-min is the time from task created to task ended. It counts a job's own time, not its time in the queue.

Totals: 625 runs, 1,436 jobs, 3,022 job-min. 38 runs were waiting at 16:08Z.

  • martha is about half: 236 runs, 809 jobs, 1,597 job-min. Its ci.yml alone is 1,510 job-min: 46 runs of about 20 jobs, about 40 job-min a run.
  • The rest: sponsors 193 runs / 405 job-min, martha-board 18 / 661, ci-images 47 / 156, martha-engine 53 / 114, realm 29 / 41, eight small repos ≤11 runs each.
  • Outcomes: 304 success, 129 failure, 135 cancelled, 38 waiting, 19 skipped.
  • The 135 cancelled runs were cancelled by hand (by Terra and four other members), not by a concurrency rule. 40 of them are martha batch tips.

The top five sources:

# Source Runs Jobs Job-min
1 A PR re-pushed after its first commit (57 PRs had 121 tips; one had 8) 193 545 1,259
2 Batch tips: 86 runs, of which 46 are re-cuts of a batch already cut (martha batch PR 4 had 6 tips) 46 re-cut 112 263
3 The same commit run twice: a branch push plus its PR, mostly sponsors secrets.yml and conflict-markers.yml (on: push on every branch) 132 139 32
4 main push of a sha the PR or batch tip had already run (fast-forward landing) 25 72 206
5 Empty "re-run, no change" commits, which re-run the whole suite to recover a lost job 18 59 144

One cost cuts across sources 1-5: martha ci.yml's three known reds.

  • Gate coverage was red in 36 of 38 runs, nothing private in 29 of 29, and clean-install in 17 of 28.
  • Together they take 740 of ci.yml's 1,510 job-min: 457 on PR pushes, 180 on batch tips, 80 on empty re-runs, 24 on main.
  • Their red is read as "known" (Supervisor 12:10Z), so on a PR push their result decides nothing.
  • Separately, "the relay loads" job failed 11 of 28 runs (the #984 flake, Saturnus's #19). Those reds are what start the empty re-runs.

Five rules, each with what it would have saved today

The rows overlap (a re-push can also be a known-red run), so the savings do not simply add up. With the one overlap taken out (122 job-min of known-red jobs on 3rd+ tips), rules 1-5 together are about 1,500 job-min, half of today's 3,022.

Rule 1. One push per review round.

  • The builder pushes once, when the local checks pass and the HANDOFF is ready.
  • A review fix is one more push.
  • With at most 2 rounds (DECIDED 11-20), a PR carries at most 2 tips. A rebase onto a moved main is the one extra push allowed.
  • WIP stays local.
  • Saves: the runs on a PR's 3rd and later tips were 94 runs, 239 jobs, 523 job-min (12 PRs). If every PR had one tip, the saving would be up to 193 runs and 1,259 job-min.
  • Needs no workflow change. It is crew practice, and the dispatcher sees it in the HANDOFF's range.

Rule 2. A known-red job stays off PR pushes until its fix is green.

  • Gate coverage (#7), nothing private (#39/#40) and clean-install (#3) run on the batch tip and on main only.
  • Each one comes back to PR pushes the day its issue's fix is green.
  • Saves: 66 jobs and 457 job-min on PR pushes. martha ci.yml per PR push drops from about 40 to about 25 job-min.
  • Needs a workflow edit later (if: on three jobs), made under its own package. Not in this one.

Rule 3. A batch is cut once, and a lost job is re-run alone.

  • The lander cuts the batch only when every package has its PASS at a final head. No re-cut while a member branch still moves.
  • A job lost to a runner restart is re-run alone, through the forge's re-run on that run, by whoever can. Nobody pushes an empty commit for it.
  • The runner restarts that lose jobs (#24, shutdown_timeout=0s) are fixed at the source.
  • Saves: re-cut tips were 46 runs, 112 jobs, 263 job-min. Empty re-run commits were 18 runs, 59 jobs, 144 job-min. Together that is 64 runs and 407 job-min, and most of the 40 hand-cancelled batch runs.
  • Open point: members cannot re-run a forge job today (permissions push:false). Who holds that button is part of the menu: the lander (Terra) or the Supervisor.

Rule 4. A fast-forward landing does not re-run the tip.

  • When main moves by fast-forward to a sha that ran in full as a batch tip, the main push runs no suite again.
  • Main keeps its scheduled and drift jobs. The landing proof is the batch tip's run, which the menu already cites.
  • Saves: 25 runs, 72 jobs, 206 job-min.
  • Needs a workflow edit later (main push becomes a condition, or push: main comes off the heavy workflows).

Rule 5. One trigger per commit.

  • Workflows run on pull_request and on push to main only, never on every branch push.
  • The cases today: sponsors' secrets.yml and conflict-markers.yml, realm's secrets.yml, ci-images' two selftests, and mcl-mail's lint, which build-push runs a second time (mcl-mail#4).
  • Saves: 132 runs and 139 jobs, but only 32 job-min.
  • The win is queue slots and container starts, not minutes: 12 of the 38 waiting runs at 16:08Z were sponsors.
  • Needs a trigger edit per repo later.

Not proposed: a new check. None of the five needs one. Rule 1 is practice, the dispatcher reads it from the range, and rules 2-5 are workflow edits (DECIDED 2026-11-19, no new check without Raf's yes).

Not measured: paths filters, for example host-drift and engine-drift only when their inputs change. Saving that would need each commit's changed files. If Raf wants it, I measure it next.

What Raf picks

One menu. Any of rules 1-5.

  • Rule 1 starts at once.
  • Rules 2, 4 and 5 become one workflow package per repo, each read before it lands.
  • Rule 3 needs the re-run button owner named, and #24 fixed.
# Fewer CI builds: what today cost, and five rules to pick from Raf, 2026-11-22: "we also need a protocol for fewer builds". That we need one is DECIDED. Which rules go in is Raf's pick, from the list below. ## Today, measured (forge, 2026-11-22 00:00Z to 16:08Z, read only) Source: `GET /repos/<o>/<r>/actions/runs` and `/actions/tasks` for every repo whose Actions are on (15 had runs). Raw data and scripts: `~/.claude/sessions/uranus-fewer-builds/` (`data/`, `pull.py`, `pullruns.py`, `an2.py`). - A **run** is one workflow on one commit. A **job** is a task a runner picked up. - **Job-min** is the time from task created to task ended. It counts a job's own time, not its time in the queue. **Totals:** 625 runs, 1,436 jobs, 3,022 job-min. 38 runs were waiting at 16:08Z. - **martha** is about half: 236 runs, 809 jobs, 1,597 job-min. Its ci.yml alone is 1,510 job-min: 46 runs of about 20 jobs, about 40 job-min a run. - **The rest:** sponsors 193 runs / 405 job-min, martha-board 18 / 661, ci-images 47 / 156, martha-engine 53 / 114, realm 29 / 41, eight small repos ≤11 runs each. - **Outcomes:** 304 success, 129 failure, 135 cancelled, 38 waiting, 19 skipped. - **The 135 cancelled runs were cancelled by hand** (by Terra and four other members), not by a concurrency rule. 40 of them are martha batch tips. **The top five sources:** | # | Source | Runs | Jobs | Job-min | |---|---|---|---|---| | 1 | A PR re-pushed after its first commit (57 PRs had 121 tips; one had 8) | 193 | 545 | 1,259 | | 2 | Batch tips: 86 runs, of which 46 are re-cuts of a batch already cut (martha batch PR 4 had 6 tips) | 46 re-cut | 112 | 263 | | 3 | The same commit run twice: a branch push plus its PR, mostly sponsors secrets.yml and conflict-markers.yml (`on: push` on every branch) | 132 | 139 | 32 | | 4 | main push of a sha the PR or batch tip had already run (fast-forward landing) | 25 | 72 | 206 | | 5 | Empty "re-run, no change" commits, which re-run the whole suite to recover a lost job | 18 | 59 | 144 | **One cost cuts across sources 1-5: martha ci.yml's three known reds.** - Gate coverage was red in 36 of 38 runs, nothing private in 29 of 29, and clean-install in 17 of 28. - Together they take 740 of ci.yml's 1,510 job-min: 457 on PR pushes, 180 on batch tips, 80 on empty re-runs, 24 on main. - Their red is read as "known" (Supervisor 12:10Z), so on a PR push their result decides nothing. - Separately, "the relay loads" job failed 11 of 28 runs (the #984 flake, Saturnus's #19). Those reds are what start the empty re-runs. ## Five rules, each with what it would have saved today The rows overlap (a re-push can also be a known-red run), so the savings do not simply add up. With the one overlap taken out (122 job-min of known-red jobs on 3rd+ tips), rules 1-5 together are about 1,500 job-min, half of today's 3,022. **Rule 1. One push per review round.** - The builder pushes once, when the local checks pass and the HANDOFF is ready. - A review fix is one more push. - With at most 2 rounds (DECIDED 11-20), a PR carries at most 2 tips. A rebase onto a moved main is the one extra push allowed. - WIP stays local. - **Saves:** the runs on a PR's 3rd and later tips were 94 runs, 239 jobs, 523 job-min (12 PRs). If every PR had one tip, the saving would be up to 193 runs and 1,259 job-min. - Needs no workflow change. It is crew practice, and the dispatcher sees it in the HANDOFF's range. **Rule 2. A known-red job stays off PR pushes until its fix is green.** - Gate coverage (#7), nothing private (#39/#40) and clean-install (#3) run on the batch tip and on main only. - Each one comes back to PR pushes the day its issue's fix is green. - **Saves:** 66 jobs and 457 job-min on PR pushes. martha ci.yml per PR push drops from about 40 to about 25 job-min. - Needs a workflow edit later (`if:` on three jobs), made under its own package. Not in this one. **Rule 3. A batch is cut once, and a lost job is re-run alone.** - The lander cuts the batch only when every package has its PASS at a final head. No re-cut while a member branch still moves. - A job lost to a runner restart is re-run alone, through the forge's re-run on that run, by whoever can. Nobody pushes an empty commit for it. - The runner restarts that lose jobs (#24, shutdown_timeout=0s) are fixed at the source. - **Saves:** re-cut tips were 46 runs, 112 jobs, 263 job-min. Empty re-run commits were 18 runs, 59 jobs, 144 job-min. Together that is 64 runs and 407 job-min, and most of the 40 hand-cancelled batch runs. - Open point: members cannot re-run a forge job today (permissions push:false). Who holds that button is part of the menu: the lander (Terra) or the Supervisor. **Rule 4. A fast-forward landing does not re-run the tip.** - When main moves by fast-forward to a sha that ran in full as a batch tip, the main push runs no suite again. - Main keeps its scheduled and drift jobs. The landing proof is the batch tip's run, which the menu already cites. - **Saves:** 25 runs, 72 jobs, 206 job-min. - Needs a workflow edit later (main push becomes a condition, or `push: main` comes off the heavy workflows). **Rule 5. One trigger per commit.** - Workflows run on `pull_request` and on push to `main` only, never on every branch push. - The cases today: sponsors' secrets.yml and conflict-markers.yml, realm's secrets.yml, ci-images' two selftests, and mcl-mail's lint, which build-push runs a second time (mcl-mail#4). - **Saves:** 132 runs and 139 jobs, but only 32 job-min. - The win is queue slots and container starts, not minutes: 12 of the 38 waiting runs at 16:08Z were sponsors. - Needs a trigger edit per repo later. **Not proposed:** a new check. None of the five needs one. Rule 1 is practice, the dispatcher reads it from the range, and rules 2-5 are workflow edits (DECIDED 2026-11-19, no new check without Raf's yes). **Not measured:** paths filters, for example host-drift and engine-drift only when their inputs change. Saving that would need each commit's changed files. If Raf wants it, I measure it next. ## What Raf picks One menu. Any of rules 1-5. - Rule 1 starts at once. - Rules 2, 4 and 5 become one workflow package per repo, each read before it lands. - Rule 3 needs the re-run button owner named, and #24 fixed.
Member

Two facts from 2026-11-22, for rules 3 and 5. They came out of the build00 runner fault (macula-io/martha#44, #30 comment 358).

  1. Dispatch is the forge's re-run. The forge has no re-run API, but it has POST /repos/{owner}/{repo}/actions/workflows/{file}/dispatches (body {"ref": "<branch>"}). A workflow that declares workflow_dispatch can be run again on the branch's real head, with no new commit and no rewrite. In macula-ci-images, build.yml, every *-selftest.yml, c4-model-gate.yml and reproducibility.yml accept it. The lander (Terra) can dispatch wherever she has push. Supervisor ruling: dispatch comes first where it exists.

  2. An empty commit starts nothing in a path-filtered repo. Every macula-ci-images trigger is path-filtered, and a commit that changes no file matches no path. So an empty "re-run" commit there fires no run at all (seen on pluto/8-pip-guard 672a92a0 and pluto/dep-advisories-checkout a5d03a28). It fired runs in martha only because martha's workflows carry no path filter.

The fallback where a workflow has no workflow_dispatch is DECIDED 2026-11-22 "Empty commit, faults only (Recommended)": one empty commit, only for a run voided by a runner fault, named in the HANDOFF. Every other case follows rule 3.

Two facts from 2026-11-22, for rules 3 and 5. They came out of the build00 runner fault (macula-io/martha#44, #30 comment 358). 1. **Dispatch is the forge's re-run.** The forge has no re-run API, but it has `POST /repos/{owner}/{repo}/actions/workflows/{file}/dispatches` (body `{"ref": "<branch>"}`). A workflow that declares `workflow_dispatch` can be run again on the branch's real head, with no new commit and no rewrite. In macula-ci-images, build.yml, every `*-selftest.yml`, c4-model-gate.yml and reproducibility.yml accept it. The lander (Terra) can dispatch wherever she has push. Supervisor ruling: dispatch comes first where it exists. 2. **An empty commit starts nothing in a path-filtered repo.** Every macula-ci-images trigger is path-filtered, and a commit that changes no file matches no path. So an empty "re-run" commit there fires no run at all (seen on pluto/8-pip-guard 672a92a0 and pluto/dep-advisories-checkout a5d03a28). It fired runs in martha only because martha's workflows carry no path filter. The fallback where a workflow has no `workflow_dispatch` is DECIDED 2026-11-22 "Empty commit, faults only (Recommended)": one empty commit, only for a run voided by a runner fault, named in the HANDOFF. Every other case follows rule 3.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
martha-ai/martha#43
No description provided.