carlos / platform Public

docs: region HA floor says what the file and the ack each prove

Astra r1 F1.3 and the 8a3d302 rulings: §24 (Scripts row, E14, new E15),
§25.4 step 1, §25.9 and §25.11, and floor.go's comment. A present file
without ha_handover keeps DR-4; any present file, capable or not, of
any age, must acknowledge the withdrawal or the drain fails; a declared
fixed box with no file keeps DR-4; fixed_boxes missing or empty refuses.
"Every start republishes" is corrected: an older writer drops the field
and skips the PUT. The verb spec notes fixed_boxes as its one new key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 76c1d2e311570eff6bc21a14f371d2725fb468d6 parent be3889a
3 files changed, +29 −17
  • docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md +10 −5
  • docs/superpowers/specs/2026-11-09-group-roll-verb-design.md +3 −1
  • internal/grouproll/floor.go +16 −11
diff --git a/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md b/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
index e5192feb3..33dadd148 100644
--- a/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
+++ b/docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md
@@ -1000,12 +1000,13 @@ the same rule for every box.
| C16 | Console and CLI region names | Blind: any member can name its AWS region. |
| C17 | Asset status home election | Blind, with the same member routing rules as E2. |
| C18 | Domain attach conflict check | Blind: live member routes reserve names, as H2. |
-| Scripts | Group roll and boot witness | Aware operator tools: inspect members by reference and check that a completed witness left no member files. The roll tool's §25.9 floor check (E14) reads `ha_handover` on every edges file in the deployment's listing, fixed forwarders included, whatever the file's age, and refuses a drain unless each says the number 1. There is no age test: a box that is not HA publishes only on change, hours apart, so an age test skipped quiet live boxes. A dead box's leftover file keeps the region on DR-4, naming the box, until departure or the operator removes it. The superseded script still has the old rule (`ha_take`, files under 15 minutes old) and is not used. |
+| Scripts | Group roll and boot witness | Aware operator tools: inspect members by reference and check that a completed witness left no member files. The roll tool's §25.9 floor check (E14) reads `ha_handover` on every edges file in the deployment's listing, fixed forwarders included, whatever the file's age, and refuses a drain unless each says the number 1, and unless every box in the config's `fixed_boxes` has a file. There is no age test: a box that is not HA publishes only on change, hours apart, so an age test skipped quiet live boxes. The file is only a hint. A present file without the capability keeps the region on DR-4, naming the box; a present file with it, of any age, still has to acknowledge the withdrawal (E15), or the drain fails. The superseded script still has the old rule (`ha_take`, files under 15 minutes old) and is not used. |
| E10 | Silence rule (`Edge.PeerDraining`, read by the activator's `NoteForward`; §25.5) | Blind: a box whose file says `draining` or `ha_drained` is not made silent or suspect for a held answer. Dial failures still make any box suspect. A terminated member that was draining keeps that file until departure, so only its silence is ignored. |
| E11 | Holder-cache drop (`notePeerDrained`, §25.4 step 4) | Blind: a file that says `ha_drained` drops this box's holder-cache entries naming that box, once per publication (its `ha_drain` id, else its generation), before the drained acknowledgement. From then until a later publication of that box no longer says `ha_drained`, neither cache installs or follows the box as a holder: a lock read that was in flight across the drop, and a delayed holder answer naming it, are not used (build ruling, 2026-11-09). A stale drained file drops nothing new. A box that is only `draining` stays a holder. |
| E12 | Drain acknowledgement receiver (`/.carlos/ha-drain`, `foldedDrain`, §25.4 step 1) | Blind: it reads the asker's own file by its exact key and answers whether its fold shows `draining` or `ha_drained` under the asked `ha_drain` transaction and id. A file that no longer matches, a stale one included, is answered as not seen. |
| E13 | Take capability (`takeCapable`, `Edge.PeerTakes`; §25.7) | Blind: a box is asked to take only when its file says `ha_take` as the number 1. Absent, other numbers, strings and booleans mean no. A stale member file can still name a successor; the take then fails its dial, and the drain tries the next candidate or fails. `ha_handover` is not a take capability: a box that is not HA says `ha_handover: 1` and no `ha_take`, and is never asked to take. |
-| E14 | Held-requests floor (`ha_handover`, read by the group roll verb's `Engine.Floor`, `internal/grouproll/floor.go`; §25.9) | Blind: every edges file in the deployment's listing counts, member or fixed box, whatever its age. Each must say `ha_handover` as the number 1. Absent, other numbers, `1.0`, strings and booleans are a DR-4 reason naming the box; an unreadable file refuses the transaction. A terminated member's unchanged file counts until departure removes it, and a terminated fixed box's until the operator does (runbook, "A fixed box has been terminated"). Until then the region stays on DR-4, which is safe. |
+| E14 | Held-requests floor (`ha_handover`, read by the group roll verb's `Engine.Floor`, `internal/grouproll/floor.go`; §25.9) | Blind: every edges file in the deployment's listing counts, member or fixed box, whatever its age. Each must say `ha_handover` as the number 1. Absent, other numbers, `1.0`, strings and booleans are a DR-4 reason naming the box; an unreadable file refuses the transaction. A box in the config's `fixed_boxes` with no file is a DR-4 reason naming it; `fixed_boxes` missing or empty refuses the transaction. The floor cannot tell a live box from a dead one. A terminated box's leftover file without the capability keeps the region on DR-4; one with the capability passes the floor and then fails the drain at E15, naming the box. Either way it counts until departure removes a member's file or the operator removes a fixed box's (runbook, "A fixed box has been terminated"). |
+| E15 | Drain acknowledgement peers (`Edge.DrainAckPeers`, read by the drain driver's `publishAndAck`, `internal/host/hadrain.go`; §25.4 step 1) | Blind: every other box with an edges file in the asker's fold, named by its key, whatever the file's age, is asked and must acknowledge. The file is a hint and the live answer is the proof: only a binary with held requests answers `/.carlos/ha-drain`. A box rolled back to an older binary keeps the newer binary's capable file but cannot answer, and a dead box's leftover file cannot answer, so the drain fails before any move, naming each box. A fold not read in full gives no peer list; it is retried within the 2 minute bound, then the drain fails. |
The drain state reuses the existing box-level `draining` field, so the
placement readers already listed (E5, C1, C6, C10, H5, and db-read
@@ -1099,7 +1100,7 @@ The roll tool runs a new root verb, `carlos system group-maintenance drain`, ove
1. **Withdraw, acknowledged.** A publishes a box-level drain state in its edges file, and from then on places nothing on itself. The field withdraws placement only. Name authority, admission and holder reachability are unchanged, so A keeps answering as a holder and a forwarder (R2.9). Placement reads it as local-denied (`internal/edge/wakeplacement.go:36-42`), and that includes §6.3 rule 1, so a clean marker naming A no longer sends a wake to A. The builder fixes the field with a reader table under §24's rule.
- A timer does not prove that peers folded the change (R2.9). So A sends a signed `/.carlos/ha-drain` hop to every live box of the deployment that views its region, fixed forwarders and other regions included. Each receiver refreshes its fold of A's edges file at once, which is one normal fold read, and answers whether it now sees A draining. A asks again every 5 s. Each request names the drain transaction and the generation of A's edges file. A receiver that has already folded that generation answers from memory with no new read, so each receiver costs one fold read per round however often it is asked (R3.9). The drain goes on only once every such box has acknowledged. A box that cannot be reached, or does not acknowledge within 2 minutes, makes the drain fail (failures, below).
+ A timer does not prove that peers folded the change (R2.9). So A sends a signed `/.carlos/ha-drain` hop to every box of the deployment with an edges file, whatever the file's age (E15), fixed forwarders and other regions included. Each receiver refreshes its fold of A's edges file at once, which is one normal fold read, and answers whether it now sees A draining. A asks again every 5 s. Each request names the drain transaction and the generation of A's edges file. A receiver that has already folded that generation answers from memory with no new read, so each receiver costs one fold read per round however often it is asked (R3.9). The drain goes on only once every such box has acknowledged. A box that cannot be reached, or does not acknowledge within 2 minutes, makes the drain fail (failures, below).
2. **Quiesce (H5).** A closes its local start gate for tenant leases. It then settles everything that crossed the gate before it closed: wakes that are restoring, acquires waiting on their conditional PUT, and lost-lease recovery workers. Each either ends awake, and is then moved in step 3, or fails. Pending stops and marker obligations are kept and settled (§5.2). Nothing is cancelled in a way that would drop a writer proof.
3. **Move each awake host H,** up to 4 at a time, busiest first:
1. *Hold.* From now `MoveState(H)` is `holding` (§25.5).
@@ -1198,7 +1199,10 @@ Both control paths, `/.carlos/ha-take` and `/.carlos/ha-drain`, are reserved on
A drain is only safe when every box that may send A a request understands the new headers, and successors understand a take. So:
- `drain` refuses unless every box of the deployment publishes `ha_handover: 1`. Every box on a release with this section writes it, HA or not, with no setting: it says the binary understands the held-requests headers (`X-Carlos-Handover`, the replay mark) and the drain acknowledgement. Fixed forwarders such as adi count. A take still needs `ha_take: 1` and a box serving the pool (E13); `ha_handover` never makes a box a take candidate.
-- The floor counts every edges file present in the deployment's `control/edges/` listing, whatever its age (E14). The capability belongs to the running binary, and every start republishes the file, so a present file says what that box last ran. An age test would hide quiet live boxes: a box that is not HA publishes only on change, often hours apart, and could forward to the member on an old binary. The risk left is a dead box's leftover file. Departure removes a member's; the operator removes a fixed box's (runbook, "A fixed box has been terminated"). Until then the floor uses DR-4 and names the box, so it fails safe.
+- The floor counts every edges file present in the deployment's `control/edges/` listing, whatever its age (E14). An age test would hide quiet live boxes: a box that is not HA publishes only on change, often hours apart, and could forward to the member on an old binary.
+- The file is a hint, not proof of what the box runs now. A start does not always republish it: a writer that does not know `ha_handover` decodes the stored file into its own struct, drops the field, finds nothing changed and skips the write. So a box rolled back to an older binary keeps the newer binary's `ha_handover: 1`. The proof is the withdrawal's acknowledgement (§25.4 step 1, E15): every box with a file, capable or not, of any age, must answer it, and only a binary with held requests can. A box that cannot answer, rolled back or dead, fails the drain before any move, naming it, and the member returns as for any failed drain.
+- A present file without the capability keeps DR-4, naming the box. A capable leftover file of a dead box passes the floor and fails the drain until departure removes a member's file or the operator removes a fixed box's (runbook, "A fixed box has been terminated").
+- A fixed box can serve and forward with no edges file: its publisher runs beside the edge, and a first write that fails does not stop it serving. So the verb's config lists every fixed box of the deployment that may forward, in any region, as `fixed_boxes`, and a listed box with no file keeps DR-4, naming it. `fixed_boxes` missing or empty refuses the transaction; it is never read as "no fixed boxes". No existing source gives the verb this set: the operator role reads only `control/edges/*` and no SSM parameter, and `CARLOS_HA_FIXED_BOX_IDENTITIES` lists only a region's fixed boxes, optionally, in host.env and SSM. Group members need no list: a member takes no traffic until it is admitted, and admission waits for its first booting publication to succeed (`internal/groupadmission/state.go:12`, `internal/host/group_admission.go:139-145, 170`).
- `replace` also checks that the release the pinned launch template boots (`group_config.release`, `infra/modules/region-host/group.tf:50`) is at or above the floor. After the launch, it checks that the replacement publishes `ha_take: 1`.
- **First install.** Rolling a group onto the first release with §25 cannot drain. That roll uses today's DR-4 rule, replacing only lock-free members, and the tool says which rule it applied.
- A rollback below the floor brings DR-4 back. The tool checks the floor on every transaction.
@@ -1269,7 +1273,8 @@ W1 to W4 passing on a release at the floor is what retires the DR-4 rule.
- **Shape:**
- the nested layout;
- the region in group mode (`infra/modules/region-host`), with its NLB, launch hook, terminations queue and rule;
- - `CARLOS_REGION_HA` and `CARLOS_GROUP_ADMISSION` on the members. Fixed boxes need no `CARLOS_REGION_HA` for the §25.9 floor, only a release at the floor: every box on such a release publishes `ha_handover: 1`. A fixed box whose edges file is left from an older release, or from a terminated box, keeps the region on DR-4 until it is updated or its file is removed;
+ - `CARLOS_REGION_HA` and `CARLOS_GROUP_ADMISSION` on the members. Fixed boxes need no `CARLOS_REGION_HA` for the §25.9 floor, only a release at the floor: every box on such a release publishes `ha_handover: 1`, and answers the drain's acknowledgement. A fixed box whose edges file has no `ha_handover: 1` keeps the region on DR-4. A fixed box rolled back below the floor, or terminated with its file left behind, fails each drain, naming it, until it is updated or its file is removed;
+ - the roll tool's config lists every fixed box of the deployment that may forward into the region in `fixed_boxes`, whatever its region;
- chrony, and SSM on the members for the roll tool.
- **Pool:** a named HA pool in `CONSOLE_HA_CAPACITY_CONFIG` (`ha_pools`), and `CONSOLE_HA_REGIONS` on the console (§23).
- **Which instances benefit:** only born-HA instances in that pool (N-HA7). Existing instances need the operator migration slice, which is not built. Until it is, they resize the old way.
diff --git a/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md b/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md
index 4d6463d5b..bea9e7fbc 100644
--- a/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md
+++ b/docs/superpowers/specs/2026-11-09-group-roll-verb-design.md
@@ -109,7 +109,9 @@ flags-after-positionals trap of `cli-default-console-flagship` cannot arise.
- **The config file is the script's config file.** The same JSON keys, the same
validation (`validate_config`, `:506-545`, plus the `held-floor-sha-map`
keys `release_public_key`, `release_channels`, `release_platform`), so one file
- serves both tools during the overlap (§11). No key is added.
+ serves both tools during the overlap (§11). One key is added after the
+ overlap: `fixed_boxes` (held floor capability, 2026-11-10, region HA spec
+ §25.9), which the superseded script refuses.
- **Exit codes and output** follow the script: 0 on success, 1 on a refusal with
`Refused: <reason>` on stderr, phase lines `phase: detail` on stdout, the JSON
drain summary line, and `status` printing the saved transaction as one JSON
diff --git a/internal/grouproll/floor.go b/internal/grouproll/floor.go
index dffaee884..6ded59499 100644
--- a/internal/grouproll/floor.go
+++ b/internal/grouproll/floor.go
@@ -21,20 +21,25 @@ var (
// Floor is the script's Operator.floor (held-floor-sha-map; region HA
// spec §25.9, group roll verb spec §9): which rule a departure or a roll
// takes. "drain" when every box with an edges file publishes
-// ha_handover: 1 and the release the transaction leaves running is at or
-// above ha_floor; "dr4" when a definite finding says otherwise. kind is
-// "replace", "remove" or "roll"; version is the release the member
-// prepared (roll only).
+// ha_handover: 1, every declared fixed box has one, and the release the
+// transaction leaves running is at or above ha_floor; "dr4" when a
+// definite finding says otherwise. kind is "replace", "remove" or "roll";
+// version is the release the member prepared (roll only).
//
// The floor counts every edges file in the deployment's control/edges/
// listing, whatever its age (§25.9; held floor capability ruling,
-// 2026-11-10). ha_handover is a property of the binary, and every start
-// republishes the file, so a present file says what its box last ran. An
-// age test hid quiet live boxes: a box that is not HA publishes only on
-// change, hours apart. A dead box's leftover file fails safe (DR-4, named)
-// until departure or the operator removes it. ha_take is not read here: it
-// says a box answers takes (region HA), which only take candidates need.
-// The journaled live list is the boxes counted.
+// 2026-11-10): an age test hid quiet live boxes, since a box that is not
+// HA publishes only on change, hours apart. The file is a hint, not proof:
+// a start does not always republish it (an older writer drops ha_handover
+// from its gate and skips the PUT), so a box rolled back below the floor
+// can keep a capable file. A present file without the capability is DR-4,
+// naming the box. Every present file, capable or not, must also be
+// acknowledged at drain time (§25.4 step 1, Edge.DrainAckPeers), or the
+// drain fails before any move. Every box in the config's fixed_boxes
+// must have a file, or it is DR-4 naming the box: a fixed box can serve
+// with no file. fixed_boxes missing or empty is a floor error. ha_take is
+// not read here: it says a box answers takes (region HA), which only take
+// candidates need. The journaled live list is the boxes counted.
//
// A floor that cannot be read (an unreadable edges file or listing, a
// template release that cannot be compared, a SHA-256 that cannot be