Lexeme-centered data model
The core model separates lexical identity, inflected forms, generated task specifications, and practice history. The schema includes lexemes, inflections, task_specs, and practice_history, with part-of-speech-specific source data for verbs, nouns, adjectives, adverbs, prepositions, and other categories.
A shared task registry decouples canonical language content from exercise rendering: the API serves POS-aware task descriptors and the client renders practice by taskType.
Content-to-practice pipeline
Offline practice and replay through the same history model
The PWA caches recent task responses for offline reuse, while attempts made without a usable network are queued in IndexedDB through Dexie.
When connectivity returns, queued attempts are replayed through the normal submission endpoint with a persistent device identity, preserving the same practice-history model for online and offline activity.
Content provenance and enrichment
The enrichment pipeline identifies incomplete entries, collects structured material from external lexical sources, optionally fills missing fields with an LLM, and retains provider snapshots so enrichment inputs can be inspected or replayed later.
Collection and mutation are separated: suggestions can be generated without changing the canonical database, reviewed, backed up, and then applied with attribution metadata where required.
Isolated database and content testing
The test harness runs the real Drizzle migrations against an isolated in-memory Postgres implementation, seeds controlled data, executes API tests, and tears the schema down again; a real Postgres instance can be substituted when needed.
Task-pack linting, type checking, unit/integration tests, environment validation, and build-time checks cover generated content and schema changes before they reach the practice client.