Changelog¶
2026-03-08¶
- Performed full Language Engine architecture audit across services/controllers/routes/migrations/docs and mapped existing implementations to canonical module names without creating duplicates.
- Added canonical additive engine adapter services:
lexicalRoleEngineService,semanticConstraintsEngineService,collocationEngineService,sentenceConstructionEngineService,difficultyEngineService,studentLemmaProgressEngineService,placementEngineService, andrubricEngineService. - Verified required schema tables (
lemma_roles,student_lemma_progress,lemma_frequency,sentence_patterns,conversation_turns,conversation_lemmas) are implemented and connected in service flows. - Updated architecture/engine/exercise/word-detail/schema documentation to reflect implemented module mappings, table usage, service-route connectivity, and audit outcomes.
2026-03-08¶
- Documentation updated to reflect current Content Bank architecture including taxonomy system, chunk graph, AI classification engine, verb conjugation engine, and vocabulary difficulty scoring.
- Updated Content Bank architecture docs to describe canonical tables (
taxonomy_categories,taxonomy_values,content_item_taxonomies,vocabulary_components,chunk_components,lemma_assets,lemma_grammar,verb_conjugations) and vocabulary schema fields used by the Lexical Unlock Graph. - Updated architecture/system docs with the Language Learning Engine component map (Vocabulary Graph, Chunk Graph, Sentence Graph, Taxonomy Classification Engine, Lexical Unlock Graph, Grammar Engine, Exercise Generation Engine, AI Classification Engine, Conversation Engine) and interaction flow.
- Updated schema snapshot and Word Detail panel docs to reflect taxonomy-based classification, chunk composition, grammar-topic language scope, and asset/grammar/conjugation integrations while preserving backward compatibility.
2026-03-07¶
- Language Engine Expansion — Morphology Layer.
- Added migration
sql/0063_morphology_engine.sqlwith additive morphology tables:lemma_forms,morphology_features,lemma_morphology_features,inflection_paradigms,lemma_paradigm_assignments, andirregular_forms. - Added
services/morphologyService.jswith morphology APIs for lemma-form retrieval, feature-based form resolution, morphology detection, irregular lookup, paradigm lookup, and form-correctness evaluation. - Integrated morphology checks into grammar validation and exposed morphology analysis/warnings in grammar-engine responses.
- Integrated morphology-aware form resolution and fallback behavior into exercise generation flows.
- Expanded vocabulary detail aggregation payload with
morphology.paradigm,morphology.forms,morphology.irregular_forms, andmorphology.frequency_by_form. - Added WordsManager Morphology UI support (paradigm card, editable forms table, irregular forms, and frequency insights).
2026-03-07¶
- Added migration
sql/0061_conversation_infrastructure.sqlwith optional conversational storage tablesconversation_turnsandconversation_lemmas(+ indexes) for dialogue tracking without replacing existing exercise/sentence models. - Added
services/conversationEngineService.jsand admin endpointPOST /admin/content-bank/conversation/process-turnto process conversational turns via the existing grammar + lexical unlock validation flow. - Conversation validation now reuses the lexical unlock rule (
introduced_unit_id < current_unit OR introduced_unit_id = current_unit AND introduced_step <= current_step) and returns out-of-scope vocabulary signals. - Expanded system documentation for Language Learning Engine architecture (Vocabulary Graph, Chunk Graph, Sentence Lemma Graph, Lexical Unlock Graph, Grammar Validation Engine, Sentence Pattern Engine, Exercise Generation Engine, Conversation Interaction Layer).
- Expanded engine/module specification docs with detailed purpose/inputs/outputs/interactions for Lexical Unlock Graph, AI Grammar Engine, Sentence Pattern Engine, Exercise Generation Service, and Conversation Engine.
- Expanded content-bank and schema docs to include conversational lemma usage and graph relationships across
sentence_lemmas,chunk_components, andconversation_lemmas. - Added
docs/engine/EXERCISE_ENGINE.mddocumenting generation flow, supported exercise types, and conversational-mode reuse.
2026-03-07¶
- Added migration
sql/0060_ai_grammar_engine.sqlintroducingsentence_lemmas,chunk_components, andsentence_patternswith indexes and integrity constraints. - Upgraded sentence/chunk unlock gating to prefer explicit lexical graph tables (
sentence_lemmas,chunk_components) with backward-compatible fallback tosentence_tokens/vocabulary_components. - Added
services/aiGrammarEngineService.jsfor structured sentence validation (unlock checks, adjective position detection, correction payloads, follow-up generation). - Added
services/exerciseGenerationService.jsfor pattern-based exercise generation constrained to unlocked vocabulary/chunks and activesentence_patterns. - Added admin endpoints:
POST /admin/content-bank/grammar-engine/validate-sentencePOST /admin/content-bank/grammar-engine/generate-followupsPOST /admin/content-bank/exercises/generate- Extended sentence/chunk creation flows to persist
sentence_lemmasandchunk_componentswithout breaking existing tables. - Updated architecture, engine, word-detail, vocabulary architecture, and schema docs to document grammar engine extensions and safety model.
2026-03-07¶
- Content Bank Create Lemma modal accessibility hardening: added dialog description to satisfy Radix
DialogContentaccessibility requirement. - Create Lemma AI action UX improved: auto-classify button now enables as soon as lemma text exists (disabled only while loading) and includes explicit AI iconography.
POST /admin/content-bank/lemmas/ai-classifyextended to return grammar topic suggestions (grammar_topics+grammar_topic_ids) with taxonomy-only mapping andUnknownfallback behavior.- Create Lemma AI prefill now applies grammar topic suggestions into the editable grammar topics multi-select.
- Safety contract reinforced in docs: AI classification remains assist-only and never auto-persists lemmas.
2026-03-07¶
- Lexical Unlock Graph: added migration
sql/0059_lexical_unlock_graph.sqlintroducingvocabulary.introduced_stepand progression indexes for unit+step gating. - Engine API: course-scoped vocabulary/sentence listing now accepts step-aware progression (
student_current_unit,student_current_step, optionalstudent_current_unit_id) and filters future lemmas/chunks/sentences. - Content Bank UI: Create Lemma dialog now captures
introduced_stepto persist unlock position metadata. - Taxonomy: added idempotent migration
sql/0058_language_scoped_grammar_topics.sqlto introducetaxonomy_values.language_idand language-scoped grammar topic seeding (EN/PT/TR/ZH examples). - Taxonomy integrity:
0058now enforces grammar-topic language scoping directly attaxonomy_valueslevel (grammar_topicsmust carry a validlanguagestaxonomy reference). - Content Bank API:
PUT /admin/content-bank/lemmas/:id/classificationsnow validates grammar-topic language compatibility and returnsinvalid_grammar_topics_languageon mismatch. - Taxonomy API/UI support: taxonomy values listing now returns
language_id, enabling language-scoped grammar topic selectors in admin UI. - Content Bank UI: Create Lemma grammar-topic selector now resolves course context (
/admin/courses/:id) and filters topics to coursetarget_language_id. - Docs: updated ENGINE_SPEC, ARCHITECTURE, WORD_DETAIL_PANEL_SPEC, and schema snapshot docs to formalize grammar topics as language-scoped taxonomy values.
- Migration simplification: removed optional link-table backfill/detection logic from
0058; migration now focuses ontaxonomy_values.language_id, grammar-topic scope validation trigger, and idempotent language-scoped seed data.
2026-03-04¶
- Stabilization: final cleanup pass completed for language-scoped Content Bank migration; course vocabulary listing/creation now resolves
courses.target_language_id->vocabulary.language_idwith legacy fallback (vocabulary.course_id) and added debug logs for scope resolution. - AI Orchestrator: fortalecido detector de erro de assinatura RPC (run_readonly_sql/run_mutation_sql) para cobrir PGRST202 e variações de mensagem PostgREST.
2026-03-03¶
- Segurança SQL do Copilot/Spok: nova migration idempotente
sql/0023_spok_sql_guardrails.sqlcompublic.sql_audit_logpara auditoria de execuções, incluindoexecuted_by,rpc_nameesql_text. - Adicionadas RPCs
public.run_readonly_sql(sql text)(somenteSELECT/EXPLAIN/descoberta) epublic.run_mutation_sql(sql text)(somenteINSERT/UPDATE/DELETE) com bloqueio explícito de DDL/comandos perigosos. - Criada allowlist administrável
public.sql_mutation_allowlistpara restringir mutações às tabelas autorizadas do projeto, sem exporservice_roleno frontend. - Hardening adicional: limite de tamanho de SQL, bloqueio de múltiplos statements e
statement_timeoutcurto (5s) em ambas as RPCs. - Permissões:
EXECUTErevogado depublice concedido apenas paraservice_rolequando a role existir no ambiente.
2026-03-02¶
- Global Linguistic Engine: nova migration idempotente
sql/0018_global_linguistic_engine.sqlcom camada semântica universal (universal_concepts), relações multilíngues (vocabulary_relations,translation_pairs), taxonomia temática (themes,theme_links), integração curricular (curricular_nodes,lesson_content_map) e governança de IA (content_generation_jobs,ai_prompt_versions). - Workflow editorial:
vocabularyesentencespassam a suportarstatuse campos de override (ai_general_instructions,image_prompt_override,tts_voice_override,translation_override_instructions). - Backend Admin: novo endpoint assíncrono
POST /admin/content-bank/batch-generatepara criação de jobs de geração em lote comtheme,pos,count,target_languageseconstraints. - Documentação:
docs/ENGINE_SPEC.mdatualizado com contrato do batch generator e ciclo editorial padronizado.
2026-03-02¶
- Content Bank (Grammar): nova migration idempotente
sql/0012_grammar_content_bank.sqlcomgrammar_cards,grammar_card_examples,grammar_card_assetse extensão degrammar_concepts(base_lang,level,updated_at). - Backend: novas rotas admin para CRUD de conceitos/cards, exemplos/assets, QA/status e busca de sentenças (
/admin/content-bank/grammar-*), além de rotas públicas/content-bank/grammar-cardse/content-bank/grammar-cards/:id. - UI Admin: novas telas Next.js para Grammar Concepts e Grammar Cards com editor completo, checklist QA e indicação de áudio EN de exemplos via
tts_assets. - Qualidade: adicionados testes unitários do fluxo de grammar content bank (
tests/grammarContentBankController.test.js).
2026-03-02¶
- Practice Engine: novo endpoint público
POST /practice/evaluatecom validação de body (sentence_id,observed,source) e contrato global{ ok: true, data } / { ok: false, error }com códigos400,404e500. - Engine Core: implementado
services/morphologicalEvaluationService.jscom pipeline v1 (normalize NFKC+casefold, tokenização, carregamento de templatesentences/sentence_tokens, alinhamento por índice, avaliação lexical/morfológica/sintática e score 40/40/20). - Qualidade: adicionados testes em
services/morphologicalEvaluationService.test.jscobrindo casoscorrect,wrong_morphology,wrong_form,wrong_order,extra,missinge consistência de score.
2026-03-02¶
- Admin Content Bank: adicionado
POST /admin/content-bank/lemmas/:id/forms/generatecom modossuggest|save, políticaoverwrite_policy=keep_manual, preview de conflitos e persistência idempotente emlemma_formssem duplicatas porlemma_id + form + feature_signature(assinatura lógica defeatures). - Backend: novo gerador morfológico EN v1 (verb/noun/adjective) com override prioritário de irregulares via
docs/irregulars/en_verbs.json. - Admin UI (Word Detail): nova ação Gerar formas com preview editável (form/features), alerta de conflitos e salvamento com recarga de detalhe.
- Qualidade: testes unitários do gerador para
go,study,watch,boxe idempotência do cálculo de inserção.
2026-03-02¶
- Governança: instituído o Enterprise Documentation Engine com wiki pública em
docs.spokeplus.com, estrutura oficial em/docs, snapshot automático de schema e pipeline de deploy contínuo com MkDocs + GitHub Pages. - Governança: PRs com mudança estrutural sem atualização dos docs passam a ser inválidos por política.
2026-03-02¶
- Docs: criada a especificação oficial do
Morphological Evaluation Enginetoken-level emdocs/MORPHOLOGICAL_EVALUATION_SPEC.mdcom contrato versionado de resultado, camadas (lexical/morphology/syntax), normalização multimodal e roadmap v1.0+. - Docs: criada a especificação de geração morfológica
docs/MORPHOLOGY_GENERATION_SPEC.mdcom política lemma-first, regras EN por POS, mecanismo de override irregular e contrato da ação administrativa “Gerar formas”. - Docs: criada a especificação de UI/contrato do painel lexical em
docs/WORD_DETAIL_PANEL_SPEC.md, incluindo seções obrigatórias e payload do endpointGET /admin/content-bank/lemmas/:id/detail. - Docs: adicionado dataset inicial de irregulares em
docs/irregulars/en_verbs.jsone links cruzados noENGINE_SPEC.md,README.mdeMANUAL_MESTRE.md.
2026-03-02¶
- Governança de snapshot estrutural oficial criada com
sql/9000_schema_tables.sql(tabelas) esql/9001_schema_columns.sql(colunas). - Nova migration idempotente
0011_schema_snapshot_view.sqlcria/atualiza a viewvw_schema_snapshotpara inspeção estrutural oficial. - Documentação obrigatória atualizada (README + MANUAL_MESTRE) com checklist pós-migration para eliminar divergência entre schema real e docs.
2026-03-02¶
- PR: Morphological universal multilingual content bank
- Nova migration
0010_morphological_engine.sqlcomlemma_forms,morphology_rules,semantic_relations, novos campos emvocabularye extensão desentence_tokens. - API admin atualizada com
GET /admin/content-bank/lemmas/:id/detaile validação obrigatória de tokens comlemma_idexistente ao criar sentenças. - Risco/migração: aplicar
0010após0009; alteração é idempotente e sem mudança de portas/PM2.
2026-03-02 — Fase E (TTS Enterprise VPS-only)¶
- Added idempotent migration
sql/0013_tts_assets.sqlwith definitivetts_assetsschema, multi-voice indexes, and status hardening. - Added provider-agnostic TTS service layer (
services/tts/*) with deterministic hash cache and storage persistence. - Added BullMQ queue module and dedicated worker (
workers/ttsWorker.js). - Added admin enqueue flow for sentence
mark-readyand queue monitoring endpoint/admin/system/queues/tts. - Updated grammar card ready flow to asynchronous
processing_audiobefore finalready. - Added unit tests for queue dedupe and worker status transitions.
- Updated docs for Redis local setup and PM2 worker.
2026-03-02 — AI Copilot + Documentation Engine Integration (baseline)¶
Added¶
services/ai-orchestrator/com provider config, intenção, tools allowlist e PATCH PLAN.- Endpoints admin de copilot (
/admin/copilot/messages,/admin/copilot/history). - Tabela
ai_action_logs(sql/0014_ai_action_logs.sql). - Endpoint interno de busca documental (
GET /internal/docs/search) + índicedocs/docs-search-index.json. - Rota
/admin/docs/metadatacom versão e commit hash dos docs. - Integração ElevenLabs consolidada na API principal.
- Copilot lateral inicial no dashboard web e rota
/admin/docs. - Documento
docs/AI_COPILOT_ARCHITECTURE.md.
2026-03-04¶
- Added idempotent migration
sql/0027_course_content_and_app_cms.sqlintroducingcourse_content_itemsplus App CMS tables (app_projects,app_themes,app_pages,project_course_bindings). - Added course-scoped Content Bank endpoints (
POST /admin/courses/:id/content-bank/link,GET /admin/courses/:id/content-bank/:type) and advanced filters. - Added App CMS admin endpoints (
/admin/app-projects*) and public domain bootstrap endpoint (GET /admin/app-projects/domain/:domain). - Added word detail actions for manual assets, generate-audio queueing, and explicit image provider-not-configured behavior.
- Updated admin web UI for course selection gate, scoped filters, App CMS page, and dark-mode-safe token usage.
2026-03-07¶
- Lexical Unlock Graph: added migration
sql/0059_lexical_unlock_graph.sqlintroducingvocabulary.introduced_stepand progression indexes for unit+step gating. - Engine API: course-scoped vocabulary/sentence listing now accepts step-aware progression (
student_current_unit,student_current_step, optionalstudent_current_unit_id) and filters future lemmas/chunks/sentences. -
Content Bank UI: Create Lemma dialog now captures
introduced_stepto persist unlock position metadata. -
Vocabulary Content Bank UI redesigned as a course-scoped lexical editor in
/courses/[courseId]/content-bank/lemmaswith structured lexical list columns, quick filters, and cross-entity search (lemma/translation/sentence text). - Vocabulary Content Bank documentation aligned to taxonomy-driven architecture and formalized as the canonical lexical knowledge graph model.
- Documented official Word Detail lexical editor behavior, including dynamic POS panels and the Save All lexical workflow.
- Documented chunk builder constraints for multiword expressions composed from existing lemma components.
- Documented number lemma representation using
numeric_value+spelled_formfor recognition and transformation exercises. - Updated schema snapshot docs to emphasize taxonomy classification (
taxonomy_categories,taxonomy_values,content_item_taxonomies) and legacy mirror-field status. - Create Lemma flow upgraded to modal with multi-POS taxonomy selection and lemma-level metadata capture (CEFR, frequency, register, semantic domain, lemma type).
- Word Detail upgraded with tabbed lexical workflow (
Core,Morphology,Senses,Translations,Sentences,Pronunciation,Semantic Relations,Taxonomies,Chunks) and singleSave Allpersistence action. - Backend compatibility maintained: existing endpoints preserved while adding enhanced list/search metadata and broader classification persistence (
status,numeric_value,spelled_form). - Added migration
sql/0054_vocabulary_taxonomy_ui_support.sqlfor number dual-representation columns and guaranteed taxonomy seeds for special tokens (symbolPOS +token_roles). - Documentation updated across architecture/operations/schema to reflect the new vocabulary taxonomy workflow and data model links.
2026-03-07¶
- Lexical Unlock Graph: added migration
sql/0059_lexical_unlock_graph.sqlintroducingvocabulary.introduced_stepand progression indexes for unit+step gating. - Engine API: course-scoped vocabulary/sentence listing now accepts step-aware progression (
student_current_unit,student_current_step, optionalstudent_current_unit_id) and filters future lemmas/chunks/sentences. -
Content Bank UI: Create Lemma dialog now captures
introduced_stepto persist unlock position metadata. -
Added migration
sql/0056_hierarchical_curriculum_taxonomy.sqlwith hierarchical taxonomy support (taxonomy_values.parent_id) and self-referential FK/index. - Reused existing taxonomy categories (
languages,semantic_domains,unit_types,cefr_levels,frequency_bands,registers,parts_of_speech) and added/ensuredcurriculum_units+grammar_topicswithout duplicating existing categories. - Seeded curriculum progression taxonomy (
Unit 1..Unit 300) and linked units tounit_typesvia parent taxonomy relationships. - Extended vocabulary compatibility with
introduced_unit_idand updated classification APIs to persistcurriculum_units(exactly one introduced unit) andgrammar_topics. - Updated Create Lemma modal with hierarchical semantic-domain selector, curriculum-unit selector, and grammar-topic multi-select.
- Added progression gating support in scoped vocabulary queries using
student_current_unit(rule: introduced unit must not exceed learner unit). - Updated architecture/engine/word detail/schema documentation to reflect hierarchical taxonomies and curriculum-unit integration.
- Added AI-assisted lemma pre-classification in Create Lemma (
Auto classify with AI) with backend endpointPOST /admin/content-bank/lemmas/ai-classify, taxonomy-safe mapping, Unknown fallback, and no automatic persistence.
2026-03-07¶
- Lexical Unlock Graph: added migration
sql/0059_lexical_unlock_graph.sqlintroducingvocabulary.introduced_stepand progression indexes for unit+step gating. - Engine API: course-scoped vocabulary/sentence listing now accepts step-aware progression (
student_current_unit,student_current_step, optionalstudent_current_unit_id) and filters future lemmas/chunks/sentences. -
Content Bank UI: Create Lemma dialog now captures
introduced_stepto persist unlock position metadata. -
Added migration
sql/0057_vocabulary_difficulty_score.sqlto introducevocabulary.difficulty_scorewith range check/index and CEFR+frequency backfill for existing rows. - Added vocabulary difficulty derivation service with taxonomy/frequency/grammar/abstraction heuristic and AI suggestion parsing.
- Added admin endpoint
POST /admin/content-bank/lemmas/:id/recompute-difficultysupporting recompute strategies (taxonomy,ai). - Extended AI classify response to include normalized
difficulty_scoresuggestion. - Extended course-scoped adaptive vocabulary filtering with
student_difficulty_leveland ascending score ordering. - Updated Word Detail UI with Difficulty Score field + recompute actions (taxonomy and AI).
- Updated architecture/engine/schema/word-detail docs for the new adaptive difficulty model.
2026-03-07¶
- Added migration
sql/0062_language_engine_expansion.sqlintroducing final additive language engine tables:lemma_roles,lemma_semantic_classes,verb_object_constraints,modifier_constraints,student_lemma_progress,pattern_difficulty,lemma_frequency, andcollocation_strength. - Extended exercise generation to consume optional role/semantic/collocation/difficulty signals while preserving fallback behavior.
- Extended grammar validation with optional semantic-constraint and naturalness hints.
- Extended conversation processing with optional
student_lemma_progressupdates after validated turns. - Extended vocabulary detail aggregation with lexical role, semantic class, frequency detail, collocation insights, and student usage analytics sections.
- Added additive admin UI enhancements in vocabulary list/tooling visibility (difficulty and introduced step columns + grammar/exercise tooling actions).
- Added dedicated engine docs:
docs/engine/GRAMMAR_ENGINE.md,docs/engine/CONVERSATION_ENGINE.md,docs/engine/SEMANTIC_CONSTRAINTS.md,docs/engine/STUDENT_PROGRESS.md.