pdf-quiz-generator/frontend
Daniel 9beafff0bf feat: AI Mode — a chat that cannot cite what it did not find
The design settled earlier, built as described: retrieval decides what may be
cited, and the server enforces it.

The model is handed a shortlist of at most fourteen sources from the learner's
own library and told to cite them by marker. Afterwards every citation it wrote
is checked against that shortlist and anything else is deleted before it is
stored or shown. A hallucinated citation is not unlikely here, it is impossible
— surviving is not a decision the model gets to make. A URL it invents is not a
citation either: only the marker form counts, so a plausible-looking link stays
in the prose citing nothing.

Retrieval reuses the hybrid search already in place, and each corpus keeps its
own visibility rules — the bank predicate and exam scope for questions, the
draft rule for articles, deck ownership for cards. A question source carries the
stem only: a chat that printed the answer would hand away the practice it exists
to prepare you for.

Curated links do the job they were built for. A retrieved row an educator tied
to another retrieved row is boosted, because two things somebody already linked
surfacing for one query is evidence rather than coincidence. Nothing is stored
for this; the boost lives only in that ordering, and the answer marks those
sources so the reader knows which claim rests on an educator's judgement rather
than on a ranking.

Citations are stored with the answer as filtered, so reopening a thread shows
the links it showed at the time rather than a fresh retrieval that may now rank
differently. In the page the markers become numbers and each number opens its
source; a section citation deep-links into that section.

Two smaller decisions worth naming: a question appears in the thread the moment
you send it and is handed back to the input if the answer fails, because typed
words are not something to lose on a 502; and someone else's thread returns 404
rather than 403, since whether it exists is not your business either.

182 backend, 206 frontend green — 16 of the backend tests are the citation
contract and the retrieval boundary.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TqXevQJhxFrM7jJg82cgZN
2026-09-10 15:19:24 +02:00
..
public Tag filtering, multi-category, bug fixes, image validation, docs 2026-04-04 22:48:26 +02:00
src feat: AI Mode — a chat that cannot cite what it did not find 2026-09-10 15:19:24 +02:00
.dockerignore Initial commit: PDF Quiz Generator app 2026-03-30 20:04:53 +00:00
docker-entrypoint.sh Tag filtering, multi-category, bug fixes, image validation, docs 2026-04-04 22:48:26 +02:00
Dockerfile Remove coach modes and improve quiz audio 2026-05-10 01:24:06 +02:00
index.html Tag filtering, multi-category, bug fixes, image validation, docs 2026-04-04 22:48:26 +02:00
nginx.conf feat: analysis recommendations, category grants, compact question header 2026-09-09 18:47:32 +02:00
package-lock.json Remove coach modes and improve quiz audio 2026-05-10 01:24:06 +02:00
package.json Remove coach modes and improve quiz audio 2026-05-10 01:24:06 +02:00
vite.config.js Remove coach modes and improve quiz audio 2026-05-10 01:24:06 +02:00