4771 Commits

Author SHA1 Message Date
wedone
71e4396b92 fix(settings): add profile button when no profiles exist (#513)
When the LLM/Embedding/Search settings page has no profiles configured, the UI displayed 'No profiles configured. Add a profile to start.' but provided no button to actually add one. The add-profile button was only visible inside the profile editor, which never rendered when the list was empty - creating a dead end for new users.

Add a '+ Profile' button in the empty-state view, matching the existing button style used in the profile editor.

Closes #512, Closes #505
2026-05-27 20:21:24 +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
unknown
daa0c4bd4b chore: remove web/.env.local (auto-generated local config)
This file is auto-generated by start_web.py and should not be tracked.
Upstream/dev already removed it.
2026-05-23 23:57:37 +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>
v1.4.0
2026-05-22 21:09:22 +08:00
Bingxi Zhao (Frank)
81d081d968 update readme 2026-05-22 20:36:55 +08:00
Bingxi Zhao (Frank)
921b1d6cff update readme 2026-05-22 20:32:02 +08:00
Bingxi Zhao (Frank)
ca7916bc57 fix: docs, docker deployment & official web 2026-05-22 20:19:32 +08:00
Bingxi Zhao (Frank)
c9a833f7c3 update readme 2026-05-22 02:12:46 +08:00
Bingxi Zhao (Frank)
206b775ad4 fix: unblock v1.4.0-beta release — Docker build + CI test alignment
web/lib/api.ts: defer NEXT_PUBLIC_API_BASE placeholder check from
module-load to first call. Docker bakes the literal placeholder for
runtime sed substitution, but Next.js evaluates this module during
static export of every prerendered page — the old throw failed the
admin/users page export and aborted the entire build.

Test alignment with shipped code (no behavior change):
- test_path_service: override _workspace_root alongside _project_root,
  since get_memory_dir() reads workspace_root, not _user_data_dir.
- test_meta_settings: assertions now match shipped defaults
  (l2_budget=20, min_chunk_chars=1000, max_chunk_chars=64000).
- test_unified_ws_turn_runtime + test_regenerate: drop emit_calls
  assertions; turn_runtime doesn't emit a memory trace after chat
  turns (feature was never wired up).
- test_turn_runtime_subscribe: 200 polls × 10ms instead of 20 × 0,
  Python 3.14's asyncio scheduler doesn't give sleep(0) enough ticks
  for the subscriber-append race.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
v1.4.0-beta
2026-05-22 00:21:41 +08:00
Bingxi Zhao (Frank)
0af2e7e0e1 update pypi 2026-05-22 00:02:44 +08:00
unknown
51af1c1f9e chore: drop unused asyncio import; refresh PR description
- deeptutor/agents/chat/agentic_pipeline.py: `asyncio` was only
  referenced in a docstring, ruff F401 flagged it.
- PR_DESCRIPTION.md: refresh diff stats (71 files, +7,284 / -99),
  test/endpoint counts, and base branch (upstream/dev), reflecting
  the cleaned merge state.
2026-05-21 23:57:14 +08:00
Bingxi Zhao (Frank)
4a1543e3c1 ci: drop docs.yml workflow
VitePress GitHub Pages deploy is not in use; remove the workflow added
alongside the pypi-release fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 23:56:18 +08:00
Bingxi Zhao (Frank)
c4b96e74e5 ci: untrack .github from gitignore and add pypi-release/docs workflows
The .github entry in .gitignore silently excluded pypi-release.yml and
docs.yml from version control, so the PyPI publish workflow never reached
the default branch and didn't fire for release events.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 23:55:45 +08:00
Bingxi Zhao (Frank)
de08fde9e1 docs: update readme 2026-05-21 23:43:06 +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)
f8c76f4ff2 update logo 2026-05-21 21:32:13 +08:00
Bingxi Zhao (Frank)
a4bc7e0799 docs:add logo 2026-05-21 21:29:37 +08:00
Bingxi Zhao (Frank)
ff8b6a6d80 docs: figs&docker settings 2026-05-21 21:16:53 +08:00
Bingxi Zhao (Frank)
589327a49b docs(readme): drop %20 padding inside language pills, match ragflow spacing
Restores shields.io default internal padding on each pill and keeps
the single &nbsp; between pills. Height stays at 40 so the glyphs
read at the size we landed on.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:48:02 +08:00
Bingxi Zhao (Frank)
5059495ec4 chore(assets): compress dt-memgraph.png (2.3 MB → 446 KB)
Resize from 2940 px wide to 1600 px and palette-quantize to 256 colors,
keeping text/labels readable while bringing the file in line with the
other dt-*.png screenshots used in the README.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:40:38 +08:00
Bingxi Zhao (Frank)
17a72797cd docs(readme): bigger language pills, tighter gap, breathing room inside
- height 36 -> 40 so glyphs read clearly without a magnifier
- &nbsp;&nbsp; gap between pills -> single &nbsp; so the row stays
  compact
- one leading + trailing %20 space inside each badge label so the
  text doesn't kiss the pill edges

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:34:56 +08:00
Bingxi Zhao (Frank)
09d3743777 docs(readme): bump language-pill height to 36px for larger glyphs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:29:57 +08:00
Bingxi Zhao (Frank)
d1c263fb71 docs(readme): add &nbsp; gaps between language pills
Inserts two non-breaking spaces between each language pill so the
row reads less cramped without forcing a wrap.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:20:54 +08:00
Bingxi Zhao (Frank)
cfa6cd419b docs(readme): scale language pills to height=28 for a chunkier hit area
Bumps the language-switcher SVGs to 28px tall so the pills line up
better with the Trendshift badge above and the Python / Next.js
shields below, and gives the labels a more readable text size on
high-DPI displays.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:18:00 +08:00
Bingxi Zhao (Frank)
4a483e07e6 docs(readme): rewrite Explore + Key Features for v1.4.0-beta, drop Roadmap section
- Rewrite Explore DeepTutor section around v1.4.0-beta surfaces:
  Chat (5 modes + Auto + new tools), Co-Writer (split editor),
  Book (GeoGebra viewer + fingerprints), Knowledge Bases (LlamaIndex,
  versioned indexes), Space (Chat History / Notebooks / Q-Bank / Skills),
  three-layer Memory (L1/L2/L3 + Memory Graph), unified Settings.
- Update Key Features to match: 5 chat modes, composable tools (ask_user,
  web_fetch, write_note, list_notebook, github_query), Space, three-layer
  Memory, unified Settings + UsageTracker.
- Swap removed figures (dt-knowledge.png, tb.png) for new ones
  (dt-kb.png, dt-memgraph.png, dt-settings.png, dt-space.png,
  dt-tutorbot.png); refresh dt-chat / dt-cowriter / dt-memory.
- Delete the static Roadmap section; add a pointer to issue #498
  near the welcome-PR note at the top so the roadmap stays open.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:10:40 +08:00
Bingxi Zhao (Frank)
b2aa9bfb4a docs(readme): fix Arabic/Hindi/Thai badge rendering, darken pill colors
shields.io uses Verdana/Helvetica fallbacks that lack proper text
shaping for Arabic (RTL join), Devanagari (combining marks), and
Thai (combining tone marks), so the native names rendered as
separated, broken glyphs. Switch those three to ASCII names
(Arabic / Hindi / Thai) to mirror ragflow's same workaround; the
links still resolve to the Arabic / Hindi / Thai README files.

Also bump pill colors from DBEDFA / DFE0E5 to BCDCF7 / CDCFD4 so
they read better against the page background.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:10:19 +08:00
Bingxi Zhao (Frank)
2bcc8bfff2 docs(readme): adopt ragflow-style pastel language pills
Drops the flat-square shields in favor of the lighter ragflow pattern:
an HTML <p align="center"> wrapper with <a><img> pills using DBEDFA
(soft blue) for the active English link and DFE0E5 (soft grey) for
the ten translations. The header now reads cleaner alongside the
existing Trendshift / Python / Next.js / License badges.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:05:06 +08:00
Bingxi Zhao (Frank)
7a36e87dbf docs(readme): switch language switcher to badge pills, place under trending
Replaces the flag-based language line at the bottom of the header
with shields.io badge pills positioned right under the Trendshift
badge. English is highlighted (blue), the ten translations use a
neutral grey. Same destinations as before.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 19:00:25 +08:00
Bingxi Zhao (Frank)
0ab5750eba docs(readme): note --pre install path for v1.4.0-beta
PyPI normalizes ``1.4.0-beta`` to ``1.4.0b0``, so the default
``pip install -U deeptutor`` stays on the latest stable. Add a short
callout under Option 1 covering ``pip install --pre`` and the exact
``deeptutor==1.4.0b0`` pin.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:22:15 +08:00
Bingxi Zhao (Frank)
2c1b8e56b2 release(1.4.0-beta): docs, version bump, CLI init wizard, packaging
- __version__.py bumped to 1.4.0-beta; pyproject.toml adds the
  ``deeptutor`` package-data globs so prompt YAMLs / capability
  prompts / Markdown templates ship in the PyPI wheel.
- New assets/releases/ver1-4-0-beta.md covers Auto Mode, Memory v2,
  agentic-engine rewrite, chat + LlamaIndex RAG refactor, new chat
  tools, Visualize+Animator merge, settings split, capabilities
  unification, multi-user / Zulip fixes, env/launcher rewrite.
- README.md adds the v1.4.0-beta entry at the top of the release
  notes; v1.3.0 rolls into the collapsed past-releases block.
- deeptutor_cli gains init_wizard.py (interactive provider menu,
  env-var auto-detect, live model-list fetch with curated fallback,
  optional connectivity probe) and a shared _tool_result helper;
  chat / common / config_cmd / init_cmd / provider_cmd updated to
  match.
- Removed legacy scripts/ helpers (_cli_kit, audit_prompts,
  check_install, generate_roster, migrate_kb, migrate_user_data,
  sync_prompts_from_en, test_embedding, test_llm_api) -- replaced by
  CLI subcommands or no longer relevant.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:08:50 +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)
7bdb10b700 feat(chat): Auto mode router + new chat tools (ask_user, web_fetch, etc.)
Auto capability (agents/auto/) gains a three-stage agent loop:
ANALYZING (one LLM call, streamed as thinking) -> DELEGATING (router
emits delegate_to_<cap> tool calls or atomic tool calls, with bounded
retries and a same-cap quota) -> SYNTHESIZING (final inline answer).
Sub-capability events flow through forward_events with call_id tagging
so conversation history keeps only Auto's own synthesis.

New chat-mountable tools:
- ask_user: pauses the turn for 1-3 structured questions, frontend
  renders a card the user navigates and submits in one batch
- web_fetch: HTTP + readable-content extraction with strict
  scheme/private-IP/size guards (pre-flight + post-redirect)
- write_note: replaces save_to_notebook; append (new record) and
  edit (existing record by id) modes
- list_notebook: read-only index / drill-down listing; only mounted
  when the user has notebooks
- github_query: read-only ``gh`` CLI wrapper (pr/issue/run/repo plus
  GET-only api); no mutation verbs reachable

Updates chat agentic_pipeline.py + agentic_chat.yaml (en/zh) to the
new tool surface and source-inventory contract, refits
tools/builtin/__init__.py as the single place to register
chat-mounted tools and their argument-augmentation wrappers, and
tightens core stream + tool_protocol around tool-result metadata.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 18:05:15 +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
c1aea77577 chore: clean up temp files and update gitignore
- Untrack .claude/settings.local.json (local config, already in .gitignore)
- Add .pytest_tmp/ to .gitignore
- Add 启动 DeepTutor.bat to .gitignore (local script)
2026-05-21 11:36:14 +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
bb60b1dcbd fix: clean feynman_explanations and stage failures on replace_modules
replace_modules() now filters feynman_explanations by new_kp_ids and
clears stage_failure_counts/stage_failure_notes entirely, preventing
stale failure records from skipping stages in newly created modules.
2026-05-21 02:11:47 +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
6c970a7a68 fix: unify list_progress mastery calculation with frontend
Change from threshold-based pass rate (count of KPs >= 0.7) to average
mastery percentage, matching the frontend ModuleTree display logic.
2026-05-21 01:16:03 +08:00
unknown
70e12ea31c fix: isolate internal error details from user-facing messages
- run(): remove exception text from user-visible error message
- error_diagnosis: remove exc from metadata and ai_confirmation
- RAG retrieval: remove exception detail from warning string
- All exception details now only go to logs with exc_info=True
2026-05-21 01:11:07 +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
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
4e072537bc feat: add cross-turn cumulative failure gate for stage degradation
stage_failure_counts was previously write-only. Now _call_llm_with_degradation
checks cumulative failures at entry — if a stage has failed >= 4 times across
turns, it skips directly without attempting LLM calls. Users can reset via /redo.
2026-05-21 01:00:09 +08:00
unknown
e219b0b898 fix: rename passRate to masteryPercent, relax module name validation
- Rename passRate variable to masteryPercent in ModuleTree to match average mastery semantics
- Remove module name requirement from CreateModuleDialog (only KP count matters)
- Sync i18n strings for updated validation message
2026-05-21 00:56:15 +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