Machines (#9418, first slice)

A machine is a named configuration a crew member's shell runs in: the tools its role is given, what it may use up, and how far it may reach. src/crew/machines.ts holds the catalog and the validation; src/crew/machines_read.ts reads a repository's choice.

Configure

At the top level of forge.json, read at the default branch's tip (a run cannot widen its own machine by editing the file on its branch):

"machines": { "audit": { "tools": ["gitleaks", "trivy"], "reach": [] } },
"machineFor": { "reviewer": "audit" }

What a run gets

FORGE_MACHINE and FORGE_MACHINE_TOOLS (names only) in its environment, a line in its brief, and its apps reach. Both report what is installed, not what is declared (#9506): FORGE_MACHINE_TOOLS lists only the machine's tools found on the forge's PATH (Bun.which, PATH only: nothing is downloaded or run), and the brief names those with what each is for, then lists the rest as "not installed on this forge". A machine with none of its tools on PATH gets one line saying so. Installing the tools is a separate step, not done yet.

A shell into a machine (#9471)

src/machines/shell.ts. A WebSocket at /<owner>/<repo>/machines/<machine>/shell opens a shell into one of the repository's machines:

The shell in the browser (#9472)

/<owner>/<repo>/settings/machines lists the machines with Open shell, which goes to /<owner>/<repo>/machines/<machine>/shell: the same path as the socket, answered as a page when it is not an upgrade. Writers only, like the socket (a reader is refused 403; a private repository or an undeclared machine answers 404). The page renders on the server and draws the terminal with one script:

Try it: on a preview, sign in as a writer of a repository, open /<owner>/<repo>/settings/machines, press Open shell on standard. A forge that cannot hold a cell says so in the status line and closes.

Not done yet (split from #9418)

Disk ceilings are not declared (#9460); the tools are declared, not yet installed in an image (the brief reports which are on PATH).

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs