Session Lifecycle

TUI Phases

The terminal UI moves through defined phases managed by PhaseManager:

shell → loading → menu → main → [hitl] → [multi] → end
PhaseDescription
shellBinary startup, terminal initialization
loadingBootstrap sequence, config loading
menuSession menu display
mainNormal operation - agents, channels, input active
hitlHuman-in-the-loop (approval modal active)
multiMulti-agent coordination mode
endShutdown/cleanup

Boot Sequence

What happens on armament launch:

  1. Terminal initialization (raw mode, screen buffer)
  2. Load config (~/.armament/config.yaml)
  3. Initialize event bus and core services
  4. Load saved session state (if resuming)
  5. Present session menu or enter main phase
  6. Spawn default channel (#armament)

Key Capabilities

Session Persistence

Session state (channels, agents, messages, config) is persisted to disk at ~/.armament/sessions/ and can be resumed on restart.

Hot Configuration

Configuration can be changed live via /config menu or /set commands without restarting:

/set theme ice
/config

Planned Enhancements

  • Session pause/resume with agent suspension
  • Crash recovery from checkpoints
  • Reconfiguration atomic swap with rollback
  • Budget enforcement with pause/warn/hard-stop actions
  • Graceful shutdown with final checkpoint