broker + Go: the gateway offer carries its REGIONS and the rent honours the operator's pick — v2 founding's region picker has no live half #1375

Closed
opened 2026-09-10 19:26:41 +00:00 by ben · 3 comments
Owner

The v2 founding page now lets the operator choose the rented gateway's region
(commit e01c349a, Ben's ruling 2026-09-10: "i want the sydney option to be a
coloured outlined box and i want to be able to click on it and choose the
location based on digital ocean droplet location options"
). The renderer half is
built and the seam carries it. The Go and broker halves do not exist, so the
control is real only against the in-memory fake.

This ticket builds the live half.

What exists today (renderer only)

  • app/src/lib/founding.ts — RegionOption{slug,label}, GatewayOffer.regions?: RegionOption[], RentRequest.region?: string; FakeFoundingClient offers
    DigitalOcean's droplet regions and folds the pick into the Access summary.
  • app/src/components/founding/FoundingAccess.vue — S4a's read-only region span
    became an accent-outlined <select data-field="region" data-action="region">.
    It renders only when offer.regions is non-empty, so against a live broker
    (which sends no regions) the screen falls back to today's read-only fact and
    nothing pretends to be choosable. That guard is deliberate and should stay.

What is missing

  1. internal/founding/access.go — GatewayOffer has Region string and no
    Regions; RentRequest is {PubKey} only, and its doc says outright
    "provider/region are the broker's own offer data, not chosen here".
  2. internal/brokerclient/client.go — Offer decodes the broker's offer
    JSON, Rent POSTs {host, ssh_pubkey}. Neither carries a region.
  3. broker/internal/broker/rentals.go — Offer() returns
    Region: r.cfg.Region, a single string; Rent provisions with
    Region: r.cfg.Region (three sites: ~207, ~287, ~314).
  4. broker/internal/broker/http.go — GET /v1/gateways/offer returns one
    region; POST /v1/gateways/rent accepts {host, ssh_pubkey} only.
  5. broker/cmd/broker/main.go:102 — Region: envOr("IDSS_GATEWAY_REGION", "syd1")
    is the whole region story on the deployed broker.

So today a live rent always lands in syd1 regardless of what the operator picks.

The load-bearing constraint — DO snapshots are REGION-SCOPED

DigitalOcean.LatestImageID resolves the newest idss-gateway-* snapshot,
and doSnapshot (provider_do.go:592) decodes only {id, name, created_at}. DO
snapshots exist only in the regions they have been transferred to; a droplet
create naming a snapshot absent from the target region fails with a 422 at
POST /v2/droplets — and per ADR 0047's no-half-rented invariant that surfaces
as a provision-stage BrokerError after the operator has already committed.

A region list the golden image cannot honour is worse than no picker. So the
offer's region list MUST be derived, not configured by hand:

offer.regions = DO's /v2/regions where available: true
∩ the resolved gateway snapshot's own regions[]

which means doSnapshot also has to decode regions []string. Expect the first
honest answer to be one region (syd1) until the image is transferred —
which is fine and correct: the picker then simply does not render, exactly as the
renderer's guard intends. Getting the snapshot into more regions (a transfer step
in scripts/gateway-image/build.sh, or a broker-side transfer-on-demand) is
out of scope here and should be its own ticket once this one proves the wire.

Work

Broker (broker/)

  • doSnapshot decodes regions []string; LatestImageID returns the id
    and its regions (or a sibling method does).
  • Provider gains a regions lookup over DO /v2/regions (idempotent GET —
    use doRetry, not do).
  • Rentals.Offer() returns Regions []Region{Slug,Label} — the intersection
    above — alongside the existing Region (which stays as the default/preselect).
  • Rentals.Rent accepts an optional region, validates it against that same
    intersection
    (an unknown or untransferred slug is a loud claim-stage
    refusal, never a silent fall back to cfg.Region), and passes it to
    CreateRequest.Region; the rental record + RentalRecord.Region store what
    was actually provisioned, not cfg.Region.
  • GET /v1/gateways/offer gains regions: [{slug,label}];
    POST /v1/gateways/rent accepts an optional region.
  • Offer/rent/validation covered in rentals_test.go / http_rent_test.go,
    including the refusal path and the empty-list (single-region) case.

App Go (internal/)

  • founding.GatewayOffer gains Regions []RegionOption; RegionOption{Slug,Label}.
  • founding.RentRequest gains Region string; its doc comment is corrected
    (it currently states the opposite).
  • brokerclient.Offer decodes regions; brokerclient.Rent sends region.
  • Orchestrator.RentServer passes it through; the Access summary line already
    renders res.Region (access.go:449), which is now the chosen one.
  • internal/founding/testing/fakes.go mirrors the new fields so the seam
    tests can drive a pick.
  • internal/founding/stdio.go needs no new op — rent-server already carries
    the whole RentRequest.

Docs

  • Amend ADR 0189 ruling 6 — it reads "Preset s-2vcpu-4gb, region syd1
    … offered as GatewayOffer data"
    . Region becomes an offer list the
    operator picks from; preset stays broker data.
  • Amend DDR 0190 ruling 1 — it reads "no dropdown chooses a provider or
    region"
    . Provider stays read-only (ADR 0048: DigitalOcean only); region
    becomes the one choosable offer fact. Note the intersection rule as the
    reason the list is sometimes a list of one.
  • STATUS.md in the same commit.
  • docs/GOTCHAS.md entry for the snapshot-region 422 if the build hits it.

Acceptance

  1. Against a broker whose golden snapshot lives in one region only, the offer
    carries a single-entry (or empty) regions and S4a shows the read-only fact —
    no picker, no behaviour change from today.
  2. Against a broker whose snapshot spans several regions, S4a renders the picker,
    preselects the broker's own region, and a rent provisions the droplet in the
    chosen region — the Access summary and the rental record both state it.
  3. A rent naming a region the image cannot serve is refused loudly at claim
    stage with a plain-language message; no droplet is created (ADR 0047).
  4. go test ./... green in both trees; internal/brokerclient round-trip test
    pins the new wire fields.

Out of scope

  • Transferring the gateway snapshot to more DO regions (own ticket).
  • Any second provider — ADR 0048 stands, DigitalOcean only.
  • The renderer: already landed in e01c349a.

Notes for whoever picks this up

  • broker/** is a deployed-service tree — once this lands on main it wants
    deploy-pending until the installed sha carries it.
  • The rehearsal rehearsal-rentfail honesty leg must keep working unchanged.
The v2 founding page now lets the operator **choose** the rented gateway's region (commit `e01c349a`, Ben's ruling 2026-09-10: *"i want the sydney option to be a coloured outlined box and i want to be able to click on it and choose the location based on digital ocean droplet location options"*). The renderer half is built and the seam carries it. **The Go and broker halves do not exist**, so the control is real only against the in-memory fake. This ticket builds the live half. ## What exists today (renderer only) - `app/src/lib/founding.ts` — `RegionOption{slug,label}`, `GatewayOffer.regions?: RegionOption[]`, `RentRequest.region?: string`; `FakeFoundingClient` offers DigitalOcean's droplet regions and folds the pick into the Access summary. - `app/src/components/founding/FoundingAccess.vue` — S4a's read-only region span became an accent-outlined `<select data-field="region" data-action="region">`. It renders **only when `offer.regions` is non-empty**, so against a live broker (which sends no `regions`) the screen falls back to today's read-only fact and nothing pretends to be choosable. That guard is deliberate and should stay. ## What is missing 1. **`internal/founding/access.go`** — `GatewayOffer` has `Region string` and no `Regions`; `RentRequest` is `{PubKey}` only, and its doc says outright *"provider/region are the broker's own offer data, not chosen here"*. 2. **`internal/brokerclient/client.go`** — `Offer` decodes the broker's offer JSON, `Rent` POSTs `{host, ssh_pubkey}`. Neither carries a region. 3. **`broker/internal/broker/rentals.go`** — `Offer()` returns `Region: r.cfg.Region`, a single string; `Rent` provisions with `Region: r.cfg.Region` (three sites: ~207, ~287, ~314). 4. **`broker/internal/broker/http.go`** — `GET /v1/gateways/offer` returns one `region`; `POST /v1/gateways/rent` accepts `{host, ssh_pubkey}` only. 5. **`broker/cmd/broker/main.go:102`** — `Region: envOr("IDSS_GATEWAY_REGION", "syd1")` is the whole region story on the deployed broker. So today a live rent always lands in `syd1` regardless of what the operator picks. ## The load-bearing constraint — DO snapshots are REGION-SCOPED `DigitalOcean.LatestImageID` resolves the newest `idss-gateway-*` **snapshot**, and `doSnapshot` (provider_do.go:592) decodes only `{id, name, created_at}`. DO snapshots exist only in the regions they have been transferred to; a droplet create naming a snapshot absent from the target region fails with a 422 at `POST /v2/droplets` — and per ADR 0047's no-half-rented invariant that surfaces as a `provision`-stage `BrokerError` after the operator has already committed. **A region list the golden image cannot honour is worse than no picker.** So the offer's region list MUST be derived, not configured by hand: > `offer.regions` = DO's `/v2/regions` where `available: true` > ∩ the resolved gateway snapshot's own `regions[]` which means `doSnapshot` also has to decode `regions []string`. Expect the first honest answer to be **one region (`syd1`)** until the image is transferred — which is fine and correct: the picker then simply does not render, exactly as the renderer's guard intends. Getting the snapshot into more regions (a transfer step in `scripts/gateway-image/build.sh`, or a broker-side transfer-on-demand) is **out of scope here** and should be its own ticket once this one proves the wire. ## Work **Broker (`broker/`)** - [ ] `doSnapshot` decodes `regions []string`; `LatestImageID` returns the id **and** its regions (or a sibling method does). - [ ] `Provider` gains a regions lookup over DO `/v2/regions` (idempotent GET — use `doRetry`, not `do`). - [ ] `Rentals.Offer()` returns `Regions []Region{Slug,Label}` — the intersection above — alongside the existing `Region` (which stays as the default/preselect). - [ ] `Rentals.Rent` accepts an optional region, **validates it against that same intersection** (an unknown or untransferred slug is a loud `claim`-stage refusal, never a silent fall back to `cfg.Region`), and passes it to `CreateRequest.Region`; the rental record + `RentalRecord.Region` store what was actually provisioned, not `cfg.Region`. - [ ] `GET /v1/gateways/offer` gains `regions: [{slug,label}]`; `POST /v1/gateways/rent` accepts an optional `region`. - [ ] Offer/rent/validation covered in `rentals_test.go` / `http_rent_test.go`, including the refusal path and the empty-list (single-region) case. **App Go (`internal/`)** - [ ] `founding.GatewayOffer` gains `Regions []RegionOption`; `RegionOption{Slug,Label}`. - [ ] `founding.RentRequest` gains `Region string`; its doc comment is corrected (it currently states the opposite). - [ ] `brokerclient.Offer` decodes `regions`; `brokerclient.Rent` sends `region`. - [ ] `Orchestrator.RentServer` passes it through; the Access summary line already renders `res.Region` (access.go:449), which is now the chosen one. - [ ] `internal/founding/testing/fakes.go` mirrors the new fields so the seam tests can drive a pick. - [ ] `internal/founding/stdio.go` needs no new op — `rent-server` already carries the whole `RentRequest`. **Docs** - [ ] **Amend ADR 0189 ruling 6** — it reads *"Preset `s-2vcpu-4gb`, region `syd1` … offered as `GatewayOffer` data"*. Region becomes an offer **list** the operator picks from; preset stays broker data. - [ ] **Amend DDR 0190 ruling 1** — it reads *"no dropdown chooses a provider or region"*. Provider stays read-only (ADR 0048: DigitalOcean only); region becomes the one choosable offer fact. Note the intersection rule as the reason the list is sometimes a list of one. - [ ] `STATUS.md` in the same commit. - [ ] `docs/GOTCHAS.md` entry for the snapshot-region 422 if the build hits it. ## Acceptance 1. Against a broker whose golden snapshot lives in one region only, the offer carries a single-entry (or empty) `regions` and S4a shows the read-only fact — **no picker, no behaviour change from today**. 2. Against a broker whose snapshot spans several regions, S4a renders the picker, preselects the broker's own `region`, and a rent provisions the droplet in the chosen region — the Access summary and the rental record both state it. 3. A rent naming a region the image cannot serve is refused loudly at `claim` stage with a plain-language message; **no droplet is created** (ADR 0047). 4. `go test ./...` green in both trees; `internal/brokerclient` round-trip test pins the new wire fields. ## Out of scope - Transferring the gateway snapshot to more DO regions (own ticket). - Any second provider — ADR 0048 stands, DigitalOcean only. - The renderer: already landed in `e01c349a`. ## Notes for whoever picks this up - `broker/**` is a deployed-service tree — once this lands on main it wants `deploy-pending` until the installed sha carries it. - The rehearsal `rehearsal-rentfail` honesty leg must keep working unchanged.

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Triage outcome — enhancement + ready-for-agent

Codebase verification (not already implemented; claim holds — with one correction)

Confirmed the Go + broker half genuinely does not exist, exactly as the ticket states:

  • internal/founding/access.go:114 — GatewayOffer{… Region string …}, no Regions; RentRequest (:134) is {PubKey} only.
  • internal/brokerclient/client.go:116 — Rent POSTs {host, ssh_pubkey}; Offer decodes a single region.
  • broker/internal/broker/rentals.go — Offer() (:203) returns Region: r.cfg.Region; Rent provisions with cfg.Region at ~:287/:314.
  • broker/cmd/broker/main.go:102 — Region: envOr("IDSS_GATEWAY_REGION", "syd1").
  • broker/internal/broker/provider_do.go:593 — doSnapshot decodes only {id,name,created_at}, no regions.

CreateRequest.Region already exists (broker/internal/broker/provider.go:30), so the rent path has a slot to fill. ADR 0189 and DDR 0190 both exist and are the correct amendment targets. No .out-of-scope/ prior rejection resembles this.

⚠️ One correction to the ticket's premise — flag, not a blocker

The ticket says "The renderer half is built and the seam carries it … The renderer: already landed in e01c349a." That commit does not exist in this repository — git cat-file -t e01c349a fails, no branch contains it, and history has never held a RegionOption type or a region <select>. On main (32f7db2a) FoundingAccess.vue still renders the read-only region span (lines 63–69, still citing the pre-amendment ADR 0189/DDR 0190), and app/src/lib/founding.ts:153 carries a single region: string. The renderer half is almost certainly sitting unpushed on Ben's machine (ticket authored the same day).

Ruled a non-blocker for this ticket. The Work this ticket defines is the Go tree (internal/) + the broker tree (broker/); neither imports the TypeScript renderer, and the Go-side seam tests (internal/founding/testing/fakes.go) are self-contained Go. The wire is provable end-to-end without the renderer, and AC1's guard means the missing UI is safe: with no regions on the wire, S4a falls back to the read-only fact and nothing pretends to be choosable. Follow-up owed: confirm e01c349a reaches main (or file the renderer as its own ticket) before the picker can actually render live — but that does not gate the backend wire.

Why this is a two-way door (ADR 0174)

The whole defined scope is revertible by a later commit and provable by an existing/new test:

  • AC1 (single-region fallback), AC3 (loud claim-stage refusal, no droplet), and AC4 (go test ./... both trees + the internal/brokerclient round-trip) are unit-provable with the faked Provider.
  • Even AC2's wire (chosen region flows to CreateRequest.Region and into RentalRecord.Region) is provable with a request-recording fake. Only the live multi-region droplet is unprovable now — and the ticket already scopes the snapshot transfer out until its own ticket, so the honest answer stays a single-region (syd1) offer.

None of the one-way-door residue is touched: no personal credentials, no security-posture widening (the region intersection only narrows what can be provisioned), no member-facing trust accept, no data destruction, no non-routine spend (all DO calls sit behind the Provider seam and are faked; no droplet is created in the buildable/provable scope). So a swarm worker can land and prove this without any live-infrastructure standing — hence ready-for-agent, not ready-for-session.

Agent brief

Goal: build the live Go + broker half of the S4a region picker so a rent honours the operator's chosen region, derived from what the golden snapshot can actually serve. The full checklist, the load-bearing snapshot-region constraint, the intersection rule, and the acceptance criteria are in the issue body — follow them verbatim. Highlights:

  • Broker: teach doSnapshot to decode regions []string; have LatestImageID (or a sibling) return the snapshot's regions; add a DO /v2/regions lookup via doRetry (idempotent GET, not do); Offer() returns the intersection (available:true ∩ snapshot regions) as Regions []Region{Slug,Label} while Region stays the preselect; Rent accepts an optional region, validates it against that same intersection (unknown/untransferred slug → loud claim-stage refusal, never a silent fall back to cfg.Region), passes it to CreateRequest.Region, and stores the actual provisioned region on RentalRecord. Cover offer/rent/validation + the refusal path + the empty/single-region case in rentals_test.go / http_rent_test.go.
  • App Go: GatewayOffer gains Regions []RegionOption{Slug,Label}; RentRequest gains Region string (fix its doc comment — it currently states the opposite); brokerclient.Offer decodes regions, Rent sends region; Orchestrator.RentServer threads it through (the Access summary at access.go:449 already renders res.Region); mirror the new fields in internal/founding/testing/fakes.go. No new stdio.go op.
  • Docs (same commit): amend ADR 0189 ruling 6 and DDR 0190 ruling 1 (region becomes a choosable offer list, provider stays read-only per ADR 0048; note the intersection rule is why the list is sometimes a list of one); update STATUS.md; add a docs/GOTCHAS.md entry if the snapshot-region 422 is hit.

Definition of done: go test ./... green in both trees; the internal/brokerclient round-trip test pins the new wire fields; the rehearsal-rentfail honesty leg still passes unchanged.

Post-merge: broker/** is a deployed-service tree — once this lands on main the executor swaps a drive blocker in and moves the ticket to deploy-pending until the installed sha carries it (do not close on unit tests alone for the broker half).

Watch out for:

  • The renderer discrepancy above — do not assume offer.regions types exist on the app/TS side; you are building the Go seam, not the Vue.
  • Keep FoundingAccess.vue's non-empty-regions render guard intact (it is the safety that makes a live single-region broker a no-op).
  • The intersection is the whole safety story: a region list the golden image cannot honour causes a POST /v2/droplets 422 after the operator commits (ADR 0047's no-half-rented invariant) — that is why the offer list must be derived, never hand-configured.
> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** ## Triage outcome — `enhancement` + `ready-for-agent` ### Codebase verification (not already implemented; claim holds — with one correction) Confirmed the **Go + broker half genuinely does not exist**, exactly as the ticket states: - `internal/founding/access.go:114` — `GatewayOffer{… Region string …}`, no `Regions`; `RentRequest` (`:134`) is `{PubKey}` only. - `internal/brokerclient/client.go:116` — `Rent` POSTs `{host, ssh_pubkey}`; `Offer` decodes a single `region`. - `broker/internal/broker/rentals.go` — `Offer()` (`:203`) returns `Region: r.cfg.Region`; `Rent` provisions with `cfg.Region` at ~`:287`/`:314`. - `broker/cmd/broker/main.go:102` — `Region: envOr("IDSS_GATEWAY_REGION", "syd1")`. - `broker/internal/broker/provider_do.go:593` — `doSnapshot` decodes only `{id,name,created_at}`, no `regions`. `CreateRequest.Region` already exists (`broker/internal/broker/provider.go:30`), so the rent path has a slot to fill. ADR 0189 and DDR 0190 both exist and are the correct amendment targets. No `.out-of-scope/` prior rejection resembles this. ### ⚠️ One correction to the ticket's premise — flag, not a blocker The ticket says *"The renderer half is built and the seam carries it … The renderer: already landed in `e01c349a`."* **That commit does not exist in this repository** — `git cat-file -t e01c349a` fails, no branch contains it, and history has never held a `RegionOption` type or a region `<select>`. On `main` (`32f7db2a`) `FoundingAccess.vue` still renders the **read-only** region span (lines 63–69, still citing the pre-amendment ADR 0189/DDR 0190), and `app/src/lib/founding.ts:153` carries a single `region: string`. The renderer half is almost certainly sitting **unpushed on Ben's machine** (ticket authored the same day). **Ruled a non-blocker for this ticket.** The Work this ticket defines is the Go tree (`internal/`) + the broker tree (`broker/`); neither imports the TypeScript renderer, and the Go-side seam tests (`internal/founding/testing/fakes.go`) are self-contained Go. The wire is provable end-to-end without the renderer, and AC1's guard means the missing UI is *safe*: with no `regions` on the wire, S4a falls back to the read-only fact and nothing pretends to be choosable. **Follow-up owed:** confirm `e01c349a` reaches `main` (or file the renderer as its own ticket) before the picker can actually render live — but that does not gate the backend wire. ### Why this is a two-way door (ADR 0174) The whole defined scope is **revertible by a later commit** and **provable by an existing/new test**: - AC1 (single-region fallback), AC3 (loud `claim`-stage refusal, no droplet), and AC4 (`go test ./...` both trees + the `internal/brokerclient` round-trip) are unit-provable with the faked `Provider`. - Even AC2's *wire* (chosen region flows to `CreateRequest.Region` and into `RentalRecord.Region`) is provable with a request-recording fake. Only the *live multi-region droplet* is unprovable now — and the ticket already scopes the snapshot transfer out until its own ticket, so the honest answer stays a single-region (`syd1`) offer. None of the one-way-door residue is touched: no personal credentials, **no security-posture widening** (the region intersection only *narrows* what can be provisioned), no member-facing trust accept, no data destruction, **no non-routine spend** (all DO calls sit behind the `Provider` seam and are faked; no droplet is created in the buildable/provable scope). So a swarm worker can land and prove this without any live-infrastructure standing — hence **`ready-for-agent`, not `ready-for-session`**. ## Agent brief **Goal:** build the live Go + broker half of the S4a region picker so a rent honours the operator's chosen region, derived from what the golden snapshot can actually serve. The full checklist, the load-bearing snapshot-region constraint, the intersection rule, and the acceptance criteria are in the issue body — follow them verbatim. Highlights: - **Broker:** teach `doSnapshot` to decode `regions []string`; have `LatestImageID` (or a sibling) return the snapshot's regions; add a DO `/v2/regions` lookup via **`doRetry`** (idempotent GET, not `do`); `Offer()` returns the **intersection** (`available:true` ∩ snapshot regions) as `Regions []Region{Slug,Label}` while `Region` stays the preselect; `Rent` accepts an optional region, **validates it against that same intersection** (unknown/untransferred slug → loud `claim`-stage refusal, never a silent fall back to `cfg.Region`), passes it to `CreateRequest.Region`, and stores the *actual* provisioned region on `RentalRecord`. Cover offer/rent/validation + the refusal path + the empty/single-region case in `rentals_test.go` / `http_rent_test.go`. - **App Go:** `GatewayOffer` gains `Regions []RegionOption{Slug,Label}`; `RentRequest` gains `Region string` (fix its doc comment — it currently states the opposite); `brokerclient.Offer` decodes `regions`, `Rent` sends `region`; `Orchestrator.RentServer` threads it through (the Access summary at `access.go:449` already renders `res.Region`); mirror the new fields in `internal/founding/testing/fakes.go`. No new `stdio.go` op. - **Docs (same commit):** amend **ADR 0189 ruling 6** and **DDR 0190 ruling 1** (region becomes a choosable offer *list*, provider stays read-only per ADR 0048; note the intersection rule is why the list is sometimes a list of one); update `STATUS.md`; add a `docs/GOTCHAS.md` entry if the snapshot-region 422 is hit. **Definition of done:** `go test ./...` green in both trees; the `internal/brokerclient` round-trip test pins the new wire fields; the `rehearsal-rentfail` honesty leg still passes unchanged. **Post-merge:** `broker/**` is a deployed-service tree — once this lands on `main` the executor swaps a drive blocker in and moves the ticket to `deploy-pending` until the installed sha carries it (do not close on unit tests alone for the broker half). **Watch out for:** - The renderer discrepancy above — do **not** assume `offer.regions` types exist on the app/TS side; you are building the Go seam, not the Vue. - Keep `FoundingAccess.vue`'s non-empty-`regions` render guard intact (it is the safety that makes a live single-region broker a no-op). - The intersection is the whole safety story: a region list the golden image cannot honour causes a `POST /v2/droplets` 422 *after* the operator commits (ADR 0047's no-half-rented invariant) — that is why the offer list must be derived, never hand-configured.

swarm-claim host=matou-dev-server-01 run=21407
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=matou-dev-server-01 run=21407 (automated multi-host claim — lowest live claim id works this ticket)

close-report for #1375 — status success

✅ close-report gates passed — every claim verified against main; issue closed.

envelope
{
  "issue": 1375,
  "status": "success",
  "commits": [
    "7f5d259eb20eed1681e79f42adab0c1f646ffad0"
  ],
  "changed_files": [
    "STATUS.md",
    "broker/internal/broker/http.go",
    "broker/internal/broker/http_rent_test.go",
    "broker/internal/broker/provider.go",
    "broker/internal/broker/provider_do.go",
    "broker/internal/broker/provider_do_regions_test.go",
    "broker/internal/broker/rentals.go",
    "broker/internal/broker/rentals_expiry_live_test.go",
    "broker/internal/broker/rentals_expiry_test.go",
    "broker/internal/broker/rentals_region_test.go",
    "broker/internal/broker/rentals_release_owed_test.go",
    "broker/internal/broker/rentals_test.go",
    "broker/internal/broker/rentals_zone_cleanup_test.go",
    "docs/GOTCHAS.md",
    "docs/adr/0189-rented-gateways-free-while-alpha-ttl-reaped-pubkey-in-release-on-abandon.md",
    "docs/adr/0190-design-s4a-rent-card-states-alpha-terms-no-payment-edge.md",
    "internal/brokerclient/client.go",
    "internal/brokerclient/client_test.go",
    "internal/founding/access.go",
    "internal/founding/access_test.go",
    "internal/founding/testing/fakes.go"
  ],
  "tests": [
    {
      "command": "go test ./... (app tree)",
      "exit_code": 0
    },
    {
      "command": "go test ./... (broker tree)",
      "exit_code": 0
    },
    {
      "command": "go vet ./... (both trees)",
      "exit_code": 0
    }
  ],
  "criteria": {
    "AC1 single-region offer carries single/empty regions and S4a shows read-only fact (no picker, no behaviour change)": "broker: Rentals.Offer populates off.Regions only when the intersection has >1 entry (rentals.go); default rent path never queries the intersection (resolveRegion returns cfg.Region for empty pick). Proven by TestOffer_RegionsSurfacedOnlyWhenMoreThanOne (single-region ⇒ empty list) + TestRent_DefaultRegionNeverLooksUpIntersection.",
    "AC2 multi-region offer renders picker preselecting broker region; a rent provisions the chosen region — Access summary and rental record state it": "broker: Offer.Regions carries {slug,label} list + Region preselect; Rent(region) validates and sets CreateRequest.Region and Rental.Region to the pick. Proven by TestGateway_OfferAndRentCarryRegionPicker, TestRent_HonoursPickedRegion. App-side: RentResult.Region flows to the Access summary — TestRentServer_RegionPickRidesThroughToSummary. (Renderer <select> UI is out_of_scope and cited commit e01c349a is absent from main — see reason; Go seam is additive.)",
    "AC3 a rent naming an unservable region is refused loudly at claim stage, no droplet created (ADR 0047)": "broker: resolveRegion returns *ProvisionError{Stage:\"claim\"} before create; proven by TestRent_RefusesUnofferableRegionAtClaimStageNoDroplet (0 creates, no rental recorded), TestRent_RegionLookupFailureOnPickIsClaimStage, and the HTTP 502-claim leg in TestGateway_OfferAndRentCarryRegionPicker.",
    "AC4 go test ./... green both trees; brokerclient round-trip pins new wire fields": "Both trees green (tests above); internal/brokerclient round-trip pinned by TestClient_OfferDecodesRegionsAndRentPostsPick (Offer decodes regions:[{slug,label}]; Rent posts region only when picked; chosen region rides back in RentResult)."
  },
  "summary": "Built the live broker + app-Go halves of the founding region picker: the offer derives its region list from DO available ∩ snapshot regions, and a rent validates the operator's pick against that same intersection (unofferable slug = loud claim-stage refusal, no droplet).",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1375 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1375, "status": "success", "commits": [ "7f5d259eb20eed1681e79f42adab0c1f646ffad0" ], "changed_files": [ "STATUS.md", "broker/internal/broker/http.go", "broker/internal/broker/http_rent_test.go", "broker/internal/broker/provider.go", "broker/internal/broker/provider_do.go", "broker/internal/broker/provider_do_regions_test.go", "broker/internal/broker/rentals.go", "broker/internal/broker/rentals_expiry_live_test.go", "broker/internal/broker/rentals_expiry_test.go", "broker/internal/broker/rentals_region_test.go", "broker/internal/broker/rentals_release_owed_test.go", "broker/internal/broker/rentals_test.go", "broker/internal/broker/rentals_zone_cleanup_test.go", "docs/GOTCHAS.md", "docs/adr/0189-rented-gateways-free-while-alpha-ttl-reaped-pubkey-in-release-on-abandon.md", "docs/adr/0190-design-s4a-rent-card-states-alpha-terms-no-payment-edge.md", "internal/brokerclient/client.go", "internal/brokerclient/client_test.go", "internal/founding/access.go", "internal/founding/access_test.go", "internal/founding/testing/fakes.go" ], "tests": [ { "command": "go test ./... (app tree)", "exit_code": 0 }, { "command": "go test ./... (broker tree)", "exit_code": 0 }, { "command": "go vet ./... (both trees)", "exit_code": 0 } ], "criteria": { "AC1 single-region offer carries single/empty regions and S4a shows read-only fact (no picker, no behaviour change)": "broker: Rentals.Offer populates off.Regions only when the intersection has >1 entry (rentals.go); default rent path never queries the intersection (resolveRegion returns cfg.Region for empty pick). Proven by TestOffer_RegionsSurfacedOnlyWhenMoreThanOne (single-region ⇒ empty list) + TestRent_DefaultRegionNeverLooksUpIntersection.", "AC2 multi-region offer renders picker preselecting broker region; a rent provisions the chosen region — Access summary and rental record state it": "broker: Offer.Regions carries {slug,label} list + Region preselect; Rent(region) validates and sets CreateRequest.Region and Rental.Region to the pick. Proven by TestGateway_OfferAndRentCarryRegionPicker, TestRent_HonoursPickedRegion. App-side: RentResult.Region flows to the Access summary — TestRentServer_RegionPickRidesThroughToSummary. (Renderer <select> UI is out_of_scope and cited commit e01c349a is absent from main — see reason; Go seam is additive.)", "AC3 a rent naming an unservable region is refused loudly at claim stage, no droplet created (ADR 0047)": "broker: resolveRegion returns *ProvisionError{Stage:\"claim\"} before create; proven by TestRent_RefusesUnofferableRegionAtClaimStageNoDroplet (0 creates, no rental recorded), TestRent_RegionLookupFailureOnPickIsClaimStage, and the HTTP 502-claim leg in TestGateway_OfferAndRentCarryRegionPicker.", "AC4 go test ./... green both trees; brokerclient round-trip pins new wire fields": "Both trees green (tests above); internal/brokerclient round-trip pinned by TestClient_OfferDecodesRegionsAndRentPostsPick (Offer decodes regions:[{slug,label}]; Rent posts region only when picked; chosen region rides back in RentResult)." }, "summary": "Built the live broker + app-Go halves of the founding region picker: the offer derives its region list from DO available ∩ snapshot regions, and a rent validates the operator's pick against that same intersection (unofferable slug = loud claim-stage refusal, no droplet).", "reason": "", "blockers": [], "no_code_change": "" } ``` </details>
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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#1375
No description provided.