open-notebook/api
Luis Novo 11ca9c138c
refactor(api): single context-building implementation (#1079)
Consolidate the three copies of context assembly into
open_notebook/utils/context_builder.py:

- POST /api/chat/context now delegates to build_notebook_context()
  (same request/response shapes, same string-matching config semantics)
- The source-chat graph now calls build_source_context() instead of the
  495-line generalized ContextBuilder class, which had exactly one
  caller and whose notebook/notes/priority-config flexibility was dead
- POST /api/notebooks/{notebook_id}/context removed: it duplicated
  /api/chat/context with a slightly different envelope and had zero
  callers (frontend, docs, tests)

Behavior is pinned by new characterization tests written before the
refactor (tests/test_context_endpoint_characterization.py) plus unit
tests for build_source_context.
2026-07-11 19:55:46 -03:00
..
routers refactor(api): single context-building implementation (#1079) 2026-07-11 19:55:46 -03:00
__init__.py Api podcast migration (#93) 2025-07-17 08:36:11 -03:00
AGENTS.md docs: restructure documentation around AGENTS.md, VISION.md and decision records (#1032) 2026-07-10 15:33:19 -03:00
auth.py chore: remove dead auth helper and fix stale default-password docs (#1026) 2026-07-10 15:47:40 -03:00
CLAUDE.md docs: restructure documentation around AGENTS.md, VISION.md and decision records (#1032) 2026-07-10 15:33:19 -03:00
command_service.py refactor(api): remove dead Streamlit-era service layer and demo commands (#1054) 2026-07-11 18:17:44 -03:00
credentials_service.py ci: gate PRs on mypy, start ignore_errors burn-down (#1076) 2026-07-11 19:25:29 -03:00
main.py refactor(api): single context-building implementation (#1079) 2026-07-11 19:55:46 -03:00
middleware.py fix: reject oversized request bodies before auth/routing (#1014) 2026-07-10 11:15:18 -03:00
models.py refactor(api): single context-building implementation (#1079) 2026-07-11 19:55:46 -03:00
podcast_service.py fix: don't leak internal exception text in API error responses (#1017) 2026-07-10 13:40:27 -03:00