Adds PageIndex OSS as a knowledge-base type and moves PageIndex retrieval from traditional RAG to reasoning-based retrieval: a small workflow-owned agent loop reads the document tree instead of going through the built-in MCP server, which this removes.
Scope stale-page detection to the KB documents that actually changed, and refuse to clear a drift warning while flagged pages are still awaiting recompilation (force=true overrides, since detection over-marks by design). One walk over raw/ per check, and a fingerprint-scheme tag so changing the formula re-baselines instead of marking every existing book stale.
Book is the bulk of this one. Compilation outlives the request that
started it, so a bus owned by that request dropped every background event
and "watch your book being written" degraded into a frozen page; the
stream is now owned per book by the process and survives a refresh or a
reconnect. Reading progress is finally recorded — `visited_page_ids` and
`bookmarked_page_ids` had been declared but never written for the life of
the feature — and rolls up into a completion score and weak chapters. A
book can also leave the app now, as one self-contained Markdown document,
with non-ASCII titles surviving the download.
Two scheduling defects that were invisible in production are fixed: the
same page compiled twice concurrently (billed twice, one result
discarded), and a book grinding on through a provider outage until every
chapter was half-generated. The source sweep is bounded and allocated
round-robin rather than spent on the first few knowledge bases, and
retrieval now tells indexed bases from connected pointers, so an Obsidian
vault or a remote IMA library no longer contributes zero while looking
like a source with nothing relevant. Confirming a spine shows a live
per-chapter estimate derived from the Section Architect's own templates.
Also here: three home starter suggestions built from memory recall,
mastery-path handoff moved into one module that changes lease, session
preference, and live turn together, and account-level Tencent IMA
credentials with the per-KB pair still winning.
Notes: assets/releases/ver1-5-13.md
This commit also carries the README prose sync, the eleven translated
READMEs, the release-notes archive sweep, and the version bump. Two gate
fixes ride along: the `Stamped` protocol is declared read-only so the
frozen `EntityStamp` satisfies it, and six GraphRAG adapter tests that
reached a deep `graphrag` import without guarding it now skip like their
four neighbours instead of failing where the extra is not installed.
Follow-up to #636: _mark_page_error now also resets pages stranded at
PLANNING (plan_blocks_async can throw after the status is persisted),
and the background worker's log-append and finalize check are wrapped
so a storage hiccup can neither skip the page reset nor kill the
worker task.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The except handler referenced `page`, which is bound only after the
loaders succeed: a loader failure on the first queue item raised
UnboundLocalError inside the handler and killed the worker task, and on
later iterations the handler could flip the previous iteration's stale
page to ERROR. `page` is now re-bound to None every iteration, both
reset paths share one _mark_page_error helper, and the save is
best-effort so a failing save cannot mask the original error or kill
the worker either. Adds regression tests for the helper's contract.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The compile_page method (user-triggered via HTTP/WebSocket) calls
self.compiler.compile_page() without try/except. If the compiler throws,
the page status is left in GENERATING permanently — same bug as _worker_loop.
Added exception handling that resets page status to ERROR on failure, then
re-raises so the caller still sees the error.
When a Book page fails to compile in the background worker (e.g. LLM timeout,
network error), the page status is left stuck in GENERATING permanently. The user
sees the page spinning forever with no way to retry.
Added a status reset in the exception handler: when compilation fails, the page
status is set to ERROR with the error message. This allows the user to see the
failure reason and the page becomes eligible for retry on the next resume_book
call.
#493 (sqlite): route _initialize() through the _connect() contextmanager
(the one remaining raw sqlite3.connect FD leak); document the auto-commit
contract so the redundant explicit commits are understood.
#529 (book):
- _strip_thinking_preamble: guard `{ not in text` before rindex() so plain
prose (refusals/errors) no longer raises ValueError -> ERROR block;
hoist json import to module top.
- llm_json: honor caller max_tokens as max(max_tokens, 2600) instead of
discarding it; bump default to 2600; fix stale 'minimal' docstring -> 'low'.
- engine.compile_page: rebuild OVERVIEW pages deterministically via
_materialize_overview_page on force, instead of running the generic LLM
compiler over hand-built intro/concept-graph/index blocks.
- kb_health.scan_log_health: key repeated-failure detection on the op, not
the free-text message, removing false positives/negatives + dead block_error.
- services/__init__: drop orphaned notebook_manager lazy-import + __all__ entry.
- PageReader.tsx: restore t() i18n on regenerate buttons; add 'Regenerating…'.
- remove PATCHES.md (developer-local scratch notes).
#484 (zulip): also match the disambiguated @**Name|user_id** mention form;
make the docstring truthful; add coverage.
#500: remove stray PR_DESCRIPTION.md committed to repo root.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- _llm_writer.py: strip thinking preamble from Qwen output, remove unsupported
response_format, increase max_tokens to 2600, fix reasoning_effort 'minimal' -> 'low'
- engine.py: allow force-recompile on overview pages (previously a no-op),
add _maybe_finalize_book to regenerate_block for book status propagation
- kb_health.py: filter repeated_failures to only count error/fail log entries
- PageReader.tsx: loading spinner + disabled state on regenerate buttons
- page.tsx: error notifications via notify() for compile/regenerate failures
- layout.tsx: suppressHydrationWarning for browser extension attribute injection
Quiz follow-up:
- New FollowupChatComposer + QuizFollowupContext let the user start a
chat thread directly from a quiz question. The composer reuses the
main ChatComposer (look, @space pickers, KB picker, attachments,
LLM selector) but routes sends through a dedicated follow-up
controller.
- New quiz_judge router + quiz-judge.ts helper power judging
follow-up answers inline.
- The older QuestionFollowupPanel.tsx is removed; QuizConfigPanel /
QuizViewer are updated to the new follow-up surface.
GeoGebra viewer:
- New Geogebra.tsx applet renderer (loaded via the official GGB
applet script) so geometry / algebra snippets can open inline
alongside chat answers. GeogebraOpenCTA + GeogebraTabContext add
the tab plumbing.
Book updates:
- book/blocks/quiz.py + book/engine.py + storage.py and the related
book components pick up the new quiz surface.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>