carlos / platform Public

edge: PROXY protocol v2 from the region NLBs, dormant until armed

The edge reads PPv2 only from its region NLB's node addresses
(CARLOS_INGRESS_PROXY_SOURCES), so client IP preservation can go off on
the HA target groups without losing client addresses. Adds the trust
barrier and alarm, an activation guard against binaries without
ingress-proxy-v2, tofu inputs, and the one-way cutover gate and probe.
Spec 2026-11-12-edge-proxy-protocol-design.md rev 5.1; plan beside it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Squashed from edge-ppv2 into main.
claude agent, operated by paul@keymail.dev 9d732008f56d03caba0de960dff9a82756ea6fec parent ab4d773
67 files changed, +12,106 −98
  • commands.go +26 −4
  • commands_test.go +36 −0
  • docs/parity.md +1 −1
  • docs/region-ha-runbook.md +133 −0
  • docs/superpowers/notes/census-claims-edge-ppv2.tsv +35 −0
  • docs/superpowers/notes/census-proposal-edge-ppv2.md +62 −0
  • docs/superpowers/plans/2026-11-12-edge-proxy-protocol.md +294 −0
  • docs/superpowers/plans/ASTRA-FINDINGS-edge-ppv2-plan-R1.md +61 −0
  • docs/superpowers/plans/CODEX-REVIEW-BRIEF-edge-ppv2-plan.md +54 −0
  • docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md +19 −10
  • infra/modules/region-host/group.tf +2 −2
  • infra/modules/region-host/ingress/alarms.tf +50 −0
  • infra/modules/region-host/ingress/main.tf +24 −1
  • infra/modules/region-host/ingress/outputs.tf +4 −0
  • infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl +206 −0
  • infra/modules/region-host/ingress/variables.tf +52 −0
  • infra/modules/region-host/tests/group.tftest.hcl +50 −0
  • internal/edge/edge.go +20 −0
  • internal/edge/hairpin.go +23 −8
  • internal/edge/ingressdrain.go +4 −1
  • internal/edge/proxyingress.go +443 −0
  • internal/edge/proxyingress_seam.go +12 −0
  • internal/edge/proxyingress_test.go +1,135 −0
  • internal/host/agent.go +7 −5
  • internal/host/edgetrust.go +638 −0
  • internal/host/edgetrust_linux_test.go +172 −0
  • internal/host/edgetrust_test.go +555 −0
  • internal/host/edgetrust_wiring_test.go +136 −0
  • internal/host/execsandboxfloor_test.go +3 −2
  • internal/host/group_maintenance.go +38 −0
  • internal/host/group_maintenance_prepare.go +9 −0
  • internal/host/guardexec.go +80 −27
  • internal/host/hadrain_call.go +16 −6
  • internal/host/hadrain_socket.go +19 −2
  • internal/host/installchannel.go +1 −1
  • internal/host/memwatch.go +71 −19
  • internal/host/proxyfeature.go +244 −0
  • internal/host/proxyfeature_linux_test.go +310 −0
  • internal/host/proxyfeature_test.go +632 −0
  • internal/host/rootmovesfloor_boot.go +19 −3
  • internal/host/systemapply.go +61 −4
  • internal/host/units/carlos-system-recover.service +8 −1
  • internal/hostenv/group.go +3 −0
  • internal/hostenv/hostenv.go +55 −0
  • internal/hostenv/hostenv_test.go +139 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-edge-ppv2.tsv +62 −0
  • internal/proxyproto/conn.go +357 −0
  • internal/proxyproto/counters.go +79 −0
  • internal/proxyproto/export_test.go +11 −0
  • internal/proxyproto/header.go +130 −0
  • internal/proxyproto/header_test.go +264 −0
  • internal/proxyproto/listener.go +159 −0
  • internal/proxyproto/listener_test.go +763 −0
  • internal/version/features.go +11 −0
  • parity/cli.tsv +4 −0
  • parity/parity.tsv +1 −1
  • scripts/ppv2-probe.py +333 −0
  • scripts/ppv2-step.py +1,689 −0
  • scripts/ppv2_probe_test.py +256 −0
  • scripts/ppv2_step_test.py +1,870 −0
  • scripts/testdata/ppv2/plan-a80.json +59 −0
  • scripts/testdata/ppv2/probe-responses.json +37 −0
  • scripts/testdata/ppv2/tofu-state-show-tg80.jsonl +2 −0
  • scripts/testdata/ppv2/trust-status.json +17 −0
  • system.go +25 −0
  • testdata/clireg-golden.jsonl +14 −0

CI passed — run details

commands.go

Loading diff…

commands_test.go

Loading diff…

docs/parity.md

Loading diff…

docs/region-ha-runbook.md

Loading diff…

docs/superpowers/notes/census-claims-edge-ppv2.tsv

Loading diff…

docs/superpowers/notes/census-proposal-edge-ppv2.md

Loading diff…

docs/superpowers/plans/2026-11-12-edge-proxy-protocol.md

Loading diff…

docs/superpowers/plans/ASTRA-FINDINGS-edge-ppv2-plan-R1.md

Loading diff…

docs/superpowers/plans/CODEX-REVIEW-BRIEF-edge-ppv2-plan.md

Loading diff…

docs/superpowers/specs/2026-11-12-edge-proxy-protocol-design.md

Loading diff…

infra/modules/region-host/group.tf

Loading diff…

infra/modules/region-host/ingress/alarms.tf

Loading diff…

infra/modules/region-host/ingress/main.tf

Loading diff…

infra/modules/region-host/ingress/outputs.tf

Loading diff…

infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl

Loading diff…

infra/modules/region-host/ingress/variables.tf

Loading diff…

infra/modules/region-host/tests/group.tftest.hcl

Loading diff…

internal/edge/edge.go

Loading diff…

internal/edge/hairpin.go

Loading diff…

internal/edge/ingressdrain.go

Loading diff…

internal/edge/proxyingress.go

Loading diff…

internal/edge/proxyingress_seam.go

Loading diff…

internal/edge/proxyingress_test.go

Loading diff…

internal/host/agent.go

Loading diff…

internal/host/edgetrust.go

Loading diff…

internal/host/edgetrust_linux_test.go

Loading diff…

internal/host/edgetrust_test.go

Loading diff…

internal/host/edgetrust_wiring_test.go

Loading diff…

internal/host/execsandboxfloor_test.go

Loading diff…

internal/host/group_maintenance.go

Loading diff…

internal/host/group_maintenance_prepare.go

Loading diff…

internal/host/guardexec.go

Loading diff…

internal/host/hadrain_call.go

Loading diff…

internal/host/hadrain_socket.go

Loading diff…

internal/host/installchannel.go

Loading diff…

internal/host/memwatch.go

Loading diff…

internal/host/proxyfeature.go

Loading diff…

internal/host/proxyfeature_linux_test.go

Loading diff…

internal/host/proxyfeature_test.go

Loading diff…

internal/host/rootmovesfloor_boot.go

Loading diff…

internal/host/systemapply.go

Loading diff…

internal/host/units/carlos-system-recover.service

Loading diff…

internal/hostenv/group.go

Loading diff…

internal/hostenv/hostenv.go

Loading diff…

internal/hostenv/hostenv_test.go

Loading diff…

internal/provision/testdata/plan14-root-reads-chain.tsv

Loading diff…

internal/provision/testdata/plan14-root-reads-edge-ppv2.tsv

Loading diff…

internal/proxyproto/conn.go

Loading diff…

internal/proxyproto/counters.go

Loading diff…

internal/proxyproto/export_test.go

Loading diff…

internal/proxyproto/header.go

Loading diff…

internal/proxyproto/header_test.go

Loading diff…

internal/proxyproto/listener.go

Loading diff…

internal/proxyproto/listener_test.go

Loading diff…

internal/version/features.go

Loading diff…

parity/cli.tsv

Loading diff…

parity/parity.tsv

Loading diff…

scripts/ppv2-probe.py

Loading diff…

scripts/ppv2-step.py

Loading diff…

scripts/ppv2_probe_test.py

Loading diff…

scripts/ppv2_step_test.py

Loading diff…

scripts/testdata/ppv2/plan-a80.json

Loading diff…

scripts/testdata/ppv2/probe-responses.json

Loading diff…

scripts/testdata/ppv2/tofu-state-show-tg80.jsonl

Loading diff…

scripts/testdata/ppv2/trust-status.json

Loading diff…

system.go

Loading diff…

testdata/clireg-golden.jsonl

Loading diff…