Title: Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity · Issue #6580 · developing-today/code · GitHub
Open Graph Title: Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity · Issue #6580 · developing-today/code
X Title: Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity · Issue #6580 · developing-today/code
Description: Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity Status: design of record + MVP built same day (2026-11-06). Direction: Drew, 2026-11-06 11:28 CST. Supersedes the trigger request in #5663 (closed as supersede...
Open Graph Description: Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity Status: design of record + MVP built same day (2026-11-06). Direction: Drew, 2026-11-06 11:28 CST. Supersedes the trigg...
X Description: Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity Status: design of record + MVP built same day (2026-11-06). Direction: Drew, 2026-11-06 11:28 CST. Supersedes the trigg...
Opengraph URL: https://github.com/developing-today/code/issues/6580
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity","articleBody":"# Design: `fleet dispatch-test` — explicit-dispatch CI over fleet runner capacity\n\nStatus: design of record + MVP built same day (2026-11-06). Direction: Drew, 2026-11-06 11:28 CST.\nSupersedes the trigger request in #5663 (closed as superseded): **no GitHub Actions\ntriggers are enabled anywhere** — this mechanism is explicit `workflow_dispatch` only,\nconsistent with the standing no-auto-CI policy (2026-11-04 ruling, PR #5501). Label:\nGitHub Pro / runners program.\n\n## Problem\n\nFleet CI capacity is spread across several GitHub scopes (personal + two orgs), each\nwith its own hosted-runner concurrency. Load is wildly uneven: measured 2026-11-06\n~11:31 CST (in-progress / queued *runs*): `developing-today/code` 45 / 244,\n`developing-today-forks/opencode` 7 / 11, `developing-today-forks/openchamber` 4 / 17,\n`dezren39/darwin-nix` 1 / 1, `dezren39/hatch` 0 / 0. There is no single place to ask\n\"where is a runner free right now?\" and no generic way to run a build+test on the\nemptiest scope with results written back reliably.\n\n## The subcommand\n\nNew domain in the fleet multicall binary (`pkgs/fleet`, epic #5412 family):\n`fleet dispatch-test`, verbs `scan`, `submit`, `status`.\n\n### Capacity scan\n\nFor each scope repo, in configured order:\n\n1. `GET /repos/{r}/actions/runs?status=in_progress` — for each run,\n `GET /repos/{r}/actions/runs/{run_id}/jobs` and count jobs with status\n `in_progress` or `queued`.\n2. `GET /repos/{r}/actions/runs?status=queued` — each queued run counts as 1 active\n unit (a not-yet-started run exposes no jobs; this is the documented\n approximation).\n3. Workflow presence: `GET /repos/{r}/actions/workflows` — the scope is eligible\n only if an active workflow file named `fleet-dispatch-test.yml` exists there.\n\n**Eligible = active jobs \u003c threshold AND workflow present.** First eligible scope\nwins. Threshold is a tunable: `--threshold` flag / `[dispatch-test] threshold`\nconfig, **default 40** (Drew's tentative figure). Scopes default to\n`developing-today/code`, `developing-today-forks/opencode`,\n`developing-today-forks/openchamber`, `dezren39/darwin-nix`, `dezren39/hatch`\n(config-overridable). At the measurement above, `code` fails the threshold test\noutright and `hatch` is the first scope that is both under threshold and\nworkflow-equipped — the scan demonstrates both rules on real data.\n\nAuth: a GitHub token resolved **by name** through fleet-secrets\n(default `github.ghcr-classic-pat` — classic PAT, scopes include `repo` +\n`workflow`, verified live 2026-11-06; covers every scope above because the\nfleet operates as dezren39 in all of them). Follow-up: move to\ndeveloping.today-fleet App installation tokens for least-privilege per scope.\n\n## Job store: Turso (MVP choice)\n\nChosen: a dedicated Turso database `fleet-dispatch-jobs` (created 2026-11-06),\none table:\n\n```sql\njobs(id TEXT PRIMARY KEY, created_at TEXT NOT NULL, name TEXT,\n target_repo TEXT, target_ref TEXT, script TEXT NOT NULL,\n status TEXT NOT NULL, run_id INTEGER, run_url TEXT,\n exit_code INTEGER, output_tail TEXT, updated_at TEXT NOT NULL)\n```\n\nWhy Turso over a CF Worker queue endpoint for the MVP: the fleet already runs on\nTurso everywhere (brokers, atlas, ledgers), the HTTP pipeline API\n(`POST /v2/pipeline`) is callable identically from the laptop binary (ureq) and\nfrom a runner step (curl + jq), there is no new service to deploy or keep alive,\nand a dedicated database keeps the blast radius at one table. A CF Worker\nfront-end remains the right hardening step if runner-side access ever needs\nrate-limiting or payload validation — the store schema does not change.\nStatus flow: `queued → dispatched → running → succeeded | failed | error`.\nToken: `turso.fleet-dispatch-jobs-token` (BWS; also the pilot repo's\n`DISPATCH_TURSO_TOKEN` Actions secret; DB URL is the repo variable\n`DISPATCH_TURSO_URL`).\n\n## Job patterns\n\n**(2) ID-input — built first (MVP).** `fleet dispatch-test submit` generates an\ninternal id (`dt-\u003cmillis base36>-\u003c4 hex>`), stores the payload (script, ref,\nname) under that id, scans, records the chosen scope on the row, then dispatches\nthe pilot workflow with the single input `job_id`. The workflow fetches its job\nby id, marks it `running` (with run id + URL), executes the script, and in an\n`if: always()` step writes back the terminal status, exit code, and the output\ntail (last 6000 bytes) — so status lands **even on failure**, and a crashed or\ntimed-out run leaves the row in `running` where `status` shows it honestly\ninstead of pretending success. A job can be re-dispatched by id (fresh run row\nfields overwrite); retry is roughly idempotent because the payload is immutable\nand keyed by the id.\n\n**(1) No-inputs pull — designed, not built.** A generic workflow dispatched with\nno inputs boots, claims the newest `queued` row (single `UPDATE … WHERE id =\n(SELECT … ORDER BY created_at DESC LIMIT 1) RETURNING` shape), executes it, and\nwrites back exactly as in pattern (2). This is the better shape for bulk work\n(no per-job dispatch call, runners pull when free); it lands as a second\nworkflow mode once pattern (2) has soaked. The store and write-back contract\nare already compatible.\n\n## Pilot workflow\n\n`dezren39/hatch` (chosen: zero active runs at measurement time, PAT-owned, no\nreal CI to disturb) carries `.github/workflows/fleet-dispatch-test.yml`:\n`workflow_dispatch` with required input `job_id`, `permissions: contents: read`,\n30-minute timeout, steps fetch → checkout(job ref) → execute → write-back\n(always) → upload `job-output.log` artifact (14-day retention). The workflow\nmust live on the repo's default branch for dispatch to see it (GitHub rule).\n\n## Artifact quotas + return paths\n\n(Research numbers posted as a comment on this issue: per-account artifact\nstorage GB, cache GB, retention defaults/min/max, private-repo minutes,\nconcurrency — dezren39 GitHub Pro personal, developing-today org,\ndeveloping-today-forks org, with sources.)\n\nReturn-path evaluation:\n\n1. **GitHub Actions artifacts (default).** Zero new infra; the output log rides\n the run. Limits: per-account storage pools are small on personal/org plans\n (see research comment) and retention is capped; fine for logs and small\n outputs, wrong for build products.\n2. **R2 via a Cloudflare Worker (fallback, when artifacts don't fit).** The\n fleet already operates Workers + R2 patterns (webhook-gateway, hatch\n workers); a presigned-upload Worker endpoint lets a runner stream large\n outputs to R2 with no GitHub storage pressure. Build only when a real job\n outgrows (1).\n3. **Tunnel straight to the laptop (last resort).** The lab tunnel\n (`lab.security.cab`) proves the path exists, but runner→laptop transfers\n couple CI results to home-network availability; use only for outputs that\n must never leave fleet hardware.\n\nRecommendation: **(1) by default, (2) when size/retention demands, (3) only on\na stated privacy need.** The store's `output_tail` covers the common case\nwithout any artifact at all.\n\n## MVP scope (this build)\n\n- `fleet dispatch-test` domain: scan / submit / status, threshold tunable,\n config in `[dispatch-test]`, tokens by name. (PR + merge link below.)\n- Turso store as above; pilot workflow in `dezren39/hatch`.\n- One end-to-end proof: a real submitted smoke job (checkout ref, print\n environment, exit 0) with scan choice, run URL, and final stored status\n recorded on this issue.\n- Out of scope for the MVP: pattern (1), App-token auth, R2 return path,\n installing the new binary fleet-wide (rides the normal fleet build/deploy\n path), any change to runner strategy beyond this dispatch mechanism.\n\n## Risks / notes\n\n- `workflow_dispatch` requires the workflow on the default branch of each\n participating repo — adding scopes later is a one-file PR per repo.\n- Runner-side store token is full-access to this one small database by\n design; rotation = `turso db tokens invalidate fleet-dispatch-jobs` +\n re-mint + BWS + repo secret update.\n- The queued-runs-as-1 approximation can undercount a queued multi-job\n matrix run; acceptable for a capacity heuristic, revisited if it misleads.\n\n## Acceptance criteria\n- `fleet dispatch-test scan` reports per-scope in-progress/queued load and workflow eligibility for the five configured scopes, honoring the threshold flag/config (default 40).\n- `submit` runs a build+test job on the first eligible scope via explicit `workflow_dispatch` only — no automatic GitHub Actions triggers are enabled anywhere.\n- `status` reports the dispatched run's state and result from the Turso job store (`fleet-dispatch-jobs`), including run URL and exit code.\n- The design's MVP scope is either landed or split into tracked implementation issues linked from this issue; no part of the design sits silently.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-11-06T17:35:28Z","url":"https://github.com/developing-today/code/issues/6580"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a73832f-a244-cdfe-7266-c53ebb3a8d96 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA10:33E446:20299A:2B148E:6B0612F0 |
| html-safe-nonce | cdad732fbf51ddf4bb845c2001e3bea5996b36cdcafc9c21ea7e8b3f2ea7805f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTEwOjMzRTQ0NjoyMDI5OUE6MkIxNDhFOjZCMDYxMkYwIiwidmlzaXRvcl9pZCI6IjYxODcwMjk0MTg0NjI4OTc2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 2666dcd48d179196ab0dcde8b2bd8a101ecf5ddb29a087f7532f4430d664ac74 |
| hovercard-subject-tag | issue:6247596119 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/6580/issue_layout |
| twitter:image | https://opengraph.githubassets.com/d5e01004b743ac6f935b9ff907d4d3e9aa8d86cccdf532b7eec7bc033183fa68/developing-today/code/issues/6580 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/d5e01004b743ac6f935b9ff907d4d3e9aa8d86cccdf532b7eec7bc033183fa68/developing-today/code/issues/6580 |
| og:image:alt | Design: fleet dispatch-test — explicit-dispatch CI over fleet runner capacity Status: design of record + MVP built same day (2026-11-06). Direction: Drew, 2026-11-06 11:28 CST. Supersedes the trigg... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | e58943f0186bb8d97b217393c2724a49ab47e4aefefc43595a90fa04699066c9 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 23517473abc6d5da019b4958bd421644e98a418b |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width