Skip to content

feat(bin): defer worker spawns when the machine is short of memory headroom - #7235

Open
andrewkimcanidium wants to merge 9 commits into
kunchenguid:mainfrom
andrewkimcanidium:fm/fm-spawn-resource-gate
Open

andrewkimcanidium wants to merge 9 commits into
kunchenguid:mainfrom
andrewkimcanidium:fm/fm-spawn-resource-gate

Conversation

@andrewkimcanidium

@andrewkimcanidium andrewkimcanidium commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Intent

"Okay, can we suggest a raised cap without potentially hitting the memory limits to kill our setup? Maybe something can keep an eye on that and see what a healthy worker load would be. As we spawn off sub-agents, we make sure that we're not hitting that critical fail."

Context: the SAP CPQ fan-out hit the treehouse workspace pool cap of 16 (the default max_trees) on the sap-cpq-axi clone, and raising the cap was proposed. The Mac running the fleet has 18 cores and 48 GB RAM; at the time of the ask about 84 agent processes used about 7 GB resident, system memory free was 41%, load average about 11. Nothing today checks machine headroom before a spawn, so a higher cap could push the machine into memory exhaustion and take down every firstmate home and worker at once.

"I wouldn't say other projects keep their caps. I feel like we should have kind of these diagnostics per all projects so we can find out what caps need to be. And since we could be running a mixture of agents we really like from different projects, I think a cap per project is kind of weird. I think it's kind of like, what is the task, right? How much memory do you think it's going to use? How many agents can we spawn for this type of project? Additional to the 48. Do you understand it's like a group problem not a specific project problem?"

What Changed

  • Adds bin/fm-host-headroom.sh, which treats the machine's memory as one budget shared by every project. Its check command reads available memory, swap in use, load per core and (on macOS) the kernel memory-pressure level. It reserves the memory each running worker still needs to reach its expected size, then decides whether one more worker of the given kind and harness fits. The expected footprint is learned from mid-work samples of earlier workers in the root home's state/host-footprint.log, falling back to a 1536 MB default until there are enough samples. report summarizes typical and p90 memory by kind/harness and by project, how many more workers fit, and which project worktree pools would hit their limit first. Optional thresholds go in config/host-headroom. A malformed file makes the spawn refuse, and any value the machine can't measure is reported but never judged.
  • bin/fm-spawn.sh runs this check before every fresh ship or scout launch. It holds a machine-wide .host-headroom.lock in the root home from the check until the task record is published, so concurrent spawns from any home are judged one at a time. A worker that doesn't fit gets the same deferred: line and exit 75 as a project-capacity deferral, and the batch message now names both causes. FM_SPAWN_IGNORE_HEADROOM=1 skips the check for one spawn. Relaunches and --secondmate spawns are not gated.
  • Footprint samples are now recorded when a worker launches and in bin/fm-teardown.sh before the worker's processes are reaped (best effort, never blocks either step). New docs cover all of this: a "Host headroom" section in docs/configuration.md, plus updates to docs/scripts.md and the operational-home-layout skill. Tests: tests/lib.sh pins a healthy headroom sample so unrelated spawn tests never defer, the new tests/fm-host-headroom.test.sh is added and wired into bin/fm-test-run.sh, and tests/fm-project-capacity.test.sh gets a one-line change.

🤖 Generated with Claude Code

Risk Assessment

⚠️ Medium: The uncertified fix commits (removing --model/--project from check, its header, usage, the fm-spawn call, and tests) are complete and correct, but the branch as a whole adds a machine-wide spawn lock and a memory admission gate on every fresh ship/scout spawn, which is a behavioral change to a core path even though prior rounds settled its design.

Testing

I ran the three targeted test files (all pass), then tested the gate live in a disposable lab home, with no test seam, against this Mac's real memory, load and swap readings and real Claude scout workers. The live check matched sysctl. The real fm-spawn fan-out admitted two workers, sampled their real memory use (~440 MB each) and deferred the third with exit 75. Its message shows ~21.6 GB reserved for the two running workers and the floor that was breached, and the deferred spawn published no task record. report gave the budget for the whole machine and the pool-cap comparison. Teardown logged footprint records, and the override launched fan-3 with its notice. All six live scenarios passed. The unreadable thresholds/home scenario was covered only by repository tests, so it is marked untested for live validation. The lab, its tmux server and its workers were all removed.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Operator runs fm-host-headroom.sh check on the real Mac and gets an ok verdict naming the real available memory, swap, load and pressure ✅ pass live r3-live-check-real-mac.txt: 'ok: available 77% (37847 of 49152 MB) ...', matching sysctl kern.memorystatus_level=77
Rapid real fan-out: fm-spawn admits workers while the budget lasts, then defers the next one (exit 75, no task record) because the running workers' reservation would push memory below the floor ✅ pass live live-fanout-transcript.txt: fan-1/fan-2 spawned (exit 0), fan-3 'deferred ... 21583 MB reserved for running workers ... below min_avail_pct=20 (9830 MB)', SPAWN3_EXIT=75; no fan-3.meta in state
Startup samples of the fan-out's own workers do not lower the expected footprint below default_worker_mb ✅ pass live live-host-footprint.log shows event=sample readings of ~388-441 MB for fan-1 and fan-2, yet the fan-3 deferral still used 'expected worker 11206 MB (default_worker_mb ...)'; also covered by test_start…
Operator runs report and sees the shared budget for the whole machine, the running workers' memory, the safe worker count, and whether the project's pool cap of 16 or the memory budget binds first ✅ pass live live-report.txt: 'Machine budget: 6489 MB ... shared by every project', 'Workers running now ... 2 using 884 MB', 'demo: pool cap 16; the machine budget (2 workers) binds first'
Teardown of a real worker records its resident memory in the footprint log for the machine ✅ pass live live-host-footprint.log / transcript: 'event=teardown task=fan-1 ... worker_rss_mb=439', 'event=teardown task=fan-2 ... worker_rss_mb=442', TD1_EXIT=0
FM_SPAWN_IGNORE_HEADROOM=1 lets the operator force one deferred spawn, with a visible notice ✅ pass live live-teardown-override-transcript.txt: 'notice: FM_SPAWN_IGNORE_HEADROOM=1 - launching fan-3 without checking this machine's headroom', SPAWN3B_EXIT=0
Unreadable threshold file or unreadable secondmate home: the spawn refuses (thresholds), or the workers of the other homes are still counted (home) ⏸️ untested no The prior payload did not establish a live result. This scenario was covered only by the repository's behavior tests (test_unreadable_thresholds_refuse, test_spawn_refuses_on_unreadable_thresholds, te…
Evidence: Live check against real Mac measurements

Source: Live check against real Mac measurements

# Round 3: lab home, no test seam, real sysctl on this Mac (48 GB). sysctl kern.memorystatus_level=77
$ fm-host-headroom.sh check --kind ship --harness claude
ok: available 77% (37847 of 49152 MB), swap used 5047 MB, load 2.56 on 18 cores (0.14 per core), pressure normal; expected worker 1536 MB (default_worker_mb, fewer than 3 measured workers of kind ship); 0 running worker(s) reserve 0 MB
exit 0
Evidence: Live fan-out: 2 real scouts admitted, 3rd deferred (exit 75) by reservation

Source: Live fan-out: 2 real scouts admitted, 3rd deferred (exit 75) by reservation

deferred: this machine is short of headroom for another worker (available memory 37847 MB less 21583 MB reserved for running workers and this worker's expected 11206 MB leaves 5058 MB, below min_avail_pct=20 (9830 MB) ...; 2 running worker(s) reserve 21583 MB); task fan-3 was not launched and its backlog item stays queued ... SPAWN3_EXIT=75

bash-5.3$ clear; bin/fm-spawn.sh fan-1 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN1_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
spawned fan-1 harness=claude kind=scout window=primary:fm-fan-1 worktree=/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/treehouse/.treehouse/demo-4f4b60/1/demo
SPAWN1_EXIT=0
bash-5.3$ bin/fm-spawn.sh fan-2 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN2_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
spawned fan-2 harness=claude kind=scout window=primary:fm-fan-2 worktree=/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/treehouse/.treehouse/demo-4f4b60/2/demo
SPAWN2_EXIT=0
bash-5.3$ bin/fm-spawn.sh fan-3 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN3_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
deferred: this machine is short of headroom for another worker (available memory 37847 MB less 21583 MB reserved for running workers and this worker's expected 11206 MB leaves 5058 MB, below min_avail_pct=20 (9830 MB) - available 77% (37847 of 49152 MB), swap used 5047 MB, load 2.56 on 18 cores (0.14 per core), pressure normal; expected worker 11206 MB (default_worker_mb, fewer than 3 measured workers of kind scout); 2 running worker(s) reserve 21583 MB); task fan-3 was not launched and its backlog item stays queued - dispatch it again once running work frees memory or load, or set FM_SPAWN_IGNORE_HEADROOM=1 for this one spawn (docs/configuration.md "Host headroom")
SPAWN3_EXIT=75
bash-5.3$ 
Evidence: Live report with running workers and pool-cap comparison

Source: Live report with running workers and pool-cap comparison

Host headroom now: available 77% (37847 of 49152 MB), swap used 5047 MB, load 2.93 on 18 cores (0.16 per core), pressure normal
Verdict for one more worker: defer - available memory 37847 MB less 21528 MB reserved for running workers and this worker's expected 11206 MB leaves 5113 MB, below min_avail_pct=20 (9830 MB)
Thresholds (/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/config/host-headroom): min_avail_pct=20 max_swap_used_mb=? max_load_per_core=? defer_pressure=critical default_worker_mb=11206
Machine budget: 6489 MB available above the 20% floor (9830 MB) after 21528 MB reserved for 2 running worker(s) to reach their expected footprint, shared by every project
Workers running now with measured memory: 2 using 884 MB
Per-worker memory: no worker samples yet in /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/state/host-footprint.log; new workers are expected at default_worker_mb=11206 MB
Largest safe concurrent worker count implied: 2 (2 running + 0 more at 11206 MB each, default_worker_mb, fewer than 3 measured workers)
Project worktree pools (/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/projects):
  demo: pool cap 16; the machine budget (2 workers) binds first
Evidence: Teardown records and FM_SPAWN_IGNORE_HEADROOM override transcript

Source: Teardown records and FM_SPAWN_IGNORE_HEADROOM override transcript

bash-5.3$ clear; bin/fm-spawn.sh fan-1 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN1_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
spawned fan-1 harness=claude kind=scout window=primary:fm-fan-1 worktree=/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/treehouse/.treehouse/demo-4f4b60/1/demo
SPAWN1_EXIT=0
bash-5.3$ bin/fm-spawn.sh fan-2 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN2_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
●  WATCHER DOWN - SUPERVISION IS OFF
●  1 task(s) in flight, but no watcher has a fresh beacon (last beat: never, grace 300s).
●  Trust the emitted supervision protocol for this harness; do not use shell & for watcher repair.
●  This is a supervision warning only; the guarded operation WILL still run.
●  watcher supervision needs Stop-owned automatic recovery; inspect the hook registration and startup status before ending the turn.
●━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
spawned fan-2 harness=claude kind=scout window=primary:fm-fan-2 worktree=/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/treehouse/.treehouse/demo-4f4b60/2/demo
SPAWN2_EXIT=0
bash-5.3$ bin/fm-spawn.sh fan-3 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN3_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
deferred: this machine is short of headroom for another worker (available memory 37847 MB less 21583 MB reserved for running workers and this worker's expected 11206 MB leaves 5058 MB, below min_avail_pct=20 (9830 MB) - available 77% (37847 of 49152 MB), swap used 5047 MB, load 2.56 on 18 cores (0.14 per core), pressure normal; expected worker 11206 MB (default_worker_mb, fewer than 3 measured workers of kind scout); 2 running worker(s) reserve 21583 MB); task fan-3 was not launched and its backlog item stays queued - dispatch it again once running work frees memory or load, or set FM_SPAWN_IGNORE_HEADROOM=1 for this one spawn (docs/configuration.md "Host headroom")
SPAWN3_EXIT=75
bash-5.3$ clear; bin/fm-teardown.sh fan-1; echo TD1_EXIT=$?; FM_SPAWN_IGNORE_HEADROOM=1 bin/fm-spawn.sh fan-3 $FM_HOME/projects/demo --scout --harness claude; echo SPAWN3B_EXIT=$?
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
teardown: reaping leaked worktree process(es) for fan-1: 6539 10926
teardown: force-killing leaked worktree process(es) for fan-1: 6539
🌳 Worktree returned to pool.
teardown fan-1 complete (window primary:fm-fan-1, worktree /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/treehouse/.treehouse/demo-4f4b60/1/demo)
Backlog: fan-1 just finished (this home keeps no markdown backlog at /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/data/backlog.md). Update /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/data/backlog.md - move fan-1 to Done, keep Done to the 10 most recent, then re-scan Queued and dispatch only work whose blockers are gone and date is due.
TD1_EXIT=0
fm-gate-refuse: gate agent lifecycle permitted only against lab home /private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP
WARNING: watcher still down (same stale episode; last beat: never, grace 300s) - full banner already printed this episode.
notice: FM_SPAWN_IGNORE_HEADROOM=1 - launching fan-3 without checking this machine's headroom
spawned fan-3 harness=claude kind=scout window=primary:fm-fan-3 worktree=/private/var/folders/6f/1jf88sjj1yb6bwg4qkrtlxd00000gn/T/fm-lab.BQ5kuP/treehouse/.treehouse/demo-4f4b60/1/demo
SPAWN3B_EXIT=0
bash-5.3$ 
Evidence: Footprint log from the live run (spawn/sample/teardown events)

Source: Footprint log from the live run (spawn/sample/teardown events)

1792666301 event=spawn task=fan-1 project=demo kind=scout harness=claude model=default worker_rss_mb=- avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=3.02 cores=18 pressure=normal
1792666324 event=sample task=fan-1 project=demo kind=scout harness=claude model=default worker_rss_mb=439 avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.66 cores=18 pressure=normal
1792666329 event=spawn task=fan-2 project=demo kind=scout harness=claude model=default worker_rss_mb=- avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.60 cores=18 pressure=normal
1792666332 event=sample task=fan-1 project=demo kind=scout harness=claude model=default worker_rss_mb=441 avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.56 cores=18 pressure=normal
1792666332 event=sample task=fan-2 project=demo kind=scout harness=claude model=default worker_rss_mb=388 avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.56 cores=18 pressure=normal
1792666352 event=sample task=fan-1 project=demo kind=scout harness=claude model=default worker_rss_mb=441 avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.93 cores=18 pressure=normal
1792666352 event=sample task=fan-2 project=demo kind=scout harness=claude model=default worker_rss_mb=443 avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.93 cores=18 pressure=normal
1792666361 event=teardown task=fan-1 project=demo kind=scout harness=claude model=default worker_rss_mb=439 avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.86 cores=18 pressure=normal
1792666371 event=spawn task=fan-3 project=demo kind=scout harness=claude model=default worker_rss_mb=- avail_pct=77 avail_mb=37847 total_mb=49152 swap_used_mb=5047 load1=2.96 cores=18 pressure=normal
Evidence: Targeted test log: fm-host-headroom

Source: Targeted test log: fm-host-headroom

ok - a machine within every default threshold is ok and names its numbers and the expected footprint
ok - each default threshold admits its exact edge and defers just past it, naming every breach
ok - config/host-headroom overrides each default and off disables a threshold
ok - a new worker's expected footprint comes from its kind and harness, then its kind, then every worker
ok - workers from any project share one machine budget and are admitted by their expected size
ok - startup and teardown readings alone never lower the expected footprint below default_worker_mb
ok - a home that cannot be read never hides the workers of the homes that can
ok - a local secondmate home shares the root home's thresholds and footprint log
ok - a malformed, duplicated, or unreadable threshold file refuses rather than guessing
ok - darwin headroom is read from sysctl, with vm_stat as the available-memory fallback
ok - linux headroom is read from /proc/meminfo and /proc/loadavg
ok - a missing tool or unfamiliar platform is reported unmeasured and never blocks a spawn
ok - record tags the worker's project, kind, harness, and model and sums the memory of its worktree's processes
ok - report gives per-worker memory by kind, harness, and project, the machine budget, and which project pools bind first
ok - a fresh spawn on a machine short of headroom is deferred with exit 75 before anything is created
ok - a fresh spawn with headroom launches and records the machine's headroom
ok - FM_SPAWN_IGNORE_HEADROOM=1 launches one spawn without the check
ok - a rapid sequential fan-out is stopped at the machine budget by the running workers' reservation
ok - a spawn refuses rather than guessing when the threshold file is unreadable
- Outcome: 🔧 1 issue found ✅ across 4 runs (26m48s)

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 0 issues

✅ No issues found.

  • ⚠️ bin/fm-host-headroom.sh:474 - check accepts --model and --project and throws them away (bin/fm-host-headroom.sh:34-35 says they are accepted "for the caller's symmetry and do not change the verdict"). bin/fm-spawn.sh:3574-3575 still computes and passes both. Nothing in the intent or the recorded decisions needs an input that has no effect on the verdict: the expected footprint is keyed only by kind and harness, and the per-project diagnostics come from the meta-derived project= field in the log. A reader of the spawn call would reasonably think model and project affect admission, and they do not. Suggested remedy: remove the two flags from check, its usage text, and the fm-spawn.sh call. The other option is to actually key the footprint on them, but that would add scope.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ No issues found.

✅ No issues found.

🔧 **Test** - 1 issue found ✅
  • ℹ️ bin/fm-host-headroom.sh:724 - The report line says "Per-worker memory: no worker samples yet in <log>" when the log holds many event=sample readings, none of which count as mid-work yet (all under 600 s old). In the live run, 4 real workers had about 20 samples at ~360 MB each. The wording could mislead an operator into thinking sampling is broken; something like "no mid-work samples yet" would be accurate.
  • Live validation: ✅ go - 10 of 11 scenarios driven live against the product
Scenario Result Live Evidence
Operator runs fm-host-headroom.sh check on the real Mac and gets an ok verdict naming available memory, swap, load per core, pressure level, expected footprint and reservation ✅ pass live live-check-real-mac.txt: ok: available 71% (34897 of 49152 MB), swap used 9528 MB, load 4.15 on 18 cores ... expected worker 1536 MB (default_worker_mb ...), exit 0
Malformed config/host-headroom makes check refuse with exit 1 instead of guessing ✅ pass live live-check-real-mac.txt: min_avail_pct must be a whole percent from 0 to 100 or off, exit=1
A fresh ship spawn on a machine short of headroom is deferred with exit 75, and no task record, tmux window, worktree, footprint record or lock is left behind ✅ pass live live-spawn-deferred.txt: deferred: this machine is short of headroom ... below min_avail_pct=95, exit=75; state/ holds only .last-watcher-beat; no fm-hr-a window; no .treehouse pool
A fresh spawn with headroom launches a real Claude worker and appends an event=spawn footprint record tagged with project, kind, harness and model ✅ pass live live-fanout-spawn-transcript.txt: spawned hr-a harness=claude kind=ship ... and event=spawn task=hr-a project=demo kind=ship harness=claude model=haiku ... avail_mb=25559
Adversarial: a rapid sequential fan-out of real workers, which barely raises measured memory, is stopped at the machine budget by the running workers' reservation ✅ pass live live-fanout-spawn-transcript.txt: hr-b and hr-c spawned; hr-d `available memory 26050 MB less 13306 MB reserved for running workers and this worker's expected 4800 MB leaves 7944 MB, below min_avail_p…
Adversarial: startup samples of freshly launched workers (~360 MB) do not lower the expected footprint below default_worker_mb ✅ pass live Footprint log holds many event=sample worker_rss_mb=35x-36x lines, yet every later check still says expected worker 4800 MB (default_worker_mb, fewer than 3 measured workers of kind ship)
A spawn waits on the machine-wide headroom lock held by another admission and is judged only after it is released ✅ pass live live-fanout-spawn-transcript.txt: holder acquired 13:57:13 and released 13:57:25; spawn hr-e started 13:57:13 and finished 13:57:26 with a deferred verdict
FM_SPAWN_IGNORE_HEADROOM=1 launches one spawn past the budget and says so ✅ pass live live-fanout-spawn-transcript.txt: notice: FM_SPAWN_IGNORE_HEADROOM=1 - launching hr-d without checking this machine&#39;s headroom then spawned hr-d
Operator runs report and sees the shared machine budget after reservations, running workers, the implied safe concurrent count, and whether each project's pool cap or the machine budget binds first ✅ pass live live-report.txt: Machine budget: 0 MB ... after 17734 MB reserved for 4 running worker(s) ... shared by every project; demo: pool cap 16; the machine budget (4 workers) binds first
Teardown of a real worker records its measured resident memory before reaping its processes ✅ pass live live-fanout-spawn-transcript.txt: event=teardown task=hr-d ... worker_rss_mb=367 written before the reap; 4 teardown records after all workers were torn down
A worker in a local secondmate home counts against the same root-home budget and lock ⏸️ untested no Driving this live needs a registered secondmate home and a second home-level spawn. In this run the lab used a single root home. I proved the shared lock with a second process holding the root lock, b…
  • bash tests/fm-host-headroom.test.sh (targeted suite, all 19 cases ok)

  • FM_HOME=$LAB bin/fm-host-headroom.sh check --kind ship --harness claude with real macOS measurement: defaults, then min_avail_pct=95, then a malformed min_avail_pct

  • Real bin/fm-spawn.sh hr-a &lt;lab&gt;/projects/demo --mode no-mistakes --yolo off --model haiku from a pane on the lab's private tmux socket, with min_avail_pct=95 (deferred) and then with defaults (launched)

  • Live sequential fan-out with default_worker_mb=4800: hr-b and hr-c admitted, then hr-d and hr-e deferred by the running workers' reservation

  • Two concurrent spawns from one home (hr-c and hr-d in separate panes)

  • Held state/.host-headroom.lock from another process for 12 s while spawning hr-e, and timed the wait

  • FM_SPAWN_IGNORE_HEADROOM=1 fm-spawn.sh hr-d past the budget

  • FM_HOME=$LAB bin/fm-host-headroom.sh report with 4 live workers

  • bin/fm-teardown.sh &lt;id&gt; --force for hr-a..hr-d, checking event=teardown lines in state/host-footprint.log

  • Lab teardown: tmux kill-server on the fm-lab socket, then rm -rf of the lab home

  • ℹ️ bin/fm-host-headroom.sh:9 - The header comment still says bin/fm-spawn.sh runs check "with the new worker's kind, harness, model, and project". After the flag removal it passes only kind and harness, so this line should read "kind and harness".

  • Live validation: ✅ go - 5 of 7 scenarios driven live against the product

Scenario Result Live Evidence
Operator runs check --kind ship --harness claude on the real machine and gets an ok verdict naming the measured memory, swap, load, pressure, expected footprint and reservation ✅ pass live r2-live-cli-transcript.txt
Passing the removed --model or --project flag to check is rejected with usage (exit 2) ✅ pass live r2-live-cli-transcript.txt
A real fm-spawn on a machine short of headroom (min_avail_pct=95) is deferred with exit 75 and creates no task record, footprint line or window; this also shows fm-spawn's call without --model/--proje… ✅ pass live r2-live-spawn-defer.txt
A malformed threshold file makes check exit 1 and fm-spawn refuse rather than guess ✅ pass live r2-live-cli-transcript.txt, r2-live-spawn-defer.txt
report shows the machine-wide budget shared by every project and the implied safe concurrent worker count ✅ pass live r2-live-cli-transcript.txt
Rapid sequential fan-out of real worker processes is stopped at the machine budget by the reservation, and startup samples never lower the default footprint ⏸️ untested no The prior payload did not establish a live result. It was covered only by tests/fm-host-headroom.test.sh, which uses fake tmux and treehouse and injected memory readings. A live fan-out needs the real…
A spawn with headroom launches and appends its footprint record ⏸️ untested no The prior payload did not establish a live result. It was covered only by the end-to-end test with fake tmux and treehouse. A live launch needs real treehouse to set up a pool worktree, which writes o…
  • bash tests/fm-host-headroom.test.sh (every case passed, including: rapid fan-out stopped at the budget, startup samples never lowering the default, an unreadable home not hiding the other homes, and the spawn defer/launch/override/refuse cases)
  • bash tests/fm-project-capacity.test.sh (exit 0)
  • Live: FM_HOME=&lt;lab&gt; bin/fm-host-headroom.sh check --kind ship --harness claude against real sysctl measurements -> ok, exit 0
  • Live: check ... --model opus and check --project x -> usage, exit 2
  • Live: lab config/host-headroom min_avail_pct=95 -> check --kind scout --harness codex defer, exit 75; malformed value -> exit 1
  • Live: bin/fm-host-headroom.sh report on the real machine
  • Live: real bin/fm-spawn.sh live-1 &lt;lab project&gt; in a marked lab home on a private fm-lab tmux socket, real memory, min_avail_pct=95 -> deferred exit 75, no task record/footprint log/tmux window; default_worker_mb=off -> spawn refused exit 1; lab torn down

✅ No issues found.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Operator runs check on the real machine with default thresholds and gets ok naming memory, swap, load, pressure, expected footprint and reservation ✅ pass live live-headroom-cli.txt section 1 and 3 (exit 0, available 81% of 49152 MB, expected 1536 MB default_worker_mb)
Removed --model/--project flags on check are rejected as bad usage ✅ pass live live-headroom-cli.txt section 2 (usage printed, exit 2 for both)
Adversarial: thresholds the machine breaches make check defer with exit 75 and name the breach ✅ pass live live-headroom-cli.txt section 4 (defer: ... below min_avail_pct=95 (46694 MB), exit 75)
Adversarial: a malformed threshold file refuses instead of guessing ✅ pass live live-headroom-cli.txt section 5 (exit 1, names line and key)
report shows the machine-wide budget shared by every project and the implied safe concurrent worker count ✅ pass live live-headroom-cli.txt section 6 (budget 29983 MB above 20% floor, largest safe count 19)
A real fresh ship spawn on a machine short of headroom is deferred before any record, brief, window or worktree is created ✅ pass live live-spawn-deferral.txt (exit 75; no meta, no launch brief, no new lab tmux window, treehouse tripwire never called)
A rapid sequential fan-out is stopped at the machine budget by reserving for running workers; startup or teardown readings never lower the default footprint; one unreadable home never hides the other… ⏸️ untested no The prior payload did not establish a live result for this scenario. Only the automated test tests/fm-host-headroom.test.sh covers it, using fake tmux and treehouse. Driving it live would need a real…
  • bash tests/fm-host-headroom.test.sh (exit 0, all 19 cases ok)
  • Live in a marked lab home (bin/fm-lab-home.sh create), real sysctl measurements: fm-host-headroom.sh check --kind ship --harness claude and check --kind scout --harness codex
  • Live: fm-host-headroom.sh check --kind ship --model opus and check --project foo (removed flags)
  • Live: check with config/host-headroom min_avail_pct=95 (defer) and min_avail_pct=banana (refuse)
  • Live: fm-host-headroom.sh sample and report
  • Live: bin/fm-spawn.sh task-live &lt;lab project&gt; --mode no-mistakes --yolo off with FM_HOME=lab, a real tmux server on the private fm-lab socket, real measurements, a treehouse tripwire on PATH, and min_avail_pct=95
  • Teardown: tmux -L fm-lab kill-server and rm -rf of the lab home

✅ No issues found.

  • Live validation: ✅ go - 6 of 7 scenarios driven live against the product
Scenario Result Live Evidence
Operator runs fm-host-headroom.sh check on the real Mac and gets an ok verdict naming the real available memory, swap, load and pressure ✅ pass live r3-live-check-real-mac.txt: 'ok: available 77% (37847 of 49152 MB) ...', matching sysctl kern.memorystatus_level=77
Rapid real fan-out: fm-spawn admits workers while the budget lasts, then defers the next one (exit 75, no task record) because the running workers' reservation would push memory below the floor ✅ pass live live-fanout-transcript.txt: fan-1/fan-2 spawned (exit 0), fan-3 'deferred ... 21583 MB reserved for running workers ... below min_avail_pct=20 (9830 MB)', SPAWN3_EXIT=75; no fan-3.meta in state
Startup samples of the fan-out's own workers do not lower the expected footprint below default_worker_mb ✅ pass live live-host-footprint.log shows event=sample readings of ~388-441 MB for fan-1 and fan-2, yet the fan-3 deferral still used 'expected worker 11206 MB (default_worker_mb ...)'; also covered by test_start…
Operator runs report and sees the shared budget for the whole machine, the running workers' memory, the safe worker count, and whether the project's pool cap of 16 or the memory budget binds first ✅ pass live live-report.txt: 'Machine budget: 6489 MB ... shared by every project', 'Workers running now ... 2 using 884 MB', 'demo: pool cap 16; the machine budget (2 workers) binds first'
Teardown of a real worker records its resident memory in the footprint log for the machine ✅ pass live live-host-footprint.log / transcript: 'event=teardown task=fan-1 ... worker_rss_mb=439', 'event=teardown task=fan-2 ... worker_rss_mb=442', TD1_EXIT=0
FM_SPAWN_IGNORE_HEADROOM=1 lets the operator force one deferred spawn, with a visible notice ✅ pass live live-teardown-override-transcript.txt: 'notice: FM_SPAWN_IGNORE_HEADROOM=1 - launching fan-3 without checking this machine's headroom', SPAWN3B_EXIT=0
Unreadable threshold file or unreadable secondmate home: the spawn refuses (thresholds), or the workers of the other homes are still counted (home) ⏸️ untested no The prior payload did not establish a live result. This scenario was covered only by the repository's behavior tests (test_unreadable_thresholds_refuse, test_spawn_refuses_on_unreadable_thresholds, te…
  • bash tests/fm-host-headroom.test.sh (exit 0, includes the fan-out-stops-at-budget, startup-sample floor, unreadable-home and spawn defer/override cases)
  • bash tests/fm-project-capacity.test.sh (exit 0)
  • bash tests/fm-teardown.test.sh (exit 0)
  • Lab home via bin/fm-lab-home.sh create, then bin/fm-host-headroom.sh check --kind ship --harness claude and report with real sysctl measurement, compared against sysctl kern.memorystatus_level vm.loadavg vm.swapusage
  • Real bin/fm-spawn.sh fan-{1,2,3} &lt;lab&gt;/projects/demo --scout --harness claude run in a lab tmux session (tmux -L fm-lab, TREEHOUSE_ROOT in the lab), config/host-headroom sized so the real budget fits two workers
  • bin/fm-host-headroom.sh report with 2 live workers
  • bin/fm-teardown.sh fan-1 / fan-2, then checked the event=teardown lines in state/host-footprint.log
  • FM_SPAWN_IGNORE_HEADROOM=1 bin/fm-spawn.sh fan-3 ... override
  • Lab teardown: tmux -L fm-lab kill-server, chmod -R u+w + rm -rf of the lab, confirmed no leftover processes and a clean worktree
✅ **Document** - passed

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

✅ No issues found.

✅ No issues found.

✅ No issues found.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @andrewkimcanidium — a machine-wide headroom check before fresh ship/scout spawns (shared budget, reservation for running workers, exit 75 deferral) is a thoughtful answer to raising pool caps without OOM-killing the fleet.

Diff review: new bin/fm-host-headroom.sh, spawn admission + .host-headroom.lock, teardown footprint record, docs, tests. Workflow-zero. Unmeasured platforms never block; malformed thresholds refuse. Fork CI approved for tip 6fa71446 (CI 38451404305, Require no-mistakes 38451404276).

Attestation: MATCH 6fa714469fc01132d1376b2dbfd9d1777b92c941. Live 10/11 noted.

Contract-class: new-default. Absent config/host-headroom, default thresholds still gate every fresh spawn (min_avail_pct=20, swap/load/pressure defaults). off / FM_SPAWN_IGNORE_HEADROOM=1 can disable pieces, but the gate is default-on — not opt-in (opt-in would stay off until enabled). No auto-merge.

VISION.md: one-interface / scripts / restart / spine / vendor / scope align; authority in tension (assumes consent to defer under defaults).

Outcome: waiting-ci. Main is red; no merge. When CI + no-mistakes are green on a green main, this is a captain merge-or-leave (new-default). Nothing needed from you unless CI fails.

@andrewkimcanidium

Copy link
Copy Markdown
Contributor Author

CI status on this PR (run 38451404305): 17 passed, 2 without a passing verdict, neither caused by this change.

Behavior portable parallel 1 - pre-existing failure on main.
The only failing test in the shard is tests/fm-pi-primary-types.test.sh (13 run, 1 failed):

fm-branch-supervision.ts(1684,26): error TS2339: Property 'prompt' does not exist on type 'BeforeAgentStartEvent'.
fm-primary-pi-watch.ts(1203,35): error TS2339: Property 'prompt' does not exist on type 'BeforeAgentStartEvent'.

The same test fails with the same two errors on main's own CI at this branch's base 6407052 (run 38316792015) and at 7df545b (run 38447546605).
It type-checks .pi/extensions/ against the Pi package installed on the runner, and this PR does not touch .pi/.
Main fixed it in 8c9c67d (#7248, "narrow before_agent_start events before reading prompt"), whose CI is green (run 38500527469).

Behavior portable serial 2 - cancelled without a verdict.
The job was cancelled by the provider rather than failing, and rerunning it needs repository admin rights, which the author does not have.
It needs a maintainer rerun, or the shard will run again on the next push or rebase onto current main.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @andrewkimcanidium, and thanks for the CI breakdown. You're right on both counts. The parallel 1 failure is fm-pi-primary-types, which was red on main and is fixed in 8c9c67de (#7248). Serial 2 was a timeout cancel, not a test failure.

The catch is that this PR's CI run was built on the old main (7df545bf), and rerunning it would rebuild that same merge commit, so parallel 1 would still fail. To get a clean signal, could you rebase onto current main (8c9c67de) and push through no-mistakes? That gives a fresh attestation and a CI run on top of the fix. Once it's green, I'll approve the fork CI right away if GitHub asks.

  • Contract-class: new-default (unchanged). With no config/host-headroom, the default thresholds gate every fresh ship/scout spawn and can defer it. So this needs the captain's decision and can't be auto-merged.
  • VISION.md: most rules align. The one tension is "Authority is explicit": the gate is on by default instead of being an option to enable, though it does strengthen a refusal path. That trade-off is for the captain.
  • Live validation: 10/11 noted; the secondmate cross-home case is covered by unit tests only.

Status: waiting on you for the rebase. Once CI and no-mistakes are green on current main, this goes to the captain as a merge-or-leave decision. It won't be waiting on you after that.

@andrewkimcanidium
andrewkimcanidium force-pushed the fm/fm-spawn-resource-gate branch from 6fa7144 to 82b0ac6 Compare October 20, 2026 22:38
@andrewkimcanidium andrewkimcanidium changed the title feat(bin): gate worker spawns on one machine-wide memory budget feat(bin): defer worker spawns when the machine is short of memory headroom Oct 20, 2026
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @andrewkimcanidium for rebasing and re-raising this. It's much appreciated.

  • Head 82b0ac60. I reviewed the diff against current main. It touches no workflow files and doesn't change CI scripting beyond registering the new test in bin/fm-test-run.sh's family map. The only commands it adds for host probes are vm_stat, sysctl, memory_pressure, free and ps. There's no network access and no secrets. The tests/lib.sh sample pin only applies under FM_TEST_SEAM=1.
  • Fork CI approved for this head: CI 39509611041 and Require no-mistakes 39509610511 / 39509645977. They're running now.
  • Contract class (my read): new-default (unchanged). With no config/host-headroom, the default thresholds still gate every fresh ship/scout spawn and can defer it with exit 75. So this is the captain's call and can't auto-merge.
  • VISION.md: most rules align, and it strengthens a refusal path. The one tension, for the captain, is "Authority is explicit": the gate is on by default rather than something you enable.
  • Live: 5 of 7 scenarios ran live. The admitted-and-launched spawn writing its footprint record, and the rapid fan-out stopping at the budget, are covered by the suite only. If you can show one real admitted spawn appending its footprint line, that would close the most useful gap. If you can't, the captain will weigh it as is.
  • Heads-up on overlap: feat(bin): add fm-capacity.sh to report open lanes and host headroom #6973 / feat(bin): publish lane capacity facts with beat pressure and keyed limits #6983 (bin/fm-capacity.sh, which has lane plus host-headroom facts and an --admit exit-75 path) cover nearby ground. They're opt-in behind config/lane-capacity. I'm noting this so the captain sees both together.

Status: waiting on CI. If it's green, this goes to the captain as a merge-or-leave decision.

@andrewkimcanidium

Copy link
Copy Markdown
Contributor Author

Real-use evidence for the footprint log, as asked: one admitted spawn and its matching teardown from state/host-footprint.log on the 18-core / 48 GB Mac running the fleet. Task and project names are replaced with placeholders; every other field is as recorded.

1792451615 event=spawn task=<task> project=<project> kind=ship harness=claude model=claude-opus-5-5 worker_rss_mb=- avail_pct=66 avail_mb=32440 total_mb=49152 swap_used_mb=1749 load1=3.76 cores=18 pressure=normal
1792456167 event=teardown task=<task> project=<project> kind=ship harness=claude model=claude-opus-5-5 worker_rss_mb=566 avail_pct=70 avail_mb=34406 total_mb=49152 swap_used_mb=1749 load1=2.70 cores=18 pressure=normal

The spawn line has no RSS (-) because the worker has not started yet; the teardown line records its last-measured footprint.

@andrewkimcanidium
andrewkimcanidium force-pushed the fm/fm-spawn-resource-gate branch from 82b0ac6 to d78a1da Compare October 21, 2026 03:01
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thank you @andrewkimcanidium for the real footprint lines. That closes the live gap I asked about: one admitted spawn whose matching teardown recorded worker_rss_mb=566.

  • Head d78a1da5, rebased onto main. The attestation matches it. I compared its diff with the head I reviewed earlier (82b0ac60), and the only difference is rebase context in the operational-home-layout skill. Nothing in it touches workflow files, the network or secrets.
  • Fork CI approved for this head: CI 39536294776 and Require no-mistakes 39536295437. They're queued now.
  • Contract class (my own read): new-default (unchanged). With no config/host-headroom, the default thresholds gate every fresh ship/scout spawn and can defer it with exit 75.
  • VISION.md: aligns on One captain, Scripts/agents, Restart, Spine (now live-backed), Vendor and Scope. The one tension is "Authority is explicit": the gate is on by default rather than something you enable, though it strengthens a refusal path. That trade-off is for Kun.
  • Status: waiting on CI only. You don't need to do anything. If CI comes back green and the PR is still mergeable, it goes to Kun as a merge-or-leave decision. It won't auto-merge. FYI, feat(bin): add fm-capacity.sh to report open lanes and host headroom #6973 (opt-in bin/fm-capacity.sh) landed on main this pass. It doesn't touch your files.

@andrewkimcanidium

Copy link
Copy Markdown
Contributor Author

On head d78a1da5, "Behavior portable serial 2" was cancelled at the 30-minute job limit (06:48:59 to 07:19:20 UTC) rather than failing: every test that finished passed, and it was mid-way through tests/fm-daemon.test.sh, which this PR does not touch. All other checks passed. Rerunning a job needs admin rights, which I do not have. Could a maintainer rerun that job (run 39536294776)?

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @andrewkimcanidium, and thanks for chasing down the serial 2 result. You're right that it was the known 30-minute job-limit cancel in tests/fm-daemon.test.sh, not something your change caused. Every other check on d78a1da5 passed.

I didn't rerun that job, though. Since your last push, main has moved to 9fe25bca (#7407, #7552, #7364, #7630, #7631, #7633 landed), and this branch now conflicts with it in three files: bin/fm-teardown.sh, docs/configuration.md and tests/lib.sh. GitHub reports it as CONFLICTING. A rerun would only re-test the old merge commit, and it still couldn't land.

Could you rebase onto current main, resolve those three files and push through no-mistakes again (git push no-mistakes)? That gives a fresh attestation and a fresh CI run on top of the new main. If GitHub asks for fork CI approval, I'll approve it once I've checked the diff. If serial 2 hits the 30-minute cancel again, I'll rerun it.

  • Contract class (my own read): new-default (unchanged). With no config/host-headroom, the default thresholds still gate every fresh ship/scout spawn and can defer it with exit 75.
  • VISION.md: aligns on One captain, Scripts/agents, Restart, Spine (your footprint lines closed the live gap), Vendor and Scope. The one tension is "Authority is explicit": the gate is on by default rather than something you turn on, though it does strengthen a refusal path. That trade-off is Kun's call.
  • Where this stands: it's waiting on you for the rebase. Once it's green and mergeable on current main, it goes to Kun as a merge-or-leave decision, and from then on nothing is needed from you. It won't auto-merge.

Add bin/fm-host-headroom.sh, which measures available memory, swap, load
per core, and macOS memory pressure, judges them against config/host-headroom
thresholds, and keeps a per-worker footprint log with a report of typical
worker memory and the concurrent load the thresholds imply. fm-spawn defers a
fresh ship or scout launch with exit 75 when the machine is below them, and
spawn and teardown append footprint records.
Tag every footprint record with the worker's project, kind, harness, and
model, keep the log and thresholds in the root home for the whole machine,
and gate each spawn on current headroom less the new worker's expected
footprint, learned from earlier workers of its kind and harness. The report
breaks memory down by kind, harness, and project, states the machine budget
and implied concurrent count, and names project worktree pools that would
bind first.
…1630), as the maintainer asked. It already includes kunchenguid#7248, the fm-pi-primary-types fix behind the "parallel 1" failure. All six PR commits are kept with no scope change. The PR's own diff is still 10 files, 1498 insertions and 4 deletions. Three conflicts came up, each just two changes landing on the same lines, and I kept both sides: - bin/fm-spawn.sh: main's Herdr project-groups hook and this PR's footprint record. - docs/configuration.md: main's paseo FM_BACKEND line and this PR's FM_SPAWN_IGNORE_HEADROOM line. - docs/scripts.md: main's updated trailer-strip and push-guard rows and this PR's fm-host-headroom row. After the rebase, the spawn case "a spawn with headroom was refused" in tests/fm-host-headroom.test.sh failed. The cause is upstream aa9ab04 (kunchenguid#7409): before sending keys, the tmux backend now runs `tmux list-windows` to check that the window exists. The fake tmux in this test answered list-windows with nothing, so the spawn rolled back and exited 1. This test also failed the same way locally on the pre-rebase head (with a different error from an unrelated preflight); it is not a defect in the gate. I made one small change, in the test only: the fake tmux now remembers the window names it creates with new-window and lists them back. That is the same pattern tests/fm-project-capacity.test.sh already uses. Results: - tests/fm-host-headroom.test.sh: exit 0, all cases ok. - tests/fm-project-capacity.test.sh: exit 0. - tests/fm-pi-primary-types.test.sh: exit 0 (Pi 1.2.0). - shellcheck on the changed test: clean. The "serial 2" failure was a timeout cancel during fm-busy-adapter-wiring.test.sh, not a test failure, so it needs no code change; it will re-run when CI runs on the new head. I did not push; the outer executor still has to commit the test change and push the rebased head
@andrewkimcanidium
andrewkimcanidium force-pushed the fm/fm-spawn-resource-gate branch from d78a1da to 083b6b3 Compare October 22, 2026 10:54
@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @andrewkimcanidium for the quick rebase. I compared the new head 083b6b36 with the one I reviewed before (d78a1da5) using a range-diff. It's the same nine commits, and the only changes are the conflict resolutions in bin/fm-teardown.sh, docs/configuration.md, tests/lib.sh and the operational-home-layout skill, where main's new lines are kept alongside yours. There are no workflow, secret or network changes, and the attestation binds this head (MATCH). GitHub now reports it as mergeable. I approved the fork runs for this head: CI 39766651322 and Require no-mistakes 39766651214. "PR must be raised via no-mistakes" passes, and the rest of CI is still running.

  • Contract class (my own read): new-default (unchanged). With no config/host-headroom, the default thresholds still gate every fresh ship/scout spawn.
  • VISION: unchanged. The one tension is "Authority is explicit", and that's Kun's call.

Status: waiting on CI. Nothing is needed from you. If serial 2 hits the 30-minute cancel again, I'll rerun it. Once it's green, this goes to Kun as a merge-or-leave decision, not an auto-merge.

@kunchenguid

Copy link
Copy Markdown
Owner

Speaking as Kun's firstmate: thanks @andrewkimcanidium — head 083b6b36 is now fully green (all 19 checks, including the serial 2 rerun), the no-mistakes attestation binds this head, and it still merges cleanly onto current main.

Contract-class: new-default (my own read, unchanged): with no config/host-headroom, the default thresholds still gate every fresh ship/scout spawn, so the unconfigured product starts deferring spawns it didn't before. VISION: aligns on peace of mind (no memory-pressure crash of the fleet), scripts own the mechanics (exact thresholds in a script), and restart/delegation; the one tension is "Authority is explicit / new capability ships as an option to enable", and that's Kun's call.

I've put this in front of Kun as a merge-or-leave decision. It's not waiting on you — nothing more is needed unless he asks for a change (for example making the gate opt-in).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants