Skip to content

feat(status): show a Lifecycle protection summary - #431

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/status-lifecycle-protection
Jul 22, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/status-lifecycle-protection

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Fourth external-review polish ("make protection status more visibly operational"). spawn status on a running managed instance now appends a compact protection summary:

Lifecycle protection:
  In-instance (spored):  enforces TTL + idle rules on the instance itself
  Out-of-band reaper:    backstop in the spore.host-infra account, if deployed for your account
  Termination deadline:  2026-07-22 18:00 PDT (in 2h 55m)
  Max compute cost:      ~$4.82 by deadline (on-demand rate, compute only; idle-stop usually ends it sooner)
  Idle timeout:          30m (stops the instance when idle; never terminates)

Data source (controller-side, from tags): deadline from the launch-anchored spawn:ttl-deadline tag (the same tag the reaper reads), falling back to LaunchTime + TTL for older instances; max compute cost from LookupEC2OnDemandPrice × hours-to-deadline (a ceiling — idle-stop usually ends it sooner; excludes EBS/network, labelled as such).

Honesty about the reaper: it runs in the infra account and is not authoritatively visible from the launch account (matching pkg/doctor ReaperConfigured and docs/safety.md), so it's described as a backstop "if deployed" rather than asserting dual enforcement we can't confirm from here.

Shown for both the SSH and SSM status paths; gated to running/pending managed instances (empty otherwise). Unit-tested: block presence, gating (unmanaged/stopped → nothing), TTL fallback, and deadline resolution. go build/go vet clean.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 76.47059% with 12 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/status.go 76.47% 10 Missing and 2 partials ⚠️

📢 Thoughts on this report? Let us know!

Fourth external-review polish: surface the safety model in the CLI, not just
the docs. `spawn status` on a running managed instance now appends:

  Lifecycle protection:
    In-instance (spored):  enforces TTL + idle rules on the instance itself
    Out-of-band reaper:    backstop in the spore.host-infra account, if deployed
    Termination deadline:  2026-07-22 18:00 PDT (in 2h 55m)
    Max compute cost:      ~$4.82 by deadline (on-demand rate, compute only; ...)
    Idle timeout:          30m (stops the instance when idle; never terminates)

Computed controller-side from tags: deadline from the launch-anchored
spawn:ttl-deadline tag (falls back to launch+TTL), max cost from
LookupEC2OnDemandPrice x hours-to-deadline. Honest about the reaper — it is
NOT authoritatively visible from the launch account (pkg/doctor ReaperConfigured
says the same), so it is described as a backstop 'if deployed' rather than
claiming dual enforcement. Shown for both the SSH and SSM status paths; only for
running/pending managed instances. Unit-tested (block presence, gating,
deadline resolution).
@scttfrdmn
scttfrdmn force-pushed the feat/status-lifecycle-protection branch from fb81969 to 000b160 Compare July 22, 2026 03:06
@scttfrdmn
scttfrdmn merged commit 2e81183 into main Jul 22, 2026
6 checks passed
@scttfrdmn
scttfrdmn deleted the feat/status-lifecycle-protection branch July 22, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant