carlos / platform Public

certwarm: warm only custom names their home box published pointing

The issuer's cert warm looked up a custom name through the box's caching
resolver as soon as the name was in its warm set. On the home box the set
included the local route table, which gains an alias the moment it is
attached, before the customer's DNS record need exist. That first lookup
planted "no such name" in the resolver for the zone's negative TTL, and
the certificate then waited that long after the record appeared (15
minutes in the dev timed attach on v0.34.37) instead of about a minute.

The warm set now comes from publication only:

- The edges file gains an additive dns_pointing mark on each custom name
  (one outside the apps domain). A published alias carries true, since it
  is published only once pointing. A route with a custom hostname is
  still published at once, with false until the box's DNS sweep stamps it
  "pointing". Names under the apps domain, wildcard rows and boxes with
  no apps domain carry no mark.
- edgesfile.DNSPointing is the one compatibility rule: an absent mark
  reads as pointing, so an older box's aliases and routes stay in the set
  through a mixed-version roll.
- homeMap.OwnServedHosts lists this box's own published exact home names
  that are pointing; ServedHosts applies the same rule to other boxes.
  The served wake fires when either set changes.
- warmSet reads OwnServedHosts and ServedHosts, and no longer the route
  table, except for regional names (#447), which no box publishes.
- The warm's wiring moves from RunWithActivatorReady into
  Edge.newIssuerWarm so the tests drive the production construction.

dnsGate, the resolver, the pass and the DNS-miss schedule are unchanged.

Refs #724.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev dabcc3e3f936d60b48bdfd7613122ad63ae720e5 parent ef8371c
13 files changed, +745 −45
  • docs/superpowers/notes/census-proposal-warm-set-published-724.md +21 −0
  • internal/edge/certwarm.go +50 −2
  • internal/edge/certwarm_test.go +198 −14
  • internal/edge/edge.go +3 −13
  • internal/edge/homemap.go +84 −13
  • internal/edge/homemap_dnspointing_test.go +118 −0
  • internal/edgesfile/dnspointing_test.go +33 −0
  • internal/edgesfile/edgesfile.go +23 −0
  • internal/host/edgesfile.go +36 −1
  • internal/host/edgesfile_dnspointing_test.go +168 −0
  • internal/host/group_names_test.go +2 −2
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-warm-set-published-724.tsv +8 −0

CI passed — run details

diff --git a/docs/superpowers/notes/census-proposal-warm-set-published-724.md b/docs/superpowers/notes/census-proposal-warm-set-published-724.md
new file mode 100644
index 000000000..3ea31b1d4
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-warm-set-published-724.md
@@ -0,0 +1,21 @@
+# Census approval: warm-set-published-724
+
+Ruling `census-ruling-warm-set-published-724`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+| unit | change | read sites | what changed |
+|---|---|---|---|
+| `internal/edge/edge.go` `RunWithActivatorReady` | body | unchanged (5) | #724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside, so it lists fewer names, never more. No read added, same 5 sites. |
+| `internal/host/edgesfile.go` `edgesFileWriteClaims` | sites | +registry:Alias, +registry:DNSStatus, +registry:Host | #724: the agent as carlos: reads PLATFORM_APPS_DOMAIN from the environment once per pass (the variable domainsLoop already reads) and sets an additive dns_pointing mark on each published custom name through dnsPointingMark: true on a published alias (registry:Alias, already published only when its dns_status is pointing), and on a route with a hostname outside the apps domain whether its registry:DNSStatus is pointing (registry:Host, registry:DNSStatus on rows the pass already lists). No mark under the apps domain, on a wildcard row, or with no apps domain set. A report the issuer cert warm reads to leave a not-yet-pointing custom name out of its set, not a root decision; it publishes the same names as before. No record, /data, release or claim read added; no new registry query; F,J1 authority retained. One-off cost: the first pass after the upgrade writes once on a box homing a custom name. |
+
+Envelopes re-pinned: `internal/edge`, `internal/edgesfile`, `internal/host`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Recorded dispositions, which each change must still satisfy:
+
+- `internal/edge/edge.go` `RunWithActivatorReady`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added
+- `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;rev3=census-ruling-region-ha-p3a;basis=Publish one injected role snapshot with box_role/admitted/drained; retain legacy route and alias rows during booting, cutting namespace withdrawal under the 2026-11-04 ruling; acknowledge the exact published tuple only after PUT; existing registry reads unchanged.;rev3=census-ruling-region-ha-p2b;basis=region HA P2b-1 T0 (Q1 ruling): before building the comparison copy and the body, a nil NamedPools on the identity becomes []string{} so the additive named_pools field is always an explicit array; the list itself is computed once at arm by edgesFileEligibility from the same provisionTickConfig(os.Getenv) parse as serves_shared_pool (CARLOS_POOLS through provision.ParseBoxPools, filtered to nonempty provision.ValidPool names, sorted, unique). A report the console reads for create admission, not a root decision; no record, /data, release or claim read added; read sites unchanged (65); F,J1 authority retained. One-off cost: the first pass after the upgrade writes once per box (seeded gate null vs []).;rev3=census-ruling-region-ha-p3b;basis=Require cached GroupReadersReady before first group publication and append additive names-2 capability even for supplied identities. Agent writes the same edges object/index with existing registry reads; known readers come from root boot configuration, snapshot from existing fold, no added GET/LIST or root authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Omit non-forward, non-platform-alias rows outside local served pools from home publication; added Host/Pool field reads and local configuration use, existing registry/store operations retained.;rev3=census-ruling-edge-page-cache-1;basis=prunes the manifest cache through the new atomic pointer (assets.manifests.Load().prune(...), nil-safe); nothing else changes; read sites unchanged (67); no read added;rev3=census-ruling-region-ha-held-build;basis=writes also when DrainPublishRequired, and reports the written drain state, its ha_drain mark (transaction and publication id) and generation to DrainSource (in-memory); the file gains ha_drained and ha_drain beside the existing draining; no read added. held-requests Task 4: sets the constant ha_take=1 on the box's own file when its in-memory capabilities include region-ha-1 (this build's edge answers take requests); not from config or any read; a report other edges read, not a root decision; no read added
+
+Seal: `499c08fd29787c5de2aa0197c05f82f6db0ab7760eb7d980bb24211e289e4c24` → `7b66ce2635ec5a372f5298ccc83749acafd5c662db8241c28b2ec1f9aff63c8a`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-warm-set-published-724.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/edge/certwarm.go b/internal/edge/certwarm.go
index 789903d3e..cb01cef72 100644
--- a/internal/edge/certwarm.go
+++ b/internal/edge/certwarm.go
@@ -682,6 +682,24 @@ func warmHello(host string) *tls.ClientHelloInfo {
// alias, so an alias-only rule would silently never warm the shipped headline
// flow.
//
+// Where the names come from, and where they deliberately do not (#724): the
+// PUBLISHED edges files, through the home map. OwnServedHosts is this box's
+// own file and ServedHosts is every other box's, and both leave out a custom
+// name its home box has not yet stamped "pointing". This box's route table
+// (e.current()) is no longer the source for its own names. It gains an
+// alias the moment the alias is attached, before the customer's DNS record
+// need exist, and every name in this set is looked up through the box's
+// caching resolver (dnsGate): a lookup made that early plants "no such name"
+// in the cache for the zone's negative TTL, and the certificate then waits
+// that long after the record appears instead of about a minute. Reading the
+// publication instead means the issuer's FIRST lookup of a new custom name
+// comes after its home box has seen the record.
+//
+// The one thing still read from the route table is a regional name
+// (regional.go, #447): no box publishes those in its edges file, so the
+// table is the only place the regional apex exists. They are written by the
+// platform from a regional claim, not attached by a tenant ahead of DNS.
+//
// What it excludes, and why each one:
//
// - "*." rows — covered by a wildcard PEM, and autocert refuses the
@@ -715,16 +733,46 @@ func (e *Edge) warmSet(appsDomain string, parents func() []string) []string {
seen[h] = true
out = append(out, h)
}
- for h := range e.current() {
+ for h, up := range e.current() {
+ if up.regional != regionalNone {
+ consider(h)
+ }
+ }
+ homes := e.homes.Load()
+ for _, h := range homes.OwnServedHosts() {
consider(h)
}
- for _, h := range e.homes.Load().ServedHosts() {
+ for _, h := range homes.ServedHosts() {
consider(h)
}
sort.Strings(out)
return out
}
+// newIssuerWarm builds this edge's cert warm and wires its two wakes. It is
+// the whole of the production wiring, so a test that calls it exercises the
+// same set, gate and wakes the edge runs with: the set is warmSet, the DNS
+// gate is dnsGate over resolve and edgeIPs, and the warm is nudged by a
+// local route reload and by a change in either half of the published name
+// set (homeMap.setServedWake). The caller starts the loop.
+func (e *Edge) newIssuerWarm(appsDomain string, parents func() []string, getCert func(*tls.ClientHelloInfo) (*tls.Certificate, error), resolve func(string) ([]string, error), edgeIPs func() []string, store release.Store) *certWarm {
+ warm := newCertWarm(
+ func() []string { return e.warmSet(appsDomain, parents) },
+ getCert,
+ dnsGate(resolve, edgeIPs),
+ e.issuerGate,
+ store,
+ )
+ // Woken when its set may have grown (#386), so a custom domain is
+ // ordered seconds after it is published rather than at the next hourly
+ // pass: a change in the names this box or another publishes (#724), or a
+ // local route reload (a regional name). A wake with nothing new in the
+ // set is dropped.
+ e.OnReload(warm.nudge)
+ e.homes.Load().setServedWake(warm.nudge)
+ return warm
+}
+
// wildcardCoverer reports whether a host is exactly one label under a
// wildcard parent this box has configured or derived — by SHAPE, never by
// whether the parent's cert exists yet (see warmSet). A nil parents func
diff --git a/internal/edge/certwarm_test.go b/internal/edge/certwarm_test.go
index 26b4d8160..8f3f3f40d 100644
--- a/internal/edge/certwarm_test.go
+++ b/internal/edge/certwarm_test.go
@@ -42,20 +42,36 @@ func TestWarmHelloCarriesTheServerName(t *testing.T) {
}
}
+// publishedEdge is an edge labelled annie whose home map has read annie's
+// own published edges file, with the given hosts object. The warm set is
+// read from publication, not from the route table (#724), so this is how a
+// test gives the issuer names of its own.
+func publishedEdge(t *testing.T, ownHosts string) (*Edge, *homeMap, release.Store) {
+ t.Helper()
+ s := meshTestStore(t)
+ putJSON(t, s, "control/edges/annie.json", `{"v":1,"box":"annie","eip":"1.1.1.1","hosts":`+ownHosts+`}`)
+ m := newHomeMap(s, "annie")
+ refreshHomeMap(t, m)
+ e := &Edge{}
+ e.homes.Store(m)
+ return e, m, s
+}
+
// The warm set is "exact hosts we serve that are not under the apps domain
// and not wildcard-covered". Each exclusion below is a separate bug if it
// regresses.
func TestWarmSetSelectsCustomDomainsOnly(t *testing.T) {
- e := &Edge{}
- e.upstreams.Store(&map[string]upstream{
- "www.customer.test": {},
- "shop.customer.test": {},
- "app.acct.oncarlos.test": {}, // platform host — apps domain
- "c1.app.acct.oncarlos.test": {}, // canary — apps domain, 3 labels
- "*.catchall.test": {}, // catch-all — wildcard covers it
- "one.go.tito.test": {}, // one label under a configured parent
- "deep.one.go.tito.test": {}, // TWO labels under it: NOT covered
- })
+ e, _, _ := publishedEdge(t, `{
+ "www.customer.test": {"role":"home"},
+ "shop.customer.test": {"role":"home"},
+ "app.acct.oncarlos.test": {"role":"home","platform":true},
+ "c1.app.acct.oncarlos.test": {"role":"home"},
+ "*.catchall.test": {"role":"home"},
+ "one.go.tito.test": {"role":"home"},
+ "deep.one.go.tito.test": {"role":"home"}}`)
+ // platform host and canary: apps domain. Catch-all: a wildcard covers
+ // it. one.go.tito.test: one label under a configured parent.
+ // deep.one.go.tito.test: TWO labels under it, NOT covered.
parents := func() []string { return []string{"go.tito.test"} }
got := e.warmSet("oncarlos.test", parents)
@@ -71,8 +87,7 @@ func TestWarmSetSelectsCustomDomainsOnly(t *testing.T) {
// exactly the window before their wildcard arrives — the burst the shape
// test exists to prevent.
func TestWarmSetExcludesChildrenOfAnUnobtainedParent(t *testing.T) {
- e := &Edge{}
- e.upstreams.Store(&map[string]upstream{"new.acct.test": {}})
+ e, _, _ := publishedEdge(t, `{"new.acct.test":{"role":"home"}}`)
// currentParents lists the parent; no cert exists for it anywhere.
if got := e.warmSet("oncarlos.test", func() []string { return []string{"acct.test"} }); len(got) != 0 {
t.Fatalf("warm set = %v; a configured parent covers its children whether or not its cert exists yet", got)
@@ -80,13 +95,182 @@ func TestWarmSetExcludesChildrenOfAnUnobtainedParent(t *testing.T) {
}
func TestWarmSetWithNoWildcardManagerCoversNothing(t *testing.T) {
- e := &Edge{}
- e.upstreams.Store(&map[string]upstream{"www.customer.test": {}})
+ e, _, _ := publishedEdge(t, `{"www.customer.test":{"role":"home"}}`)
if got := e.warmSet("oncarlos.test", nil); len(got) != 1 || got[0] != "www.customer.test" {
t.Fatalf("warm set = %v, want the custom domain", got)
}
}
+// The warm set is this box's published names and every other box's, and
+// nothing from the route table: a name this box serves but has not published
+// (an alias attached a moment ago, its DNS record not yet made) is not in
+// it. An edge with no home map at all, or no box label, has no publication
+// to read and warms nothing.
+func TestWarmSetReadsPublicationNotTheRouteTable(t *testing.T) {
+ e, m, s := publishedEdge(t, `{"published.customer.test":{"role":"home","alias":true,"dns_pointing":true}}`)
+ putJSON(t, s, "control/edges/betty.json", `{"v":1,"box":"betty","eip":"2.2.2.2","hosts":{"elsewhere.customer.test":{"role":"home","alias":true,"dns_pointing":true}}}`)
+ refreshHomeMap(t, m)
+ e.upstreams.Store(&map[string]upstream{
+ "published.customer.test": {},
+ "fresh.customer.test": {alias: true}, // attached, not yet published
+ "firstroute.customer.test": {}, // a custom route, likewise
+ })
+ got := e.warmSet("oncarlos.test", nil)
+ if want := "elsewhere.customer.test,published.customer.test"; strings.Join(got, ",") != want {
+ t.Fatalf("warm set = %v, want %s: only published names", got, want)
+ }
+
+ bare := &Edge{}
+ bare.upstreams.Store(&map[string]upstream{"www.customer.test": {}})
+ if got := bare.warmSet("oncarlos.test", nil); len(got) != 0 {
+ t.Fatalf("an edge with no home map warmed %v from its route table", got)
+ }
+ unlabelled := &Edge{}
+ unlabelled.upstreams.Store(&map[string]upstream{"www.customer.test": {}})
+ um := newHomeMap(s, "")
+ refreshHomeMap(t, um)
+ unlabelled.homes.Store(um)
+ if got := unlabelled.warmSet("oncarlos.test", nil); len(got) != 0 {
+ t.Fatalf("an unlabelled edge warmed %v", got)
+ }
+}
+
+// issuerWarmFixture is an issuer edge (annie) built through newIssuerWarm,
+// the production wiring: the real warmSet, the real dnsGate over a counting
+// fake resolver and a fixed edge set, and the real wakes. publish rewrites
+// annie's own edges file and has the home map read it.
+type issuerWarmFixture struct {
+ e *Edge
+ m *homeMap
+ s release.Store
+ w *certWarm
+ mu sync.Mutex
+ lookups map[string]int
+ orders map[string]int
+}
+
+func newIssuerWarmFixture(t *testing.T, ownHosts string) *issuerWarmFixture {
+ t.Helper()
+ f := &issuerWarmFixture{lookups: map[string]int{}, orders: map[string]int{}}
+ f.e, f.m, f.s = publishedEdge(t, ownHosts)
+ f.w = f.e.newIssuerWarm("oncarlos.test", nil,
+ func(h *tls.ClientHelloInfo) (*tls.Certificate, error) {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ f.orders[h.ServerName]++
+ return &tls.Certificate{}, nil
+ },
+ func(host string) ([]string, error) {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ f.lookups[host]++
+ return []string{"203.0.113.7"}, nil
+ },
+ func() []string { return []string{"203.0.113.7"} },
+ nil,
+ )
+ return f
+}
+
+func (f *issuerWarmFixture) publish(t *testing.T, box, hosts string) {
+ t.Helper()
+ putJSON(t, f.s, "control/edges/"+box+".json", `{"v":1,"box":"`+box+`","eip":"1.1.1.1","hosts":`+hosts+`}`)
+ refreshHomeMap(t, f.m)
+}
+
+func (f *issuerWarmFixture) counts(host string) (lookups, orders int) {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ return f.lookups[host], f.orders[host]
+}
+
+func (f *issuerWarmFixture) totalLookups() int {
+ f.mu.Lock()
+ defer f.mu.Unlock()
+ n := 0
+ for _, c := range f.lookups {
+ n += c
+ }
+ return n
+}
+
+// THE assertion for #724. An alias attached on the issuer's own box is in
+// its route table at once, before the customer has made the DNS record. The
+// warm must not ask the resolver about it then: the box's resolver caches
+// "no such name" for the zone's negative TTL, and the certificate then waits
+// that long after the record appears. So until the box's own edges file
+// publishes the name as pointing: zero lookups, zero orders, however many
+// passes and reload wakes go by. After it does: one lookup, one order.
+func TestIssuerWarmDoesNotLookUpAnUnpublishedAlias(t *testing.T) {
+ const alias = "shop.example.com"
+ f := newIssuerWarmFixture(t, `{"app.acct.oncarlos.test":{"role":"home","platform":true}}`)
+ f.e.upstreams.Store(&map[string]upstream{
+ "app.acct.oncarlos.test": {},
+ alias: {alias: true},
+ })
+ f.w.pass()
+ f.e.runReloadHooks() // the reload that brought the alias nudges the warm
+ if f.w.hasNewHost() {
+ t.Fatal("the warm counts an unpublished alias as a new host: its wake would run a pass that looks the name up")
+ }
+ f.w.pass()
+ if n := f.totalLookups(); n != 0 {
+ t.Fatalf("%d resolver lookup(s) before the alias was published (%v): the first one plants the negative cache entry", n, f.lookups)
+ }
+
+ f.publish(t, "annie", `{"app.acct.oncarlos.test":{"role":"home","platform":true},"`+alias+`":{"role":"home","alias":true,"dns_pointing":true}}`)
+ if !f.w.hasNewHost() {
+ t.Fatal("the published alias is not a new host to the warm")
+ }
+ f.w.pass()
+ if lookups, orders := f.counts(alias); lookups != 1 || orders != 1 {
+ t.Fatalf("after publication: %d lookup(s), %d order(s), want 1 and 1", lookups, orders)
+ }
+}
+
+// A first-route claim is a ROUTE with a custom hostname, published at once
+// with dns_pointing false. The warm leaves it alone on the same terms, on
+// its own box and on another, until the home box flips the mark.
+func TestIssuerWarmWaitsForACustomRouteToPoint(t *testing.T) {
+ const own, remote = "shop.example.com", "store.example.net"
+ f := newIssuerWarmFixture(t, `{"`+own+`":{"role":"home","platform":false,"dns_pointing":false}}`)
+ f.e.upstreams.Store(&map[string]upstream{own: {}})
+ f.publish(t, "betty", `{"`+remote+`":{"role":"home","platform":false,"dns_pointing":false}}`)
+ f.w.pass()
+ f.w.pass()
+ if n := f.totalLookups(); n != 0 {
+ t.Fatalf("%d resolver lookup(s) for routes not yet pointing (%v)", n, f.lookups)
+ }
+
+ f.publish(t, "annie", `{"`+own+`":{"role":"home","platform":false,"dns_pointing":true}}`)
+ f.w.pass()
+ if lookups, orders := f.counts(own); lookups != 1 || orders != 1 {
+ t.Fatalf("own route after the flip: %d lookup(s), %d order(s), want 1 and 1", lookups, orders)
+ }
+ if lookups, _ := f.counts(remote); lookups != 0 {
+ t.Fatalf("betty's route was looked up %d time(s) before betty saw it pointing", lookups)
+ }
+ f.publish(t, "betty", `{"`+remote+`":{"role":"home","platform":false,"dns_pointing":true}}`)
+ f.w.pass()
+ if lookups, orders := f.counts(remote); lookups != 1 || orders != 1 {
+ t.Fatalf("betty's route after the flip: %d lookup(s), %d order(s), want 1 and 1", lookups, orders)
+ }
+}
+
+// Publication wakes the warm. newIssuerWarm hands the home map its nudge, so
+// the refresh that reads the flipped mark starts a pass by itself, and the
+// certificate does not wait for the hourly one.
+func TestIssuerWarmIsWokenByItsOwnPublication(t *testing.T) {
+ const alias = "shop.example.com"
+ f := newIssuerWarmFixture(t, `{}`)
+ passes := loopWarm(t, f.w)
+ f.publish(t, "annie", `{"`+alias+`":{"role":"home","alias":true,"dns_pointing":true}}`)
+ waitCount(t, passes, 2, "passes")
+ if lookups, orders := f.counts(alias); lookups != 1 || orders != 1 {
+ t.Fatalf("after the wake: %d lookup(s), %d order(s), want 1 and 1", lookups, orders)
+ }
+}
+
// ALL answers must be in the edge set. A name mid-migration resolves to the
// old host AND ours; an any-match gate passes it, the order goes out, and
// validation fails from the CA's vantage anyway — burning the shared
diff --git a/internal/edge/edge.go b/internal/edge/edge.go
index 0d012d33c..ab9c51822 100644
--- a/internal/edge/edge.go
+++ b/internal/edge/edge.go
@@ -4900,19 +4900,9 @@ func RunWithActivatorReady(args []string, act Activator, cache *Cache, ready fun
defer cancel()
return edgesfile.EdgeIPs(ctx, store, envIPs, time.Now())
}
- warm := newCertWarm(
- func() []string { return e.warmSet(appsDomain, parents) },
- perHostCert,
- dnsGate(warmResolver, edgeIPs),
- e.issuerGate,
- store,
- )
- // Woken when its set may have grown (#386), so a custom domain is
- // ordered seconds after it reaches this box rather than at the next
- // hourly pass: a local route reload, or a change in the names other
- // boxes home. A wake with nothing new in the set is dropped.
- e.OnReload(warm.nudge)
- e.homes.Load().setServedWake(warm.nudge)
+ // The set, the DNS gate and the wakes are newIssuerWarm's
+ // (certwarm.go).
+ warm := e.newIssuerWarm(appsDomain, parents, perHostCert, warmResolver, edgeIPs, store)
go warm.run()
log.Printf("edge: cert warm on (%s pass) — custom domains are ordered and renewed proactively, not on first handshake", warmInterval)
}
diff --git a/internal/edge/homemap.go b/internal/edge/homemap.go
index 8579f5828..856541831 100644
--- a/internal/edge/homemap.go
+++ b/internal/edge/homemap.go
@@ -238,6 +238,10 @@ type edgesHostView struct {
// by edgesfile/testdata/assets-host.golden.json. Absent on a file from an
// unarmed box or a publisher that predates it, which reads as no block.
Assets *edgesAssetsView `json:"assets,omitempty"`
+ // DNSPointing is the publisher's own DNS verdict for a custom name
+ // (#724). Absent reads as pointing: edgesfile.DNSPointing is its only
+ // reader, and holds the compatibility rule.
+ DNSPointing *bool `json:"dns_pointing,omitempty"`
}
// edgesAssetsView is the wire shape of the assets block: path prefixes, the
@@ -266,6 +270,10 @@ type homeEntry struct {
// dial reports whether the entry is a backhaul target (role home). A
// cert-only wildcard entry folds with dial false and Home skips it.
dial bool
+ // pointing reports whether any box homing the name has seen its DNS
+ // point at this deployment (edgesfile.DNSPointing, unioned across home
+ // rows like the classes). ServedHosts lists only such names (#724).
+ pointing bool
// account and app are the owner the dial target's box published. They
// travel with eip and box and are never merged across entries.
account, app string
@@ -296,6 +304,10 @@ type homeSnapshot struct {
files map[string]edgesFileView
// hosts is the fold: host → home, own box already excluded.
hosts map[string]homeEntry
+ // ownServed is OwnServedHosts' answer: this box's own published exact
+ // home names whose DNS it has seen pointing. Sorted, never written after
+ // the snapshot is published.
+ ownServed []string
// read is set once the snapshot comes from a successful hosts refresh:
// the empty snapshot a restart starts from is not an answer (AssetsFor).
read bool
@@ -321,11 +333,12 @@ type homeMap struct {
snap *homeSnapshot
// hostsWake fires after a Refresh that changed the NAME set (setHostsWake).
hostsWake func()
- // servedWake fires after a Refresh that changed the ServedHosts set
- // (setServedWake): the cert warm's cue that a custom domain was attached
- // on another box (#386). Separate from hostsWake because their filters
- // are opposites: hostsWake ignores exactly the unclassed rows a custom
- // domain arrives as.
+ // servedWake fires after a Refresh that changed the ServedHosts set or
+ // the OwnServedHosts set (setServedWake): the cert warm's cue that a
+ // custom domain was attached on another box (#386), or that this box or
+ // another published one as pointing (#724). Separate from hostsWake
+ // because their filters are opposites: hostsWake ignores exactly the
+ // unclassed rows a custom domain arrives as.
servedWake func()
// partialPolls counts polls that could not read (or parse) every object,
// for the first-and-every-tenth log cadence.
@@ -639,7 +652,7 @@ func (m *homeMap) refreshHosts(ctx context.Context) error {
// deterministic; say so once a refresh.
log.Printf("edge: home map: %d host(s) published by two boxes at the same installation stamp, e.g. %s", len(tied), tied[0])
}
- snap := &homeSnapshot{groupObserved: m.snapshot().groupObserved, files: next, hosts: hosts, read: true, departureComplete: failed == 0, readerComplete: failed == 0 && !readerMissing}
+ snap := &homeSnapshot{groupObserved: m.snapshot().groupObserved, files: next, hosts: hosts, ownServed: ownServedHosts(next, m.self), read: true, departureComplete: failed == 0, readerComplete: failed == 0 && !readerMissing}
m.mu.Lock()
m.snap = snap
wake := m.hostsWake
@@ -658,7 +671,10 @@ func (m *homeMap) refreshHosts(ctx context.Context) error {
// that.
go wake()
}
- if served != nil && !sameServedSet(prev.hosts, snap.hosts) {
+ if served != nil && (!sameServedSet(prev.hosts, snap.hosts) || !slices.Equal(prev.ownServed, snap.ownServed)) {
+ // Either half of the warm set moved: another box's names, or this
+ // box's own publication (a custom name it has just stamped
+ // "pointing", #724).
go served()
}
return nil
@@ -666,7 +682,8 @@ func (m *homeMap) refreshHosts(ctx context.Context) error {
// sameServedSet reports whether two folds serve the same exact names, by
// ServedHosts' filter. Addresses and owners moving change nothing here: the
-// warm's question is only which names exist.
+// warm's question is only which names exist. A name whose publisher flips
+// it to pointing joins the set, so the flip is a change (#724).
func sameServedSet(a, b map[string]homeEntry) bool {
n := 0
for h, e := range a {
@@ -686,9 +703,36 @@ func sameServedSet(a, b map[string]homeEntry) bool {
return n == 0
}
-// servedInput is ServedHosts' filter: a dialable, exact name.
+// servedInput is ServedHosts' filter: a dialable, exact name that a box
+// homing it has seen pointing here (every name but a custom one a current
+// publisher has not stamped yet: edgesfile.DNSPointing).
func servedInput(host string, e homeEntry) bool {
- return e.dial && !strings.HasPrefix(host, "*.")
+ return e.dial && e.pointing && !strings.HasPrefix(host, "*.")
+}
+
+// ownServedHosts is OwnServedHosts' answer for one poll's files: the exact
+// names this box's own file publishes as home, DNS pointing. The own file is
+// the one foldHomes leaves out of the fold (Box == self), so the two sets
+// never overlap and never miss a file between them. Sorted; nil for an
+// unlabelled box.
+func ownServedHosts(files map[string]edgesFileView, self string) []string {
+ if self == "" {
+ return nil
+ }
+ var out []string
+ for _, f := range files {
+ if f.Box != self {
+ continue
+ }
+ for host, h := range f.Hosts {
+ if host == "" || strings.HasPrefix(host, "*.") || h.Role != edgeRoleHome || !edgesfile.DNSPointing(h.DNSPointing) {
+ continue
+ }
+ out = append(out, host)
+ }
+ }
+ slices.Sort(out)
+ return slices.Compact(out)
}
// samePlatformSet reports whether two folds name the same PLATFORM hosts —
@@ -799,6 +843,11 @@ func (m *homeMap) Hosts() []string {
// autocert refuses the wildcard label anyway (Allowed). Only dial-able
// entries count — a cert-only wildcard row homes nothing.
//
+// A custom name its publisher has not seen pointing yet is left out (#724,
+// edgesfile.DNSPointing): the cert warm looks up every name listed here
+// through this box's caching resolver, and a lookup made before the record
+// exists is remembered as "no such name" for the zone's negative TTL.
+//
// An unlabelled box (self == "") reports nothing, as Home does: an edge that
// cannot tell its own rows from another box's must not answer at all.
func (m *homeMap) ServedHosts() []string {
@@ -817,6 +866,27 @@ func (m *homeMap) ServedHosts() []string {
return out
}
+// OwnServedHosts is ServedHosts' other half: the exact names THIS box homes,
+// read from its own published edges file as the home map last polled it and
+// not from its route table. The fold leaves the own file out, so
+// ServedHosts never lists these.
+//
+// The published file is the source on purpose (#724). The route table gains
+// a custom domain the moment it is attached, before its DNS record need
+// exist; the file gains an alias only once this box's DNS sweep has stamped
+// it "pointing", and marks a custom route dns_pointing false until the same
+// stamp. So a name listed here is one whose record this box has already
+// seen, and the cert warm's first cached lookup of it cannot be the one that
+// plants "no such name".
+//
+// Sorted, nil-safe, and nothing for an unlabelled box, as ServedHosts.
+func (m *homeMap) OwnServedHosts() []string {
+ if m == nil || m.self == "" {
+ return nil
+ }
+ return slices.Clone(m.snapshot().ownServed)
+}
+
// setHostsWake installs the callback a changed host set fires (Refresh).
// Under the map's own lock: run() is already polling when the wildcard
// manager is wired in after it.
@@ -829,8 +899,8 @@ func (m *homeMap) setHostsWake(fn func()) {
m.mu.Unlock()
}
-// setServedWake installs the callback a changed ServedHosts set fires
-// (Refresh), on the same terms as setHostsWake.
+// setServedWake installs the callback a changed ServedHosts or
+// OwnServedHosts set fires (Refresh), on the same terms as setHostsWake.
func (m *homeMap) setServedWake(fn func()) {
if m == nil {
return
@@ -935,6 +1005,7 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
merged := hosts[host]
merged.platform = merged.platform || (h.Platform && !h.Alias && !h.Wildcard)
merged.wildcard = merged.wildcard || h.Wildcard
+ merged.pointing = merged.pointing || (h.Role == edgeRoleHome && edgesfile.DNSPointing(h.DNSPointing))
hosts[host] = merged
}
}
@@ -951,7 +1022,7 @@ func foldHomes(files map[string]edgesFileView, self string, privateDial bool) (m
}
h.claims = cs
h.routeExists = r.RouteExists
- h.platform, h.wildcard = classes.platform, classes.wildcard
+ h.platform, h.wildcard, h.pointing = classes.platform, classes.wildcard, classes.pointing
hosts[name] = h
}
diff --git a/internal/edge/homemap_dnspointing_test.go b/internal/edge/homemap_dnspointing_test.go
new file mode 100644
index 000000000..b5731b0c4
--- /dev/null
+++ b/internal/edge/homemap_dnspointing_test.go
@@ -0,0 +1,118 @@
+package edge
+
+import (
+ "strings"
+ "sync/atomic"
+ "testing"
+ "time"
+)
+
+// #724: the home map's two name sets for the cert warm, this box's own
+// publication (OwnServedHosts) and every other box's (ServedHosts), leave
+// out a custom name whose home box has not seen it pointing, and gain it
+// when that box flips the mark. Either flip wakes the warm.
+func TestHomeMapServedSetsWaitForDNSPointing(t *testing.T) {
+ s := meshTestStore(t)
+ own := func(pointing string) {
+ putJSON(t, s, "control/edges/annie.json", `{"v":1,"box":"annie","eip":"1.1.1.1","hosts":{
+ "app.acct.apps.test":{"role":"home","platform":true},
+ "*.catch.example.com":{"role":"home"},
+ "cert.example.com":{"role":"wildcard"},
+ "shop.example.com":{"role":"home","platform":false,"dns_pointing":`+pointing+`}}}`)
+ }
+ other := func(pointing string) {
+ putJSON(t, s, "control/edges/betty.json", `{"v":1,"box":"betty","eip":"2.2.2.2","hosts":{
+ "old.example.net":{"role":"home","alias":true},
+ "store.example.net":{"role":"home","platform":false,"dns_pointing":`+pointing+`}}}`)
+ }
+ own("false")
+ other("false")
+ m := newHomeMap(s, "annie")
+ var woke atomic.Int32
+ m.setServedWake(func() { woke.Add(1) })
+ refreshHomeMap(t, m)
+ waitWoke(t, &woke, 1)
+
+ sets := func() (string, string) {
+ return strings.Join(m.OwnServedHosts(), ","), strings.Join(m.ServedHosts(), ",")
+ }
+ // The apps-domain row carries no mark and is listed (the warm drops it by
+ // domain); the wildcard row and the cert-only row are not exact homes.
+ // old.example.net carries no mark: a publisher from before it existed.
+ if o, r := sets(); o != "app.acct.apps.test" || r != "old.example.net" {
+ t.Fatalf("before any flip: own %q, others %q; want app.acct.apps.test and old.example.net", o, r)
+ }
+
+ // This box stamps its own route pointing.
+ own("true")
+ refreshHomeMap(t, m)
+ waitWoke(t, &woke, 2)
+ if o, r := sets(); o != "app.acct.apps.test,shop.example.com" || r != "old.example.net" {
+ t.Fatalf("after the own flip: own %q, others %q", o, r)
+ }
+
+ // Betty stamps hers.
+ other("true")
+ refreshHomeMap(t, m)
+ waitWoke(t, &woke, 3)
+ if o, r := sets(); o != "app.acct.apps.test,shop.example.com" || r != "old.example.net,store.example.net" {
+ t.Fatalf("after betty's flip: own %q, others %q", o, r)
+ }
+
+ // Nothing moved: no wake.
+ refreshHomeMap(t, m)
+ time.Sleep(20 * time.Millisecond)
+ if woke.Load() != 3 {
+ t.Fatalf("an unchanged refresh woke the warm (%d)", woke.Load())
+ }
+
+ // A record that goes away takes the name back out, on either side.
+ own("false")
+ other("false")
+ refreshHomeMap(t, m)
+ waitWoke(t, &woke, 4)
+ if o, r := sets(); o != "app.acct.apps.test" || r != "old.example.net" {
+ t.Fatalf("after both marks cleared: own %q, others %q", o, r)
+ }
+
+ // The caller may keep and change what it was handed.
+ got := m.OwnServedHosts()
+ got[0] = "scribbled"
+ if o, _ := sets(); o != "app.acct.apps.test" {
+ t.Fatalf("OwnServedHosts handed out the snapshot's own slice: %q", o)
+ }
+}
+
+// An unlabelled box cannot tell its own file from another box's, so it
+// reports no names of either kind, as ServedHosts always has. A nil map
+// (no deployment store) likewise.
+func TestHomeMapOwnServedHostsNeedsABoxLabel(t *testing.T) {
+ s := meshTestStore(t)
+ putJSON(t, s, "control/edges/annie.json", `{"v":1,"box":"annie","eip":"1.1.1.1","hosts":{"shop.example.com":{"role":"home","dns_pointing":true}}}`)
+ m := newHomeMap(s, "")
+ refreshHomeMap(t, m)
+ if got := m.OwnServedHosts(); len(got) != 0 {
+ t.Fatalf("an unlabelled box reported own hosts %v", got)
+ }
+ if got := m.ServedHosts(); len(got) != 0 {
+ t.Fatalf("an unlabelled box reported served hosts %v", got)
+ }
+ var nilMap *homeMap
+ if got := nilMap.OwnServedHosts(); got != nil {
+ t.Fatalf("a nil map reported %v", got)
+ }
+}
+
+// Two boxes homing one name (a static site runs on every box): it is listed
+// as soon as either has seen it pointing.
+func TestHomeMapServedHostsPointingOnAnyHomeBox(t *testing.T) {
+ s := meshTestStore(t)
+ putJSON(t, s, "control/edges/annie.json", `{"v":1,"box":"annie","eip":"1.1.1.1","hosts":{}}`)
+ putJSON(t, s, "control/edges/betty.json", `{"v":1,"box":"betty","eip":"2.2.2.2","hosts":{"shop.example.com":{"role":"home","dns_pointing":false}}}`)
+ putJSON(t, s, "control/edges/carol.json", `{"v":1,"box":"carol","eip":"3.3.3.3","hosts":{"shop.example.com":{"role":"home","dns_pointing":true}}}`)
+ m := newHomeMap(s, "annie")
+ refreshHomeMap(t, m)
+ if got := m.ServedHosts(); len(got) != 1 || got[0] != "shop.example.com" {
+ t.Fatalf("served hosts = %v, want shop.example.com", got)
+ }
+}
diff --git a/internal/edgesfile/dnspointing_test.go b/internal/edgesfile/dnspointing_test.go
new file mode 100644
index 000000000..bec20d1e1
--- /dev/null
+++ b/internal/edgesfile/dnspointing_test.go
@@ -0,0 +1,33 @@
+package edgesfile
+
+import "testing"
+
+// The compatibility rule (#724): a host entry with no dns_pointing mark reads
+// as pointing, whichever kind it is. A box that predates the mark publishes
+// an alias only once it is pointing and a route whatever its DNS, and both
+// must stay in the issuer's warm set through a mixed-version roll. Only an
+// explicit false withholds a name.
+func TestDNSPointingAbsentReadsAsPointing(t *testing.T) {
+ f, err := Parse([]byte(`{"v":1,"box":"annie","eip":"1.1.1.1","hosts":{
+ "old-alias.example.com":{"role":"home","platform":false,"alias":true},
+ "old-route.example.com":{"role":"home","platform":false},
+ "waiting.example.com":{"role":"home","platform":false,"dns_pointing":false},
+ "pointing.example.com":{"role":"home","platform":false,"dns_pointing":true}}}`))
+ if err != nil {
+ t.Fatal(err)
+ }
+ for host, want := range map[string]bool{
+ "old-alias.example.com": true,
+ "old-route.example.com": true,
+ "waiting.example.com": false,
+ "pointing.example.com": true,
+ } {
+ if got := f.Hosts[host].Pointing(); got != want {
+ t.Errorf("%s: Pointing() = %v, want %v", host, got, want)
+ }
+ }
+ yes, no := true, false
+ if !DNSPointing(nil) || !DNSPointing(&yes) || DNSPointing(&no) {
+ t.Error("DNSPointing: want nil and true to read as pointing, false as not")
+ }
+}
diff --git a/internal/edgesfile/edgesfile.go b/internal/edgesfile/edgesfile.go
index 35a34f49a..a863a5da4 100644
--- a/internal/edgesfile/edgesfile.go
+++ b/internal/edgesfile/edgesfile.go
@@ -69,8 +69,31 @@ type Host struct {
// testdata/assets-host.golden.json. Additive: nil on a file without it,
// which includes every file an unarmed box writes.
Assets *HostAssets `json:"assets,omitempty"`
+ // DNSPointing is the home box's own DNS verdict for a custom name (one
+ // outside the apps domain): true once its DNS sweep has stamped the name
+ // "pointing", false until then. A pointer because absent is not false:
+ // read it through Pointing, never directly (#724).
+ DNSPointing *bool `json:"dns_pointing,omitempty"`
}
+// Pointing reports whether the publishing box has seen the name's DNS point
+// at this deployment. See DNSPointing.
+func (h Host) Pointing() bool { return DNSPointing(h.DNSPointing) }
+
+// DNSPointing reads a host entry's dns_pointing mark, and is the one place
+// the compatibility rule lives: an ABSENT mark reads as pointing.
+//
+// A publisher that predates the mark publishes an alias only once it is
+// pointing, and publishes a route whatever its DNS, which the issuer's cert
+// warm then looked up for itself. Reading absent as true keeps both exactly
+// as they were through a mixed-version roll. A current publisher also leaves
+// the mark off every name that has no DNS verdict to wait for (anything
+// under the apps domain, every "*." row), for the same reading. Only an
+// explicit false withholds a name from the warm set (#724): the record may
+// not exist yet, and a cached lookup of it would plant "no such name" in the
+// issuer's resolver for the zone's negative TTL.
+func DNSPointing(mark *bool) bool { return mark == nil || *mark }
+
// HostAssets is the decoded assets block: the path prefixes the host's
// serving builds declare, the instance's asset generation, the host's
// authority time in Unix seconds, and the primary route hostname the block
diff --git a/internal/host/edgesfile.go b/internal/host/edgesfile.go
index 63c584807..3fedae8b9 100644
--- a/internal/host/edgesfile.go
+++ b/internal/host/edgesfile.go
@@ -114,6 +114,29 @@ type edgeHost struct {
// box (CARLOS_ASSET_CACHE=1) for a host assetPolicy says catches.
// Additive (omitempty): a file without it parses byte-identically.
Assets *edgeAssets `json:"assets,omitempty"`
+ // DNSPointing is this box's own DNS verdict for a custom name, one
+ // outside the apps domain (#724): true once the box's DNS sweep has
+ // stamped the name "pointing", false until then. The issuer's cert warm
+ // leaves a false name out of its set, so its caching resolver is first
+ // asked about the name after the record exists. Set by dnsPointingMark:
+ // nil, and so absent, on every name with no verdict to wait for. A
+ // reader takes absent as pointing (edgesfile.DNSPointing). Additive
+ // (omitempty on the pointer, so false is written and nil is not).
+ DNSPointing *bool `json:"dns_pointing,omitempty"`
+}
+
+// dnsPointingMark is a published name's dns_pointing mark. A name under the
+// apps domain, a "*." row, and every name on a box with no apps domain (its
+// DNS sweep never runs, so nothing would ever stamp "pointing") get no mark:
+// their publication is exactly what it was. A custom name gets pointing as
+// given: an alias is published only once it is pointing, and a route says
+// whether its dns_status is "pointing".
+func dnsPointingMark(appsDomain, host string, pointing bool) *bool {
+ host = strings.ToLower(host)
+ if appsDomain == "" || strings.HasPrefix(host, "*.") || host == appsDomain || strings.HasSuffix(host, "."+appsDomain) {
+ return nil
+ }
+ return &pointing
}
// hostOwner folds the owners of every route served under one hostname. Any
@@ -630,6 +653,9 @@ func edgesFileWriteClaims(ctx context.Context, s release.Store, reg *registry.Re
}
forwards := map[string]bool{}
pools := provisionTickConfig(os.Getenv).ServedPools()
+ // The apps domain as the DNS sweep reads it (domainsLoop): a name outside
+ // it is a custom name and carries a dns_pointing mark (#724).
+ appsDomain := strings.ToLower(strings.TrimSpace(os.Getenv("PLATFORM_APPS_DOMAIN")))
for _, r := range routes {
// edge.Reload (internal/edge/edge.go) is the deployment's own
// definition of "serves": it skips any row whose Status != "ready"
@@ -690,6 +716,13 @@ func edgesFileWriteClaims(ctx context.Context, s release.Store, reg *registry.Re
// homes from its checkout replicas. See the replica loop below for
// the account apex that rides along.
h := edgeHost{Role: "home", Platform: r.Platform || r.Provisioned, Replica: r.Replica}
+ // A route with a custom hostname (a first-route claim) is published
+ // whatever its DNS, as it always was, and now says whether this box
+ // has seen it pointing. dns_status is outside the registry
+ // fingerprint, so the flip to "pointing" reaches the file on the
+ // timer's pass, as an alias's does: the body differs from the last
+ // one written, and the gate below writes it.
+ h.DNSPointing = dnsPointingMark(appsDomain, r.Host, r.DNSStatus == "pointing")
if lifetimes {
// The row's lifetime pair (self-serve moves plan 1, design
// §6.4): the edge orders two unstamped entries by it.
@@ -812,8 +845,10 @@ func edgesFileWriteClaims(ctx context.Context, s release.Store, reg *registry.Re
// off), and names the primary as its target: the edge compares two
// aliases' pairs only for one target.
p := hosts[primary]
+ // Only a pointing alias reaches here, so its mark is always true.
hosts[a.Alias] = edgeHost{Role: "home", Alias: true, Account: acct, App: app, Stamp: p.Stamp,
- Incarnation: p.Incarnation, ServingSeq: p.ServingSeq, TargetHost: primary}
+ Incarnation: p.Incarnation, ServingSeq: p.ServingSeq, TargetHost: primary,
+ DNSPointing: dnsPointingMark(appsDomain, a.Alias, true)}
}
// Replica placements (#162): a row minted from a role=replica record —
diff --git a/internal/host/edgesfile_dnspointing_test.go b/internal/host/edgesfile_dnspointing_test.go
new file mode 100644
index 000000000..d6c225e39
--- /dev/null
+++ b/internal/host/edgesfile_dnspointing_test.go
@@ -0,0 +1,168 @@
+package host
+
+import (
+ "context"
+ "encoding/json"
+ "strings"
+ "testing"
+ "time"
+
+ "github.com/carlosframework/platform/internal/registry"
+ "github.com/carlosframework/platform/internal/release"
+)
+
+// #724: the edges file says, for every custom name it publishes, whether
+// this box has seen the name's DNS point here. An alias is published only
+// once it is pointing, so its mark is true. A route with a custom hostname
+// (a first-route claim) is published at once, as it always was, with the
+// mark false until the DNS sweep stamps it "pointing". Names under the apps
+// domain and "*." rows carry no mark.
+//
+// The flip is the part that could silently not happen: dns_status is
+// outside the registry fingerprint, so no change pass follows it. The next
+// pass at all (the timer's) must still write the file, because the body
+// differs from the one last written.
+func TestEdgesFileMarksCustomNamesDNSPointing(t *testing.T) {
+ t.Setenv("PLATFORM_APPS_DOMAIN", "apps.test")
+ s := &putCountingStore{Store: release.NewDirStore(t.TempDir())}
+ reg := edgesTestRegistry(t)
+ if err := reg.Upsert(registry.Route{Host: "app.acct.apps.test", Kind: "service", Addr: "10.0.0.1:3000", Status: "ready", Platform: true}); err != nil {
+ t.Fatal(err)
+ }
+ seedRoute(t, reg, "shop.example.com")
+ seedRoute(t, reg, "*.catch.example.com")
+ if err := reg.UpsertAlias(registry.RouteAlias{Alias: "www.example.org", Host: "app.acct.apps.test", Account: "acct", App: "app", DNSStatus: "pointing"}); err != nil {
+ t.Fatal(err)
+ }
+ if err := reg.UpsertAlias(registry.RouteAlias{Alias: "fresh.example.org", Host: "app.acct.apps.test", Account: "acct", App: "app"}); err != nil {
+ t.Fatal(err)
+ }
+ var last []byte
+ publish := func() map[string]map[string]json.RawMessage {
+ t.Helper()
+ if err := edgesFilePass(context.Background(), s, reg, edgesFile{Box: "annie"}, "1.2.3.4", &last); err != nil {
+ t.Fatal(err)
+ }
+ body, _, err := s.Get(context.Background(), "control/edges/annie.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ var f struct {
+ Hosts map[string]map[string]json.RawMessage `json:"hosts"`
+ }
+ if err := json.Unmarshal(body, &f); err != nil {
+ t.Fatal(err)
+ }
+ return f.Hosts
+ }
+ mark := func(hosts map[string]map[string]json.RawMessage, host string) string {
+ t.Helper()
+ h, ok := hosts[host]
+ if !ok {
+ t.Fatalf("%s is not published", host)
+ }
+ if raw, ok := h["dns_pointing"]; ok {
+ return string(raw)
+ }
+ return "absent"
+ }
+
+ hosts := publish()
+ for host, want := range map[string]string{
+ "www.example.org": "true", // a published alias is a pointing alias
+ "shop.example.com": "false", // a custom route, not yet stamped
+ "app.acct.apps.test": "absent", // under the apps domain
+ "*.catch.example.com": "absent", // a wildcard row
+ } {
+ if got := mark(hosts, host); got != want {
+ t.Errorf("%s: dns_pointing %s, want %s", host, got, want)
+ }
+ }
+ if _, ok := hosts["fresh.example.org"]; ok {
+ t.Error("an alias that is not pointing was published")
+ }
+ if s.puts != 1 {
+ t.Fatalf("first pass puts = %d, want 1", s.puts)
+ }
+
+ // The DNS sweep stamps the route. The fingerprint does not move, so it is
+ // the gate's body comparison that has to carry the flip into the file.
+ before, err := reg.Fingerprint()
+ if err != nil {
+ t.Fatal(err)
+ }
+ if err := reg.SetDNSStatus("shop.example.com", "pointing", time.Now().Unix()); err != nil {
+ t.Fatal(err)
+ }
+ if after, err := reg.Fingerprint(); err != nil || after != before {
+ t.Fatalf("the registry fingerprint moved on a dns_status stamp (%v): this test's premise is gone, and the route flip now has a change pass of its own", err)
+ }
+ hosts = publish()
+ if got := mark(hosts, "shop.example.com"); got != "true" {
+ t.Errorf("shop.example.com after the stamp: dns_pointing %s, want true", got)
+ }
+ if s.puts != 2 {
+ t.Fatalf("puts after the flip = %d, want 2: the flip to pointing must rewrite the file", s.puts)
+ }
+ publish()
+ if s.puts != 2 {
+ t.Fatalf("puts after an unchanged pass = %d, want still 2", s.puts)
+ }
+
+ // And back: a record the customer deleted stops reading as pointing.
+ if err := reg.SetDNSStatus("shop.example.com", "", time.Now().Unix()); err != nil {
+ t.Fatal(err)
+ }
+ if got := mark(publish(), "shop.example.com"); got != "false" {
+ t.Errorf("shop.example.com after losing its record: dns_pointing %s, want false", got)
+ }
+}
+
+// A box with no apps domain runs no DNS sweep, so nothing would ever stamp a
+// name "pointing". It publishes no mark at all, which every reader takes as
+// pointing: its file is byte for byte what it was before the mark existed.
+func TestEdgesFileOmitsDNSPointingWithoutAnAppsDomain(t *testing.T) {
+ t.Setenv("PLATFORM_APPS_DOMAIN", "")
+ s, reg := release.NewDirStore(t.TempDir()), edgesTestRegistry(t)
+ seedRoute(t, reg, "shop.example.com")
+ if err := reg.UpsertAlias(registry.RouteAlias{Alias: "www.example.org", Host: "shop.example.com", DNSStatus: "pointing"}); err != nil {
+ t.Fatal(err)
+ }
+ var last []byte
+ if err := edgesFilePass(context.Background(), s, reg, edgesFile{Box: "annie"}, "1.2.3.4", &last); err != nil {
+ t.Fatal(err)
+ }
+ body, _, err := s.Get(context.Background(), "control/edges/annie.json")
+ if err != nil {
+ t.Fatal(err)
+ }
+ if !strings.Contains(string(body), `"www.example.org"`) || strings.Contains(string(body), "dns_pointing") {
+ t.Fatalf("want the alias published and no dns_pointing mark: %s", body)
+ }
+}
+
+func TestDNSPointingMark(t *testing.T) {
+ for _, tc := range []struct {
+ apps, host string
+ pointing bool
+ want string
+ }{
+ {"apps.test", "shop.example.com", false, "false"},
+ {"apps.test", "shop.example.com", true, "true"},
+ {"apps.test", "Shop.Example.com", true, "true"},
+ {"apps.test", "app.acct.apps.test", false, "absent"},
+ {"apps.test", "App.Acct.Apps.Test", false, "absent"},
+ {"apps.test", "apps.test", false, "absent"},
+ {"apps.test", "notapps.test", false, "false"}, // a suffix, not a label under it
+ {"apps.test", "*.catch.example.com", false, "absent"},
+ {"", "shop.example.com", false, "absent"},
+ } {
+ got := "absent"
+ if m := dnsPointingMark(tc.apps, tc.host, tc.pointing); m != nil {
+ got = map[bool]string{true: "true", false: "false"}[*m]
+ }
+ if got != tc.want {
+ t.Errorf("dnsPointingMark(%q, %q, %v) = %s, want %s", tc.apps, tc.host, tc.pointing, got, tc.want)
+ }
+ }
+}
diff --git a/internal/host/group_names_test.go b/internal/host/group_names_test.go
index 4667526bb..85984bf4e 100644
--- a/internal/host/group_names_test.go
+++ b/internal/host/group_names_test.go
@@ -255,7 +255,7 @@ func TestGroupNameClassCensus(t *testing.T) {
}{
{registry.Route{}, "DemoID DemoHost DemoLifetime DemoExpiresAt ClaimOwnership WakeIncarnation Host Slug Kind Socket Addr Addrs Health Status HoldOp Incarnation ServingSeq SeedSource ImportGate AssetsOff AssetGen PagesOff LastError Stateless FleetBoxes Copies ReplicaRevision ReplicaIncarnation DBPath Version PrevVersion GoodVersion GoodDigest GoodDemand ServingVersion App Pool Region Channel Environment Tunnel FleetBox FleetLabel Assigned Moved Caps Hibernate HA Runtime Gate RateLimit Canary Replication NextDue StatusNamed Backing Unit Platform Provisioned Seed Args IdleSeconds MaxRunSeconds DNSStatus DNSCheckedAt CertExpiresAt Account Steering UpdateSettings EgressAllow Size PolicyExpiresAt BuildState Replicas Replica CreatedAt"},
{provision.Record{}, "DemoClaim Demo ReplicaAssignment Coordinator ReplicaDeploy RecordSeq Acquisition Maintenance Schema Host Slug App Account Pool Region Channel CreatedAt CreatedBy FleetBox FleetBoxAt FleetBoxMoved HA Move LastMove ActiveRun Interactive RunKeys Seed Kind Addr Unit Hibernate Runtime Environment StatusNamed Addrs Health Steering Assets AssetGen Pages Gate Incarnation IncarnationMigrating MoveSeq Retired RateLimit Role Replicas Updates Major Pin InstallRequest"},
- {edgeHost{}, "Role Platform Alias Replica Wildcard Account App Stamp Incarnation ServingSeq TargetHost Assets"},
+ {edgeHost{}, "Role Platform Alias Replica Wildcard Account App Stamp Incarnation ServingSeq TargetHost Assets DNSPointing"},
{domains.Claim{}, "Acquisition RecordIncarnation OwnershipState Schema Host Account App Route CreatedAt CreatedBy Wildcard Catchall Paths Instances Placements Pending PendingUntil"},
{registry.RouteAlias{}, "Alias Host Account App DNSStatus DNSCheckedAt CertExpiresAt CreatedAt"},
{registry.RoutePath{}, "Host Prefix Target Account App"},
@@ -459,7 +459,7 @@ var groupNameProducerInventory = map[string]string{
"claimunit_binding.go:claimUnitShape.route": "f38fd6e10aba680354ee908c255fd34e731fe2d1a22fffd41ac449e8b763dd2c",
"claimunit_policy.go:claimUnitShapeCheck": "45f16830e5ed834995ca573a710f1e390a504b7eb78c3c0465ac70e7f306e50c",
"claimunit_policy.go:rootClaimRestartShape": "1d0370516c32482b1784f4bd4ab0deb042c31120d81f4dc8c417f52b24ef76ac",
- "edgesfile.go:edgesFileWriteClaims": "00876c0a071a68e58799e6097f7459e81fb0a9c0d200202bda257fe409db79e9", // held-requests: drain report and forced drain publish only; no name derivation
+ "edgesfile.go:edgesFileWriteClaims": "577e7cec14583485e02efe50f53160cd626322b2ff494fc0c86fbfbd1cfac24a", // #724: dns_pointing mark on custom names only; no name or class derivation
"movesheldenv.go:composeHeldEnv": "17ad3714758d1c07a71375734c125496855a16ca800eb814bde58283d3a5318b",
"movesheldrelease_root.go:heldReleaseRoute": "10bf824edc963319a38a47b91877b865977b1dc4a27c6e7680c46704289a7df7",
"movesstage.go:heldReleasePublished": "edad51c04a01657b77a9fc469404db5fde51cff1f2c61e243d6a717fb6224e85",
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 263d9e39d..2058b6853 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -148,3 +148,4 @@ plan14-root-reads-billing-dashboard-1.tsv 8924fafc5b6083858a72f45c764081abe3bcad
plan14-root-reads-billing-dash-3-cost.tsv 8924fafc5b6083858a72f45c764081abe3bcad6a6de71901470586c076c64bb6
plan14-root-reads-no-negative-prime-724.tsv ab10145ee873e26b87a653f728cd0c9737592fefe94b659ac5988201c195cb7a
plan14-root-reads-gvisor-probe-retry.tsv 499c08fd29787c5de2aa0197c05f82f6db0ab7760eb7d980bb24211e289e4c24
+plan14-root-reads-warm-set-published-724.tsv 7b66ce2635ec5a372f5298ccc83749acafd5c662db8241c28b2ec1f9aff63c8a
diff --git a/internal/provision/testdata/plan14-root-reads-warm-set-published-724.tsv b/internal/provision/testdata/plan14-root-reads-warm-set-published-724.tsv
new file mode 100644
index 000000000..0611ada8c
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-warm-set-published-724.tsv
@@ -0,0 +1,8 @@
+# Census overlay warm-set-published-724, written by census-propose (#369). census-ruling-warm-set-published-724, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-warm-set-published-724.md.
+# 1 body, 1 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@legacy da167273bdf3659de3c3d40331dfa7c2a72dfcaea84b2c1489abca848a9f3110 internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside, so it lists fewer names, never more. No read added, same 5 sites. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 2dc64b1405b94ea073dcef2714368eb00a0b3e6738c319847f59aecb24e159cd
+internal/edge/edge.go RunWithActivatorReady legacy accepted-legacy accepted-legacy;rev3=J4;basis=root-input;rev3=census-ruling-certwarm-wake;basis=registers the cert warm's nudge on OnReload and on the home map's new served-hosts wake (#386); nudge only sends on a buffered channel; no read added, same 5 sites;rev3=census-ruling-edge-roll-blip;basis=the :80/:443 (and dev) listeners are bound on the calling goroutine with net.Listen via listen()/listenAddr (same empty-address defaults as ListenAndServe) before the serve goroutines, which now call Serve/ServeTLS on them, and one log line names the bound addresses; no read added, same 5 sites;rev3=census-ruling-edge-held-streams;basis=the edge in the agent (carlos-edge.service, user carlos): the inline home-map arming (newHomeMap, one boot Refresh, Store, run) moves unchanged into the new Edge.ArmHomeMap and is called here as e.ArmHomeMap(); same refresh, same timeout, same order. The reads are moved, none added.;rev3=census-ruling-agent-start-demo-1;basis=Logs the combined explicit wildcard parents through demoWildcardDomains; no new watcher or read loop.;rev3=census-ruling-region-ha-p3a;basis=P3a Task 3: invoke the local admission Close before HTTP/HTTPS draining and door shutdown in both dev and normal listeners. Preserve merged main's startup behavior and its census basis; the same five read sites, no new reads.;rev3=census-ruling-stateless-replicas-3;basis=Task 1b: defer stopping and joining the edge's replica jobs at shutdown. Existing five direct read sites unchanged; no new reader or authority.;rev3=census-ruling-region-ha-p3b;basis=Wrap dev, HTTP and HTTPS listeners through ConfigureGroupHairpin before serving. Indirectly read protected root boot identity and group-ingress.json; kernel local/peer addresses mark local ingress, never HTTP headers. Agent edge uses verified public source for accounting; direct read sites unchanged and absent marker keeps original listeners. CI fix removes interface enumeration: local peer must match snapshot primary IPv4, an ingress IPv4 installed locally by root, or loopback; kernel destination must still be an ingress EIP on port 80/443. Merge 45cebde4 retains deferred stopReplicaProbes alongside group listener wrapping and shutdown admission closure.;rev3=census-ruling-demo-api-site-route;basis=Change the startup failure context from load routes to initialize because origin validation now runs during construction. Existing five read sites unchanged; no new read or runtime authority.;rev3=census-ruling-region-ha-graceful-terminate-t2;basis=Invoke the agent shutdown timestamp hook synchronously at SIGTERM/SIGINT receipt before closing admission in dev and TLS paths. No read added.;rev3=census-ruling-region-ha-held-build;basis=region HA held-requests Task 5: registers the https and http servers with the connection drain (conns.serve) so a drain can close idle keep-alive connections; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the inline cert warm construction (newCertWarm over warmSet and dnsGate, then OnReload and setServedWake registering warm.nudge) moves unchanged into the new Edge.newIssuerWarm in certwarm.go and is called here with the same apps domain, parents, perHostCert, warmResolver, edgeIPs and store; the loop still starts here. The warm set it wires now reads the published edges files through the home map (OwnServedHosts and ServedHosts, both already polled) instead of the local route table, regional names aside, so it lists fewer names, never more. No read added, same 5 sites. data-literal@129,data-literal@148,data-literal@284,data-literal@417,file:Open@1013 2dc64b1405b94ea073dcef2714368eb00a0b3e6738c319847f59aecb24e159cd
+internal/host/edgesfile.go edgesFileWriteClaims authority F,J1 rev3=census-ruling-self-serve-moves-1;basis=root-route;kept=F;scope=protected-decision-only; the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): region-ha-2a's body, which with the box's lifetimes switch on also publishes each served row's lifetime pair (registry:Incarnation and registry:ServingSeq, two new sites on the rows it already lists) and an alias's or served catch-all's primary's pair, and names that primary as target_host whatever the switch; a report the edge orders unstamped entries by, not a decision; no record, /data, release or claim read added; F,J1 authority retained; self-serve moves 1 Task 8;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328 plan 2 Task 8: takes a localAddrs reader (instancectl.LocalAddresses in production, which reads /proc/net/fib_trie and /proc/net/if_inet6 in the agent) and publishes its non-loopback entries as the edges file's addrs before the write gate (boxAddrs, no read of its own), so an address change writes once. The same 44 sites, offsets moved; no record, /data, release or claim read added; a report the console's egress grant check reads, not a root decision; F,J1 authority retained.;rev3=census-ruling-edge-asset-cache-3;basis=starts with assets = assets.active(), so a policy whose box has not opened its asset store publishes no assets blocks and reads no manifests, and copies the decision's Primary (the route host the block was decided for, drift D4) into the published assets block; read sites unchanged (44); no read added. Merged onto main's #328 body, which takes the localAddrs reader: the assets.active() line sits after that signature and the loop passes pub and instancectl.LocalAddresses;rev3=census-ruling-region-ha-p1a;basis=the agent as carlos: the claims argument (*edgesClaims) becomes addrs (AddressSource) and the applyEdgesClaims(ctx, claims, routes, hosts) call is deleted with edgesclaims.go, which is the one whole:Route site removed: no host claim is read and every served row publishes as with region HA off; the box-address publication is the same code reading addrs.BoxAddresses() instead of claims.addrs; a report the edge reads, not a root decision; no read added; merge of origin/main d7ae1d76: main's edge asset cache plan 3 body is kept (census-ruling-edge-asset-cache-3): the first line is assets = assets.active(), so a policy whose store has not opened publishes no assets blocks and reads no manifests, and edgesFileLoop passes pub (assets.active() for that tick) in the assets argument; main's claims *edgesClaims argument is this branch's addrs AddressSource, and no edgesClaims, applyEdgesClaims or hostclaim reference remains;rev3=census-ruling-alias-wake-338;basis=#338 follow-up: skips publishing a platform alias edge.PlatformAliasFold refuses (and so anything attached to it); reads the same route listing;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 and its fix rounds: publishes by FleetArmVerdict (via fleetRefusedFor): withheld rows left out; a forward host's path rows left out of its owner; no assets for forward rows; the alias loop replays Reload's alias fold from the served rows so a chained alias carries its root primary's owner; certRefused and parentRefused leave out a refused claim's wildcard parent (+registry:Alias x5, +registry:Host x4, +whole:Route, +whole:RouteAlias x2, +whole:RoutePath x7, +whole:WildcardDomain). Rows already read in the pass; keeps authority F,J1; publishes less, never more.;rev3=census-ruling-probe-burst-limit;basis=sets the constant BurstNotices=true on the box's own edges file (this build's edge answers probe-burst notices, so peers may send them); not from config or any read; the same 65 sites; a report other edges read, not a root decision; F,J1 authority retained; no new root read or write kind;rev3=census-ruling-region-ha-p3a;basis=Publish one injected role snapshot with box_role/admitted/drained; retain legacy route and alias rows during booting, cutting namespace withdrawal under the 2026-11-04 ruling; acknowledge the exact published tuple only after PUT; existing registry reads unchanged.;rev3=census-ruling-region-ha-p2b;basis=region HA P2b-1 T0 (Q1 ruling): before building the comparison copy and the body, a nil NamedPools on the identity becomes []string{} so the additive named_pools field is always an explicit array; the list itself is computed once at arm by edgesFileEligibility from the same provisionTickConfig(os.Getenv) parse as serves_shared_pool (CARLOS_POOLS through provision.ParseBoxPools, filtered to nonempty provision.ValidPool names, sorted, unique). A report the console reads for create admission, not a root decision; no record, /data, release or claim read added; read sites unchanged (65); F,J1 authority retained. One-off cost: the first pass after the upgrade writes once per box (seeded gate null vs []).;rev3=census-ruling-region-ha-p3b;basis=Require cached GroupReadersReady before first group publication and append additive names-2 capability even for supplied identities. Agent writes the same edges object/index with existing registry reads; known readers come from root boot configuration, snapshot from existing fold, no added GET/LIST or root authority.;rev3=census-ruling-region-ha-g2-fixes;basis=Omit non-forward, non-platform-alias rows outside local served pools from home publication; added Host/Pool field reads and local configuration use, existing registry/store operations retained.;rev3=census-ruling-edge-page-cache-1;basis=prunes the manifest cache through the new atomic pointer (assets.manifests.Load().prune(...), nil-safe); nothing else changes; read sites unchanged (67); no read added;rev3=census-ruling-region-ha-held-build;basis=writes also when DrainPublishRequired, and reports the written drain state, its ha_drain mark (transaction and publication id) and generation to DrainSource (in-memory); the file gains ha_drained and ha_drain beside the existing draining; no read added. held-requests Task 4: sets the constant ha_take=1 on the box's own file when its in-memory capabilities include region-ha-1 (this build's edge answers take requests); not from config or any read; a report other edges read, not a root decision; no read added;rev3=census-ruling-warm-set-published-724;basis=#724: the agent as carlos: reads PLATFORM_APPS_DOMAIN from the environment once per pass (the variable domainsLoop already reads) and sets an additive dns_pointing mark on each published custom name through dnsPointingMark: true on a published alias (registry:Alias, already published only when its dns_status is pointing), and on a route with a hostname outside the apps domain whether its registry:DNSStatus is pointing (registry:Host, registry:DNSStatus on rows the pass already lists). No mark under the apps domain, on a wildcard row, or with no apps domain set. A report the issuer cert warm reads to leave a not-yet-pointing custom name out of its set, not a root decision; it publishes the same names as before. No record, /data, release or claim read added; no new registry query; F,J1 authority retained. One-off cost: the first pass after the upgrade writes once on a box homing a custom name. registry:Account@16743,registry:Alias@10183,registry:Alias@10340,registry:Alias@10410,registry:Alias@10442,registry:Alias@11186,registry:Alias@11396,registry:Alias@14216,registry:Alias@14266,registry:Alias@9544,registry:Alias@9563,registry:Alias@9662,registry:Alias@9716,registry:Alias@9751,registry:Alias@9813,registry:App@16755,registry:DNSStatus@10349,registry:DNSStatus@5731,registry:DNSStatus@9858,registry:Host@14119,registry:Host@14139,registry:Host@14404,registry:Host@14484,registry:Host@14519,registry:Host@14568,registry:Host@15030,registry:Host@15065,registry:Host@16173,registry:Host@4188,registry:Host@4279,registry:Host@4325,registry:Host@4384,registry:Host@5723,registry:Host@5970,registry:Host@6940,registry:Host@9589,registry:Host@9637,registry:Incarnation@5930,registry:Platform@5238,registry:Pool@4239,registry:Provisioned@5252,registry:Replica@5276,registry:ServingSeq@5945,registry:Status@2957,whole:Route@1026,whole:Route@18213,whole:Route@1841,whole:Route@19038,whole:Route@19213,whole:Route@2327,whole:Route@7025,whole:Route@750,whole:RouteAlias@14170,whole:RouteAlias@18235,whole:RouteAlias@19228,whole:RouteAlias@9427,whole:RouteAlias@9509,whole:RouteAlias@9701,whole:RoutePath@18228,whole:RoutePath@19221,whole:RoutePath@6809,whole:RoutePath@6841,whole:RoutePath@6888,whole:RoutePath@6916,whole:RoutePath@6954,whole:RoutePath@6974,whole:RoutePath@6986,whole:RoutePath@7040,whole:WildcardDomain@14097,whole:WildcardDomain@14473 5b2180cec383f62ccb24a32a8eff30ab462eaab4d13f4b7b0503fc639a0c6b49
+@coverage internal/edge 0c1bfcbd72e4de798f83d4d7c5167e3bad47f412462a53453a23e862299e287f
+@coverage internal/edgesfile 55e261de1c2527dade77aefaefd3515595bfccb7c6bbaeec246c5ab1308047dc
+@coverage internal/host 6e65359f159ffa837e000c1506df6545f7f47857a0e29f73338c0b0338d50201