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.
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.
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.
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.
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).
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.
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>
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>
Adapted the migration foundation from PR #1384 while preserving current workspace, caption and turn-admission safeguards.
Co-authored-by: XZH <cto@xzh.ai>
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>
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.
* 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>
* 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(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(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(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>
* 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(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>
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.