Commit Graph

117 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
04cc156fa8 daily update 2026-06-13 19:51:44 +08:00
Bingxi Zhao (Frank)
171b1cc2d2 release: v1.4.4 — ClawHub skill hub, real KB document previews
A focused cut on top of v1.4.3:

- Skill hub: install community skills from ClawHub (and any compatible
  registry via settings/skill_hubs.json) — provider abstraction in
  services/skill/hub.py, new `deeptutor skill search/install/list/remove`
  CLI, admin-only install endpoint for multi-user (install ≠ assign).
  Every import runs a security gate: hub verdict check, zip-slip/zip-bomb
  guards, text/script suffix whitelist, `always:` frontmatter stripped,
  provenance recorded in .hub-lock.json.
- KB previews: new /knowledge/{kb}/file-preview-text/{filename} endpoint
  serving extracted plain text; KB Files tab renders real in-browser
  DOCX/XLSX previews; DOCX previewer scales pages to fit narrow panels.
- Markdown previews allow safe raster data:image URLs on <img src>
  (react-markdown strips all data: URLs by default); script-capable
  schemes stay blocked.
- All ten localized READMEs re-synced with the English README.
- Docs (deeptutor.info): `deeptutor skill` reference, hub-install notes on
  Space and multi-user pages, KB file routes in the server API table
  (en + zh).
- CLI docs contract test updated for partner/skill subcommands.

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-13 03:58:28 +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)
062f401195 feat(partners): live streaming for telegram/discord/feishu + unavailable-channel surfacing
- telegram: send_delta via progressive edit_message_text (throttled,
  flood-control retry, HTML final render, mid-stream overflow split)
- discord: send_delta via REST POST/PATCH with rate-limit retry; send()
  now raises on failure so the manager retry applies
- feishu: send_delta via CardKit streaming cards (create → sequenced
  stream updates → close streaming_mode, regular-card fallback)
- registry: discover_all_with_errors keeps import-failed channels
  diagnosable; schema API marks them available:false with the reason;
  UI grays them out and shows the missing-dependency message instead
  of silently dropping them (the "why is X missing?" class of bugs)
- 10 new streaming contract tests; 343 partner tests green; tsc clean

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 22:39:49 +08:00
Bingxi Zhao (Frank)
46093e5e2b update msg 2026-06-11 20:03:34 +08:00
Bingxi Zhao (Frank)
da1061910b feat(partners): production IM infra — retry/dedup/coalescing, per-channel delivery flags, stream-delta protocol, slack/telegram connection fixes
- manager: exponential-backoff retry (send_max_retries), origin-scoped
  duplicate suppression, _stream_delta coalescing, per-channel
  send_progress/send_tool_hints gating (global AND channel override)
- base: send_delta/supports_streaming protocol, _wants_stream injection
- runner: live stream segments per loop round (turn_id:call_id), narration
  rounds freeze on completion, final reply marked _streamed when delivered
- telegram: split API/polling HTTPX pools (pool exhaustion fix), trim
  legacy nanobot command menu, raise on send failure for manager retry
- slack: Socket Mode handshake timeout + WSS diagnostics, send raises
- schema: DeliveryOverrides/StreamingSupport mixins on channel configs
- partners/network.py: strict SSRF validator for channel media downloads
- icons: correct WeCom mark (TDesign outline, official brand palette)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 17:43:08 +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
Bingxi Zhao (Frank)
b2ce70db69 Merge pull request #500: Guided Learning (mastery-based tutoring subsystem)
New self-contained deeptutor/learning/ subsystem (models, storage, service,
scheduler, grading) + 12-stage guided_learning capability, REST router, and
web learning pages, with 164 tests.

Conflict resolutions:
- services/llm/factory.py: kept dev's stream runner (allow_image_fallback
  multimodal path); dropped the PR's incidental 300s asyncio.wait_for wrapper
  and its now-orphaned TimeoutError handler / unused logger — the blanket
  timeout is unrelated to guided learning, dev already has consumer-side
  timeouts, and 300s would truncate long legitimate streams (book/research).
- web/components/sidebar/WorkspaceSidebar.tsx: kept dev's structure, added a
  useCallback handleNewChat that cancels any in-flight streaming turn before
  newSession() (mirrors handleDeleteSession) and wired it to onNewChat.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:44:05 +08:00
Bingxi Zhao (Frank)
56a87d3f72 Merge pull request #529: Qwen JSON preamble, force-recompile overview pages, health false positives
Book Engine fixes for local/Qwen models: robust JSON parsing, force-recompile
now resets overview pages, regenerate_block finalizes the book, and
scan_log_health no longer flags repeated successes as failures.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-29 13:36:32 +08:00
Bingxi Zhao (Frank)
c54743bfb0 improve chat 2026-05-28 22:01:26 +08:00
Truffle
69ea8b3c90 fix(auth): make require_auth async so the user ContextVar reaches the endpoint (#485)
Fixes #481. Makes `require_auth` and `require_admin` `async def` so the user ContextVar set inside the dep is visible to async endpoints; sync deps run via `anyio.to_thread.run_sync` under `copy_context()` and the set is discarded on return.
2026-05-28 17:43:23 +08:00
Name Card Scanner Dev
4c611c63f4 Merge remote-tracking branch 'origin/main' into fix/local-patches-win-utf8 2026-05-28 02:21:13 +08:00
Bingxi Zhao (Frank)
6c024857b7 release: v1.4.1 — security & stability patch
Security: lock down the TutorBot tool sandbox (shell exec is opt-in, all
filesystem/shell access confined to the bot workspace) and isolate per-user
resources, closing #518, #517, #516, #515, #514 and #506 (first hardened in
#507).

Bug fixes: chat input disabled after the first turn (#520), KB embedding
failure on long documents (#521 / #509), profile creation under Docker
(#512 / #513), Qwen reasoning models failing native tool calling (#527 / #528),
the GPT-5 init-wizard token parameter (#508), and oversized session-event
truncation (#524).

Features: HTTP/SSE API for multi-turn chat with a specific TutorBot (#511),
multimodal image fallback for vision-capable providers without a capability
entry, safe ZIP knowledge upload, and a /settings/network page with model
fetching (community PRs #522 and #523 reimplemented locally).

Also bumps __version__ to 1.4.1, adds the v1.4.1 release notes, updates the
README Releases section, and ships the Astro + Starlight docs site under site/.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-27 23:16:00 +08:00
xiongjnu
c1932dcb0a feat: truncate oversized event payloads in session response (#524)
RAG tool results can return KB document content exceeding 1MB per event,
causing the frontend TraceSurface to run out of memory when loading large
sessions. Truncate tool_result and observation payloads at 1MB in the
get_session endpoint, marking truncated events with _truncated: true.

The LLM context builder reads from a separate content-only store and
is unaffected by this truncation.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 20:22:08 +08:00
Name Card Scanner Dev
262de248bd fix: Windows UTF-8 encoding, Deep Research guard, notebook import, startup scripts
- Fix UnicodeEncodeError 'gbk' on Windows by setting encoding='utf-8' on
  stdout/stderr reconfigure in run_server.py
- Guard Deep Research send to prevent 'settings are incomplete' crash
- Add lazy import for notebook_manager in services/__init__.py
- Add start_backend.bat with PYTHONIOENCODING=utf-8 and PYTHONUTF8=1
- Add start_frontend.bat convenience script
- Document all patches in PATCHES.md for re-apply after upstream sync
2026-05-27 15:40:33 +08:00
Bingxi Zhao (Frank)
6153d8c092 release: v1.4.0 — release notes, version bump, repo hygiene
- Add assets/releases/ver1-4-0.md covering deltas since v1.4.0-beta
  (reasoning_effort normalization, tool-schema fallback, restart-safe
  turn runtime, frontend placeholder hardening, CLI chat REPL config).
- Bump deeptutor/__version__ to 1.4.0.
- Update README Releases section: v1.4.0 at top, install opt-in note
  updated for stable.
- Fix pre-existing pre-commit failures so the v1.4.0 cut runs clean:
  bandit B324 (mark _sha1 as non-security), mypy no-redef in
  document.py / line_doc.py, mypy arg-type/assignment in
  snapshot/adapters.py, mypy assignment + arg-type in
  services/memory/settings.py, mypy func-returns-value on
  set.add idiom in deeptutor_cli/init_wizard.py.
- Apply ruff format / prettier sweep across the repo.
- Remove stale workspace + i18n env example + playwright captures
  already cleaned locally; ignore .playwright-cli/ going forward.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-22 21:09:22 +08:00
unknown
77b24725c5 merge: upstream/dev into feature/guided-learning
Resolved 8 conflicts:
- agentic_pipeline.py: keep `import asyncio` (ours)
- deep_question.py: accept upstream's removal of answer_now fast-path
  (refactored into agentic engine in upstream 23ca302); drop dead
  helpers _parse_answer_now_json, _collect_cost_summary, and the
  legacy _run_mimic_mode overload
- pocketbase_store.py, WorkspaceSidebar.tsx, en/zh app.json: keep ours
- playground/page.tsx: keep ours (apiFetch + RESEARCH_SOURCE_OPTIONS),
  also remove pre-existing duplicate top-of-file block left over from
  the earlier a8801f9 merge; add `type ResearchSource` import
- reporting_agent.py: accept upstream's deletion
2026-05-21 23:26:53 +08:00
Bingxi Zhao (Frank)
90a2c14c81 chore: backend + frontend follow-ons for v1.4.0-beta
Wires the new memory / capability / settings / quiz subsystems into
existing surfaces and finishes the chat-pipeline follow-on work.

Backend:
- Session services pick up the cumulative source inventory + new tool
  tags (turn_runtime, sqlite_store, pocketbase_store, protocol,
  base_session_manager).
- LlamaIndex RAG pipeline config / document_loader / retrievers
  tightened; rag/service.py routed to match.
- Sessions / unified_ws / settings / notebook routers updated for
  delete-chat-turn, multi-user, and the new tool surface.
- TutorBot manager + Zulip channel + openai_compat_provider follow-on
  fixes layered on top of the v1.3.10 SSL/Zulip sweeps.
- runtime/{banner, launcher, orchestrator}, services/setup/init,
  prompt/manager, json_parser refined for the runtime-settings
  rewrite.

Frontend:
- Co-Learn pages and session-surfaces removed (folded into chat).
- Chat composer / messages / trace / session panels, sidebars,
  common modals, markdown renderers, and i18n updated for the new
  ask_user / write_note / source-inventory flow.
- Admin, agents, co-writer, playground, book pages picked up the
  shared updates.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:08:22 +08:00
Bingxi Zhao (Frank)
4df05d02da feat(quiz/book): quiz follow-up chat composer, GeoGebra viewer, book updates
Quiz follow-up:
- New FollowupChatComposer + QuizFollowupContext let the user start a
  chat thread directly from a quiz question. The composer reuses the
  main ChatComposer (look, @space pickers, KB picker, attachments,
  LLM selector) but routes sends through a dedicated follow-up
  controller.
- New quiz_judge router + quiz-judge.ts helper power judging
  follow-up answers inline.
- The older QuestionFollowupPanel.tsx is removed; QuizConfigPanel /
  QuizViewer are updated to the new follow-up surface.

GeoGebra viewer:
- New Geogebra.tsx applet renderer (loaded via the official GGB
  applet script) so geometry / algebra snippets can open inline
  alongside chat answers. GeogebraOpenCTA + GeogebraTabContext add
  the tab plumbing.

Book updates:
- book/blocks/quiz.py + book/engine.py + storage.py and the related
  book components pick up the new quiz surface.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:07:39 +08:00
Bingxi Zhao (Frank)
acd0d9329d feat(capabilities): unify infra, merge Animator into Visualize, split settings UI
Capability infrastructure:
- New capabilities/_shared.emit_capability_result helper fills the
  result envelope (label, summary, payload, render hints, UsageTracker
  totals) consistently across modes.
- StatusI18n loads capability status copy from
  capabilities/prompts/{en,zh}/<name>.yaml; legacy main.yaml strings
  removed.
- New capabilities_settings router + service-config module power the
  /settings/capabilities admin page (live capability list, defaults,
  per-capability overrides).

Visualize + Animator merge:
- Visualize's AnalysisAgent now picks one of six render_types:
  svg / chartjs / mermaid / html (text pipeline) or manim_video /
  manim_image (Manim subprocess). The result envelope carries
  render_type so the frontend delegates to the right viewer.
- math_animator capability is folded behind Visualize; the standalone
  MathAnimatorConfigPanel.tsx is removed. The Animator sidebar entry
  is gone, but Manim outputs and existing records remain unaffected.

Settings UI:
- /settings page split into appearance / capabilities / embedding /
  llm / mcp / memory / search / status / tools tabs with a shared
  layout and items index.
- New /settings/tools page lists chat-mountable tools and surfaces
  availability (e.g. gh for github_query) via a new tools router.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:06:14 +08:00
Bingxi Zhao (Frank)
23ca3024be refactor(agents): rebuild Deep Research / Deep Solve / Question on agentic engine
Replaces three bespoke multi-agent pipelines with orchestrators on top
of a shared agentic-engine primitive set (core/agentic/: labeled_step,
loop, tool_dispatch, usage, client). Each capability now lives in one
pipeline.py file with one pipeline.yaml prompt.

- Deep Research: Rephrase (ask_user loop) -> Decompose (OUTLINE) ->
  Research blocks (THINK/TOOL/APPEND/FINISH per topic, dynamic queue
  preserved) -> Reporting (OUTLINE/INTRO/SECTION/CONCLUSION).
  CitationManager and the dynamic topic queue are kept.
- Deep Solve: Pre-retrieve (KB-only, QUERIES/rag/SUMMARY) -> Plan ->
  per-step THINK/TOOL/FINISH/REPLAN loop with back-edge to Plan ->
  Synthesize. Step FINISH text flows into the next step's context.
- Question: coordinator + pipeline replace generator / idea_agent /
  models, with new history.py and mimic_source.py helpers.

Removed: research/agents/, research/research_pipeline.py,
research/prompts/{en,zh}/*.yaml (legacy multi-agent prompts);
solve/agents/, solve/memory/, solve/utils/, main_solver.py,
session_manager.py, tool_runtime.py and old prompts;
question/agents/{generator,idea_agent}.py, example.py, models.py,
old prompts; api/routers/solve.py (capability owns its own routing).

Adds shared agents/_shared/tool_composition.py for cross-pipeline
tool wiring. Updates deep_research/deep_solve/deep_question
capabilities to dispatch through the new pipelines.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:03:44 +08:00
Bingxi Zhao (Frank)
2b7242081f feat(memory): three-layer memory subsystem (L1/L2/L3) with workbench
Replaces the flat single-blob memory page with a structured store:
- L1 captures raw run traces; L2 holds normalized document records;
  L3 holds curated slots per surface (chat, notebook, book, TutorBot).
- New consolidator pipeline (chunker, guards, parse, references, runs,
  modes, line-doc, meta) turns traces into versioned line-oriented
  documents with stable ids and snapshot history.
- Per-user isolation flows through PathService; the store API is
  stateless.

UI ships a dedicated /memory workbench with graph / L1 / L2 / L3 /
resolve subpages, plus a reusable MemorySection embedded where the
legacy panel lived.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:02:32 +08:00
whf
a0ee477ff9 fix: ruff auto-fix (22 issues), mypy type fixes for KnowledgeType 2026-05-21 14:41:51 +08:00
whf
a8801f929a merge: guided-learning-v2 into feature/guided-learning (target dev)
Resolved 10 conflicts:
- api/main.py: kept dev CORS config
- unified_ws.py: kept dev auth flow (ws_require_auth)
- builtin_capabilities.py: added guided_learning + auto capabilities
- pocketbase_store.py: merged both additions
- ChatMessages, WorkspaceSidebar, chat/playground pages: merged both additions
- en/zh app.json: added comma, validated JSON
2026-05-21 13:18:41 +08:00
unknown
707aaab4b7 fix: pre-launch P1/P2 blockers — failure count reset, notebook escaping, E2E test
- P1-B: Reset stage_failure_counts on LLM success in _call_llm_with_degradation
  so a recovered stage is not permanently penalized by prior transient failures
- P1-A: HTML-escape notebook records (<, >, &) before embedding in
  <notebook_records> XML tags to prevent prompt injection; truncate type to 50 chars
- P2-A: Remove redundant `except (Exception, asyncio.TimeoutError)` (3 places)
  since Python 3.11+ TimeoutError is already a subclass of Exception
- P1-C: Add E2E flow test covering PRETEST → EXPLAIN → FEYNMAN_CHECK →
  PRACTICE_QUIZ → ERROR_DIAGNOSIS → MODULE_TEST → REVIEW → COMPLETED

164 tests pass.
2026-05-21 11:16:39 +08:00
unknown
edfdd1535e fix: sanitize notebook LLM output type and module name
- Add ALLOWED_KP_TYPES whitelist (memory/concept/procedure/design), fallback to concept
- Strip and truncate module name to 200 chars
2026-05-21 02:12:20 +08:00
unknown
ec63d0f566 fix: reset stage_failure_counts and feynman_explanations on /redo
Without this, users who accumulated 4+ failures on a stage would find
it permanently skipped even after redo, with no self-service recovery.
2026-05-21 01:26:16 +08:00
unknown
7099424354 fix: strengthen prompt injection protection in generate-from-notebook
- Wrap user content in <notebook_records> XML tags for trust boundary
- Strengthen system prompt to explicitly treat tagged content as data
- Sanitize LLM output: strip, truncate to 200 chars, skip names < 2 chars
2026-05-21 01:04:22 +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
f83e950dd8 fix: mark stale turns cancelled before reporting no active turn (P2-11)
After server restart, persisted "running" turns have no live execution.
Mark them cancelled so create_turn won't reject the upcoming start_turn.
2026-05-20 10:35:16 +08:00
unknown
37aafbb73d fix: send module_changed before cancelling active turn (P2-9)
Reorder change_module handler: send module_changed first, then cancel
the active turn, then save progress. This ensures the frontend processes
the module switch before receiving any cancellation error, preventing
the UI from getting stuck on a "Turn cancelled" dead end.
2026-05-20 10:25:52 +08:00
unknown
5bb807ab7e fix: cancel active turns before replace-modules via HTTP (P2-7)
The WS change_module path cancels active turns to prevent stale
progress overwrites, but the HTTP /replace-modules endpoint was
missing this protection. A concurrent turn's finally block could
restore old modules after replacement.
2026-05-20 10:16:13 +08:00
unknown
c40628346a fix: add continue after change_module to prevent spurious error (P2-3)
The change_module handler fell through to the generic unknown-type
error, so every module switch sent both module_changed and an error.
2026-05-20 10:08:17 +08:00
unknown
261865c2a5 fix: split init_modules into replace/merge (P2-2)
- Add replace_modules() that cleans stale KP state (mastery, repetition, errors, feynman)
- Rename init_modules to merge_modules, keep alias for backward compat
- Add /replace-modules API endpoint for full module replacement
2026-05-20 00:21:15 +08:00
unknown
b611c2b11c fix: restore active turn on page refresh (P1-8)
- Add check_active_turn WS message handler returning turn_id + status
- Frontend sends check_active_turn on connect instead of start_turn
- If active turn exists, subscribe_session to resume; otherwise start_turn
2026-05-20 00:20:26 +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
unknown
1f7c3feae0 fix: use JSON-structured records in notebook prompt, prevent injection (Block2) 2026-05-19 22:07:07 +08:00
unknown
e70a24d574 fix: server-side KP/module mapping, remove client-trusted fields (Block5) 2026-05-19 21:58:09 +08:00
unknown
2a49676a68 fix: unify grade_answer, remove substring false positive (Block4) 2026-05-19 21:52:16 +08:00
whf
d086a06b90 Fix 3 P2 bugs from Codex global review: manual module id collision, stale chapters on book switch, stage not reset on module switch 2026-05-17 12:56:24 +08:00
whf
97496d6511 Block 9: backend endpoint tests (21 new + 3 list_all), fix stale local HTTPException imports 2026-05-17 02:42:09 +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
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
6f3070f8d3 Block 21: Auto-mastery calculation, mock module cleanup, quiz_attempts tracking, global review passed 2026-05-15 00:58:34 +08:00
whf
315b5d0da0 Block 18: StreamBus wait_for_input bidirectional mechanism with bus registry 2026-05-14 22:28:10 +08:00
whf
526bc1c550 Block 17: Server-side question answer persistence, eliminate client-supplied expected_answer 2026-05-14 21:05:52 +08:00