carlos / platform Public

Design: domain resale, a service role that buys domains for customers

An app on the platform can offer domain registration to its own
customers through an owner-minted domains credential with spend caps,
charging the account's saved card off-session. Paul's rulings P1-P8,
discussion 1483. Reviewed in three Astra rounds and a scoped fourth
check with Paul's go.

Squashed from design-domain-resale into main.
claude agent, operated by paul@keymail.dev 4285cf3243c12b0afdbf48182253c9c35028e51c parent 27708a9
9 files changed, +1,201 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R1.md +37 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R2.md +52 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R3.md +20 −0
  • docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R4-scoped.md +10 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R2.md +41 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R3.md +43 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R4-scoped.md +1 −0
  • docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec.md +34 −0
  • docs/superpowers/specs/2026-11-28-domain-resale-design.md +963 −0

CI cancelled — superseded by a newer push — run details

diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R1.md b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R1.md
new file mode 100644
index 000000000..ad7d5440f
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R1.md
@@ -0,0 +1,37 @@
+Reviewed `38cf6052`, round 1. No files changed or tests run.
+
+1. **P1 — Renewals bypass the required spending authority (§5.2).**
+ [Spec:210](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:210) explicitly exempts renewals from both cap enforcement and accounting, contrary to the brief’s fixed ruling. A credential with an exhausted monthly cap can enable renewal across the account’s service-bought domains and cause further charges. Renewal prices are determined when charged, so their cost was not fixed at purchase ([registration spec:128](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-01-domain-registration-design.md:128)).
+ **Fix:** Define durable renewal spending authority and enforce its caps under the billing hold, including after credential rotation or revocation. Remove the exemption and Q1’s uncapped alternatives. **Fault family:** bounded spending authority.
+
+2. **P1 — Authorization retries can create multiple PaymentIntents (§6.3).**
+ [Spec:333](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:333) retries ambiguous answers until definite, without a resend deadline or reconciliation path. After a successful authorization whose response is lost, an outage beyond Stripe’s key retention can make the identical resend create another authorization. Cached `500` responses also cannot be resolved simply by resending. Stripe documents both behaviors: [https://docs.stripe.com/api/idempotent_requests](https://docs.stripe.com/api/idempotent_requests). Existing billing explicitly bounds resends to 22 hours ([billinghold.go:40](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/billinghold.go:40)).
+ **Fix:** Persist the first-send provider timestamp and purchase metadata; bound resends, reconcile unknown outcomes, and stop sending when uniqueness cannot be established. Test recovery beyond key retention. **Fault family:** payment idempotency across outages.
+
+3. **P1 — The reused purchase engine requires a Checkout session (§6.3).**
+ The proposed direct PaymentIntent has no Checkout session, but registration reads one before calling the registrar ([domainbuy.go:829](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:829)). Capture reconciliation and cancellation recovery also read it ([domainbuy.go:603](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:603), [domainbuy.go:942](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:942)). The adapter rejects an empty session ID ([payment.go:172](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/billingstripe/payment.go:172)). Adding authorization and entering `authorised`, as [spec:337](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:337) describes, therefore cannot complete a purchase through those paths.
+ **Fix:** Specify direct PaymentIntent reads and adapt every downstream payment check, including crash recovery, capture ambiguity and cancellation ambiguity. Preserve identity, amount, currency and authorization-state validation. **Fault family:** payment-state continuity without Checkout.
+
+4. **P1 — New attachment paths omit existing service-authority checks (§§4.1, 6.1, 6.6).**
+ The app binding restricts point and detach, but purchase accepts an `app` in its body ([spec:269](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:269)). Existing purchase admission checks app existence and linked-app policy, not credential binding ([domainbuy.go:139](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:139)); the normal binding check only inspects the URL’s app ([apicli.go:75](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/apicli.go:75)). A credential bound to app A can therefore buy-and-attach to app B under the specified checks.
+
+ There is a second missing check: general service attachment refuses control-plane apps ([apidomains.go:345](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/apidomains.go:345)), whereas today’s person-only point path calls the shared attach core without that check ([domainpoint.go:179](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainpoint.go:179)). Opening point to services creates another route around this protection.
+ **Fix:** Require common service attachment authorization for explicit point and purchase-triggered attach: validate the body’s app against the binding and enforce the control-plane refusal before effects, including deferred attachment. **Fault family:** consistent authority across attachment paths.
+
+5. **P1 — Replacing every door’s set removes existing detach access (§4.2).**
+ [Spec:118](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:118) says every listed set becomes `Exactly(Domains)`. Detach already admits Publish, Instance and Admin, with Team admitted through scoped registration ([routedecls.go:938](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/routedecls.go:938)). Following the instruction removes existing callers’ access and fails the legacy Instance compatibility assertion ([svcroutes_test.go:907](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/svcroutes_test.go:907)).
+ **Fix:** Make detach an explicit exception: preserve its existing roles and scoped registration, add Domains explicitly, and apply resale restrictions only to Domains callers. Keep purchase doors exclusive to Domains. **Fault family:** existing credential compatibility.
+
+6. **P2 — Adding a card does not establish billing currency (§4.4).**
+ [Spec:168](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:168) directs an account without currency to add a card. Card setup passes `fixCurrency=false` ([billingcard.go:48](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/billingcard.go:48)); leaving currency unset is intentional and asserted in [billingcard_test.go:41](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/billingcard_test.go:41). An eligible account can follow the prescribed remedy repeatedly and still cannot mint the credential.
+ **Fix:** Provide an owner-confirmed way to establish billing currency before minting monetary caps, under the billing hold, and correct the claimed current behavior. **Fault family:** reseller onboarding prerequisites.
+
+7. **P2 — The polling contract omits terminal `unpaid` (§6.4).**
+ [Spec:380](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:380) tells consumers to poll until `done` or `failed`, while §6.3 retains `unpaid`. Capture failure sets that terminal state ([domainbuy.go:618](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:618)); the existing CLI explicitly stops on it ([domains_buy_cli.go:348](/home/paulca/amadan.net/carlos/platform-design-domain-resale/domains_buy_cli.go:348)). A consumer following the spec polls indefinitely after registration succeeds but collection fails.
+ **Fix:** Enumerate all terminal service-purchase states and define the consumer action for `unpaid`, distinguishing successful registration from successful payment. **Fault family:** purchase completion signaling.
+
+8. **P2 — The live-purchase conflict discloses person-bought purchases (§6.1).**
+ [Spec:277](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:277) returns the ID of any live purchase on the account. That includes a person’s purchase, contrary to §4.1’s neutral-404 rule. Existing lookup filters by account and purchase kind, without service provenance ([domainpurchase_shared.go:106](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainpurchase_shared.go:106)); check also returns that purchase’s frozen quote ([domainbuy.go:47](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:47)).
+ **Fix:** Apply the service-provenance filter before live-purchase responses in both check and purchase admission. Return `purchase_in_progress` with an ID only for service-started purchases; use the specified neutral refusal otherwise. **Fault family:** person/service purchase isolation.
+
+**NOT READY — P1 findings 1–5.**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R2.md b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R2.md
new file mode 100644
index 000000000..c96beba07
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R2.md
@@ -0,0 +1,52 @@
+- R1 P1-1, renewal spending authority: **resolved** by P4 and §5.2’s commitment ledger.
+- R1 P1-2, duplicate authorizations after outages: **resolved** by bounded resends and reconciliation.
+- R1 P1-3, Checkout-dependent payment reads: **resolved** by §6.3a.
+- R1 P1-4, attachment authority: **partly resolved**; point’s implicit detach remains outside the proposed check.
+- R1 P1-5, existing detach access: **resolved** by the explicit exception.
+- R1 P2-6, billing currency onboarding: **resolved** by owner-confirmed currency at mint.
+- R1 P2-7, terminal `unpaid`: **resolved** by §6.4.
+- R1 P2-8, person-purchase disclosure: **resolved** by the provenance filter.
+
+Reviewed `55b1c80548544f14f7795f2ed2d3c8c25a6a087c`. No files changed or tests run. Discussion 1483 was inaccessible from the sandbox; its rulings were taken from the brief.
+
+1. **P1 — Point can still detach another app’s retained claims (§§4.5, 6.6; carried from R1 P1-4).**
+
+ The proposed check authorizes the destination app ([spec:218](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:218)). However, point calls `takeOverPurgedClaim`, which releases a claim using its existing `c.App`, without checking the service’s binding ([domainpoint.go:196](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainpoint.go:196)). That release can also retire a first-route record ([domainattach.go:437](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainattach.go:437)).
+
+ **Failure:** A credential bound to app A points a service-bought domain whose claims remain on purged app B. A passes the new check, then point deletes B’s claims and potentially its route record. This contradicts §4.1’s restriction that every attachment and detachment reaches only the bound app.
+
+ **Fix:** Refuse cross-app takeover by a bound service before any DNS or claim mutation; leave that recovery to a person. Add a witness using a retained claim from a purged app.
+
+ **Fault family:** consistent authority across attachment paths. This family has findings in two consecutive rounds, triggering stopping rule 2. The choices are upfront refusal (recommended), removing service takeover, or one authorization guard covering every affected app with a guard test.
+
+2. **P1 — Recovered authorizations can enter registration without enough capture lifetime (§§6.3, 6.3a).**
+
+ Reconciliation continues for approximately seven days, and any recovered `requires_capture` intent enters `authorised`. The spec stores `CaptureBefore` but asserts that the existing 24-hour registration deadline remains safely inside it ([spec:451](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:451)). Existing registration checks only the payment status, then starts its deadline from the registrar attempt ([domainbuy.go:829](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:829)).
+
+ **Failure:** After a lost response and prolonged read outage, an authorization is recovered minutes before `CaptureBefore`. Registration starts while the intent still requires capture; the hold expires before registration reconciliation and capture finish. Carloku incurs the registration cost and receives no payment. Stripe explicitly requires capture before the charge’s individual deadline: [https://docs.stripe.com/payments/place-a-hold-on-a-payment-method](https://docs.stripe.com/payments/place-a-hold-on-a-payment-method).
+
+ **Fix:** Require sufficient remaining authorization lifetime before starting registration. Bound setup and registration reconciliation by `CaptureBefore`, with capture margin, using provider time. Cancel an authorization recovered too late; test recovery immediately before expiry.
+
+ **Fault family:** registration must complete within its payment authorization.
+
+3. **P2 — The common owner gate would remove existing member access to domain listings (§4.2).**
+
+ The spec describes the person side of every listed door as owner-only ([spec:131](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:131)). Today, `domainListAPIGate` deliberately admits any account member ([apidomainbuy.go:341](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/apidomainbuy.go:341)).
+
+ **Failure:** Applying the specified common gate prevents a non-owner member from using the existing account domain list.
+
+ **Fix:** Explicitly preserve the list’s person-member admission while requiring owner authority for its new service callers.
+
+ **Fault family:** existing caller compatibility.
+
+4. **P2 — Inline-contact privacy does not cover registrar error text (§§6.2, 7).**
+
+ The service path requires `EnsureContact` ([spec:396](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:396)). That method returns provider errors unchanged; the adapter retains provider descriptions and scrubs only API credentials ([client.go:578](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/registrar/openprovider/client.go:578)). Purchase processing logs returned errors ([domainbuy.go:1004](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:1004)).
+
+ **Failure:** A registrar validation response echoing a customer’s email, phone or address puts that contact data into operational logs despite its exclusion from API replies and saved contacts.
+
+ **Fix:** Require contact-operation errors to discard provider descriptions, retaining classifications and numeric codes, as transfer errors already do. Add a fixture whose error description echoes contact fields and verify they reach neither logs nor audit details.
+
+ **Fault family:** registrant data crossing into diagnostics.
+
+**NOT READY — P1 findings 1 and 2.**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R3.md b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R3.md
new file mode 100644
index 000000000..8e3f57e94
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R3.md
@@ -0,0 +1,20 @@
+- R2 P1-1, cross-app claim takeover: **resolved** by §6.6’s refusal before mutation and exclusion of service callers from takeover.
+- R2 P1-2, insufficient authorization lifetime: **partly resolved**; the margins work with a real deadline, but the fallback remains unsafe.
+- R2 P2-3, member access to listings: **resolved** by §4.2’s separate person and service admission rules.
+- R2 P2-4, contact data in registrar errors: **resolved** by §6.2’s required scrubbing and diagnostic witness.
+
+Reviewed `a5cb7fa001cc0df22fa737078de10543ba62f5fd`. No files changed or tests run.
+
+1. **P1 — The six-day fallback can admit registration after the safe authorization window (§6.3; carried from R2 P1-2).**
+
+ **Evidence:** [Spec:496](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:496) substitutes intent creation plus six days when `CaptureBefore` is absent. [Spec:510](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:510) then admits registration with 30 hours remaining against that substituted deadline. Missing deadlines are an accepted adapter result: [payment.go:96](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/billingstripe/payment.go:96), explicitly tested with `null_capture_before` in [payment_test.go:538](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/billingstripe/payment_test.go:538).
+
+ Stripe documents a **4-day-18-hour** authorization window for Visa merchant-initiated transactions, shorter than this fallback. [https://docs.stripe.com/payments/place-a-hold-on-a-payment-method](https://docs.stripe.com/payments/place-a-hold-on-a-payment-method)
+
+ **Failure scenario:** An immediately authorized Visa payment is recovered 110 hours after creation without `CaptureBefore`. The substituted deadline is hour 144, so the apparent 34 hours remaining passes admission. The actual hold expires at hour 114—only four hours away. Registration can succeed with an ambiguous response and be reconciled after that expiry, leaving Carloku with the registration cost and an uncapturable payment. The proposed 24-hour reconciliation allowance permits this sequence.
+
+ **Concrete fix:** Remove the six-day fallback for direct purchases. Without a verified capture deadline, refuse before zone creation or registration, cancel the authorization through the existing reconciliation path, and report a stable reason. Add a missing-deadline witness asserting no zone or registration call.
+
+ **Fault family:** registration must complete within its payment authorization. This is the same invariant as R2 P1-2, now failing in two consecutive rounds. Refusing the unknown-deadline case removes the remaining P1 without cutting resale; cutting off-session registration would also remove it, but would remove the requested feature. The three-round budget is exhausted.
+
+**NOT READY — P1-1: unsafe authorization-deadline fallback.**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R4-scoped.md b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R4-scoped.md
new file mode 100644
index 000000000..d48c4de7b
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R4-scoped.md
@@ -0,0 +1,10 @@
+R3 P1-1, unsafe six-day fallback: **resolved**. No P1, P2 or P3 findings in `a5cb7fa0..b61c7065`.
+
+- **Fallback removed:** §6.3 requires a provider-verified `CaptureBefore`; the only remaining six-day reference records the resolved finding. [Spec:507](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:507)
+- **Refusal precedes effects:** the check explicitly runs before zone creation and every registrar call, covering reconciliation lookups and retries. [Spec:522](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:522)
+- **Cancellation and cleanup fit:** §6.3a substitutes an intent read for cancellation recovery. Existing `failPurchase` confirms cancellation before `finishPurchaseWithoutHold` deletes any zone and marks the purchase failed. Claims are created later, during captured-purchase attachment, which this refusal never reaches. [Spec:572](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:572), [domainbuy.go:925](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:925), [domainbuy.go:708](/home/paulca/amadan.net/carlos/platform-design-domain-resale/internal/console/domainbuy.go:708)
+- **Witness specified:** the missing-`capture_before` case requires `failed`, reason `capture_deadline_unknown`, no zone creation, no registrar call, and a cancelled hold. This is a required implementation test, not an already implemented test. [Spec:552](/home/paulca/amadan.net/carlos/platform-design-domain-resale/docs/superpowers/specs/2026-11-28-domain-resale-design.md:552)
+
+No files changed, tests run, or subagents spawned.
+
+**READY**
\ No newline at end of file
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R2.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R2.md
new file mode 100644
index 000000000..5929a85e1
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R2.md
@@ -0,0 +1,41 @@
+# Review brief: domain resale design, round 2 of 3
+
+Repo carlos/platform, branch `design-domain-resale`, commit 6d98951c764b34addcdf8eba62ec8838858c5e3b.
+Under review: `docs/superpowers/specs/2026-11-28-domain-resale-design.md`.
+Authorities: `docs/superpowers/specs/2026-11-01-domain-registration-design.md` (renewal §4.2 and its sequence, the registrar and billing rules), `docs/superpowers/specs/2026-11-19-platform-accounts-design.md` (§6.2, §6.3 which this reverses for the new role only, §8), AGENTS.md. Renewals are designed in the registration spec and planned, unmerged, on branch `domain-renewals`; review this spec against the merged registration spec's §4.2, not that branch.
+
+You are an independent reviewer. Read the document, then the code it names, and check every claim against that code.
+
+## Fixed: do not re-argue
+
+- Paul's rulings, carlos/platform discussion 1483 (`amadan discuss show carlos/platform 1483`): the consumer app is the merchant and Carloku bills the consumer's account; purchases and renewals by the service credential charge the account's saved card off-session within spend caps, no prepaid balance; renewals ship first; the end customer is the legal registrant. Report only mechanisms that fail to honour them.
+- Paul's later rulings, same discussion (second reply), recorded as P4-P6 in the spec's §2: caps never refuse a renewal; transfer out first; flagship switch-on 2026-12-15. The round 1 P1 about renewals bypassing caps is resolved within P4 by admitting renewal spend at commitment (§5.2); judge that mechanism, not the ruling.
+
+## What to check
+
+1. Authority: can a `domains` credential reach anything beyond what §the role lists (check svcrole, routedecls Allow sets, the gate functions, Admin's union); can it see or change a domain a person bought; can any existing credential gain spending power.
+2. Money: the caps' enforcement under concurrency (the billing lock named), idempotency end to end (Idempotency-Key to the Stripe key, a retry after an ambiguous answer, a crash between authorise and register), refunds and the unpaid path for off-session charges, SCA/authentication-required handling, tax.
+3. Registrant data: an inline contact never reaching the owners' contact list, who can read it back, logs and audit not leaking it.
+4. Ownership and departure: a consumer's customer's domain when the consumer's card fails at renewal or the account closes; transfer out by a person.
+5. Claims the spec makes about current code (the point door, route paths, the Checkout path, DailyCap, linked accounts): verify each.
+6. The switch and testing: off by default, no live registration without approval, a first user and date (stopping rules 5, 6).
+
+## Round 2
+
+Earlier rounds: round 1 on 38cf6052, `docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R1.md`. The spec's §14 says how each was resolved.
+
+First give one line per P1 and P2 from round 1: resolved, partly, or not. Carry every unresolved or partly resolved finding forward at its current severity, then add new findings, especially in the new sections (§4.5, §5.2's ledger, §6.3's bounded resend, §6.3a). The verdict covers everything outstanding.
+
+## 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. Goes on a follow-up list; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (its fault family). End with exactly one verdict: READY, READY AFTER FIXES, or NOT READY (listing the P1s).
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites.
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R3.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R3.md
new file mode 100644
index 000000000..0f22ec31c
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R3.md
@@ -0,0 +1,43 @@
+# Review brief: domain resale design, round 3 of 3
+
+Repo carlos/platform, branch `design-domain-resale`, commit 8d68bb994264968a34aa217ed8595e121f2943b2.
+Under review: `docs/superpowers/specs/2026-11-28-domain-resale-design.md`.
+Authorities: `docs/superpowers/specs/2026-11-01-domain-registration-design.md` (renewal §4.2 and its sequence, the registrar and billing rules), `docs/superpowers/specs/2026-11-19-platform-accounts-design.md` (§6.2, §6.3 which this reverses for the new role only, §8), AGENTS.md. Renewals are designed in the registration spec and planned, unmerged, on branch `domain-renewals`; review this spec against the merged registration spec's §4.2, not that branch.
+
+You are an independent reviewer. Read the document, then the code it names, and check every claim against that code.
+
+## Fixed: do not re-argue
+
+- Paul's rulings, carlos/platform discussion 1483 (`amadan discuss show carlos/platform 1483`): the consumer app is the merchant and Carloku bills the consumer's account; purchases and renewals by the service credential charge the account's saved card off-session within spend caps, no prepaid balance; renewals ship first; the end customer is the legal registrant. Report only mechanisms that fail to honour them.
+- Paul's later rulings, same discussion (second reply), recorded as P4-P6 in the spec's §2: caps never refuse a renewal; transfer out first; flagship switch-on 2026-12-15. The round 1 P1 about renewals bypassing caps is resolved within P4 by admitting renewal spend at commitment (§5.2); judge that mechanism, not the ruling.
+
+## What to check
+
+1. Authority: can a `domains` credential reach anything beyond what §the role lists (check svcrole, routedecls Allow sets, the gate functions, Admin's union); can it see or change a domain a person bought; can any existing credential gain spending power.
+2. Money: the caps' enforcement under concurrency (the billing lock named), idempotency end to end (Idempotency-Key to the Stripe key, a retry after an ambiguous answer, a crash between authorise and register), refunds and the unpaid path for off-session charges, SCA/authentication-required handling, tax.
+3. Registrant data: an inline contact never reaching the owners' contact list, who can read it back, logs and audit not leaking it.
+4. Ownership and departure: a consumer's customer's domain when the consumer's card fails at renewal or the account closes; transfer out by a person.
+5. Claims the spec makes about current code (the point door, route paths, the Checkout path, DailyCap, linked accounts): verify each.
+6. The switch and testing: off by default, no live registration without approval, a first user and date (stopping rules 5, 6).
+
+## Round 3
+
+Earlier rounds: round 1 on 38cf6052 (`CODEX-FINDINGS-domain-resale-spec-R1.md`), round 2 on 55b1c805 (`CODEX-FINDINGS-domain-resale-spec-R2.md`), both in docs/superpowers/reviews/. The spec's §14 says how each was resolved.
+
+Also fixed, do not re-argue: Paul's ruling P7 (discussion 1483, 2026-11-28, under stopping rule 2): a `domains` credential refuses up front to point a domain with claims on any app other than its bound one; a person does that recovery. Judge whether §6.6 implements it, not the ruling.
+
+First give one line per P1 and P2 from round 2: resolved, partly, or not. Carry every unresolved finding forward, then add new findings, especially in what changed: §6.6's refusal, §6.3's two margins (`captureMargin` 6 h, `registrationStartMargin` 30 h, in provider time) against Stripe's authorisation lifetime, §4.2's person and service admission on the list, §6.2's error scrubbing. This is the last round in the budget: a NOT READY must say whether its P1s share one cause, and whether refusing the case up front or cutting the feature would remove them.
+
+## 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. Goes on a follow-up list; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (its fault family). End with exactly one verdict: READY, READY AFTER FIXES, or NOT READY (listing the P1s).
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites.
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R4-scoped.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R4-scoped.md
new file mode 100644
index 000000000..fc186d255
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec-R4-scoped.md
@@ -0,0 +1 @@
+Scoped fourth check (Paul's go, 2026-11-29) of carlos/platform branch design-domain-resale, the diff a5cb7fa0..b61c7065 (`git diff a5cb7fa0 b61c7065 -- docs/superpowers/specs/2026-11-28-domain-resale-design.md`) only. Round 3's one P1 (docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R3.md): the six-day fallback when CaptureBefore is absent. Paul's ruling P8: refuse up front, no zone and no registrar call without a provider-verified capture deadline; cancel the hold; reason capture_deadline_unknown. Check: is the fallback gone everywhere in the spec; is the refusal checked before the zone step and before every registrar call (including reconciliation and retries); does cancellation go through the existing failPurchase path correctly (internal/console/domainbuy.go) without leaving a zone or claim; does the witness test pin it. Do not review anything else. Severity P1/P2/P3 as in docs/superpowers/reviews/REVIEW-BRIEF-TEMPLATE.md. End with one verdict: READY, READY AFTER FIXES, or NOT READY. Do not edit files or spawn subagents.
diff --git a/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec.md b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec.md
new file mode 100644
index 000000000..77e939b29
--- /dev/null
+++ b/docs/superpowers/reviews/CODEX-REVIEW-BRIEF-domain-resale-spec.md
@@ -0,0 +1,34 @@
+# Review brief: domain resale design, round 1 of 3
+
+Repo carlos/platform, branch `design-domain-resale`, commit 73860f92b088b0f8a50996bb821d5d07585c5622.
+Under review: `docs/superpowers/specs/2026-11-28-domain-resale-design.md`.
+Authorities: `docs/superpowers/specs/2026-11-01-domain-registration-design.md` (renewal §4.2 and its sequence, the registrar and billing rules), `docs/superpowers/specs/2026-11-19-platform-accounts-design.md` (§6.2, §6.3 which this reverses for the new role only, §8), AGENTS.md. Renewals are designed in the registration spec and planned, unmerged, on branch `domain-renewals`; review this spec against the merged registration spec's §4.2, not that branch.
+
+You are an independent reviewer. Read the document, then the code it names, and check every claim against that code.
+
+## Fixed: do not re-argue
+
+- Paul's rulings, carlos/platform discussion 1483 (`amadan discuss show carlos/platform 1483`): the consumer app is the merchant and Carloku bills the consumer's account; purchases and renewals by the service credential charge the account's saved card off-session within spend caps, no prepaid balance; renewals ship first; the end customer is the legal registrant. Report only mechanisms that fail to honour them.
+
+## What to check
+
+1. Authority: can a `domains` credential reach anything beyond what §the role lists (check svcrole, routedecls Allow sets, the gate functions, Admin's union); can it see or change a domain a person bought; can any existing credential gain spending power.
+2. Money: the caps' enforcement under concurrency (the billing lock named), idempotency end to end (Idempotency-Key to the Stripe key, a retry after an ambiguous answer, a crash between authorise and register), refunds and the unpaid path for off-session charges, SCA/authentication-required handling, tax.
+3. Registrant data: an inline contact never reaching the owners' contact list, who can read it back, logs and audit not leaking it.
+4. Ownership and departure: a consumer's customer's domain when the consumer's card fails at renewal or the account closes; transfer out by a person.
+5. Claims the spec makes about current code (the point door, route paths, the Checkout path, DailyCap, linked accounts): verify each.
+6. The switch and testing: off by default, no live registration without approval, a first user and date (stopping rules 5, 6).
+
+## 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. Goes on a follow-up list; never a reason for another round.
+
+A P1 states its failure scenario and the evidence (file:line). Do not raise a P2 to P1 to keep the review open.
+
+## Output
+
+Findings ranked P1, P2, P3. Each gives the section, the problem, the evidence (file:line, verified), the failure scenario, a concrete fix and the invariant or trust boundary it breaks (its fault family). End with exactly one verdict: READY, READY AFTER FIXES, or NOT READY (listing the P1s).
+
+Do not edit files. Do not spawn Anthropic-model reviewers or subagents of your own. Do not run the full test suites.
diff --git a/docs/superpowers/specs/2026-11-28-domain-resale-design.md b/docs/superpowers/specs/2026-11-28-domain-resale-design.md
new file mode 100644
index 000000000..1d0724b20
--- /dev/null
+++ b/docs/superpowers/specs/2026-11-28-domain-resale-design.md
@@ -0,0 +1,963 @@
+# Domain resale: an app sells domains to its own customers
+
+Status: revision 4, 2026-11-29. Draft for Paul's review. Branch
+`design-domain-resale`, off `main` at `60f0dc35`. Discussion:
+carlos/platform #1483 (the request and Paul's rulings); patrix/patrix
+discussion 23. Review budget: at most three rounds (AGENTS.md stopping
+rules). Round 1 (Astra, `38cf6052`): five P1, three P2, resolved in
+revision 2. Round 2 (Astra, `55b1c805`): two P1, two P2, resolved in
+revision 3. Round 3 (Astra, `a5cb7fa0`): one P1, resolved in this revision
+by Paul's ruling P8. The budget is spent; a scoped fourth check of this
+revision's diff runs only with Paul's go (§14).
+
+Builds on `2026-11-01-domain-registration-design.md` (revision 5,
+approved; "registration spec" below), `2026-11-19-platform-accounts-design.md`
+("platform accounts spec") and `2026-08-18-service-principals-design.md`.
+Depends on renewals, which are being planned as their own slice from
+registration spec §4.2 (branch `domain-renewals`). This spec does not
+redesign renewal: it uses renewal's off-session charge and auto-renew
+flag, and says who else may switch that flag. Code references are to
+`60f0dc35` and are starting points; re-check each.
+
+## 1. Why
+
+Farshad asked for domain registration in Patrix's hosted product. Patrix's
+root, dashboard.patrix.cc (`patrix-home`, on the `patrix` account), wants a
+"Get a domain" step in a site's settings: the site owner searches for a
+name, buys it, and the site serves at it. Any multi-tenant app on Carloku
+wants the same, so it belongs in the platform.
+
+Today every purchase door is person-only (`routedecls.go` around lines
+900-931, `Allow: svcrole.Set{}`; `domainBuyAPIGate` calls `apiPerson`),
+and payment is a Checkout page a person completes (`purchaseCheckout`). A
+root's credential can attach a hostname but not check, buy or renew one.
+
+## 2. Paul's rulings (2026-11-28, #1483)
+
+P1. **The app is the merchant.** Carloku bills the consumer's own account
+ the catalog price (registration spec §6.2). The consumer charges its
+ customer however it likes. The end customer is the legal registrant:
+ an inline contact per purchase, frozen on the purchase as every
+ purchase's contact already is (registration spec §11.7).
+P2. **Saved card, off-session.** Purchases and renewals made through the
+ service credential charge the account's card on file with no person
+ present, within the credential's spend caps. No prepaid balance.
+P3. **Renewals first.** Auto-renewal ships first, as its own slice. The
+ consumer can switch auto-renew off per domain through the service role
+ (its customer stopped paying) and on again.
+
+Second reply on #1483, the same day, settling revision 1's open questions:
+
+P4. **Caps never refuse a renewal.** Renewals count toward the
+ credential's totals, but a cap never refuses one, so a paid-for domain
+ never lapses for that reason. Caps limit new purchases only (§5.2).
+P5. **Transfer out first.** Transfer out (registration spec §4.3) is built
+ before resale switches on for any account.
+P6. **Switch-on date.** The `patrix` account on flagship, 2026-12-15, after
+ renewals and transfer out are live there.
+
+After round 2, when the attachment-authority findings reached stopping
+rule 2 (posted on #1483):
+
+P7. **Refuse cross-app takeover up front.** A `domains` credential refuses
+ to point a domain that still has claims on any app other than its
+ bound one, including the retained claims of a purged app (the
+ `takeOverPurgedClaim` path), before any DNS or claim change, with a
+ stable code. A person on the account does that recovery (§6.6).
+
+After round 3, when the authorisation-lifetime findings reached stopping
+rule 2 (2026-11-29, posted on #1483):
+
+P8. **No verified capture deadline, no registration.** For a direct
+ purchase, an authorisation with no `CaptureBefore` verified from the
+ provider gets no zone and no registrar call: it is cancelled through
+ the existing reconciliation path and the purchase fails with a stable
+ reason. There is no fallback deadline (§6.3).
+
+This spec **reverses platform accounts spec §6.3 ("Buying domains stays
+person-only") for the new `domains` role only**, by Paul's request in
+#1483. Every other role, and every person-only door this spec does not
+name, stays as it is.
+
+## 3. Requirements
+
+R1. A new service role, `domains`, minted only by an owner, reaches the
+ doors of §4.2 and nothing else.
+R2. It reaches only registrations a `domains` credential of the same
+ account bought. A domain a person bought is invisible to it.
+R3. Each credential carries money caps per day and per month and a count
+ cap per day, set at mint and changed by an owner, enforced by the
+ console under the billing hold against the account's resale ledger,
+ which no rotation, revocation or renewal escapes (§5.2). The account's
+ daily purchase cap still applies on top.
+R4. A refusal for a cap is a 429 that names the cap, its value, what is
+ used and when it resets.
+R5. A service purchase charges the account's saved card off-session,
+ authorised before anything is registered and captured after, as
+ registration spec §5.1 orders it for a person.
+R6. A card that cannot be charged ends the purchase before anything is
+ registered, with a stable code the consumer can act on, and the
+ account's owners are told what to do.
+R7. A retried purchase never charges twice and never starts a second
+ purchase.
+R8. The registrant is the end customer, from an inline contact that is
+ never saved to the account's contacts and never read back by the role.
+R9. Every act of a `domains` credential is audited with the credential.
+R10. The feature is off for every account until an operator grants it
+ resale.
+
+Non-goals (v1): premium names; the consumer setting its own retail price
+at Carloku; Carloku billing the end customer; transfers in by the role;
+changing a registrant through the role; webhooks to the consumer (it
+polls).
+
+Anti-goals: spending past a cap by any route (concurrent starts, retries,
+rotation); a credential that can lose the account a domain (transfer out,
+unlock, the transfer code, zone deletion, or ending renewal of a domain a
+person bought); a registration before its money is authorised; any
+existing credential, Admin included, gaining the power to spend.
+
+## 4. The `domains` role
+
+### 4.1 Shape (my calls)
+
+- **Outside Admin's union.** `Allow` panics on `Domains`; a door admits it
+ only through `Exactly(Domains)`, as for `Run` and `Platform`. No
+ credential minted before this spec gains spending power, and Admin has
+ no caps.
+- **One role per credential, as today.** A root that also provisions
+ instances holds two credentials: its existing `instance` or `publish`
+ one, and a `domains` one. A leak of either does not give the other's
+ reach, and `doorsFor` stays truthful.
+- **Account-scoped, optionally bound to one app** (`--app`). Check,
+ purchase, status and list are the account's (registrations live at the
+ account, registration spec §11). Bound to an app, every way the role
+ attaches or detaches reaches only that app: point, detach, and the `app`
+ a purchase names in its body (§4.5). Patrix mints it with
+ `--app patrix-sites`.
+- **Held to its minter.** Every role door is owner-level, and a named
+ service credential is held to its minter's role now (`apiOwnerOnly`,
+ `stepUpOwnerAuthority`). A minter who stops being an owner takes the
+ credential's reach with them.
+- **Service-bought only (R2).** The purchase and the registration it
+ becomes record the credential that started it (§7). Any `domains`
+ credential of the account reaches those registrations, not only the one
+ that bought: an owner who revokes a leaked credential and mints a new one
+ keeps the consumer's customers reachable. Everything else answers the
+ neutral 404. Without this a leaked credential could switch off renewal
+ of patrix.cc.
+
+### 4.2 Doors it reaches
+
+The person doors' paths where one exists, so there is one purchase engine
+and one set of refusals. Each door admits persons exactly as today: the
+account list (`domainListAPIGate`) any member of the account, every other
+door an owner. A `domains` principal is admitted only on an account with a
+live resale grant (§9) and, on every door the list included, only while
+it is held to an owner (§4.1).
+
+Role Sets. Every door below but detach is person-only today (the zero
+Set), and its Set becomes `Exactly(Domains)`: a person still passes, since
+persons are not role-gated, and no other role gains it. **Detach is the
+exception**: it already admits Publish, Instance and Admin through `Allow`
+and Team through its scoped registration (`routedecls.go`, the detach
+line; Instance is pinned by `TestInstanceRoleMatchesTodaysAppTokenReach`).
+It keeps all of them and its scoped registration, and adds `Domains`
+explicitly (the builder adds the Set constructor this needs, since `Allow`
+cannot carry Domains and `Exactly` drops Admin). The restriction of the
+table's right-hand column applies only to a Domains caller; every existing
+caller detaches exactly as today.
+
+| Door | For the role |
+|---|---|
+| `POST /api/cli/accounts/{account}/domains/check` | As for a person, inside the check budget (`domainCheckLimiter`) |
+| `POST /api/cli/accounts/{account}/domains/purchases` | The service shape (§6.1) |
+| `GET /api/cli/accounts/{account}/domains/purchases/{id}` | Only purchases a `domains` credential started |
+| `GET /api/cli/accounts/{account}/domains` | Only service-bought entries, with the fields of §6.4 |
+| The renewals slice's auto-renew door | Service-bought only (§6.5) |
+| `POST /api/cli/apps/{account}/{app}/domains/point` | Service-bought, bound app only; gains `route` (§6.6) |
+| `DELETE /api/cli/apps/{account}/{app}/domains/{host}` | Hosts under a service-bought registration, bound app only; the door's control-plane fuse and owner check stay first |
+
+If the renewals slice adds no API door for the flag, this spec adds
+`PUT /api/cli/accounts/{account}/domains/auto-renew/{domain}`.
+`/domains/{domain}/auto-renew` would collide with
+`PUT /domains/contacts/{id}` in the mux; `/domains/transfer/{domain}` is the
+precedent.
+
+### 4.3 Doors it never reaches
+
+- Saved contacts (the four `.../domains/contacts` doors): the owners'
+ address book (§6.2).
+- Transfers in (`.../domains/transfers/check`, `.../transfers`).
+- Transfer out, unlock and the transfer (EPP) code (registration spec
+ §4.3, Plan 4, not built): a person on the consumer account only (§8).
+- Customer DNS records (registration spec §5.3a) and zone deletion.
+- The general attach (`POST .../apps/{account}/{app}/domains`): the role
+ points bought domains and attaches nothing else. The consumer's
+ `instance` or `publish` credential still attaches as today.
+- Placements, certificate import, path maps, features, billing pages,
+ card setup, plan changes.
+- Every services, instance-token, door-key, email-credential and platform
+ door. A credential never mints a credential (AGENTS.md), and this role is
+ no exception.
+
+`svcroutes_test.go`'s intent lists pin exactly §4.2's doors for the role,
+`closedDoors` loses the five zero-Set patterns that gain it (the auto-renew
+door is new), the detach door's existing roles stay pinned, and a test
+asserts that no `Allow` set carries `Domains`.
+
+### 4.4 Minting
+
+Owner-only and person-only, through the existing services doors
+(`POST /api/cli/services/{account}` and the browser's services form), which
+no credential reaches. Refused, each with a 409 naming the fix (my calls):
+- without the account's resale grant (§9), as `ErrNotPlatform` is;
+- on a linked account: it never gets a Stripe customer (platform accounts
+ spec §8), so there is no card to charge;
+- while the account has no billing currency and the mint names none: the
+ caps are money in that currency. Saving a card does not fix a currency
+ (`cardSetupLocked` passes `fixCurrency=false`, and
+ `billingcard_test.go` holds it), so the mint itself is the owner's way to
+ choose one: `--currency eur`, confirmed by the owner, fixes the account's
+ billing currency under the billing hold, through the same rule
+ `paymentCustomerLocked` uses (`ChooseCurrency`, refused with
+ `errCheckoutUncertain` when a Checkout in flight could fix another), and
+ the answer says it is now fixed. On an account with a currency,
+ `--currency` must match it or is refused;
+- without both money caps (§5.1), as a 400.
+
+The platform's per-customer credential door keeps minting only Publish and
+Deploy, so a linked account cannot hold the role either way.
+
+### 4.5 One attachment authority
+
+Today the attach door refuses a service credential on a control-plane app
+(`refuseServiceControlPlane`, `apidomains.go`) and holds it to the URL's
+app, while the point door, person-only so far, calls the shared attach
+core without either check (`domainpoint.go`), and purchase admission
+checks only that the body's app exists and is not linked
+(`startDomainPurchase`). Opening point and purchase to a service would make
+two routes round those checks.
+
+So one function, the service attachment check, decides for every service
+caller of every attaching path: the attach door, point, and the attach a
+purchase makes when it is captured. It refuses, before any effect:
+- an app other than the credential's bound app (the neutral 404, as a URL
+ mismatch answers);
+- a control-plane app (`refuseServiceControlPlane`'s refusal);
+- a linked app (`linkedRefusalFor`, as today).
+
+Point also refuses a service caller any takeover of another app's claims
+(P7, §6.6).
+
+A purchase runs it at start, on the body's `app`, and again in the captured
+step before the deferred attach, because the app's flags can change in
+between. Refused then, the purchase finishes unpointed, as for an app that
+went away (registration spec §11.7), with reason `app_refused`, and the
+domain is still registered and paid. A test drives each attaching path with
+a bound credential at another app and at a control-plane app.
+
+## 5. Spend limits (R3, R4)
+
+### 5.1 The caps
+
+| Cap | Meaning | Default |
+|---|---|---|
+| `spend_day` | Money committed per UTC day: purchases and auto-renew switch-ons (§5.2) | none, required |
+| `spend_month` | The same per UTC calendar month | none, required |
+| `purchases_day` | Purchases started per UTC day | 5 |
+
+My calls:
+- **Money caps have no default.** An owner types the figure; a default
+ would be a number nobody chose, charged to their card.
+- **Money is the catalog price before tax**, in the account's billing
+ currency, minor units on the wire. Tax depends on the address and is
+ added by the charge (§6.3); the cap stays a number the owner can check
+ against the price list.
+- **A purchase counts from the moment it starts**, unless it ends with
+ nothing charged (declined, authorisation cancelled, failed before
+ capture). One in flight counts, so the money in flight never exceeds
+ the caps.
+- **UTC days and months**, as `PurchasesToday` counts the account's day.
+- **Checked and counted under the billing hold**, where
+ `startPurchaseCheckout` checks `DailyCap`, so two concurrent starts
+ cannot both take a cap's last unit.
+- **Counted on the account's resale ledger** (§5.2), never on the listing
+ id, which is the hash of the current secret and changes on rotation.
+- **The account's daily cap applies on top**: the catalog's `daily_cap`,
+ or the grant's (§9), counting every purchase on the account, person and
+ service alike.
+
+### 5.2 The ledger and renewals (P4)
+
+Renewals run under registration spec §4.2: the card on file is charged and
+then the registrar renews. The renewals slice charges the price in the
+renewal notice (its choice 1). Paul's P4: renewals count toward the
+totals, and a cap never refuses one. The hole to close is a credential
+spending through renewals after its cap is gone, for example by switching
+auto-renew back on across many domains. The rule: **spend is admitted when
+it is committed, not when it is charged.**
+
+- **A purchase** commits its price, admitted at start (§5.1), and with it
+ the domain's renewals while auto-renew stays on as the purchase left it.
+ That renewal authority is already admitted; it needs no second check.
+- **Switching auto-renew on through the role** is a new commitment. It is
+ admitted like a purchase: refused with §5.3's 429 when the next
+ renewal's price (the notice price once the notice is sent, else the
+ catalog's renewal price now) would exceed what remains of the day or
+ month cap. It does not count against `purchases_day`. Admitted, it is
+ booked at that price in the window it was admitted in.
+- **Switching it off** is always allowed and books nothing.
+- **A renewal charge is never refused by a cap.** It is booked once: if a
+ switch-on committed it, it settles that booking at the amount charged,
+ in the switch-on's window; otherwise it is booked in the window it is
+ charged in. So a month with renewals leaves less room for purchases.
+
+**The invariant, stated once:** every amount a `domains` credential
+commits, and every renewal of a service-bought domain, is booked exactly
+once on the account's resale ledger, and no purchase or switch-on is
+admitted unless the ledger's total for the day and the month, plus its
+amount, stays within the acting credential's caps. It is enforced in one
+place: one admission function, called under the billing hold by the
+purchase start and the auto-renew door, is the only writer of purchase and
+switch-on bookings, and the renewal pass's charge step is the only writer
+of renewal bookings. A guard test fails any other writer of the ledger
+table and any service money path that skips admission.
+
+**Bound to the account, not the credential.** The ledger is the
+account's: each booking names the credential that committed it, but a
+credential's caps are checked against the account's whole resale total for
+the window. Rotating keeps the credential row; revoking one and minting
+another starts no fresh total; a revoked credential's domains keep
+renewing and keep being booked. So neither rotation nor revocation resets
+or escapes the totals. Two `domains` credentials share one total, each
+bounded by its own caps (my call: the conservative reading, and a
+consumer needs one).
+
+The services listing shows the day's and month's totals with renewals
+apart.
+
+### 5.3 When a cap is reached
+
+Refused before anything is written or charged: 429, `Retry-After` set to
+the seconds until the cap resets, and a body naming it:
+
+```json
+{"error": "This credential has reached its daily spending limit for domains.",
+ "code": "limit", "limit": "spend_day", "currency": "eur",
+ "cap": 5000, "used": 4200, "price": 1500, "resets_at": "2026-11-29T00:00:00Z"}
+```
+
+`limit` is `spend_day`, `spend_month`, `purchases_day` or
+`account_daily_cap`. For the money caps `cap`, `used` and `price` are minor
+units of `currency`; for the count caps `cap` and `used` are counts, and
+`price` and `currency` are left out. The same 429, with `limit`
+`spend_day` or `spend_month` and `price` the renewal's, refuses a
+switch-on. The check budget's 429 keeps its own code, `rate`. The first
+cap refusal of a UTC day emails the owners, once per credential, naming
+the cap and how to change it (my call: they should know customers are
+being turned away).
+
+### 5.4 Setting and changing them
+
+At mint (§10), and later by an owner as a person through a new services
+door, `POST /api/cli/services/{account}/{name}/limits` (zero role Set,
+owner-gated, like rotate and revoke) and its browser form. A raise applies
+to the next purchase. A cut below what is used refuses the next purchase
+and touches nothing in flight. Every change is audited.
+
+## 6. Buying, following and pointing
+
+### 6.1 The purchase request
+
+`POST /api/cli/accounts/{account}/domains/purchases` from the role, with an
+`Idempotency-Key` header:
+
+```json
+{"name": "shop.example", "currency": "eur", "price": 1500,
+ "contact": {"first_name": "Ana", "last_name": "Ruiz", "email": "ana@shop.example", ...},
+ "reference": "site-4812", "app": "patrix-sites", "route": "shop-4812.patrix.cc"}
+```
+
+`contact` has `registrar.Contact`'s fields, as the person door takes.
+
+- `contact` is required and `contact_id` refused (§6.2).
+- `currency` and `price` confirm the check's quote; a change is 409
+ `price_changed` with the new price, as for a person.
+- `reference` is the consumer's own id for its customer or site:
+ optional, 1-64 characters of `A-Za-z0-9._:-`, else 422 `reference`. It
+ is stored on the purchase and the registration and returned by status
+ and list, so the consumer maps a domain to its customer without storing
+ our ids. Not unique.
+- `app`, with an optional `route`, points the domain once it is registered
+ (the captured step's attach, §6.6). The service attachment check (§4.5)
+ runs on it at start and again before that attach. Without `app` the
+ domain is registered and not pointed (registration spec §11.4's "Not
+ yet"); the role does not send `not_yet`.
+- `Idempotency-Key` (R7): required from the role, 1-64 printable ASCII
+ characters, else 400 `idempotency_key`; unique per account for 30 days.
+ The same key with the same body answers the same purchase as it now
+ stands, with `"replayed": true`. The same key with another body is 422
+ `idempotency_mismatch` and starts nothing. A new key for a name the
+ account already has a live purchase of is 409 `purchase_in_progress`
+ with that purchase's id only when a `domains` credential started it (a
+ person resumes instead; a server should poll).
+- **A person's live purchase stays invisible (R2).** Today a live purchase
+ of the name lets its owner resume at its stored price
+ (`ownLivePurchaseOfKind`, filtered by account and kind only), and the
+ check answers that purchase's frozen quote (`admitDomainBuy`). For a
+ `domains` caller, both the check and the purchase admission filter that
+ lookup by service provenance first: a live purchase a person started is
+ the neutral refusal (`claimRefusal`, as for a name held elsewhere), with
+ no id and no quote.
+
+The answer is 201 `{"id", "state", "domain", "reference"}`, with no
+`checkout_url`.
+
+### 6.2 The registrant (R8)
+
+- The end customer is the registrant. The contact is checked with
+ `registrar.Contact.Validate`, plus an address check on `email` (which
+ `Validate` only requires to be present), plus any fields the catalog's
+ TLDs need (registration spec §8).
+- **My call: a service purchase's contact is never saved to the account's
+ saved contacts.** `insertDomainPurchaseLocked` saves a new contact or
+ reuses an equal saved one; the service path does neither. It freezes the
+ contact on the purchase alone, with a fresh registrar handle
+ (`EnsureContact` with no existing handle). The saved list is the owners'
+ address book: filled with customers, it would offer them to the next
+ purchase made by hand.
+- **No contact data in diagnostics.** The Openprovider adapter keeps the
+ provider's description in a refusal (it scrubs only its own credentials,
+ `client.go`), and the purchase pass logs the errors it returns, so a
+ validation answer that echoes an email, phone or address would reach the
+ logs. The contact operations, `EnsureContact` and `Register` (which names
+ the handle), therefore return errors without provider text: only the
+ adapter's classification and the provider's numeric codes, through
+ `trusted`, as transfer errors already do. This is the adapter's
+ behaviour for every caller, since it cannot tell a service purchase from
+ a person's. A fixture whose error description echoes the contact's
+ email, phone and street shows that none of them reaches the returned
+ error, the purchase pass's log lines or any audit detail.
+- WHOIS privacy stays on, as registration spec §4.4 says for every domain.
+ The registrar's registrant verification email goes to the end customer;
+ the list door shows its state and deadline (§6.4) so the consumer can
+ tell them.
+- **Who reads it back**: the account's people on the domain's page
+ ("Registered to", registration spec §11.6), and the operator, as for any
+ registration. **Not the role**: its answers carry `reference`, never the
+ contact. The consumer already holds its customer's details, and a leaked
+ credential should not read every customer's address.
+- A purchase that ends with no registration has its frozen contact cleared
+ 30 days after it ends (my call). The row keeps its domain, reference,
+ money and outcome.
+- The consumer is responsible for the details being its customer's real
+ ones, as registries require. That is a term of the resale grant (§9), not
+ something the console can check.
+
+### 6.3 Charging off-session (R5, R6)
+
+Registration spec §5.1 is unchanged from step 3 on (zone, register,
+capture, attach). Steps 1 and 2 change for the role:
+
+1. **Admission**, all before any money: the gate (grant live, credential
+ live and held to an owner); every check a person's purchase makes
+ (`admitDomainDoor`, `admitDomainBuy`); then, under the billing hold, the
+ account's daily cap, the credential's caps, the registrar balance and
+ the card (below).
+2. **Authorise off-session** instead of opening a Checkout: a PaymentIntent
+ on the account's customer and saved card, confirmed at once,
+ off-session, manual capture, for the price plus the tax the same address
+ pays at Checkout (`PreparePaymentCheckout` uses automatic tax, exclusive
+ prices), with metadata naming the account and the purchase. Its
+ idempotency key is the purchase id with a fixed suffix. The prepared
+ request is stored before its first send and resent only verbatim, as
+ `CheckoutPrepared` is. A purchase records which way it pays (Checkout or
+ direct), fixed at start.
+
+**Bounded resends (billinghold.go's rule).** The key only protects a
+resend while the provider still holds it, and a cached 5xx answers the
+same 5xx to every resend. So, as `resendLifetime` (22 hours) bounds every
+other stored billing request:
+- The first send's provider time (`FirstSentAt`, from `providerNow`, taken
+ before the send) is stored with the prepared request. With no provider
+ time nothing is sent.
+- The request is tried inside the purchase call, for at most the
+ `handlerRetries` backoff, so a decline answers the call itself. An
+ answer that is not definite (`ErrNoResponse`, `ErrInFlight`,
+ `ErrNotExecuted`, `ErrIndeterminate`) returns 201 in state
+ `authorising`, and the purchase pass carries on.
+- Before every resend, the pass reconciles by reading: the PaymentIntent by
+ its stored id when an answer gave one, else the account customer's
+ PaymentIntents created since `FirstSentAt` less a margin, matched by the
+ purchase id in metadata (an exhaustive list, which is read-consistent).
+ One found settles it, whatever the send's answer said: `requires_capture`
+ is `authorised`; a decline is §6.3's code; `canceled` is `failed` with
+ nothing held. More than one for one purchase (which the key should make
+ impossible) alerts the operator and cancels all but the first.
+- A resend goes only while provider time is within `resendLifetime` of
+ `FirstSentAt`, and never after a cached `ErrIndeterminate`, which a
+ resend cannot change: that case waits on reads alone.
+- **Past the bound, the pass never sends again.** It keeps reading for the
+ card authorisation's lifetime (about seven days). If none is ever found,
+ the purchase ends `failed` with reason `authorisation_unknown`, nothing
+ registered, and the operator alerted. One that appears later is
+ cancelled, since nothing was registered against it. When unsure, the
+ purchase fails; it never makes a second authorisation.
+- A definite authorisation enters the existing `authorised` state, and the
+ authorisation's `CaptureBefore` is stored. It must be verified: read from
+ the provider on an intent read that passes §6.3a's checks. There is no
+ fallback when the provider gives none (P8, below).
+
+**Registration completes within the authorisation.** A recovered
+authorisation can arrive close to its `CaptureBefore`, and today's engine
+checks only the payment status before it registers and starts its
+deadlines from its own attempts (`registerPurchase`,
+`purchaseSetupDeadline`). For a direct purchase, every bound below is read
+in provider time (`providerNow`); with no provider time no registrar call
+is started.
+- **Margins.** `captureMargin`, 6 hours: the time kept for capture and its
+ reconciliation. `registrationStartMargin`, 30 hours: Plan 1's 24-hour
+ registering deadline plus `captureMargin`.
+- **No deadline (P8).** An authorisation with no verified `CaptureBefore`
+ (the adapter accepts a missing `capture_before`, `billingstripe/payment.go`,
+ and a card's real hold can be shorter than any assumed one: Visa
+ merchant-initiated holds last 4 days 18 hours) gets no zone and no
+ registrar call. It is cancelled through the existing cancellation and
+ its reconciliation (`failPurchase`, read on the intent per §6.3a), and the
+ purchase ends `failed` with reason `capture_deadline_unknown`, nothing
+ registered. The check runs before the zone step and again before every
+ registrar call.
+- **Start.** The zone step and the registrar's first call start only while
+ `CaptureBefore` is at least `registrationStartMargin` away. An
+ authorisation found with less (a late reconcile, a slow setup) is
+ cancelled at once, and the purchase ends `failed` with reason
+ `authorisation_late`, nothing registered.
+- **Setup.** The setup deadline is the earlier of today's (24 hours from
+ `SetupStartedAt`) and `CaptureBefore` less `registrationStartMargin`.
+- **Registration reconciliation.** The registering deadline is the earlier
+ of today's (24 hours from the first attempt) and `CaptureBefore` less
+ `captureMargin`. At it, Plan 1's rule applies unchanged: a Lookup that
+ does not find the domain cancels the authorisation and fails the
+ purchase `unconfirmed`; one that finds it proceeds to capture.
+- **Capture** is attempted as soon as registration is recorded. A capture
+ that still fails, the hold having lapsed, is §5.1 step 7's `unpaid`,
+ bounded by one registration fee.
+
+Tests: an authorisation recovered one minute short of
+`registrationStartMargin` before `CaptureBefore` is cancelled and the
+registrar is never called; one a minute inside it registers; an
+indeterminate registration whose deadline is clipped by `CaptureBefore` is
+settled by Lookup and cancelled when not found, before the hold lapses;
+an authorisation whose intent read carries no `capture_before` (the
+adapter's `null_capture_before` case) ends `failed` with
+`capture_deadline_unknown`, with no zone created, no registrar call made
+and the hold cancelled.
+
+### 6.3a Payment state without a Checkout session
+
+Every payment read in the purchase engine today goes through the Checkout
+session: `PaymentCheckout(ctx, p.CheckoutSession)`, which the adapter
+refuses for an empty id (`billingstripe/payment.go`). A direct purchase has
+no session, so each read is replaced, for that path only, by one function
+that reads the purchase's payment by its way of paying: the session as
+today, or the PaymentIntent directly (a new provider read, with the
+intent's latest charge expanded for `CaptureBefore`). Every place:
+
+| Where (`domainbuy.go`) | Today | Direct path |
+|---|---|---|
+| `advancePurchaseStep`, awaiting payment | Reads the session for `Authorised` | Never reached: a direct purchase starts in `authorising` (above) |
+| `registerPurchase`, before the registrar call | Session read; needs `requires_capture` | Intent read; needs `requires_capture` |
+| `advancePurchaseEffects`, `registered`: capture reconciliation | Session read after an unclear capture | Intent read |
+| `failPurchase`: cancellation recovery | Session read after an unclear cancel | Intent read |
+| `purchaseCheckout`, `resumeDomainPurchase` | Open or reuse a session | Never called: a direct purchase is resumed by its state |
+
+Each intent read checks what the session read checks today and more: the
+intent id is the stored one, its metadata names this purchase and account,
+its customer is the account's, its currency is the purchase's, and its
+total is the stored total (the pre-tax price plus the tax the authorisation
+carried, both stored at authorisation). Any mismatch is
+`billing.ErrIndeterminate`, as today, and the purchase stays where it is.
+Crash recovery is unchanged in shape: each state's step is re-entered and
+reads before it writes. Transfers in are never direct (the role has no
+transfer doors), and the shared function refuses a direct transfer. A test
+walks every state of a direct purchase against the Fake with no session,
+including a crash after each send and an unclear capture and cancel.
+
+**New on `billing.Provider`**: an off-session charge with tax against the
+saved card, and a read of whether the customer has a usable card. The
+renewals slice needs both (registration spec §6.1), so this spec reuses its
+primitive and adds only manual capture, so that a failed registration
+cancels an authorisation instead of refunding a charge. The Stripe adapter
+implements it; the console still imports only `internal/billing`; the
+billingtest Fake scripts every outcome below.
+
+**When the card cannot be charged**, the call answers 402 and nothing is
+registered:
+
+| Code | When | The account owner |
+|---|---|---|
+| `no_card` | No saved card; refused before a purchase is created | Adds a card in Billing |
+| `card_authentication_required` | The bank asked for authentication (SCA); the purchase ends `failed` | Updates the card in Billing: saving it authenticates it once for off-session use |
+| `card_declined` | Any other definite decline; the purchase ends `failed` | Checks or replaces the card |
+| `card_needs_attention` | An off-session decline in the last 24 hours and no card saved since; refused before a purchase is created | As for that decline |
+
+The consumer tells its customer something like "We couldn't complete this
+purchase right now. Please try again later." Its words are its own; the
+codes are stable.
+
+My calls:
+- **After an off-session decline, the account's service purchases are
+ refused up front** (`card_needs_attention`) until a card is saved or 24
+ hours pass. Issuers count repeated declined off-session attempts against
+ the merchant, and a card the bank wants authenticated keeps refusing.
+ Person purchases are unaffected: Checkout can authenticate.
+- **The owners get one email per decline episode**, naming the code, the
+ credential, the domain and the reference, with a link to Billing. No
+ payment link: the purchase has failed, and the consumer retries once the
+ card works.
+- A capture that fails after registration is registration spec §5.1 step
+ 7, unchanged: the domain is kept and marked unpaid, auto-renew goes off,
+ the owners get a payment link, the operator an alert. The caps still
+ count it.
+
+### 6.4 Status and list
+
+`GET .../purchases/{id}` answers today's `domainPurchaseReply`, plus
+`reference`, plus a §6.3 code in `reason` when the card ended it. The
+consumer polls until a terminal state, as `carlos domains buy` stops on
+them. For a direct purchase the terminal states are:
+
+| State | Registered | Paid | The consumer |
+|---|---|---|---|
+| `done` | yes | yes | Done. If pointed, it may wait on `domain_state` reaching `live`, as the CLI does |
+| `failed` | no | nothing taken | Shows `reason`; may retry with a new key |
+| `unpaid` | yes | no | The domain is the account's and stays usable, but auto-renew is off and the owners have a payment link (§6.3). Treat it as registered, not settled: tell the account owners, and do not switch auto-renew on (refused until paid) |
+
+`expired` is a Checkout session's expiry and is never reached by a direct
+purchase.
+
+`GET .../domains` for the role lists service-bought registrations and
+purchases in flight, with today's fields (`domain`, `bought`, `expires`,
+`purchase`, `addresses`) plus `reference`, `auto_renew`, the renewal
+slice's renewal state (for example a failed renewal charge and its next
+retry) and registrant verification (`pending` with its deadline, or
+`done`). No contact.
+
+### 6.5 Auto-renew (P3)
+
+The role switches a service-bought domain's auto-renew off and on: body
+`{"auto_renew": false}`, answer `{"domain", "auto_renew", "expires"}`. What
+each setting does (the charge 30 days before expiry, the reminders, the
+lifecycle at expiry) is the renewals slice's, unchanged, and its emails go
+to the account's owners (§8). Switching on is admitted against the caps
+(§5.2) and can be refused with §5.3's 429; switching off is always
+allowed. The role cannot switch on a domain marked unpaid until it is paid
+(my call: it would charge a card that already failed).
+
+### 6.6 Pointing and detaching
+
+The point door (`domainpoint.go`) writes the bought zone's managed set and
+attaches the apex and `www` to the app. A hosted Patrix site is an instance
+of `patrix-sites`, so the role's call carries `route`, the instance host,
+and the attach targets it as the attach door's `route` field does
+(`resolveAliasRoute`, `apidomains.go`). The door's other rules stand: the
+domain is the account's registration, has a zone here and no purchase in
+flight, and claims are the attach's. For a service caller the service
+attachment check (§4.5) runs first. Moving a domain to another site is
+detach, then point.
+
+**No takeover by a service (P7).** For a person, point first releases each
+apex or `www` claim of this account whose app no longer exists
+(`takeOverPurgedClaim`), which can also retire that app's first-route
+record. A `domains` caller never reaches that release. Before the zone
+write and before any claim read-and-release, point reads the claims on the
+apex and `www`, and refuses with 409 `claimed_elsewhere` (naming the host,
+not the app) when either is a claim of this account on any app other than
+the bound one (for an unbound credential, other than the app in the URL):
+a live app, one in Trash, or a purged app whose claims a purge retained.
+Another account's claim is refused at the same point with the attach's
+neutral refusal. Nothing in the zone, the claims or the route records
+changes. A person on the account recovers: detach from the other app, or
+point as a person, which takes over a purged app's claims as today. The
+attach a purchase makes when captured never takes over a claim (buying
+refuses every existing claim at start, and `attachDomain` refuses another
+app's), so it needs no change.
+
+Witness: an account holds a service-bought domain whose apex and `www`
+claims a purge of app B retained. A `domains` credential bound to app A
+points it at A: 409 `claimed_elsewhere`; the zone host records no write;
+B's claims and its first-route record are unchanged; no release is
+audited. The same with B in Trash, and with an unbound credential naming A.
+A person owner then points it at A and takes the claims over. Pointing uses the account's custom-domain entitlement,
+as any attach does.
+
+## 7. Audit (R9)
+
+Every act of a `domains` credential is an `s.audit` row on the account,
+actor `service:<sqid>/<name>` (`auditActor`), with the credential's stable
+id (its row, which rotation keeps), the domain and the reference in the
+detail:
+
+- `domain-purchase-start` (price, currency, reference), and the
+ purchase's end (`done` or `failed`, with its reason);
+- `domain-purchase-refused` for a card code or a cap (naming it);
+- `domain-auto-renew` (on or off, and for on the booked price),
+ `domain-point` and `domain-detach` (app and route);
+- `domain-renewal-booked` when a renewal of a service-bought domain is
+ booked on the resale ledger (§5.2), naming the credential that holds its
+ commitment;
+- `service-limits` when an owner changes caps, and `domain-resale-grant`
+ when the operator grants, changes or revokes, with the person as actor.
+
+The purchase row and its registration carry the credential's stable id
+beside the existing `Principal` string, so the caps (§5) and the role's
+reach (§4.1) read one column, and the domain's page says "Bought by
+<credential>, reference <reference>".
+
+## 8. Ownership
+
+- **The registration is the consumer account's**, like any (registration
+ spec §11). The end customer is the registrant, so in the registry the
+ domain is the customer's; Carloku's customer is the consumer.
+- **A departing customer takes their domain** by transfer out (registration
+ spec §4.3), done by a person on the consumer account: an owner unlocks
+ it on the domain's page and gives the transfer code to the customer, who
+ moves it where they like. The role never reaches this (§4.3). Transfer
+ out is Plan 4, not built yet, and by Paul's P5 it is built before resale
+ switches on for any account (§9, §12).
+- **The consumer account closing.** Deleting an account that holds
+ registrations is refused, naming them (registration spec §4.3). The
+ consumer hands each to its customer by transfer out, or switches
+ auto-renew off and lets it lapse, before the account can go.
+- **The card failing at renewal.** Renewal retries and emails the owners
+ (§4.2); the domain is not renewed until paid. A renewal email about a
+ service-bought domain names its reference (my call). Telling the end
+ customer is the consumer's job; Carloku never writes to an end
+ customer, though the registrar writes to a registrant (verification,
+ registry notices).
+- **The grant or the credential revoked.** Registrations stay, renewals go
+ on by their flag, and the owners manage the domains by hand on the
+ Domains page.
+
+**Linked accounts.** The consumer here is an ordinary account (Patrix's
+`patrix` account holds every hosted site's instance), so platform accounts
+spec §8 is untouched. My call: a linked account may not hold the role
+(§4.4), since it never has a Stripe customer, and `admitDomainDoor` already
+refuses it.
+
+## 9. The switch (R10, stopping rules 5 and 6)
+
+**Off for every account until an operator grants it.** Resale is an abuse
+vector (registration spec §6.4) and the operator's prepaid registrar
+balance carries each purchase until capture, so the operator decides who
+resells (my call). An operator door and command, as for the platform grant:
+
+```
+carlos accounts domain-resale --account <sqid> --grant --daily-cap 20 --reason "..."
+carlos accounts domain-resale --account <sqid> --revoke
+```
+
+The grant holds `daily_cap` (purchases per UTC day for this account,
+replacing the catalog's `daily_cap` for it alone, since a reseller buys for
+many people), `reason`, `granted_by` and `state`. Without a grant the role
+cannot be minted. Revoked, every `domains` credential on the account is
+refused at every door with 403 `resale_off` from the next request, and §8
+applies. Buying itself must be on (`domainBuyReady`); where it is off the
+doors are not registered.
+
+**First user**: Patrix's hosted dashboard, dashboard.patrix.cc, for
+Farshad.
+**Switch-on** (P5, P6): transfer out is built first, for every account,
+dev included. On dev, the day the resale slice merges (after renewals and
+transfer out have merged), granted to the dev `patrix` account, on the
+Openprovider sandbox and Stripe test mode. On flagship, **2026-12-15**, for
+the `patrix` account only, after renewals and transfer out are live there.
+The plan carries this date, and the slice does not merge dormant.
+
+**What a user sees first.** On dev, in the console, before Patrix ships
+anything: the account's Services settings show the `domains` credential
+with its caps and what it has used today and this month, and the Domains
+page marks each service-bought domain "Bought by patrix-root, reference
+site-4812". Next, Patrix's own "Get a domain" step on its dev dashboard.
+Each new screen and string gets the UX pass in the mockup kit, then copy
+review, before it is built.
+
+## 10. CLI and API surface
+
+Owners mint and change caps within `carlos services`:
+
+```
+carlos services create --role domains --spend-day 50 --spend-month 300 \
+ [--purchases-day 5] [--app patrix-sites] [--account <sqid|name>] [--json] patrix-root-domains
+carlos services limits [--spend-day N] [--spend-month N] [--purchases-day N] \
+ [--account <sqid|name>] <name>
+carlos services ls # a domains row shows its caps and today's and this month's use
+```
+
+Money on the command line is a decimal in the account's billing currency
+("50", "49.99"), sent as minor units; the answer names the currency. The
+create answer's `doors`, from `doorsFor`, lists §4.2's patterns.
+
+The role's calls are API calls from the consumer's server. For testing,
+`carlos domains check`, `buy` and `list` work with a `domains` credential
+in `CARLOS_SERVICE_TOKEN`; `buy` gains `--contact-file`, `--reference` and
+`--route`, and makes an idempotency key per run. `carlos accounts
+domain-resale` is new (§9). Each new command, flag and route lands with its
+`parity/parity.tsv` row and `docs/site/cli.md` heading in the same branch.
+
+Wire conventions are today's: `{"error", "code"}`, `no-store`, the
+byte-identical 404 for an account the caller does not hold.
+
+## 11. Testing without spending money
+
+- **Package tests** use the fake registrar and the billingtest Fake, which
+ scripts each off-session outcome: authorised, declined, authentication
+ required, no card, and each indeterminate class followed by a definite
+ answer. Witness tests at least: the role reaches exactly §4.2's doors and
+ no `Allow` set carries it; concurrent starts cannot both take a cap's
+ last unit; a retry with the same key charges once and answers the same
+ purchase, and another body under that key starts nothing; a
+ person-bought registration is the neutral 404 at every role door;
+ rotation keeps the caps' counts and the reach; a service purchase saves
+ no contact and no answer carries one; a decline sets
+ `card_needs_attention` and a saved card clears it. And for round 1's
+ findings: a credential whose month cap is used up cannot switch auto-renew
+ on, while a renewal of a domain it bought still charges and is booked;
+ revoking a credential and minting another starts no fresh total; the
+ ledger has no writer but the two of §5.2; an authorisation whose answer
+ is lost is found by the reconcile read, and one still unknown past
+ `resendLifetime` is never resent (the Fake drops its key store to show
+ it); every state of a direct purchase runs with no Checkout session; a
+ bound credential cannot point or buy-and-attach to another app or to a
+ control-plane app; an Instance and a Team credential still detach as
+ today; a person's live purchase answers a `domains` check and purchase
+ with the neutral refusal; the mint fixes the currency it is given.
+- **Dev** uses the Openprovider sandbox (registration spec §7.1) and Stripe
+ test mode, whose test cards cover each path: one that authenticates once
+ when saved and then charges off-session, one that needs authentication
+ on every charge, one that declines. The plan names the exact cards.
+- **No live registration and no live charge without Paul's approval**
+ (AGENTS.md, production infrastructure). The first flagship purchase is a
+ witness Paul approves in scope: one domain on a cheap catalog TLD, the
+ `patrix` account's real card, its cost, and what happens to it after.
+
+This touches billing and a security gate, so each task gets its own review
+(stopping rule 3).
+
+## 12. Slices
+
+0. **Renewals** (registration spec §4.2, branch `domain-renewals`):
+ auto-renew, the off-session charge, the renewal emails. First (P3); not
+ part of this spec.
+0b. **Transfer out** (registration spec §4.3, Plan 4): built before resale
+ switches on for any account (P5); not part of this spec.
+1. **Resale**: the grant; the role, its mint with caps and the limits door;
+ the service purchase with off-session authorise, idempotency and caps;
+ status and list for the role; the auto-renew door for the role; point
+ with `route`, and detach; audit; the console's Services and Domains
+ additions. Witness on dev: a `domains` credential buys a sandbox domain
+ for a made-up customer with nobody signed in, points it at an instance
+ route, switches auto-renew off and on, is refused at its daily money
+ cap with §5.3's 429, and a test card needing authentication fails a
+ purchase with 402 `card_authentication_required` and nothing
+ registered.
+2. **Patrix** (patrix/patrix, not this repo): "Get a domain" on the
+ dashboard, the roster naming the new origin, and Patrix's own charge to
+ its site owner.
+
+Left to the builder: storage, including the resale ledger's table; the
+provider method names, after reading what renewals added (the off-session
+charge with manual capture, the PaymentIntent read, the customer's
+PaymentIntent list); the Set constructor detach needs; how point passes
+`route` to `attachDomain`; the test cards; TLD-specific contact fields.
+
+## 13. Open questions for Paul
+
+None at revision 2. Paul's P4 to P6 settled revision 1's three.
+
+## 14. Review history
+
+**Round 1**, Astra, on `38cf6052` (revision 1): NOT READY, five P1 and
+three P2. Resolved in revision 2:
+
+1. P1, renewals bypass spending authority (bounded spending authority).
+ Paul ruled P4 the same day. Spend is admitted when committed: a purchase
+ carries its renewals; switching auto-renew on is admitted against the
+ caps and booked; switching off is always allowed; renewal charges are
+ never refused and are booked once. Caps are checked against the
+ account's resale ledger, so rotation and revocation neither reset nor
+ escape the totals. The invariant and its one enforcement point: §5.2.
+2. P1, authorisation retries can create several PaymentIntents (payment
+ idempotency across outages). §6.3 now follows `billinghold.go`: the
+ first send's provider time is stored, resends stop at
+ `resendLifetime`, each is preceded by a reconcile read (by stored id,
+ else by purchase metadata), never after a cached 5xx, and past the bound
+ the purchase only reads and, when still unsure, fails rather than send.
+3. P1, the engine needs a Checkout session (payment-state continuity
+ without Checkout). §6.3a names every session read in `domainbuy.go`
+ and its direct replacement, the checks each read keeps (identity,
+ metadata, customer, currency, total), and that the adapter's session
+ read is never called for a direct purchase.
+4. P1, attachment paths skip service checks (consistent authority across
+ attachment paths). §4.5: one service attachment check (binding,
+ control-plane, linked) for the attach door, point and the purchase's
+ attach, run at start and again before the deferred attach.
+5. P1, replacing every Set removes detach access (existing credential
+ compatibility). §4.2: detach keeps Publish, Instance, Admin and its
+ scoped Team registration and adds Domains; the other doors become
+ `Exactly(Domains)`.
+6. P2, a card does not fix the billing currency (reseller onboarding
+ prerequisites). §4.4: the mint takes `--currency` and fixes it under the
+ billing hold by `paymentCustomerLocked`'s rule; the claim about card
+ setup is corrected.
+7. P2, polling omits `unpaid` (purchase completion signalling). §6.4 lists
+ the terminal states, what each means for registration and payment, and
+ the consumer's action for `unpaid`.
+8. P2, a person's live purchase leaks (person/service purchase isolation).
+ §6.1: the check and the purchase filter the live-purchase lookup by
+ service provenance first; a person's is the neutral refusal, with no id
+ and no quote.
+
+**Round 2**, Astra, on `55b1c805` (revision 2): NOT READY, two P1 and two
+P2. Round 1's findings resolved except point's takeover (R1 P1-4, partly).
+Resolved in revision 3:
+
+1. P1, point can still detach another app's retained claims (consistent
+ authority across attachment paths, second round running: stopping rule
+ 2). Paul ruled P7, refuse up front. §6.6: a `domains` caller is refused
+ with 409 `claimed_elsewhere` before any zone or claim change when the
+ apex or `www` has a claim of this account on any app but the bound one,
+ purged apps' retained claims included; a person recovers. Witness with a
+ retained claim of a purged app.
+2. P1, registration can start without enough authorisation left
+ (registration within its payment authorisation). §6.3: named margins
+ (`captureMargin` 6 hours, `registrationStartMargin` 30 hours), setup and
+ registering deadlines clipped by `CaptureBefore` in provider time, an
+ authorisation recovered too late cancelled (`authorisation_late`), and
+ tests just either side of the margin.
+3. P2, the common gate would drop member access to the list (existing
+ caller compatibility). §4.2: persons are admitted exactly as today, the
+ list to any member; `domains` callers are held to an owner.
+4. P2, registrar error text could carry contact data (registrant data in
+ diagnostics). §6.2: `EnsureContact` and `Register` return errors without
+ provider descriptions, through `trusted`, with a fixture that echoes
+ contact fields and checks logs and audit.
+
+Findings file: `docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R2.md`.
+
+**Round 3**, Astra, on `a5cb7fa0` (revision 3): NOT READY, one P1. Every
+other finding of rounds 1 to 3 resolved (R2 P1-2 partly). Resolved in
+revision 4:
+
+1. P1, the six-day fallback can admit registration after the real hold
+ expires (registration within its payment authorisation, second round
+ running: stopping rule 2). Paul ruled P8, refuse up front. §6.3: the
+ fallback is removed; with no verified `CaptureBefore` there is no zone
+ and no registrar call, the hold is cancelled through the existing
+ reconciliation path, and the purchase fails `capture_deadline_unknown`.
+ Witness: an intent read with no `capture_before`.
+
+Findings file: `docs/superpowers/reviews/CODEX-FINDINGS-domain-resale-spec-R3.md`.
+The three-round budget is spent. A scoped fourth check, of revision 4's
+diff only, runs with Paul's go.