feat(dataset-updater): Virtues FR→EN/RU/PT translation configs (#218 phase 2) - #231
Merged
Merged
Conversation
) Completes phase 2 of #218 by wiring the DatasetUpdater to the Virtues taxonomy now that the CSV columns (_en/_ru/_pt) and entity properties are in place (PR #223 + #229 — both merged on master). Changes: - DatasetUpdaterRootConfig.cs: 3 new configs (Enabled=false each), one per target language. Same structure as the Fallacies translation configs that have been production-proven on this pipeline - 6 new prompt files adapted for Virtues taxonomic content: - PromptVirtuesTranslate{En,Ru,Pt}{User,Assistant}.txt - Each enforces taxonomy coherence across entries, FR "vous" → target-language register, canonical logic terminology, and wiki link localization Design notes: - SelectEmptyTargets=true so re-runs only fill gaps (cheap deltas) - ChunkSize=8, MaxGroupItemNb=12 — small batches for translation quality (large batches tend to drift on niche logic terms) - Model: gpt-5.4-mini (eco tier, matches Fallacies translation configs) - pt-PT explicitly requested (not pt-BR), consistent with Rules PT retranslation (#211) Test plan: - dotnet build succeeds - 88 tests pass - End-to-end: set Enabled=true on one config, run pipeline with OpenAI key, verify 3-5 rows translate cleanly (same validation gate as #183 DatasetUpdater acceptance) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 tasks
jsboige
added a commit
that referenced
this pull request
Apr 24, 2026
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>
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 #231 Verdict: This PR wires the DatasetUpdater to populate Virtues translations via OpenAI function calling. Three new configs (EN, RU, PT) + 6 prompt template files. Positive:
Prompt concerns (noted as fixed in #238):
Since #238 fixes these prompt issues, the overall trajectory is correct, but this PR in isolation has prompt quality problems that could produce bad translations if run as-is. Verdict adjusted: Acceptable as a scaffold, but should not be run without #238's prompt fixes applied. |
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
Completes phase 2 of #218. With the CSV i18n columns (PR #223) and Virtue entity scaffold (PR #229) now on master, this PR wires the DatasetUpdater to populate Virtues translations via OpenAI.
What's added
3 new configs in `DatasetUpdaterRootConfig.cs` (Enabled=false each)
6 new prompt files in `DatasetUpdater/Resources/`
`PromptVirtuesTranslate{En,Ru,Pt}{User,Assistant}.txt` — each enforces:
Design rationale
Test plan
Follow-ups not in this PR
🤖 Generated with Claude Code