Repository navigation
fix(mastery): make source preparation demand-driven and preserve partial teaching - #1954
Merged
pancacake merged 9 commits intoOct 18, 2026
Merged
Conversation
This was referenced Oct 13, 2026
2 tasks done
9 tasks done
alvinets
pushed a commit
to alvinets/DeepTutor
that referenced
this pull request
Nov 8, 2026
…lity prerequisite contract
alvinets
pushed a commit
to alvinets/DeepTutor
that referenced
this pull request
Nov 8, 2026
…lity prerequisite contract
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and behavior
Refs #1902 and #1949. Missing cached evidence, genuinely unavailable source material and incomplete coverage of one subtopic are different situations. Treating them alike can cause repeated expensive preparation or a tutor that repeatedly apologizes instead of teaching the supported part.
This makes preparation demand-driven through the existing Mastery and turn-loop owners:
Dependency and ownership
Stacked on #1953 at a15c14b, which provides the real preparation/page/source and assessment owners; that PR is itself based on #1943. Incremental implementation: 3175b81, verification: ca006fb. Please coordinate review/rebase in that order rather than merging competing preparation mechanisms.
#1952 remains the complementary owner of publicly delivered teaching receipts. This branch does not import or claim that independent behavior. It also adds no alternative memory database, automatic critic, provider override or translated prompt overhaul.
Verification
The combined local application separately passed its Mastery/source/profile/group integration checks and built-browser recovery smoke. No real learner records were changed for tests. An optional broader run had 268 passes and two failures also reproduced on the unchanged parent: an existing stream-timing assertion and a summary fixture needing initialized configuration. Those are not reported fixed by this PR.
Detailed contracts and proof:
docs/verification/mastery-demand-source-preparation.md.An equivalent native design is welcome; the important behavior is proportionate, reusable source grounding that does not turn ordinary retrieval uncertainty into a teaching deadlock or weaken real access/evidence checks.
Contribution map and remaining requirements: tracking issue #1940.
Connected follow-up
#1957 is stacked on this branch and adds private source inspection, intentional authenticated source presentation, attempt-scoped assistance and bounded delivery after successful repair. It also reuses identical successful inspection batches within one preparation. Please review its incremental range separately; those changes are not claimed to be in this PR's head. #1956 independently fixes explicitly incomplete terminal outcomes. The updated dependency/evidence map is maintained in the main body of #1940.