carlos / platform Public

plan: account subdomains, final re-review (Fable READY)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 3dc59c0db99f38497cc309962fb65bba6a8f7050 parent b1a185d
1 file changed, +67 −0
  • docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-final-R2.md +67 −0

CI failed — run details

Intent

Human

<task-notification> <task-id>a0b449ae6ab46e7ca</task-id> <tool-use-id>toolu_0192oohyACqPe463L5fasok3</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/a0b449ae6ab46e7ca.output</output-file> <status>completed</status> <summary>Agent "Final-review fix wave" 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. All eight items (F1–F8) are fixed on `design-account-name-hosts`, which is not pushed. The full report is in `.superpowers/sdd/2026-11-11-account-subdomains/final-fix-report.md`. **Commits:** - `32e90a94` Merge main into design-account-name-hosts (F7) - `3ddc49de` domains: retire account namespace claims instead of deleting them - `65dd551f` host: pin Claim.RetiredAt in the group-name class census - `754023e7` console: subdomain remove retires; rollback undoes only its own write (F1, F3, F4, F6, F8) - `d064559e` console: an owner's namespace claim no longer blocks its placements (F2) - `f5efc874` console: instance list q also matches the host each row shows (F5) - `b1a185d4` census: account subdomains final fix wave Every commit builds. Between `3ddc49de` and `b1a185d4` the class census and the write census are red; both are green at the tip. **Tests:** Every targeted run you listed passes at `b1a185d4`, including both census tests and the darwin and windows vet. Each new regression fails with only its fix reverted. Astra's interleaving test, run against delete-on-remove, reproduces the original race: bcd gets harbour at once and bab's late write lands under bcd's name. For F8, a logging proxy saw 4 real requests to `c1.shop.bab.oncarlos.com` before the fix and 0 after. **Census items needing a ruling:** 1. Write census (`accountSubdomainsWriteCensusInventory`, now built on `memberBackups2aWriteCensusInventory`): - Re-pin `AttachAccountNamespace` → `c405dc14…`. - New unit `putNamespace`, nonrecord / sel:Put → `4c78aa1d…`. - Re-pin `Server.handleAPIInstanceList` → `533e9bbe…`. - No class or kind changes. 2. Root-read overlay `account-subdomains`, re-proposed on main's new chain: - Seal `b130b2d6…` → `165bf116…`. - Only two envelopes moved: `internal/host` (from main) and `internal/domains` (from this wave). No unit changed. **Concerns:** - **The hour rests on wall time.** The cooldown only works if a late write lands within one request, as rev 4 argues (the console reads a body within 5 minutes). A request held for more than an hour of real time could still land under a reassigned name. - **Same-second ABA.** S3 ETags are hashes of the body, so two byte-identical writes share an ETag. Unretire stamps a fresh `created_at`/`created_by` to avoid this, but a byte-identical successor written in the same second could still collide. The risk is negligible but not zero. - **Docs page.** `docs/site/cli.md` doesn't mention the hour's cooldown. Adding it needs a copy review, so I didn't write it. - **Repo lock.** A stale `.git/packed-refs.lock` from 06:59, not mine, makes every commit print a lock error even though the commit lands. I left it alone; it needs someone to check that its owner is gone.</result> <usage><subagent_tokens>364719</subagent_tokens><tool_uses>156</tool_uses><duration_ms>3490398</duration_ms></usage> </task-notification>

Human

<task-notification> <task-id>bziz40r7i</task-id> <tool-use-id>toolu_01LWptAD9fGYaZuXLKDuEmLv</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/709ac745-ee81-4971-97b8-321e18b19cf6/tasks/bziz40r7i.output</output-file> <status>completed</status> <summary>Background command "Package fix wave and run Astra + Fable scoped re-review" completed (exit code 0)</summary> </task-notification>

Attributed to this commit: 29.6 g CO₂e (3,779,791 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-final-R2.md b/docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-final-R2.md
new file mode 100644
index 000000000..585bfe429
--- /dev/null
+++ b/docs/superpowers/plans/FABLE-FINDINGS-account-subdomains-final-R2.md
@@ -0,0 +1,67 @@
+### Finding Verdicts
+
+- **P1 (Astra) remove-then-reassign race, one-hour cooldown** — ADDRESSED.
+ - Remove retires and never deletes: `internal/console/apisubdomain.go:662`; `RetireAccountNamespace` at `internal/domains/namespace.go:248`.
+ - Boxes stop deriving: `AccountNamespaces` skips `RetiredAt` at `internal/domains/namespace.go:392`. Its callers are the alias pass (`internal/domains/aliases.go:845`) and the console view; the edge reads only the `account_namespaces` table that pass writes.
+ - Same account retakes at once (`UnretireAccountNamespace`); another account gets `retired_cooldown` from the view (`internal/console/subdomains.go:625`) and again from the fresh key read in `subdomainWrite`. `ReplaceRetiredAccountNamespace` re-checks the hour itself.
+ - After the hour the occupancy walk and the post-write re-read still run on every write path.
+ - A retired name is nobody's for creates: `labelOwner` at `internal/console/subdomains.go:83` answers no owner.
+ - `TestSubdomainRetiredInterleaving` models Astra's ordering through the placements door with a paused body.
+- **P2-2 (Astra) owner's namespace claim blocked its placements** — ADDRESSED. `ownNamespaceClaim` at `internal/console/apiplacements.go:921` passes only a schema-1 claim at that host that `AccountNamespaces` gives to the asking account. Foreign, retired, pending and unparseable refuse 409; a failed read refuses 503 (`TestPlacementsOverlapNamespaceClaim`).
+- **P2-3 (Astra) rollback could delete a successor** — ADDRESSED. `subdomainRollBack` takes the ETag its own write answered and never re-reads one. The domain writers re-check that ETag and write conditionally (`namespaceAt`, `putNamespace`). `TestSubdomainRollbackSparesASuccessor` covers it.
+- **P2-4 (Astra) check_host from platform routes** — ADDRESSED. `subdomainCheckRoute` at `internal/console/apisubdomain.go:273` is the fallback after records, with the same `derivesName` gate.
+- **P2-5 (Astra) instance list q matches public_host** — ADDRESSED. `internal/console/apiinstances.go:1328` computes the row's value once and uses it for both the filter and the answer.
+- **P2 (Fable) display memo** — ADDRESSED. `displayNamespaceView` at `internal/console/canonical.go:116` has a 5 s TTL and a generation guard, and `subdomainWritten` resets it. Only `hostCanon.host` and `accountSubdomainPane` read it; `doorNamespaces`, `subdomainRefusal`, the re-read, show, remove and the inventory still call `loadNamespaces`.
+- **P2 (Fable) re-merge main, rewire census, re-propose overlay** — ADDRESSED. See the merge check and census ruling below.
+- **P3 (Fable) hermetic canonical test** — ADDRESSED. `canonFixture` installs `instancesOnlyTransport` at the `newInstanceFetcher` seam (`internal/console/canonical_test.go`).
+
+Checks I ran at `b1a185d4`:
+- The report names the covering tests and commands but shows no raw output, so I ran focused ones.
+- `go test ./internal/console -run` on the retire, rollback-successor, placements, display-memo, check-route and list-q tests: ok.
+- `go test ./internal/domains -run 'Retire|Unretire|Replace|Restore|Namespace'`: ok.
+- `go test ./internal/host -run TestGroupNameClassCensus`: ok.
+- `go test ./internal/provision -run TestPlan9B8RecordWriteCensus`: PASS.
+- `TestPlan14RootReadCensus` did not run: the sandbox's Go cache is read-only and the unsandboxed retry was denied. It is unverified by me.
+
+### Merge check (32e90a94)
+
+- `plan14-root-reads-chain.tsv`: both sides survive. Main's `member-backups-2a` line (`b130b2d6…`) is followed by `account-subdomains` (`165bf116…`) last.
+- `plan9_b8_census_test.go`: the tip is still `accountSubdomainsWriteCensusInventory` (line 369), which now builds on `memberBackups2aWriteCensusInventory` (`account_subdomains_census_test.go:138`). The write census test passes, so main's 2a units and this branch's pins coexist.
+- The overlay's only merge change is the `internal/host` coverage line. The card's seal line was updated to match.
+
+### New Breakage in the Fix Diff
+
+- **Minor** — `internal/provision/account_subdomains_census_test.go:5`: the header still says "layered on memberBackups1WriteCensusInventory", and there is no 2a merge note. The report says the header was updated; it was not.
+- **Minor** — `internal/console/apisubdomain.go:517`: `unreadable(..., nil)` logs `%!v(<nil>)`.
+- **Minor** — `internal/console/apisubdomain.go:584`: when the successor is another console's retire, the 500 says the name is "still held" and to run remove, which is then a no-op. It is harmless but inaccurate.
+- **Minor** — `internal/console/apisubdomain.go:758`: a retired label counts as assigned, so a late write under it shows nowhere in the inventory. An operator sees it only through another account's `occupied` refusal.
+
+No Critical or Important breakage.
+
+### Out-of-Scope Observations
+
+- `docs/site/cli.md:2312` does not mention the hour's cooldown. That is user-facing copy and is owed a copy review.
+- The stale `.git/packed-refs.lock` the implementer reported is not theirs and needs its owner checked.
+
+### Census ruling
+
+1. **Write census — APPROVE.**
+ - `AttachAccountNamespace` re-pin (`c405dc14…`): the same create-only Put at the claim key, now also returning its ETag. Stays nonrecord / sel:Put.
+ - `putNamespace` (new, `4c78aa1d…`): the one Put for the four new writers, at `domains.ClaimKey` only. Every caller passes the ETag it read and judged, so it is never create-only or unconditional, and a lost CAS writes nothing. nonrecord / sel:Put is the right class.
+ - `Server.handleAPIInstanceList` re-pin (`533e9bbe…`): filter only; the listing and the instances-literal sites are unchanged. Stays key-site / lit:instances.
+ - `TestPlan9B8RecordWriteCensus` passes at the tip.
+2. **Root-read overlay — APPROVE, on condition that `TestPlan14RootReadCensus` is green in CI.**
+ - No `@legacy` or unit line changed in either diff, and the seal hashes only those lines (`rootReadLegacySeal`), so `b130b2d6… → 165bf116…` staying fixed across the fix wave is consistent.
+ - `internal/host` envelope: moved by main's merge plus a test-only field pin. Nothing new is reachable by root.
+ - `internal/domains` envelope (`71a6098d…`): the namespace writers are console-called, conditional Puts on a `domains/` claim key. `AccountNamespaces` now derives less (it skips retired claims), never more. No check is weakened.
+
+### Implementer's concerns
+
+- **Wall-time bound of the hour** — accepted, as spec rev 4 states it. The walk at replace time catches any write that has landed, whatever the hour. A late placement directly under the name is also refused outright by the fresh `*.P` read, since a retired claim refuses. Only a request held in flight for over an hour escapes, and console clock skew of minutes sits well inside the margin. No fix needed.
+- **Same-second ETag ABA** — accepted. It needs the same account, the same operator address and the same second on two consoles; the bytes are then identical, so the undo removes a claim equal to the one the successor wrote. Negligible; a nonce in the claim would close it if it is ever wanted.
+
+### Verdict
+
+**Fix round:** All findings addressed, no new Critical/Important breakage.
+
+**READY** for merge. The one condition is a green `TestPlan14RootReadCensus` on hosted CI, which I could not run here; the four Minor items can ride a follow-up.