box/host
dan-claude-bot fee1929d10 feat(setup-host): auto-pick a free subnet — nested box-in-box, zero flags (#80)
#86 shipped the refuse half of #80's fix #1; this completes the other half:
"refuse … or automatically select a non-colliding subnet". The bare
setup-host that used to stop an agent mid-drill inside a box now decides
the subnet itself. choose_subnet is the one place that decision happens,
before any mutation — BOX_GW, the bridge, the ACL carve-out, the firewall
and the doctor's expectations all derive from its answer. Four deliberate
cases:

1. explicit BOX_SUBNET — honored or refused, never silently overridden:
   a script that says 10.90 gets 10.90 or a loud stop. The claimant
   refusal and the bridge agree-gate are unchanged in spirit.
2. no pin, boxnet exists — converge to the bridge's own subnet: the
   bridge IS the pin (boxes hold leases on it). The old agree-gate
   refusal on a bare re-run against a moved bridge becomes convergence,
   announced when the bridge is off-default, silent on the plain
   default-host re-run. A FOREIGN claimant on the bridge's own subnet
   still refuses — that is #80's poisoned state, and converging would
   rebuild the blackouts; the refusal names the bridge move instead.
3. no pin, no bridge, 10.88.0.0/24 free — the default, as always.
4. no pin, no bridge, default claimed — the nested case (a drill or
   rehearsal inside a box, whose own uplink owns 10.88): scan
   10.89.0.0/24 … 10.127.0.0/24 in order, take the first free candidate,
   announce the pick, the claimant and the BOX_SUBNET pin for scripts;
   refuse only when every candidate is claimed. The scan only ever runs
   bridge-less — an existing bridge is case 2, which precedes it.

Pure over ip (via subnet_claimant and the bridge read), so test/cli.sh
drives every case against canned tables with the shim ip.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-18 21:22:00 +00:00
..
box-firewall.service Give box-firewall.service RemainAfterExit so its state means something 2026-07-17 14:05:23 +00:00
box-firewall.sh box-firewall: converge the UFW carve-out off the live bridge; fail closed at boot 2026-07-18 20:45:21 +00:00
grant-user.sh feat: box export / import — state that survives the box and the host (#70) 2026-07-18 18:55:23 +00:00
migrate-host.sh feat(setup-host): refuse a claimed subnet, and BOX_SUBNET to move off one (#80) 2026-07-18 19:46:58 +00:00
revoke-user.sh fix(revoke): purge re-checks the incus-user state dir — as root, not as a hopeful stat 2026-07-18 16:01:57 +00:00
setup-host.sh feat(setup-host): auto-pick a free subnet — nested box-in-box, zero flags (#80) 2026-07-18 21:22:00 +00:00
teardown-host.sh feat(cli): versions, use, uninstall — the install managed from the CLI, absence-asserted 2026-07-18 16:01:57 +00:00