Commit Graph

48 Commits

Author SHA1 Message Date
Anthony
52d050cdaa fix(voice): drop repeated quad key and sort a reading test import
Ruff F601 rejected the second quad entry in the TTS spacing map. Ruff I001 wanted the reading media-note imports in one block.
2026-09-22 19:41:38 -07:00
Bingxi Zhao (Frank)
7d330f043c Merge remote-tracking branch 'origin/pr-1503' into codex/merge-pr-1503
# Conflicts:
#	deeptutor/services/session/turns/executor.py
2026-09-23 10:32:28 +08:00
Bingxi Zhao (Frank)
367195b7cf Merge remote-tracking branch 'origin/dev' into dev
# Conflicts:
#	deeptutor/api/routers/reading_extensions.py
#	tests/reading/test_extension_router.py
#	web/locales/en/app.json
#	web/locales/zh/app.json
2026-09-19 16:41:12 +08:00
Gao-Chenkai
3eb831d108 feat(learning): persist cross-surface Focus-Check in Question Bank
Route Mastery, Book, and Immersive Reading attempts through one review record so reading quizzes are server-graded, retryable, and show the learner's pick next to the reference answer.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-17 21:21:15 +08:00
flower-moon
0b0e693eb7 refactor(reading): own the page-render predicate in the reading layer
The session layer held both the decision ("is this page worth rendering?") and
the injection, and the reading capability had no way to ask the same question
without importing session internals. The predicate and the render record now
live in deeptutor/reading/page_render.py, the session helpers delegate to it,
and the viewport seed says when a rendered page is attached — a model told the
attached image is the page it is being asked about reads it instead of
guessing. With no render the seed is byte-for-byte what it was.
2026-09-17 19:22:11 +08:00
flower-moon
31dfc68181 feat(reading): render the open page when its content is drawn
Extracting a PDF's raster images is not enough for slide decks: the diagrams
are usually vector drawings, and the rasters inside them are the shading
fragments. On a real lecture page — two charged-shell diagrams with Gaussian
surfaces and the field formulas — the four "figures" reaching the model were
186x91pt pink shading blocks, and the honest answer was "these are decorative
bars, not plots".

So when the open page's content is mostly drawn (>= 8 drawing objects) the
page itself is rendered — labels, formulas and all — and rides first in the
turn's image attachments, with the page's own rasters behind it. The ceiling
stays at four images per turn, the render is 110dpi/JPEG (~132KB, ~60ms) and
any failure degrades to the previous behaviour. Pages that are only typed skip
the render: their text already reaches the model.
2026-09-17 19:22:10 +08:00
flower-moon
8e19581d93 feat(reading): surface figure captions to the model
Stored captions do nothing by themselves, so both text paths now show them.
read_material's embedded-image list gains the description after each file
name, which is what lets a question about another page — or another deck —
be answered from figures the model never received. The reading viewport seed
adds one compact line for the open page, so a text-only model still learns
what its figures show when image input is unavailable.

When nothing is captioned the output is byte-for-byte the previous text
(asserted by test, including the store-raising path); the rendering moved to
media_notes.py to keep tools.py under its size ceiling (763 -> 728 lines).
2026-09-17 18:46:28 +08:00
flower-moon
8c718530b2 feat(reading): caption embedded figures at ingest
A figure only reaches the model while its page is the open one: the viewport
injection carries at most four images, and read_material returns text. That
leaves a question spanning several pages of a deck (or several decks)
answered without ever seeing the figures it is about.

Ingest can now describe each stored figure once, with the active vision model,
and write the description back into media.json next to the image it belongs
to. captions.py mirrors the RAG image-description pipeline: it is gated on
supports_multimodal_images(), runs at image_description_limits() concurrency
with a per-image timeout, tolerates individual failures, and returns the
number of rows it wrote. The work is best-effort by design: the upload path
schedules it as a background task that can only log, never fail an ingest.

Off by default (document_parsing.json -> image_caption, surfaced through the
document-parsing settings API), so nothing changes until the switch is on.

store.refresh_document() lands alongside it: re-extraction of an already
ingested document that keeps annotations/positions/bookmarks/assets in place,
rewrites units/media/manifest in one atomic swap, refuses to touch anything
when the raw bytes are gone or the unit count would change, and carries
existing captions over by image name so a refresh never silently discards
descriptions the API already paid for.
2026-09-17 18:46:28 +08:00
flower-moon
8999c0d3e4 feat(reading): extract PDF figures so the reader can send them to the model
The reading chain only pulled embedded images out of Office files; the PDF
branch produced text alone, so a slide deck uploaded as PDF reported
media_count 0 and no [图片 N] markers at all. The chat-attachment path already
had the missing half (extract_pdf_images + per-page markers), so the reader
now reuses it: each page's figures are pinned to that page's locator and the
marker lines are appended at the END of the page text, leaving every existing
character offset — and therefore every saved annotation anchor — untouched.

Budgets differ by path. Chat attachments inflate images into one request, so
they keep the 12-image/12MB document cap; the reader stores bytes on disk and
only ever sends the open page, so reading_image_budget() allows 120 images /
60MB per document while capping each page at 4 — the same ceiling the viewport
injection applies per turn, which keeps one dense figure page from eating the
document budget. extract_pdf_images/extract_docx_rich/extract_pptx_rich now
accept an explicit ImageBudget, defaulting to the previous behaviour.

Measured on the physics decks: day03_GaussLaw.pdf goes from 0 to 63 media rows
across 23 of its 42 pages (66 candidates, 3 dropped by the per-page cap).
2026-09-17 18:46:28 +08:00
Bingxi Zhao (Frank)
c547a5a31c fix: resolve verified learning, ingestion and delivery regressions
Bind mastery drafts before their opening turn and preserve stored session modes.
Track chat duration from submission through terminal completion. Run async reading
extensions on their event loop and allow retries after cancellable timeouts.
Allow first uploads into empty LlamaIndex knowledge bases, preserve Telegram
thread routing, parse embedding Retry-After dates, and enforce robots rules and
host pacing during documentation crawls, including redirects.

Fixes #1461
Fixes #1458
Fixes #1451
Fixes #1448
Fixes #1392
Fixes #1429
Refs #1435, #1412

Reuses contributions from PRs #1462, #1452 and #1403.

Co-authored-by: sjagadee <srini.jagadeesh@gmail.com>
Co-authored-by: AoHanBei <dongaohan21@gmail.com>
Co-authored-by: Gao-Chenkai <DevChenkai@outlook.com>
2026-09-15 20:06:57 +08:00
Bingxi Zhao (Frank)
04040a2c06 release: v1.6.5
Ship a content workspace you choose, one exec tool for every language,
Mastery Path modes that gate its tools, and Settings that grades
readiness instead of listing faults.

Release notes: assets/releases/ver1-6-5.md
2026-09-06 13:46:29 +08:00
Bingxi Zhao (Frank)
93df3d48b7 release: v1.6.4
Ship lighter isolated runtimes, richer Books and Mastery flows,
Reading/session polish, and explicit model API capabilities.

Release notes: assets/releases/ver1-6-4.md
2026-09-03 01:38:54 +08:00
Bingxi Zhao (Frank)
fc39543bc0 feat: integrate frontend backend and canonical routes 2026-09-01 22:24:29 +08:00
Bingxi Zhao (Frank)
02ba56793e chore: checkpoint backend stabilization workspace 2026-09-01 21:28:15 +08:00
XZH
0cb0a269a7 chore(ci): format dev baseline for ruff 2026-08-31 08:55:52 -07:00
Bingxi Zhao (Frank)
57df37b75f Merge pull request #1119 from evan188199-tech/codex/feat-reading-translation
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
#	web/tests/reading-extensions.test.ts
2026-08-31 20:08:59 +08:00
Bingxi Zhao (Frank)
dd154501a0 Merge pull request #1115 from evan188199-tech/codex/feat-reading-quiz-extension
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
#	web/tests/reading-extensions.test.ts
2026-08-31 20:01:30 +08:00
Bingxi Zhao (Frank)
2f26e468b6 Merge pull request #1108 from evan188199-tech/codex/feat-reading-vocabulary
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/tests/reading-extensions.test.ts
2026-08-31 19:57:20 +08:00
Bingxi Zhao (Frank)
37fc1f1b06 Merge pull request #1106 from evan188199-tech/codex/feat-reading-study-guidance
# Conflicts:
#	pyproject.toml
#	web/components/reading/ReadingExtensionBar.tsx
#	web/locales/en/app.json
#	web/locales/zh/app.json
#	web/tests/reading-extensions.test.ts
2026-08-31 19:55:28 +08:00
Bingxi Zhao (Frank)
1c918e87a8 Merge pull request #1032 from Zuan0/reading-chat-references
# Conflicts:
#	deeptutor/services/session/source_inventory.py
#	deeptutor/services/session/turn_runtime.py
#	tests/reading/test_turn_wiring.py
#	web/app/(workspace)/home/[[...sessionId]]/page.tsx
#	web/context/UnifiedChatContext.tsx
2026-08-31 19:19:38 +08:00
Bingxi Zhao (Frank)
09b5698039 Merge pull request #1031 from Zuan0/reading-citation-capture
# Conflicts:
#	web/components/reading/AnnotationList.tsx
#	web/components/reading/ReaderPane.tsx
#	web/lib/reading-api.ts
2026-08-31 19:10:34 +08:00
Bingxi Zhao (Frank)
8d0378f3f8 Merge pull request #1104 from contributor 2026-08-31 17:51:52 +08:00
XZH
f3079d72ed feat(reading): add source-grounded translation extension (#1117) 2026-08-30 08:09:19 -07:00
XZH
d6735ec986 feat(reading): add source-grounded quiz extension (#1114) 2026-08-30 07:29:26 -07:00
XZH
c102bd0917 feat(reading): add source-grounded vocabulary extension 2026-08-30 05:41:11 -07:00
XZH
78f291d311 feat(reading): add source-grounded study guidance extension (#1105) 2026-08-30 05:15:35 -07:00
XZH
1fb291045d feat(reading): add safe read-aloud extension (#1103) 2026-08-30 04:56:05 -07:00
Bingxi Zhao (Frank)
5228af9141 merge: integrate recent issue fixes
# Conflicts:
#	web/context/UnifiedChatContext.tsx
#	web/tests/reading-turn-state.test.ts
2026-08-30 17:49:11 +08:00
Bingxi Zhao (Frank)
f694f204a8 feat: add app updater and unify workspace chat flows 2026-08-30 17:40:47 +08:00
Bingxi Zhao (Frank)
64dff25792 style: format recent issue fixes 2026-08-30 16:42:43 +08:00
Bingxi Zhao (Frank)
3f3bf0b841 feat(reading): render safe versioned web snapshots 2026-08-30 16:01:40 +08:00
Bingxi Zhao (Frank)
ce7c2dc2dc release: v1.6.1 — one key, one navigator, one sidebar you arrange
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.
2026-08-30 13:19:42 +08:00
Bingxi Zhao (Frank)
fc0be68d6f wip: course / partner groups in progress 2026-08-29 22:29:53 +08:00
Bingxi Zhao (Frank)
97a4d0eeef feat(reading): add immersive reading workspace 2026-08-28 14:58:48 +08:00
Benjamin
b277247036 feat(reading): add citation capture 2026-08-27 16:16:54 +08:00
Benjamin
e3d8b05c0d feat(reading): add chat section references 2026-08-27 16:15:28 +08:00
Bingxi Zhao (Frank)
1f6fe858f1 fix(reading): isolate timed-out extension workers 2026-08-26 01:04:12 +08:00
XZH
88777a4421 fix(reading): bound extension action execution 2026-08-26 01:00:05 +08:00
XZH
27700d4a48 feat(reading): add safe extension protocol 2026-08-26 01:00:05 +08:00
Bingxi Zhao
f78ff1abdc Merge pull request #979 from evan188199-tech/codex/epub-bilingual-pairing
feat(reading): add explicit bilingual EPUB pairing
2026-08-26 00:58:08 +08:00
Bingxi Zhao (Frank)
5de30246bd fix(reading): make EPUB pairings durable and explicit 2026-08-26 00:43:15 +08:00
XZH
410711bf7b feat(reading): add explicit bilingual EPUB pairing 2026-08-26 00:40:50 +08:00
Bingxi Zhao (Frank)
ebe8e147f4 fix(reading): keep selector anchors coherent 2026-08-26 00:39:05 +08:00
XZH
2b09789182 fix(reading): validate selector text bounds 2026-08-26 00:36:30 +08:00
XZH
4f94c6f1f9 feat(reading): persist W3C text selectors 2026-08-26 00:35:59 +08:00
XZH
9daea4d0af fix(reading): reset stale legacy EPUB positions 2026-08-24 08:03:13 -07:00
XZH
d3b19f3a2e feat(reading): add source-faithful EPUB contract 2026-08-23 04:38:24 -07:00
Bingxi Zhao (Frank)
7c6bcfaef7 release: v1.5.14
Immersive Reading, self-configuration, and a two-way IMA library.

- Immersive Reading: a new capability that opens a document beside the
  thread. New reading engine (PDF pages / slides / page-sized sections),
  five reading tools, a deterministic locate pre-pass that grounds the
  turn without a second LLM call, /api/v1/reading, and a reader pane with
  selection, highlights, notes, and export to an annotated PDF or Markdown.
- Setup capability: inspect the install, apply a setting, install a
  parsing engine, or request a credential from a chat turn. New settings
  spec table; a candidate value is probed before it is committed, and API
  keys never enter the model's context.
- Tencent IMA: pipeline split into transport/envelope/models/sources/
  notes/media/inventory, an additive capability with five tools, and
  connected libraries that can finally be enumerated (bounded listings
  are reported as a lower bound).
- Retrieval: supports_rag_retrieval() replaces is_connected_kb() for the
  "can I sweep this?" question, so linked / lightrag_server / ima sources
  stop being silently dropped from every book.
- Notebooks: their own console at /notebook, per-notebook locks and atomic
  writes, copy / move / export routes, damaged files surfaced instead of
  dropped, and renaming a record no longer clears its knowledge-base link.
- Settings persistence: one lock and one atomic replace shared by every
  writer of interface.json; the PUT endpoints stop writing the
  defaults-merged view back to disk.

Release notes: assets/releases/ver1-5-14.md
2026-08-19 17:34:52 +08:00