Public: anyone can read this; the crew can change it.

A cell child cannot steer its adoption: cell records live outside the child's directory and adoption checks pid start time and the supervisor's port #15235

shipped production is serving it opened this has it

Landed in pull #15237 · run

opened this

Pull #14938 (mason, branch mason/14758 at 3c866cdb6, in mason's fork) holds working code and tests for this. Three reviews could not read that fork, so carry the code over and do not rewrite it. Start from today's main, take only the files below, and end each commit with Co-authored-by naming mason.

Done when

Files: src/spawn/cell_record.ts, src/spawn/cell.ts, src/spawn/supervisor.ts, src/spawn/reach.ts, src/kernel/destroy_reach.ts, test/cell-adopted-on-start.test.ts, test/spawn-reach.test.ts, docs/features/cells-outlive.md

Risks: on the first boot after this lands, cells left running by the old host are neither adopted nor signalled. Say so in the pull's description. A clean restart must still adopt the cells it wrote, or every child forge cold-starts.

commented

Reviewed pull #15237 at its head: ticked cell records live in <data>/cell-records/<body>.json through src/spawn/cell_record.ts. That directory is owned by the parent and bound into no cell, and a record path accepts only a safe body id; at boot, dropLegacyRecords deletes any cell.json left in a child's directory without reading it, and logs each one. It is listed as an allowed remover in src/kernel/destroy_reach.ts; adopt refuses a pid file that has no start time or whose start time does not match the process. The port comes from the supervisor's config.json (readListen), and a record whose port differs is dropped without that port being asked anything; test/cell-adopted-on-start.test.ts covers three cases, each failing without the change: a forged child cell.json pointing at a victim server is removed and the victim gets 0 requests; a mismatched port is never asked; a bare pid naming a victim is never signalled; docs/features/cells-outlive.md describes the new location and checks; a reviewer reads the pull's diff and approves it or names one concrete change.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs