Skip to content

fix(mastery): protect answer sources and finish repaired assessment delivery - #1957

Merged
pancacake merged 11 commits into
HKUDS:devfrom
yepyhun:contrib/mastery-assessment-delivery-safety
Oct 18, 2026
Merged

pancacake merged 11 commits into
HKUDS:devfrom
yepyhun:contrib/mastery-assessment-delivery-safety

Conversation

@yepyhun

@yepyhun yepyhun commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Scope and review order

Addresses the connected assessment workflow in #1955. Stacked on #1954
(ca006fbf), which depends on #1953 and #1943. The incremental review range is
ca006fbf...HEAD; inherited commits should be reviewed in their original PRs.
The separate runtime outcome fix is #1956. Please coordinate integration rather
than merging duplicate foundations.

Behavior

  • Mastery source inspection remains available to the model but is private by
    default in public tool content, metadata, source events and durable replay.
    Original authorized pixels are retained for inference.
  • rag supports intentional teaching/reveal presentation through the existing
    learning owner. Exact source references and current access are checked before
    publication. The frontend uses the native authenticated binary-source loader
    and existing image preview; ordinary teaching figures remain displayable.
  • Publication receipts bind assistance to the assessment attempt. Same-turn
    pre-card exposure and exposure during the pending session remain assisted
    through ordinary/group grading, correction and replay. Earlier study does not
    permanently disqualify later independent recall. Qualitative learning rules
    are not replaced by a blanket source-exposure gate.
  • Pending questions and unanswered group siblings cannot reveal their shared
    solution page through the presentation operation. Unrelated teaching pages
    remain available.
  • Successful source repair at the settlement boundary allows one restricted
    quiz-delivery round in the existing final slot. It cannot reopen arbitrary
    exploration, bypass validation or increase every turn's general loop budget.
  • Within a preparation, exact successful inspection batches are reused after
    targeted repair. Changed batches and failed checks are inspected again.
  • Single and grouped visual questions share a typed contract. Hint-description
    lists become their assistance count before source I/O; invalid counts fail
    clearly instead of reaching int(list) after inspection. Guided answers remain
    assisted. A malformed later child is rejected before inspecting earlier ones.
  • Source selection returns candidate IDs and scope rather than asking the model
    to recopy quotations. Excerpts are taken from retrieved text; complete text,
    original pixels and later question/key verification remain unchanged. Legacy
    quote compatibility permits only whitespace/Unicode composition differences
    that map back to an original excerpt; unsupported quotes remain rejected.
  • Request schema enums are copied before nullable-provider customization, so
    source presentation metadata remains valid for the tools API.

The existing tool result, learning transaction, pending interaction, source-access
and settlement owners remain authoritative. There is no additional model critic,
parallel progress database or filename-based answer-key classifier.

Evidence

  • Clean stacked checkout: 59 focused backend tests passed, covering private
    projection/replay, intentional presentation, attempt-scoped assistance,
    bounded delivery, preparation and exact successful-batch reuse.
  • 4 rendered frontend tests passed for intentional authenticated source
    display and rejection of unmarked/untrusted previews.
  • The extended installation separately passed the corresponding narrow scopes,
    including five source-display tests with the real shared-loop event origin.
  • RED regressions established the repair-boundary failure, duplicate inspection
    and assistance-scope errors before their fixes. Independent review completed
    separately from implementation. No real learner records or paid model calls
    were needed for this follow-up.

Follow-up commit b8fccb92 reproduces and fixes visual hint-list crashes,
source-selection quote-copy failures and mutable enum metadata. The clean stack
passed 20 focused visual tests, 14 source-selection/repair tests and two schema
serialization regressions; these are distinct scoped runs, not a combined
coverage percentage. The installation additionally passed one integrated set
of 30 changed-case regressions. The root/native changed owners were independently
reviewed for source validation, assistance preservation and schema isolation.

Limits

Publication is not proof that a learner viewed the page. Historical exposure is
not inferred and historical grades are not rewritten. A model can still make an
incorrect prose claim; the public projection controls normal tool publication,
not every possible model-authored statement. This does not promise perfect
question-bank selection, semantic grading or whole-session cost reduction.

An equivalent native implementation is welcome if it preserves these connected
behaviors. Broader coverage and remaining requirements: #1940.

@pancacake
pancacake merged commit 9aae961 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
alvinets pushed a commit to alvinets/DeepTutor that referenced this pull request Nov 8, 2026
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