376fddf18e
server/cost.py — derive_cost() counts LLM input/output tokens (gemma4 + deepseek-v4-flash), Deepgram audio minutes, Cartesia/Piper characters; derives estimated cents from scenarios/cost_rates.yaml. No enforced ceiling (D-012 pilot). CostBreakdown dataclass carries the breakdown dict stored in sessions.cost_breakdown_json. Per G-005: v0.1 logged costs are pilot-config (Ollama tier + cloud), NOT at-scale /learner economics — that requires self-hosted gemma4:e4b + Piper (post-pilot). server/session_recorder.py — SessionRecorder wires the SQLite store into the pipeline lifecycle: start() creates a session row, log_turn() writes turns with ASR/TTS text + latency + accumulates cost inputs, set_branch_path(), end() derives cost + writes outcome + debrief + updates progress. No auth — learner_id is the hardcoded learner-1 (D-007). 7 tests pass (derive_cost basic/piper-zero/breakdown-dict, load_rates yaml, no-enforced-ceiling, recorder full lifecycle with DB assertions, progress updated). ---ci--- phase: 1 milestone: v0.1 plan: 04 task: 04-03,04-04 status: execute persona: backend-engineer,data-engineer requirements: covered: [REQ-STATE-01, REQ-NFR-COST-01] ---/ci---