Skip to content

Centralize session status policy #58

@ThomasK33

Description

@ThomasK33

What to build

Deepen the session lifecycle status rules into a shared status-policy module. The module should answer questions such as whether a session is terminal, active, commandable, live-host eligible, or offline-replay eligible, and the existing lifecycle, inspect, and gc paths should use that module without changing public CLI JSON or human output.

Acceptance criteria

  • A shared status-policy module covers every SessionStatus value with assertions or exhaustive checks.
  • src/host/lifecycle.ts, src/cli/commands/inspect.ts, and src/cli/commands/gc.ts use the shared policy instead of local status lists for terminal/active/offline decisions.
  • Existing lifecycle, inspect, and gc behavior remains unchanged, including stale-host reconciliation and destroyed-session handling.
  • Targeted tests cover the policy module directly and the existing inspect, gc, and lifecycle integration tests still pass.

Blocked by

None - can start immediately.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or improvementready-for-agentFully specified, ready for an AFK agent

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions