carlos / platform Public

edge: answer /.carlos/geo on demos too; tests for every geo arm (R1)

Astra round 1 (REVIEW-FINDINGS-static-site-geo-962-R1.md, NOT READY):

R1-1 (P1, every site dispatch path must answer the reserved path): a
demo route returned through serveDemoTraffic before the new answer, so
its app got /.carlos/geo. serveDemoTraffic now answers it through the
demo response policy, after the demo's admission, import-gate and lapse
refusals and before the guard, the throttles, the demo's traffic
allowance and the app, and skips its observer defer: never metered,
counted or recorded, as on the ordinary path. The policy turns
Cache-Control into its own no-store.

R1-2 (P2, geo provenance on every arm): tests for a rejected hop
(null, no lookup), the tunnel client adopting the hub's answer, a
linked request passing to its pinned app, a wildcard custom domain, a
forward row answered at the hub, and the demo.

Census: Edge.serveDemoTraffic added to the static-site-geo-962 card
(body, read sites unchanged); round 1 approved Edge.ServeHTTP and the
internal/edge envelope.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 07a813d8ececb78718b16f9dae861b66d1143b25 parent 565cbe6
6 files changed, +176 −5
  • docs/superpowers/notes/census-proposal-static-site-geo-962.md +3 −1
  • docs/superpowers/reviews/REVIEW-FINDINGS-static-site-geo-962-R1.md +34 −0
  • internal/edge/demo_traffic.go +16 −1
  • internal/edge/geoanswer_test.go +118 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-static-site-geo-962.tsv +4 −2

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-static-site-geo-962.md b/docs/superpowers/notes/census-proposal-static-site-geo-962.md
index 47d973240..d573134b4 100644
--- a/docs/superpowers/notes/census-proposal-static-site-geo-962.md
+++ b/docs/superpowers/notes/census-proposal-static-site-geo-962.md
@@ -4,6 +4,7 @@ Ruling `census-ruling-static-site-geo-962`. The independent reviewer approves or
| unit | change | read sites | what changed |
|---|---|---|---|
+| `internal/edge/demo_traffic.go` `Edge.serveDemoTraffic` | body | unchanged (33) | discussion #962, Astra R1-1: a demo request whose cleaned path is /.carlos/geo is answered by serveGeoAnswer through the demo response policy, after the demo's admission, import-gate and lapse refusals and before the guard, throttles, the demo traffic allowance and the app; the observer defer and guard state are skipped for it; no store, registry or file read added; read sites unchanged |
| `internal/edge/edge.go` `Edge.ServeHTTP` | body | unchanged (65) | 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; no store, registry or file read added; read sites unchanged |
Envelopes re-pinned: `internal/edge`.
@@ -12,8 +13,9 @@ Review: a model from the other family than the author reads the branch's diff ag
Recorded dispositions, which each change must still satisfy:
+- `internal/edge/demo_traffic.go` `Edge.serveDemoTraffic`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:128-334 reads the resolved Route and passes it to existing admission, metering, rate and activator helpers. Resident serving checks precede the inert moved hook (:143), retirement and durable request debit (:302); output debits use the writer below compression. Forwarders do not count or transform again. Existing expiry/control cancellations and five-second write bounds apply; no request-path console or bucket read.;rev3=census-ruling-edge-page-cache-1;basis=attaches the in-memory page mark holder to a demo's request when the route is an instance (up.route.Kind, the +registry:Kind and +whole:Route sites), as ServeHTTP does; nothing else; final fix wave: also wraps the app's writer in the page diagnostics writer (pageDiagnostics(r, host, up).wrap(appWriter)), which sets Carlos-Cache: bypass on a marked response and records nothing; in memory, no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the demo route's request header scrub also deletes tunnelclient.LinkAppHeader (Carlos-Link-App), the hub-set link publication header, beside the tunnel markers it already deletes; a header delete on the cloned request, no read added
- `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
-Seal: `b130b2d616e6476f056f4bd3dd5a5f64dd77aca49e95718ad6419ed0fd37f2d5` → `f8de0c7bd094ea95dc1ef1d8d7d56a4f00a326fd09114253004020c57ae0e9a3`.
+Seal: `b130b2d616e6476f056f4bd3dd5a5f64dd77aca49e95718ad6419ed0fd37f2d5` → `42efc9f311ee9d43943a91770afe9299cc10e32b5585a14a7a47050f0843bb6e`.
Overlay: `internal/provision/testdata/plan14-root-reads-static-site-geo-962.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/reviews/REVIEW-FINDINGS-static-site-geo-962-R1.md b/docs/superpowers/reviews/REVIEW-FINDINGS-static-site-geo-962-R1.md
new file mode 100644
index 000000000..51e5bea7f
--- /dev/null
+++ b/docs/superpowers/reviews/REVIEW-FINDINGS-static-site-geo-962-R1.md
@@ -0,0 +1,34 @@
+Reviewed `f2cf2828..2edc14b3`, round 1 of 3. No files changed.
+
+1. **P1 — Demo sites never reach the geo endpoint** — brief items 1, 3, 4 and 7.
+
+ `ServeHTTP` returns through `handleDemoRequest` at [edge.go:2250](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/edge.go:2250), before the new handler at line 2739. [demo.go:128](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/demo.go:128) dispatches to `serveDemoTraffic`, which computes geo but ultimately calls the app at [demo_traffic.go:343](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/demo_traffic.go:343).
+
+ **Failure scenario:** A live demo requests `GET /.carlos/geo`. It receives the app’s response—potentially a 404 or its own route’s content—instead of country JSON. The request also passes through demo accounting and can reach the activator. This contradicts the endpoint’s reservation and accounting contract, plus “Every site” and “isn’t counted in analytics” in [cli.md:1792](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/docs/site/cli.md:1792).
+
+ **Fix:** Add the geo answer to the demo dispatch path after geo selection and applicable serving refusals, before accounting and activation. Preserve demo response protections. Add a real demo-route test asserting country JSON, required headers, no app request, no wake and no accounting.
+
+ **Fault family:** Every supported site dispatch path must enforce the reserved endpoint before tenant execution.
+
+2. **P2 — Important endpoint dispatch and trust cases lack regression tests** — brief item 5.
+
+ The backhaul test covers a verified hop, while [geoanswer_test.go:373](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/geoanswer_test.go:373) deliberately answers at the tunnel hub and asserts that the receiving edge sees nothing. It therefore does not test the endpoint’s tunnel-side adoption.
+
+ Missing endpoint cases include rejected hops, tunnel-client delivery, HA front forwarding and HA ingress, `IsForward` rows, catch-all domains, regional names and the linked-request exception. The demo omission is demonstrated above.
+
+ **Failure scenario:** An alternate ingress answers using its own lookup, or a pinned request is intercepted, while the current endpoint tests remain green.
+
+ **Fix:** Extend the existing fixtures to exercise these paths. Assert ingress-derived JSON without a receiving-edge lookup, nulls for rejected hops, and app delivery for pinned requests.
+
+ **Fault family:** Geo provenance and endpoint ownership must survive every dispatch arm.
+
+No P3 findings.
+
+Census verdicts for the reviewed diff:
+
+- **Approve `Edge.ServeHTTP` — body, read sites unchanged.** Read the complete function, including geo selection at [edge.go:2418](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/edge.go:2418), door/import/lapse checks and the new return at line 2739. The change consumes existing request context and adds no root file, registry or bucket read.
+- **Approve the `internal/edge` envelope.** Reviewed all new functions in [geoanswer.go:29](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/geoanswer.go:29), the tests and the exclusion at [assetcatch.go:1055](/home/paulca/.cache/tmp/claude-1001/geo-962/wt/internal/edge/assetcatch.go:1055). These add no new authority to open, execute or follow tenant-controlled resources. Ordinary requests bypass local cache reads and writes; the far exclusion also prevents replay of existing asset entries.
+
+`git diff --check` passed. The targeted Go tests could not start because the read-only sandbox prevented creation of Go’s build directory. No full suites were run.
+
+**NOT READY**
\ No newline at end of file
diff --git a/internal/edge/demo_traffic.go b/internal/edge/demo_traffic.go
index 90aa32a22..e8b2bd49f 100644
--- a/internal/edge/demo_traffic.go
+++ b/internal/edge/demo_traffic.go
@@ -200,11 +200,20 @@ func (e *Edge) serveDemoTraffic(dst http.ResponseWriter, r *http.Request, up ups
var delivered int64
ob := &countingWriter{ResponseWriter: dst, n: &delivered}
r, out := withOutcome(r)
- if e.guard != guardOff && !isDoor && !hopDoorFrom(ctx) && !fromTunnel(ctx) {
+ // The visitor's country (geoanswer.go) is the edge's own answer on a
+ // demo as on every other site: answered below, after the demo's own
+ // refusals and before the guard, the throttles and the demo's traffic
+ // allowance, and never metered, counted or recorded, as on the
+ // ordinary path.
+ geoAsk := isGeoPath(r.URL.Path)
+ if e.guard != guardOff && !geoAsk && !isDoor && !hopDoorFrom(ctx) && !fromTunnel(ctx) {
out.guard = e.newGuardState(up.route)
out.guard.acct, out.guard.app = release.RouteAccount(up.route), up.route.App
}
defer func() {
+ if geoAsk {
+ return
+ }
if m := e.usageMeter.Load(); m != nil {
m.Record(up.route, 1, delivered, hopped)
}
@@ -257,6 +266,12 @@ func (e *Edge) serveDemoTraffic(dst http.ResponseWriter, r *http.Request, up ups
if e.admissionRefuses(refusal, r, up.route) || !e.importGateAdmit(refusal, r, host, up.route) || !e.planDisabledAdmit(refusal, r, host, up.route) {
return
}
+ if geoAsk {
+ // Through the demo's response policy, which keeps its own headers
+ // (Cache-Control becomes its no-store) and refuses a cookie.
+ serveGeoAnswer(policy, r)
+ return
+ }
if out.guard != nil {
if hit, matched := edgeguard.Check(r.URL.Path, r.URL.RawQuery); matched {
if until, from, cooling := out.guard.cooling(r); cooling && burstDecide(refusal, r, until, from, up.viaTunnel || up.route.IsForward()) {
diff --git a/internal/edge/geoanswer_test.go b/internal/edge/geoanswer_test.go
index c3587040f..9cc2bba17 100644
--- a/internal/edge/geoanswer_test.go
+++ b/internal/edge/geoanswer_test.go
@@ -418,3 +418,121 @@ func TestGeoAnswerForADoorCallerIsNull(t *testing.T) {
t.Fatal("a door call was looked up")
}
}
+
+// A rejected hop is answered with no geo at all: its RemoteAddr is the
+// sending edge, so neither its claim nor a lookup is believed (codex R2-1).
+func TestGeoAnswerForARejectedHopIsNull(t *testing.T) {
+ e, _ := meshGeoEdge(t, "app.test")
+ spy := spyGeo(e, "XX")
+ r := geoReq("app.test", geoTestGB)
+ r.URL.Path = GeoPath
+ r.Header.Set(hopHeader, "1")
+ r.Header.Set(hopAuthHeader, signHop([]byte("not-the-mesh-key-not-the-mesh-key"), "app.test", time.Now()))
+ r.Header.Set(geoip.HeaderHop, "hit;src=GeoLite2-City")
+ r.Header.Set(geoip.HeaderCountry, "FR")
+ w := httptest.NewRecorder()
+ e.ServeHTTP(w, r)
+ wantGeoAnswer(t, "rejected hop", w, geoNull)
+ if spy.Load() != 0 {
+ t.Fatal("a rejected hop was looked up")
+ }
+}
+
+// The tunnel client's side: a request a tunnel delivered carries the hub's
+// answer (spec §8.4), which this edge adopts without a lookup of its own.
+func TestGeoAnswerOnATunnelClientAdoptsTheHubs(t *testing.T) {
+ e, n := geoAppEdge(t, "app.test", "service")
+ spy := spyGeo(e, "XX")
+ saved := fromTunnel
+ fromTunnel = func(context.Context) bool { return true }
+ t.Cleanup(func() { fromTunnel = saved })
+ w := geoAsk(e, "GET", "app.test", GeoPath, "127.0.0.1",
+ geoip.HeaderHop, "hit;src=GeoLite2-City", geoip.HeaderCountry, "DE")
+ wantGeoAnswer(t, "tunnel client", w, `{"country":"DE","source":"GeoLite2-City"}`)
+ if spy.Load() != 0 || n.Load() != 0 {
+ t.Fatalf("lookups %d, app requests %d; want 0 and 0", spy.Load(), n.Load())
+ }
+}
+
+// A linked request is the pinned app's alone (ServeLinked): the path goes on
+// to the app, as every other edge-owned handler is skipped for it.
+func TestGeoAnswerSkipsALinkedRequest(t *testing.T) {
+ s := newPCScene(t, pageOK(pcBody), func(r *registry.Route) { r.Hibernate = true })
+ loadTestDB(t, s.e)
+ rec := linkedGet(s.e, LinkedTarget{Host: pcHost, Account: "abc", App: "blog", PublicHost: "blog.pub.example.com"}, GeoPath)
+ wantBody(t, rec, 200, pcBody)
+ if n := s.b.n.Load(); n != 1 {
+ t.Fatalf("the app saw %d requests, want the linked geo path", n)
+ }
+}
+
+// A catch-all custom domain (a wildcard route_aliases row) answers too.
+func TestGeoAnswerOnAWildcardDomain(t *testing.T) {
+ app, n := countingApp(t)
+ reg := openReg(t)
+ if err := reg.Upsert(registry.Route{Host: "relay.bab.oncarlos.com", Kind: "service", Addr: app.Listener.Addr().String(), Status: "ready"}); err != nil {
+ t.Fatal(err)
+ }
+ upsertAlias(t, reg, "*.woodstar.app", "relay.bab.oncarlos.com")
+ e, err := New(reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(e.probers.Stop)
+ loadTestDB(t, e)
+ wantGeoAnswer(t, "wildcard", geoAsk(e, "GET", "paul.woodstar.app", GeoPath, geoTestGB), geoGBAnswer)
+ if n.Load() != 0 {
+ t.Fatal("the app saw the geo ask")
+ }
+}
+
+// A live demo answers it too, through the demo's response policy (its
+// Cache-Control is no-store), without spending the demo's traffic
+// allowance, reaching the app, or being counted.
+func TestGeoAnswerOnADemo(t *testing.T) {
+ var n atomic.Int64
+ e, rt, c := demoTrafficFixture(t, http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ n.Add(1)
+ w.Write([]byte("app"))
+ }))
+ loadTestDB(t, e)
+ m := &memAnalytics{}
+ e.EnableAnalytics(m)
+ e.SetAnalyticsOn(map[string]bool{release.RouteAccount(rt) + "/" + rt.App: true})
+ meter := NewUsageMeter()
+ e.EnableUsage(meter)
+ r := httptest.NewRequest("GET", "https://"+rt.Host+GeoPath, nil)
+ r.RemoteAddr = net.JoinHostPort(geoTestGB, "4444")
+ rec := httptest.NewRecorder()
+ e.ServeHTTP(rec, r)
+ if rec.Code != 200 || rec.Body.String() != geoGBAnswer {
+ t.Fatalf("demo geo = %d %q", rec.Code, rec.Body.String())
+ }
+ assertDemoPolicy(t, rec.Header())
+ h := rec.Header()
+ if h.Get("Cache-Control") != "no-store" || h.Get("Vary") != "*" || h.Get("Content-Type") != "application/json" || len(h.Values("Set-Cookie")) != 0 {
+ t.Fatalf("demo geo headers %v", h)
+ }
+ if n.Load() != 0 || c.requests != 0 {
+ t.Fatalf("app requests %d, demo allowance spent %d", n.Load(), c.requests)
+ }
+ if len(m.snap()) != 0 || len(meter.Drain().Rows) != 0 {
+ t.Fatal("the demo's geo answer was counted or metered")
+ }
+}
+
+// A fleet's forward row on the hub: the hub answers from its own lookup, and
+// the fleet box never sees the request.
+func TestGeoAnswerForAForwardRowAtTheHub(t *testing.T) {
+ cb := &countingBox{}
+ hubURL, hub, box := forwardHubAndBox(t, []registry.Route{forwardRow("shop.example.com", "home", fwdOwner)}, nil, cb)
+ hubSpy, boxSpy := spyGeo(hub, "NL"), spyGeo(box, "XX")
+ resp, body := fwdDo(t, hubURL, "GET", "shop.example.com", GeoPath, "", nil)
+ if resp.StatusCode != 200 || string(body) != `{"country":"NL","source":"TestDB-NL"}` ||
+ resp.Header.Get("Cache-Control") != "no-store, private" {
+ t.Fatalf("forward row geo = %d %q %v", resp.StatusCode, body, resp.Header)
+ }
+ if n := cb.count("shop.example.com"); n != 0 || hubSpy.Load() != 1 || boxSpy.Load() != 0 {
+ t.Fatalf("box requests %d, lookups hub=%d box=%d", n, hubSpy.Load(), boxSpy.Load())
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 53fda9c0e..113d5d665 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -177,4 +177,4 @@ plan14-root-reads-member-backups-1.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31
plan14-root-reads-gvisor-empty-execstart.tsv 44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f
plan14-root-reads-demo-referrer-same-origin.tsv 44b11f63c98595a70e62124034bdf5185c5a58561e99e3e269141557cf13880f
plan14-root-reads-member-backups-2a.tsv b130b2d616e6476f056f4bd3dd5a5f64dd77aca49e95718ad6419ed0fd37f2d5
-plan14-root-reads-static-site-geo-962.tsv f8de0c7bd094ea95dc1ef1d8d7d56a4f00a326fd09114253004020c57ae0e9a3
+plan14-root-reads-static-site-geo-962.tsv 42efc9f311ee9d43943a91770afe9299cc10e32b5585a14a7a47050f0843bb6e
diff --git a/internal/provision/testdata/plan14-root-reads-static-site-geo-962.tsv b/internal/provision/testdata/plan14-root-reads-static-site-geo-962.tsv
index 30d1d5874..1edeb0ea0 100644
--- a/internal/provision/testdata/plan14-root-reads-static-site-geo-962.tsv
+++ b/internal/provision/testdata/plan14-root-reads-static-site-geo-962.tsv
@@ -1,5 +1,7 @@
# Census overlay static-site-geo-962, written by census-propose (#369). census-ruling-static-site-geo-962, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-static-site-geo-962.md.
-# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 2 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 3b791f925574f14259d0cad54b644f0ff967ff098c41be8741a645e1851abf78 internal/edge/demo_traffic.go Edge.serveDemoTraffic legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:128-334 reads the resolved Route and passes it to existing admission, metering, rate and activator helpers. Resident serving checks precede the inert moved hook (:143), retirement and durable request debit (:302); output debits use the writer below compression. Forwarders do not count or transform again. Existing expiry/control cancellations and five-second write bounds apply; no request-path console or bucket read.;rev3=census-ruling-edge-page-cache-1;basis=attaches the in-memory page mark holder to a demo's request when the route is an instance (up.route.Kind, the +registry:Kind and +whole:Route sites), as ServeHTTP does; nothing else; final fix wave: also wraps the app's writer in the page diagnostics writer (pageDiagnostics(r, host, up).wrap(appWriter)), which sets Carlos-Cache: bypass on a marked response and records nothing; in memory, no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the demo route's request header scrub also deletes tunnelclient.LinkAppHeader (Carlos-Link-App), the hub-set link publication header, beside the tunnel markers it already deletes; a header delete on the cloned request, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962, Astra R1-1: a demo request whose cleaned path is /.carlos/geo is answered by serveGeoAnswer through the demo response policy, after the demo's admission, import-gate and lapse refusals and before the guard, throttles, the demo traffic allowance and the app; the observer defer and guard state are skipped for it; no store, registry or file read added; read sites unchanged registry:App@2996,registry:DemoExpiresAt@1390,registry:Kind@7078,whole:Route@1089,whole:Route@1393,whole:Route@1532,whole:Route@1619,whole:Route@1742,whole:Route@223,whole:Route@2266,whole:Route@2923,whole:Route@2988,whole:Route@2999,whole:Route@3113,whole:Route@3209,whole:Route@3283,whole:Route@3330,whole:Route@3388,whole:Route@3417,whole:Route@3636,whole:Route@3667,whole:Route@3699,whole:Route@375,whole:Route@4072,whole:Route@454,whole:Route@4736,whole:Route@4786,whole:Route@4838,whole:Route@5263,whole:Route@6028,whole:Route@6571,whole:Route@7081,whole:Route@7529 da278b352dc5a3a7bcf00e894a6b2e2cf16415584ee704c2555f90e9e66614d1
@legacy 8fc2d1b7428a808e4e3dab84e8b212f3d9dcdb778bec9bebe3bd406701eedd0b 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-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; no store, registry or file read added; read sites unchanged file:ReadAll@19701,registry:Account@10586,registry:App@10610,registry:App@27496,registry:ClaimStamp@10640,registry:Gate@18675,registry:Gate@31887,registry:Gate@31947,registry:Gate@32005,registry:HA@14410,registry:HA@14752,registry:Host@10817,registry:Host@14791,registry:Host@31990,registry:ImportGate@40841,registry:Incarnation@10675,registry:Kind@24530,registry:Kind@26358,registry:Kind@29796,registry:Kind@40783,registry:Kind@40812,registry:ServingSeq@10709,whole:Route@10589,whole:Route@10613,whole:Route@10643,whole:Route@10678,whole:Route@10712,whole:Route@10820,whole:Route@14413,whole:Route@14507,whole:Route@14755,whole:Route@14794,whole:Route@18570,whole:Route@18681,whole:Route@21498,whole:Route@22282,whole:Route@22740,whole:Route@22932,whole:Route@24533,whole:Route@26361,whole:Route@27422,whole:Route@27488,whole:Route@27499,whole:Route@27752,whole:Route@27847,whole:Route@27923,whole:Route@27967,whole:Route@28269,whole:Route@28299,whole:Route@29799,whole:Route@30084,whole:Route@31890,whole:Route@31950,whole:Route@31993,whole:Route@32008,whole:Route@33219,whole:Route@35507,whole:Route@40786,whole:Route@40815,whole:Route@40844,whole:Route@40876,whole:Route@43321,whole:Route@8418,whole:Route@8517,whole:Route@8623 d68f21252b234969203735ffdd9a4340186b2fbe5710b05bf587eea4e89d7fe0
+internal/edge/demo_traffic.go Edge.serveDemoTraffic legacy accepted-legacy accepted-legacy;rev3=census-ruling-agent-start-demo-2;basis=demo_traffic.go:128-334 reads the resolved Route and passes it to existing admission, metering, rate and activator helpers. Resident serving checks precede the inert moved hook (:143), retirement and durable request debit (:302); output debits use the writer below compression. Forwarders do not count or transform again. Existing expiry/control cancellations and five-second write bounds apply; no request-path console or bucket read.;rev3=census-ruling-edge-page-cache-1;basis=attaches the in-memory page mark holder to a demo's request when the route is an instance (up.route.Kind, the +registry:Kind and +whole:Route sites), as ServeHTTP does; nothing else; final fix wave: also wraps the app's writer in the page diagnostics writer (pageDiagnostics(r, host, up).wrap(appWriter)), which sets Carlos-Cache: bypass on a marked response and records nothing; in memory, no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 3: the demo route's request header scrub also deletes tunnelclient.LinkAppHeader (Carlos-Link-App), the hub-set link publication header, beside the tunnel markers it already deletes; a header delete on the cloned request, no read added;rev3=census-ruling-static-site-geo-962;basis=discussion #962, Astra R1-1: a demo request whose cleaned path is /.carlos/geo is answered by serveGeoAnswer through the demo response policy, after the demo's admission, import-gate and lapse refusals and before the guard, throttles, the demo traffic allowance and the app; the observer defer and guard state are skipped for it; no store, registry or file read added; read sites unchanged registry:App@2996,registry:DemoExpiresAt@1390,registry:Kind@7078,whole:Route@1089,whole:Route@1393,whole:Route@1532,whole:Route@1619,whole:Route@1742,whole:Route@223,whole:Route@2266,whole:Route@2923,whole:Route@2988,whole:Route@2999,whole:Route@3113,whole:Route@3209,whole:Route@3283,whole:Route@3330,whole:Route@3388,whole:Route@3417,whole:Route@3636,whole:Route@3667,whole:Route@3699,whole:Route@375,whole:Route@4072,whole:Route@454,whole:Route@4736,whole:Route@4786,whole:Route@4838,whole:Route@5263,whole:Route@6028,whole:Route@6571,whole:Route@7081,whole:Route@7529 da278b352dc5a3a7bcf00e894a6b2e2cf16415584ee704c2555f90e9e66614d1
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-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; no store, registry or file read added; read sites unchanged file:ReadAll@19701,registry:Account@10586,registry:App@10610,registry:App@27496,registry:ClaimStamp@10640,registry:Gate@18675,registry:Gate@31887,registry:Gate@31947,registry:Gate@32005,registry:HA@14410,registry:HA@14752,registry:Host@10817,registry:Host@14791,registry:Host@31990,registry:ImportGate@40841,registry:Incarnation@10675,registry:Kind@24530,registry:Kind@26358,registry:Kind@29796,registry:Kind@40783,registry:Kind@40812,registry:ServingSeq@10709,whole:Route@10589,whole:Route@10613,whole:Route@10643,whole:Route@10678,whole:Route@10712,whole:Route@10820,whole:Route@14413,whole:Route@14507,whole:Route@14755,whole:Route@14794,whole:Route@18570,whole:Route@18681,whole:Route@21498,whole:Route@22282,whole:Route@22740,whole:Route@22932,whole:Route@24533,whole:Route@26361,whole:Route@27422,whole:Route@27488,whole:Route@27499,whole:Route@27752,whole:Route@27847,whole:Route@27923,whole:Route@27967,whole:Route@28269,whole:Route@28299,whole:Route@29799,whole:Route@30084,whole:Route@31890,whole:Route@31950,whole:Route@31993,whole:Route@32008,whole:Route@33219,whole:Route@35507,whole:Route@40786,whole:Route@40815,whole:Route@40844,whole:Route@40876,whole:Route@43321,whole:Route@8418,whole:Route@8517,whole:Route@8623 d68f21252b234969203735ffdd9a4340186b2fbe5710b05bf587eea4e89d7fe0
-@coverage internal/edge b58e2851c1e5aba3f3bd0022da7f3b8b79146b418504656f32a2e09f2d2d4818
+@coverage internal/edge f398f89b79780f2e589fd26ca95332a8f5099d05d47554183c490572cfc1b0d8