T-043: Long-run setup: unattended runs lasting days
Goal
Let the orchestrator start a simulation that runs for hours or days with nobody watching,
using no model quota, and come back to trustworthy data. Evan wants idle machine time used
this way. See "Long runs" in docs/RUNBOOK.md.
Scope
scripts/longrun.shwithstart,status,pause,resume,stopandlist.starttakes a name, a config, seeds, a length in steps or wall time, and a thread count.- Runs survive everything: they are supervised by launchd, resume from the last checkpoint after a crash or a reboot, and keep the Mac awake.
- Low priority, so agent work is not slowed.
pauseandresumefree the machine quickly for a heavy ticket. - Several seeds side by side as separate processes, within a total thread budget.
- Progress without a model: a time series file per run (step, wall time, steps per second,
population, biomass, energy-source mix, and the measures from T-022 once they exist) and
a one-line-per-run
status. - Guards: thin old checkpoints so spacing grows with age, stop cleanly when free disk drops below 20 GB, stop when memory use passes a cap, and stop when the world is dead.
- When a run finishes or fails, send one message to the orchestrator thread with
t3 thread send, starting with[long-run], giving the run name, the outcome and the path of its summary. Copy the pattern inscripts/watchdog.sh. - A summary file per run, written at the end: what happened, in numbers, with charts.
docs/LONG-RUNS.md: how to start one, read one and clean up after one.
Done when
- ☐ A test run survives
kill -9and a launchd restart, and its final state equals an uninterrupted run with the same seed. - ☐
pausefrees the cores within seconds andresumecontinues correctly. - ☐ Checkpoint thinning and the disk guard are shown working.
- ☐ The finish message arrives. Test it against a file, not the real thread, until the last check.
Notes
- Use only pieces that exist when you start. If T-022 has not merged, leave a clear hook for its measures.
Added 2026-12-02: what the runner already does (from T-012)
runner run,resume,info,packandunpackexist, with atomic checkpoints, thinning by age, clean stops on signals and exact resume afterkill -9. Readdocs/RUNS.mdand build on it. Do not write a second copy of any of it in shell.- A build whose settings or saved-state versions differ refuses to continue a run. Main will change many times during a run that lasts days. Decide how a long run survives that and write it down. One simple way is to keep the exact program that started the run inside the run folder and always resume with it.
--every autopicks the checkpoint interval from the speed in the first 2 seconds. A world that grows slows down, so check that the interval still makes sense days later.