rented gateway: an own-domain community never renews its broker lease — the renewer lives inside the address heartbeat, which rests for own domains, so the reaper destroyed tu-ia's live gateway at the 24 h TTL #2189

Closed
opened 2026-11-11 12:21:24 +00:00 by ben · 4 comments
Owner

What happened

tu-ia (own domain tech.tuia.co, Access rented) completed its founding on app 2026.11.3430: authority flipped 2026-11-10 22:01 local, hand-off finished and the founding state scrubbed at 23:00. At 2026-11-11 04:12:27 UTC the gateway droplet (DigitalOcean id 617642142, idss-gateway-tu-ia-d764, 170.64.232.153) was destroyed — DigitalOcean action 3536924536, type destroy. It had been created at 2026-11-10 04:07:44 UTC: 24 h 05 min earlier, i.e. the broker's rental TTL. The community, its KERIA/witness state and everything on the box are gone; only the laptop's config-repo replica remains.

Why

control-plane/cmd/control-plane/main.go productionAddressHeartbeat wires the lease renewer (heartbeat.WithRenewer → brokerclient.RenewGateway, ADR 0189) inside the address heartbeat, and the heartbeat returns nil before that point for:

  • any apex that is not <slug>.idss.nz — "own-domain communities are outside this loop by construction (ADR 0049/0136)";
  • any gateway without IDSS_CLAIM_SECRET — and installRented sets claim only for AddressSubdomain.

So a rented gateway with an own domain never renews its lease, and the broker's reaper destroys it at the TTL, silently, after the community is live. Until #2185 an own-domain rented founding never got far enough to hit this; now it does every time.

Fix

Split the lease renew from the address heartbeat: IDSS_ACCESS_KIND=rented alone wires a renew loop, whatever the address kind. It needs a credential the broker accepts that does not depend on a broker-claimed subdomain — the rental's own secret from RentServer (keyed on whatever host the rental was booked under), exported to the gateway the way IDSS_CLAIM_SECRET is. A test should found a rented + own-domain community and assert the control plane wires a renewer. Also: the reaper should not destroy a box whose lease was never renewed without a loud standing condition on the operator app in the hours before — the TTL is a cliff with no warning today.

Related: ADR 0189, ADR 0135/0136, #1335, #2185, internal/founding/rentedpath.go (installRented), internal/brokerclient/client.go.

## What happened tu-ia (own domain `tech.tuia.co`, Access **rented**) completed its founding on app 2026.11.3430: authority flipped 2026-11-10 22:01 local, hand-off finished and the founding state scrubbed at 23:00. At **2026-11-11 04:12:27 UTC** the gateway droplet (DigitalOcean id 617642142, `idss-gateway-tu-ia-d764`, 170.64.232.153) was destroyed — DigitalOcean action 3536924536, type `destroy`. It had been created at 2026-11-10 04:07:44 UTC: **24 h 05 min** earlier, i.e. the broker's rental TTL. The community, its KERIA/witness state and everything on the box are gone; only the laptop's config-repo replica remains. ## Why `control-plane/cmd/control-plane/main.go` `productionAddressHeartbeat` wires the lease renewer (`heartbeat.WithRenewer` → `brokerclient.RenewGateway`, ADR 0189) **inside** the address heartbeat, and the heartbeat returns `nil` before that point for: - any apex that is not `<slug>.idss.nz` — "own-domain communities are outside this loop by construction (ADR 0049/0136)"; - any gateway without `IDSS_CLAIM_SECRET` — and `installRented` sets `claim` only for `AddressSubdomain`. So a rented gateway with an own domain **never renews its lease**, and the broker's reaper destroys it at the TTL, silently, after the community is live. Until #2185 an own-domain rented founding never got far enough to hit this; now it does every time. ## Fix Split the lease renew from the address heartbeat: `IDSS_ACCESS_KIND=rented` alone wires a renew loop, whatever the address kind. It needs a credential the broker accepts that does not depend on a broker-claimed subdomain — the rental's own secret from `RentServer` (keyed on whatever host the rental was booked under), exported to the gateway the way `IDSS_CLAIM_SECRET` is. A test should found a rented + own-domain community and assert the control plane wires a renewer. Also: the reaper should not destroy a box whose lease was never renewed without a loud standing condition on the operator app in the hours before — the TTL is a cliff with no warning today. Related: ADR 0189, ADR 0135/0136, #1335, #2185, `internal/founding/rentedpath.go` (`installRented`), `internal/brokerclient/client.go`.
ben self-assigned this 2026-11-11 12:21:25 +00:00

This was generated by AI during triage.

Agent Brief

Category: bug
Summary: A rented gateway on an own domain never renews its broker lease, so the broker's TTL reaper destroys the live community at ~24h. Wire the lease renewer whenever the access kind is rented, independent of the address kind, using the rental's own secret.

Current behavior:
The lease renewer (heartbeat.WithRenewer → brokerclient.Client.RenewGateway, ADR 0189) is wired inside the address heartbeat builder (productionAddressHeartbeat). That builder returns nil early for two cases the renewer sits after:

  1. any apex that is not an <slug>.idss.nz name (own-domain communities "rest" out of the DNS loop by construction, ADR 0049/0136); and
  2. any gateway with no IDSS_CLAIM_SECRET — and the rented-path installer only exports a claim secret when the address kind is a broker-claimed subdomain.

So a rented + own-domain gateway (now reachable since #2185) reaches neither the claim-secret nor the renewer path: the heartbeat rests entirely, the lease is never renewed, and the broker reaps the live droplet at the rental TTL. This destroyed tu-ia's live gateway (community, KERIA/witness state, everything on the box) ~24h05m after rent, silently, after hand-off completed.

Verified in code: RenewGateway authenticates by the host's bound rental secret against /v1/gateways/renew (the broker adopts/uses the host's claim secret; a host not claimed via /subdomains/claim adopts the first secret presented at rent). So the broker already accepts a renew for an own-domain host if the renewer presents the secret that rent was booked under — no new broker trust model is required.

Desired behavior:
Renewing a rented gateway's lease is gated on the access kind being rented, not on the address kind being an idss.nz subdomain. A rented community on its own domain renews its lease on every healthy pass and is never reaped while live. Non-rented (own-VPS / self-hosted / private) communities carry no broker lease and stay unwired, exactly as today. An idss.nz-subdomain rented community is unchanged.

The renewer must present a credential the broker accepts for the own-domain host that does not depend on a broker-claimed subdomain: the rental's own secret (the one the rent was booked under for that host), exported to the gateway process the way IDSS_CLAIM_SECRET is today. For a subdomain-rented community the existing claim secret continues to serve (behavior unchanged).

Key interfaces:

  • The control-plane address-heartbeat wiring (productionAddressHeartbeat in control-plane/cmd/control-plane/main.go): the renew loop should be decided by the rented access kind and its own rental credential, decoupled from the two early returns that rest the DNS re-point loop for own-domain / no-claim-secret communities. The DNS re-point resting for own domains is correct and stays; only the lease renew must survive it.
  • The rented-path installer (internal/founding.installRented / rentedpath.go) and the gateway render (internal/clan): export the rental's own secret to the gateway environment for an own-domain rented draft, alongside IDSS_ACCESS_KIND=rented, as a stable env the control plane reads (mirror how IDSS_CLAIM_SECRET is threaded).
  • brokerclient.Client.RenewGateway(ctx, host, secret) — unchanged; it already posts {host} with the secret as bearer. ErrGatewayNotRented handling (the loud standing condition) stays as-is.

Acceptance criteria:

  • A test founds a rented + own-domain community and asserts the control plane wires a lease renewer for it (the named test in the report).
  • A rented + idss.nz-subdomain community still wires the renewer (regression: unchanged).
  • An own-VPS / self-hosted / private community wires no renewer (unchanged).
  • The renewer for an own-domain rented community presents the rental's own secret (not an empty / absent claim secret), so a real renew would authenticate against the broker's /v1/gateways/renew.
  • The DNS re-point loop still rests for own-domain communities (own-domain DNS stays a manual posture, ADR 0049/0136) — only the lease renew is added.
  • go test for the touched packages, go vet, gofmt clean.

Out of scope:

  • The broker's reaper giving a loud standing condition / warning on the operator app in the hours before a TTL cliff (so an un-renewed box is not destroyed silently). That is a separate broker-side + operator-app enhancement — file it as a follow-up enhancement; this ticket is the renewer wiring that stops the silent reap in the first place. (Note: the heartbeat already raises a standing condition on ErrGatewayNotRented; the missing piece is the no-warning-before-TTL cliff, which is broker/design work.)
  • The live drive proving a real own-domain rented founding survives past the TTL — owed as drive proof after the helper-side fix lands (the fix reaches a founder only through a rebuilt app at a feed-named revision, #1769); tracked by the standing drive issue.

Ruled by agent under ADR 0174 — veto anytime.
Ruling: ready-for-agent. This is a two-way door — additive renewer wiring plus an exported rental secret, revertible per commit, and proven by the seam test named above. It is not on the one-way-door list: no personal credentials (the rental secret already exists and already authenticated the rent), no security-posture widening (the broker already accepts a host-keyed renew), no member-facing trust accept, no data destruction (this prevents the reap), no non-routine spend. The reaper-warning half is carved out as a follow-up so it does not block the renewer fix.

> *This was generated by AI during triage.* ## Agent Brief **Category:** bug **Summary:** A rented gateway on an own domain never renews its broker lease, so the broker's TTL reaper destroys the live community at ~24h. Wire the lease renewer whenever the access kind is `rented`, independent of the address kind, using the rental's own secret. **Current behavior:** The lease renewer (`heartbeat.WithRenewer` → `brokerclient.Client.RenewGateway`, ADR 0189) is wired *inside* the address heartbeat builder (`productionAddressHeartbeat`). That builder returns `nil` early for two cases the renewer sits after: 1. any apex that is not an `<slug>.idss.nz` name (own-domain communities "rest" out of the DNS loop by construction, ADR 0049/0136); and 2. any gateway with no `IDSS_CLAIM_SECRET` — and the rented-path installer only exports a claim secret when the address kind is a broker-claimed subdomain. So a **rented + own-domain** gateway (now reachable since #2185) reaches neither the claim-secret nor the renewer path: the heartbeat rests entirely, the lease is never renewed, and the broker reaps the live droplet at the rental TTL. This destroyed tu-ia's live gateway (community, KERIA/witness state, everything on the box) ~24h05m after rent, silently, after hand-off completed. Verified in code: `RenewGateway` authenticates by the host's bound rental secret against `/v1/gateways/renew` (the broker adopts/uses the host's claim secret; a host not claimed via `/subdomains/claim` adopts the first secret presented at rent). So the broker already accepts a renew for an own-domain host *if the renewer presents the secret that rent was booked under* — no new broker trust model is required. **Desired behavior:** Renewing a rented gateway's lease is gated on **the access kind being `rented`**, not on the address kind being an idss.nz subdomain. A rented community on its own domain renews its lease on every healthy pass and is never reaped while live. Non-rented (own-VPS / self-hosted / private) communities carry no broker lease and stay unwired, exactly as today. An idss.nz-subdomain rented community is unchanged. The renewer must present a credential the broker accepts for the own-domain host that does not depend on a broker-claimed subdomain: the rental's own secret (the one the rent was booked under for that host), exported to the gateway process the way `IDSS_CLAIM_SECRET` is today. For a subdomain-rented community the existing claim secret continues to serve (behavior unchanged). **Key interfaces:** - The control-plane address-heartbeat wiring (`productionAddressHeartbeat` in `control-plane/cmd/control-plane/main.go`): the renew loop should be decided by the `rented` access kind and its own rental credential, decoupled from the two early returns that rest the *DNS re-point* loop for own-domain / no-claim-secret communities. The DNS re-point resting for own domains is correct and stays; only the lease renew must survive it. - The rented-path installer (`internal/founding.installRented` / `rentedpath.go`) and the gateway render (`internal/clan`): export the rental's own secret to the gateway environment for an own-domain rented draft, alongside `IDSS_ACCESS_KIND=rented`, as a stable env the control plane reads (mirror how `IDSS_CLAIM_SECRET` is threaded). - `brokerclient.Client.RenewGateway(ctx, host, secret)` — unchanged; it already posts `{host}` with the secret as bearer. `ErrGatewayNotRented` handling (the loud standing condition) stays as-is. **Acceptance criteria:** - [ ] A test founds a **rented + own-domain** community and asserts the control plane wires a lease renewer for it (the named test in the report). - [ ] A **rented + idss.nz-subdomain** community still wires the renewer (regression: unchanged). - [ ] An **own-VPS / self-hosted / private** community wires **no** renewer (unchanged). - [ ] The renewer for an own-domain rented community presents the rental's own secret (not an empty / absent claim secret), so a real renew would authenticate against the broker's `/v1/gateways/renew`. - [ ] The DNS re-point loop still rests for own-domain communities (own-domain DNS stays a manual posture, ADR 0049/0136) — only the lease renew is added. - [ ] `go test` for the touched packages, `go vet`, gofmt clean. **Out of scope:** - The broker's reaper giving a **loud standing condition / warning on the operator app in the hours before a TTL cliff** (so an un-renewed box is not destroyed silently). That is a separate broker-side + operator-app enhancement — file it as a follow-up `enhancement`; this ticket is the renewer wiring that stops the silent reap in the first place. (Note: the heartbeat already raises a standing condition on `ErrGatewayNotRented`; the missing piece is the no-warning-before-TTL cliff, which is broker/design work.) - The **live drive** proving a real own-domain rented founding survives past the TTL — owed as drive proof after the helper-side fix lands (the fix reaches a founder only through a rebuilt app at a feed-named revision, #1769); tracked by the standing drive issue. --- **Ruled by agent under ADR 0174 — veto anytime.** Ruling: `ready-for-agent`. This is a two-way door — additive renewer wiring plus an exported rental secret, revertible per commit, and proven by the seam test named above. It is not on the one-way-door list: no personal credentials (the rental secret already exists and already authenticated the rent), no security-posture widening (the broker already accepts a host-keyed renew), no member-facing trust accept, no data destruction (this *prevents* the reap), no non-routine spend. The reaper-warning half is carved out as a follow-up so it does not block the renewer fix.

swarm-claim host=bens-mac-04 run=63566
(automated multi-host claim — lowest live claim id works this ticket)

swarm-claim host=bens-mac-04 run=63566 (automated multi-host claim — lowest live claim id works this ticket)

⏩ independent reviewer for #2189 — verdict unauthenticated

review JSON
{
  "verdict": "unauthenticated",
  "findings": []
}
:fast_forward: **independent reviewer** for #2189 — verdict `unauthenticated` <details><summary>review JSON</summary> ```json { "verdict": "unauthenticated", "findings": [] } ``` </details>

close-report for #2189 — status success

✅ close-report gates passed — every claim verified against the pushed worker branch sandcastle/worker/20261111-073131-0f4af0 (pre-land — the host promotes it to main only after its post-run verify, #193/#283); issue closed.

envelope
{
  "issue": 2189,
  "status": "success",
  "commits": [
    "4f39d8f7acdb192aec03d7ac8693b5d912e5910e"
  ],
  "changed_files": [
    "STATUS.md",
    "control-plane/cmd/control-plane/lease_renewer_wiring_test.go",
    "control-plane/cmd/control-plane/main.go",
    "docs/GOTCHAS.md",
    "internal/clan/clan.go",
    "internal/clan/vmguest.go",
    "internal/clan/vmguest_test.go",
    "internal/founding/access.go",
    "internal/founding/draft.go",
    "internal/founding/identity_seedleg_test.go",
    "internal/founding/ownvpspath.go",
    "internal/founding/ownvpspath_internal_test.go",
    "internal/founding/rentedleaserenew_test.go",
    "internal/founding/rentedpath.go",
    "internal/founding/selfhostedpath.go",
    "internal/founding/selfhostedpath_internal_test.go",
    "internal/heartbeat/heartbeat.go",
    "internal/heartbeat/lease_renew_loop_test.go"
  ],
  "tests": [
    {
      "command": "go test ./internal/heartbeat/ ./internal/clan/ ./internal/founding/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go vet ./internal/heartbeat/ ./internal/clan/ ./internal/founding/ ./control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "gofmt -l internal/heartbeat/ internal/clan/ internal/founding/ control-plane/cmd/control-plane/",
      "exit_code": 0
    },
    {
      "command": "go build ./...",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A test founds a rented + own-domain community and asserts the control plane wires a lease renewer for it": "founding TestCreateCommunity_RentedOwnDomainPersistsRentalLedgerKey drives Build it for a rented own-domain community and asserts the rental ledger key (rental host + secret) persists on Access; control-plane TestLeaseRenewer_WiresForRentedOwnDomain asserts productionLeaseRenewer wires a renewer for a rented own-domain apex; TestLeaseRenewer_PresentsRentalSecretToBroker drives a Tick against a test broker and asserts it reaches /v1/gateways/renew",
    "A rented + idss.nz-subdomain community still wires the renewer (regression: unchanged)": "control-plane TestLeaseRenewer_WiresForRentedSubdomain asserts productionLeaseRenewer wires for a rented subdomain with apex + IDSS_CLAIM_SECRET fallback",
    "An own-VPS / self-hosted / private community wires no renewer (unchanged)": "control-plane TestLeaseRenewer_RestsForNonRented asserts nil for own-vps/self-hosted/private/empty access kinds",
    "The renewer for an own-domain rented community presents the rental's own secret (not an empty / absent claim secret)": "control-plane TestLeaseRenewer_PresentsRentalSecretToBroker asserts the /v1/gateways/renew call carries host=tech.tuia.co.idss.nz and Authorization: Bearer rental-secret-xyz; founding TestRentedOwnDomain_GatewayFactsAndAnswerCarryRenewCredential asserts rentedLeaseSecretAnswers feeds the rental secret; clan TestGatewayRenders_RentedOwnDomainExportsRentalSecret asserts the render exports IDSS_RENTAL_SECRET + IDSS_RENTAL_HOST",
    "The DNS re-point loop still rests for own-domain communities (only the lease renew is added)": "control-plane TestLeaseRenewer_WiresForRentedOwnDomain asserts productionAddressHeartbeat returns nil for the own-domain apex; existing TestAddressHeartbeat_RestsForOwnDomainApex unchanged; clan test asserts IDSS_CLAIM_SECRET export stays absent for the own-domain rental",
    "go test for the touched packages, go vet, gofmt clean": "all four packages green, go vet clean, gofmt -l empty, go build ./... clean (see tests[])"
  },
  "summary": "Split the rented gateway lease renew out of the address heartbeat into a standalone LeaseRenewLoop keyed on IDSS_ACCESS_KIND=rented, presenting the rental's own ledger key, so a rented own-domain community's lease is renewed and not reaped at the TTL.",
  "blockers": []
}
**close-report** for #2189 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261111-073131-0f4af0` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 2189, "status": "success", "commits": [ "4f39d8f7acdb192aec03d7ac8693b5d912e5910e" ], "changed_files": [ "STATUS.md", "control-plane/cmd/control-plane/lease_renewer_wiring_test.go", "control-plane/cmd/control-plane/main.go", "docs/GOTCHAS.md", "internal/clan/clan.go", "internal/clan/vmguest.go", "internal/clan/vmguest_test.go", "internal/founding/access.go", "internal/founding/draft.go", "internal/founding/identity_seedleg_test.go", "internal/founding/ownvpspath.go", "internal/founding/ownvpspath_internal_test.go", "internal/founding/rentedleaserenew_test.go", "internal/founding/rentedpath.go", "internal/founding/selfhostedpath.go", "internal/founding/selfhostedpath_internal_test.go", "internal/heartbeat/heartbeat.go", "internal/heartbeat/lease_renew_loop_test.go" ], "tests": [ { "command": "go test ./internal/heartbeat/ ./internal/clan/ ./internal/founding/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go vet ./internal/heartbeat/ ./internal/clan/ ./internal/founding/ ./control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "gofmt -l internal/heartbeat/ internal/clan/ internal/founding/ control-plane/cmd/control-plane/", "exit_code": 0 }, { "command": "go build ./...", "exit_code": 0 } ], "criteria": { "A test founds a rented + own-domain community and asserts the control plane wires a lease renewer for it": "founding TestCreateCommunity_RentedOwnDomainPersistsRentalLedgerKey drives Build it for a rented own-domain community and asserts the rental ledger key (rental host + secret) persists on Access; control-plane TestLeaseRenewer_WiresForRentedOwnDomain asserts productionLeaseRenewer wires a renewer for a rented own-domain apex; TestLeaseRenewer_PresentsRentalSecretToBroker drives a Tick against a test broker and asserts it reaches /v1/gateways/renew", "A rented + idss.nz-subdomain community still wires the renewer (regression: unchanged)": "control-plane TestLeaseRenewer_WiresForRentedSubdomain asserts productionLeaseRenewer wires for a rented subdomain with apex + IDSS_CLAIM_SECRET fallback", "An own-VPS / self-hosted / private community wires no renewer (unchanged)": "control-plane TestLeaseRenewer_RestsForNonRented asserts nil for own-vps/self-hosted/private/empty access kinds", "The renewer for an own-domain rented community presents the rental's own secret (not an empty / absent claim secret)": "control-plane TestLeaseRenewer_PresentsRentalSecretToBroker asserts the /v1/gateways/renew call carries host=tech.tuia.co.idss.nz and Authorization: Bearer rental-secret-xyz; founding TestRentedOwnDomain_GatewayFactsAndAnswerCarryRenewCredential asserts rentedLeaseSecretAnswers feeds the rental secret; clan TestGatewayRenders_RentedOwnDomainExportsRentalSecret asserts the render exports IDSS_RENTAL_SECRET + IDSS_RENTAL_HOST", "The DNS re-point loop still rests for own-domain communities (only the lease renew is added)": "control-plane TestLeaseRenewer_WiresForRentedOwnDomain asserts productionAddressHeartbeat returns nil for the own-domain apex; existing TestAddressHeartbeat_RestsForOwnDomainApex unchanged; clan test asserts IDSS_CLAIM_SECRET export stays absent for the own-domain rental", "go test for the touched packages, go vet, gofmt clean": "all four packages green, go vet clean, gofmt -l empty, go build ./... clean (see tests[])" }, "summary": "Split the rented gateway lease renew out of the address heartbeat into a standalone LeaseRenewLoop keyed on IDSS_ACCESS_KIND=rented, presenting the rental's own ledger key, so a rented own-domain community's lease is renewed and not reaped at the TTL.", "blockers": [] } ``` </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#2189
No description provided.