Commit Graph

331 Commits

Author SHA1 Message Date
Bingxi Zhao (Frank)
6bbcc00c55 Merge dev into preview, preserving preview features
Integrate dev fixes with preview's Python/TypeScript schedulers, chat queue, learning navigation, and live turn persistence.
2026-10-27 01:16:58 +08:00
Bingxi Zhao (Frank)
28c11e2ae8 feat: update notes, chat interactions and workspace UI on preview
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.
2026-10-26 22:13:34 +08:00
Bingxi Zhao (Frank)
a509ec2362 fix(settings): explain denied catalog writes without losing drafts (#1984) 2026-10-19 02:10:06 +08:00
Bingxi Zhao (Frank)
9aae961412 Merge PR #1957: separate private source evidence from explicit public presentation 2026-10-19 00:53:44 +08:00
Bingxi Zhao
1aed52fd0d Merge pull request #1814 from dajiaohuang/fix/quiz-judge-attachments
fix(api): materialize saved quiz answer attachments
2026-10-19 00:22:53 +08:00
Bingxi Zhao
b82439042a Merge pull request #1812 from dajiaohuang/fix/co-writer-http-errors
fix(api): preserve Co-Writer model-selection HTTP errors
2026-10-19 00:22:28 +08:00
Bingxi Zhao (Frank)
399297e7f0 feat: preserve TypeScript engine migration and workspace updates 2026-10-18 23:09:10 +08:00
Bingxi Zhao (Frank)
857a82e74a feat(notes): add block notebooks with inline reviews and linked favorites
Add rich text and learning blocks, media uploads, page trees, and revisioned notebook storage. Present AI suggestions at their target blocks with durable accept and dismiss actions.

Unify saved outputs as Favorites with typed expandable blocks, stable source links, atomic batch insertion, nesting, dragging, and undo/redo.

Validation: 99 frontend tests and 99 backend tests pass in an isolated snapshot, along with TypeScript, scoped ESLint, dependency architecture, and locale parity checks.
2026-10-17 23:15:23 +08:00
Renn F
53fa3627d9 fix(api): disable the ssrf category and qualify guard behaviour notes
Browsers send the page URL as Referer, and guard-core 4.4.0 flags
localhost and LAN addresses in it as ssrf, which returned 400 for every
UI request. Pass every detection category except ssrf, with tests for
local-address Referers (200) and an attack pattern in a Referer (400).

Say that system.json gains the disabled security_guard block on the next
load instead of claiming nothing changes, document the IPv4-mapped peer
caveat of guard-core 4.4.0 with the mapped-form workaround, fix the
session handoff line citation, and drop the launch-flag test that
duplicates tests/runtime/test_uvicorn_launch_flags.py.

Add tests for the mapped-form workaround and for the access log
recording a guard rejection through the real application stack.
2026-10-16 17:21:34 +02:00
Renn F
86b3633ca2 feat(api): exempt loopback from the guard rate limit by default
The bundled frontend proxy drops X-Forwarded-For and does not add the
browser address, so every browser reaches the backend as loopback and
would share one rate-limit bucket. Add `security_guard.exempt_ips`
(default 127.0.0.1 and ::1, DEEPTUTOR_GUARD_EXEMPT_IPS) passed to
SecurityConfig. It skips the rate limit only; the denylist, bans and the
attack-pattern scan still apply, and loopback requests that carry
X-Forwarded-For are still limited as the forwarded client.

Document that an allowlist must list loopback for the bundled frontend,
and qualify engine behaviour statements with the engine versions they
were verified on.
2026-10-16 16:38:15 +02:00
Renn F
dbd270cfdb feat(api): add opt-in fastapi-guard request screening
Add an off-by-default `security_guard` setting (system.json, with
DEEPTUTOR_GUARD_* deployment overrides) that mounts fastapi-guard's
pure-ASGI middleware in front of the routers: per-address rate limit,
IP allow/deny lists, ban list and an attack-pattern scan of path, query
and headers. Request bodies, WebSocket handshakes, Redis, CORS and
security headers are left alone.

The guard is added before the access-log and CORS middlewares so CORS
stays outermost and 429/403 responses carry CORS headers. When disabled
the package is never imported. When enabled without the package the
backend fails at startup with an install hint. fastapi-guard ships as
the optional `guard` extra (requirements/guard.txt, DEEPTUTOR_EXTRAS).
2026-10-16 16:24:52 +02:00
Bingxi Zhao
63621137a4 Merge pull request #1911 from Owaid0723666/feat/add-onomeo-provider
feat(providers): add onomeo as an OpenAI-compatible gateway
2026-10-15 03:23:16 +08:00
Bingxi Zhao
cedd060ac1 Merge branch 'dev' into feat/add-onomeo-provider 2026-10-15 02:03:57 +08:00
Bingxi Zhao
b9397ae6e8 Merge branch 'dev' into fix/workspace-kb-file-delete-not-found 2026-10-15 02:03:46 +08:00
yepyhun
b8fccb92b2 fix(mastery): validate visual hints and select original source excerpts 2026-10-13 17:24:37 +02:00
Bingxi Zhao (Frank)
3cbecb2479 feat(workspaces): add scoped instructions and refine learning UI 2026-10-12 19:29:47 +08:00
Owaid0723666
bfdfb18e48 feat(providers): add onomeo as an OpenAI-compatible gateway
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 15:54:36 +09:00
李晨
7948cd0f2e fix(knowledge): resolve workspace-scoped knowledge base files during deletion 2026-10-08 21:18:06 +08:00
dajiaohuang
29332160bf Merge commit '6cf793bd868ba5ecbe64722936d4be8fab5a01df' into fix/co-writer-http-errors 2026-10-08 12:40:42 +08:00
dajiaohuang
4650bf5394 fix(co-writer): preserve model selection HTTP errors 2026-10-08 12:40:42 +08:00
dajiaohuang
777b0caf2b Merge commit '6cf793bd868ba5ecbe64722936d4be8fab5a01df' into fix/quiz-judge-attachments 2026-10-08 12:35:32 +08:00
dajiaohuang
447a5da103 fix(quiz): resolve stored attachment URLs before judging 2026-10-08 12:35:32 +08:00
Bingxi Zhao (Frank)
6cf793bd86 release: v1.6.14
Ship original-source visual practice, recoverable indexing, unified video
Reading, scientific research tools, managed plugins, and a learning journal
as summarized in assets/releases/ver1-6-14.md.

Improve provider setup and protocol-aware endpoints. Restore missing
localized setup and Ukrainian UI text, keep plugin loading in the plugin
layer, harden research XML parsing, and repair isolated test fixtures and
type-checking errors found by the release gate.

Sync README prose and all eleven translations, bump the package version,
and update the stable release announcement.

Validation: 10180 Python tests and 8 subtests passed (28 skipped); 1303
Node tests passed on Node 22; 24 provider UI tests passed. All pre-commit
hooks, ruff, translation checks, documentation checks, and docs build passed.
2026-10-08 11:34:42 +08:00
Bingxi Zhao (Frank)
7885daa98a feat(plugins): add reviewed managed lifecycle and revocable runtime gates (#1307)
Adapt the Phase 1 foundation from PR #1309 and complete scoped API lifecycle, pre-import approval, artifact-bound revocation, recovery, bounded workers and frontend isolation. Keep the stronger ecosystem roadmap explicit in the RFC.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-08 08:50:05 +08:00
Bingxi Zhao (Frank)
64bc0d8e7c feat(learning): expose a durable workspace journal overview (#1407)
Adapt the journal foundation from PR #1226 and add a read-only mission, handoff and confirmed-record panel. Share its snapshot with turn injection, preserve corrupt files, and serialize worker writes.

Co-authored-by: ZQR1101 <278034003+ZQR1101@users.noreply.github.com>
2026-10-08 03:11:15 +08:00
Bingxi Zhao (Frank)
8986c31580 feat(reading): complete Watching convergence with safe legacy migration (#1378)
Adapted the migration foundation from PR #1384 while preserving current workspace, caption and turn-admission safeguards.

Co-authored-by: XZH <cto@xzh.ai>
2026-10-08 02:48:50 +08:00
Bingxi Zhao (Frank)
e49f518669 Reconcile user setup and provider changes with all reviewed PRs 2026-10-07 20:54:24 +08:00
Yongliang
b19a837457 feat(cli): add GitHub Copilot device login to init (#1277)
* Save uncommitted changes

* fix: isolate Copilot credentials and honor model routing

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: normalize Copilot Responses history replay

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* fix: correct Copilot model discovery and response language

Honor Astra temperature restrictions, synchronize response language preferences, and preserve system prompts in Responses requests.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

* Keep Copilot integration focused on owner authentication and runtime

---------

Co-authored-by: Yongliang Wang <yonwa@microsoft.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:50:55 +08:00
Felix
4b6cddbe49 feat: add Opper as an LLM and embedding provider (#1786)
Opper (https://opper.ai) is an EU-hosted AI gateway: 700+ models from
50+ providers behind one OpenAI-compatible API and one key. This adds it
as a named provider. The LLM entry follows the Requesty one (#1631). The
embedding entry follows the OpenRouter one, with a default model and
dimension like the OpenAI entry.

- provider_registry.py: gateway ProviderSpec after FutureInfra. Env
  OPPER_API_KEY, base URL https://api.opper.ai/v3/compat. Base URL
  detection keys on the api.opper.ai host rather than a bare "opper"
  substring, so unrelated URLs that happen to contain it are not claimed.
- Embeddings: Opper serves OpenAI-compatible /embeddings under the same
  base URL. Registered in embedding_endpoint.py (label, default endpoint,
  /embeddings path rule), provider_runtime.py (default
  text-embedding-3-large, 3072 dims) and the GraphRAG OpenAI-compatible
  binding set.
- Tests: registry lookup and base detection, runtime resolution for the
  opper binding and for an openai binding pointed at Opper, the Settings
  LLM choice, native tool calling, the embedding runtime and the GraphRAG
  api_base translation.

Like the other recent gateway additions, it stays out of the curated
init menus, the README and the capability table. Opper model ids are
bare names (claude-sonnet-4-6, gpt-5.4-mini, text-embedding-3-large), so
the existing model-level rules for claude-, gpt-5 and gemini apply as
they are, and the text-embedding-3 rule sends dimensions=3072.

Checked: python -m py_compile on the ten changed files, git diff --check.
Not run locally: pytest, ruff and pre-commit.

Disclosure: I work at Opper.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:50:37 +08:00
yeheboo
6431539efe feat(providers): add Y-API as an OpenAI-compatible gateway (#1791)
Adds a ProviderSpec for Y-API plus the same three assertions the other
gateway rows carry. Declares the Anthropic Messages endpoint through
api_base_by_format, so profiles on this provider can pick that wire.
2026-10-07 20:48:16 +08:00
Bingxi Zhao (Frank)
f8be756906 Integrate saved user workspace changes with reviewed dev updates 2026-10-07 20:37:55 +08:00
evan188199-tech
0802510450 fix: log silently swallowed failures in five services (#1707)
* fix(codex): log a warning when token revocation fails during logout

Logout previously swallowed revocation failures silently, leaving the
remote token possibly valid with no operator trace. Log only the error
kind and HTTP status (never credential material) and keep clearing the
local credentials as before.

* fix(llm): warn when CodeBuddy tool-call interrupt or drain fails

A silent except-pass after receiving tool_calls let the SDK keep
generating in the background when interrupt() failed, quietly draining
quota. Log a warning (exception type + short reason) for interrupt and
drain failures; return value semantics unchanged.

* fix(memory): log corrupt snapshot files instead of skipping silently

read_notebook_entities / read_cowriter_entities / read_book_entities
swallowed (OSError, json.JSONDecodeError) with a bare continue, so a
corrupt notebook file or manifest silently dropped content from the
memory snapshot. Each skip now logs a warning with the file path and
reason (no file content); snapshot results are otherwise unchanged.

* fix(notebook): log unreadable files instead of skipping them silently during index rebuild

* fix(question): log failed error-event delivery in mimic websocket

The mimic generation error handler swallowed secondary failures of the
error send_json with a bare 'except Exception: pass', so a delivery
failure left the frontend without any reason and nothing in the logs.
Split the handler: closed/disconnecting clients (RuntimeError,
WebSocketDisconnect) stay debug-level, any other send failure is logged
as a warning with traceback. Cleanup paths keep their best-effort
narrow handling. Focused tests cover both branches.

* 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>
Co-authored-by: Bingxi Zhao (Frank) <13051345080@163.com>
2026-10-07 20:37:27 +08:00
evan188199-tech
0a2c316737 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>
2026-10-07 20:28:50 +08:00
evan188199-tech
65d9b8f557 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>
2026-10-07 20:22:52 +08:00
evan188199-tech
50a3ba4e4d 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>
2026-10-07 20:22:32 +08:00
evan188199-tech
70d65c0029 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>
2026-10-07 20:22:03 +08:00
evan188199-tech
f0348731de 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>
2026-10-07 20:14:11 +08:00
evan188199-tech
27ef7af57c 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>
2026-10-07 20:12:46 +08:00
evan188199-tech
d7a8610731 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>
2026-10-07 20:12:37 +08:00
Bingxi Zhao (Frank)
f07029cfcf release: v1.6.13
Ship the reading, listening, question-bank, parsing, and provider updates
summarized in assets/releases/ver1-6-13.md.

Make speech timeouts configurable, report actionable synthesis failures,
and keep chat attachments discoverable in their selected workspace while
preserving earlier uploads and URLs. Keep reply playback cancellation and
single-audio ownership intact.

Sync README prose and all eleven translations, update the stable install
note, and archive release notes older than one week. Repair stale reading
test fixtures and spawned test imports, and clear the Partner type error.

Validation: 9252 Python tests and 8 subtests passed (28 skipped); 518 web
unit tests, 1253 Node tests, and 62 browser audits passed. Pre-commit, ruff,
typecheck, contracts, architecture, i18n, production build, route budgets,
and the docs build passed.
2026-10-04 21:35:00 +08:00
Bingxi Zhao (Frank)
4d7b080fbe fix(knowledge): reuse catalog probes without blocking the API (#1711) 2026-10-04 18:04:10 +08:00
Bingxi Zhao (Frank)
8ed5fe040e test: synchronize session restoration and turn cleanup 2026-10-04 16:21:59 +08:00
Bingxi Zhao
c30449895e Merge pull request #1661 from ChinskiKaczynski/feat/polish-language
feat: add Polish localization
2026-10-04 15:13:29 +08:00
Bingxi Zhao (Frank)
2700105923 Merge dev into PR #1664 and preserve integrated behavior 2026-10-04 14:41:40 +08:00
Bingxi Zhao
ab52f95cc3 Merge pull request #1640 from evan188199-tech/codex/co-writer-model-selection
feat(co-writer): support model selection for edits (#661)
2026-10-04 14:27:08 +08:00
Bingxi Zhao (Frank)
dfeb2fb4f3 Merge dev into PR #1657 and preserve integrated behavior 2026-10-04 14:22:45 +08:00
Bingxi Zhao
002dbc34ee Merge pull request #1685 from evan188199-tech/codex/fix/mastery-session-lock
fix(session): stop waiting turns before deletion (#1646)
2026-10-04 14:19:37 +08:00
Bingxi Zhao
2f62ab1d71 Merge pull request #1625 from evan188199-tech/codex/fix/workspace-subagents
fix(workspace): preserve shared subagent access (#1613)
2026-10-04 14:17:27 +08:00
Bingxi Zhao
412fdf4dd0 Merge pull request #1651 from evan188199-tech/codex/feat/learner-assigned-books
feat(learner): expose assigned interactive books
2026-10-04 14:15:04 +08:00
Bingxi Zhao
f56dfb476e Merge pull request #1599 from dxhome/codex/fix-knowledge-list-proxy
fix: knowledge base listing through proxy
2026-10-04 14:13:31 +08:00