Docs/Fleet.md

The fleet: agents on several machines, and the staging server

The owner talks to one agent, the orchestrator (Claude Code on the dev PC). It gives each change to a worker (Claude Code on another machine, one task at a time), and as soon as the workers are done it rebuilds the staging server: main + every branch being tested, deployed on its own node. The owner tests in VR a few minutes later, then says which features are good; only those go to main (by the merge queue, as before).

owner ◄──► orchestrator (dev PC): analyses, dispatches, reviews ─┬─► chopper (Windows): feat/a ─┐
                │                                               ├─► jetson (Orin NX): feat/b ───┤  pushed
                │                                               └─► node4 (RK1): feat/c ────────┤
                │                                                                               ▼
                └── Tools/Fleet/Build-Staging.ps1: main + feat/a + feat/b + feat/c ──► staging (rk1node3)
                                                                                         https://staging.sushivr.ovh
owner's PC: "Nexus of Fates Staging" (its own install) ── plays on staging ── OK ──► queue/<branch> ──► main

The machines

Machine Role
Dev PC (BeeLink, 10.0.0.22) Orchestrator; builds the images and the Windows client; runs Build-Staging.ps1
chopper (10.0.0.21, Windows) Worker for everything: client, UI and screenshots, Blender, servers (Godot, Blender, Docker Desktop, a GPU)
jetson (10.0.0.3, Jetson Orin NX 16 GB) Worker for the client, UI and screenshots and servers, no Blender (Godot .NET on the NVIDIA GPU: its runs get DISPLAY=:0, the desktop session with no screen plugged)
node4 (10.0.0.20, RK1 32 GB) Worker for servers and game logic only (no GPU, no Godot, no Blender)
rk1node3 (10.0.0.9, RK1 16 GB) Staging server (its own database): staging.sushivr.ovh, monitor-staging.sushivr.ovh, UDP game-staging.sushivr.ovh
tp2node3 (10.0.0.19) The dev server (sushivr.ovh): releases only, unchanged (Docs/Deploy.md)

Workers are listed in Tools/Fleet/workers.json (with what each can do). One agent per machine: two agents on one PC would share the local backend's ports (Start-Dev.ps1, Stop-Dev.ps1 kills by process name), Blender and the CPU.

Who does what (the owner's rules, 2026-11-29):

  • the orchestrator does not write the code: it stays free for the owner (who reports, asks, brainstorms meanwhile). For each request it analyses (reads the code, finds a bug's cause) and writes the worker a precise task (the files, what must be true at the end, the screenshots wanted), dispatches it to a free worker that can do it (a queue when all are busy), then reviews the branch, rebuilds staging and makes the pull request. Only an edit of a line or two, faster done than explained, it makes itself. (Measured on the day it changed: three tasks coded by the orchestrator in a row took the 20 minutes the owner could not talk to it.)
  • the workers implement, test, take the screenshots and update the docs; a UI task goes to chopper or the jetson, a model to regenerate in Blender to chopper, a server or game-logic one to any of them (node4 first, it can do only that);
  • the models (2026-11-29): the orchestrator on Opus (it analyses and writes precise tasks), the workers on Sonnet by default (Start-Task.ps1 passes --model sonnet; a resume keeps the task's model); -Model opus for a big or tricky task (a new engine, a shader, a bug not understood);
  • never one change split between agents (measured: about three times the time and the tokens of one);
  • a worker starts from origin/main (or from the one unmerged branch it depends on), never from staging: it holds features not validated yet and is rebuilt every time. Conflicts are best avoided by merging what the owner validated;
  • one more agent later: the owner's second gaming PC (Windows, GPU: set up like chopper), when he does not play on it.

Giving a task to a worker

./Tools/Fleet/Start-Task.ps1 -Worker chopper -Branch feat/golem-roar -Task "The golem roars before its slam."
./Tools/Fleet/Start-Task.ps1 -Branch feat/golem-roar -Resume -Task "Retour VR : trop fort, baisse de moitié."
./Tools/Fleet/Get-FleetTasks.ps1            # who works on what, their phase; collects the finished ones
./Tools/Fleet/Get-FleetTasks.ps1 -Branch feat/golem-roar -Result   # Claude's answer
  • The worker's clone is reset to origin/<branch> (or a new branch from origin/main); -Resume goes on with the same Claude session in the same clone (the owner's feedback).
  • Claude runs headless (claude -p, permissions bypassed: a worker is used by nobody else) with Tools/Fleet/WorkerRules.md added to its system prompt: stay on the branch, follow AGENTS.md, build and test, push origin/<branch> (never main, staging, queue/), answer in French (what changed, how to test it in VR).
  • It writes its phase to ~/nof-fleet/<branch>/phase on the worker: coding, testing, done.
  • The run is detached on the worker (Linux: setsid nohup; Windows: a process made through CIM, outside the SSH session, with the user's folders and PATH set by the run script). It writes its outcome there: result.json (Claude's answer), then finished (exit code). So nothing depends on the dev PC: if it, or the orchestrator's session, stops, the agents go on.
  • Start-Task.ps1 then waits, reading those files every 20 s (-NoWait: returns at once); the orchestrator runs it in the background and stays free for the owner. After a restart, Get-FleetTasks.ps1 collects what finished meanwhile; a task whose process is gone without an outcome (the worker restarted) shows lost: -Resume goes on with it. State: %LOCALAPPDATA%\nof-fleet\tasks\<branch>\state.json; shared code: Tools/Fleet/Fleet.Common.ps1.

Usage limits

When the Claude account's limit is reached (the 5-hour window or the weekly one), a worker's claude -p stops with an error that says it. Get-FleetTasks.ps1 (Update-TaskFromWorker) recognises it and marks the task limited, not failed: limitMessage (the raw message), limitKind (five-hour | weekly) and resumeAt (parsed from the message: time, weekday or date, its timezone in parentheses, else the dev PC's; plus 5 min of margin) go in its state.json, and the message is appended once to %LOCALAPPDATA%\nof-fleet\limits.log (the real format was never seen: read it there and fix Get-LimitInfo in Fleet.Common.ps1 if the parser misses).

  • See: Get-FleetTasks.ps1 shows limited and a note column: "limited until lundi 9:00 (weekly limit)".
  • Resume by itself, without the orchestrator's session: a Windows scheduled task NOF-Fleet-Resume on the dev PC (made and updated when a task becomes limited, removed when none is) runs Tools/Fleet/Resume-Limited.ps1, once at the earliest resumeAt (a weekly limit is scheduled at its time, never polled for days). That script resumes each due task with Start-Task.ps1 -Resume and a short note ("La limite d'utilisation est passée : reprends où tu en étais."), or starts it again from its task when Claude had not answered yet (no session).
  • No time in the message: the scheduled task runs every 30 min; before resuming, the script makes a tiny call (claude -p ok --model haiku) and waits if that one is limited too.
  • Force a resume now (the limit lifted by hand): ./Tools/Fleet/Resume-Limited.ps1 -Force; -WhatIf only says what it would do. Cancel: delete the task's folder in %LOCALAPPDATA%\nof-fleet\tasks\ (or Unregister-ScheduledTask NOF-Fleet-Resume to stop the automatic resume).
  • Tests, no real limit: pwsh -NoProfile -File ./Tools/Fleet/Test-Limits.ps1 (the parser on 5-hour, weekly and unknown messages; the scheduled task made, updated, removed, under a test name).

Rebuilding staging

./Tools/Fleet/Build-Staging.ps1 -Branches feat/golem-roar, feat/menu-y
  1. A kept worktree (%LOCALAPPDATA%\nof-fleet\staging) is reset to origin/main, then each branch is merged. A branch that conflicts is left out (its files are reported, the orchestrator sends it back to its worker); the others go on. git rerere replays a conflict solved once by hand.
  2. dotnet build of the solution: a red build publishes nothing.
  3. Pushed to the staging branch (forced: rebuilt every time, nobody works on it).
  4. Tools/Ci/Publish-Release.ps1 -Staging: images :staging-<commit> (and :staging), client package staging-<commit> for https://staging.sushivr.ovh with the profile staging.
  5. Over SSH on rk1node3: a checkout of the commit, then deploy/deploy.sh staging-<commit> with the staging names (PUBLIC_HOST=game-staging.sushivr.ovh, MONITOR_URL=https://monitor-staging.sushivr.ovh, no warning).

The outcome is in %LOCALAPPDATA%\nof-fleet\staging-last.json (commit, branches merged and left out, seconds per step). One build at a time (a lock file); Remove-OldPackages.ps1 keeps the last 5 staging publications.

When (the orchestrator's rule): as soon as a worker is done, unless another worker is testing (it will be done in a few minutes: wait for it, 3 minutes at most, so both arrive in one build). A worker that finishes during a build goes into the next one, with all the others that finished meanwhile. The owner's "go" builds at once.

The orchestrator's code review

When a worker is done, the orchestrator reviews its branch (git diff origin/main...origin/<branch>) while staging builds, so the owner does not wait for it:

  • bugs a reader can see (states not reset, a mode forgotten, a hidden widget still clickable, a hot loop allocating...);
  • the docs and the code in step (Docs/, AGENTS.md, the code's comments, every Lang/*.json), as AGENTS.md asks;
  • the project's rules (AGENTS.md section 2), and the worker's own "choices made alone". Its findings go to the owner with the build, and back to the worker (Start-Task.ps1 -Resume, the same session). A fix of the docs only needs no staging rebuild; a fix of the code does. A problem already on main is noted for later, not given to the branch.

Where the owner reads it: the branch's draft pull request on Gitea (on the phone too):

./Tools/Fleet/Publish-Review.ps1 -Branch feat/credits -ReviewFile review.md -Images vr.png, vr-credits.png

The pull request (made as a draft, "WIP: " title, the first time) has the worker's answers as its description, every round in order (the task, then each -Resume: the review's or the owner's feedback); the review and the pictures (the render node's screenshots, the agent's) go into a comment, the pictures uploaded as attachments. Merging still goes through the merge queue after the owner's OK, which closes the pull request as merged.

The staging install on the owner's PC

The staging client is the usual game with two differences, from its build.json:

  • "api": "https://staging.sushivr.ovh": it plays on staging and updates itself from staging (/api/client/latest of the staging ApiServer): a new staging build is offered on its login screen, like the dev channel's updates;
  • "profile": "staging": its settings, account and device session are in user://settings-staging.cfg, never mixed with the usual install's (ClientBuild.SettingsFile).

Its installer (Publish-Client.ps1 -Profile staging, NexusOfFates.iss /DEdition=Staging) is another program, Nexus of Fates Staging: its own folder, shortcuts, uninstall entry and firewall rule, next to the usual install. First install: the download on https://staging.sushivr.ovh.

After the owner's test

  • OK for a feature: its branch goes to main through the merge queue (git push origin HEAD:queue/<branch>, AGENTS.md), then it leaves the staging list (it is in main now).
  • Feedback: Start-Task.ps1 -Resume on the same branch; staging is rebuilt when the worker is done.
  • Releases and the dev server do not change: Actions > Release, Actions > Deploy (Docs/Deploy.md).