Skip to content

Lifecycle-hook tag emit + --on-idle (#25) - #34

Merged
scttfrdmn merged 1 commit into
mainfrom
feat/lifecycle-tag-emit
Jul 21, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
feat/lifecycle-tag-emit

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Emits the spawn:* tags for several daemon-enforced lifecycle features, so an instance spawn-ts launches is honored by a real spored — spawn-ts (a browser launcher, no on-instance daemon) writes the tags but can't run the behavior itself. The honest tag-emit half; docs say so plainly. Closes #25.

  • LifecycleHooks on LaunchSpec/LaunchInput: preStop(+timeout), spotWebhookUrl/webhookCorrelation/webhookTimeout, notifyUrl/notifyPlatform/notifyCommand, activeProcesses.
  • buildHookTags/decodeHookTags — wire-identical to pkg/aws/tags.go; decoded onto ManagedInstance.hooks in both providers; shown in spawn status.
  • CLI launch flags (--pre-stop, --pre-stop-timeout, --spot-webhook-url, --webhook-correlation, --notify-url, --notify-platform, --active-processes); the dashboard launch form exposes pre-stop + notify.
  • --on-idle stop|hibernate — the modern spelling of --hibernate-on-idle (rejects terminate → points at --on-complete); both map to the same spawn:hibernate-on-idle tag.

Changed

  • spawn:hibernate-on-idle is now emitted only when true (matches the Go tool — absent means the default idle action, stop). Decode unchanged; no test asserted the old "false".

Note on scope: I confirmed against the Go source that there is no spawn:on-idle wire tag — --on-idle is a CLI flag that resolves into the existing hibernate-on-idle tag. So this adopts the flag ergonomics without inventing a tag spored doesn't read (the roadmap's "adopt spawn:on-idle" was based on the flag deprecation).

243 tests (tags.ts 100%), typecheck + build green.

Emit the spawn:* tags for daemon-enforced lifecycle hooks so an instance
spawn-ts launches is honored by a real spored — spawn-ts (browser launcher, no
daemon) writes the tags but can't run the behavior itself.

- types: LifecycleHooks on LaunchSpec/LaunchInput (pre-stop[+timeout],
  spot-webhook-url/correlation/timeout, notify-url/platform/command,
  active-processes). tags.ts: buildHookTags/decodeHookTags (wire-identical to
  pkg/aws/tags.go); decoded onto ManagedInstance.hooks in both providers.
- CLI: --pre-stop/--pre-stop-timeout/--spot-webhook-url/--webhook-correlation/
  --notify-url/--notify-platform/--active-processes; status shows them. Dashboard
  launch form exposes pre-stop + notify.
- --on-idle stop|hibernate: modern spelling of --hibernate-on-idle (rejects
  'terminate' → --on-complete); both set spawn:hibernate-on-idle.
- Align spawn:hibernate-on-idle to the Go tool: emit only when true (absent =
  default stop). Decode unchanged.

Tag-emit only — execution is spored's on the instance; docs say so. 243 tests,
tags.ts 100%.
@scttfrdmn
scttfrdmn merged commit ca566f8 into main Jul 21, 2026
1 check passed
@scttfrdmn
scttfrdmn deleted the feat/lifecycle-tag-emit branch July 21, 2026 20:55
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.

Lifecycle-tag emit: pre-stop, spot-webhook, notify, active-processes, on-idle

1 participant