carlos / platform Public

edge: a hub-forwarded host not routed here yet answers 503, not 404

During a fleet drain or detach the hub forwards a relabelled record to
the new box before its next reconcile mints the route; the box answered
404 unknown host, which a client may cache (#1008 witness, finding 2).
A tunnel-delivered request for a host this box neither routes nor
backhauls now answers 503 with Retry-After 2, like the stale-hop
refusal. Strangers still get the unchanged unknown-host answer.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev f2c2c267fa3d7b4f3bff1579d885dc2559de40ee parent ad37185
5 files changed, +81 −0
  • docs/superpowers/notes/census-proposal-fleet-unrouted-503.md +19 −0
  • internal/edge/edge.go +13 −0
  • internal/edge/fleetunrouted_test.go +43 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-fleet-unrouted-503.tsv +5 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-fleet-unrouted-503.md b/docs/superpowers/notes/census-proposal-fleet-unrouted-503.md
new file mode 100644
index 000000000..ef2afb594
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-fleet-unrouted-503.md
@@ -0,0 +1,19 @@
+# Census approval: fleet-unrouted-503
+
+Ruling `census-ruling-fleet-unrouted-503`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/edge/edge.go` `Edge.ServeHTTP` | body | unchanged (65) | a request the hub tunnel delivered (tunnelclient mark, not a link channel) for a host this box neither routes nor backhauls answers 503 Retry-After 2 instead of the unknown-host 404; no new read, dial or store access; unmarked requests unchanged (#1008) |
+
+Envelopes re-pinned: `internal/edge`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/edge/edge.go` `Edge.ServeHTTP`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.;rev3=census-ruling-demo-api-site-route;basis=Reserve the configured site API namespace after hop verification and control-header scrubbing, before ordinary static, cache, billing and tenant dispatch. Validate hop field shape and delegate only allowlisted operations to the dedicated console path with verified client attribution and console admission. The alias helper enables HTTP/1.1 full duplex so an early console refusal does not wait for upload EOF. Existing 56 read sites unchanged; no new registry, bucket or file read.;rev3=census-ruling-region-ha-g2-fixes;basis=Consult HA ingress after region admission and before miss/alias backhaul; no new direct read; routing-only metadata does not create an upstream.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3/W4: backhaul and door calls pass the owner the door checked into backhaulTo; the §6.5 holder follow (once, GET/HEAD or an unswitched upgrade, no body) and one connect-failure fallback dial only boxes in the holder region's view (same Region/Placement/DataBucket, HomeEligible, fresh) for that owner. Holder name comes only from the TLS-verified signed hop answer; app-set X-Carlos-Holder stays stripped. Routing only; the receiving box still re-checks the lease. No new read site.;rev3=census-ruling-edge-page-cache-1;basis=attaches an in-memory page mark holder to every request to an instance route (the +registry:Kind check of up.route.Kind), wraps the hold and upgrade branches in pageDiagnostics, asks servePage after the plan throttle (a hit answered from the page index over the asset store), keeps an opted-in instance out of the LRU (pagesOptedIn), wraps the response in the page writer, and wraps the proxy's writer in assetInformationalScrub on the remaining arms; the page reads are in the new pagecache.go units;rev3=census-ruling-region-ha-held-build;basis=first branch: a request for the reserved control paths /.carlos/ha-drain and /.carlos/ha-take goes to serveHAControl and returns (refused unless a signed ask); no request on those paths reaches a route, a forward or an app; no read added here. region HA held-requests Task 2: X-Carlos-Replayable is read from verified hops only and deleted from every request; just before frontForwardHA, moveGate runs for an HA hibernating route (route HA, Host and the whole Route passed in memory) and can only hold, refuse with an existing answer or front-forward to the confirmed holder; ReleaseMoveTicket before serveHeld; no store or filesystem read added; region HA held-requests Task 5: after the HA control-path branch, every request is counted by the connection drain (conns.track: a cancellable request context, and Connection: close only while draining); memory only; no read added; Task 5 fix 1: after the drain's final barrier a new request is refused at once through handoverExit with the existing answerHolderUnreachable, never forwarded; the tracked request also carries its connection (from ConnContext) so the drain can close it at its bound; memory only; no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the inbound strip also deletes tunnelclient.LinkAppHeader (Carlos-Link-App) from every client request, beside Carlos-Tunnel-Upgrade; a header delete, no read added; linked deployments slice 1 Task 8: a request carrying a link pin (ServeLinked, set only by the home agent's link handler from its own registry's published set) skips the edge's own handlers (HA control, demo handling, the steering probe, the tunnel hub, hop acceptance, the burst notice, the demo API alias, the replica probe), takes its upstream from selectUpstream (the pinned exact entry or a 502), never enters the alias/catch-all backhaul block, the HA front forward, the local asset catch, the page cache or the response LRU; the two lookupUpstreamPath calls become selectUpstream; no read added;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 (#511): for a request whose host has no entry (the lookup miss), after the replica-probe branch, calls refuseRetiredCopy(r, host): within the grace of a host whose replica copy this box retired, the fleet tunnel stream is refused with REFUSED_STREAM (tunnelclient.Refuse) and nothing is written; any other miss gets the unknown-host answer as before; memory only, a refusal only, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962: after planDisabledAdmit and before the page mark holder and the observer, a request whose cleaned path is /.carlos/geo (not a linked request) is answered by serveGeoAnswer from the request's geo answer already on the context (decideGeo), 200 JSON no-store or 405, and returns; merged with main (no new read)
+
+Seal: `30b6ee553f864b11c18481ce747ad98d696de462e2cb9bec5832b01c2e224104` → `0f148cc5106065040691da81c9705da76b3663f7733a21e4babfa1d6a9611902`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-fleet-unrouted-503.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index 4f47d2618..3ab83ef63 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -2565,6 +2565,19 @@ func (e *Edge) ServeHTTP(w http.ResponseWriter, r *http.Request) {
if e.serveAssetFar(w, r, host) || e.backhaul(w, r, host) {
return
}
+ // A request the hub's tunnel delivered names a host the hub has a
+ // row for, sending it to this box: during a drain or detach the
+ // record is relabelled here before this box's next reconcile mints
+ // the route. Answer that with the come-back-shortly 503 rather than
+ // a 404 a client may cache (#1008 witness, finding 2). Only the
+ // tunnel can set the mark, so a stranger asking for the same host
+ // still gets the unchanged unknownHost answer below, as with the
+ // stale-hop refusal. A link channel's request is not a hub forward.
+ if fromTunnel(r.Context()) && !linkedRequest(r.Context()) {
+ e.logThrottled("fleet-unrouted "+host, fmt.Sprintf("%s arrived over the hub tunnel before this box routes it; answered 503", host))
+ Unavailable(w, "fleet-unrouted", "not served here", 2)
+ return
+ }
e.unknownHost(w, r)
return
}
diff --git a/internal/edge/fleetunrouted_test.go b/internal/edge/fleetunrouted_test.go
new file mode 100644
index 000000000..a63577679
--- /dev/null
+++ b/internal/edge/fleetunrouted_test.go
@@ -0,0 +1,43 @@
+package edge
+
+import (
+ "net/http"
+ "net/http/httptest"
+ "testing"
+
+ "github.com/carlosframework/platform/internal/tunnelclient"
+)
+
+// #1008 witness finding 2: during a drain or detach the hub forwards a
+// relabelled record to this box before its next reconcile mints the route.
+// A request the hub's tunnel delivered for a host this box does not route
+// answers 503 with Retry-After: 2, never a 404 a client may cache. The same
+// request without the tunnel's mark (a stranger) still gets the unchanged
+// 404 with no Retry-After, so the answer tells an outsider nothing.
+func TestTunnelDeliveredUnroutedHostIsA503(t *testing.T) {
+ e, _, _ := hopEdge(t, "annie", "app.test")
+ for _, c := range []struct {
+ name string
+ h http.Handler
+ status int
+ retry string
+ answer string
+ }{
+ {"hub tunnel", tunnelclient.Mark(e), http.StatusServiceUnavailable, "2", "fleet-unrouted"},
+ {"stranger", e, http.StatusNotFound, "", ""},
+ } {
+ t.Run(c.name, func(t *testing.T) {
+ w := httptest.NewRecorder()
+ c.h.ServeHTTP(w, httptest.NewRequest("GET", "http://moved.test/", nil))
+ if w.Code != c.status || w.Header().Get("Retry-After") != c.retry || w.Header().Get(answerHeader) != c.answer {
+ t.Fatalf("got %d Retry-After %q answer %q, want %d %q %q", w.Code, w.Header().Get("Retry-After"), w.Header().Get(answerHeader), c.status, c.retry, c.answer)
+ }
+ })
+ }
+ // A host this box routes is served as before over the tunnel.
+ w := httptest.NewRecorder()
+ tunnelclient.Mark(e).ServeHTTP(w, httptest.NewRequest("GET", "http://app.test/", nil))
+ if w.Code != http.StatusOK {
+ t.Fatalf("routed host over the tunnel: %d, want 200", w.Code)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 12988c77b..08a90285d 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -226,3 +226,4 @@ plan14-root-reads-sr-followups.tsv da718fcd010b3c1db861196e0bbb9121723a9857ad16c
plan14-root-reads-close-direct-s3-fleet-writes.tsv c6655e82e81ccd2a7547655eb393ec3fd10bba396255a1edb30d59b7ad1e682e
plan14-root-reads-fleet-drain-followups.tsv c6655e82e81ccd2a7547655eb393ec3fd10bba396255a1edb30d59b7ad1e682e
plan14-root-reads-fleet-skip-ha-ingress-scan.tsv 30b6ee553f864b11c18481ce747ad98d696de462e2cb9bec5832b01c2e224104
+plan14-root-reads-fleet-unrouted-503.tsv 0f148cc5106065040691da81c9705da76b3663f7733a21e4babfa1d6a9611902
diff --git a/internal/provision/testdata/plan14-root-reads-fleet-unrouted-503.tsv b/internal/provision/testdata/plan14-root-reads-fleet-unrouted-503.tsv
new file mode 100644
index 000000000..79567a8bf
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-fleet-unrouted-503.tsv
@@ -0,0 +1,5 @@
+# Census overlay fleet-unrouted-503, written by census-propose (#369). census-ruling-fleet-unrouted-503, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fleet-unrouted-503.md.
+# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy b469a7877c5a9f571b8606a64e89a8a124d000a807841bcc934bf0f6af1ea71a internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.;rev3=census-ruling-demo-api-site-route;basis=Reserve the configured site API namespace after hop verification and control-header scrubbing, before ordinary static, cache, billing and tenant dispatch. Validate hop field shape and delegate only allowlisted operations to the dedicated console path with verified client attribution and console admission. The alias helper enables HTTP/1.1 full duplex so an early console refusal does not wait for upload EOF. Existing 56 read sites unchanged; no new registry, bucket or file read.;rev3=census-ruling-region-ha-g2-fixes;basis=Consult HA ingress after region admission and before miss/alias backhaul; no new direct read; routing-only metadata does not create an upstream.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3/W4: backhaul and door calls pass the owner the door checked into backhaulTo; the §6.5 holder follow (once, GET/HEAD or an unswitched upgrade, no body) and one connect-failure fallback dial only boxes in the holder region's view (same Region/Placement/DataBucket, HomeEligible, fresh) for that owner. Holder name comes only from the TLS-verified signed hop answer; app-set X-Carlos-Holder stays stripped. Routing only; the receiving box still re-checks the lease. No new read site.;rev3=census-ruling-edge-page-cache-1;basis=attaches an in-memory page mark holder to every request to an instance route (the +registry:Kind check of up.route.Kind), wraps the hold and upgrade branches in pageDiagnostics, asks servePage after the plan throttle (a hit answered from the page index over the asset store), keeps an opted-in instance out of the LRU (pagesOptedIn), wraps the response in the page writer, and wraps the proxy's writer in assetInformationalScrub on the remaining arms; the page reads are in the new pagecache.go units;rev3=census-ruling-region-ha-held-build;basis=first branch: a request for the reserved control paths /.carlos/ha-drain and /.carlos/ha-take goes to serveHAControl and returns (refused unless a signed ask); no request on those paths reaches a route, a forward or an app; no read added here. region HA held-requests Task 2: X-Carlos-Replayable is read from verified hops only and deleted from every request; just before frontForwardHA, moveGate runs for an HA hibernating route (route HA, Host and the whole Route passed in memory) and can only hold, refuse with an existing answer or front-forward to the confirmed holder; ReleaseMoveTicket before serveHeld; no store or filesystem read added; region HA held-requests Task 5: after the HA control-path branch, every request is counted by the connection drain (conns.track: a cancellable request context, and Connection: close only while draining); memory only; no read added; Task 5 fix 1: after the drain's final barrier a new request is refused at once through handoverExit with the existing answerHolderUnreachable, never forwarded; the tracked request also carries its connection (from ConnContext) so the drain can close it at its bound; memory only; no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the inbound strip also deletes tunnelclient.LinkAppHeader (Carlos-Link-App) from every client request, beside Carlos-Tunnel-Upgrade; a header delete, no read added; linked deployments slice 1 Task 8: a request carrying a link pin (ServeLinked, set only by the home agent's link handler from its own registry's published set) skips the edge's own handlers (HA control, demo handling, the steering probe, the tunnel hub, hop acceptance, the burst notice, the demo API alias, the replica probe), takes its upstream from selectUpstream (the pinned exact entry or a 502), never enters the alias/catch-all backhaul block, the HA front forward, the local asset catch, the page cache or the response LRU; the two lookupUpstreamPath calls become selectUpstream; no read added;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 (#511): for a request whose host has no entry (the lookup miss), after the replica-probe branch, calls refuseRetiredCopy(r, host): within the grace of a host whose replica copy this box retired, the fleet tunnel stream is refused with REFUSED_STREAM (tunnelclient.Refuse) and nothing is written; any other miss gets the unknown-host answer as before; memory only, a refusal only, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962: after planDisabledAdmit and before the page mark holder and the observer, a request whose cleaned path is /.carlos/geo (not a linked request) is answered by serveGeoAnswer from the request's geo answer already on the context (decideGeo), 200 JSON no-store or 405, and returns; merged with main (no new read);rev3=census-ruling-fleet-unrouted-503;basis=a request the hub tunnel delivered (tunnelclient mark, not a link channel) for a host this box neither routes nor backhauls answers 503 Retry-After 2 instead of the unknown-host 404; no new read, dial or store access; unmarked requests unchanged (#1008) file:ReadAll@20938,registry:Account@11002,registry:App@11026,registry:App@28733,registry:ClaimStamp@11056,registry:Gate@19912,registry:Gate@33124,registry:Gate@33184,registry:Gate@33242,registry:HA@15647,registry:HA@15989,registry:Host@11233,registry:Host@16028,registry:Host@33227,registry:ImportGate@42078,registry:Incarnation@11091,registry:Kind@25767,registry:Kind@27595,registry:Kind@31033,registry:Kind@42020,registry:Kind@42049,registry:ServingSeq@11125,whole:Route@11005,whole:Route@11029,whole:Route@11059,whole:Route@11094,whole:Route@11128,whole:Route@11236,whole:Route@15650,whole:Route@15744,whole:Route@15992,whole:Route@16031,whole:Route@19807,whole:Route@19918,whole:Route@22735,whole:Route@23519,whole:Route@23977,whole:Route@24169,whole:Route@25770,whole:Route@27598,whole:Route@28659,whole:Route@28725,whole:Route@28736,whole:Route@28989,whole:Route@29084,whole:Route@29160,whole:Route@29204,whole:Route@29506,whole:Route@29536,whole:Route@31036,whole:Route@31321,whole:Route@33127,whole:Route@33187,whole:Route@33230,whole:Route@33245,whole:Route@34456,whole:Route@36744,whole:Route@42023,whole:Route@42052,whole:Route@42081,whole:Route@42113,whole:Route@44558,whole:Route@8418,whole:Route@8517,whole:Route@8623 86c1896c04d6aac3b4720ea387eae6b2c7cbf84cddc4ba4b61b7e5b830a0e885
+internal/edge/edge.go Edge.ServeHTTP legacy accepted-legacy accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: pass the already-resolved Route to the reserved replica-probe handler after acceptHop and existing admissionRefuses, requiring tunnel context plus private marker and refusing door/backhaul ingress. Added whole Route use only; scrub marker before forwarding; HA calls remain unchanged.;rev3=census-ruling-region-ha-p3b;basis=Resolve local aliases/catch-alls with cached peer name ownership before serving. Add registry Account/App/ClaimStamp/Host/Incarnation/ServingSeq and six whole Route references for NameClaim; inputs are agent registry rows/edges publications used by unprivileged edge, not root permits. Closed owners retain names and return 503; aware remote owner cannot fall through on missing transport, while legacy hop/door behavior remains. Merge 45cebde4 retains authenticated replica probes after local admission and before ordinary name resolution; probe authentication still requires the tunnel context.;rev3=census-ruling-agent-start-demo-2;basis=edge.go:1901 enters the protected demo path before ordinary exits; :2012-2015 rechecks the selected marked Route after lookup. Added whole Route use routes demos through serving checks, counters and policy; no new registry query or file open in this unit.;rev3=census-ruling-demo-api-site-route;basis=Reserve the configured site API namespace after hop verification and control-header scrubbing, before ordinary static, cache, billing and tenant dispatch. Validate hop field shape and delegate only allowlisted operations to the dedicated console path with verified client attribution and console admission. The alias helper enables HTTP/1.1 full duplex so an early console refusal does not wait for upload EOF. Existing 56 read sites unchanged; no new registry, bucket or file read.;rev3=census-ruling-region-ha-g2-fixes;basis=Consult HA ingress after region admission and before miss/alias backhaul; no new direct read; routing-only metadata does not create an upstream.;rev3=census-ruling-region-ha-g2r-fixes;basis=W3/W4: backhaul and door calls pass the owner the door checked into backhaulTo; the §6.5 holder follow (once, GET/HEAD or an unswitched upgrade, no body) and one connect-failure fallback dial only boxes in the holder region's view (same Region/Placement/DataBucket, HomeEligible, fresh) for that owner. Holder name comes only from the TLS-verified signed hop answer; app-set X-Carlos-Holder stays stripped. Routing only; the receiving box still re-checks the lease. No new read site.;rev3=census-ruling-edge-page-cache-1;basis=attaches an in-memory page mark holder to every request to an instance route (the +registry:Kind check of up.route.Kind), wraps the hold and upgrade branches in pageDiagnostics, asks servePage after the plan throttle (a hit answered from the page index over the asset store), keeps an opted-in instance out of the LRU (pagesOptedIn), wraps the response in the page writer, and wraps the proxy's writer in assetInformationalScrub on the remaining arms; the page reads are in the new pagecache.go units;rev3=census-ruling-region-ha-held-build;basis=first branch: a request for the reserved control paths /.carlos/ha-drain and /.carlos/ha-take goes to serveHAControl and returns (refused unless a signed ask); no request on those paths reaches a route, a forward or an app; no read added here. region HA held-requests Task 2: X-Carlos-Replayable is read from verified hops only and deleted from every request; just before frontForwardHA, moveGate runs for an HA hibernating route (route HA, Host and the whole Route passed in memory) and can only hold, refuse with an existing answer or front-forward to the confirmed holder; ReleaseMoveTicket before serveHeld; no store or filesystem read added; region HA held-requests Task 5: after the HA control-path branch, every request is counted by the connection drain (conns.track: a cancellable request context, and Connection: close only while draining); memory only; no read added; Task 5 fix 1: after the drain's final barrier a new request is refused at once through handoverExit with the existing answerHolderUnreachable, never forwarded; the tracked request also carries its connection (from ConnContext) so the drain can close it at its bound; memory only; no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the inbound strip also deletes tunnelclient.LinkAppHeader (Carlos-Link-App) from every client request, beside Carlos-Tunnel-Upgrade; a header delete, no read added; linked deployments slice 1 Task 8: a request carrying a link pin (ServeLinked, set only by the home agent's link handler from its own registry's published set) skips the edge's own handlers (HA control, demo handling, the steering probe, the tunnel hub, hop acceptance, the burst notice, the demo API alias, the replica probe), takes its upstream from selectUpstream (the pinned exact entry or a 502), never enters the alias/catch-all backhaul block, the HA front forward, the local asset catch, the page cache or the response LRU; the two lookupUpstreamPath calls become selectUpstream; no read added;rev3=census-ruling-stateless-replicas-4-r28;basis=R28 (#511): for a request whose host has no entry (the lookup miss), after the replica-probe branch, calls refuseRetiredCopy(r, host): within the grace of a host whose replica copy this box retired, the fleet tunnel stream is refused with REFUSED_STREAM (tunnelclient.Refuse) and nothing is written; any other miss gets the unknown-host answer as before; memory only, a refusal only, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962: after planDisabledAdmit and before the page mark holder and the observer, a request whose cleaned path is /.carlos/geo (not a linked request) is answered by serveGeoAnswer from the request's geo answer already on the context (decideGeo), 200 JSON no-store or 405, and returns; merged with main (no new read);rev3=census-ruling-fleet-unrouted-503;basis=a request the hub tunnel delivered (tunnelclient mark, not a link channel) for a host this box neither routes nor backhauls answers 503 Retry-After 2 instead of the unknown-host 404; no new read, dial or store access; unmarked requests unchanged (#1008) file:ReadAll@20938,registry:Account@11002,registry:App@11026,registry:App@28733,registry:ClaimStamp@11056,registry:Gate@19912,registry:Gate@33124,registry:Gate@33184,registry:Gate@33242,registry:HA@15647,registry:HA@15989,registry:Host@11233,registry:Host@16028,registry:Host@33227,registry:ImportGate@42078,registry:Incarnation@11091,registry:Kind@25767,registry:Kind@27595,registry:Kind@31033,registry:Kind@42020,registry:Kind@42049,registry:ServingSeq@11125,whole:Route@11005,whole:Route@11029,whole:Route@11059,whole:Route@11094,whole:Route@11128,whole:Route@11236,whole:Route@15650,whole:Route@15744,whole:Route@15992,whole:Route@16031,whole:Route@19807,whole:Route@19918,whole:Route@22735,whole:Route@23519,whole:Route@23977,whole:Route@24169,whole:Route@25770,whole:Route@27598,whole:Route@28659,whole:Route@28725,whole:Route@28736,whole:Route@28989,whole:Route@29084,whole:Route@29160,whole:Route@29204,whole:Route@29506,whole:Route@29536,whole:Route@31036,whole:Route@31321,whole:Route@33127,whole:Route@33187,whole:Route@33230,whole:Route@33245,whole:Route@34456,whole:Route@36744,whole:Route@42023,whole:Route@42052,whole:Route@42081,whole:Route@42113,whole:Route@44558,whole:Route@8418,whole:Route@8517,whole:Route@8623 86c1896c04d6aac3b4720ea387eae6b2c7cbf84cddc4ba4b61b7e5b830a0e885
+@coverage internal/edge d9ca2f002ac85faf2880d47cda9f769d827e4c3453e83f9be55cd6930e9b7bd4