Skip to content

Orphan / zombie reaper (spawn orphans + cleanup) #23

Closed

Description

@scttfrdmn

A lifecycle safety-net spawn-ts lacks: find spawn:managed=true instances that are past their spawn:ttl-deadline but still running — the exact failure mode from #19 (spored died or never installed, so the instance never self-terminated) — and offer to reap them.

Go source

  • cmd/orphans.go, cmd/cleanup.go, zombie_guard.go.

Browser feasibility

Browser-native — pure tag-scan + terminate over EC2Provider. Reuse decodeConfigTags (src/core/tags.ts) and the pure evaluate/ttlDeadline logic in src/core/lifecycle.ts to decide "should be dead."

Acceptance

  • SpawnClient.findOrphans(nowMs) → managed instances whose TTL deadline has passed while still running/pending.
  • A reap path terminates them, guarded by the existing confirm mechanism.
  • CLI orphans command (list; --reap/-y to terminate) in src/cli/commands.ts.
  • Dashboard surfaces an orphan warning banner with a reap action.
  • Tests over MockProvider: a past-deadline running instance is flagged; a within-deadline one isn't; reap terminates.

Size: small-medium.

Activity

  1. added
    area: core
    cost-safety
    on Jul 21, 2026
  2. added a commit that references this issue on Jul 21, 2026
  3. added a commit that references this issue on Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: corecost-safety

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions