machines
The machines jobs run on: local, where Arthur and the coordinator run, and others reached with ssh over a private network (Tailscale), with the user’s own keys and ~/.ssh/config: no secret in the config, no password prompt, no host key accepted on its own, and a machine whose address is not private is refused. Each machine has labels (os, arch, tools); a job goes to a machine that has the labels its project’s piece, machines.project({ ... }), or its ticket’s requires names. Every machine is checked at the start of arthur run and then at a set interval, and a change is machine-online or machine-offline. Nothing listens for Arthur on any of them.
machines({ local: { labels: { tools: ["docker"] }, maxJobs: 3 }, list: [{ name: "mac", ssh: "mac-mini", home: "/Users/arthur/.arthur", labels: { os: "macos", arch: "arm64", tools: ["xcodebuild"] }, maxJobs: 2 }], check: { everySeconds: 60 },}),Options
Section titled “Options”local.labels.tools: the tools on this machine a job may need, such asdocker; itsosandarchare detected, never set.local.maxJobs,list[].maxJobs: the most jobs at once on the machine. Default no limit of its own; orchestration’smaxAgentscounts every job.list: the other machines, each{ name, ssh, home, labels?, maxJobs? }:name, which--machineand a job’s record use, neverlocal;ssh, aHostof~/.ssh/configor a host name such as a Tailscale name;home, Arthur’s home folder there for its jobs and repositories;labels.os(linuxormacos),labels.arch(Node’s word:x64,arm64) andlabels.tools, whatrequiresis matched against. Anosorarchthat disagrees with the machine keeps it offline.check.everySeconds: seconds between the checks of every machine overssh: its address private,arthur version, its os and arch, its free CPU and memory. Default 60.
Each machine’s labels are what other plugins read as machines.labels: the docker plugin acts on the machines whose tools hold docker (commands/machines.md).
arthur machines (/machines on a channel) shows each machine, online or why not, with its jobs, and arthur machines update [<name>] brings each to the commit Arthur’s checkout here is at, through arthur update there; its page, what arthur machines --help prints, is commands/machines.md.
arthur machines
Section titled “arthur machines”Usage: arthur machines, arthur machines update [<name>]; on a channel /machines. Comes with the machines plugin.
Every machine jobs may run on, local first, then the list in config order, each checked now (below), without the model; the shell and the channel get the same text. Each machine’s line says online or why not, and under it its labels, its maxJobs and its jobs that have not ended, each with its state:
local: online (linux x64, arthur 0.1.0 3f9c2a1b7d4e) labels: os linux, arch x64, tools docker; maxJobs: 3; jobs: 2026-10-18-worker-1a2b3c4d (working)mac (ssh mac-mini): offline: ssh mac-mini: arthur@mac-mini: Permission denied (publickey).; fix: ssh-copy-id mac-mini labels: os macos, arch arm64, tools xcodebuild; maxJobs: 2; no jobsAny other argument is wrong usage: usage: arthur machines [update [<name>]] and exit code 2 in the shell, usage: /machines on a channel. A config or a plugin that does not load: exit code 1.
The list
Section titled “The list”The machines are declared in arthur.config.ts, as the options of the plugin:
machines({ local: { labels: { tools: ["docker"] }, maxJobs: 3 }, list: [ { name: "mac", ssh: "mac-mini", home: "/Users/arthur/.arthur", labels: { os: "macos", arch: "arm64", tools: ["xcodebuild"] }, maxJobs: 2 }, ], check: { everySeconds: 60 },}),local: the machine Arthur runs on, always there. Itsos(linux, ormacoson a Mac) andarch(Node’s word:x64,arm64) are detected;labels.toolsandmaxJobsare given here, both optional.list: the other machines, optional. Each entry hasname(lowercase letters, digits and dashes, from a letter),ssh(aHostof~/.ssh/configor a Tailscale name, never an ssh option),home(Arthur’s home folder there, an absolute path: its job records, repositories and worktrees), all required;labels, each optional:os(linuxormacos),arch(asuname -msays it in Node’s words:x86_64isx64,aarch64isarm64) andtools(a list of command names, such asxcodebuildordocker, each onecommand -vfinds there:arthur doctorchecks them, below); andmaxJobs, a whole number of 1 or more. Left out,maxJobssets no limit of the machine’s own;maxAgentsof orchestration still counts every job.check.everySeconds: how oftenarthur runchecks every listed machine; default 60, at least 10.
Each listed machine is registered with the core’s job runner, with its labels, so arthur spawn --machine <name> runs a job there (see arthur spawn --help), and each job is placed by its labels (below).
Refused at load, each refusal naming the machine and the option’s path: a missing name, ssh or home; a name, ssh or home of another form; any other key; an os label other than linux or macos; a tools that is not a list of names; a maxJobs that is not a whole number of 1 or more; os or arch on local; a machine named local; two machines with one name; an everySeconds under 10. And a machine whose ssh resolves to a public address: the host name ssh -G <ssh> prints, or each address that name resolves to, must be private, which is loopback (127.0.0.0/8, ::1), RFC 1918 (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) or Tailscale (100.64.0.0/10, fd7a:115c:a1e0::/48), but not the cloud metadata address 100.100.100.200 inside them: Arthur reaches its machines only over the private network. A name that does not resolve at load (Tailscale down) does not refuse it: its check says so.
The check
Section titled “The check”arthur run checks every listed machine at its start and every check.everySeconds; arthur machines, /machines and arthur doctor check them when asked. All machines are checked in parallel, and each check is cut after 10 seconds, its ssh killed, so ten machines that do not answer cost 10 seconds, not 100; a check asked while one runs waits for that one. A check:
- The address, as at load:
ssh -G <ssh>and the name it prints resolved here, each address private. - One command over the core’s SSH,
ssh -o BatchMode=yes -o StrictHostKeyChecking=yes -o ConnectTimeout=10 <ssh> sh -c '<script>' sh <free> <n> <paths> <tools>: the script runsuname -sm && arthur version && node -e "$1", thendf -Pkon each of the<n><paths>(missingfor one not there; it stops at df’s first failure, whose line it keeps), thencommand -von each of<tools>, thengit var GIT_AUTHOR_IDENTandgit var GIT_COMMITTER_IDENT, printing df’s exit code and output last, after a linedisk <code>, only with paths.<free>is a Node script that prints one JSON line of the machine’s free CPU and memory over one second,<paths>the ones the round’s answers name (below), both for theresourcesplugin,<tools>the machine’stoolslabels: ssh never asks for a password and never accepts a host key on its own. - What the machine says compared with its labels (
os,arch, where given) and with this core’s version:arthur versionprints<release> <hash>(arthur version --help), and only the hash, the last word, must be the same, so two releases of one core agree. An online machine is shown, and told inmachine-online, with its own line.
The machine is online when all three pass. Otherwise it is offline, the reason one of:
ssh <ssh> resolves to <address>, not a private address, orssh -G <ssh>: <error>and a name that does not resolve.ssh <ssh>: <ssh's line>: ssh’s own failure (its exit code 255), such as a key the machine refuses (Permission denied (publickey).), a host key that is not known or has changed (Host key verification failed.), or a machine that does not answer. Each check tries again the same way, never with a password and never accepting a key.arthur is not there (<its line>): noarthuron thePATHof a command over ssh there.git is not there (<its line>): nogiton thePATHof a command over ssh there (itsgit var, below, exits 127).its labels say os macos; the machine says linux x64: a label that disagrees with the machine, both named.it runs arthur <theirs>, this one is <ours>; both need the same version, both whole lines ofarthur version: another hash, or a line of a hash alone, as Arthur printed before its releases.uname -sm && arthur version && node -e failed there: <its line>, orcheck timed out after 10 s.
Each offline reason comes with its fix: ssh-copy-id <ssh> for a refused key; for a host key, compare ssh-keyscan <ssh> with the key the machine itself shows, then add it to ~/.ssh/known_hosts; arthur machines update <name> (below) when its arthur is of another version; when arthur is missing, install Arthur's core there (docs/deploy.md), arthur on the PATH of a command over ssh, then arthur machines update <name>; git installed there, on the PATH of a command over ssh (docs/deploy.md), when git is missing; the labels in arthur.config.ts set to what the machine is; the machine on the private network (tailscale up there) when it does not answer.
As each round begins, in arthur run, arthur machines, /machines and arthur doctor alike, the plugin calls collect("machines.round", checks, everySeconds), checks a Map of each listed machine’s name to a promise of its check: { free, disk }, the line node -e printed and, with paths, df’s { code, output } (its errors in the output), once it is online, or { error }, its offline reason above; everySeconds, its check.everySeconds, so the resources plugin reads that check until twice that has passed. Each answer is a Map of a machine’s name to the paths its check’s df reads, which the checks wait for, within their 10 seconds; an answer that rejects or is no Map names none. The resources plugin keeps the check as the machine’s free CPU and memory and, with keepFree.disk, its free disk, so one ssh call per machine and round serves the check and both readings. A df that fails leaves the machine online, with no room in the resources plugin; a df that hangs past the 10 seconds takes the whole check with it, check timed out after 10 s.
In arthur run, each change is an event, once: machine-online with machine, os, arch and version, or machine-offline with machine and reason. The first check after the start tells each machine’s state; after that only a change does, so a machine that stays offline is told once, and one that goes offline and comes back is told twice. A reason that changes while the machine stays offline is no event. arthur machines from a shell checks, but emits nothing: the events are arthur run’s.
Other plugins read a machine’s labels through collect("machines.labels", machine): local’s with its detected os and arch and its tools from local.labels, a listed machine’s as arthur.config.ts writes them ({} without labels), undefined for a name the plugin does not know. The docker plugin acts on the machines whose tools hold docker.
Updating
Section titled “Updating”arthur machines update brings every listed machine to the version here, arthur machines update <name> the one named: it runs arthur update <commit> there over the core’s SSH, <commit> the commit Arthur’s checkout here is at (git rev-parse HEAD in the core’s folder), not the newest release, so a machine runs what this one runs, a development checkout of main included. arthur update there fetches that commit from its origin, checks it out and runs npm ci (arthur update --help). The machines are updated in parallel, each cut after 600 seconds, one line each, in the list’s order:
mac: updated 0.1.0 3f9c2a1b7d4e to 0.2.0 8b0c9ebef9cabuild: offline, skipped: ssh build-box: ssh: connect to host build-box port 22: Connection timed outgpu: not updated: arthur update: /home/arthur/arthur has changed tracked files: package.json; commit, stash or undo them firstA machine ssh does not reach (its exit code 255) is named and skipped, offline, skipped: ssh <ssh>: <ssh's line>; one where arthur update refused or failed, not updated: <its last line on stderr> (exit code <n> when it said nothing); one killed before it ended, at the 600 seconds or by a signal, cut before arthur update ended there (<its last line>), maybe during its npm ci: run arthur update <commit> there by hand, since its own rollback did not run; the others are updated all the same. Exit code 0 when each was updated or up to date, else 1. A machine whose Arthur has no arthur update yet is updated once by hand (docs/deploy.md, “Updating”).
Refused, exit code 1: inside a job, arthur machines update: refused inside a job <id>: a job runs only the commands its role needs; put what the coordinator should do in your final message, before any SSH; a name not in the list, no machine <name>; machines: <names> (machines: none with an empty list); an empty list, no machine to update: the list of the machines plugin is empty; and a core outside a Git checkout, this core, <folder>, is not in a Git checkout: arthur machines update brings each machine to the commit it is at.
Placing a job
Section titled “Placing a job”The plugin answers the core’s jobs.place for every spawn, arthur spawn and a plugin’s host.jobs.spawn alike, so each job runs on a machine that has what it needs. The labels a job needs come from the first of these that is there:
arthur spawn --requires os=macos,tools=xcodebuild(a plugin’s spawn:requires: { os: "macos", tools: ["xcodebuild"] }).- The
requireskey of its ticket’s JSON block, thejsonblock at the top of the ticket’sticket.md, such as"requires": { "os": "macos", "tools": ["xcodebuild"] }. The ticket is the firstTicket:of the task that lies in a ticket folder (spec/features/<id>-<slug>/), read in the project’s main checkout. The ticket’srequiresreplaces the project’s as a whole; an empty one,"requires": {}, clears it. - The project’s piece,
machines.project({ os?, arch?, tools? })in its project file (arthur projects --help, “A project’s file”). One of another shape is refused at load, before the setup:plugin machines: setup failed: project <name>: machines.project(...): requires must be .... - None: the job may go to any machine.
The ticket and the project come from the projects the projects plugin provides; without it (projects off), neither requires anything. Every job of a ticket, worker, review or plan, whose task names the ticket, is placed by the same labels, so its checks run where it was built.
A ticket’s JSON block may also name the machine every job of it runs on, "machine": "local", read beside requires (also when --requires replaces its labels): a ticket that cannot run elsewhere, such as one that makes a new plugin with arthur plugin new (arthur plugin --help). It is placed as --machine is, below; --machine wins over it.
A machine has the labels when its os and arch are the ones asked (a machine without that label has not) and its tools hold each tool asked. Without --machine or a ticket’s machine, the job goes to one of the machines that have the labels, are online and are under their maxJobs (the jobs counted are those in a run on it: working, idle, or held; local is always online, the others are checked now as above, in parallel): the one with the most room. The room is what the resources plugin answers when it provides resources.free (called with the machine’s name, the jobs it has room for, roadmap entry 34), else the fewest jobs in a run; on a tie local, then the list’s order. With --machine, or else a ticket’s machine, the named machine must have the labels and is neither checked nor held to its maxJobs, so a job goes there as before; an unknown name is the core’s to refuse (unknown machine <name>; machines: <names>).
Refused before any worktree or record exists, naming the labels, where they come from (--requires, ticket <id> or project <name>), and every machine with its labels and its state (online, <n> jobs, online, full: <n> of <maxJobs> jobs, or offline: <reason>):
no machine has the labels; the job needs tools gpu (--requires); machines: local (os linux, arch x64, tools docker): online, 0 of 3 jobs; mac (os macos, arch arm64, tools xcodebuild): online, 1 of 2 jobsevery machine with the labels is offline or full; the job needs os macos, tools xcodebuild (ticket AR0003); machines: local (os linux, arch x64, tools docker): online, 0 of 3 jobs; mac (os macos, arch arm64, tools xcodebuild): offline: ssh mac-mini: arthur@mac-mini: Permission denied (publickey).machine local lacks os macos, tools xcodebuild; the job needs os macos, tools xcodebuild (project shop); machines: ...machine local, which its ticket names, lacks os macos; the job needs os macos (--requires); machines: ...Also refused, naming where: a requires that is not { os?, arch?, tools? } with os and arch non-empty strings and tools a list of them (<where>: requires must be ...), a ticket’s machine that is not a non-empty string (ticket <id> (<file>): machine must be a machine's name, got <value>), and a ticket whose JSON block is not JSON (<file>: its JSON block is not JSON (<error>); fix it by hand), also when --requires is given.
arthur doctor
Section titled “arthur doctor”The plugin gives arthur doctor (roadmap entry 80) one requirement per listed machine, never critical, so arthur run starts with a machine offline: machines <name>: ok (linux x64, arthur <version>), or machines <name>: missing: <reason>; without it: no job runs on <name>; fix: <fix>, the reason and fix as above.
The same check asks command -v there for each of the machine’s tools labels, each a command name, on the PATH a command over ssh gets. A machine online with one not found stays online (placement goes by the labels as written), and its line names each: machines gpu: missing: command -v finds no nvidia-smi, xcodebuild there (linux x64, arthur <version>); without it: no job that needs nvidia-smi, xcodebuild runs on gpu; fix: install nvidia-smi, xcodebuild on gpu, on the PATH of a command over ssh (docs/deploy.md), or drop what it does not need from its tools label. The tools labels of local are checked the same, by the same loop run here on the PATH of arthur run, its line first and only when local.labels.tools is set: machines local: missing: command -v finds no docker here (linux x64, arthur <version>); without it: no job that needs docker runs on local; fix: install docker on the PATH of arthur run, or drop what it does not need from local's tools label. Placement still goes by the labels as written.
The same check asks git there for its identity, as arthur merge does here (delivery <project> identity, arthur merge --help), since a worker on the machine commits with that machine’s git config: git var GIT_AUTHOR_IDENT, then git var GIT_COMMITTER_IDENT, in the login folder of a command over ssh, so it reads the user’s and the system’s git config there and the GIT_* variables a command over ssh gets, not an identity set in one repository there alone. A machine online whose git has none stays online (placement goes by the labels), and its line names the first that failed with git’s last line, after any tools not found: machines gpu: missing: git var GIT_AUTHOR_IDENT there: fatal: no email was given and auto-detection is disabled (linux x64, arthur <version>); without it: a job placed on gpu fails at its first commit: git has no author there; fix: git config --global user.name "<your name>" and git config --global user.email "<your email>" on gpu (ssh gpu-box). With tools not found too, each part of the line holds both, tools first, joined by ; .