carlos / platform Public

fix: keep replica copy data out of the tenant upstreams view

Publish historical copy evidence under a separate replica_copies heartbeat
key, leaving the tenant upstream view unchanged. Preserve the existing
bucket request budget and five-minute cadence.

Give invalid set rows internal structural diagnostics, correct tenancy
comments, and strengthen alias, removed-probe and production shutdown tests.
Co-Authored-By: Codex (gpt-6-astra) <noreply@openai.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev e7359225fdfbf5d90468f15f9c1ccd69c3abf7d4 parent 9a054d0
12 files changed, +269 −56
  • docs/superpowers/notes/census-proposal-stateless-replicas-3.md +7 −3
  • internal/edge/edge.go +4 −12
  • internal/edge/fleetforward.go +17 −2
  • internal/edge/replicaforward_test.go +48 −1
  • internal/edge/replicashutdown_linux_test.go +105 −0
  • internal/edge/upgrades.go +2 −2
  • internal/host/agent.go +30 −1
  • internal/host/replica_request_budget_test.go +22 −13
  • internal/host/replica_tunnel_e2e_test.go +6 −0
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv +13 −9
  • internal/status/snapshot.go +14 −12

CI passed — run details

Intent

Human

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

Human

<task-notification> <task-id>ac222dbcea11ef88a</task-id> <tool-use-id>toolu_01MCG2G251QaoJhzxRPdHBRw</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/ac222dbcea11ef88a.output</output-file> <status>completed</status> <summary>Agent "Task 3 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 `94200054efc8bc2fce33fba728d6578bb9f7742105f4a266ed92c9365931bf9c`. `make census-card` reports the census clean. The 13 `-run 'Census|RootReads'` failures all fail only on the read-only `~/.cache/go-build`, so they are environmental. Every Tasks 1-2 row approved at 00eef808 carries over byte-identical, except `Edge.syncReplicaProbes`, which is re-frozen with the Task 3 claim. Review written to `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/stateless-replicas-3/.superpowers/sdd/2026-11-01-stateless-replicas-3-routing/task-3-census-review.md`. Three findings, none blocking: 1. `internal/edge/fleetforward.go:59` refuses a set row on a box that has tunnels on but is not the hub, where it used to take ArmFleet. It fails closed (serves less, nothing new opened), so it is a code-review note, not a census issue. 2. `internal/edge/edge.go:1383` syncs replica probe jobs before the `beforePublish` hook at `edge.go:1384`, the same order the existing `e.probers.Sync` already uses. If that test-only hook fails, probes run for a set that was never published; they use no bucket and grant no authority. 3. `internal/status/snapshot.go:514`: copy versions, digests and boot IDs reported by member boxes now travel in the private heartbeat. They are identity-checked before storage, the socket path is stripped, no token or env field is included, and the console and CLI only display them. Recorded so they don't later become routing authority without a census card.</result> <usage><subagent_tokens>109536</subagent_tokens><tool_uses>30</tool_uses><duration_ms>302330</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>a98f2ff8eaab14317</task-id> <tool-use-id>toolu_01PfaJzGgkQgss8YsQcoLXu1</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/a98f2ff8eaab14317.output</output-file> <status>completed</status> <summary>Agent "Task 3 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 3 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-3-review.md`. **Spec verdict:** ❌, because of one finding (I1). Everything else I could check from the diff complies. **Quality verdict:** Needs fixes. **Counts:** 0 Critical, 1 Important, 8 Minor. There are also three items I couldn't verify from the diff: - Prober stop at shutdown goes through the unchanged Task 1b code; the new tests call the stop directly. - The report's red-run output shows only the host package, not the edge failures it describes. - The claim that the HA and legacy paths are byte-identical. **I1:** - **Where:** `edge.go:1558-1567` and `status/snapshot.go:514`. - **Problem:** Copy data travels in the existing upstreams block of the status report, which the console already copies into its tenant-facing instance list (`console/apiinstances.go:1075`, `:1330`). - **Effect:** For a set host, the console API now returns each copy's boot id, incarnation, digest and provisional SR-3 reason strings, and `carlos instances list` shows the copies in its UPSTREAMS column. "Up" there is the copy's raw healthy flag, without the 3-second aging that routing uses, so a stale copy can show as up. - **Why it matters:** Ruling Q6 and the plan gave that console surface to Plan 4.3. It is dormant while copies above 1 are refused. - **Fix:** Publish the copies under a separate metrics key (`replica_copies`, as the brief first named), or get a recorded ruling that accepts the exposure.</result> <usage><subagent_tokens>140085</subagent_tokens><tool_uses>34</tool_uses><duration_ms>357507</duration_ms></usage> </task-notification>

Human

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

Human

<task-notification> <task-id>a15166cded9a0712e</task-id> <tool-use-id>toolu_01VmoudcoH4yZQ8A67H7CFYP</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/195ef15b-aac6-42d6-b49b-41ffb7a4abbc/tasks/a15166cded9a0712e.output</output-file> <status>completed</status> <summary>Agent "F8 round 3 code 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>Verdict: NEEDS FIXES. The code is correct and the authority is tight. No-evidence behaviour is the same as today and the witness runs through the edge to the real console handler. But the fix probably doesn't fix F8 on dev. - **Critical C1 (`internal/host/fleetbind.go:392`, `:438`/`:465`, `:496-498`):** nothing in production writes a fleet binding for a stateless route on an unlabelled record. The wake hook and the startup pass both skip stateless routes. The stateless publisher only runs once the box already coordinates, and even then not for an unlabelled record. So an app that has only ever run stateless, or one whose only box was replaced, still gets a 404 forever. The witness writes the binding by hand. Before merging, check on dev that `fleets/r10r/bindings/&lt;host&gt;.json` exists, names the active box and has `bound_at &gt;= CreatedAt`. If it doesn't, the box side needs a publisher for these records, which is the manager's call. - **Important I1 (`internal/activator/coordinator.go:136`):** the "nothing periodic" claim is wrong. Once a box takes coordination it keeps it and renews every 5 minutes, and each renewal costs one binding GET per unlabelled app, forever. The money is tiny, but this is new per-app polling: either accept it explicitly in the report and proposal, or skip the binding read for renew/release by the box that already holds the lease. The review, with five minor findings and the checks that passed, is at /home/paulca/.cache/sr-f8/review-r3.md.</result> <usage><subagent_tokens>120343</subagent_tokens><tool_uses>34</tool_uses><duration_ms>340826</duration_ms></usage> </task-notification>

Attributed to this commit: 38.1 g CO₂e (4,757,536 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/docs/superpowers/notes/census-proposal-stateless-replicas-3.md b/docs/superpowers/notes/census-proposal-stateless-replicas-3.md
index 75b722a48..7abe9bd97 100644
--- a/docs/superpowers/notes/census-proposal-stateless-replicas-3.md
+++ b/docs/superpowers/notes/census-proposal-stateless-replicas-3.md
@@ -7,8 +7,10 @@ Ruling `census-ruling-stateless-replicas-3`. The independent reviewer approves o
| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority. |
| `internal/edge/fleetforward.go` `FleetArmVerdict` | body | unchanged (19) | Task 3: classify ArmReplica as fleet-served for the existing shared routing, edges-file and alias verdict. Existing field reads unchanged; pure in-memory decision, same owner and alias checks. |
| `internal/edge/reqrecords.go` `requestResponse` | body | unchanged (4) | Task 2: copy the final replica box and attempt count from the existing per-request outcome into additive reqrec.Response fields. Existing four Route reads unchanged; no new external read, path, credential or authority. The observer still records one client response at the hub; ordinary requests retain zero fields. |
-| `internal/host/agent.go` `runAgent` | body | unchanged (5) | Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. |
-| `internal/edge/edge.go` `Edge.Reload` | sites | +registry:Host ×4, +whole:Route ×8 | Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. |
+| `internal/host/agent.go` `runAgent` | body | unchanged (5) | Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority. |
+| `internal/host/agent.go` `statusLoop` | body | unchanged (6) | Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action. |
+| `internal/status/snapshot.go` `CollectBox` | body | unchanged (28) | Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read. |
+| `internal/edge/edge.go` `Edge.Reload` | sites | +registry:Host ×4, +whole:Route ×8 | Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. Fix round 1 M2: comment and whitespace correction only; read sites and routing behavior unchanged. |
| `internal/edge/edge.go` `Edge.ServeHTTP` | sites | +whole:Route | 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. |
Envelopes re-pinned: `internal/activator`, `internal/edge`, `internal/host`, `internal/replicas`, `internal/reqrec`, `internal/status`, `internal/tunnelclient`.
@@ -21,6 +23,8 @@ Recorded dispositions, which each change must still satisfy:
- `internal/edge/fleetforward.go` `FleetArmVerdict`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 fix round 3: the single fleet-arm refusal decision over one listing, used by Edge.Reload, the edges-file writer and the alias pass (parity by construction); returns the refused set with reasons and the accountless notes (+registry:Host x3, +registry:Status, +whole:Route x3). Pure; no I/O. Review R1 finding 2: also returns Served, each admitted row Reload sends through the fleet arm (a forward row, or a fleet-placed row with no Tunnel) with its fleet, app and the fleet owner from owners; a host the alias step refuses is dropped from it (+registry:App, +registry:Host, +registry:Region, +registry:Tunnel on the listing it already holds). Pure; no I/O. Review R2: the pre-fold fleet rows are now Arm; Served is the destination after the platform-alias fold: every ready, unrefused, non-sidecar row DispatchArm gives an entry, with its Arm fleet when its arm is a fleet's, folded by foldPlatformAliases (Reload's own fold), keeping the hosts that go to a fleet (+registry:Host, +registry:Status, +whole:Route on the listing it already holds). Pure; no I/O; refusals unchanged.
- `internal/edge/reqrecords.go` `requestResponse`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-edge-request-records;identity=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=new: a pure constructor: copies the account (release.RouteAccount of the route), app, host and environment of the route row the edge already resolved for this request, and the request's method, path, raw query, User-Agent, client address and GeoIP country (from the request context), with the status, into a reqrec.Response; the recorder masks the path, keeps only the query's names, and stores the client address only as its /24 (IPv6 /48) prefix and a day-salted hash before anything is stored; the account and app come from the route row, never the Host header; it reads no file, no store and no box state, writes nothing, and makes no decision; the class of Edge.emitEdgeError and UsageMeter.Record (J1 root-route)
- `internal/host/agent.go` `runAgent`: authority, task B,C,D,F. Basis: rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.
+- `internal/host/agent.go` `statusLoop`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.
+- `internal/status/snapshot.go` `CollectBox`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.
- `internal/edge/edge.go` `Edge.Reload`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.
- `internal/edge/edge.go` `Edge.ServeHTTP`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.;rev3=census-ruling-region-ha-p3a;basis=Complete the P3a cut: an exact peer name with no dial target answers the approved admission 503 before local wildcard dispatch or asset serving. ExactHome and lookupHome stop fallback at a present non-dial entry; backhaulTo refuses an empty target before signing or dialing. Retain Task 3 local admission and fixed platform/unit exemptions. Two added whole Route uses feed the local in-memory admission predicate; existing Route values and store/path reads are unchanged.;rev3=census-ruling-stateless-coordinator-route;basis=P24/P25: POST only, exact /api/fleet/replicas/ prefix on the reserved tunnel host calls the existing local console proxy only for an unescaped, already-clean path; malformed forms remain on the hub. No new read sites relative to origin/main. Merge with main 3487d6f6 retains its region HA admission checks before routing and after login target lookup, its empty-home refusal, and their two existing whole:Route reads; these change this unit's digest relative to the previously approved branch tip 92b24a7d.
@@ -46,6 +50,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- reads `internal/edge/fleetforward.go:DispatchArm`: +registry:FleetBoxes; keeps legacy, task accepted-legacy
- reads `internal/edge/fleetforward.go:FleetServeEligible`: +registry:Account, +registry:App, +registry:FleetBoxes, +registry:HA, +registry:Hibernate, +registry:Kind, +registry:Platform, +registry:Tunnel; keeps legacy, task accepted-legacy
-Seal: `59c0891618b9befae27ebe04d0a67b08c7f7658bca9f1c78bf6d05eb7a708e82` → `94200054efc8bc2fce33fba728d6578bb9f7742105f4a266ed92c9365931bf9c`.
+Seal: `59c0891618b9befae27ebe04d0a67b08c7f7658bca9f1c78bf6d05eb7a708e82` → `17c819e60e8273e6e37a2225583b185a82f224d021c84c067ef46ba581cd0eaa`.
Overlay: `internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index b31b578eb..995090997 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -552,8 +552,8 @@ type upstream struct {
regional regionalMode
regionalKey string
// tenancy is what this host is served under when it goes through a
- // tunnel (upgrades.go): set by Reload for ArmForward, ArmFleet and
- // ArmTunnel, zero for every other arm, copied by the alias folds with
+ // tunnel (upgrades.go): set by Reload for ArmForward, ArmFleet,
+ // ArmReplica and ArmTunnel, zero for every other arm, copied by the alias folds with
// the rest of the entry. An open upgrade stays only while the current
// map still serves its host with the tenancy it was admitted under.
tenancy tenancy
@@ -956,6 +956,7 @@ func (e *Edge) Reload() error {
served, viaFleet := verdict.Arm[t.Host]
arm := DispatchArm(t, viaFleet, e.tunnels != nil)
switch arm {
+ // Sets select only live assigned copies, before legacy fleet fallback.
case ArmReplica:
p := replicaProxy(t.Host, served.Fleet, e.replicaProberForRouting(), e.tunnels)
p.ModifyResponse = e.responseModifier(t)
@@ -973,7 +974,6 @@ func (e *Edge) Reload() error {
// one rule: the hub only, inert, on a fleet in this box's fleets
// table, its raw account the fleet's owner. An admitted forward row
// is always in Arm; one that is not is ArmNone, never another arm.
-
case ArmForward:
box, authoritative := fleetBoxOf(t)
p := fleetProxy(served.Fleet, box, authoritative, e.tunnels)
@@ -1556,15 +1556,7 @@ func (e *Edge) deploymentHosts() []string {
// route that stopped being probed is simply gone from the next call rather
// than lingering as a stale entry someone has to remember to evict.
func (e *Edge) UpstreamStates() map[string][]UpstreamState {
- out := e.probers.State()
- for host, snapshot := range e.ReplicaSnapshots() {
- states := make([]UpstreamState, 0, len(snapshot.Copies))
- for _, copy := range snapshot.Copies {
- states = append(states, UpstreamState{Addr: copy.Fleet + "/" + copy.Box, Up: copy.Healthy, Since: copy.ObservedAt, LastError: copy.Reason, ReplicaCopy: &copy})
- }
- out[host] = states
- }
- return out
+ return e.probers.State()
}
// Allowed reports whether host is configured — used as the autocert
diff --git a/internal/edge/fleetforward.go b/internal/edge/fleetforward.go
index 4c134b4e7..e5f5ad08c 100644
--- a/internal/edge/fleetforward.go
+++ b/internal/edge/fleetforward.go
@@ -56,8 +56,23 @@ func TunnelsArmed(getenv func(string) string) bool {
// invalid account into OpsAccount.
func FleetServeEligible(rt registry.Route, hub bool, owners map[string]string) (ok bool, why string) {
fleet, placed := registry.FleetPlacement(rt.Region)
- if rt.FleetBoxes != "" && (!hub || !rt.ValidReplicaProjection() || rt.Account == "" || rt.App == "" || rt.Platform || rt.HA || rt.Hibernate || rt.Tunnel != "" || (rt.Kind != "instance" && !rt.IsForward())) {
- return false, replicaUnavailable
+ if rt.FleetBoxes != "" {
+ switch {
+ case !hub:
+ return false, "replica set row on a box that is not the hub"
+ case !rt.ValidReplicaProjection():
+ return false, "replica set row has an invalid projection"
+ case rt.Account == "" || rt.App == "":
+ return false, "replica set row has no account or app"
+ case rt.Platform:
+ return false, "replica set row is platform-owned"
+ case rt.HA || rt.Hibernate:
+ return false, "replica set row carries HA or hibernation"
+ case rt.Tunnel != "":
+ return false, "replica set row carries an explicit tunnel"
+ case rt.Kind != "instance" && !rt.IsForward():
+ return false, "replica set row has an unsupported kind"
+ }
}
if rt.IsForward() {
if !hub {
diff --git a/internal/edge/replicaforward_test.go b/internal/edge/replicaforward_test.go
index d08d47eb3..f9c19384e 100644
--- a/internal/edge/replicaforward_test.go
+++ b/internal/edge/replicaforward_test.go
@@ -157,7 +157,10 @@ func TestReplicaAliasesPreserveSetAuthority(t *testing.T) {
}
if host == source.Host {
sourceSet = up.route.FleetBoxes
- } else {
+ } else if host != forward.Host {
+ if up.route.Host != source.Host {
+ t.Fatalf("alias %s uses probe key %s, want %s", host, up.route.Host, source.Host)
+ }
aliasSet = up.route.FleetBoxes
}
if sourceSet != "" && aliasSet != "" && sourceSet != aliasSet {
@@ -292,3 +295,47 @@ func TestReplicaReloadAndBindingRace(t *testing.T) {
t.Fatal("shutdown retained jobs")
}
}
+
+func TestReplicaStatusExcludesUpstreams(t *testing.T) {
+ e, rt, _ := replicaRoutingFixture(t, func(http.ResponseWriter, *http.Request) {})
+ if err := e.reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ if err := e.Reload(); err != nil {
+ t.Fatal(err)
+ }
+ if len(e.ReplicaSnapshots()[rt.Host].Copies) != 2 {
+ t.Fatal("missing copy observations")
+ }
+ if states := e.UpstreamStates(); len(states) != 0 {
+ t.Fatalf("replica copies exposed as tenant upstreams: %+v", states[rt.Host])
+ }
+}
+
+func TestReplicaStructuralRefusal(t *testing.T) {
+ _, rt := replicaHubFixture(t, 2)
+ rt.Status = "ready"
+ for _, tc := range []struct {
+ name string
+ mutate func(*registry.Route)
+ }{
+ {"projection", func(r *registry.Route) { r.Stateless = false }},
+ {"account", func(r *registry.Route) { r.Account = "" }},
+ {"app", func(r *registry.Route) { r.App = "" }},
+ {"platform", func(r *registry.Route) { r.Platform = true }},
+ {"ha", func(r *registry.Route) { r.HA = true }},
+ {"hibernate", func(r *registry.Route) { r.Hibernate = true }},
+ {"tunnel", func(r *registry.Route) { r.Tunnel = "t1" }},
+ {"kind", func(r *registry.Route) { r.Kind = "static" }},
+ } {
+ t.Run(tc.name, func(t *testing.T) {
+ bad := rt
+ tc.mutate(&bad)
+ verdict := FleetArmVerdict([]registry.Route{bad}, map[string]string{"pi": rt.Account}, true, true)
+ reason, refused := verdict.Refused[bad.Host]
+ if !refused || reason == "" || reason == replicaUnavailable || len(verdict.Arm) != 0 || len(verdict.Served) != 0 {
+ t.Fatalf("structural refusal misreported as health: %+v", verdict)
+ }
+ })
+ }
+}
diff --git a/internal/edge/replicashutdown_linux_test.go b/internal/edge/replicashutdown_linux_test.go
new file mode 100644
index 000000000..5b50ab67c
--- /dev/null
+++ b/internal/edge/replicashutdown_linux_test.go
@@ -0,0 +1,105 @@
+package edge
+
+import (
+ "context"
+ "os"
+ "os/exec"
+ "path/filepath"
+ "sync"
+ "syscall"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/replicas"
+)
+
+func TestReplicaEdgeShutdown(t *testing.T) {
+ if os.Getenv("CARLOS_TEST_REPLICA_SHUTDOWN") == "1" {
+ path := filepath.Join(os.Getenv("CARLOS_DATA_DIR"), "registry.db")
+ reg, err := registry.Open(path)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := reg.UpsertFleet(registry.Fleet{Name: "pi", Account: "bab", Bucket: "pi-data"}); err != nil {
+ t.Fatal(err)
+ }
+ rt := registry.Route{Host: "shop.example.com", Account: "bab", App: "shop", Kind: "instance", Status: "ready", Region: "fleet/pi", Stateless: true, FleetBoxes: `["box-00"]`, Copies: 2, ReplicaRevision: 1, ReplicaIncarnation: "life"}
+ if err := reg.Upsert(rt); err != nil {
+ t.Fatal(err)
+ }
+ if err := reg.Close(); err != nil {
+ t.Fatal(err)
+ }
+ started := make(chan struct{})
+ var once sync.Once
+ var running *Edge
+ var job *replicaJob
+ RunWithActivatorReady([]string{"-dev", "-registry", path, "-http", "127.0.0.1:0"}, nil, nil, func(e *Edge) {
+ running = e
+ if e.replicaProbes == nil {
+ t.Fatal("production Reload created no prober")
+ }
+ e.replicaProbes.mu.Lock()
+ job = e.replicaProbes.jobs[replicaSlot{rt.Host, "box-00"}]
+ e.replicaProbes.mu.Unlock()
+ if job == nil {
+ t.Fatal("production Reload created no job")
+ }
+ replicaConnect(e.tunnels, "pi/box-00")
+ select {
+ case <-started:
+ case <-time.After(4 * time.Second):
+ t.Fatal("production prober never started")
+ }
+ process, err := os.FindProcess(os.Getpid())
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := process.Signal(syscall.SIGTERM); err != nil {
+ t.Fatal(err)
+ }
+ }, func(e *Edge) {
+ e.ReplicaProbe = func(ctx context.Context, _, _ string) (replicas.Copy, error) {
+ once.Do(func() { close(started) })
+ <-ctx.Done()
+ return replicas.Copy{}, ctx.Err()
+ }
+ })
+ // Returning from the real listener/drain path must cancel and join the job.
+ if running == nil || job == nil {
+ t.Fatal("edge did not run")
+ }
+ select {
+ case <-job.done:
+ default:
+ t.Fatal("edge shutdown did not join replica job")
+ }
+ if job.ctx.Err() == nil {
+ t.Fatal("edge shutdown did not cancel replica job")
+ }
+ running.replicaProbes.mu.Lock()
+ stopped := running.replicaProbes.stopped
+ remaining := len(running.replicaProbes.jobs)
+ running.replicaProbes.mu.Unlock()
+ if !stopped || remaining != 0 || len(running.ReplicaSnapshots()) != 0 {
+ t.Fatal("edge shutdown retained replica probes")
+ }
+ return
+ }
+ exe, err := os.Executable()
+ if err != nil {
+ t.Fatal(err)
+ }
+ ctx, cancel := context.WithTimeout(t.Context(), 12*time.Second)
+ defer cancel()
+ cmd := exec.CommandContext(ctx, exe, "-test.run=^TestReplicaEdgeShutdown$", "-test.timeout=10s")
+ dd := t.TempDir()
+ cmd.Dir = dd
+ cmd.Env = []string{"HOME=" + dd, "TMPDIR=" + os.TempDir(), "CARLOS_DATA_DIR=" + dd, "CARLOS_TEST_REPLICA_SHUTDOWN=1", "CARLOS_TUNNEL_HOST=tunnel.example.com"}
+ output, err := cmd.CombinedOutput()
+ if err != nil {
+ t.Fatalf("edge shutdown child: %v\n%s", err, output)
+ }
+ t.Logf("production shutdown child:\n%s", output)
+}
diff --git a/internal/edge/upgrades.go b/internal/edge/upgrades.go
index 4e52f168d..e6a828baf 100644
--- a/internal/edge/upgrades.go
+++ b/internal/edge/upgrades.go
@@ -28,8 +28,8 @@ const tunnelUpgradeCap = 128
// tenancy is what a served host was admitted under (spec §4.6.1): the
// dispatch arm, and the account, app and fleet or tunnel the arm sends it
-// to. Reload sets it on the upstreams it builds for ArmForward and ArmFleet
-// (from FleetArmVerdict's Arm, the value that picks the proxy's fleet) and
+// to. Reload sets it on the upstreams it builds for ArmForward, ArmFleet
+// and ArmReplica (from FleetArmVerdict's Arm, which picks the fleet), and
// for ArmTunnel (from the row); every other entry has the zero tenancy. An
// alias copies its source's entry, and so its tenancy. Nothing else
// computes it.
diff --git a/internal/host/agent.go b/internal/host/agent.go
index 8c9661bcf..d86d795c8 100644
--- a/internal/host/agent.go
+++ b/internal/host/agent.go
@@ -1129,6 +1129,7 @@ func runAgent(args []string, buildClaims ClaimFactory) {
// the loop always sees the CURRENT probe set: Reload replaces probers
// behind this handle without the heartbeat needing to be re-wired.
setUpstreamSource(e.UpstreamStates)
+ setReplicaSource(e.ReplicaSnapshots)
// The GeoIP block for the heartbeat (geoip spec §5.5), the same way.
geoIPSource.Store(e.GeoIPState)
heldStreamsSource.Store(e.HeldStreamsForStatus)
@@ -4387,6 +4388,9 @@ func shouldSkipPublisherElection(getenv func(string) string) bool {
// goroutine a test would have no way to stop.
var upstreamSource atomic.Value // func() map[string][]status.UpstreamState
+// Separate from upstreamSource: the console already publishes upstreams to tenants.
+var replicaSource atomic.Value // func() map[string]replicas.Snapshot
+
// geoIPSource is the edge's GeoIP state for the heartbeat, published from
// the edge-ready callback like upstreamSource (geoip spec §5.5).
var geoIPSource atomic.Value // func() edge.GeoIPState
@@ -4447,6 +4451,30 @@ func setUpstreamSource(fn func() map[string][]status.UpstreamState) {
upstreamSource.Store(fn)
}
+func setReplicaSource(fn func() map[string]replicas.Snapshot) {
+ if fn == nil {
+ fn = func() map[string]replicas.Snapshot { return nil }
+ }
+ replicaSource.Store(fn)
+}
+
+// The source copies maps and samples under the edge's prober lock.
+func replicaCopies() map[string][]replicas.Copy {
+ fn, _ := replicaSource.Load().(func() map[string]replicas.Snapshot)
+ if fn == nil {
+ return nil
+ }
+ snapshots := fn()
+ if len(snapshots) == 0 {
+ return nil
+ }
+ out := make(map[string][]replicas.Copy, len(snapshots))
+ for host, snapshot := range snapshots {
+ out[host] = snapshot.Copies
+ }
+ return out
+}
+
// upstreamStates reads the current probe table for the heartbeat, or nil when
// no source has been published yet.
//
@@ -4660,7 +4688,8 @@ func statusLoop(reg *registry.Registry, svc *activator.Service, buildStates func
// leaves no ghost behind in the next snapshot. nil until the
// edge-ready callback publishes the source, and on any box that
// probes nothing — both publish no key at all.
- Upstreams: upstreamStates(),
+ Upstreams: upstreamStates(),
+ ReplicaCopies: replicaCopies(),
// One stat (two with a WAL) per database route per tick, which
// is what `carlos instances list` and `carlos routes` show as DB.
DBBytes: dbFileBytes,
diff --git a/internal/host/replica_request_budget_test.go b/internal/host/replica_request_budget_test.go
index 7a7dc876e..d4a68cc6a 100644
--- a/internal/host/replica_request_budget_test.go
+++ b/internal/host/replica_request_budget_test.go
@@ -416,8 +416,15 @@ func TestReplicaBlockedACKDoesNotBlockReconcile(t *testing.T) {
func replicaRoutingRequestBudget(t *testing.T) {
w := replicaTunnelFixture(t)
prev := upstreamSource.Load()
+ prevReplica := replicaSource.Load()
setUpstreamSource(w.e.UpstreamStates)
+ setReplicaSource(w.e.ReplicaSnapshots)
t.Cleanup(func() {
+ if prevReplica != nil {
+ replicaSource.Store(prevReplica)
+ } else {
+ setReplicaSource(nil)
+ }
if prev != nil {
upstreamSource.Store(prev)
} else {
@@ -441,6 +448,7 @@ func replicaRoutingRequestBudget(t *testing.T) {
p := status.Probes{MachineID: "replica-budget"}
if with {
p.Upstreams = upstreamStates()
+ p.ReplicaCopies = replicaCopies()
}
if err := statusTick(ctx, w.store, w.reg, p, false, ""); err != nil {
t.Fatal(err)
@@ -463,25 +471,26 @@ func replicaRoutingRequestBudget(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- var box struct {
- Metrics struct {
- Upstreams map[string][]struct {
- Copy map[string]any `json:"replica_copy"`
- } `json:"upstreams"`
- } `json:"metrics"`
- }
+ var box status.Box
if err = json.Unmarshal(raw, &box); err != nil {
t.Fatal(err)
}
- copies := box.Metrics.Upstreams[w.rt.Host]
- if len(copies) != 2 || copies[0].Copy["box"] != "box-a" || copies[1].Copy["box"] != "box-b" || copies[1].Copy["workers_running"] != float64(2) {
+ if box.Metrics == nil {
+ t.Fatalf("missing private metrics: %s", raw)
+ }
+ _, upstreamPresent := box.Metrics.Upstreams[w.rt.Host]
+ if upstreamPresent || strings.Contains(string(raw), "replica_copy\"") {
+ t.Fatalf("copy data reached tenant upstreams: %s", raw)
+ }
+ copies := box.Metrics.ReplicaCopies[w.rt.Host]
+ if !strings.Contains(string(raw), "replica_copies") || len(copies) != 2 || copies[0].Box != "box-a" || copies[1].Box != "box-b" || copies[1].WorkersRunning != 2 {
t.Fatalf("historical copies missing: %s", raw)
}
// Caller-owned maps must not mutate live health.
- states := upstreamStates()
- states[w.rt.Host][0].ReplicaCopy.Box = "changed"
+ states := replicaCopies()
+ states[w.rt.Host][0].Box = "changed"
delete(states, w.rt.Host)
- if upstreamStates()[w.rt.Host][0].ReplicaCopy.Box != "box-a" {
+ if replicaCopies()[w.rt.Host][0].Box != "box-a" {
t.Fatal("heartbeat shares live storage")
}
snap := w.e.ReplicaSnapshots()
@@ -500,7 +509,7 @@ func replicaRoutingRequestBudget(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- if strings.Contains(string(raw), "replica_copy") {
+ if strings.Contains(string(raw), "replica_copies") {
t.Fatalf("retired copies remain: %s", raw)
}
}
diff --git a/internal/host/replica_tunnel_e2e_test.go b/internal/host/replica_tunnel_e2e_test.go
index f5e8e154b..aa809c7da 100644
--- a/internal/host/replica_tunnel_e2e_test.go
+++ b/internal/host/replica_tunnel_e2e_test.go
@@ -265,6 +265,8 @@ func TestReplicaReloadAndBindingRace(t *testing.T) {
if got.FleetBoxes != next.FleetBoxes || got.FleetBox != "" || got.FleetLabel != "" || got.ReplicaRevision != next.ReplicaRevision {
t.Fatalf("legacy binding overwrote set: %+v", got)
}
+ probesBefore := w.probes[0].Load()
+ survivorProbes := w.probes[1].Load()
before := w.requests[0].Load()
for i := 0; i < 20; i++ {
if box := w.get(t); box != "box-b" {
@@ -274,6 +276,10 @@ func TestReplicaReloadAndBindingRace(t *testing.T) {
if w.requests[0].Load() != before {
t.Fatal("removed member dialled")
}
+ replicaHostWait(t, "surviving probe cycles after shrink", func() bool { return w.probes[1].Load() >= survivorProbes+3 })
+ if got := w.probes[0].Load(); got != probesBefore {
+ t.Fatalf("removed box probed after shrink: %d -> %d", probesBefore, got)
+ }
snap := w.e.ReplicaSnapshots()[w.rt.Host]
if len(snap.Copies) != 1 || snap.Copies[0].Box != "box-b" {
t.Fatalf("removed probe retained: %+v", snap)
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index aa9aea569..36a54b45f 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -82,4 +82,4 @@ plan14-root-reads-region-ha-followups.tsv cfb026f1f9d59f325937cbddf26df2d94d5240
plan14-root-reads-region-ha-p3a.tsv f44d209a054eee55fdee54227d419b74c34a9b2fc174c7a0bb74d5c2711a68bb
plan14-root-reads-stateless-coordinator-route.tsv 7974cb078e82272605cbc8ef6809c9ae5e0b02edc22ca843cd2ef4b38d9e44e9
plan14-root-reads-stateless-replicas-2.tsv 59c0891618b9befae27ebe04d0a67b08c7f7658bca9f1c78bf6d05eb7a708e82
-plan14-root-reads-stateless-replicas-3.tsv 94200054efc8bc2fce33fba728d6578bb9f7742105f4a266ed92c9365931bf9c
+plan14-root-reads-stateless-replicas-3.tsv 17c819e60e8273e6e37a2225583b185a82f224d021c84c067ef46ba581cd0eaa
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 3caa2b12e..4d769d1e7 100644
--- a/internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv
+++ b/internal/provision/testdata/plan14-root-reads-stateless-replicas-3.tsv
@@ -1,9 +1,11 @@
# Census overlay stateless-replicas-3, written by census-propose (#369). census-ruling-stateless-replicas-3, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-stateless-replicas-3.md.
-# 4 body, 2 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 6 body, 2 sites, 7 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 19 new dispositions: 2 reads re-frozen at their disposition with the claim, 17 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
@legacy a02e5c799c0ab4fefc6cbd35bc424a93c61924373619e65ef0af15d99d97bd12 internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 141655c4967b15b262faaa0f21a9e3514e8844162ef6c62db699e78638456c10
@legacy 4e896298c4fc9d37f3c50efde3284977a1d5af8fb1ee85211570c867b1e9f25f internal/edge/fleetforward.go FleetArmVerdict legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 fix round 3: the single fleet-arm refusal decision over one listing, used by Edge.Reload, the edges-file writer and the alias pass (parity by construction); returns the refused set with reasons and the accountless notes (+registry:Host x3, +registry:Status, +whole:Route x3). Pure; no I/O. Review R1 finding 2: also returns Served, each admitted row Reload sends through the fleet arm (a forward row, or a fleet-placed row with no Tunnel) with its fleet, app and the fleet owner from owners; a host the alias step refuses is dropped from it (+registry:App, +registry:Host, +registry:Region, +registry:Tunnel on the listing it already holds). Pure; no I/O. Review R2: the pre-fold fleet rows are now Arm; Served is the destination after the platform-alias fold: every ready, unrefused, non-sidecar row DispatchArm gives an entry, with its Arm fleet when its arm is a fleet's, folded by foldPlatformAliases (Reload's own fold), keeping the hosts that go to a fleet (+registry:Host, +registry:Status, +whole:Route on the listing it already holds). Pure; no I/O; refusals unchanged.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: classify ArmReplica as fleet-served for the existing shared routing, edges-file and alias verdict. Existing field reads unchanged; pure in-memory decision, same owner and alias checks. registry:App@798,registry:Host@1436,registry:Host@1496,registry:Host@1619,registry:Host@1679,registry:Host@380,registry:Host@563,registry:Host@622,registry:Host@756,registry:Region@687,registry:Status@1368,registry:Status@320,registry:Tunnel@728,whole:Route@1336,whole:Route@1526,whole:Route@1735,whole:Route@268,whole:Route@522,whole:Route@870 45a015c3eee5a73cf4f07aa7e0b2501cf8cb9587aae1e6218a733540b3219094
@legacy d1fceb749957ef6abc6e2c02bdfae532fcdaba22eb152dc0acbfe00051699e16 internal/edge/reqrecords.go requestResponse legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-request-records;identity=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=new: a pure constructor: copies the account (release.RouteAccount of the route), app, host and environment of the route row the edge already resolved for this request, and the request's method, path, raw query, User-Agent, client address and GeoIP country (from the request context), with the status, into a reqrec.Response; the recorder masks the path, keeps only the query's names, and stores the client address only as its /24 (IPv6 /48) prefix and a day-salted hash before anything is stored; the account and app come from the route row, never the Host header; it reads no file, no store and no box state, writes nothing, and makes no decision; the class of Edge.emitEdgeError and UsageMeter.Record (J1 root-route);rev3=census-ruling-stateless-replicas-3;basis=Task 2: copy the final replica box and attempt count from the existing per-request outcome into additive reqrec.Response fields. Existing four Route reads unchanged; no new external read, path, credential or authority. The observer still records one client response at the hub; ordinary requests retain zero fields. registry:App@190,registry:Environment@226,registry:Host@204,whole:Route@180 0eb4f75b1d48476ac610f69e0c3621a44995eb6c4ebf63d002c95a3496ad7c0e
+@legacy 997910edfcc7dce4bc50ccfc7eaf0b04b5c9f6b5207959f53ade88f35bdf93a3 internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action. whole:Route@11776,whole:Route@12057,whole:Route@6404,whole:Route@6431,whole:Route@7739,whole:Route@9962 025a3111044273a4226af0a59e06b765ef62da017b81117f9d2bb6d2e5dafa2a
+@legacy 74291fee3536efec6e54902379fc05ccaacbdd8da6d35ad9846bda922be1f1c5 internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read. registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 e16dac4c201338a45948122ffb429e60815d5f428bf5339b5416837e1023a32f
@legacy eef846cad40472c4151369c696b1da1835b1e24c5b3d317d81667571039ffcc8 internal/activator/replicaprobe.go Service.ProbeCopy legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: read the local registry assignment and the already-awake entry's launch/worker evidence under the held-leg predicate; compare account, app, fleet, box membership and lifetime; no bucket call, wake, authority acquisition or activity update. Added registry field and whole Route reads are the existing local projection, not tenant-selected paths. registry:Account@1564,registry:App@1581,registry:FleetBoxes@306,registry:HA@402,registry:HA@891,registry:Hibernate@386,registry:Hibernate@874,registry:Incarnation@819,registry:Incarnation@838,registry:Kind@361,registry:Region@1135,registry:Region@792,registry:Region@806,registry:ReplicaIncarnation@1658,registry:ReplicaIncarnation@741,registry:ReplicaIncarnation@767,registry:ReplicaRevision@1703,registry:Stateless@857,whole:Route@1083,whole:Route@1089,whole:Route@296,whole:Route@683,whole:Route@714,whole:Route@719 efe551a9cdf45284360710a083d19813120343f843ae9db9d3b4636d5f96d57c
@legacy 1852ab27b5e9593b9d9bc0f7c604e1f97d35a60368cdb6c7835a31307b90c13c internal/edge/replicaprobe.go Edge.replicaCopyMatches legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: compare Copy identity against the loaded Route's host, account, app, fleet, incarnation and assignment revision; local box must remain a member. Only in-memory registry field reads; no file or bucket reads. registry:Account@213,registry:App@251,registry:Host@170,registry:Region@115,registry:ReplicaIncarnation@325,registry:ReplicaRevision@374 503766598b5be534178a0c843ad160082961a96577c7c591416f9921712614ce
@legacy 14804d70792904629f6a6c21a6c46994a723b86dee0c5b60ebf5bb8c8721aa55 internal/edge/replicaprobe.go Edge.serveReplicaProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 I4/F1: the dialled pathname comes from the serving Gen.Socket and, for shared/foreign layouts, can originate in the registry row Socket. Dial through unixdial.Checked: refuse the instance-control directory before connect and require getpeername to match the dialled path before sending HTTP, including symlink refusal. Existing Route reads unchanged. M5 handles request construction errors before RoundTrip; M2 uses the shared reason constant. Authenticated private landing, held-leg admission, one-second bound and post-response identity checks remain. registry:FleetBoxes@390,registry:HA@459,registry:Hibernate@443,registry:Host@346,registry:Kind@365,whole:Route@1025,whole:Route@1215,whole:Route@2268,whole:Route@706 8b158b6a5f414bc8290e9b13b0c27da2002920e837b7c9e98aea0771c98bac5e
@@ -22,13 +24,15 @@
@legacy 5af61b9be2ebcc76b4871899e03d72ff5f5c5e8a86da58e9ccb435025f024165 internal/edge/tunnel.go tunnelWire.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: the scanner's file:Read sites are net.Conn.Read on the existing authenticated reverse-channel connection, not filesystem reads. Notify closure on reader failure so copy health excludes closed connections immediately. No pathname, root-owned file or new network destination is introduced. file:Read@21,file:Read@62 eff57b35dc5f4f7e2f54e08b07e07b0a21d571c41704be0a3d1997db362b8234
@legacy 84e1fa64113c54c580f5f77b91da2456f49432aeae923f0ebf3b4d92e7e60c1b 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
@legacy ef5572f16b111fccc40c8744df6df5613386e8880844be62ec786c9fd718934b internal/edge/fleetforward.go DispatchArm legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R2: Reload's dispatch order as one function over a row it serves (forward only when admitted to the fleet arm, own Tunnel where tunnels are on, fleet arm, socket, AddrList, static, status, else none), moved out of Reload's switch unchanged; read by Reload and FleetArmVerdict. Pure; no I/O.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: read FleetBoxes and ValidReplicaProjection on the supplied row before the legacy forward/tunnel/fleet arms. An admitted valid set selects ArmReplica; a set without fleet authority selects no arm. Local non-hub resident socket dispatch remains unchanged. No external read. registry:FleetBoxes@82,registry:Kind@466,registry:Kind@512,registry:Socket@376,registry:Tunnel@289 27183e653005eeb8b48fd9ed55a79b153a7ae6cf1536f51fd4586843d4975064
-@legacy 3ff362714db025c57a447061fbb76debe0c72f726dec64e050db774cc6e10598 internal/edge/fleetforward.go FleetServeEligible legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4 (§4.4 tenancy): a forward row is eligible only on a hub, inert, fleet-placed, its fleet in the fleets table and its raw Account non-empty and equal to the owner; a non-forward fleet-placed row: empty raw Account served and noted, else release.RouteAccount must equal the owner; raw field before RouteAccount (+registry:Account x7, +registry:Region x2, +registry:Tunnel, +whole:Route). Pure; no I/O.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: gate set routing on hub role, valid projection, nonempty account/app, instance or inert forward kind, no platform ownership, HA, hibernation or explicit tunnel. New reads are fields of the already-supplied Route. Existing fleet-owner and inert-forward checks still apply; no external read or expansion of destination authority. registry:Account@1100,registry:Account@1256,registry:Account@1354,registry:Account@1610,registry:Account@224,registry:Account@841,registry:Account@912,registry:Account@998,registry:App@244,registry:FleetBoxes@160,registry:HA@275,registry:Hibernate@284,registry:Kind@320,registry:Platform@260,registry:Region@145,registry:Region@679,registry:Tunnel@1057,registry:Tunnel@300,whole:Route@1532 c7caa48b160438d34219e899dbdcf8b7fc5f0a2b989f2de1f562500a9463e574
-@legacy c96003c22f327131507288de511ce1d1c82555e606504b69d6a35c98a56a23bd internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. registry:Account@9839,registry:Alias@24783,registry:Alias@24870,registry:Alias@25450,registry:App@9855,registry:Health@13580,registry:Health@13706,registry:Hibernate@29297,registry:Host@11166,registry:Host@11223,registry:Host@11259,registry:Host@12002,registry:Host@14189,registry:Host@14284,registry:Host@14572,registry:Host@14598,registry:Host@14650,registry:Host@19245,registry:Host@21152,registry:Host@21460,registry:Host@21487,registry:Host@22302,registry:Host@22874,registry:Host@25204,registry:Host@25253,registry:Host@27868,registry:Host@27893,registry:Host@27910,registry:Host@4397,registry:Host@4766,registry:Host@4820,registry:Host@4870,registry:Host@5890,registry:Host@6005,registry:Kind@17581,registry:Kind@17603,registry:Prefix@22849,registry:Socket@12066,registry:Socket@17460,registry:Socket@21468,registry:Status@4691,registry:Target@22861,registry:Tunnel@9699,registry:Tunnel@9870,registry:Version@17562,registry:Version@17664,whole:RegionalDomain@26092,whole:Route@11314,whole:Route@11422,whole:Route@12122,whole:Route@14723,whole:Route@14787,whole:Route@14838,whole:Route@21520,whole:Route@21527,whole:Route@21623,whole:Route@22737,whole:Route@23905,whole:Route@26084,whole:Route@26129,whole:Route@27774,whole:Route@27808,whole:Route@27896,whole:Route@27975,whole:Route@29299,whole:Route@294,whole:Route@3417,whole:Route@3475,whole:Route@4405,whole:Route@5919,whole:Route@6108,whole:Route@6241,whole:Route@6264,whole:Route@6279,whole:Route@7126,whole:Route@7234,whole:Route@9761,whole:RouteAlias@24754,whole:RoutePath@22280 3a0bdd66ab99319f58599ade38bd49a8a0a96ac656de2c62be2fd8f255ebd8a5
+@legacy 3a51eeb80e8baf03a2b1a320963ac89d379978890a026ee8ab8b6bcf168ce253 internal/edge/fleetforward.go FleetServeEligible legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4 (§4.4 tenancy): a forward row is eligible only on a hub, inert, fleet-placed, its fleet in the fleets table and its raw Account non-empty and equal to the owner; a non-forward fleet-placed row: empty raw Account served and noted, else release.RouteAccount must equal the owner; raw field before RouteAccount (+registry:Account x7, +registry:Region x2, +registry:Tunnel, +whole:Route). Pure; no I/O.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: gate set routing on hub role, valid projection, nonempty account/app, instance or inert forward kind, no platform ownership, HA, hibernation or explicit tunnel. New reads are fields of the already-supplied Route. Existing fleet-owner and inert-forward checks still apply; no external read or expansion of destination authority. Fix round 1 M1: retain the same fail-closed structural predicate but give each invalid condition an internal diagnostic instead of the no-healthy-copy message. No admission expansion, user-facing answer, or additional read. registry:Account@1269,registry:Account@1340,registry:Account@1426,registry:Account@1528,registry:Account@1684,registry:Account@1782,registry:Account@2038,registry:Account@375,registry:App@395,registry:FleetBoxes@160,registry:HA@546,registry:Hibernate@555,registry:Kind@723,registry:Platform@473,registry:Region@1107,registry:Region@145,registry:Tunnel@1485,registry:Tunnel@637,whole:Route@1960 9ac46053694c38f60bff76e1084a6d6a604e1837fb682ec31aa3b3070ebbf183
+@legacy 0ace0d6ba79a060f2ec36d5cb7a9332cc083e635650b7b61fdc2e50cf4db5f60 internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. Fix round 1 M2: comment and whitespace correction only; read sites and routing behavior unchanged. registry:Account@9912,registry:Alias@24856,registry:Alias@24943,registry:Alias@25523,registry:App@9928,registry:Health@13653,registry:Health@13779,registry:Hibernate@29370,registry:Host@11239,registry:Host@11296,registry:Host@11332,registry:Host@12075,registry:Host@14262,registry:Host@14357,registry:Host@14645,registry:Host@14671,registry:Host@14723,registry:Host@19318,registry:Host@21225,registry:Host@21533,registry:Host@21560,registry:Host@22375,registry:Host@22947,registry:Host@25277,registry:Host@25326,registry:Host@27941,registry:Host@27966,registry:Host@27983,registry:Host@4397,registry:Host@4766,registry:Host@4820,registry:Host@4870,registry:Host@5890,registry:Host@6079,registry:Kind@17654,registry:Kind@17676,registry:Prefix@22922,registry:Socket@12139,registry:Socket@17533,registry:Socket@21541,registry:Status@4691,registry:Target@22934,registry:Tunnel@9772,registry:Tunnel@9943,registry:Version@17635,registry:Version@17737,whole:RegionalDomain@26165,whole:Route@11387,whole:Route@11495,whole:Route@12195,whole:Route@14796,whole:Route@14860,whole:Route@14911,whole:Route@21593,whole:Route@21600,whole:Route@21696,whole:Route@22810,whole:Route@23978,whole:Route@26157,whole:Route@26202,whole:Route@27847,whole:Route@27881,whole:Route@27969,whole:Route@28048,whole:Route@29372,whole:Route@294,whole:Route@3417,whole:Route@3475,whole:Route@4405,whole:Route@5919,whole:Route@6182,whole:Route@6315,whole:Route@6338,whole:Route@6353,whole:Route@7199,whole:Route@7307,whole:Route@9834,whole:RouteAlias@24827,whole:RoutePath@22353 575980dc1128d337eead6f4f6ca0fd4ce89258d9900cfac5bd1df80ce0d4ff8f
@legacy 7543220573485e822d13d2cf145e49bf557d9c0b4937327f0bfcba23e52a59a9 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
internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 141655c4967b15b262faaa0f21a9e3514e8844162ef6c62db699e78638456c10
internal/edge/fleetforward.go FleetArmVerdict legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 fix round 3: the single fleet-arm refusal decision over one listing, used by Edge.Reload, the edges-file writer and the alias pass (parity by construction); returns the refused set with reasons and the accountless notes (+registry:Host x3, +registry:Status, +whole:Route x3). Pure; no I/O. Review R1 finding 2: also returns Served, each admitted row Reload sends through the fleet arm (a forward row, or a fleet-placed row with no Tunnel) with its fleet, app and the fleet owner from owners; a host the alias step refuses is dropped from it (+registry:App, +registry:Host, +registry:Region, +registry:Tunnel on the listing it already holds). Pure; no I/O. Review R2: the pre-fold fleet rows are now Arm; Served is the destination after the platform-alias fold: every ready, unrefused, non-sidecar row DispatchArm gives an entry, with its Arm fleet when its arm is a fleet's, folded by foldPlatformAliases (Reload's own fold), keeping the hosts that go to a fleet (+registry:Host, +registry:Status, +whole:Route on the listing it already holds). Pure; no I/O; refusals unchanged.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: classify ArmReplica as fleet-served for the existing shared routing, edges-file and alias verdict. Existing field reads unchanged; pure in-memory decision, same owner and alias checks. registry:App@798,registry:Host@1436,registry:Host@1496,registry:Host@1619,registry:Host@1679,registry:Host@380,registry:Host@563,registry:Host@622,registry:Host@756,registry:Region@687,registry:Status@1368,registry:Status@320,registry:Tunnel@728,whole:Route@1336,whole:Route@1526,whole:Route@1735,whole:Route@268,whole:Route@522,whole:Route@870 45a015c3eee5a73cf4f07aa7e0b2501cf8cb9587aae1e6218a733540b3219094
internal/edge/reqrecords.go requestResponse legacy accepted-legacy accepted-legacy;rev3=census-ruling-edge-request-records;identity=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=new: a pure constructor: copies the account (release.RouteAccount of the route), app, host and environment of the route row the edge already resolved for this request, and the request's method, path, raw query, User-Agent, client address and GeoIP country (from the request context), with the status, into a reqrec.Response; the recorder masks the path, keeps only the query's names, and stores the client address only as its /24 (IPv6 /48) prefix and a day-salted hash before anything is stored; the account and app come from the route row, never the Host header; it reads no file, no store and no box state, writes nothing, and makes no decision; the class of Edge.emitEdgeError and UsageMeter.Record (J1 root-route);rev3=census-ruling-stateless-replicas-3;basis=Task 2: copy the final replica box and attempt count from the existing per-request outcome into additive reqrec.Response fields. Existing four Route reads unchanged; no new external read, path, credential or authority. The observer still records one client response at the hub; ordinary requests retain zero fields. registry:App@190,registry:Environment@226,registry:Host@204,whole:Route@180 0eb4f75b1d48476ac610f69e0c3621a44995eb6c4ebf63d002c95a3496ad7c0e
-internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. file:Exec@18226,file:Open@1517,file:Statfs@47850,registry:App@11938,whole:Route@11930 916ecf4ddcec9c37f1233710a3e8dbba4d0c8b952d60b6a4831d45258b7591bc
+internal/host/agent.go runAgent authority B,C,D,F rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): builds the box's lifetime judge once (newBoxJudge, nil with host claims on) and hands it to the seed placement, the moves and runs workers and every loop it starts; read sites unchanged, offsets moved; B,C,D,F authority retained; self-serve moves 1 Task 8: derives the box's lifetimes switch from the judge once (lifetimes := boxJudge != nil) and hands it to the edges file loop; read sites unchanged, offsets moved;rev3=census-ruling-plans-4d-lapse;basis=arms two more plans hooks from the same snapshot: e.SetPlanDisabledFor(planDisabledFor) beside SetPlanGovernedFor, and svc.SetDisabledFor(planDisabledRoute) beside SetMaxRunFor (plans 4d); the reads live in those units (plans-4d-units decision); read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 9b81d97b (with main's plan rate ceiling, edge request records, regional box names, self-serve moves plan 1, plans 4d-1 lapse and its other later changes under main's own census rulings) plus the rootfs placement wiring in the activator start: an agentRootfs built from eb.NestedOK, CARLOS_DEPLOYMENT_SINGLE_TENANT, CARLOS_POOLS, the claim flag, swapArming's answer, the control client's /ready/rootfs and, on a fleet box whose identity resolved, fleetOwnerCheck over the deploy store main already opens for the fleet label (fleetStore), then arm and armedRootfs.Store; this body reads nothing new itself; the closures it wires read later, at a rootfs wake and each status tick: GET /ready/rootfs over the control socket, NestedOK's checks, and release.FleetOwnerKey for the judged row's own account and this box's fleet from the deploy store;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Tasks 7 and 11, #329 plan 3 Task 7 and plan 1 Task 7's policy cache: the control client is built once and handed to eb.Control, to the status tick (egressStatus) and to a new egressNudgeLoop goroutine; armSizeSource(svc, "/sys/fs/cgroup") after the activator Service; armPolicyCache() after armChangeIndex; statusLoop takes egressStatus. The reads are those units' own (decision rows); this body reads nothing new: the same five sites, offsets moved, in the agent; B,C,D,F authority retained.;rev3=census-ruling-remote-instance-metrics;basis=builds the metrics loop's owners closure (metricsOwners over the agent's registry, the activator and cgm.Leftover) when an activator exists and hands it to metricsLoop; reads nothing new itself;rev3=census-ruling-edge-asset-cache-3;basis=adds file:Statfs. runAgent keeps its authority (B,C,D,F). The new site is assetcache.Statfs, an exported assetcache.FS interface value (var Statfs FS = statfsFS{}), not a function value and not a call in runAgent: the ready hook passes it to armEdgeAssetCache as the store's filesystem, and armEdgeAssetCache calls its Space method on the configured data directory (dataDir(): $CARLOS_DATA_DIR, else /data), which calls unix.Statfs there (statfsFS.Space, accepted legacy at census-ruling-edge-asset-cache-2). No request-supplied pathname reaches it.;rev3=census-ruling-remote-metrics-nested;basis=main's body (merged origin/main acfa4f80, under main's own census rulings) plus: snapshots the nested layout (snapshotNestedUnits over /sys/fs/cgroup/carlos.slice/carlos-instances.slice) once at start, before the activator, and hands the metrics loop a unitSources struct (stamped units, routeHostNames, that root and the snapshot); reads nothing new itself;rev3=census-ruling-region-ha-p1a;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): wires region HA P1a into the activator: cfg.Record = haRecordFacts(openDeployStore, boxJudge) (the box's lifetime judge this body already builds with newBoxJudge, nil with host claims on; CI fix) and cfg.Self = lease.CurrentSelf; eb.Lifetimes (the process's lifetime index), eb.Registry, eb.StartupSwept (seedSweptAtStart.Load), eb.FilesStore from newProductionFilesStore (now lease.NewFilesStore, rootaws-loaded, a log line on failure) and lease.SetObligationDir(<data>/.ha-owed) (logged on failure; HA acquires then refuse); this body reads nothing new itself, the same five sites; the reads are those units' own (haRecordFacts and lease's SetObligationDir are new rows on this card); merge of origin/main d7ae1d76: main's own later changes to this body are kept as main has them, under main's rulings (census-ruling-remote-instance-metrics: the metricsOwners closure for metricsLoop; census-ruling-edge-asset-cache-3: the +file:Statfs site, assetcache.Statfs handed to the asset ready hook); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b1;basis=region HA P1b-1: builds one termfence.Confirmer (Self from lease.CurrentSelf at each call, EC2 DescribeInstances method only, client from rootaws.LoadDefaultConfig with retries off, built lazily on first use) and sets eb.OwnerTerminated; this body reads nothing new itself, the same six sites;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 7: the startup Sweep literal hands its answer to startupSwept, which logs as before and, only on a clean sweep, marks rootfs admission swept (MarkRootfsSwept); same Sweep call, no read added;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): sets svc.Fleet = fleetWakeFor(os.Getenv, identity, identErr, fleetStore) from the identity it already resolves once and the deployment store the fleet loops already opened, and logs an ERROR naming the identity error when the box is on a fleet with an invalid identity. fleetWakeFor reads CARLOS_REGION and CARLOS_FLEET from the same environment. Read sites unchanged (6). Agent, not root; a platform box is unchanged.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 12: one call more beside armRunsPass, armInteractivePass(svc, reg, rolloutSink, boxJudge), in the same activator Configure hook, handing it the same box judge; fix round 1 (Astra P2, shutdown): after svc.Shutdown(ctx), shutdownInteractive(ctx) ends and joins every interactive session under the same shutdown budget; the worker's own reads are its units' (interactive.go); this body reads nothing new, the same six sites; merge of origin/main 6f1f6ca6: main's svc.Fleet = fleetWakeFor(...) and its invalid-identity ERROR line are kept as main has them (census-ruling-managed-fleets-1b); this branch's change is the same as above; read sites unchanged (6);rev3=census-ruling-fix-set-aside-exdev;basis=set-aside EXDEV fix: one field more on the agent ExecBackend literal, RawInstanceDir: layout.RawInstanceDir (a pure path join: <dataDir>/.instances/<InstanceID(host)>), so the start rule set-aside moves a copy out through the raw directory instead of through the nosymfollow bind; this body reads nothing new, the same six sites;rev3=census-ruling-durability-3a-escrow;basis=durability 3a Task 3: one more assignment beside eb.FilesStore: eb.EscrowKey = haEscrowKey(os.Getenv("CARLOS_SECRETS_KEY")), the agent's own environment parsed by appconfig.ParsePrivateKey as the moves pass parses it (unset or unparseable: a log line and nil, and HA publication refuses on the box). No path is opened or read, no read site added; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 4: one more goroutine beside configSyncLoop: go escrowLoop(agentCtx, reg, svc), the escrow sweep every 30 s over the same registry and Service. This body reads nothing new itself; the same six sites, offsets moved; B,C,D,F authority retained. Durability 3a Task 5: one more call beside eb.EscrowKey: wireRawSecretPages(eb, PageOperator, metricsBoxLabel(os.Getenv, readMachineID())), which sets eb.OnRawSecret to page an operator (alerting.Page through PageOperator, LevelIncident) on its own goroutine with a 20 s timeout; metricsBoxLabel and readMachineID are the reads this body already makes for the moves refusal log; no new read site; the same six sites, offsets moved; B,C,D,F authority retained. Merge of origin/main 90c4d3aa: main's own later changes to this body are kept as main has them, under main's rulings; this branch's change is the same as above. Merge of origin/main 00bf5b8c (fleet set-aside EXDEV fix): main's change to this body is kept as main has it, under its own census ruling; this branch's change is unchanged.;rev3=census-ruling-probe-burst-limit;basis=two more sink wirings beside setAnalyticsSink: setProtectionSink(e.SetProtectionRecordOnly) and setAssetOwnersSource(e.AssetOwners), function values the telemetry pass calls; this body reads nothing new, the same six sites; authority B,C,D,F retained; no new root read or write kind;rev3=census-ruling-region-ha-p1b3a;basis=Arm HA placement exactly once on the existing Service before activatorStart and edges publication, wiring AwakeApps and the PageOperator callback; existing six read sites unchanged, no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Final review I3: start the concrete coordinator's renewal worker with agent setup; existing closeReplicaCoordinator shutdown cancels and joins it before release. No new read sites or credentials. Merge origin/main c59715e7: retain main's armHAPlacement(svc, PageOperator) wiring beside the existing activator setup; stateless coordinator and shutdown wiring remain. Same read sites; no new root read or credential.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): in the edge-ready callback, calls act.SetHeldWakeHook(e.HeldWake) when act is non-nil (installing the non-blocking wake callback) and stores e.HeldStreamsForStatus in heldStreamsSource. Wiring of in-memory callbacks only; no read added.;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Service.SetDutyView to the live edge DutySnapshot in the ready callback. No new read; no new loop or cloud operation. B2 wires the registry as the persistent DutyStore before service startup; no new cloud or filesystem path. B3b: arm one journal-backed termination consumer before service startup using agentCtx and the shared confirmer; expose edge tick and join at edge shutdown. No new direct read sites.;rev3=census-ruling-agent-start-demo-1;basis=Passes the existing registry, data store and hibernation prefix into the demo worker, and the existing instance-control client into the demo before-exec hook. No alternate data store or polling loop. Merge resolution against origin/main 9bd45488 retains main's HA departure controller, lifecycle and duty wiring alongside the demo data store and worker; no read site added by the resolution.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: install closed fixed admission before every launch source, bind activator/backend and edge, wire the real termination Started lifecycle and role reader after the change index; close before cancellation/child shutdown. No new external reads or cloud authority. Fix R1: move bind/lifecycle/edge-option wiring into wireAgentAdmission and worker listing into runWorkerBootPassAfterAdmission. Worker boot waits for admission before listing then uses unchanged bounded wakes and per-host serialization; whole Route read moves to the helper. No new storage, cloud, or root execution authority. Preserve merged main's agent wiring and census basis; the branch removes one whole Route use by moving worker iteration to the helper, with no added read kind.;rev3=census-ruling-stateless-replicas-2;basis=Slice 3b: arms a fleet-only worker using the existing registry, activator, backend and authenticated console transport. Owned worker stops and joins at shutdown. No new bucket reader. merge of origin/main 9b8b2c50: retain HA duty/departure lifecycle, wake-slot and existing agent wiring alongside the replica placement worker; no new read introduced by resolution. merge of origin/main 6be08467: Retain main demo configuration, admission, build and expiry wiring alongside the replica worker; merge-only body change, no additional read. merge of origin/main 7920cccf: Retain main box-role/group admission wiring and boot publication beside the owned replica worker and shutdown; main moves the boot registry List into runWorkerBootPassAfterAdmission, removing its inline whole Route site. No new read introduced by conflict resolution.;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 M3: retain the private snapshot source and cancel/join ownership, but use the replica-health-specific retry loop. It logs its first failure only and retains the existing exponential backoff capped at 30 seconds; unsupported builds return nil. Existing five direct read sites unchanged; no new credentials, bucket reader or app lifecycle action. Fix round 1 Q20: publish Edge.ReplicaSnapshots as a separate in-memory status source, leaving the tenant-visible Upstreams source unchanged. No new external reader or authority. file:Exec@18226,file:Open@1517,file:Statfs@47889,registry:App@11938,whole:Route@11930 cc2cc4d518ced5480a20e5fe5cca1dc9250519dde64b29a22d69f3eb346883a8
+internal/host/agent.go statusLoop legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's context carries the box's lifetime judge; read sites unchanged, offsets moved;rev3=census-ruling-rootfs-apps-2;basis=main's body as of the merge of origin/main 953b9fda (its later changes, regional box names and self-serve moves plan 1 among them, under main's own census rulings), where the tick fills rootfs_ready and rootfs_blocked from armedRootfs.Load().probe, which each tick runs NestedOK's checks and asks the control socket's GET /ready/rootfs (never the store); the same four direct sites;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: takes root's GET /egress reader and fills p.Egress = egressStatusProbe(egressStatus, routes, provision.PolicyReadStates()) and p.SizeCommittedMiB = sizeCommittedMiB(armedSizeSource.Load(), routes); the two added whole:Route sites are the tick's own registry list handed to those two units (decision rows), which read root's control socket and the activator's memory; no store request added; the four existing sites unchanged, offsets moved.;rev3=census-ruling-fleet-alerts-1;basis=the agent (carlos-edge.service, user carlos): the status tick passes os.Geteuid() to alertDeliveryProbe, which fills AlertDelivery.EngineBeat/EngineBeatWhy from engineBeatArmed (the env value and the euid only, no file access, root refused before the path is looked at), and fills Probes.DiskFullETAHours from diskETAProbe(&processDiskTrend, now), a Theil-Sen fit over the metrics loop's in-memory ring of disk readings; the same six sites, no read added, no store request added;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): the status tick's Probes gain HeldStreams: heldStreamsState(), which calls the edge's in-memory counters function (nil until the edge is ready). No file, bucket or registry access added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: read the detached in-memory replica snapshot source into Probes.ReplicaCopies on the existing five-minute tick. Existing six direct read sites unchanged. No additional bucket request, changed cadence or app lifecycle action. whole:Route@11776,whole:Route@12057,whole:Route@6404,whole:Route@6431,whole:Route@7739,whole:Route@9962 025a3111044273a4226af0a59e06b765ef62da017b81117f9d2bb6d2e5dafa2a
+internal/status/snapshot.go CollectBox legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-rootfs-apps-2;basis=copies Probes.RootfsReady and RootfsBlocked into BoxMetrics (private, like Layout); the same 28 sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 11 and #329 plan 3 Task 7: copies Probes.Egress and Probes.SizeCommittedMiB into BoxMetrics (private, like Layout) and counts them in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3: comment only, the Hibernate count is left as is (display);rev3=census-ruling-regional-domains-447;basis=#447 Task 7: copies Probes.AliasesRead into BoxMetrics.AliasesRead (json aliases_read, omitempty) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-fleet-alerts-1;basis=copies Probes.DiskFullETAHours into BoxMetrics.DiskFullETAHours (json disk_full_eta_hours, omitempty; private, like Layout) and counts it in the condition that builds Metrics; the same 28 sites, no read added;rev3=census-ruling-edge-held-streams;basis=copies Probes.HeldStreams into BoxMetrics.HeldStreams (json held_streams, omitempty, additive) and counts it in the condition that builds Metrics; the same 28 sites, no read added.;rev3=census-ruling-stateless-replicas-3;basis=Fix round 1 Q20: carry already-supplied ReplicaCopies into a separate optional private BoxMetrics replica_copies field; allow copy evidence alone to create the metrics block. Upstreams retains address probes only. Existing 28 Route read sites unchanged; no filesystem, bucket, console or CLI read. registry:Alias@4543,registry:CertExpiresAt@3160,registry:CertExpiresAt@3396,registry:CertExpiresAt@4658,registry:DBPath@2495,registry:DBPath@2553,registry:DNSCheckedAt@3365,registry:DNSCheckedAt@4627,registry:DNSStatus@3139,registry:DNSStatus@3334,registry:DNSStatus@4597,registry:Hibernate@3853,registry:Host@2295,registry:Host@2437,registry:Host@2666,registry:Host@3280,registry:Host@3315,registry:Host@4578,registry:Kind@2473,registry:Kind@3807,registry:Platform@2152,registry:ServingVersion@2324,registry:ServingVersion@2447,registry:Socket@4066,registry:Version@2186,registry:Version@2305,whole:Route@1581,whole:RouteAlias@4440 e16dac4c201338a45948122ffb429e60815d5f428bf5339b5416837e1023a32f
internal/activator/replicaprobe.go Service.ProbeCopy legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: read the local registry assignment and the already-awake entry's launch/worker evidence under the held-leg predicate; compare account, app, fleet, box membership and lifetime; no bucket call, wake, authority acquisition or activity update. Added registry field and whole Route reads are the existing local projection, not tenant-selected paths. registry:Account@1564,registry:App@1581,registry:FleetBoxes@306,registry:HA@402,registry:HA@891,registry:Hibernate@386,registry:Hibernate@874,registry:Incarnation@819,registry:Incarnation@838,registry:Kind@361,registry:Region@1135,registry:Region@792,registry:Region@806,registry:ReplicaIncarnation@1658,registry:ReplicaIncarnation@741,registry:ReplicaIncarnation@767,registry:ReplicaRevision@1703,registry:Stateless@857,whole:Route@1083,whole:Route@1089,whole:Route@296,whole:Route@683,whole:Route@714,whole:Route@719 efe551a9cdf45284360710a083d19813120343f843ae9db9d3b4636d5f96d57c
internal/edge/replicaprobe.go Edge.replicaCopyMatches legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1a: compare Copy identity against the loaded Route's host, account, app, fleet, incarnation and assignment revision; local box must remain a member. Only in-memory registry field reads; no file or bucket reads. registry:Account@213,registry:App@251,registry:Host@170,registry:Region@115,registry:ReplicaIncarnation@325,registry:ReplicaRevision@374 503766598b5be534178a0c843ad160082961a96577c7c591416f9921712614ce
internal/edge/replicaprobe.go Edge.serveReplicaProbe legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1 fix round 1 I4/F1: the dialled pathname comes from the serving Gen.Socket and, for shared/foreign layouts, can originate in the registry row Socket. Dial through unixdial.Checked: refuse the instance-control directory before connect and require getpeername to match the dialled path before sending HTTP, including symlink refusal. Existing Route reads unchanged. M5 handles request construction errors before RoundTrip; M2 uses the shared reason constant. Authenticated private landing, held-leg admission, one-second bound and post-response identity checks remain. registry:FleetBoxes@390,registry:HA@459,registry:Hibernate@443,registry:Host@346,registry:Kind@365,whole:Route@1025,whole:Route@1215,whole:Route@2268,whole:Route@706 8b158b6a5f414bc8290e9b13b0c27da2002920e837b7c9e98aea0771c98bac5e
@@ -47,13 +51,13 @@ internal/edge/replicaprober.go sameReplicaJob legacy accepted-legacy accepted-le
internal/edge/tunnel.go tunnelWire.Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: the scanner's file:Read sites are net.Conn.Read on the existing authenticated reverse-channel connection, not filesystem reads. Notify closure on reader failure so copy health excludes closed connections immediately. No pathname, root-owned file or new network destination is introduced. file:Read@21,file:Read@62 eff57b35dc5f4f7e2f54e08b07e07b0a21d571c41704be0a3d1997db362b8234
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/fleetforward.go DispatchArm legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R2: Reload's dispatch order as one function over a row it serves (forward only when admitted to the fleet arm, own Tunnel where tunnels are on, fleet arm, socket, AddrList, static, status, else none), moved out of Reload's switch unchanged; read by Reload and FleetArmVerdict. Pure; no I/O.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: read FleetBoxes and ValidReplicaProjection on the supplied row before the legacy forward/tunnel/fleet arms. An admitted valid set selects ArmReplica; a set without fleet authority selects no arm. Local non-hub resident socket dispatch remains unchanged. No external read. registry:FleetBoxes@82,registry:Kind@466,registry:Kind@512,registry:Socket@376,registry:Tunnel@289 27183e653005eeb8b48fd9ed55a79b153a7ae6cf1536f51fd4586843d4975064
-internal/edge/fleetforward.go FleetServeEligible legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4 (§4.4 tenancy): a forward row is eligible only on a hub, inert, fleet-placed, its fleet in the fleets table and its raw Account non-empty and equal to the owner; a non-forward fleet-placed row: empty raw Account served and noted, else release.RouteAccount must equal the owner; raw field before RouteAccount (+registry:Account x7, +registry:Region x2, +registry:Tunnel, +whole:Route). Pure; no I/O.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: gate set routing on hub role, valid projection, nonempty account/app, instance or inert forward kind, no platform ownership, HA, hibernation or explicit tunnel. New reads are fields of the already-supplied Route. Existing fleet-owner and inert-forward checks still apply; no external read or expansion of destination authority. registry:Account@1100,registry:Account@1256,registry:Account@1354,registry:Account@1610,registry:Account@224,registry:Account@841,registry:Account@912,registry:Account@998,registry:App@244,registry:FleetBoxes@160,registry:HA@275,registry:Hibernate@284,registry:Kind@320,registry:Platform@260,registry:Region@145,registry:Region@679,registry:Tunnel@1057,registry:Tunnel@300,whole:Route@1532 c7caa48b160438d34219e899dbdcf8b7fc5f0a2b989f2de1f562500a9463e574
-internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. registry:Account@9839,registry:Alias@24783,registry:Alias@24870,registry:Alias@25450,registry:App@9855,registry:Health@13580,registry:Health@13706,registry:Hibernate@29297,registry:Host@11166,registry:Host@11223,registry:Host@11259,registry:Host@12002,registry:Host@14189,registry:Host@14284,registry:Host@14572,registry:Host@14598,registry:Host@14650,registry:Host@19245,registry:Host@21152,registry:Host@21460,registry:Host@21487,registry:Host@22302,registry:Host@22874,registry:Host@25204,registry:Host@25253,registry:Host@27868,registry:Host@27893,registry:Host@27910,registry:Host@4397,registry:Host@4766,registry:Host@4820,registry:Host@4870,registry:Host@5890,registry:Host@6005,registry:Kind@17581,registry:Kind@17603,registry:Prefix@22849,registry:Socket@12066,registry:Socket@17460,registry:Socket@21468,registry:Status@4691,registry:Target@22861,registry:Tunnel@9699,registry:Tunnel@9870,registry:Version@17562,registry:Version@17664,whole:RegionalDomain@26092,whole:Route@11314,whole:Route@11422,whole:Route@12122,whole:Route@14723,whole:Route@14787,whole:Route@14838,whole:Route@21520,whole:Route@21527,whole:Route@21623,whole:Route@22737,whole:Route@23905,whole:Route@26084,whole:Route@26129,whole:Route@27774,whole:Route@27808,whole:Route@27896,whole:Route@27975,whole:Route@29299,whole:Route@294,whole:Route@3417,whole:Route@3475,whole:Route@4405,whole:Route@5919,whole:Route@6108,whole:Route@6241,whole:Route@6264,whole:Route@6279,whole:Route@7126,whole:Route@7234,whole:Route@9761,whole:RouteAlias@24754,whole:RoutePath@22280 3a0bdd66ab99319f58599ade38bd49a8a0a96ac656de2c62be2fd8f255ebd8a5
+internal/edge/fleetforward.go FleetServeEligible legacy accepted-legacy accepted-legacy;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4 (§4.4 tenancy): a forward row is eligible only on a hub, inert, fleet-placed, its fleet in the fleets table and its raw Account non-empty and equal to the owner; a non-forward fleet-placed row: empty raw Account served and noted, else release.RouteAccount must equal the owner; raw field before RouteAccount (+registry:Account x7, +registry:Region x2, +registry:Tunnel, +whole:Route). Pure; no I/O.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: gate set routing on hub role, valid projection, nonempty account/app, instance or inert forward kind, no platform ownership, HA, hibernation or explicit tunnel. New reads are fields of the already-supplied Route. Existing fleet-owner and inert-forward checks still apply; no external read or expansion of destination authority. Fix round 1 M1: retain the same fail-closed structural predicate but give each invalid condition an internal diagnostic instead of the no-healthy-copy message. No admission expansion, user-facing answer, or additional read. registry:Account@1269,registry:Account@1340,registry:Account@1426,registry:Account@1528,registry:Account@1684,registry:Account@1782,registry:Account@2038,registry:Account@375,registry:App@395,registry:FleetBoxes@160,registry:HA@546,registry:Hibernate@555,registry:Kind@723,registry:Platform@473,registry:Region@1107,registry:Region@145,registry:Tunnel@1485,registry:Tunnel@637,whole:Route@1960 9ac46053694c38f60bff76e1084a6d6a604e1837fb682ec31aa3b3070ebbf183
+internal/edge/edge.go Edge.Reload legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-design-edge-rate-limit-358;basis=each route's upstream entry gains rate: e.parseRateSettings(t), the row's rate_limit column parsed once per reload; the one added site is that whole:Route pass of t (parseRateSettings is a new unit, classified in the decisions overlay); no other read added;rev3=census-ruling-certwarm-wake;basis=the single reload hook call becomes runReloadHooks(), which runs every registered hook in order (#386); no read added, same 57 sites (56 before #358 landed on main);rev3=census-ruling-edge-asset-cache-3;basis=each tenant reverse proxy built in the switch (the tunnel, fleet, socket and TCP arms, every *httputil.ReverseProxy) is installed behind assetScrubbedProxy, which hands the proxy an assetInformationalScrub writer so an app's 1xx (103) loses the asset cache's reserved headers (X-Carlos-Asset-Fill, -Fill-Ack, -Expires, Carlos-Cache) on every local path, as the backhaul already does (final review F6); a type check of the proxy it just built and a wrapper around it; static and status handlers untouched; read sites unchanged (57), offsets moved; no read added;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: after the path fold, a resolved platform alias takes its source's own upstream entry (same proxy, route, hibernating: the existing activator wake, lease and fence), keeping its own prefix map (none for a minted apex) and never inheriting the source's (Astra r2 P1); a refused alias, or one whose source has no entry, is dropped from the map (not served, not Allowed); the attached-hostname fold clears platformAlias;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Task 5: the activator-managed test (generation proxy, hib, no-activator 404) is Route.ActivatorOwned instead of Kind and Hibernate inline, so a resident rootfs instance goes through the activator; binary rows unchanged;rev3=census-ruling-edge-roll-blip;basis=the tcpProxy and multiProxy calls pass e.hold (the per-Edge localHold set once in newEdge): a loopback TCP upstream that refuses is redialled for up to 13 s and a probed route with a local upstream waits for prober readmission instead of answering 502/503 (#434 part B); edge-side dial policy only, no read added, same 52 sites;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: after the alias fold, reads the regional_domains rows (e.reg.ListRegional; an error aborts the reload as every registry read here does) and applies them with foldRegional against the routes slice the same reload read; the added reads are that one registry list and the routes already read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Tasks 4 and 6: the forward case (fleetProxy toward the binding's FleetBox, throttled refusal); one refusal check before the switch from FleetArmVerdict (sidecar not judged; a non-ready forward row refused; a forward row always judged by FleetServeEligible, any other row only where tunnels are on; an alias of a refused source refused with it); the accountless note; path rows of a forward host not folded; no alias folded onto a refused row; refusedHosts held through every fold. ListFleets and FleetChannelAuth read before the loop (+registry:FleetBox, +registry:Host x7, +whole:Route x3). Serving only; the hub's agent, not root. Review R1 finding 2: the switch reads verdict.Served (FleetArmVerdict) by host; the forward case and the fleet-placed case take their fleet from it (served.Fleet) instead of FleetPlacement(t.Region), and an admitted forward row not Served continues rather than falling through (+registry:Host, -registry:Region); the same rows take the same arms; no read added. Review R2: the switch is on DispatchArm(t, viaFleet, tunnels) (the order moved there unchanged: forward only when in Arm, own Tunnel, fleet, socket, addrs, static, status, else continue), the fleet cases read verdict.Arm (renamed from Served), and the platform-alias fold is foldPlatformAliases with the same take (source entry, own paths, alias marks) and the same refusal log (-registry:Kind x2, -registry:Socket, -registry:Tunnel, +whole:Route: those reads moved into DispatchArm); same rows, same arms, same entries; no read added.;rev3=census-ruling-fleet-routes-followups;basis=the owners map is now e.reg.FleetOwners() instead of ListFleets folded inline: the same fresh-connection ListFleets read and the same name->account map (-registry:Account, -registry:Name, -whole:Fleet x2 move into Registry.FleetOwners); no read added; same error path (abort the reload);rev3=census-ruling-tunnel-websockets;basis=The ArmTunnel arm now records its tenancy (Account, App, Tunnel) copied from the row t that Reload already lists; no new registry query, no file read. Also the reload mutex taken first and held to return, five nil-in-production test hooks, and the sweepUpgrades call after the swap, which reads only the map Reload has just built (spec 7, Tasks 3 and 4).;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5, rule 3): the two fleet proxy builds pass the row to fleetBoxOf(t) instead of reading t.FleetBox (-registry:FleetBox x2, +whole:Route x2); fleetBoxOf answers FleetLabel as authoritative when set, else FleetBox; an authoritative box has no fallback to another of the fleet's channels (503 errFleetDark instead). The edge in the agent, not root; it routes to fewer channels, never more.;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): after the new upstream map is published, closes the held streams of any host the new map no longer holds (absent, not hibernating, route no longer Hibernate). Reads the freshly built in-memory map m and the in-memory held set; no read added beyond the rebuild Reload already does.;rev3=census-ruling-devbox-identity;basis=#486 A: only the devbox edge created by newDevboxEdge (carlos-devbox service user, not root) enables the new proxy hooks. Saves the existing DispatchArm result and reads t.Socket from an already-listed route when that arm is ArmSocket, passing it to configureDevboxProxy for per-request expected-owner validation and visitor-header rewriting. Adds one registry:Socket field site; no new registry query or file open, and ordinary fleet/agent edges leave the hook disabled. Final fix wave: its devbox-only outgoing-header/trailer hooks now also strip case-insensitive underscore/hyphen aliases through stripVisitorHeaders; no new read.;rev3=census-ruling-agent-start-demo-1;basis=Checks demo route eligibility and filters the final folded map using the existing registry listing; no new registry or store query. Merge resolution against origin/main 9bd45488 retains main's devbox proxy hooks (reading the existing route Socket) alongside demo filtering; no additional registry query.;rev3=census-ruling-stateless-replicas-3;basis=Task 3: dispatch admitted stateless set rows through replicaProxy before legacy fleetBoxOf. Read Host and supplied whole Route values from the existing listing to build and filter the set probe inputs after all registry reads and alias folds; synchronize before map publication. Tenancy comes only from FleetArmVerdict. No new external read; no set row reaches legacy fallback, local addresses, provision.Health or hibernation on the hub. Fix round 1 M2: comment and whitespace correction only; read sites and routing behavior unchanged. registry:Account@9912,registry:Alias@24856,registry:Alias@24943,registry:Alias@25523,registry:App@9928,registry:Health@13653,registry:Health@13779,registry:Hibernate@29370,registry:Host@11239,registry:Host@11296,registry:Host@11332,registry:Host@12075,registry:Host@14262,registry:Host@14357,registry:Host@14645,registry:Host@14671,registry:Host@14723,registry:Host@19318,registry:Host@21225,registry:Host@21533,registry:Host@21560,registry:Host@22375,registry:Host@22947,registry:Host@25277,registry:Host@25326,registry:Host@27941,registry:Host@27966,registry:Host@27983,registry:Host@4397,registry:Host@4766,registry:Host@4820,registry:Host@4870,registry:Host@5890,registry:Host@6079,registry:Kind@17654,registry:Kind@17676,registry:Prefix@22922,registry:Socket@12139,registry:Socket@17533,registry:Socket@21541,registry:Status@4691,registry:Target@22934,registry:Tunnel@9772,registry:Tunnel@9943,registry:Version@17635,registry:Version@17737,whole:RegionalDomain@26165,whole:Route@11387,whole:Route@11495,whole:Route@12195,whole:Route@14796,whole:Route@14860,whole:Route@14911,whole:Route@21593,whole:Route@21600,whole:Route@21696,whole:Route@22810,whole:Route@23978,whole:Route@26157,whole:Route@26202,whole:Route@27847,whole:Route@27881,whole:Route@27969,whole:Route@28048,whole:Route@29372,whole:Route@294,whole:Route@3417,whole:Route@3475,whole:Route@4405,whole:Route@5919,whole:Route@6182,whole:Route@6315,whole:Route@6338,whole:Route@6353,whole:Route@7199,whole:Route@7307,whole:Route@9834,whole:RouteAlias@24827,whole:RoutePath@22353 575980dc1128d337eead6f4f6ca0fd4ce89258d9900cfac5bd1df80ce0d4ff8f
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 bfa19b4a843629a3a81b654c04d2521b600d63909b7c339d4171488f544ba56b
-@coverage internal/host 8202b947824702b5897bdb32875ea7ab1386bd0b8f077f5ec1d506c2038f565a
+@coverage internal/edge ad2940df7a60a2a71f136496e6084df1368d19b514f9343a5be49c8c42d80ebe
+@coverage internal/host 9020bd15e0da7c30f1b1ea07346f28c4cb7ca9dadf54c5e726fa0220c0f9d8b1
@coverage internal/replicas 550a02209630a661b8d786822fd51607a4d0481af9ea79e91d270faa1a70d942
@coverage internal/reqrec 384ce988cf87bb60daac7b64f4f398f79b6e09d475698263c5c5b0f36a512ae9
-@coverage internal/status aa303f7d776f78c88272b64c7f0f0f4f4fb10e704bc3ac6acde778c463410b1d
+@coverage internal/status 39db39d326d284c85624ee7a935354780e7124cc85c14451d482a6c2114b5edb
@coverage internal/tunnelclient a5bd418d97ee5e5d2bb9550dd35e2456b1c06fc541b82fe1e40a5594ed6fba30
diff --git a/internal/status/snapshot.go b/internal/status/snapshot.go
index a78a32670..7c92b8b95 100644
--- a/internal/status/snapshot.go
+++ b/internal/status/snapshot.go
@@ -146,6 +146,8 @@ type Probes struct {
// route, which is most of them — and publishes as an absent key, not an
// empty object.
Upstreams map[string][]UpstreamState
+ // ReplicaCopies is historical copy evidence, separate from tenant upstreams.
+ ReplicaCopies map[string][]replicas.Copy
// Aliases is this box's route_aliases rows (registry.RouteAlias), the
// agent's reg.ListAliases() read at statusTick — carried through raw so
@@ -509,14 +511,11 @@ type ProofWait struct {
// BuildFleet never copies Metrics into the public fleet.json (see the package
// doc comment).
type UpstreamState struct {
- // ReplicaCopy carries build and worker evidence through the existing heartbeat.
- // It is absent on address probes and never used as live routing authority.
- ReplicaCopy *replicas.Copy `json:"replica_copy,omitempty"`
- Addr string `json:"addr"`
- Up bool `json:"up"`
- Since time.Time `json:"since"` // last transition (or the sync that started this prober)
- Fails int `json:"fails"` // consecutive probe failures
- LastError string `json:"last_error,omitempty"` // dial vs status, for the log/dashboard
+ Addr string `json:"addr"`
+ Up bool `json:"up"`
+ Since time.Time `json:"since"` // last transition (or the sync that started this prober)
+ Fails int `json:"fails"` // consecutive probe failures
+ LastError string `json:"last_error,omitempty"` // dial vs status, for the log/dashboard
}
// SystemState is the last platform self-update outcome root recorded on the
@@ -648,6 +647,8 @@ type BoxMetrics struct {
// entries on the busiest box today, and self-limiting: only routes an
// operator gave an addr list AND a health block are in it at all.
Upstreams map[string][]UpstreamState `json:"upstreams,omitempty"`
+ // ReplicaCopies stays private until a separate console/CLI view is designed.
+ ReplicaCopies map[string][]replicas.Copy `json:"replica_copies,omitempty"`
// Aliases is issue #151's per-hostname DNS/cert status, keyed by the
// alias hostname — the box's own route_aliases rows only (CollectBox is
// called per-box, same scope as RouteVersions above), never a fleet-wide
@@ -1165,7 +1166,7 @@ func CollectBox(routes []registry.Route, p Probes, now time.Time) Box {
if p.MemTotalBytes != nil || p.MemAvailBytes != nil || p.Load1 != nil ||
p.DiskFreeBytes != nil || p.DiskFullETAHours != nil || p.Release != "" || p.Tunnel != "" ||
p.InstanceID != "" || p.Platform != "" || p.SystemChannel != "" || p.System != nil ||
- len(routeVersions) > 0 || len(routeServing) > 0 || len(aliasReadings) > 0 || p.AliasesRead || len(p.Upstreams) > 0 ||
+ len(routeVersions) > 0 || len(routeServing) > 0 || len(aliasReadings) > 0 || p.AliasesRead || len(p.Upstreams) > 0 || len(p.ReplicaCopies) > 0 ||
len(routeDBBytes) > 0 || p.Layout != nil || len(p.ConfigRefusals) > 0 || len(p.ReleaseRefusals) > 0 || len(p.ProofWaits) > 0 || p.Rollout != nil || p.ConfigGuard != "" ||
p.Alerts != nil || p.GeoIP != nil || p.HeldStreams != nil || len(p.BuildStates) > 0 || p.BuildStatesErr != "" ||
p.UpdateSettings != 0 || len(p.Updates) > 0 || len(p.Egress) > 0 || p.SizeCommittedMiB != nil {
@@ -1199,9 +1200,10 @@ func CollectBox(routes []registry.Route, p Probes, now time.Time) Box {
// for a later probe tick to mutate under the marshaller. An empty
// map (rather than nil) reaching this line can only happen
// alongside another known field above, and omitempty drops it.
- Upstreams: p.Upstreams,
- RouteDBBytes: routeDBBytes,
- Layout: p.Layout,
+ Upstreams: p.Upstreams,
+ ReplicaCopies: p.ReplicaCopies,
+ RouteDBBytes: routeDBBytes,
+ Layout: p.Layout,
// A fresh copy: the guard's own slice is its to mutate.
ConfigRefusals: append([]ConfigRefusal(nil), p.ConfigRefusals...),
ConfigRefusalsTotal: p.ConfigRefusalsTotal,