Live rented gateway's lease heartbeat gets 409 "this host has no active rental" from the broker — the box is off the ledger (orphan risk) #1335

Closed
opened 2026-09-09 01:28:59 +00:00 by ben · 6 comments
Owner

Seen: manual trial 2026-09-08 (Whakatohea, rented path, build db1d1b23). The gateway at 209.38.86.8 (idss-gateway-whakatohea-research-centre-cb94) was rented through the app at 00:08 UTC 2026-09-09 (box booted 00:09) and came live at 00:52. From its first heartbeat onward, every 5-minute renew fails:

address heartbeat: rented gateway lease renew failed — retrying next pass; the broker's TTL reaper is the backstop (ADR 0189)
err="brokerclient: /v1/gateways/renew: 409 Conflict: broker: this host has no active rental"

409 comes from Rentals.Renew → ErrNotRented (no record, or Released:true) — the request passed the claim-secret check, so this is the ledger, not auth. The app's own state still holds the rental (draft.access.kind=rented, no abandoned_rentals), and the app never called release for this box. The broker has been up since 2026-09-03 with no restarts, so it is not a lost ledger.

What is known about the window: the previous Whakatohea box (170.64.136.124) was released + the name offboarded at ~20:11 UTC 2026-09-08, four hours BEFORE this rent, and the name was re-claimed by the app (new claim secret). Rent writes the ledger record under the normalised apex and only three paths ever set Released (Rent-on-gone-server, Release, Reap) — none should have fired. Needs the broker journal for whakatohea between 00:08 and 00:52 UTC 2026-09-09 (root on the mail droplet: journalctl -u ourcloud-broker --since "2026-09-09 00:00").

Why it matters: the backstop the log names does not exist for this box — a host the ledger does not carry is never reaped, so it bills until someone finds it by hand (ADR 0047/0100 orphan class). The heartbeat's wording ("the reaper is the backstop") is wrong for ErrNotRented specifically and should say so loudly.

Ask: (1) find why the record went missing/released; (2) make the control plane distinguish 409-not-rented from a transient and surface it on the dashboard (an orphan nobody can see); (3) decide whether the app should re-rent/re-register on not-rented.

**Seen:** manual trial 2026-09-08 (Whakatohea, rented path, build db1d1b23). The gateway at 209.38.86.8 (`idss-gateway-whakatohea-research-centre-cb94`) was rented through the app at 00:08 UTC 2026-09-09 (box booted 00:09) and came live at 00:52. From its first heartbeat onward, every 5-minute renew fails: ``` address heartbeat: rented gateway lease renew failed — retrying next pass; the broker's TTL reaper is the backstop (ADR 0189) err="brokerclient: /v1/gateways/renew: 409 Conflict: broker: this host has no active rental" ``` 409 comes from `Rentals.Renew` → `ErrNotRented` (no record, or `Released:true`) — the request passed the claim-secret check, so this is the ledger, not auth. The app's own state still holds the rental (`draft.access.kind=rented`, no `abandoned_rentals`), and the app never called release for this box. The broker has been up since 2026-09-03 with no restarts, so it is not a lost ledger. **What is known about the window:** the previous Whakatohea box (170.64.136.124) was released + the name offboarded at ~20:11 UTC 2026-09-08, four hours BEFORE this rent, and the name was re-claimed by the app (new claim secret). `Rent` writes the ledger record under the normalised apex and only three paths ever set `Released` (Rent-on-gone-server, Release, Reap) — none should have fired. Needs the broker journal for `whakatohea` between 00:08 and 00:52 UTC 2026-09-09 (root on the mail droplet: `journalctl -u ourcloud-broker --since "2026-09-09 00:00"`). **Why it matters:** the backstop the log names does not exist for this box — a host the ledger does not carry is never reaped, so it bills until someone finds it by hand (ADR 0047/0100 orphan class). The heartbeat's wording ("the reaper is the backstop") is wrong for `ErrNotRented` specifically and should say so loudly. **Ask:** (1) find why the record went missing/released; (2) make the control plane distinguish 409-not-rented from a transient and surface it on the dashboard (an orphan nobody can see); (3) decide whether the app should re-rent/re-register on not-rented.

This was generated by AI during triage.

Category: bug · State: ready-for-session

Ruled by agent under ADR 0174 — veto anytime

The routing call: this is not ready-for-human. Root-causing it (Ask 1) needs the live broker journal on the mail droplet (journalctl -u ourcloud-broker, root) — that is an interactive agent session's standing (a live droplet door), which the reporter named, not Ben's hands or eyes. Pulling a journal is not data destruction, not a posture widening, not a Ben-only credential, and the follow-on fixes (Asks 2 and 3) are revertible-by-commit and provable by the broker's rentals tests. So the whole ticket is a two-way door an agent session can close; a swarm worker can't, because it has no route to the droplet journal — hence ready-for-session, not ready-for-agent. Ask 3's re-rent/re-register policy is itself a two-way door the implementing session should rule (proposed default below) and post here, not escalate.

Verified against the codebase

Real paths, all present:

  • broker/internal/broker/rentals.go:167 — ErrNotRented = "broker: this host has no active rental"; Renew (L355-361) returns it when the host key is absent or Released:true.
  • The ledger is rentals map[string]Rental keyed by host (the normalised apex), L126. Only three paths set Released: Rent-on-gone-server (L248-257), Release, Reap.
  • The misleading heartbeat wording lives at internal/heartbeat/heartbeat.go:381-384 (and the doc-comment L370-374): it asserts "the broker's TTL reaper is the backstop" unconditionally, which is false for ErrNotRented — a host the ledger doesn't carry is never reaped (the ADR 0047/0100 orphan class the report names).

A suspected lead for the session (confirm against the journal, don't assume): the previous Whakatohea box shared the same normalised apex host key and was released ~20:11 UTC, four hours before this rent under the same key. Trace whether the new Rent record was later flipped Released — Rent-on-gone-server (L248-257) is the one path that marks a live-keyed record released, and it keys on host. GOTCHAS #58 is the adjacent "deleted-behind-the-broker's-back" case.

Not redundant: no existing code distinguishes 409-not-rented from a transient renew failure, and nothing surfaces an off-ledger orphan on the dashboard.

Session brief

Evidence gate (do first): on the mail droplet as root, journalctl -u ourcloud-broker --since "2026-09-09 00:00" and grep for whakatohea between 00:08 and 00:52 UTC — find which of Rent / Release / Reap flipped Released (or whether the record was never written under the apex the renew uses). Paste the finding here.

Then:

  1. Fix the root cause the journal reveals (likely in rentals.go — a host-keyed ledger record being released out from under a live rent, or a normalisation mismatch between the write key and the renew key).
  2. Make the control plane distinguish 409 ErrNotRented from a transient renew failure and surface it on the dashboard as an off-ledger/orphan warning (an orphan nobody can see is the harm). Fix the heartbeat wording at internal/heartbeat/heartbeat.go:381-384 so it does not claim the TTL reaper is the backstop when the error is ErrNotRented specifically — that box will never be reaped.
  3. Proposed default ruling for Ask 3 (re-rent/re-register on not-rented), adopt or amend and post: on a clean ErrNotRented where the app still holds the rental and never released, the app should re-register the existing box with the broker (re-assert the ledger record) rather than rent a new box — re-renting would spend on a second droplet and orphan the first. Provable by a broker rentals test; revertible by commit → two-way door.

Acceptance:

  • Root cause identified from the journal and named in a commit/comment.
  • A rentals-package test reproduces the missing/released-record condition and passes after the fix.
  • ErrNotRented renders a distinct dashboard warning + corrected heartbeat wording (test-covered).
  • GOTCHAS entry appended for the orphan-on-not-rented class.

No session-host marker set: the evidence is the broker journal on the mail droplet, reachable by any session with DO/droplet standing, not pinned to one worker host.

> *This was generated by AI during triage.* **Category:** bug · **State:** ready-for-session ## Ruled by agent under ADR 0174 — veto anytime **The routing call:** this is *not* `ready-for-human`. Root-causing it (Ask 1) needs the live broker journal on the mail droplet (`journalctl -u ourcloud-broker`, root) — that is an interactive agent session's standing (a live droplet door), which the reporter named, **not** Ben's hands or eyes. Pulling a journal is not data destruction, not a posture widening, not a Ben-only credential, and the follow-on fixes (Asks 2 and 3) are revertible-by-commit and provable by the broker's rentals tests. So the whole ticket is a two-way door an agent session can close; a swarm worker can't, because it has no route to the droplet journal — hence `ready-for-session`, not `ready-for-agent`. Ask 3's re-rent/re-register policy is itself a two-way door the implementing session should rule (proposed default below) and post here, not escalate. ## Verified against the codebase Real paths, all present: - `broker/internal/broker/rentals.go:167` — `ErrNotRented` = "broker: this host has no active rental"; `Renew` (L355-361) returns it when the host key is absent **or** `Released:true`. - The ledger is `rentals map[string]Rental` keyed by **host** (the normalised apex), L126. Only three paths set `Released`: Rent-on-gone-server (L248-257), `Release`, `Reap`. - The misleading heartbeat wording lives at `internal/heartbeat/heartbeat.go:381-384` (and the doc-comment L370-374): it asserts "the broker's TTL reaper is the backstop" **unconditionally**, which is false for `ErrNotRented` — a host the ledger doesn't carry is never reaped (the ADR 0047/0100 orphan class the report names). **A suspected lead for the session (confirm against the journal, don't assume):** the previous Whakatohea box shared the same normalised apex host key and was released ~20:11 UTC, four hours before this rent under the same key. Trace whether the new `Rent` record was later flipped `Released` — Rent-on-gone-server (L248-257) is the one path that marks a *live-keyed* record released, and it keys on `host`. GOTCHAS #58 is the adjacent "deleted-behind-the-broker's-back" case. Not redundant: no existing code distinguishes 409-not-rented from a transient renew failure, and nothing surfaces an off-ledger orphan on the dashboard. ## Session brief **Evidence gate (do first):** on the mail droplet as root, `journalctl -u ourcloud-broker --since "2026-09-09 00:00"` and grep for `whakatohea` between 00:08 and 00:52 UTC — find which of Rent / Release / Reap flipped `Released` (or whether the record was never written under the apex the renew uses). Paste the finding here. **Then:** 1. Fix the root cause the journal reveals (likely in `rentals.go` — a host-keyed ledger record being released out from under a live rent, or a normalisation mismatch between the write key and the renew key). 2. Make the control plane distinguish `409 ErrNotRented` from a transient renew failure and surface it on the dashboard as an off-ledger/orphan warning (an orphan nobody can see is the harm). Fix the heartbeat wording at `internal/heartbeat/heartbeat.go:381-384` so it does **not** claim the TTL reaper is the backstop when the error is `ErrNotRented` specifically — that box will never be reaped. 3. **Proposed default ruling for Ask 3 (re-rent/re-register on not-rented), adopt or amend and post:** on a clean `ErrNotRented` where the app still holds the rental and never released, the app should re-register the existing box with the broker (re-assert the ledger record) rather than rent a *new* box — re-renting would spend on a second droplet and orphan the first. Provable by a broker rentals test; revertible by commit → two-way door. **Acceptance:** - Root cause identified from the journal and named in a commit/comment. - A rentals-package test reproduces the missing/released-record condition and passes after the fix. - `ErrNotRented` renders a distinct dashboard warning + corrected heartbeat wording (test-covered). - GOTCHAS entry appended for the orphan-on-not-rented class. _No `session-host` marker set: the evidence is the broker journal on the mail droplet, reachable by any session with DO/droplet standing, not pinned to one worker host._

Ruled by agent under ADR 0174 — veto anytime

Session-runner on matou-dev-server-01. Landed the two-way-door parts (Asks 2 & 3) and re-routed the residue that needs a door this session class does not have.

Landed — commit be8cf359 (green, pushed to main)

Ask 2 (distinguish 409-not-rented from a transient; surface loudly):

  • brokerclient.RenewGateway now surfaces a 409 not-rented as the typed ErrGatewayNotRented. postJSON's bare-error branch returns a *brokerStatusError (status code + message; formats identically, so string-only callers are unaffected), so the classification is not a brittle call-site string-match. ErrReleasing — the broker's other 409 — is deliberately not matched (a release-owed lease is still carried by the reaper, so it is not an orphan).
  • The broker's ErrNotRented wire text is now pinned on both sides (broker TestErrNotRented_WireTextIsTheClientContract) so the two modules can't drift silently.
  • The control-plane wiring translates it to heartbeat.ErrLeaseNotRented (the heartbeat keeps no transport knowledge — the seam does the translation).
  • heartbeat.renewLease now raises a LOUD (ERROR), STANDING orphan condition (Status.LeaseOrphaned, held raised-at) on a separate lease condition from DNS health — a renew failure never flips the record's health (ADR 0189), and the per-tick DNS-status rebuild never wipes a standing orphan's raised-at. The heartbeat wording (heartbeat.go renewLease + doc-comment) no longer claims "the reaper is the backstop" for ErrNotRented; it says the reaper will never reap this box. A transient failure keeps the (now-correct) benign note; a renew that lands clears the condition.
  • Tests: TestTick_RenewNotRentedRaisesLoudStandingOrphanCondition, TestClient_RenewGatewayNotRentedIsTypedOrphan / …TransientIsNotAnOrphan, plus the transient test now asserts LeaseOrphaned stays false.
  • Note / follow-up: heartbeat.Status() is not yet consumed by any dashboard read-model (this is a pre-existing gap for every heartbeat state, DNS repoint-failed included) — so "surfaced" here means the control-plane operator log at ERROR + the standing Status field, not a graphical dashboard alert. Wiring heartbeat.Status() (lease + DNS conditions) into the monitor alert stream is broader than this ticket and touches a member-facing surface; worth its own issue.

Ask 3 (re-rent / re-register on not-rented) — ruled, amending the triage's proposed default: no auto-remediation. The triage proposed the app re-register the existing box (re-assert the ledger). I'm deferring that, not adopting it:

  • Re-rent is spend and, if the real cause is a ledger key the box is carried under, would create a second orphan and mask the bug.
  • Re-register needs a new broker endpoint that lets a claim-secret holder assert an arbitrary box into the ledger — an authority/posture question — and its correctness depends on the still-unknown root cause. Building it blind would paper over a broker bug we haven't diagnosed.
  • The conservative two-way default is what landed: surface the orphan loud for an operator. Re-register stays the likely future fix once the journal names the root cause.

docs/GOTCHAS.md #202 records the class.

Evidence gathered this session (read-only, two-way)

  • The orphan is real and still billing. doctl compute droplet get 598889761: idss-gateway-whakatohea-research-centre-cb94, 209.38.86.8, active, s-2vcpu-4gb, syd1. Tag idss-rental-expires-1788998911 = 2026-09-10T00:08:31Z — i.e. rent-time (00:08) + 24h, never advanced, confirming no renew ever landed. It is a member-facing name, so the hourly rental-reap.sh sweep will report but never destroy it (ADR 0189 amd. 2 ruling 3), and the broker reaper can't (no ledger record). A true orphan.
  • The journal is not reachable from this session host. ssh root@mail.matou.nz (143.198.134.168) and root@143.198.134.168 both time out on port 22 (not refused — firewalled). The only broker door open to this host is the public HTTP (GET /v1/gateways/offer → 200). The triage's assumption that "any session with DO/droplet standing" can pull journalctl -u ourcloud-broker does not hold for matou-dev-server-01 — the broker deploy path runs from CI with its own route, not a general session shell.

Why human — the residue that needs a door this session lacks

  1. Root-cause (Ask 1): needs journalctl -u ourcloud-broker --since "2026-09-09 00:00" as root on the mail droplet to see which of Rent / Release / Reap flipped Released (or whether the record was ever written under the renew's apex key). Port 22 to the mail droplet is firewalled from session hosts — this is a human/ops door, not a ready-for-session one.
  2. The live orphan box 209.38.86.8 (droplet 598889761): it is a member-facing gateway from an active Whakatohea trial, so destroying it is a one-way-door trust call the sweep itself refuses to delegate (ADR 0189 amd. 2 ruling 3 / ADR 0174). It bills until someone decides keep-vs-destroy. I have doctl + the DO token and could destroy it, but deliberately did not — that decision is a human's.

Re-routing ready-for-session → ready-for-human on the strength of #1 and #2. The heartbeat/brokerclient hardening (Asks 2 & 3) is done and pushed; a future session or operator with mail-droplet root closes Ask 1 and rules on the live box.

## Ruled by agent under ADR 0174 — veto anytime Session-runner on `matou-dev-server-01`. Landed the two-way-door parts (Asks 2 & 3) and re-routed the residue that needs a door this session class does not have. ### Landed — commit `be8cf359` (green, pushed to `main`) **Ask 2 (distinguish 409-not-rented from a transient; surface loudly):** - `brokerclient.RenewGateway` now surfaces a 409 not-rented as the typed **`ErrGatewayNotRented`**. `postJSON`'s bare-error branch returns a `*brokerStatusError` (status code + message; formats identically, so string-only callers are unaffected), so the classification is not a brittle call-site string-match. `ErrReleasing` — the broker's *other* 409 — is deliberately **not** matched (a release-owed lease is still carried by the reaper, so it is not an orphan). - The broker's `ErrNotRented` wire text is now pinned on **both** sides (`broker` `TestErrNotRented_WireTextIsTheClientContract`) so the two modules can't drift silently. - The control-plane wiring translates it to **`heartbeat.ErrLeaseNotRented`** (the heartbeat keeps no transport knowledge — the seam does the translation). - `heartbeat.renewLease` now raises a **LOUD (ERROR), STANDING** orphan condition (`Status.LeaseOrphaned`, held raised-at) on a **separate lease condition** from DNS health — a renew failure never flips the record's health (ADR 0189), and the per-tick DNS-status rebuild never wipes a standing orphan's raised-at. The heartbeat wording (`heartbeat.go` renewLease + doc-comment) no longer claims "the reaper is the backstop" for `ErrNotRented`; it says the reaper will **never** reap this box. A transient failure keeps the (now-correct) benign note; a renew that lands clears the condition. - Tests: `TestTick_RenewNotRentedRaisesLoudStandingOrphanCondition`, `TestClient_RenewGatewayNotRentedIsTypedOrphan` / `…TransientIsNotAnOrphan`, plus the transient test now asserts `LeaseOrphaned` stays false. - **Note / follow-up:** `heartbeat.Status()` is not yet consumed by any dashboard read-model (this is a pre-existing gap for *every* heartbeat state, DNS repoint-failed included) — so "surfaced" here means the control-plane **operator log at ERROR** + the standing `Status` field, not a graphical dashboard alert. Wiring `heartbeat.Status()` (lease + DNS conditions) into the monitor alert stream is broader than this ticket and touches a member-facing surface; worth its own issue. **Ask 3 (re-rent / re-register on not-rented) — ruled, amending the triage's proposed default:** **no auto-remediation.** The triage proposed the app *re-register* the existing box (re-assert the ledger). I'm deferring that, not adopting it: - *Re-rent* is spend and, if the real cause is a ledger key the box **is** carried under, would create a **second** orphan and mask the bug. - *Re-register* needs a **new broker endpoint** that lets a claim-secret holder assert an arbitrary box into the ledger — an authority/posture question — and its correctness depends on the **still-unknown root cause**. Building it blind would paper over a broker bug we haven't diagnosed. - The conservative two-way default is what landed: surface the orphan **loud** for an operator. Re-register stays the likely future fix once the journal names the root cause. `docs/GOTCHAS.md` **#202** records the class. ### Evidence gathered this session (read-only, two-way) - **The orphan is real and still billing.** `doctl compute droplet get 598889761`: `idss-gateway-whakatohea-research-centre-cb94`, **209.38.86.8**, `active`, `s-2vcpu-4gb`, `syd1`. Tag `idss-rental-expires-1788998911` = **2026-09-10T00:08:31Z** — i.e. rent-time (00:08) + 24h, **never advanced**, confirming no renew ever landed. It is a member-facing name, so the hourly `rental-reap.sh` sweep will **report but never destroy** it (ADR 0189 amd. 2 ruling 3), and the broker reaper can't (no ledger record). A true orphan. - **The journal is not reachable from this session host.** `ssh root@mail.matou.nz` (143.198.134.168) and `root@143.198.134.168` both **time out on port 22** (not refused — firewalled). The only broker door open to this host is the public HTTP (`GET /v1/gateways/offer` → 200). The triage's assumption that "any session with DO/droplet standing" can pull `journalctl -u ourcloud-broker` does **not** hold for `matou-dev-server-01` — the broker deploy path runs from CI with its own route, not a general session shell. ### Why human — the residue that needs a door this session lacks 1. **Root-cause (Ask 1):** needs `journalctl -u ourcloud-broker --since "2026-09-09 00:00"` as **root on the mail droplet** to see which of Rent / Release / Reap flipped `Released` (or whether the record was ever written under the renew's apex key). Port 22 to the mail droplet is firewalled from session hosts — this is a human/ops door, not a `ready-for-session` one. 2. **The live orphan box `209.38.86.8` (droplet `598889761`):** it is a **member-facing** gateway from an active Whakatohea trial, so destroying it is a one-way-door trust call the sweep itself refuses to delegate (ADR 0189 amd. 2 ruling 3 / ADR 0174). It bills until someone decides keep-vs-destroy. I have `doctl` + the DO token and could destroy it, but deliberately did **not** — that decision is a human's. Re-routing `ready-for-session` → `ready-for-human` on the strength of #1 and #2. The heartbeat/brokerclient hardening (Asks 2 & 3) is done and pushed; a future session or operator with mail-droplet root closes Ask 1 and rules on the live box.
Author
Owner

Root cause (from the broker's rentals.json, read by Ben): the live box is on the ledger under a DIFFERENT host than the community's address.

ledger host server ip released
whakatohea-research-centre.idss.nz 598889761 209.38.86.8 (the live box) false — expires 2026-09-10T00:08:31Z
whakatohea.idss.nz 598636434 170.64.136.124 (yesterday's) true

How: RentServer (S4, access.go ~366) claims <Details.Slug>.idss.nz — the slug derived from the community NAME, whakatohea-research-centre — and rents under that host (ADR 0189: the rent is bound to the claimed name). S5 then shows that slug pre-filled; the operator edited it to whakatohea. ClaimSubdomain (access.go ~525) sees the persisted claim does not carry the new slug, claims the new name and replaces Draft.Address (host + secret) — the rental stays keyed on the old host, nothing re-binds it, and the old claim secret is dropped from state. From then on: the gateway heartbeats under its apex (whakatohea.idss.nz), the broker authenticates the secret (it IS the current claim), Renew looks the apex up and finds only yesterday's released record → ErrNotRented 409; an abandonment ReleaseGateway would miss the same way; and the reaper WILL destroy the live gateway at the unrenewed TTL — 2026-09-10T00:08:31Z for this box.

SaveDetails already guards the mirror case (rename after rent clears the Address, orchestrator.go ~515) but S5's slug edit after a rent has no guard at all.

Fix needs a ruling (one-way door — the name is bound to a box at rent):

  1. S5 refuses a different slug while a rental is bound to the current claim ("the name was reserved when the server was rented; go back to Access to release the server first"), or
  2. the broker gains a rebind (/v1/gateways/rebind {old_host, new_host} under BOTH secrets) and S5 re-keys the rental, or
  3. S5's slug change releases + re-rents (a whole new box; slow, and the DNS point already happened).

Plus, independent of the ruling: the control plane's ErrNotRented handling landed in be8cf359 (loud orphan warning) — but this case is not an orphan the reaper never reaps, it is the OPPOSITE: a live box the reaper WILL reap. The warning should say the box is on a clock. And SaveDetails' guard should extend to ClaimSubdomain: a claim replaced while Draft.Access.Kind == rented must never silently drop the rental's binding.

The Whakatohea trial box: lease lapses 19:08 local tonight; nothing renews it. Ben decides whether to let it go or release it by hand.

**Root cause (from the broker's `rentals.json`, read by Ben):** the live box is on the ledger under a DIFFERENT host than the community's address. | ledger host | server | ip | released | |---|---|---|---| | `whakatohea-research-centre.idss.nz` | 598889761 | 209.38.86.8 (the live box) | false — expires 2026-09-10T00:08:31Z | | `whakatohea.idss.nz` | 598636434 | 170.64.136.124 (yesterday's) | true | **How:** `RentServer` (S4, access.go ~366) claims `<Details.Slug>.idss.nz` — the slug derived from the community NAME, `whakatohea-research-centre` — and rents under that host (ADR 0189: the rent is bound to the claimed name). S5 then shows that slug pre-filled; the operator edited it to `whakatohea`. `ClaimSubdomain` (access.go ~525) sees the persisted claim does not carry the new slug, claims the new name and **replaces `Draft.Address` (host + secret)** — the rental stays keyed on the old host, nothing re-binds it, and the old claim secret is dropped from state. From then on: the gateway heartbeats under its apex (`whakatohea.idss.nz`), the broker authenticates the secret (it IS the current claim), `Renew` looks the apex up and finds only yesterday's released record → `ErrNotRented` 409; an abandonment `ReleaseGateway` would miss the same way; and the reaper WILL destroy the live gateway at the unrenewed TTL — 2026-09-10T00:08:31Z for this box. `SaveDetails` already guards the mirror case (rename after rent clears the Address, orchestrator.go ~515) but S5's slug edit after a rent has no guard at all. **Fix needs a ruling** (one-way door — the name is bound to a box at rent): 1. S5 refuses a different slug while a rental is bound to the current claim ("the name was reserved when the server was rented; go back to Access to release the server first"), or 2. the broker gains a rebind (`/v1/gateways/rebind {old_host, new_host}` under BOTH secrets) and S5 re-keys the rental, or 3. S5's slug change releases + re-rents (a whole new box; slow, and the DNS point already happened). Plus, independent of the ruling: the control plane's `ErrNotRented` handling landed in be8cf359 (loud orphan warning) — but this case is not an orphan the reaper never reaps, it is the OPPOSITE: a live box the reaper WILL reap. The warning should say the box is on a clock. And `SaveDetails`' guard should extend to `ClaimSubdomain`: a claim replaced while `Draft.Access.Kind == rented` must never silently drop the rental's binding. The Whakatohea trial box: lease lapses 19:08 local tonight; nothing renews it. Ben decides whether to let it go or release it by hand.
Author
Owner

RULED by Ben 2026-09-08 — option 1: refuse the slug change after a rent. The name is bound to the box at rent (ADR 0189 ruling 4/5); S5 may re-present it but not change it while a rental is bound to the current claim.

Build:

  • Orchestrator.ClaimSubdomain (internal/founding/access.go): when Draft.Access.Kind == rented and rentClaim(d) holds a claim whose host does not carry the requested slug, refuse — return a SubdomainClaim{Available:false, Reason: "…"} (or a typed error the stdio face maps to the same S5 stay) whose wording tells the operator the name was reserved when the server was rented, and that changing it means going back to Access and releasing the server first. Never touch Draft.Address, never call the broker.
  • The same guard on SaveDetails' rename path: today a rename after a rent CLEARS the Address (orchestrator.go ~515) — with a bound rental that is the same silent unbind. Refuse the rename while rented, same wording, or keep the slug override pinned to the rented claim.
  • The S5 wireframe/copy: the field renders read-only (pre-filled, with the one-line reason) when a rental is bound — update docs/ux/wireframes for the address screen and the flow edge; DDR note under the ADR 0189 sequence recording this ruling.
  • Heartbeat wording (control-plane main.go, landed in be8cf359): the 409 case must ALSO say the box is on the TTL clock, not only "orphan the reaper never reaps" — for a mis-keyed rental the reaper DOES reap it. Name the expiry if the broker's error carries it, else the TTL.
  • Tests: founding unit test for both refusals (claim + rename) with a rented draft; a stdio-face test that S5 stays put with the reason; the existing rename-clears-address test flips to refuse-when-rented.
  • GOTCHAS entry: symptom = live rented gateway heartbeats 409 "no active rental"; cause = rental keyed on the rent-time slug, address re-claimed after; rule = the name is frozen after rent.

Out of scope: a broker rebind endpoint (option 2, not taken). The Whakatohea trial box lapses 2026-09-10T00:08:31Z by design of this ruling — no manual rescue.

**RULED by Ben 2026-09-08 — option 1: refuse the slug change after a rent.** The name is bound to the box at rent (ADR 0189 ruling 4/5); S5 may re-present it but not change it while a rental is bound to the current claim. **Build:** - `Orchestrator.ClaimSubdomain` (internal/founding/access.go): when `Draft.Access.Kind == rented` and `rentClaim(d)` holds a claim whose host does not carry the requested slug, refuse — return a `SubdomainClaim{Available:false, Reason: "…"}` (or a typed error the stdio face maps to the same S5 stay) whose wording tells the operator the name was reserved when the server was rented, and that changing it means going back to Access and releasing the server first. Never touch `Draft.Address`, never call the broker. - The same guard on `SaveDetails`' rename path: today a rename after a rent CLEARS the Address (orchestrator.go ~515) — with a bound rental that is the same silent unbind. Refuse the rename while rented, same wording, or keep the slug override pinned to the rented claim. - The S5 wireframe/copy: the field renders read-only (pre-filled, with the one-line reason) when a rental is bound — update `docs/ux/wireframes` for the address screen and the flow edge; DDR note under the ADR 0189 sequence recording this ruling. - Heartbeat wording (control-plane main.go, landed in be8cf359): the 409 case must ALSO say the box is on the TTL clock, not only "orphan the reaper never reaps" — for a mis-keyed rental the reaper DOES reap it. Name the expiry if the broker's error carries it, else the TTL. - Tests: founding unit test for both refusals (claim + rename) with a rented draft; a stdio-face test that S5 stays put with the reason; the existing rename-clears-address test flips to refuse-when-rented. - GOTCHAS entry: symptom = live rented gateway heartbeats 409 "no active rental"; cause = rental keyed on the rent-time slug, address re-claimed after; rule = the name is frozen after rent. Out of scope: a broker rebind endpoint (option 2, not taken). The Whakatohea trial box lapses 2026-09-10T00:08:31Z by design of this ruling — no manual rescue.

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

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

close-report for #1335 — status success

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

envelope
{
  "issue": 1335,
  "status": "success",
  "commits": [
    "fd9490d2"
  ],
  "changed_files": [
    "STATUS.md",
    "app/src/components/founding/FoundingAddress.vue",
    "app/tests/unit/foundingAccessAddress.test.ts",
    "control-plane/cmd/control-plane/main.go",
    "docs/GOTCHAS.md",
    "docs/adr/0228-design-rented-community-name-frozen-after-rent.md",
    "docs/ux/flows/p1-founding.mermaid",
    "docs/ux/wireframes/p1-founding/p1-s5-address.html",
    "internal/brokerclient/client.go",
    "internal/founding/access.go",
    "internal/founding/access_test.go",
    "internal/founding/orchestrator.go",
    "internal/founding/orchestrator_test.go",
    "internal/founding/stdio_test.go",
    "internal/heartbeat/heartbeat.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci --command go test ./internal/founding/ ./internal/heartbeat/ ./internal/brokerclient/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go vet ./internal/founding/ ./internal/heartbeat/ ./internal/brokerclient/ ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci --command go build ./control-plane/...",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm exec vitest run tests/unit/foundingAccessAddress.test.ts tests/unit/foundingWizard.test.ts tests/unit/quasarUiFounding.test.ts tests/unit/founding.test.ts",
      "exit_code": 0
    },
    {
      "command": "CI=true pnpm exec eslint src/components/founding/FoundingAddress.vue tests/unit/foundingAccessAddress.test.ts",
      "exit_code": 0
    }
  ],
  "criteria": {
    "Root cause identified and named in a commit/comment": "Ben's ruling comment on the issue names it (rental keyed on the rent-time slug, Draft.Address re-claimed after); the fix commit fd9490d2 and DDR 0228 record it.",
    "A founding test reproduces the missing/released-record condition (both refusals) with a rented draft and passes after the fix": "TestClaimSubdomain_RefusesADifferentSlugWhileRentalBound (internal/founding/access_test.go) and TestSaveDetails_RefusesRenameWhileRentalBound (internal/founding/orchestrator_test.go) — both green.",
    "ClaimSubdomain refuses a different slug while a rental is bound (S5 stays with the reason, no broker call, Address untouched)": "internal/founding/access.go ClaimSubdomain returns SubdomainClaim{Available:false, Reason:rentalNameBoundReason}; TestClaimSubdomain_RefusesADifferentSlugWhileRentalBound + stdio-face TestHandle_ClaimSubdomainRefusesDifferentSlugWhileRentalBound assert it.",
    "SaveDetails refuses a rename while a rental is bound (ErrRentalNameBound), not the silent Address clear": "internal/founding/orchestrator.go SaveDetails; TestSaveDetails_RefusesRenameWhileRentalBound asserts refusal + Address intact + same-slug save still allowed; existing rename-drops-stale test (non-rented) still green.",
    "S5 wireframe/UI renders the slug read-only with the reason when a rental is bound": "docs/ux/wireframes/p1-founding/p1-s5-address.html + FoundingAddress.vue (data-field=subdomain-slug readonly, data-status=rental-name-bound, data-field=rental-name-locked); vitest test 'freezes the subdomain name read-only while a rental is bound (#1335)' green.",
    "Heartbeat 409-not-rented wording ALSO says the box is on a TTL clock the reaper WILL reap (not only orphan-never-reaped)": "internal/heartbeat/heartbeat.go (ErrLeaseNotRented, renewLease detail+log, LeaseOrphaned doc), internal/brokerclient/client.go (ErrGatewayNotRented), control-plane/cmd/control-plane/main.go comment — all name both fates and the TTL (default 24h, ADR 0189).",
    "GOTCHAS entry appended for the class": "docs/GOTCHAS.md #204 (mis-keyed rental / silent name unbind); DDR 0228 recorded under the ADR 0189 sequence.",
    "Flow edge updated": "docs/ux/flows/p1-founding.mermaid — S5 self-loop for the refused slug edit while a rental is bound."
  },
  "summary": "Froze the rented community name after rent (Ben's ruling option 1): S5 slug edit and S2 rename refuse while a rental is bound, the S5 field is read-only, and the 409-not-rented wording now names the TTL-clock fate too.",
  "reason": "",
  "blockers": [],
  "no_code_change": ""
}
**close-report** for #1335 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against main; issue closed. <details><summary>envelope</summary> ```json { "issue": 1335, "status": "success", "commits": [ "fd9490d2" ], "changed_files": [ "STATUS.md", "app/src/components/founding/FoundingAddress.vue", "app/tests/unit/foundingAccessAddress.test.ts", "control-plane/cmd/control-plane/main.go", "docs/GOTCHAS.md", "docs/adr/0228-design-rented-community-name-frozen-after-rent.md", "docs/ux/flows/p1-founding.mermaid", "docs/ux/wireframes/p1-founding/p1-s5-address.html", "internal/brokerclient/client.go", "internal/founding/access.go", "internal/founding/access_test.go", "internal/founding/orchestrator.go", "internal/founding/orchestrator_test.go", "internal/founding/stdio_test.go", "internal/heartbeat/heartbeat.go" ], "tests": [ { "command": "nix develop .#go-ci --command go test ./internal/founding/ ./internal/heartbeat/ ./internal/brokerclient/", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go vet ./internal/founding/ ./internal/heartbeat/ ./internal/brokerclient/ ./control-plane/...", "exit_code": 0 }, { "command": "nix develop .#go-ci --command go build ./control-plane/...", "exit_code": 0 }, { "command": "CI=true pnpm exec vitest run tests/unit/foundingAccessAddress.test.ts tests/unit/foundingWizard.test.ts tests/unit/quasarUiFounding.test.ts tests/unit/founding.test.ts", "exit_code": 0 }, { "command": "CI=true pnpm exec eslint src/components/founding/FoundingAddress.vue tests/unit/foundingAccessAddress.test.ts", "exit_code": 0 } ], "criteria": { "Root cause identified and named in a commit/comment": "Ben's ruling comment on the issue names it (rental keyed on the rent-time slug, Draft.Address re-claimed after); the fix commit fd9490d2 and DDR 0228 record it.", "A founding test reproduces the missing/released-record condition (both refusals) with a rented draft and passes after the fix": "TestClaimSubdomain_RefusesADifferentSlugWhileRentalBound (internal/founding/access_test.go) and TestSaveDetails_RefusesRenameWhileRentalBound (internal/founding/orchestrator_test.go) — both green.", "ClaimSubdomain refuses a different slug while a rental is bound (S5 stays with the reason, no broker call, Address untouched)": "internal/founding/access.go ClaimSubdomain returns SubdomainClaim{Available:false, Reason:rentalNameBoundReason}; TestClaimSubdomain_RefusesADifferentSlugWhileRentalBound + stdio-face TestHandle_ClaimSubdomainRefusesDifferentSlugWhileRentalBound assert it.", "SaveDetails refuses a rename while a rental is bound (ErrRentalNameBound), not the silent Address clear": "internal/founding/orchestrator.go SaveDetails; TestSaveDetails_RefusesRenameWhileRentalBound asserts refusal + Address intact + same-slug save still allowed; existing rename-drops-stale test (non-rented) still green.", "S5 wireframe/UI renders the slug read-only with the reason when a rental is bound": "docs/ux/wireframes/p1-founding/p1-s5-address.html + FoundingAddress.vue (data-field=subdomain-slug readonly, data-status=rental-name-bound, data-field=rental-name-locked); vitest test 'freezes the subdomain name read-only while a rental is bound (#1335)' green.", "Heartbeat 409-not-rented wording ALSO says the box is on a TTL clock the reaper WILL reap (not only orphan-never-reaped)": "internal/heartbeat/heartbeat.go (ErrLeaseNotRented, renewLease detail+log, LeaseOrphaned doc), internal/brokerclient/client.go (ErrGatewayNotRented), control-plane/cmd/control-plane/main.go comment — all name both fates and the TTL (default 24h, ADR 0189).", "GOTCHAS entry appended for the class": "docs/GOTCHAS.md #204 (mis-keyed rental / silent name unbind); DDR 0228 recorded under the ADR 0189 sequence.", "Flow edge updated": "docs/ux/flows/p1-founding.mermaid — S5 self-loop for the refused slug edit while a rental is bound." }, "summary": "Froze the rented community name after rent (Ben's ruling option 1): S5 slug edit and S2 rename refuse while a rental is bound, the S5 field is read-only, and the 409-not-rented wording now names the TTL-clock fate too.", "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#1335
No description provided.