- P1-B: Reset stage_failure_counts on LLM success in _call_llm_with_degradation
so a recovered stage is not permanently penalized by prior transient failures
- P1-A: HTML-escape notebook records (<, >, &) before embedding in
<notebook_records> XML tags to prevent prompt injection; truncate type to 50 chars
- P2-A: Remove redundant `except (Exception, asyncio.TimeoutError)` (3 places)
since Python 3.11+ TimeoutError is already a subclass of Exception
- P1-C: Add E2E flow test covering PRETEST → EXPLAIN → FEYNMAN_CHECK →
PRACTICE_QUIZ → ERROR_DIAGNOSIS → MODULE_TEST → REVIEW → COMPLETED
164 tests pass.
- Add stage_failure_counts/stage_failure_notes to LearningProgress for persistent failure tracking
- Wrap RAG retrieval with 10s independent timeout in _call_llm_impl
- Add _call_llm_with_timeout (default 60s) and _call_llm_with_degradation (bounded retry + skip)
- Apply degradation to all 12 stage handlers with stage-specific fallback paths
- Extract _run_interactive_quiz_loop shared helper for practice/practice_quiz
- Extract StructuredStageContent component from page.tsx
- Add TypeError to JSON parse except clauses across 7 files
- Simplify _record_attempt_and_update_mastery to single save exit
- Move import logging to module top in service.py
Backend: list_progress() derives display name from first module name,
falling back to book_id for empty-module books.
Frontend: ProgressSummary gains 'name' field, card heading uses
card.name || card.book_id instead of raw book_id.
Tests: 2 new negative tests (name from module, empty-module fallback).
92/92 passing.