Skip to content

feat(mastery): retain scoped teaching feedback and strategy outcomes - #1936

Merged
pancacake merged 4 commits into
HKUDS:devfrom
yepyhun:contrib/mastery-teaching-guide
Oct 18, 2026
Merged

pancacake merged 4 commits into
HKUDS:devfrom
yepyhun:contrib/mastery-teaching-guide

Conversation

@yepyhun

@yepyhun yepyhun commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Problem and behavior

Mastery Path can remember intake answers, but a single free-text preference field does not reliably preserve independent corrections. Repeated teaching difficulties and attempted explanations also need a small durable record, rather than relying entirely on the conversation window.

This adds keyed teaching feedback to the existing per-path LearnerProfile and mastery_profile tool. Explicit learner requests stay separate from objective-local observations and strategy outcomes. Routine mastery_status snapshots return the path preferences and at most three relevant current-objective observations. Explicit include_teaching_history inspection returns the bounded path record so the learner can inspect, correct or remove notes through conversation.

For example, a learner can say that a definition is confusing, ask for a spatial example, and later report that the example helped. The tutor can remember both the request and the result without treating the explanation itself as proof of understanding or awarding mastery credit.

Design and safeguards

  • Existing path-scoped transactional storage owns the state; no separate global personality/memory subsystem or extra critic model.
  • Independent upsert/remove operations preserve unrelated preferences and observations. Existing free-text intake fields remain compatible.
  • Empty optional arguments preserve existing intake instead of erasing it during an unrelated feedback update. Intentional clearing requires explicit field names, a literal quote from the current learner request, and the current path revision.
  • A request-local capability hook injects the real current learner message, session and turn. Explicit preferences and reported strategy results require a literal quote from that message. Inferred difficulties remain tentative, and unconfirmed attempts remain unknown.
  • Structured updates require the current path revision. Transactions reject stale changes and roll back the whole batch. Identical retries are no-ops; an old retry cannot overwrite a newer preference or resurrect a removed entry.
  • Observation objective IDs must exist in the bound path. Storage caps are six preferences, twelve observations and six operations per batch. Full inspection stays within that path; no automatic silent eviction.
  • Teaching feedback never mutates mastery scores, quiz attempts, pending questions or learning evidence.
  • A selected profile write needs a successful storage receipt before the tutor can treat it as durable. A failed write gets at most one corrective round, then useful teaching continues with an explicit unsaved notice. Optional memory failure cannot deadlock the lesson or bypass question-card finish handling.
  • English and Chinese tutor instructions ask for an actual change of explanation after repeated confusion, preserve the distinction between learner feedback and inferred difficulty, and avoid recording an update for every message.

Validation

Targeted tests first failed because the structured update API and trusted quote injection were missing. The explicit-inspection test also failed before the read option was implemented.

  • Local feature plus existing snapshot tests: 38 passed in 4.07s.
  • Clean upstream-based checkout, feature tests only: 27 passed in 1.73s.
  • Scoped Ruff checks and whitespace checks pass in the clean checkout.
  • Fixtures use synthetic paths, objectives and learner statements. No paid model calls or changes to actual learner state were needed.

The tests cover reload/persistence, independent corrections/removal, legacy compatibility, scope, limits, invalid confirmation, actual-quote verification, spoofed private context replacement, stale replay, atomic rollback, and resumed snapshot delivery/full inspection without mastery changes. Tentative teaching observations alone do not count as completed learner intake.

Limits and follow-up

This implements durable bounded state and its automatic delivery, not a guarantee that a model always identifies confusion or selects the best pedagogical explanation. A quote is mechanically checked for provenance; whether it actually supports the interpretation remains the tutor's responsibility. There is no new formal mastery score or automatic inference that silence means understanding.

The existing model chooses when a meaningful update is warranted. The learner can inspect/correct notes through the existing tools; a dedicated visual preferences editor is not included. Notes bind to the path's stable objective IDs and rely on native outline identity semantics.

Please consider this as a concrete implementation of the core durable-adaptation mechanism discussed in #1933. It is reasonable to improve the selection, update contract or user experience if there is a better fit, while preserving evidence provenance, non-destructive updates, bounded context and the separation from mastery assessment.

Refs #1933

Contribution status, related fixes and remaining requirements: tracking issue #1940.

Follow-up: actionable current-objective focus

Commit f4b0197 addresses the advisory part of #1949 through the existing profile owner: the next-step focus contains at most three current-objective observations, including the attempted strategy and its learner-supported outcome. Unrelated historical notes do not become the current difficulty. Fresh learner requests and compatible teaching defaults take precedence over stale summaries; pacing remains advisory rather than a rigid paragraph/quiz counter.

The clean native checkout passed 30 focused profile/focus tests. No extra inference pass or second memory database is added. Persistence, scoping and instruction delivery are tested; interpreting new feedback, saving an important observation and selecting an effective explanation remain model decisions, not guaranteed semantic compliance.

See #1949 and tracking issue #1940.

Continuity follow-up

Commit 1a2cdb5 adds non-destructive intake updates, explicitly authorized clearing, cross-session correction persistence and bounded save-failure handling. The independent review also checked that the unsaved notice composes with existing card/empty-final delivery behavior rather than bypassing it.

Commit b081d97 corrects a subsequently reproduced boundary case: the unsaved
notice must not finalize an intermediate, textless tool batch. It is attached
only when actual prose is finishing or the requested card has been delivered.
Both new regression cases failed before the fix; all eight focused continuity
tests pass afterward. This preserves useful preparation/delivery after optional
profile persistence fails; it does not introduce another retry loop.

Clean contribution checkout: 111 passed across profile continuity, teaching compass and Mastery capability tests; scoped Ruff and whitespace checks pass. These are overlapping regression scopes, not additional coverage percentages. The mechanism preserves recorded requests; it does not claim perfect model compliance with every teaching preference.

@pancacake
pancacake merged commit f976208 into HKUDS:dev Oct 18, 2026
8 of 15 checks passed
alvinets pushed a commit to alvinets/DeepTutor that referenced this pull request Nov 8, 2026
…uide

feat(mastery): retain scoped teaching feedback and strategy outcomes
alvinets pushed a commit to alvinets/DeepTutor that referenced this pull request Nov 8, 2026
…uide

feat(mastery): retain scoped teaching feedback and strategy outcomes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants