Skip to content

fix(prompts): prevent baratineur contamination in PT DatasetUpdater - #297

Merged
jsboige merged 1 commit into
masterfrom
fix/dataset-updater-pt-prompts
May 17, 2026
Merged

fix(prompts): prevent baratineur contamination in PT DatasetUpdater#297
jsboige merged 1 commit into
masterfrom
fix/dataset-updater-pt-prompts

Conversation

@jsboige

@jsboige jsboige commented May 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Root cause fix for the 92% PT Scenarii and 42% PT Rules "baratineur" contamination identified during ai-01's i18n audit (cycles 32-33).

Problem

  • Scenarii PT prompt (PromptScenariiTranslatePtUser.txt): Lacked explicit source→target field mapping (unlike EN prompt which has a clear mapping table). The vague directive "traduis par des équivalents portugais naturels" was ignored by the model ~92% of the time.
  • Rules PT prompt (PromptRulesTranslatePtUser.txt): Line 13 explicitly instructed the model to conserve "Baratineur" and "Mixologue" as proper nouns → the model was told NOT to translate them.

Changes

Scenarii PT:

  • Added explicit field mapping table (matching EN prompt structure): baratineur → smoothTalker_pt, piocheur → drawer_pt, etc.
  • Strengthened directive: "baratineur" and "piocheur" must be translated, never left in French
  • Renumbered items to maintain consistency

Rules PT:

  • Removed "conserve Baratineur/Mixologue" directive
  • Clarified: only "Argumentum" and card family names are proper nouns to preserve
  • Roles must now be translated to Portuguese equivalents

Test plan

  • Both prompt files reviewed against EN equivalents for consistency
  • Validation: re-run DatasetUpdater PT on 3-5 test records to confirm "baratineur" is now translated
  • Full PT re-translation run after validation (Scenarii 167 records + Rules 24 records)

Context

🤖 Generated with Claude Code

…amination

Root cause of 92% PT Scenarii and 42% PT Rules contamination:
- Scenarii PT prompt lacked explicit field mapping (unlike EN prompt)
- Rules PT prompt explicitly instructed "conserve Baratineur (rôle du jeu)"

Changes:
- Scenarii PT: add explicit source→target field mapping table
- Scenarii PT: strengthen directive to translate baratineur/piocheur
- Rules PT: remove "conserve Baratineur" — roles must be translated
- Rules PT: clarify that only game name and card family names are proper nouns

These fixes must be in place before any DatasetUpdater PT re-run.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

@jsboige jsboige left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review ai-01 — cycle 37

Verdict : 🟢 APPROVE (COMMENTED) — root cause fix exact pour findings #7 + #11. Validation hypothèse cycle 34 #3.

Convention checklist

  • Diff sanity : +17/-11, 2 fichiers prompts seulement, surgical
  • Format : .txt préservé, encoding propre
  • No data regression : N/A (prompts, pas de data)
  • CI verts : Build Debug + Release + GitGuardian SUCCESS

Smoking gun confirmé

Rules PT prompt (AVANT) :

3. **Termes du jeu :** Conserve les noms propres du jeu tels que :
   - "Argumentum" (nom du jeu)
   - "Baratineur" (rôle du jeu)   ← LE BUG ÉTAIT LITTÉRAL
   - "Mixologue" (rôle du jeu)

→ Le prompt explicitement instructait le modèle de NE PAS traduire "Baratineur". Le 42% records cassés (#211) était une conséquence directe du prompt mal formulé. Confirme hypothèse #3 cycle 34 ("SystemPromptPrefix PT Scenarii/Rules ne contenait pas la directive de traduction de baratineur").

Rules PT prompt (APRÈS) :

"Argumentum" (nom du jeu) reste "Argumentum". Les noms des familles de cartes (en français) sont des noms propres — conserve-les en français. Les rôles comme "Baratineur" et "Mixologue" doivent être traduits en équivalents portugais naturels.

✓ Inversion claire, conservation préservée pour Argumentum + family names.

Scenarii PT prompt — améliorations clés :

  1. Field mapping explicite (item 2 ajouté) :

    - baratineur → smoothTalker_pt
    - piocheur → drawer_pt
    - contexte → context_pt
    - enjeu → issue_pt
    - suggestion → suggestion_pt
    

    → Matche la structure EN prompt qui marchait (cycle 34 a confirmé Fallacies/EN clean).

  2. Item 6 renforcé "TRADUIRE OBLIGATOIREMENT" avec emphasis (must) + exemples concrets ("convencedor", "bobo") :

    "baratineur" et "piocheur" sont des rôles de jeu qui doivent être traduits en portugais. Ces mots sont français et ne doivent jamais apparaître tels quels dans les champs cibles.

→ Inversion claire vs ancien wording vague ("traduis par des équivalents portugais naturels"). Le modèle ne pourra plus se tromper sur l'intention.

Impact attendu

Si PR mergé puis re-run DatasetUpdater PT sur :

  • Scenarii (167 records) : devrait éliminer les 154 records contaminés "baratineur*" → coverage qualité ~95%+
  • Rules (24 records) : devrait débloquer #211, fixer les 10/24 records cassés

Test plan — recommandations ai-01

Avant le full re-run sur 167+24 records :

  1. Smoke test 5 records Scenarii diverses catégories (histoire/mythologie/relation/politique)
  2. Diff line-by-line sur cellules avant/après PT pour valider sémantique (sample 10)
  3. Lint regex post-génération : grep baratin* doit retourner 0 dans cellules PT
  4. Cross-check glossaire : termes utilisés ("convencedor"/"bobo"/autre?) cohérents entre records

Note GDrive

Re-run DatasetUpdater écrira sur CSV local. Workflow attendu :

  1. Re-run prompts corrigés → CSV local updated
  2. Diff vs master (avant merge data)
  3. Upload GDrive avec safety (download → diff → re-upload)
  4. PR data update (séparée de cette PR prompt fix)

→ Cette PR prompt fix est standalone et peut merger maintenant. Le data update arrive en suivi.

🤖 Generated with Claude Code

@clusterManager-Myia clusterManager-Myia left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — clean prompt engineering fix for the PT baratineur contamination.

PromptRulesTranslatePtUser.txt: Replaced the explicit keep-as-French list (Baratineur, Mixologue) with a translate-to-PT directive. Correct — these are role names, not proper nouns.

PromptScenariiTranslatePtUser.txt: Added explicit source→target field mapping (baratineur→smoothTalker_pt, piocheur→drawer_pt, etc.) and strengthened rule #6 with MUST-translate + never-appear-as-French language. The mapping table closes the ambiguity gap that caused the 92% contamination rate.

No issues found.

@jsboige
jsboige merged commit 9980a73 into master May 17, 2026
3 checks passed
@jsboige
jsboige deleted the fix/dataset-updater-pt-prompts branch June 1, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants