carlos / platform Public

edge: replica calls go to an operator-set console address

Cherry-pick of 0ac75766 (main) onto release-v0.35.2 (v0.35.1) for the
v0.35.2 hotfix. Code and witnesses are identical to main. The census
overlay replica-console-account is re-proposed on this base: the chain
seal goes from 19c9f395 to e1b40925 (main: 846d1f22 to 87e151a5), and the
card is identical apart from the seals.

CARLOS_REPLICA_CONSOLE_ADDR (hub host.env, a literal loopback ip:port)
sends fleet replica calls to that console address and reads no route
data; unset, behaviour is unchanged (#511, #1007).

(cherry picked from commit 0ac757663bbef0733c09b33e8470421e84525c9d)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 5eb788975cece9648ac1a7e2b036a44e5631b615 parent 7d168df
6 files changed, +305 −5
  • docs/superpowers/notes/census-proposal-replica-console-account.md +19 −0
  • internal/edge/edge.go +13 −1
  • internal/edge/replicaconsole.go +96 −4
  • internal/edge/replicaconsole_test.go +171 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-replica-console-account.tsv +5 −0

CI passed — run details

Intent

Human

<paseo-system version="1" kind="agent-message" source-agent-id="8a3d302a-eac7-407c-b61c-f5ccc66b5544" message-id="4e340d57-9036-4bf9-a594-a49b756e5a63"> Agent manager 8a3d302 to platform-a9: thanks. Release agent 2db0f16f pushed branch release-v0.35.2 at v0.35.1 and needs YOU to put 0ac75766 on it with the census seal recomputed on that base (only author/reviewer produce seals). Please do that (Astra census check on the hotfix base if the seal changes), push, and tell 2db0f16f when its CI is green. </paseo-system>

Human

<task-notification> <task-id>b93m7l5un</task-id> <tool-use-id>toolu_01YJWqDTz1sYFFfmGwFVDGQF</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/72128d15-58b8-452f-9f7e-8e864e8854d2/tasks/b93m7l5un.output</output-file> <status>completed</status> <summary>Background command "Send the merge SHA to the release agent and 8a3d302" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 20.8 g CO₂e (2,648,490 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on hotfix-v0.35.2-console, 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/docs/superpowers/notes/census-proposal-replica-console-account.md b/docs/superpowers/notes/census-proposal-replica-console-account.md
new file mode 100644
index 000000000..5addacda7
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-replica-console-account.md
@@ -0,0 +1,19 @@
+# Census approval: replica-console-account
+
+Ruling `census-ruling-replica-console-account`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/edge/replicaconsole.go` `Edge.serveReplicaConsole` | body | unchanged (6) | when operator config CARLOS_REPLICA_CONSOLE_ADDR (hub host.env, read once in enableTunnelsFromEnv, refused at load unless a literal loopback IP and port) is set, replica calls go to a proxy built only from that address, stamping the hub build as X-Carlos-Version; no route field is read, so records can neither choose, redirect nor disable the endpoint. Unset, the selection is byte-identical to main (accountless console.service local route). Witnesses TestReplicaConsoleConfiguredEndpoint (distinct destinations, injected and rewritten rows, endpoint down), TestReplicaConsoleUnconfiguredIgnoresAccountRows, TestParseReplicaConsoleAddr, TestReplicaConsoleAddrFromHostEnv. Same reads, no new read source, no write. |
+
+Envelopes re-pinned: `internal/edge`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/edge/replicaconsole.go` `Edge.serveReplicaConsole`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-stateless-coordinator-route;basis=Reads existing in-memory route fields to select a unique accountless console.service local upstream; refuses missing or ambiguous console, tenant routes, remote and tunnel upstreams. Reuses proxy and version wrapper; leaves fleet identity authentication at console.;rev3=census-ruling-retry-after-503;basis=the missing/ambiguous-console 503s go through UnavailableHeader (adds Retry-After 2 and answer/box headers); selection unchanged; no read added
+
+Seal: `19c9f395547d998f4b5e87e89c0dfa3b5f012d177a87eb5010a8c4defac305dc` → `e1b409253683d1a3329f3de2db293c6313b7d052b1f58249ebf3c72cc24c5aee`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-replica-console-account.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index 57e8ca19c..f6fc9eadb 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -115,7 +115,11 @@ type Activator interface {
// its backend. The host→backend map is swapped atomically, so reloads and
// zero-downtime deploys never drop a live connection.
type Edge struct {
- shutdownStarted func(time.Time)
+ shutdownStarted func(time.Time)
+ // replicaConsole forwards fleet replica calls to the operator-configured
+ // console endpoint (replicaConsoleAddrEnv); nil uses the accountless
+ // console.service route. Set before serving.
+ replicaConsole http.Handler
haIngress atomic.Pointer[haIngressLookup]
haIngressBlocked atomic.Pointer[map[string]bool]
// ReplicaProbe is configured before the first syncReplicaProbes call.
@@ -5453,6 +5457,14 @@ func enableTunnelsFromEnv(e *Edge) error {
return fmt.Errorf("CARLOS_TUNNEL_CLIENTS: %q is not a valid tunnel name — want [a-z0-9-]{1,32}, and it must match a route's --tunnel to carry anything", name)
}
}
+ consoleAddr, err := parseReplicaConsoleAddr(os.Getenv(replicaConsoleAddrEnv))
+ if err != nil {
+ return err
+ }
+ if consoleAddr != "" {
+ e.replicaConsole = newReplicaConsoleProxy(consoleAddr)
+ log.Printf("edge: fleet replica calls go to the console at %s (%s)", consoleAddr, replicaConsoleAddrEnv)
+ }
e.EnableTunnels(NewTunnelHub(host, clients))
// Rebuild the route table so tunnel-backed routes that were skipped (or
// left on their old socket/addr) by the startup reload pick up the hub,
diff --git a/internal/edge/replicaconsole.go b/internal/edge/replicaconsole.go
index 6af26c9f5..508310010 100644
--- a/internal/edge/replicaconsole.go
+++ b/internal/edge/replicaconsole.go
@@ -1,11 +1,103 @@
package edge
-import "net/http"
+import (
+ "fmt"
+ "net"
+ "net/http"
+ "net/http/httputil"
+ "net/netip"
+ "strconv"
+ "strings"
+ "time"
-// serveReplicaConsole reuses the local console route, including its version
-// header. Only POSTs on the reserved tunnel host enter here; other methods
-// keep the hub's 404. Authentication remains the console's fleetIdentityOK.
+ "github.com/carlosframework/platform/internal/version"
+)
+
+// replicaConsoleAddrEnv names, in the hub's host.env, the loopback address
+// of the console process the hub hands fleet boxes' replica calls to. It is
+// operator configuration, and the only source trusted for that endpoint:
+// route rows come from deployment records, and records are not a tenancy
+// boundary (a legacy direct-S3 fleet box can write them), so no route field
+// may choose, redirect or disable where those calls and their fleet bearer
+// tokens go. A self-hosted deployment whose console is installed into its
+// operator account sets it (Tito: 127.0.0.1:8090); the platform's own hubs
+// need not.
+const replicaConsoleAddrEnv = "CARLOS_REPLICA_CONSOLE_ADDR"
+
+// WithReplicaConsoleAddr configures the replica console endpoint (tests;
+// the process reads replicaConsoleAddrEnv in enableTunnelsFromEnv). addr
+// must already have passed parseReplicaConsoleAddr.
+func WithReplicaConsoleAddr(addr string) RunOption {
+ return func(e *Edge) { e.replicaConsole = newReplicaConsoleProxy(addr) }
+}
+
+// parseReplicaConsoleAddr checks replicaConsoleAddrEnv's value: unset is ""
+// and no error; otherwise a literal loopback IP and a port, so the endpoint
+// is always this box's own process. A host name (localhost included) or any
+// other address fails the boot, naming the variable.
+func parseReplicaConsoleAddr(raw string) (string, error) {
+ raw = strings.TrimSpace(raw)
+ if raw == "" {
+ return "", nil
+ }
+ host, port, err := net.SplitHostPort(raw)
+ if err != nil {
+ return "", fmt.Errorf("%s: %q is not ip:port: %v", replicaConsoleAddrEnv, raw, err)
+ }
+ ip, err := netip.ParseAddr(host)
+ if err != nil || !ip.IsLoopback() || ip.Zone() != "" {
+ return "", fmt.Errorf("%s: %q must be a loopback IP address, such as 127.0.0.1:8090", replicaConsoleAddrEnv, raw)
+ }
+ if n, err := strconv.Atoi(port); err != nil || n < 1 || n > 65535 {
+ return "", fmt.Errorf("%s: %q has no valid port", replicaConsoleAddrEnv, raw)
+ }
+ return net.JoinHostPort(ip.String(), port), nil
+}
+
+// newReplicaConsoleProxy forwards replica calls to the configured console
+// endpoint. Nothing in it comes from route data: the upstream is addr, and
+// X-Carlos-Version, which the box reads only as proof that the console
+// answered (internal/host replicaCoordinatorAPI.post), is this hub's own
+// build. A failed dial answers 502 with no version, which the box reads as
+// the console unreachable.
+func newReplicaConsoleProxy(addr string) http.Handler {
+ return &httputil.ReverseProxy{
+ Rewrite: func(pr *httputil.ProxyRequest) {
+ setForwarded(pr)
+ pr.Out.URL.Scheme = "http"
+ pr.Out.URL.Host = addr
+ pr.Out.Host = pr.In.Host
+ },
+ Transport: &http.Transport{
+ DialContext: (&net.Dialer{Timeout: 5 * time.Second}).DialContext,
+ MaxIdleConns: 8,
+ IdleConnTimeout: 90 * time.Second,
+ ResponseHeaderTimeout: 30 * time.Second,
+ },
+ ModifyResponse: func(resp *http.Response) error {
+ resp.Header.Set("X-Carlos-Version", version.Build)
+ return nil
+ },
+ ErrorHandler: func(w http.ResponseWriter, _ *http.Request, _ error) {
+ w.WriteHeader(http.StatusBadGateway)
+ },
+ }
+}
+
+// serveReplicaConsole hands a box's replica call to the console. Only POSTs
+// on the reserved tunnel host enter here; other methods keep the hub's 404.
+// Authentication remains the console's fleetIdentityOK.
+//
+// With replicaConsoleAddrEnv set, the call goes to that endpoint and route
+// data plays no part. Unset, the console is the one route for app console
+// with unit console.service and no account (the platform console's shape),
+// on a loopback upstream or a socket, not an alias, regional, via a tunnel
+// or activator-owned, and its proxy (with its version header) is reused.
func (e *Edge) serveReplicaConsole(w http.ResponseWriter, r *http.Request) {
+ if e.replicaConsole != nil {
+ e.replicaConsole.ServeHTTP(w, e.withForwardKey(r))
+ return
+ }
var console http.Handler
for host, up := range *e.upstreams.Load() {
rt := up.route
diff --git a/internal/edge/replicaconsole_test.go b/internal/edge/replicaconsole_test.go
index 277102b77..f665415a6 100644
--- a/internal/edge/replicaconsole_test.go
+++ b/internal/edge/replicaconsole_test.go
@@ -100,3 +100,174 @@ func TestFleetReplicaConsoleOnTunnelHost(t *testing.T) {
t.Fatalf("tenant console: %d", w.Code)
}
}
+
+// TestReplicaConsoleConfiguredEndpoint (#511): with CARLOS_REPLICA_CONSOLE_ADDR
+// set, a box's replica call goes to that endpoint and nowhere else, whatever
+// the registry holds. Route rows come from deployment records, which a
+// legacy direct-S3 fleet box can write: an injected console.service row, a
+// system console row, or the configured console's own row rewritten to
+// another loopback port neither take the call nor make it ambiguous. The
+// version header the box needs is the hub's build, never a route's.
+func TestReplicaConsoleConfiguredEndpoint(t *testing.T) {
+ server := func(name string, hits *atomic.Int32) *httptest.Server {
+ s := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+ hits.Add(1)
+ if r.Header.Get("Authorization") != "Bearer fleet-token" || r.URL.Path != "/api/fleet/replicas/a/app/h/coordinator" {
+ t.Errorf("%s got %s %v", name, r.URL, r.Header)
+ }
+ _, _ = io.WriteString(w, name)
+ }))
+ t.Cleanup(s.Close)
+ return s
+ }
+ var configuredHits, systemHits, injectedHits, rewrittenHits atomic.Int32
+ configured := server("configured", &configuredHits)
+ system := server("system", &systemHits)
+ injected := server("injected", &injectedHits)
+ rewritten := server("rewritten", &rewrittenHits)
+ addr, err := parseReplicaConsoleAddr(configured.Listener.Addr().String())
+ if err != nil {
+ t.Fatal(err)
+ }
+ reg := openReg(t)
+ rows := []registry.Route{
+ // Tito's shape: the console row in its operator account, at the
+ // configured address, plus the platform row for the same app.
+ {Host: "console.staging.example.com", Account: "bab", App: "console", Unit: "console.service", Kind: "instance", Addr: addr, Status: "ready", Version: "route-version"},
+ {Host: "console.bab.staging.example.com", Account: "bab", App: "console", Kind: "instance", Addr: addr, Status: "ready", Platform: true},
+ {Host: "console.test", App: "console", Unit: "console.service", Kind: "instance", Addr: system.Listener.Addr().String(), Status: "ready", Version: "route-version"},
+ {Host: "injected.test", Account: "x", App: "console", Unit: "console.service", Kind: "instance", Addr: injected.Listener.Addr().String(), Status: "ready", Version: "route-version"},
+ }
+ for _, rt := range rows {
+ if err := reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ }
+ e, err := New(reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer e.probers.Stop()
+ WithReplicaConsoleAddr(addr)(e)
+ e.EnableTunnels(NewTunnelHub("tunnel.test", nil))
+ post := func() *httptest.ResponseRecorder {
+ t.Helper()
+ req := httptest.NewRequest("POST", "https://tunnel.test/api/fleet/replicas/a/app/h/coordinator", strings.NewReader(`{"op":"acquire"}`))
+ req.Header.Set("Authorization", "Bearer fleet-token")
+ w := httptest.NewRecorder()
+ e.ServeHTTP(w, req)
+ return w
+ }
+ check := func(stage string) {
+ t.Helper()
+ w := post()
+ if w.Code != 200 || w.Body.String() != "configured" {
+ t.Fatalf("%s: %d %q", stage, w.Code, w.Body.String())
+ }
+ if v := w.Header().Get("X-Carlos-Version"); v == "" || v == "route-version" {
+ t.Fatalf("%s: version header %q, want the hub's build", stage, v)
+ }
+ }
+ check("configured")
+ // The configured console's own row rewritten to another loopback
+ // port, as a record writer could: the call still goes to the endpoint.
+ rows[0].Addr = rewritten.Listener.Addr().String()
+ if err := reg.Upsert(rows[0]); err != nil {
+ t.Fatal(err)
+ }
+ if err := e.Reload(); err != nil {
+ t.Fatal(err)
+ }
+ check("row rewritten")
+ if systemHits.Load()+injectedHits.Load()+rewrittenHits.Load() != 0 {
+ t.Fatalf("route upstreams reached: system %d injected %d rewritten %d", systemHits.Load(), injectedHits.Load(), rewrittenHits.Load())
+ }
+ // The endpoint down: 502 with no version, which the box reads as the
+ // console unreachable; no route upstream stands in.
+ configured.Close()
+ if w := post(); w.Code != http.StatusBadGateway || w.Header().Get("X-Carlos-Version") != "" {
+ t.Fatalf("endpoint down: %d %q", w.Code, w.Header().Get("X-Carlos-Version"))
+ }
+ if systemHits.Load()+injectedHits.Load()+rewrittenHits.Load() != 0 {
+ t.Fatal("a route upstream stood in for the configured endpoint")
+ }
+}
+
+// TestReplicaConsoleUnconfiguredIgnoresAccountRows: without the setting, an
+// account-owned console.service row beside the system console neither takes
+// the call nor makes it ambiguous, and alone it is not the console.
+func TestReplicaConsoleUnconfiguredIgnoresAccountRows(t *testing.T) {
+ var systemHits, ownedHits atomic.Int32
+ system := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { systemHits.Add(1) }))
+ defer system.Close()
+ owned := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { ownedHits.Add(1) }))
+ defer owned.Close()
+ ownedRow := registry.Route{Host: "console.staging.example.com", Account: "bab", App: "console", Unit: "console.service", Kind: "instance", Addr: owned.Listener.Addr().String(), Status: "ready", Version: "v"}
+ systemRow := registry.Route{Host: "console.test", App: "console", Unit: "console.service", Kind: "instance", Addr: system.Listener.Addr().String(), Status: "ready", Version: "v"}
+ for _, tc := range []struct {
+ name string
+ rows []registry.Route
+ code int
+ answer string
+ }{
+ {"system beside account-owned", []registry.Route{systemRow, ownedRow}, 200, ""},
+ {"account-owned alone", []registry.Route{ownedRow}, 503, "replica-console-missing"},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ systemHits.Store(0)
+ ownedHits.Store(0)
+ reg := openReg(t)
+ for _, rt := range tc.rows {
+ if err := reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ }
+ e, err := New(reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer e.probers.Stop()
+ e.EnableTunnels(NewTunnelHub("tunnel.test", nil))
+ w := httptest.NewRecorder()
+ e.ServeHTTP(w, httptest.NewRequest("POST", "https://tunnel.test/api/fleet/replicas/a/app/h/coordinator", strings.NewReader(`{}`)))
+ if w.Code != tc.code || w.Header().Get("X-Carlos-Answer") != tc.answer || ownedHits.Load() != 0 || (systemHits.Load() == 1) != (tc.code == 200) {
+ t.Fatalf("%d %q system %d owned %d", w.Code, w.Header().Get("X-Carlos-Answer"), systemHits.Load(), ownedHits.Load())
+ }
+ })
+ }
+}
+
+func TestParseReplicaConsoleAddr(t *testing.T) {
+ for in, want := range map[string]string{"": "", " 127.0.0.1:8090 ": "127.0.0.1:8090", "[::1]:8090": "[::1]:8090", "127.0.0.2:1": "127.0.0.2:1"} {
+ got, err := parseReplicaConsoleAddr(in)
+ if err != nil || got != want {
+ t.Errorf("%q: %q %v", in, got, err)
+ }
+ }
+ for _, bad := range []string{"localhost:8090", "10.0.0.1:8090", "0.0.0.0:8090", "console.example.com:8090", "127.0.0.1", "127.0.0.1:0", "127.0.0.1:65536", "127.0.0.1:http", "http://127.0.0.1:8090", "[fe80::1%eth0]:8090"} {
+ if got, err := parseReplicaConsoleAddr(bad); err == nil {
+ t.Errorf("%q accepted as %q", bad, got)
+ }
+ }
+}
+
+// TestReplicaConsoleAddrFromHostEnv: the hub reads the setting when it arms
+// its tunnels, and a bad value fails the boot.
+func TestReplicaConsoleAddrFromHostEnv(t *testing.T) {
+ reg := openReg(t)
+ e, err := New(reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ defer e.probers.Stop()
+ t.Setenv("CARLOS_FLEET", "")
+ t.Setenv("CARLOS_TUNNEL_HOST", "tunnel.test")
+ t.Setenv(replicaConsoleAddrEnv, "10.0.0.1:8090")
+ if err := enableTunnelsFromEnv(e); err == nil || !strings.Contains(err.Error(), replicaConsoleAddrEnv) {
+ t.Fatalf("bad value: %v", err)
+ }
+ t.Setenv(replicaConsoleAddrEnv, "127.0.0.1:8090")
+ if err := enableTunnelsFromEnv(e); err != nil || e.replicaConsole == nil {
+ t.Fatalf("good value: %v, configured %v", err, e.replicaConsole != nil)
+ }
+}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 5da2adc86..559d5f00f 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -207,3 +207,4 @@ plan14-root-reads-member-backups-2b.tsv 07b748a749084fdaf61c5087a6edfca8a7927396
plan14-root-reads-instance-gomemlimit-991.tsv 19c9f395547d998f4b5e87e89c0dfa3b5f012d177a87eb5010a8c4defac305dc
plan14-root-reads-ppv2-operator-copy.tsv 19c9f395547d998f4b5e87e89c0dfa3b5f012d177a87eb5010a8c4defac305dc
plan14-root-reads-fleet-tunnel-tls-state.tsv 19c9f395547d998f4b5e87e89c0dfa3b5f012d177a87eb5010a8c4defac305dc
+plan14-root-reads-replica-console-account.tsv e1b409253683d1a3329f3de2db293c6313b7d052b1f58249ebf3c72cc24c5aee
diff --git a/internal/provision/testdata/plan14-root-reads-replica-console-account.tsv b/internal/provision/testdata/plan14-root-reads-replica-console-account.tsv
new file mode 100644
index 000000000..1f9cca79e
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-replica-console-account.tsv
@@ -0,0 +1,5 @@
+# Census overlay replica-console-account, written by census-propose (#369). census-ruling-replica-console-account, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-replica-console-account.md.
+# 1 body, 0 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy 12edbd2e5eccec79415e4d335e95074759a35a5279200bf2500e4de01182b9f2 internal/edge/replicaconsole.go Edge.serveReplicaConsole legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-coordinator-route;basis=Reads existing in-memory route fields to select a unique accountless console.service local upstream; refuses missing or ambiguous console, tenant routes, remote and tunnel upstreams. Reuses proxy and version wrapper; leaves fleet identity authentication at console.;rev3=census-ruling-retry-after-503;basis=the missing/ambiguous-console 503s go through UnavailableHeader (adds Retry-After 2 and answer/box headers); selection unchanged; no read added;rev3=census-ruling-replica-console-account;basis=when operator config CARLOS_REPLICA_CONSOLE_ADDR (hub host.env, read once in enableTunnelsFromEnv, refused at load unless a literal loopback IP and port) is set, replica calls go to a proxy built only from that address, stamping the hub build as X-Carlos-Version; no route field is read, so records can neither choose, redirect nor disable the endpoint. Unset, the selection is byte-identical to main (accountless console.service local route). Witnesses TestReplicaConsoleConfiguredEndpoint (distinct destinations, injected and rewritten rows, endpoint down), TestReplicaConsoleUnconfiguredIgnoresAccountRows, TestParseReplicaConsoleAddr, TestReplicaConsoleAddrFromHostEnv. Same reads, no new read source, no write. registry:Account@332,registry:App@352,registry:Host@273,registry:Socket@450,registry:Unit@375,whole:Route@254 31e8a1bc5fd1903daed1e82189e214b46ba6348761f2300525788b6a90393f97
+internal/edge/replicaconsole.go Edge.serveReplicaConsole legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-coordinator-route;basis=Reads existing in-memory route fields to select a unique accountless console.service local upstream; refuses missing or ambiguous console, tenant routes, remote and tunnel upstreams. Reuses proxy and version wrapper; leaves fleet identity authentication at console.;rev3=census-ruling-retry-after-503;basis=the missing/ambiguous-console 503s go through UnavailableHeader (adds Retry-After 2 and answer/box headers); selection unchanged; no read added;rev3=census-ruling-replica-console-account;basis=when operator config CARLOS_REPLICA_CONSOLE_ADDR (hub host.env, read once in enableTunnelsFromEnv, refused at load unless a literal loopback IP and port) is set, replica calls go to a proxy built only from that address, stamping the hub build as X-Carlos-Version; no route field is read, so records can neither choose, redirect nor disable the endpoint. Unset, the selection is byte-identical to main (accountless console.service local route). Witnesses TestReplicaConsoleConfiguredEndpoint (distinct destinations, injected and rewritten rows, endpoint down), TestReplicaConsoleUnconfiguredIgnoresAccountRows, TestParseReplicaConsoleAddr, TestReplicaConsoleAddrFromHostEnv. Same reads, no new read source, no write. registry:Account@332,registry:App@352,registry:Host@273,registry:Socket@450,registry:Unit@375,whole:Route@254 31e8a1bc5fd1903daed1e82189e214b46ba6348761f2300525788b6a90393f97
+@coverage internal/edge c21d213f8c8d08e121493dc87a9211045ae20a45fc256b7dc672b8e6d09d24a1