carlos / platform Public

fix: bound only retryable replica attempts before headers

Keep slow writes and final replica attempts on legacy header waits.
Start eligible read timers after upload completion, preserve dispatch
history for exhausted retries, and prefer headers over timer races.

Cover slow requests, uploads, informational responses and deterministic
header/timer races over real h2 channels. Refresh the census envelope.
Co-Authored-By: Codex (gpt-6-astra) <noreply@openai.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev c5da45ae9f7f40045e0ac5993521df0ab5c06bb7 parent fb2c715
3 files changed, +227 −14
  • internal/edge/replica_retry_test.go +157 −0
  • internal/edge/replicaproxy.go +69 −13
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv +1 −1

Intent

Human

<task-notification> <task-id>bz244eksz</task-id> <tool-use-id>toolu_011fUhsYvjtkbL3MfBgH8kpj</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/bz244eksz.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 2" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>ab8ece0b2d8356e72</task-id> <tool-use-id>toolu_018W5qzKWSoL8vDt2xpC3Fy3</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/ab8ece0b2d8356e72.output</output-file> <status>completed</status> <summary>Agent "Task 2 review (spec + quality)" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>I've reviewed Task 2 and written the review to `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/stateless-replicas-3/.superpowers/sdd/2026-11-01-stateless-replicas-3-routing/task-2-review.md`. Everything else matches the brief, but one requirement was misread (I1), so the task needs a fix round. - **Spec verdict:** โŒ for I1 only. Three items can't be checked from this diff: - zero bucket calls end to end (Task 3's budget test covers it); - hub-versus-box billing once the replica proxy is wired into Reload (Task 3); - Paul's copy review of SR-3-C01/C02. The text matches the deck word for word. - **Quality verdict:** Needs fixes. - **Counts:** Critical 0, Important 1, Minor 6. **I1 (Important):** `internal/edge/replicaproxy.go:117-120`. Every request on a replicated app is cancelled if it has no response headers after 3 s, whatever the method and even on the last copy. Upload time counts toward the 3 s. As a result: - a healthy POST or upload that takes longer than 3 s gets a 502; - a slow GET runs on two copies and then gets a 502. Single-copy apps have no such limit today: the existing tunnel and fleet proxies have no header timeout, and the backhaul allows 30 s. The plan's wording ("each attempt at most 3 seconds before headers") can be read as requiring this, so it may be plan-mandated and needs a controller ruling. My suggested fix is to apply the 3 s limit only when it expires on a GET or HEAD that still has an untried copy to fall back to.</result> <usage><subagent_tokens>122053</subagent_tokens><tool_uses>17</tool_uses><duration_ms>201334</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a1eebc259e0c9d121</task-id> <tool-use-id>toolu_01FroqzASdSZtjQZ8VQiHVNT</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/a1eebc259e0c9d121.output</output-file> <status>completed</status> <summary>Agent "Task 2 census review" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**APPROVE** **Seal:** `59c0891618b9befae27ebe04d0a67b08c7f7658bca9f1c78bf6d05eb7a708e82` โ†’ `00eef8089c6cd9ba4725c22c618e871d3b038c958b3db906e1fc6af49ef9a65f`. `make census-card` reports the census clean at that seal, and the chain line matches. The core census tests pass. The same 13 fixture tests as Task 1 fail, each only on the sandbox's read-only `~/.cache/go-build`. Findings, one line each: - **Carried over:** Task 1's 17 new units, its body and sites rows and its claims are byte-identical. The overlay only adds the `requestResponse` row, the re-pinned edge and replicas envelopes, and a new reqrec envelope. - **`internal/edge/reqrecords.go:41-53` `requestResponse` (body):** keeps its prior basis, with the claim appended and the same four read sites. The only addition reads the box and attempt count from an in-memory request context value (`outcomeFrom`). Approve. - **`internal/edge/replicaproxy.go:65-166`:** it reads nothing on disk or in a bucket and has no wake. It uses only in-memory prober state (`Live`, `Eject`) and the hub's channel table. Zero bucket calls per request is confirmed. - **No body replay** (`replicaproxy.go:100-103,128,152-158`, `internal/replicas/retry.go:5-7`, `internal/edge/tunnel.go:606-617`): the lower transport never gets `GetBody`, and only GET or HEAD retry after dispatch. Any 1xx or returned response ends retries. A failed dispatch counts as a pre-dispatch failure only when the tunnel channel is missing. - **Upgrades** still pass the existing admission, caps and reservation checks (`internal/edge/tunnel.go:511-541`). No check is weakened. - **`internal/edge/edge.go:4838-4847` `tunnelRewrite`:** a byte-for-byte factoring of the two old closures. It still strips the probe marker on every tunnel dispatcher, the new replica proxy included. - **No leaks:** the new error text is fixed (SR-3-C01/C02), and nothing writes tokens, environment or socket paths to the client. - **N4 resolved:** `internal/edge/replicaprober.go:343` now ages samples out by `ObservedAt`. - **N5 (non-blocking), `internal/reqrec/recorder.go:423`:** `selected_box` puts a fleet box label in tenant-visible logs. Confirm that is acceptable for managed fleets before Task 3 wires the proxy. - **N6 (non-blocking), `internal/edge/replicaproxy.go:82`:** the `started` flag is shared across attempts. It is harmless today. The review is in `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/stateless-replicas-3/.superpowers/sdd/2026-11-01-stateless-replicas-3-routing/task-2-census-review.md`.</result> <usage><subagent_tokens>84640</subagent_tokens><tool_uses>17</tool_uses><duration_ms>196592</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>b8cmf7mkc</task-id> <tool-use-id>toolu_01JuWwuzwqytQe5RkEdnJSRE</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/b8cmf7mkc.output</output-file> <status>completed</status> <summary>Background command "Wait for Task 2 fix or F8 round 2" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 19.0 g CO₂e (2,145,523 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on stateless-replicas-3-routing, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.

diff --git a/internal/edge/replica_retry_test.go b/internal/edge/replica_retry_test.go
index cb150043b..68116b69b 100644
--- a/internal/edge/replica_retry_test.go
+++ b/internal/edge/replica_retry_test.go
@@ -4,6 +4,7 @@ import (
"context"
"io"
"net/http"
+ "net/http/httptest"
"strings"
"sync/atomic"
"testing"
@@ -202,3 +203,159 @@ func TestReplicaNoHealthyCopiesAfterMissingChannels(t *testing.T) {
t.Fatal("missing set was not closed and reported unavailable")
}
}
+
+// Q17: a slow healthy request must keep the legacy header-wait behavior
+// when its expiry cannot safely lead to another attempt.
+func TestReplicaSlowNonRetryableAndLastAttempt(t *testing.T) {
+ for _, scenario := range []string{"POST", "GET last copy", "GET final attempt", "GET one-shot body"} {
+ t.Run(scenario, func(t *testing.T) {
+ var slowCalls, otherCalls atomic.Int32
+ slow := func(w http.ResponseWriter, r *http.Request) {
+ slowCalls.Add(1)
+ if _, err := io.Copy(io.Discard, r.Body); err != nil {
+ return
+ }
+ timer := time.NewTimer(5 * time.Second)
+ defer timer.Stop()
+ select {
+ case <-timer.C:
+ w.WriteHeader(204)
+ case <-r.Context().Done():
+ }
+ }
+ other := func(w http.ResponseWriter, r *http.Request) { otherCalls.Add(1); panic(http.ErrAbortHandler) }
+ handlers := []http.HandlerFunc{slow, other}
+ method := "GET"
+ var body io.Reader
+ wantAttempts, wantOthers := 1, int32(0)
+ switch scenario {
+ case "POST":
+ method = "POST"
+ body = strings.NewReader("upload")
+ case "GET last copy":
+ handlers = []http.HandlerFunc{slow}
+ case "GET final attempt":
+ handlers = []http.HandlerFunc{other, slow}
+ wantAttempts, wantOthers = 2, 1
+ case "GET one-shot body":
+ body = io.NopCloser(strings.NewReader("once"))
+ }
+ h, p, rt := replicaProxyFixture(t, handlers...)
+ req, out := withOutcome(replicaDispatchRequest(t, method, body))
+ if scenario == "GET one-shot body" {
+ // Match an inbound request with an unknown-length upload.
+ // ReverseProxy treats an inbound ContentLength of 0 as empty.
+ req.ContentLength = -1
+ }
+ w := httptest.NewRecorder()
+ replicaProxy(rt.Host, "pi", p, h).ServeHTTP(w, req)
+ if w.Code != 204 || slowCalls.Load() != 1 || otherCalls.Load() != wantOthers || out.replicaAttempts != wantAttempts {
+ t.Fatalf("slow request: status=%d slow=%d other=%d attempts=%d", w.Code, slowCalls.Load(), otherCalls.Load(), out.replicaAttempts)
+ }
+ })
+ }
+}
+
+func TestReplicaReplayableUploadExcludedFromHeaderWait(t *testing.T) {
+ var calls atomic.Int32
+ h, p, rt := replicaProxyFixture(t, func(w http.ResponseWriter, r *http.Request) {
+ calls.Add(1)
+ b, err := io.ReadAll(r.Body)
+ if err != nil {
+ return
+ }
+ if string(b) != "upload" {
+ t.Errorf("body = %q", b)
+ }
+ w.WriteHeader(204)
+ }, func(http.ResponseWriter, *http.Request) { t.Error("upload time caused a retry") })
+ reader, writer := io.Pipe()
+ defer reader.Close()
+ defer writer.Close()
+ req, out := withOutcome(replicaDispatchRequest(t, "GET", reader))
+ req.GetBody = func() (io.ReadCloser, error) { return io.NopCloser(strings.NewReader("upload")), nil }
+ done := make(chan struct{})
+ go func() {
+ defer close(done)
+ timer := time.NewTimer(5 * time.Second)
+ defer timer.Stop()
+ select {
+ case <-timer.C:
+ io.WriteString(writer, "upload")
+ case <-req.Context().Done():
+ }
+ writer.Close()
+ }()
+ resp, err := replicaProxy(rt.Host, "pi", p, h).Transport.RoundTrip(req)
+ if resp != nil {
+ resp.Body.Close()
+ }
+ reader.Close()
+ select {
+ case <-done:
+ case <-time.After(6 * time.Second):
+ t.Fatal("upload fixture did not stop")
+ }
+ if err != nil || resp.StatusCode != 204 || calls.Load() != 1 || out.replicaAttempts != 1 {
+ t.Fatalf("upload: response=%v err=%v calls=%d attempts=%d", resp, err, calls.Load(), out.replicaAttempts)
+ }
+}
+
+func TestReplicaDispatchedThenMissingIsNotFleetDark(t *testing.T) {
+ // A is a real dispatch that closes its channel; B disappears only in
+ // the dispatch hub, after the health set was captured. Both end ejected.
+ var dispatch *TunnelHub
+ h, p, rt := replicaProxyFixture(t, func(http.ResponseWriter, *http.Request) { dispatch.CloseChannel("pi/box-00") }, func(http.ResponseWriter, *http.Request) { t.Error("missing B dispatched") })
+ dispatch = NewTunnelHub("tunnel.example.com", nil)
+ dispatch.conns["pi/box-00"] = h.channel("pi/box-00")
+ req, out := withOutcome(replicaDispatchRequest(t, "GET", nil))
+ w := httptest.NewRecorder()
+ replicaProxy(rt.Host, "pi", p, dispatch).ServeHTTP(w, req)
+ if w.Code != 502 || w.Header().Get("Retry-After") != "" || strings.Contains(w.Body.String(), replicaUnavailable) || out.replicaAttempts != 2 || len(p.Live(rt.Host)) != 0 {
+ t.Fatalf("dispatched request misclassified: status=%d body=%q attempts=%d live=%d", w.Code, w.Body.String(), out.replicaAttempts, len(p.Live(rt.Host)))
+ }
+}
+
+// Keep response-start refusal under Q17: after 103 the same slow request
+// cannot be retried, so its failover timer must no longer cancel it.
+func TestReplicaInformationalResponseStopsHeaderTimer(t *testing.T) {
+ h, p, rt := replicaProxyFixture(t, func(w http.ResponseWriter, r *http.Request) {
+ w.WriteHeader(http.StatusEarlyHints)
+ timer := time.NewTimer(5 * time.Second)
+ defer timer.Stop()
+ select {
+ case <-timer.C:
+ w.WriteHeader(204)
+ case <-r.Context().Done():
+ }
+ }, func(http.ResponseWriter, *http.Request) { t.Error("response-started request repeated") })
+ resp, err := replicaProxy(rt.Host, "pi", p, h).Transport.RoundTrip(replicaDispatchRequest(t, "GET", nil))
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer resp.Body.Close()
+ if resp.StatusCode != 204 {
+ t.Fatalf("status=%d", resp.StatusCode)
+ }
+}
+
+func TestReplicaHeadersWinTimerRace(t *testing.T) {
+ h, p, rt := replicaProxyFixture(t, func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(204) }, func(http.ResponseWriter, *http.Request) { t.Error("successful response retried") })
+ proxy := replicaProxy(rt.Host, "pi", p, h)
+ transport := proxy.Transport.(*replicaTransport)
+ // Headers have already returned successfully. Hold the proxy precisely
+ // here until its real timer fires, making Stop return false deterministically.
+ transport.afterRoundTrip = func(ctx context.Context) {
+ select {
+ case <-ctx.Done():
+ case <-time.After(5 * time.Second):
+ t.Error("eligible attempt timer did not fire")
+ }
+ }
+ req, out := withOutcome(replicaDispatchRequest(t, "GET", nil))
+ w := httptest.NewRecorder()
+ proxy.ServeHTTP(w, req)
+ if w.Code != 204 || out.replicaAttempts != 1 {
+ t.Fatalf("headers discarded: status=%d attempts=%d", w.Code, out.replicaAttempts)
+ }
+}
diff --git a/internal/edge/replicaproxy.go b/internal/edge/replicaproxy.go
index 73e0e715f..52010e6f6 100644
--- a/internal/edge/replicaproxy.go
+++ b/internal/edge/replicaproxy.go
@@ -35,6 +35,8 @@ type replicaTransport struct {
p *replicaProber
hub *TunnelHub
cursor atomic.Uint64
+ // Test seam for the interval between transport completion and timer stop.
+ afterRoundTrip func(context.Context)
}
func replicaProxy(host, fleet string, p *replicaProber, hub *TunnelHub) *httputil.ReverseProxy {
@@ -78,7 +80,7 @@ func (t *replicaTransport) RoundTrip(req *http.Request) (*http.Response, error)
start := (t.cursor.Add(1) - 1) % uint64(len(live))
last := errReplicaUnavailable
attempts := 0
- var dispatched bool
+ var dispatched, anyDispatched bool
var started atomic.Bool
for i := 0; i < len(live); i++ {
if err := req.Context().Err(); err != nil {
@@ -114,12 +116,63 @@ func (t *replicaTransport) RoundTrip(req *http.Request) (*http.Response, error)
o.replicaBox = box
o.replicaAttempts = attempts
}
- // The deadline ends at headers. Cancellation stays attached until the
- // response body (or upgraded connection) closes, without a stream TTL.
+ // Only a replayable read with another live candidate gets a header
+ // timer. Slow writes and the last attempt retain legacy behavior.
+ canTimeOut := false
+ if replicas.RetryAllowed(req.Method, true, started.Load()) && (body == nil || req.GetBody != nil) {
+ current := t.p.Live(t.host)
+ for j := i + 1; j < len(live) && !canTimeOut; j++ {
+ next := live[(int(start)+j)%len(live)]
+ for _, c := range current {
+ if c.Box == next.Box && c.Incarnation == next.Incarnation {
+ canTimeOut = true
+ break
+ }
+ }
+ }
+ }
ctx, cancel := context.WithCancel(req.Context())
- timer := time.AfterFunc(replicaAttemptTimeout, cancel)
+ var timerMu sync.Mutex
+ var timer *time.Timer
+ headersDone := false
+ startTimer := func() {
+ timerMu.Lock()
+ defer timerMu.Unlock()
+ if canTimeOut && !headersDone && timer == nil {
+ timer = time.AfterFunc(replicaAttemptTimeout, func() {
+ timerMu.Lock()
+ defer timerMu.Unlock()
+ if !headersDone {
+ cancel()
+ }
+ })
+ }
+ }
+ stopTimer := func() {
+ timerMu.Lock()
+ defer timerMu.Unlock()
+ headersDone = true
+ if timer != nil {
+ timer.Stop()
+ }
+ }
+ hasBody := body != nil
+ if !hasBody {
+ startTimer()
+ }
ctx = httptrace.WithClientTrace(ctx, &httptrace.ClientTrace{
- Got1xxResponse: func(int, textproto.MIMEHeader) error { started.Store(true); return nil },
+ Got1xxResponse: func(int, textproto.MIMEHeader) error {
+ started.Store(true)
+ stopTimer()
+ return nil
+ },
+ WroteRequest: func(info httptrace.WroteRequestInfo) {
+ // Upload time never consumes the header wait. The mutex also
+ // prevents a late write callback arming after headers arrived.
+ if info.Err == nil && hasBody {
+ startTimer()
+ }
+ },
})
attempt := req.Clone(ctx)
attempt.Body = body
@@ -127,10 +180,16 @@ func (t *replicaTransport) RoundTrip(req *http.Request) (*http.Response, error)
// loop; never expose GetBody to a lower transport or an upgrade helper.
attempt.GetBody = nil
resp, didDispatch, err := t.hub.replicaRoundTrip(t.fleet+"/"+box, attempt)
+ if t.afterRoundTrip != nil {
+ t.afterRoundTrip(ctx)
+ }
dispatched = didDispatch
+ anyDispatched = anyDispatched || dispatched
owned = owned || dispatched
- stopped := timer.Stop()
- if err == nil && stopped && ctx.Err() == nil {
+ stopTimer()
+ // Headers already returned by RoundTrip win even if cancellation
+ // raced them. Never turn a successful response into a proxy 502.
+ if err == nil {
if rw, ok := resp.Body.(io.ReadWriteCloser); ok {
resp.Body = &replicaResponseConn{ReadWriteCloser: rw, cancel: cancel}
} else {
@@ -138,16 +197,13 @@ func (t *replicaTransport) RoundTrip(req *http.Request) (*http.Response, error)
}
return resp, nil
}
- // Even if the timer won at the headers boundary, a returned response
- // ends retry authority. No status, including 500 or 101, is failover.
+ // A returned response ends retry authority even on an error path.
+ // No status, including 500 or 101, is failover.
responseStarted := started.Load() || resp != nil
if resp != nil && resp.Body != nil {
resp.Body.Close()
}
cancel()
- if err == nil {
- err = context.DeadlineExceeded
- }
last = err
if dispatched && body != nil {
body.Close()
@@ -159,7 +215,7 @@ func (t *replicaTransport) RoundTrip(req *http.Request) (*http.Response, error)
return nil, &replicaUnrepeatedError{last}
}
}
- if !dispatched && len(t.p.Live(t.host)) == 0 {
+ if !anyDispatched && len(t.p.Live(t.host)) == 0 {
return nil, errReplicaUnavailable
}
return nil, last
diff --git a/internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv b/internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv
index 67b505b90..08ed48bd6 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv
@@ -43,7 +43,7 @@ internal/edge/tunnel.go tunnelWire.Read legacy accepted-legacy accepted-legacy;r
internal/host/replicahealth_linux.go serveReplicaHealth legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: Lstat checks the fixed agent-owned /run/carlos/.replicas directory and health.sock; Open opens that directory read-only for flock. Require directory ownership and mode 0700, socket 0600, preserve live/non-socket/ambiguous existing paths, and only remove proven stale sockets under the lock. Read-only snapshot handler, bounded shutdown and listener-owned unlink; not mounted into tenant namespaces. No root read of tenant-controlled input. file:Lstat@252,file:Lstat@906,file:Open@650 1ff1e05ec8222c2adf684421e40eb55c7590beba28a725e5035b08da04042cb2
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. file:ReadAll@15522,registry:App@21679,registry:Gate@14496,registry:Gate@26070,registry:Gate@26130,registry:Gate@26188,registry:Host@26173,registry:ImportGate@33573,registry:Kind@20541,registry:Kind@23979,registry:Kind@33515,registry:Kind@33544,whole:Route@14391,whole:Route@14502,whole:Route@17319,whole:Route@18103,whole:Route@18561,whole:Route@18753,whole:Route@20544,whole:Route@21605,whole:Route@21671,whole:Route@21682,whole:Route@21935,whole:Route@22030,whole:Route@22106,whole:Route@22150,whole:Route@22452,whole:Route@22482,whole:Route@23982,whole:Route@24267,whole:Route@26073,whole:Route@26133,whole:Route@26176,whole:Route@26191,whole:Route@27109,whole:Route@29172,whole:Route@33518,whole:Route@33547,whole:Route@33576,whole:Route@33608,whole:Route@35456,whole:Route@5576,whole:Route@5671 d86bb163dfe6c165cad91eb2a4713f3f862d6128a8ec59808e6dc638c3d44a49
@coverage internal/activator c5b02ec2a8b43a6ec7472b2f70d2d2a7d81a6e9fea126d398aca21ae46b5ca6f
-@coverage internal/edge ab38d53cf6d787b4747b0c8ad33e1e0b25cd9c8cfc786e8cc6a87e2e78915eee
+@coverage internal/edge b9b517d13731206a94d26de4b625366f9e629350d325f09c73402a23dad348f3
@coverage internal/host 8202b947824702b5897bdb32875ea7ab1386bd0b8f077f5ec1d506c2038f565a
@coverage internal/replicas 550a02209630a661b8d786822fd51607a4d0481af9ea79e91d270faa1a70d942
@coverage internal/reqrec 384ce988cf87bb60daac7b64f4f398f79b6e09d475698263c5c5b0f36a512ae9