carlos / platform Public

Cut namespace withdrawal from region HA P3a

Keep booting route and alias publication identical to legacy rows, with
only the effective role and admission fields added. Remove reservation
lookup/dispatch and preserve local admission refusal and H4 exclusions.

Add a production-wired publication/local-refusal/peer-collision witness,
record the group-box follow-up, and regenerate the census proposal.
Focused and race tests, vet, cross-builds and census pass. Full edge and
edgesfile pass; host has the same 21 previously recorded local failures.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 59cb5c7a64eef13c7c96c6bdb4be51c9e5e6f32d parent eb3098a
20 files changed, +187 −787
  • docs/superpowers/notes/census-proposal-region-ha-p3a.md +3 −3
  • docs/superpowers/notes/census-region-ha-p3a-claims.tsv +2 −2
  • docs/superpowers/plans/2026-11-01-region-ha-p3-group.md +1 −0
  • internal/edge/boxroles_test.go +0 −89
  • internal/edge/edge.go +3 −16
  • internal/edge/held_names_test.go +0 −164
  • internal/edge/homemap.go +15 −46
  • internal/edgesfile/admission.go +0 −48
  • internal/edgesfile/edgesfile.go +6 −7
  • internal/edgesfile/fold.go +1 −6
  • internal/edgesfile/homeelect.go +1 −2
  • internal/edgesfile/snapshot.go +5 −6
  • internal/edgesfile/testdata/held-names.json +0 −84
  • internal/host/booting_publication_test.go +128 −0
  • internal/host/boxroles.go +0 −25
  • internal/host/boxroles_test.go +5 −128
  • internal/host/edgesfile.go +10 −12
  • internal/host/held_names_test.go +0 −142
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv +6 −6

Intent

Human

<task-notification> <task-id>bb0h9hwli</task-id> <tool-use-id>toolu_01AbPYn6VZh1zUB22EU3sVHu</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6cb8c43c-d494-478a-8f04-1067486903df/tasks/bb0h9hwli.output</output-file> <status>completed</status> <summary>Background command "W=/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-p3/.superpowers/sdd/2026-11-03-region-ha-p3a; sleep 30; while true; do if [ -s $W/task-2-astra-fix2.md ]; then cat $W/task-2-astra-fix2.md; exit 0; fi; if ! pgrep -f "task-2-astra-fix2.md" &gt;/dev/null; then echo DEAD; tail -c 400 $W/task-2-astra-fix2.log; exit 1; fi; sleep 60; done" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>aa75a4a31718fac73</task-id> <tool-use-id>toolu_01SWWYvGMSw3LmWfn97ZZEHM</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6cb8c43c-d494-478a-8f04-1067486903df/tasks/aa75a4a31718fac73.output</output-file> <status>completed</status> <summary>Agent "Opus review P3a Task 2" 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>**Re-review R2 of fix eb3098a1: NOT READY.** N1 is fixed, but the fix opens two new P1s, and stopping rule 2 is already used up for this fault family. - **N1 (closed box's alias name falls to another app's catch-all): ADDRESSED.** On drain, platform and booting, Home is false and dispatch answers 503; legacy and admitted are unchanged. - **One place?** Classification is in one helper, `NamespaceHost.Hold`. Enforcement is spread across `findHome`, `ServeHTTP` and `DeploymentRoutesComplete`, and both new bugs are there. - **Guard test:** it catches a new name-carrying field. It misses both bugs below because no row puts the same name on the serving side. - **New R2-1 [P1], alias takeover:** a closed box's real routes no longer count as deployment routes, and the fold no longer suppresses other owners' aliases. Probe: drain, platform and booting all give `Owner(x.example.com)` to acct-w's alias; legacy gives acct-a. The 2026-11-04 ruling ("holding never counts as a route") seems to have been read as covering real routes too; the controller should re-read it. - **New R2-2 [P1], admitted box refuses its own catch-all:** `servesExactly` checks only the exact key, so a closed peer's held `*.parent` makes the admitted box answer 503 for every child of its own local catch-all. That lasts the whole restart window, and indefinitely while a box is drain or platform. - **Wire bytes and mixed roll:** switch-off stays byte-identical, since `held` exists only inside `namespace`, which only booting publications carry. Old-binary peers ignore `namespace`, so to them a booting box's names simply vanish (catch-all fallback and alias takeover). Every box must run the new readers before any box turns admission on; that is a rollout gate, not a code fix. Details are under "Re-review R2" in `task-2-review-opus.md`.</result> <usage><subagent_tokens>258074</subagent_tokens><tool_uses>5</tool_uses><duration_ms>115844</duration_ms></usage> </task-notification>

Human

<paseo-system version="1" kind="agent-message" source-agent-id="8a3d302a-eac7-407c-b61c-f5ccc66b5544" message-id="6faf8f0f-51e0-47fb-abcb-03425946342d"> Answer (agent manager, session 8a3d302, delegated by Paul 2026-11-03): CUT namespace withdrawal from P3a, as you recommend. - Booting publications keep the legacy route and alias rows byte for byte. - A closed box refuses locally with 503 and Retry-After (T3). - Home election and cold-wake exclusion of boxes that aren&apos;t admitted stay (H4). This removes the whole family and the mixed-roll gate without cutting anything users have today, which is consistent with Paul&apos;s earlier cuts (N-HA13). No fourth round. Record it on #421 as a rule-2 cut under Paul&apos;s delegation. Add to P3b&apos;s outline anything group boxes will need instead, such as names held by a booting group box. Then carry on: census, whole-branch review, and merge under the standing approval. </paseo-system>

Attributed to this commit: 10.6 g CO₂e (1,287,518 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on region-ha-p3-group, 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-region-ha-p3a.md b/docs/superpowers/notes/census-proposal-region-ha-p3a.md
index b96219208..e3c7c928d 100644
--- a/docs/superpowers/notes/census-proposal-region-ha-p3a.md
+++ b/docs/superpowers/notes/census-proposal-region-ha-p3a.md
@@ -10,7 +10,7 @@ Ruling `census-ruling-region-ha-p3a`. The independent reviewer approves or rejec
| `internal/activator/rootfsworkers.go` `Service.installRootfsWorkerLocked` | body | unchanged (1) | P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. |
| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners; existing reads unchanged. |
| `internal/host/agent.go` `fastTick` | body | unchanged (1) | Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged. |
-| `internal/host/edgesfile.go` `edgesFileWriteClaims` | body | unchanged (65) | Publish one injected role snapshot; hold every published name during booting withdrawal, with held separate from route provenance and wildcard/platform class; held names grant no deployment-route authority; acknowledge the exact published role/admitted/drained tuple only after PUT; existing registry reads unchanged. |
+| `internal/host/edgesfile.go` `edgesFileWriteClaims` | body | unchanged (65) | Publish one injected role snapshot with box_role/admitted/drained; retain legacy route and alias rows during booting, cutting namespace withdrawal under the 2026-11-04 ruling; acknowledge the exact published tuple only after PUT; existing registry reads unchanged. |
| `internal/activator/activator.go` `Service.WakeWorker` | sites | +whole:Route ×2 | P3a Task 3: check local tenant admission and start permission before lease/restore, preserving already-awake reuse during drain and existing serialization. Whole Route passes to the local predicate; no new filesystem or store read. |
| `internal/activator/activator.go` `Service.begin` | sites | +whole:Route ×3 | P3a Task 3: check local tenant admission and start permission before lease/restore, preserving already-awake reuse during drain and existing serialization. Whole Route passes to the local predicate; no new filesystem or store read. |
| `internal/activator/activator.go` `Service.doWakeOnce` | sites | +whole:Route ×2 | P3a Task 3: check local tenant admission and start permission before lease/restore, preserving already-awake reuse during drain and existing serialization. Whole Route passes to the local predicate; no new filesystem or store read. |
@@ -32,7 +32,7 @@ Ruling `census-ruling-region-ha-p3a`. The independent reviewer approves or rejec
| `internal/activator/genservice.go` `Service.startGenExe` | sites | +whole:Route | P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. |
| `internal/activator/hawake.go` `ExecBackend.haSpawnGate` | sites | +whole:Route | P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. |
| `internal/activator/workerbuild.go` `Service.startWorker` | sites | +whole:Route | P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. |
-| `internal/edge/edge.go` `Edge.ServeHTTP` | sites | +whole:Route ×2 | Refuse every held name class with no serving peer, including held wildcard children, before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. P3a Task 3: refuse a managed tenant before forwarding, geo/proof preparation and dispatch; recheck the route after login next-path resolution. Only the fixed platform/unit scope is exempt. Whole Route passes to a local permission check, not a new store/path read. |
+| `internal/edge/edge.go` `Edge.ServeHTTP` | sites | +whole:Route ×2 | Cut the peer namespace-reservation refusal and restore legacy exact-home/catch-all dispatch. Keep P3a Task 3 local admission refusal before forwarding, geo/proof preparation and dispatch, and recheck after login next-path resolution; fixed platform/unit exemptions unchanged. Same Route values and read sites; no new store/path read. |
| `internal/host/agent.go` `runAgent` | sites | -whole:Route | 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. Existing reads unchanged; no new 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. |
| `internal/host/schedule_wiring.go` `newScheduleDeps` | sites | +whole:Route ×4 | P3a Task 3 fix R1: defer timers while local admission is closed, before token mint or attempt bookkeeping; translate an admission refusal from WithDuty into ErrDutyDeferred. Four whole Route predicate uses check existing fixed-route exemptions or pass the same row to WithDuty; no new external read or start authority. |
@@ -106,6 +106,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/host/memwatch.go:memwatchLoop`: reads +file:CommandContext; written legacy, accepted-legacy, frozen
- reads `internal/activator/backend_exec.go:ExecBackend.nestedReady`: +whole:Route; keeps legacy, task accepted-legacy
-Seal: `c68e2453bfc8afaf3794eb4c08850428982fa6954269b6b99bddfda4e6242929` → `754722950bfe1ee96603aa373d2fa272585e17e39a70a221fb6f8cebf0e6bca6`.
+Seal: `c68e2453bfc8afaf3794eb4c08850428982fa6954269b6b99bddfda4e6242929` → `530a1201bda6233facc66a0b51716b3d72783efc07aba7a925022e6052e37559`.
Overlay: `internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/docs/superpowers/notes/census-region-ha-p3a-claims.tsv b/docs/superpowers/notes/census-region-ha-p3a-claims.tsv
index f0f8c7de9..37c74ae23 100644
--- a/docs/superpowers/notes/census-region-ha-p3a-claims.tsv
+++ b/docs/superpowers/notes/census-region-ha-p3a-claims.tsv
@@ -9,11 +9,11 @@ infra/modules/region-host/ingress/variables.tf:external Add ingress-only inputs
infra/modules/region-host/ingress/versions.tf:external Declare OpenTofu and AWS provider requirements for the isolated ingress child; no root runtime reads.
infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl:external Add mock regression for the unchanged fixed instance/profile/SG/root-volume wiring and legacy outputs; no root runtime reads.
internal/host/agent.go:fastTick Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged.
-internal/host/edgesfile.go:edgesFileWriteClaims Publish one injected role snapshot; hold every published name during booting withdrawal, with held separate from route provenance and wildcard/platform class; held names grant no deployment-route authority; acknowledge the exact published role/admitted/drained tuple only after PUT; existing registry reads unchanged.
+internal/host/edgesfile.go:edgesFileWriteClaims Publish one injected role snapshot with box_role/admitted/drained; retain legacy route and alias rows during booting, cutting namespace withdrawal under the 2026-11-04 ruling; acknowledge the exact published tuple only after PUT; existing registry reads unchanged.
internal/boxroles/roles.go:Read Two point GETs of validated own and canonical-region desired-role keys; strict bounded parsing, errors never default to serve; no filesystem read or root authority grant.
internal/host/boxroles.go:boxRoleReader.pass Apply successful two-GET roles even while the watch is unusable; preserve restrictions and close starts on failed reads/application; retain one jittered ReadGate and bounded retry backoff through watch failure; throttle failure logs; no filesystem read.
internal/host/boxroles_config_linux.go:readRoleRegionConfig Read the fixed operator-delivered /etc/carlos/region-config.json through no-symlink openat2, fstat root ownership/regular-file/non-writable checks, single-link check and 4097-byte limited read; validate explicit canonical code and unchanged raw placement, never infer from AWS.
-internal/edge/edge.go:Edge.ServeHTTP Refuse every held name class with no serving peer, including held wildcard children, before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. P3a Task 3: refuse a managed tenant before forwarding, geo/proof preparation and dispatch; recheck the route after login next-path resolution. Only the fixed platform/unit scope is exempt. Whole Route passes to a local permission check, not a new store/path read.
+internal/edge/edge.go:Edge.ServeHTTP Cut the peer namespace-reservation refusal and restore legacy exact-home/catch-all dispatch. Keep P3a Task 3 local admission refusal before forwarding, geo/proof preparation and dispatch, and recheck after login next-path resolution; fixed platform/unit exemptions unchanged. Same Route values and read sites; no new store/path read.
internal/activator/activator.go:Service.serveWakeError P3a Task 3: neutral admission 503 with Retry-After before forwarded-holder diagnostics; no new read, no holder identity. Fix R1: distinguish startup from drain/shutdown using the same admission state; retain 503, Retry-After, no-store and removal of holder identity. Read sites unchanged.
internal/activator/activator.go:type Service P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority.
internal/activator/claimwake.go:Service.doClaimWake P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read.
diff --git a/docs/superpowers/plans/2026-11-01-region-ha-p3-group.md b/docs/superpowers/plans/2026-11-01-region-ha-p3-group.md
index 6af98b282..b1bd581fe 100644
--- a/docs/superpowers/plans/2026-11-01-region-ha-p3-group.md
+++ b/docs/superpowers/plans/2026-11-01-region-ha-p3-group.md
@@ -282,6 +282,7 @@ This section is deliberately **not an executable task list**. Wait for actual am
| Work / invariant | Exactly what must merge first | Integration boundary and acceptance |
|---|---|---|
| **Serving set / H4,R1,A1** | P1b-3a's real cold-wake snapshot/chooser and per-box suspect list, including actual raw-field decoder in `internal/edge`, activator placement wiring and awake Apps publication | Project P3 box_role/admitted/drained into that producer; <=15m/future<=1m/compatible evidence. Booting/platform never candidate; drain can remain a holder during sleep. Preserve N-HA12 10s exclusion, N-HA10 front accounting, local recovery when evidence is unusable and no headroom refusal for existing hosts. No new holder-cache policy or second chooser. |
+| Names held by a booting group box / H4,A1 | P3a cut namespace withdrawal (rule 2, 2026-11-04; three rounds F1/F2, N1, R2-1/R2-2) | A replacement group box publishes its names only after admission or holds them with route authority intact; design it as one invariant with a guard test over every name class, review against an admitted peer's own catch-all and other accounts' aliases; every box must run the new reader before any group box opts in. |
| **Termination-start latch / I3,A1** | P1b-3b's functioning single termination consumer, durable scan/import path and its independent start/cancel acknowledgment on main | Wire actual start success into TerminationStarted. Empty queue is allowed; client construction failure is not started. No network probe to S3 in health. N-HA11 remains one 20s long-poll/box, ~180 receives/h. P3 consumes lifecycle state; it does not implement or ack the departure queue. Consumer startup cannot wait for P3 drain completion. |
| **Console ingress / E1,N1** | P2a's complete CONSOLE_REGION_INGRESS parser/rendering/guidance on main | Validate agent PLATFORM_EDGE_IPS accepts the full public ingress set; set console ingress **before any group edges publication** so auto-public box IPv4s do not become DNS advice. Private root publishes all NLB zone EIPs, plus separately intended platform ingress; no trust-proxy expansion. Hairpin is the own-region subset, not the deployment-wide union. |
| **Role write / R1,S1** | P3 role reader/publication and P2a merged; then P2b's operator-authenticated, claim-free role producer is planned against that main | `carlos system box role <ref|@region-code> <serve|drain|platform>`; authorization/fresh-auth ordering, CAS, audit and serial/index; saved desired versus applied status. Do not repurpose old roster role writes or provide box-local administration. Region default covers new replacement refs during rollback. P2b owns API/CLI/docs, P3 owns application. No new root read from role data. |
diff --git a/internal/edge/boxroles_test.go b/internal/edge/boxroles_test.go
index b5880e7d2..15881adc5 100644
--- a/internal/edge/boxroles_test.go
+++ b/internal/edge/boxroles_test.go
@@ -2,8 +2,6 @@ package edge
import (
"encoding/json"
- "fmt"
- "net/http"
"testing"
"github.com/carlosframework/platform/internal/edgesfile"
@@ -62,90 +60,3 @@ func TestRoleHomeElection(t *testing.T) {
}
}
}
-
-func TestAdmissionWithdrawalWindow(t *testing.T) {
- // These are the writer's namespace-only bytes during a fixed restart.
- // The real fold and wildcard-parent readers must keep their namespace.
- for _, admitted := range []bool{true, false, true} {
- f := wakeFile("g-first")
- f["box_role"] = "serve"
- f["admitted"] = admitted
- f["drained"] = false
- if admitted {
- f["hosts"] = map[string]any{"shop.example.com": map[string]any{"role": "home", "platform": true}, "*.customer.example.com": map[string]any{"role": "wildcard", "wildcard": true}}
- } else {
- f["box_role"] = "booting"
- f["hosts"] = map[string]any{}
- f["namespace"] = map[string]any{"shop.example.com": map[string]any{"route": true, "platform": true}, "*.customer.example.com": map[string]any{"wildcard": true}}
- }
- alias := wakeFile("z-alias")
- alias["hosts"] = map[string]any{"shop.example.com": map[string]any{"role": "home", "alias": true, "stamp": 100}}
- self := wakeFile("self")
- self["hosts"] = map[string]any{}
- m := wakeMap(t, self, f, alias)
- if hosts := m.Hosts(); len(hosts) != 1 || hosts[0] != "shop.example.com" {
- t.Fatalf("parent changed %v", hosts)
- }
- if parents := m.WildcardParents(); len(parents) != 1 || parents[0] != "customer.example.com" {
- t.Fatalf("delegated parents changed %v", parents)
- }
- _, box, ok := m.Home("shop.example.com")
- wantBox := "g-first"
- if !admitted {
- wantBox = "z-alias"
- }
- if !ok || box != wantBox {
- t.Fatalf("alias takeover %s %v", box, ok)
- }
- }
-}
-
-func TestAdmissionWithdrawalRejectsPeerCatchall(t *testing.T) {
- for _, role := range []string{"booting", "serve", "drain", "platform"} {
- for _, local := range []bool{false, true} {
- t.Run(fmt.Sprintf("%s/local=%t", role, local), func(t *testing.T) {
- self := "observer"
- var localHosts []string
- if local {
- self = "z-wild"
- localHosts = []string{"*.example.com"}
- }
- e, m, _ := hopEdge(t, self, localHosts...)
- rec, eip := fakeHomeEdge(t, nil)
- putJSON(t, m.s, edgesfile.Key("z-wild"), fmt.Sprintf(`{"v":1,"box":"z-wild","eip":%q,"box_role":"serve","admitted":true,"drained":false,"hosts":{"*.example.com":{"role":"home","account":"acct-w","app":"w"}}}`, eip))
- fields := `"hosts":{"a.example.com":{"role":"home","account":"acct-a","app":"a"}}`
- if role == "booting" {
- fields = `"hosts":{},"namespace":{"a.example.com":{"route":true}}`
- }
- putJSON(t, m.s, edgesfile.Key("g-first"), fmt.Sprintf(`{"v":1,"box":"g-first","eip":"203.0.113.1","box_role":%q,"admitted":%t,"drained":false,%s}`, role, role != "booting" && role != "serve", fields))
- refreshHomeMap(t, m)
- resp := hopRequest(t, e, "a.example.com", map[string]string{"Cookie": "private=acct-a"})
- body := readBody(t, resp)
- if resp.StatusCode != http.StatusServiceUnavailable || rec.get().n != 0 {
- t.Errorf("closed exact name reached catch-all: status=%d body=%q peer requests=%d", resp.StatusCode, body, rec.get().n)
- }
- if role == "booting" || role == "serve" {
- if body != "This service is starting. Try again later.\n" || resp.Header.Get("Retry-After") != "2" {
- t.Errorf("startup response: %q %v", body, resp.Header)
- }
- } else if body != "This service is unavailable. Try again later.\n" || resp.Header.Get("Retry-After") != "2" {
- t.Errorf("unavailable response: %q %v", body, resp.Header)
- }
- if _, box, ok := m.Home("a.example.com"); ok {
- t.Errorf("closed Home fell through to %s", box)
- }
- if account, _, _, _, ok := m.Owner("a.example.com"); ok {
- t.Errorf("closed Owner fell through to %s", account)
- }
- if addr, _, ok := m.ExactHome("a.example.com"); !ok || addr != "" {
- t.Errorf("missing unavailable exact marker: %q %t", addr, ok)
- }
- resp = hopRequest(t, e, "other.example.com", nil)
- siblingBody := readBody(t, resp)
- if resp.StatusCode != http.StatusOK {
- t.Fatalf("unreserved sibling refused: %d %s", resp.StatusCode, siblingBody)
- }
- })
- }
- }
-}
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index 68e58d8d9..d3e857e82 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -2000,24 +2000,11 @@ func (e *Edge) ServeHTTP(w http.ResponseWriter, r *http.Request) {
// The far asset catch (assetcatch.go, design §5.1) runs on this path too,
// just before the dial: the name is homed elsewhere, so its declared asset
// paths are answered from this box's store or filled from that home.
- if !e.servesExactly(host) {
- home, exact := e.homes.Load().findHome(host)
- if exact || (home.held && !home.dial) {
- if !home.dial {
- body := "This service is unavailable. Try again later."
- if home.starting {
- body = "This service is starting. Try again later."
- }
- w.Header().Set("Retry-After", "2")
- http.Error(w, body, http.StatusServiceUnavailable)
+ if ok && !hopped && !isDoor && !e.servesExactly(host) {
+ if eip, box, remote := e.homes.Load().ExactHome(host); remote {
+ if e.serveAssetFar(w, r, host) || e.backhaulTo(w, r, host, eip, box) {
return
}
- if ok && !hopped && !isDoor {
- observeRegional("exact-home", host)
- if e.serveAssetFar(w, r, host) || e.backhaulTo(w, r, host, home.eip, home.box) {
- return
- }
- }
}
}
// A regional deny entry the gate let through to the exact-home arm above
diff --git a/internal/edge/held_names_test.go b/internal/edge/held_names_test.go
deleted file mode 100644
index 5e10718fc..000000000
--- a/internal/edge/held_names_test.go
+++ /dev/null
@@ -1,164 +0,0 @@
-package edge
-
-import (
- "crypto/tls"
- "crypto/x509"
- "encoding/json"
- "fmt"
- "net"
- "net/http"
- "net/http/httptest"
- "os"
- "reflect"
- "sort"
- "strings"
- "sync/atomic"
- "testing"
- "time"
-
- "github.com/carlosframework/platform/internal/edgesfile"
-)
-
-// All decoded fields are classified here, including references that do not
-// register another name. A newly decoded field must be classified before this
-// guard can pass. Hosts/Namespace keys register names; target_host and
-// assets.primary refer to primaries, covered by the derived-alias fixture.
-func TestHeldNamesDecoderCoverage(t *testing.T) {
- for _, tc := range []struct {
- value any
- fields string
- }{
- {edgesFileView{}, "AdmissionFields Namespace etag V Box EIP Hosts PrivateIP PrivateCIDR Region Placement DataBucket SecretsKeyFP BurstNotices Generation Capabilities HibernationConfigured Draining Role Headroom placementNull"},
- {edgesHostView{}, "Role Replica Platform Alias Wildcard Account App Stamp Incarnation ServingSeq TargetHost Assets"},
- {edgesAssetsView{}, "Paths Gen At Primary"},
- {edgesfile.Host{}, "Role Platform Alias Wildcard Assets"},
- {edgesfile.HostAssets{}, "Paths Gen At Primary"},
- {edgesfile.NamespaceHost{}, "Held Route Platform Wildcard"},
- {edgesfile.AdmissionFields{}, "BoxRole Admitted Drained"},
- {edgesfile.File{}, "AdmissionFields Namespace V Box EIP Region Generation Hosts Addrs"},
- } {
- typ := reflect.TypeOf(tc.value)
- var got []string
- for i := 0; i < typ.NumField(); i++ {
- got = append(got, typ.Field(i).Name)
- }
- want := strings.Fields(tc.fields)
- sort.Strings(got)
- sort.Strings(want)
- if !reflect.DeepEqual(got, want) {
- t.Errorf("%s decoder changed; classify new fields and extend held-name matrix: got %v want %v", typ, got, want)
- }
- }
-}
-
-func TestHeldNamesGuard(t *testing.T) {
- var classes []struct {
- Class, Name string
- Host map[string]any
- Route bool
- }
- body, err := os.ReadFile("../edgesfile/testdata/held-names.json")
- if err != nil {
- t.Fatal(err)
- }
- if err = json.Unmarshal(body, &classes); err != nil {
- t.Fatal(err)
- }
- for _, c := range classes {
- for _, state := range []string{"legacy", "booting", "not-admitted", "serve", "drain", "platform"} {
- for _, local := range []bool{false, true} {
- t.Run(fmt.Sprintf("%s/%s/local=%t", c.Class, state, local), func(t *testing.T) {
- self := "observer"
- var localHosts []string
- if local {
- self = "z-wild"
- localHosts = []string{"*.example.com"}
- }
- e, m, _ := hopEdge(t, self, localHosts...)
- query := c.Name
- if strings.HasPrefix(query, "*.") {
- query = "a" + query[1:]
- }
- rec, peerIP := heldNameHome(t, query)
- homeIP := peerIP
- peer := map[string]any{"v": 1, "box": "z-wild", "eip": peerIP, "hosts": map[string]any{"*.example.com": map[string]any{"role": "home", "account": "acct-w", "app": "w"}}}
- h := map[string]any{}
- for k, v := range c.Host {
- h[k] = v
- }
- h["account"], h["app"] = "acct-a", "a"
- f := map[string]any{"v": 1, "box": "g-first", "eip": homeIP, "hosts": map[string]any{c.Name: h}}
- closed := state != "legacy" && state != "serve"
- if state != "legacy" {
- role := state
- if role == "not-admitted" {
- role = "serve"
- }
- f["box_role"], f["admitted"], f["drained"] = role, state != "booting" && state != "not-admitted", false
- }
- if state == "booting" {
- f["hosts"] = map[string]any{}
- f["namespace"] = map[string]any{c.Name: map[string]any{"held": true, "route": c.Route, "wildcard": h["wildcard"] == true, "platform": h["platform"] == true}}
- }
- for box, file := range map[string]any{"g-first": f, "z-wild": peer} {
- b, err := json.Marshal(file)
- if err != nil {
- t.Fatal(err)
- }
- putJSON(t, m.s, edgesfile.Key(box), string(b))
- }
- refreshHomeMap(t, m)
- resp := hopRequest(t, e, query, map[string]string{"Cookie": "private=acct-a"})
- gotBody := readBody(t, resp)
- if closed {
- if resp.StatusCode != http.StatusServiceUnavailable || rec.Load() != 0 {
- t.Errorf("held name reached catch-all: status=%d body=%q requests=%d", resp.StatusCode, gotBody, rec.Load())
- }
- if _, box, ok := m.Home(query); ok {
- t.Errorf("held Home resolved to %s", box)
- }
- if acct, _, _, _, ok := m.Owner(query); ok {
- t.Errorf("held Owner resolved to %s", acct)
- }
- if addr, _, ok := m.ExactHome(c.Name); !ok || addr != "" {
- t.Errorf("missing held exact marker: %q %t", addr, ok)
- }
- } else {
- // Cert-only parents have always allowed an actual catch-all to serve.
- wantStatus := http.StatusOK
- if c.Class == "cert-only-parent" {
- wantStatus = http.StatusNotFound
- }
- if resp.StatusCode != wantStatus {
- t.Errorf("serving behavior changed: %d %s", resp.StatusCode, gotBody)
- }
- if !local && c.Class != "cert-only-parent" {
- if acct, _, _, _, ok := m.Owner(query); !ok || acct != "acct-a" {
- t.Errorf("serving owner changed: %q %t", acct, ok)
- }
- }
- }
- })
- }
- }
- }
-}
-
-func heldNameHome(t *testing.T, host string) (*atomic.Int64, string) {
- t.Helper()
- calls := &atomic.Int64{}
- cert, _ := selfSignedLeaf(t, host, time.Now().Add(time.Hour))
- server := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { calls.Add(1); w.WriteHeader(http.StatusOK) }))
- server.TLS = &tls.Config{Certificates: []tls.Certificate{*cert}}
- server.StartTLS()
- t.Cleanup(server.Close)
- ip, port, err := net.SplitHostPort(server.Listener.Addr().String())
- if err != nil {
- t.Fatal(err)
- }
- oldPort, oldCAs := backhaulPort, backhaulRootCAs
- backhaulPort, backhaulRootCAs = port, x509.NewCertPool()
- backhaulRootCAs.AddCert(cert.Leaf)
- t.Cleanup(func() { backhaulPort, backhaulRootCAs = oldPort, oldCAs })
- return calls, ip
-}
diff --git a/internal/edge/homemap.go b/internal/edge/homemap.go
index 0fd84c0fb..60d2b29ce 100644
--- a/internal/edge/homemap.go
+++ b/internal/edge/homemap.go
@@ -134,12 +134,11 @@ var (
// decoder ignores, which is the point.
type edgesFileView struct {
edgesfile.AdmissionFields
- Namespace map[string]edgesfile.NamespaceHost `json:"namespace,omitempty"`
- etag string
- V int `json:"v"`
- Box string `json:"box"`
- EIP string `json:"eip"`
- Hosts map[string]edgesHostView `json:"hosts"`
+ etag string
+ V int `json:"v"`
+ Box string `json:"box"`
+ EIP string `json:"eip"`
+ Hosts map[string]edgesHostView `json:"hosts"`
// PrivateIP, PrivateCIDR, Region and Placement choose the dial address
// (region HA spec 2 §6, edgesfile.Reader.Dial). All are absent from a writer that
// predates them, and the dial is then EIP, as before.
@@ -238,8 +237,6 @@ type edgesAssetsView struct {
// homeEntry is one folded answer: where to dial, and which box that is.
type homeEntry struct {
- held bool
- starting bool
// eip is the address to dial: edgesfile.Reader.Dial's answer, the home box's
// private address within its region and its EIP from anywhere else.
eip string
@@ -866,23 +863,13 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
}
reader := edgesfile.Reader{Box: self, Self: own.dialPoint(), SelfKnown: ownKnown, PrivateDial: privateDial}
hosts := make(map[string]homeEntry)
-
for _, k := range keys {
f := files[k]
if f.Box == "" || f.Box == self {
continue
}
addr := reader.Dial(f.dialPoint())
- entries := make(map[string]edgesHostView, len(f.Hosts)+len(f.Namespace))
for host, h := range f.Hosts {
- entries[host] = h
- }
- for host, n := range f.Namespace {
- if _, ok := entries[host]; !ok {
- entries[host] = edgesHostView{Role: "reserved", Platform: n.Platform, Wildcard: n.Wildcard}
- }
- }
- for host, h := range entries {
if host == "" {
continue
}
@@ -891,13 +878,12 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
// A dial target needs an address. A file with none (a box
// with no discoverable public IP) still carries its cert
// halves below; its dial halves are simply not dialable.
- if addr == "" && !f.ProjectHome(h.Role, h.Alias, f.Namespace[host]).Held {
+ if addr == "" {
if !h.Wildcard || !strings.HasPrefix(host, "*.") {
continue
}
h.Role = edgeRoleWildcard
}
- case "reserved":
case edgeRoleWildcard:
// The cert-only role is defined for marked catch-all keys
// alone; on an exact key it would be a KnownHost admission
@@ -908,8 +894,7 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
default:
continue
}
- projection := f.ProjectHome(h.Role, h.Alias, f.Namespace[host])
- in := homeEntry{held: projection.Held, starting: projection.Starting, eip: addr, box: f.Box, platform: h.Platform && !h.Alias && !h.Wildcard, alias: h.Alias, wildcard: h.Wildcard, dial: projection.Dial,
+ in := homeEntry{eip: addr, box: f.Box, platform: h.Platform && !h.Alias && !h.Wildcard, alias: h.Alias, wildcard: h.Wildcard, dial: h.Role == edgeRoleHome && f.HomeEligible(),
account: h.Account, app: h.App, stamp: h.Stamp, incarnation: h.Incarnation, servingSeq: h.ServingSeq, targetHost: h.TargetHost, assets: h.Assets}
prev, dup := hosts[host]
if !dup {
@@ -928,8 +913,6 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
// replaces an alias never inherits the alias's owner or pair,
// even when it publishes none of its own.
merged := prev
- merged.held = prev.held || in.held
- merged.starting = prev.starting || in.starting
merged.platform = prev.platform || in.platform
merged.wildcard = prev.wildcard || in.wildcard
if dialBeats(in, prev) {
@@ -1074,23 +1057,16 @@ func (m *homeMap) Home(host string) (eip, box string, ok bool) {
return h.eip, h.box, true
}
-func (m *homeMap) exactHome(host string) (homeEntry, bool) {
- h, exact := m.findHome(host)
- return h, exact
-}
-
// ExactHome is Home without the one-label wildcard fallback: the dial target
-// another box published for exactly host. A reserved name answers true
-// with an empty address, so dispatch refuses instead of serving a catch-all.
-// The edge asks it when its own
+// another box published for exactly host. The edge asks it when its own
// answer for host came only through a local "*.<parent>" key, so that an
// exact name served elsewhere still wins (ServeHTTP). Fail-closed without a
// self label, exactly as Home is.
func (m *homeMap) ExactHome(host string) (eip, box string, ok bool) {
- if h, found := m.exactHome(host); found {
- if !h.dial {
- return "", h.box, true
- }
+ if m == nil || m.self == "" {
+ return "", "", false
+ }
+ if h, found := m.snapshot().hosts[host]; found && h.dial {
observeRegional("exact-home", host)
return h.eip, h.box, true
}
@@ -1101,23 +1077,16 @@ func (m *homeMap) ExactHome(host string) (eip, box string, ok bool) {
// snapshot read. Home and Owner both go through it, so they can never pick
// different entries for the same host.
func (m *homeMap) lookupHome(host string) (homeEntry, bool) {
- h, _ := m.findHome(host)
- return h, h.dial
-}
-
-// findHome reads one snapshot for dispatch and ownership. The boolean marks
-// an exact match; a held wildcard can also refuse a child's fallback.
-func (m *homeMap) findHome(host string) (homeEntry, bool) {
if m == nil || m.self == "" {
return homeEntry{}, false
}
hosts := m.snapshot().hosts
- if h, ok := hosts[host]; ok && (h.dial || h.held) {
+ if h, ok := hosts[host]; ok && h.dial {
return h, true
}
if i := strings.IndexByte(host, '.'); i > 0 {
- if h, ok := hosts["*"+host[i:]]; ok && (h.dial || h.held) {
- return h, false
+ if h, ok := hosts["*"+host[i:]]; ok && h.dial {
+ return h, true
}
}
return homeEntry{}, false
diff --git a/internal/edgesfile/admission.go b/internal/edgesfile/admission.go
index 7c48367ca..ef428b617 100644
--- a/internal/edgesfile/admission.go
+++ b/internal/edgesfile/admission.go
@@ -25,51 +25,3 @@ func (f AdmissionFields) HomeEligible() bool {
}
return admissionField(f.BoxRole, &role) && admissionField(f.Admitted, &admitted) && admissionField(f.Drained, &drained) && role == "serve" && admitted && !drained
}
-
-// NamespaceHost preserves name ownership during startup withdrawal. It
-// carries no address, owner, alias target or serving role.
-type NamespaceHost struct {
- Held bool `json:"held,omitempty"`
- Route bool `json:"route,omitempty"`
- Platform bool `json:"platform,omitempty"`
- Wildcard bool `json:"wildcard,omitempty"`
-}
-
-// Hold preserves every name a non-serving box publishes: exact routes,
-// aliases, catch-all-derived names and certificate-only wildcard parents.
-// Booting, not-admitted, drain and platform boxes hold all of these classes.
-// A held name must never fall back to another app's or account's catch-all or
-// wildcard parent. Holding never grants deployment-route authority, including
-// DeploymentRoutesComplete and alias reconciliation. Route records provenance
-// separately; ProjectHome grants route authority only to serving host rows.
-func (n NamespaceHost) Hold(role string, alias, platform, wildcard bool) NamespaceHost {
- n.Held = true
- n.Route = n.Route || (role == RoleHome && !alias)
- n.Platform = n.Platform || (platform && !alias)
- n.Wildcard = n.Wildcard || wildcard
- return n
-}
-
-// HomeProjection separates held names, dial targets and deployment routes.
-type HomeProjection struct {
- Dial bool
- Held bool
- Starting bool
- Route bool
-}
-
-func (f AdmissionFields) ProjectHome(role string, alias bool, n NamespaceHost) HomeProjection {
- eligible := f.HomeEligible()
- route := role == RoleHome && !alias
- if !eligible && role != "" {
- n = n.Hold(role, alias, false, false)
- }
- boxRole, admitted := "", true
- starting := (admissionField(f.BoxRole, &boxRole) && boxRole == "booting") || (admissionField(f.Admitted, &admitted) && !admitted)
- return HomeProjection{
- Starting: starting,
- Dial: eligible && role == RoleHome,
- Held: n.Held,
- Route: eligible && route && !n.Held,
- }
-}
diff --git a/internal/edgesfile/edgesfile.go b/internal/edgesfile/edgesfile.go
index fc87da059..35a34f49a 100644
--- a/internal/edgesfile/edgesfile.go
+++ b/internal/edgesfile/edgesfile.go
@@ -87,13 +87,12 @@ type HostAssets struct {
// File is one box's published file.
type File struct {
AdmissionFields
- Namespace map[string]NamespaceHost `json:"namespace,omitempty"`
- V int `json:"v"`
- Box string `json:"box"`
- EIP string `json:"eip"`
- Region string `json:"region,omitempty"`
- Generation string `json:"generation,omitempty"`
- Hosts map[string]Host `json:"hosts"`
+ V int `json:"v"`
+ Box string `json:"box"`
+ EIP string `json:"eip"`
+ Region string `json:"region,omitempty"`
+ Generation string `json:"generation,omitempty"`
+ Hosts map[string]Host `json:"hosts"`
// Addrs is every non-loopback address the box holds, each a bare
// address or a prefix (#328). nil is absent or null: a writer that
// predates the field, or a box whose read failed. Empty is a box with
diff --git a/internal/edgesfile/fold.go b/internal/edgesfile/fold.go
index a6631632a..aea71c76d 100644
--- a/internal/edgesfile/fold.go
+++ b/internal/edgesfile/fold.go
@@ -190,13 +190,8 @@ func DeploymentRoutesComplete(ctx context.Context, s release.Store, now time.Tim
continue // no fresh snapshot: not evidence of a live route
}
joined++
- for host, n := range f.Namespace {
- if f.ProjectHome("", false, n).Route {
- out[host] = true
- }
- }
for host, h := range f.Hosts {
- if f.ProjectHome(h.Role, h.Alias, NamespaceHost{}).Route {
+ if h.Role == RoleHome && !h.Alias {
out[host] = true
}
}
diff --git a/internal/edgesfile/homeelect.go b/internal/edgesfile/homeelect.go
index 4d6a910e1..bfb99c58b 100644
--- a/internal/edgesfile/homeelect.go
+++ b/internal/edgesfile/homeelect.go
@@ -183,13 +183,12 @@ func elect(files []electFile, r Reader) map[string]Elected {
e Elected
}
won := map[string]held{}
-
for _, f := range files {
if !f.HomeEligible() || f.box == "" || f.box == r.Box || r.Dial(f.dial) == "" {
continue
}
for host, in := range f.hosts {
- if host == "" || !f.ProjectHome(in.Role, in.Alias, NamespaceHost{}).Dial {
+ if host == "" || in.Role != RoleHome {
continue
}
c := HomeClaim{Dial: true, Alias: in.Alias, Stamp: in.Stamp,
diff --git a/internal/edgesfile/snapshot.go b/internal/edgesfile/snapshot.go
index b0d346801..b4e4886ce 100644
--- a/internal/edgesfile/snapshot.go
+++ b/internal/edgesfile/snapshot.go
@@ -27,12 +27,11 @@ import (
// write home" (that is the home map's question, internal/edge).
type PlacementView struct {
AdmissionFields
- Namespace map[string]NamespaceHost `json:"namespace,omitempty"`
- V int `json:"v"`
- Box string `json:"box"`
- EIP string `json:"eip"`
- Region string `json:"region"`
- Placement string `json:"placement"`
+ V int `json:"v"`
+ Box string `json:"box"`
+ EIP string `json:"eip"`
+ Region string `json:"region"`
+ Placement string `json:"placement"`
// PrivateIP and PrivateCIDR are the box's private address and its
// region network (region HA spec 2 §6), absent from a writer that
// predates them. Read only by the home election (ElectHomes), which
diff --git a/internal/edgesfile/testdata/held-names.json b/internal/edgesfile/testdata/held-names.json
deleted file mode 100644
index a22ad8771..000000000
--- a/internal/edgesfile/testdata/held-names.json
+++ /dev/null
@@ -1,84 +0,0 @@
-[
- {
- "class": "exact-route",
- "name": "a.example.com",
- "host": {
- "role": "home"
- },
- "route": true
- },
- {
- "class": "platform-route",
- "name": "a.example.com",
- "host": {
- "role": "home",
- "platform": true
- },
- "route": true
- },
- {
- "class": "catchall-derived-route",
- "name": "a.example.com",
- "host": {
- "role": "home",
- "platform": true
- },
- "route": true
- },
- {
- "class": "replica-route",
- "name": "a.example.com",
- "host": {
- "role": "home",
- "replica": true
- },
- "route": true
- },
- {
- "class": "plain-alias",
- "name": "a.example.com",
- "host": {
- "role": "home",
- "alias": true,
- "target_host": "primary.example.net"
- }
- },
- {
- "class": "derived-alias",
- "name": "a.example.com",
- "host": {
- "role": "home",
- "alias": true,
- "target_host": "primary.example.net",
- "assets": {
- "primary": "primary.example.net"
- }
- }
- },
- {
- "class": "route-catchall",
- "name": "*.shop.example.com",
- "host": {
- "role": "home"
- },
- "route": true
- },
- {
- "class": "alias-catchall",
- "name": "*.shop.example.com",
- "host": {
- "role": "home",
- "alias": true,
- "wildcard": true,
- "target_host": "primary.example.net"
- }
- },
- {
- "class": "cert-only-parent",
- "name": "*.shop.example.com",
- "host": {
- "role": "wildcard",
- "wildcard": true
- }
- }
-]
diff --git a/internal/host/booting_publication_test.go b/internal/host/booting_publication_test.go
new file mode 100644
index 000000000..0dc621079
--- /dev/null
+++ b/internal/host/booting_publication_test.go
@@ -0,0 +1,128 @@
+package host
+
+import (
+ "bytes"
+ "encoding/json"
+ "net/http"
+ "net/http/httptest"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/activator"
+ "github.com/carlosframework/platform/internal/domains"
+ "github.com/carlosframework/platform/internal/edge"
+ "github.com/carlosframework/platform/internal/edgesfile"
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+ "github.com/carlosframework/platform/internal/status"
+)
+
+func TestAdmissionBootingKeepsLegacyRows(t *testing.T) {
+ ctx := t.Context()
+ s := release.NewDirStore(t.TempDir())
+ reg := edgesTestRegistry(t)
+ for _, host := range []string{"shop.example.com", "*.parent.example.com"} {
+ if err := reg.Upsert(registry.Route{Host: host, Account: "acct", App: "shop", Kind: "service", Addr: "127.0.0.1:1", Status: "ready"}); err != nil {
+ t.Fatal(err)
+ }
+ }
+ if err := reg.UpsertAlias(registry.RouteAlias{Alias: "alias.example.net", Host: "shop.example.com", Account: "acct", App: "shop", DNSStatus: "pointing"}); err != nil {
+ t.Fatal(err)
+ }
+ ident := edgesFile{Box: "box"}
+ var legacy, booting []byte
+ if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.1", &legacy); err != nil {
+ t.Fatal(err)
+ }
+ var fixture edgesFile
+ if err := json.Unmarshal(legacy, &fixture); err != nil || len(fixture.Hosts) != 3 || !fixture.Hosts["alias.example.net"].Alias {
+ t.Fatalf("fixture lacks routes and alias: %s (%v)", legacy, err)
+ }
+ a := newFixedAdmission(admissionEnv, admissionHealth())
+ ident.RoleSource = a
+ if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.1", &booting); err != nil {
+ t.Fatal(err)
+ }
+ stripped := bytes.Replace(booting, []byte(`"box_role":"booting","admitted":false,"drained":false,`), nil, 1)
+ if !bytes.Equal(legacy, stripped) {
+ t.Errorf("booting changed legacy publication beyond admission fields:\nlegacy: %s\nbooting: %s", legacy, booting)
+ }
+ body, _, err := s.Get(ctx, edgesFileKey("box"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ var published struct{ Hosts json.RawMessage }
+ var before struct{ Hosts json.RawMessage }
+ if err := json.Unmarshal(body, &published); err != nil {
+ t.Fatal(err)
+ }
+ if err := json.Unmarshal(legacy, &before); err != nil {
+ t.Fatal(err)
+ }
+ if !bytes.Equal(published.Hosts, before.Hosts) {
+ t.Errorf("stored booting route/alias rows differ from legacy: %s", published.Hosts)
+ }
+
+ svc := activator.New(activator.Config{}, nil, nil)
+ opt := wireAgentAdmission(a, svc, &activator.ExecBackend{}, nil)
+ e, err := edge.New(reg, svc)
+ if err != nil {
+ t.Fatal(err)
+ }
+ opt(e)
+ for _, host := range []string{"shop.example.com", "alias.example.net", "child.parent.example.com"} {
+ w := httptest.NewRecorder()
+ e.ServeHTTP(w, httptest.NewRequest("GET", "https://"+host+"/", nil))
+ if w.Code != http.StatusServiceUnavailable || w.Header().Get("Retry-After") != "10" || w.Header().Get("X-Carlos-Holder") != "" || w.Body.String() != "This service is starting. Try again later.\n" {
+ t.Errorf("local booting response for %s: %d %v %q", host, w.Code, w.Header(), w.Body.String())
+ }
+ }
+
+ peer := edgesTestRegistry(t)
+ claim := domains.Claim{Schema: 1, Host: "parent.example.com", Account: "other", App: "other", Route: "other.example.net", Wildcard: true, Catchall: true}
+ if err := peer.Upsert(registry.Route{Host: claim.Route, Account: claim.Account, App: claim.App, Kind: "service", Addr: "127.0.0.1:1", Status: "ready"}); err != nil {
+ t.Fatal(err)
+ }
+ cb, err := json.Marshal(claim)
+ if err != nil {
+ t.Fatal(err)
+ }
+ if _, err := s.Put(ctx, domains.ClaimKey(claim.Host), cb, ""); err != nil {
+ t.Fatal(err)
+ }
+ if err := domains.ReconcileAliases(ctx, s, peer, time.Now, nil, nil); err != nil {
+ t.Fatal(err)
+ }
+ aliases, err := peer.ListAliases()
+ if err != nil || len(aliases) != 2 {
+ t.Fatalf("peer fixture lacks apex and catch-all: %v %v", aliases, err)
+ }
+ if err := status.WriteBox(ctx, s, status.Box{Label: "box", GeneratedAt: time.Now()}); err != nil {
+ t.Fatal(err)
+ }
+ routes, complete := edgesfile.DeploymentRoutesComplete(ctx, s, time.Now())
+ if !complete || !routes["shop.example.com"] || !routes["*.parent.example.com"] || routes["alias.example.net"] {
+ t.Errorf("booting route authority changed: %v complete=%t", routes, complete)
+ }
+ if err := domains.ReconcileAliases(ctx, s, peer, time.Now, routes, nil); err != nil {
+ t.Fatal(err)
+ }
+ aliases, err = peer.ListAliases()
+ if err != nil {
+ t.Fatal(err)
+ }
+ for _, alias := range aliases {
+ if alias.Alias == "*.parent.example.com" {
+ t.Error("peer retained another account's catch-all over the booting box's published route")
+ }
+ }
+ peerEdge, err := edge.New(peer, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ w := httptest.NewRecorder()
+ peerEdge.ServeHTTP(w, httptest.NewRequest("GET", "https://child.parent.example.com/", nil))
+ if w.Code != http.StatusNotFound {
+ t.Errorf("peer took booting wildcard route: %d %q", w.Code, w.Body.String())
+ }
+}
diff --git a/internal/host/boxroles.go b/internal/host/boxroles.go
index 00f8acea1..a1d9d544d 100644
--- a/internal/host/boxroles.go
+++ b/internal/host/boxroles.go
@@ -2,7 +2,6 @@ package host
import (
"context"
- "encoding/json"
"errors"
"fmt"
"log"
@@ -12,7 +11,6 @@ import (
"time"
"github.com/carlosframework/platform/internal/boxroles"
- "github.com/carlosframework/platform/internal/edgesfile"
"github.com/carlosframework/platform/internal/release"
)
@@ -111,29 +109,6 @@ func snapshotBoxRole(f edgesFile) edgesFile {
return f
}
-func withBoxRole(f edgesFile, last []byte) edgesFile {
- f = snapshotBoxRole(f)
- if f.RoleSource == nil || f.BoxRole != boxroles.Booting {
- return f
- }
- f.Namespace = map[string]edgesfile.NamespaceHost{}
- reserve := func(hosts map[string]edgeHost) {
- for host, h := range hosts {
- f.Namespace[host] = f.Namespace[host].Hold(h.Role, h.Alias, h.Platform, h.Wildcard)
- }
- }
- var prior edgesFile
- if json.Unmarshal(last, &prior) == nil {
- for host, n := range prior.Namespace {
- f.Namespace[host] = n.Hold("", false, false, false)
- }
- reserve(prior.Hosts)
- }
- reserve(f.Hosts)
- f.Hosts = map[string]edgeHost{}
- return f
-}
-
// armBoxRoles is called by admission startup after armChangeIndex. A
// configuration refusal leaves no reader installed and makes no role GETs.
func armBoxRoles(ctx context.Context, getenv func(string) string, ref string, apply func(boxroles.Role, bool) error) error {
diff --git a/internal/host/boxroles_test.go b/internal/host/boxroles_test.go
index 3a1bc35c8..3a71dff6c 100644
--- a/internal/host/boxroles_test.go
+++ b/internal/host/boxroles_test.go
@@ -5,7 +5,6 @@ import (
"context"
"encoding/json"
"errors"
- "fmt"
"github.com/carlosframework/platform/internal/boxroles"
"github.com/carlosframework/platform/internal/domains"
"github.com/carlosframework/platform/internal/edge"
@@ -309,7 +308,7 @@ func TestRoleUnusableWatchAndApplicationBackoff(t *testing.T) {
}
}
-func TestAdmissionWithdrawalWindow(t *testing.T) {
+func TestAdmissionPublishedRouteAuthority(t *testing.T) {
ctx := context.Background()
s := release.NewDirStore(t.TempDir())
reg := edgesTestRegistry(t)
@@ -344,18 +343,18 @@ func TestAdmissionWithdrawalWindow(t *testing.T) {
if err = json.Unmarshal(body, &f); err != nil {
t.Fatal(err)
}
- if !admitted && (len(f.Hosts) != 0 || !f.Namespace["shop.example.com"].Platform || f.BoxRole != boxroles.Booting || *f.Admitted || *f.Drained) {
+ if !admitted && (len(f.Hosts) != 1 || !f.Hosts["shop.example.com"].Platform || f.BoxRole != boxroles.Booting || *f.Admitted || *f.Drained) {
t.Fatalf("boot publication %s", body)
}
routes, complete := edgesfile.DeploymentRoutesComplete(ctx, s, time.Now())
- if !complete || routes["shop.example.com"] != admitted {
- t.Fatal("namespace withdrawn", routes, complete)
+ if !complete || !routes["shop.example.com"] {
+ t.Fatal("published route lost authority", routes, complete)
}
if err := domains.ReconcileAliases(ctx, s, other, time.Now, routes, nil); err != nil {
t.Fatal(err)
}
aliases, err := other.ListAliases()
- if err != nil || (len(aliases) == 0) != admitted {
+ if err != nil || len(aliases) != 0 {
t.Fatal("alias takeover", aliases, err)
}
_, ok, err := edge.FoldedHome(map[string][]byte{edgesFileKey("box"): body}, "observer", "shop.example.com")
@@ -464,128 +463,6 @@ func TestRolePublicationSchedule(t *testing.T) {
}
}
-func TestRoleWithdrawalKeepsPriorNamespaceClass(t *testing.T) {
- ctx := context.Background()
- s := release.NewDirStore(t.TempDir())
- reg := edgesTestRegistry(t)
- route := registry.Route{Host: "shop.example.com", Kind: "service", Addr: "10.0.0.1:3000", Status: "ready", Platform: true}
- if err := reg.Upsert(route); err != nil {
- t.Fatal(err)
- }
- pub := &rolePublication{role: boxroles.Serve, admitted: true}
- ident := edgesFile{Box: "box", RoleSource: pub}
- var last []byte
- if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.1", &last); err != nil {
- t.Fatal(err)
- }
- // A partially reconstructed row cannot remove the old wildcard parent
- // while startup is still closed.
- route.Platform = false
- if err := reg.Upsert(route); err != nil {
- t.Fatal(err)
- }
- pub.admitted = false
- if err := edgesFilePass(ctx, s, reg, ident, "203.0.113.1", &last); err != nil {
- t.Fatal(err)
- }
- body, _, _ := s.Get(ctx, edgesFileKey("box"))
- var f edgesFile
- if err := json.Unmarshal(body, &f); err != nil {
- t.Fatal(err)
- }
- if !f.Namespace[route.Host].Platform {
- t.Fatal("booting row erased prior parent class")
- }
-}
-
-func TestAdmissionWithdrawalKeepsPeerCatchall(t *testing.T) {
- for _, certOnly := range []bool{false, true} {
- t.Run(fmt.Sprintf("certOnly=%t", certOnly), func(t *testing.T) {
- ctx := context.Background()
- s := release.NewDirStore(t.TempDir())
- claim := domains.Claim{Schema: 1, Host: "shop.example.com", Account: "acct", App: "app", Route: "app.acct.example.net", Wildcard: true, Catchall: true}
- b, _ := json.Marshal(claim)
- if _, err := s.Put(ctx, domains.ClaimKey(claim.Host), b, ""); err != nil {
- t.Fatal(err)
- }
- regs := []*registry.Registry{edgesTestRegistry(t), edgesTestRegistry(t)}
- for i, reg := range regs {
- if !certOnly || i != 0 {
- if err := reg.Upsert(registry.Route{Host: claim.Route, Account: claim.Account, App: claim.App, Kind: "service", Addr: "127.0.0.1:3000", Status: "ready"}); err != nil {
- t.Fatal(err)
- }
- }
- if err := domains.ReconcileAliases(ctx, s, reg, time.Now, nil, nil); err != nil {
- t.Fatal(err)
- }
- }
- if certOnly {
- if err := regs[0].UpsertWildcardDomain(registry.WildcardDomain{Host: claim.Host, Account: claim.Account, App: claim.App}); err != nil {
- t.Fatal(err)
- }
- }
- pub := &rolePublication{role: boxroles.Serve, admitted: true}
- var last, peerLast []byte
- for _, admitted := range []bool{true, false, true} {
- pub.admitted = admitted
- for i, box := range []string{"g-first", "z-peer"} {
- source, gate := pub, &last
- if i == 1 {
- source = &rolePublication{role: boxroles.Serve, admitted: true}
- gate = &peerLast
- }
- if err := edgesFilePass(ctx, s, regs[i], edgesFile{Box: box, RoleSource: source}, "203.0.113.1", gate); err != nil {
- t.Fatal(err)
- }
- if err := status.WriteBox(ctx, s, status.Box{Label: box, GeneratedAt: time.Now()}); err != nil {
- t.Fatal(err)
- }
- }
- body, _, err := s.Get(ctx, edgesFileKey("g-first"))
- if err != nil {
- t.Fatal(err)
- }
- var first edgesFile
- if err := json.Unmarshal(body, &first); err != nil {
- t.Fatal(err)
- }
- star := "*." + claim.Host
- if !admitted {
- n, present := first.Namespace[star]
- if !present || !n.Wildcard || n.Route {
- t.Fatalf("withdrawal lost wildcard class or invented route: %s", body)
- }
- } else if h, present := first.Hosts[star]; !present || (certOnly && h.Role != "wildcard") || (!certOnly && (h.Role != "home" || !h.Alias)) {
- t.Fatalf("wrong fixture publication: %s", body)
- }
- routes, complete := edgesfile.DeploymentRoutesComplete(ctx, s, time.Now())
- if !complete || !routes[claim.Route] {
- t.Fatal("missing real route", routes, complete)
- }
- if err := domains.ReconcileAliases(ctx, s, regs[1], time.Now, routes, nil); err != nil {
- t.Fatal(err)
- }
- aliases, err := regs[1].ListAliases()
- found := false
- for _, a := range aliases {
- found = found || a.Alias == "*."+claim.Host
- }
- if err != nil || !found {
- t.Errorf("admitted=%t: peer lost catch-all: %v %v (routes %v)", admitted, aliases, err, routes)
- }
- snap, err := edgesfile.ReadSnapshot(ctx, s)
- if err != nil {
- t.Fatal(err)
- }
- won, _, err := edgesfile.ElectHomesForEveryReader(snap.Files)
- if err != nil || won["*."+claim.Host].Box == "" {
- t.Errorf("catch-all election lost: %v %v", won, err)
- }
- }
- })
- }
-}
-
func TestRolePublisherAckIdentifiesBody(t *testing.T) {
ctx := context.Background()
p := &rolePublication{role: boxroles.Serve}
diff --git a/internal/host/edgesfile.go b/internal/host/edgesfile.go
index aa49df487..99d113ee2 100644
--- a/internal/host/edgesfile.go
+++ b/internal/host/edgesfile.go
@@ -18,7 +18,6 @@ import (
"github.com/carlosframework/platform/internal/appconfig"
"github.com/carlosframework/platform/internal/boxroles"
"github.com/carlosframework/platform/internal/edge"
- "github.com/carlosframework/platform/internal/edgesfile"
"github.com/carlosframework/platform/internal/instancectl"
"github.com/carlosframework/platform/internal/registry"
"github.com/carlosframework/platform/internal/release"
@@ -258,16 +257,15 @@ func awakeCount(reg *registry.Registry) int {
// batch-wide if it ever reached here (plan review catch, 2026-08-23).
// edgesFileRegion resolves the real thing.
type edgesFile struct {
- RoleSource edgesRoleSource `json:"-"`
- RolePublishRequired bool `json:"-"`
- BoxRole boxroles.Role `json:"box_role,omitempty"`
- Admitted *bool `json:"admitted,omitempty"`
- Drained *bool `json:"drained,omitempty"`
- Namespace map[string]edgesfile.NamespaceHost `json:"namespace,omitempty"`
- V int `json:"v"`
- Box string `json:"box"`
- EIP string `json:"eip"`
- Region string `json:"region,omitempty"`
+ RoleSource edgesRoleSource `json:"-"`
+ RolePublishRequired bool `json:"-"`
+ BoxRole boxroles.Role `json:"box_role,omitempty"`
+ Admitted *bool `json:"admitted,omitempty"`
+ Drained *bool `json:"drained,omitempty"`
+ V int `json:"v"`
+ Box string `json:"box"`
+ EIP string `json:"eip"`
+ Region string `json:"region,omitempty"`
// PrivateIP is the address an edge in this box's region dials (region
// HA spec 2 §6), and PrivateCIDR the region network that holds it,
// both validated by edgesfile.PrivateAddress before they are written.
@@ -954,7 +952,7 @@ func edgesFileWriteClaims(ctx context.Context, s release.Store, reg *registry.Re
f := ident
f.V, f.EIP, f.Hosts, f.Generation = 1, eip, hosts, ""
- f = withBoxRole(f, *last)
+ f = snapshotBoxRole(f)
f.BurstNotices = true
f.PrivateIP, f.PrivateCIDR = private.Private, private.PrivateCIDR
// Before the gate copy, so an address change is a reason to write.
diff --git a/internal/host/held_names_test.go b/internal/host/held_names_test.go
deleted file mode 100644
index c309617f2..000000000
--- a/internal/host/held_names_test.go
+++ /dev/null
@@ -1,142 +0,0 @@
-package host
-
-import (
- "context"
- "encoding/json"
- "os"
- "testing"
- "time"
-
- "github.com/carlosframework/platform/internal/boxroles"
- "github.com/carlosframework/platform/internal/domains"
- "github.com/carlosframework/platform/internal/edgesfile"
- "github.com/carlosframework/platform/internal/registry"
- "github.com/carlosframework/platform/internal/release"
- "github.com/carlosframework/platform/internal/status"
-)
-
-func TestHeldNamesPublicationGuard(t *testing.T) {
- var classes []struct {
- Class, Name string
- Host edgeHost
- Route bool
- }
- body, err := os.ReadFile("../edgesfile/testdata/held-names.json")
- if err != nil {
- t.Fatal(err)
- }
- if err = json.Unmarshal(body, &classes); err != nil {
- t.Fatal(err)
- }
- for _, c := range classes {
- for _, state := range []string{"legacy", "booting", "not-admitted", "serve", "drain", "platform"} {
- t.Run(c.Class+"/"+state, func(t *testing.T) {
- ctx := context.Background()
- s := release.NewDirStore(t.TempDir())
-
- reg := edgesTestRegistry(t)
- primary := c.Name
- if c.Host.Alias {
- primary = "primary.example.net"
- }
- if c.Host.Role == "home" {
- if err := reg.Upsert(registry.Route{Host: primary, Account: "acct", App: "app", Kind: "service", Addr: "127.0.0.1:3000", Status: "ready", Platform: c.Host.Platform, Replica: c.Host.Replica}); err != nil {
- t.Fatal(err)
- }
- }
- if c.Host.Alias {
- if err := reg.UpsertAlias(registry.RouteAlias{Alias: c.Name, Host: primary, Account: "acct", App: "app", DNSStatus: "pointing"}); err != nil {
- t.Fatal(err)
- }
- }
- if c.Host.Wildcard {
- if err := reg.UpsertWildcardDomain(registry.WildcardDomain{Host: c.Name[2:], Account: "acct", App: "app"}); err != nil {
- t.Fatal(err)
- }
- }
- source := &rolePublication{role: boxroles.Serve, admitted: true}
- f := edgesFile{Box: "g-first", RoleSource: source}
- if state == "legacy" {
- f.RoleSource = nil
- }
- var last []byte
- if err := edgesFilePass(ctx, s, reg, f, "203.0.113.1", &last); err != nil {
- t.Fatal(err)
- }
- serving, err := edgesfile.Parse(last)
- if err != nil {
- t.Fatal(err)
- }
- h, present := serving.Hosts[c.Name]
- if !present || h.Role != c.Host.Role || h.Alias != c.Host.Alias || h.Wildcard != c.Host.Wildcard {
- t.Fatalf("fixture did not publish class %s: %s", c.Class, last)
- }
- closed := state != "legacy" && state != "serve"
- if state != "legacy" {
- source.role = boxroles.Role(state)
- if state == "not-admitted" {
- source.role = boxroles.Serve
- }
- source.admitted = state != "booting" && state != "not-admitted"
- }
- if err := edgesFilePass(ctx, s, reg, f, "203.0.113.1", &last); err != nil {
- t.Fatal(err)
- }
- b, _, err := s.Get(ctx, edgesfile.Key(f.Box))
- if err != nil {
- t.Fatal(err)
- }
-
- if err = status.WriteBox(ctx, s, status.Box{Label: f.Box, GeneratedAt: time.Now()}); err != nil {
- t.Fatal(err)
- }
- decoded, err := edgesfile.Parse(b)
- if err != nil {
- t.Fatal(err)
- }
- if closed && (state == "booting" || state == "not-admitted") {
- if _, ok := decoded.Namespace[c.Name]; !ok {
- t.Errorf("withdrawal dropped %s: %s", c.Class, b)
- }
- }
- routes, complete := edgesfile.DeploymentRoutesComplete(ctx, s, time.Now())
- if !complete || routes[c.Name] != (c.Route && !closed) {
- t.Errorf("held name counted as route or serving route lost: routes=%v complete=%t bytes=%s", routes, complete, b)
- }
- // Reconciliation consumes the real fleet route set. A hold alone must
- // never delete the serving peer's alias on that key.
- if closed {
- reg := edgesTestRegistry(t)
- primary := "primary.example.net"
- if err = reg.Upsert(registry.Route{Host: primary, Account: "acct", App: "app", Kind: "service", Addr: "127.0.0.1:3000", Status: "ready"}); err != nil {
- t.Fatal(err)
- }
- claim := domains.Claim{Schema: 1, Host: c.Name, Account: "acct", App: "app", Route: primary}
- if c.Name[0] == '*' {
- claim.Host = c.Name[2:]
- claim.Wildcard = true
- claim.Catchall = true
- }
- cb, _ := json.Marshal(claim)
- if _, err = s.Put(ctx, domains.ClaimKey(claim.Host), cb, ""); err != nil {
- t.Fatal(err)
- }
- if err = domains.ReconcileAliases(ctx, s, reg, time.Now, routes, nil); err != nil {
- t.Fatal(err)
- }
- aliases, err := reg.ListAliases()
- if err != nil {
- t.Fatal(err)
- }
- found := false
- for _, a := range aliases {
- found = found || a.Alias == c.Name
- }
- if !found {
- t.Errorf("hold suppressed peer alias %s: %v", c.Name, aliases)
- }
- }
- })
- }
- }
-}
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 411257709..0462f3c68 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -75,4 +75,4 @@ plan14-root-reads-domains-check-country.tsv b0fc198c53bb0dacba33a54c3d8bf8fe5ac0
plan14-root-reads-static-stream-extract.tsv 7fb932b118e67e23b33a374c6a4020b38976667c7ec4cfb855c0f8b598b1756b
plan14-root-reads-ls284.tsv 744b16d970f22476b79982e57c326157ca5137fa96ccaee4a7ae10c25248d124
plan14-root-reads-region-ha-p1b3b-t.tsv c68e2453bfc8afaf3794eb4c08850428982fa6954269b6b99bddfda4e6242929
-plan14-root-reads-region-ha-p3a.tsv 754722950bfe1ee96603aa373d2fa272585e17e39a70a221fb6f8cebf0e6bca6
+plan14-root-reads-region-ha-p3a.tsv 530a1201bda6233facc66a0b51716b3d72783efc07aba7a925022e6052e37559
diff --git a/internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv b/internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv
index ad4088402..62c53d471 100644
--- a/internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv
@@ -50,7 +50,7 @@
@legacy 20b2b61d4d7e38c529ad737228c91df3dea42c439c685bc3b82da31092cb214a internal/activator/genservice.go Service.startGen legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. whole:Route@120,whole:Route@249,whole:Route@307,whole:Route@522 48410b006d4ff4566c9379d6696f55c9b67d882b5a5b685ad757960fa619cabe
@legacy ecfe00ccdb2d18bd5c05fb0dc2e86b8857d9f528a5a2ca3350ab6a9a054f2e93 internal/activator/genservice.go Service.startGenExe legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. whole:Route@170,whole:Route@253 445d05293d9e0a7ae4858c723a77eb0d267ee3839f67dacbeaa762de58546a07
@legacy d5d3f63f7810cc876d19791895726c64872024d4a40e9dc5cf4bccca96d90b4a internal/activator/hawake.go ExecBackend.haSpawnGate legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: before every spawn of a host this backend acquired HA, re-runs haContained and refuses an uncontained row; a non-HA host passes; +registry:Host, +whole:Route; only refuses;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. registry:Host@153,whole:Route@210,whole:Route@93 71c81e3c5168d1a2a0fc56144828676efe2673ac52415b787e0ab3e8bf18959b
-@legacy e33a3783ee68fb347f748e260ed33037591240f2576eb3bcdd06f43eafa67ea1 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=Refuse every held name class with no serving peer, including held wildcard children, before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. P3a Task 3: refuse a managed tenant before forwarding, geo/proof preparation and dispatch; recheck the route after login next-path resolution. Only the fixed platform/unit scope is exempt. Whole Route passes to a local permission check, not a new store/path read. file:ReadAll@15405,registry:App@21562,registry:Gate@14379,registry:Gate@25953,registry:Gate@26013,registry:Gate@26071,registry:Host@26056,registry:ImportGate@33456,registry:Kind@20424,registry:Kind@23862,registry:Kind@33398,registry:Kind@33427,whole:Route@14274,whole:Route@14385,whole:Route@17202,whole:Route@17986,whole:Route@18444,whole:Route@18636,whole:Route@20427,whole:Route@21488,whole:Route@21554,whole:Route@21565,whole:Route@21818,whole:Route@21913,whole:Route@21989,whole:Route@22033,whole:Route@22335,whole:Route@22365,whole:Route@23865,whole:Route@24150,whole:Route@25956,whole:Route@26016,whole:Route@26059,whole:Route@26074,whole:Route@26992,whole:Route@29055,whole:Route@33401,whole:Route@33430,whole:Route@33459,whole:Route@33491,whole:Route@35339,whole:Route@5267 5476545ea7aa077d8db55d9ee51bdb854c4e3c093daaf706c44b63d17e5b4957
+@legacy 8682f2d1cd780e76dcafa8a92f2d476002b9b2198e865af142d9fb4457a6d92f 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=Cut the peer namespace-reservation refusal and restore legacy exact-home/catch-all dispatch. Keep P3a Task 3 local admission refusal before forwarding, geo/proof preparation and dispatch, and recheck after login next-path resolution; fixed platform/unit exemptions unchanged. Same Route values and read sites; no new store/path read. file:ReadAll@15044,registry:App@21201,registry:Gate@14018,registry:Gate@25592,registry:Gate@25652,registry:Gate@25710,registry:Host@25695,registry:ImportGate@33095,registry:Kind@20063,registry:Kind@23501,registry:Kind@33037,registry:Kind@33066,whole:Route@13913,whole:Route@14024,whole:Route@16841,whole:Route@17625,whole:Route@18083,whole:Route@18275,whole:Route@20066,whole:Route@21127,whole:Route@21193,whole:Route@21204,whole:Route@21457,whole:Route@21552,whole:Route@21628,whole:Route@21672,whole:Route@21974,whole:Route@22004,whole:Route@23504,whole:Route@23789,whole:Route@25595,whole:Route@25655,whole:Route@25698,whole:Route@25713,whole:Route@26631,whole:Route@28694,whole:Route@33040,whole:Route@33069,whole:Route@33098,whole:Route@33130,whole:Route@34978,whole:Route@5267 a0c2b3b0f2a4295bc332424df7c76f12f0b33477bc618fe72501df026164448e
@legacy 3718b1a504525b86388061b7d768fe876df57b4cae39ad6f7d49eb0df4835473 internal/host/schedule_wiring.go newScheduleDeps legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (J1, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from armSchedule: main's body with the runner's Skip set to scheduleSkip; no new read site;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Runner.WithDuty before token access through the existing Service. No new read.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3 fix R1: defer timers while local admission is closed, before token mint or attempt bookkeeping; translate an admission refusal from WithDuty into ErrDutyDeferred. Four whole Route predicate uses check existing fixed-route exemptions or pass the same row to WithDuty; no new external read or start authority. registry:App@1979,registry:App@388,registry:Host@2046,registry:Host@396,whole:Route@1223,whole:Route@1298,whole:Route@1974,whole:Route@383,whole:Route@872,whole:Route@946 143dc95af7d681eb5cbd9ca957acd888e1942404f9463b4e9a4bc6bf216d95dd
internal/activator/activator.go Service.serveWakeError diagnostic C,J4 rev3=PROPOSED-seed; incarnation-keyed missing-files diagnostics and indexed retry results; throttles output only and grants no retry, stop or launch;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more case, errLeaseRefused (a born-HA host outside the nested layout or an HA acquire's refusal): logged at most once per diagnostic window (allowFilesDiagnostic(rt.Host, ...)) and answered 503 with Retry-After: 10; the other cases unchanged; +registry:Host x2 are rt.Host in that call and the log line; it only answers;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: two new answers, a resident inside its backoff gets 503 with Retry-After (RFS-3-C16), and a rootfs row refused before the lease (errRootfsNotAdmitted) gets the existing wake-failed 503; no read added;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: for a verified HA hop, a held lease answers 503 Retry-After 1 with X-Carlos-Holder (answerForwarded) and every other refusal adds X-Carlos-Holder: none (noteNoHolder); legacy routes and cancellation unchanged; same reads;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: neutral admission 503 with Retry-After before forwarded-holder diagnostics; no new read, no holder identity. Fix R1: distinguish startup from drain/shutdown using the same admission state; retain 503, Retry-After, no-store and removal of holder identity. Read sites unchanged. registry:Host@1253,registry:Host@1317,registry:Host@3019,registry:Host@3083,whole:Route@387 a39a010317dae409f05d3a32267414170852694bce8213ca8d61bfb06925d08b
internal/activator/activator.go type Service authority B,C,D,F,J4 rev3=PROPOSED-seed; existing activator lifecycle and due-wake state plus owned seed exclusion and incarnation-keyed diagnostics; normal refusal and preparation ordering remain authoritative; PROPOSED-plans-2-box-limits adds the idleFor hook field, which only narrows idle windows;rev3=census-ruling-plans-4c-box-throttle;basis=gains the maxRunFor hook field beside idleFor (plans 4c). No read added.;rev3=census-ruling-plans-4d-lapse;basis=gains the disabledFor hook field beside maxRunFor (plans 4d). No read added.;rev3=census-ruling-remote-instance-metrics;basis=gains tenancySeq, hostTenants and hostMixed, in-memory fields for Tenancies; no read added;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: one more field, markers (markerRetry: an atomic running flag and the last log time) for retryOwedMarkers; no read added; merge of origin/main d7ae1d76: main's fields are kept as main has them (census-ruling-remote-instance-metrics: tenancySeq, hostTenants, hostMixed); this branch's change is the same as above;rev3=census-ruling-rootfs-apps-3;basis=rootfs Plan 3 Tasks 7 and 8: new fields for rootfs admission (rootfsArmed, rootfsSwept), the per-host gate ask and refusal memo, and residency state (lister, backoff, start ceiling, cursor, test seam); no read;rev3=census-ruling-rootfs-apps-3-release;basis=rootfs Plan 3 Group R: one new field, releaseOps (host to the in-memory release record, under a.mu); no read;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W: one new field, leaseNow (a clock seam for a worker start's headroom against the lease deadline, nil is the real clock); no read;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2: gains the holder cache and its single-flight state; no read;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (controller ruling after branch review R1, and Paul's R2 ruling): one field, Fleet (activator.FleetWake: the box's fleet state, not on a fleet by default, on a fleet with a known label and a record reader, or on a fleet with an invalid identity), set by the agent before Start and read only by routeCurrentUnderLease. No read in the declaration. Agent, not root.;rev3=census-ruling-rootfs-apps-6;basis=rootfs Plan 6 Task 7a fix round 1: one field, drainBudget (time.Duration), which New copies from residentDrainBudget and a rootfs entry's lease watch reads in its place, so a test's change of the package var never races a watch goroutine; declaration only, reads nothing; merge of origin/main 6f1f6ca6: main's one field, Fleet (activator.FleetWake), is kept as main has it (census-ruling-managed-fleets-1b); this branch's change is the same as above;rev3=census-ruling-region-ha-p1b3a;basis=Add bounded placement peer and diagnostic state and the over-capacity callback; no read in this declaration and no new root authority.;rev3=census-ruling-stateless-replicas-1;basis=Add coordinator, existing-record observation callback and per-host preparation locks; no read in the declaration. Task 3a: Add optional canonical storage-selection and durable deploy-ID callbacks; declaration only, no read or authority in these fields.;rev3=census-ruling-edge-held-streams;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): adds the heldLegs map to actEntry (legs by id, under a.mu) and heldWakeHook (atomic pointer to a callback) and heldLegSeq (atomic counter) to Service. State only, in memory; no read of tenant, app or box-agent-writable input.;rev3=census-ruling-wake-storm-cap;basis=the agent as carlos: one field, wakeSlots (chan struct{}, the wake semaphore made by New from Config.WakeSlots, default 4); declaration only, no read.;rev3=census-ruling-region-ha-p1b3b-t;basis=Add the B2 DutyStore interface field and process-local duty view, suppression and invalidation state. No read added. B2 adds the verified-successor identity callback; no read in the declaration. B3b adds a nonblocking departure-suspicion callback, invoked only after an accepted holder-forward failure and after cache locks release; it cannot authorize a take.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: immutable callbacks installed before Start for tenant admission, local start permission, fixed route exemptions and shutdown closure; nil callbacks preserve switch-off behavior; no new reads. Fix R1: add an immutable startup-phase callback for response copy, set before service startup. No new read or execution authority. 6021fe3c1c364d0d4192cdc6c759a6340a4b3c099dd7394c8e5ed9e9bbde912b
@@ -58,7 +58,7 @@ internal/activator/claimwake.go Service.doClaimWake legacy accepted-legacy accep
internal/activator/rootfsworkers.go Service.installRootfsWorkerLocked legacy accepted-legacy accepted-legacy;rev3=census-ruling-rootfs-apps-3-workers;basis=rootfs Plan 3 Group W, W1.11: the one writer of a worker's proc; installs only on the host's own entry, for a worker still the entry's, while the entry is awake and owned (a resident only with its lease watch); refused, the caller stops and proves gone what it started; in-memory;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. whole:Route@263 4796e557b3281e2165ac8cee36361bd88b4faef56f5520e5c83a3c7fd050a535
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-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; existing reads unchanged. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 58941f6f3c6726de8d9e93562a1b95de0f7f90d43b6a54107958efd95af38d78
internal/host/agent.go fastTick legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=PROPOSED-s3-change-index;identity=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos);basis=observes the change index before any pass (observeIndex), runs the backstop's requested full pass and a scoped pass for moved app scopes (indexTick), and arms the canary pointer gate on the sweep (canaryPointerGate) only on a tick whose own index observation succeeded; read site unchanged, offset moved;rev3=census-ruling-stateless-replicas-1;basis=Call coordinator Tick on the existing tick before convergence; client renews held terms only at the pinned interval. Existing registry read unchanged. Final review I3: signal the owned renewal worker instead of waiting for its sequential console HTTP calls. Existing convergence and record read unchanged.;rev3=census-ruling-region-ha-p3a;basis=Run the optional desired-role reader on the existing tick after observing the armed change index; no new root path or timer, nil reader is unchanged. registry:Host@4821 487aa39fc1d1a2bb188ab5b71f0ee4bc0b417c53914f74c2b55867001a2ce528
-internal/host/edgesfile.go edgesFileWriteClaims authority F,J1 rev3=census-ruling-self-serve-moves-1;basis=root-route;kept=F;scope=protected-decision-only; the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): region-ha-2a's body, which with the box's lifetimes switch on also publishes each served row's lifetime pair (registry:Incarnation and registry:ServingSeq, two new sites on the rows it already lists) and an alias's or served catch-all's primary's pair, and names that primary as target_host whatever the switch; a report the edge orders unstamped entries by, not a decision; no record, /data, release or claim read added; F,J1 authority retained; self-serve moves 1 Task 8;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 8: takes a localAddrs reader (instancectl.LocalAddresses in production, which reads /proc/net/fib_trie and /proc/net/if_inet6 in the agent) and publishes its non-loopback entries as the edges file's addrs before the write gate (boxAddrs, no read of its own), so an address change writes once. The same 44 sites, offsets moved; no record, /data, release or claim read added; a report the console's egress grant check reads, not a root decision; F,J1 authority retained.;rev3=census-ruling-edge-asset-cache-3;basis=starts with assets = assets.active(), so a policy whose box has not opened its asset store publishes no assets blocks and reads no manifests, and copies the decision's Primary (the route host the block was decided for, drift D4) into the published assets block; read sites unchanged (44); no read added. Merged onto main's #328 body, which takes the localAddrs reader: the assets.active() line sits after that signature and the loop passes pub and instancectl.LocalAddresses;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the claims argument (*edgesClaims) becomes addrs (AddressSource) and the applyEdgesClaims(ctx, claims, routes, hosts) call is deleted with edgesclaims.go, which is the one whole:Route site removed: no host claim is read and every served row publishes as with region HA off; the box-address publication is the same code reading addrs.BoxAddresses() instead of claims.addrs; a report the edge reads, not a root decision; no read added; merge of origin/main d7ae1d76: main's edge asset cache plan 3 body is kept (census-ruling-edge-asset-cache-3): the first line is assets = assets.active(), so a policy whose store has not opened publishes no assets blocks and reads no manifests, and edgesFileLoop passes pub (assets.active() for that tick) in the assets argument; main's claims *edgesClaims argument is this branch's addrs AddressSource, and no edgesClaims, applyEdgesClaims or hostclaim reference remains;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: skips publishing a platform alias edge.PlatformAliasFold refuses (and so anything attached to it); reads the same route listing;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 and its fix rounds: publishes by FleetArmVerdict (via fleetRefusedFor): withheld rows left out; a forward host's path rows left out of its owner; no assets for forward rows; the alias loop replays Reload's alias fold from the served rows so a chained alias carries its root primary's owner; certRefused and parentRefused leave out a refused claim's wildcard parent (+registry:Alias x5, +registry:Host x4, +whole:Route, +whole:RouteAlias x2, +whole:RoutePath x7, +whole:WildcardDomain). Rows already read in the pass; keeps authority F,J1; publishes less, never more.;rev3=census-ruling-probe-burst-limit;basis=sets the constant BurstNotices=true on the box's own edges file (this build's edge answers probe-burst notices, so peers may send them); not from config or any read; the same 65 sites; a report other edges read, not a root decision; F,J1 authority retained; no new root read or write kind;rev3=census-ruling-region-ha-p3a;basis=Publish one injected role snapshot; hold every published name during booting withdrawal, with held separate from route provenance and wildcard/platform class; held names grant no deployment-route authority; acknowledge the exact published role/admitted/drained tuple only after PUT; existing registry reads unchanged. registry:Account@15753,registry:Alias@10256,registry:Alias@13226,registry:Alias@13276,registry:Alias@8683,registry:Alias@8702,registry:Alias@8801,registry:Alias@8855,registry:Alias@8890,registry:Alias@8952,registry:Alias@9322,registry:Alias@9479,registry:Alias@9549,registry:Alias@9581,registry:App@15765,registry:DNSStatus@8997,registry:DNSStatus@9488,registry:Host@13129,registry:Host@13149,registry:Host@13414,registry:Host@13494,registry:Host@13529,registry:Host@13578,registry:Host@14040,registry:Host@14075,registry:Host@15183,registry:Host@3889,registry:Host@3935,registry:Host@3994,registry:Host@5109,registry:Host@6079,registry:Host@8728,registry:Host@8776,registry:Incarnation@5069,registry:Platform@4848,registry:Provisioned@4862,registry:Replica@4886,registry:ServingSeq@5084,registry:Status@2677,whole:Route@1026,whole:Route@17223,whole:Route@18041,whole:Route@18216,whole:Route@1841,whole:Route@2047,whole:Route@6164,whole:Route@750,whole:RouteAlias@13180,whole:RouteAlias@17245,whole:RouteAlias@18231,whole:RouteAlias@8566,whole:RouteAlias@8648,whole:RouteAlias@8840,whole:RoutePath@17238,whole:RoutePath@18224,whole:RoutePath@5948,whole:RoutePath@5980,whole:RoutePath@6027,whole:RoutePath@6055,whole:RoutePath@6093,whole:RoutePath@6113,whole:RoutePath@6125,whole:RoutePath@6179,whole:WildcardDomain@13107,whole:WildcardDomain@13483 623de89af2adc399601b13eb4f6a529f45f8e13def4230beb7995d19d72dfe9c
+internal/host/edgesfile.go edgesFileWriteClaims authority F,J1 rev3=census-ruling-self-serve-moves-1;basis=root-route;kept=F;scope=protected-decision-only; the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): region-ha-2a's body, which with the box's lifetimes switch on also publishes each served row's lifetime pair (registry:Incarnation and registry:ServingSeq, two new sites on the rows it already lists) and an alias's or served catch-all's primary's pair, and names that primary as target_host whatever the switch; a report the edge orders unstamped entries by, not a decision; no record, /data, release or claim read added; F,J1 authority retained; self-serve moves 1 Task 8;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 8: takes a localAddrs reader (instancectl.LocalAddresses in production, which reads /proc/net/fib_trie and /proc/net/if_inet6 in the agent) and publishes its non-loopback entries as the edges file's addrs before the write gate (boxAddrs, no read of its own), so an address change writes once. The same 44 sites, offsets moved; no record, /data, release or claim read added; a report the console's egress grant check reads, not a root decision; F,J1 authority retained.;rev3=census-ruling-edge-asset-cache-3;basis=starts with assets = assets.active(), so a policy whose box has not opened its asset store publishes no assets blocks and reads no manifests, and copies the decision's Primary (the route host the block was decided for, drift D4) into the published assets block; read sites unchanged (44); no read added. Merged onto main's #328 body, which takes the localAddrs reader: the assets.active() line sits after that signature and the loop passes pub and instancectl.LocalAddresses;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the claims argument (*edgesClaims) becomes addrs (AddressSource) and the applyEdgesClaims(ctx, claims, routes, hosts) call is deleted with edgesclaims.go, which is the one whole:Route site removed: no host claim is read and every served row publishes as with region HA off; the box-address publication is the same code reading addrs.BoxAddresses() instead of claims.addrs; a report the edge reads, not a root decision; no read added; merge of origin/main d7ae1d76: main's edge asset cache plan 3 body is kept (census-ruling-edge-asset-cache-3): the first line is assets = assets.active(), so a policy whose store has not opened publishes no assets blocks and reads no manifests, and edgesFileLoop passes pub (assets.active() for that tick) in the assets argument; main's claims *edgesClaims argument is this branch's addrs AddressSource, and no edgesClaims, applyEdgesClaims or hostclaim reference remains;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: skips publishing a platform alias edge.PlatformAliasFold refuses (and so anything attached to it); reads the same route listing;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 and its fix rounds: publishes by FleetArmVerdict (via fleetRefusedFor): withheld rows left out; a forward host's path rows left out of its owner; no assets for forward rows; the alias loop replays Reload's alias fold from the served rows so a chained alias carries its root primary's owner; certRefused and parentRefused leave out a refused claim's wildcard parent (+registry:Alias x5, +registry:Host x4, +whole:Route, +whole:RouteAlias x2, +whole:RoutePath x7, +whole:WildcardDomain). Rows already read in the pass; keeps authority F,J1; publishes less, never more.;rev3=census-ruling-probe-burst-limit;basis=sets the constant BurstNotices=true on the box's own edges file (this build's edge answers probe-burst notices, so peers may send them); not from config or any read; the same 65 sites; a report other edges read, not a root decision; F,J1 authority retained; no new root read or write kind;rev3=census-ruling-region-ha-p3a;basis=Publish one injected role snapshot with box_role/admitted/drained; retain legacy route and alias rows during booting, cutting namespace withdrawal under the 2026-11-04 ruling; acknowledge the exact published tuple only after PUT; existing registry reads unchanged. registry:Account@15753,registry:Alias@10256,registry:Alias@13226,registry:Alias@13276,registry:Alias@8683,registry:Alias@8702,registry:Alias@8801,registry:Alias@8855,registry:Alias@8890,registry:Alias@8952,registry:Alias@9322,registry:Alias@9479,registry:Alias@9549,registry:Alias@9581,registry:App@15765,registry:DNSStatus@8997,registry:DNSStatus@9488,registry:Host@13129,registry:Host@13149,registry:Host@13414,registry:Host@13494,registry:Host@13529,registry:Host@13578,registry:Host@14040,registry:Host@14075,registry:Host@15183,registry:Host@3889,registry:Host@3935,registry:Host@3994,registry:Host@5109,registry:Host@6079,registry:Host@8728,registry:Host@8776,registry:Incarnation@5069,registry:Platform@4848,registry:Provisioned@4862,registry:Replica@4886,registry:ServingSeq@5084,registry:Status@2677,whole:Route@1026,whole:Route@17223,whole:Route@18041,whole:Route@18216,whole:Route@1841,whole:Route@2047,whole:Route@6164,whole:Route@750,whole:RouteAlias@13180,whole:RouteAlias@17245,whole:RouteAlias@18231,whole:RouteAlias@8566,whole:RouteAlias@8648,whole:RouteAlias@8840,whole:RoutePath@17238,whole:RoutePath@18224,whole:RoutePath@5948,whole:RoutePath@5980,whole:RoutePath@6027,whole:RoutePath@6055,whole:RoutePath@6093,whole:RoutePath@6113,whole:RoutePath@6125,whole:RoutePath@6179,whole:WildcardDomain@13107,whole:WildcardDomain@13483 0450da8864ebd70c0d09133555f2667de59ea85a07cb42dbf4eed3d8d4545dd0
infra/modules/region-host/group_alarms.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add default-off termination queue age alarm, using existing queue name and regional SNS topic; no IAM, queue, consumer or instance changes. Copy sweep 1: apply approved variable and alarm descriptions verbatim; no resource, threshold, action or read changes. file:external@0 0ae34a01de1eed9c44b120330f794ed7e9067c2afc74b51c2b56e979aaa0743d
infra/modules/region-host/ingress/alarms.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add per-TG NLB alarms and optional deployment/region clock and admission alarms, notify only; no compute actions or fixed identifiers. file:external@0 a4da64aa4ccbe2ffc0618ffe7e1e6d4ca5ee616b056a938a94c9eb3041bcffbb
infra/modules/region-host/ingress/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add isolated IPv4 NLB, VPC/zone lookups, validated CIDR egress, protected new EIPs and TCP health-checked target groups; no fixed-resource edits or root runtime reads. file:external@0 103369ef62af3311ee0e01e751e23a03ca3634015841f0a9437ee7e682353d37
@@ -109,7 +109,7 @@ internal/activator/genservice.go Service.startGen legacy accepted-legacy accepte
internal/activator/genservice.go Service.startGenExe legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. whole:Route@170,whole:Route@253 445d05293d9e0a7ae4858c723a77eb0d267ee3839f67dacbeaa762de58546a07
internal/activator/hawake.go ExecBackend.haSpawnGate legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p1a;basis=new: before every spawn of a host this backend acquired HA, re-runs haContained and refuses an uncontained row; a non-HA host passes; +registry:Host, +whole:Route; only refuses;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. registry:Host@153,whole:Route@210,whole:Route@93 71c81e3c5168d1a2a0fc56144828676efe2673ac52415b787e0ab3e8bf18959b
internal/activator/workerbuild.go Service.startWorker authority E2 E39: close the unsupported claimed worker path before backend entry, replacement or supervised stop. Claims-off paths remain unchanged. This is refusal coverage, not positive root-reserved worker launch support. Fixtures: TestPlan14GenerationWorkerStartBoundary, TestPlan14GenerationWorkerRealBackendRefusal, TestPlan14GenerationWorkerReplacementBoundary, TestPlan14GenerationWorkerSupervisionBoundary. Pre-flight 29 and E39 worker launch audit.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: add/recheck the local start prohibition on generation, worker, sidecar, command or root-control launch, including retained leases; preserve existing lease/ownership checks and fixed-unit exemptions. Whole Route passes to the in-memory predicate; no new filesystem/store read. registry:Host@1301,registry:Host@1479,registry:Host@2414,whole:Route@1031,whole:Route@233,whole:Route@2520 efa454a478f289a6f63432802e63d313ba2c1f4298aae6cfb46c666e99b47654
-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=Refuse every held name class with no serving peer, including held wildcard children, before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. P3a Task 3: refuse a managed tenant before forwarding, geo/proof preparation and dispatch; recheck the route after login next-path resolution. Only the fixed platform/unit scope is exempt. Whole Route passes to a local permission check, not a new store/path read. file:ReadAll@15405,registry:App@21562,registry:Gate@14379,registry:Gate@25953,registry:Gate@26013,registry:Gate@26071,registry:Host@26056,registry:ImportGate@33456,registry:Kind@20424,registry:Kind@23862,registry:Kind@33398,registry:Kind@33427,whole:Route@14274,whole:Route@14385,whole:Route@17202,whole:Route@17986,whole:Route@18444,whole:Route@18636,whole:Route@20427,whole:Route@21488,whole:Route@21554,whole:Route@21565,whole:Route@21818,whole:Route@21913,whole:Route@21989,whole:Route@22033,whole:Route@22335,whole:Route@22365,whole:Route@23865,whole:Route@24150,whole:Route@25956,whole:Route@26016,whole:Route@26059,whole:Route@26074,whole:Route@26992,whole:Route@29055,whole:Route@33401,whole:Route@33430,whole:Route@33459,whole:Route@33491,whole:Route@35339,whole:Route@5267 5476545ea7aa077d8db55d9ee51bdb854c4e3c093daaf706c44b63d17e5b4957
+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=Cut the peer namespace-reservation refusal and restore legacy exact-home/catch-all dispatch. Keep P3a Task 3 local admission refusal before forwarding, geo/proof preparation and dispatch, and recheck after login next-path resolution; fixed platform/unit exemptions unchanged. Same Route values and read sites; no new store/path read. file:ReadAll@15044,registry:App@21201,registry:Gate@14018,registry:Gate@25592,registry:Gate@25652,registry:Gate@25710,registry:Host@25695,registry:ImportGate@33095,registry:Kind@20063,registry:Kind@23501,registry:Kind@33037,registry:Kind@33066,whole:Route@13913,whole:Route@14024,whole:Route@16841,whole:Route@17625,whole:Route@18083,whole:Route@18275,whole:Route@20066,whole:Route@21127,whole:Route@21193,whole:Route@21204,whole:Route@21457,whole:Route@21552,whole:Route@21628,whole:Route@21672,whole:Route@21974,whole:Route@22004,whole:Route@23504,whole:Route@23789,whole:Route@25595,whole:Route@25655,whole:Route@25698,whole:Route@25713,whole:Route@26631,whole:Route@28694,whole:Route@33040,whole:Route@33069,whole:Route@33098,whole:Route@33130,whole:Route@34978,whole:Route@5267 a0c2b3b0f2a4295bc332424df7c76f12f0b33477bc618fe72501df026164448e
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-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. Existing reads unchanged; no new 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. file:Exec@18155,file:Open@1517,file:Statfs@46949,registry:App@11910,whole:Route@11902 f4eec5ecc2ca4c37bd80395aa9f01cb153bfe0a94e753992f79dbefb2c1a126a
internal/host/schedule_wiring.go newScheduleDeps legacy accepted-legacy accepted-legacy;rev3=census-ruling-moves-offline-fixes;basis=root-route (J1, main's disposition); the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), from armSchedule: main's body with the runner's Skip set to scheduleSkip; no new read site;rev3=census-ruling-region-ha-p1b3b-t;basis=Wire Runner.WithDuty before token access through the existing Service. No new read.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3 fix R1: defer timers while local admission is closed, before token mint or attempt bookkeeping; translate an admission refusal from WithDuty into ErrDutyDeferred. Four whole Route predicate uses check existing fixed-route exemptions or pass the same row to WithDuty; no new external read or start authority. registry:App@1979,registry:App@388,registry:Host@2046,registry:Host@396,whole:Route@1223,whole:Route@1298,whole:Route@1974,whole:Route@383,whole:Route@872,whole:Route@946 143dc95af7d681eb5cbd9ca957acd888e1942404f9463b4e9a4bc6bf216d95dd
@coverage infra/modules/region-host 3c50b6dd14e7f99e9aff32bdcecffa28af5c6fffbc6c64d1a44e0271275ce861
@@ -120,9 +120,9 @@ internal/host/schedule_wiring.go newScheduleDeps legacy accepted-legacy accepted
@coverage infra/modules/region-host/tests e3b4f8199f84822455ff1624e4ba739d9aa7b4933c3fc2cb79f657ec43c21082
@coverage internal/activator c16decc0fdbca4134e5a24e02799803bda8563809c6bd4c9122aeb8fc523cc91
@coverage internal/boxroles b8804945a8da39c3f4d1778dc977ee1a071a6c8489ace1c5a22c92b5acb85d91
-@coverage internal/edge fdc4d80d561135c8b4d01273497e198e6641d94efd0c352adb22594aace8d4aa
-@coverage internal/edgesfile 89b59db1d072c72e0a75f468814077feaab09b4cd99da34769adc9eafae19e20
+@coverage internal/edge 1b2ecaa48b1d3d6a13720cf5026a9f84586565ad79b1decf0155b94467f8935c
+@coverage internal/edgesfile e760fc2e638290c6f9e8df7649d2ff7c1f327b7a11fd2ca7f1f50fbe86fbd3ec
@coverage internal/groupadmission 2172be5de464b7860474c2c38d13ed3c2c16a50e9b151e123642f4c832968a2e
-@coverage internal/host 284a84f197aef7f84e7db264a35d1fd0df5fa3969601e76703bd9f5d0597f9da
+@coverage internal/host 71813c654002006a7326e65514a46d8324135fec831fb645b1acb7381192a9f3
@coverage internal/hostenv d9df92980cd7f97c31ad7334ee552e7f6378fdb310d8a1ca0d0d0cda983db81e
@coverage internal/release 95051eb07c6f91bdda535e8b8b45154a97c0f6869e92c32572e7f84c32677af4