carlos / platform Public

edge: wildcard certificate for account subdomains (T4)

parentsFor gains a names argument (sqid to held subdomain). Every sqid
parent it derives from a route host also brings <name>.<apps-domain>,
so an account holding harbour gets one *.harbour.<apps-domain>
certificate for its derived hosts, ordered and served the same way as
its sqid wildcard (spec 4.6). A name rides on the sqid's routes: no
app host under the sqid, no name parent. Names outside the subdomain
shape never become parents.

newWildcardFromEnv reads account_namespaces from the edge's own
registry handle (as ListWildcardDomains; not the read-only worker) and
keeps the last good names on a read error. refresh() inverts them,
taking the lexically first name if an account somehow has two, as
domains.AccountNamespaces does. A box without PLATFORM_APPS_DOMAIN
gets no names reader and derives no name parent.

The table is in the registry fingerprint, so the watcher's reload hook
re-derives when a name is held or released; a test drives that path on
an edge whose only route under the sqid is homed on another box.

Census: newWildcardFromEnv body change and the internal/edge envelope
added to the account-subdomains overlay (census-propose; not approved).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev e649e9bb372ecef2bcb4f0613d6bc8eaeb6a7486 parent 9dd75d5
7 files changed, +278 −12
  • docs/superpowers/notes/census-proposal-account-subdomains.md +4 −2
  • internal/edge/steeringprobe_test.go +2 −2
  • internal/edge/wildcard.go +70 −2
  • internal/edge/wildcard_parents_test.go +193 −0
  • internal/edge/wildcard_test.go +4 −4
  • internal/provision/testdata/plan14-root-reads-account-subdomains.tsv +4 −1
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −1

Intent

Human

<task-notification> <task-id>a76f9b72723e31697</task-id> <tool-use-id>toolu_01FG2R1CuuWBvdL6jvWDBnwc</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/a76f9b72723e31697.output</output-file> <status>completed</status> <summary>Agent "Implement Task 3: boxes derive names" 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>Status: DONE_WITH_CONCERNS I committed `9dd75d5d domains: repair kept-name exact claims too, round 2 (T3)` on top of d7b78504. The status repair now checks names that are held and names kept because their namespace body did not read. So an exact claim in the derived shape, made while its name is kept, ends up "pointing" and is published. Tests: I added two regressions for that exact case, one in `internal/domains` and one through the edges file in `internal/host`. Both fail on d7b78504 and pass now. The covering domains runs, the host edges-file and group-name tests, and both census guards pass. Concerns: - **Root-read census needs a new ruling:** the change moved `repairNamespaceStatus`, so I re-ran the proposal under `account-subdomains` (seal `b3d35a0b…` → `25410e0f…`). I did not approve it. Astra's earlier approval was for the previous proposal, so it needs ruling again. - **Group-name census:** I re-pinned `repairNamespaceStatus` there as well. Report (round 2 appended): /home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/.superpowers/sdd/2026-11-11-account-subdomains/task-3-report.md</result> <usage><subagent_tokens>345603</subagent_tokens><tool_uses>9</tool_uses><duration_ms>383507</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bnhcbqjrp</task-id> <tool-use-id>toolu_01BQ5e2hYmxavcHbEKJg9vZJ</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/bnhcbqjrp.output</output-file> <status>completed</status> <summary>Background command "Run Astra re-review of T3 round-2 fix" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 16.3 g CO₂e (2,109,630 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-account-name-hosts, 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-account-subdomains.md b/docs/superpowers/notes/census-proposal-account-subdomains.md
index 02a61ed68..41d78f342 100644
--- a/docs/superpowers/notes/census-proposal-account-subdomains.md
+++ b/docs/superpowers/notes/census-proposal-account-subdomains.md
@@ -4,6 +4,7 @@ Ruling `census-ruling-account-subdomains`. The independent reviewer approves or
| unit | change | read sites | what changed |
|---|---|---|---|
+| `internal/edge/wildcard.go` `newWildcardFromEnv` | body | unchanged (3) | with PLATFORM_APPS_DOMAIN set, also gives the wildcard manager a names reader: the edge's own registry handle's ListAccountNamespaces (the box's own registry database, as carlos, as ListWildcardDomains beside it), keeping the last good names on a read error; refresh() inverts them to sqid -> name and parentsFor adds <name>.<apps-domain> as a parent only beside a sqid parent it already derives from a route host, and only for a name in the subdomain shape; no apps domain, no reader; same read sites (body change only); no file, path, command or bucket read added |
| `internal/host/agent.go` `aliasPassReportingComplete` | body | unchanged (5) | sets AliasReport.AppsDomain from PLATFORM_APPS_DOMAIN (trimmed), the variable domainsTickConfig reads; same reads and calls otherwise; body change only |
| `internal/domains/aliases.go` `ReconcileAliasesReport` | sites | +whole:Route ×3, +whole:RouteAlias ×3 | with AliasReport.AppsDomain set, reads the box's own account_namespaces table (reg.ListAccountNamespaces), sorts a listed-but-unread namespace claim (ParseNamespaceHost on the dropped host): a not-found body keeps nothing and is not counted by relevantDropped, any other failure keeps that name's recorded rows; runs deriveNamespaceAliases after deriveInstanceAliases on the routes, alias rows and claims it already read (AccountNamespaces over the read claims), keepNamespaceAliases for unread names, and writes the table through writeAccountNamespaces (once, only when it differs; no shrink under StartupNoRemoval); the added sites are the routes and alias rows already read handed to those helpers; no file or bucket read added; fix round 1: keepNamespaceAliases runs before deriveNamespaceAliases, and repairNamespaceStatus stamps "pointing" on derived-shape rows of exact claims and kept names, over claims and rows already read |
| `internal/domains/aliases.go` `deriveInstanceAliases` | sites | +registry:Alias | takes a *int budget shared with the namespace pass instead of a local counter; the same checks and cap (maxInstanceAliases, now a var so a test can lower it); names kept on a failed instance listing now take the budget too, each once (fix round 1, Astra I-2), so the cap holds on that branch; same reads; body change only; derives and keeps less, never more |
@@ -11,12 +12,13 @@ Ruling `census-ruling-account-subdomains`. The independent reviewer approves or
| `internal/registry/registry.go` `Registry.Fingerprint` | sites | +file:Query | hashes account_namespaces (name, account) over the same fresh connection, with a section marker written only when a row exists, so a registry with no held names digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision |
| `internal/registry/registry.go` `Registry.migrate` | sites | +file:Exec, +registry:sql | one more CREATE TABLE IF NOT EXISTS account_namespaces (name TEXT PRIMARY KEY, account TEXT NOT NULL), an in-binary literal (+file:Exec, +registry:sql); additive, no existing statement changed |
-Envelopes re-pinned: `internal/domains`, `internal/host`, `internal/registry`.
+Envelopes re-pinned: `internal/domains`, `internal/edge`, `internal/host`, `internal/registry`.
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/wildcard.go` `newWildcardFromEnv`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-1;basis=Includes the configured demo domain in the existing wildcard manager's explicit parent input.;rev3=census-ruling-region-ha-g2r-fixes;basis=W2a: on a gated box (issuer gate armed: store and mirror exist) with no DNS provider, builds a serve-only wildcard manager that loads and serves wildcard PEMs from the existing local cache/mirror and never orders (dns nil never reaches obtain). Ungated boxes still get nil. Same parent inputs; no new path or provider credential read.
- `internal/host/agent.go` `aliasPassReportingComplete`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=Extract the existing serialized alias pass, add cancellable locking and routing-only alias/regional publication from its completeness report; existing deployment/claim/registry reads retained, new in-memory Route/RegionalDomain passes.;rev3=census-ruling-fix-incomplete-domains-pass;basis=gains a startup bool parameter that it copies into domains.AliasReport.StartupNoRemoval; runHAIngressStartup passes true, aliasPassReporting (the ordinary agent pass) passes false; same reads and calls, body change only; no root pass calls it; no root decision
- `internal/domains/aliases.go` `ReconcileAliasesReport`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-edge-asset-cache-1;basis=the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos), in its alias pass (aliasPassReporting in runAgent; ReconcileAliases, now a wrapper, is its other caller): main's ReconcileAliases body, moved here with the same reads and writes, plus a completeness report (AliasReport) set false at every point that already logged a failure and carried on, and when relevantDropped names a listed claim the pass could not rule out; the box's asset authority clock advances only after a complete pass; one more whole:Route and whole:RouteAlias site each, the routes and alias rows the pass already read handed to relevantDropped; no registry, file or bucket read added; no root pass calls it; no root decision;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: in the alias pass inside the agent: reads the existing regional_domains rows (reg.ListRegional) beside the alias rows, derives a regional claim's rows through deriveRegional for AliasReport.Region (the caller's ReconcileConfig.Region, set by aliasPassReporting) and its wildcard parent when bound, skipping the alias, paths and catch-all halves for it, writes them through writeRegional, and keeps an unread regional claim's wildcard parent while the kept apex row still binds a target RegionalTarget accepts on the routes this pass read (same account and app, per-box cap); claims are read as before (the listing and per-claim GETs it already does); the added reads are the registry's regional rows and fields of rows the pass already holds;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): Task 6 fix rounds 2-3: AliasReport.FleetRefused (edge.FleetArmVerdict's refused set) is called once on the pass's own listing; a Wildcard claim whose primary is fleet-refused derives no wildcard_domains row (an earlier one goes with the ordinary removal); the catch-all alias is derived as before (+registry:Host, +whole:Route). Rows already read; writes less, never more; no root pass calls it.;rev3=census-ruling-region-ha-g2-fixes;basis=Project accepted regional exact/catchall names and plain/delegated aliases into routing-only reports using existing claims and pre-pool metadata; new whole Route/RegionalDomain uses, no new external reader.;rev3=census-ruling-fix-incomplete-domains-pass;basis=adds AliasReport.StartupNoRemoval, an input set only by the agent startup HA ingress pass (host startupAliasPass via runHAIngressStartup): when set, the pass skips the route_aliases, wildcard_domains and route_paths removals (each skipped removal marks the pass incomplete) and the removal rules themselves are unchanged; derivations, refusals and writes are unchanged; same read sites (body change only); no new registry, file or bucket read; deletes less, never more, and only on the startup pass; no root pass calls it; no root decision
- `internal/domains/aliases.go` `deriveInstanceAliases`: legacy, task accepted-legacy. Basis: accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=root-route; the agent (/opt/carlos/carlos agent, carlos-edge.service, user carlos): rev3=J1's body; a stale body under a retired lifetime no longer makes a label shared, and a label with a record that cannot be judged keeps its existing alias row of the catch-all's own account and app (reading that row's Account and App) only once the derived name has passed every precedence check a derived name answers to (validity, an exact claim, a local real route, a deployment route, the per-box cap), and derives no new one; a report-only conservative keep, never a new route;rev3=census-ruling-regional-domains-447;basis=#447 Task 2: an instance catch-all whose parent claim is regional is inert (logged once, continue), as one whose parent is not held is; it only narrows what derives; no read added
@@ -35,6 +37,6 @@ New dispositions, which census-propose wrote and the reviewer checks against the
- other `changed registry schema`: closed only if it is the registry schema (re-pinned)
- reads `internal/registry/remote_dispatch.go:Registry.dispatchRemote`: +registry:Names, +registry:StringMap; keeps hint, task E2
-Seal: `b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369` → `25410e0f5ffa3bae361a8af9a45667b46dd948793351748155f78b61cbbe8c55`.
+Seal: `b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369` → `dde10a6f5fe44a4be206275f883b6613c9eeb850f184132d93136fc5e84d9134`.
Overlay: `internal/provision/testdata/plan14-root-reads-account-subdomains.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/internal/edge/steeringprobe_test.go b/internal/edge/steeringprobe_test.go
index ce3313065..dfb590154 100644
--- a/internal/edge/steeringprobe_test.go
+++ b/internal/edge/steeringprobe_test.go
@@ -163,7 +163,7 @@ func TestSteeringArmsTheAppsDomainWildcardParent(t *testing.T) {
if len(w.staticDomains) != 0 {
t.Fatalf("unsteered staticDomains = %v, want none (the apps domain must not become a parent)", w.staticDomains)
}
- if got := parentsFor(w.staticDomains, w.appsDomain, nil); len(got) != 0 {
+ if got := parentsFor(w.staticDomains, w.appsDomain, nil, nil); len(got) != 0 {
t.Fatalf("unsteered parents = %v, want none", got)
}
@@ -179,7 +179,7 @@ func TestSteeringArmsTheAppsDomainWildcardParent(t *testing.T) {
t.Fatalf("steered staticDomains = %v, want [oncarlos.com]", w.staticDomains)
}
// The parent has to cover the probe name exactly.
- w.parents = parentsFor(w.staticDomains, w.appsDomain, nil)
+ w.parents = parentsFor(w.staticDomains, w.appsDomain, nil, nil)
cert, _ := selfSignedWildcard(t, "oncarlos.com", time.Now().Add(time.Hour))
w.certs["oncarlos.com"] = cert
if w.certFor("edge.oncarlos.com") == nil {
diff --git a/internal/edge/wildcard.go b/internal/edge/wildcard.go
index e67c2f328..161bc14fb 100644
--- a/internal/edge/wildcard.go
+++ b/internal/edge/wildcard.go
@@ -39,6 +39,7 @@ import (
"errors"
"fmt"
"log"
+ "maps"
"net"
"os"
"sort"
@@ -85,6 +86,12 @@ type wildcardManager struct {
// challengeFQDN under mu (issuance runs on run()'s goroutine).
delegatedSet map[string]bool
+ // names reads the held account subdomains (account subdomains spec
+ // §4.6) as the registry keeps them: name to account sqid. nil = none,
+ // which is every box without an apps domain (newWildcardFromEnv). Like
+ // delegated, a failed read answers the last good set.
+ names func() map[string]string
+
// refreshMu serializes refresh() (see there); mu guards the fields.
refreshMu sync.Mutex
mu sync.Mutex
@@ -200,7 +207,16 @@ var (
// shared ACME budget (#215). The console refuses such first routes for
// sqid-shaped labels that are not the attaching account's own; this is the
// edge's half, for the labels no account could hold.
-func parentsFor(staticAndDelegated []string, appsDomain string, hosts []string) []string {
+//
+// names maps an account sqid to the subdomain it holds (account subdomains
+// spec §4.6). Every sqid parent this derives from a route host also brings
+// <name>.<appsDomain> when names has one for it, so the account gets one
+// *.<name>.<appsDomain> certificate for its derived <app>.<name> hosts. The
+// name rides on the sqid's routes: an account with no app host here has no
+// name parent either, and a name not in the subdomain shape
+// (domains.NormalizeSubdomain) is never a parent. No apps domain, no name
+// parents.
+func parentsFor(staticAndDelegated []string, appsDomain string, hosts []string, names map[string]string) []string {
seen := map[string]bool{}
var out []string
add := func(p string) {
@@ -221,6 +237,9 @@ func parentsFor(staticAndDelegated []string, appsDomain string, hosts []string)
}
if labels := strings.Split(rest, "."); len(labels) == 2 && domains.ValidSqid(labels[1]) {
add(labels[1] + suffix)
+ if name, ok := domains.NormalizeSubdomain(names[labels[1]]); ok && name == names[labels[1]] {
+ add(name + suffix)
+ }
}
}
}
@@ -228,6 +247,24 @@ func parentsFor(staticAndDelegated []string, appsDomain string, hosts []string)
return out
}
+// namesBySqid inverts the registry's held names (name to sqid) into the
+// sqid-to-name map parentsFor takes, skipping a name not in the subdomain
+// shape or an empty sqid. The door leaves an account at most one name;
+// should the table still give one account two, the lexically first wins,
+// as in domains.AccountNamespaces, so every box picks the same one.
+func namesBySqid(byName map[string]string) map[string]string {
+ out := make(map[string]string, len(byName))
+ for name, sqid := range byName {
+ if n, ok := domains.NormalizeSubdomain(name); !ok || n != name || sqid == "" {
+ continue
+ }
+ if cur, ok := out[sqid]; !ok || name < cur {
+ out[sqid] = name
+ }
+ }
+ return out
+}
+
// refresh recomputes the parent set from the live route table (called from
// the reload hook on every route swap, and once at startup), folding in
// delegated parents (spec §4) alongside the static and per-account ones.
@@ -273,7 +310,14 @@ func (w *wildcardManager) refresh() {
delegated = append(delegated, d)
}
}
- parents := parentsFor(append(append([]string(nil), w.staticDomains...), delegated...), w.appsDomain, w.hosts())
+ // Held names (account subdomains spec §4.6), read here on every pass
+ // like delegated() above. A box with no apps domain derives none, even
+ // from a table left in its registry.
+ var names map[string]string
+ if w.names != nil && w.appsDomain != "" {
+ names = namesBySqid(w.names())
+ }
+ parents := parentsFor(append(append([]string(nil), w.staticDomains...), delegated...), w.appsDomain, w.hosts(), names)
now := time.Now()
w.mu.Lock()
w.parents = parents
@@ -962,6 +1006,30 @@ func newWildcardFromEnv(e *Edge, cache autocert.Cache) *wildcardManager {
// box homes, #300), so a region edge derives the account parents of apps
// it only ever backhauls to — and loads their mirrored wildcards.
w := newWildcardManager(static, appsDomain, e.deploymentHosts, delegated, zone, cache, dns)
+ // Held account subdomains (account subdomains spec §4.6): the alias pass
+ // writes account_namespaces, its contents move the registry fingerprint,
+ // so the reload hook re-derives the moment a name is held or let go.
+ // Read straight from this edge's own registry handle, as
+ // ListWildcardDomains above. A read error answers the last good names,
+ // for the reason the delegated reader gives. Only under an apps domain:
+ // without one the table may be stale and no name is a parent.
+ if appsDomain != "" {
+ var (
+ namesMu sync.Mutex
+ lastNames map[string]string
+ )
+ w.names = func() map[string]string {
+ byName, err := e.reg.ListAccountNamespaces()
+ namesMu.Lock()
+ defer namesMu.Unlock()
+ if err != nil {
+ log.Printf("edge: account subdomains read failed: %v; subdomain parents unchanged this pass", err)
+ return maps.Clone(lastNames)
+ }
+ lastNames = byName
+ return maps.Clone(byName)
+ }
+ }
// DNS-01 orders are gated on the same election per-host HTTP-01 orders
// are (certsync.go): one issuer per deployment, whichever protocol the
// name needs. The cache handle is already the publishing one, so the
diff --git a/internal/edge/wildcard_parents_test.go b/internal/edge/wildcard_parents_test.go
index 9bc2fa747..e06aebacb 100644
--- a/internal/edge/wildcard_parents_test.go
+++ b/internal/edge/wildcard_parents_test.go
@@ -463,3 +463,196 @@ func TestUnionDelegatedCapsAndWarns(t *testing.T) {
t.Fatalf("local-only case logged or changed: %v / %s", got, buf.String())
}
}
+
+// ---- account subdomains (spec §4.6) -----------------------------------------
+
+// A held name is a wildcard parent beside its account's sqid parent: one
+// *.harbour.<apps> certificate covers every derived <app>.harbour.<apps>.
+func TestParentsForAddsHeldName(t *testing.T) {
+ got := parentsFor(nil, "apps.test", []string{"shop.bdq.apps.test"}, map[string]string{"bdq": "harbour"})
+ if want := []string{"bdq.apps.test", "harbour.apps.test"}; !reflect.DeepEqual(got, want) {
+ t.Fatalf("parents = %v; want %v", got, want)
+ }
+ // Case and a static parent change nothing about the rule.
+ got = parentsFor([]string{"go.tito.io"}, "Apps.Test", []string{"SHOP.BDQ.apps.test", "blog.bdq.apps.test"}, map[string]string{"bdq": "harbour"})
+ if want := []string{"bdq.apps.test", "go.tito.io", "harbour.apps.test"}; !reflect.DeepEqual(got, want) {
+ t.Fatalf("parents = %v; want %v", got, want)
+ }
+}
+
+// No name, another account's name, a name in no name shape, or no apps
+// domain: the sqid parents only.
+func TestParentsForNoNameNoExtraParent(t *testing.T) {
+ hosts := []string{"shop.bdq.apps.test"}
+ for _, names := range []map[string]string{
+ nil,
+ {},
+ {"bcd": "harbour"},
+ {"bdq": ""},
+ {"bdq": "bad.name"},
+ {"bdq": "-harbour"},
+ {"bdq": "xn--harbour"},
+ {"bdq": "Harbour"},
+ } {
+ if got, want := parentsFor(nil, "apps.test", hosts, names), []string{"bdq.apps.test"}; !reflect.DeepEqual(got, want) {
+ t.Errorf("names %v: parents = %v; want %v", names, got, want)
+ }
+ }
+ // A box with no apps domain derives no name parent (a table Task 3 left
+ // as it was there may be stale).
+ if got := parentsFor([]string{"go.tito.io"}, "", hosts, map[string]string{"bdq": "harbour"}); !reflect.DeepEqual(got, []string{"go.tito.io"}) {
+ t.Fatalf("no apps domain: parents = %v", got)
+ }
+}
+
+// A name follows its account's routes: an account with no app host here
+// (or only a canary host, one label too deep) has no sqid parent, so its
+// name has none either.
+func TestParentsForNameWithoutRoutes(t *testing.T) {
+ names := map[string]string{"bdq": "harbour"}
+ for _, hosts := range [][]string{
+ nil,
+ {"shop.bcd.apps.test"},
+ {"canary.shop.bdq.apps.test"},
+ {"bdq.apps.test"},
+ {"shop.bdq.example.com"},
+ } {
+ got := parentsFor(nil, "apps.test", hosts, names)
+ for _, p := range got {
+ if p == "harbour.apps.test" {
+ t.Errorf("hosts %v: parents %v include the name with no route under bdq", hosts, got)
+ }
+ }
+ }
+}
+
+// namesEdge is a two-box edge whose only bdq route is homed on betty, over
+// a real registry, with the wildcard manager built from the environment.
+func namesEdge(t *testing.T, appsDomain string) (*Edge, *registry.Registry, *wildcardManager) {
+ t.Helper()
+ e, _, _ := remoteHomedEdge(t, nil)
+ platformHomedOn(t, e.homes.Load(), "betty", "2.2.2.2", "shop.bdq.apps.test")
+ reg, err := registry.Open(filepath.Join(t.TempDir(), "registry.db"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { reg.Close() })
+ e.reg = reg
+ t.Setenv("CARLOS_WILDCARD_DOMAINS", "go.tito.io")
+ t.Setenv("PLATFORM_APPS_DOMAIN", appsDomain)
+ t.Setenv("CARLOS_DNS_PROVIDER", "route53")
+ t.Setenv("CARLOS_ACME_DELEGATION_ZONE", "")
+ w := newWildcardFromEnv(e, autocert.DirCache(t.TempDir()))
+ if w == nil {
+ t.Fatal("want a manager")
+ }
+ return e, reg, w
+}
+
+// A failed read of the names keeps the last names read, as the delegated
+// reader does: a transient registry error must not drop a parent whose
+// certificate is loaded and serving.
+func TestRefreshKeepsLastGoodNamesOnReadError(t *testing.T) {
+ _, reg, w := namesEdge(t, "apps.test")
+ if err := reg.SetAccountNamespaces(map[string]string{"harbour": "bdq"}); err != nil {
+ t.Fatal(err)
+ }
+ w.refresh()
+ want := []string{"bdq.apps.test", "go.tito.io", "harbour.apps.test"}
+ if got := w.currentParents(); !reflect.DeepEqual(got, want) {
+ t.Fatalf("parents = %v; want %v", got, want)
+ }
+ reg.Close() // every read fails from here
+ if _, err := reg.ListAccountNamespaces(); err == nil {
+ t.Fatal("test bug: the read was supposed to fail")
+ }
+ w.refresh()
+ if got := w.currentParents(); !reflect.DeepEqual(got, want) {
+ t.Fatalf("after a failed read: parents = %v; want %v (last good names kept)", got, want)
+ }
+}
+
+// A box without an apps domain derives no name parent, even with a table
+// in its registry, and never reads it.
+func TestWildcardNamesNeedAppsDomain(t *testing.T) {
+ _, reg, w := namesEdge(t, "")
+ if err := reg.SetAccountNamespaces(map[string]string{"harbour": "bdq"}); err != nil {
+ t.Fatal(err)
+ }
+ if w.names != nil {
+ t.Fatal("a manager with no apps domain has a names reader")
+ }
+ w.refresh()
+ if got := w.currentParents(); !reflect.DeepEqual(got, []string{"go.tito.io"}) {
+ t.Fatalf("parents = %v; want the static parent only", got)
+ }
+}
+
+// Two names left on one account (a store-mode write the door would have
+// refused) resolve as domains.AccountNamespaces does: the lexically first.
+func TestNamesBySqidPicksLexicallyFirst(t *testing.T) {
+ got := namesBySqid(map[string]string{"quay": "bdq", "harbour": "bdq", "bad.name": "bcd", "marina": "bcd", "": "bdq", "dock": ""})
+ if want := map[string]string{"bdq": "harbour", "bcd": "marina"}; !reflect.DeepEqual(got, want) {
+ t.Fatalf("namesBySqid = %v; want %v", got, want)
+ }
+}
+
+// The production path, end to end, on an edge whose only bdq route is homed
+// on another box: the alias pass writing the name moves the registry
+// fingerprint, the watcher reloads, the reload hook re-derives, and the
+// name's parent arrives; removing the name takes it away again.
+func TestNamespaceChangeRefreshesParentsOnRemoteOnlyEdge(t *testing.T) {
+ reg, err := registry.Open(filepath.Join(t.TempDir(), "registry.db"))
+ if err != nil {
+ t.Fatal(err)
+ }
+ t.Cleanup(func() { reg.Close() })
+ e, err := New(reg, nil)
+ if err != nil {
+ t.Fatal(err)
+ }
+ hm := newHomeMap(meshTestStore(t), "annie")
+ platformHomedOn(t, hm, "betty", "2.2.2.2", "shop.bdq.apps.test")
+ e.homes.Store(hm)
+ if e.Allowed("shop.bdq.apps.test") {
+ t.Fatal("test bug: the bdq route is supposed to be remote only")
+ }
+ t.Setenv("CARLOS_WILDCARD_DOMAINS", "")
+ t.Setenv("PLATFORM_APPS_DOMAIN", "apps.test")
+ t.Setenv("CARLOS_DNS_PROVIDER", "route53")
+ t.Setenv("CARLOS_ACME_DELEGATION_ZONE", "")
+ w := newWildcardFromEnv(e, autocert.DirCache(t.TempDir()))
+ if w == nil {
+ t.Fatal("want a manager")
+ }
+ e.OnReload(w.refresh)
+ w.refresh()
+ if got := w.currentParents(); !reflect.DeepEqual(got, []string{"bdq.apps.test"}) {
+ t.Fatalf("seed parents = %v", got)
+ }
+
+ tick := make(chan time.Time)
+ e.watchTick = tick
+ stop, done := make(chan struct{}), make(chan struct{})
+ go func() {
+ e.Watch(stop)
+ close(done)
+ }()
+ t.Cleanup(func() {
+ close(stop)
+ <-done
+ })
+ sendTick(t, tick) // the first poll baselines with a reload
+
+ if err := reg.SetAccountNamespaces(map[string]string{"harbour": "bdq"}); err != nil {
+ t.Fatal(err)
+ }
+ sendTick(t, tick)
+ waitParents(t, w, []string{"bdq.apps.test", "harbour.apps.test"})
+
+ if err := reg.SetAccountNamespaces(map[string]string{}); err != nil {
+ t.Fatal(err)
+ }
+ sendTick(t, tick)
+ waitParents(t, w, []string{"bdq.apps.test"})
+}
diff --git a/internal/edge/wildcard_test.go b/internal/edge/wildcard_test.go
index 23a567cf8..091e45a62 100644
--- a/internal/edge/wildcard_test.go
+++ b/internal/edge/wildcard_test.go
@@ -68,17 +68,17 @@ func TestParentsFor(t *testing.T) {
"x.acct3.oncarlos.com", // nor one with a digit in it
"x.ops.oncarlos.com", // nor "o": not in the sqid alphabet
}
- got := parentsFor([]string{"go.tito.io"}, "oncarlos.com", hosts)
+ got := parentsFor([]string{"go.tito.io"}, "oncarlos.com", hosts, nil)
want := []string{"abs.oncarlos.com", "bab.oncarlos.com", "case.oncarlos.com", "go.tito.io"}
if !reflect.DeepEqual(got, want) {
t.Fatalf("parentsFor = %v, want %v", got, want)
}
// No apps domain → static only.
- if got := parentsFor([]string{"go.tito.io"}, "", hosts); !reflect.DeepEqual(got, []string{"go.tito.io"}) {
+ if got := parentsFor([]string{"go.tito.io"}, "", hosts, nil); !reflect.DeepEqual(got, []string{"go.tito.io"}) {
t.Fatalf("static only = %v", got)
}
// Nothing at all.
- if got := parentsFor(nil, "", nil); got != nil {
+ if got := parentsFor(nil, "", nil, nil); got != nil {
t.Fatalf("empty = %v, want nil", got)
}
}
@@ -438,7 +438,7 @@ func TestCurrentHostsPlatformOnly(t *testing.T) {
if !reflect.DeepEqual(got, want) {
t.Fatalf("currentHosts = %v, want %v", got, want)
}
- parents := parentsFor(nil, "oncarlos.com", got)
+ parents := parentsFor(nil, "oncarlos.com", got, nil)
wantParents := []string{"acct.oncarlos.com", "bcd.oncarlos.com"}
if !reflect.DeepEqual(parents, wantParents) {
t.Fatalf("parents = %v, want %v (a provisioned custom domain mints no parent; the unowned evil row never reaches here)", parents, wantParents)
diff --git a/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv b/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv
index 500350489..185108f53 100644
--- a/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv
+++ b/internal/provision/testdata/plan14-root-reads-account-subdomains.tsv
@@ -1,6 +1,7 @@
# Census overlay account-subdomains, written by census-propose (#369). census-ruling-account-subdomains, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-account-subdomains.md.
-# 1 body, 5 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+# 2 body, 5 sites, 4 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
# 8 new dispositions: 1 reads re-frozen at their disposition with the claim, 6 new units frozen accepted-legacy, 0 quiet units retired while they read nothing, 1 other.
+@legacy 44c3c50f4bcda5c032356b159d9e5f4a15fdb66c82cbeca1989f1d1a247bac21 internal/edge/wildcard.go newWildcardFromEnv legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-1;basis=Includes the configured demo domain in the existing wildcard manager's explicit parent input.;rev3=census-ruling-region-ha-g2r-fixes;basis=W2a: on a gated box (issuer gate armed: store and mirror exist) with no DNS provider, builds a serve-only wildcard manager that loads and serves wildcard PEMs from the existing local cache/mirror and never orders (dns nil never reaches obtain). Ungated boxes still get nil. Same parent inputs; no new path or provider credential read.;rev3=census-ruling-account-subdomains;basis=with PLATFORM_APPS_DOMAIN set, also gives the wildcard manager a names reader: the edge's own registry handle's ListAccountNamespaces (the box's own registry database, as carlos, as ListWildcardDomains beside it), keeping the last good names on a read error; refresh() inverts them to sqid -> name and parentsFor adds <name>.<apps-domain> as a parent only beside a sqid parent it already derives from a route host, and only for a name in the subdomain shape; no apps domain, no reader; same read sites (body change only); no file, path, command or bucket read added registry:Host@6617,whole:WildcardDomain@6564,whole:WildcardDomain@6590 3fd6037048f31fdf43704ab87f43ab45a8aa8ad1a73b92bc656eeae367b4b225
@legacy 25840eb4a2ba81e4108851318ad48bc9d7bdccc6a824c7a8ca372306428913bb internal/host/agent.go aliasPassReportingComplete legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=Extract the existing serialized alias pass, add cancellable locking and routing-only alias/regional publication from its completeness report; existing deployment/claim/registry reads retained, new in-memory Route/RegionalDomain passes.;rev3=census-ruling-fix-incomplete-domains-pass;basis=gains a startup bool parameter that it copies into domains.AliasReport.StartupNoRemoval; runHAIngressStartup passes true, aliasPassReporting (the ordinary agent pass) passes false; same reads and calls, body change only; no root pass calls it; no root decision;rev3=census-ruling-account-subdomains;basis=sets AliasReport.AppsDomain from PLATFORM_APPS_DOMAIN (trimmed), the variable domainsTickConfig reads; same reads and calls otherwise; body change only whole:RegionalDomain@1778,whole:Route@1856,whole:Route@957,whole:Route@979,whole:Route@998 8a439cd701910b91d9bf8c39e96a56141c20c063f590dc26f557eb5337884ad6
@legacy 6640a6d2ced4baaf78c77b55c524e0cdf0392c0d028319922700db419e9a5c57 internal/domains/namespacealiases.go deriveNamespaceAliases legacy accepted-legacy accepted-legacy;rev3=census-ruling-account-subdomains;basis=new: derives <prefix>.<name>.<apps> -> <prefix>.<sqid>.<apps> alias rows from the routes, alias rows and claim listing the pass already read (Provisioned or Platform, not sidecar or replica, of the name's account), writes them "pointing" (fix round 1) with UpsertAlias, and SetAliasDNSStatus("pointing") for an existing one that is not, to the box's own registry, and HA names into the in-memory AliasIngress report; no file, path or bucket read registry:Account@1666,registry:Account@2867,registry:Alias@760,registry:App@1687,registry:App@1696,registry:App@1812,registry:DNSStatus@2137,registry:HA@2758,registry:Host@1238,registry:Host@1645,registry:Host@1655,registry:Host@1783,registry:Host@2740,registry:Host@2849,registry:Platform@1062,registry:Provisioned@1044,registry:Replica@1096,whole:Route@1028,whole:Route@1156,whole:Route@2412,whole:Route@2494,whole:Route@2532,whole:Route@2714,whole:Route@2769,whole:Route@3107,whole:Route@3172,whole:Route@3246,whole:Route@3302,whole:Route@3326,whole:Route@919,whole:RouteAlias@1617,whole:RouteAlias@712,whole:RouteAlias@742,whole:RouteAlias@755,whole:RouteAlias@771 c100c0ab8340ac352b4ccce7c6db7c572d5d54d4ba8924214d1cc097a7e39f21
@legacy bfff2db67ed66e28eac929243b4893d7d29c6753020540e504a1eba8d66e2f3d internal/domains/namespacealiases.go isNamespaceDerived legacy accepted-legacy accepted-legacy;rev3=census-ruling-account-subdomains;basis=new: pure predicate over one alias row and the held-name map; no read registry:Account@220,registry:Alias@133,registry:Host@241 c647beeb6870d420d9748a891d9889a264757b22f141f08925157e7ac0f2628d
@@ -13,6 +14,7 @@
@legacy 6487c32cb53e58f13d5304afbf1d1bfde28819c3d266fe32dd5600cade696388 internal/domains/reconcile.go StampHealth legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-dns-fresh-lookup-724;basis=section 4 now computes every cached verdict first, then freshUpgrade gives up to 64 randomly ordered names that could have a public zone (not under the apps domain, not special-use like .internal) and whose verdict is "" or "elsewhere" an uncached lookup (30 s pass budget) that may only upgrade to "pointing", then stamps; the extra sites are the indexed loops over the same rows (#724);rev3=census-ruling-no-negative-prime-724;basis=section 4 now hands each route and alias, with its previous stamp (the two new registry:DNSStatus reads, rt.DNSStatus and a.DNSStatus, same rows already listed), to dnsVerdicts, which first hands the pass's hostnames to Config.FreshRetain (the resolver forgets its in-memory backoff and strike for names no longer carried) and then decides each hostname once per pass and applies the verdict to every row carrying it: a name not "pointing" before this pass and eligible for a fresh lookup (public name, not under the apps domain, ResolveFresh set) is looked at uncached first within the same 64-lookup/30 s budget (shared, with previously "pointing" names' upgrade looks serviced before any fresh-first name so new names cannot starve a published one) and stamped from it (edge address, A or AAAA, "pointing", other "elsewhere", authoritative not-found "", authoritative NODATA for A and AAAA with the zone's SOA "" with no cached query), falling back to the cached lookup past the budget or on the second fresh failure in a row; the first fresh failure in a row is held (stamp and check time untouched, the resolver forgives it so the next pass asks fresh again); a previously "pointing" name keeps cached-first plus the upgrade-only fresh look (ResolveUpgrade, nearest zones first), so the fresh path still never unpublishes; a fresh-first name that ends the pass "pointing" (fresh or cached) has its fresh failure backoff cleared through Config.FreshForget, so an onboarding failure never suppresses the upgrade look that keeps it published; new names are ordered never-checked first then oldest check, and lookups answered from the backoff do not count against the budget; StampHealth's own body is unchanged by the last round; no new file, path or command input; the dropped Alias/Host/Route/RouteAlias sites are the old indexed loops folded into the candidate build (#724);rev3=census-ruling-account-subdomains;basis=reads the box's own account_namespaces table (only when DNS stamping runs) and leaves out of the DNS loop the alias rows isNamespaceDerived names (an alias under a held name, of that name's account, pointing at its sqid twin); if that read fails it logs and leaves out every alias two or more labels under the apps domain, still stamping every other alias, every route and all TLS expiry (fix round 1); the added RouteAlias sites are that filter over rows already listed; stamps less, never more; TLS stamping unchanged registry:Alias@1972,registry:Alias@4450,registry:Alias@5039,registry:Alias@5129,registry:Alias@5563,registry:Alias@5627,registry:Alias@5715,registry:DNSCheckedAt@4325,registry:DNSCheckedAt@4472,registry:DNSStatus@4311,registry:DNSStatus@4459,registry:DNSStatus@4664,registry:DNSStatus@4963,registry:Host@4302,registry:Host@4736,registry:Host@4820,registry:Host@5332,registry:Host@5391,registry:Host@5473,whole:Route@199,whole:Route@236,whole:Route@4126,whole:Route@4242,whole:Route@4571,whole:Route@5286,whole:RouteAlias@1680,whole:RouteAlias@1906,whole:RouteAlias@2058,whole:RouteAlias@2106,whole:RouteAlias@2126,whole:RouteAlias@2138,whole:RouteAlias@4172,whole:RouteAlias@4386,whole:RouteAlias@4866,whole:RouteAlias@5516,whole:RouteAlias@780 5288387d1eac4611bc4b1acc30569011009192e7210127001c27174e1e1cfa43
@legacy d5b19e5fea9c3ef9f7b7c68012a8529fcab3fe0a670e1e4a64d90366ab25bf10 internal/registry/registry.go Registry.Fingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.;rev3=census-ruling-stateless-replicas-1;basis=Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source.;rev3=census-ruling-agent-start-demo-1;basis=Existing SELECT reads four more demo columns; only a marked row adds them to the hash, so ordinary hashes remain unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Four additive projection columns join the existing routes SELECT and hash only when nonzero; no new query or file read. merge of origin/main 6be08467: Union main demo identity and expiry with replica columns in the same SELECT and hash; merge-only body change.;rev3=census-ruling-agent-start-demo-3;basis=Hash moved-notice wire bytes so notice-only changes invalidate an edge route snapshot. Census read-site delta: +file:QueryRow.;rev3=census-ruling-edge-page-cache-1;basis=selects the new pages_off column with the rest and folds "pages_off=1" into the hash only when set, as assets_off, so a registry that never sets it fingerprints as before; same routes SELECT, no new table; read sites unchanged (34); no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: hashes link_channels (link_id, account, token_hash, status, generation; connected, seen_at, seq and created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no links digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision; linked deployments slice 1 Task 7: also folds home_link (id, serving_url, tunnel_url, the token's sha256 never the token, account, apps_domain, box_label, conn_gen; state and created_at not) and home_link_apps (name, home_account, home_app, home_host) through fingerprintHomeLink over the same fresh connection, each section marker written only when a row exists, so a registry with no link digests as before; no file path read; a digest, never a decision;rev3=census-ruling-account-subdomains;basis=hashes account_namespaces (name, account) over the same fresh connection, with a section marker written only when a row exists, so a registry with no held names digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision file:Exec@284,file:Open@188,file:Query@10785,file:Query@11707,file:Query@12810,file:Query@368,file:Query@6655,file:Query@7134,file:Query@8120,file:Query@8816,file:Query@9728,file:QueryRow@13727,registry:ClaimIncarnation@1729,registry:ClaimIncarnation@5563,registry:ClaimIncarnation@5640,registry:ClaimOwner@1773,registry:ClaimOwner@5764,registry:ClaimOwner@5829,registry:ClaimRowID@1792,registry:ClaimRowID@5856,registry:ClaimRowID@5922,registry:ClaimStamp@1754,registry:ClaimStamp@5673,registry:ClaimStamp@5737,registry:Incarnation@1848,registry:Incarnation@6143,registry:Incarnation@6207,registry:ServingSeq@1867,registry:ServingSeq@6234,registry:ServingSeq@6297,registry:Text@158,registry:path@207,registry:remote@55,registry:remote@87,whole:remoteClient@57,whole:remoteClient@89 a52e0bc25d555bbf22f35655c54c0fa3aca6cedec5f0b6b80157d9d95f921a29
@legacy 5d46724aa4ebbec5cc075b3d28c1efd3fdd89e73abcb73ceaabc6bc2c68c36e5 internal/registry/registry.go Registry.migrate legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user), on every registry open; a box CLI verb that opens the registry directly runs it as whoever runs the verb: census-ruling-seeded-instances's body with two more columns added to routes (incarnation and serving_seq, INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule); self-serve moves 1 Task 7;rev3=census-ruling-rootfs-apps-2;basis=one more ALTER TABLE, routes ADD COLUMN runtime TEXT NOT NULL DEFAULT '', beside main's rate_limit, assets_off, asset_gen, incarnation and serving_seq (the last four from the merges of origin/main 3c33f2eb and 953b9fda); the same sixteen sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 4: three more ALTER TABLE statements in the existing loop, routes ADD COLUMN egress_allow, size and policy_expires_at, each TEXT NOT NULL DEFAULT '' and idempotent through the duplicate-column rule; the same sixteen sites, no read added.;rev3=census-ruling-region-ha-p1a;basis=one more ALTER TABLE in the existing loop: routes ADD COLUMN ha INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule; the same sixteen sites, no read added;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos (agent, registry child; a box CLI verb that opens the registry directly runs it as whoever runs it), on every registry open: the ALTER TABLE routes statements are now built from the one migration definition routeAddedColumns (addedColumn name, type, default; review r1 P2): for each entry without the Claim mark, "ALTER TABLE routes ADD COLUMN " + spec(), byte for byte the statements main runs, in main's order, under the same duplicate-column rule. +registry:Claim is that mark, +whole:addedColumn the struct. Every name, type and default is an in-binary literal; no statement added, removed or changed; no read added.;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: one more CREATE TABLE IF NOT EXISTS regional_domains (host TEXT PRIMARY KEY, target, account, app, region TEXT NOT NULL DEFAULT '', created_at INTEGER NOT NULL DEFAULT 0), beside wildcard_domains; the added sites are that statement (+file:Exec, +registry:sql), an in-binary literal; additive, no existing statement changed;rev3=census-ruling-region-ha-p1b3b-t;basis=Create local HA duty/replay tables and revision triggers in the existing registry connection; no new database path.;rev3=census-ruling-agent-start-demo-3;basis=Create moved-notice storage as a single (id, wire) row; fingerprints include the stored wire bytes. Census read-site delta: +file:Exec, +registry:sql.;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: calls migrateLinks after migrateHADuties (one CREATE TABLE IF NOT EXISTS link_channels, an in-binary literal); additive, no existing statement changed; linked deployments slice 1 Task 7: also runs migrateHomeLink (CREATE TABLE IF NOT EXISTS home_link and home_link_apps) after migrateLinks; additive, the box's own registry database, as carlos;rev3=census-ruling-account-subdomains;basis=one more CREATE TABLE IF NOT EXISTS account_namespaces (name TEXT PRIMARY KEY, account TEXT NOT NULL), an in-binary literal (+file:Exec, +registry:sql); additive, no existing statement changed file:Exec@1124,file:Exec@1855,file:Exec@212,file:Exec@2409,file:Exec@3057,file:Exec@3822,file:Exec@4101,file:Exec@4964,file:Exec@51,file:Exec@5140,file:Exec@761,registry:Claim@686,registry:sql@1124,registry:sql@1855,registry:sql@212,registry:sql@2409,registry:sql@3057,registry:sql@3822,registry:sql@4101,registry:sql@4964,registry:sql@51,registry:sql@5140,registry:sql@761,whole:addedColumn@661 0c5fdaf1215e8f81c156a1fc1576cb075c2a52238bde75fc8320d49472fd117d
+internal/edge/wildcard.go newWildcardFromEnv legacy accepted-legacy accepted-legacy;rev3=J1;basis=root-route;rev3=census-ruling-agent-start-demo-1;basis=Includes the configured demo domain in the existing wildcard manager's explicit parent input.;rev3=census-ruling-region-ha-g2r-fixes;basis=W2a: on a gated box (issuer gate armed: store and mirror exist) with no DNS provider, builds a serve-only wildcard manager that loads and serves wildcard PEMs from the existing local cache/mirror and never orders (dns nil never reaches obtain). Ungated boxes still get nil. Same parent inputs; no new path or provider credential read.;rev3=census-ruling-account-subdomains;basis=with PLATFORM_APPS_DOMAIN set, also gives the wildcard manager a names reader: the edge's own registry handle's ListAccountNamespaces (the box's own registry database, as carlos, as ListWildcardDomains beside it), keeping the last good names on a read error; refresh() inverts them to sqid -> name and parentsFor adds <name>.<apps-domain> as a parent only beside a sqid parent it already derives from a route host, and only for a name in the subdomain shape; no apps domain, no reader; same read sites (body change only); no file, path, command or bucket read added registry:Host@6617,whole:WildcardDomain@6564,whole:WildcardDomain@6590 3fd6037048f31fdf43704ab87f43ab45a8aa8ad1a73b92bc656eeae367b4b225
internal/host/agent.go aliasPassReportingComplete legacy accepted-legacy accepted-legacy;rev3=census-ruling-region-ha-g2-fixes;basis=Extract the existing serialized alias pass, add cancellable locking and routing-only alias/regional publication from its completeness report; existing deployment/claim/registry reads retained, new in-memory Route/RegionalDomain passes.;rev3=census-ruling-fix-incomplete-domains-pass;basis=gains a startup bool parameter that it copies into domains.AliasReport.StartupNoRemoval; runHAIngressStartup passes true, aliasPassReporting (the ordinary agent pass) passes false; same reads and calls, body change only; no root pass calls it; no root decision;rev3=census-ruling-account-subdomains;basis=sets AliasReport.AppsDomain from PLATFORM_APPS_DOMAIN (trimmed), the variable domainsTickConfig reads; same reads and calls otherwise; body change only whole:RegionalDomain@1778,whole:Route@1856,whole:Route@957,whole:Route@979,whole:Route@998 8a439cd701910b91d9bf8c39e96a56141c20c063f590dc26f557eb5337884ad6
internal/domains/namespacealiases.go deriveNamespaceAliases legacy accepted-legacy accepted-legacy;rev3=census-ruling-account-subdomains;basis=new: derives <prefix>.<name>.<apps> -> <prefix>.<sqid>.<apps> alias rows from the routes, alias rows and claim listing the pass already read (Provisioned or Platform, not sidecar or replica, of the name's account), writes them "pointing" (fix round 1) with UpsertAlias, and SetAliasDNSStatus("pointing") for an existing one that is not, to the box's own registry, and HA names into the in-memory AliasIngress report; no file, path or bucket read registry:Account@1666,registry:Account@2867,registry:Alias@760,registry:App@1687,registry:App@1696,registry:App@1812,registry:DNSStatus@2137,registry:HA@2758,registry:Host@1238,registry:Host@1645,registry:Host@1655,registry:Host@1783,registry:Host@2740,registry:Host@2849,registry:Platform@1062,registry:Provisioned@1044,registry:Replica@1096,whole:Route@1028,whole:Route@1156,whole:Route@2412,whole:Route@2494,whole:Route@2532,whole:Route@2714,whole:Route@2769,whole:Route@3107,whole:Route@3172,whole:Route@3246,whole:Route@3302,whole:Route@3326,whole:Route@919,whole:RouteAlias@1617,whole:RouteAlias@712,whole:RouteAlias@742,whole:RouteAlias@755,whole:RouteAlias@771 c100c0ab8340ac352b4ccce7c6db7c572d5d54d4ba8924214d1cc097a7e39f21
internal/domains/namespacealiases.go isNamespaceDerived legacy accepted-legacy accepted-legacy;rev3=census-ruling-account-subdomains;basis=new: pure predicate over one alias row and the held-name map; no read registry:Account@220,registry:Alias@133,registry:Host@241 c647beeb6870d420d9748a891d9889a264757b22f141f08925157e7ac0f2628d
@@ -27,6 +29,7 @@ internal/domains/reconcile.go StampHealth legacy accepted-legacy accepted-legacy
internal/registry/registry.go Registry.Fingerprint legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user); the remote arm, unchanged, in the process that holds a remote handle: census-ruling-seeded-instances's body with the row's lifetime pair (incarnation, serving_seq) folded into the edge's change poll, each only when non-zero, so a registry with no pair digests as before; self-serve moves 1 Task 7;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: hashes regional_domains (host, target, account, app, region; created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no regional rows digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; no file path read;rev3=census-ruling-fleet-public-routes;basis=fleet public routes (spec 2026-10-29 rev 4, §4.2 writer rule): review R1 finding 1: the routes SELECT also reads host, kind, account, app, platform and fingerprintForwardInert (one CASE over the ForwardForbidden columns), and every row folds host, kind, account and app (tagged, quoted), platform when set, and forward_inert=0 for a forward row that is not inert, so a rowid reused by another hostname, an in-place account or app rewrite, or a stray forbidden column moves the edge's change poll. Same one SELECT per table on the same fresh connection to the box's own registry database, as carlos; no table, file or bucket read added; a digest, never a decision.;rev3=census-ruling-managed-fleets-1b;basis=managed fleets 1b (Task 5): the SELECT also reads fleet_label and, only when it is set, hashes "fleet_label=<q>" into the digest, so labelling a row moves the edge's reload fingerprint. Read sites unchanged (33). Registry side, not root; an unlabelled registry's digest is byte-identical.;rev3=census-ruling-stateless-replicas-1;basis=Read the additive stateless projection in the existing registry SELECT and hash only when set; no new read source.;rev3=census-ruling-agent-start-demo-1;basis=Existing SELECT reads four more demo columns; only a marked row adds them to the hash, so ordinary hashes remain unchanged.;rev3=census-ruling-stateless-replicas-2;basis=Four additive projection columns join the existing routes SELECT and hash only when nonzero; no new query or file read. merge of origin/main 6be08467: Union main demo identity and expiry with replica columns in the same SELECT and hash; merge-only body change.;rev3=census-ruling-agent-start-demo-3;basis=Hash moved-notice wire bytes so notice-only changes invalidate an edge route snapshot. Census read-site delta: +file:QueryRow.;rev3=census-ruling-edge-page-cache-1;basis=selects the new pages_off column with the rest and folds "pages_off=1" into the hash only when set, as assets_off, so a registry that never sets it fingerprints as before; same routes SELECT, no new table; read sites unchanged (34); no read added;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: hashes link_channels (link_id, account, token_hash, status, generation; connected, seen_at, seq and created_at not) over the same fresh connection, with a section marker written only when a row exists, so a registry with no links digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision; linked deployments slice 1 Task 7: also folds home_link (id, serving_url, tunnel_url, the token's sha256 never the token, account, apps_domain, box_label, conn_gen; state and created_at not) and home_link_apps (name, home_account, home_app, home_host) through fingerprintHomeLink over the same fresh connection, each section marker written only when a row exists, so a registry with no link digests as before; no file path read; a digest, never a decision;rev3=census-ruling-account-subdomains;basis=hashes account_namespaces (name, account) over the same fresh connection, with a section marker written only when a row exists, so a registry with no held names digests as before; the one added site is that SELECT (+file:Query) on the box's own registry database, as carlos; a digest, never a decision file:Exec@284,file:Open@188,file:Query@10785,file:Query@11707,file:Query@12810,file:Query@368,file:Query@6655,file:Query@7134,file:Query@8120,file:Query@8816,file:Query@9728,file:QueryRow@13727,registry:ClaimIncarnation@1729,registry:ClaimIncarnation@5563,registry:ClaimIncarnation@5640,registry:ClaimOwner@1773,registry:ClaimOwner@5764,registry:ClaimOwner@5829,registry:ClaimRowID@1792,registry:ClaimRowID@5856,registry:ClaimRowID@5922,registry:ClaimStamp@1754,registry:ClaimStamp@5673,registry:ClaimStamp@5737,registry:Incarnation@1848,registry:Incarnation@6143,registry:Incarnation@6207,registry:ServingSeq@1867,registry:ServingSeq@6234,registry:ServingSeq@6297,registry:Text@158,registry:path@207,registry:remote@55,registry:remote@87,whole:remoteClient@57,whole:remoteClient@89 a52e0bc25d555bbf22f35655c54c0fa3aca6cedec5f0b6b80157d9d95f921a29
internal/registry/registry.go Registry.migrate legacy accepted-legacy accepted-legacy;rev3=census-ruling-self-serve-moves-1;basis=the registry's SQLite side, as carlos: in the agent (/opt/carlos/carlos agent, carlos-edge.service) and in the registry child (carlos __registry-child, which a root pass forks as the service user), on every registry open; a box CLI verb that opens the registry directly runs it as whoever runs the verb: census-ruling-seeded-instances's body with two more columns added to routes (incarnation and serving_seq, INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule); self-serve moves 1 Task 7;rev3=census-ruling-rootfs-apps-2;basis=one more ALTER TABLE, routes ADD COLUMN runtime TEXT NOT NULL DEFAULT '', beside main's rate_limit, assets_off, asset_gen, incarnation and serving_seq (the last four from the merges of origin/main 3c33f2eb and 953b9fda); the same sixteen sites, no read added;rev3=census-ruling-instance-egress-sizes-328-329;basis=#328/#329 plan 1 Task 4: three more ALTER TABLE statements in the existing loop, routes ADD COLUMN egress_allow, size and policy_expires_at, each TEXT NOT NULL DEFAULT '' and idempotent through the duplicate-column rule; the same sixteen sites, no read added.;rev3=census-ruling-region-ha-p1a;basis=one more ALTER TABLE in the existing loop: routes ADD COLUMN ha INTEGER NOT NULL DEFAULT 0, idempotent through the duplicate-column rule; the same sixteen sites, no read added;rev3=census-ruling-ha-p1a-433;basis=the registry's SQLite side as carlos (agent, registry child; a box CLI verb that opens the registry directly runs it as whoever runs it), on every registry open: the ALTER TABLE routes statements are now built from the one migration definition routeAddedColumns (addedColumn name, type, default; review r1 P2): for each entry without the Claim mark, "ALTER TABLE routes ADD COLUMN " + spec(), byte for byte the statements main runs, in main's order, under the same duplicate-column rule. +registry:Claim is that mark, +whole:addedColumn the struct. Every name, type and default is an in-binary literal; no statement added, removed or changed; no read added.;rev3=census-ruling-regional-domains-447;basis=#447 Task 4: one more CREATE TABLE IF NOT EXISTS regional_domains (host TEXT PRIMARY KEY, target, account, app, region TEXT NOT NULL DEFAULT '', created_at INTEGER NOT NULL DEFAULT 0), beside wildcard_domains; the added sites are that statement (+file:Exec, +registry:sql), an in-binary literal; additive, no existing statement changed;rev3=census-ruling-region-ha-p1b3b-t;basis=Create local HA duty/replay tables and revision triggers in the existing registry connection; no new database path.;rev3=census-ruling-agent-start-demo-3;basis=Create moved-notice storage as a single (id, wire) row; fingerprints include the stored wire bytes. Census read-site delta: +file:Exec, +registry:sql.;rev3=census-ruling-linked-deployments-slice1;basis=linked deployments slice 1 Task 1: calls migrateLinks after migrateHADuties (one CREATE TABLE IF NOT EXISTS link_channels, an in-binary literal); additive, no existing statement changed; linked deployments slice 1 Task 7: also runs migrateHomeLink (CREATE TABLE IF NOT EXISTS home_link and home_link_apps) after migrateLinks; additive, the box's own registry database, as carlos;rev3=census-ruling-account-subdomains;basis=one more CREATE TABLE IF NOT EXISTS account_namespaces (name TEXT PRIMARY KEY, account TEXT NOT NULL), an in-binary literal (+file:Exec, +registry:sql); additive, no existing statement changed file:Exec@1124,file:Exec@1855,file:Exec@212,file:Exec@2409,file:Exec@3057,file:Exec@3822,file:Exec@4101,file:Exec@4964,file:Exec@51,file:Exec@5140,file:Exec@761,registry:Claim@686,registry:sql@1124,registry:sql@1855,registry:sql@212,registry:sql@2409,registry:sql@3057,registry:sql@3822,registry:sql@4101,registry:sql@4964,registry:sql@51,registry:sql@5140,registry:sql@761,whole:addedColumn@661 0c5fdaf1215e8f81c156a1fc1576cb075c2a52238bde75fc8320d49472fd117d
@coverage internal/domains fc681633c98fd7dedee47dca8862a0295c84dee2534a3e3d4403c7fd21b83438
+@coverage internal/edge 9b9f642f53505bd73aad991d29b75b68abba48b6eb9d242a6634bea069dc421c
@coverage internal/host aa8f6c1a0b8dd200cb7656622d1fb6004ea0e1bbac292459b4eafa463da7f9bb
@coverage internal/registry 87edc805294acb90abb7637f64fd174bd8ced08978783dbb2631855082955582
@fields ?,A,Account,Accounts,AcquiredGeneration,AddedAt,Addr,Addrs,Adoption,Alias,Aliases,Alive,AllowAbsent,App,AppsDomain,Archives,Args,AssetGen,AssetsOff,Assigned,Assignment,At,Attempts,B,Backing,Basis,Binding,Blocked,Body,BoxLabel,Bucket,BuildState,By,Callback,CallbackError,CallbackFailed,Canary,Caps,CertExpiresAt,Changed,Channel,CheckedAt,Claim,ClaimIncarnation,ClaimOwner,ClaimOwnership,ClaimRowID,ClaimStamp,Class,Code,Column,ConnGen,Connected,Contents,Copies,Count,CreatedAt,Cursor,DBPath,DNSCheckedAt,DNSStatus,Deadline,Default,DeleteUncertain,Demand,DemoExpiresAt,DemoHost,DemoID,DemoLifetime,Departure,DepartureIID,DepartureRef,Departures,Digest,DoneBefore,DrainingSince,Due,DueAt,Duty,EdgesETag,EgressAllow,EnrolledAt,Env,EnvBefore,Environment,Error,ErrorKind,ExcludeHosts,ExpectGood,ExpectOp,ExpectPair,Expected,ExpectedPair,F,Failed,FenceGen,Field,FillLegacyRegistration,Fleet,FleetBox,FleetBoxes,FleetLabel,Fleets,Found,From,FromDB,FromOp,FromSock,Gate,Generation,GoodDemand,GoodDigest,GoodVersion,HA,HAJournal,Hash,Health,Held,Hibernate,Hint,Hints,HoldOp,HolderEpoch,HolderIID,HolderRef,HomeAccount,HomeApp,HomeHost,HomeLink,HomeLinkApp,HomeLinkApps,Host,Hosts,ID,IID,Id,IdValue,Identity,Idle,IdleSeconds,Import,ImportGate,Inbox,Incarnation,InventoryGeneration,Journal,Keep,Key,KeyFP,Keys,Kind,Label,LabelledAt,LastAt,LastBlocked,LastError,LastMs,LastPage,LastStatus,Lifetime,Limit,Link,LinkID,LinkSeen,LockETag,LockGeneration,Managed,MaxRun,MaxRunSeconds,MessageID,Method,Moved,Ms,Name,Names,Next,NextAt,NextAttempt,NextDue,NextGood,NextValue,NotBefore,Now,Number,Number64,Observation,Observed,ObservedValue,Offset,Old,Oldest,On,OnConflict,Op,Original,Owner,Ownership,P,Page,PagesOff,Pair,Path,Paths,PermissionAlerted,Phase,Platform,PolicyExpiresAt,Pool,Prefix,Prev,PrevVersion,ProofDigest,ProofKey,Provisioned,Pub,RDs,RateLimit,Raw,Receipt,ReceivedAt,RecordDigest,RecordKey,Ref,Region,Regional,Registration,Replica,ReplicaIncarnation,ReplicaLife,ReplicaRevision,Replicas,Replication,Rescan,Result,Retirement,RetryCount,Revision,RotateGen,RotatePending,Route,Routes,Row,Rows,Runtime,Scan,SecretsKeyFP,SecretsKeySetAt,SecretsKeySetBy,SecretsPub,Seed,SeedID,SeedSource,SeenAt,Seq,Sequence,ServingSeq,ServingURL,ServingVersion,Size,Slug,Socket,Spec,Sqid,StartedAt,State,Stateless,Status,StatusNamed,Steering,StringMap,Summary,T,TValue,Tags,Target,Targets,Text,Timer,Timers,Times,To,ToDB,ToOp,ToSock,Token,TokenHash,Tunnel,TunnelURL,Type,Unit,UnlinkPending,Unresolved,UpdateSettings,Ver,Version,ViewKey,Visited,W,Waiting,Wake,WakeDigest,WakeIncarnation,Walk,Wildcards,closed,conn,connect,ctx,d,dec,done,enc,full,input,output,path,readOnly,remote,slot,sql,wait
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 2730c48f4..5ec72d473 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -173,4 +173,4 @@ plan14-root-reads-stats-prune-400.tsv 75b32391a24d2c9269fc579aae68ac80b7b1d4ccf0
plan14-root-reads-group-observation-carry.tsv 587f6e92c5e594b9bb6436a2d0066849454407202e311f43483bed3be4591940
plan14-root-reads-activator-settle-wait.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369
plan14-root-reads-lease-checkpoint-no-compaction.tsv b3d35a0bd7c0500c74efbe5e8f566adb623696d31bd9860164907e08a2e79369
-plan14-root-reads-account-subdomains.tsv 25410e0f5ffa3bae361a8af9a45667b46dd948793351748155f78b61cbbe8c55
+plan14-root-reads-account-subdomains.tsv dde10a6f5fe44a4be206275f883b6613c9eeb850f184132d93136fc5e84d9134