45 Commits

Author SHA1 Message Date
Benjamin Schwing
b7dd96d453 fix(mastery): grade concept objectives within covered and own scope (#2363, #2364) (#2366)
* fix(mastery): grade within the objective's covered and own scope

- Reuse the preserved objective-scoped packet for an objective request
  after a focus preparation replaced the live slot, and do not rebuild
  an incomplete objective packet whose fingerprints are unchanged (#2363).
- mastery_assess grades a concept/design explanation against the covered
  facets of an incomplete objective packet, records that scope, and
  returns a structured coverage_gap result instead of a bare refusal.
- Tell the learner when an answer was not recorded or was graded only
  against the covered part.
- Give the judge sibling objectives as out of scope and return the
  single missing element with a next_step to ask for exactly it (#2364).

* test(mastery): cover the focus-only assessment deadlock from #2905

A complete focus-scoped packet with no assessment slot gets a structured
coverage_gap on every repeated mastery_assess, with no judge call and no
recorded evidence. One objective preparation then grades the retained
explanation together with the next reply.

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>

* fix(mastery): make the missing-element step the assess instruction

Since dev added a generic instruction to every final mastery_assess
payload, a non-passing verdict carried two competing moves: next_step
asked for exactly the named missing element (#2364) and instruction
asked the learner to explain the objective again. While the gate is not
cleared, the targeted step is now also the instruction, and it says to
record the reply with mastery_assess.

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>

* fix(mastery): say when an unclear explanation is kept for grading

A non-final verdict in a session keeps the explanation and grades it
together with the follow-up, so the generic "not recorded, progress
unchanged" notice misled the learner into repeating the whole answer.
Add an assessment_needs_clarification notice (en/zh) for that case; an
explanation outside a session keeps the not_recorded notice.

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>

* fix(mastery): preserve the missing assessment element on replay

---------

Signed-off-by: Benjamin Schwing <63053132+BenjiAvH@users.noreply.github.com>
Co-authored-by: Qiuner <wdst3635@163.com>
2026-11-30 06:32:56 -03:00
Bingxi Zhao (Frank)
e81f9c866d fix(mastery): save a standalone reference answer for qualitative practice 2026-11-15 01:00:14 +08:00
Bingxi Zhao (Frank)
04daf46c5d fix(learning): preserve legacy review history and idempotent strategy bindings 2026-10-29 01:04:55 +08:00
Bingxi Zhao (Frank)
d09a4d3a4f Merge pull request #2028: configurable review strategies 2026-10-29 01:04:33 +08:00
nandanadileep
e27735d75c fix: Mastery Path concept objectives can never 2026-10-28 00:16:17 +00:00
XZH
aa7d54bd7b feat(learning): add mastery review strategies (#1908)
Mastery paths previously scheduled with one fixed interval template per knowledge type, which did not fit exam cramming, language drilling, science review, or learner-specific pacing.

Add four built-in strategy presets and custom per-round interval templates with validated persistence, CRUD, duplication, and path bindings. Bound paths keep a frozen strategy snapshot, replay durable evidence when switching, and mastery tools follow the bound path scheduler.

Expose strategy management in the mastery review trail, including custom interval editing and loading, empty, busy, invalid-input, and error states. Regenerate the OpenAPI contract and add focused backend and web regression coverage. Legacy paths without a binding continue to use the previous default scheduler.
2026-10-22 18:37:54 -07:00
Bingxi Zhao (Frank)
9aae961412 Merge PR #1957: separate private source evidence from explicit public presentation 2026-10-19 00:53:44 +08:00
Bingxi Zhao (Frank)
0fd8dc8384 Merge PR #1953: source-bound assessment with portable lexical page lookup 2026-10-19 00:43:33 +08:00
Bingxi Zhao (Frank)
59cdd81170 Merge PR #1943: preserve grouped questions through reviewed outline revisions 2026-10-19 00:40:44 +08:00
yepyhun
755686264d fix(mastery): separate source inspection from assessment delivery 2026-10-13 13:49:35 +02:00
yepyhun
ccac56eec1 fix(mastery): bind semantic assessment to verified question evidence 2026-10-13 12:21:04 +02:00
yepyhun
c3301c0055 feat(mastery): support independently graded question groups 2026-10-12 21:03:14 +02:00
yepyhun
e6853db336 feat(mastery): retain scoped teaching feedback with learner evidence 2026-10-12 13:12:50 +02:00
Bingxi Zhao (Frank)
2350ea2dba feat(mastery): complete source-grounded visual practice and evidence (#1611)
Bind original visual sources and keys to supported tasks; verify accepted model pixels, preserve cues/assistance and canonical attempts, keep uncertainty ungraded, expose challenge/repair, and separate required visual evidence from generic text mastery.
2026-10-08 05:25:05 +08:00
Bingxi Zhao (Frank)
4f2a897942 fix(mastery): honor explicit teach-first preference 2026-09-27 04:46:58 +08:00
Bingxi Zhao (Frank)
55490af65e Merge issue fixes into PR synthesis
Combine knowledge bootstrap coverage and preserve later progress-isolation tests, native notebook tooltip, and locale-aware tool-hint fallback. Regenerate frontend contracts and align test fixtures with merged APIs.
2026-09-23 12:06:19 +08:00
Bingxi Zhao (Frank)
a83683640e fix(learning): replay retention changes and late evidence consistently (#1541) 2026-09-23 11:14:02 +08:00
Bingxi Zhao (Frank)
8b08debd7c fix(learning): make review timing and retention settings consistent (#1541) 2026-09-23 11:00:25 +08:00
Bingxi Zhao (Frank)
ba7efc5dbf Merge PR #1477 mastery objective relations 2026-09-23 10:34:25 +08:00
Bingxi Zhao (Frank)
24da87ae4e Merge PR #1368: account-scoped reading learning records 2026-09-23 10:27:53 +08:00
Bingxi Zhao (Frank)
0fff9246c0 fix(mastery): bind repairs to exact question evidence 2026-09-21 12:45:43 +08:00
Bingxi Zhao (Frank)
01da2757bd fix(learning): complete adaptive linked evidence flow 2026-09-21 10:35:22 +08:00
Gao-Chenkai
33fa74b5b6 fix(mastery): keep learning evidence bound to objective identity
Replace no longer reuses positional IDs for unrelated waypoints, invalid
questions can be voided or re-keyed, and defer advances the route without
faking mastery.

Fixes #1527

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-21 10:23:53 +08:00
XZH
62032ad7e0 feat(learning): persist mastery prerequisites and topic-source links (#1476) 2026-09-15 08:13:39 -07:00
Gao-Chenkai
21cd2bb23f feat: complete adaptive SRS persistence and review UI 2026-09-15 21:00:01 +08:00
XZH
facbc020b9 feat(learner): add account-scoped reading learning records (#1109) 2026-09-11 07:18:02 -07:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bingxi Zhao (Frank)
1b5ad913d4 feat(mastery): ship atlas and guided study journeys 2026-08-28 00:09:44 +08:00
Bingxi Zhao (Frank)
3f2a70f168 feat(mastery): add v2 topic backend and archive migration 2026-08-27 23:10:15 +08:00
Bingxi Zhao (Frank)
bd80a4d28a release: v1.5.17
Partners stop being a deployment-wide admin resource and become
per-user: three nested rights (manage / use / neither) replace the
blanket admin gate on the router, each member can build and own their
own, and every person's conversations with a partner stay private to
their account. Grants keep working and now offer only admin-managed
partners. Channel runtime state moves from one directory per channel to
one per partner — copied, not moved, and only when its owner is
unambiguous — so two partners can finally run the same channel.

Around that: a knowledge base can track GitHub repositories and re-sync
their Markdown (#903); Antigravity CLI joins My Agents now that Gemini
CLI is retired (#828); personal WeChat signs in from a QR code drawn in
the browser instead of the server log (#951); a chat account can be
linked to a DeepTutor account with /link; containers re-apply the extras
they declare instead of losing them at compose down (#762); and
`deeptutor doctor` answers whether a workspace is ready to run (#959).

Reliability, largely from community PRs: embeddings survive a
rate-limited provider through key rotation, a retry budget and a global
throttle (#962); MinerU parsing and code execution work on Windows
(#844, #964); indexing fails bounded instead of hanging (#946); MinerU
page-layout blocks stop being indexed as content (#949); voice uploads
carry a MIME the transcription API accepts (#945); and reasoning effort
can be overridden per conversation (#641).

Release plumbing: notes in assets/releases/ver1-5-17.md, v1.5.13
archived, __version__ 1.5.17, README Releases row and all eleven
translations synced.

Two defects found by the release gate and fixed here:

- Six partner routes — the four channel-onboarding endpoints and both
  WeChat QR endpoints — kept the _auth-only mount they had inherited
  from the blanket admin gate, so any signed-in account could start a
  QR login for someone else's partner and write a bot token into its
  channel config. All six now declare _MANAGEABLE, and a sweep test
  asserts no {partner_id} route is left ungated.
- A configured api_key became `str | list[str]` when key rotation
  landed, but ten call sites pass it somewhere that takes one key; a
  list would have rendered into an Authorization header verbatim.
  keypool.primary_api_key reduces at each boundary.

Gates: pre-commit (all 15 hooks), ruff check + format, pytest
5276 passed, web 605 node tests, docs build.
2026-08-25 02:24:35 +08:00
Bingxi Zhao (Frank)
b71aef2b5b feat(mastery): carry explanation and difficulty into the question bank
A mastery attempt reached the bank as a bare right/wrong, reviewable
only as a score. mastery_quiz now takes both fields, held server-side
like expected_answer so neither leaks onto the card being answered, and
the sync writes them through. An unrecognised difficulty is dropped
rather than rejected — a mislabelled badge must not cost the learner a
question.
2026-08-20 01:29:55 +08:00
Bingxi Zhao (Frank)
94a6edd563 feat(mastery): harden path state and turn recovery 2026-08-17 09:57:55 +08:00
Bingxi Zhao (Frank)
04cc156fa8 daily update 2026-06-13 19:51:44 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
whf
a0ee477ff9 fix: ruff auto-fix (22 issues), mypy type fixes for KnowledgeType 2026-05-21 14:41:51 +08:00
unknown
00338e79b4 feat: persist Feynman unevaluated explanations in LearningProgress
When LLM evaluation fails in feynman_check, the user's explanation text
is now saved to progress.feynman_explanations[kp_id] instead of being
lost. Cleared on successful evaluation. New field: feynman_explanations.
2026-05-21 01:02:06 +08:00
unknown
6934db4a91 perf: unified LLM/RAG timeout, per-stage degradation, and code cleanup
- Add stage_failure_counts/stage_failure_notes to LearningProgress for persistent failure tracking
- Wrap RAG retrieval with 10s independent timeout in _call_llm_impl
- Add _call_llm_with_timeout (default 60s) and _call_llm_with_degradation (bounded retry + skip)
- Apply degradation to all 12 stage handlers with stage-specific fallback paths
- Extract _run_interactive_quiz_loop shared helper for practice/practice_quiz
- Extract StructuredStageContent component from page.tsx
- Add TypeError to JSON parse except clauses across 7 files
- Simplify _record_attempt_and_update_mastery to single save exit
- Move import logging to module top in service.py
2026-05-21 00:07:31 +08:00
unknown
6d478bcbd3 fix: model strictness, empty-module guards, list_progress error reporting
LearningProgress model_config changed from extra="allow" to extra="ignore"
to reject unknown fields (P1-9). All stage handlers now guard against empty
modules to avoid wasted LLM calls (P2-1). list_progress returns
{summaries, errors} instead of silently swallowing load failures (P2-3).

P1-9, P2-1, P2-3
2026-05-20 12:49:18 +08:00
unknown
783776ad26 fix: connect() closure deps (P1-6) + change_module race guard (P1-7)
- Add modules.length, moduleSelected, currentModuleId to connect() useCallback deps
- Add version field to LearningProgress and CAS save to LearningStore
- Cancel active turn before change_module (await task completion)
- Clear pending auto-advance timer on module_changed event
2026-05-20 00:18:50 +08:00
unknown
10a1936367 fix: add FEYNMAN_CHECK retry limit, skip after 3 failures (Block1) 2026-05-19 22:04:48 +08:00
unknown
80ccbe9dfb Block 7.5: Practice quiz phase, auto-advance fix, cancel streaming safety
- Add PRACTICE_QUIZ stage between Feynman Check and Error Diagnosis
- Generate 5-10 practice questions per module, record attempts but don't gate mastery
- Fix auto-advance race: move stagesRef updates outside React setState callbacks
- Fix stale handleStreamEvent closure via ref pattern
- Fix PLAN stage permanent deadlock when modules not initialized
- Clear error state unconditionally on new stage_start
- Add cancelStreamingTurn to sidebar and chat page for proper cleanup
- Fix cancelStreamingTurn to handle missing turnId gracefully
- Keep empty page_ids refs for whole-book resolution in guided learning
2026-05-16 11:33:45 +08:00
whf
6f3070f8d3 Block 21: Auto-mastery calculation, mock module cleanup, quiz_attempts tracking, global review passed 2026-05-15 00:58:34 +08:00
whf
5451aa60b4 Block 19: Interactive diagnostic phases — wait_for_input, server-side grading, answer stripping, correct_count, CLI timeout 2026-05-14 23:15:47 +08:00
whf
e82b5374cf Block 15: Phase 3 — enum values English + _missing_() backward compat, __init__.py docstring, i18n keys, 66/66 tests 2026-05-14 11:01:49 +08:00
whf
a177d2b22b Block 1: Add learning data models (4 enums + 9 Pydantic models per Framework v1.8.2) 2026-05-06 01:40:28 +08:00