carlos / platform Public

plan: domain registration transfers in; round 1 review brief

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev b77e1ec730a6656943ea7c7d4d2e3da1e6a83ec7 parent 322478a
2 files changed, +309 −0
  • docs/superpowers/plans/2026-11-21-domain-registration-transfers-in.md +277 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-transfers-plan.md +32 −0

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-KEERgp
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/benbjohnson/litestream v0.5.14
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading golang.org/x/net v0.62.0
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading golang.org/x/sys v0.49.0
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/lmittmann/tint v1.1.3
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading golang.org/x/text v0.43.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec

amadan: job cancelled — a newer push superseded it
diff --git a/docs/superpowers/plans/2026-11-21-domain-registration-transfers-in.md b/docs/superpowers/plans/2026-11-21-domain-registration-transfers-in.md
new file mode 100644
index 000000000..521c9e268
--- /dev/null
+++ b/docs/superpowers/plans/2026-11-21-domain-registration-transfers-in.md
@@ -0,0 +1,277 @@
+# Domain registration, transfers in 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:** An account owner moves a domain they hold at another registrar into Carloku with its auth code: they pay a year's transfer, the domain keeps its nameservers, and once the transfer completes it is a bought domain on the Domains page.
+
+**Architecture:** A transfer is a second kind of purchase in the existing account-level purchase store (`internal/console/domainstore.go`), advanced by the existing purchase pass with its own states: Checkout (authorise), submit to the registrar, capture on acceptance, wait, then record the registration with no zone, or refund. The `registrar` seam gains transfer check, request and status calls (Openprovider adapter, fake); the `billing` seam gains a refund. Plan 2a's pages and CLI gain "Move to Carloku" / `carlos domains transfer`, and handle a bought domain with no Carloku zone.
+
+**Tech Stack:** Go, modernc SQLite (console.db), `internal/registrar` + `internal/registrar/openprovider` (REST `/v1`), `internal/billing` + `internal/billingstripe`, `golang.org/x/net/dns/dnsmessage` (already a dependency through `golang.org/x/net`) for the DS lookup, `html/template` console pages from the mockup kit.
+
+**Spec:** `docs/superpowers/specs/2026-11-01-domain-registration-design.md`, revision 5, §12 (approved 2026-11-21). Read §12 whole, plus §5.1, §5.5, §6, §7, §11.3-§11.7. Plans 1 (`docs/superpowers/plans/2026-11-01-domain-registration-1-buy.md`) and 2a (`docs/superpowers/plans/2026-11-19-domain-registration-2a-account-domains.md`) built the engine and the account pages this plan extends.
+
+**Plans in this series:** 1 buy (live). 2a account-level domains (merged 69b44f53, v0.40.3 on dev). **Transfers in (this plan), ahead of 2b and 3 (spec R16).** 2b reconcile/reconverge/alerts. 3 renewals (must ship within a year of the first completed transfer). 4 customer records, change owner, transfer out.
+
+**Switch-on:** rides the buy door (`domainBuyReady`; off while `CARLOS_HOST_CLAIM` is on). The first real transfer is rushedsunlight.com on flagship after the release, with Paul's GO and his auth code (spec §12.7).
+
+## Global Constraints
+
+- **Registration only (R13):** a transfer sends the domain's current nameservers, read from public DNS at check time, and never changes them. A transfer is never submitted with an empty nameserver list.
+- **Money (R14, §12.4):** authorise at Checkout; capture only once the registrar has accepted the request; a definite refusal before acceptance cancels the authorisation; a failure after capture is refunded in full; an ambiguous registrar or payment answer is never read as a failure; a capture that fails after acceptance keeps the transfer tracked, and a completion then is recorded `unpaid` (operator alerted, owner emailed), bounded by one fee.
+- Registrar-side auto-renew OFF and WHOIS privacy where the TLD allows it, on every transfer (§5.5, §4.4).
+- **The auth code is a secret (§7.4, anti-goal):** never logged, never in a URL or query string, never in an error string or `%v`/`%#v` output; held in the purchase record only until the move that records the submit, which clears it. The CLI reads it from `--auth-code -` (stdin) as well as the flag value.
+- Refusals before payment (§12.3): not registrable, TLD not marked transferable in the catalog, premium, already registered with Carloku, another ACCOUNT's claim on the apex or `www` (this account's own claims are allowed and left untouched), DNSSEC-signed (a DS record exists), nameservers unreadable, the registrar's transfer check says no, the buying entitlement (custom-domain entitlement incl. sponsored accounts), the daily cap (transfers count with purchases), and the registrar balance covering the transfer cost (§6.3: refuse and alert the operator, as buying does). Neutral refusals stay byte-identical to the buying ones.
+- A completed transfer records a `DomainRegistration` with `ZoneID ""`. Every Plan 1/2a path that reads a registration must handle an empty zone: Point refuses it ("its DNS is hosted elsewhere"), the domain page shows records to set at the DNS host.
+- No registrar or DNS host name in any customer-facing string; every new string is a draft in a `*_copy.go` file until the copy pass (Task 11). No em or en dashes; curly quotes in prose; nothing says the domain "renews".
+- Every new route gets its `parity/parity.tsv` row (then `make parity-doc`), its route-register entries (linkedpolicy.go, claim_invariant_fixtures_test.go, claim_invariant_probes_read_test.go, svcroutes_test.go, apilinks_test.go, testdata/claim-routes.txt when not gated by `gateNoHostClaim`, the submission-gate list) and `Gate: gateNoHostClaim` for buy-door routes, as Plan 2a's doors do.
+- Writing Go here (AGENTS.md): ctx passed on; no `time.Sleep` in tests; `errors.Is`/`As`; functions under 300 lines, files under 3,000 (`internal/console/domainbuy.go` is large: put the transfer engine in its own file); `make code-health` before pushing.
+- CI traps from Plan 2a: console chrome CSS changes re-pin `demo_claim_footer_test.go` digests; account pages over 500 ms cold need an `over:` record in `internal/console/testdata/perf-budgets.txt`; a new census layer file goes in `scripts/gitleaks-gate/notscanned.go`.
+- Review budget (AGENTS.md stopping rules): plan review by Astra, at most three rounds, stop at the first round with no P1. Per-task Astra review on Tasks 2, 3, 6 and 9 (registrar adapter, billing refund, money engine, security gates); Fable joins on Task 6 and the whole-branch review.
+- Local verification: targeted `-run` on touched packages only; CI runs everything. Root-package tests need `TMPDIR` set to a fresh `mktemp -d /var/tmp/...` (not under /tmp).
+
+## Review Focus
+
+1. **A wrong or stale auth code.** Expected: the registrar refuses at submit (authorisation cancelled, nothing taken) or fails after acceptance (capture refunded); the card ends Failed with "the transfer code was not accepted" copy and Refunded/Not charged. Tests in Task 6: `TestTransferRefusedAtSubmitCancelsAuthorisation`, `TestTransferFailsAfterAcceptanceRefunds`.
+2. **The losing registrar says nothing for a week.** Expected: the transfer stays `transfer_pending`, status read every 30 minutes, operator alerts at 24 h unknown (submit) and a day before the authorisation lapses; a completion after the lapse is recorded `unpaid` and the domain is still recorded as the customer's. Test in Task 6: `TestTransferUnknownAlertsAndLateCompletionIsUnpaid`.
+3. **Nameservers can't be read** (NXDOMAIN, SERVFAIL, an empty answer, or a resolver timeout). Expected: refused before payment with "we couldn't read this domain's nameservers, try again" copy; a transfer is never sent with no nameservers. Tests in Task 6: `TestTransferStartRefusesUnreadableNameservers` and in Task 2 the adapter refuses an empty list (`TestRequestTransferRefusesEmptyNameservers`).
+4. **The auth code leaks.** Expected: absent from every log line, error, URL and stored record after submit; `String`/`GoString` of the request redacted. Tests: Task 2 `TestTransferRequestStringRedactsAuthCode`, Task 6 `TestTransferAuthCodeClearedAtSubmitAndNeverLogged` (captures the log output of a whole transfer and greps for the code).
+5. **A transferred domain (no zone) on Plan 2a's paths.** Expected: the Domains page shows "Bought here" with expiry; the domain page shows Renewal, Registered to, Addresses and records to set, plus "DNS hosted elsewhere"; Point refuses with a plain message and writes nothing; account deletion counts it. Tests in Task 8: `TestTransferredDomainPageShowsDNSElsewhere`, `TestPointRefusesDomainWithoutZone`.
+
+---
+
+### Task 1: UX pass in the mockup kit
+
+**Files:**
+- Create: `docs/superpowers/mockups/domains-account-kit/transfer-form.html`, `transfer-card.html` (from `docs/console-mockup-kit/shell.html`, components from `docs/console-styleguide.md`), and update `domain-elsewhere.html` with the "Move to Carloku" action and `domain-bought.html` with a "DNS hosted elsewhere" variant.
+
+- [ ] **Step 1:** Draw the form (spec §12.3 items 1-2: before-you-start lines, auth code field, Registered to as in buy step 3, summary: price, "Your DNS and email don't change", the nameservers kept) and the card (Paid → Sent → Waiting for the current registrar (up to five days, can be approved sooner there) → Done / Failed + Refunded or Not charged).
+- [ ] **Step 2:** UX pass at 390 px and desktop, light and dark; lead with state; `impeccable` critique and distill; fix what reads badly.
+- [ ] **Step 3:** Commit `mockups: transfer form and card`; the controller posts the paths on the branch discussion. Tasks 2-8 do not wait for Paul's look; Task 9 does unless he says go on.
+
+### Task 2: Registrar seam and Openprovider adapter for transfers (risky: per-task review)
+
+**Files:**
+- Modify: `internal/registrar/registrar.go`, `internal/registrar/registrar_test.go`, `internal/registrar/registrartest/fake.go`
+- Modify: `internal/registrar/openprovider/client.go`, `internal/registrar/openprovider/client_test.go`; Create: `internal/registrar/openprovider/testdata/transfer_*.json`
+
+**Interfaces:**
+- Produces, in `registrar`:
+ ```go
+ type TransferCheck struct {
+ Domain string
+ Transferable bool // false: Reason says why (locked, too recent, ...)
+ Reason string // provider-neutral code: "locked", "recent", "expired", "not_registered", "unsupported", ""
+ Cost Money // the registrar's transfer cost, one year
+ Premium bool
+ }
+ type TransferRequest struct {
+ Domain, AuthCode, OwnerHandle, Key string // Key: idempotency, the purchase ID
+ Nameservers []string
+ }
+ func (r TransferRequest) String() string // auth code redacted
+ func (r TransferRequest) GoString() string // same
+ type TransferState string
+ const (
+ TransferPending TransferState = "pending" // accepted, waiting on the losing registrar or registry
+ TransferCompleted TransferState = "completed" // the domain is now in our account
+ TransferFailed TransferState = "failed" // definite; Reason says why
+ TransferNone TransferState = "none" // no transfer for this domain in our account
+ )
+ type TransferStatus struct {
+ State TransferState
+ Reason string // provider-neutral: "auth_code", "rejected", "timeout", "locked", ""
+ Registered Registered // set when State == TransferCompleted (expiry from the registrar)
+ }
+ // Registrar gains:
+ CheckTransfer(ctx context.Context, domain string) (TransferCheck, error)
+ RequestTransfer(ctx context.Context, r TransferRequest) (TransferStatus, error) // ErrRefused definite (nothing pending), ErrIndeterminate after send
+ TransferStatus(ctx context.Context, domain string) (TransferStatus, error)
+ ```
+ The fake: `TransferChecks map[string]TransferCheck`, `Transfers map[string]TransferStatus` (scripted; `Advance(domain, TransferStatus)` moves one), `RequestErr` one-shot, idempotent by Key, records the last `TransferRequest` it saw with the auth code (for tests) and `Calls`.
+- Openprovider (`/v1`, confirm paths and fields against developer.openprovider.com before writing testdata; the documented examples use `/v1beta/domains/transfer`): `RequestTransfer` sends the domain, `auth_code`, owner/admin/tech/billing handles = `OwnerHandle`, `name_servers` from the request, `autorenew: "off"`, privacy on, period 1; refuses an empty `Nameservers` with `ErrRefused` before any HTTP call. `TransferStatus` maps the provider's status values (pending request, active, failed/rejected codes) to the neutral states; a domain not in the account is `TransferNone`, never indeterminate. `CheckTransfer` uses the provider's transfer check/price where `/v1` has one; where it can't establish transferability it returns `Transferable: true` with the cost (best effort, spec T5).
+
+- [ ] **Step 1: Write failing tests:** `TestTransferRequestStringRedactsAuthCode` (`fmt.Sprintf("%v %#v %+v", r, r, r)` has no auth code), `TestFakeTransferLifecycle`, `TestRequestTransferSendsAutorenewOffNameserversHandles` (decoded body), `TestRequestTransferRefusesEmptyNameservers` (no HTTP call), `TestRequestTransferTimeoutIsIndeterminate`, `TestRequestTransferBadAuthCodeIsRefused` (documented refusal code → `ErrRefused`, reason `auth_code`), `TestTransferStatusMapsPendingCompletedFailedNone`, `TestCheckTransferParsesCostAndLock`, `TestAuthCodeNeverInErrorText` (a provider error body echoing the code is not surfaced in the error string).
+- [ ] **Step 2: Run** `go test ./internal/registrar/... -run 'Transfer'`; expect FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run**; expect PASS.
+- [ ] **Step 5: Commit** `registrar: transfer check, request and status (Openprovider /v1)`.
+- [ ] **Step 6: Astra task review** (external API mapping, secret handling).
+
+### Task 3: Refunds in the billing seam (risky: per-task review)
+
+**Files:**
+- Modify: `internal/billing/billing.go` (Provider interface near `:336-342`), `internal/billing/billingtest/fake.go`
+- Modify: `internal/billingstripe/payment.go`, `internal/billingstripe/payment_test.go`, `internal/billingstripe/prepared.go` (Send dispatch)
+
+**Interfaces:**
+- Produces: `PrepareRefund(paymentIntent, key string) (Prepared, error)` on `billing.Provider`, full refund of a captured PaymentIntent; Stripe `POST /v1/refunds` with `payment_intent`, idempotency key from `key`, outcome classified through the existing `classify` so a lost answer is indeterminate. The fake: `RefundPayment` lifecycle (refund before capture errors; double refund with the same key is one refund). Every `billing.Provider` implementation compiles (`git grep -n 'billing.Provider' -- '*.go'`).
+
+- [ ] **Step 1: Write failing tests:** `TestRefundFormAndIdempotency`, `TestRefundLostAnswerIsIndeterminate`, `TestFakeRefundLifecycle`.
+- [ ] **Step 2: Run** `go test ./internal/billing/... ./internal/billingstripe/ -run Refund`; expect FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run**; expect PASS; `go vet ./internal/billing/... ./internal/billingstripe/ ./internal/console/`.
+- [ ] **Step 5: Commit** `billing: full refunds of a captured payment`.
+- [ ] **Step 6: Astra task review** (billing).
+
+### Task 4: Catalog: transferable TLDs and transfer quotes
+
+**Files:**
+- Modify: `internal/domainreg/catalog.go`, `internal/domainreg/catalog_test.go`, `internal/domainreg/testdata/catalog.json`; the operator runbook `docs/site/domains-buying.md` (one paragraph on `transferable` and why only TLDs whose transfer adds a year are marked)
+
+**Interfaces:**
+- Produces: `TLD` gains `Transferable bool \`json:"transferable"\`` and `Transfer map[string]int64 \`json:"transfer"\`` (optional; a missing currency falls back to `Renew`). `func (c *Catalog) QuoteTransfer(domain, currency string, t registrar.TransferCheck) (Quote, error)` with `ErrTLDNotOffered` for a TLD absent or not `Transferable`, `ErrPremium`, `ErrNotTransferable` (new; `t.Transferable` false, wrapping `t.Reason`), `ErrCostAboveCeiling` (same rule as `Quote`).
+
+- [ ] **Step 1: Write failing tests:** `TestQuoteTransferDefaultsToRenewPrice`, `TestQuoteTransferUsesTransferPriceWhenSet`, `TestQuoteTransferRefusesUnmarkedTLD`, `TestQuoteTransferRefusesLockedWithReason`, `TestQuoteTransferCostCeiling`, `TestLoadCatalogAcceptsTransferFields`.
+- [ ] **Step 2: Run** `go test ./internal/domainreg/ -run 'QuoteTransfer|LoadCatalog'`; expect FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run**; expect PASS.
+- [ ] **Step 5: Commit** `domainreg: transferable TLDs and transfer quotes`.
+
+### Task 5: Store: transfer purchases and expiry alerts
+
+**Files:**
+- Modify: `internal/console/domainstore.go`, `internal/console/domainstore_test.go`
+
+**Interfaces:**
+- Produces:
+ ```go
+ type PurchaseKind string
+ const (PurchaseKindBuy PurchaseKind = "buy"; PurchaseKindTransfer PurchaseKind = "transfer")
+ // DomainPurchase gains Kind PurchaseKind (column kind TEXT NOT NULL DEFAULT 'buy')
+ const (
+ PurchaseTransferSubmitting PurchaseState = "transfer_submitting" // sent; outcome may be unknown
+ PurchaseTransferPending PurchaseState = "transfer_pending" // accepted by the registrar
+ PurchaseTransferRefunding PurchaseState = "transfer_refunding" // failed after capture; refund in flight
+ )
+ // purchaseDetails gains (all omitempty):
+ AuthCode string // cleared in the move that enters transfer_submitting's successor; never logged
+ Nameservers []string // read at check, sent at submit
+ SubmittedAt time.Time
+ Captured bool // capture confirmed
+ CaptureFailed bool // definite capture failure after acceptance
+ UnknownAlerted, LapseAlerted bool
+ NextStatusAt time.Time // next transfer status read (30 min cadence)
+ func (s *Store) PendingTransfers(ctx context.Context) ([]DomainPurchase, error) // kind transfer, live
+ func (s *Store) RegistrationsExpiringBefore(ctx context.Context, t time.Time) ([]DomainRegistration, error) // expires_at < t and expiry_alerted_at = 0
+ func (s *Store) MarkExpiryAlerted(ctx context.Context, domain string, at time.Time) error
+ ```
+ Schema: `ALTER TABLE domain_purchases ADD COLUMN kind ...`, `ALTER TABLE domain_registrations ADD COLUMN expiry_alerted_at INTEGER NOT NULL DEFAULT 0` (the duplicate-column tolerant loop). The new states are live (not in `liveDomainPurchaseSQL`'s terminal list), so the one-live-purchase-per-domain index and `DomainObligations` cover transfers. `String()`/`GoString()` on `purchaseDetails` (or wherever purchases are formatted for logs) redact `AuthCode`.
+
+- [ ] **Step 1: Write failing tests:** `TestTransferPurchaseRoundTripKindAndDetails`, `TestOneLivePurchasePerDomainAcrossKinds` (a live transfer blocks a buy of the same domain and vice versa), `TestDomainObligationsCountsPendingTransfer`, `TestPurchaseDetailsRedactAuthCode`, `TestRegistrationsExpiringBeforeAndMarkAlerted`, `TestMigrateAddsKindAndExpiryAlertedIdempotent`.
+- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TransferPurchase|LivePurchasePerDomainAcrossKinds|DomainObligationsCountsPending|RedactAuthCode|RegistrationsExpiring|MigrateAddsKind'`; expect FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run**; expect PASS; also `-run 'StoreGate|ClaimSQL|SavedContact|MigrateDomains'`.
+- [ ] **Step 5: Commit** `console: transfer purchases and registration expiry alerts in the store`.
+
+### Task 6: The transfer engine (risky: per-task review)
+
+**Files:**
+- Create: `internal/console/domaintransfer.go`, `internal/console/domaintransfer_test.go`, `internal/console/domaintransfer_copy.go`
+- Modify: `internal/console/domainbuy.go` (dispatch transfer-kind purchases to the transfer steps from `advancePurchaseStep`; reuse `purchaseCheckout`, `purchaseMutation`, `movePurchase`, `purchaseAlert`, `purchaseOwnerNotice`), `internal/console/server.go` (`Config.LookupNS func(ctx, name) ([]*net.NS, error)` defaulting to `net.DefaultResolver.LookupNS`, and `Config.LookupDS func(ctx, name) (bool, error)` defaulting to `lookupDS` below)
+- Create: `internal/console/dnsds.go`, `internal/console/dnsds_test.go`
+
+**Interfaces:**
+- Consumes: Tasks 2-5; `admitDomainBuy`'s entitlement, cap and linked refusals (factor the shared parts into one helper both use; buying keeps refusing every existing claim, transfers refuse only another account's claim, spec T4); `purchaseContactSelection` and the frozen-contact rules (Plan 2a Task 4); `s.claims.ListWithUnread` for the claim check.
+- Produces:
+ ```go
+ func (s *Server) quoteTransfer(ctx context.Context, acct *Account, name string) (transferQuote, *doorRefusal)
+ type transferQuote struct { Quote domainreg.Quote; Nameservers []string }
+ func (s *Server) startDomainTransfer(ctx context.Context, acct *Account, name, authCode string, contact purchaseContactSelection, principal string, confirmed domainreg.Quote) (*DomainPurchase, string /*checkout URL*/, *domainreg.Quote, *doorRefusal)
+ func (s *Server) advanceTransferStep(ctx context.Context, acct *Account, p *DomainPurchase) error
+ func lookupDS(ctx context.Context, name string) (bool, error) // dnsmessage DS query to the system resolver (/etc/resolv.conf), TCP fallback on truncation; error on SERVFAIL or timeout
+ ```
+ Steps, each one CAS move (spec §12.4):
+ 1. `awaiting_payment` → `authorised`: as buying (Checkout, `PaymentCheckout`).
+ 2. `authorised` → `transfer_submitting` FIRST (records `SubmittedAt`), then `RequestTransfer(Key: purchase ID, Nameservers: details.Nameservers, OwnerHandle: frozen handle, AuthCode)`. Accepted (pending) → `transfer_pending`, clearing `AuthCode` in that move. `ErrRefused` → cancel the authorisation → `failed` (reason from the status/refusal; `AuthCode` cleared). `ErrIndeterminate`/crash: stay; next pass reads `TransferStatus`: pending/completed → treat as accepted; failed → cancel → `failed`; none → retry `RequestTransfer` with the same Key once 10 minutes have passed (the adapter is idempotent by Key). Alert the operator once at 24 h unknown (`UnknownAlerted`) and once when the authorisation is a day from lapsing (6 days after `SetupStartedAt`, `LapseAlerted`). `AuthCode` stays only while the request may still need resending.
+ 3. `transfer_pending`: if not `Captured` and not `CaptureFailed`, `Send(PrepareCapture(pi, id+":capture"))`: success → `Captured`; definite failure → `CaptureFailed` (operator alert); indeterminate → retry next pass. Then, at `NextStatusAt` (every 30 minutes), `TransferStatus`: completed → `AddDomainRegistration{ZoneID: "", Expires: status.Registered.Expires, Registrant: frozen contact, AutoRenew: true}` then `done` (or `unpaid` with owner notice + alert when `CaptureFailed`, or when the authorisation lapsed uncaptured); failed → `transfer_refunding` if `Captured`, else cancel the authorisation (ignore "already lapsed") → `failed`.
+ 4. `transfer_refunding`: `Send(PrepareRefund(pi, id+":refund"))`: success → `failed` with `Reason` and a "refunded" mark; indeterminate → retry; definite failure → alert the operator, stay and retry (every failed transfer ends refunded).
+ Start refusals, all before Checkout: the Global Constraints list, plus `CheckTransfer` and `QuoteTransfer` errors mapped to plain copy (`domaintransfer_copy.go`, drafts). Nameservers come from `LookupNS` (lower-case, trailing dot stripped, sorted); none or an error → refusal. `LookupDS` true → the DNSSEC refusal; error → "couldn't check, try again" refusal (fail closed).
+
+- [ ] **Step 1: Write failing tests** on a transfer fixture beside `newPurchaseFixture`: `TestTransferHappyPathRecordsRegistrationWithoutZone` (nameservers sent = those read; registrant frozen; registration ZoneID ""; expiry from the fake; payment captured once; claims untouched), `TestTransferStartRefusals` (table: not registrable, TLD unmarked, premium, already ours, another account's apex claim, own apps' claims ALLOWED, DS present, DS lookup error, NS unreadable, empty NS, check says locked, daily cap, sponsored account allowed), `TestTransferRefusedAtSubmitCancelsAuthorisation`, `TestTransferFailsAfterAcceptanceRefunds`, `TestTransferRefundIndeterminateRetriesAndAlertsOnDefiniteFailure`, `TestTransferCaptureFailsThenCompletesIsUnpaid`, `TestTransferUnknownAlertsAndLateCompletionIsUnpaid` (Review Focus 2), `TestTransferIndeterminateSubmitResendsSameKeyAfterTenMinutes`, `TestTransferStatusReadEveryThirtyMinutesOnly` (a fake clock; count `TransferStatus` calls), `TestTransferAuthCodeClearedAtSubmitAndNeverLogged` (Review Focus 4), `TestTransferResumesAfterRestart` (new Server over the same store mid-`transfer_submitting`: one request, one capture), `TestLookupDSParsesAnswerAndServfail` (a local UDP responder on 127.0.0.1; no network).
+- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestTransfer|TestLookupDS'`; expect FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run** the same plus `-run 'TestPurchase|TestStart|DomainBuy|APIDomain'` (buying unchanged); expect PASS.
+- [ ] **Step 5: Commit** `console: transfer engine (submit, capture on acceptance, wait, refund)`.
+- [ ] **Step 6: Astra and Fable task review** (money flow, secret handling, termination of every path).
+
+### Task 7: Operator alert before any registration expires
+
+**Files:**
+- Create: `internal/console/domainexpiry.go`, `internal/console/domainexpiry_test.go`
+- Modify: the purchase pass start (`StartDomainPurchasePass` in `domainbuy.go`) or `jobs.go` to run it once a day
+
+**Interfaces:**
+- Consumes: Task 5 `RegistrationsExpiringBefore`, `MarkExpiryAlerted`; `purchaseAlert`.
+- Produces: `func (s *Server) domainExpiryPass(ctx context.Context, now time.Time) error`: for each registration expiring within 60 days and not alerted, page the operator once naming the domain, account and date ("nothing renews domains yet"), then mark it. Runs daily; console.db only, no registrar or bucket calls.
+
+- [ ] **Step 1: Write failing tests:** `TestExpiryPassAlertsOnceAtSixtyDays`, `TestExpiryPassIgnoresLaterExpiries`.
+- [ ] **Step 2: Run** `go test ./internal/console/ -run ExpiryPass`; expect FAIL.
+- [ ] **Step 3: Implement.**
+- [ ] **Step 4: Run**; expect PASS.
+- [ ] **Step 5: Commit** `console: alert the operator 60 days before a registration expires`.
+
+### Task 8: Plan 2a paths for a domain with no Carloku zone
+
+**Files:**
+- Modify: `internal/console/domainpoint.go`, `internal/console/domainpoint_test.go`, `internal/console/accountdomainspage.go`, `internal/console/templates/account_domain.html`, `internal/console/accountdomains_copy.go`, `internal/console/accountdomainspage_test.go`
+
+**Interfaces:**
+- Consumes: Task 5 (`DomainRegistration.ZoneID == ""` marks DNS hosted elsewhere).
+- Produces: `pointBoughtDomain` refuses a registration with `ZoneID ""` before any write, with a draft "its DNS is hosted elsewhere; attach its addresses on the app" message. The domain page for such a registration renders Addresses, Renewal (expiry, next year's price), Registered to, the records to set at its DNS host (the registered-elsewhere `claimDNSAdvice` table), and a "DNS hosted elsewhere" line; no Point form. Registered-elsewhere domain pages and cards gain "Move to Carloku" for owners when `domainBuyReady` (a link to Task 9's form); a domain with a live transfer shows its transfer card link instead.
+
+- [ ] **Step 1: Write failing tests:** `TestPointRefusesDomainWithoutZone` (no SetManaged, no attach), `TestTransferredDomainPageShowsDNSElsewhere`, `TestElsewhereDomainOffersMoveToCarloku` (owner yes, member no, buy door off no), `TestDomainWithLiveTransferLinksItsCard`.
+- [ ] **Step 2: Run** `go test ./internal/console/ -run 'PointRefusesDomainWithoutZone|TransferredDomainPage|MoveToCarloku|LiveTransferLinks'`; expect FAIL.
+- [ ] **Step 3: Implement**; strings as drafts.
+- [ ] **Step 4: Run**; expect PASS; also `-run 'TestPoint|DomainPage|DomainsOverview|AccountDomain'`.
+- [ ] **Step 5: Commit** `console: bought domains with DNS hosted elsewhere; Move to Carloku`.
+
+### Task 9: Transfer form, start door and the transfer card (risky: per-task review)
+
+**Files:**
+- Create: `internal/console/accountdomaintransfer.go`, `internal/console/accountdomaintransfer_test.go`, `internal/console/templates/account_domain_transfer.html`
+- Modify: `internal/console/appdomainbuy.go` (the purchase card renders transfer-kind stages), `internal/console/templates/domain_buy.html`, `internal/console/routedecls.go`, the route registers and parity (Global Constraints)
+
+**Interfaces:**
+- Consumes: Task 6 `quoteTransfer`, `startDomainTransfer`; Plan 2a's owner/CSRF/`domainBuyReady` gate (`domainBuyBrowserGate`, account form) and saved-contact picker.
+- Produces routes (owners, CSRF on POST, `Gate: gateNoHostClaim`):
+ - `GET /a/{sqid}/domains/{domain}/transfer`: the form (Task 1 mockup): before-you-start lines, auth code (`type="password"`, `autocomplete="off"`), Registered to, summary with price and the nameservers kept (from `quoteTransfer`), Pay.
+ - `POST /a/{sqid}/domains/{domain}/transfer`: re-quotes (Plan 1's `price_changed` path), calls `startDomainTransfer`, 303 to Checkout. The auth code travels only in the POST body; a re-shown form after a refusal never echoes it.
+ - The purchase card at `/a/{sqid}/domains/purchases/{id}` shows the transfer stages (Paid, Sent, Waiting for the current registrar, Done / Failed with Refunded or Not charged) and polls the status JSON, which gains `"kind"`.
+
+- [ ] **Step 1: Write failing tests:** `TestTransferFormShowsNameserversAndPrice`, `TestTransferPostRedirectsToCheckout`, `TestTransferFormNeverEchoesAuthCode` (after a refusal the body lacks the code), `TestTransferDoorsOwnerOnlyCSRFAndBuyDoorOff`, `TestTransferCardStages` (pending, done, failed refunded, failed not charged), `TestPurchaseStatusJSONHasKind`.
+- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TransferForm|TransferPost|TransferDoors|TransferCard|PurchaseStatusJSONHasKind'`; expect FAIL.
+- [ ] **Step 3: Implement**; strings as drafts.
+- [ ] **Step 4: Run**; expect PASS; the register tests (`SvcRoutes|APILinks|ClaimInvariant|LinkedPolicy|Parity|ClaimConsoleRouteCensus|SubmissionGate`), `go test ./internal/parity/`, and the perf walk (`TestConsoleScreensMeetTheBudget`) with an `over:` record if the form's first view passes 500 ms.
+- [ ] **Step 5: Commit** `console: transfer form, start door and transfer card`.
+- [ ] **Step 6: Astra task review** (security gates, the auth code in transit).
+
+### Task 10: CLI and its API door
+
+**Files:**
+- Modify: `internal/console/apidomainbuy.go`, `internal/console/apidomainbuy_test.go`, `internal/console/routedecls.go` (+ registers)
+- Create: `domains_transfer_cli.go`, `domains_transfer_cli_test.go`; Modify: `domains_cli.go` (verb), `domains_buy_copy.go`, `apimode.go` (beside `postDomainPurchase`), `parity/parity.tsv` + clireg node, `docs/site/cli.md`
+
+**Interfaces:**
+- Produces API (persons only, owners, `domainBuyAPIGate`, service-closed, `gateNoHostClaim`): `POST /api/cli/accounts/{account}/domains/transfers/check {"name"}` → `{"domain","price","currency","nameservers":[...]}` or a refusal; `POST /api/cli/accounts/{account}/domains/transfers {"name","auth_code","contact_id"|"contact","currency","price"}` → `{"id","checkout_url","state"}`. Status uses the existing purchase status door (`"kind":"transfer"`).
+- Produces CLI: `carlos domains transfer <name> --auth-code <code|-> [--contact <id> | --contact-file f] [--yes] [--no-wait]`: shows price and the nameservers kept, confirms, prints the Checkout link, then waits (as `buy`'s `waitDomainPurchase`, printing each new state once) until done/failed, with no wait for `live` (DNS is elsewhere). `--auth-code -` reads one line from stdin; the code never appears in output.
+
+- [ ] **Step 1: Write failing tests:** API `TestAPITransferCheckAndStart`, `TestAPITransferOwnerOnlyServiceClosed`; CLI `TestDomainsTransferPrintsNameserversAndCheckout`, `TestDomainsTransferReadsAuthCodeFromStdin`, `TestDomainsTransferWaitsToDoneOrFailed`, `TestDomainsTransferNeverPrintsAuthCode`.
+- [ ] **Step 2: Run** `go test ./internal/console/ -run 'TestAPITransfer'` and `go test . -run 'TestDomainsTransfer'` (TMPDIR per Global Constraints); expect FAIL.
+- [ ] **Step 3: Implement**; strings as drafts.
+- [ ] **Step 4: Run**; expect PASS; `go test . -run 'CLIGolden|Parity|CLIReg'` (re-record the golden corpus for the new verb), `GOOS=darwin go build ./...`, `GOOS=windows go build ./...`.
+- [ ] **Step 5: Commit** `cli: carlos domains transfer`.
+
+### Task 11: Copy pass
+
+- [ ] **Step 1:** Brief for Luna (delegated copy review), as Plan 2a's `docs/superpowers/specs/LUNA-COPY-BRIEF-DOMAINS-2A.md`: every new string with where it shows (kit mockup paths), and the facts that must stay true: the domain's DNS and email don't change; a year is added; nothing is taken for a transfer that doesn't happen (refunded or not charged); the transfer can take up to five days and can be approved sooner at the current registrar; no registrar or DNS host names; nothing renews yet.
+- [ ] **Step 2:** Run the Luna pass; apply the table verbatim; resolve flags with Luna, not by hand.
+- [ ] **Step 3:** Pin approved strings (`approved_account_domains_copy_test.go` or a twin); `go test . ./internal/console/ -run Approved`.
+- [ ] **Step 4: Commit** `domains: approved transfer copy (Luna pass TRANSFERS-1)`.
+
+### Task 12: Census, review, merge, release and the first transfer
+
+- [ ] **Step 1: Census** for the root-package (CLI) changes: `make census-card`, CLAIMS, `make census-propose NAME=domain-transfers CLAIMS=<file>`, Astra's verdict on #280. Any new record-write census layer joins `scripts/gitleaks-gate/notscanned.go`.
+- [ ] **Step 2:** Whole-branch review, Astra and Fable on one brief; one fix wave; scoped re-review. `make code-health`; CI green.
+- [ ] **Step 3:** Merge (squash, subject under 80 characters) with Paul's go; release with a dev roll per the release recipe, coordinated on #421.
+- [ ] **Step 4: Dev witness:** the form and card on the dev console; `carlos domains transfer` against dev up to the registrar call (the Openprovider sandbox cannot complete a real transfer): refusals (DS, unreadable NS, unmarked TLD) and one submit that the sandbox refuses, ending Failed with the authorisation cancelled.
+- [ ] **Step 5: Flagship and the first real transfer** (Paul's GO): mark `com` transferable in the flagship catalog; Paul unlocks rushedsunlight.com at eNom and supplies the auth code (he types it, or pipes it to `--auth-code -`); record each state with timestamps, the nameservers before and after (unchanged), MX unchanged, the new expiry, and the capture.
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-transfers-plan.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-transfers-plan.md
new file mode 100644
index 000000000..d147146dd
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-transfers-plan.md
@@ -0,0 +1,32 @@
+# Review brief: domain registration transfers-in plan, round 1 of 3
+
+Repo carlos/platform, branch `design-domain-transfers`, commit named in the reviewer's prompt.
+Under review: `docs/superpowers/plans/2026-11-21-domain-registration-transfers-in.md`.
+Authorities: `docs/superpowers/specs/2026-11-01-domain-registration-design.md` revision 5 §12 (approved by Paul 2026-11-21, on this branch; §12 is the only part not yet on main, and it is approved), Plans 1 and 2a (merged), `AGENTS.md`, and the code on this branch (main at 21e821a6 plus the spec commits).
+
+You are an independent reviewer. Read the plan as the builder would: an engineer who has not seen this codebase implements each task from its text alone. Check every claim against the code.
+
+## Fixed: do not re-argue
+- Paul's rulings R1-R16 and the builder-check calls B1-B4, C1-C3, T1-T7 (spec §3, §11.2, §12.2, §10, §11.10, §12.9).
+- Registration-only transfers (keep nameservers); DNS moves wait for Plan 4.
+- Buying is off while CARLOS_HOST_CLAIM is on; transfers ride that switch.
+
+## What to check
+1. Money: can any path take money without a transfer that completes or is refunded, or leave an authorisation neither captured nor cancelled forever without an operator alert? Does the state machine terminate on every registrar and payment outcome, including crash between steps?
+2. The auth code: is there any place it can be logged, echoed, put in a URL, or survive in storage after the submit is recorded?
+3. The registrar seam and Openprovider: are the transfer calls and the neutral states mappable from Openprovider's API (`/v1`, or say if only `/v1beta` exists)? Is "best effort" transfer checking safe?
+4. Plan 2a interactions: every path that assumes a bought domain has a zone (Point, pages, purchase card, account deletion, Unpointing, the app-gone path); the one-live-purchase-per-domain index across kinds.
+5. The DS lookup via dnsmessage and the system resolver: correct and testable without the network?
+6. Route registers, parity, census, gitleaks, perf budget: anything CI will fail on that the plan doesn't name?
+7. Task right-sizing, interface consistency, and whether each step lets the builder write exactly one reasonable thing.
+
+## Severity
+- P1: unsafe, would not compile, a test fails, or it would not work. Blocks merge.
+- P2: wrong or missing. Fixed without reopening this review.
+- P3: clarity or polish. Follow-up list; never a reason for another round.
+A P1 states its failure scenario and evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+Findings ranked P1, P2, P3: section or task, problem, evidence (file:line, verified), failure scenario, concrete fix, and the invariant it breaks (its fault family). End with exactly one verdict: READY / READY AFTER FIXES / NOT READY.
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents. Do not run full suites.