broker: subdomain-issuance — ClaimSubdomain / PointSubdomain go real on Matou's zone (terms ruling first) #221

Closed
opened 2026-07-31 02:38:50 +00:00 by ben · 2 comments
Owner

Parent

Founding spec #11 (ADRs 0047/0048/0049 — the Matou-side service). Contract-gap sweep 2026-07-30, filed on Ben's request.

What's true today

  • The broker is a 12-line skeleton (broker/internal/broker/broker.go, Version = "0.0.0-skeleton"). ClaimSubdomain / PointSubdomain have no real implementation, and the production helper wiring fails loud by design: app/helper/cmd/helper/wiring_prod.go leaves the broker port nil — "deferred business decision — the rental broker's terms (ADR 0047/0048)".
  • Consequence: founding's <slug>.matou.nz path (P1-S5 claim + reserve, P1-S10 point-at-gateway) does not work today; only the own-domain and private paths are real. The matou.nz zone-with-API is Matou's standing obligation (ADR 0013 — DNS hosting only, never ingress), and rented-gateway provisioning (ADR 0047) sits behind the same terms decision.

What to build

The ruling first — this is the deferred business decision, Ben's to make: the broker's terms. Pricing (if any) for subdomain issuance and for rented gateways, what Matou commits to operationally (zone availability, record turnaround), and the eject-route guarantees (ADR 0049 — the own-VPS path stays the exit).

Then the implementation (splittable to ready-for-agent once ruled): the v1 broker capabilities per ADR 0049 — slug claim-check + reservation, record CRUD on the matou.nz zone, PointSubdomain once the gateway IP is known — running on Matou infrastructure, never inside a community's fleet; the helper's production wiring goes real and the fail-loud stub retires.

Acceptance criteria

  • Given Ben's terms ruling, When it lands, Then it is recorded (ADR or matou-ops decision) and this ticket splits an implementation ticket to ready-for-agent
  • Given the implemented broker, When founding claims a slug, Then <slug>.matou.nz reserves, points at the gateway once reachability passes (ADR 0049's gate), and the helper wiring no longer fails loud
  • Given the eject route, Then nothing in the implementation makes the own-domain path second-class

Task manifest

task: broker:subdomain-issuance
implements_seam: "the broker's v1 capabilities (ADR 0049) behind founding's BrokerClient port"
interface: "founding's <slug>.matou.nz path works end to end"
seam: "broker API tests + the helper wiring's fail-loud stub retired"
acceptance:
  - given: the terms ruled; when: founding claims a slug; then: reserved, pointed, real
depends_on: []
out_of_scope: [in-flow domain purchase (deferred out of v1, ADR 0049 §3), rented-gateway provisioning beyond what the terms ruling covers]
needs_human_decision: ["the broker's terms — pricing, Matou's operational commitment, eject-route guarantees (ADR 0047/0048's deferred decision)"]

Blocks

Nothing in-repo — founding's own-domain and private paths are unaffected.

## Parent Founding spec #11 (ADRs 0047/0048/0049 — the Matou-side service). Contract-gap sweep 2026-07-30, filed on Ben's request. ## What's true today - The broker is a 12-line skeleton (`broker/internal/broker/broker.go`, `Version = "0.0.0-skeleton"`). `ClaimSubdomain` / `PointSubdomain` have no real implementation, and the production helper wiring **fails loud by design**: `app/helper/cmd/helper/wiring_prod.go` leaves the broker port nil — "deferred business decision — the rental broker's terms (ADR 0047/0048)". - Consequence: founding's `<slug>.matou.nz` path (P1-S5 claim + reserve, P1-S10 point-at-gateway) does not work today; only the own-domain and private paths are real. The matou.nz zone-with-API is Matou's standing obligation (ADR 0013 — DNS hosting only, never ingress), and rented-gateway provisioning (ADR 0047) sits behind the same terms decision. ## What to build **The ruling first — this is the deferred business decision, Ben's to make:** the broker's terms. Pricing (if any) for subdomain issuance and for rented gateways, what Matou commits to operationally (zone availability, record turnaround), and the eject-route guarantees (ADR 0049 — the own-VPS path stays the exit). Then the implementation (splittable to `ready-for-agent` once ruled): the v1 broker capabilities per ADR 0049 — slug claim-check + reservation, record CRUD on the matou.nz zone, `PointSubdomain` once the gateway IP is known — running on Matou infrastructure, never inside a community's fleet; the helper's production wiring goes real and the fail-loud stub retires. ## Acceptance criteria - [ ] Given Ben's terms ruling, When it lands, Then it is recorded (ADR or matou-ops decision) and this ticket splits an implementation ticket to `ready-for-agent` - [ ] Given the implemented broker, When founding claims a slug, Then `<slug>.matou.nz` reserves, points at the gateway once reachability passes (ADR 0049's gate), and the helper wiring no longer fails loud - [ ] Given the eject route, Then nothing in the implementation makes the own-domain path second-class ## Task manifest ```yaml task: broker:subdomain-issuance implements_seam: "the broker's v1 capabilities (ADR 0049) behind founding's BrokerClient port" interface: "founding's <slug>.matou.nz path works end to end" seam: "broker API tests + the helper wiring's fail-loud stub retired" acceptance: - given: the terms ruled; when: founding claims a slug; then: reserved, pointed, real depends_on: [] out_of_scope: [in-flow domain purchase (deferred out of v1, ADR 0049 §3), rented-gateway provisioning beyond what the terms ruling covers] needs_human_decision: ["the broker's terms — pricing, Matou's operational commitment, eject-route guarantees (ADR 0047/0048's deferred decision)"] ``` ## Blocks Nothing in-repo — founding's own-domain and private paths are unaffected.
Author
Owner

Ruled by Ben, 2026-07-30 — free while alpha. Subdomain issuance is free during alpha, Matou's commitment is best-effort (no SLA), terms revisited before any paid/GA offering; rented-gateway pricing stays deferred; the eject route stays first-class. Recorded as ADR 0114 (docs/adr/0114-broker-terms-free-while-alpha.md). The build is now fully specified (ADR 0049 v1 capabilities against the matou.nz zone) — flipping this ticket ready-for-human → ready-for-agent.

**Ruled by Ben, 2026-07-30 — free while alpha.** Subdomain issuance is free during alpha, Matou's commitment is best-effort (no SLA), terms revisited before any paid/GA offering; rented-gateway pricing stays deferred; the eject route stays first-class. Recorded as **ADR 0114** (`docs/adr/0114-broker-terms-free-while-alpha.md`). The build is now fully specified (ADR 0049 v1 capabilities against the matou.nz zone) — flipping this ticket `ready-for-human` → `ready-for-agent`.
Author
Owner

Implemented in 201a7d9 (on origin/main). The terms gate was already ruled (ADR 0114 — subdomain issuance free while alpha, best-effort, rentals deferred), so this landed the build.

Broker module (broker/internal/broker/): grew from the 12-line skeleton to real v1 capabilities (ADR 0049) — Registry (concurrency-safe reservation ledger: slug claim-check + reserve, DNS-label validation, reserved-infra names never issued), a Zone port for record CRUD on the matou.nz zone with the real key-systems binding (KeySystemsZone, the only working matou.nz DNS API per the lab-dns facts) plus an honest UnconfiguredZone that fails loud (ADR 0100), and an Issuer whose Point refuses any never-claimed/foreign host and surfaces every zone-write failure. HTTP API POST /v1/subdomains/{claim,point}; rented gateways stay off it (ADR 0114). main.go serves it; the live matou.nz record write is a matou-ops boot injection (the zone-with-API is ADR 0013s standing obligation).

App side (internal/brokerclient.Client): the real founding.BrokerClient over HTTP — ClaimSubdomain/PointSubdomain real; Offer/Rent honestly unavailable-in-alpha (a typed BrokerError, never a fabricated rental — the eject/own-domain path stays first-class).

Wiring: the helpers production broker fail-loud stub retired — foundingPorts now wires WithBroker(brokerclient.New(...)) and the boot seam test port map flips broker → real.

Seams: broker/internal/broker/{broker,http,zone}_test.go, internal/brokerclient/client_test.go, and the helper boot seam test (wiring_test.go). No Go toolchain in the Sandcastle sandbox (#198) — verified by careful review. STATUS.md updated in the same commit.

Implemented in 201a7d9 (on origin/main). The terms gate was already ruled (ADR 0114 — subdomain issuance free while alpha, best-effort, rentals deferred), so this landed the build. **Broker module** (`broker/internal/broker/`): grew from the 12-line skeleton to real v1 capabilities (ADR 0049) — `Registry` (concurrency-safe reservation ledger: slug claim-check + reserve, DNS-label validation, reserved-infra names never issued), a `Zone` port for record CRUD on the matou.nz zone with the real key-systems binding (`KeySystemsZone`, the only working matou.nz DNS API per the lab-dns facts) plus an honest `UnconfiguredZone` that fails loud (ADR 0100), and an `Issuer` whose `Point` refuses any never-claimed/foreign host and surfaces every zone-write failure. HTTP API `POST /v1/subdomains/{claim,point}`; rented gateways stay off it (ADR 0114). `main.go` serves it; the live matou.nz record write is a matou-ops boot injection (the zone-with-API is ADR 0013s standing obligation). **App side** (`internal/brokerclient.Client`): the real `founding.BrokerClient` over HTTP — `ClaimSubdomain`/`PointSubdomain` real; `Offer`/`Rent` honestly unavailable-in-alpha (a typed `BrokerError`, never a fabricated rental — the eject/own-domain path stays first-class). **Wiring**: the helpers production broker fail-loud stub retired — `foundingPorts` now wires `WithBroker(brokerclient.New(...))` and the boot seam test port map flips broker → real. Seams: `broker/internal/broker/{broker,http,zone}_test.go`, `internal/brokerclient/client_test.go`, and the helper boot seam test (`wiring_test.go`). No Go toolchain in the Sandcastle sandbox (#198) — verified by careful review. STATUS.md updated in the same commit.
ben closed this issue 2026-07-31 03:55:09 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/idss#221
No description provided.