carlos / platform Public

Fix role withdrawal reservations and publication acknowledgments

Keep withdrawn real hostnames reserved without treating catch-all aliases or certificate-only parents as deployment routes. Refuse unavailable exact names before wildcard dispatch.

Snapshot role state once per publication and acknowledge the tuple actually written. Apply successful role reads during watch failures while retaining bounded backoff, jitter and throttled logs. Add RED/GREEN witnesses and refresh the census proposal.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paul Campbell pushed by claude agent, operated by paul@keymail.dev 3dd6772f53d3a169871195b40aff2cda7c382339 parent 5a42016
15 files changed, +409 −85
  • docs/superpowers/notes/census-proposal-region-ha-p3a.md +4 −2
  • docs/superpowers/notes/census-region-ha-p3a-claims.tsv +3 −2
  • internal/boxroles/roles.go +0 −7
  • internal/boxroles/roles_test.go +1 −5
  • internal/edge/boxroles_test.go +53 −1
  • internal/edge/edge.go +15 −3
  • internal/edge/homemap.go +29 −15
  • internal/edgesfile/admission.go +27 −0
  • internal/edgesfile/fold.go +5 −3
  • internal/edgesfile/homeelect.go +9 −7
  • internal/host/boxroles.go +33 −16
  • internal/host/boxroles_test.go +213 −12
  • internal/host/edgesfile.go +6 −3
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1
  • internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv +10 −8

Intent

Human

<task-notification> <task-id>aa75a4a31718fac73</task-id> <tool-use-id>toolu_01Ege4ohqEY1VstnaEpmnSKK</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>**Verdict: READY AFTER FIXES.** Two P1s, one P2 and nine P3s. The core role reader, read gate and backoff, strict record decoding, the protected region config, the single merged wake chooser, and the unchanged bytes on switch-off boxes all hold up. Census as committed: approve. Both P1s are in the new `namespace` reservation. I reproduced each with a throwaway `go test -overlay` test and deleted it afterwards; nothing in the worktree was changed except the review file. - **P1 F1, namespace / no wildcard reassignment (H4, P3-3).** When a box is booting, drain or platform, its exact hostname gets no dial target. `lookupHome` then falls through to another box's route catch-all, and `ExactHome` returns false (`internal/edge/homemap.go:925` and `:1108-1121`, `edge.go:1999-2004`). Result: `a.example.com` belonging to `acct-a` is backhauled to, and served by, `acct-w`'s `*.example.com` app. - **P1 F2, no false alias takeover / routes win (H4, P3-3).** The booting reservation includes catch-all aliases and cert-only wildcard parents (`internal/host/boxroles.go:104-111`). `DeploymentRoutesComplete` then counts every reserved name as a real route (`internal/edgesfile/fold.go:193`). So every box's `ReconcileAliases` drops the catch-all, including on the admitted peer, for the whole booting window. That is the woodstar.app loop class again. - **P2 F3, start-ack seam (A1/I4).** `EdgesPublished()` does not say which state it acknowledged, and `EdgesRole()` is read twice per pass. If State flips during the PUT, a booting body gets acknowledged as the admitted publication Task 3 is waiting for. The fix is to pass the published (role, admitted, drained). The P3s include the unjittered 30m backstop, the 4096-byte cap applied only after the whole body is read, and a successful drain read being discarded while the change watch is unusable. That last one needs a controller ruling. The rest are in the review. The production-wired witnesses do go through real wiring. But each uses a single box with plain names, so none would catch F1 or F2. Full review: `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-p3/.superpowers/sdd/2026-11-03-region-ha-p3a/task-2-review-opus.md`</result> <usage><subagent_tokens>183379</subagent_tokens><tool_uses>45</tool_uses><duration_ms>520947</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bn4dnghkf</task-id> <tool-use-id>toolu_01UBjwMNNB82cmQkic7vi1nm</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6cb8c43c-d494-478a-8f04-1067486903df/tasks/bn4dnghkf.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; until [ -s $W/task-1-astra-fix1.md ]; do sleep 60; done; cat $W/task-1-astra-fix1.md" completed (exit code 0)</summary> </task-notification>

Human

<task-notification> <task-id>a414ba25549c98ed0</task-id> <tool-use-id>toolu_01DNXNK2j96gkSVrCnbJazZA</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/6cb8c43c-d494-478a-8f04-1067486903df/tasks/a414ba25549c98ed0.output</output-file> <status>completed</status> <summary>Agent "Opus review P3a Task 1" 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>All three findings are fixed by 5a420161, and the fix adds no new P1 or P2. I re-ran my earlier probes against the new gate, and its own 25 tests pass. - **F1 ADDRESSED:** a new EIP pointed at the fixed instance or its network interface, and an EIP association via that interface, now all exit 1. - **F2 ADDRESSED:** renaming `aws_eip.host` to `.public` and `aws_security_group.host` to `.nlb` are both refused, and so is the later address change. Moving a resource to another module without changing its name still passes, as the ruling intends. - **F3 ADDRESSED:** instance stop, security-group attachment, volume attachment, `aws_iam_role_policies_exclusive` and an auto-recover alarm changed to terminate are all refused. - **P3a dev apply still passes:** both new EIPs, the load balancer and its security group, a target group, a listener, a target-group attachment to a fixed instance, a load-balancer alarm and the instance lookup row all exit 0. - **New P3, not blocking:** a new resource that names a fixed instance ID or IP has no allow-list route, because the allow-list only covers updates. An alarm with an InstanceId dimension would be refused, for example. Task 4's planned alarms don't do this, but it's worth checking before Task 6. "Re-review R1" is appended to `/home/paulca/amadan.net/carlos/platform/.claude/worktrees/region-ha-p3/.superpowers/sdd/2026-11-03-region-ha-p3a/task-1-review-opus.md`, and my probe scratch is deleted.</result> <usage><subagent_tokens>141936</subagent_tokens><tool_uses>8</tool_uses><duration_ms>109077</duration_ms></usage> </task-notification>

Attributed to this commit: 10.2 g CO₂e (1,222,810 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 d3e6a98fc..893493c5a 100644
--- a/docs/superpowers/notes/census-proposal-region-ha-p3a.md
+++ b/docs/superpowers/notes/census-proposal-region-ha-p3a.md
@@ -4,8 +4,9 @@ Ruling `census-ruling-region-ha-p3a`. The independent reviewer approves or rejec
| unit | change | read sites | what changed |
|---|---|---|---|
+| `internal/edge/edge.go` `Edge.ServeHTTP` | body | unchanged (40) | Refuse a reserved exact hostname with no serving peer before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. |
| `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 injected effective role and admission facts, withdraw booting home/alias rows into non-serving namespace reservations, and acknowledge only successful writes; existing registry reads unchanged. |
+| `internal/host/edgesfile.go` `edgesFileWriteClaims` | body | unchanged (65) | Publish one injected role snapshot; preserve the real-route bit separately from wildcard/platform class during booting withdrawal; acknowledge the exact published role/admitted/drained tuple only after PUT; existing registry reads unchanged. |
Envelopes re-pinned: `infra/modules/region-host/ingress`, `infra/modules/region-host/ingress/tests`, `infra/modules/region-host/ingress/tests/fixed-targets`, `infra/modules/region-host/ingress/tests/fixed-targets/tests`, `infra/modules/region-host/tests`, `internal/boxroles`, `internal/edge`, `internal/edgesfile`, `internal/host`, `internal/hostenv`, `internal/release`.
@@ -13,6 +14,7 @@ Review: a model from the other family than the author reads the branch's diff ag
Recorded dispositions, which each change must still satisfy:
+- `internal/edge/edge.go` `Edge.ServeHTTP`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-seeded-instances;basis=the edge inside the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): main's body with the import gate checked after the door's scope and a gated row left out of the response cache; serving only;rev3=census-ruling-edge-request-records;basis=one more call in the observer defer, observeRecords(up.route, ...), passing on the route the defer already holds; no new kind of read;rev3=census-ruling-design-edge-rate-limit-358;basis=calls rateAdmit twice, and an admitted request holds a slot on both paths: on the upgrade path before the activator or proxy (the handshake holds its slot through slotWriter, given back at the first final answer or at the reverse proxy's hijack on a 101, so an open WebSocket is not counted; released by a defer), and on the ordinary path after the response-cache check and before the activator and proxy (an admitted request holds a slot through slotWriter, released by a defer); a refusal is a 429 written there and returns; the upgrade path's comment now names slotWriter as its one wrapper; one comment on the door mark reworded; read sites unchanged (22: main's 21 plus edge-request-records' observeRecords pass of the route), offsets moved; no read added;rev3=census-ruling-plans-4c-box-throttle;basis=calls planThrottleAdmit before the response cache, and on an upgrade trackUpgrade then planUpgradeAdmit (plans 4c, Astra findings 1 and 2); the new reads live in those units (plans-4c-units decision). The same read sites here.;rev3=census-ruling-plans-4d-lapse;basis=calls planDisabledAdmit right after the import gate, passing the final upstream's route and the request host; a turned-off route gets the fixed disabled page before the meter, gate, cache and activator (plans 4d). The new read lives in that unit (plans-4d-units decision); one more whole-row pass here.;rev3=census-ruling-edge-protection-2;basis=runs the guard, a pure in-memory matcher on r.URL.Path and RawQuery (internal/edgeguard), once per request after the meter and observer defer and before the password gate, the upgrade branch, the cache and the activator, for a request that is not a door call, a backhauled door hop or a tunnel delivery; a matched block answers a 404 itself through guardDecide; the two new sites are one expression, up.route.Kind == "static" (a static route this box serves checks only the hard tier here and leaves the probe tier to serveTree), a read of the route row the edge already resolved; no new kind of read;rev3=census-ruling-edge-asset-cache-3;basis=the asset cache's three hooks (asset cache plan 3): the request's reserved asset headers are deleted at entry (the fill assertion kept only beside a verified hop); on the exact-remote and lookup-miss branches the far catch (serveAssetFar) is tried before backhaulTo and backhaul; after the observer defer and main's hard and probe checks, a verified hop with a valid fill assertion is answered by serveAssetFillForHop; after the upgrade branch and before gzip and the shared cache, the local catch (serveAssetLocal); the observer defer skips only the usage meter for an acknowledged home fill (out.unbilled); the new reads live in the new units of the edge-asset-cache-3-decisions overlay; the same route row and read sites (25); no read added;rev3=census-ruling-regional-domains-447;basis=#447 Task 5: straight after lookupUpstreamPath it calls regionalGate (regional.go), which for an entry built from a regional_domains row answers 503 to a hop or a deny entry before any arm that can leave the box (the exact-home backhaul, the far asset catch, the door dial, the miss backhaul), and lets a star match through only to the exact-home arm when ExactHome names another box for that distinct exact name; after the exact-home arm a regional deny entry the arm did not answer is refused (regionalRefuse, 503); refusals only, on the route map the edge already holds; read sites unchanged (25);rev3=census-ruling-static-headers;basis=the shared response cache is no longer looked up or filled for a static-kind route: one more read of the route row the edge already resolved (up.route.Kind == "static") in the cacheable expression; a refusal only, nothing new opened or followed;rev3=census-ruling-region-ha-p1b2;basis=region HA P1b-2 (N-HA10): one call, frontForwardHA, right after the route lookup's !ok block and before the login POST; same reads;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 4: loginPost and cacheable treat a forward row as not this box's to answer (IsForward(), +whole:Route x2): no login form and no shared cache for a forward host. Serving only.;rev3=census-ruling-tunnel-websockets;basis=Deletes the Carlos-Upgrade marker header from incoming requests and puts the upgrade admission (host, path, the entry tenancy, all in hand) on a tunnel arm request. For a login POST on an ungated ArmTunnel row it reads the visitor request body (bounded by gate.MaxFormBody, 413 past it; a request body, not a file) and resolves next against the entry Reload built (Gate, Route); the bytes pass on only when loginPassesThrough holds (spec 7, Tasks 3, 5 and 6).;rev3=census-ruling-console-protection-tab;basis=one more call in the observer defer, observeGuardCount(up.route, out), beside the observeRecords call that files the guard Match: it passes on the route row the defer already holds (+whole:Route) and the request outcome to the usage meter, which counts the check in memory. Called whether or not the request was unbilled, as observeRecords is. Nothing is opened, read or followed; no new kind of read; no check, refusal or serving decision changes.;rev3=census-ruling-probe-burst-limit;basis=answers a probe-burst notice POST (serveBurstNotice) ahead of every route for a non-door caller; builds the guard state for up.route and stamps its account and app (RouteAccount, App) for the cool-down's this-app/other-app label; for a catalogue match on a non-static or tunnelled route, offers the burst rule (in-memory limiter, burstDecide: 429 or a watch verdict, never a block for a fleet or forward row); the observer defer calls noteBurst(up.route, ...); the added sites are the route value already in hand (+registry:App, +whole:Route x5); no new root read or write kind;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): parses the request's query once (stripHoldMarker) to record the carlos_hold=1 mark in the request context; calls classifyHold on the upstream already resolved from the loaded map (the +whole:Route is that in-memory Route), including a second pass for a login POST; gives a marked request on a door-refused route the plain 404; adds the hold branch (planThrottleAdmit, rateAdmit, serveHeld) after the gate; and excludes marked requests from the shared cache. Reads only the request and the already-loaded upstream map; no registry or bucket read added.
- `internal/host/agent.go` `fastTick`: legacy, task accepted-legacy. Basis: 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.
- `internal/host/edgesfile.go` `edgesFileWriteClaims`: authority, task F,J1. Basis: 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
@@ -32,6 +34,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- new `internal/host/boxroles.go:boxRoleReader.pass`: reads +file:Read; written legacy, accepted-legacy, frozen
- new `internal/host/boxroles_config_linux.go:readRoleRegionConfig`: reads +file:Fstat, +file:Openat2, +file:ReadAll; written legacy, accepted-legacy, frozen
-Seal: `c68e2453bfc8afaf3794eb4c08850428982fa6954269b6b99bddfda4e6242929` → `ad0fc07cb89ad62b50b6f816621bf18256850fdb1540e5979e7b5edc132f6baf`.
+Seal: `c68e2453bfc8afaf3794eb4c08850428982fa6954269b6b99bddfda4e6242929` → `e07f174b3b8458fc921ad52e96223f59e3e622eb42e1deea81e5bb72f4795736`.
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 d8ec023f5..42d418522 100644
--- a/docs/superpowers/notes/census-region-ha-p3a-claims.tsv
+++ b/docs/superpowers/notes/census-region-ha-p3a-claims.tsv
@@ -9,7 +9,8 @@ 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 injected effective role and admission facts, withdraw booting home/alias rows into non-serving namespace reservations, and acknowledge only successful writes; existing registry reads unchanged.
+internal/host/edgesfile.go:edgesFileWriteClaims Publish one injected role snapshot; preserve the real-route bit separately from wildcard/platform class during booting withdrawal; acknowledge the exact published role/admitted/drained 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 desired roles through the startup-injected callback with one existing ReadGate and bounded retry backoff; preserve restrictions and close new starts on unknown evidence; no filesystem read.
+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 a reserved exact hostname with no serving peer before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority.
diff --git a/internal/boxroles/roles.go b/internal/boxroles/roles.go
index 7a2edfc16..3d717d13e 100644
--- a/internal/boxroles/roles.go
+++ b/internal/boxroles/roles.go
@@ -9,7 +9,6 @@ import (
"io"
"os"
"regexp"
- "slices"
"strings"
"time"
@@ -36,12 +35,6 @@ type Record struct {
var label = regexp.MustCompile(`^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$`)
func ValidLabel(v string, max int) bool { return len(v) > 0 && len(v) <= max && label.MatchString(v) }
-func ValidateRegion(region string, configured []string) error {
- if !ValidLabel(region, 32) || !slices.Contains(configured, region) {
- return fmt.Errorf("boxroles: unconfigured region %q", region)
- }
- return nil
-}
func Key(target string) (string, error) {
value, max := target, 63
if strings.HasPrefix(target, "@region-") {
diff --git a/internal/boxroles/roles_test.go b/internal/boxroles/roles_test.go
index 968bb3cfc..8120020d0 100644
--- a/internal/boxroles/roles_test.go
+++ b/internal/boxroles/roles_test.go
@@ -78,9 +78,5 @@ func TestRoleKeys(t *testing.T) {
t.Fatal(err)
}
}
- for _, region := range []string{"", "../ie", "ie/uk", "unknown"} {
- if err := ValidateRegion(region, []string{"ie", "uk"}); err == nil {
- t.Errorf("accepted region %q", region)
- }
- }
+
}
diff --git a/internal/edge/boxroles_test.go b/internal/edge/boxroles_test.go
index 78ea30621..d5fd5d1a1 100644
--- a/internal/edge/boxroles_test.go
+++ b/internal/edge/boxroles_test.go
@@ -2,6 +2,8 @@ package edge
import (
"encoding/json"
+ "fmt"
+ "net/http"
"testing"
"github.com/carlosframework/platform/internal/edgesfile"
@@ -74,7 +76,7 @@ func TestAdmissionWithdrawalWindow(t *testing.T) {
} else {
f["box_role"] = "booting"
f["hosts"] = map[string]any{}
- f["namespace"] = map[string]any{"shop.example.com": map[string]any{"platform": true}, "*.customer.example.com": map[string]any{"wildcard": true}}
+ 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}}
@@ -91,3 +93,53 @@ func TestAdmissionWithdrawalWindow(t *testing.T) {
}
}
}
+
+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 c7127d904..bc3fd0ecd 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -1996,11 +1996,23 @@ 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 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) {
+ if !e.servesExactly(host) {
+ if home, remote := e.homes.Load().exactHome(host); remote {
+ 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)
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/homemap.go b/internal/edge/homemap.go
index 3e7ce6195..47dc3be6e 100644
--- a/internal/edge/homemap.go
+++ b/internal/edge/homemap.go
@@ -238,6 +238,8 @@ type edgesAssetsView struct {
// homeEntry is one folded answer: where to dial, and which box that is.
type homeEntry struct {
+ reserved 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,11 +868,13 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
hosts := make(map[string]homeEntry)
reserved := map[string]bool{}
for _, f := range files {
- for host := range f.Namespace {
- reserved[host] = true
+ for host, n := range f.Namespace {
+ if f.ProjectHome("", false, n).Reserved {
+ reserved[host] = true
+ }
}
for host, h := range f.Hosts {
- if !f.HomeEligible() && h.Role == edgeRoleHome && !h.Alias {
+ if f.ProjectHome(h.Role, h.Alias, edgesfile.NamespaceHost{}).Reserved {
reserved[host] = true
}
}
@@ -902,16 +906,13 @@ 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 == "" {
+ if addr == "" && !f.ProjectHome(h.Role, h.Alias, f.Namespace[host]).Reserved {
if !h.Wildcard || !strings.HasPrefix(host, "*.") {
continue
}
h.Role = edgeRoleWildcard
}
case "reserved":
- if _, fromHosts := f.Hosts[host]; fromHosts {
- continue
- }
case edgeRoleWildcard:
// The cert-only role is defined for marked catch-all keys
// alone; on an exact key it would be a KnownHost admission
@@ -922,7 +923,8 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
default:
continue
}
- 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(),
+ projection := f.ProjectHome(h.Role, h.Alias, f.Namespace[host])
+ in := homeEntry{reserved: projection.Reserved, starting: projection.Starting, eip: addr, box: f.Box, platform: h.Platform && !h.Alias && !h.Wildcard, alias: h.Alias, wildcard: h.Wildcard, dial: projection.Dial,
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 {
@@ -941,6 +943,8 @@ 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.reserved = prev.reserved || in.reserved
+ merged.starting = prev.starting || in.starting
merged.platform = prev.platform || in.platform
merged.wildcard = prev.wildcard || in.wildcard
if dialBeats(in, prev) {
@@ -1085,16 +1089,26 @@ 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) {
+ if m == nil || m.self == "" {
+ return homeEntry{}, false
+ }
+ h, found := m.snapshot().hosts[host]
+ return h, found && (h.dial || h.reserved)
+}
+
// ExactHome is Home without the one-label wildcard fallback: the dial target
-// another box published for exactly host. The edge asks it when its own
+// 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
// 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 m == nil || m.self == "" {
- return "", "", false
- }
- if h, found := m.snapshot().hosts[host]; found && h.dial {
+ if h, found := m.exactHome(host); found {
+ if !h.dial {
+ return "", h.box, true
+ }
observeRegional("exact-home", host)
return h.eip, h.box, true
}
@@ -1109,8 +1123,8 @@ func (m *homeMap) lookupHome(host string) (homeEntry, bool) {
return homeEntry{}, false
}
hosts := m.snapshot().hosts
- if h, ok := hosts[host]; ok && h.dial {
- return h, true
+ if h, ok := hosts[host]; ok && (h.dial || h.reserved) {
+ return h, h.dial
}
if i := strings.IndexByte(host, '.'); i > 0 {
if h, ok := hosts["*"+host[i:]]; ok && h.dial {
diff --git a/internal/edgesfile/admission.go b/internal/edgesfile/admission.go
index 1e6070e8b..31e8d9b2f 100644
--- a/internal/edgesfile/admission.go
+++ b/internal/edgesfile/admission.go
@@ -29,6 +29,33 @@ func (f AdmissionFields) HomeEligible() bool {
// NamespaceHost preserves name ownership during startup withdrawal. It
// carries no address, owner, alias target or serving role.
type NamespaceHost struct {
+ Route bool `json:"route,omitempty"`
Platform bool `json:"platform,omitempty"`
Wildcard bool `json:"wildcard,omitempty"`
}
+
+// HomeProjection keeps namespace ownership separate from serving permission.
+// A box that is not serving (booting, not admitted, drain, platform) withdraws
+// its own hostnames from dial targets but still reserves them, so no other
+// account's catch-all or wildcard parent can take them. Reserving a name never
+// makes it a deployment route: only a real, non-alias home has that class.
+// Wildcard cert parents retain their class without suppressing peer aliases.
+type HomeProjection struct {
+ Dial bool
+ Reserved bool
+ Starting bool
+ Route bool
+}
+
+func (f AdmissionFields) ProjectHome(role string, alias bool, n NamespaceHost) HomeProjection {
+ eligible := f.HomeEligible()
+ route := role == RoleHome && !alias
+ boxRole, admitted := "", true
+ starting := (admissionField(f.BoxRole, &boxRole) && boxRole == "booting") || (admissionField(f.Admitted, &admitted) && !admitted)
+ return HomeProjection{
+ Starting: starting,
+ Dial: eligible && role == RoleHome,
+ Reserved: n.Route || (!eligible && route),
+ Route: n.Route || route,
+ }
+}
diff --git a/internal/edgesfile/fold.go b/internal/edgesfile/fold.go
index 9dbd1d488..a6631632a 100644
--- a/internal/edgesfile/fold.go
+++ b/internal/edgesfile/fold.go
@@ -190,11 +190,13 @@ func DeploymentRoutesComplete(ctx context.Context, s release.Store, now time.Tim
continue // no fresh snapshot: not evidence of a live route
}
joined++
- for host := range f.Namespace {
- out[host] = true
+ for host, n := range f.Namespace {
+ if f.ProjectHome("", false, n).Route {
+ out[host] = true
+ }
}
for host, h := range f.Hosts {
- if h.Role == RoleHome && !h.Alias {
+ if f.ProjectHome(h.Role, h.Alias, NamespaceHost{}).Route {
out[host] = true
}
}
diff --git a/internal/edgesfile/homeelect.go b/internal/edgesfile/homeelect.go
index fc03e0457..f034009d8 100644
--- a/internal/edgesfile/homeelect.go
+++ b/internal/edgesfile/homeelect.go
@@ -136,7 +136,7 @@ type electedEntry struct {
// electFile is one file's entries, decoded once for every reader.
type electFile struct {
- eligible bool
+ AdmissionFields
namespace map[string]NamespaceHost
key string
box string
@@ -162,7 +162,7 @@ func decodeForElection(files []PlacementView) ([]electFile, error) {
slices.SortStableFunc(sorted, func(a, b PlacementView) int { return strings.Compare(key(a), key(b)) })
out := make([]electFile, 0, len(sorted))
for _, f := range sorted {
- ef := electFile{eligible: f.HomeEligible(), namespace: f.Namespace, key: key(f), box: f.Box, dial: f.DialPoint(), hosts: make(map[string]electedEntry, len(f.Hosts))}
+ ef := electFile{AdmissionFields: f.AdmissionFields, namespace: f.Namespace, key: key(f), box: f.Box, dial: f.DialPoint(), hosts: make(map[string]electedEntry, len(f.Hosts))}
for host, raw := range f.Hosts {
var in electedEntry
if err := json.Unmarshal(raw, &in); err != nil {
@@ -186,21 +186,23 @@ func elect(files []electFile, r Reader) map[string]Elected {
won := map[string]held{}
reserved := map[string]bool{}
for _, f := range files {
- for host := range f.namespace {
- reserved[host] = true
+ for host, n := range f.namespace {
+ if f.ProjectHome("", false, n).Reserved {
+ reserved[host] = true
+ }
}
for host, h := range f.hosts {
- if !f.eligible && h.Role == RoleHome && !h.Alias {
+ if f.ProjectHome(h.Role, h.Alias, NamespaceHost{}).Reserved {
reserved[host] = true
}
}
}
for _, f := range files {
- if !f.eligible || f.box == "" || f.box == r.Box || r.Dial(f.dial) == "" {
+ if !f.HomeEligible() || f.box == "" || f.box == r.Box || r.Dial(f.dial) == "" {
continue
}
for host, in := range f.hosts {
- if host == "" || in.Role != RoleHome || (in.Alias && reserved[host]) {
+ if host == "" || !f.ProjectHome(in.Role, in.Alias, NamespaceHost{}).Dial || (in.Alias && reserved[host]) {
continue
}
c := HomeClaim{Dial: true, Alias: in.Alias, Stamp: in.Stamp,
diff --git a/internal/host/boxroles.go b/internal/host/boxroles.go
index 50c66383f..640278ed1 100644
--- a/internal/host/boxroles.go
+++ b/internal/host/boxroles.go
@@ -20,7 +20,7 @@ import (
// switch-off; neither roles nor publication change on a legacy fixed box.
type edgesRoleSource interface {
EdgesRole() (boxroles.Role, bool, bool)
- EdgesPublished()
+ EdgesPublished(boxroles.Role, bool, bool)
}
type boxRolePublisher struct{ Source edgesRoleSource }
@@ -37,6 +37,7 @@ type boxRoleReader struct {
role boxroles.Role
retryAt time.Time
backoff time.Duration
+ readErrs int
}
func newBoxRoleReader(getenv func(string) string, w *release.ChangeWatch, s release.Store, ref, region string, apply func(boxroles.Role, bool) error) (*boxRoleReader, error) {
@@ -49,7 +50,7 @@ func newBoxRoleReader(getenv func(string) string, w *release.ChangeWatch, s rele
if !boxroles.ValidLabel(ref, 63) || !boxroles.ValidLabel(region, 32) || s == nil || apply == nil {
return nil, errors.New("boxroles: invalid reader configuration")
}
- return &boxRoleReader{store: s, watch: w, gate: release.NewReadGate(w, release.ChangeIndexBackstop), ref: ref, region: region, apply: apply, role: boxroles.Booting}, nil
+ return &boxRoleReader{store: s, watch: w, gate: release.NewReadGate(w, backstopEvery()), ref: ref, region: region, apply: apply, role: boxroles.Booting}, nil
}
func (r *boxRoleReader) pass(ctx context.Context, now time.Time) {
if r == nil {
@@ -65,31 +66,41 @@ func (r *boxRoleReader) pass(ctx context.Context, now time.Time) {
return
}
role, err := boxroles.Read(ctx, r.store, r.ref, r.region)
- if err == nil && !r.watch.Usable() {
- err = errors.New("boxroles: change watch is unusable")
- }
if err == nil {
err = r.apply(role, true)
}
if err != nil {
// Keep the last restriction, while the separate known bit closes new starts.
_ = r.apply(r.role, false)
- log.Printf("could not read the desired role. keeping the last restriction and starting no new tenant work: %v", err)
- if r.backoff == 0 {
- r.backoff = 5 * time.Second
+ r.readErrs++
+ if r.readErrs == 1 || r.readErrs%30 == 0 {
+ log.Printf("could not read the desired role. keeping the last restriction and starting no new tenant work: %v", err)
}
- r.retryAt = now.Add(r.backoff)
- r.backoff = min(2*r.backoff, time.Minute)
+ r.retry(now)
return
}
r.role = role
+ r.readErrs = 0
+ r.gate.Mark(boxroles.Scope, gen, now, true)
+ if !r.watch.Usable() {
+ r.retry(now)
+ return
+ }
r.retryAt = time.Time{}
r.backoff = 0
- r.gate.Mark(boxroles.Scope, gen, now, true)
}
-func withBoxRole(f edgesFile, last []byte) edgesFile {
- if f.RoleSource == nil {
+func (r *boxRoleReader) retry(now time.Time) {
+ if r.backoff == 0 {
+ r.backoff = 5 * time.Second
+ }
+ r.retryAt = now.Add(r.backoff)
+ r.backoff = min(2*r.backoff, time.Minute)
+}
+
+// snapshotBoxRole freezes one source read for scheduling, the body and its ack.
+func snapshotBoxRole(f edgesFile) edgesFile {
+ if f.RoleSource == nil || f.Admitted != nil {
return f
}
role, admitted, drained := f.RoleSource.EdgesRole()
@@ -97,7 +108,12 @@ func withBoxRole(f edgesFile, last []byte) edgesFile {
role, admitted, drained = boxroles.Booting, false, false
}
f.BoxRole, f.Admitted, f.Drained = role, &admitted, &drained
- if role != boxroles.Booting {
+ 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{}
@@ -105,6 +121,7 @@ func withBoxRole(f edgesFile, last []byte) edgesFile {
for host, h := range hosts {
if !h.Alias || h.Wildcard {
n := f.Namespace[host]
+ n.Route = n.Route || (h.Role == edgesfile.RoleHome && !h.Alias)
n.Platform = n.Platform || (h.Platform && !h.Alias)
n.Wildcard = n.Wildcard || h.Wildcard
f.Namespace[host] = n
@@ -154,8 +171,8 @@ func armBoxRoles(ctx context.Context, getenv func(string) string, ref string, ap
// dueWithRole uses the existing publication schedule and its retry budget.
func (s *edgesLoopState) dueWithRole(now time.Time, key string, fpOK, assetsDue bool, ident edgesFile) bool {
if ident.RoleSource != nil {
- role, admitted, drained := ident.RoleSource.EdgesRole()
- key += fmt.Sprintf("|%s|%t|%t", role, admitted, drained)
+ ident = snapshotBoxRole(ident)
+ key += fmt.Sprintf("|%s|%t|%t", ident.BoxRole, *ident.Admitted, *ident.Drained)
assetsDue = assetsDue || ident.RolePublishRequired
}
return s.dueWith(now, key, fpOK, assetsDue)
diff --git a/internal/host/boxroles_test.go b/internal/host/boxroles_test.go
index 8b9a1c417..55aea141b 100644
--- a/internal/host/boxroles_test.go
+++ b/internal/host/boxroles_test.go
@@ -1,9 +1,11 @@
package host
import (
+ "bytes"
"context"
"encoding/json"
"errors"
+ "fmt"
"github.com/carlosframework/platform/internal/boxroles"
"github.com/carlosframework/platform/internal/domains"
"github.com/carlosframework/platform/internal/edge"
@@ -11,6 +13,7 @@ import (
"github.com/carlosframework/platform/internal/registry"
"github.com/carlosframework/platform/internal/release"
"github.com/carlosframework/platform/internal/status"
+ "log"
"strings"
"testing"
"time"
@@ -92,11 +95,11 @@ func TestRoleReadGateBackstop(t *testing.T) {
// Bypass the index writer to model a saved role whose index bump was lost.
raw := release.NewDirStore(s.root)
raw.Put(ctx, "control/box-roles/box.json", []byte(`{"role":"drain"}`), "")
- r.pass(ctx, now.Add(29*time.Minute))
+ r.pass(ctx, now.Add(r.gate.MaxAge()-time.Second))
if s.gets != 2 {
t.Fatal(s.gets)
}
- r.pass(ctx, now.Add(30*time.Minute))
+ r.pass(ctx, now.Add(r.gate.MaxAge()))
if s.gets != 4 || *role != boxroles.Drain {
t.Fatalf("backstop %d %s", s.gets, *role)
}
@@ -107,11 +110,11 @@ func TestRoleReadGateBackstop(t *testing.T) {
s.Put(ctx, "control/box-roles/@region-ie.json", []byte(`{"role":"platform"}`), "")
w.Poll(ctx)
}
- r.pass(ctx, now.Add(31*time.Minute))
+ r.pass(ctx, now.Add(34*time.Minute))
before := s.gets
// Another reader already consumed moved; generation captured before GET is still due.
w.Poll(ctx)
- r.pass(ctx, now.Add(31*time.Minute+time.Second))
+ r.pass(ctx, now.Add(34*time.Minute+time.Second))
if s.gets != before+2 {
t.Fatalf("lost racing change %d -> %d", before, s.gets)
}
@@ -132,7 +135,7 @@ func TestRoleUnreadableIsClosed(t *testing.T) {
t.Fatal(*role, *known)
}
s.fail = "control/box-roles/@region-ie.json"
- r.pass(ctx, now.Add(31*time.Minute))
+ r.pass(ctx, now.Add(34*time.Minute))
if *role != boxroles.Platform || *known {
t.Fatal(*role, *known)
}
@@ -187,25 +190,38 @@ func TestRoleDisarmed(t *testing.T) {
}
type rolePublication struct {
- role boxroles.Role
- admitted, drained bool
- acks int
+ role boxroles.Role
+ admitted, drained bool
+ acks int
+ reads int
+ publishedRole boxroles.Role
+ publishedAdmitted, publishedDrained bool
}
func (p *rolePublication) EdgesRole() (boxroles.Role, bool, bool) {
+ p.reads++
return p.role, p.admitted, p.drained
}
-func (p *rolePublication) EdgesPublished() { p.acks++ }
+func (p *rolePublication) EdgesPublished(role boxroles.Role, admitted, drained bool) {
+ p.acks++
+ p.publishedRole, p.publishedAdmitted, p.publishedDrained = role, admitted, drained
+}
type roleWriteFail struct {
release.Store
- fail bool
+ fail bool
+ during func()
}
func (s *roleWriteFail) Put(ctx context.Context, k string, b []byte, e string) (string, error) {
if s.fail {
return "", errors.New("write failed")
}
+ if s.during != nil {
+ f := s.during
+ s.during = nil
+ f()
+ }
return s.Store.Put(ctx, k, b, e)
}
func TestRolePublisherAck(t *testing.T) {
@@ -271,7 +287,7 @@ func TestRoleUnusableWatchAndApplicationBackoff(t *testing.T) {
w.Poll(cancelled)
r.pass(ctx, now.Add(time.Second))
before := s.gets
- if *known || *role != boxroles.Serve {
+ if !*known || *role != boxroles.Serve {
t.Fatal(*role, *known)
}
w.Poll(ctx)
@@ -401,10 +417,12 @@ func TestRoleWatchRecoversWithoutGenerationChange(t *testing.T) {
c, cancel := context.WithCancel(ctx)
cancel()
w.Poll(c)
+ s.fail = "control/box-roles/box.json"
r.pass(ctx, now.Add(time.Second))
if *known {
- t.Fatal("unusable observation left starts open")
+ t.Fatal("unreadable role left starts open")
}
+ s.fail = ""
w.Poll(ctx)
r.pass(ctx, now.Add(6*time.Second))
if !*known || s.gets != 6 {
@@ -479,3 +497,186 @@ func TestRoleWithdrawalKeepsPriorNamespaceClass(t *testing.T) {
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}
+ s := &roleWriteFail{Store: release.NewDirStore(t.TempDir()), during: func() { p.admitted = true }}
+ var last []byte
+ ident := snapshotBoxRole(edgesFile{Box: "box", RoleSource: p, RolePublishRequired: true})
+ now := time.Now()
+ state := &edgesLoopState{sched: newEdgesFileSchedule(now, func() time.Duration { return 5 * time.Minute })}
+ if !state.dueWithRole(now, "registry", true, false, ident) {
+ t.Fatal("first publication not due")
+ }
+ if err := edgesFilePass(ctx, s, edgesTestRegistry(t), ident, "203.0.113.1", &last); err != nil {
+ t.Fatal(err)
+ }
+ body, _, err := s.Get(ctx, edgesFileKey("box"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ var f edgesFile
+ if err := json.Unmarshal(body, &f); err != nil {
+ t.Fatal(err)
+ }
+ if f.BoxRole != boxroles.Booting || *f.Admitted {
+ t.Fatal(string(body))
+ }
+ if p.publishedRole != f.BoxRole || p.publishedAdmitted != *f.Admitted || p.publishedDrained != *f.Drained || p.reads != 1 {
+ t.Fatalf("ack=(%s,%t,%t), body=(%s,%t,%t), source reads=%d", p.publishedRole, p.publishedAdmitted, p.publishedDrained, f.BoxRole, *f.Admitted, *f.Drained, p.reads)
+ }
+}
+func TestRoleSuccessfulReadWithUnusableWatch(t *testing.T) {
+ r, s, w, role, known := roleReaderFixture(t)
+ ctx := context.Background()
+ now := time.Now()
+ r.pass(ctx, now)
+ s.Put(ctx, "control/box-roles/box.json", []byte(`{"role":"drain"}`), "")
+ c, cancel := context.WithCancel(ctx)
+ cancel()
+ w.Poll(c)
+ r.pass(ctx, now.Add(time.Second))
+ if *role != boxroles.Drain || !*known {
+ t.Fatalf("fresh drain discarded: %s known=%t", *role, *known)
+ }
+ before := s.gets
+ for sec := 2; sec < 6; sec++ {
+ r.pass(ctx, now.Add(time.Duration(sec)*time.Second))
+ }
+ if s.gets != before {
+ t.Fatal("unusable watch bypassed backoff", s.gets, before)
+ }
+ for sec := 6; sec < 3600; sec++ {
+ r.pass(ctx, now.Add(time.Duration(sec)*time.Second))
+ }
+ if s.gets-2 > 128 || !*known || *role != boxroles.Drain {
+ t.Fatalf("unusable watch budget: gets=%d role=%s known=%t", s.gets-2, *role, *known)
+ }
+}
+
+func TestRoleBackstopJitter(t *testing.T) {
+ ages := map[time.Duration]bool{}
+ for i := 0; i < 32; i++ {
+ r, _, _, _, _ := roleReaderFixture(t)
+ age := r.gate.MaxAge()
+ if age < 27*time.Minute || age > 33*time.Minute {
+ t.Fatalf("backstop outside jitter bounds: %s", age)
+ }
+ ages[age] = true
+ }
+ if len(ages) == 1 {
+ t.Fatal("all role readers have the same backstop")
+ }
+}
+
+func TestRoleUnreadableLogThrottle(t *testing.T) {
+ var out bytes.Buffer
+ old := log.Writer()
+ log.SetOutput(&out)
+ t.Cleanup(func() { log.SetOutput(old) })
+ r, s, _, _, _ := roleReaderFixture(t)
+ s.fail = "control/box-roles/box.json"
+ now := time.Now()
+ for i := 0; i < 31; i++ {
+ r.pass(context.Background(), now.Add(time.Duration(i)*time.Minute))
+ }
+ if n := strings.Count(out.String(), "could not read the desired role."); n != 2 {
+ t.Fatalf("unthrottled failure log: %d", n)
+ }
+ s.fail = ""
+ r.pass(context.Background(), now.Add(time.Hour))
+ s.fail = "control/box-roles/box.json"
+ r.pass(context.Background(), now.Add(2*time.Hour))
+ if n := strings.Count(out.String(), "could not read the desired role."); n != 3 {
+ t.Fatalf("recovery did not reset throttle: %d", n)
+ }
+}
diff --git a/internal/host/edgesfile.go b/internal/host/edgesfile.go
index 4cf7f2b12..af9e92a85 100644
--- a/internal/host/edgesfile.go
+++ b/internal/host/edgesfile.go
@@ -994,7 +994,7 @@ func edgesFileWriteClaims(ctx context.Context, s release.Store, reg *registry.Re
}
*last = gate
if f.RoleSource != nil {
- f.RoleSource.EdgesPublished()
+ f.RoleSource.EdgesPublished(f.BoxRole, *f.Admitted, *f.Drained)
}
if assets != nil {
assets.passDone(clocks, settled, true, f.Hosts)
@@ -1244,7 +1244,8 @@ func edgesFileLoop(reg *registry.Registry, lifetimes bool, assets *assetPolicy)
if pub != nil && err == nil {
key = edgesChangeKey(key, pub.servingDigest())
}
- if !state.dueWithRole(now, key, err == nil, pub.rewriteDue(), ident) {
+ roleIdent := snapshotBoxRole(ident)
+ if !state.dueWithRole(now, key, err == nil, pub.rewriteDue(), roleIdent) {
continue
}
if state.timed() {
@@ -1255,7 +1256,9 @@ func edgesFileLoop(reg *registry.Registry, lifetimes bool, assets *assetPolicy)
ident.Headroom = headroomFor(headroomCapabilities(ident.Capabilities), dataDir, reg)
ident = withMovesFields(ident, dataDir, optDir)
ident = withSeedsFields(ident, dataDir, optDir)
- err = edgesFileWriteClaims(ctx, store, reg, ident, eip, &last, state.timed(), addrs, lifetimes, pub, instancectl.LocalAddresses)
+ passIdent := ident
+ passIdent.BoxRole, passIdent.Admitted, passIdent.Drained = roleIdent.BoxRole, roleIdent.Admitted, roleIdent.Drained
+ err = edgesFileWriteClaims(ctx, store, reg, passIdent, eip, &last, state.timed(), addrs, lifetimes, pub, instancectl.LocalAddresses)
if err != nil {
// Throttled: a bucket that refuses every write (an IAM Deny, an
// outage) is retried on a backoff, and each retry must not be a
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index e05cba085..6d85a0794 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 ad0fc07cb89ad62b50b6f816621bf18256850fdb1540e5979e7b5edc132f6baf
+plan14-root-reads-region-ha-p3a.tsv e07f174b3b8458fc921ad52e96223f59e3e622eb42e1deea81e5bb72f4795736
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 249136880..8ad6d6636 100644
--- a/internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv
+++ b/internal/provision/testdata/plan14-root-reads-region-ha-p3a.tsv
@@ -1,6 +1,7 @@
# Census overlay region-ha-p3a, written by census-propose (#369). census-ruling-region-ha-p3a, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-region-ha-p3a.md.
-# 2 body, 0 sites, 11 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 3 body, 0 sites, 11 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 13 new dispositions: 0 reads re-frozen at their disposition with the claim, 13 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 0 other.
+@legacy 94e90eb186c2bd0c67eb2dad2c99281ab9362a0101b89af82d933496426eb276 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 a reserved exact hostname with no serving peer before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. file:ReadAll@15319,registry:App@21417,registry:Gate@14293,registry:Gate@25808,registry:Gate@25868,registry:Gate@25926,registry:Host@25911,registry:ImportGate@33311,registry:Kind@20279,registry:Kind@23717,registry:Kind@33253,registry:Kind@33282,whole:Route@14188,whole:Route@14299,whole:Route@17841,whole:Route@18299,whole:Route@18491,whole:Route@20282,whole:Route@21343,whole:Route@21409,whole:Route@21420,whole:Route@21673,whole:Route@21768,whole:Route@21844,whole:Route@21888,whole:Route@22190,whole:Route@22220,whole:Route@23720,whole:Route@24005,whole:Route@25811,whole:Route@25871,whole:Route@25914,whole:Route@25929,whole:Route@26847,whole:Route@28910,whole:Route@33256,whole:Route@33285,whole:Route@33314,whole:Route@33346,whole:Route@35194 74c46972c00a0d56d710b71b4ab76b20df5b75a80806053e51b3cd9bc3c063d4
@legacy 835af32ac1034a8c2cf1fb9241753c715eeac79cf63b917d7235d70577cd247e 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
@legacy 377eb01304b9a5473fcef2354ef85dd2ba95785c48ff2ba1a0782778499989ef 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
@legacy c1636b10d14fd359d718264048fe782d0405dde3102b72a1a8eac270c37b14f6 infra/modules/region-host/ingress/outputs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Expose per-zone addresses and NLB/TG identities for root attachments and Task 4 alarms; no root runtime reads. file:external@0 83d036fd1e80e375df647bfbb84eb9307faa97ad5511672c938a164919f246a9
@@ -13,10 +14,11 @@
@legacy 134888d1b095e8268cdd1cd04df27087407ae3fee1c4742f0df5a431520783ef infra/modules/region-host/ingress/versions.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Declare OpenTofu and AWS provider requirements for the isolated ingress child; no root runtime reads. file:external@0 bb3be812da255c0f031b2bfdfee462e4687de3681c742b529b55693a8875136b
@legacy 73e967bb630a74f28c53f50b63c997d086154b025cf7b59074d5b0fe2fc3bea7 infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add mock regression for the unchanged fixed instance/profile/SG/root-volume wiring and legacy outputs; no root runtime reads. file:external@0 cab0fdd9e01c4497f06a617db6c41aa9887da80bd0518c76fe8eba935be42c85
@legacy 6c02de7e1e2960b253dafcce566bdcd6ae60cf8751c98b7036ce6dcabc43b1fc internal/boxroles/roles.go Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=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. file:Read@5 7a81085231b83e3c7f524640fe5c5d347ac941af24a7ee9f3bd15a3d349aec03
-@legacy 7a9921c9cb3d1fa2aa7fa0bc817c36c9ec379b6e30d03e3f395de4f3ff053a91 internal/host/boxroles.go boxRoleReader.pass legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Apply desired roles through the startup-injected callback with one existing ReadGate and bounded retry backoff; preserve restrictions and close new starts on unknown evidence; no filesystem read. file:Read@268 832d15595492589b64928bad0831273d08ecd355a0f4cd939774acaa2d0bf821
+@legacy ae2d187d96ed8e3327b8f23d5509c63f623fdbcb132c16ac9f86be7c243426a8 internal/host/boxroles.go boxRoleReader.pass legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=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. file:Read@268 5a24611b7b34023794f20e4820f843700c201186ce8e28a763cca44bbd06a89f
@legacy 02d429c92fa49c5ad18109eb1fc99874d6fe43094c02b809029f7da90d2e22d6 internal/host/boxroles_config_linux.go readRoleRegionConfig legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=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. file:Fstat@414,file:Openat2@90,file:ReadAll@733 2ab0091c9dad48273774eb0feb4b9289b823b9ed7a76852e6c6d26b34cb6e231
+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 a reserved exact hostname with no serving peer before a local or remote catch-all can handle it; one snapshot supplies the reservation and dial decision; no new read or forwarding authority. file:ReadAll@15319,registry:App@21417,registry:Gate@14293,registry:Gate@25808,registry:Gate@25868,registry:Gate@25926,registry:Host@25911,registry:ImportGate@33311,registry:Kind@20279,registry:Kind@23717,registry:Kind@33253,registry:Kind@33282,whole:Route@14188,whole:Route@14299,whole:Route@17841,whole:Route@18299,whole:Route@18491,whole:Route@20282,whole:Route@21343,whole:Route@21409,whole:Route@21420,whole:Route@21673,whole:Route@21768,whole:Route@21844,whole:Route@21888,whole:Route@22190,whole:Route@22220,whole:Route@23720,whole:Route@24005,whole:Route@25811,whole:Route@25871,whole:Route@25914,whole:Route@25929,whole:Route@26847,whole:Route@28910,whole:Route@33256,whole:Route@33285,whole:Route@33314,whole:Route@33346,whole:Route@35194 74c46972c00a0d56d710b71b4ab76b20df5b75a80806053e51b3cd9bc3c063d4
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 injected effective role and admission facts, withdraw booting home/alias rows into non-serving namespace reservations, and acknowledge only successful writes; 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 7e02cc72e5c7d15cbf8a63a333b265a584e8b1775742de0cb148272eea4c25ae
+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; preserve the real-route bit separately from wildcard/platform class during booting withdrawal; 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
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
infra/modules/region-host/ingress/outputs.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Expose per-zone addresses and NLB/TG identities for root attachments and Task 4 alarms; no root runtime reads. file:external@0 83d036fd1e80e375df647bfbb84eb9307faa97ad5511672c938a164919f246a9
infra/modules/region-host/ingress/tests/fixed-targets/main.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add dev-root fixture attaching literal instance IDs to both target groups with read-only AZ lookups and target-zone precondition; no fixed-module references or root runtime reads. file:external@0 98e19cac1a98259ba7f3c1e9ab95471e25afa2ae77c54bd4c575a2e094fac62e
@@ -28,16 +30,16 @@ infra/modules/region-host/ingress/variables.tf external legacy accepted-legacy a
infra/modules/region-host/ingress/versions.tf external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Declare OpenTofu and AWS provider requirements for the isolated ingress child; no root runtime reads. file:external@0 bb3be812da255c0f031b2bfdfee462e4687de3681c742b529b55693a8875136b
infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl external legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Add mock regression for the unchanged fixed instance/profile/SG/root-volume wiring and legacy outputs; no root runtime reads. file:external@0 cab0fdd9e01c4497f06a617db6c41aa9887da80bd0518c76fe8eba935be42c85
internal/boxroles/roles.go Read legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=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. file:Read@5 7a81085231b83e3c7f524640fe5c5d347ac941af24a7ee9f3bd15a3d349aec03
-internal/host/boxroles.go boxRoleReader.pass legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=Apply desired roles through the startup-injected callback with one existing ReadGate and bounded retry backoff; preserve restrictions and close new starts on unknown evidence; no filesystem read. file:Read@268 832d15595492589b64928bad0831273d08ecd355a0f4cd939774acaa2d0bf821
+internal/host/boxroles.go boxRoleReader.pass legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=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. file:Read@268 5a24611b7b34023794f20e4820f843700c201186ce8e28a763cca44bbd06a89f
internal/host/boxroles_config_linux.go readRoleRegionConfig legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-p3a;basis=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. file:Fstat@414,file:Openat2@90,file:ReadAll@733 2ab0091c9dad48273774eb0feb4b9289b823b9ed7a76852e6c6d26b34cb6e231
@coverage infra/modules/region-host/ingress 009777ca5464e8e6e0bfda45c00229b8924e0dc55f39d7d3036bca2b2d4f871e
@coverage infra/modules/region-host/ingress/tests b6467c0277af3f8f58a86f9d7bb703907d44bd5216c66c97acf9e3c8c031b416
@coverage infra/modules/region-host/ingress/tests/fixed-targets f99d9d22e9ad6820b3fcc4e5210dad538a62274005c6fdd7c4a3af292aef91cc
@coverage infra/modules/region-host/ingress/tests/fixed-targets/tests 567e4b97ac15cea31cb88aba77dccf739e58382158dba13d6b03e22935995b52
@coverage infra/modules/region-host/tests 18abb8044924e7422d67f4266905e6da7d024426cd7846868fca55932adbb9ae
-@coverage internal/boxroles 399e67f4d8a3ec2053b90db89b62ff567a969141890ee3a6285a52dd52502fb8
-@coverage internal/edge 13d248c3e2ee86191250fe902ae22eac348cb71c3c1d4e16157155c5823c4517
-@coverage internal/edgesfile d52ae7f7d22875c95dac7c3ad6f65cf3d427ea6f554919d61bf7fedaab655285
-@coverage internal/host 93ec0640137e3fc920d00bc4c2882ac281bca51b011b100e95c1291d7e643b99
+@coverage internal/boxroles b8804945a8da39c3f4d1778dc977ee1a071a6c8489ace1c5a22c92b5acb85d91
+@coverage internal/edge 075f22493dd46475a9133906d3c85c965e8f650fba87f063478667f59daea63a
+@coverage internal/edgesfile 79ccfee3606279650719114b126a16cef92707b148d8c941e1100e21115f7283
+@coverage internal/host e8ecef850e704f956957f0b0ceb4419f92fa602b43663b2bdd8e18ebe828dc1d
@coverage internal/hostenv 3e9785f0d91b89f13982f43b643a09671d6b6dc3ac176855ad3b597ac8daf8ae
@coverage internal/release 95051eb07c6f91bdda535e8b8b45154a97c0f6869e92c32572e7f84c32677af4