host: home link loop that serves only published apps
Linked deployments slice 1, Task 8 (spec §3 anti-goal 1, §6.2, §6.3). The agent runs a second, registry-driven tunnel loop beside the fleet one. The first home box to see an unclaimed link claims it (never a fleet box) and dials the link's hub. A change of token, tunnel URL, claim or conn_gen replaces the connection, which ends every stream of an unpublished or retargeted app. The link handler reads Carlos-Link-App and looks the name up in the home's published set on every request. A missing or unpublished name gets 404 (LD-C50). A published one goes to edge.ServeLinked: the edge's normal pipeline with the upstream pinned to the published account and app. selectUpstream is now the one request-path site. A pin selects only the exact local instance entry, else 502 (LD-C51). The edge's own handlers, backhaul, HA forwards and every home cache are skipped. The app and the password gate see the public host over https. Census overlay linked-deployments-slice1 re-proposed with Task 8 claims.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 files changed,
+1,804
−51
docs/superpowers/notes/census-proposal-linked-deployments-slice1.md+32 −5internal/edge/demo.go+10 −2internal/edge/edge.go+191 −20internal/edge/forwardha.go+1 −1internal/edge/haingress.go+2 −2internal/edge/homemap.go+18 −0internal/edge/linkoffline.go+3 −0internal/edge/linkpin_test.go+101 −0internal/edge/pagecache.go+6 −2internal/edge/purge_header.go+27 −8internal/gate/gate.go+20 −2internal/host/agent.go+4 −0internal/host/link_client.go+274 −0internal/host/link_e2e_test.go+970 −0internal/host/link_handler.go+104 −0internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-linked-deployments-slice1.tsv+40 −8
docs/superpowers/notes/census-proposal-linked-deployments-slice1.mdLoading diff…
internal/edge/demo.goLoading diff…
internal/edge/edge.goLoading diff…
internal/edge/forwardha.goLoading diff…
internal/edge/haingress.goLoading diff…
internal/edge/homemap.goLoading diff…
internal/edge/linkoffline.goLoading diff…
internal/edge/linkpin_test.goLoading diff…
internal/edge/pagecache.goLoading diff…
internal/edge/purge_header.goLoading diff…
internal/gate/gate.goLoading diff…
internal/host/agent.goLoading diff…
internal/host/link_client.goLoading diff…
internal/host/link_e2e_test.goLoading diff…
internal/host/link_handler.goLoading diff…
internal/provision/testdata/plan14-root-reads-chain.tsvLoading diff…
internal/provision/testdata/plan14-root-reads-linked-deployments-slice1.tsvLoading diff…