carlos / platform Public

spec: hub HA design rev 1 (#1388, #908)

Part 1: a hub edge restart drops no fleet request (admission
exemption, hub warm-up hold, sender hold, socket handoff).
Part 2: two or more hubs per region, fleet boxes tunnel to each.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev dfd46a8e302f674c91c0068575acfaae7f6107e4 parent bac71e0
1 file changed, +301 −0
  • docs/superpowers/specs/2026-11-25-hub-ha-design.md +301 −0
diff --git a/docs/superpowers/specs/2026-11-25-hub-ha-design.md b/docs/superpowers/specs/2026-11-25-hub-ha-design.md
new file mode 100644
index 000000000..93d717276
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-25-hub-ha-design.md
@@ -0,0 +1,301 @@
+# Hub HA: fleet traffic through hub restarts and hub loss (#1388, #908)
+
+Design, 2026-11-25, **rev 1** (draft for Astra round 1). Asked for by agent manager 8a3d302 with Paul's go, relayed through Tito. Branch `design-hub-ha`, cut from `origin/main` at bac71e00. Nothing here is built. Review budget: at most three Astra rounds (AGENTS.md stopping rules); a P1 in round three means cut scope and go to Paul.
+
+Line citations are to `origin/main` at bac71e00.
+
+The spec has two parts:
+- **Part 1 (short term, small):** a planned restart of the hub's edge drops no fleet request. It keeps one hub per region.
+- **Part 2 (the real fix):** two or more hubs per region, so losing a hub, planned or not, leaves fleet apps serving.
+
+## 1. The problem
+
+Every fleet box dials one reverse tunnel, to the region's hub: the console's box, whose edge has `CARLOS_TUNNEL_HOST` set and `CARLOS_FLEET` unset (`internal/edge/fleetforward.go:17-19`). Only the hub serves forward rows and replica-set rows (`fleetforward.go:72-73,89-90`), and only the hub publishes those names in its edges file (`internal/host/edgesfile.go:682-685`). Every other edge sends a fleet request to the hub by backhaul (`internal/edge/edge.go:4596`), dialling the hub's address directly on 443.
+
+So the hub's edge process is a single point of failure for every fleet app in the deployment. On Tito's v0.43.2 roll (2026-11-25 02:15Z) the IE hub's edge restart took billing.tito.io out for 15 s through every edge, UK included, while both copies (box-a, box-c) stayed healthy (#1388). Classic and Pro move to Tito's production fleet next. #908 asks for the same redundancy for the console, the home box's own apps and fleet entry.
+
+## 2. Today's gap, measured
+
+### 2.1 The dev hub (sophie), six restarts on 2026-11-24
+
+Read-only journal of `carlos-edge` on sophie (i-05498eada6f0afd23), which has W6 armed for two target groups and `CARLOS_GROUP_ADMISSION=1`:
+
+| Restart | Drain began | Listeners closed | New edge started | Tunnel `demo/box-1` back | Tenant admission open |
+|---|---|---|---|---|---|
+| 10:32 | 10:31:39.05 | 10:32:42.18 | 10:32:43.04 | 10:32:44.25 (+1.2 s) | 10:33:13.74 (+30.7 s) |
+| 10:48 | 10:47:02.84 | 10:48:08.01 | 10:48:08.03 | 10:48:09.22 (+1.2 s) | 10:48:38.66 (+30.6 s) |
+| 12:31 | 12:30:20.32 | 12:31:25.51 | 12:31:26.58 | 12:31:27.71 (+1.1 s) | 12:31:57.32 (+30.7 s) |
+| 12:46 | 12:45:44.44 | 12:46:49.65 | 12:46:51.00 | 12:46:52.21 (+1.2 s) | 12:47:21.73 (+30.7 s) |
+| 13:01 | 13:00:56.15 | 13:01:59.30 | 13:01:59.32 | 13:02:00.51 (+1.2 s) | 13:02:30.05 (+30.7 s) |
+| 18:51 | 18:50:20.33 | 18:51:25.52 | 18:51:27.33 | 18:51:28.46 (+1.1 s) | 18:51:57.99 (+30.7 s) |
+
+Times after "+" are from the new process's start. Admission waited on `Reconciled, RolePublished, TerminationStarted, hosting, activator` every time.
+
+Reading it:
+1. **The listener gap is about 1 to 2 s** (listeners closed to new process start, plus about 1 s to bind). Every hop from another edge in that window is refused.
+2. **Tunnels come back fast:** about 1.1 s after start, because the box's backoff starts at 250 ms (`internal/tunnelclient/tunnelclient.go:42-43`) and the hub loads its fleet credentials before it listens (`edge.go:1060,1541`).
+3. **Then 30 s of 503 for fleet apps on an admission-gated hub.** Forward and replica-set rows are tenant rows. A fixed box exempts only platform and unit-backed rows from tenant admission (`internal/host/group_admission.go:100`), so the fleet arm answers 503 `Retry-After: 10` until admission opens (`internal/edge/group_admission.go:10-24`), although nothing about a fleet row needs the activator, a lease or a reconcile. This is the largest part of the gap on dev and on any hub with region HA's fixed admission. No fleet probe ran during these restarts, so this is read from the code and the admission log lines, not counted at a client.
+
+### 2.2 Tito's hub (no NLB, no W6, no tenant admission)
+
+Tito's 15 s is not visible from here; this is the reconstruction from code, to be confirmed by the witness (§3.8):
+- **SIGTERM closes the listeners at once,** then waits up to 10 s for in-flight requests (`edge.go:5236-5248`). A tunnel is a hijacked connection, so `Shutdown` neither waits for it nor closes it; it dies at process exit. The tunnels keep serving in-flight work, but nothing new can reach the hub for the whole wait. Any long response (a proxied SSE stream, a slow download) makes the wait the full 10 s.
+- **Restart and bind:** about 1 s (`carlos-edge.service`, `Restart=always`, `RestartSec=1`; dev above).
+- **Tunnels:** about 1 s.
+- **Replica copies:** a fresh process has no probe history. A copy is live after two passing probes one second apart (`internal/edge/replicaprober.go:18-21`), so about 2 s more. Until then a replica-set row answers 503 `Retry-After: 2` (`internal/edge/replicaproxy.go:57-60`). The fallback to the previous forward row's box needs a previous map entry, which a new process does not have.
+
+That is about 10 + 1 + 1 + 2 = 14 s, which matches the 15 s Tito saw.
+
+### 2.3 What each client gets during the gap
+
+| Where the request entered | Answer today |
+|---|---|
+| Another edge (another region, a region HA member, a fixed box) | **502 with no `Retry-After`** while the hub refuses (`internal/edge/backhaul_holder.go:298-316`; the alternative lookup finds no second claimant for a fleet name). Then whatever the hub answers. |
+| The hub's own listener (DNS straight to the hub's address) | connection refused |
+| The hub, after start, no tunnel yet | 503 `Retry-After: 2`, "fleet unreachable: no connected box" (`edge.go:4337-4340`) |
+| The hub, after start, copies not yet risen | 503 `Retry-After: 2`, "no healthy copy is available" |
+| The hub, admission closed | 503 `Retry-After: 10` |
+
+Nothing on the hub waits for a tunnel to come back, and nothing on a sending edge waits for the hub.
+
+W6 does not help fleet traffic. It withdraws the hub from the NLB so the NLB sends it no new flows (`internal/host/ingressdrain.go:137-167`), but hops from other edges dial the hub's own address and never read the health answer.
+
+## 3. Part 1: a hub restart that drops no fleet request
+
+### 3.1 Guarantee
+
+For a **planned** restart of the hub's edge (a roll, `carlos system apply` or `rollback`, a host.env change, an operator `systemctl restart`), a fleet request gets **no error and a pause of at most about 15 s, typically 3 to 5 s**, when:
+- the fleet box serving it stays connected before and after, and its copy was healthy before;
+- the request entered through another edge, or through the region's NLB with W6 armed on the hub, or through the hub's own listener with socket handoff (S4);
+- it is not already running on the hub when the old process exits. A request in flight through a tunnel at exit keeps today's rule: it gets the 10 s drain, then it is cut and never retried.
+
+An unplanned hub death is not covered by Part 1; it is Part 2's job.
+
+### 3.2 S1: fleet rows are exempt from tenant admission
+
+`fixedAdmission.exempt` (`internal/host/group_admission.go:100`) also returns true for a row the fleet arm serves: a forward row or a replica-set row (`FleetBoxes != ""`) that `FleetServeEligible` accepts on a hub. The activator's start refusal (`internal/activator/group_admission.go:15`) is unaffected, because the fleet arm never starts a local unit.
+
+Why it is safe: tenant admission protects lease acquisition, local wakes and placement on a box that has not finished its first reconcile. A fleet row has none of these. Its only readiness inputs are the routing map and the fleet credentials, both loaded before the listeners bind (`edge.go:4947,5314-5341`), and the tunnel, which S2 waits for. Group members never take the exemption (`a.group` stays authoritative), and a group member is never a hub (`HubArmed` needs `CARLOS_FLEET` unset and the box is fixed under H24).
+
+### 3.3 S2: the hub waits for a tunnel and a copy instead of refusing
+
+A **warm-up window** starts when the edge starts serving and lasts 60 s. In that window, a request the fleet arm would answer with "no connected box" or "no healthy copy" is **held** instead:
+- it waits for the event that would let it through: the fleet's channel registering (forward row) or the copy rising (replica-set row), or the bound;
+- the hub reads none of its body while it waits;
+- when the event comes it is served as normal; at the bound it gets today's answer.
+
+To shorten the replica wait, a copy whose channel registered in the warm-up window rises on its **first** passing probe instead of two. A fresh channel and a passing probe are both positive proof the copy answers now; the second probe guards against flapping, which a new process has no history of. Outside the window the rise stays at two.
+
+Bounds (builder may tune the values, not the shapes):
+
+| Bound | Value | When exceeded |
+|---|---|---|
+| Hold per request | 10 s | today's 503 `Retry-After: 2` |
+| Held per host | 64 | the new request gets today's answer |
+| Held per hub | 1,024 | the same |
+| Warm-up window | 60 s from first serve | no holds; today's behaviour |
+
+Holds are one place: a `fleetWarmHold` call in front of `fleetProxy` (`edge.go:4289`) and the replica transport's no-copy branch. Registration (`tunnel.go:326`) and the prober's rise signal a condition variable per fleet. A fleet box that is really gone costs a request at most 10 s once per restart, then today's answer.
+
+### 3.4 S3: a sending edge holds a request while the hub restarts
+
+On any edge, a backhaul whose dial to the destination fails **at connect** (refused, reset before the TLS handshake ends, or the 5 s dial timeout, `edge.go:4732-4745`) and for which `backhaulAlternative` finds no other claimant, is **held and re-dialled** instead of answered 502:
+- re-dial the same box after 250 ms, 500 ms, then every 1 s, for at most 15 s from the first failure;
+- the client's request body is not read while held (nothing was sent: the dial failed before any byte of the request left), so any method and any body may be held; this is not a replay and spends no forward attempt (`replay.go:34`, I4 unchanged);
+- each re-dial goes through the normal path: if the home map now names another claimant (Part 2), the hold ends and the request goes there;
+- at the bound, the answer is **503 `Retry-After: 5`** through `edge.Unavailable` with a new site name, `backhaul-unreachable`, instead of today's bare 502.
+
+This applies to every backhaul, not only to fleet names: any single-claimant name whose box refuses connections gets a pause of up to 15 s and then a retryable 503, where today it gets an instant bare 502. That is better for a dead fixed box's clients too, and it is how a non-hub fixed box's planned restart (leo) also stops costing hops.
+
+Bounds: 64 held per destination host, 1,024 per sending edge, 15 s per request. Over a bound, the request gets the new 503 at once. The backhaul suspect mark (`backhaul_retry.go:11`) is still set on the first failure. It only steers the choice among alternatives, so a held request re-dials its box whether or not it is suspect. The builder logs held counts per destination once per hold episode, not per request.
+
+### 3.5 S4: the hub's own listener survives the restart (socket handoff)
+
+S3 covers traffic from other edges, and W6 covers NLB traffic. A client whose DNS points straight at the hub's address (Tito today: no NLB) still meets a closed listener. S4 closes that:
+
+- A new unit, `carlos-edge.socket`, owns `:80` and `:443` (`ListenStream=`, `FileDescriptorName=http`/`https`, `Service=carlos-edge.service`). The edge takes its listeners from systemd (`LISTEN_FDS`, by name) when they are present and binds itself otherwise, so a box without the socket unit is unchanged.
+- During a restart the sockets stay open in systemd. New connections complete the TCP handshake in the kernel and wait in the accept queue, and the new process accepts them. Clients see a pause, not a refusal.
+- On SIGTERM the old process stops accepting and, before the 10 s in-flight wait, closes edge-held SSE streams at an event boundary (`closeAllHeld`, as W6 step 3 does), so a long stream no longer pins the wait at 10 s.
+- W6 still works: `CloseIngress` closes the process's own copy of the listener; systemd's stays open. A late NLB flow now queues for the new process instead of being refused.
+- PPv2 wraps the inherited listener the same way it wraps a bound one.
+
+**Rollback across S4 is the risk.** A binary below the S4 floor binds `:443` itself and fails while the socket unit holds it. So the socket unit is installed and enabled only by a root `apply` of a release at or above the floor, and `rollback` to a release below the floor first stops and disables the socket unit, then swaps the binary, in one root verb. The floor goes in `release` beside the other floors. The accept backlog is raised to 4,096 (`Backlog=`), so about 15 s of arrivals at a few hundred per second fit.
+
+S4 is the largest piece of Part 1 and only matters where clients reach the hub directly. It is listed separately in the estimate (§5) so Paul can take Part 1 without it; Tito would then put an NLB (#908's draft carlos-infrastructure #58) or the UK edge in front of fleet app names.
+
+### 3.6 Request budget
+
+No new store requests: S1 to S4 are memory and process changes. S3's re-dials go to the box, not to S3. Steady state per box per day with nothing changing: **0 additional requests.** A store-call counting test covers the hold paths (they must read nothing).
+
+### 3.7 Tests
+
+- S1: a fixed-admission hub before admission opens serves a forward row and a replica-set row; a group member still refuses; a hibernating ordinary tenant row on the hub still gets 503.
+- S2: a request arriving before the channel registers is served once it registers; one at the bound gets 503 `Retry-After: 2`; caps; no body read while held; the warm-up rise of one probe; outside the window two probes.
+- S3: refused dial then success within the bound serves the request once, POST included, body intact; a box that never comes back gives 503 `Retry-After: 5` at 15 s; a dial that connected and then failed is not held (today's rules); caps; a new claimant appearing mid-hold ends the hold there; the attempt counter is untouched.
+- S4: inherited listeners by name; fallback to binding; restart under load with an in-process fake systemd (pass fds to a child); rollback below the floor removes the socket unit first; `TestExecSandbox…` binary-size guard still passes.
+- `unavailable_guard_test.go` gains the two site names.
+
+### 3.8 Dev witness (after a release, in a booked window on #421)
+
+Probes from an in-region host, one address only (RELEASE-ROLL-CARD rule), at about 20 requests a second each, against a fleet app on dev (a replica-set app with two copies and a forward-row app):
+- **P1** through leo's edge (another edge, backhaul);
+- **P2** through the IE NLB (W6 armed on sophie);
+- **P3** straight at sophie's EIP (only with S4).
+
+Restart sophie's edge three times. Pass: 0 non-2xx, 0 timeouts, longest request under 15 s, median pause under 5 s, and every POST landed exactly once. Control run first on the old release to put a number on today's gap for each probe. Then Tito repeats P1 and P3 on staging before production.
+
+### 3.9 Floor and rollout
+
+S1 and S2 are hub-local: they act when the hub runs the release. S3 acts on each sending edge as it gets the release. Order: dev boxes, dev console, witness, flagship, Tito staging, Tito production (Tito rolls its own). No host.env changes, except S4's socket unit, which the root installs itself.
+
+## 4. Part 2: more than one hub per region
+
+### 4.1 The model
+
+A region has a **hub set**: two or more boxes, each a hub by today's definition (`CARLOS_TUNNEL_HOST` set, `CARLOS_FLEET` unset). Every fleet box keeps **one tunnel to every hub** in its home region. Every hub serves every fleet's forward and replica-set rows over its own tunnels, and publishes those names in its edges file. A sending edge picks any eligible hub and falls over to another on a connect failure, through the alternative lookup it already has.
+
+So no tunnel or route has a single owner to fail over. Losing a hub, planned or not, removes one of several equal paths.
+
+Rejected alternatives:
+- **One tunnel per box, failing over between hubs.** Which hub holds a box's tunnel would have to be published, and every sender would learn it late. The publication lag is the outage.
+- **Non-hub edges dialling fleet boxes directly.** Fleet boxes accept no inbound connections, by design (#53).
+- **Hubs behind the NLB for tunnels.** The NLB picks the target per flow, so a box cannot choose to reach each hub once.
+
+### 4.2 Which boxes are hubs
+
+v1: the hub set is the region's **fixed boxes with elastic IPs** that the operator names. On dev that is sophie and leo; for Tito, the IE home box plus one new small box in IE in another AZ. Group members are not hubs in v1: their public addresses are not stable, and a group member's edge restarts on every roll.
+
+A hub that is not the console's box must not run tenants: it serves fleet traffic and nothing else that needs a lease. It is set up with `CARLOS_POOLS=@none`, a new reserved token that serves no pool (`provision.ParseBoxPools`, `internal/provision/reconcile.go:3523`), so it adopts no tenant record in a flat or nested region. This works without region HA, so Tito's flat production can have two hubs before any HA migration.
+
+### 4.3 Fleet boxes reach every hub
+
+- The tunnel hostname resolves to the address of every hub. That record is operator DNS today (no code here writes it; `infra/remote-host.md:59-62`). The operator adds one A record per hub.
+- The box resolves the name on each dial pass and runs **one `tunnelclient.Loop` per address**, each with today's backoff and handshake bounds, TLS server name = the tunnel hostname. Every hub holds that certificate through the shared certificate mirror.
+- The hub's `101` answer adds `Carlos-Hub: <box ref>`. The box keys its loops by hub ref, so two addresses of one hub collapse to one tunnel, and a hub that moved address is not dialled twice.
+- The box re-resolves every 60 s while connected, so a hub added or removed in DNS is picked up within a minute plus the record's TTL. A loop whose address left DNS ends after its connection ends.
+- The box's status reports each hub's state; "connected" means at least one hub, "degraded" means some but not all.
+- **Capacity:** each hub enforces its upgrade cap (128 per channel) on its own tunnel, so a box may carry up to 128 upgrades per hub. The box's HTTP/2 stream limits apply per tunnel connection, unchanged.
+
+A fleet box below the Part 2 floor keeps one tunnel to whichever address DNS gave it. §4.6's hub-to-hub hop keeps it reachable from every hub.
+
+### 4.4 Every hub has the fleet state
+
+Today the fleet state a hub needs lives only in the console box's registry, written by the console (`internal/console/fleets.go:258`, `hostsused.go:386-435`, `managedhistory.go:111`):
+- the fleets table (name to owning account);
+- fleet boxes and the sha256 of each bearer token (`internal/registry/fleets.go`), which become `SetDynamicAuth`'s credential set;
+- replica assignments (the box set of each replica-set row).
+
+Forward rows themselves are already derived on the hub by its bindings pass from `fleets/<fleet>/` bindings (`internal/host/fleetbind.go`). Every hub runs that pass, since every hub is `HubArmed`.
+
+**The hub view.** The console publishes one object, `control/fleet-hub/view.json`, after every committed change to those three tables, under a new change-index scope (`release.ChangeScope`). It holds, per fleet: owner, the active boxes with label and token hash, and each replica host's assignment, plus a revision. Every hub that is not the console box folds it into its own registry: it is the only writer of those tables there. The console's box keeps reading its own tables, which are the source.
+
+- **Who may write it:** only the console. It is outside every fleet-writable prefix (`fleets/<fleet>/`), so no fleet box can write it through the store door (`internal/edge/storedoor.go:711,824`). A hub never reads fleet state from a fleet-writable key (the census rule).
+- **Token hashes in the store:** they are sha256 of 256-bit random tokens, which cannot be reversed. The plaintext never leaves the console's mint.
+- **Revocation** must not wait for a fold. When the console removes or rotates a fleet box's credential, it also sends a signed `/.carlos/fleet-revoke` hop (mesh key, bound to method, path, body and time, as `/.carlos/ha-take` is) to every hub in the edges view. A hub applies it at once (`TunnelHub.CloseChannel`) and records the revision, so a later fold of an older view cannot restore the credential. A hub that cannot be reached gets the revocation at its next fold, and the console logs the unreached hubs. A hub that has not completed a fold in 10 minutes refuses **new** registrations (existing tunnels stay) until it does; a stale hub then fails closed for new credentials rather than admitting a revoked one.
+- **Fresh hub:** it serves fleet rows only after its first fold succeeds. Until then it publishes no fleet names, so no sender picks it.
+
+### 4.5 Every hub publishes fleet names, and senders choose
+
+Each hub's edges file publishes the fleet names it serves, as the single hub does today. The name-authority resolution already accepts several claimants of one name with the same owner, class and target (`internal/edgesfile/nameauthority.go`, `homemap.go:1140-1146`: unstamped duplicates are normal), and `backhaulAlternative` (`backhaul_retry.go:54-93`) already picks another eligible claimant after a connect failure. Part 2 relies on both and adds:
+- hubs publish fleet names **unstamped**, like a static site, so two hubs never tie on a stamp;
+- among eligible hub claimants, a sender prefers a hub in its own region and AZ, then any hub, and spreads by rendezvous hash of the host over the eligible hubs, so one hub's restart moves only its share;
+- S3's hold (§3.4) is what covers the moment between a hub going away and the sender's home map noticing; with a second claimant the first re-dial already goes there.
+
+The builder confirms with a table test that two hubs' claims on one fleet name resolve to `NameDialable` with both eligible, and that withdrawing one hub's file leaves the other serving.
+
+### 4.6 A hub without the box's tunnel forwards once
+
+A request can reach hub B while the fleet box has no tunnel to B (B just started, the box is below the floor, or the box's tunnel to B is mid-reconnect). Then B sends it **once** to a peer hub over the ordinary signed backhaul, choosing a hub whose edges file lists the box's channel as connected (a new edges field, `fleet_channels`, the set of connected `<fleet>/<label>` names, refreshed on the edges file's normal cadence). Rules:
+- I4 holds: a hub never forwards a request it received as a hop, and this is the request's one forward;
+- the body is streamed, not copied; the forward is made only after B's own S2 hold (if in warm-up) ends without a channel;
+- if no peer lists the channel, today's 503 `Retry-After: 2`.
+
+### 4.7 Replica routing with several hubs
+
+Each hub runs its own replica prober over its own tunnels and its own round robin (`replicaprober.go`, `replicaproxy.go`). Copies see N times the probe traffic (one probe a second per copy per hub; tunnel traffic, no store requests). GET and HEAD retries stay within one hub. Placement and assignment stay the console's; hubs read the assignment from the hub view.
+
+### 4.8 The control doors fleet boxes use
+
+- **The store door** (`internal/edge/storedoor.go`) is served by any hub with its own role; it holds no state. A fleet box uses the hub its call happens to reach.
+- **The replica coordinator door** proxies to the console (`CARLOS_REPLICA_CONSOLE_ADDR=127.0.0.1:8090` on the console's box). A hub that is not the console's box sets it to the console box's private address (same region), so coordinator calls work from every hub. When the console is down, coordinator calls fail on every hub, as they do today; serving does not depend on them.
+- **Interactive sessions and other console doors** stay on the console's box.
+
+### 4.9 Planned and unplanned hub loss
+
+- **Planned restart of one hub:** Part 1 applies to it, and senders mostly do not notice: at the first refused dial the alternative is the other hub. Its tunnels end at exit, and fleet boxes keep serving through the others; each box re-dials the restarted hub with today's backoff.
+- **Hub death:** senders mark it suspect on the first connect failure and use the other hub for 60 s at a time (`backhaul_retry.go:11`); its edges file goes stale and it drops out of the claim set on the normal age rule. A hung hub (accepts, never answers) costs requests already sent to it up to the 30 s header timeout, as any hung box does today; that is not new.
+- **The console's box dies:** fleet apps keep serving through the other hubs. The control plane (deploys, scaling, the coordinator, revocations by fold) waits for the console. Console HA is region HA G6's pool console path, not this spec.
+
+### 4.10 What this gives #908
+
+| #908 ask | After Part 2 |
+|---|---|
+| 1. The console and the home box's apps on more than one box | **Not covered.** Console HA is G6. Home-box apps (Tito Go) stay single-box until the existing-host migration slice (region HA N-HA7). |
+| 2. Existing hosts and fleet traffic entering through any box | Fleet traffic: yes, through any edge and any hub, surviving one hub's loss. Existing placed hosts already enter through any edge by backhaul; their home box stays their single point. |
+| 3. Migration path for a flat home region | Part 2 needs no HA migration: add one fixed box with `CARLOS_POOLS=@none`, give it `CARLOS_TUNNEL_HOST`, add its A record. No moves or imports are refused while it runs. |
+| 4. DNS on the NLB | Unchanged guidance: hairpin redirect A21 covers a box reaching its own region's NLB. Part 2 does not need fleet app names on the NLB; any edge works. |
+
+### 4.11 Request budget
+
+Per hub that is not the console's box, steady state with nothing changing:
+- the hub view: one generation check rides the existing change-index read; one GET per change; the 30-minute backstop is 48 conditional GETs a day;
+- the bindings pass: as on today's hub, scoped by the change index (already budgeted under #336), so N hubs cost N times it.
+
+The console's publish is one PUT per committed change (fleet and box changes are rare). Probes and tunnels make no store requests. Total: about **50 requests per extra hub per day** idle. A store-call counting test pins the fold.
+
+### 4.12 Tests
+
+- Seeded simulation of two or three hubs and several fleet boxes under restarts, deaths, revocations and folds, with invariants: (H-1) no revoked credential is ever admitted after the console's revoke returned, unless that hub was unreached and is then refusing new registrations; (H-2) a request is forwarded at most once between hubs and at most twice overall; (H-3) with one hub down and one fleet box connected to the other, every request is served. Each has a mutation that must fail the sweep.
+- Tunnel client: one loop per resolved address, dedupe by `Carlos-Hub`, a removed address's loop ends, DNS changes within the re-resolve.
+- Edges: two hubs' unstamped claims resolve with both eligible; sender preference and spread.
+- Hub view: console-only writer, fold, stale-fold refusal of new registrations, revision ordering against a revoke hop.
+- `CARLOS_POOLS=@none` adopts no record.
+- Census card for the new key `control/fleet-hub/view.json` (writer: console; readers: hubs).
+
+### 4.13 Dev drill
+
+Add leo to dev's hub set. Probes as §3.8 P1 and P2. Pass:
+1. restart sophie's edge: 0 errors;
+2. restart leo's edge: 0 errors;
+3. stop sophie's EC2 instance (the console's box) under load: fleet apps serve through leo with 0 errors after at most one held pause; deploys wait; start it again;
+4. revoke a throwaway fleet box's credential while sophie is reachable: both hubs drop its tunnel within 2 s;
+5. a pre-floor fleet box (one tunnel) stays reachable through both hubs.
+
+### 4.14 Rollout and floor
+
+1. Release with Part 2 on every box; inert until a second hub exists.
+2. Fleet boxes at the floor (they then dial every address).
+3. Operator: the second hub box (fixed, EIP, `CARLOS_POOLS=@none`, `CARLOS_TUNNEL_HOST`, `CARLOS_REPLICA_CONSOLE_ADDR`), then the A record.
+4. Dev drill, then flagship, then Tito staging, then Tito production.
+
+## 5. Estimate
+
+Rough, build only, Opus implementing with Astra reviewing, after approval:
+
+| Piece | Work | Notes |
+|---|---|---|
+| Part 1 S1 admission exemption | ½ day | |
+| Part 1 S2 hub warm-up hold | 2 days | |
+| Part 1 S3 sender hold | 3 days | touches backhaul; §25/§7.5 boundary tests in CI |
+| Part 1 S4 socket handoff | 4 days | optional; root apply and rollback ordering |
+| Part 1 dev witness and release | 2 days | one booked dev window |
+| **Part 1 total** | **about 1½ weeks** (1 week without S4) | |
+| Part 2 hub view and revoke hop | 4 days | census card |
+| Part 2 multi-hub tunnel client | 3 days | |
+| Part 2 edges claims, sender choice, hub hop | 4 days | |
+| Part 2 `@none`, coordinator door, simulation | 3 days | |
+| Part 2 infra (second hub module, DNS) and drill | 3 days | operator repos |
+| **Part 2 total** | **about 3½ weeks** | |
+
+So Part 1 on dev about a week and a half after approval, Part 2 on dev about five weeks after approval. Both fit Tito's target of about two months before Classic and Pro cut over, with a margin of a few weeks for the release train and Tito's own rolls.
+
+## 6. Open questions for Paul
+
+1. **S4 (socket handoff): build it, or require fleet app names to enter through an NLB or another edge?** Recommendation: build it. Tito has no NLB today, and a planned restart then needs nothing from the client's path.
+2. **S3 applies to every backhaul, not only fleet names.** A dead single-home box's clients then wait up to 15 s and get a retryable 503, instead of an instant 502. Recommendation: yes, everywhere.
+3. **Part 2's hub set is fixed boxes with EIPs.** For Tito that is one more small always-on box in IE (about $15 to $30 a month for a t4g.small or medium). Recommendation: yes; group members as hubs later, if ever.
+4. **Order:** Part 1 first, then Part 2, as written? Recommendation: yes. Part 1 is small, helps single-hub regions forever, and Part 2 relies on S3.
+
+## 7. Review record
+
+Astra round 1: pending.