Practice notebook entries recorded in one session now share a single
sidebar row, titled by that session with its question count, expandable
to each question's own practice link. Entries without a session (and
sessions that produced one question) keep individual rows, and the
Question Bank, answers and review links are unchanged.
The learning index navigation read gains the existing session id and
title (no new persisted field); grouping happens in the projection.
Sidebar strings added to every locale.
The resource and personalization shelves in the sidebar and command
palette, the tools page section titles and availability notes, and the
system and general workspace names picked the English text directly
outside Chinese. They now go through t(). The settings search heading
and the appearance blurb get their missing catalog entries.
Move the Electron macOS app into the main repository and ship it with every
DeepTutor release.
- apps/desktop: Electron shell that installs a signed bundled runtime and
hosts the web UI; versioned with the bundled core.
- White app icon with the black DeepTutor mark, generated by
scripts/make-icon.swift; redesigned start screen and title bar.
- Shell copy in en/zh/de/fr/pl/uk, starting in English and following the
interface language and theme from DeepTutor Settings, including live changes.
- Web UI labels itself "Open DeepTutor MacOS v<version>" inside the app
(user-agent marker) and "Open DeepTutor Web v<version>" in a browser.
- Sealing refuses a missing or mismatched signing key instead of silently
generating a new one.
- desktop-release.yml builds, smoke-tests and attaches the DMG to each
GitHub Release; Developer ID signing and notarization run when secrets exist.
- tests.yml runs the shell checks.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Remove course pages, APIs and the course_study capability. Add anchored note
threads and reviewed learning-block generation, queued and withdrawable chat
messages, quote attachments, side chats, and the calendar/favorites/navigation
updates.
Keep preview's existing backend architecture. Wire the new features through
its Python application and existing chat engine, retain legacy selected-text
requests, persist mid-turn messages in replay, and restore note context when
regenerating. Leave stored user data intact.
Validate frontend contracts, dependency boundaries, types, 1290 node tests,
840 rendered tests, lint, localization and the production build. Exercise
session/notes/API regressions, 53 chat-engine tests and 20 Python/native
integration tests with isolated runtime data.
- Settings → General gains a classic/modern layout choice; classic is a frozen
snapshot of dev's sidebar and learning dashboard, modern keeps iterating.
Variants differ only through slots, tokens and per-variant CSS on
<html data-ui-layout>; the preference lives in localStorage.
- Modern chrome: warm neutral tokens, WorkspaceMenu header, ⌘K command palette
and keyboard shortcuts, PageBar location strip, swipeable PartnerRoster.
- Remove dead HomeShortcuts, WorkspaceSwitcher and the inline sidebar search
query chain.
* fix(embedding): do not serialize requests when batch delay is zero
The spacing lock was held around every embedding HTTP call, so concurrent indexing stayed serial even when batch_delay was 0.
Fixes#1779
* fix(embedding): treat LAN Lemonade endpoints as keyless local servers
OpenAI-compatible profiles pointed at a private Lemonade port were still required to have an API key, so LlamaIndex knowledge bases failed to initialize.
Fixes#1782
* fix(reading): keep headings that follow fenced code examples
The reader treated any line starting with the fence character as a toggle, so an example fence swallowed every later heading.
Fixes#1641
* fix(learning): hide surfaces a learner account cannot use
The auth status already returned the learning policy, but the sidebar ignored it, and model options answered 403 for those accounts.
Fixes#1222
* fix(github-source): refresh unchanged sync state (#1490)
* test: freeze naive FIXED_NOW for cross-platform TZ stability (#1733)
* test: pin TZ in runtime_context date assertions for cross-timezone stability
* test: freeze naive FIXED_NOW for cross-platform TZ stability
Rework of 568c522f0 per review: datetime.now() returns a naive datetime,
so .astimezone() only attaches the host zone without shifting the calendar
date. The aware frozen clock made astimezone() convert across zones and
west-of-UTC hosts rendered the previous day. Making FIXED_NOW naive fixes
every timezone on every OS (including Windows) with no TZ env or tzset()
global-state churn; the tz-pinning fixture is reverted as unnecessary.
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(partners): lock outbound dispatch timeout semantics (#1763)
_dispatch_outbound's 'except asyncio.TimeoutError: continue' is the 1s
idle-poll timeout on an empty outbound queue, not a message skip: a
cancelled Queue.get() pops nothing and a consume finishing despite the
timeout has its result returned by wait_for. Channel send timeouts are
Exception subclasses retried inside _send_with_retry (backoff 1s/2s/4s,
send_max_retries attempts) and logged on give-up. Document this on the
handler and lock it with focused tests (idle poll then deliver, send
timeout retried in-dispatch, retries exhausted after max attempts).
Co-authored-by: XZH <cto@xzh.ai>
* test: add tex_downloader/tex_chunker toolchain tests (#1748)
Co-authored-by: XZH <cto@xzh.ai>
* test(question): pin mimic websocket error-path and stdout interceptor failure contracts (#1741)
* test(question): pin mimic websocket error-path and stdout interceptor failure contracts
Failure-injection characterization tests for the two DT-22 HIGH findings on
websocket_mimic_generate: the outer error broadcast swallow and the
StdoutInterceptor terminal-write swallow (ex-TeeWrite). Pins that send/write
failures stay isolated, process stdout is always restored, and the websocket
still closes. 现状豁免 recorded in docstrings: the swallows are silent by
design today; surfacing them is a code change outside this test-only card.
* style(tests): reformat question router mimic websocket test for ruff format
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(api): cover learning-records account isolation and read boundaries (#1739)
* test(api): cover learning-records account isolation and read boundaries
Regression protection for GET /api/mastery-paths/reading/records
(#1109/#1130): cross-account invisibility through the real
require_learning_surface auth stack, the 200-entry most-recent-first
activity tail, the empty-account branch, 401 on missing/invalid tokens,
405 on writes, and 400 on conflicting workspace scopes.
* test(api): fix ruff import order and formatting in learning-records tests
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(reading): cover the bilingual EPUB pairing pipeline edge cases (#1738)
* test(reading): cover the bilingual EPUB pairing pipeline edge cases
* style(reading): apply ruff format to bilingual EPUB unit tests
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(storage): lock file library disk-deletion failure paths (#1719)
Merge the six DT-22 regression cases (previously on a separate
test_file_library_deletion.py branch) into the existing per-module
test file, right after the delete_file / hard_delete_file sections:
- successful delete prunes now-empty parents, keeps non-empty ones
and the library root itself
- missing on-disk target is a silent no-op; hard delete still clears
the DB row when the disk file vanished out-of-band
- unlink failure is only logged (list-vs-disk inconsistency window)
- an exception while pruning parents is swallowed: file still
removed, empty dirs left behind, caller unaffected (current
behaviour pinned)
Coverage of deeptutor.services.storage.file_library: 84% -> 87%
(196-197 and 203-206 now covered). No product code changes.
Co-authored-by: XZH <cto@xzh.ai>
* test(book): cover engine stage transitions (#1718)
* test(book): cover engine stage transitions
Pin the three guarantees a long book generation depends on:
stage order with per-stage artefact persistence, single-stage failure
retry without duplicating output (exploration degrade + page-level
compile retry), and pause/resume recovery that never re-pays finished
pages. All agents and the compiler are faked — no LLM, no long tasks.
* docs: add PR evidence for book engine stage transition tests
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(plugins): pin entry-point loader contract across load, isolation, duplicate and gating paths (#1740)
* test(plugins): pin entry-point loader contract across load, isolation, duplicate and gating paths
* style(plugins): format test_entrypoint_loader to satisfy ruff format
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(co-writer): lock router contract for CRUD, 4xx payloads, export failures (#1768)
Coverage gap: deeptutor/api/routers/co_writer.py had 246 missing lines
(40.0%). Add tests/api/routers/test_co_writer_contract.py (40 cases):
document CRUD request/response shapes, illegal-payload 4xx handling,
export/import failure branches, edit/automark agent passthrough, and
history/tool-calls endpoints. All storage and agent work is stubbed to
tmp_path; no product code changed.
Evidence: evidence/co-writer-tests-20261003/ (40 passed on
origin/main ef2d9e5c3; no failing cases, contract currently holds).
Co-authored-by: XZH <cto@xzh.ai>
* test(session): cover pocketbase_store failure branches and pagination edges (#1773)
* test(session): cover pocketbase_store failure branches and pagination edges
* docs: add PR evidence for pocketbase_store fallback coverage
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(launcher): cover lifecycle termination, port cleanup and marker corruption paths (#1769)
* test(launcher): cover lifecycle termination, port cleanup and marker corruption paths
* style(tests): sort imports in test_launcher_lifecycle to satisfy ruff I001
---------
Co-authored-by: XZH <cto@xzh.ai>
* style: apply ruff format to spine_synthesizer tests (#1750)
* test(book): cover SpineSynthesizer materialise, revise loop and fallback paths
20 offline cases over the spine_synthesizer seams the LLM-call test does
not reach: payload-to-chapter/graph materialisation, the draft-critique-
revise loop with on_round events, unusable-output fallbacks, and the
deterministic invariants (count, order, clamping). Module coverage
14.0% -> 94%. All LLM traffic is replayed via BaseAgent.stream_llm; each
test seeds its own agents.yaml home so no runtime install is required.
* style: apply ruff format to spine_synthesizer tests
* docs: add PR evidence for spine_synthesizer coverage
---------
Co-authored-by: XZH <cto@xzh.ai>
* chore(tests): keep regression coverage without internal audit artifacts
* fix(llm): avoid tokenizing image payloads in request fingerprints (#1712)
* perf(llm): deduplicate repeated inline user images per request (#1714)
* perf(llm): deduplicate repeated inline user images per request
* fix(llm): preserve image fallback and stable replay references
* fix(learning): prevent compounding SRS lapses during multi-turn qualitative repairs (#1781) (#1794)
* fix(mastery-path): allow editing legacy objective counts (#1790)
* fix(crawler): ignore absurd robots.txt crawl-delay values (#1787)
A hostile robots.txt could park every request to a host (and the shared
per-host pace lock) on one unbounded sleep; delays beyond 60s are now
treated as "no directive" and the default interval applies instead
(RFC 9309 lets crawlers cap unreasonable values).
* fix: decode escaped emoji in ask_user cards as real characters (#1780)
decode_escaped_unicode_for_display repairs double-encoded \uXXXX runs
(#973) with the unicode_escape codec, which turns a surrogate-pair escape
for an emoji into two lone surrogates instead of one emoji. The
result cannot be encoded as UTF-8, so an ask_user card or mastery question
whose escaped text contains an emoji fails when the event is persisted to
SQLite or sent over the WebSocket.
Decode each run as a JSON string instead, matching the web decoder's
JSON.parse, and leave runs with an unpaired surrogate escaped.
* fix(services): surface fsync failures in atomic writers as rate-limited warnings (#1751)
Co-authored-by: XZH <cto@xzh.ai>
* fix(partners): stop telegram typing loop for denied senders and dropped media-group stragglers (#1746)
* test(partners): telegram message parsing, chunking and typing contract suite
Red-first coverage for deeptutor/partners/channels/telegram.py (coverage
gap: 418 missing / 30.2%). 28 green tests pin current behavior; 2 red
tests encode real defects for a fix card:
1. media-group straggler arriving while _flush_media_group dispatches is
buffered but never flushed (message dropped, buffer leaks)
2. typing indicator for an ACL-denied sender runs forever
No product code changed. Evidence in evidence/telegram-tests-20261003/.
* fix(partners): stop telegram typing loop for denied senders and dropped media-group stragglers
- start the typing indicator only for senders passing is_allowed: a
denied sender never receives a reply, so the 4-second send_chat_action
loop used to run until channel restart
- release the media-group task slot before dispatching the buffered
album, so a straggler item arriving mid-dispatch schedules its own
follow-up flush instead of being silently dropped (and leaking its
buffer); the finally guard only drops the task's own registration
* test(partners): telegram suite lint polish; drop internal evidence dir
- fix ruff F541 (redundant f-string) and apply ruff format
- reword red-test docstrings: both defects are fixed on this branch
- remove evidence/telegram-tests-20261003/ (internal tracking artifacts,
kept on the v1 branch) so the tree matches upstream conventions
---------
Co-authored-by: XZH <cto@xzh.ai>
* fix(api): warn when a deferred tool's definition fails to load (#1731)
* fix(api): warn when a deferred tool's definition fails to load
build_tool_options swallowed get_definition() errors on deferred (MCP)
tools with a bare continue, so a broken tool silently vanished from
the options surface with no trace of why it was unavailable. The skip
now logs a warning naming the provider and adapter class plus the
failure reason; enumeration of the remaining tools is unchanged.
* style(api): ruff-format deferred tool definition warning changes
---------
Co-authored-by: XZH <cto@xzh.ai>
* fix(rag): classify invalid persisted index errors and include re-index steps (#1702)
* fix(rag): classify invalid persisted index errors and include re-index steps
Searching a knowledge base whose persisted vector store contains invalid
vectors (issue #440) was misclassified: the ValueError raised at index
load wraps a provider-facing "Details: ..." tail, so search_error_result
matched the embedding-provider branch first and returned
invalid_embedding_provider_response without needs_reindex, blaming the
provider instead of the damaged index.
Check the persisted-index diagnosis first, include the recorded failure
reason (which store file, which vector) in the user-facing answer, and
spell out recovery: run the knowledge base's 'Re-index' action; re-uploading
documents reuses the damaged store and cannot repair it.
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
* fix(knowledge): surface swallowed KB status, progress and folder-sync failures (#1706)
* fix(knowledge): make update_kb_status write failures observable
The ready-transition metadata refresh swallowed every exception
(`except Exception: pass`), and a kb_config.json persist failure
surfaced only as an opaque raise inside fire-and-forget callers, so
a lost status update left the persisted KB state stale with no
diagnostic.
- Log a warning naming the KB when the best-effort ready-transition
metadata refresh fails, instead of silently passing.
- Log an error with the KB name and status when persisting the
config fails, then re-raise so callers still receive the exception
(the write is authoritative, not best-effort).
Tests: a persist failure is logged and re-raised; a metadata refresh
failure is logged and does not propagate.
* fix(knowledge): make progress WS failures visible instead of silent
The websocket_progress endpoint swallowed five failure points with
`except Exception: pass`: timestamp parsing (x2), error-frame delivery,
socket close, and user-context reset. A corrupt progress snapshot or a
broken teardown path therefore vanished without a trace.
- Share a _progress_age_seconds helper for both freshness checks: narrow
the catch to (TypeError, ValueError), keep the inactive/stale fallback,
and log unparseable timestamps at warning level.
- Reuse the already-parsed snapshot age in the replay decision, so one
corrupt timestamp warns once per connection instead of once per
freshness check.
- Trace failed error-frame delivery and failed close at debug level
(usually an already-disconnected client, not a fault).
- Log a failed reset_current_user at warning level: leaking the user
context is a real fault, not a disconnect.
Tests: malformed timestamp degrades with a warning; cleanup failures are
logged and never propagate; normal disconnects stay silent.
* fix(knowledge): stop swallowing a failed reindex error-progress write
The reindex failure path wrapped its ProgressTracker ERROR update in
`except Exception: pass`, so when that write itself failed the rebuild's
failure alert disappeared and the KB progress view silently stayed stale.
Log a warning instead; the task-level error status remains authoritative.
* fix(knowledge): log folder sync state recording failures
update_folder_sync_state() swallowed per-file mtime recording errors
with 'except Exception: pass', so a file whose state could not be
recorded silently degraded the persisted sync state while last_sync
still advanced. Log the failure at WARNING and keep the un-recorded
fallback so the next scan re-syncs the file.
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
* fix(co-writer): keep a placeholder row and warn when DOCX table row parsing fails (#1700)
* fix(co-writer): warn and keep placeholder row when DOCX table row parsing fails
_table_to_markdown swallowed per-row cell errors with 'except Exception:
continue', silently dropping rows (e.g. malformed merged cells) from the
converted markdown. Log a warning with the table/row ordinal and keep a
placeholder row so the loss is visible in the output itself.
Use an English placeholder '(unparseable row)' so non-Chinese documents
are not polluted, and keep test imports sorted for CI.
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
* fix(runtime): surface launcher termination and port-kill signal failures (#1715)
_terminate and _kill_port_listeners wrapped every tree signal in
bare except-pass blocks, so a child or port listener the signals could
not reach survived shutdown with no log line to trace: zombie children
and occupied ports after restart, with nothing to investigate.
Signal delivery now goes through _signal_target, which logs each
failure at WARNING with its cause; the SIGTERM -> wait -> SIGKILL
ladder and its timeouts are unchanged. A target that is already gone
is not a failure: ESRCH from os.kill/os.killpg is treated as
terminated, and on Windows _send_tree_signal now checks taskkill's
exit code, staying quiet for its "process not found" (128) while
raising for real failures such as access denied, so the Windows path
is observable too.
Co-authored-by: XZH <cto@xzh.ai>
* fix(rag): log swallowed embedding/image progress and LightRAG meta failures (#1703)
* fix(embedding): log progress callback failures instead of swallowing them
embed/embed_contents wrapped progress_callback in 'except Exception: pass'.
A failing progress sink vanished without a trace while indexing continued,
making KB index progress untrustworthy (stalled reads with no diagnostics).
Keep the callback best-effort (embedding runs must not fail on UI feedback)
but log a warning with batch context and the underlying exception.
* fix: log image progress callback failures instead of swallowing them
_describe_one wrapped image_progress_callback in 'except Exception: pass',
so a broken progress sink silently dropped indexing progress updates with
no trace. Log a warning with completed/total context and keep the batch
running; add a focused test covering visible failure logging and
uninterrupted loading.
* fix(lightrag): warn when workspace meta.json exists but is unusable
workspace_for() swallowed OSError/ValueError when reading meta.json and
silently fell back to the path-hash workspace name, which can open an
empty store with no log trail. Missing files stay silent; unreadable or
corrupt meta now logs a warning with the path and exception type while
keeping the same fallback behavior.
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
* docs(tools): add tools surface guide (#1716)
Co-authored-by: XZH <cto@xzh.ai>
* docs(events): add event and progress chain guide (#1717)
Co-authored-by: XZH <cto@xzh.ai>
* feat(visualize): add Mermaid mindmap visualizer (#1295)
Co-authored-by: XZH <cto@xzh.ai>
* perf(mastery): seed fresh status before the first model call (#1713)
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
* fix(visualize): validate mindmap roots and complete translations
* test(rag): exercise current image client and portable read failures
* docs(events): distinguish handler isolation from durable replay
* test(settings): cover CLI-app model persistence end to end (#1630) (#1745)
* test(settings): apply PR #1634 draft test verbatim
Applies the exact test change from PR #1634 (codex/test/subagent-settings-draft,
fc8ef2f36) on top of dev to verify it passes without any fix commit.
* test(settings): cover CLI-app model persistence end to end (#1630)
Mounts the real SubagentSettingsEditor inside SettingsProvider with the
settings toolbar and a network-level mock backend. Verifies the three
paths from issue #1630: live model edits flush through PUT
/api/subagents/settings before POST /api/settings/apply and survive a
remount; a draft parked server-side applies even when its editor is not
mounted; a restored draft applies from the editor's page and survives a
reload.
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(quiz): add QuizViewer smoke and grading interaction coverage (#1775)
Co-authored-by: XZH <cto@xzh.ai>
* test(web): smoke ChatWorkspace empty home, streaming turn, failure banner (#1767)
* test(web): smoke ChatWorkspace empty home, streaming turn, failure banner
ChatWorkspace.tsx had 0% unit coverage (DT-21 top-15 gap #2). Mount the
real surface with the ChatStateAdapter mocked at its boundary and stub
the heavy leaf components, then assert:
- empty draft renders the greeting home and bootstraps newSession()
- a first send reaches sendMessage with the composed turn config
- streamed deltas drive message-list/composer streaming flags until done
- submission failure shows the composer-adjacent error banner with a
working Resend, and the needs-review variant drops the Resend
- an unloadable URL session settles into the retryable failure state
File coverage: 0% -> 50.3% lines (476/947), 47.4% statements.
* docs(evidence): add PR draft for ChatWorkspace smoke tests
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(web): cover VisualizationViewer render branches (mermaid/svg/chartjs/html/plugin/manim) (#1749)
Add web/tests/visualize/VisualizationViewer.spec.tsx with 22 vitest cases
covering the three core states (loading, render success, render-failure
fallback) plus the remaining render dispatch branches: svg sanitize/split,
chartjs parse/destroy, html iframe bridge, plugin iframe, geogebra,
unknown renderer, manim delegation, toolbar/fullscreen/code panel.
VisualizationViewer.tsx coverage: statements 1.69% -> 74.57%, branches
0% -> 50.86%, functions 0% -> 71.69%, lines 1.49% -> 61.56%.
Full suite 114 files / 493 tests green; typecheck + eslint clean.
No product code changed. Evidence: evidence/test-visualization-viewer-20261003/
Co-authored-by: XZH <cto@xzh.ai>
* test(web): smoke coverage for StandaloneComposer send gating (#1744)
Pins the composer's own state pool: empty-input guard, full submission
payload with one-shot state consumption, the isStreaming lock and its
awaitingUserReply escape hatch. ChatComposer is stubbed so the tests
exercise StandaloneComposer's decisions, not the presentation.
Covers the 0%-coverage Top-20 entry from evidence/coverage-2026-10-02.
Co-authored-by: XZH <cto@xzh.ai>
* test(web): cover the settings store and memory-graph helpers (#1710)
* test(web): cover settings store persistence and normalization
* test(web): cover memory-graph pure functions
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
* test(api): add contract tests for upload guards, quiz judge, reading progress, notebook and memory routers (#1709)
* test(api): lock knowledge-base upload and delete guard contracts
* test(api): unit-cover the quiz-judge WebSocket router
* test(reading): pin the reading progress API durability contract
* test(notebook): pin the question notebook API source, dedup and concurrency contract
* test(memory): cover the memory workbench router contract
* test(codebuddy): make credential fixture expiry relative to now
test_load_credentials_parses_session wrote a hard-coded expiresAt of
1791055241000 (2026-10-03 15:40:41 UTC) and asserted is_expired() is
False. Once that instant passed the assertion flipped, so the test now
fails on every Python version for every branch.
Derive expiresAt / refreshExpiresAt from time.time() so the fixture
always describes a live session, and assert against the value written.
---------
Co-authored-by: XZH <cto@xzh.ai>
* fix(courses): surface course deletion failure instead of silent redirect (#1754)
The confirm handler fired deleteCourse with void and no .catch, so a
failed delete left an unhandled rejection, gave the learner no feedback,
and still navigated away from the course page. Await the call in a
try/catch: stay on the page with a visible alert (and the dialog open
for retry) on failure, push /courses only on success, and disable the
confirm button while pending.
Co-authored-by: XZH <cto@xzh.ai>
* fix(reading): converge the mobile header and dock the selection panel (#1734)
Below 768px the reader header converges to back, title + chapter,
bookmark and more: forward moves into the more menu (also when the
workspace hosts it), the file icon yields its width, and the chapter
indicator truncates inside a bounded share of the row instead of
disappearing. The selection panel becomes a bottom card on phones:
collapsed rows for short content, a capped scrollable body for the
note editor and overflow actions, a drag handle for pull-down-to-
dismiss, and safe-area padding; the desktop popover is unchanged.
Refs #916
Co-authored-by: XZH <cto@xzh.ai>
* fix(reading): respect fence indentation and verify learner navigation
---------
Co-authored-by: Rockynowzzz <198366628+Rockynowzzz@users.noreply.github.com>
Co-authored-by: AoHanBei <dongaohan21@gmail.com>
Co-authored-by: evan188199-tech <evan188199@gmail.com>
Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: ZyPulse <sysu2752225139@gmail.com>
Co-authored-by: OrdoAbChao <58732249+OrdoAbChao7@users.noreply.github.com>
Co-authored-by: KennySimpson <70093673+KennyMcSimpson@users.noreply.github.com>
Co-authored-by: Jinguang Gu <simongu@gmail.com>
Co-authored-by: Mohammad Hijjawi <51020382+MohammadHijjawi97@users.noreply.github.com>
Collections vs workspaces: a workspace holds many collections, and a
collection's files and reading conversations live in the workspace it
was created in. The library now shows collections as folders grouped
under their workspace, and creating one asks which workspace it goes
into.
- Folder page at /learning/reading/folders/[folderId]: breadcrumb,
files, the collection's conversations, and "Start reading" that opens
the whole folder in the reader. The reader's back link returns to it.
- Collections carry a user-picked color (new `color` column, migrated);
tones are --folder-* tokens with dark variants.
- One shared "New collection" / "Edit collection" dialog with consistent
type sizes.
- Selection popover gains AI actions; results land as cards at the foot
of the companion. Read-aloud is a single header toggle.
- The three ⋯ menus (collection, document, conversation) merge into one.
- Outline toggle moves to the left and starts closed; navigator has
Outline / Annotations tabs.
- Reading conversations live in the main sidebar (with a page-shaped idle
mark) instead of a history dropdown in the companion.
- Fix sidebar rows never showing a selected state
(bg-[var(--background)]/60 compiled to nothing).
- Composer floats over the conversation (no divider, bottom fade); the
toolbar wraps by content instead of splitting under 420px.
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.
* feat(sessions): add recycle bin for deleted chats
Implements soft-delete for chat sessions so users can restore
accidentally deleted conversations from a recycle bin.
Backend:
- Schema migration adds deleted_at REAL column to sessions
- delete_session becomes a soft-delete (sets deleted_at timestamp)
- New store methods: restore_session, purge_session, list_deleted_sessions
- Session list queries exclude soft-deleted sessions
- API endpoints: GET /sessions/recycle-bin, POST /{id}/restore,
DELETE /{id}/purge (purge triggers attachment/mastery cleanup)
Frontend:
- RecycleBinSection: collapsible sidebar section listing deleted
sessions with Restore and Delete permanently actions
- Wired into SidebarShell via recycleBinSlot prop
- API client functions for list, restore, and purge
- en/zh translations for all recycle-bin UI strings
Tests: 6 backend tests covering the soft-delete lifecycle
* style: apply ruff format to sqlite_store
* fix(sessions): preserve recycled chat artifacts
* feat(sessions): fold #1444's backend into this recycle bin
#1444 built the same feature from the other end. This PR had the SQLite
column, the routes and the sidebar UI; #1444 had the protocol declarations,
the PocketBase implementation and the CLI wording. Neither shipped alone —
this one left multi-user deployments answering AttributeError on
/recycle-bin, and #1444 built a bin nobody could see. Closes#1444; its
backend is here.
Kept from here: one `deleted_at` column. #1444 carried `is_deleted` beside it
in both backends, and `deleted_at IS NOT NULL` already says everything the
boolean did — PocketBase now derives the outward `is_deleted` field from the
timestamp instead of storing it twice.
Taken from #1444: the naming, which turns out to fix the residual both PRs
shipped with. `delete_session` keeps meaning what every existing caller
already meant by it — remove the row — so `reading.py`'s two internal
cleanups need no patch: a deleted reading workspace still takes its sessions
with it instead of depositing them in a learner's bin, where restoring one
would resurrect a session pointing at a workspace that no longer exists. The
chat surface's delete is a separate, explicitly named `soft_delete_session`,
and `hard_delete_session` empties the bin. Both backends agree, and the
protocol declares all five so a backend cannot silently lack one again.
`test_entries_cascade_on_session_purge` becomes two tests, because there are
now two deletions worth pinning: one the bin can undo, and one that skips it
and cascades immediately.
Co-Authored-By: sjagadee <srini.jagadeesh@gmail.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
---------
Co-authored-by: XZH <cto@xzh.ai>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
Co-authored-by: sjagadee <srini.jagadeesh@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Both halves of the CI repair are kept: the inline octocat that pulls the
generated brand-icon table out of the app-shell chunk (this branch) and the
deferred session-organization list plus the settings-audit `matrix` locator
fix (#1282). The audit fixture keeps the richer editable-settings body and
the backend-independent catch-all, with the catch-all registered first so
the specific stubs still win.
SidebarShell rendered its footer GitHub mark through BrandGlyph, which pulls
lib/brand-icons.generated.ts (~95KB) into the chunk every route shares, so the
table was counted against every measured route budget. Render the same CC0
octocat path inline (byte-identical to the generated github entry) and let the
store surfaces that actually show brand rows keep importing the table through
BrandIcon. Routes drop ~90KB: / 305->211KB, /co-writer 324->231KB,
/co-writer/[docId] 525->431KB, all comfortably under budget.
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
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.
Release notes: assets/releases/ver1-6-3.md
Model configuration was one layer replicated seven times: every service
stored its own profile with its own credentials, so a single OpenRouter
key had to be pasted into five separate pages. This release splits that
in two — a **connection** holds one vendor credential and links it down
to every service that vendor can serve, and a **task model** takes the
calls nobody asks for (naming a conversation, writing the composer's
starting points) off the model picked for actual reasoning. Both are
opt-in; existing per-service profiles resolve exactly as before.
Around that: Settings drops the card grid for a persistent searchable
navigator whose landing page answers "what state am I in" instead of
repeating the directory; Mastery Path files study conversations under
their topic and opens them in the tutor rather than dropping them on
/home; the sidebar folds features into More and reorders by drag; the
reading companion is rebuilt from /home's own chat components; and the
LightRAG engine talks to the SDK directly, so its extra no longer drags
MinerU in transitively.
Also back-merges PR #1041 (Anthropic SDK 1.x temperature via extra_body)
and PR #741 (owner-only auth secret/token files), which had been merged
straight into main and never flowed back to dev.
Release notes: assets/releases/ver1-6-1.md
Gates: pre-commit 15/15, ruff clean, pytest 5802 passed, web 450 node
tests, eslint 0 errors, docs build clean.
The Mastery Path sidebar, composer and progress ring, in four changes.
Study conversations are filed under their topic. They were already ordinary
chat sessions carrying `mastery_path_id`, so the sidebar had everything it
needed and used none of it: they sat loose among the recents, and a click
opened them on /home, which drops the outline, the waypoint header and the
tutor's own composer. `lib/mastery-session.ts` answers both questions in one
place, because a sidebar that files a conversation under a heading and then
navigates somewhere else is worse than one that does neither. Grouped
conversations are exempt from the eight-row cut on recents: a heading that
says "4" while listing two of them is worse than a slightly longer list.
The composer placeholder is written by the task model. "Ask your tutor about
X" was the third appearance of that waypoint on screen and proposed nothing,
and a learner who is stuck is stuck on what to ask. So it offers one question
the tutor's last message did not already answer, and Tab takes it. It is a
question and never an answer -- on a mastery path the learner produces the
understanding, so anything not ending in a question mark is dropped. Nothing
waits on the call: the static placeholder stands until a hint arrives, and a
failure just leaves it standing.
`/topics/index` exists because the sidebar refreshes on every stream end and
`/topics` answers with each path's whole knowledge map and source excerpts.
It is declared above `/topics/{path_id}`, which matches any single segment.
The connected-agent and persona chips reach every surface sharing the
composer. StandaloneComposer already filtered subagents out of the knowledge
picker, commented "they are their own composer control" -- and then never
mounted that control, so a connected agent was unreachable from Mastery Path,
Immersive Reading and quiz follow-ups alike. Owning the split once lifts all
three, and keeps them on the same composer the chat page renders.
The progress ring stops competing with the card it sits on. A bare "7" is an
id or a step number, not a measurement; `--primary` is what buttons and links
are, and the card is itself one; and a 2.5px round cap at low percentages
reads as a stuck spinner. Ink hairline, a real unit, and `--primary` kept for
the one moment it means something.