Repository navigation
Orphan / zombie reaper (#23) - #31
Merged
Merged
Conversation
A lifecycle safety-net for the #19 failure mode: an instance whose spored died or never installed runs past its TTL and bills forever. findOrphans (core/ orphans.ts) flags managed, live instances past their TTL deadline + a 10-min grace (reusing the now-exported ttlDeadline from lifecycle.ts). - SpawnClient.findOrphans() / reapOrphans() — detection + confirmed terminate. - CLI `orphans [--reap] [-y]` (list, then optionally terminate). - Dashboard warning banner with a one-click reap (confirmed). - Pure detection is provider-agnostic + 100% covered; client/CLI/dashboard tests use a shared-provider future-clock trick to stage a past-TTL instance. 212 tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A lifecycle safety-net for the exact failure mode #19 exposed: if spored dies or never installs, an instance runs past its TTL and bills indefinitely — nothing catches it. Closes #23.
src/core/orphans.ts—findOrphans(instances, now, grace?): managed + live (running/pending) + past its effective TTL deadline by a 10-min grace (spored's poll + shutdown lag is normal; a truly stuck box isn't). Reuses the now-exportedttlDeadlinefromlifecycle.ts. Instances with no TTL are never orphans.SpawnClient.findOrphans()/reapOrphans()— detection over the last-known list; reap terminates (caller confirms first).orphans [--reap] [-y]— lists overdue instances;--reapterminates (with confirm unless-y).Pure detection is provider-agnostic and 100% covered; client/CLI/dashboard tests stage a past-TTL instance via a shared-provider future-clock client (models spored having failed). 212 tests, build green.