You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(review): reconcile deck write-root with panel read-root (Issue #1)
Generated decks never appeared in the Quiz/Flashcard panels. Root cause was
TWO independent bugs, not the single "3-level layout" hypothesis in the handoff:
A. Read-root unconfigured (dominant). The panels read decks from
`review.directories`; the generator WRITES them under `content.base_path`.
These are two separate config keys that must agree, but the live config sets
only `content`, so `_web.py` handed `discover_directories([])` and the panels
showed nothing regardless of disk contents.
Fix: new `settings.resolve_study_dirs()` falls back to `content.base_path`
when `review.directories` is unset. Wired into `_web.py` and `mcp/tools.py`.
B. Single-level descent. The real vault is 3 levels deep
(`base/<publisher>/<course>/{flashcards,quizzes}/`) but `discover_directories`
only walked one child level (the publisher), never reaching course dirs.
Fix: recursive descent to depth 4, stopping at the first content-bearing
dir on each branch (a course is a leaf — never recurse into its deck subdirs,
and skip empty deck dirs that `get_course_dir` eagerly mkdirs).
Proven end-to-end (scripts/prove_gen_readpath.py + live server + Playwright):
generated a real Ollama/gemma4 deck into CodeWithMosh/Complete_SQL_Mastery,
confirmed files land where panels read, `/api/courses` lists it (9 fc / 6 quiz),
`/api/cards` returns quality content, and the Flashcard panel renders card 1/9.
Tests: +9 (4 loader, 4 resolver, 1 empty-dir guard). 87 passed, no regressions.
0 commit comments