Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.
Release notes: assets/releases/ver1-6-3.md
Route knowledge-base create and upload requests around Next Proxy body cloning and stream multipart data directly to FastAPI. Preserve authentication/content headers, strip hop-by-hop transport headers, and retain all backend validation limits.
Adds matcher and streaming contract regression coverage.
#784 fixed the launcher, but the same address is rendered on two other paths
that kept "localhost": the Docker entrypoint (render_environment) and the
last-resort default in web/proxy.ts. On a dual-stack host that name resolves
to ::1 first while uvicorn binds 0.0.0.0 (IPv4 only), so every rewritten
/api/* request fails to connect — the launcher and container paths are meant
to stay in sync, and after #784 they no longer did.
Also disambiguates the two same-named _optional_positive_int helpers added by
#774: catalog's drops junk from a live API response, contracts' rejects it as
cache corruption. Same name, opposite behaviour — the strict one is now
_require_optional_positive_int and says why it differs.
For a remote or containerized deployment the browser's localhost is the
user's workstation while the OAuth listener runs on the server, so a
reverse proxy cannot deliver http://localhost:1455/auth/callback to that
private listener and Codex sign-in could never complete.
Keep the listener loopback-only and forward just the exact browser
callback path through the Web origin to a state-validating broker. The
settings card and CLI now show the real callback address, the SSH tunnel
command, an explicit authorize action and a countdown, and survive a page
reload; the deployment docs cover the Docker host-port and reverse-proxy
caveats.
The listener stays bound to loopback and ports 1455/1457 are never
published; the Web bridge rewrites only /auth/callback; the broker
requires an active operation and a constant-time state match; callback
responses are no-store HTML that never echo the code or state; PKCE and
the token exchange are unchanged. Binding the listener with
start_serving=False also closes a window where a connection could be
accepted before the callback object existed.
The frontend no longer bakes the backend URL into the bundle at build
time and mutates it with sed on every container start. Instead:
* web/lib/api.ts: apiUrl and wsUrl become one-line pass-throughs, so
the browser fetches relative paths through the frontend
(:3782/api/...). All existing call sites keep working unchanged.
* web/proxy.ts: catches /api/* and /ws/* and rewrites them to
DEEPTUTOR_API_BASE_URL at request time, reading
DEEPTUTOR_AUTH_ENABLED for the auth-redirect check.
* web/lib/auth.ts: switches from NEXT_PUBLIC_AUTH_ENABLED (build-time)
to DEEPTUTOR_AUTH_ENABLED (set by the entrypoint on every start).
* Dockerfile: drops the .env.local placeholder block, the sed -i in
start-frontend.sh, and the runtime API-base fallback chain. Adds
gosu, bakes a non-root 'deeptutor' user (UID 1000), and has the
entrypoint chown /app/data and export DEEPTUTOR_API_BASE_URL and
DEEPTUTOR_AUTH_ENABLED from data/user/settings/*.json on every
start. supervisord is now invoked under 'gosu deeptutor'.
* web/tests/api-resolve-base.test.ts: deleted (its 8 tests reference
resolveBase / isApiBasePlaceholder, both gone; apiUrl/wsUrl are
now pass-throughs so the rest is meaningless). The auth-redirect
test is updated to prime DEEPTUTOR_AUTH_ENABLED instead.
Issue 1: Add waitingForLLM state — show spinner with
'Generating diagnostic questions...' text while waiting for LLM
response after WS connect, instead of silent 'Ready to start learning'.
Issue 2: Module picker — when multiple modules exist and none
selected, show module selection cards before auto-connecting WS.
Single-module books still auto-start. ModuleTree clickable after.
Issue 3: Git rm middleware.ts, git add proxy.ts (Next.js 16 compat).
92/92 tests passing.