@tdd_issue @tdd_issue_4739
Feature: Bug #4739 — TUI SQLite session persistence not implemented
  As a developer
  I want to verify that the TUI session persistence layer exists
  So that the bug is captured and will be caught by a regression test

  The spec (§Session Persistence and Resume) requires TUI sessions to be
  persisted in an SQLite database at ~/.local/state/cleveragents/tui.db
  via a TuiSessionStore class in cleveragents.tui.session_store.

  Currently no such module exists — the TUI hardcodes a single in-memory
  session and has no SQLite persistence layer.

  @tdd_issue @tdd_issue_4739 @tdd_expected_fail
  Scenario: TuiSessionStore module can be imported from cleveragents.tui
    Given the tdd4739 test environment is set up
    When I attempt to import cleveragents.tui.session_store
    Then the tdd4739 import should succeed without errors

  @tdd_issue @tdd_issue_4739 @tdd_expected_fail
  Scenario: TuiSessionStore class exists in the session_store module
    Given the tdd4739 test environment is set up
    When I attempt to import cleveragents.tui.session_store
    Then the tdd4739 module should expose a TuiSessionStore class

  @tdd_issue @tdd_issue_4739 @tdd_expected_fail
  Scenario: TuiSessionStore can persist a session record to SQLite
    Given the tdd4739 test environment is set up with a temp db path
    When I create a TuiSessionStore pointing at the temp db path
    And I save a tdd4739 session record with id "test-session-001"
    Then the tdd4739 session record should be retrievable by id "test-session-001"

  @tdd_issue @tdd_issue_4739 @tdd_expected_fail
  Scenario: TuiSessionStore lists all persisted sessions
    Given the tdd4739 test environment is set up with a temp db path
    When I create a TuiSessionStore pointing at the temp db path
    And I save a tdd4739 session record with id "sess-a"
    And I save a tdd4739 session record with id "sess-b"
    Then the tdd4739 session store should list 2 sessions
