Skip to content

Guardrail: TTL must always terminate — never add a TTL→stop mode #72

Closed

Description

@scttfrdmn

Invariant

TTL expiry must always TERMINATE. There must be no TTL→stop (or TTL→hibernate) mode.

Current state (verified): correct. TTL expiry's only action is a.terminate("TTL expired") (pkg/agent/agent.go:299). There is no ttl-action config anywhere in the codebase. Only --on-complete offers stop/hibernate/terminate; idle offers stop/hibernate. TTL is the single unconditional executioner. Good.

Why this needs to be written down

"Stop" is not a terminal state — it's an indefinite, EBS-billing pause. A TTL→stop mode would mean the hard deadline resolves to "pause forever," which:

idle→stop is defensible (a pause with TTL still ticking toward eventual termination). A TTL→stop is a footgun and should be impossible, not merely undocumented.

Ask

  • Add a brief comment at the TTL-expiry site (agent.go) stating the invariant: TTL always terminates; do not add a stop/hibernate branch here — see Guardrail: TTL must always terminate — never add a TTL→stop mode #72.
  • Optionally a tiny guard/test asserting no ttl-action-style tag is honored into a non-terminate action.
  • Document the invariant alongside the lifecycle model.

Related

Activity

  1. scttfrdmn commented on Jun 8, 2026

    @scttfrdmn
    ContributorAuthor

    Implemented in PR #74 (v0.37.0, tracked in #75). Added the invariant comment at the TTL-expiry site in pkg/agent/agent.go and a regression test (TestCheckAndAct_ExpiredTTL_AlwaysTerminates) asserting an expired TTL calls Terminate and never Stop/Hibernate — even with HibernateOnIdle set.

  2. added a commit that references this issue on Jun 25, 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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions