Add instance expiration controls - #434
Conversation
-->
✱ stlc build✅ go code · compare
✅ python code · compare
✅ typescript code · compare
Diagnostics: ❗ 0 new / 1 total error, 💡 0 new / 5 total note
Build metadata
This comment is auto-generated by stlc and is kept up to date as you push. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 843a3cd. Configure here.
843a3cd to
469a295
Compare
469a295 to
0336f8b
Compare
|
reviewed — one correctness issue and three follow-ups worth addressing. Bugs
Structural / Maintainability
Questions
|

Summary
ttlor absoluteexpires_atwhen creating or updating an instancettl: "0s"to disable expirationexpires_atdeadline, returningnullwhen disabled409 instance_expiredonce the current deadline has passed and404if deletion already completedInstances without an expiration are unchanged. The reaper uses the normal instance deletion path.
Testing
go test ./... -run '^$'make oapi-generate(verified deterministic output)The complete API suite was also attempted, but environment-dependent tests require
mkfs.erofsand network bridge permissions unavailable locally. The targeted tests and repository-wide compile pass.Note
Medium Risk
Adds automatic instance deletion and new create/update API fields, including lock races between the reaper and lifecycle operations. Incorrect expiration handling could delete live workloads.
Overview
Adds optional instance expiration: create and update accept mutually exclusive
ttl(Go duration) orexpires_at. Responses always include canonicalexpires_at(nullwhen disabled). Update TTLs are relative to commit time;ttl: "0s"clears expiration.A host TTL reaper sweeps about once a minute and deletes expired instances through the normal delete path. It uses per-instance locks so in-flight create/update wins over a stale reap, times out slow deletes, and records
hypeman_instances_ttl_reaper_deletions_total. Past-deadline updates return409 instance_expired; already-reaped instances return404.Forks and snapshot records drop expiration; restoring a snapshot keeps the current instance deadline.
Reviewed by Cursor Bugbot for commit 0336f8b. Bugbot is set up for automated code reviews on this repo. Configure here.