Skip to content

feat: verify spored came up on launch; fail if it didn't (#50) - #251

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/50-verify-spored-on-launch
Jun 25, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/50-verify-spored-on-launch

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Summary

Closes #50. spored installs asynchronously via cloud-init, so a failed install (bad download, checksum/arch mismatch, network) left a "running" instance with no lifecycle agent — no TTL enforcement, no idle stop, no completion handling. That's a cost-control hole: a spored-less instance has no TTL safety net (the #47 zombie class), and spawn launch reported success.

Change

When launch waits for readiness (--wait-for-ssh, the default), it now verifies spored status responds over SSM and fails loudly if spored never came up:

  • verifySporedReady polls spored status over SSM (works for both keyed and keyless instances) to a 3-minute deadline.
  • --require-spored (default true): the check; disable with --require-spored=false.
  • --terminate-on-error (default false): auto-terminate the agentless instance instead of leaving it for inspection.
  • On failure the error names the instance and the exact spawn connect / spawn terminate commands.
  • Linux only (Windows readiness uses password-data, a separate path).

Verification

make check green; Tier 0 coverage gate green (rebuilt bin/spawn). The happy path is exercised by the existing live e2e launches; the failure path is a bounded SSM poll that returns an error → the launch returns non-zero (the #16 wiring, verified this session).

Part of the pre-epic batch; releases together with #222/#214/#246/#79/#247/#248.

spored installs asynchronously via cloud-init, so a failed install (bad
download, checksum/arch mismatch, network) left a "running" instance with NO
lifecycle agent — no TTL enforcement, no idle stop, no completion handling. That
is a cost-control hole: a spored-less instance has no TTL safety net (the #47
zombie class).

When launch waits for readiness (--wait-for-ssh, the default), it now verifies
`spored status` responds over SSM (verifySporedReady, polled to a 3m deadline;
SSM works for keyed and keyless instances) and fails loudly if spored never came
up, pointing the user to inspect (spawn connect) or terminate it.

- --require-spored (default true): the check; disable with --require-spored=false.
- --terminate-on-error (default false): auto-terminate the agentless instance
  instead of leaving it running for inspection.
- Linux only (Windows readiness is password-data based, separate path).

Closes #50.
@codecov

codecov Bot commented Jun 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 5.12821% with 37 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
cmd/launch.go 5.12% 37 Missing ⚠️

📢 Thoughts on this report? Let us know!

@scttfrdmn
scttfrdmn merged commit f9c7ed5 into main Jun 25, 2026
6 of 7 checks passed
@scttfrdmn
scttfrdmn deleted the feat/50-verify-spored-on-launch branch June 25, 2026 16:48
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.

launch should fail if spored fails to install on the instance

1 participant