Commit Graph

14 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
dcb9bce8df release: v1.4.5 — Guided Learning on the chat loop + loop-plugin framework
Guided Learning is rebuilt on the chat agent loop: the bespoke stage
machine is gone, replaced by a tutor chat driving a hard, per-type mastery
gate, with the /learning page reworked into a status dashboard. Existing
learning progress loads unchanged.

A new loop-plugin framework (deeptutor/loop_plugins/) makes the chat loop
extensible — mastery is the first plugin, contributing its tools, system
block, and server-owned kwargs without the pipeline hard-coding it — and
the loop gains context-checkpoint folding. Partner Chat/Archive
conversations gain Markdown export + save-to-notebook (one shared
serializer), and every chat turn now signals done the moment the answer is
saved so the composer/clock free up before title generation.

Bump __version__ to 1.4.5, add assets/releases/ver1-4-5.md, archive notes
older than two weeks into past_releases/ (fixing the one cross-link that
crosses the boundary), and add the README release row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-14 01:10:49 +08:00
Bingxi Zhao (Frank)
04cc156fa8 daily update 2026-06-13 19:51:44 +08:00
Bingxi Zhao (Frank)
452de66729 release: v1.4.3 — TutorBot→Partners, single-loop Chat, real multi-user isolation
The biggest cut since v1.4.0:

- Partners: TutorBot renamed and rebuilt on the product chat agent loop —
  production IM pipeline (retry/dedup/coalescing, per-channel delivery),
  live streaming on Telegram/Discord/Feishu, new WeCom AI Bot channel
  (15 connectors), web-chat attachments, soul template library + editor.
  Automatic non-destructive migration from data/tutorbot/; HTTP API moved
  to /api/v1/partners.
- Chat: single exploring agent loop with native tool calling; Activity
  header with collapsible thinking/tool trace.
- Multi-user: per-user grants v2 (tools/MCP/exec), data/users + data/system
  layout with automatic migration, runner mounts only the user workspace.
- Visualize: inline themed SVG, structured prompts, local validate+repair
  replacing the LLM review round.
- Co-writer Mermaid diagrams + selection RAG/web; file viewer docx/xlsx
  previews; MinerU cloud parsing backend; office skills on by default;
  CLI chat renderer rewrite.
- Docs rebuilt at deeptutor.info: per-channel setup guides (en+zh),
  refreshed screenshots.
- Pre-commit clean sweep: defusedxml for SVG validation, usedforsecurity
  flags on content hashes, mypy fixes, types-croniter stub.

Release notes: assets/releases/ver1-4-3.md

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 17:17:43 +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
unknown
c6faab4dfc fix: frontend error handling, submit debounce, i18n, API format adaptation
fetchProgress catch block logs warning instead of silently swallowing.
Submit button protected by submittingRef to prevent double-sends.
Four hardcoded English strings replaced with i18n keys.
fetchAllProgress adapted to new {summaries, errors} API format.
book/page.tsx updated for new fetchAllProgress return type.

P2-4, P2-5, P2-6
2026-05-20 12:51:16 +08:00
whf
95f4498942 Block 22: display module name on /learning cards instead of raw book_id
Backend: list_progress() derives display name from first module name,
falling back to book_id for empty-module books.
Frontend: ProgressSummary gains 'name' field, card heading uses
card.name || card.book_id instead of raw book_id.
Tests: 2 new negative tests (name from module, empty-module fallback).

92/92 passing.
2026-05-18 20:40:47 +08:00
whf
7b273d8db8 Block 8 refinement: remove KB placeholder tab, use bookApi.list, LLM parsing type safety, toast on import failure 2026-05-17 02:22:36 +08:00
unknown
64989bd3e7 Block 7+8: Book integration + Create Module dialog (4 tabs)
Block 7: "Start learning" button on BookLibrary cards, import-from-book
endpoint, handleLearn with duplicate progress check, i18n keys.

Block 8: CreateModuleDialog with manual/book/KB/notebook tabs,
generate-from-notebook backend endpoint with LLM extraction,
listBooks/generateModulesFromNotebook API functions, 30+ i18n keys.
2026-05-17 00:05:16 +08:00
whf
cdc1b73ed8 Block 7: /book integration — Start Learning button in BookLibrary 2026-05-16 23:52:15 +08:00
whf
4aaef7cc41 Block 3: frontend API client + multi-book page redesign with tab panel, delete/redo 2026-05-16 22:32:17 +08:00
whf
526bc1c550 Block 17: Server-side question answer persistence, eliminate client-supplied expected_answer 2026-05-14 21:05:52 +08:00
whf
22336e648e Block 16: Server-side answer grading, remove client-supplied is_correct/mastery_estimate 2026-05-14 20:29:34 +08:00
whf
92ae45e361 Block 10+11: Module list page with progress cards + learning-api client 2026-05-14 05:12:01 +08:00