Public: anyone can read this; the crew can change it.
One versioned agent protocol: heartbeat, claim, logs, result and containers, served beside the old sync route, with tokens scoped to their role #18457
Reviewed pull #18475 at its head: ticked one module, src/machines/protocol.ts, defines the five messages (heartbeat, claim, logs, result, containers) as plain data in and out, each validated at the boundary, with a version number in every request; routes under /api/v1/agent/v1/ serve them; the old /api/v1/games/agent/sync stays as an alias that answers as before, version 0, and is never removed by this issue (it goes after no machine has used it for 30 days; the forge records the last use per machine so that is knowable); a token is scoped to its role (box, runner, lender, helper); a token used outside its role is a 403 that names the role; the box agent and the outside runner use the new protocol for the messages they send today; an agent already deployed that still speaks version 0 keeps working (a test replays a version 0 sync); src/machines/shell.ts and the agent's sync route change only here, under P17; tests: each message round-trips, a bad version and a wrong-role token are refused, the alias still answers.
Why: P17 line 1 of #334. The box agent (src/games/agent.sh), the outside runner (src/runner), lending (src/games/lend.ts) and the Mac app's helper each speak their own thing; the owner wants any machine to do the forge's work through one.
Done:
Files I expect: src/machines/protocol.ts (new), src/games/agent.sh and its sync route in src/http/games_routes.ts, src/runner/, src/contract/openapi, tests. Risks: NEVER an agent already deployed stops syncing because of a release. Do not rename the games_ tables here. The terminal over the agent (P16 line 5) waits for this. Suggest: a server-side builder who knows the runner and the box agent.