domains: the startup alias pass removes nothing (option A)
Replaces the row-keep logic (census rounds 1-4 rejected it: an alias row cannot show the authority it was derived under). The fix moves to the trigger. 98c43eea's startup HA ingress pass runs under a 5 s deadline on a cold claim cache, and on 2026-11-07 it removed every custom domain whose claim read timed out. The startup pass now sets AliasReport.StartupNoRemoval: it derives and writes as usual but removes no route_aliases, wildcard_domains or route_paths row, and reports incomplete if it skipped one. The removal rules are unchanged, and the next ordinary pass applies them, as on v0.34.4. Witness: TestStartupAliasPassRemovesNothing (production wiring, real 5 s deadline, cold cache) plus the wiring pin and a domains test per table. Census re-proposed for both changed units.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
11 files changed,
+254
−245
docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md+5 −3internal/domains/aliases.go+27 −45internal/domains/aliases_startup_test.go+56 −0internal/domains/aliases_unread_keep_test.go+0 −146internal/host/agent.go+6 −3internal/host/edgesfile_unread_claims_test.go+141 −35internal/host/group_names_test.go+4 −5internal/host/haingress.go+6 −2internal/host/haingress_startup_test.go+1 −1internal/provision/testdata/plan14-root-reads-chain.tsv+1 −1internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv+7 −4
CI passed — run details
diff --git a/docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md b/docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md| index 6522192ed..19895a52a 100644 |
| --- a/docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md |
| +++ b/docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md |
| @@ -4,16 +4,18 @@ Ruling `census-ruling-fix-incomplete-domains-pass`. The independent reviewer app |
| | unit | change | read sites | what changed | |
| |---|---|---|---| |
| -| `internal/domains/aliases.go` `ReconcileAliasesReport` | sites | +registry:Account, +registry:Alias ×7, +registry:App ×2, +registry:Host ×2, +whole:Route ×3, +whole:RouteAlias | scope cut after census rounds 1-3: keeps ONLY an exact-name route_aliases row whose own claim is listed but not read this pass (relevantDropped hosts, so a complete pass keeps nothing), via keepUnreadAlias, and only while every refusal the plain derivation makes without the claim body still passes on rows this pass read: target route local with the row account and app, no local route owns the name, deploymentRoutes does not name it, normalised name, no sidecar suffix on either end; catch-all, instance, wildcard_domains and route_paths removal unchanged from main; no new registry, file or bucket read; deletes less, never more; no root pass calls it; no root decision | |
| +| `internal/domains/aliases.go` `ReconcileAliasesReport` | body | unchanged (104) | 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/host/agent.go` `aliasPassReportingComplete` | body | unchanged (5) | 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 | |
| -Envelopes re-pinned: `internal/domains`. |
| +Envelopes re-pinned: `internal/domains`, `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/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. |
| +- `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. |
| -Seal: `5c6f157c56e24dc835edc534c5dc0e043e6527e8116e5bb470e68e4fd271796c` → `89f774f48752b6d65ada2e6e9362c2aebb2ee39f505b4f909fb2188de0521721`. |
| +Seal: `5c6f157c56e24dc835edc534c5dc0e043e6527e8116e5bb470e68e4fd271796c` → `61027a32e31cb7ce017304f526f668c26980999e2699a3013a82e2630164143e`. |
| Overlay: `internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`. |
diff --git a/internal/domains/aliases.go b/internal/domains/aliases.go| index c168b9119..6bff906b0 100644 |
| --- a/internal/domains/aliases.go |
| +++ b/internal/domains/aliases.go |
| @@ -320,6 +320,22 @@ type AliasReport struct { |
| // refused route must not drive a certificate order anywhere, and this |
| // table is the box's own wildcard manager's source. Nil refuses nothing. |
| FleetRefused func(routes []registry.Route) map[string]string |
| + // StartupNoRemoval is an INPUT, set by the caller before the pass, and |
| + // ONLY by the agent's startup HA ingress pass (runHAIngressStartup). The |
| + // pass derives and writes as usual, but removes nothing from |
| + // route_aliases, wildcard_domains or route_paths: each row it would have |
| + // removed is left as it is, and the pass is incomplete. The removal rules |
| + // themselves are unchanged; the next ordinary pass applies them. |
| + // |
| + // Why: removal is only safe on a pass that read every claim, and the |
| + // startup pass runs under a short deadline with a cold claim cache, so |
| + // it routinely cannot. On 2026-11-07 (v0.34.14, flagship) it timed out |
| + // on 75 claim GETs and removed every custom domain those claims had |
| + // derived; the next pass re-inserted them with a blank dns_status, and |
| + // the edges file withheld them for about a minute. Before that pass |
| + // existed (v0.34.4) a restarted box made no removal until its first |
| + // ordinary pass, which is the behaviour this restores. |
| + StartupNoRemoval bool |
| } |
| // relevantDropped returns the hosts of the listed-but-unread claims that the |
| @@ -429,16 +445,9 @@ func ReconcileAliasesReport(ctx context.Context, s release.Store, reg *registry. |
| if err != nil { |
| return err |
| } |
| - // unreadAlias is the claims whose exact-name alias rows this pass keeps |
| - // (keepUnreadAlias, below): exactly the unread claims that make it |
| - // incomplete, so a complete pass never kept anything. |
| - unreadAlias := map[string]bool{} |
| if h := relevantDropped(dropped, routes, existing); len(h) > 0 { |
| log.Printf("domains: %d claim(s) listed but unreadable this pass (e.g. %s) — the pass is incomplete", len(h), h[0]) |
| incomplete = true |
| - for _, host := range h { |
| - unreadAlias[host] = true |
| - } |
| } |
| desired := map[string]bool{} |
| desiredWild := map[string]registry.WildcardDomain{} |
| @@ -778,46 +787,11 @@ func ReconcileAliasesReport(ctx context.Context, s release.Store, reg *registry. |
| }, reg, now) { |
| incomplete = true |
| } |
| - // keepUnreadAlias reports whether an exact-name alias row whose own claim |
| - // was listed but not read this pass is kept as it is, box stamps included, |
| - // instead of deleted. |
| - // |
| - // Deleting it is the 2026-11-07 flagship shrink: an edge restart's first |
| - // alias pass ran under the startup HA ingress deadline with a cold claim |
| - // cache, 75 claim GETs timed out, and every custom domain's row went. The |
| - // next pass re-inserted them with a blank dns_status, which the edges file |
| - // withholds until the DNS sweep comes round again, so the other edges |
| - // answered 404 for those names for about a minute. |
| - // |
| - // Only the plain alias, the row named exactly by its unread claim, is kept, |
| - // and only while every refusal the plain derivation makes without the |
| - // claim's body still passes on what this pass did read: the target route |
| - // is local and still the row's account and app, no local route owns the |
| - // name, no other box serves it as a route, the name is normalised, and |
| - // neither end is under the reserved sidecar suffix. Catch-all, instance, |
| - // wildcard-parent and path rows each rest on further authority the row |
| - // cannot show (a parent claim, the fleet arm, a path target), so they are |
| - // still removed as before. A claim that has left the listing is a detach |
| - // and is not in unreadAlias. |
| - keepUnreadAlias := func(a registry.RouteAlias) bool { |
| - if !unreadAlias[a.Alias] || strings.HasPrefix(a.Alias, "*.") { |
| - return false |
| - } |
| - if strings.HasSuffix(a.Alias, sidecarSuffix) || strings.HasSuffix(a.Host, sidecarSuffix) { |
| - return false |
| - } |
| - if n, ok := NormalizeAliasHost(a.Alias); !ok || n != a.Alias { |
| - return false |
| - } |
| - if _, taken := byHost[a.Alias]; taken || deploymentRoutes[a.Alias] { |
| - return false |
| - } |
| - rt, ok := byHost[a.Host] |
| - return ok && rt.App == a.App && release.RouteAccount(rt) == a.Account |
| - } |
| + noRemoval := rep != nil && rep.StartupNoRemoval |
| for _, a := range existing { |
| if !desired[a.Alias] { |
| - if keepUnreadAlias(a) { |
| + if noRemoval { |
| + incomplete = true // left for the next ordinary pass |
| continue |
| } |
| if err := reg.DeleteAlias(a.Alias); err != nil { |
| @@ -895,6 +869,10 @@ func ReconcileAliasesReport(ctx context.Context, s release.Store, reg *registry. |
| } |
| for _, e := range existingWild { |
| if _, ok := desiredWild[e.Host]; !ok { |
| + if noRemoval { |
| + incomplete = true // left for the next ordinary pass |
| + continue |
| + } |
| if err := reg.DeleteWildcardDomain(e.Host); err != nil { |
| log.Printf("domains: remove wildcard %s: %v", e.Host, err) |
| incomplete = true |
| @@ -919,6 +897,10 @@ func ReconcileAliasesReport(ctx context.Context, s release.Store, reg *registry. |
| } |
| for _, p := range existingPaths { |
| if _, ok := desiredPaths[p.Host+"\x00"+p.Prefix]; !ok { |
| + if noRemoval { |
| + incomplete = true // left for the next ordinary pass |
| + continue |
| + } |
| if err := reg.DeletePath(p.Host, p.Prefix); err != nil { |
| log.Printf("domains: remove path %s/%s: %v", p.Host, p.Prefix, err) |
| incomplete = true |
diff --git a/internal/domains/aliases_startup_test.go b/internal/domains/aliases_startup_test.go| new file mode 100644 |
| index 000000000..100c4673c |
| --- /dev/null |
| +++ b/internal/domains/aliases_startup_test.go |
| @@ -0,0 +1,56 @@ |
| +package domains |
| + |
| +import ( |
| + "context" |
| + "testing" |
| +) |
| + |
| +// TestStartupNoRemovalLeavesEveryTable: with AliasReport.StartupNoRemoval |
| +// set, a pass whose claims have all left the listing removes nothing from |
| +// route_aliases, wildcard_domains or route_paths and reports incomplete; the |
| +// same pass without the flag removes them all. |
| +func TestStartupNoRemovalLeavesEveryTable(t *testing.T) { |
| + e := newAliasEnv(t) |
| + addRoute(t, e.reg, "shop.example.com", "abc", "shop") |
| + addRoute(t, e.reg, "api.example.com", "abc", "api") |
| + putClaim(t, e.store, Claim{Host: "wild.example.org", Account: "abc", App: "shop", Route: "shop.example.com", Wildcard: true, Catchall: true}) |
| + putClaim(t, e.store, Claim{Host: "shop.example.com", Account: "abc", App: "shop", Paths: map[string]string{"api": "api.example.com"}}) |
| + e.mustPass() |
| + deleteClaim(t, e.store, "wild.example.org") |
| + deleteClaim(t, e.store, "shop.example.com") |
| + count := func() (int, int, int) { |
| + a, err := e.reg.ListAliases() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + w, err := e.reg.ListWildcardDomains() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + p, err := e.reg.ListPaths() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + return len(a), len(w), len(p) |
| + } |
| + a0, w0, p0 := count() |
| + if a0 == 0 || w0 == 0 || p0 == 0 { |
| + t.Fatalf("setup: aliases %d, wildcards %d, paths %d", a0, w0, p0) |
| + } |
| + rep := AliasReport{Complete: true, StartupNoRemoval: true} |
| + if err := ReconcileAliasesReport(context.Background(), e.store, e.reg, aliasNow(), known(), nil, &rep); err != nil { |
| + t.Fatal(err) |
| + } |
| + if rep.Complete { |
| + t.Fatal("a startup pass that left rows for removal reported complete") |
| + } |
| + if a, w, p := count(); a != a0 || w != w0 || p != p0 { |
| + t.Fatalf("startup pass removed rows: aliases %d->%d, wildcards %d->%d, paths %d->%d", a0, a, w0, w, p0, p) |
| + } |
| + if rep, err := e.pass(e.store, known(), nil); err != nil || !rep.Complete { |
| + t.Fatalf("ordinary pass: complete=%v err=%v", rep.Complete, err) |
| + } |
| + if a, w, p := count(); a != 0 || w != 0 || p != 0 { |
| + t.Fatalf("ordinary pass left rows: aliases %d, wildcards %d, paths %d", a, w, p) |
| + } |
| +} |
diff --git a/internal/domains/aliases_unread_keep_test.go b/internal/domains/aliases_unread_keep_test.go| deleted file mode 100644 |
| index 80415cf28..000000000 |
| --- a/internal/domains/aliases_unread_keep_test.go |
| +++ /dev/null |
| @@ -1,146 +0,0 @@ |
| -package domains |
| - |
| -import ( |
| - "context" |
| - "testing" |
| - |
| - "github.com/carlosframework/platform/internal/release" |
| -) |
| - |
| -// unreadKeysStore fails GET of every listed key in keys with a transient |
| -// (non-NotExist) error, the way a bucket read cut off by the pass's deadline |
| -// reads. The listing still shows the keys. |
| -type unreadKeysStore struct { |
| - *release.DirStore |
| - keys map[string]bool |
| -} |
| - |
| -func (u unreadKeysStore) Get(ctx context.Context, key string) ([]byte, string, error) { |
| - if u.keys[key] { |
| - return nil, "", context.DeadlineExceeded |
| - } |
| - return u.DirStore.Get(ctx, key) |
| -} |
| - |
| -// TestUnreadClaimKeepsItsExactAlias is the 2026-11-07 flagship shrink |
| -// (v0.34.14 annie). A box's first alias pass after an edge restart ran under |
| -// the startup HA ingress deadline with a cold ClaimCache; 75 claim GETs ran |
| -// out of time, and the pass deleted every alias row those claims had |
| -// derived. The next pass re-inserted them with a blank dns_status, and the |
| -// edges file withheld every custom domain until the DNS sweep stamped them |
| -// again, about a minute later. |
| -// |
| -// An exact-name alias whose own claim is listed but unread is kept exactly |
| -// as it is, DNS stamp included, and the pass reports incomplete. The rows |
| -// that rest on further authority (catch-all star, instance names, wildcard |
| -// parent, path prefixes) still go as before: that is the scope cut. A claim |
| -// that has left the listing still loses its row on the same kind of pass. |
| -func TestUnreadClaimKeepsItsExactAlias(t *testing.T) { |
| - e := newAliasEnv(t) |
| - addRoute(t, e.reg, "shop.example.com", "abc", "shop") |
| - addRoute(t, e.reg, "api.example.com", "abc", "api") |
| - putClaim(t, e.store, Claim{Host: "www.example.com", Account: "abc", App: "shop", Route: "shop.example.com"}) |
| - putClaim(t, e.store, Claim{Host: "gone.example.com", Account: "abc", App: "shop", Route: "shop.example.com"}) |
| - putClaim(t, e.store, Claim{Host: "wild.example.org", Account: "abc", App: "shop", Route: "shop.example.com", Wildcard: true, Catchall: true}) |
| - putClaim(t, e.store, Claim{Host: "shop.example.com", Account: "abc", App: "shop", Paths: map[string]string{"api": "api.example.com"}}) |
| - putClaim(t, e.store, Claim{Host: "example.net", Account: "abc", App: "shop-site"}) |
| - putClaim(t, e.store, Claim{Host: "*.example.net", Account: "abc", App: "shop", Instances: true}) |
| - addInstance(t, e.reg, "acme.abc.carlos.example.net", "acme", "abc", "shop") |
| - |
| - unread := unreadKeysStore{e.store, map[string]bool{ |
| - ClaimKey("www.example.com"): true, |
| - ClaimKey("gone.example.com"): true, |
| - ClaimKey("wild.example.org"): true, |
| - ClaimKey("shop.example.com"): true, |
| - ClaimKey("*.example.net"): true, |
| - }} |
| - for _, cached := range []bool{false, true} { |
| - e.mustPass() |
| - got := aliasMap(t, e.reg) |
| - for _, a := range []string{"www.example.com", "gone.example.com", "*.wild.example.org", "acme.example.net"} { |
| - if _, ok := got[a]; !ok { |
| - t.Fatalf("setup: alias %s not derived (have %v)", a, got) |
| - } |
| - } |
| - for _, a := range []string{"www.example.com", "gone.example.com"} { |
| - if err := e.reg.SetAliasDNSStatus(a, "pointing", 1755000000); err != nil { |
| - t.Fatal(err) |
| - } |
| - } |
| - var cache *ClaimCache |
| - if cached { |
| - cache = &ClaimCache{} // cold, as after a restart |
| - } |
| - rep, err := e.pass(unread, known(), cache) |
| - if err != nil { |
| - t.Fatalf("cache=%v: unread claims must not fail the pass: %v", cached, err) |
| - } |
| - if rep.Complete { |
| - t.Fatalf("cache=%v: the pass hid unread claims as complete", cached) |
| - } |
| - got = aliasMap(t, e.reg) |
| - for _, a := range []string{"www.example.com", "gone.example.com"} { |
| - row, ok := got[a] |
| - if !ok { |
| - t.Fatalf("cache=%v: alias %s was deleted on a pass that never read its claim", cached, a) |
| - } |
| - if row.DNSStatus != "pointing" { |
| - t.Fatalf("cache=%v: alias %s lost its DNS stamp (%q): the row was rewritten", cached, a, row.DNSStatus) |
| - } |
| - } |
| - for _, a := range []string{"*.wild.example.org", "acme.example.net"} { |
| - if _, ok := got[a]; ok { |
| - t.Fatalf("cache=%v: %s was kept; only exact aliases are (scope cut)", cached, a) |
| - } |
| - } |
| - } |
| - |
| - // Control: a claim that has left the listing is a detach, unread or not. |
| - deleteClaim(t, e.store, "gone.example.com") |
| - if _, err := e.pass(unread, known(), nil); err != nil { |
| - t.Fatal(err) |
| - } |
| - got := aliasMap(t, e.reg) |
| - if _, ok := got["gone.example.com"]; ok { |
| - t.Fatal("a detached claim's alias was kept") |
| - } |
| - if _, ok := got["www.example.com"]; !ok { |
| - t.Fatal("the unread claim's alias was dropped alongside the detach") |
| - } |
| -} |
| - |
| -// TestUnreadClaimKeepStillRefuses: every refusal the plain derivation can |
| -// make without the claim's body still removes a kept row: the target host |
| -// reused by another tenant, a local route now owning the name, and another |
| -// box serving the name as a route. |
| -func TestUnreadClaimKeepStillRefuses(t *testing.T) { |
| - cases := []struct { |
| - name string |
| - change func(e *aliasEnv) |
| - routes map[string]bool |
| - }{ |
| - {"target reused by another tenant", func(e *aliasEnv) { |
| - addRoute(t, e.reg, "shop.example.com", "xyz", "other") |
| - }, known()}, |
| - {"a local route owns the name", func(e *aliasEnv) { |
| - addRoute(t, e.reg, "www.example.com", "xyz", "other") |
| - }, known()}, |
| - {"another box serves the name as a route", func(e *aliasEnv) {}, map[string]bool{"www.example.com": true}}, |
| - } |
| - for _, c := range cases { |
| - t.Run(c.name, func(t *testing.T) { |
| - e := newAliasEnv(t) |
| - addRoute(t, e.reg, "shop.example.com", "abc", "shop") |
| - putClaim(t, e.store, Claim{Host: "www.example.com", Account: "abc", App: "shop", Route: "shop.example.com"}) |
| - e.mustPass() |
| - c.change(e) |
| - unread := unreadKeysStore{e.store, map[string]bool{ClaimKey("www.example.com"): true}} |
| - if _, err := e.pass(unread, c.routes, nil); err != nil { |
| - t.Fatal(err) |
| - } |
| - if _, ok := aliasMap(t, e.reg)["www.example.com"]; ok { |
| - t.Fatal("a kept alias survived a refusal the pass could see") |
| - } |
| - }) |
| - } |
| -} |
diff --git a/internal/host/agent.go b/internal/host/agent.go| index fe7325fc0..f2eeab8c0 100644 |
| --- a/internal/host/agent.go |
| +++ b/internal/host/agent.go |
| @@ -1385,13 +1385,16 @@ var aliasPassMu sync.Mutex |
| // home): a regional claim (#447) derives its regional_domains rows for this |
| // region's placement. |
| func aliasPassReporting(ctx context.Context, store release.Store, reg *registry.Registry, cache *domains.ClaimCache, auth *assetAuthority, region string) error { |
| - _, err := aliasPassReportingComplete(ctx, store, reg, cache, auth, region) |
| + _, err := aliasPassReportingComplete(ctx, store, reg, cache, auth, region, false) |
| return err |
| } |
| // aliasPassReportingComplete also returns completeness so startup retries a |
| // partial fold even when reconciliation kept rows without returning an error. |
| -func aliasPassReportingComplete(ctx context.Context, store release.Store, reg *registry.Registry, cache *domains.ClaimCache, auth *assetAuthority, region string) (bool, error) { |
| +// startup is true only for the startup HA ingress pass (runHAIngressStartup): |
| +// it sets domains.AliasReport.StartupNoRemoval, so a pass that could not read |
| +// every claim under the startup deadline never removes a row. |
| +func aliasPassReportingComplete(ctx context.Context, store release.Store, reg *registry.Registry, cache *domains.ClaimCache, auth *assetAuthority, region string, startup bool) (bool, error) { |
| for !aliasPassMu.TryLock() { |
| select { |
| case <-ctx.Done(): |
| @@ -1406,7 +1409,7 @@ func aliasPassReportingComplete(ctx context.Context, store release.Store, reg *r |
| start := auth.passBegin() |
| defer auth.passEnd() |
| deploymentRoutes, routesWhole := edgesfile.DeploymentRoutesComplete(ctx, store, time.Now()) |
| - rep := domains.AliasReport{DeploymentRoutesPartial: deploymentRoutes != nil && !routesWhole, Region: region} |
| + rep := domains.AliasReport{DeploymentRoutesPartial: deploymentRoutes != nil && !routesWhole, Region: region, StartupNoRemoval: startup} |
| if routes := boxHAIngress.routes.Load(); routes != nil { |
| rep.HAIngressRoutes = *routes |
| } |
diff --git a/internal/host/edgesfile_unread_claims_test.go b/internal/host/edgesfile_unread_claims_test.go| index 3a42af128..c8d57afef 100644 |
| --- a/internal/host/edgesfile_unread_claims_test.go |
| +++ b/internal/host/edgesfile_unread_claims_test.go |
| @@ -2,6 +2,9 @@ package host |
| import ( |
| "context" |
| + "encoding/json" |
| + "os" |
| + "reflect" |
| "strings" |
| "testing" |
| "time" |
| @@ -11,26 +14,44 @@ import ( |
| "github.com/carlosframework/platform/internal/release" |
| ) |
| -// claimGetTimeoutStore lists every claim but times out reading their bodies, |
| -// the way a restarted edge's first alias pass read them under the startup HA |
| -// ingress deadline on 2026-11-07. |
| -type claimGetTimeoutStore struct{ *release.DirStore } |
| +// slowClaimStore lists every claim, but a GET of a claim in slow blocks |
| +// until the caller's deadline, the way annie's claim reads did under the |
| +// startup HA ingress deadline on 2026-11-07. |
| +type slowClaimStore struct { |
| + *release.DirStore |
| + slow map[string]bool |
| +} |
| -func (s claimGetTimeoutStore) Get(ctx context.Context, key string) ([]byte, string, error) { |
| - if strings.HasPrefix(key, domains.ClaimsPrefix) { |
| - return nil, "", context.DeadlineExceeded |
| +func (s slowClaimStore) Get(ctx context.Context, key string) ([]byte, string, error) { |
| + if s.slow[key] { |
| + <-ctx.Done() |
| + return nil, "", ctx.Err() |
| } |
| return s.DirStore.Get(ctx, key) |
| } |
| -// TestEdgesFileKeepsAliasesWhenClaimReadsTimeOut is the production-wired |
| -// witness for the 2026-11-07 flagship shrink: the alias pass the agent runs |
| -// (aliasPassReportingComplete, through the box's own ClaimCache) over a |
| -// store whose claim reads time out, then the edges file the box publishes. |
| -// The custom domain must still be published, which means its row kept the |
| -// DNS stamp the sweep gave it: a re-inserted row is withheld until the next |
| -// sweep. |
| -func TestEdgesFileKeepsAliasesWhenClaimReadsTimeOut(t *testing.T) { |
| +func putStartupClaim(t *testing.T, s release.Store, c domains.Claim) { |
| + t.Helper() |
| + c.Schema = 1 |
| + c.CreatedAt = time.Now().UTC().Format(time.RFC3339) |
| + body, err := json.Marshal(c) |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if _, err := s.Put(context.Background(), domains.ClaimKey(c.Host), body, ""); err != nil { |
| + t.Fatal(err) |
| + } |
| +} |
| + |
| +// TestStartupAliasPassRemovesNothing is the production-wired witness for |
| +// the 2026-11-07 flagship shrink. The startup alias pass (aliasPassReportingComplete |
| +// with startup set, as runHAIngressStartup runs it) over a cold claim cache, with some claim |
| +// reads blocking past the startup deadline, must leave every alias row |
| +// exactly as it was (plain, catch-all and instance names, DNS stamps |
| +// included) and report incomplete. The ordinary pass on a healthy store |
| +// then removes exactly the one row whose claim left the listing, so the |
| +// startup flag did not leak into it. |
| +func TestStartupAliasPassRemovesNothing(t *testing.T) { |
| aliasClaimCache.Reset() |
| oldAuthority := boxAssetAuthority |
| boxAssetAuthority = newAssetAuthority(nil) |
| @@ -42,38 +63,123 @@ func TestEdgesFileKeepsAliasesWhenClaimReadsTimeOut(t *testing.T) { |
| ctx := context.Background() |
| store := release.NewDirStore(t.TempDir()) |
| reg := edgesTestRegistry(t) |
| - if err := reg.Upsert(registry.Route{Host: "shop.example.com", Account: "abc", App: "shop", Kind: "instance", Status: "ready"}); err != nil { |
| - t.Fatal(err) |
| + for _, rt := range []registry.Route{ |
| + {Host: "shop.example.com", Account: "abc", App: "shop", Kind: "instance", Status: "ready"}, |
| + {Host: "acme.abc.carlos.example.net", Slug: "acme", Account: "abc", App: "shop", Kind: "instance", Status: "ready"}, |
| + } { |
| + if err := reg.Upsert(rt); err != nil { |
| + t.Fatal(err) |
| + } |
| } |
| - if _, _, err := domains.AttachClaim(ctx, store, domains.Claim{Host: "www.example.org", Account: "abc", App: "shop", Route: "shop.example.com"}); err != nil { |
| + if err := reg.SetProvisioned("acme.abc.carlos.example.net", true); err != nil { |
| t.Fatal(err) |
| } |
| - ident := edgesFile{Box: "annie"} |
| - publish := func() map[string]edgeHost { |
| - t.Helper() |
| - var last []byte |
| - if err := edgesFileWrite(ctx, store, reg, ident, "203.0.113.1", &last, true); err != nil { |
| + for _, c := range []domains.Claim{ |
| + {Host: "www.example.org", Account: "abc", App: "shop", Route: "shop.example.com"}, |
| + {Host: "gone.example.org", Account: "abc", App: "shop", Route: "shop.example.com"}, |
| + {Host: "wild.example.org", Account: "abc", App: "shop", Route: "shop.example.com", Wildcard: true, Catchall: true}, |
| + {Host: "example.net", Account: "abc", App: "shop-site"}, |
| + {Host: "*.example.net", Account: "abc", App: "shop", Instances: true}, |
| + } { |
| + putStartupClaim(t, store, c) |
| + } |
| + |
| + if ok, err := aliasPassReportingComplete(ctx, store, reg, &aliasClaimCache, boxAssetAuthority, "", false); err != nil || !ok { |
| + t.Fatalf("setup pass: complete=%v err=%v", ok, err) |
| + } |
| + for _, a := range []string{"www.example.org", "gone.example.org", "wild.example.org", "*.wild.example.org", "acme.example.net"} { |
| + if err := reg.SetAliasDNSStatus(a, "pointing", time.Now().Unix()); err != nil { |
| t.Fatal(err) |
| } |
| - return readEdgesFile(t, store, "annie").Hosts |
| + } |
| + before, err := reg.ListAliases() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if len(before) != 5 { |
| + t.Fatalf("setup: want three plain, a catch-all and an instance row, have %+v", before) |
| + } |
| + wildBefore, err := reg.ListWildcardDomains() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + |
| + // Restart: cold cache, the claims that derived every row blocked past |
| + // the startup deadline. |
| + aliasClaimCache.Reset() |
| + slow := slowClaimStore{store, map[string]bool{ |
| + domains.ClaimKey("www.example.org"): true, |
| + domains.ClaimKey("gone.example.org"): true, |
| + domains.ClaimKey("wild.example.org"): true, |
| + domains.ClaimKey("*.example.net"): true, |
| + }} |
| + attempt, cancel := context.WithTimeout(ctx, haIngressStartupAttempt) |
| + ok, _ := aliasPassReportingComplete(attempt, slow, reg, &aliasClaimCache, boxAssetAuthority, "", true) |
| + cancel() |
| + if ok { |
| + t.Fatal("a startup pass whose claim reads timed out reported complete") |
| + } |
| + after, err := reg.ListAliases() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if !reflect.DeepEqual(before, after) { |
| + t.Fatalf("the startup pass changed route_aliases:\nbefore %+v\nafter %+v", before, after) |
| + } |
| + wildAfter, err := reg.ListWildcardDomains() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if !reflect.DeepEqual(wildBefore, wildAfter) { |
| + t.Fatalf("the startup pass changed wildcard_domains: %+v -> %+v", wildBefore, wildAfter) |
| } |
| - if ok, err := aliasPassReportingComplete(ctx, store, reg, &aliasClaimCache, boxAssetAuthority, ""); err != nil || !ok { |
| - t.Fatalf("control pass: complete=%v err=%v", ok, err) |
| + // The ordinary pass, healthy store, one claim detached: that row alone goes. |
| + if err := store.Delete(ctx, domains.ClaimKey("gone.example.org")); err != nil { |
| + t.Fatal(err) |
| + } |
| + if ok, err := aliasPassReportingComplete(ctx, store, reg, &aliasClaimCache, boxAssetAuthority, "", false); err != nil || !ok { |
| + t.Fatalf("ordinary pass: complete=%v err=%v", ok, err) |
| } |
| - if err := reg.SetAliasDNSStatus("www.example.org", "pointing", time.Now().Unix()); err != nil { |
| + final, err := reg.ListAliases() |
| + if err != nil { |
| t.Fatal(err) |
| } |
| - if _, ok := publish()["www.example.org"]; !ok { |
| - t.Fatal("control: the stamped alias is not in the edges file") |
| + var want []registry.RouteAlias |
| + for _, a := range before { |
| + if a.Alias != "gone.example.org" { |
| + want = append(want, a) |
| + } |
| + } |
| + if !reflect.DeepEqual(want, final) { |
| + t.Fatalf("the ordinary pass must remove exactly gone.example.org:\nwant %+v\nhave %+v", want, final) |
| } |
| +} |
| - aliasClaimCache.Reset() // cold, as after a restart |
| - ok, _ := aliasPassReportingComplete(ctx, claimGetTimeoutStore{store}, reg, &aliasClaimCache, boxAssetAuthority, "") |
| - if ok { |
| - t.Fatal("a pass that read no claim bodies reported complete") |
| +// TestStartupUsesTheNoRemovalPass pins the wiring: runHAIngressStartup's |
| +// alias pass has startup set, the ordinary pass does not, and the flag |
| +// reaches the report only through that parameter. |
| +func TestStartupUsesTheNoRemovalPass(t *testing.T) { |
| + src, err := readHostSource("haingress.go") |
| + if err != nil { |
| + t.Fatal(err) |
| } |
| - if _, ok := publish()["www.example.org"]; !ok { |
| - t.Fatal("the edges file dropped a custom domain after a pass that could not read its claim") |
| + body := src[strings.Index(src, "func runHAIngressStartup("):] |
| + body = body[:strings.Index(body, "\n}\n")] |
| + if strings.Count(body, "aliasPassReportingComplete(") != 1 || !strings.Contains(body, "provisionTickConfig(os.Getenv).Region, true)") { |
| + t.Fatal("runHAIngressStartup must run the alias pass with startup set, and only that") |
| } |
| + agent, err := readHostSource("agent.go") |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + if strings.Count(agent, "StartupNoRemoval: startup") != 1 || strings.Contains(agent, "StartupNoRemoval: true") || |
| + !strings.Contains(agent, "aliasPassReportingComplete(ctx, store, reg, cache, auth, region, false)") { |
| + t.Fatal("StartupNoRemoval must be set only through the startup parameter, and the ordinary pass must pass false") |
| + } |
| +} |
| + |
| +func readHostSource(name string) (string, error) { |
| + b, err := os.ReadFile(name) |
| + return string(b), err |
| } |
diff --git a/internal/host/group_names_test.go b/internal/host/group_names_test.go| index 7bbee3c2d..d6fefe7a8 100644 |
| --- a/internal/host/group_names_test.go |
| +++ b/internal/host/group_names_test.go |
| @@ -388,10 +388,9 @@ func (p *haIngressProjection) publishAliases(names map[string]Route) { p.aliases |
| // - ReconcileSidecars withdraws synthetic sidecar names by the same proof. |
| // - ReconcileAliasesReport retains regional exact and catchall claim names and |
| // their region-selected target; it creates no locally runnable route. |
| -// - ReconcileAliasesReport keeps an existing plain alias row whose own claim |
| -// was listed but unread this pass (fix-incomplete-domains-pass), only |
| -// while the plain derivation's body-free refusals still pass; it mints no |
| -// name and no new class, and every other class is removed as before. |
| +// - ReconcileAliasesReport with StartupNoRemoval (the startup HA ingress |
| +// pass only) removes no alias, wildcard or path row and is incomplete; |
| +// it mints no name and changes no class (fix-incomplete-domains-pass). |
| // - Reload blocks ingress for held, unready, import-gated and sidecar names. |
| // - foldRegional preserves the regional claim and marks exact-route conflicts. |
| // - edgesFileWriteClaims omits local hosts outside the configured pool; it |
| @@ -414,7 +413,7 @@ var groupNameProducerInventory = map[string]string{ |
| "../provision/haingress.go:HAIngressRoutesFromRecords": "731822d67daf83884aa037e2a42e0dd3358edc9a31cecba45a609672a88dc7c3", |
| "../provision/demo_claim_seed.go:abortDemoClaimSeed": "e010b4e6b026a0744b7eacf6ffdb09647de6e1541e33ce73e71e7c99964a9f7a", |
| - "../domains/aliases.go:ReconcileAliasesReport": "91d61105ead8c852be296c057f31fb5daa2950de1742f028568abedd27ef93dd", |
| + "../domains/aliases.go:ReconcileAliasesReport": "7e8b5d72f23f5e540fc9504666b05098c78fbd3b1c77a84654898f8a121df459", |
| "../domains/aliases.go:deriveInstanceAliases": "47b40b392927d9c50cab6c350083af24565e4e148cd1b5ddc257e9803153c0c2", |
| "../domains/aliases.go:deriveRegional": "79fd7c432e6b0a9ffd945312851e52af2c450769416ef44ff9a4bea681b44cde", |
| "../domains/reconcile.go:Reconcile": "8b2848535d0a15117d578ac28c7486997c6ad8960b58b6dca5d4b35cde14eed0", |
diff --git a/internal/host/haingress.go b/internal/host/haingress.go| index 157afdaba..37a0c4833 100644 |
| --- a/internal/host/haingress.go |
| +++ b/internal/host/haingress.go |
| @@ -136,6 +136,10 @@ func wireHAIngressScan(ctx context.Context, s release.Store, cfg *provision.Reco |
| } |
| } |
| +// haIngressStartupAttempt bounds each startup attempt, its alias pass |
| +// included. |
| +const haIngressStartupAttempt = 5 * time.Second |
| + |
| // runHAIngressStartup finishes after success or three retries. The existing |
| // instances and record-view loops own every later refresh. |
| func runHAIngressStartup(ctx context.Context, open func(context.Context) (release.Store, error), judge *provision.LifetimeJudge, reg *registry.Registry) { |
| @@ -152,7 +156,7 @@ func runHAIngressStartup(ctx context.Context, open func(context.Context) (releas |
| if ctx.Err() != nil { |
| return |
| } |
| - attempt, cancel := context.WithTimeout(ctx, 5*time.Second) |
| + attempt, cancel := context.WithTimeout(ctx, haIngressStartupAttempt) |
| attempt = provision.WithLifetimes(attempt, judge) |
| err := refreshHAIngressAtStart(attempt, open, judge) |
| if err == nil { |
| @@ -160,7 +164,7 @@ func runHAIngressStartup(ctx context.Context, open func(context.Context) (releas |
| store, err = open(attempt) |
| if err == nil { |
| var complete bool |
| - complete, err = aliasPassReportingComplete(attempt, store, reg, &aliasClaimCache, boxAssetAuthority, provisionTickConfig(os.Getenv).Region) |
| + complete, err = aliasPassReportingComplete(attempt, store, reg, &aliasClaimCache, boxAssetAuthority, provisionTickConfig(os.Getenv).Region, true) |
| if !complete { |
| err = errors.Join(err, errors.New("HA ingress: incomplete startup alias pass")) |
| } |
diff --git a/internal/host/haingress_startup_test.go b/internal/host/haingress_startup_test.go| index 080714994..696124449 100644 |
| --- a/internal/host/haingress_startup_test.go |
| +++ b/internal/host/haingress_startup_test.go |
| @@ -298,7 +298,7 @@ func TestHAIngressStartupAliasLockDeadline(t *testing.T) { |
| ctx, cancel := context.WithTimeout(t.Context(), 30*time.Millisecond) |
| defer cancel() |
| start := time.Now() |
| - complete, err := aliasPassReportingComplete(ctx, nil, nil, &aliasClaimCache, boxAssetAuthority, "") |
| + complete, err := aliasPassReportingComplete(ctx, nil, nil, &aliasClaimCache, boxAssetAuthority, "", false) |
| if complete || err != context.DeadlineExceeded || time.Since(start) > time.Second { |
| t.Fatalf("startup alias lock deadline: complete=%v err=%v elapsed=%s", complete, err, time.Since(start)) |
| } |
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv| index 2d963ac9e..feebf54e9 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -112,4 +112,4 @@ plan14-root-reads-demo-snapshot-unit-check.tsv 1e83ce23d7d1306e3963f802fecf8c914 |
| plan14-root-reads-region-ha-g2-fixes.tsv 3c1d54d297da31d147cdb4e1ad4627f759c8cb8eae2db53cc92218db35e59c7b |
| plan14-root-reads-fix-asset-e2e-unsized-flake.tsv 3c1d54d297da31d147cdb4e1ad4627f759c8cb8eae2db53cc92218db35e59c7b |
| plan14-root-reads-region-ha-g2r-fixes.tsv 5c6f157c56e24dc835edc534c5dc0e043e6527e8116e5bb470e68e4fd271796c |
| -plan14-root-reads-fix-incomplete-domains-pass.tsv 89f774f48752b6d65ada2e6e9362c2aebb2ee39f505b4f909fb2188de0521721 |
| +plan14-root-reads-fix-incomplete-domains-pass.tsv 61027a32e31cb7ce017304f526f668c26980999e2699a3013a82e2630164143e |
diff --git a/internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv b/internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv| index c2e9cc4cc..0c556dbd0 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv |
| @@ -1,5 +1,8 @@ |
| # Census overlay fix-incomplete-domains-pass, written by census-propose (#369). census-ruling-fix-incomplete-domains-pass, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md. |
| -# 0 body, 1 sites, 1 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| -@legacy 50e6359a5a1c4d457755439dd4f888b2ae7849179294384a0b6a2720d853a54e internal/domains/aliases.go ReconcileAliasesReport legacy accepted-legacy 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=scope cut after census rounds 1-3: keeps ONLY an exact-name route_aliases row whose own claim is listed but not read this pass (relevantDropped hosts, so a complete pass keeps nothing), via keepUnreadAlias, and only while every refusal the plain derivation makes without the claim body still passes on rows this pass read: target route local with the row account and app, no local route owns the name, deploymentRoutes does not name it, normalised name, no sidecar suffix on either end; catch-all, instance, wildcard_domains and route_paths removal unchanged from main; no new registry, file or bucket read; deletes less, never more; no root pass calls it; no root decision registry:Account@19568,registry:Account@21583,registry:Account@21598,registry:Account@21716,registry:Account@22068,registry:Account@22081,registry:Alias@19123,registry:Alias@19153,registry:Alias@19213,registry:Alias@19336,registry:Alias@19358,registry:Alias@19412,registry:Alias@19448,registry:Alias@19625,registry:Alias@19710,registry:Alias@19780,registry:App@14459,registry:App@14659,registry:App@14815,registry:App@15016,registry:App@19521,registry:App@19531,registry:App@21611,registry:App@21622,registry:App@21729,registry:App@22094,registry:App@22103,registry:App@4510,registry:App@4706,registry:App@8330,registry:App@8529,registry:Host@15382,registry:Host@19258,registry:Host@19498,registry:Host@21393,registry:Host@21468,registry:Host@21491,registry:Host@21543,registry:Host@21877,registry:Host@21949,registry:Host@22053,registry:Host@22364,registry:Host@22417,registry:Host@22489,registry:Host@23023,registry:Host@23136,registry:Host@23195,registry:Host@23276,registry:Host@834,registry:Prefix@23031,registry:Prefix@23150,registry:Prefix@23203,registry:Prefix@23284,registry:Region@21738,registry:Status@11193,registry:Target@21563,registry:Target@21668,whole:RegionalDomain@20357,whole:RegionalDomain@20375,whole:RegionalDomain@21321,whole:RegionalDomain@21359,whole:RegionalDomain@21380,whole:RegionalDomain@21403,whole:RegionalDomain@21530,whole:RegionalDomain@276,whole:RegionalDomain@2961,whole:RegionalDomain@3162,whole:Route@1045,whole:Route@10523,whole:Route@10975,whole:Route@11137,whole:Route@14428,whole:Route@14503,whole:Route@14650,whole:Route@1470,whole:Route@14712,whole:Route@14855,whole:Route@15011,whole:Route@16264,whole:Route@17359,whole:Route@17367,whole:Route@19405,whole:Route@19491,whole:Route@19561,whole:Route@21661,whole:Route@21712,whole:Route@3143,whole:Route@337,whole:Route@3562,whole:Route@3853,whole:Route@4550,whole:Route@4701,whole:Route@4757,whole:Route@7676,whole:Route@787,whole:Route@816,whole:Route@827,whole:Route@8374,whole:Route@845,whole:Route@8520,whole:RouteAlias@1478,whole:RouteAlias@17375,whole:RouteAlias@19600,whole:RouteAlias@19658,whole:RoutePath@12720,whole:RoutePath@22916,whole:RoutePath@22958,whole:RoutePath@23093,whole:RoutePath@23123,whole:WildcardDomain@15578,whole:WildcardDomain@21427,whole:WildcardDomain@21456,whole:WildcardDomain@21937,whole:WildcardDomain@21959,whole:WildcardDomain@21983,whole:WildcardDomain@22032,whole:WildcardDomain@22195,whole:WildcardDomain@22323,whole:WildcardDomain@22352,whole:WildcardDomain@3376 c08fd2ead16dfbe8c280f09bd8d580c2e1d94add8ae4f18f611ad8160095c0af |
| -internal/domains/aliases.go ReconcileAliasesReport legacy accepted-legacy 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=scope cut after census rounds 1-3: keeps ONLY an exact-name route_aliases row whose own claim is listed but not read this pass (relevantDropped hosts, so a complete pass keeps nothing), via keepUnreadAlias, and only while every refusal the plain derivation makes without the claim body still passes on rows this pass read: target route local with the row account and app, no local route owns the name, deploymentRoutes does not name it, normalised name, no sidecar suffix on either end; catch-all, instance, wildcard_domains and route_paths removal unchanged from main; no new registry, file or bucket read; deletes less, never more; no root pass calls it; no root decision registry:Account@19568,registry:Account@21583,registry:Account@21598,registry:Account@21716,registry:Account@22068,registry:Account@22081,registry:Alias@19123,registry:Alias@19153,registry:Alias@19213,registry:Alias@19336,registry:Alias@19358,registry:Alias@19412,registry:Alias@19448,registry:Alias@19625,registry:Alias@19710,registry:Alias@19780,registry:App@14459,registry:App@14659,registry:App@14815,registry:App@15016,registry:App@19521,registry:App@19531,registry:App@21611,registry:App@21622,registry:App@21729,registry:App@22094,registry:App@22103,registry:App@4510,registry:App@4706,registry:App@8330,registry:App@8529,registry:Host@15382,registry:Host@19258,registry:Host@19498,registry:Host@21393,registry:Host@21468,registry:Host@21491,registry:Host@21543,registry:Host@21877,registry:Host@21949,registry:Host@22053,registry:Host@22364,registry:Host@22417,registry:Host@22489,registry:Host@23023,registry:Host@23136,registry:Host@23195,registry:Host@23276,registry:Host@834,registry:Prefix@23031,registry:Prefix@23150,registry:Prefix@23203,registry:Prefix@23284,registry:Region@21738,registry:Status@11193,registry:Target@21563,registry:Target@21668,whole:RegionalDomain@20357,whole:RegionalDomain@20375,whole:RegionalDomain@21321,whole:RegionalDomain@21359,whole:RegionalDomain@21380,whole:RegionalDomain@21403,whole:RegionalDomain@21530,whole:RegionalDomain@276,whole:RegionalDomain@2961,whole:RegionalDomain@3162,whole:Route@1045,whole:Route@10523,whole:Route@10975,whole:Route@11137,whole:Route@14428,whole:Route@14503,whole:Route@14650,whole:Route@1470,whole:Route@14712,whole:Route@14855,whole:Route@15011,whole:Route@16264,whole:Route@17359,whole:Route@17367,whole:Route@19405,whole:Route@19491,whole:Route@19561,whole:Route@21661,whole:Route@21712,whole:Route@3143,whole:Route@337,whole:Route@3562,whole:Route@3853,whole:Route@4550,whole:Route@4701,whole:Route@4757,whole:Route@7676,whole:Route@787,whole:Route@816,whole:Route@827,whole:Route@8374,whole:Route@845,whole:Route@8520,whole:RouteAlias@1478,whole:RouteAlias@17375,whole:RouteAlias@19600,whole:RouteAlias@19658,whole:RoutePath@12720,whole:RoutePath@22916,whole:RoutePath@22958,whole:RoutePath@23093,whole:RoutePath@23123,whole:WildcardDomain@15578,whole:WildcardDomain@21427,whole:WildcardDomain@21456,whole:WildcardDomain@21937,whole:WildcardDomain@21959,whole:WildcardDomain@21983,whole:WildcardDomain@22032,whole:WildcardDomain@22195,whole:WildcardDomain@22323,whole:WildcardDomain@22352,whole:WildcardDomain@3376 c08fd2ead16dfbe8c280f09bd8d580c2e1d94add8ae4f18f611ad8160095c0af |
| -@coverage internal/domains 6f3e7804be3d20121919542e89d96529e51cda401345c74e307a9f1be54698e9 |
| +# 2 body, 0 sites, 2 envelope: each changed unit re-frozen at its existing disposition with its claim appended. |
| +@legacy 20f509e213335e884339f7d3d0b0d301a678f6d7252233647d8644d8125404fb internal/domains/aliases.go ReconcileAliasesReport legacy accepted-legacy 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 registry:Account@19542,registry:Account@19557,registry:Account@19675,registry:Account@20027,registry:Account@20040,registry:Alias@17536,registry:Alias@17669,registry:Alias@17739,registry:App@14167,registry:App@14367,registry:App@14523,registry:App@14724,registry:App@19570,registry:App@19581,registry:App@19688,registry:App@20053,registry:App@20062,registry:App@4218,registry:App@4414,registry:App@8038,registry:App@8237,registry:Host@15090,registry:Host@19352,registry:Host@19427,registry:Host@19450,registry:Host@19502,registry:Host@19836,registry:Host@19908,registry:Host@20012,registry:Host@20323,registry:Host@20469,registry:Host@20541,registry:Host@21075,registry:Host@21188,registry:Host@21340,registry:Host@21421,registry:Host@834,registry:Prefix@21083,registry:Prefix@21202,registry:Prefix@21348,registry:Prefix@21429,registry:Region@19697,registry:Status@10901,registry:Target@19522,registry:Target@19627,whole:RegionalDomain@18316,whole:RegionalDomain@18334,whole:RegionalDomain@19280,whole:RegionalDomain@19318,whole:RegionalDomain@19339,whole:RegionalDomain@19362,whole:RegionalDomain@19489,whole:RegionalDomain@2669,whole:RegionalDomain@276,whole:RegionalDomain@2870,whole:Route@10231,whole:Route@1045,whole:Route@10683,whole:Route@10845,whole:Route@1237,whole:Route@14136,whole:Route@14211,whole:Route@14358,whole:Route@14420,whole:Route@14563,whole:Route@14719,whole:Route@15972,whole:Route@17067,whole:Route@17075,whole:Route@19620,whole:Route@19671,whole:Route@2851,whole:Route@3270,whole:Route@337,whole:Route@3561,whole:Route@4258,whole:Route@4409,whole:Route@4465,whole:Route@7384,whole:Route@787,whole:Route@8082,whole:Route@816,whole:Route@8228,whole:Route@827,whole:Route@845,whole:RouteAlias@1245,whole:RouteAlias@17083,whole:RouteAlias@17511,whole:RoutePath@12428,whole:RoutePath@20968,whole:RoutePath@21010,whole:RoutePath@21145,whole:RoutePath@21175,whole:WildcardDomain@15286,whole:WildcardDomain@19386,whole:WildcardDomain@19415,whole:WildcardDomain@19896,whole:WildcardDomain@19918,whole:WildcardDomain@19942,whole:WildcardDomain@19991,whole:WildcardDomain@20154,whole:WildcardDomain@20282,whole:WildcardDomain@20311,whole:WildcardDomain@3084 869ecac5f880354600f21f2d3581bb67870f0415d6e5a2889c582016357d3b47 |
| +@legacy cdd97b97486c72e1d6c832d48c99789f5424f8f42acd3410f1bdcde14e403311 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 whole:RegionalDomain@1560,whole:Route@1638,whole:Route@739,whole:Route@761,whole:Route@780 d66fa16382a4a6150b184da6ff888adcc843dcc028c36ec5c867e81ab250eef5 |
| +internal/domains/aliases.go ReconcileAliasesReport legacy accepted-legacy 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 registry:Account@19542,registry:Account@19557,registry:Account@19675,registry:Account@20027,registry:Account@20040,registry:Alias@17536,registry:Alias@17669,registry:Alias@17739,registry:App@14167,registry:App@14367,registry:App@14523,registry:App@14724,registry:App@19570,registry:App@19581,registry:App@19688,registry:App@20053,registry:App@20062,registry:App@4218,registry:App@4414,registry:App@8038,registry:App@8237,registry:Host@15090,registry:Host@19352,registry:Host@19427,registry:Host@19450,registry:Host@19502,registry:Host@19836,registry:Host@19908,registry:Host@20012,registry:Host@20323,registry:Host@20469,registry:Host@20541,registry:Host@21075,registry:Host@21188,registry:Host@21340,registry:Host@21421,registry:Host@834,registry:Prefix@21083,registry:Prefix@21202,registry:Prefix@21348,registry:Prefix@21429,registry:Region@19697,registry:Status@10901,registry:Target@19522,registry:Target@19627,whole:RegionalDomain@18316,whole:RegionalDomain@18334,whole:RegionalDomain@19280,whole:RegionalDomain@19318,whole:RegionalDomain@19339,whole:RegionalDomain@19362,whole:RegionalDomain@19489,whole:RegionalDomain@2669,whole:RegionalDomain@276,whole:RegionalDomain@2870,whole:Route@10231,whole:Route@1045,whole:Route@10683,whole:Route@10845,whole:Route@1237,whole:Route@14136,whole:Route@14211,whole:Route@14358,whole:Route@14420,whole:Route@14563,whole:Route@14719,whole:Route@15972,whole:Route@17067,whole:Route@17075,whole:Route@19620,whole:Route@19671,whole:Route@2851,whole:Route@3270,whole:Route@337,whole:Route@3561,whole:Route@4258,whole:Route@4409,whole:Route@4465,whole:Route@7384,whole:Route@787,whole:Route@8082,whole:Route@816,whole:Route@8228,whole:Route@827,whole:Route@845,whole:RouteAlias@1245,whole:RouteAlias@17083,whole:RouteAlias@17511,whole:RoutePath@12428,whole:RoutePath@20968,whole:RoutePath@21010,whole:RoutePath@21145,whole:RoutePath@21175,whole:WildcardDomain@15286,whole:WildcardDomain@19386,whole:WildcardDomain@19415,whole:WildcardDomain@19896,whole:WildcardDomain@19918,whole:WildcardDomain@19942,whole:WildcardDomain@19991,whole:WildcardDomain@20154,whole:WildcardDomain@20282,whole:WildcardDomain@20311,whole:WildcardDomain@3084 869ecac5f880354600f21f2d3581bb67870f0415d6e5a2889c582016357d3b47 |
| +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 whole:RegionalDomain@1560,whole:Route@1638,whole:Route@739,whole:Route@761,whole:Route@780 d66fa16382a4a6150b184da6ff888adcc843dcc028c36ec5c867e81ab250eef5 |
| +@coverage internal/domains edd6a5b74fafc84e66428acba400daa0518708cff714974d2104ad977f992b4b |
| +@coverage internal/host 8b3fe4adf55965bb8f4b110a154b3989ae48496721de4b5fd10a1a5e81105e0a |