carlos / platform Public

edge: serialise declaredBody reads; HTTP/1 only (#1032 review r1)

Astra round 1 on fix-dbforward-reuse-1032:

P1: an HA-forwarded upload past the replay limit can get an early
closing answer while the transport is still reading the body;
finishEarlyAnswer then reads the body too. net/http's body serialised
those reads, but declaredBody read and changed its remaining count
outside that lock. The whole Read now holds a mutex. Close does not
take it, so it reaches the body under a pending read as before.

P2: on HTTP/2 the declared bytes arriving do not end the stream:
trailers, a reset or excess DATA come on a later read, and the server
never closes the body under a handler, so the race the wrapper fixes
does not exist there. withDeclaredBodyEnd now wraps HTTP/1 requests
only.

New tests, each failing on the round-1 code:
TestDeclaredBodySerialisesOverlappingReads (overlap and -race) and
TestEdgeLeavesAnHTTP2BodyToItsStream (trailers, a stream that ends
after the answer starts, one DATA byte more than declared). Census
proposal re-run with the same NAME.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 398e5f62c3db848bad0dfe4c51052aa5a4d4301a parent 6f2938d
5 files changed, +275 −18
  • docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md +2 −2
  • internal/edge/edge.go +25 −10
  • internal/edge/proxybody_test.go +242 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv +5 −5

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md b/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md
index 9776d1e7e..947e1a94f 100644
--- a/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md
+++ b/docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md
@@ -4,7 +4,7 @@ Ruling `census-ruling-fix-dbforward-reuse-1032`. The independent reviewer approv
| unit | change | read sites | what changed |
|---|---|---|---|
-| `internal/edge/edge.go` `Edge.ServeHTTP` | body | unchanged (65) | the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: a request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; memory only, no read, dial or store access added |
+| `internal/edge/edge.go` `Edge.ServeHTTP` | body | unchanged (65) | the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: an HTTP/1 request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; HTTP/2 requests are left as they are (Astra r1 P2); memory only, no read, dial or store access added |
Envelopes re-pinned: `internal/edge`.
@@ -18,6 +18,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/edge/edge.go:declaredBody.Read`: reads +file:Read ×2; written legacy, accepted-legacy, frozen
-Seal: `c9cd3c8fdf31240b83affa0b2798422f3a99e1d0d400dbaf68665c1127996448` → `c1b93be890eedf37db32da130ab6be9ba4f2853f19b54869f8b60987d6b34405`.
+Seal: `c9cd3c8fdf31240b83affa0b2798422f3a99e1d0d400dbaf68665c1127996448` → `72771689d131a1baeabf32439316ea924e595ab29d13bd7d8c664f1a71da9921`.
Overlay: `internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index 72d6b9ce8..afca1bd0e 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -2257,25 +2257,32 @@ func firstSegmentClean(p string) string {
return firstSegment(path.Clean(p))
}
-// withDeclaredBodyEnd gives a request with a declared Content-Length a body
-// that answers EOF itself once those bytes have been read (#1032).
+// withDeclaredBodyEnd gives an HTTP/1 request with a declared
+// Content-Length a body that answers EOF itself once those bytes have been
+// read (#1032).
//
// After a proxy's transport has sent the declared bytes upstream, it reads
// the body once more to confirm EOF before it counts the request as
-// written. On HTTP/1.1 net/http closes the server's request body as soon as
-// the response head is written, so an upstream that answers the moment it
-// has the body (a forwarded db read streams at once) can make that read
-// land on a closed body. The read fails ("invalid Read on closed Body"),
-// the transport closes the upstream connection, and the streamed answer is
-// cut after its first bytes. With the end answered here, the confirming
-// read never reaches the server's body.
+// written. On HTTP/1.1 net/http may close the server's request body when it
+// flushes the response head, so an upstream that answers the moment it has
+// the body (a forwarded db read streams at once) can make that read land on
+// a closed body. The read fails ("invalid Read on closed Body"), the
+// transport closes the upstream connection, and the streamed answer is cut
+// after its first bytes. With the end answered here, the confirming read
+// never reaches the server's body. On HTTP/1 the server's framing has
+// already ended the body at that length, so the EOF is the one it would
+// give.
+//
+// HTTP/2 is left alone: there the declared bytes arriving do not end the
+// stream (trailers, a reset or excess DATA come on a later read), and the
+// server never closes the body under a handler, so the race does not exist.
//
// Full duplex (ResponseController.EnableFullDuplex) would also keep the
// body open, but then a transport goroutine still reading the body after
// the handler returns races the server's read of the next request on the
// same connection, which net/http answers with a panic.
func withDeclaredBodyEnd(r *http.Request) *http.Request {
- if r.ContentLength <= 0 || r.Body == nil || r.Body == http.NoBody {
+ if r.ProtoMajor != 1 || r.ContentLength <= 0 || r.Body == nil || r.Body == http.NoBody {
return r
}
out := r.WithContext(r.Context())
@@ -2284,12 +2291,20 @@ func withDeclaredBodyEnd(r *http.Request) *http.Request {
}
// declaredBody is a request body that ends after its declared length.
+//
+// Reads are serialised, as net/http's own body serialises them: the
+// transport and an early answer's cleanup (finishEarlyAnswer) may read at
+// the same time, and left must count both. Close does not take mu, so it
+// reaches the body under a pending read exactly as it did before.
type declaredBody struct {
io.ReadCloser
+ mu sync.Mutex
left int64
}
func (b *declaredBody) Read(p []byte) (int, error) {
+ b.mu.Lock()
+ defer b.mu.Unlock()
if b.left <= 0 {
return 0, io.EOF
}
diff --git a/internal/edge/proxybody_test.go b/internal/edge/proxybody_test.go
index 8b0021963..c494af943 100644
--- a/internal/edge/proxybody_test.go
+++ b/internal/edge/proxybody_test.go
@@ -3,13 +3,19 @@ package edge
import (
"bufio"
"bytes"
+ "crypto/tls"
"io"
"net/http"
"net/http/httptest"
"net/http/httptrace"
+ "strings"
"sync"
+ "sync/atomic"
"testing"
+ "golang.org/x/net/http2"
+ "golang.org/x/net/http2/hpack"
+
"github.com/carlosframework/platform/internal/registry"
)
@@ -117,3 +123,239 @@ func TestEdgeStreamSurvivesTheTransportsEOFCheck(t *testing.T) {
t.Fatalf("the stream after its first line: %q, %v", rest, err)
}
}
+
+// overlapReader serves data, holding its first read until release. It
+// notes a read that starts while another is in progress.
+type overlapReader struct {
+ mu sync.Mutex
+ data []byte
+ active atomic.Int32
+ overlap atomic.Bool
+ calls atomic.Int32
+ entered chan struct{}
+ release chan struct{}
+}
+
+func (o *overlapReader) Read(p []byte) (int, error) {
+ if o.active.Add(1) > 1 {
+ o.overlap.Store(true)
+ }
+ defer o.active.Add(-1)
+ if o.calls.Add(1) == 1 {
+ close(o.entered)
+ <-o.release
+ }
+ o.mu.Lock()
+ defer o.mu.Unlock()
+ if len(o.data) == 0 {
+ return 0, io.EOF
+ }
+ n := copy(p, o.data)
+ o.data = o.data[n:]
+ return n, nil
+}
+
+func (o *overlapReader) Close() error { return nil }
+
+// An early answer's cleanup (finishEarlyAnswer) reads the request body while
+// the transport's read of it is still pending. net/http's body serialises
+// the two; declaredBody must too, and count what both read (Astra #1032 r1,
+// P1). Run with -race: an unserialised wrapper races on left.
+func TestDeclaredBodySerialisesOverlappingReads(t *testing.T) {
+ inner := &overlapReader{data: []byte("abcdef"), entered: make(chan struct{}), release: make(chan struct{})}
+ b := &declaredBody{ReadCloser: inner, left: 6}
+ type result struct {
+ n int
+ err error
+ }
+ first, second := make(chan result, 1), make(chan result, 1)
+ go func() {
+ n, err := b.Read(make([]byte, 4))
+ first <- result{n, err}
+ }()
+ <-inner.entered
+ go func() {
+ n, err := b.Read(make([]byte, 16))
+ second <- result{n, err}
+ }()
+ close(inner.release)
+ a, c := <-first, <-second
+ if inner.overlap.Load() {
+ t.Fatal("two reads reached the request body at once")
+ }
+ if a.n+c.n != 6 || a.err != nil || c.err != io.EOF {
+ t.Fatalf("first %d %v, second %d %v: want 6 bytes in all, the second ending at EOF", a.n, a.err, c.n, c.err)
+ }
+ if n, err := b.Read(make([]byte, 1)); n != 0 || err != io.EOF || b.left != 0 {
+ t.Fatalf("after the declared bytes: %d %v, left %d", n, err, b.left)
+ }
+}
+
+// h2Edge is an edge behind an HTTP/2 front for app.example.com, whose
+// upstream reads the body, answers "ok" and flushes it, then, when hold is
+// not nil, ends its answer with "done" once hold is closed. wrote says, for
+// each proxied request, how the edge's transport ended its write of the
+// request body and which X-Check trailer the edge's server had by then.
+func h2Edge(t *testing.T, hold <-chan struct{}) (front *httptest.Server, wrote <-chan h2Wrote) {
+ t.Helper()
+ upstream := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ io.ReadAll(r.Body)
+ io.WriteString(w, "ok\n")
+ if hold == nil {
+ return
+ }
+ http.NewResponseController(w).Flush()
+ select {
+ case <-hold:
+ io.WriteString(w, "done\n")
+ case <-r.Context().Done():
+ }
+ }))
+ t.Cleanup(upstream.Close)
+ reg := openReg(t)
+ if err := reg.Upsert(registry.Route{Host: "app.example.com", Kind: "service", Addr: upstream.Listener.Addr().String(), Status: "ready", App: "web"}); err != nil {
+ t.Fatal(err)
+ }
+ e, err := New(reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ ch := make(chan h2Wrote, 1)
+ front = httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ in := r
+ r = r.WithContext(httptrace.WithClientTrace(r.Context(), &httptrace.ClientTrace{
+ WroteRequest: func(info httptrace.WroteRequestInfo) {
+ ch <- h2Wrote{err: info.Err, trailer: in.Trailer.Get("X-Check")}
+ },
+ }))
+ e.ServeHTTP(w, r)
+ }))
+ front.EnableHTTP2 = true
+ front.StartTLS()
+ t.Cleanup(front.Close)
+ return front, ch
+}
+
+type h2Wrote struct {
+ err error
+ trailer string
+}
+
+// On HTTP/2 the declared bytes arriving do not end the request body: the
+// stream's end, its trailers or its error come on a later read. The edge
+// leaves an HTTP/2 body as it is, so each still reaches whoever reads the
+// body, here the proxy's transport (Astra #1032 r1, P2).
+// h2Post opens an HTTP/2 connection to front and sends the headers of a
+// POST to app.example.com declaring a 5-byte body. The caller writes the
+// DATA frames itself, so it decides when, and whether, the stream ends.
+func h2Post(t *testing.T, front *httptest.Server) *http2.Framer {
+ t.Helper()
+ cfg := front.Client().Transport.(*http.Transport).TLSClientConfig.Clone()
+ cfg.NextProtos = []string{"h2"}
+ conn, err := tls.Dial("tcp", front.Listener.Addr().String(), cfg)
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { conn.Close() })
+ if _, err := io.WriteString(conn, http2.ClientPreface); err != nil {
+ t.Fatal(err)
+ }
+ fr := http2.NewFramer(conn, conn)
+ if err := fr.WriteSettings(); err != nil {
+ t.Fatal(err)
+ }
+ var block bytes.Buffer
+ enc := hpack.NewEncoder(&block)
+ for _, f := range [][2]string{{":method", "POST"}, {":scheme", "https"}, {":authority", "app.example.com"}, {":path", "/reads"}, {"content-length", "5"}} {
+ enc.WriteField(hpack.HeaderField{Name: f[0], Value: f[1]})
+ }
+ if err := fr.WriteHeaders(http2.HeadersFrameParam{StreamID: 1, BlockFragment: block.Bytes(), EndHeaders: true}); err != nil {
+ t.Fatal(err)
+ }
+ return fr
+}
+
+// h2ReadUntil reads frames until stream 1's DATA so far contains want.
+func h2ReadUntil(t *testing.T, fr *http2.Framer, want string) {
+ t.Helper()
+ var got []byte
+ for !bytes.Contains(got, []byte(want)) {
+ f, err := fr.ReadFrame()
+ if err != nil {
+ t.Fatalf("waiting for %q (have %q): %v", want, got, err)
+ }
+ if d, ok := f.(*http2.DataFrame); ok && d.StreamID == 1 {
+ got = append(got, d.Data()...)
+ }
+ }
+}
+
+func TestEdgeLeavesAnHTTP2BodyToItsStream(t *testing.T) {
+ t.Run("trailers", func(t *testing.T) {
+ front, wrote := h2Edge(t, nil)
+ req, err := http.NewRequest(http.MethodPost, front.URL+"/reads", strings.NewReader("hello"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ req.Host = "app.example.com"
+ req.ContentLength = 5
+ req.Trailer = http.Header{"X-Check": {"yes"}}
+ res, err := front.Client().Do(req)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer res.Body.Close()
+ if b, err := io.ReadAll(res.Body); err != nil || res.ProtoMajor != 2 || string(b) != "ok\n" {
+ t.Fatalf("HTTP/%d answer %q: %v", res.ProtoMajor, b, err)
+ }
+ if got := <-wrote; got.err != nil || got.trailer != "yes" {
+ t.Fatalf("write ended %v with trailer %q, want nil and yes", got.err, got.trailer)
+ }
+ })
+
+ t.Run("a stream that ends after its answer starts", func(t *testing.T) {
+ hold := make(chan struct{})
+ release := sync.OnceFunc(func() { close(hold) })
+ t.Cleanup(release)
+ front, wrote := h2Edge(t, hold)
+ fr := h2Post(t, front)
+ if err := fr.WriteData(1, false, []byte("hello")); err != nil {
+ t.Fatal(err)
+ }
+ // The upstream has the declared bytes and has started its answer;
+ // the stream is still open, so the body has not ended.
+ h2ReadUntil(t, fr, "ok\n")
+ select {
+ case got := <-wrote:
+ t.Fatalf("the transport finished the body (%v) before its stream ended", got.err)
+ default:
+ }
+ if err := fr.WriteData(1, true, nil); err != nil {
+ t.Fatal(err)
+ }
+ if got := <-wrote; got.err != nil {
+ t.Fatalf("write ended %v after the stream ended", got.err)
+ }
+ release()
+ h2ReadUntil(t, fr, "done\n")
+ })
+
+ t.Run("more DATA than declared", func(t *testing.T) {
+ hold := make(chan struct{})
+ t.Cleanup(sync.OnceFunc(func() { close(hold) }))
+ front, wrote := h2Edge(t, hold)
+ fr := h2Post(t, front)
+ if err := fr.WriteData(1, false, []byte("hello")); err != nil {
+ t.Fatal(err)
+ }
+ h2ReadUntil(t, fr, "ok\n")
+ // The transport has sent the declared bytes and is waiting for the
+ // stream's end; what comes is one byte too many.
+ if err := fr.WriteData(1, true, []byte("!")); err != nil {
+ t.Fatal(err)
+ }
+ if got := <-wrote; got.err == nil {
+ t.Fatal("the transport took a body with more DATA than declared as whole")
+ }
+ })
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index e998e33c3..1f548b006 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -245,4 +245,4 @@ plan14-root-reads-ha-1192.tsv 8df52839a0c961d3721f3a5c3247d06202dae4e00d011844b7
plan14-root-reads-audit-bugs-2.tsv 1610abfc476fe45d259494242243756dac9cfec49cdd7f7f7b238329392241a1
plan14-root-reads-bounded-systemctl.tsv 16cae3931aadfa57a5293d69becf318645681400777cc08972cf08eb449c2457
plan14-root-reads-mail-submission-followups.tsv c9cd3c8fdf31240b83affa0b2798422f3a99e1d0d400dbaf68665c1127996448
-plan14-root-reads-fix-dbforward-reuse-1032.tsv c1b93be890eedf37db32da130ab6be9ba4f2853f19b54869f8b60987d6b34405
+plan14-root-reads-fix-dbforward-reuse-1032.tsv 72771689d131a1baeabf32439316ea924e595ab29d13bd7d8c664f1a71da9921
diff --git a/internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv b/internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv
index c8c196f44..199ffcec8 100644
--- a/internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv
+++ b/internal/provision/testdata/plan14-root-reads-fix-dbforward-reuse-1032.tsv
@@ -1,8 +1,8 @@
# Census overlay fix-dbforward-reuse-1032, written by census-propose (#369). census-ruling-fix-dbforward-reuse-1032, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fix-dbforward-reuse-1032.md.
# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 1 new dispositions: 0 reads re-frozen at their disposition with the claim, 1 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
-@legacy dcd823d387b753687030f04fadb7a470199e081dc08866b23b20ba1cd7931cb3 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);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: a request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; memory only, no read, dial or store access added file:ReadAll@20389,registry:Account@11147,registry:App@11171,registry:App@28184,registry:ClaimStamp@11201,registry:Gate@19363,registry:Gate@32575,registry:Gate@32635,registry:Gate@32693,registry:HA@15098,registry:HA@15440,registry:Host@11378,registry:Host@15479,registry:Host@32678,registry:ImportGate@41529,registry:Incarnation@11236,registry:Kind@25218,registry:Kind@27046,registry:Kind@30484,registry:Kind@41471,registry:Kind@41500,registry:ServingSeq@11270,whole:Route@11150,whole:Route@11174,whole:Route@11204,whole:Route@11239,whole:Route@11273,whole:Route@11381,whole:Route@15101,whole:Route@15195,whole:Route@15443,whole:Route@15482,whole:Route@19258,whole:Route@19369,whole:Route@22186,whole:Route@22970,whole:Route@23428,whole:Route@23620,whole:Route@25221,whole:Route@27049,whole:Route@28110,whole:Route@28176,whole:Route@28187,whole:Route@28440,whole:Route@28535,whole:Route@28611,whole:Route@28655,whole:Route@28957,whole:Route@28987,whole:Route@30487,whole:Route@30772,whole:Route@32578,whole:Route@32638,whole:Route@32681,whole:Route@32696,whole:Route@33907,whole:Route@36195,whole:Route@41474,whole:Route@41503,whole:Route@41532,whole:Route@41564,whole:Route@44009,whole:Route@8563,whole:Route@8662,whole:Route@8768 68f139634762585f25438c5fea17378901841e1ef50dd30cdb8ebb01d1d47b4b
-@legacy 86dce7f511e2d757f5accb66f2a758d687410b64fe7d9211100cd3831bd1138e internal/edge/edge.go declaredBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-fix-dbforward-reuse-1032;basis=new: reads at most the declared remaining bytes from the wrapped request body (the visitor's request body, not a file) and answers io.EOF once they are read; the two +file:Read sites are the wrapped body's Read method; no file, registry or bucket read file:Read@153,file:Read@23 cf360197ef56c2134be8a9d1ca2249aacc21bc6a4ec7f744d000c74cbc9d5abe
-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);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: a request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; memory only, no read, dial or store access added file:ReadAll@20389,registry:Account@11147,registry:App@11171,registry:App@28184,registry:ClaimStamp@11201,registry:Gate@19363,registry:Gate@32575,registry:Gate@32635,registry:Gate@32693,registry:HA@15098,registry:HA@15440,registry:Host@11378,registry:Host@15479,registry:Host@32678,registry:ImportGate@41529,registry:Incarnation@11236,registry:Kind@25218,registry:Kind@27046,registry:Kind@30484,registry:Kind@41471,registry:Kind@41500,registry:ServingSeq@11270,whole:Route@11150,whole:Route@11174,whole:Route@11204,whole:Route@11239,whole:Route@11273,whole:Route@11381,whole:Route@15101,whole:Route@15195,whole:Route@15443,whole:Route@15482,whole:Route@19258,whole:Route@19369,whole:Route@22186,whole:Route@22970,whole:Route@23428,whole:Route@23620,whole:Route@25221,whole:Route@27049,whole:Route@28110,whole:Route@28176,whole:Route@28187,whole:Route@28440,whole:Route@28535,whole:Route@28611,whole:Route@28655,whole:Route@28957,whole:Route@28987,whole:Route@30487,whole:Route@30772,whole:Route@32578,whole:Route@32638,whole:Route@32681,whole:Route@32696,whole:Route@33907,whole:Route@36195,whole:Route@41474,whole:Route@41503,whole:Route@41532,whole:Route@41564,whole:Route@44009,whole:Route@8563,whole:Route@8662,whole:Route@8768 68f139634762585f25438c5fea17378901841e1ef50dd30cdb8ebb01d1d47b4b
-internal/edge/edge.go declaredBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-fix-dbforward-reuse-1032;basis=new: reads at most the declared remaining bytes from the wrapped request body (the visitor's request body, not a file) and answers io.EOF once they are read; the two +file:Read sites are the wrapped body's Read method; no file, registry or bucket read file:Read@153,file:Read@23 cf360197ef56c2134be8a9d1ca2249aacc21bc6a4ec7f744d000c74cbc9d5abe
-@coverage internal/edge 8165fc55dac9cf93d6fe0d23e060f66b3acf435a45482349a0f909a2a19e437c
+@legacy a9300a80296cf9b3f49441074cb1b70e1877cf1c1ffa40f87124739bccec79a2 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);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: an HTTP/1 request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; HTTP/2 requests are left as they are (Astra r1 P2); memory only, no read, dial or store access added file:ReadAll@20389,registry:Account@11147,registry:App@11171,registry:App@28184,registry:ClaimStamp@11201,registry:Gate@19363,registry:Gate@32575,registry:Gate@32635,registry:Gate@32693,registry:HA@15098,registry:HA@15440,registry:Host@11378,registry:Host@15479,registry:Host@32678,registry:ImportGate@41529,registry:Incarnation@11236,registry:Kind@25218,registry:Kind@27046,registry:Kind@30484,registry:Kind@41471,registry:Kind@41500,registry:ServingSeq@11270,whole:Route@11150,whole:Route@11174,whole:Route@11204,whole:Route@11239,whole:Route@11273,whole:Route@11381,whole:Route@15101,whole:Route@15195,whole:Route@15443,whole:Route@15482,whole:Route@19258,whole:Route@19369,whole:Route@22186,whole:Route@22970,whole:Route@23428,whole:Route@23620,whole:Route@25221,whole:Route@27049,whole:Route@28110,whole:Route@28176,whole:Route@28187,whole:Route@28440,whole:Route@28535,whole:Route@28611,whole:Route@28655,whole:Route@28957,whole:Route@28987,whole:Route@30487,whole:Route@30772,whole:Route@32578,whole:Route@32638,whole:Route@32681,whole:Route@32696,whole:Route@33907,whole:Route@36195,whole:Route@41474,whole:Route@41503,whole:Route@41532,whole:Route@41564,whole:Route@44009,whole:Route@8563,whole:Route@8662,whole:Route@8768 68f139634762585f25438c5fea17378901841e1ef50dd30cdb8ebb01d1d47b4b
+@legacy a6c215eb108146fdb11875273af962d5a6010f0c05792da5f714ef91baeab884 internal/edge/edge.go declaredBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-fix-dbforward-reuse-1032;basis=new: reads at most the declared remaining bytes from the wrapped request body (the visitor's request body, not a file) and answers io.EOF once they are read; the whole Read (length checks, inner read, decrement) holds the wrapper's mutex so the transport and finishEarlyAnswer's overlapping reads are serialised as net/http's body serialises them, and Close does not take it (Astra r1 P1); the two +file:Read sites are the wrapped body's Read; no file, registry or bucket read file:Read@187,file:Read@23 5fdb194f00006c4179a6f88a9dec733f307c9b1ef820810b7356294e6c719f16
+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);rev3=census-ruling-fleet-unrouted-503-fix1;basis=a request the hub delivered over this fleet box's channel (MarkFleetChannel, set by the box's own tunnel loop for a "<fleet>/<label>" channel, plus the tunnel client mark) for a host this box neither routes nor backhauls, and not under a platform domain, answers 503 Retry-After 2 instead of the unknown-host 404; fixed log key; no new read, dial or store access; every other request unchanged (#1008);rev3=census-ruling-fix-dbforward-reuse-1032;basis=the drain tracking call now takes withDeclaredBodyEnd(r) instead of r: an HTTP/1 request with a declared Content-Length is served from there on with a body that answers EOF itself after those bytes (#1032), so a proxy transport's confirming read after sending the body upstream no longer lands on the server's closed request body and tears down the upstream connection; HTTP/2 requests are left as they are (Astra r1 P2); memory only, no read, dial or store access added file:ReadAll@20389,registry:Account@11147,registry:App@11171,registry:App@28184,registry:ClaimStamp@11201,registry:Gate@19363,registry:Gate@32575,registry:Gate@32635,registry:Gate@32693,registry:HA@15098,registry:HA@15440,registry:Host@11378,registry:Host@15479,registry:Host@32678,registry:ImportGate@41529,registry:Incarnation@11236,registry:Kind@25218,registry:Kind@27046,registry:Kind@30484,registry:Kind@41471,registry:Kind@41500,registry:ServingSeq@11270,whole:Route@11150,whole:Route@11174,whole:Route@11204,whole:Route@11239,whole:Route@11273,whole:Route@11381,whole:Route@15101,whole:Route@15195,whole:Route@15443,whole:Route@15482,whole:Route@19258,whole:Route@19369,whole:Route@22186,whole:Route@22970,whole:Route@23428,whole:Route@23620,whole:Route@25221,whole:Route@27049,whole:Route@28110,whole:Route@28176,whole:Route@28187,whole:Route@28440,whole:Route@28535,whole:Route@28611,whole:Route@28655,whole:Route@28957,whole:Route@28987,whole:Route@30487,whole:Route@30772,whole:Route@32578,whole:Route@32638,whole:Route@32681,whole:Route@32696,whole:Route@33907,whole:Route@36195,whole:Route@41474,whole:Route@41503,whole:Route@41532,whole:Route@41564,whole:Route@44009,whole:Route@8563,whole:Route@8662,whole:Route@8768 68f139634762585f25438c5fea17378901841e1ef50dd30cdb8ebb01d1d47b4b
+internal/edge/edge.go declaredBody.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-fix-dbforward-reuse-1032;basis=new: reads at most the declared remaining bytes from the wrapped request body (the visitor's request body, not a file) and answers io.EOF once they are read; the whole Read (length checks, inner read, decrement) holds the wrapper's mutex so the transport and finishEarlyAnswer's overlapping reads are serialised as net/http's body serialises them, and Close does not take it (Astra r1 P1); the two +file:Read sites are the wrapped body's Read; no file, registry or bucket read file:Read@187,file:Read@23 5fdb194f00006c4179a6f88a9dec733f307c9b1ef820810b7356294e6c719f16
+@coverage internal/edge 48835da88ac7cd2c06b5916d7df5e208de2412eb8270b175ee94311c127d45e9