carlos / platform Public

spec: PROXY protocol v2 on the region HA NLBs (rev 1)

Client IP preservation off and PPv2 on, so a NATed client reusing a
source port through both NLB addresses can no longer collide at a target.
Edge trust rule, cutover states, tofu and witness. Draft for Astra R1.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 5eae4ea7569451db267f2a15541edece108e5107 parent ae1b8cc
2 files changed, +303 −0
  • docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md +248 −0
  • docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-ppv2.md +55 −0

CI passed — run details

diff --git a/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md b/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md
new file mode 100644
index 000000000..c6d59abaf
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md
@@ -0,0 +1,248 @@
+# PROXY protocol v2 on the region HA load balancers
+
+Design, 2026-11-12, **rev 1** (draft for Astra round 1). Agent manager 8a3d302 asked for it on 2026-11-12 with Paul's approval: client IP preservation off and PROXY protocol v2 on, on both target groups of each region NLB, before G6 opens the NLBs to customers. Design only; the build is a separate GO. Review budget: at most three Astra rounds (AGENTS.md stopping rules).
+
+Line citations are to `origin/main` at ae1b8cca. AWS facts quote "Edit target group attributes for your Network Load Balancer" (docs.aws.amazon.com/elasticloadbalancing/latest/network/edit-target-group-attributes.html, read 2026-11-12) unless another page is named.
+
+## 1. The finding
+
+On the v0.34.46 flagship roll (2026-11-11), four requests through the US NLB died in the TCP connect: the SYN was never answered for 30 s, and no edge saw the connection (`~/.cache/lost-post/REPORT.md`). The best fit is a limit AWS documents ("Intermittent TCP connection establishment failure", NLB troubleshooting page): with client IP preservation on and cross-zone on, one client IP and source port can reach the same target through two NLB addresses, and the target sees one 4-tuple for two connections. A NAT that keeps source ports (docs-t1's, many office routers, some carrier NATs) makes this happen to ordinary clients. The user sees a connect that hangs 20 to 30 s.
+
+The 2026-11-12 drain experiment (`~/.cache/drain-syn/REPORT.md`) cleared the W6 drain and the NLB's handling of target changes, and left this limit as the open issue. It found PAWS counters on every target (PAWSEstab 10,716 on leo, 97,318 on sophie), which is what colliding 4-tuples produce.
+
+AWS lists four mitigations: more targets (lowers the odds), clients changing ports (not ours to change), cross-zone off, or client IP preservation off with the client address read from PROXY protocol v2. Cross-zone off is ruled out: the group spec needs it (2026-10-15 §A1-1; `group.tf` refuses an NLB without it) and US 1a has one target.
+
+Today on both NLBs (read 2026-11-12, `~/.cache/ppv2/aws/`):
+
+| | dev IE (`carlos-dev-ie-nlb`) | flagship US (`carlos-flagship-us-nlb`) |
+|---|---|---|
+| Targets in both TGs | leo, sophie (fixed), 2 members | adi (fixed), 2 members |
+| Node private addresses | 172.31.29.110 (1a), 172.31.11.189 (1c) | 172.31.3.3 (1a), 172.31.17.119 (1c) |
+| `preserve_client_ip` / `proxy_protocol_v2` | true / false on both TGs | true / false on both TGs |
+| Health checks | HTTP :80 `/.carlos/lb-health`, both TGs | same |
+| Peak new flows, 14 days | 1,203 a minute, NLB-wide | 198 a minute |
+
+## 2. What changes, in one paragraph
+
+Each target group stops preserving the client address and sends a PROXY protocol v2 header instead. The target then sees every NLB connection coming from one of the NLB's own private addresses, on a source port the NLB chose, so two client connections can never share a 4-tuple at the target. The edge learns the client address from the header. It reads a header only on connections whose socket peer is one of its region NLB's private addresses, listed in a new host-env key; it rewrites the connection's remote address to the header's source before net/http sees it, so every reader of `r.RemoteAddr` downstream (rate limits, protection, geo, records, analytics, `X-Forwarded-For`) sees the client exactly as today, with no change of its own. A header from any other peer is consumed and ignored. The cutover flips one attribute on one target group per step, in an order where every target handles every new connection correctly at every moment, and each step reverses on its own.
+
+## 3. Guarantee
+
+**Fixed:** with preservation off, two client connections through the NLB never share a 4-tuple at a target: the NLB allocates the source address and port toward each target, so the documented collision cannot happen. Hairpin connections through the NLB work too (AWS: "you can also prevent this type of connection error by disabling client IP preservation"), which removes the A21 limit (region HA spec 2026-10-26 §12.4).
+
+**Kept:** every request that reaches an edge through the NLB carries the same client address in `r.RemoteAddr` as it does today, for every TG state the cutover passes through (§6.2). Requests that do not come through the NLB (fixed boxes' own EIPs, cross-region backhaul to a member's public address, hop-signed forwards between boxes, the door, hairpin, tunnels) are unchanged byte for byte, except that the edge on an armed box reads their first bytes before net/http does (§4.3).
+
+**Zero downtime is the target and is measured** (§10), as in W6. AWS states that preservation changes "take effect only for new TCP connections"; it states nothing for the PROXY protocol attribute, so the design does not depend on it (§6.2 covers both old and new behaviour for every connection), and the dev witness records it.
+
+**Not covered:**
+- A target running an edge older than the release that carries this (call it vN) while its TG has PROXY protocol on. It answers the header with 400 or a TLS error, fails its health checks and leaves the target group. That is one lost target, not an outage, unless every target is old, when the NLB fails open to all of them. Refused by procedure, not code: §7.3.
+- Real client addresses inside the NLB's own TCP layer (NLB logs, flow logs): unchanged, off.
+
+## 4. Edge parsing
+
+### 4.1 Which listeners
+
+The public `:80` and `:443` listeners bound in `Serve` (`internal/edge/edge.go:5295-5310`), on a box whose host.env carries `CARLOS_INGRESS_PROXY_SOURCES` (§4.2). Both, because both TGs flip and both TGs' health checks land on `:80` (`HealthCheckPort 80` on the `:443` TG today). The dev-mode single listener (`edge.go:5124-5139`), the door, the backhaul port, devbox listeners and the relay are never wrapped.
+
+A box without the key runs exactly today's listeners: no wrapper, no peek. That keeps every box that is not an NLB target (annie, Tito's boxes, self-hosters) out of the change, and it is the dormancy switch.
+
+The wrapper goes outermost, after `ConfigureGroupHairpin` (`edge.go:5303-5310`), so that `hairpinListener.Accept` (`internal/edge/hairpin.go:66-82`) still classifies the raw socket and never blocks on a header. `hairpinConnContext` (`hairpin.go:84-92`) unwraps the new connection type before its type assertion (one `NetConn()`-style accessor, the same shape as `tls.Conn.NetConn`), and a test pins that a hairpin connection through the wrapped listener keeps its normalisation (`normalizeHairpin`, `hairpin.go:93-110`).
+
+### 4.2 The trust rule
+
+`CARLOS_INGRESS_PROXY_SOURCES` is a comma-separated list of 1 to 16 IPv4 addresses: the region NLB's node private addresses, one per enabled zone (two today). It is a new `Optional` host-env key (`internal/hostenv/hostenv.go:75`), validated at write and seed like `CARLOS_INGRESS_TARGET_GROUPS` (`hostenv.go:255-282`): each entry a private (RFC 1918) IPv4 address, no duplicates. The edge reads it once at start; a change takes an edge restart (drained on fixed boxes by W6, on members by the group roll).
+
+A connection is **trusted** when its socket peer address (the kernel's, before any rewrite) is in the list. Nothing else makes it trusted: not the destination, not a header, not the VPC CIDR. The VPC CIDR is not enough because target security groups admit 443 from the VPC (`infra/modules/region-host/group.tf:150-156`) and tenant code runs on boxes in that VPC; a tenant could otherwise send a header from a box's private address and choose its client address, which reaches other tenants' apps as `X-Forwarded-For`. VPC source/destination checks stop a box sending from an NLB node's address.
+
+Where the addresses come from: tofu reads the NLB's network interfaces (`description = "ELB net/<name>/<id>"`) and outputs their private addresses (§8.1). They are fixed for the NLB's life and change only if a zone is added to the NLB; §4.5's private-source counter catches a list that is out of date.
+
+### 4.3 Reading the header
+
+The wrapper's `Accept` returns at once; nothing is read on the accept goroutine. Reading happens on the connection's own goroutine, at the first of `Read` or `RemoteAddr`. net/http calls `RemoteAddr` first thing in `conn.serve` (`$GOROOT/src/net/http/server.go:1908`, Go 1.26.10), before any deadline or read of its own, and `tls.Conn.RemoteAddr` delegates to the wrapped connection (`crypto/tls/conn.go:136`), so the address is settled before net/http or TLS read a byte. `ConnContext` hooks (hairpin, `connDrain.serve` at `internal/edge/hadrainconns.go:152-165`) and `ConnState` hooks run on the accept goroutine and must not call `RemoteAddr`; a test pins that the accept loop never blocks on a silent trusted connection.
+
+Untrusted connection: `RemoteAddr` answers the socket peer at once. On the first `Read`, the wrapper reads up to 12 bytes, stopping at the first byte that differs from the PPv2 signature (`\r\n\r\n\0\r\nQUIT\n`). HTTP and TLS both differ at byte 0, so this is one read. A mismatch replays the bytes read to the caller. A full signature means a header: §4.4.
+
+Trusted connection: the first `RemoteAddr` or `Read` reads the same way, under a read deadline of 10 s from accept (the listeners' `ReadHeaderTimeout`, `internal/edge/ingressdrain.go:92-93`), then clears that deadline. The design does not depend on whether the NLB sends the header at connect or with the client's first bytes ("prepends a proxy protocol header to the TCP data"). A timeout closes the connection.
+
+v1 (text) headers are never parsed: the NLB sends only v2. A client that sends `PROXY TCP4 ...` gets today's 400.
+
+### 4.4 What each header does
+
+| Peer | First bytes | Result |
+|---|---|---|
+| trusted | PPv2, command PROXY, family INET or INET6, a usable source (below) | remote address = header source address and port |
+| trusted | PPv2, command LOCAL, or PROXY with family UNSPEC | remote address = socket peer, request marked **client unknown** (§4.6). AWS health checks carry this: "the client connection information is not sent" |
+| trusted | no PPv2 signature | remote address = socket peer, **client unknown**. Health checks before the flip, and §6.2's states S0 and S1 never produce this for data; it exists for a rollback done out of order |
+| trusted | PPv2, malformed or over the limits | connection closed |
+| untrusted | PPv2, well formed | header consumed and ignored; remote address = socket peer. Needed in S1 (§6.2), where the peer is the client itself |
+| untrusted | PPv2, malformed | connection closed |
+| untrusted | anything else | unchanged |
+
+Limits and checks: version nibble 2; command LOCAL or PROXY; family and protocol INET/STREAM, INET6/STREAM or UNSPEC; the declared length at least the address block (12 bytes for INET, 36 for INET6) and at most 512 bytes in total, TLVs included. TLVs are skipped unread (AWS sends `PP2_TYPE_AWS` 0xEA only for PrivateLink). A usable source is a unicast address that is not loopback, unspecified, link-local or multicast; anything else closes the connection (a real NLB cannot send it). Exactly one header is consumed. AWS: the NLB "does not discard or overwrite ... any incoming proxy protocol headers sent by the client", so a client's own header after the NLB's reaches net/http as payload and fails as today.
+
+The header's destination address and port are not used.
+
+### 4.5 Counters
+
+Per listener, since start: `proxied` (trusted, PROXY), `local` (trusted, LOCAL or UNSPEC), `absent` (trusted, no header), `ignored` (untrusted header consumed), `ignored_private` (untrusted header from a private address: almost certainly an NLB node missing from the key), `malformed`, `timeout`. One journal line at start (`edge: proxy protocol: armed on :80 and :443, trusting 172.31.29.110,172.31.11.189`), and one throttled line every 5 minutes when a counter moved, naming them. `ignored_private` above zero also logs once at warning level with the peer address. The cutover reads these lines over SSM (§6.3); no new metric or alarm in the edge.
+
+### 4.6 Client unknown
+
+A trusted connection without a client address (LOCAL, UNSPEC, no header) has the NLB node as its socket peer. Keying limits on it would put every client behind that node in one bucket. So `clientIP(r)` (`internal/edge/analytics.go:100-115`) answers "" for such a request, from a context mark set by the wrapper's `ConnContext`, and each reader already handles "no address":
+- `ratelimit.ClientKey("")` is not ok, so the rate limit (`internal/edge/ratelimit.go:133-136`), the probe-burst cooling and note (`internal/edge/guard.go:161`, `:316`) and backhaul fair share (`edge.go:4561`) skip, as they do for a request with no parseable address;
+- geo answers off (`internal/edge/geoipheaders.go:41`, `net.ParseIP("")` is nil);
+- request records and analytics carry no client (`reqrecords.go:46`, `analytics.go:154`);
+- the gate's attempt limiter (`internal/gate/gate.go:260-268`) keys on `r.RemoteAddr`, the NLB node: stricter, never looser, and this case is transitional only.
+`r.RemoteAddr` itself stays the NLB node's address, so `X-Forwarded-For` to the app says what the edge saw.
+
+This fails open on per-client limits only for connections from the NLB's own addresses, which no client can originate.
+
+## 5. Client IP everywhere it is used
+
+Every reader derives the client from `r.RemoteAddr`, directly or through `clientIP(r)`; none reads the socket. The wrapper changes the connection's `RemoteAddr`, net/http copies it into `r.RemoteAddr` (`server.go:1908`, and `:2152`/`:4002` for HTTP/2), so no reader changes.
+
+| Reader | Where | With PPv2 |
+|---|---|---|
+| Per-client rate limit | `ratelimit.go:133` | client, as today |
+| Protection tiers: probe-burst cooling and trip | `guard.go:161`, `:316` | client |
+| Backhaul fair share | `edge.go:4554-4561` | client |
+| Geo headers | `geoipheaders.go:41` | client; door, hop and tunnel branches unchanged |
+| Request records | `reqrecords.go:46` | client |
+| Analytics visitor hash | `analytics.go:100-115`, `:154` | client |
+| `X-Forwarded-For` and its proof to apps and holders | `homemap.go:1684-1718` (`SetXForwarded` reads `r.RemoteAddr`), `forwardproof.go:44` | client, signed as today |
+| Gate attempt limiter | `gate.go:260-268` | client |
+| Journal lines naming a peer | `burst_notice.go:603`, `hadrain.go:282`, net/http's TLS handshake error (`server.go:1953`) | client |
+| Asset catch record | `assetcatch.go:676` | client |
+| Hairpin normalisation | `hairpin.go:93-110` | unchanged (hairpin peers are never trusted) |
+| Door, devbox front, tunnel hub log | `door.go:126`, `devboxfront.go:44`, `tunnel.go:329` | not on a wrapped path, or not via the NLB |
+| Console readers (`authcli.go:574`, `cliplace.go`, `demo_api_origin.go:38`, `stepup.go:499`) | console on annie | annie is not an NLB target; they read what the local edge forwards |
+
+Hop-verified requests between boxes keep taking the client from the signed `X-Forwarded-For` (`analytics.go:101-108`); the sending edge now fills it from the header-derived address.
+
+## 6. Cutover
+
+### 6.1 Prerequisites, per NLB
+
+1. vN (the release carrying §4 and §8.1) runs on **every** target in both TGs: fixed boxes rolled, members replaced through the group roll onto a launch template naming vN.
+2. `CARLOS_INGRESS_PROXY_SOURCES` equals the module output (§8.1) and is in effect on every target: in the region's host-env parameters before the member roll (members write host.env only at launch, `hostenv.go:144-150`), and in each fixed box's host.env on its card, as W6 delivered `CARLOS_INGRESS_TARGET_GROUPS`. Each target's journal shows the §4.5 armed line with exactly the module's addresses.
+3. The group module is at vN, whose precondition accepts the new states (§8.2). A group plan with the old module would refuse once the TGs change.
+
+Arming changes nothing on the wire: until step 1 below, no connection carries a header and trusted peers are only health checks, which get client unknown on a path (`lbHealthAnswer`, `internal/edge/lbhealth.go:34-48`) that reads no client address.
+
+### 6.2 States and steps
+
+Two attributes per TG, four combinations. The order below visits only S0, S1 and S2; S3 is refused.
+
+| State | preserve | PPv2 | Socket peer at target | Header | Edge result |
+|---|---|---|---|---|---|
+| S0 today | on | off | client | none | untrusted, unchanged |
+| S1 | on | on | client | NLB's, source = client | untrusted, header ignored, peer = client: same address |
+| S2 target | off | on | NLB node | NLB's | trusted, header source = client |
+| S3 refused | off | off | NLB node | none | trusted, client unknown: limits off for everyone |
+
+In S1 the edge must ignore, not trust, the header, because the peer is the client and is not in the list; §4.4 does that. Within one attribute change, nodes and connections can be on either side for a while (new connections only, per AWS for preservation; assumed for PPv2). Each step changes one attribute on one TG, so every new connection is in one of two adjacent states, and every target handles both.
+
+Steps, per NLB, each a targeted tofu apply of one resource attribute (0 add / 1 change / 0 destroy):
+1. **A80:** PPv2 on, `:80` TG. Watch 5 min.
+2. **A443:** PPv2 on, `:443` TG. Watch 10 min. Both TGs in S1.
+3. **B80:** preservation off, `:80` TG. Watch 5 min.
+4. **B443:** preservation off, `:443` TG. Watch 30 min. Both TGs in S2.
+
+`:80` goes first in each pair because it carries only ACME challenges, redirects and health checks.
+
+**Watches after each step** (abort rule: any one fails twice in a row, roll back that step):
+- every target healthy in both TGs (`describe-target-health` every 10 s);
+- the probe (§10) shows no error and no connect over 900 ms that its reference checks do not explain;
+- §4.5 counters on every target: `malformed`, `timeout`, `ignored_private` stay 0; after A80/A443, `ignored` rises (S1); after B80/B443, `proxied` rises and `absent` stays 0 on data traffic (health checks show as `local`);
+- the echo check (§10) shows the probe's public address, never 172.31.x.
+
+### 6.3 Rollback
+
+Reverse order, one attribute per apply: B443, B80, A443, A80. Each reverse step lands in a state the previous paragraph already covers. Two reversals in one apply could pass through S3 for a while on some nodes; that is refused on the card, and §4.6 bounds it (limits off for those connections, nothing refused) if it happens anyway.
+
+In an abort, the operator may run the same single-attribute change with `aws elbv2 modify-target-group-attributes` (seconds) and reconcile tofu afterwards with a plan that shows no change. Open question 3.
+
+Edge rollback: an edge older than vN may run on a target only while both its TGs have PPv2 off. The roll card's rollback section says so, and the group re-pin card checks the TG attributes before naming a launch template older than vN.
+
+### 6.4 Order across NLBs
+
+Dev IE first, in a dev #421 window after vN is on dev. Flagship US after the dev witness passes every row, in a flagship window with the lock posted on #421 (region HA live window rules), before G6 opens the US NLB to customers. Not in the same window as a release roll or a group roll.
+
+## 7. Interactions
+
+### 7.1 Fixed boxes in the target groups and W6
+
+leo, sophie and adi carry NLB traffic and their own EIP traffic on the same listeners. NLB connections come from the node addresses (trusted); EIP connections come from clients (untrusted, unchanged). W6's drain reads TG health and fails `/.carlos/lb-health` on purpose (`lbhealth.go:34-48`); health checks reach that handler with or without a LOCAL header, so the drain is unchanged. The W6 witness rows (drained restarts with 0 errors) rerun in S2 (§10).
+
+### 7.2 Health checks
+
+Both TGs check `:80` `/.carlos/lb-health`. After A80 or A443, that TG's checks carry a LOCAL header, from trusted peers. After A80 and before A443, `:80` sees both kinds at once, per connection. Admission gating (`lbhealth.go:38-46`) is unchanged.
+
+### 7.3 Mixed versions
+
+Before A80, any mix of versions and keys is fine. From A80 on, every target in that TG must be armed. Members launched while PPv2 is on must come from a launch template naming vN or later with the key in the region's parameters; a member that cannot parse fails ELB health, so the group's ELB health check replaces it with another from the same template, a loop the HA capacity alarms already report. That is why §6.3 puts the check on the re-pin card rather than relying on the loop.
+
+### 7.4 Hairpin (A21)
+
+Members redirect their own traffic to the NLB addresses to the local edge (§12.4, `hairpin.go`). That stays: it is correct in every state, and it saves a round trip. With preservation off, hairpin through the NLB would work, so the redirect becomes optional; retiring it is a separate simplification, not part of this change.
+
+### 7.5 Capacity
+
+AWS: with preservation off, about 55,000 connections a minute to each target IP and port. Peak is 1,203 new flows a minute NLB-wide on dev and 198 on the flagship (14 days to 2026-11-12). The NLB alarms gain `PortAllocationErrorCount` (§8.1).
+
+### 7.6 Security groups
+
+Unchanged. Targets already admit 80 and 443 from the NLB's security group (`group.tf:134-143`); the NLB's egress already covers the VPC CIDRs on both ports (`ingress/main.tf:51-62`). Health checks already come from the node addresses.
+
+## 8. Tofu
+
+### 8.1 This repo, `infra/modules/region-host/ingress` (rides vN)
+
+- `aws_lb_target_group.target` (`ingress/main.tf:97-126`): `preserve_client_ip = var.preserve_client_ip` (default `true`) and `proxy_protocol_v2 = var.proxy_protocol_v2` (default `false`), each a map by port (`{ "80" = ..., "443" = ... }`) so a root can flip one TG at a time. Defaults keep today's state, so re-pinning to vN plans 0/0/0. A validation refuses any port with preservation off and PPv2 off (S3).
+- Output `proxy_protocol_sources`: the node private addresses, sorted, from `data "aws_network_interfaces"` filtered on `description = "ELB ${aws_lb.nlb.arn_suffix}"`, with a precondition that the count equals the number of zones.
+- Alarm on `PortAllocationErrorCount` Sum > 0 over 5 minutes, beside the module's existing alarms (`ingress/alarms.tf`), on the module's topic.
+- The dev root (pinfra `dev/region-ha-ingress.tf`) and flagship root (carloku-infrastructure `region-ha-us.tf`) use this module; both get the four step values as root locals.
+
+### 8.2 This repo, `infra/modules/region-host/group.tf` (rides vN)
+
+The existing-target-group precondition (`group.tf:182-187`) requires `preserve_client_ip == "true"`. It changes to accept S0, S1 and S2 and refuse S3 per TG: `tg.preserve_client_ip == "true" || tg.proxy_protocol_v2`. The error message names both attributes. Other checks stay.
+
+### 8.3 Roots
+
+- **dev, platform-infrastructure:** re-pin `dev/region-ha-ingress.tf` and `dev/region-ha-group.tf` to vN (planned 0/0/0 apart from the new alarm, 1/0/0); write `CARLOS_INGRESS_PROXY_SOURCES` into `/carlos/dev/ie/` and into leo's and sophie's host.env on the roll card; then the four steps, one targeted apply each.
+- **flagship, carloku-infrastructure:** push vN to the GitHub mirror, bump `?ref=` on `region-ha-us.tf` and `region-ha-us-group.tf`, same sequence with adi.
+
+First-of-kind applies need 8a3d302's GO; later NLBs' identical steps fall under the standing approval for counted applies when the plan matches the card exactly.
+
+## 9. Tests
+
+- `internal/proxyproto` (new, about 200 lines, no dependency): table tests for every row of §4.4 and every limit; byte-at-a-time and split reads; a 12-byte prefix that diverges at each position; timeout; exactly one header consumed; a v1 header passed through.
+- Listener: a real `http.Server` behind the wrapper, plain and TLS (HTTP/1.1 and HTTP/2), with a trusted and an untrusted dialler (loopback aliases or a test hook supplying the peer), asserting `r.RemoteAddr`; a silent trusted connection does not delay a second connection's accept; `ConnContext` and `ConnState` hooks never block.
+- Production wiring (house rule, production-wired witnesses): the listener stack built the way `Serve` builds it, `publicServers` plus `ConfigureGroupHairpin` plus the wrapper, with a header-carrying request reaching the rate limiter and `X-Forwarded-For` with the header's address, and a hairpin connection keeping its normalisation.
+- Client unknown: a LOCAL request skips the rate limit and burst, gets no geo, and forwards `X-Forwarded-For` with the node address.
+- hostenv: the key's validation (private IPv4, 1-16, no duplicates).
+- Tofu: `ingress` tests for the defaults (S0), each step map, the S3 refusal and the output; `group.tf` test for the precondition in all four states.
+- `go vet` and cross-builds (darwin, windows) for the new package.
+
+## 10. Witness
+
+**Probe:** in-region, as the drain experiment recommends: a throwaway t4g.nano (or the root runner) in the NLB's VPC public subnet, dialling one NLB public address at 3 requests a second, recording source port and connect time per request, with docs-t1 reference checks if run from there instead. **Echo:** an app on the HA pool that returns the `X-Forwarded-For` it received (the plan names it; a 20-line app if none exists).
+
+Dev rows, all in one window:
+1. Prerequisites (§6.1) shown from command output: versions, armed lines, key equals module output.
+2. Each step A80 to B443 with its watches; record when `ignored` and `proxied` start moving relative to the apply, which measures propagation.
+3. In S2: the echo shows the probe's public address; a rate-limit burst from the probe is limited and a second address is not.
+4. In S2: 4 W6 drained restarts (2 leo, 2 sophie) under the probe, 0 errors.
+5. In S2: one group roll replacing a member, under the probe, 0 errors, the new member armed.
+6. In S2: from a member, `curl` an NLB public address with the hairpin redirect on (unchanged path) and one request through the NLB from a host outside the hairpin set, both 200.
+7. **Collision row:** from one host, 200 pairs of connections with the same source port to both NLB addresses (the lost-post repro), in S0 and then S2. In S2, target-side `ss` shows the pairs as distinct 4-tuples from the node addresses. S0 is expected to pass too (the repro never failed); the row shows the mechanism, not a before and after.
+8. Rollback drill: B443 to A80 in reverse with the watches, then forward again.
+
+Flagship rows: 1, 2, 3 (echo only), 4 (2 adi restarts), 7 in S2 only.
+
+## 11. Open questions for Paul
+
+1. **Client unknown (§4.6).** A trusted connection without a client address skips per-client limits rather than being refused. Refusing would break health checks before the flip. Recommend as written.
+2. **Hairpin redirect (§7.4).** Keep it now and retire it later as its own change. Recommend keep.
+3. **Fast rollback (§6.3).** Allow the direct `aws elbv2` single-attribute change in an abort, reconciled by a no-change tofu plan after. Recommend yes.
+4. **When.** Build after this is approved; dev window on the first dev roll after vN; flagship before G6. Switch-on date for the dormant code is that dev window.
diff --git a/docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-ppv2.md b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-ppv2.md
new file mode 100644
index 000000000..a8859aa77
--- /dev/null
+++ b/docs/superpowers/specs/CODEX-REVIEW-BRIEF-edge-ppv2.md
@@ -0,0 +1,55 @@
+# Review brief: PROXY protocol v2 on the region HA NLBs (spec), round 1 of 3
+
+Repo carlos/platform, branch `design-edge-ppv2`, the commit named in your prompt.
+Under review: `docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md`.
+Authorities (merged on main): `docs/superpowers/specs/2026-10-26-region-ha-without-claims-design.md` (§12),
+`docs/superpowers/specs/2026-10-15-region-ha-two-box-regions-design.md`,
+`docs/superpowers/specs/2026-11-10-fixed-edge-ingress-drain-design.md` (W6). Code at `origin/main` ae1b8cca.
+
+You are an independent reviewer. Read the document, then the code it names, and check every claim against that code.
+Background evidence (read only if useful): `~/.cache/lost-post/REPORT.md`, `~/.cache/drain-syn/REPORT.md`,
+live NLB attributes in `~/.cache/ppv2/aws/`.
+
+## Fixed: do not re-argue
+
+- Paul approved the direction: client IP preservation off plus PROXY protocol v2 on both TGs of each region NLB,
+ edge parses on :80 and :443 trusting only the NLB's private addresses. Cross-zone off is NOT an option.
+- Design only; no infra change is part of this review.
+
+## What to check
+
+1. The trust rule (§4.2): can any party other than the NLB get a header trusted? Tenants on boxes in the VPC,
+ cross-region backhaul to members' public 443, fixed boxes' EIPs, hairpin, health checks.
+2. The cutover states (§6.2): is every new connection handled correctly in S0, S1 and S2 and across each
+ single-attribute step, including propagation where nodes disagree? Is S3 really unreachable or bounded?
+ Is the S1 "ignore untrusted header" rule safe?
+3. Blocking (§4.3): does anything on net/http's accept goroutine (ConnContext, ConnState, hairpin Accept,
+ connDrain) call RemoteAddr or Read on a wrapped connection? Check Go 1.26 net/http and crypto/tls.
+ Interaction with Server.Shutdown / W6 CloseIngress for connections still reading a header.
+4. §5: is any client-address reader missing, or one that reads the socket rather than r.RemoteAddr?
+5. §4.6 client unknown: does every reader really treat "" as no address, and is fail-open acceptable as bounded?
+6. Tofu (§8): attribute names and in-place updates in the AWS provider; the group.tf precondition change;
+ the ENI data source; ordering against the pinned module refs in the two roots.
+7. Host-env delivery (§6.1): do members and fixed boxes really get the key the way the spec says?
+8. Witness (§10): does it prove the fix and the zero-downtime claim as far as the spec claims?
+
+## Severity
+
+- **P1**: unsafe, would not compile, a test fails, or it would not work. Blocks merge.
+- **P2**: wrong or missing. Fixed without reopening this review.
+- **P3**: clarity or polish. Goes on a follow-up list; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section, the problem, the evidence (file:line, verified), the failure
+scenario, a concrete fix and the invariant or trust boundary it breaks (its fault family). End with exactly one
+verdict:
+
+- **READY**: no P1 and no P2.
+- **READY AFTER FIXES**: no P1. The listed P2s are fixed without another round.
+- **NOT READY**: one or more P1s, listed.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test
+suites. Do not make any AWS call that changes anything.