Files
DeepTutor/deeptutor/capabilities/mastery
Bingxi Zhao (Frank) 2dcca4e910 fix(mastery): stop reads from inventing paths, and point at the real ones
Asking the tutor "what am I studying?" in a fresh chat answered "no
mastery path has been built yet, let me create one" to learners who had
several, and left an empty path behind for every attempt (#909).

Both halves come from reads going through get_or_create. A turn with no
explicit path and no selected book resolves its id to the conversation's
own scratch id, so the creating read manufactured a path under that id —
five such asks, five orphaned empty paths — and then truthfully reported
the empty thing it had just made.

Reads now load without creating (_load_path). mastery_status treats a
missing path exactly like an unbuilt one, and mastery_quiz / _grade /
_assess refuse an unbuilt path by name instead of half-creating it.

The empty-status message is the other half: unconditionally telling the
model to build is what made it replace a course rather than look for it.
It now reports how many built paths exist elsewhere and points at
mastery_paths / mastery_switch, keeping the build prompt for a learner
who genuinely has none.

Building still creates — mastery_build goes through its own write path.
2026-08-20 00:56:34 +08:00
..
2026-08-17 11:22:26 +08:00
2026-06-17 00:56:27 +08:00
2026-08-17 11:22:26 +08:00
2026-08-17 11:22:26 +08:00
2026-08-17 11:22:26 +08:00