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.