spec §25: cap held-request forward attempts at two
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 file changed,
+2
−2
docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md+2 −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 dd66bd074..4affa1908 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 |
| @@ -1108,7 +1108,7 @@ Everything else answers as today: a lost lease (F-A), `HAUnavailableResponse`, a |
| 2. on the departing box itself, its own release of the host (§25.3 step 5); |
| 3. a **fallback lock read.** If no notice has come 2 s after the first hold for the host, the box reads `lock.json` once for the host, coalesced (one read in flight per host, as `resolve` does today, `hacache.go:270-341`). It retries at 4 s and 8 s from the first hold. A release marker sends the held requests through the normal §6.2 decision: the box acquires and wakes the host itself, or forwards to the §6.3 choice. An unexpired lease of a box in view sends them there. A held lease of the departing box keeps them waiting. Any other answer gives today's response. |
| -A released request is forwarded at most once, to one box, and the receiver never forwards it again (§6.4). If that forward fails, the request gets today's answer for that failure. A held request is never held twice. |
| +A released request is forwarded at most once, to one box, and the receiver never forwards it again (§6.4). If that forward fails, the request gets today's answer for that failure. A held request is never held twice. With the refused first send, a held request makes at most two forward attempts, §6.5's limit; §6.5's own retry is not added on top (I4). |
| **Bounds.** The constants are the builder's to tune; the shapes are not. |
| @@ -1129,7 +1129,7 @@ The departing box applies the same bounds and stops holding at D - 10 s. |
| - **WebSockets and upgrades.** An upgrade that has not switched protocols may be held, since it has no body. An established WebSocket on A is cut at the step 3 bound, as today. The client's reconnect is held like any request. |
| - **Edge-held SSE streams (#432).** A marked held-stream request is held like a GET, and it never wakes a host. On release it is forwarded to the successor from memory. If the successor is not running the host, the successor holds the stream as #432 already does for a sleeping host. A's own held streams close when A's edge exits, and the browsers reconnect. |
| - **T6-b.** Today a marked request on a forwarding box with a cold holder cache gets `retry: 30000` (`forwardha.go:194-213`). During a handover, the released notice puts the successor in every peer's cache, so reconnecting streams find it from memory and do not get the retry. The general cold-cache case, a box that learned nothing, stays the open #432 follow-up. This section does not add a lock read on the held-stream path. |
| -- **Cross-region first boxes.** A box in another region that forwards to A (backhaul) is a first box too. It honours `X-Carlos-Handover: pending` and holds. It receives no notices (it is outside view(region)), and a foreign region's lock is never read (§6.1). So it releases by retrying: at 2, 4 and 8 s from the first hold, one hop through `backhaulTo` to a box of the region in its view other than A. That box answers as §6.4 says: it acquires from the marker and wakes, or serves, or refuses with a holder it names, which the first box tries once (§6.5). When the bound runs out, the answer is today's. |
| +- **Cross-region first boxes.** A box in another region that forwards to A (backhaul) is a first box too. It honours `X-Carlos-Handover: pending` and holds. It receives no notices (it is outside view(region)), and a foreign region's lock is never read (§6.1). So it releases once, 4 s after the first hold: one hop through `backhaulTo` to a box of the region in its view other than A. That box answers as §6.4 says: it serves, or acquires from the marker and wakes, or refuses. A refusal is relayed as today. A's release takes about 3 s (§9.9), so 4 s usually finds the marker. |
| **The header.** `X-Carlos-Handover` is honoured only on an answer to a hop this box sent over its verified transport (`forwardTransport`, TLS to the box's name). It is stripped from app responses at the tenant boundary, as `X-Carlos-Holder` is (`stripAppHolder`, `forwardha.go:118-128`). |