carlos / platform Public

Regional domains (#447): implementation plan and draft copy deck

Thirteen tasks in spec §15 order, the placements GET and CLI read first.
Per-task Astra reviews: Tasks 2+3 (claim writers), 4+5 (derivation and
edge; stands in for the design re-check, naming ruling 6, the R4 P2 fix
and the detach/recreate residual), 6 (carlos add, root), 7+8 (PUT door
and reverse doors), 10 (promotion floor). The rest whole-branch.

The copy deck holds RD-1 to RD-39 as drafts; implementing tasks use the
drafts and Task 11 swaps in approved text behind a copy gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev 50c86d54a3e322b25b3c045e4809cbf504a75524 parent 75b6bf8
2 files changed, +825 −0
  • docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md +108 −0
  • docs/superpowers/plans/2026-10-28-regional-domains-447.md +717 −0

CI failed — run details

diff --git a/docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md b/docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md
new file mode 100644
index 000000000..fe35e73c6
--- /dev/null
+++ b/docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md
@@ -0,0 +1,108 @@
+# Regional domains (#447): copy record
+
+Every person-facing string the regional domains plan writes (spec
+`docs/superpowers/specs/2026-10-28-regional-domains-447-design.md`, plan
+`docs/superpowers/plans/2026-10-28-regional-domains-447.md`): the CLI help
+and output of `carlos domains placements`, the refusals a member sees from
+the placements door and the doors it changes, the operator lines of the
+release floor and `carlos add`, and the CLI page section. Diagnostics, log
+lines and JSON keys (the GET's `reason` values among them) are not copy and
+are not here.
+
+The rules:
+
+- Every row starts `draft`. The implementing tasks write the draft text
+ into code so the branch works end to end. The copy task (plan Task 11)
+ runs the review: a Luna pass on Paul's house rules, then Paul's approval
+ (or his delegation to Luna, as for the region labels deck). Approved text
+ replaces the draft here verbatim, the row becomes `approved`, and the copy
+ task swaps it into the file the row names. The gate
+ `approved_regional_domains_copy_test.go` (added by Task 11) then fails
+ unless every row is approved and its text is in its file.
+- No em dashes. A full stop and a new sentence instead, continuing in lower
+ case in CLI and console strings. Docs prose keeps the CLI page's sentence
+ case.
+- Neutral names only in examples: shop, example.com, example.net.
+- In a Go file a row is one string literal, or one `fmt.Sprintf`,
+ `fmt.Errorf` or `errors.New` format, with a format verb where the row has
+ a `<placeholder>`. A row inside a multi-line usage block is matched with
+ whitespace collapsed (runs of spaces and newlines read as one space).
+- A table cell is one line; a paragraph break is written `\n\n`. In
+ `docs/site/cli.md` each paragraph of a row is one line.
+- Ids are never renumbered.
+
+Placeholders: `<host>` the domain; `<instance>` an instance hostname;
+`<region>` a region as the member named it; `<route>` the route a single
+domain points at; `<box>` a server's label; `<release>` a release tag;
+`<floor>` the regional floor, as `v0.31.0`; `<channel>` a system channel;
+`<target>` a release a system update or rollback would move to; `<n>` a
+count.
+
+## CLI help (domains_cli.go)
+
+| id | file | text | status |
+|---|---|---|---|
+| RD-1 | domains_cli.go | placements --app <a> [--set <region>=<instance>]... [--wildcard] [--catchall] [flags] <hostname> without --set, shows which instance serves the hostname in each region, whether it is ready, and the addresses to point DNS at. with --set, makes the hostname a regional domain: each region serves it from the instance named for it, and never sends it to another region. give the whole set every time. --wildcard and --catchall take effect only when the domain is created. | draft |
+| RD-2 | domains_cli.go | a region and the instance that serves the hostname there, as region=instance. repeat it for each region | draft |
+| RD-3 | domains_cli.go | use one wildcard certificate for the domain. set only when the domain is created, and needs a CNAME. the message says which if it is missing | draft |
+| RD-4 | domains_cli.go | also serve every one-label name under the domain from the same instances. set only when the domain is created, and needs --wildcard | draft |
+
+## CLI output (domains_cli.go)
+
+| id | file | text | status |
+|---|---|---|---|
+| RD-5 | domains_cli.go | REGION\tINSTANCE\tREADY\tADDRESSES | draft |
+| RD-6 | domains_cli.go | <host> is a regional domain. each region serves it from its own instance. | draft |
+| RD-7 | domains_cli.go | <host> is served from <route>. | draft |
+| RD-8 | domains_cli.go | point DNS for <host> at the addresses of the ready regions, with latency-based routing. | draft |
+| RD-9 | domains_cli.go | no server in this region serves <instance> yet. | draft |
+| RD-10 | domains_cli.go | the servers here run a release too old for regional domains. | draft |
+| RD-11 | domains_cli.go | no fixed address is published for this region. | draft |
+| RD-12 | domains_cli.go | not every server has reported. try again in a few minutes. | draft |
+| RD-13 | domains_cli.go | waiting for every server to report since the domain was created. this takes up to five minutes. | draft |
+| RD-14 | domains_cli.go | another route uses this hostname, so no region is ready. | draft |
+| RD-15 | domains_cli.go | <host> now serves from one instance in each of <n> regions. | draft |
+| RD-16 | domains_cli.go | this console does not support regional domains yet. | draft |
+
+## Console refusals a member sees
+
+| id | file | text | status |
+|---|---|---|---|
+| RD-17 | internal/console/apiplacements.go | give between one and eight placements, one per region. | draft |
+| RD-18 | internal/console/apiplacements.go | <region> is named twice. give one instance per region. | draft |
+| RD-19 | internal/console/apiplacements.go | <instance> is named for two regions. give a different instance in each region. | draft |
+| RD-20 | internal/console/apiplacements.go | <instance> is not an instance of this app in <region>. | draft |
+| RD-21 | internal/console/apiplacements.go | <host> is already attached to this app as an ordinary domain. detach it first, then set placements to attach it again as a regional domain. | draft |
+| RD-22 | internal/console/apiplacements.go | could not check every server just now. try again in a few minutes. | draft |
+| RD-23 | internal/console/apiplacements.go | <box> runs <release>, which cannot serve regional domains. try again when every server runs <floor> or later. | draft |
+| RD-24 | internal/console/apiplacements.go | the placements changed while this request ran. try again. | draft |
+| RD-25 | internal/console/apiplacements.go | regional domains are not available on this console yet. | draft |
+| RD-26 | internal/domains/claims.go | this is a regional domain. carlos domains placements is the only way to change where it is served, and its wildcard and catch-all settings are fixed when it is created. to change those, detach it and create it again. | draft |
+| RD-27 | internal/console/apex.go | <host> is a regional domain, so it cannot also be an instance's hostname. choose another name. | draft |
+| RD-28 | internal/console/apidomains.go | a catch-all on <host> would cover a regional domain under it, so it cannot be turned on. | draft |
+| RD-29 | internal/console/domaincatchall.go | an instance catch-all cannot cover a regional domain. | draft |
+
+## Release floor (operators: internal/release, internal/console, system.go)
+
+| id | file | text | status |
+|---|---|---|---|
+| RD-30 | internal/console/regionalfloor.go | <channel> runs <release> and this deployment has a regional domain, so it takes only <floor> or later. <target> is not one. to move it there anyway, pass --allow-below-regional-floor | draft |
+| RD-31 | internal/console/regionalfloor.go | moving to <target> below <floor> on <channel> with --allow-below-regional-floor: servers on it cannot read regional domains and stop serving them | draft |
+| RD-32 | internal/release/layoutintent.go | allow a release below <floor> while regional domains exist. servers on it stop serving them | draft |
+
+## carlos add (operators, cli.go)
+
+| id | file | text | status |
+|---|---|---|---|
+| RD-33 | cli.go | <host> belongs to a regional domain, so it cannot be a route here. detach the domain first. | draft |
+| RD-34 | cli.go | could not read the domain claim for <host>, so the regional domain check was skipped. | draft |
+
+## CLI page (docs/site/cli.md)
+
+| id | file | text | status |
+|---|---|---|---|
+| RD-35 | docs/site/cli.md | One domain, one instance per region | draft |
+| RD-36 | docs/site/cli.md | A regional domain is served in each region by that region's own instance of the app. A request that reaches a server in one region is answered there and never sent to another region. If that region's instance is not running, the request gets a 503. | draft |
+| RD-37 | docs/site/cli.md | `--set` gives the whole set each time, one `region=instance` per region. Without `--set`, the command shows each region's instance, whether it is ready, and the addresses its servers answer on. Once every region you named is ready, point DNS for the domain at those addresses with latency-based routing. | draft |
+| RD-38 | docs/site/cli.md | A regional domain has to be new. A hostname already attached as an ordinary domain is refused, and so is one that a catch-all already covers. To make an attached hostname regional, detach it first. `--wildcard` and `--catchall` are set when the domain is created and cannot be changed afterwards. To change them, detach the domain and set its placements again. | draft |
+| RD-39 | docs/site/cli.md | Each instance stays its own, with its own data, backups and hostname. Path prefixes, static sites and fleet placements are not supported on a regional domain. | draft |
diff --git a/docs/superpowers/plans/2026-10-28-regional-domains-447.md b/docs/superpowers/plans/2026-10-28-regional-domains-447.md
new file mode 100644
index 000000000..5e119edd3
--- /dev/null
+++ b/docs/superpowers/plans/2026-10-28-regional-domains-447.md
@@ -0,0 +1,717 @@
+# Regional custom-domain placements (#447) Implementation Plan
+
+> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
+
+**Goal:** A member creates one custom domain in regional mode (apex, plus its one-label catch-all if it has one), served in each chosen region by that region's own instance of the same app, never backhauled, with the per-region EIPs to point latency DNS at.
+
+**Architecture:** A schema-2 claim carries a `placements` list. Every box derives one row per regional claim into a new registry table `regional_domains` (never `route_aliases`), naming its own bound target or none, judged by one shared predicate `release.RegionalTarget`. The edge's `Reload` turns each row into a serve or deny entry with no path map, and `Edge.regionalGate`, called straight after `lookupUpstreamPath`, refuses every hop and every deny before any arm can leave the box. The console's placements door is the only writer of a regional claim and refuses anything that may have served as an ordinary name; a release floor keeps old binaries out.
+
+**Tech Stack:** Go 1.26, SQLite registry, `release.Store` (DirStore in tests, S3 in production), the console's CLI API, `carlos` CLI.
+
+**Spec:** `docs/superpowers/specs/2026-10-28-regional-domains-447-design.md` (rev 5; Paul's rulings 1-6 in §2 are fixed). Copy deck: `docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md`.
+
+Branch `regional-domains-447`, worktree
+`/home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447`,
+planned at tip `75b6bf83`. Spec citations were checked against this tip
+(the branch changes only docs since c6a5ba51); every cited line matched
+within two lines. Where the spec does not match the code, see "Spec against
+the code" below.
+
+## Global Constraints
+
+- Invariant (spec §1): a regional name is never served from, or backhauled to, another region, including after a restart, with the claim unreadable, or after a rollback.
+- Rulings (spec §2) are fixed: EIP addresses (1); release floor modelled on the rootfs floor (2); platform capability only, no consumer migration (3); born regional, overlap refused both ways, no path map, one shared predicate in derivation and `Reload` (4); `aliases_read` on the heartbeat, regional row beats a real route at its own key, `carlos add` refuses when it can read the claim (5); `Wildcard`/`Catchall` fixed at creation and the PUT refuses while `PendingForHost(host, "") > 0` (6).
+- Wire changes are additive. A regional claim is `"schema": 2`; single mode stays schema 1 with no placements. Readers accept schema 2 only when `Regional()` and `ValidPlacements()` hold; above 2 is refused as today.
+- 1 to 8 placements (`domains.MaxPlacements = 8`), one per region, distinct hosts.
+- Region codes are `ReconcileConfig.Region` / the edges file `placement` (`CARLOS_REGION`, `""` for the home). The console converts with `homeRegionIn` / `homeRegionOut`.
+- `release.RegionalDomainsFloor` is `v0.31.0` unless main has a v0.31.x tag when Task 12 runs (latest tag today `v0.30.2`). `RegionalFloorOverrideFlag = "allow-below-regional-floor"`.
+- Every refusal the PUT makes from the snapshot or the walk uses the attach door's neutral bytes: `jsonError(w, http.StatusConflict, hostUnavailableMsg)` (`"hostname unavailable"`).
+- No new per-box polling, no new bucket objects (spec §11). Edges files are byte-identical; the heartbeat gains only `metrics.aliases_read`.
+- Copy: person-facing strings come from the copy deck, draft until Task 11. No em dashes in new text. Diagnostics, log lines and JSON keys are not copy.
+- Regional GET `reason` values are JSON values, exactly: `no-serving-box`, `below-floor`, `no-address`, `evidence-incomplete`, `settling`, `route-collision`.
+
+## House rules (every task inherits these)
+
+- Always `cd /home/paulca/amadan.net/carlos/platform/.claude/worktrees/regional-domains-447 && <command>`. Never let a git command run in `/home/paulca/amadan.net/carlos/platform`.
+- Tests: locally only the packages you touched, with `-run`: `go test ./internal/<pkg>/ -run 'TestX|TestY' -count=1`. Never `make test`, never `go test ./...`. CI runs the full gate.
+- Go cache: leave `GOCACHE` at its default. Inside the sandbox it is read-only, so run `go` commands with the sandbox off. Never set `GOCACHE`, `GOMODCACHE` or `GOTMPDIR` to a per-task path.
+- Socket-binding tests (packages `edge`, `host`, `console`, `activator`): run with the sandbox off and a short on-disk temp root: `mkdir -p /var/tmp/ck && TMPDIR=/var/tmp/ck GOTMPDIR=/var/tmp/ck go test ...`. If a socket path still exceeds 107 bytes ("bind: invalid argument"), use `/tmp/k` the same way.
+- Scratch files go under `$TMPDIR` (sandboxed commands) and are deleted once at the end of the task, sandboxed. Never `rm` with globs or patterns; delete only paths you created, by name.
+- Never: `git stash`, `git checkout -- <file>`, `git worktree prune`, `pkill -f`, `sudo`. To undo a mutation, edit the file back with the Edit tool and check `git diff`.
+- No tenant names: examples use shop, example.com, example.net, alice.
+- Any listener a test starts binds `127.0.0.1` (port 0). Never `0.0.0.0` or a bare `:port`.
+- A test that runs the `carlos` binary builds its env with `carlosTestEnv(t)` and sets `cmd.Dir` to a `t.TempDir()`.
+- Commit after each task. Identity check first: `git config user.name` must read `claude` and `git config user.email` must read `claude~paul@keymail.dev`. Message ends with a blank line and `Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>`. Ignore the `packed-refs.lock` error `git commit` prints; confirm with `git log --oneline -1`. Do not push.
+- Census tests are expected to fail from Task 2 until Task 13: `TestPlan14RootReadCensus` and `TestPlan9B8RecordWriteCensus` (both `internal/provision`) pin root-binary bytes and record-write sites by digest. Do not touch their inventories before Task 13.
+- Cross-compile: CI builds `GOOS=darwin` and `windows`. Nothing in this plan needs a Linux-only syscall; a task that adds one adds `//go:build linux` plus a `!linux` stub. A new test that needs Linux carries `//go:build linux`.
+- One amadan task per plan task on the branch, set Started at dispatch and Done at review clean (`amadan` CLI, always naming `carlos/platform`).
+- Review rounds: a review stops at the first round with no P1; at most three rounds per review (AGENTS.md "Stopping rules"); P3s go to a follow-up list in the branch's notes.
+- A mutation check is run by removing exactly the named guard with the Edit tool, running the named test, watching the named leg fail, restoring the guard with the Edit tool, re-running to green, and checking `git diff` shows no trace. Record each in the task's commit message under `Mutation checks:` (guard removed, test, the failing leg and its message), and in the review brief.
+
+## Spec against the code
+
+What the code says where the spec is silent or differs, and what this plan does. No ruling is changed by any of these.
+
+1. **Claim writes are journaled.** Every claim write in `internal/domains/claims.go` is a `claimRaw*` function wrapped by `release.WithAppMutation` (`claims.go:942-968`), and `TestPlan9B8RecordWriteCensus` pins each `claimRaw*` by digest (`plan9_b8_census_test.go:743-746`). `SetClaimPlacements` follows the pattern: `claimRawSetClaimPlacements` plus a `WithAppMutation` wrapper. Task 13 inventories it.
+2. **`Metrics.Aliases` is more than `route_aliases`.** `CollectBox` also adds an entry for every non-platform route that carries a DNS or cert stamp, keyed by the route host (`internal/status/snapshot.go:1009-1024`). The PUT's "a fresh heartbeat lists the host" test therefore also catches a real route at the host, which it refuses anyway; the GET's settling test cannot match a bound target, whose host is never the apex or `*.<apex>`. No change.
+3. **W1 and the edges-file writer.** The real hop auth and backhaul dial seams (`backhaulPort`, `backhaulRootCAs`, `newBackhaulEdgeWith`) are unexported in `internal/edge`, and `internal/edge` cannot import `internal/host` (host imports edge). So W1 runs in `internal/edge` on the existing two-edge backhaul scene (`backhaul_e2e_test.go:521`), with the real registry, the real `domains.ReconcileAliasesReport` pass, the real `Reload`, home map and hop auth, and each box's edges file taken from a golden that the writer's own test pins (W2 in `internal/host` asserts the real writer's output equals it). This is the repo's precedent for crossing this boundary (`asset_e2e_test.go`, the `assets-host.golden.json` golden). The alternative, exporting edge's dial seams for a host-package test, puts test seams in production API. The Task 5 reviewer is told this.
+4. **W1 and the console server.** W1's claim is written with `domains.SetClaimPlacements` (Task 2), production code; the console PUT lands in Task 7, after W1. The console server is the wiring of W5, W8, W11, W13 and W14.
+5. **The box's region reaches the alias pass** through a new input field `AliasReport.Region` (beside the existing input `DeploymentRoutesPartial`) and a new `region string` parameter on `aliasPassReporting` (`internal/host/agent.go:1172`). Its two production callers already hold the value: `changeindex.go:333` (`l.cfg().Region`) and `agent.go:3887` (`cfg.Region`). `domains.ReconcileAliases` (nil report, tests only) derives as the home.
+6. **The floor constant is needed in Task 1** (the GET's `below-floor`), so Task 1 declares `RegionalDomainsFloor` at the provisional `v0.31.0`; Task 12 checks the tags and pins it.
+7. **The floor override is signed, as the rootfs one is.** `TestRegionalFloorUnreservedRollbackKeepsTheOverride` and `TestRegionalFloorOverrideIsPartOfTheRequest` mirror rootfs tests that read `SystemPointer.AllowBelowRootfsFloor` and the reservation digest (`hostactivation.go:111-121, 241`). So Task 10 adds `AllowBelowRegionalFloor` to `release.SystemPointer` (`json:"allow_below_regional_floor,omitempty"`), `release.SystemPromoteOptions`, the reservation digest and the held-rollback comparison. Boxes do not read it.
+8. **Instance create's first claim check passes the claim's own app.** `hostClaimHolder` (`apex.go:193`) returns nil when the claim is the caller's app. Spec §6.3 wants every app refused. Task 3 adds `apexHold.Regional`: a regional claim of the caller's account answers RD-27; another account's keeps today's neutral bytes. The recheck under the host exclusion answers the same bytes per case.
+9. **Host-claim consoles.** With `cfg.HostClaim` on (the shelved host-lifecycle claim), claim writes go through another authority and capabilities are refused (`errClaimAliasCapabilitiesUnsupported`). The spec does not mention it; the PUT refuses there too (RD-25, 409).
+10. **The GET's floor test applies to regional claims only.** Spec §8 says a box counts at or above the floor. For a single-mode claim the floor means nothing (an old binary serves an ordinary alias correctly), and applying it would mark every existing claim `below-floor` until the release rolls. So single mode counts boxes at any release; regional mode applies the floor.
+11. **The PUT takes the enabling gate from `setDomainCapabilities`.** Task 7 moves the gate (`apidomains.go:699-735`: zone, `wildFailTripped`, `delegationCNAMEDelegated`, `allowWildFail`) into `wildcardEnablingRefusal` and calls it from both. Behaviour of the existing door is unchanged.
+12. **The cert-only star entry has role `"wildcard"`** (`internal/host/edgesfile.go:746`), and `edgesfile.DeploymentRoutes` reads `Role == RoleHome && !Alias` as a real route, which is the spec's "without the alias mark".
+
+Nothing in the spec had to be planned around a ruling.
+
+## File map
+
+| File | Responsibility | Tasks |
+|---|---|---|
+| `internal/release/layoutintent.go` | `RegionalDomainsFloor`, `RegionalFloorAllows`, override flag and usage | 1, 10, 12 |
+| `internal/release/regionaltarget.go` (new) | `RegionalTarget`, the one eligibility predicate | 4 |
+| `internal/release/systempointer.go` | `AllowBelowRegionalFloor` on the pointer and options | 10 |
+| `internal/domains/claims.go` | `Placement`, `Placements`, readers, `SetClaimPlacements`, `ErrRegionalClaim`, writer refusals | 2 |
+| `internal/domains/aliases.go` | the regional derivation, instance catch-all parent rule | 2, 4 |
+| `internal/registry/registry.go`, `remote_dispatch.go` | `regional_domains` table, list/upsert/delete, remote, `Fingerprint` | 4 |
+| `internal/status/snapshot.go` | `Probes.AliasesRead`, `BoxMetrics.AliasesRead` | 4 |
+| `internal/host/agent.go`, `changeindex.go` | `aliases_read` in `statusTick`; region into the alias pass | 4 |
+| `internal/edge/edge.go`, `homemap.go`, `assetcatch.go` | regional entries, `regionalGate`, no path map, test dial hook | 5 |
+| `cli.go` (root) | `carlos add` claim check | 6 |
+| `internal/provision/recordhost.go` (new) | `RecordHostDeclared`, the keys-only walk | 7 |
+| `internal/console/apiplacements.go` (new) | GET and PUT doors, readiness, evidence, overlap, barrier | 1, 7, 8, 9 |
+| `internal/console/apidomains.go` | attach and capability writer rules, Catchall-on scan, `domainItem` mode | 3, 7, 8 |
+| `internal/console/teamdoors.go`, `apex.go`, `domainattach.go`, `claim_first_route.go`, `lifetimes_create.go`, `hostsused.go`, `lifetimes.go`, `apiinstances.go` | team scope, instance-create refusal and recheck | 3, 8 |
+| `internal/console/domaincatchall.go` | instance catch-all scan | 8 |
+| `internal/console/regionalfloor.go` (new), `rootfsfloor.go`, `apisystemupdate.go`, `hostactivation.go` | the promotion floor | 10 |
+| `internal/console/authcli.go` | GET and PUT registration | 1, 7 |
+| `apimode.go`, `domains_cli.go`, `system.go` (root) | CLI read, write, floor flags | 1, 9, 10 |
+| `internal/edgesfile/testdata/regional-box.golden.json` (new) | the writer-pinned file W1 serves from | 4 |
+| `docs/site/cli.md` | the CLI page section | 11 |
+| `approved_regional_domains_copy_test.go` (new, root) | the copy gate | 11 |
+| `internal/provision/regional_domains_447_census_test.go` (new), census overlay and card | censuses | 13 |
+
+## Review Focus
+
+Five inputs the spec implies but no witness exercises, most likely to bite first. Each has a test in the task that owns the code.
+
+1. **A bound instance that is asleep, deleted or moved.** A member expects a sleeping instance to wake on its regional name exactly as on an alias, and a deleted one to show as not ready rather than serve elsewhere. Tests: Task 5 `TestRegionalNameWakesItsSleepingTarget`; Task 9 `TestPlacementsGetShowsADeletedTarget`.
+2. **Spelling of the input.** `--set UK=SHOP-UK.Example.NET`, the home region given by its name, an empty region (`--set =shop-ie.example.net`). Expected: hostnames lower-cased, the home name stored as `""`, an empty or unknown region refused with RD-20. Test: Task 7 `TestPlacementsPutNormalisesInput`.
+3. **The same region or instance given twice.** Expected RD-18 or RD-19 and nothing written, and the CLI sends exactly what was typed. Tests: Task 7 `TestPlacementsPutRefusesDuplicates`; Task 9 `TestRunDomainsPlacementsSendsTheWholeSet`.
+4. **Changing capabilities the only allowed way.** Ruling 6 sends a member to detach and create again; that path must work end to end, including on a console with proof on. Test: Task 8 `TestDetachThenRecreateChangesCapabilities`.
+5. **A new CLI against an older console.** The route does not exist there (a 404 with no JSON); the member should read RD-16, not a decode error. Test: Task 9 `TestRunDomainsPlacementsAgainstAnOlderConsole`.
+
+---
+
+### Task 1: Placements GET and the CLI read (spec §15 step 1)
+
+**Goal:** `carlos domains placements --app shop example.com` shows, for any existing alias claim, the region, serving boxes, their EIPs and readiness. The first thing anyone can see.
+
+**Model:** Opus (console, CLI and release in one slice). **Review:** whole-branch (a read-only door registered with the same roles and team scope as `GET .../domains/{host}`; the whole-branch reviewer checks the registration).
+
+**Files:**
+- Create: `internal/console/apiplacements.go`, `internal/console/apiplacements_test.go`
+- Modify: `internal/console/authcli.go` (register after line 866), `internal/release/layoutintent.go` (after `TeamEnvironmentFloor`, line 247), `apimode.go` (beside `domainPaths`, line 4643), `domains_cli.go` (dispatch at line 98, new `runDomainsPlacements`), `domains_cli_test.go`
+
+**Interfaces:**
+- Produces, `internal/release/layoutintent.go`:
+ ```go
+ // RegionalDomainsFloor: provisional until Task 12 pins it.
+ var RegionalDomainsFloor = SemVer{Major: 0, Minor: 31, Patch: 0}
+ ```
+- Produces, `internal/console/apiplacements.go`:
+ ```go
+ const (
+ reasonNoServingBox = "no-serving-box"
+ reasonBelowFloor = "below-floor"
+ reasonNoAddress = "no-address"
+ reasonEvidenceIncomplete = "evidence-incomplete"
+ reasonSettling = "settling"
+ reasonRouteCollision = "route-collision"
+ )
+ type placementsAnswer struct {
+ Host string `json:"host"`
+ Mode string `json:"mode"` // "single" | "regional"
+ Route string `json:"route"`
+ Wildcard bool `json:"wildcard"`
+ Catchall bool `json:"catchall"`
+ Placements []placementState `json:"placements"`
+ }
+ type placementState struct {
+ Region string `json:"region"` // homeRegionOut of the code
+ Target string `json:"target"`
+ Ready bool `json:"ready"`
+ Reason string `json:"reason,omitempty"`
+ Boxes []placementBox `json:"boxes"` // never null
+ }
+ type placementBox struct {
+ Box string `json:"box"`
+ EIP string `json:"eip"`
+ AWSRegion string `json:"aws_region"` // the edges file's region
+ Release string `json:"release"` // heartbeat metrics.release
+ }
+ func (s *Server) handleAPIDomainPlacementsGet(w http.ResponseWriter, r *http.Request)
+ // placementsView is the GET body from one claim and one joined snapshot. Pure.
+ func (s *Server) placementsView(c domains.Claim, snap edgesfile.Snapshot, boxes []status.Box, now time.Time) placementsAnswer
+ // servingBoxes: fresh files whose Placement == code and whose Hosts[target]
+ // decodes (edgesfile.Host) with Role == edgesfile.RoleHome, sorted by Box.
+ func servingBoxes(snap edgesfile.Snapshot, code, target string) []edgesfile.PlacementView
+ // boxAtRegionalFloor mirrors boxAtRootfsFloor (rootfs.go:291) against RegionalDomainsFloor.
+ func boxAtRegionalFloor(b status.Box) bool
+ ```
+- Produces, root `apimode.go`:
+ ```go
+ type apiPlacementBox struct{ Box, EIP, AWSRegion, Release string } // json box, eip, aws_region, release
+ type apiPlacement struct{ Region, Target string; Ready bool; Reason string; Boxes []apiPlacementBox }
+ type apiPlacements struct{ Host, Mode, Route string; Wildcard, Catchall bool; Placements []apiPlacement }
+ func (s *apiSession) domainPlacements(ctx context.Context, a apiAcct, app, host string) (apiPlacements, error)
+ ```
+- Rules for `placementsView` in this task (single mode; Task 9 adds the regional rules):
+ - `Mode` is `"single"` when `!c.Regional()`. One entry: `Target` is `c.Route`, or `c.Host` when `c.Route == ""` (a first-route claim). `Region` is `homeRegionOut` of the first serving box's `Placement` (by box label), or `""` when none serves.
+ - A serving box counts when its heartbeat (joined by `status.Box.Label == PlacementView.Box`) is fresh and its `EIP` is nonempty; single mode ignores the floor (note 10). `Ready` when one counts. `Boxes` lists every serving box. Not ready: `no-serving-box` when none serves, else `no-address`.
+- Handler: `domainsGate`; `NormalizeAliasHost(r.PathValue("host"))` else the family's 404; `domains.GetClaim`: not found, another account or app, or `Instances` gives exactly the bytes `handleAPIDomainGet` gives for a missing claim; one `edgesfile.ReadSnapshot` and one `status.LoadBoxesComplete`, joined with `edgesfile.JoinLive`; a snapshot read error is 503 with RD-22 (draft). 200 with `placementsView`.
+- Registration, `authcli.go`: `s.cliScopedRoute("GET /api/cli/apps/{account}/{app}/domains/{host}/placements", svcrole.Allow(svcrole.Publish, svcrole.Instance), scopeDomainHost, s.handleAPIDomainPlacementsGet)`. If a registration inventory test lists every route, add this one there.
+- CLI: `carlos domains placements --app <a> [--account] [--account-id] [--console] <hostname>` (read only in this task; `--set` comes in Task 9). Usage constant `domainsPlacementsUsage` is syntax only. Output: RD-6 or RD-7, then a table with RD-5's header (`REGION`, `INSTANCE`, `READY` as `yes`/`no`, `ADDRESSES` comma-joined EIPs of counted boxes), then, for each not-ready region, its reason sentence (RD-9 to RD-14 by reason value), then RD-8 when any region is ready. Draft text from the deck.
+
+- [ ] **Step 1: Write the failing tests.** In `internal/console/apiplacements_test.go`, reusing the rootfs door world's helpers (`rootfsDoorWorld`, `writeFleetBoxOn`, `rootfs_test.go`) and the apidomains test helpers for claims and edges files:
+ - `TestPlacementsGetSingleModeReadiness`: a claim `shop.example.com` with `Route: "shop-ie.example.net"`; box `annie` (placement `""`, EIP `203.0.113.10`, fresh heartbeat release `v0.30.2`) publishes the route under `home`: `ready == true`, `boxes == [{annie, 203.0.113.10, eu-west-1, v0.30.2}]`, `region` is the home's name. A second file `betty` naming the route with a stale heartbeat is not listed. With `annie`'s EIP empty: `ready == false`, `reason == "no-address"`. With no file serving the route: `reason == "no-serving-box"`, `boxes == []` (JSON `[]`, not `null`).
+ - `TestPlacementsGetAnswersTheFamilyNotFound`: another account's claim, another app's claim, `*.example.com` (instance catch-all), and no claim each give the status and body bytes of `GET .../domains/{host}` for a missing claim.
+ - `TestPlacementsGetUnreadableSnapshot`: a store whose `List("control/edges/")` fails: 503.
+ In `domains_cli_test.go`, following `TestAPISessionDomainList` and `TestRunDomainsPathsPrintsThePublishedMap`:
+ - `TestAPISessionDomainPlacements`: decodes the JSON above, including `aws_region` and an empty `boxes`.
+ - `TestRunDomainsPlacementsPrintsTable`: single mode prints RD-7 with the host and route, the header, one row `<home name> shop-ie.example.net yes 203.0.113.10`, and RD-8.
+- [ ] **Step 2: Run them to see them fail.**
+ `go test ./internal/console/ -run 'TestPlacementsGet' -count=1` and `go test . -run 'TestAPISessionDomainPlacements|TestRunDomainsPlacements' -count=1`. Expected: compile failures (undefined `handleAPIDomainPlacementsGet`, `domainPlacements`).
+- [ ] **Step 3: Implement** the interfaces above.
+- [ ] **Step 4: Run the tests to see them pass** (same commands, socket rules for `console`). Also `go test ./internal/release/ -run 'TestRootfsLifecycleFloorIsPinned|TestTeamEnvironmentFloorIsPinned' -count=1` and `go vet ./internal/console/ ./internal/release/ .`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 1: placements GET and CLI read`.
+
+---
+
+### Task 2: Regional claim shape and the domains writer rules (spec §15 step 2, domains half)
+
+**Goal:** a schema-2 claim with placements that current readers accept and every writer in `internal/domains` treats correctly; `ErrRegionalClaim`; the reader audit.
+
+**Model:** Opus (production storage shape). **Review:** per-task Astra, joint with Task 3 (claim writers on production storage, `SetClaimCapabilities`).
+
+**Files:**
+- Modify: `internal/domains/claims.go`, `internal/domains/aliases.go` (one skip, after the `Pending` skip at line 400)
+- Test: `internal/domains/regional_claims_test.go` (new)
+
+**Interfaces (all in `internal/domains/claims.go`):**
+```go
+const MaxPlacements = 8
+type Placement struct {
+ Region string `json:"region"` // a stored code: "" is the home
+ Host string `json:"host"`
+}
+// on Claim, declared beside Instances (the round-trip rule, claims.go:48-61):
+Placements []Placement `json:"placements,omitempty"`
+
+func (c Claim) Regional() bool // len(c.Placements) > 0
+func (c Claim) PlacementFor(region string) string // the bound host, "" if none
+func (c Claim) ValidPlacements() bool
+func (c Claim) PendingLive(now time.Time) bool // exported pendingLive
+func GetClaimETag(ctx context.Context, s release.Store, host string) (*Claim, string, error)
+var ErrRegionalClaim = errors.New("<RD-26 draft text>")
+// SetClaimPlacements writes next (Schema 2, Pending false) as given. cur nil
+// and etag "" is a create-only Put; otherwise a CAS on etag. Equal bytes to
+// cur write nothing (changed false). release.ErrCASConflict is returned
+// as-is, no retry. !next.ValidPlacements() is ErrBadPlacements.
+func SetClaimPlacements(ctx context.Context, s release.Store, next Claim, cur *Claim, etag string) (changed bool, err error)
+var ErrBadPlacements = errors.New("domains: invalid placements")
+```
+- `ValidPlacements`: `Schema == 2`; 1 to `MaxPlacements` entries; regions unique; hosts unique; each host equals its `NormalizeAliasHost` and is not under `sidecarSuffix`; `Route` is one of the hosts; `len(Paths) == 0`; `!Instances`; `!Pending`.
+- Readers: `getClaimETag` (line 449) and `readClaimDetail` (line 705) accept schema 1, and schema 2 only when `Regional() && ValidPlacements()`; any other schema 2 and anything above 2 keep today's refusal and skip.
+- `SetClaimPlacements` is `claimRawSetClaimPlacements` wrapped in `release.WithAppMutation(ctx, s, next.Account, next.App, "domains.SetClaimPlacements", ...)`, as `SetClaimPaths` is (line 963).
+- `AttachClaimProven` (line 510), after the owner match (line 576): when `cur.Regional()`, a `c.Route` that is one of `cur`'s bound hosts returns `false, false, false, nil` (no write); any other route returns `ErrRegionalClaim`. It never writes schema 2 (`c.Schema = 1` at the top stays).
+- `claimRawSetClaimPaths` (line 875): a regional claim returns `ErrRegionalClaim` after the owner gate.
+- `claimRawSetClaimCapabilities` (line 776): after the same-values return at line 793 (`false, nil`), `if cur.Regional() { return false, ErrRegionalClaim }` before building `next`.
+- `claimRawAttachInstanceCatchall` (line 292): when the parent claim it reads is `Regional()`, `ErrRegionalClaim`.
+- `ReconcileAliasesReport` (`aliases.go`): right after the `Pending` skip, `if c.Regional() { continue }`. Task 4 replaces this line with the derivation.
+
+**Reader audit.** The 30 non-test files matching `grep -rln 'domains\.Claim\b\|GetClaim\|ListClaims\|ClaimCache' --include=*.go . | grep -v _test.go` each either ignore placements safely or branch on `Regional()` first. Record one line per file in the commit message under `Reader audit:`. Expected verdicts (verify each; change code only where the verdict says so):
+- Branch in this task: `internal/domains/claims.go`, `internal/domains/aliases.go`.
+- Branch in Task 3: `internal/console/teamdoors.go` (`inScopeClaim`), `apex.go` (`hostClaimHolder`), `apidomains.go` (attach, capabilities, paths, `domainItem`), `domainattach.go` (`claimRefusal`), `claim_first_route.go`.
+- Branch in Task 4: `internal/domains/aliases.go` (derivation, instance catch-all parent).
+- Safe as they are (state why in the audit line): `internal/domains/claimcache.go` (decodes through `readClaimDetail`), `internal/edge/storedoor.go` (relays the JSON object whole, `storedoor.go:757`), `internal/host/agent.go`, `assetauthority.go`, `changeindex.go`, `edgesfile.go` (cache plumbing or `route_aliases` only), `internal/hostops/*.go` and `internal/console/claim_alias.go`, `claim_pending_views.go`, `claim_purge.go`, `claim_retire.go` (host-claim objects under `control/hosts/`, or HostClaim mode, which the PUT refuses), `internal/mail/domainclaim.go` (mail domain claims), `internal/registry/registry.go` (comments only), `internal/console/server.go`, `appsettings.go`, `domainstate.go`, `apiinstancemove_offline.go`, `domaincatchall.go` (read `Route`/`Host`/`Account` for listing or moves; check each that reads `Route` does not treat a regional claim as an alias of its `Route`; a listing that shows `Route` is fine).
+
+- [ ] **Step 1: Write the failing tests** in `internal/domains/regional_claims_test.go` (W6, domains half):
+ - `TestRegionalClaimRoundTrips`: a claim with two placements marshals with `"schema":2` and `"placements":[{"region":"","host":"shop-ie.example.net"},{"region":"uk","host":"shop-uk.example.net"}]`; `GetClaim` returns it equal; `PlacementFor("uk") == "shop-uk.example.net"`, `PlacementFor("us") == ""`.
+ - `TestTodaysReaderRuleSkipsSchema2`: the bytes `SetClaimPlacements` writes decode with `Schema == 2`, which the pre-change rule (`c.Schema > 1`, claims.go:449, 705) skips: assert `Schema > 1` on the decoded value, so an old binary derives nothing.
+ - `TestSchema2WithoutValidPlacementsIsSkipped`: schema 2 with no placements, with 9, with a duplicate region, with `Route` not among them, with `Paths`, and schema 3: `GetClaim` errors and `ListClaims` skips each.
+ - `TestSchema1ClaimRoundTripsByteStable`: an existing schema-1 body (with `wildcard`, `catchall`, `paths`) read and rewritten by `SetClaimCapabilities` keeps every byte except the two capabilities, and gains no `placements` key.
+ - `TestSetClaimCapabilitiesRefusesARegionalClaim` (W14 leg c): on a regional claim with neither capability, `(true,false)` and `(true,true)`; on one with both, `(true,false)` and `(false,false)`: each gives `ErrRegionalClaim`, and the object's bytes and ETag are unchanged. The claim's own values give `false, nil` and no `Put` (a counting store). `(false,true)` is still `ErrCatchallNeedsWildcard`, checked first.
+ - `TestAttachClaimProvenOnARegionalClaim`: a bound host is a no-op (`false, false, false, nil`, no `Put`); another route is `ErrRegionalClaim`; the stored claim stays schema 2.
+ - `TestSetClaimPathsRefusesARegionalClaim`, `TestInstanceCatchallRefusesARegionalParent`.
+ - `TestSetClaimPlacementsWrites`: create-only on no claim; a second create with etag `""` gets `release.ErrCASConflict`; equal bytes write nothing; an invalid set is `ErrBadPlacements`.
+ - `TestRegionalClaimDerivesNothingYet`: `ReconcileAliasesReport` over a regional claim whose bound host is a local ready route writes no `route_aliases`, `route_paths` or `wildcard_domains` row.
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/domains/ -run 'TestRegional|TestTodaysReaderRule|TestSchema2|TestSchema1ClaimRoundTripsByteStable|TestSetClaimCapabilitiesRefusesARegionalClaim|TestAttachClaimProvenOnARegionalClaim|TestSetClaimPathsRefusesARegionalClaim|TestInstanceCatchallRefusesARegionalParent|TestSetClaimPlacementsWrites' -count=1`. Expected: undefined `Placement`, `SetClaimPlacements`.
+- [ ] **Step 3: Implement** the interfaces and rules above; do the reader audit.
+- [ ] **Step 4: Run to see them pass**, plus the package's existing claim tests: `go test ./internal/domains/ -count=1`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 2: regional claim shape and domains writer rules`, with the `Reader audit:` lines.
+
+---
+
+### Task 3: Console writer rules, team scope and instance create (spec §15 step 2, console half)
+
+**Goal:** every console door that writes a claim or an instance record at a regional name refuses or no-ops as §6.3 and §6.4 say; instance create's recheck under the host exclusion sits before `BeginAllocation`.
+
+**Model:** Opus (security gates, locks). **Review:** per-task Astra, joint with Task 2.
+
+**Files:**
+- Modify: `internal/console/teamdoors.go:233`, `apex.go` (`apexHold` line 43, `hostClaimHolder` line 193, `claimHeldSentence`), `apidomains.go` (`setDomainCapabilities` line 663, paths door, `domainItem` line 1261), `domainattach.go` (`claimRefusal` line 754), `claim_first_route.go:14`, `lifetimes_create.go:60-128`, `hostsused.go:560`, `lifetimes.go` (`lifetimeCreateRefusal` line 101)
+- Test: `internal/console/regional_writers_test.go` (new)
+
+**Interfaces:**
+```go
+// apex.go
+type apexHold struct { Holder string; Trashed bool; OtherAccount string; Regional bool }
+// regionalClaimHold reads host's claim once: nil when there is none or it is
+// not regional; &apexHold{OtherAccount: c.Account} for another account's
+// regional claim; &apexHold{Regional: true} for this account's. Errors fail closed.
+func (s *Server) regionalClaimHold(ctx context.Context, acct, host string) (*apexHold, error)
+// lifetimes.go: the recheck's refusal, answered by lifetimeCreateRefusal as
+// 409 claimHeldSentence(host, e.hold), the bytes the first check gives.
+type regionalHostError struct{ host string; hold *apexHold }
+```
+- `hostClaimHolder`: a regional claim of `acct` returns `&apexHold{Regional: true}` whatever `own` is; another account's keeps `OtherAccount`. `claimHeldSentence`: `hold.Regional` gives RD-27 (draft).
+- Recheck, `createRecordWithLifetimeLocked`: immediately before step 1's `s.admit(host, "")` (line 81), `s.regionalClaimHold(ctx, rec.Account, host)`; a hold returns `&regionalHostError{host, hold}`; a read error returns it wrapped, nothing persisted.
+- Recheck, `createRecordMarked`: after `s.lockApp(...)`, `defer s.lockHostname(rec.Host)()` (app then host, the lock table's order), then the same recheck before `firstKindRecheck`.
+- `lifetimeCreateRefusal` maps `*regionalHostError` to `&doorRefusal{http.StatusConflict, claimHeldSentence(host, e.hold)}`, so the create, seed and first-route doors answer it alike.
+- `inScopeClaim`: `|| c.Regional()` beside `c.Instances` (out of scope: not-found bytes on get, detach, attach and the placements GET).
+- `setDomainCapabilities`: compute the final `(wildcard, catchall)` (including the wildcard-off cascade, today's `switch` first case) before any DNS work; then, if `cur.Regional()` and either differs from `cur`, `jsonError(w, http.StatusConflict, domains.ErrRegionalClaim.Error())` and return: no CNAME lookup, no `wildFail` count, no write. Equal values fall through to `SetClaimCapabilities`, which returns `false, nil` (no audit, no bump).
+- Attach door: `domains.ErrRegionalClaim` from `attachDomainClaim` answers 409 with its text (beside the `ErrHostUnavailable` branch, `apidomains.go:597`); `claimRefusal` maps it the same way. The paths door maps it to 409 too.
+- `attachClaimFirstRoute`: read the claim first; regional answers `claimRefusal(host, domains.ErrRegionalClaim)` before `beginClaimCreate`.
+- `domainItem`: `"mode": "regional"` for a regional claim (JSON key on the list item; omit for single mode, or `"single"`, matching the existing struct's omitempty habit).
+
+- [ ] **Step 1: Write the failing tests** in `internal/console/regional_writers_test.go`, with regional claims written by `domains.SetClaimPlacements` directly:
+ - `TestTeamScopeRefusesRegionalClaim` (W4): a team credential scoped to the bound instance gets not-found bytes on `GET .../domains/{host}`, `GET .../placements`, `DELETE .../domains/{host}` and attach; the claim is untouched.
+ - `TestAttachOnARegionalClaim` (W6 console): attach naming a bound host is 200 with `created:false`, no claim write, no serial bump; another route is 409 with RD-26's text.
+ - `TestFirstRouteAttachOnARegionalHostWritesNoRecord` (W6): lifetimes off and on, an app with no ready route attaching a regional host it owns: 409, no record at `provision.RecordKey`, `PendingForHost(host,"") == 0`.
+ - `TestSetDomainCapabilitiesRefusesARegionalChangeBeforeDNS`: through the attach door on a bound host, `wildcard:true`; `wildcard:false` on a claim with both: 409 RD-26, zero calls to a counting `lookupCNAME`, no `wildFail` count, bytes and ETag unchanged. The same values: 200, no write, no audit row, no serial bump.
+ - `TestInstanceCreateRefusesARegionalHost` (W11 leg): lifetimes off and on, creating an instance at `shop.example.com` from the claim's own app: 409 RD-27; from another account: today's neutral bytes; no record written.
+ - `TestRegionalRecheckLeavesNoPendingAllocation` (W11 rev 5 leg): lifetimes on; make the first claim check pass (no claim) and write the regional claim before the create reaches the recheck (a one-shot `lifetimeLockHook` that writes the claim when the hostname lock is `held`); the create 409s at the recheck, `PendingForHost(host,"") == 0`; `recoverLifetimes` then writes no record. Mutation check: move the recheck after `BeginAllocation`; the recovery leg writes a record.
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/console/ -run 'TestTeamScopeRefusesRegionalClaim|TestAttachOnARegionalClaim|TestFirstRouteAttachOnARegionalHostWritesNoRecord|TestSetDomainCapabilitiesRefusesARegionalChangeBeforeDNS|TestInstanceCreateRefusesARegionalHost|TestRegionalRecheckLeavesNoPendingAllocation' -count=1`.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run to see them pass**, then the neighbours: `go test ./internal/console/ -run 'TestAPIDomain|TestDomainAttach|TestLifetime|TestTeam|TestInstanceCreate|TestHostsUsed' -count=1`. Run the mutation check and restore.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 3: console writer rules, team scope and instance create`.
+
+**Review brief (Tasks 2 and 3, one Astra review):** the claim's wire shape and its readers (an old binary must skip schema 2; a current one must accept only a valid regional schema 2); every writer's regional rule; `SetClaimCapabilities` refusing after the same-values return; instance create's recheck order (before `BeginAllocation`, under the host exclusion, lock order app then host in `createRecordMarked`); neutral bytes for other accounts; the reader audit lines.
+
+---
+
+### Task 4: `RegionalTarget`, `regional_domains`, the derivation and `aliases_read` (spec §15 step 3)
+
+**Goal:** every box derives one row per regional claim naming its bound target or none, the edges file still publishes no regional name, and the heartbeat says whether its alias read succeeded.
+
+**Model:** Opus (five packages). **Review:** per-task Astra, joint with Task 5 (the predicate and the rows feed the edge's routing decision).
+
+**Files:**
+- Create: `internal/release/regionaltarget.go`, `internal/release/regionaltarget_test.go`, `internal/domains/regional_derive_test.go`, `internal/edgesfile/testdata/regional-box.golden.json`
+- Modify: `internal/registry/registry.go` (table beside `route_aliases`, line 759; methods beside `ListWildcardDomains`, line 3425; `Fingerprint`, line 3641), `internal/registry/remote_dispatch.go` (request field line 84, response field line 126, dispatch line 342), `internal/domains/aliases.go`, `internal/status/snapshot.go` (`Probes` line 150, `BoxMetrics` line 641, `CollectBox` metrics condition line 1119 and the copy into `Metrics`), `internal/host/agent.go` (`aliasPassReporting` line 1172 and its call at 3887; `statusTick` line 4480), `internal/host/changeindex.go:333`
+- Test: `internal/registry/regional_test.go`, `internal/status/snapshot_test.go` (add), `internal/host/edgesfile_test.go` (add), `internal/host/host_test.go` or a new `internal/host/aliasesread_test.go`
+
+**Interfaces:**
+```go
+// internal/release/regionaltarget.go
+// RegionalTarget is the one eligibility predicate (spec §7.2, D10), used by
+// derivation and by the edge's Reload on the same route snapshot.
+func RegionalTarget(rt registry.Route, account, app, region string) bool
+// true only when: rt.Status == "ready"; RouteAccount(rt) == account; rt.App == app;
+// rt.Kind == "" || rt.Kind == "instance"; rt.Provisioned; !rt.IsSidecar(); !rt.Replica;
+// registry.FleetPlacement(rt.Region) not ok; rt.Tunnel == ""; rt.Socket != ""; rt.Region == region.
+
+// internal/registry/registry.go
+type RegionalDomain struct {
+ Host, Target, Account, App, Region string // Target "" means deny on this box
+ CreatedAt int64
+}
+func (r *Registry) ListRegional() ([]RegionalDomain, error) // ordered by host
+func (r *Registry) UpsertRegional(d RegionalDomain) error // ON CONFLICT(host) updates target, account, app, region only
+func (r *Registry) DeleteRegional(host string) error // idempotent
+
+// internal/domains/aliases.go
+// AliasReport gains an INPUT field beside DeploymentRoutesPartial:
+Region string // this box's region code (ReconcileConfig.Region)
+
+// internal/status/snapshot.go
+// Probes: AliasesRead bool (beside Aliases)
+// BoxMetrics: AliasesRead bool `json:"aliases_read,omitempty"` (beside Aliases)
+
+// internal/host/agent.go
+func aliasPassReporting(ctx context.Context, store release.Store, reg *registry.Registry, cache *domains.ClaimCache, auth *assetAuthority, region string) error
+```
+- Table: `CREATE TABLE IF NOT EXISTS regional_domains (host TEXT PRIMARY KEY, target TEXT NOT NULL DEFAULT '', account TEXT NOT NULL DEFAULT '', app TEXT NOT NULL DEFAULT '', region TEXT NOT NULL DEFAULT '', created_at INTEGER NOT NULL DEFAULT 0);` Remote: methods `"ListRegional"`, `"UpsertRegional"`, `"DeleteRegional"`, request field `RD RegionalDomain`, response field `Regional []RegionalDomain`. `Fingerprint` hashes `host, target, account, app, region` (not `created_at`) under its own `"\x1dregional_domains\x1e"` section, so a derivation change reloads the edge and a re-upsert does not.
+- Derivation (replaces Task 2's `continue`), in `ReconcileAliasesReport` with `boxRegion := ""` or `rep.Region`:
+ - `t := c.PlacementFor(boxRegion)`; keep it only if `rt, ok := byHost[t]; ok && release.RegionalTarget(rt, c.Account, c.App, boxRegion)`, else `t = ""`.
+ - desired rows: `c.Host -> t`; and `"*." + c.Host -> t` when `c.Wildcard && c.Catchall`; each with `c.Account`, `c.App`, `boxRegion`. Written on every box, for every regional claim, whether or not `t` is empty, and whether or not a real route holds the key (§7.2 last bullet).
+ - a `Wildcard` regional claim desires its `wildcard_domains` row only where `t != ""`, counted against `maxWildcardDomains`.
+ - then `continue`: the plain-alias, paths and wildcard halves never see a regional claim.
+ - after the loop: delete every `regional_domains` row not desired, except rows whose host (or, for a star row, whose apex) is a listed-but-unread claim this pass (`listed[...]` true, not in `claims`): kept as they are, and `incomplete = true`.
+ - a failed upsert or delete logs and sets `incomplete`, as the alias writes do.
+- Instance catch-all parent rule (`deriveInstanceAliases`, line 158): `apex.Regional()` counts as not held (`sayInstanceCatchallOnce(c.Host, "inert: its parent "+parent+" is regional")`).
+- `statusTick`: in the `reg.ListAliases()` success branch set `p.Aliases = aliases` and `p.AliasesRead = true`; the error branch leaves it false. `CollectBox` copies `p.AliasesRead` to `Metrics.AliasesRead` and adds `p.AliasesRead` to the attach condition (line 1119), so a successful read with no rows still publishes `"metrics":{"aliases_read":true}`.
+- Golden `regional-box.golden.json`: the two host entries the real writer publishes for a box serving `shop-ie.example.net` bound to regional `shop.example.com` with `Wildcard` and `Catchall`, keyed by host: the target under role `home`, and `*.shop.example.com` with role `wildcard` and `"wildcard":true`; no `shop.example.com` key. Written by hand from the writer's output (print it once from the W2 test, read it, commit it) and compared with `json.Compact` on both sides, as `TestPublishesAssetsForAnArmedHome` compares `assets-host.golden.json` (`internal/host/assetpublish_test.go:510-519`). Box-specific fields (stamp, incarnation, serving sequence) are whatever the W2 fixture produces; W1 rebases only the target host per box.
+
+- [ ] **Step 1: Write the failing tests.**
+ - `internal/release/regionaltarget_test.go` `TestRegionalTarget`: a ready provisioned socket instance of `(acct, shop)` in `uk` is true for `(acct, shop, "uk")`; each single change is false: another account, another app, `Kind "static"`, not provisioned, sidecar, `Replica`, `Region "fleet/x"`, `Tunnel` set, `Socket ""` with an `Addr`, `Status "starting"`, region `""`.
+ - `internal/registry/regional_test.go` `TestRegionalDomainsTable`: upsert, list ordered, re-upsert with a new `CreatedAt` leaves `Fingerprint` unchanged, a target change moves it, delete is idempotent, and the same over a remote registry (follow `remote_test.go`).
+ - `internal/domains/regional_derive_test.go` (W3): `TestRegionalClaimDerivesNoAliasOrPathRow`, `TestRegionalRowOnEveryBox` (two registries, box regions `""` and `"uk"`, each gets both rows; the `uk` box's target is `shop-uk.example.net` only when that route is local and `RegionalTarget` holds, else `""`), `TestRegionalCatchallDerivesStarWithApex` (first pass writes `shop.example.com` and `*.shop.example.com` together), `TestRegionalRowsKeptWhenClaimUnreadable` (a listing that shows the key and a GET that fails: rows unchanged, report incomplete), `TestRegionalRowsDeletedOnDetach`, `TestRegionalRowWrittenOverARealRoute`, `TestInstanceCatchallUnderRegionalParentDerivesNothing`, `TestRegionalWildcardRowOnlyWhereBound`.
+ - `internal/status/snapshot_test.go` `TestCollectBoxCarriesAliasesRead`: `Probes{AliasesRead: true}` alone yields `Metrics.AliasesRead == true` and JSON `"aliases_read":true`; false omits the key.
+ - `internal/host` `TestStatusTickSetsAliasesReadOnlySuccess`: through `statusTick` with a registry whose alias read fails (close the alias table or use a failing remote), the written heartbeat has no `aliases_read`; healthy, it has `true`.
+ - `internal/host/edgesfile_test.go` `TestEdgesFileNeverPublishesRegionalNames` (W2): run the real derivation then the real writer (`edgesFileWrite`); the file has the target under `home`, never `shop.example.com` under any role, never `*.shop.example.com` under `home`, and `*.shop.example.com` with role `wildcard` present (with `Wildcard`); its `hosts` block equals the golden.
+- [ ] **Step 2: Run to see them fail:**
+ `go test ./internal/release/ -run 'TestRegionalTarget' -count=1`;
+ `go test ./internal/registry/ -run 'TestRegionalDomainsTable' -count=1`;
+ `go test ./internal/domains/ -run 'TestRegional|TestInstanceCatchallUnderRegionalParentDerivesNothing' -count=1`;
+ `go test ./internal/status/ -run 'TestCollectBoxCarriesAliasesRead' -count=1`;
+ `go test ./internal/host/ -run 'TestStatusTickSetsAliasesReadOnlySuccess|TestEdgesFileNeverPublishesRegionalNames' -count=1`.
+- [ ] **Step 3: Implement**, generate and commit the golden.
+- [ ] **Step 4: Run to see them pass**, plus `go test ./internal/domains/ -count=1`, `go test ./internal/registry/ -run 'Fingerprint|Remote' -count=1`, `go test ./internal/host/ -run 'TestAssetAuthority|TestPublishes|TestEdgesFile' -count=1`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 4: RegionalTarget, regional_domains, derivation, aliases_read`.
+
+---
+
+### Task 5: Edge regional entries and `regionalGate` (spec §15 step 4)
+
+**Goal:** `Reload` turns every `regional_domains` row into a serve or deny entry, a regional row beats a real route at its own key, no regional entry carries a path map, and `regionalGate` refuses every hop and every deny before any arm leaves the box.
+
+**Model:** Opus. **Review:** per-task Astra, joint with Task 4. This review stands in for a design re-check (spec header, ruling 6); see the review section below.
+
+**Files:**
+- Modify: `internal/edge/edge.go` (`upstream` struct line 413; `Reload` after the alias fold, line 1084; `lookupUpstreamPath` line 1448; `ServeHTTP` after line 1675; `backhaulTo` line 3351), `internal/edge/homemap.go` (`Home` line 983, `ExactHome` line 996), `internal/edge/assetcatch.go` (`serveAssetFar` line 1046)
+- Create: `internal/edge/regional.go` (gate, mode type, hook), `internal/edge/regional_e2e_test.go`, `internal/edge/regional_test.go`, `internal/host/regionalwake_test.go`
+
+**Interfaces:**
+```go
+// internal/edge/regional.go
+type regionalMode uint8
+const (
+ regionalNone regionalMode = iota
+ regionalServe
+ regionalDeny
+)
+// upstream gains: regional regionalMode; regionalKey string (the row's host)
+
+// regionalGate answers and returns true when the request must stop here.
+// Not ok or not regional: false. A star match (!e.servesExactly(host)), not
+// hopped, for which e.homes.Load().ExactHome(host) names another box: false
+// (arm 1 serves that distinct exact name). A hop: 503. Deny: 503. Serve: false.
+// The 503 sets Retry-After: 2 and logs through logThrottled("regional "+up.regionalKey, ...).
+func (e *Edge) regionalGate(w http.ResponseWriter, r *http.Request, host string, up upstream, ok, hopped bool) bool
+
+// regionalObserve is a test hook: nil in production, an atomic load per call.
+// Events: "backhaul" (backhaulTo, before dialling), "asset-fill" (serveAssetFar,
+// before a fill), "home" and "exact-home" (Home/ExactHome returning ok).
+var regionalObserve atomic.Pointer[func(event, host string)]
+```
+- `ServeHTTP`: `if e.regionalGate(w, r, host, up, ok, hopped) { return }` directly after `up, ok := e.lookupUpstreamPath(host, r.URL.Path)` (line 1675), before the exact-home arm (1689) and the miss arm. Door callers pass through the same line.
+- `lookupUpstreamPath`: `if !ok || up.paths == nil || up.regional != regionalNone { return up, ok }`. The login re-resolution (line 1790) then gets the same entry back.
+- `Reload`, after the alias fold: `rows, err := e.reg.ListRegional()`; an error aborts the reload (`return err`). Build `byHost` from the `routes` slice read at line 714. For each row:
+ 1. if `cur, present := m[row.Host]; present && !cur.alias`: a deny entry, and `e.logThrottled("regional-over-route "+row.Host, ...)` naming the host. The route's registry row is untouched.
+ 2. else serve only if all hold: `row.Target != ""`; `rt, found := byHost[row.Target]`; `release.RegionalTarget(rt, row.Account, row.App, row.Region)`; `tu, present := m[row.Target]` and `!tu.alias && !tu.platformAlias && !tu.viaTunnel`. Serve entry: a copy of `tu` with `paths = nil`, `alias = true`, `platformAlias = false`, `regional = regionalServe`, `regionalKey = row.Host`.
+ 3. otherwise deny: `upstream{alias: true, regional: regionalDeny, regionalKey: row.Host}` (zero route, nil proxy).
+ The entry replaces whatever `m[row.Host]` held, alias or route.
+- No other reader of the map needs a change; check each one tolerates a zero-route deny entry: `currentHosts` (excluded by `alias`), `Allowed` (admits the key: §9 wants that), `warmSet` (`certwarm.go:718`), `importGateAdmit` (`importgate.go:39`), purge resolution (`purge_header.go:423`), the `:80` fallback (`edge.go:2600`, a redirect grants nothing).
+
+**Witnesses:**
+- `TestRegionalNameNeverLeavesItsRegion` (W1), `internal/edge/regional_e2e_test.go`, on `newBackhaulSceneWith` (annie = box A, home, named `ie` by the console; betty = box B, region `uk`), one DirStore bucket, each edge with its own real registry. Tie and Tuk are counting HTTP servers on unix sockets (`127.0.0.1` is not involved; the socket files live under the test's temp dir), routes `{Kind: "instance", Socket: ..., Provisioned: true, Status: "ready", Account: <acct>, App: "shop", Region: "" / "uk"}`. The claim `shop.example.com` (`Wildcard`, `Catchall`, placements `""->shop-ie.example.net`, `"uk"->shop-uk.example.net`) is written with `domains.SetClaimPlacements`; each box's rows come from `domains.ReconcileAliasesReport` with `Region` set, then `Reload`. Each box's edges file is the golden from Task 4, rebased to the box's name, EIP and target. `regionalObserve` counts events; `calls` and `served` on each `backhaulEdge` count arrivals. Legs (a) to (i) and the direct path-map assertion exactly as spec §13 W1 says. Mutation checks, each watched to fail once (house rules):
+ 1. remove the `regionalGate` call: (c) records a dial or (d) moves Tie;
+ 2. keep the target's path map on the serve entry and restore `lookupUpstreamPath`'s 1448 test to `up.paths == nil`: (g) moves Tother; the kept map alone fails the direct assertion;
+ 3. restore "route wins" in `Reload` (skip a row whose key holds a route): (i) records an accept on the TCP backend.
+- `TestRegionalEntryRechecksItsTarget` (W10), `internal/edge/regional_test.go`: legs (a) to (f) as spec §13 W10; restoring the row serves again. Mutation check: replace `release.RegionalTarget` in `Reload` with a presence test; (a) serves.
+- `TestRegionalApexIsAllowedForCertificates` (W9): on a box with only a deny entry, `Allowed("shop.example.com")` is true, `Allowed("*.shop.example.com")` and `Allowed("alice.shop.example.com")` are false, and `e.warmSet(appsDomain, nil)` contains `shop.example.com`.
+- `TestRegionalNameWakesItsSleepingTarget` (Review Focus 1), `internal/host/regionalwake_test.go`, modelled on `TestPlatformAliasWakesItsSleepingInstance` (`aliaswake_test.go:23`): a request for the regional name to a box whose bound target is hibernating wakes the target through its own wake path and is served.
+
+- [ ] **Step 1: Write the failing tests** above.
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/edge/ -run 'TestRegionalNameNeverLeavesItsRegion|TestRegionalEntryRechecksItsTarget|TestRegionalApexIsAllowedForCertificates' -count=1` and `go test ./internal/host/ -run 'TestRegionalNameWakesItsSleepingTarget' -count=1` (socket rules).
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run to see them pass**, run the four mutation checks and restore, then the neighbours: `go test ./internal/edge/ -run 'TestBackhaul|TestAlias|TestPath|TestHop|TestDoor|TestWildcard|TestAssetE2E|TestCertWarm' -count=1`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 5: edge regional entries and regionalGate`, with `Mutation checks:` lines.
+
+**Review brief (Tasks 4 and 5, one Astra review; it stands in for the design re-check).** Brief from `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md`; reviewer Astra (GPT-6 via codex) on the branch diff for Tasks 4 and 5, plus Task 2's reader rules for context. The brief names, for the reviewer:
+- the invariant (spec §1) and that it is enforced in one place, `regionalGate`, called straight after `lookupUpstreamPath` and before every arm that leaves the box;
+- `Reload`'s regional fold: the shared predicate on the same `routes` slice, the deny over a real route at its own key (apex and star), no path map, the serve entry's copy rules;
+- **ruling 6:** a regional claim's `Wildcard` and `Catchall` are fixed when it is created; every writer refuses to change them (`SetClaimCapabilities` and `setDomainCapabilities`, Tasks 2 and 3; the PUT, Task 7). So a box that derived the apex derived the star in the same pass (§7.2), and R4 P1's transition cannot arise;
+- **the R4 P2 fix:** the PUT refuses while `PendingForHost(host, "") > 0`, read under the host exclusion it holds; a read error fails closed (Task 7, step 5-6). Instance create's recheck sits before `BeginAllocation` (Task 3);
+- **the residual**, to judge as stated, not to fix: a member who detaches and recreates the domain with different capabilities, on a box whose claim reads keep failing, keeps that box's rows from the old claim (listed but unreadable, §7.2) and has never read the new one. That box is in spec §10.5's class (a box that cannot read its bucket), with the same end (its first successful pass or its first adoption);
+- the W1 harness choice (note 3 above) and the mutation-check record in the commit;
+- stopping rules: stop at the first round with no P1; three rounds at most.
+
+---
+
+### Task 6: `carlos add` refuses a regional host (spec §15 step 4, root half)
+
+**Goal:** a root `carlos add` of a host a regional claim holds (`X`, or `*.Y` under regional `Y`) is refused when the claim can be read, and proceeds with one line when it cannot.
+
+**Model:** Sonnet (one function, one test, an exact brief). **Review:** per-task Astra (root binary).
+
+**Files:**
+- Modify: `cli.go` (`runAdd`, right after `addRail` at line 180)
+- Create: `cli_add_regional_test.go`
+
+**Interfaces:**
+```go
+// addRegionalCheck: for host "X" the claim at X; for "*.Y" the claim at Y.
+// store nil (deploymentReadSeam gave none): skipped=true. A GET error other
+// than os.ErrNotExist: skipped=true. A regional claim: refused=true.
+func addRegionalCheck(ctx context.Context, store release.Store, host string) (refused, skipped bool)
+```
+- In `runAdd`, before the registry is opened: `store, _ := deploymentReadSeam()`; `refused, skipped := addRegionalCheck(context.Background(), store, host)`; refused: `log.Fatalf` with RD-33 (draft); skipped: print RD-34 (draft) to stderr and continue. One `domains.GetClaim` per run; no listing.
+- For `*.Y`, refused whether or not the claim has `Catchall`.
+
+- [ ] **Step 1: Write the failing test** `TestAddRefusesARegionalHost` (W12) in `cli_add_regional_test.go`, following `TestAddRefusesAnExistingRootfsHost` (`cli_add_rootfs_test.go:18`): a DirStore with a regional claim on `shop.example.com` (no `Catchall`), written with `domains.SetClaimPlacements`; env from `carlosTestEnv(t)` plus `CARLOS_DEPLOYMENT_DIR` and a valid `CARLOS_RELEASE_PUBKEY`; `cmd.Dir` a temp dir. `carlos add -registry <db> -app shop shop.example.com` and `*.shop.example.com` exit non-zero with output containing the host, and the registry has no row; `alice.shop.example.com` and `*.example.com` are added. With the two variables unset, and again with the claim object replaced by unreadable bytes (`chmod 000` on the DirStore file), the output contains RD-34's draft and the row is added.
+- [ ] **Step 2: Run to see it fail:** `go test . -run 'TestAddRefusesARegionalHost' -count=1`.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run to see it pass**, plus `go test . -run 'TestAddRefusesAnExistingRootfsHost|TestAdd' -count=1`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 6: carlos add refuses a regional host`.
+
+**Review brief:** root reads one claim object through the existing deployment-store seam (`deploymentReadSeam`, `cli.go:2004`), the same seam the verb's nested-layout and daemon checks use (`cli.go:241, 289`); nothing new is opened, run or followed from a tenant-writable path; the skip path is safe because Task 5's `Reload` denies the key (W1 leg i).
+
+---
+
+### Task 7: The placements PUT door (spec §15 step 5, part 1)
+
+**Goal:** `PUT /api/cli/apps/{account}/{app}/domains/{host}/placements` creates a regional claim, or replaces the set on the caller's own, in spec §6.2's order, with the never-served evidence, the overlap tests, the declared-ownership walk, the pending-operation read, the activation barrier, proof and the enabling gate.
+
+**Model:** Opus. **Review:** per-task Astra, joint with Task 8 (a security gate and a production-storage write).
+
+**Files:**
+- Modify: `internal/console/apiplacements.go`, `internal/console/authcli.go`, `internal/console/apidomains.go` (extract the enabling gate), `internal/console/server.go` (the mutex field)
+- Create: `internal/provision/recordhost.go`, `internal/provision/recordhost_test.go`, `internal/console/apiplacements_put_test.go`
+
+**Interfaces:**
+```go
+// internal/provision/recordhost.go
+// RecordHostDeclared lists record keys as readAllRecords does (knownAccounts,
+// then listAppSubtree(..., "instances/"), reconcile.go:2619, 2891) and matches
+// each key's host with ParseRecordKey; it reads no record body. Strict: a
+// listing error, an account manifest that does not read cleanly, or a partial
+// app listing is an error.
+func RecordHostDeclared(ctx context.Context, s release.Store, host string) (bool, error)
+
+// internal/console/server.go
+regionalMu sync.Mutex // held from evidence to write; acquired after any app or host lock
+
+// internal/console/apiplacements.go
+type placementIn struct { Region string `json:"region"`; Host string `json:"host"` }
+type placementsPutBody struct {
+ Placements []placementIn `json:"placements"`
+ Wildcard *bool `json:"wildcard,omitempty"`
+ Catchall *bool `json:"catchall,omitempty"`
+}
+func (s *Server) handleAPIDomainPlacementsPut(w http.ResponseWriter, r *http.Request)
+// regionalEvidenceRefusal: spec §6.2 step 6's walk, pending and snapshot tests.
+func (s *Server) regionalEvidenceRefusal(ctx context.Context, host string, snap edgesfile.Snapshot, boxes []status.Box, now time.Time) *doorRefusal
+// regionalOverlapRefusal: spec §6.7's table (three GETs, two snapshot rows).
+func (s *Server) regionalOverlapRefusal(ctx context.Context, host string, snap edgesfile.Snapshot, boxes []status.Box, now time.Time) *doorRefusal
+// regionalDescendantRefusal: any claim "<label>.<parent>" regional, or listed
+// but unread (s.claims.ListWithUnread), is 409; a listing error is 503.
+func (s *Server) regionalDescendantRefusal(ctx context.Context, parent string) *doorRefusal
+// regionalReadyRefusal: spec §10.3, judging the heartbeats already loaded.
+func regionalReadyRefusal(boxes []status.Box, complete bool, now time.Time) *doorRefusal
+
+// internal/console/apidomains.go, extracted from setDomainCapabilities (lines 699-735):
+// zone, wildFailTripped, delegationCNAMEDelegated, allowWildFail; nil admits.
+func (s *Server) wildcardEnablingRefusal(ctx context.Context, p Principal, host string) *doorRefusal
+```
+- Registration: `s.cliRoute("PUT /api/cli/apps/{account}/{app}/domains/{host}/placements", svcrole.Set{}, s.handleAPIDomainPlacementsPut)` (person only; a team credential cannot reach it).
+- Handler order (spec §6.2, each step's refusal before the next step runs; every snapshot, walk or overlap refusal is the neutral `hostUnavailableMsg` 409):
+ 1. `domainsGate`; `apiPerson`; `refuseTemporary`; `refuseControlPlane`; `cfg.HostClaim` on: 409 RD-25.
+ 2. `NormalizeAliasHost` (400 as attach); `domainHostPolicy(host, acct.Sqid) != hostOpen` or `directAppsDomainHost(host)`: 400 `"that hostname is platform-managed"`.
+ 3. Body: 1 to 8 (RD-17); each region through `homeRegionIn` (empty input: RD-20); duplicate region RD-18; each host `NormalizeAliasHost` (RD-20 when not a hostname); duplicate host RD-19; the host is a record of `listRecords(ctx, acct.Sqid, app, ...)` with `Region` equal to the code, `KindOrDefault() == "instance"`, `Role == ""`, not `registry.FleetPlacement(Region)`; otherwise RD-20, the same bytes for unknown and foreign hosts. `catchall` true without `wildcard` true: 422 with `domains.ErrCatchallNeedsWildcard.Error()`.
+ 4. `defer s.lockAppHost(acct.Sqid, app, host)()` in every mode; then `s.regionalMu.Lock()`. `domains.GetClaimETag`. Claim rule: none, own pending, or another owner's pending that `cur.PendingLive(now)` false or proven: create. Own regional: update; a body `wildcard`/`catchall` that differs from the claim: 409 RD-26, nothing written. Own verified schema 1: 409 RD-21. Another owner's verified: neutral 409. On create: `customDomainRefusal(acct, host)`.
+ 5. One snapshot: `edgesfile.ReadSnapshot` and `status.LoadBoxesComplete` concurrently, `edgesfile.JoinLive`. A read error, `!snap.EvidenceComplete()`, no fresh box, or a fresh heartbeat with `Metrics == nil`: 503 RD-22. `provision.RecordHostDeclared(ctx, s.cfg.Releases, host)`: error 503 RD-22. `s.store.PendingForHost(host, "")`: error 503 RD-22.
+ 6. `regionalEvidenceRefusal`: declared record at the host (any account, the caller's own included); `PendingForHost > 0`; any fresh file publishes `host` or `"*."+host` under `home` (alias or not); any fresh heartbeat lists `host`, `"*."+host` or `"*."+parent` in `Metrics.Aliases`. Then `regionalOverlapRefusal`: `domains/*.X.json` always; `domains/P.json` (with `Catchall`, any schema) and `domains/*.P.json` (any state, any body) only when P has an interior dot; a fresh file with `"*."+P` under `home`; a fresh heartbeat listing `"*."+P`. A not-found GET passes; a body that does not parse at `*.X` or `*.P` refuses 409; any other GET error 503 RD-22. On create with `catchall`: `regionalDescendantRefusal(ctx, host)`.
+ 7. `regionalReadyRefusal(boxes, complete, now)`: error, incomplete, no fresh box: 503 RD-22; a fresh box below the floor (missing or unparseable release counts as below): 409 RD-23 naming the first by label with its release; then a fresh box with `Metrics == nil || !Metrics.AliasesRead`: 503 RD-22.
+ 8. On create or replacing a pending claim: `s.domainProver(ctx, host, acct.Sqid)`; unproven with proof on: 409 with the `verify` record as attach answers it (`attachAnswer`'s verify shape), nothing written. With `wildcard` true: `wildcardEnablingRefusal`; any refusal, nothing written.
+ 9. `domains.SetClaimPlacements`: create: `Schema 2`, `Route` the first placement's host in body order, `CreatedAt` now (UTC RFC 3339), `CreatedBy` `auditActor(p, acct)`, `Wildcard`/`Catchall` from the body (absent false). Update: `Route` kept if still bound, else the first host; capabilities, `CreatedAt`, `CreatedBy` kept. `release.ErrCASConflict`: 409 RD-24. On `changed`: `auditActivity` (action `"domain-placements"`, detail lists the region=host pairs) and `bumpSerial`.
+ 10. 200 with `s.placementsView(written, snap, boxes, now)`. No further reads.
+ `s.regionalMu.Unlock()` and the lock release run on every return path (defer).
+
+- [ ] **Step 1: Write the failing tests.**
+ - `internal/provision/recordhost_test.go` `TestRecordHostDeclared`: a record key at the host under another account is true; none is false; a counting store sees no `Get` of any `instances/<host>.json`; an account manifest that fails to read, and a failed app listing, are errors.
+ - `internal/console/apiplacements_put_test.go`, with the world from Task 1's tests (heartbeats with `metrics.release` at the floor and `aliases_read: true` by default) and Task 2's claim helpers:
+ - `TestPlacementsPutTargetRefusals` (W5): unknown and another account's instance give identical bytes (RD-20); region mismatch; replica, fleet-placed, static and sidecar targets; a platform hostname (400); a service credential (401 from `apiPerson`, nothing written).
+ - `TestPlacementsPutClaimStates` (W5): no claim creates (schema 2, `pending` absent); own pending is replaced with a fresh body (no field of the pending claim survives); own verified schema 1, alias and first route, 409 RD-21; another account's verified, the neutral 409; proof on and no TXT: 409 with `verify`, nothing written.
+ - `TestPlacementsPutEvidenceRefusals` (W5): an own regional claim being updated while another box publishes a real route at the host, and at `*.<host>`: 409 (no owner exemption); a heartbeat listing the host as an alias row: 409; one edges file unreadable, one heartbeat unreadable, a fresh heartbeat with no edges file, a fresh heartbeat with no `metrics`: 503 and nothing written.
+ - `TestPlacementsPutOverlapRefusals` (W5): a parent claim with `Catchall`; an instance catch-all `*.<parent>`; an instance catch-all `*.<host>`; a file publishing `*.<parent>` as `home`; a heartbeat listing `*.<parent>`: 409 each; an unreadable parent claim: 503.
+ - `TestPlacementsPutDeclaredOwnership` (W5): a committed, unprovisioned record at the host (no route, nothing in any file) under another account, then under the caller's own app: 409 each; an account manifest that will not read during the walk: 503, nothing written.
+ - `TestPlacementsPutTwoLabelApex` (W5): a PUT for `example.com` makes the `domains/*.example.com.json` GET and neither GET at `com` (counting store); a claim at `*.example.com` in any state, and an object there that does not parse: 409 each; a GET error there: 503.
+ - `TestPlacementsPutCapabilitiesAtCreation` (W5): with both writes both true; with neither, both false; `catchall` alone 422, nothing written; `wildcard` with no delegation zone, and with no delegating CNAME: 422, nothing written; `catchall` while `alice.shop.example.com` is regional, or listed but unread: 409; a failed listing 503.
+ - `TestPlacementsPutUnchangedWritesNothing` (W5): the same set again: 200, no `Put`, serial unchanged, no audit row; a CAS conflict injected between read and write: 409 RD-24.
+ - `TestPlacementsRefusesWithABoxBelowTheFloor` (W7 barrier): a fresh box at `v0.30.2`: 409 RD-23 naming it and its release; a missing release counts as below; incomplete heartbeats 503; a stale old box ignored; every box at the floor with one `aliases_read` absent: 503.
+ - `TestPlacementsPutNormalisesInput` (Review Focus 2) and `TestPlacementsPutRefusesDuplicates` (Review Focus 3).
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/provision/ -run 'TestRecordHostDeclared' -count=1`; `go test ./internal/console/ -run 'TestPlacementsPut|TestPlacementsRefusesWithABoxBelowTheFloor' -count=1`.
+- [ ] **Step 3: Implement.** Extract `wildcardEnablingRefusal` first and run `go test ./internal/console/ -run 'TestAPIDomainAttach|TestDomainCapabil|TestWild' -count=1` to show the attach door unchanged.
+- [ ] **Step 4: Run to see them pass.**
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 7: the placements PUT door`.
+
+---
+
+### Task 8: Reverse doors, interleavings and fixed capabilities (spec §15 step 5, part 2)
+
+**Goal:** no catch-all can be created above a regional name from any door; the PUT and instance create serialise per host in both orders and across a failed record write; a regional claim's capabilities cannot change at any writer.
+
+**Model:** Opus. **Review:** per-task Astra, joint with Task 7.
+
+**Files:**
+- Modify: `internal/console/apidomains.go` (`setDomainCapabilities`), `internal/console/domaincatchall.go` (`attachInstanceCatchall` line 80), `internal/console/apiinstances.go` (test hook stages around the claim check at 1507 and the record write at 2101-2117)
+- Create: `internal/console/regional_reverse_test.go`
+
+**Interfaces:**
+- `setDomainCapabilities`, on the false-to-true `Catchall` transition only, after the regional check from Task 3 and before the enabling gate: `s.regionalMu.Lock()`, `regionalDescendantRefusal(ctx, host)`; 409 RD-28 (the regional-or-unread case) or 503; unlock after the write. The scan answers RD-28 in both 409 cases so it never says which name sits under the parent.
+- `attachInstanceCatchall`, after `customDomainRefusal`: `s.regionalMu.Lock()`; `regionalDescendantRefusal(ctx, parent)` answers RD-29 (409) or 503; `ErrRegionalClaim` from `domains.AttachInstanceCatchall` (parent regional, Task 2) answers RD-29 too. Both the API door (`apidomains.go:403`) and the browser door (`appdomains.go:60`) go through this function.
+- Test hook, `apiinstances.go`: `var instanceCreateHook func(stage, host string)` (nil in production), called with `"after-claim-check"` after the concurrent holder and claim checks are judged, and `"after-record-write"` after the record write returns, inside the host exclusion on both create paths.
+
+- [ ] **Step 1: Write the failing tests** in `internal/console/regional_reverse_test.go`:
+ - `TestCatchallRefusedOverARegionalName` (W11): with `shop.example.com` regional (made by the PUT), turning `Catchall` on for `example.com`: 409 RD-28; with a claim under `example.com` listed but unread: 409; a failed listing: 503; instance catch-all attach on `*.example.com` and on `*.shop.example.com`, from the API door and the browser door: 409 RD-29; instance create at `shop.example.com` by the claim's own app: 409 RD-27.
+ - `TestRegionalPutAndInstanceCreateSerialise` (W11 rev 4 legs), lifetimes off and on: `instanceCreateHook` holds a create at `"after-claim-check"` (no claim yet); the PUT runs to completion; the create resumes and 409s at the recheck, no record written. Reversed: the hook holds the create at `"after-record-write"` inside the host exclusion; the PUT blocks on the exclusion, then 409s on the walk, no claim written. A `lifetimeLockHook` order checker (as `lifetimes.go:43` describes) reports no inversion in either.
+ - `TestRegionalPutRefusesAPendingAllocation` (W11 rev 5 legs): lifetimes on; fail the record write of a create at `shop.example.com` after `BeginAllocation` (the fault store pattern of `TestRecoveryLeavesPendingWhenUnreadable`, `lifetimes_create_test.go:1024`): the create returns with the allocation pending and no record. The PUT: 409 neutral bytes, no claim. `recoverLifetimes` writes the record; the PUT again: 409 (now the walk), no claim. With `PendingForHost` failing: 503, nothing written. Mutation check: remove the pending test; the first PUT writes the claim and recovery then writes the colliding record.
+ - `TestRegionalClaimCapabilitiesAreFixed` (W14), exactly spec §13 W14 legs (a), (b), (c), the same-values legs, the bytes/ETag/serial/audit assertions, and the route-less branch shown unreachable (a regional claim's `Route` is never empty). Mutation checks: remove `SetClaimCapabilities`' regional refusal, (c) writes; remove the door's early refusal, (a) makes a CNAME lookup.
+ - `TestDetachThenRecreateChangesCapabilities` (Review Focus 4): detach `shop.example.com` (made with neither capability), PUT again with `wildcard` and `catchall` and a delegating CNAME: 200, both true; with proof on and the TXT present: verified; the old claim's bytes are gone.
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/console/ -run 'TestCatchallRefusedOverARegionalName|TestRegionalPutAndInstanceCreateSerialise|TestRegionalPutRefusesAPendingAllocation|TestRegionalClaimCapabilitiesAreFixed|TestDetachThenRecreateChangesCapabilities' -count=1`.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run to see them pass**, run the mutation checks and restore, then `go test ./internal/console/ -run 'TestAPIDomain|TestInstanceCatchall|TestAppDomain|TestLifetime|TestPlacements' -count=1`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 8: reverse doors, interleavings, fixed capabilities`, with `Mutation checks:`.
+
+**Review brief (Tasks 7 and 8, one Astra review):** spec §6.2's order and neutrality (no refusal readable apart from an ordinary "someone holds it"); the evidence and overlap rules against §6.7's table; the lock order (app, host, `regionalMu`) and that every return releases them; `PendingForHost` read under the host exclusion with a read error failing closed (R4 P2); the barrier; the enabling gate on create; capabilities fixed at every writer (ruling 6); the request budget against §11 (count the reads the tests' counting store records).
+
+---
+
+### Task 9: Regional readiness on the GET, and the CLI write (spec §15 step 5, part 3)
+
+**Goal:** the GET reports each region of a regional claim truthfully, including `settling`, `evidence-incomplete` and `route-collision`; `carlos domains placements --set` creates and updates.
+
+**Model:** Opus (W13 runs through `internal/host` and the console). **Review:** whole-branch.
+
+**Files:**
+- Modify: `internal/console/apiplacements.go` (`placementsView`), `apimode.go`, `domains_cli.go`, `domains_cli_test.go`
+- Create: `internal/host/aliasesread_e2e_test.go`
+
+**Interfaces:**
+- `placementsView` for a regional claim: `Mode "regional"`, one entry per placement in claim order, `Region` `homeRegionOut(p.Region)`, `Target` `p.Host`. A serving box counts when fresh, `boxAtRegionalFloor`, and `EIP != ""`. Per placement, not ready: `no-serving-box` (none serves), `below-floor` (some serve, none at the floor), `no-address` (some at the floor, none with an EIP). Then, applied to every placement at once (ready false, reason replaced), first match wins: `evidence-incomplete` (`!snap.EvidenceComplete()`, or a fresh heartbeat with `Metrics == nil || !Metrics.AliasesRead`); `route-collision` (a fresh file publishes `host` or `"*."+host` under `home` with `Alias == false`); `settling` (a fresh heartbeat's `GeneratedAt` before the claim's `CreatedAt`, or listing `host` or `"*."+host` in `Metrics.Aliases`, or a fresh file publishing either under `home` with `Alias == true`).
+- `apimode.go`: `func (s *apiSession) domainSetPlacements(ctx context.Context, a apiAcct, app, host string, set []apiPlacementIn, wildcard, catchall *bool) (apiPlacements, error)` with `type apiPlacementIn struct{ Region, Host string }` (json `region`, `host`); PUT to `.../domains/<host>/placements`. A 404 whose body is not the console's JSON error gives an error carrying RD-16.
+- `domains_cli.go`: `--set` is a repeatable flag (a `flag.Value` appending `region=host` pairs in order; a value without `=` is a usage error); `--wildcard`, `--catchall` sent only when named (`fs.Visit`, as `runDomainsAttach` does at line 128). With `--set`: PUT, print RD-15 then the same view as the read. Flag help RD-2, RD-3, RD-4; `domainsUsage` gains RD-1 and the verb list `<attach|verify|detach|list|paths|placements>`.
+
+- [ ] **Step 1: Write the failing tests.**
+ - `internal/console/apiplacements_test.go` `TestPlacementsGetRegionalReadiness` (W8): ready only from a fresh box in that region, at the floor, publishing the target and an EIP; a ready `ie` never makes `uk` ready; incomplete evidence makes none ready (`evidence-incomplete` everywhere); a fresh heartbeat older than `created_at`, or listing the host as an alias row: `settling` everywhere; a published real route at the host: `route-collision`; a fresh heartbeat with `aliases_read` false, and one without the key: `evidence-incomplete` everywhere.
+ - `TestPlacementsGetShowsADeletedTarget` (Review Focus 1): remove `uk`'s route from its box's file: `uk` is `no-serving-box`, `ie` stays ready.
+ - `internal/host/aliasesread_e2e_test.go` `TestFailedAliasReadIsIncompleteEvidence` (W13), exactly spec §13 W13, through the real `statusTick`, `CollectBox`, the heartbeat store and a console server built as `movesoffline_e2e_test.go` builds one. That file is `//go:build linux`; if the test reuses its helpers it carries the same constraint. Mutation check: make the barrier ignore `AliasesRead`; the first PUT writes the claim.
+ - `domains_cli_test.go`: `TestRunDomainsPlacementsSendsTheWholeSet` (two `--set` in order, including the same region twice, sent as typed); `TestRunDomainsPlacementsCapabilityFlagsSentOnlyWhenNamed`; `TestRunDomainsPlacementsAgainstAnOlderConsole` (Review Focus 5: a bare 404 prints RD-16); `TestRunDomainsPlacementsPrintsRegionalView` (RD-6, rows, a reason line, RD-8).
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/console/ -run 'TestPlacementsGet' -count=1`; `go test ./internal/host/ -run 'TestFailedAliasReadIsIncompleteEvidence' -count=1`; `go test . -run 'TestRunDomainsPlacements|TestAPISessionDomainPlacements' -count=1`.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run to see them pass**; run the mutation check and restore.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 9: regional readiness and the CLI write`.
+
+---
+
+### Task 10: The promotion floor and its override (spec §15 step 6)
+
+**Goal:** while a regional claim exists, no system channel at or above the floor moves below it without `--allow-below-regional-floor`; the override is logged and signed like the rootfs one.
+
+**Model:** Opus. **Review:** per-task Astra (the signed system pointer and promotion gates are production storage).
+
+**Files:**
+- Modify: `internal/release/layoutintent.go`, `internal/release/systempointer.go` (pointer line 38, options line 263, both builders 308 and 368), `internal/console/rootfsfloor.go`, `internal/console/apisystemupdate.go` (bodies lines 356 and 914, preflight 424, rollback mapping 949), `internal/console/hostactivation.go` (digest 111-121, promote 204, held rollback 241, rollback 259-262), `system.go` (flags beside lines 295 and 576, body at 348 and 593)
+- Create: `internal/console/regionalfloor.go`, `internal/console/regionalfloor_test.go`
+- Test: `internal/release/layoutintent_test.go` (add), `internal/console/apisystemupdate_test.go` (add)
+
+**Interfaces:**
+```go
+// internal/release/layoutintent.go
+const RegionalFloorOverrideFlag = "allow-below-regional-floor"
+const RegionalFloorOverrideUsage = "<RD-32 draft, with v0.31.0 in place of <floor>>"
+// shaped like RootfsFloorAllows (line 262), against RegionalDomainsFloor
+func RegionalFloorAllows(installed, candidate string) bool
+// internal/release/systempointer.go
+AllowBelowRegionalFloor bool `json:"allow_below_regional_floor,omitempty"` // SystemPointer
+AllowBelowRegionalFloor bool // SystemPromoteOptions
+// internal/console/regionalfloor.go
+var errRegionalFloorPromotion = errors.New("regional floor")
+type regionalFloorError struct{ msg string } // Unwrap() error { return errRegionalFloorPromotion }
+// Claims are read only when !RegionalFloorAllows(cur.Current.Version, target):
+// s.claims.ListWithUnread; a listing error refuses; any Regional() claim, or
+// any unread claim, refuses unless allow (logged with RD-31).
+func (s *Server) regionalFloorJudge(ctx context.Context, channel string, cur *release.SystemPointer, target string, allow bool) error
+// rootfsfloor.go: rootfsFloorGate becomes systemFloorGate: one pointer read,
+// both judges on it, the one ETag returned.
+func (s *Server) systemFloorGate(ctx context.Context, component, channel, target string, allowRootfs, allowRegional bool) (string, error)
+```
+- Request bodies gain `AllowBelowRegionalFloor bool json:"allow_below_regional_floor"` on update and rollback; the door maps `errRegionalFloorPromotion` exactly as it maps `errRootfsFloorPromotion`. `rollbackHostUpdate` gains an `allowBelowRegionalFloor bool` parameter and runs `regionalFloorJudge` after `rootfsFloorJudge` on the same `current`. The reservation digest struct and the held-rollback comparison include the new field.
+- `system.go`: `fs.Bool(release.RegionalFloorOverrideFlag, false, release.RegionalFloorOverrideUsage)` on `carlos system update` and `rollback`; `in["allow_below_regional_floor"] = true` when set.
+
+- [ ] **Step 1: Write the failing tests** (W7), mirroring the rootfs tests line for line: `internal/release/layoutintent_test.go` `TestRegionalFloorAllows` (mirror of line 157); `internal/console/regionalfloor_test.go` `TestRegionalFloorRefusesBeforeReservation`, `TestRegionalFloorLeavesAChannelAloneWithoutRegionalClaims`, `TestRegionalFloorLeavesAChannelBelowItAlone`, `TestRegionalFloorOverrideIsPartOfTheRequest`, `TestRegionalFloorBindsTheJudgedPointer`, `TestRegionalFloorUnreservedRollbackKeepsTheOverride`, `TestRegionalFloorCountsAnUnreadClaim`, `TestRegionalFloorReadsNoClaimsWhenNotCrossing` (counting store: zero `domains/` lists); `internal/console/apisystemupdate_test.go` `TestSystemDoorsRefuseBelowTheRegionalFloor` (mirror of line 549).
+- [ ] **Step 2: Run to see them fail:** `go test ./internal/release/ -run 'TestRegionalFloorAllows' -count=1`; `go test ./internal/console/ -run 'TestRegionalFloor|TestSystemDoorsRefuseBelowTheRegionalFloor' -count=1`.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run to see them pass**, plus `go test ./internal/console/ -run 'TestRootfsFloor|TestSystemDoors|TestActivation' -count=1` and `go test . -run 'TestSystem' -count=1`.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 10: the promotion floor and its override`.
+
+**Review brief:** both judges on one pointer read and one ETag; claims read only when crossing; unread counts as regional; the override signed, part of the request, logged; boxes do not read the field.
+
+---
+
+### Task 11: Copy review, the CLI page and the copy gate (spec §15 step 7)
+
+**Goal:** every RD row approved and in its file, the CLI page names the subcommand, and a gate keeps it so.
+
+**Model:** Sonnet. **Review:** whole-branch.
+
+**Files:**
+- Modify: `docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md`, the files each row names, `docs/site/cli.md` (inside `### carlos domains`, after the `#### One name per instance: *.<parent>` section)
+- Create: `approved_regional_domains_copy_test.go`, `docs/superpowers/plans/LUNA-COPY-BRIEF-REGIONAL-DOMAINS.md`, `docs/superpowers/plans/LUNA-COPY-REVIEW-REGIONAL-DOMAINS.md`
+
+**Interfaces:**
+- Gate, modelled on `approved_db_forward_copy_test.go`: `const regionalDomainsCopyRecordPath = "docs/superpowers/plans/2026-10-28-regional-domains-447-copy.md"`; `regionalDomainsCopyIDs` is RD-1 to RD-39 in order; `regionalDomainsCopyBuilt` is every id; tests `TestRegionalDomainsCopyRecordIsComplete`, `TestRegionalDomainsCopyHasNoEmDash`, `TestRegionalDomainsBuiltCopyIsApproved`, `TestRegionalDomainsBuiltCopyIsApplied`. The applied test collapses whitespace (`strings.Join(strings.Fields(s), " ")`) on both the file and the row before matching, and replaces each `<placeholder>` with a format-verb wildcard as the db gate does.
+- CLI page: heading `#### ` + RD-35, then RD-36, the example block from spec §6.6 (both commands, and the `--wildcard --catchall` form; syntax, not copy), RD-37, RD-38, RD-39.
+
+- [ ] **Step 1: Luna pass.** Write the brief from `LUNA-COPY-BRIEF-REGION-LABELS-2.md`'s shape: the deck, Paul's house rules (no em dashes; full stop and a new sentence, lower case in CLI and console strings; plain; neutral names), the context of each row. Record the result in `LUNA-COPY-REVIEW-REGIONAL-DOMAINS.md`.
+- [ ] **Step 2: Paul's approval.** Hand the deck to Paul through the `copy-review` skill (or apply his delegation to Luna if he gives it, as for the region labels deck). Apply approved text to the deck verbatim; each row becomes `approved`.
+- [ ] **Step 3: Write the failing gate** and run it: `go test . -run 'TestRegionalDomainsCopy|TestRegionalDomainsBuiltCopy' -count=1`. Expected: the applied test fails on every row whose approved text differs from the draft in code.
+- [ ] **Step 4: Swap the approved text into each file**, write the CLI page section, and run: the gate; `go test ./internal/docsite/ -count=1`; and the tests that assert on copy: `go test ./internal/console/ -run 'TestPlacements|TestRegional|TestCatchallRefusedOverARegionalName|TestInstanceCreateRefusesARegionalHost|TestAttachOnARegionalClaim' -count=1`, `go test . -run 'TestRunDomainsPlacements|TestAddRefusesARegionalHost' -count=1`, `go test ./internal/domains/ -run 'TestRegional|TestSetClaimCapabilitiesRefusesARegionalClaim' -count=1`. Tests that pinned draft text are updated to the approved text in the same commit.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 11: approved copy, CLI page, copy gate`.
+
+---
+
+### Task 12: Assign the floor (spec §15 step 7, §10.1)
+
+**Goal:** `release.RegionalDomainsFloor` names the first release that carries this branch, pinned by a test.
+
+**Model:** Sonnet. **Review:** whole-branch.
+
+**Files:** Modify `internal/release/layoutintent.go`, `internal/release/layoutintent_test.go`; if the value changes, RD-32's text in the deck and the constant.
+
+- [ ] **Step 1: Read the tags:** `git fetch --tags origin` is not needed; run `git tag --sort=-v:refname | head -5` and `git ls-remote --tags origin 'v0.31*'`. If any `v0.31.x` exists, the floor is the next minor (`v0.32.0`) and the comment says why; otherwise `v0.31.0`.
+- [ ] **Step 2: Write the failing test** `TestRegionalDomainsFloorIsPinned` beside `TestTeamEnvironmentFloorIsPinned` (line 199): the value equals the chosen `SemVer`; it is above `TeamEnvironmentFloor`; `BelowFloor` holds for `v0.30.2` and not for the floor; `RegionalFloorOverrideUsage` names `"v" + RegionalDomainsFloor.String()`. Run `go test ./internal/release/ -run 'TestRegionalDomainsFloorIsPinned' -count=1`; it fails until the comment and value are final (write the test first against the chosen value).
+- [ ] **Step 3: Set the value and its doc comment** in the style of `TeamEnvironmentFloor`'s (line 232): the latest tag at the time of writing, and that the first release cut from a main containing this branch MUST be that version.
+- [ ] **Step 4: Run** `go test ./internal/release/ -run 'Floor' -count=1` and the console floor tests from Task 10.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 12: pin RegionalDomainsFloor`.
+
+---
+
+### Task 13: The census (spec §14, AGENTS.md "The census")
+
+**Goal:** both censuses pass with reviewed entries, and the branch's whole gate is green once.
+
+**Model:** Opus. **Review:** the census reviewer (Astra, the other family from the author) per AGENTS.md "The census" step 4; verdict recorded on amadan #280. The whole branch then gets its final review (below).
+
+**Files:**
+- Create: `internal/provision/regional_domains_447_census_test.go`, `testdata/plan14-root-reads-regional-domains-447.tsv` (written by the tool), `docs/superpowers/notes/census-proposal-regional-domains-447.md` (written by the tool)
+- Modify: `internal/provision/plan9_b8_census_test.go` (line 369: the chain head), `testdata/plan14-root-reads-chain.tsv` (written by the tool)
+
+- [ ] **Step 1: Root-read census.** `make census-card` (sandbox off). Expected classes per spec §14: `internal/edge` (`Reload`, `regionalGate`, `lookupUpstreamPath`, `ServeHTTP`, `backhaulTo`, the hook sites), `internal/domains` (claim shape, derivation, instance catch-all parent rule), `internal/registry` (table, fingerprint, remote), `internal/release` (`RegionalTarget`, floor, `SystemPointer`, `SystemPromoteOptions`), `internal/host` (`aliasPassReporting`, its callers, `statusTick`), `internal/status` (`AliasesRead`), `internal/provision` (`RecordHostDeclared`), the root package (`cli.go` `runAdd`/`addRegionalCheck`, `domains_cli.go`, `apimode.go`, `system.go`), and `internal/edgesfile` only for the golden if the scanner takes testdata. `internal/console` is out of scope. Write a CLAIMS file in `$TMPDIR`, one line per changed unit, `<file>:<unit><TAB><what changed, and which read was added if any>`: the only new root read is `addRegionalCheck`'s one `domains.GetClaim` of `domains/<host>.json` through `deploymentReadSeam` (the deployment bucket or `CARLOS_DEPLOYMENT_DIR`), read only, never opened as a path. Then `make census-propose NAME=regional-domains-447 CLAIMS=$TMPDIR/claims.tsv`. Restore the card's hand-written context section, which census-propose drops: what the branch does, the one new read, and why no unit lets root open, run, query or follow anything from a path a tenant, app or box agent can create. Rerun `make census-propose` with the same NAME after any later code change.
+- [ ] **Step 2: Record-write census.** Run `go test ./internal/provision/ -run 'TestPlan9B8RecordWriteCensus' -count=1` and read its problems. Write `regionalDomains447WriteCensusInventory()` layered on `freshBox446WriteCensusInventory()`, in the shape of `edge_rate_limit_census_test.go`, with a header comment per unit: `claimRawSetClaimPlacements` (new, `nonrecord`, `sel:Put`), `claimRawSetClaimCapabilities`, `claimRawSetClaimPaths`, `claimRawAttachInstanceCatchall` (changed, `nonrecord`), `RecordHostDeclared` (new, `key-site`), `createRecordMarked` and `createRecordWithLifetimeLocked` (changed, class unchanged), and any other unit the test names, each with its reviewed class and new digest. Point `TestPlan9B8RecordWriteCensus` at the new function. Never bless a digest without reading the unit.
+- [ ] **Step 3: Run both:** `go test ./internal/provision/ -run 'TestPlan14RootReadCensus|TestCensusScopeIsTheRootBinary|TestPlan9B8RecordWriteCensus|TestPlan9B8CensusRejectsNewSites' -count=1`. Expected: PASS.
+- [ ] **Step 4: Once, before handoff** (sandbox off, niced): `go build ./... && go vet ./... && gofmt -l .` (empty), `GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build ./...`, `GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build ./...`. The full test gate runs in CI on push, not locally.
+- [ ] **Step 5: Commit** `Regional domains (#447) Task 13: census overlays and card`. Brief the census reviewer from `docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md`.
+
+---
+
+## After Task 13
+
+- Whole-branch review (Fable, per AGENTS.md delegation policy), against `main` on the amadan.net remote, briefed with this plan, the spec, the Review Focus list and the P3 follow-up list. It covers the whole-branch tasks (1, 9, 11, 12) in particular, including Task 1's GET registration. Stop at the first round with no P1.
+- Push to amadan only when the controller says so; read CI with `amadan ci status carlos/platform -branch regional-domains-447`. Merge is `amadan branch merge -squash` with full arguments, by whoever owns the merge (platform-17).