feat(tui): design and implement SQLite session persistence schema at ~/.local/state/cleveragents/tui.db #8592

Open
opened 2026-04-13 21:13:15 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit message type: feat
  • Scope: tui
  • Branch name prefix: feat/v3.7.0-tui-sqlite-session-schema

Background and Context

As part of Epic #8087 (TUI Session Persistence & Multi-Session Tabs), the first step is to design and implement the SQLite schema for session persistence. Sessions must persist to ~/.local/state/cleveragents/tui.db.

This issue blocks Epic #8087.

Expected Behavior

  • SQLite database is created at ~/.local/state/cleveragents/tui.db on first TUI launch
  • Schema includes tables for: sessions, session_messages, session_metadata
  • Schema is versioned with migrations for future changes
  • Database is created with proper permissions (user-only read/write)

Acceptance Criteria

  • SQLite database is created at ~/.local/state/cleveragents/tui.db on first launch
  • Schema includes sessions table with: id, name, created_at, updated_at, a2a_binding
  • Schema includes session_messages table with: id, session_id, role, content, timestamp
  • Schema includes session_metadata table with: session_id, key, value
  • Schema is versioned (schema_version table)
  • Database is created with user-only permissions (0600)
  • Integration tests verify database creation and schema
  • Unit tests achieve >= 97% coverage

Subtasks

  • Design SQLite schema (sessions, session_messages, session_metadata, schema_version)
  • Implement database initialization at ~/.local/state/cleveragents/tui.db
  • Implement schema migration system
  • Set proper file permissions (0600)
  • Write integration tests for database creation
  • Write unit tests for schema initialization

Definition of Done

  1. SQLite database is created with correct schema
  2. Integration tests verify database creation
  3. Unit tests pass with >= 97% coverage
  4. Code reviewed and merged to main branch

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Metadata - **Commit message type**: `feat` - **Scope**: `tui` - **Branch name prefix**: `feat/v3.7.0-tui-sqlite-session-schema` ## Background and Context As part of Epic #8087 (TUI Session Persistence & Multi-Session Tabs), the first step is to design and implement the SQLite schema for session persistence. Sessions must persist to `~/.local/state/cleveragents/tui.db`. This issue blocks Epic #8087. ## Expected Behavior - SQLite database is created at `~/.local/state/cleveragents/tui.db` on first TUI launch - Schema includes tables for: sessions, session_messages, session_metadata - Schema is versioned with migrations for future changes - Database is created with proper permissions (user-only read/write) ## Acceptance Criteria - [ ] SQLite database is created at `~/.local/state/cleveragents/tui.db` on first launch - [ ] Schema includes `sessions` table with: id, name, created_at, updated_at, a2a_binding - [ ] Schema includes `session_messages` table with: id, session_id, role, content, timestamp - [ ] Schema includes `session_metadata` table with: session_id, key, value - [ ] Schema is versioned (schema_version table) - [ ] Database is created with user-only permissions (0600) - [ ] Integration tests verify database creation and schema - [ ] Unit tests achieve >= 97% coverage ## Subtasks - [ ] Design SQLite schema (sessions, session_messages, session_metadata, schema_version) - [ ] Implement database initialization at `~/.local/state/cleveragents/tui.db` - [ ] Implement schema migration system - [ ] Set proper file permissions (0600) - [ ] Write integration tests for database creation - [ ] Write unit tests for schema initialization ## Definition of Done 1. SQLite database is created with correct schema 2. Integration tests verify database creation 3. Unit tests pass with >= 97% coverage 4. Code reviewed and merged to main branch --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
Author
Owner

[AUTO-OWNR-1] Triage Decision (Cycle 4)

Status: Verified

MoSCoW: Must Have
Priority: High
Milestone: v3.7.0

Rationale: SQLite session persistence schema at ~/.local/state/cleveragents/tui.db is a hard v3.7.0 spec requirement and the foundational dependency for Epic #8087. This also directly addresses the data-loss pattern identified in bug #8500. Without the schema, session save/restore (#8594) cannot be implemented.

Next Steps: This is a prerequisite for #8594. Assign to an implementation worker. Branch feat/v3.7.0-tui-sqlite-session-schema. Design and implement sessions, session_messages, session_metadata, and schema_version tables. Set file permissions to 0600. Integration tests for database creation required.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## [AUTO-OWNR-1] Triage Decision (Cycle 4) **Status**: ✅ Verified **MoSCoW**: Must Have **Priority**: High **Milestone**: v3.7.0 **Rationale**: SQLite session persistence schema at `~/.local/state/cleveragents/tui.db` is a hard v3.7.0 spec requirement and the foundational dependency for Epic #8087. This also directly addresses the data-loss pattern identified in bug #8500. Without the schema, session save/restore (#8594) cannot be implemented. **Next Steps**: This is a prerequisite for #8594. Assign to an implementation worker. Branch `feat/v3.7.0-tui-sqlite-session-schema`. Design and implement `sessions`, `session_messages`, `session_metadata`, and `schema_version` tables. Set file permissions to 0600. Integration tests for database creation required. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
HAL9000 added this to the v3.7.0 milestone 2026-04-13 21:16:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#8592
No description provided.