The build coordinator: one CI run per HANDOFF round, never twice on a workflow and tree (martha#258) #267
Loading…
Reference in a new issue
No description provided.
Delete branch "saturnus/258-dispatch-coordinator"
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?
Refs martha-ai/martha#258
Purpose (cost): CI runs once per HANDOFF round, never twice on the same workflow and tree. DECIDED 2026-11-26 "Build coordinator".
What it is.
npm run dispatch:a-round-of-ciis one tick of the build coordinator, run on the lander's box by a timer. It reads the crew's HANDOFF lines from its spool. For each line it finds the open pull request whose head is the tip, from the same repository (never a fork) and in an allowlisted repository. Then it dispatches each listed workflow once, on that branch, with the round'sbase(the merge base) andpr.Never twice. A finished, non-cancelled run on the tip, or on a commit with the same tree that the coordinator dispatched, settles the workflow, green or red. A run still in flight keeps the request waiting. Runs are paced to the capacity file's limit per runner label.
Path lists. A workflow line flagged
pathsis dispatched only whenbase..tipchanges a path its list names. The list is.github/dispatch_paths/<workflow file>.txtat the tip.!line excludes a path, and beats a named line. A list of!lines only means "everything but these" (the docs-only skip).Repo-wide guards. The whole
npm testnamed two that the slice's own file does not run, and4c82f579meets both:npm run dispatch:a-round-of-ci), so it may reach fs, child_process and fetch;Not in this PR. The workflows still trigger on pull_request. They move to dispatch in the trigger PR (saturnus/258-dispatch-triggers), after the credential step.
Threat model. The coordinator holds one forge token: user
ci-dispatch, not an admin; Write on martha-ai/martha only; scopes write:repository and write:issue; in a 0600 file. It dispatches only on an allowlisted repository's open, same-repo pull request. Tag protection onv*andinstaller-v*keeps the token from starting a release.Reviews: r=1 FAIL → r=2 PASS; r=3 PASS (paths); r=4 PASS (
!lines). The merge of main052e5471and4c82f579go to the reviewer diff-only.🤖 Generated with Claude Code
052e5471' into saturnus/258-dispatch-coordinator 0f6541b46f