edge: account subdomain review fixes, round 1 (T4)
The new wildcard parent tests used a tenant's domain as the static parent; they now use static.test. The read-error test captures the log output it causes, asserts the names-read diagnostic, and restores the logger in cleanup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
internal/edge/wildcard_parents_test.go+15 −6
CI passed — run details
Intent
<task-notification> <task-id>a94c09830561f6f62</task-id> <tool-use-id>toolu_01YBCKHLrLrHHpSTWCurRMCg</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/a94c09830561f6f62.output</output-file> <status>completed</status> <summary>Agent "Implement Task 4: edge wildcard parents" finished</summary> <note>A task-notification fires each time this agent stops with no live background children of its own. The user can send it another message and resume it, so the same task-id may notify more than once.</note> <result>**Status:** DONE_WITH_CONCERNS. Task 4 is built and committed. The only open item is the root-read census overlay, which still needs an independent reviewer. **Commit:** `e649e9bb edge: wildcard certificate for account subdomains (T4)` **Tests:** all 7 new edge tests failed before the change for the right reasons and pass now, and the existing `Wildcard`, `Steering` and `Warm` edge tests pass. The census guards pass after the overlay was proposed again. **Concerns:** 1. `TestPlan14RootReadCensus` failed because `newWildcardFromEnv` and the `internal/edge` package changed. I re-ran `make census-propose NAME=account-subdomains` with a claim for that change; the overlay is written but not approved. 2. The edge does not use the read-only worker: it opens the registry directly, like the `ListWildcardDomains` reader. So I left the worker's allow-list alone. 3. I kept the brief's signature (sqid → one name). If an account somehow has two names, only the alphabetically first gets a wildcard certificate, the same rule `domains.AccountNamespaces` uses. Hosts under the other name fall back to per-host certificates rather than failing. 4. `GOOS=darwin go vet ./internal/edge` fails on untouched test files (`readerConn` undefined on darwin). That predates this change; `go build ./internal/edge` works for darwin and windows. **Report:** /home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/.superpowers/sdd/2026-11-11-account-subdomains/task-4-report.md</result> <usage><subagent_tokens>151248</subagent_tokens><tool_uses>54</tool_uses><duration_ms>535898</duration_ms></usage> </task-notification>
<task-notification> <task-id>bkv82njw3</task-id> <tool-use-id>toolu_016yqCC4MkWPYXy1NjbXBUBC</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/bkv82njw3.output</output-file> <status>completed</status> <summary>Background command "Package and run Astra review of T4" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 16.9 g CO₂e (2,139,599 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-account-name-hosts, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/internal/edge/wildcard_parents_test.go b/internal/edge/wildcard_parents_test.go| index e06aebacb..bace9c619 100644 |
| --- a/internal/edge/wildcard_parents_test.go |
| +++ b/internal/edge/wildcard_parents_test.go |
| @@ -474,8 +474,8 @@ func TestParentsForAddsHeldName(t *testing.T) { |
| t.Fatalf("parents = %v; want %v", got, want) |
| } |
| // Case and a static parent change nothing about the rule. |
| - got = parentsFor([]string{"go.tito.io"}, "Apps.Test", []string{"SHOP.BDQ.apps.test", "blog.bdq.apps.test"}, map[string]string{"bdq": "harbour"}) |
| - if want := []string{"bdq.apps.test", "go.tito.io", "harbour.apps.test"}; !reflect.DeepEqual(got, want) { |
| + got = parentsFor([]string{"static.test"}, "Apps.Test", []string{"SHOP.BDQ.apps.test", "blog.bdq.apps.test"}, map[string]string{"bdq": "harbour"}) |
| + if want := []string{"bdq.apps.test", "harbour.apps.test", "static.test"}; !reflect.DeepEqual(got, want) { |
| t.Fatalf("parents = %v; want %v", got, want) |
| } |
| } |
| @@ -500,7 +500,7 @@ func TestParentsForNoNameNoExtraParent(t *testing.T) { |
| } |
| // A box with no apps domain derives no name parent (a table Task 3 left |
| // as it was there may be stale). |
| - if got := parentsFor([]string{"go.tito.io"}, "", hosts, map[string]string{"bdq": "harbour"}); !reflect.DeepEqual(got, []string{"go.tito.io"}) { |
| + if got := parentsFor([]string{"static.test"}, "", hosts, map[string]string{"bdq": "harbour"}); !reflect.DeepEqual(got, []string{"static.test"}) { |
| t.Fatalf("no apps domain: parents = %v", got) |
| } |
| } |
| @@ -538,7 +538,7 @@ func namesEdge(t *testing.T, appsDomain string) (*Edge, *registry.Registry, *wil |
| } |
| t.Cleanup(func() { reg.Close() }) |
| e.reg = reg |
| - t.Setenv("CARLOS_WILDCARD_DOMAINS", "go.tito.io") |
| + t.Setenv("CARLOS_WILDCARD_DOMAINS", "static.test") |
| t.Setenv("PLATFORM_APPS_DOMAIN", appsDomain) |
| t.Setenv("CARLOS_DNS_PROVIDER", "route53") |
| t.Setenv("CARLOS_ACME_DELEGATION_ZONE", "") |
| @@ -558,10 +558,16 @@ func TestRefreshKeepsLastGoodNamesOnReadError(t *testing.T) { |
| t.Fatal(err) |
| } |
| w.refresh() |
| - want := []string{"bdq.apps.test", "go.tito.io", "harbour.apps.test"} |
| + want := []string{"bdq.apps.test", "harbour.apps.test", "static.test"} |
| if got := w.currentParents(); !reflect.DeepEqual(got, want) { |
| t.Fatalf("parents = %v; want %v", got, want) |
| } |
| + // The failed reads below log by design: capture them, so they do not |
| + // escape into test output, and check the names reader said so. |
| + var buf strings.Builder |
| + prev := log.Writer() |
| + log.SetOutput(&buf) |
| + t.Cleanup(func() { log.SetOutput(prev) }) |
| reg.Close() // every read fails from here |
| if _, err := reg.ListAccountNamespaces(); err == nil { |
| t.Fatal("test bug: the read was supposed to fail") |
| @@ -570,6 +576,9 @@ func TestRefreshKeepsLastGoodNamesOnReadError(t *testing.T) { |
| if got := w.currentParents(); !reflect.DeepEqual(got, want) { |
| t.Fatalf("after a failed read: parents = %v; want %v (last good names kept)", got, want) |
| } |
| + if !strings.Contains(buf.String(), "edge: account subdomains read failed:") || !strings.Contains(buf.String(), "subdomain parents unchanged this pass") { |
| + t.Fatalf("no names-read diagnostic logged:\n%s", buf.String()) |
| + } |
| } |
| // A box without an apps domain derives no name parent, even with a table |
| @@ -583,7 +592,7 @@ func TestWildcardNamesNeedAppsDomain(t *testing.T) { |
| t.Fatal("a manager with no apps domain has a names reader") |
| } |
| w.refresh() |
| - if got := w.currentParents(); !reflect.DeepEqual(got, []string{"go.tito.io"}) { |
| + if got := w.currentParents(); !reflect.DeepEqual(got, []string{"static.test"}) { |
| t.Fatalf("parents = %v; want the static parent only", got) |
| } |
| } |