domains: the startup alias pass removes nothing
On 2026-11-07 (v0.34.14 flagship) annie's startup HA ingress alias pass (98c43eea) ran under a 5 s deadline on a cold claim cache. 75 claim GETs timed out, and it removed every custom domain those claims derived. The next pass re-inserted the rows with a blank dns_status, so the edges file withheld 58 hosts for about 60 s and other edges answered 404. 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). Census census-ruling-fix-incomplete- domains-pass approved by Astra (#280). Analysis and the ordinary-pass follow-up on #421. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Squashed from fix-incomplete-domains-pass into main.
10 files changed,
+317
−7
docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md+21 −0internal/domains/aliases.go+29 −0internal/domains/aliases_startup_test.go+56 −0internal/host/agent.go+6 −3internal/host/edgesfile_unread_claims_test.go+185 −0internal/host/group_names_test.go+4 −1internal/host/haingress.go+6 −2internal/host/haingress_startup_test.go+1 −1internal/provision/testdata/plan14-root-reads-chain.tsv+1 −0internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv+8 −0
CI failed — 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| new file mode 100644 |
| index 000000000..19895a52a |
| --- /dev/null |
| +++ b/docs/superpowers/notes/census-proposal-fix-incomplete-domains-pass.md |
| @@ -0,0 +1,21 @@ |
| +# Census approval: fix-incomplete-domains-pass |
| + |
| +Ruling `census-ruling-fix-incomplete-domains-pass`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26). |
| + |
| +| unit | change | read sites | what changed | |
| +|---|---|---|---| |
| +| `internal/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`, `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` → `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 2a6395b52..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 |
| @@ -771,8 +787,13 @@ func ReconcileAliasesReport(ctx context.Context, s release.Store, reg *registry. |
| }, reg, now) { |
| incomplete = true |
| } |
| + noRemoval := rep != nil && rep.StartupNoRemoval |
| for _, a := range existing { |
| if !desired[a.Alias] { |
| + if noRemoval { |
| + incomplete = true // left for the next ordinary pass |
| + continue |
| + } |
| if err := reg.DeleteAlias(a.Alias); err != nil { |
| log.Printf("domains: remove alias %s: %v", a.Alias, err) |
| incomplete = true |
| @@ -848,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 |
| @@ -872,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/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| new file mode 100644 |
| index 000000000..c8d57afef |
| --- /dev/null |
| +++ b/internal/host/edgesfile_unread_claims_test.go |
| @@ -0,0 +1,185 @@ |
| +package host |
| + |
| +import ( |
| + "context" |
| + "encoding/json" |
| + "os" |
| + "reflect" |
| + "strings" |
| + "testing" |
| + "time" |
| + |
| + "github.com/carlosframework/platform/internal/domains" |
| + "github.com/carlosframework/platform/internal/registry" |
| + "github.com/carlosframework/platform/internal/release" |
| +) |
| + |
| +// 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 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) |
| +} |
| + |
| +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) |
| + t.Cleanup(func() { |
| + aliasClaimCache.Reset() |
| + boxAssetAuthority = oldAuthority |
| + }) |
| + t.Setenv("CARLOS_REGION_HA", "") |
| + ctx := context.Background() |
| + store := release.NewDirStore(t.TempDir()) |
| + reg := edgesTestRegistry(t) |
| + 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 := reg.SetProvisioned("acme.abc.carlos.example.net", true); err != nil { |
| + t.Fatal(err) |
| + } |
| + 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) |
| + } |
| + } |
| + 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) |
| + } |
| + |
| + // 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) |
| + } |
| + final, err := reg.ListAliases() |
| + if err != nil { |
| + t.Fatal(err) |
| + } |
| + 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) |
| + } |
| +} |
| + |
| +// 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) |
| + } |
| + 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 a4ff5458f..d6fefe7a8 100644 |
| --- a/internal/host/group_names_test.go |
| +++ b/internal/host/group_names_test.go |
| @@ -388,6 +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 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 |
| @@ -410,7 +413,7 @@ var groupNameProducerInventory = map[string]string{ |
| "../provision/haingress.go:HAIngressRoutesFromRecords": "731822d67daf83884aa037e2a42e0dd3358edc9a31cecba45a609672a88dc7c3", |
| "../provision/demo_claim_seed.go:abortDemoClaimSeed": "e010b4e6b026a0744b7eacf6ffdb09647de6e1541e33ce73e71e7c99964a9f7a", |
| - "../domains/aliases.go:ReconcileAliasesReport": "845b0a1b0c3ddd5a161a5ba5fae1e4bad3c80a9be2079e4ee3de67078af54ee1", |
| + "../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 f6e79a931..feebf54e9 100644 |
| --- a/internal/provision/testdata/plan14-root-reads-chain.tsv |
| +++ b/internal/provision/testdata/plan14-root-reads-chain.tsv |
| @@ -112,3 +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 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| new file mode 100644 |
| index 000000000..0c556dbd0 |
| --- /dev/null |
| +++ b/internal/provision/testdata/plan14-root-reads-fix-incomplete-domains-pass.tsv |
| @@ -0,0 +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. |
| +# 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 |