carlos / platform Public

plan: account subdomains, Astra round 2 findings (NOT READY)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 0624d07b90b02ac616fc4c919fce1b9a2f74b539 parent d89572c
1 file changed, +105 −0
  • docs/superpowers/plans/CODEX-FINDINGS-account-subdomains-plan-R2.md +105 −0

Intent

Human

Fable 5.2 might be able to help too.

Human

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

Attributed to this commit: 6.74 g CO₂e (753,368 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/CODEX-FINDINGS-account-subdomains-plan-R2.md b/docs/superpowers/plans/CODEX-FINDINGS-account-subdomains-plan-R2.md
new file mode 100644
index 000000000..3d6b1838c
--- /dev/null
+++ b/docs/superpowers/plans/CODEX-FINDINGS-account-subdomains-plan-R2.md
@@ -0,0 +1,105 @@
+- R1-1 (P1): **partly** — console enforcement does not account for declared routes that have not materialized.
+- R1-2 (P1): **partly** — unread preservation is specified, but the parser expects bucket keys while the cache returns hostnames.
+- R1-3 (P1): **resolved** — foreign namespace bodies are no longer required for box-side enforcement.
+- R1-4 (P1): **resolved** — account-level writes bypass `WithAppMutation`; the door refuses host-claim mode.
+- R1-5 (P1): **resolved** — namespace fingerprinting and the remote-only refresh test are specified.
+- R1-6 (P1): **resolved** — both deny tiers and explicit operator reservations are now considered.
+- R1-7 (P1): **resolved** — the response shapes and CLI instance decoder are corrected.
+- R1-8 (P1): **partly** — the census predecessor is stale, and a proposal note alone cannot update the root-read inventory.
+- R1-9 (P1): **partly** — command registration and projection are corrected; parity-table coverage remains missing.
+- R1-10 (P2): **resolved** — show/remove resolve tombstoned accounts.
+- R1-11 (P2): **partly** — probes retain identity, but display coverage remains incomplete.
+- R1-12 (P2): **resolved** — selectors, recording flag, reconcile helper and failure injection are corrected.
+- R1-13 (P2): **resolved** — the post-write reread checks for a second name and rolls back.
+- R1-14 (P2): **resolved by scope change** — settings is read-only.
+- R1-15 (P2): **resolved** — effective writes reset the cache and bump the serial.
+
+Reviewed the requested commit’s plan and spec. The checkout’s two later commits change only the review brief. No files changed, subagents spawned or tests run.
+
+1. **P1 — Tasks 5–6: assignment can overlook an already-declared foreign instance.**
+ **Carried from R1-1.** The occupancy check and post-write reread name claims and deployment routes, but neither includes instance-record keys or pending operations.
+
+ Instance creation persists a record independently of a domain claim ([hostsused.go:728](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/hostsused.go:728)). Published deployment routes exclude boxes without fresh snapshots ([fold.go:189](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/edgesfile/fold.go:189)). The existing regional admission boundary explicitly checks declared records and pending operations for this reason ([apiplacements.go:794](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/apiplacements.go:794)).
+
+ **Failure scenario:** account B already has a record for `shop.harbour.apps.test`, but it has not materialized, or its box is offline. Assignment to A passes both scans. B’s box later reconciles and serves that direct route; no new console request invokes the namespace predicate. This requires no concurrent attach and can last beyond the stated one-request race window.
+
+ **Fix:** specify a complete namespace-wide declared-host scan, including pending operations, before assignment and during the reread. Refuse incomplete evidence. Extend the strict approach in `RecordHostDeclared` to descendants and add a delayed-materialization witness.
+
+ **Fault family:** held namespaces must never serve another account.
+
+2. **P1 — Tasks 2, 3 and 5: unread-namespace detection uses the wrong input representation.**
+ **Carried from R1-2.** Task 2 defines `ParseNamespaceKey` as the inverse of `ClaimKey`, accepting `domains/*.harbour.apps.test.json`. Task 3 rule 5 applies it to the listing, but `listWithHosts` indexes that listing by stripped hostnames ([claimcache.go:151](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/domains/claimcache.go:151)). Task 5’s `ListWithUnread` likewise returns `UnreadClaim.Host`, not a bucket key ([claimcache.go:103](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/domains/claimcache.go:103)).
+
+ **Failure scenario:** a namespace GET fails; its cache entry is `*.harbour.apps.test`. Passing that to the specified key parser does not recognize the namespace. The box can remove its aliases/table row, and the console can miss the unknown-owner reservation.
+
+ **Fix:** define a namespace-host parser and use it at both cache boundaries, or explicitly reconstruct `ClaimKey(host)` before calling the key parser. Test through the actual cache interfaces.
+
+ **Fault family:** namespace ownership must not disappear on read failure.
+
+3. **P1 — Task 3 rule 3: production HA ingress entries fail the eligibility predicate.**
+ The plan requires HA ingress routes to be eligible under rule 1, including `Provisioned || Platform`. Production `HAIngressRoutesFromRecords` sets neither field; it produces routing metadata with `HA`, ownership and lifetime fields ([haingress.go:64](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/provision/haingress.go:64)). Existing alias derivation accepts that metadata without requiring either flag ([aliases.go:1034](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/domains/aliases.go:1034)).
+
+ **Failure scenario:** an ingress box knows an HA instance through the production projection but has no local route. Every projected entry fails Task 3’s predicate, so its named alias never enters `AliasIngress`.
+
+ **Fix:** specify separate eligibility for validated HA projection entries, preserving the existing owner/lifetime checks and unavailable-entry handling. Build the witness through `HAIngressRoutesFromRecords`, rather than hand-setting `Provisioned` in a fixture.
+
+ **Fault family:** derived names must reach every required serving path.
+
+4. **P1 — Task 5: the infrastructure check misses protected descendants and self-hosted console names.**
+ Testing only `<name>.<apps>` and `probe.<name>.<apps>` cannot detect a deny entry such as `admin.harbour.apps.test`: `HostDenied` matches the tested host or its ancestors, not protected descendants ([claims.go:967](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/domains/claims.go:967)).
+
+ The recipe also omits the unconditional exact-console and demo checks in `domainHostPolicy` ([domainpolicy.go:66](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/domainpolicy.go:66)). Console hosts enter `platformDomains` only with `ReservePlatformDomains` enabled ([apidomains.go:144](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/apidomains.go:144)).
+
+ **Failure scenario:** an operator denies `admin.harbour.apps.test`, with no route currently there. Assignment of `harbour` succeeds; an eligible `admin.bdq.apps.test` route then derives the forbidden name without passing the ordinary domain policy.
+
+ **Fix:** check namespace overlap against every protected infrastructure name/subtree, including descendants, console hosts and demo reservations. Preserve only the approved exception for the synthetic apps-domain reservation. Add nested-deny and self-hosted-console witnesses.
+
+ **Fault family:** namespace assignment must preserve infrastructure reservations.
+
+5. **P1 — Tasks 2 and 8: the census instructions still cannot produce the promised passing gate.**
+ **Carried from R1-8.** Task 2 chains its writer overlay after `regionalDomains447WriteCensusInventory`, but the active test consumes `linkedDeploymentsSlice1WriteCensusInventory` ([plan9_b8_census_test.go:369](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/provision/plan9_b8_census_test.go:369)). Merely adding the proposed function does not connect it to the active inventory; replacing the active inventory with that older predecessor loses subsequent changes.
+
+ The root-read instruction still says to write a proposal **note**. The failing test compares source digests and envelopes with its loaded inventory ([plan14_root_reads_test.go:668](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/provision/plan14_root_reads_test.go:668)); a Markdown note changes none of those pins. Tasks 3–7 subsequently change additional in-scope source.
+
+ **Fix:** append to the current writer-inventory tip and wire the test to the new tip. Specify the CLAIMS file, `make census-propose`, generated overlay/chain update and independent approval. Refresh coverage for the final diff before asserting a passing gate.
+
+ **Fault family:** reviewed source and name-production coverage.
+
+6. **P1 — Task 7: updating the CLI projection does not supply parity coverage.**
+ **Carried from R1-9.** The task names `parity/cli.tsv`, but never adds the new command paths to `parity/parity.tsv`. `make parity-doc` regenerates the projection and rendered documentation; it does not invent table rows ([Makefile:40](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/Makefile:40)). `TestParityCLIPaths` requires every runnable command to have table coverage ([repo_test.go:62](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/parity/repo_test.go:62)).
+
+ **Failure scenario:** the golden and projection tests pass, but CI fails because the new operator commands are absent from the parity table.
+
+ **Fix:** explicitly add operator/outside parity coverage for the runnable subdomain paths, document them in `docs/site/cli.md`, regenerate, and run the parity checks.
+
+ **Fault family:** CLI command-tree and published-interface consistency.
+
+7. **P2 — Tasks 6–7: the canonical display inventory remains incomplete.**
+ **Carried from R1-11.** Two verified omissions are:
+
+ - Canary links on the releases page: `CanaryView.Hosts` is populated directly from route hosts ([view.go:809](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/view.go:809)) and rendered as external links ([app_releases.html:165](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/templates/app_releases.html:165)).
+ - The initial single-instance deploy announcement constructs its URL directly ([deploy.go:647](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/deploy.go:647)).
+
+ **Failure scenario:** an account with a name still receives sqid URLs on these surfaces.
+
+ **Fix:** add both display paths and witnesses to the inventory. Preserve the identity hosts used for deployment and route selection.
+
+ **Fault family:** canonical presentation without changing operational identity.
+
+8. **P2 — Task 6: `homeLinkPublicURL` needs the serving deployment’s mapping.**
+ The plan lists `homelink.go:152` as another local `canonicalHost` call site. That helper builds a URL from the linked deployment’s `AppsDomain` and account ([homelink.go:148](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/homelink.go:148)). The normal path obtains publication URLs from the serving console; this helper is its fallback ([homelink.go:474](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/console/homelink.go:474)).
+
+ **Failure scenario:** the home console’s local namespace mapping cannot resolve the serving console’s account name, so applying its helper leaves the fallback URL noncanonical.
+
+ **Fix:** specify how this fallback retains or obtains the serving console’s canonical publication URL. Do not resolve remote account identity against local claims. Test with different home and serving apps domains.
+
+ **Fault family:** canonical URL propagation across deployment boundaries.
+
+9. **P3 — Review Focus 5: the cache explanation is inaccurate.**
+ `ClaimCache` has no TTL, but every call obtains a fresh listing and evicts entries absent from it ([claimcache.go:147](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/domains/claimcache.go:147), [claimcache.go:197](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-account-name-hosts/internal/domains/claimcache.go:197)). Reset is not the only way removal becomes visible.
+
+ **Fix:** correct the explanation on the follow-up list; retain the planned set/remove display tests. **Fault family:** documentation accuracy.
+
+The namespace-ownership family remains outstanding in a second consecutive round. Under stopping rule 2, pause further fixes for that family; the recommended option is a complete, fail-closed admission gate with an operator conflict report.
+
+**NOT READY**
\ No newline at end of file