41 Commits

Author SHA1 Message Date
Benjamin Schwing
c4befc3706 fix(mastery): keep a partial explanation pending for the missing part
Builds on the clarification handling from #2261. After a final partial
grade the learner usually sends only the missing part, which was then
graded alone and found partial again, so answers split over several
messages could alternate between partial grades without ever passing.

Keep the graded explanation pending after a final partial, with the same
session/objective scope and TTL as a clarification request, so the next
explanation is graded together with it. Pending explanations are now
dropped when the path moves on after them (a final assessment of any
objective, a deferral, a question on another objective, a reset or
revision); ordering uses event ids instead of timestamps so the partial
that records the request does not cancel it. A pass or an incorrect
grade still ends it, and a retried turn replays its saved verdict.

Refs #2249
2026-11-01 18:51:31 +00:00
LucianVane
c1fe11b899 fix(mastery): grade a clarification together with the explanation it completes
When mastery_assess asks for clarification, keep the explanation for that
objective in the session. The next assessment grades the earlier explanation
plus the clarification instead of the short reply alone.

Fixes #2249
2026-10-31 23:55:11 +08: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)
59cdd81170 Merge PR #1943: preserve grouped questions through reviewed outline revisions 2026-10-19 00:40:44 +08:00
Bingxi Zhao (Frank)
ba899ffc68 Merge PR #1939: review outline changes before atomic commit 2026-10-19 00:38:00 +08:00
yepyhun
c3301c0055 feat(mastery): support independently graded question groups 2026-10-12 21:03:14 +02:00
yepyhun
c510b13363 feat(mastery): add reviewed outline previews and retry-safe commits 2026-10-12 11:23:32 +02:00
dajiaohuang
80881c2500 fix(learning): read related projections in one snapshot 2026-10-08 12:35:34 +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)
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)
01da2757bd fix(learning): complete adaptive linked evidence flow 2026-09-21 10:35:22 +08:00
Bingxi Zhao (Frank)
da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00
XZH
62032ad7e0 feat(learning): persist mastery prerequisites and topic-source links (#1476) 2026-09-15 08:13:39 -07:00
Gao-Chenkai
a448e8743c fix: keep adaptive SRS UI compatible with base tests 2026-09-15 21:31:20 +08: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)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
Bingxi Zhao (Frank)
d57d2983ef feat(mastery): complete v2 learning workflows 2026-08-28 14:58:43 +08:00
Bingxi Zhao (Frank)
3f8644d6e9 fix(mastery): persist v2 metadata for migrated topics 2026-08-28 00:16:39 +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)
96d6df9eb1 release: v1.5.13
Book is the bulk of this one. Compilation outlives the request that
started it, so a bus owned by that request dropped every background event
and "watch your book being written" degraded into a frozen page; the
stream is now owned per book by the process and survives a refresh or a
reconnect. Reading progress is finally recorded — `visited_page_ids` and
`bookmarked_page_ids` had been declared but never written for the life of
the feature — and rolls up into a completion score and weak chapters. A
book can also leave the app now, as one self-contained Markdown document,
with non-ASCII titles surviving the download.

Two scheduling defects that were invisible in production are fixed: the
same page compiled twice concurrently (billed twice, one result
discarded), and a book grinding on through a provider outage until every
chapter was half-generated. The source sweep is bounded and allocated
round-robin rather than spent on the first few knowledge bases, and
retrieval now tells indexed bases from connected pointers, so an Obsidian
vault or a remote IMA library no longer contributes zero while looking
like a source with nothing relevant. Confirming a spine shows a live
per-chapter estimate derived from the Section Architect's own templates.

Also here: three home starter suggestions built from memory recall,
mastery-path handoff moved into one module that changes lease, session
preference, and live turn together, and account-level Tencent IMA
credentials with the per-KB pair still winning.

Notes: assets/releases/ver1-5-13.md

This commit also carries the README prose sync, the eleven translated
READMEs, the release-notes archive sweep, and the version bump. Two gate
fixes ride along: the `Stamped` protocol is declared read-only so the
frozen `EntityStamp` satisfies it, and six GraphRAG adapter tests that
reached a deep `graphrag` import without guarding it now skip like their
four neighbours instead of failing where the extra is not installed.
2026-08-17 11:22:26 +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)
fb3c568697 fix pageindex & minor bugs 2026-07-18 19:47:03 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
Bingxi Zhao (Frank)
e3a351a488 refactor(guided-learning): post-merge hardening of #500
Security/correctness:
- Stop leaking diagnostic answers: persist a _sanitize_diagnostic() snapshot
  (drops top-level answers + inline answer keys) into progress.diagnostic,
  which is returned verbatim by the /progress endpoints. Grading is unaffected
  (authoritative answers live in LearningStore).
- _safe_json_parse + generate_from_notebook now use the shared fence-stripping
  parse_json_response instead of bare json.loads, so the common fenced/lightly
  -malformed LLM output is recovered instead of silently dropped / 500'd.

Decoupling:
- unified_ws change_module: move module lookup + PRETEST reset into
  LearningService.switch_module(); router keeps only the WS ordering
  (module_changed before cancel) and no longer imports learning.models.
- unified_ws check_active_turn: use new public TurnRuntimeManager
  .has_live_execution() instead of reaching into _lock/_executions.
- redo endpoint: LearningStore.clear_questions() instead of poking _questions_path.
- remove unused StreamEventType.USER_INPUT enum; document the WS message types.

Stability:
- LearningStore: question read-modify-write (save_question_answers/_meta),
  delete(), and clear_questions() now hold _cas_lock — consistent concurrency
  model; _atomic_write_text cleans up its temp file on failure.

Cleanliness/clarity:
- router: shared _validate_book_id() (9 endpoints) + _parse_modules()
  (init/replace); _classify_error drops unused expected_answer param.
- guided_learning: hoist logging/RAGService imports + module logger; move tuning
  constants to class top; ContextVar declared after imports.
- storage: hoist json import (7 inline copies removed).
- pocketbase_store: move _VALID_ID/_validate_id below the import block.
- rename misleading mastered_pct -> avg_mastery_pct (service + web consumers).

Frontend:
- learning [bookId] page uses lib fetchProgress (apiFetch -> auth redirect)
  instead of a raw credentials fetch; track/clear the retry + auto-advance
  timers on unmount; drop dead currentStage state + ModuleTree prop.
- learning-api: remove orphaned submitAnswer + AnswerRequest.
- CreateModuleDialog: use the static bookApi import; reset manualBookId to ''
  to match initial state; learning list page: stop shadowing the t() translator.

Conflict-resolution carryover: dropped the PR's incidental 300s factory timeout
(kept dev's stream runner).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 14:28:32 +08:00
whf
a0ee477ff9 fix: ruff auto-fix (22 issues), mypy type fixes for KnowledgeType 2026-05-21 14:41:51 +08:00
unknown
c2dd63d7ef fix: use module-level lock for save/save_cas across all store instances (P2-10)
The per-instance _cas_lock only serialized save_cas on the same
LearningStore instance. save() was unprotected and request handlers
create fresh instances. Moving to a module-level _cas_lock ensures
compare-and-semantics hold across concurrent requests.
2026-05-20 10:26:52 +08:00
unknown
c4c411abb0 fix: make save_cas atomic with a threading lock (P2-8)
The previous check-then-write was not atomic — two concurrent callers
with the same expected_version could both pass the version check and
write, with the last writer silently dropping the first update.
2026-05-20 10:16:17 +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
whf
a27b2749f0 fix: preserve question metadata in save_question_answers merge; clear feynman_retries on redo 2026-05-19 22:25:34 +08:00
whf
1e9f2a56d5 fix: load_question_answers backward compat with dict values from save_question_meta 2026-05-19 22:18:54 +08:00
unknown
e70a24d574 fix: server-side KP/module mapping, remove client-trusted fields (Block5) 2026-05-19 21:58:09 +08:00
whf
fb7787b089 Block 5+6: DELETE/redo endpoints, change_module WS, LLM progress hints 2026-05-16 23:33:56 +08:00
whf
3fd2d8e809 Block 2: backend list_all + list_progress + GET /progress endpoint 2026-05-16 21:53:22 +08:00
whf
526bc1c550 Block 17: Server-side question answer persistence, eliminate client-supplied expected_answer 2026-05-14 21:05:52 +08:00
unknown
08e1829fde fix(C4): remove router singleton race condition + use unique tmp filenames in atomic write 2026-05-12 14:45:59 +08:00
whf
50a6e14793 Block 2: Add JSON storage layer for LearningProgress with path traversal protection 2026-05-06 01:54:13 +08:00