Cells outlive the host (FORGE_CELLS_OUTLIVE)
On when the host boots (#13750), so a production release leaves a hosted forge's checks and runs running; set FORGE_CELLS_OUTLIVE=off to tie cells to the host again. With it on, a child's cell runs its proxy and relays in a supervisor of its own and is not tied to this process: stopping the host leaves the cell running (#13755).
On start the host takes its cells back (#13756). For each supervised cell the host writes a record, <data>/cell-records/<body>.json (pid, port, supervisor control directory, start time, name, size; spawn/cell_record.ts), as soon as it is spawned, and clears it when it exits. That directory is the parent's and is bound into no cell, and a record path takes only a safe body id, so a child cannot write or name a record (#15235). A cell.json an older host left in a child's own directory is removed at boot without being read (dropLegacyRecords), and the log says so for each. At boot the host reads every record and, for each:
- the pid must still be the cell its supervisor names:
cell.pidin the control directory must carry the pid and its start time, and that start time must be the running process's (readStartedPid). A bare pid, or a reused one, is never adopted or signalled; - the port must be the one the supervisor relays the cell's way in on (
config.jsonlisten,readListen). A record naming any other port is dropped without that port being asked anything; - the port must answer. A cell that is its supervisor's but silent is stopped and its record cleared, since nothing else would reap it;
- otherwise the cell is held in the registry as if this host had started it. A start for the same body waits for adoption to finish and finds the adopted cell, never a second one. The record is cleared when the cell goes.
Not yet: the beat door still runs in the host (#13921).
What the host did is shown. For this host's life it keeps each cell it adopted or dropped at boot (spawn/adopted.ts: name, pid, when, why). /system lists them under "Child forges across the restart" ("kept running across the restart", "stopped: did not answer"), and nothing when there were none; the MCP system tool (kind: adopted) and the terminal's System screen read the same rows.
Upgrading from a host that kept records in the child's directory. The first boot after #15235 finds no record in cell-records/, so cells the older host left running are neither adopted nor signalled: each is started afresh when next asked, and the old cell ends with its supervisor. Every restart after that adopts the cells it recorded.