carlos / platform Public

docs: region HA drain asks the verb's one population

Spec §24 E15, §25.4 step 1 and §25.9: the verb's single listing of
control/edges/ for the floor is the acknowledgement population, carried
in the drain request; the member asks every box on it plus any its fold
adds, and its fold's completeness is never evidence. States the
residual (a box first publishing during the drain window) and why it is
bounded: members serve only after admission, which needs their booting
publication; fixed boxes are operator-added.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 802b5502e9a7ed61d86b7a5c245d201af9780fc1 parent 51d88bb
1 file changed, +4 −2
  • docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md +4 −2
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 d7f9622b1..0d23803ab 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
@@ -1006,7 +1006,7 @@ the same rule for every box.
| 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. Each ask carries a fresh random nonce, covered by the ask's signature. The answer is signed under the mesh key over a separate domain, the answering box, the asking box, the transaction, the phase, the drain id, the nonce and the answer itself. |
| 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 box in the config's `fixed_boxes` with no file is a DR-4 reason naming it. The config must declare either a non-empty `fixed_boxes` or `"no_fixed_boxes": true`; neither, or both, 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 can sign an answer for the ask (E12). Anything else is not an acknowledgement: an unsigned body, a bad signature, an answer to another ask (its nonce differs), a 404, or a tenant app's page behind an older binary. 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. |
+| E15 | Drain acknowledgement population (the roll verb's floor listing, carried as `drain --peers=`; `publishAndAck` in `internal/host/hadrain.go`, which adds `Edge.DrainAckPeers`; §25.4 step 1) | Blind: one population, read once, by the party that decides. The verb lists `control/edges/` once for the transaction's floor (§25.9), and every box it counted, the member excluded, travels in the drain request. A asks every box on that list, and also any other box with an edges file in its own fold, named by its key, whatever the file's age. The fold may only add boxes. Its completeness is never evidence: after a failed LIST, unreadable files, or no poll since a box published, it is a last-good map. A listed box the fold lacks is asked after one fresh fold read; if it still cannot be read or answer, the drain fails naming it. A drain request without the list, from an older tool, is refused before anything runs. The file is a hint and the live answer is the proof: only a binary with held requests can sign an answer for the ask (E12). Anything else is not an acknowledgement: an unsigned body, a bad signature, an answer to another ask (its nonce differs), a 404, or a tenant app's page behind an older binary. 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 box that first publishes after the verb's listing is on the list only if A's fold has read it by then; §25.9 says why that window is bounded. |
The drain state reuses the existing box-level `draining` field, so the
placement readers already listed (E5, C1, C6, C10, H5, and db-read
@@ -1100,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 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. Each ask carries a fresh random nonce, and the answer is signed under the mesh key over the two boxes, the transaction, the phase, the drain id, the nonce and the answer (E12). A counts only an answer signed for that ask. An older binary cannot sign one, and a tenant app it might pass the path to cannot either, so neither acknowledges. 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 on the roll verb's list, plus any other box with an edges file in A's own fold, whatever the file's age (E15), fixed forwarders and other regions included. The list is the verb's single read of `control/edges/` for the transaction's floor, every box it counted except A, carried in the drain request (`drain --peers=`); a request without it is refused before anything runs. A's fold may add boxes to the list but never remove one, and a listed box A's fold lacks is asked after one fresh fold read. 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. Each ask carries a fresh random nonce, and the answer is signed under the mesh key over the two boxes, the transaction, the phase, the drain id, the nonce and the answer (E12). A counts only an answer signed for that ask. An older binary cannot sign one, and a tenant app it might pass the path to cannot either, so neither acknowledges. 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).
@@ -1201,6 +1201,8 @@ A drain is only safe when every box that may send A a request understands the ne
- `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). 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.
+- One population, read once, by the party that decides: the verb's listing of `control/edges/` for this floor is also the drain's acknowledgement population. The verb passes every box it counted, the member excluded, in the drain request, and the member asks every one of them, plus any box its own fold adds (E15). An empty list is valid only when the floor counted no other box. S3 LIST is strongly consistent, so a box whose file existed at the floor's read is on the list.
+- The residual is a brand-new box that first publishes during the drain window: it is not on the list, and is asked only if the member's fold reads it in time. This is bounded. A group member cannot serve before it is admitted, and admission requires its own booting publication to have succeeded (`internal/host/group_admission.go:139-145, 170`; `internal/groupadmission/state.go:12`). New fixed boxes are added by the operator, so the operator does not add one while a transaction is running (one sentence for the runbook).
- 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. A deployment with no fixed boxes says so with `"no_fixed_boxes": true`. The config must have exactly one of a non-empty `fixed_boxes` and `"no_fixed_boxes": true`; neither (a missing or empty list with `no_fixed_boxes` false or absent), or both, refuses the transaction. Silence 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`.