plan: account subdomains, Fable 5.2 round 2 findings (NOT READY)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-plan-R2.md+96 −0
CI passed — run details
Intent
<task-notification> <task-id>bcofh9zmg</task-id> <tool-use-id>toolu_01RCqPyFozKfUR67nhwvzWRw</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/bcofh9zmg.output</output-file> <status>completed</status> <summary>Background command "Run Fable 5.2 round-2 review of the plan" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 17.4 g CO₂e (2,102,461 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-account-name-hosts, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-plan-R2.md b/docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-plan-R2.md| new file mode 100644 |
| index 000000000..eca160c08 |
| --- /dev/null |
| +++ b/docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-plan-R2.md |
| @@ -0,0 +1,96 @@ |
| +**NOT READY: three P1s, all in Task 3.** Nothing was edited and no tests were run; every finding comes from reading the plan, spec rev 2 and main's code at 29e9de4a. |
| + |
| +## Round 1 status |
| + |
| +| # | Sev | Status | |
| +|---|-----|--------| |
| +| 1 | P1 | Resolved. Console enforcement holds and the residual race is as stated; see P2-2 for a read that still admits. | |
| +| 2 | P1 | Partly. The console side refuses on unread keys, but the box side over-corrects (P1-2). | |
| +| 3 | P1 | Resolved. The store door returns a namespace claim body only to its own account (`storedoor.go:962`). | |
| +| 4 | P1 | Resolved. | |
| +| 5 | P1 | Partly. The fingerprint is planned, but the new registry methods miss remote mode (P1-1). | |
| +| 6 | P1 | Partly. Both tiers are read, but exact console hosts and infrastructure under the name are missed (P2-1). | |
| +| 7 | P1 | Resolved. | |
| +| 8 | P1 | Resolved as planned; I did not trace the overlay chain. | |
| +| 9 | P1 | Resolved. `TestCLIGolden`, `-record`, `TestCLIProjection`, `parity/cli.tsv` and `parity-doc` all exist. | |
| +| 10 | P2 | Resolved. | |
| +| 11 | P2 | Partly (P3-1). | |
| +| 12 | P2 | Partly (P1-3, P2-5). | |
| +| 13 | P2 | Resolved. Two racing names either both roll back or the later one does. | |
| +| 14 | P2 | Cut by ruling. | |
| +| 15 | P2 | Resolved. | |
| + |
| +## P1 |
| + |
| +**P1-1. Task 3: the new registry methods have no remote-mode path.** |
| +- **Problem:** the plan names only `registry.go` for `SetAccountNamespaces` and `ListAccountNamespaces`. |
| +- **Evidence:** a root agent opens the registry through a child process (`internal/host/registryowner.go:24-45`). `OpenRemote` builds a `Registry` with no `sql` handle (`internal/registry/remote.go:60-66`). Every table method starts with an `r.remote != nil` branch and has a `dispatchRemote` case (`registry.go:3667`, `remote_dispatch.go:476-478`). The read-only worker allows only four methods (`remote.go:298`). |
| +- **Failure:** on a production box the alias pass calls `SetAccountNamespaces` and dereferences a nil `r.sql`, every pass. The planned round-trip test uses a local registry and passes. |
| +- **Fix:** add the remote branches, `remoteRequest`/`remoteResponse` fields and dispatch cases. Decide whether the edge's reader goes through the read-only worker and allow `ListAccountNamespaces` there if so. Add a remote round-trip test in the style of `TestRemoteRegistryRoundTrip`. |
| +- **Fault family:** certificate configuration must reach every serving edge. |
| + |
| +**P1-2. Task 3 rule 5: a foreign namespace key makes every other account's fleet box permanently incomplete.** |
| +- **Problem:** rule 5 marks the pass incomplete for any listed key `ParseNamespaceKey` accepts whose claim is not in `claims`. |
| +- **Evidence:** the fleet store door lists every claim key but answers 404 for another account's body (`storedoor.go:962-965`, `:979-1003`). That arrives as a `notFound` drop (`claimcache.go:139-142`). `relevantDropped` exists to stop exactly this case counting (`aliases.go:341-354`). |
| +- **Failure:** the operator gives `bdq` a name; from then on every fleet box of every other account reports an incomplete pass. The domain confirmed time stops advancing (`assetauthority.go:110-113`) and HA alias ingress is zeroed on each incomplete pass (`host/haingress.go:249-263`). An instance catch-all key directly under the apps domain has the same shape and triggers it too. |
| +- **Fix:** apply rule 5 only when the drop is not `notFound`, or when this box already holds an `account_namespaces` row for that name. Add a test through the store door: a foreign namespace is listed, the body is 404, and the pass is complete with nothing kept. |
| +- **Fault family:** read-failure handling must not degrade unrelated tenants. |
| + |
| +**P1-3. Task 3 rule 3: the HA rule cannot pass its own test.** |
| +- **Problem:** rule 3 reuses rule 1's eligibility, `(rt.Provisioned || rt.Platform) && release.RouteAccount(rt) == sqid`. |
| +- **Evidence:** `HAIngressRoutes` entries carry only `Host, Account, App, Pool, Region, HA, Incarnation, ServingSeq` (`provision/haingress.go:64`). An entry whose evidence refuses forwarding is a zero `Route` (`:46`). |
| +- **Failure:** no HA route is ever eligible, so `TestNamespaceHAIngress` fails as written. |
| +- **Fix:** give rule 3 its own test: `rt.HA && rt.Host != "" && rt.Account == sqid`, with the map key under `<sqid>.<apps>`. Say what a zeroed entry does; mirroring `aliases.go:1038-1041` (name kept but unavailable) is the obvious choice. Also skip a name already in `rep.AliasIngress`. |
| +- **Fault family:** derived rows must be treated as exact-claim aliases on every path. |
| + |
| +## P2 |
| + |
| +**P2-1. Task 5 `subdomainInfrastructure` misses three spec §4.2 rule 4 cases.** |
| +- **Evidence:** console hosts are reserved by exact name in `domainHostPolicy`, not in either list (`domainpolicy.go:67`). `platformDomains` adds them only with `ReservePlatformDomains` on (`apidomains.go:146`). `demoDomainReserved` is in neither list. |
| +- **Failure:** on a self-hosted deployment with the console at `console.apps.test`, the name `console` is allowed. A tunnel or steering host below the name (`hub.t.apps.test` for name `t`) is also missed, because `HostDenied` only matches entries at or above the host. |
| +- **Fix:** also refuse when `<name>.<apps>` is a console host or demo-reserved, and when any reserved or platform entry sits at or under `<name>.<apps>`. Add test rows for each. |
| +- **Fault family:** assignment must preserve infrastructure reservations. |
| + |
| +**P2-2. Task 5/6: the "something already lives there" route read can admit.** |
| +- **Evidence:** the console's existing route fold is permissive on failure (`apidomains.go:1795-1801`, a nil map reads as no conflict). It only sees live boxes. |
| +- **Failure:** a failed or partial fold lets `set` succeed over a foreign route under the name, and the post-write re-read and `show` miss it the same way. |
| +- **Fix:** use `edgesfile.DeploymentRoutesComplete` and answer `SubdomainUnreadable` on nil or partial, in `subdomainRefusal`, the re-read and `show`. Also check instance records under the name, since a record has no route until a box provisions it. |
| +- **Also:** state what POST does when `AttachAccountNamespace` returns `created=false`. A same-account instance catch-all on `harbour.<apps>` shares the key and passes rule 5; it must refuse, not report success. |
| +- **Fault family:** reads that fail refuse. |
| + |
| +**P2-3. Task 5/6: `namespaceOwner` and `canonicalHost` cost one bucket listing per call.** |
| +- **Evidence:** `ClaimCache` does a `ListMod` on every call (`claimcache.go:147`). |
| +- **Failure:** `canonicalHost(ctx, host)` per row means an apps page or instance list of N rows makes N listings, and every `domainHostPolicy` call under the apps domain adds one. |
| +- **Fix:** resolve the account's name once per request (one `AccountNamespaces` read) and pass it to a pure host-rewriting function. |
| +- **Also:** `appsNamespace`, `otherAccountsNamespace`, `domainHostPolicy`, `firstRouteOutsideNamespace` and `domainProofExempt` take no context today, so the plan should say the signatures change at all 11 call sites. |
| +- **Fault family:** canonical URL propagation at bounded cost. |
| + |
| +**P2-4. Task 3/6: a canonical URL can be shown before other edges can route it.** |
| +- **Evidence:** a new alias row has a blank `dns_status`, and the edges file withholds it until the home box stamps it (`aliases.go:332-336`). |
| +- **Failure:** on a multi-edge deployment a new app's name URL, now the link the console and deploy output show, fails on every edge but the home box until that stamp. Spec §2 says it answers "the moment its route exists". |
| +- **Fix:** either write derived rows with the sqid twin's `dns_status` (the apps wildcard answers both, §4.7), or have `canonicalHost` return the name only once the alias is published. Add a test for whichever is chosen. |
| +- **Fault family:** derived rows must reach every serving edge. |
| + |
| +**P2-5. Task 6: the approved-copy test cannot be written where the plan puts it.** |
| +- **Evidence:** `checkApprovedCopy` is in package `main` at the repo root (`approved_copy_test.go:71`), not in `internal/console`. |
| +- **Fix:** put the test at the root, where it can check both CLI and console files, or follow `internal/console/approved_nav_copy_test.go`. Move the selector to the matching `go test` command in Task 6 or 7. |
| +- **Fault family:** verification must exercise the intended behaviour. |
| + |
| +## P3 |
| + |
| +1. **Display inventory:** `templates/app_releases.html:165` is missing. `homelink.go:152` runs on the linking console with no access to the serving deployment's claims, so it should use the URL the serving console returns (`apilinks.go:126`). |
| +2. **Review Focus 5 and resolution 15:** the claim cache lists on every call, so nothing is stale without `Reset()`. The call is harmless but the stated reason is wrong. |
| +3. **Rule 5 kept rows:** scope them to rows whose `Account` matches the kept table row and whose `Host` is the sqid twin. |
| +4. **Rule 6 under `StartupNoRemoval`:** say whether the table shrinks on the startup pass. Keeping it matches the alias rows it retains. |
| +5. **`listed` holds hosts, not keys** (`claimcache.go:138`), so `ParseNamespaceKey` needs `ClaimKey(host)` or a host-based twin. |
| +6. **Rollback:** say what POST returns if the rollback detach itself fails. The claim is then still held while the answer is a refusal. |
| + |
| +## Checked and sound |
| + |
| +- **File and line references:** `claims.go:448` and `:840`, `aliases.go:782-790` and `:1045`, `wildcard.go:203`, `:276` and `:939`, `routedecls.go:982`, `accounts.go:85-88`, `apimode.go:3387`, `domaincatchall.go:163`, and the named census and console tests all match. |
| +- **Certificates:** `certFor` picks the wildcard by SNI for an alias host (`wildcard.go:314-334`); canary names fall to per-host through `Allowed`. |
| +- **Inert claim:** a namespace claim derives nothing in the main loop and on an old binary, and the instance catch-all door cannot overwrite it (`claims.go:481`). |
| +- **Alias pass callers:** every production caller goes through `aliasPassReportingComplete`, so `AppsDomain` reaches all of them. |
| +- **Console-only manifests:** the console's manifest door only ever writes the account's own sqid domain (`apiinstances.go:3545`). |
| + |
| +**Verdict: NOT READY** (P1-1, P1-2, P1-3). |