feat(dataset-updater): Scenarii FR→EN/RU/PT translation configs (#219) - #232
Merged
Conversation
Adds 3 DatasetUpdaterConfig entries (Enabled=false) for translating the 76 untranslated scenarios per target language (EN/RU/PT) via OpenAI GPT-5.4-mini, plus 6 Scenarii-specific prompt files (User + Assistant x 3 languages). Audit (167 total FR-complete scenarios): - EN: 85 scenarios missing ≥1 field (category, subcategory, title, smoothTalker, drawer, context, issue, suggestion_en) - RU: 76 scenarios missing _ru fields - PT: 76 scenarios missing _pt fields Config pattern mirrors #231 (Virtues): SequentialChunks, ChunkSize=8, SelectEmptyTargets=true, MaxGroupItemNb=12, UseFunctionCalling=true. Each config uses a dedicated prompt pair tailored to scenario context: - Scenarii-specific field mapping (catégorie→category, baratineur→smoothTalker, piocheur→drawer, enjeu→issue, suggestion→suggestion_en — only one with suffix) - Narrative-tone instructions (rhythm, humor, brevity) - pt-PT (not pt-BR); Russian contemporary register (not archaic) - Category/subcategory consistency across scenarios - Measured adaptation of French cultural references Prerequisites satisfied: SDK migration #183 (PR #210) + GPT-5.x models (PR #222). Scenario.cs entity already had complete i18n scaffolding (EN without _en suffix is historical design; RU/PT use suffix). Build: 0 errors, 17 warnings (pre-existing). Tests: 88 pass, 1 skip (Freeplane GUI), 0 fail. Closes #219 (pending successful end-to-end run with OpenAI key). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jsboige
force-pushed
the
feat/scenarii-translation-configs
branch
from
April 24, 2026 00:52
acd983b to
5f47e68
Compare
2 tasks
This was referenced Apr 25, 2026
jsboige
added a commit
that referenced
this pull request
Apr 25, 2026
…anslations + fix BOM bug + csproj wildcards (#236) Closes #236. ## Summary ### Prompt refinement (#236) - Fix hallucinated "Vous → impératif" instruction (FR descriptions are declarative/nominal, not 2nd person) - Add canonical family mapping (9 EN / 12 PT / 12 RU families with fixed translations) - Wikipedia link caveat (no fabricated URLs, leave empty if uncertain) - Align assistant prompts with corrected user prompts ### csproj copy gap fix (#236) - Replace 21 explicit `<None Update>` entries with 2 wildcards (`*.txt`, `*.json`) - Fixes latent bug from #228/#231/#232: 21 resource files (Virtues/Scenarii/Rules prompts, CSV samples, Fallacies JSON) were not copied to bin output, blocking DatasetUpdater runs ### Virtues taxonomy translation campaign - EN: 218/223 (97.8%), 1468 _en fields - PT: 223/223 (100%), 1503 _pt fields (links cleared due to hallucination risk — see follow-up note) - RU: 220/223 (98.7%), 1480 _ru fields - All 8 family translations consistent across each language ### TokenManager fix - SharpToken throws on unknown models (e.g. gpt-5.4-mini) — added try/catch with cl100k_base fallback ### Critical bug fix: BOM accumulation in DatasetUpdater - `UtilityExtensions.cs`: strip BOM on read with `TrimStart('')` - `DataSetInfo.cs`: write without BOM via `new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)` - CSV: stripped 3 accumulated BOMs from header (1 per translation cycle EN/PT/RU) - Without fix: CsvHelper would silently mismatch `pk` column header → empty PK column → broken `SelectEmptyTargets` idempotency for all future DatasetUpdater runs ### Review feedback follow-ups 1. EN subsubfamily inconsistency — pk=4,5 "Actual argument" → "Real argument" (matching pk=3, canonical mapping) 2. PT links cleared (203 URLs) — conservative cleanup vs hallucination risk, can be regenerated via future PT run with corrected prompt + caveat ## Validation - ✅ Build: 0 errors, 17 warnings (identical to master) - ✅ Tests: 88 pass / 0 fail / 1 skip (identical to master) - ✅ CSV: 0 BOM, header `pk` clean - ✅ EN consistency: 3× "Real argument", 0× "Actual argument" 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Collaborator
|
Post-hoc review — PR #232 Verdict: ✅ LGTM Well-structured DatasetUpdater configs for translating 76 untranslated scenarios per language. Same proven pattern as other translation configs. Positive:
Observations:
No regressions. Good infrastructure addition. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds DatasetUpdater infrastructure to translate the 76 untranslated scenarios per target language, closing the translation gap for Scenarii (167 total, 76-85 missing per lang).
Same pattern as PR #231 (Virtues translation configs), but adapted for the game-scenario context.
Changes
3 new DatasetUpdaterConfig entries (all
Enabled = false)_rufields_ptfieldsPattern:
SequentialChunks,ChunkSize=8,SelectEmptyTargets=true,MaxGroupItemNb=12,UseFunctionCalling=true,MaxChildren=8,MaxDegreeOfParallelismWebService=4, modelgpt-5.4-mini.6 new Scenarii-specific prompt files
PromptScenariiTranslate{En,Ru,Pt}{User,Assistant}.txtWhy dedicated prompts? Scenarii are narrative game situations (not abstract taxonomy), so the prompts specifically enforce:
_ensuffix (historical design):catégorie→category,baratineur→smoothTalker,piocheur→drawer,enjeu→issue,suggestion→suggestion_en(sole suffixed field)Audit (empirical measurement)
Run on
Cards/Scenarii/Argumentum Scenarii - Cards.csv:All 167 rows have all 8 FR source fields populated.
pathis unique (167/167) and non-empty — validPrimaryField.Prerequisites
Scenario.csentity has complete i18n scaffolding — no entity changes needed_ensuffix are a historical design choice (English was considered the "base" locale), not a bug_ru/_ptsuffix as expectedValidation
Test plan
AssetConverterConfig.jsonfrom C# sourceEnabled = trueon one Scenarii config (e.g. EN) withTakeChunkNb = 1for a dry-run on 8 scenariosUpdateRecordfunction calls fire, CSV is updated with translationsCloses
Closes #219 (pending successful end-to-end run with OpenAI key).
🤖 Generated with Claude Code