feat(P01-04-01,P01-04-02): SQLite schema + async store (D-007)
db/schema.sql + db/migrations/0001_init.sql — four tables: learner (single hardcoded 'learner-1'/'Alex' row, D-007 no auth), sessions (id, learner_id, scenario_id, started_at, ended_at, branch_path_json, outcome, cost_estimated_cents, debrief_text, cost_breakdown_json), turns (id, session_id, seq, role, asr_text, tts_text, latency_ms), progress (learner_id, scenario_id, attempts, last_outcome). db/migrate.py applies migrations idempotently via a _migrations tracking table. db/store.py — PraxisStore async access layer (aiosqlite): start_session, log_turn, end_session (branch_path + outcome + cost + debrief), update_progress (increment attempts + last_outcome), get_session, get_turns, get_learner. Type-annotated SessionRow/TurnRow dataclasses. 6 tests pass (migration creates all tables, hardcoded learner exists, idempotent migrations, start→log→end→query full session, update_progress, get_learner). ---ci--- phase: 1 milestone: v0.1 plan: 04 task: 04-01,04-02 status: execute persona: data-engineer requirements: covered: [REQ-STATE-01] ---/ci---
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
"""Praxis SQLite store package — async access layer (D-007)."""
|
||||
|
||||
from db.store import (
|
||||
PraxisStore,
|
||||
SessionRow,
|
||||
TurnRow,
|
||||
HARDCODED_LEARNER_ID,
|
||||
)
|
||||
from db.migrate import apply_migrations
|
||||
|
||||
__all__ = [
|
||||
"PraxisStore",
|
||||
"SessionRow",
|
||||
"TurnRow",
|
||||
"HARDCODED_LEARNER_ID",
|
||||
"apply_migrations",
|
||||
]
|
||||
Reference in New Issue
Block a user