Build coordinator: CI runs once per HANDOFF round and once per landing batch, dispatched by a queue paced to runner capacity #258
Open
opened 2026-11-26 10:37:30 +00:00 by saturnus
·
1 comment
No Branch/Tag specified
main
vesta/372-lan-members
terra/batch-337-237
uranus/251-fold-ci
saturnus/229-land-skip
titan/2-worktree-finish-branch-form
neptunus/232-repo-delete-clean
neptunus/230-force-push
uranus/111-gitlink-eisdir
venus/129-no-launcher-endpoint
saturnus/45-branch-move-head
jupiter/45-volatile-mesh-say
venus/8-land-on-any-host-2
titan/111-gitlinks
juno/040-host-rerecord
vesta/24-remove-github-sponsors
ceres/19-signin-probe
vesta/67-set-a-exports-git-dir
jupiter/47-status-clock
pallas/46-forge-ci-seam
juno/39-offline-private-scan
ceres/19-relay-end-written
venus/8-land-on-any-host
ceres/19-relay-frame
venus/28-budget-line
vesta/48-git-guard
ceres/47-hourly-status
terra/batch3-forge-b
pluto/23-declared-digests
ceres/318-friction-note-rebuilt
neptunus/check-private-digests
hygiea/5-tsx-typecheck
terra/batch2-forge
vesta/973-ask-proof-and-pr-base
jupiter/16-5-3-forge-repo-links
jupiter/check-private-stop
terra/batch3-forge
saturnus/1016-crew-mail
venus/999-refresh-modes
uranus/601-martha-forge-workflows
ceres/1041-work-graph
jupiter/957-gap-19-prompt-text
mercurius/987-stranger-text-gate
jupiter/check-private-stop-posted
pluto/1045-under-600
ceres/1041-contract-lines
pluto/1045-free-splits
diverged/hygiea/962-worktree-finish-owner-and-branch
ceres/967-provider-key
saturnus/1016-mesh-key
hygiea/962-worktree-finish-owner-and-branch
pluto/1045-cognitive-complexity
venus/999-refresh-modes-held-merge
pluto/1010-repo-numbers
pluto/1010-drift-numbers
terra/batch-terra-1121e
hygiea/916-provider-subscription-refusal
venus/999-brief-notice
hygiea/992-job-timeouts
jupiter/1016-crew-memory
terra/batch-terra-1121c
mars/1000-progress-off-tasks
uranus/989-confinement-v
hygiea/985-launcher-verbs-r2
mars/985-rename-handover-match
jupiter/979-guard-places
uranus/980-assign-model
ceres/959-wake-on-idle
uranus/989-confinement-u
juno/802-a-handle-on-my-run
pluto/989-confinement
terra/batch-terra-1120f
mercurius/987-rebased-keep
vesta/308-a-week-of-the-ledger-vesta
jupiter/984-gap-5-crew-state
hygiea/985-launcher-verbs
vesta/915-worktree-finish
terra/batch-terra-1120b
terra/981-review-fix
venus/review-917
final-tip
keep-318-tip
neptunus/1006-review
hygiea/976-the-ci-wait-by-run
terra/979-review-fix
terra/962-review
hygiea/601-row-174-the-engines-settings-watch
uranus/968-markers-r1
terra/981-review
vesta/308-a-week-of-the-ledger
terra/986-review
saturnus/511-up-config
hygiea-601-last3b
hygiea-601-last3
hygiea-601-pre-rebase
jupiter/batch-92
venus/venus-review-929
venus/venus-review-934
uranus/511-up-claude
saturnus/511-refusals
venus/906-token-fixture
jupiter/541-a-engine-start-clean
uranus/614-slice3-approved-skills-on
uranus/614-dw6-unrooted-skill-folders
venus/639-redact-stdin
venus/venus-review-913
neptunus/547-s6-kitty-launch
venus/venus-review-897
neptunus/907-review
venus/898-bundle-main-installer
hygiea/309-a-declared-goal
venus/614-engine-skills-2
neptunus/893-review
venus/639-night2
venus/venus-review-883
jupiter/541-c4-goose-call-answered-by-the-entry
venus/venus-review-866
venus/541-9a-slice-2
mercurius/614-engine-skills
titan/637-updater-switch
pluto/755-fewer-judge-starts
uranus/836-review
mercurius/846-posted-text
neptunus/828-review-r1
titan/801-hint-text
uranus/785-part-2
uranus/797-review
neptunus/830-review
venus/venus-review-837
uranus/724-reap
juno/784-the-launch-a-start-builds
neptunus/784-review-fix
juno/784-the-adapter-under-its-ceiling
diverged/juno/784-the-launch-a-start-builds
juno/784-the-adapter-back-under-origin
neptunus/694-review-fix
juno/732-the-cap-holds-b
neptunus/732-review-fix
titan/541-c3-hints-record
jupiter/host-2.1.328
juno/732-the-cap-holds
ceres/781-launcher-path
uranus/785-hint-files
ceres/724-part-2
neptunus/766-review-fix
uranus/755-hook-filter
jupiter/review-788
neptunus/745-review-fix
uranus/772-judge-env
jupiter/753-keys-declared-twice
pallas/784-launch-request
ceres/562-wire-the-scan
jupiter/744-split-prove-the-core
titan/541-c2-goose-gate-rows
pallas/765-approve-listing
pr-766-tip
terra/769-review
pallas/748-cycle-roots
uranus/uranus-batch-69
venus/venus-review-756
pr-733-head
neptunus/727-shell-quoting
venus/venus-review-738
pallas/694-a-trial-line-keeps-its-transcript
ceres/724-part-1-a-test-leaves-nothing-behind-v2
ceres/tests-leave-nothing-in-the-temp-directory
neptunus/541-2-4-3-the-recording
ceres/700-the-stand-in-reports-its-start
titan/541-6b-multi-host-review-model
uranus/uranus-733r1
scratch-703
titan/541-5-member-host
neptunus/541-2-4-2-the-tool-call
ceres/625-release-redraw
mars/541-acp-transport
ceres/batch-62-redraw
neptunus/541-6-host-model-vocabulary
heads/pr/672
pr/672c
heads/pr/673
juno/541-6-host-model-vocabulary
pr/668b
saturnus/612-no-answer-gets-a-second-launch
ceres/601-release-bump
heads/pr/625
heads/pr/668
pr/656b
heads/pr/666
pallas/611-init-layout
pr/654-r2b
heads/pr/656
pr/662-new
pr/654-new
pr/660-new
saturnus/632-retire-owner-guard
saturnus/602-own-config
ceres/638-read-shape
neptunus/541-10-recorded-goose-host
titan/611-init-layout
venus/244-member-half
titan/165-stand-in-case
pallas/177-tree-stat-record
ceres/314-volatile-path-note-clean
uranus/uranus-batch-48
jupiter/160-where-we-are
uranus/uranus-batch-46
juno/513-budget-r2
pallas/437-trial-builder-r2
pallas/437-trial-builder
saturnus/289b-shell
saturnus/289b-rules
saturnus/289-record-values
ceres/170-vouching-on-real-events
ceres/170-vouching-reaches-the-member
neptunus/136-member-memory
mercurius/4-claw-code-analysis
mercurius/5-scaffold-theme
v0.5.0
dry-run-v0.5.0
installer-v2.0.4
dry-run-installer-v2.0.4
v0.4.3
installer-v2.0.3
dry-run-installer-v2.0.3
dry-run-v0.4.3
v0.4.2
dry-run-v0.4.2
installer-v2.0.2
dry-run-installer-v2.0.2
v0.4.1
dry-run-v0.4.1
installer-v2.0.1
installer-v2.0.0
tested-locks
v0.4.0
ci-tools
v0.3.0
installer-v1.1.1
v0.2.0
installer-v1.1.0
v0.1.0
installer-v1.0.2
installer-v1.0.1
installer-v1.0.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
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#258
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (cost): CI runs once per HANDOFF round and once per landing batch, never twice on the same workflow and tree, and never more at once than the runners can take. Today a push is a run: ~5,375 jobs and ~105 runner-h a day (forge-setup#75).
Decision: DECIDED 2026-11-26 "Build coordinator" (Raf's lean-CI menu, via the Supervisor; placed by Mars). It replaces macula-io/macula-sponsors#85: once a push starts no run, there is nothing to count per push. It sits in the lift order of the lean-CI design (step 3), beside DECIDED 2026-11-26 "M2: path-filtered".
Design r2 (r1 FAIL by Mars on fable: F1-F4 and notes N5-N14 folded; the change list is in the r2 comment)
1. Triggers. Every crew workflow triggers on
workflow_dispatchand onpushtomain, and on nothing else. Withpull_requestgone, a push to a member branch starts nothing.base(40 hex: the PR's base sha) andpr(its number). The range jobs readinputs.baseon a dispatch andgithub.event.beforeon a push: ci.yml:871, 948-949, 1058-1059 and 1174-1175 are "no test the base passed goes missing", "pictures change only with the version", "nothing private" and the literal check. So a dispatched run judges the same range a PR run did. Dispatched run 4499 showed that without it they fail, skip or pass vacuously..forgejo/heavy_paths.txt. The coordinator dispatches heavy.yml for a round only whengit diff --name-only base..tiphits it.judge_the_checks.ts(:9, :89) the dispatch shape (N13).2. Requests. The mod writes one request per HANDOFF to the coordinator's spool on host00, one file per request (the lander-spool pattern):
<org/repo> pr=<n> <branch> <base40>..<tip40> <package> r=<N>A landing needs no request. A batch is one push of N merges to main (N14), and that push is its one run.
3. The queue script (
src/dispatch_a_round_of_ci/, beside the land script). A user timer on host00 starts it as a oneshot service, about every minute (N8). Per request:tip^{tree}). A FINISHED, non-cancelled run of that workflow on a commit with that tree settles the request, green or red. The coordinator comments that run's id on the PR and dispatches nothing. A red is not redispatched on a re-sent HANDOFF: the flake rule stands (one job rerun, by the lander). A RUNNING run keeps the request waiting, because a concurrency group can still cancel it (ci.yml:37-39). A cancelled run settles nothing.POST /repos/{o}/{r}/actions/workflows/{file}/dispatcheswithref=<branch>andinputs={base, pr}. Then it reads the run back byhead_sha. If the branch moved in between, the run is not this round's: it says so on the PR and does not redispatch.8f43cb5d: 87 statuses, all pull_request). So the coordinator comments the run id on the PR. The readers already go by the runs API (skipped_ci_jobs.ts:41,49, handoff_commits.ts:199). The HANDOFF goes before the run exists and carries theci=form for owed CI; the VERDICT names the run.martha-bwrap 1) and the allowlist live on host00 beside the token, in the coordinator user's config directory, not in martha's tree.4. The landing skip reads a dispatched run (F4).
crew-code/core/skip_ci_on_landing.ts:211turns the landing skip off for any workflow that triggers on push without pull_request. After the trigger PRs that is every repo. The reader now accepts a green, finished, dispatched run on the PR tip as that tip's evidence, so "a land whose tree equals a green PR tip runs nothing on main" still holds. martha keeps it off under M2, as the lean-CI design says.5. Owner. The lander owns it: Terra, Pluto as backup, Pallas during the cooldown. Their jobs are to start and stop the timer, edit capacity and the allowlist, and drain or clear a stuck request. The coordinator never reruns.
6. Threat model. The coordinator holds a forge token, and a token that can dispatch can also write to the repo. Forgejo has no dispatch-only scope.
ci-dispatch), with write only on the allowlisted repos.main(landers only) means it cannot land code. Release tags (v*,installer-v*, which release.yml and installer.yml publish from) get the same tag protection, to the landers (N9). That forge setting goes in the cred menu with the bot.7. Order and rollout (N13).
inputs.base..tip, not an empty base.Pieces
src/dispatch_a_round_of_ci/: script, oneshot unit and timer. It gets a C4 box and a README row.skip_ci_on_landing.tsreads a dispatched run.saturnus/85-push-roundare reused where they fit.inputs.base,heavy_paths.txtwhere there is a heavy.yml, andjudge_the_checks.ts.ci-dispatchbot, its token, and tag protection to the landers.Refs forge-setup#75, macula-io/macula-sponsors#85
Design r2: the r1 FAIL (Mars, fable) folded. The body above is now r2. Each finding and where it went:
base+pr. The range jobs (ci.yml:871, 948-949, 1058-1059, 1174-1175) readinputs.baseon a dispatch, and the spool line carriespr=<n>andbase..tip. §1, §2. It is also a proof item in §7..forgejo/heavy_paths.txt, and the coordinator diffsbase..tipagainst it. §1.skip_ci_on_landing.ts:211: the reader accepts a green, finished, dispatched run on the tip. §4, and §7 step 1.v*andinstaller-v*tag protection to the landers goes in the cred menu. §6.judge_the_checks.ts. §1, §7.