Commit graph

265 commits

Author SHA1 Message Date
lila
5ee594334c flooring sense difficulty instead of rejecting the entry
Every rejection in the German run was the same rule: a translation ranked
below its own sense. The model tags a sense "medium" while correctly
tagging some translations "easy" — the translations are right and the
derived sense label is wrong, but the whole entry was discarded.

The prompt defines sense difficulty as the easiest translation difficulty
in that sense, so it is a derived value rather than an independent
judgement. validate.ts now recomputes it via applySenseDifficultyFloor.

The floor only ever lowers. Raising a sense to match its translations
would gate a concept out of levels it belongs in and collapse the
concept-vs-word distinction the two difficulty columns exist to express
(design-doc section 4).

- validate.ts: drop the cross-field rejection, add the floor; the valid
  result now carries "normalizations" so repairs are reported, not silent
- pipeline.ts: count and print normalizations per batch and in the summary
- replay.ts: new, re-validates responses/ with the current rules and no
  API calls; --write stages recovered entries, --langs and --verbose
- tests: six cases covering the floor, replacing the old rejection test

Replaying all 38 saved responses took the reject rate from 20 entries to
zero. staging.db now holds 746 words / 774 senses / 3,436 translations
with no sense ranked above its easiest translation.

Docs also record the API quota ceiling found today: the free tier allows
about 20 requests/day, not the 1,000 previously assumed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 12:34:37 +02:00
lila
da9cdbfa1b updating docs to match the implemented phase 3 pipeline
The pipeline docs still described pipeline.ts as pseudocode and the
validation module as unwritten. Both have been implemented and run.

- CLAUDE.md: replace the "no executable pipeline yet" description with
  the actual module flow, plus the two invariants worth preserving
  (resumability via headword diffing, raw responses saved before parsing)
- DATA_PIPELINE.md: mark the seven implemented modules, add a module
  responsibility map and the CLI flag table, drop the resolved warning
  about hardcoded prompt values
- roadmap.md: check off phase 3 tasks 3.2/3.3/3.4, record where the
  build diverged from the plan, note that validate.ts is stricter than
  its own spec
- STATUS.md: phase 3 is data work now, not code work

Also records two open issues: the systemic difficulty-ordering rejection
cause, and the hard-tier shortfall pending a full run.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-20 12:10:48 +02:00
lila
37c978e230 implementing phase 3 pipeline: gemini structured output, validation, sqlite staging
Prompt is now a template (fixes the hardcoded en/es leftovers in rules
2, 3, 15, 16, 26, 31). pipeline.ts replaces the pseudocode: wordlist
normalization, skip-already-staged idempotency, batches of 20 against
gemini-3.6-flash with responseSchema, raw responses persisted per batch,
per-entry validation with rejection log, one transaction per word into
db/staging.db. Flags: --langs --pos --max-batches --delay-ms --dry-run.

Smoke run: 40/40 words staged (de+es, one batch each), 0 rejections.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 19:04:04 +02:00
lila
303bb9388c updating pipeline roadmap and status to match branch reality
Roadmap: phase 4 re-scoped to import only (migration already applied),
phase 3 gains prompt templating, wordlist dedup, structured output,
raw-response persistence, and validation tests; idempotency decision
documented (skip already-staged words, one transaction per word).
Stale paths, postgres setup, and file structure corrected.

STATUS.md: refreshed from stale 2026-05-15 Kaikki state to current
gemini-only pipeline work.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-09 13:32:15 +02:00
lila
e534b98bc5 updating documentation, prettier format 2026-08-02 01:01:33 +02:00
lila
039ed50567 renaming files and folders to convention so no mapping is needed 2026-07-24 14:12:12 +02:00
lila
29844ca0a6 finishing phase 2 2026-07-24 13:53:33 +02:00
lila
e4a12c5ff0 updating prompt 2026-07-24 13:45:32 +02:00
lila
4acbbe1929 updating prompt 2026-07-24 13:26:33 +02:00
lila
c46368616d adding pipeline db credentials and gemini api key 2026-07-24 13:26:20 +02:00
lila
214a7ecff1 adding sql schema for sqlite db, adding sqlite db to gitignore 2026-07-24 00:33:28 +02:00
lila
63f27e8e13 Add words, senses, translations schema migration 2026-07-24 00:23:56 +02:00
lila
061b05afb6 setting up postgres container for new schema 2026-07-23 23:57:11 +02:00
lila
5eda891fb5 adding prompt to query the language data 2026-07-23 20:03:31 +02:00
lila
73c3e6f4fc adding noun lists for all 5 languages 2026-07-23 18:43:13 +02:00
lila
e0b1f7f92f updating documentation 2026-07-23 16:57:07 +02:00
lila
de3ebf66a9 adding new schema for words, senses and translations incl. relations 2026-07-23 16:49:16 +02:00
lila
0770ff9ec6 adding genders of nouns 2026-07-23 16:48:25 +02:00
lila
7e02a03bda renaming difficulty level intermediate to medium 2026-07-23 14:15:53 +02:00
lila
61fa032d6c updating docs 2026-07-23 14:15:33 +02:00
lila
88b16a1ed7 removing not needed files 2026-07-21 17:45:10 +02:00
lila
597083e1fd refactor: gut old pipeline architecture for complete rewrite 2026-07-18 15:24:27 +02:00
lila
0ae3b9f686 refactor: remove CLI, local LLM support, and unused configs 2026-07-18 15:06:25 +02:00
lila
55ddcd3180 updating documentation 2026-07-18 14:50:15 +02:00
lila
56f479da45 wip 2026-07-06 18:07:32 +02:00
lila
4fb1550e7d wip 2026-07-06 17:12:25 +02:00
lila
8e8484f875 wip 2026-07-06 15:35:22 +02:00
lila
e89e3b7a70 bugfixing #3 2026-07-06 15:21:52 +02:00
lila
1c4dcdd108 bugfixing #2 2026-07-06 14:41:30 +02:00
lila
2a6c56ed23 bugfixing #1 2026-07-06 14:27:47 +02:00
lila
afd28d934e wip 2026-07-06 13:09:30 +02:00
lila
cc89f0c75c wip 2026-06-03 00:02:19 +02:00
lila
0118798e36 feat: guest play — allow singleplayer quiz without auth
- Add optionalAuth middleware: attaches session when present,
  never blocks (guests pass through)
- Make game endpoints (start/answer) accept optional auth
- GameSessionStore.userId: string → string | null
- Rate limiter falls back to IP for unauthenticated users
- Frontend: remove /play route guard, show 'Create account' CTA
  on score screen for guests
- Add tests for guest session creation, answer submission,
  and cross-user session isolation
2026-05-31 21:28:08 +02:00
lila
d55a1ed648 wip 2026-05-30 03:47:59 +02:00
lila
37f6a55798 updating docs 2026-05-30 03:47:52 +02:00
lila
caa2f7d395 updating docs 2026-05-25 01:04:49 +02:00
lila
7e0311683f updating documentation 2026-05-16 01:59:43 +02:00
lila
1ba57c7e9d adding tasks 2026-05-15 23:12:55 +02:00
lila
97b0f302d0 refactoring documentation 2026-05-15 23:09:54 +02:00
lila
04a581efe1 WIP: checkpoint before stage-3 sub-stage rewrite 2026-05-12 22:13:14 +02:00
lila
73fb12ac35 feat: enrich script working, redesigning to sub-stage architecture
- Enrich script functional with timeout, progress tracking, rejection mechanism
- Identified ordering issue: CEFR voting needs validated translations first
- Redesign: round1_gloss → round1_example → round1_translations → round1_cefr
- Update data-pipeline.md with new sub-stage design and roadmap
- Qwen3.5-4B confirmed working with thinking disabled
2026-05-07 13:09:43 +02:00
lila
7f10c35e03 docs: update roadmap — stage 3 enrich script written, llama.cpp next 2026-05-05 19:30:18 +02:00
lila
9642daf6dd feat: add stage 3 round 1 enrich script and wire into orchestrator 2026-05-05 19:28:38 +02:00
lila
76af2ab093 fix: update db import validation tests to account for reverse links
- Translation count test now adds reverse link count to expected total
- Non-English translations test now filters to kaikki source only
- Target language test now filters to kaikki source only — reverse links
  to English are valid and expected
2026-05-05 19:10:19 +02:00
lila
1c44ef989b feat: update pipeline orchestrator for Kaikki — wire up stages 1 and 2
- Replace checkOmwExists with checkExtractedFilesExist
- Wire up importKaikki and reverseLink as real stage implementations
- Track reverse link completion via sentinel row in run_status
- Update report to use resolved_entry_cefr and entry counts
- Stages 3 onwards remain as stubs
2026-05-05 19:04:28 +02:00
lila
6f9a42c707 feat: add stage 2 reverse link sync script 2026-05-05 18:57:55 +02:00
lila
b5a76ee178 docs: update roadmap — stage 1 in progress, sample extraction complete 2026-05-05 18:52:10 +02:00
lila
ba2635e3f7 feat: add stage 1 and db import validation tests for Kaikki schema 2026-05-05 18:51:11 +02:00
lila
0cc643e308 feat: update extractor for all 5 languages, update import for multi-language
- Extract.ts now processes all 5 language files, filters non-English
  entries by lang_code, skips translation extraction for non-English
  (no translations in source files)
- Import.ts now imports all 5 language output files, uses language
  field from ExtractedSense instead of hardcoding en
- Sample limit hardcoded to 500 entries per language for development
2026-05-05 18:46:32 +02:00
lila
209d52f54b feat: add Kaikki extraction and import scripts for stage 1
- Add stage-1-extract/scripts/extract.ts — streams Kaikki JSONL,
  filters to supported POS and languages, skips abbreviations and
  senses with no translations in supported languages
- Rewrite db/import.ts for Kaikki flat model — tracks sense_index
  offsets per headword+pos to handle duplicate JSONL entries
- Rewrite db/schema.sql for Kaikki model — entries, translations,
  LLM vote tables, resolved tables
- Add extract and db:import scripts to package.json
- Sample mode hardcoded to 500 entries for development
2026-05-05 18:11:53 +02:00