Rented idss-rental gateway droplets carry NO expiry tag — the droplet class the drive actually rents today has no sweep of any kind #741
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#741
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The
clan-labfleet has a TTL contract (clan-lab-expires-<epoch>+clan-lab reap), and as of #723 that contract is actually enforced again. The rented gateway fleet has no such contract at all.broker/internal/broker/rentals.go:39:That is the whole tag set. No expiry, no TTL, nothing time-based. And
clan-lab reapis structurally unable to help: it resolves targets only amongclan-lab-tagged droplets — the guardrail that keeps it away frommatou-prodalso keeps it away from these.So the only thing that ever destroys a rented gateway is the drive's own teardown (
oc_droplet_cleanup/ the broker's release). That teardown is well-built — an EXIT trap, at-most-once, fires on every red path (#393) — but it is exactly the same shape as the clan-lab teardown that #393 and #723 both watched fail: a process that dies hard enough, or a host that reboots mid-drive, leaves as-2vcpu-4gbbilling with nobody counting.This matters more than the clan-lab case did, because the rented path is what the rehearsal drive uses now. The clan-lab droplet #723 found had been superseded; a leaked
idss-gateway-*would be from a live workflow.Not doing this under #723: that ticket was scoped to the
clan-lab-expires-tag and its (broken) enforcer, and a rental TTL is a broker-side design question, not a cron fix.What needs deciding
idss-rental-expires-<epoch>tag stamped atRent(mirrors clan-lab, sweepable by anything with the token), vs. broker-side state with its own reaper. The tag is cheaper and needs no broker uptime to be enforceable.extendneeds a caller.scripts/clan-lab-reap.sh(which already resolves doctl and the token from a bare cron, and pages on failure) to a second tag family is the small move; abrokerendpoint is the larger one.idss-gateway-<slug>-<rand4>,provider_do.go:66) — #— a stale key per drive was already a bug once.Note for whoever takes it: check the reaper's log for a success, not for the absence of errors. That is the #723 lesson (GOTCHAS #74) and it applies to whatever gets built here.
Ruled by agent under ADR 0174 — veto anytime
All four open questions decided, built, and proven. The decisive fact was not in the ticket, and it changes the answer to question 2:
A rented gateway renews its OWN lease. The control-plane runs on the rented box and calls
POST /v1/gateways/renewon every healthy heartbeat pass (productionAddressHeartbeat, control-plane/cmd/control-plane/main.go; ADR 0189/0136). So the lease clock — ledger or tag, it makes no difference — measures abandonment (nobody is heartbeating), never "this box outlived the thing that rented it". A leaked box that comes up healthy pushes its own deadline forward forever, andRentals.Reapwill never see it lapse. Any design that stamps the lease and stops there would have shipped a sweep that cannot catch the leak it was written for.1. Where the clock lives — the tag, and a second clock the box cannot move
idss-rental-expires-<epoch>, stamped by the broker atRentand re-stamped atRenew(Provider.Retag, DO binding = create-tag → APPLY → untag, in that order so a rental is never momentarily unclocked). Account-side, enforceable by anything holding the token, no broker uptime and no ledger read — exactly the ticket's reasoning, and it mirrorsclan-lab-expires-.One invariant makes it safe: the tag may run ahead of the ledger, never behind. Behind is the one divergence in which a sweep destroys a lease the broker still calls live. So
Renewmoves the tag before the ledger and refuses the renew when the provider will not move it, rather than extending a lease whose machine still wears the old deadline. A sweep meeting two expiry tags (a removal that failed) takes the latest.Because of the self-renewal finding, the tag alone is not enough: the sweep also enforces a drive wall — an age no heartbeat can push.
2. What TTL is honest — 24h lease unchanged; an 8h WALL on drive boxes only
The lease TTL stays 24h (ADR 0189 ruling 1, and its promise to a real community — "your heartbeat keeps it renewed" — is untouched). The wall applies only to
idss-gateway-rehearsal-*: 8h is longer than any drive has legitimately taken (the lab fleet's own rehearsal TTL is 6h; #713 measured a single activate at 45m) and short enough that a leak costs hours, not days.extendneeds no caller. The hatch is a tag:idss-rental-holdkeeps a box whatever both clocks say — theREHEARSAL_KEEP_RED_DROPLETcase (#412/#704), where the sweeper must not be the thing that eats an investigation.3. Who sweeps —
scripts/rental-reap.sh, hourly, not the clan-lab CLINot an extension of
clan-lab reap: that CLI lives under.claude/, which an unattended session cannot write (#740's residue), and conflating two fleets' policies in one entrypoint is how one fleet's guardrail becomes the other's bug. What IS shared is the part that must not be re-learned: #723's environment contract is extracted toscripts/lib/reap-env.sh(doctl resolution from a cron PATH, derived+exportedHOME, host-only token file, loud CANNOT-REAP page). Both reapers source it;clan-lab-reap-test.shgrows a case for the production shape after the extraction and is 6/6.What the sweep may destroy is deliberately narrower than what it can see. Only drive boxes. A rental named anything else is a real community's gateway: it is reported and paged for a human ruling, never deleted. Destroying a member-facing machine is on ADR 0174's one-way-door list and is not a cron job's to open — so a broker endpoint that could reap any rental was rejected too.
4. The per-rental SSH keys — yes, and they were already leaking again
Both halves: a swept box's own key dies with it (matching
Destroy's #708 behaviour, including the legacy doubledidss-gateway-idss-gateway-…name), and orphanedidss-gateway-*keys are swept on their own. Never on first sighting — a key registered seconds ago for a droplet still mid-create is indistinguishable from an orphan, and deleting it fails a rent in flight; two passes an hour apart, or nothing. Orphanedidss-rental-expires-*tag objects go the same way, read the GOTCHAS #75 way (a count that does not render deletes nothing).Why this is a two-way door
A commit, a tag family, and a cron line — all revertible; the sweep is
--dry-run-able and its default posture is to report rather than destroy. The one irreversible act was destroying the leaked box the ticket predicted (details in the close report): a rehearsal drive machine with no member data, no certificate and no live drive, which nothing on the account would ever have freed. No spend, no posture change, no credential.The ticket's note, honoured
The sweep prints
SWEEP OK: destroyed=… kept=… flagged=… keys=… tags=…on every run, including an empty account, and the installed cron line was run in a bareenv -i PATH=/usr/bin:/binshell — both with and without the host env files sourced — and its log read back for that line.idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745Close report — the rented fleet has a clock and a sweep, and the leak this ticket predicted was on the account while it was being written
Landed:
2af75c50onmain(CI green for this sha:seam✅,publish✅,publish-broker✅).The leak, found live
idss-gateway-rehearsal-c-8bc1—s-2vcpu-4gb, syd1, tagsidss-gateway,idss-rental, no expiry tag of any kind — rented2026-08-24T01:34:24Z, stillactiveand billing at 07:35Z. No drive running anywhere on the host (the executor has been parked on "#721 blocked by 1 open issue"), no run dir left on disk. On the box:caddyactive,control-planeandidss-agentinactive, and/var/lib/caddy/.local/share/caddy/acme/*/sites/empty — it never obtained a certificate. A drive that died mid-deploy, six hours of an idle machine, nothing counting. (This is the same droplet #723's session saw two hours earlier and correctly left alone as "the in-flight rental" —clan-lab reapcannot touch it by design.)Nothing on the account would have freed it, and had its control-plane come up healthy, nothing ever would have — see the ruling comment: the box renews its own lease.
What landed
broker/…/rentals.go,provider.go,provider_do.goidss-rental-expires-<epoch>stamped atRent, re-stamped atRenewvia the newProvider.Retag(create-tag → APPLY → untag).Renewmoves the tag before the ledger and refuses the renew if it cannot — the tag may run ahead of the ledger, never behind.scripts/rental-reap.shidss-rental-expires-*tag objects. Destroys onlyidss-gateway-rehearsal-*; any other rental is reported and paged.idss-rental-holdkeeps a box.--dry-run.scripts/lib/reap-env.shHOME, host-only token file, loudCANNOT REAP+ page.docs/GOTCHAS.mddocs/adr/0189-…broker/README.md,STATUS.mdProof
Offline, red before green.
scripts/tests/rental-reap-test.sh13/13, driven the way cron actually calls it — barePATH=/usr/bin:/bin, a stubdoctlreachable only through the dirs the script resolves for itself, no token exported, plus an up-front assertion that no real doctl is on that PATH so the suite cannot pass vacuously. Cases: both clocks; the wall firing and not firing; a community gateway refused destruction; the two-expiry-tag renew race in both tag orders (aset -edeath mid-loop would end a sweep silently); the two-pass orphan-key rule; a<nil>tag count deleting nothing;--dry-run;CANNOT REAPloudness.clan-lab-reap-test.sh6/6 after the extraction, with a new case for the shape the hourly cron line actually runs (the legacyCLAN_LAB_*overrides absent — every prior case set them). Broker: 4 rental-clock tests + 3 DO retag tests;gofmt/go vet/go test ./...clean.Live, through the shipped script so the fix is its own proof:
(run with an explicit
RENTAL_DRIVE_WALL_HOURS=4for a drive that was hours over; the default 8h wall would have taken it at 09:34Z unattended.)Then the second pass reaped six orphaned per-rental SSH keys —
idss-gateway-idss-gateway-rehearsal-rentfail-<ts>-…, one per overnightrent-fails-cleanleg — none deleted on first sighting. The account now holds zeroidss-rentaldroplets and zero orphanedidss-gateway-*keys.The cron line, proven the #723 way — for a SUCCESS, not for the absence of errors. Installed on matou-dev-server-01 (
47 * * * *, product-owned, beside the:17clan-lab line; crontab backed up tocron-backups/crontab-20260824T074312Z-pre-741.bak) and run verbatim underenv -i PATH=/usr/bin:/bin:…and again with no env files sourced at all, resolving doctl and the token entirely on its own — belt removed, braces held.
What is NOT live, and why that is filed rather than fudged
The broker half is merged and unit-proven but not installed:
broker-deploy'sdeployjob has run exactly once in the last 11,639 action tasks, whilepublish-brokersucceeded again for this very sha minutes ago. The live broker is measurably older than #708 — it minted six doubled-prefix SSH keys between 17:07 and 01:33, all after that fix landed at 16:49Z, and only pre-fix code writes that name. Root cause is already filed and alreadyready-for-human: #690 (deploy user + sudoers +BROKER_DEPLOY_SSH_KEY). GOTCHAS #59 warned about exactly this; the rail is publishing into a void.So the loop-closer is #745 (
ready-for-session, blocked by #690): verify the tag on a live rental once the broker actually deploys. Until then the drive wall carries the whole fleet — it needs no tag, no ledger and no broker, and it is the only clock that catches a leaked box that is still healthy. Billing safety does not wait on #690; only precision does.Closing: every question in this ticket is decided, built, offline-proven, and live-proven on the account, and the one piece that cannot be finished here is tracked where a session can finish it.
idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745seamis cancelled — the newest published broker binary is b9a3adfd (2026-08-24), two broker commits behind main #864idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745idss-broker-installis a hand-placed copy that nothing re-places or checks #872idss-broker-installis a hand-placed copy that nothing re-places or checks #872idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745idss-rental-expires-tag on a LIVE rental once the broker actually deploys (#741's broker half is merged but not installed) #745rehearsal-e.idss.nzreds "already taken" — the single-sourcedREHEARSAL_SLUGis permanently held by the device target's LIVE standing community #1401