Skip to content

Align documentation with current implementation - #16

Merged
prathamkashyap merged 1 commit into
mainfrom
docs/truth-pass
Oct 4, 2026
Merged

prathamkashyap merged 1 commit into
mainfrom
docs/truth-pass

Conversation

@prathamkashyap

Copy link
Copy Markdown
Owner

Documentation-only truth pass. No application, test, config, CI or deployment files are touched —
the commit contains exactly README.md and docs/KNOWN_LIMITATIONS.md.

Both documents had been frozen while the reliability work landed underneath them, so they described
the original prototype. KNOWN_LIMITATIONS.md was the sharper problem: it opened with three
sections that contradicted its own later sections. "Synchronous Document Indexing" and "Lack of
Background Task Runners" are both false today, while sections further down describe
INDEX_MATERIAL / SYNC_ATTEMPT as tracked background jobs — a reader hitting line 14 and line 59
got opposite answers. That framing is rewritten so limitations read as deferred work rather than as
failures of the shipped system.

Corrections

Retrieval is described accurately. The shipped retriever is local-hash-v1: tokenise, drop stop
words, FNV-1a hash each token into one of 384 dimensions with a sign bit, L2-normalise, compare by
cosine, blend with lexical keyword overlap at 0.78 · vector + 0.22 · lexical. Every component is
lexical — no learned embedding model, no vector store. Both documents now say so plainly. Worth
noting: a full BM25 implementation exists in bm25Retriever.js, but it is imported only by its own
tests
, so a reader would reasonably assume it was active. It is not.

Semantic retrieval remains deferred, and is listed as such rather than as current capability —
adopted on evidence that the lexical baseline has plateaued, not on the assumption that embeddings
generalise better. Deferred terms appear 3 times under "Deferred" and 0 times under "Shipped".

Synchronous versus BullMQ work is distinguished. Quiz generation is a synchronous request that
calls the provider inline; mistake analysis is also inline (quizController.js:316). Only two jobs
are enqueued by the API today — INDEX_MATERIAL and SYNC_ATTEMPT. REBUILD_REVIEW_QUEUE is
handled by the worker but has no route trigger. The previous "everything from PDF parsing to mistake
analysis in the background" was false on both counts.

A tension worth recording rather than hiding: AI_COMPLETION_TIMEOUT_MS is 30s, yet measured
generation takes 117–244s. Not a contradiction — aiQuizService.js:295-297 issues up to three
sequential provider calls. The timeout is per call; the wall-clock is their sum.

Tutor history is an interaction/audit log, not conversational memory. GET /api/v1/tutor/history
reconstructs from LearningEvent records with eventType: "ai_tutoring_interaction", returning
topic, question, result and timestamp. tutorService.js holds no message history at all, so follow-up
questions do not inherit earlier turns. Documented explicitly so the endpoint is not read as a
transcript.

Current GROQ_MODEL configuration is documented: process.env.GROQ_MODEL || "openai/gpt-oss-120b".
The previously hard-coded default was retired by Groq and returned 404 model_not_found on every AI
feature; it is named only in the source comment recording that incident, and appears nowhere in these
documents.

Production topology is documented accurately. Render free tiers only: static frontend, one free
web service running start:combined → node main.js (which starts the HTTP server and the
BullMQ consumer in a single process), free Key Value Redis, and Atlas M0 — the previous "M10+
with replica set" was wrong on both count and tier. autoDeployTrigger: off is stated, because a
merge does not deploy. The environment table also now records that ALLOWED_ORIGINS is required in
production and that an empty value permits no browser origin.

Test counts were re-measured, not carried over. The README claimed "118 tests across 6 suites"
for backend unit; the actual figure is 942.

Suite Measured
Frontend (Vitest) 374 passed / 29 files
Backend unit (Jest) 942 passed / 36 suites
Backend integration (Jest) 101 passed, 13 skipped / 114 total
Browser E2E (Playwright) 26 passed, 2 skipped
typecheck · lint · build pass

Re-run after editing to confirm the documented figures had not drifted.

Two limitations reworded rather than copied

Topic snooze. The previous "read-before-write race" was stale: snoozeReviewQueueItem is a
single atomic findOneAndUpdate. The real behaviour is asymmetric durability — a failed_question
item's dueAt is protected during a rebuild by $max/$min, while a topic item's dueAt is
recomputed from progress and deliberately overwritten, so a topic snooze does not survive a rebuild.

Flashcard identity. itemType flips between due_flashcard and overdue_review at the one-day
boundary, and it participates in both the upsert filter and the unique index. The service contains no
delete or cleanup of superseded rows, so a card crossing the boundary can appear twice. Affects the
queue only; the card's own SM-2 schedule is untouched.

Theme caveat recorded accurately

The persisted theme preference is applied at boot on every route. The remaining gap is only that the
landing page and auth screen expose no toggle — switching stays in the authenticated shell.
Documented explicitly as not an initialisation defect, since that was fixed in #15.

Verification

npm test · npm run typecheck · npm run lint · npm run build · npm run test:e2e all pass.
git diff --check clean. No files outside the two allowed were modified.

@prathamkashyap
prathamkashyap merged commit b4b1bfc into main Oct 4, 2026
3 checks passed
@prathamkashyap
prathamkashyap deleted the docs/truth-pass branch October 4, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant