founding (rented, own domain): choosing Access again drops the broker claim recorded for the rental, so the retry is refused with "name already taken" for 24 h #2200

Closed
opened 2026-11-18 05:45:03 +00:00 by ben · 4 comments
Owner

What happened

TuIA re-founding (own domain tech.tuia.co, rented Access), app 2026.11.3458 at b2d4ffed, 2026-11-18.

  1. First rent, 04:06 UTC. Build claimed the community slug tu-ia at the broker as the rental's ledger key, recorded it on Access (RentalHost / RentalSecret, the #2189 fix), then failed at provision. That failure was the DigitalOcean size withdrawal, fixed by #2198 / GOTCHAS #420.
  2. The operator went back to Access to pick up the new offer (the new region and size choice), then retried.
  3. The retry refused the build: claim — That community name is already taken, so it couldn't be claimed — pick a different name. that name is already taken.

The draft had no rental_host or rental_secret left on draft.access. The broker's reservations.json still held tu-ia, claimed at 04:06 and never used, under a secret the app had lost. The name was wedged for the full unredeemed TTL (24 h). It was cleared by hand: the reservation was deleted from the broker ledger, backed up at reservations.json.bak-20261118-tu-ia.

Why

internal/founding/access.go, the rent step:

  • It reuses a prior claim only via d.Access.RentalHost / d.Access.RentalSecret (the "Resume" branch).
  • Choosing Access again replaces d.Access with a fresh choice, so the recorded claim is dropped.
  • The next build calls ClaimSubdomain(d.Details.Slug) again, and the broker answers "taken". From the broker's side that's correct: an unredeemed claim inside its TTL with a different caller.

This affects every own-domain rented founding that steps back to Access after a failed rent. A subdomain Address is probably not affected, because its claim lives on d.Address, but that's worth checking.

Fix (proposed)

When Access is set again on a draft that has an unredeemed rental claim:

  • Carry RentalHost / RentalSecret over to the new Access choice whenever the community slug is unchanged. This is the simplest fix; or
  • Release the claim at the broker before dropping it, if a release door for unredeemed reservations exists.

Then the retry takes the Resume branch. Seam: an orchestrator test where the first rent fails at provision, Access is set again with a different region or preset, and the retry rents under the same host and secret with no second ClaimSubdomain.

Related: #2189, GOTCHAS #230, #318, #420; internal/founding/access.go (rent step, rentClaim, nameTakenError).

## What happened TuIA re-founding (own domain `tech.tuia.co`, rented Access), app 2026.11.3458 at b2d4ffed, 2026-11-18. 1. **First rent, 04:06 UTC.** Build claimed the community slug `tu-ia` at the broker as the rental's ledger key, recorded it on Access (`RentalHost` / `RentalSecret`, the #2189 fix), then failed at provision. That failure was the DigitalOcean size withdrawal, fixed by #2198 / GOTCHAS #420. 2. **The operator went back to Access** to pick up the new offer (the new region and size choice), then retried. 3. **The retry refused the build:** `claim — That community name is already taken, so it couldn't be claimed — pick a different name. that name is already taken`. The draft had no `rental_host` or `rental_secret` left on `draft.access`. The broker's `reservations.json` still held `tu-ia`, claimed at 04:06 and never used, under a secret the app had lost. The name was wedged for the full unredeemed TTL (24 h). It was cleared by hand: the reservation was deleted from the broker ledger, backed up at `reservations.json.bak-20261118-tu-ia`. ## Why `internal/founding/access.go`, the rent step: - It reuses a prior claim only via `d.Access.RentalHost` / `d.Access.RentalSecret` (the "Resume" branch). - Choosing Access again replaces `d.Access` with a fresh choice, so the recorded claim is dropped. - The next build calls `ClaimSubdomain(d.Details.Slug)` again, and the broker answers "taken". From the broker's side that's correct: an unredeemed claim inside its TTL with a different caller. This affects every own-domain rented founding that steps back to Access after a failed rent. A subdomain Address is probably not affected, because its claim lives on `d.Address`, but that's worth checking. ## Fix (proposed) When Access is set again on a draft that has an unredeemed rental claim: - **Carry `RentalHost` / `RentalSecret` over** to the new Access choice whenever the community slug is unchanged. This is the simplest fix; or - **Release the claim at the broker** before dropping it, if a release door for unredeemed reservations exists. Then the retry takes the Resume branch. Seam: an orchestrator test where the first rent fails at provision, Access is set again with a different region or preset, and the retry rents under the same host and secret with no second `ClaimSubdomain`. Related: #2189, GOTCHAS #230, #318, #420; `internal/founding/access.go` (rent step, `rentClaim`, `nameTakenError`).

This was generated by AI during triage.

Triage: bug → ready-for-agent

Verified in code. Reproduced the root cause by reading internal/founding:

  • The rent step takes a Resume branch only when d.Access.RentalHost != "", reusing d.Access.RentalHost / d.Access.RentalSecret instead of re-claiming the slug (the #2189 fix).
  • RentServer (the "choose Access again" path) assigns a fresh AccessChoice to d.Access with no carry-over of RentalHost / RentalSecret. So stepping back to Access after a failed rent drops the recorded claim, and the next build calls ClaimSubdomain(d.Details.Slug) again → the broker returns "taken" (by us, inside the unredeemed TTL) → nameTakenError. Confirmed exactly as reported.
  • The subdomain-Address case is not affected: rentClaim reads the claim from d.Address (Host/Secret), and RentServer only replaces d.Access and advances to the Address step — it never touches d.Address. So a subdomain Address's claim survives re-choosing Access. The bug is specific to own-domain rented foundings whose rental ledger key lives on d.Access.RentalHost.

No existing implementation of carry-over/release was found; not already fixed. No matching .out-of-scope/ entry.

Ruled by agent under ADR 0174 — veto anytime

The ticket proposes two fixes (carry the claim over vs. release it at the broker). Picking between them is a two-way door: revertible by a later commit and provable by the orchestrator seam test the ticket already specifies; it is not on the one-way-door list (no personal credentials, security widening, member-facing trust accept, data destruction, or non-routine spend).

Ruling: take fix (1) — carry RentalHost / RentalSecret over to the new Access choice whenever the community slug is unchanged. It is the local, self-contained change; it needs no new broker release door; and it keeps the existing Resume branch as the single reuse path. Fix (2) (release at the broker) is left for a later ticket if an unredeemed-reservation release door is ever added — not required here. What proves it: the orchestrator seam test below.

Agent Brief

Category: bug
Summary: Re-choosing Access on a rented, own-domain founding drops the unredeemed broker claim recorded on the draft, so the retry is refused "name already taken" for the full 24 h TTL.

Current behavior:
A rented founding with an own-domain Address records the rental's broker ledger key (the community slug claimed at the broker) onto the Access choice (RentalHost / RentalSecret, #2189). If the first rent fails after that claim (e.g. provision fails), and the operator steps back to the Access step and picks a new region/size, the Access choice is replaced wholesale and the recorded claim is lost. The next build re-claims the same slug at the broker, which refuses it as already-claimed (by this same app, inside its unredeemed TTL), surfacing a plain-language "that community name is already taken" error that persists for ~24 h until the reservation expires or is cleared by hand.

Desired behavior:
When the Access step is set again on a draft that already carries an unredeemed rental claim, and the community slug is unchanged, the new Access choice must retain the existing RentalHost / RentalSecret. The subsequent build then takes the existing Resume branch and rents under the same host + secret, with no second ClaimSubdomain call. A genuinely different community slug (if that is even reachable at this step) must not reuse a stale claim.

Key interfaces:

  • The orchestrator operation that records a rented Access choice (records size/region, provisions nothing) — it currently constructs a fresh rented AccessChoice. It must carry the prior choice's RentalHost / RentalSecret onto the new one when the draft's community slug is unchanged.
  • The provision/rent step's existing Resume branch (reuse RentalHost / RentalSecret rather than re-claim) is the behavior to preserve and now reach on this path; do not add a second reuse path.
  • rentClaim / the subdomain-Address path is already correct (claim lives on the Address) and must stay unchanged.

Acceptance criteria:

  • A new orchestrator seam test: first rent of an own-domain rented founding claims the slug at the broker and records RentalHost/RentalSecret, then fails at provision; Access is set again with a different region or preset; the retry rents under the same host + secret and makes no second ClaimSubdomain call (assert on the fake broker's claim count).
  • After the fix, the retry does not return the "name already taken" (nameTakenError) refusal on this path.
  • Re-choosing Access still updates the region/size the operator picked (the carry-over must not clobber the new size/region order).
  • A subdomain-Address rented founding is unaffected — its claim continues to live on the Address and survives re-choosing Access (add or extend a test asserting this if not already covered).
  • go test ./internal/founding/... passes.

Out of scope:

  • Adding a broker-side release door for unredeemed reservations (fix option 2) — not taken here.
  • Any change to the broker's reservation TTL or the manual reservations.json cleanup.
  • The DigitalOcean size-withdrawal provision failure that triggered the first rent failure (already fixed, #2198 / GOTCHAS #420).

Related: #2189, GOTCHAS #230, #318, #420.

> *This was generated by AI during triage.* ## Triage: bug → ready-for-agent **Verified in code.** Reproduced the root cause by reading `internal/founding`: - The rent step takes a **Resume** branch only when `d.Access.RentalHost != ""`, reusing `d.Access.RentalHost` / `d.Access.RentalSecret` instead of re-claiming the slug (the #2189 fix). - `RentServer` (the "choose Access again" path) assigns a **fresh** `AccessChoice` to `d.Access` with no carry-over of `RentalHost` / `RentalSecret`. So stepping back to Access after a failed rent drops the recorded claim, and the next build calls `ClaimSubdomain(d.Details.Slug)` again → the broker returns "taken" (by us, inside the unredeemed TTL) → `nameTakenError`. Confirmed exactly as reported. - The subdomain-Address case is **not** affected: `rentClaim` reads the claim from `d.Address` (Host/Secret), and `RentServer` only replaces `d.Access` and advances to the Address step — it never touches `d.Address`. So a subdomain Address's claim survives re-choosing Access. The bug is specific to own-domain rented foundings whose rental ledger key lives on `d.Access.RentalHost`. No existing implementation of carry-over/release was found; not already fixed. No matching `.out-of-scope/` entry. ## Ruled by agent under ADR 0174 — veto anytime The ticket proposes two fixes (carry the claim over vs. release it at the broker). Picking between them is a **two-way door**: revertible by a later commit and provable by the orchestrator seam test the ticket already specifies; it is not on the one-way-door list (no personal credentials, security widening, member-facing trust accept, data destruction, or non-routine spend). **Ruling:** take fix (1) — **carry `RentalHost` / `RentalSecret` over** to the new Access choice whenever the community slug is unchanged. It is the local, self-contained change; it needs no new broker release door; and it keeps the existing Resume branch as the single reuse path. Fix (2) (release at the broker) is left for a later ticket if an unredeemed-reservation release door is ever added — not required here. **What proves it:** the orchestrator seam test below. ## Agent Brief **Category:** bug **Summary:** Re-choosing Access on a rented, own-domain founding drops the unredeemed broker claim recorded on the draft, so the retry is refused "name already taken" for the full 24 h TTL. **Current behavior:** A rented founding with an own-domain Address records the rental's broker ledger key (the community slug claimed at the broker) onto the Access choice (`RentalHost` / `RentalSecret`, #2189). If the first rent fails after that claim (e.g. provision fails), and the operator steps **back to the Access step** and picks a new region/size, the Access choice is replaced wholesale and the recorded claim is lost. The next build re-claims the same slug at the broker, which refuses it as already-claimed (by this same app, inside its unredeemed TTL), surfacing a plain-language "that community name is already taken" error that persists for ~24 h until the reservation expires or is cleared by hand. **Desired behavior:** When the Access step is set again on a draft that already carries an unredeemed rental claim, and the **community slug is unchanged**, the new Access choice must **retain** the existing `RentalHost` / `RentalSecret`. The subsequent build then takes the existing Resume branch and rents under the same host + secret, with **no second `ClaimSubdomain`** call. A genuinely different community slug (if that is even reachable at this step) must not reuse a stale claim. **Key interfaces:** - The orchestrator operation that records a rented Access choice (records size/region, provisions nothing) — it currently constructs a fresh rented `AccessChoice`. It must carry the prior choice's `RentalHost` / `RentalSecret` onto the new one when the draft's community slug is unchanged. - The provision/rent step's existing **Resume** branch (reuse `RentalHost` / `RentalSecret` rather than re-claim) is the behavior to preserve and now reach on this path; do not add a second reuse path. - `rentClaim` / the subdomain-Address path is already correct (claim lives on the Address) and must stay unchanged. **Acceptance criteria:** - [ ] A new orchestrator seam test: first rent of an own-domain rented founding claims the slug at the broker and records `RentalHost`/`RentalSecret`, then fails at provision; Access is set again with a **different region or preset**; the retry rents under the **same** host + secret and makes **no second `ClaimSubdomain` call** (assert on the fake broker's claim count). - [ ] After the fix, the retry does **not** return the "name already taken" (`nameTakenError`) refusal on this path. - [ ] Re-choosing Access still updates the region/size the operator picked (the carry-over must not clobber the new size/region order). - [ ] A subdomain-Address rented founding is unaffected — its claim continues to live on the Address and survives re-choosing Access (add or extend a test asserting this if not already covered). - [ ] `go test ./internal/founding/...` passes. **Out of scope:** - Adding a broker-side release door for unredeemed reservations (fix option 2) — not taken here. - Any change to the broker's reservation TTL or the manual `reservations.json` cleanup. - The DigitalOcean size-withdrawal provision failure that triggered the first rent failure (already fixed, #2198 / GOTCHAS #420). Related: #2189, GOTCHAS #230, #318, #420.

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

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

⏩ independent reviewer for #2200 — verdict unauthenticated

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

close-report for #2200 — status success

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

envelope
{
  "issue": 2200,
  "status": "success",
  "commits": [
    "15054e51ba5edb3d16351d641dd1a86be5d8c73d",
    "a456d16afc9fe3b77933fba342011a2a972ecb21"
  ],
  "changed_files": [
    "STATUS.md",
    "internal/founding/access.go",
    "internal/founding/rentedaccessretry_test.go"
  ],
  "tests": [
    {
      "command": "nix develop .#go-ci -c go test ./internal/founding/...",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c go vet ./internal/founding/",
      "exit_code": 0
    },
    {
      "command": "nix develop .#go-ci -c gofmt -l internal/founding/access.go internal/founding/rentedaccessretry_test.go",
      "exit_code": 0
    }
  ],
  "criteria": {
    "A new orchestrator seam test: first rent claims the slug + records RentalHost/RentalSecret then fails at provision; Access set again with a different region or preset; the retry rents under the same host+secret and makes no second ClaimSubdomain (assert on the fake broker's claim count)": "internal/founding/rentedaccessretry_test.go TestRentServer_CarriesRentalClaimAcrossReChoiceAfterFailedRent — RentServer(syd1,8gb)+SetOwnDomain, first CreateCommunity fails on broker.RentErr with RentalHost recorded and Claimed==1, re-RentServer(sfo2,4gb), retry CreateCommunity asserts Claimed==1 (no second claim) and RentedHosts[0]/RentedSecrets[0] == recorded host+secret",
    "After the fix, the retry does not return the name already taken (nameTakenError) refusal on this path": "same test sets broker.TakenSlugs[te-runanga-o-example]=true before the retry and asserts CreateCommunity returns no error (and specifically not a founding.validation.slugTaken BrokerError)",
    "Re-choosing Access still updates the region/size the operator picked (carry-over must not clobber the new order)": "same test asserts acc.GatewayOrderedPreset==s-2vcpu-4gb && acc.GatewayRegion==sfo2 after the second RentServer, and broker.Rented[0].Preset==s-2vcpu-4gb after the retry",
    "A subdomain-Address rented founding is unaffected — its claim lives on the Address and survives re-choosing Access": "internal/founding/rentedaccessretry_test.go TestRentServer_SubdomainClaimSurvivesReChoiceAfterFailedRent — subdomain claim+secret on d.Address survive a failed rent and a re-chosen Access, retry reuses the claim with Claimed==1; carryRentalClaim in access.go only reads d.Access.RentalHost (empty for subdomain) so rentClaim/d.Address path is untouched",
    "go test ./internal/founding/... passes": "nix develop .#go-ci -c go test ./internal/founding/... → ok (exit 0)"
  },
  "summary": "RentServer carries an unredeemed rental broker claim (RentalHost/RentalSecret) onto a re-chosen Access when the community slug is unchanged, so a retry after a failed rent takes provision's Resume branch instead of being refused name-already-taken.",
  "blockers": []
}
**close-report** for #2200 — status `success` :white_check_mark: **close-report gates passed** — every claim verified against the pushed worker branch `sandcastle/worker/20261118061530-318464` (pre-land — the host promotes it to `main` only after its post-run verify, #193/#283); issue closed. <details><summary>envelope</summary> ```json { "issue": 2200, "status": "success", "commits": [ "15054e51ba5edb3d16351d641dd1a86be5d8c73d", "a456d16afc9fe3b77933fba342011a2a972ecb21" ], "changed_files": [ "STATUS.md", "internal/founding/access.go", "internal/founding/rentedaccessretry_test.go" ], "tests": [ { "command": "nix develop .#go-ci -c go test ./internal/founding/...", "exit_code": 0 }, { "command": "nix develop .#go-ci -c go vet ./internal/founding/", "exit_code": 0 }, { "command": "nix develop .#go-ci -c gofmt -l internal/founding/access.go internal/founding/rentedaccessretry_test.go", "exit_code": 0 } ], "criteria": { "A new orchestrator seam test: first rent claims the slug + records RentalHost/RentalSecret then fails at provision; Access set again with a different region or preset; the retry rents under the same host+secret and makes no second ClaimSubdomain (assert on the fake broker's claim count)": "internal/founding/rentedaccessretry_test.go TestRentServer_CarriesRentalClaimAcrossReChoiceAfterFailedRent — RentServer(syd1,8gb)+SetOwnDomain, first CreateCommunity fails on broker.RentErr with RentalHost recorded and Claimed==1, re-RentServer(sfo2,4gb), retry CreateCommunity asserts Claimed==1 (no second claim) and RentedHosts[0]/RentedSecrets[0] == recorded host+secret", "After the fix, the retry does not return the name already taken (nameTakenError) refusal on this path": "same test sets broker.TakenSlugs[te-runanga-o-example]=true before the retry and asserts CreateCommunity returns no error (and specifically not a founding.validation.slugTaken BrokerError)", "Re-choosing Access still updates the region/size the operator picked (carry-over must not clobber the new order)": "same test asserts acc.GatewayOrderedPreset==s-2vcpu-4gb && acc.GatewayRegion==sfo2 after the second RentServer, and broker.Rented[0].Preset==s-2vcpu-4gb after the retry", "A subdomain-Address rented founding is unaffected — its claim lives on the Address and survives re-choosing Access": "internal/founding/rentedaccessretry_test.go TestRentServer_SubdomainClaimSurvivesReChoiceAfterFailedRent — subdomain claim+secret on d.Address survive a failed rent and a re-chosen Access, retry reuses the claim with Claimed==1; carryRentalClaim in access.go only reads d.Access.RentalHost (empty for subdomain) so rentClaim/d.Address path is untouched", "go test ./internal/founding/... passes": "nix develop .#go-ci -c go test ./internal/founding/... → ok (exit 0)" }, "summary": "RentServer carries an unredeemed rental broker claim (RentalHost/RentalSecret) onto a re-chosen Access when the community slug is unchanged, so a retry after a failed rent takes provision's Resume branch instead of being refused name-already-taken.", "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#2200
No description provided.