sparerunner

module
v0.0.0-...-681ab99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: Apache-2.0

README

SpareRunner

CI CodeQL OpenSSF Scorecard Go Reference License

Flexible GitHub Actions runners from the machines you already own — on demand or full-time.

SpareRunner turns trusted Windows, macOS, and Linux computers you already own into a small private GitHub Actions fleet. Join a machine with one command, then let a local controller schedule one-job runner processes across repositories and organizations—without Kubernetes, cloud instances, or mandatory containers.

The capacity is spare because you already own the hardware, not because it is short-lived. One fleet holds both kinds of machine at once:

  • the computer you work on, which contributes while you are willing to lend it and which you reclaim in one click;
  • the surplus computer with nothing else to do, which serves full time.

It fills the gap between registering runners by hand and running dedicated runner infrastructure:

GitHub-hosted runners
  ↓
a self-hosted runner registered by hand on each machine, for each scope
  ↓
SpareRunner
  ↓
ARC / Kubernetes / commercial runner platforms

[!WARNING] SpareRunner is not a public-code sandbox. Native mode provides an ephemeral GitHub runner identity and disposable work directory, not a disposable machine. Workflow code runs with the local runner account's privileges. Use it only with private repositories and trusted workflows, contributors, actions, and dependencies. Lending a computer you also use yourself does not change this.

Status

SpareRunner is under active pre-alpha development. The repository currently contains the accepted specification, durable domain/store foundations, the isolated GitHub scale-set adapter, and a Linux-capable controller/node enrollment path. sprun init, sprun serve, sprun join, sprun node add, and sparerunner-agent serve work for development, including pinned enrollment, mTLS WebSockets, reconnect, the signed GitHub App Manifest flow, installation discovery across multiple private org/repo scopes, private Target verification, generated management UI/API, node-affined scheduling, native runner lifecycle, verified cleanup, node availability control, per-Target exclusion, the desktop tray, and the Raycast extension. The production controller now starts a per-Target runner-coordinator fleet against real GitHub scale sets: each Target with a verified runtime binding gets its own message session and dispatch loop, and runner executions are created from GitHub's assigned-job statistic rather than from JobAvailable alone, which is what the scale-set protocol actually requires.

End-to-end job execution is not yet proven live: the last verified live run received, committed, and acknowledged every message correctly while the workflow still sat queued, and the fix for that has deterministic coverage but no live confirmation. Those core paths have local and fault-injection coverage, but OS service installation, a real private GitHub job, and live three-OS sandbox evidence remain release gates; the Windows local control endpoint fails closed. Restart and disconnect reconciliation against live GitHub state (task-011), node-affined scheduling's remaining live multi-Target evidence (task-010), per-Target availability's restart and reboot evidence (task-019), and macOS/Windows platform support (task-008/task-009) are still in progress. A tag now produces a draft, checksummed six-platform bundle with CycloneDX SBOM and GitHub attestation steps; it is not a supported release until the real-machine gate and platform signing prerequisites pass. Do not install it on a production runner fleet.

The specification is the project source of truth:

Intended experience

sprun init
sprun serve

Then, on another computer:

sprun join spr_...

Connect a GitHub App you own, then point a Target at a private scope. This needs no browser session with the controller — see Connecting a GitHub App:

sprun github connect --app-id 1234567 --client-id Iv1.… \
  --private-key-file ~/Downloads/your-app.private-key.pem
sprun github installations
sprun config apply fleet.yaml

Keep the App private key outside any repository working directory, and delete it once sprun github connect has stored it. It mints installation tokens for every installation of that App.

Workflows then select the fleet with:

runs-on: sparerunner

OS-specific labels are sparerunner-linux, sparerunner-macos, and sparerunner-windows.

On a computer you also use yourself, an optional tray client sits in the system tray or menu bar. It shows every private org/repo scope that computer currently waits on and what is running right now, and stops or resumes accepting new jobs in one click. The owner can also exclude a single scope while the machine keeps serving the rest. Stopping never cancels the job already running, and the same switch is available from Raycast on macOS, and as sprun node pause / sprun node resume:

sparerunner-agent serve --local-control
sprun node status

Product boundary

  • vs manual self-hosted runners: automated enrollment, per-job lifecycle, fleet scheduling, and multi-organization visibility
  • vs GARM: schedules on existing enrolled hosts instead of provisioning and deleting infrastructure instances
  • vs ARC: no Kubernetes; native Windows, macOS, and Linux hosts
  • built on GitHub scale sets: SpareRunner uses GitHub's official scale-set client and runner instead of replacing GitHub's scheduling protocol

The thing SpareRunner competes with is not Kubernetes. It is the manual loop of SSHing into each machine, downloading a runner, registering it per repository, installing a service, adding a second runner for a second job, updating it, stopping it, and re-registering it when it breaks.

The first release deliberately excludes public repositories and external forks, cloud providers, Kubernetes, controller HA, enterprise RBAC, VMs, external plugins, WAN/NAT traversal, GPU scheduling, and Docker mode. Directions the product may take later are recorded under Future Direction in the requirements.

Development

Prerequisites are pinned by mise, and just bootstrap installs all of them:

mise trust
just bootstrap
just check

just check also needs a Docker-compatible runtime for the privileged Linux runner boundary test. CONTRIBUTING.md covers setup in full, including what to do without one.

just --list shows every recipe. The ones you need most:

just check       # formatting, lint, tests, and builds
just check-ci    # everything the required CI gate proves, including the race detector
just lint        # Go, Web, workflows, shell, and committed secrets
just build-all   # cross-compile controller and agent
just check-release-artifacts dist # verify a GoReleaser bundle, checksums, and SBOMs
just dev         # Vite Web UI only through Process Compose

Every required CI check has a just recipe that runs the same thing locally, so a red pull request can always be reproduced without pushing again:

CI job Local command
Static analysis just lint-workflows, just lint-shell, just lint-secrets
Generated contracts just generate-api-check, just generate-web-check
Go quality just fmt-check, just test-go
Lint Go (per GOOS) just lint-go (host only; set GOOS for another target)
Go race detector just test-race
Go vulnerability scan just vulncheck
Privileged Linux runner boundary just test-platform-linux
Web quality just lint-web, pnpm --dir web typecheck, pnpm --dir web test:ci, just check-npm-policy
Web component tests pnpm --dir web test:ct
Raycast extension just lint-raycast
Management journey just test-management-ui-linux, just smoke-embedded-ui-linux
Cross-build just build-all

just test-enrollment-cli-linux runs the actual controller and agent CLI binaries inside a restricted Linux container and verifies join, reconnect, and join-code non-persistence. just dev still starts only the Web UI; it does not imply that the management API or controller-backed UI flows are available.

Tests write machine-readable results below output/test-results/, which is ignored by Git.

Pull requests that touch code also run CodeQL and dependency review; OpenSSF Scorecard and a reachable-vulnerability drift scan run weekly against main. See .github/workflows for what each one gates on.

Security

Please read SECURITY.md before reporting a vulnerability. The native runner isolation contract and threat model are documented, while their three-OS live evidence and signing prerequisites remain release gates. Until those gates pass, this repository is development software and has no security-support promise.

The boundary itself is written down, not implied:

  • Security contract — what SpareRunner promises and what it explicitly does not.
  • Threat model — the adversaries in scope and the ones deliberately out of scope.
  • Native isolation — what a runner process can and cannot reach on the host.
  • Support matrix — the OS and configuration surface each claim has been proven on.

Contributing and support

License

Apache License 2.0. See LICENSE.

Directories

Path Synopsis
cmd
sparerunner-tray command
Command sparerunner-tray is the optional, unprivileged desktop presentation of this computer's SpareRunner node.
Command sparerunner-tray is the optional, unprivileged desktop presentation of this computer's SpareRunner node.
sprun command
internal
agentstate
Package agentstate owns the canonical, secret-free Agent snapshot identity shared by the transport and SQLite adapters.
Package agentstate owns the canonical, secret-free Agent snapshot identity shared by the transport and SQLite adapters.
api
Package api owns the versioned loopback management HTTP boundary.
Package api owns the versioned loopback management HTTP boundary.
api/gen
Package gen provides primitives to interact with the openapi HTTP API.
Package gen provides primitives to interact with the openapi HTTP API.
app
Package app composes SpareRunner's enrollment, transport, and durable stores into executable controller and agent flows.
Package app composes SpareRunner's enrollment, transport, and durable stores into executable controller and agent flows.
auth
Package auth owns the single-admin browser session boundary for the loopback management API.
Package auth owns the single-admin browser session boundary for the loopback management API.
config
Package config owns the versioned, non-secret management configuration document.
Package config owns the versioned, non-secret management configuration document.
domain
Package domain defines SpareRunner's infrastructure-independent scheduling contracts.
Package domain defines SpareRunner's infrastructure-independent scheduling contracts.
enroll
Package enroll implements one-time controller enrollment without persisting private node key material.
Package enroll implements one-time controller enrollment without persisting private node key material.
github
Package github isolates the GitHub Actions scale-set client from SpareRunner.
Package github isolates the GitHub Actions scale-set client from SpareRunner.
nodectl
Package nodectl is the node-local control contract between the privileged Agent service and the unprivileged desktop surfaces (tray, launcher, CLI).
Package nodectl is the node-local control contract between the privileged Agent service and the unprivileged desktop surfaces (tray, launcher, CLI).
platform/linux
Package linux provides the Linux runner ownership boundary.
Package linux provides the Linux runner ownership boundary.
platform/macos
Package macos implements the macOS native-runner ownership boundary.
Package macos implements the macOS native-runner ownership boundary.
platform/windows
Package windows owns the Windows native-runner boundary.
Package windows owns the Windows native-runner boundary.
reconcile
Package reconcile restores Controller admission authority from durable desired state and authenticated Agent observations after a process or session boundary.
Package reconcile restores Controller admission authority from durable desired state and authenticated Agent observations after a process or session boundary.
releaseevidence
Package releaseevidence validates the machine-readable evidence required by the first cross-platform SpareRunner release.
Package releaseevidence validates the machine-readable evidence required by the first cross-platform SpareRunner release.
runner
Package runner implements the in-process native runner lifecycle boundary.
Package runner implements the in-process native runner lifecycle boundary.
scheduler
Package scheduler assigns concrete node slots to GitHub Targets.
Package scheduler assigns concrete node slots to GitHub Targets.
store
Package store owns the durable controller desired state and agent journal.
Package store owns the durable controller desired state and agent journal.
transport
Package transport owns the authenticated agent WebSocket protocol.
Package transport owns the authenticated agent WebSocket protocol.
winacl
Package winacl owns the exact Windows ACL and reparse-point contract used by SpareRunner credential locators.
Package winacl owns the exact Windows ACL and reparse-point contract used by SpareRunner credential locators.
test
live/linux command
live/macos command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL