fix(memo): #443 Mémo Back grid — language-invariant 7×3×3 grouping - #449
Conversation
…uping
The Mémo Back card collapsed from the spec 7×3×3 taxonomy grid (7 families ×
3 sub-families × 3 sub-sub-families) to an irregular shape. Root cause: the
template grouped the grid via name-coincidence markers
({{#ifCond Famille "==" text_fr}} …) that fired only on rows whose text_fr
happened to equal their own level label. FR rename campaigns (#351 ×27,
#308 ×13) changed text_fr → the coincidences vanished → families collapsed
(Tricherie sub-families = 0, Erreur math/raisonnement = 1, …). The taxonomy
DATA is correct; only the template's grouping was broken.
Fix (lane ai-01 = TEMPLATE, data is fine):
- CardPen main.js: add 3 control-break helpers reading the language-invariant
FR taxonomy columns (Sous-Famille / Soussousfamille), present in every row
regardless of render language. They carry NO column token, so the localizer
(CardSetLocalization.FormatField appends "}}") cannot corrupt the helper call:
ifFamilyHeader = Sous-Famille=='' && Soussousfamille==''
ifSubfamilyHeader= Sous-Famille!='' && Soussousfamille==''
ifLeafFirst = Soussousfamille!='' on first occurrence (control-break)
- Argumentum_Memo_Back_fr.json: swap the 3 name-coincidence conditions for the
new helpers (display tokens {{Famille}}/{{Sous-Famille}}/{{Soussousfamille}}
unchanged → localization preserved); fix colorPalette to iterate the rowset
and emit one swatch per family-root (was fixed indices 0/25/50/…/150, which
duplicated Influence and omitted Obstruction).
Single shared template → fix propagates to all 8 languages.
Validated three ways on the real injected data (taxonomy WHERE carte∈{1,2},
176 rows): (1) Node + vendored Handlebars → 7 families / 21 sub-families /
63 leaves; (2) OLD-template render proving the regression (10/53, Tricherie=0);
(3) LIVE CardPen engine (Playwright) → 7×3×3 DOM + 7 distinct palette colors
(Obstruction red present, no Influence duplicate) + viewed screenshot.
Refs #443
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
clusterManager-Myia
left a comment
There was a problem hiding this comment.
[NanoClaw]
Clean, well-scoped fix. The root cause analysis is solid.
Logic verification (7x3x3 grouping)
The three helpers form a correct control-break pattern over the language-invariant FR taxonomy columns:
ifFamilyHeader— sf=="" && ssf=="" → 7 root rows. Correct.ifSubfamilyHeader— sf!="" && ssf=="" → 21 subfamily headers. Correct.ifLeafFirst(rows, index)— ssf!="" && ssf !== prev_ssf → 63 leaf first-occurrences. Correct.
Language-invariance — valid. Helpers read structural FR taxonomy keys (always present), not rendered text. No column tokens inside helper calls, so the localizer cannot corrupt them. Shared template propagates to all 8 languages.
colorPalette fix — correct. Old hardcoded indices (0/25/50/75/100/125/150) assumed uniform distribution but 176/7 = 25.14, causing drift that duplicated Influence and skipped Obstruction. New approach emits one swatch per ifFamilyHeader (7 iterations, 7 families). Right fix.
Minor note: ifLeafFirst takes ../rowset @index as positional params — works correctly but worth documenting the arg order dependency in main.js. Not a blocker.
No secrets, no regressions. LGTM.
…-break (#455) #449 ("language-invariant control-break grouping") replaced the old `{{#ifCond Famille "==" text_fr}}` family selector with control-break helpers ({{#ifFamilyHeader}}/{{#ifSubfamilyHeader}}). Six regression tests still asserted the removed `Famille "=="` / `text_fr ` tokens and failed on master (verified: template now has 0 ifCond, 1 control-break). The geometry is correct (8/8 languages PASS visual re-check, RU 7x3x3), so this was stale test debt, not a localization regression. Replace the stale grouping-selector assertions in both Memo_Back theory tests with assertions that the language-invariant control-break helpers survive translation — same concern (grouping integrity post-translation), new mechanism. Display-token, FR-token-absence, Famille_camelCase and subtitle assertions are unchanged. Updated the historical Bug 2 comment and the test docstring to reflect the #449 supersession. .Tests suite: 155/155 pass (was 6 failing). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…cascade Without these computed properties, ~93% of AR/FA/ZH mindmap nodes would have empty links (CSV link_ar/fa/zh coverage is 6-7%). The fallback cascade matches the existing pattern: own lang → EN → FR. Also restores FallaciesLocalizationTests.cs to master (control-break helpers from #449), reversing an erroneous test regression in PR #454. Co-Authored-By: Claude <noreply@anthropic.com>
…454) * feat(i18n): add AR/FA/ZH language support for MindMap generation (#134 8-lang scope) - Add AR/FA/ZH properties + CsvHelper mappings to Fallacy.cs entity (FamilyAr/Fa/Zh, SubfamilyAr/Fa/Zh, TextAr/Fa/Zh, DescAr/Fa/Zh, ExampleAr/Fa/Zh, LinkAr/Fa/Zh) - Extend MindMapLocalization StaticConversions in AssetConverterConfig.cs to cover AR/FA/ZH for text, desc, example, link, and family hierarchy - Add ES/AR/FA/ZH to FallacyMindMapCreatorConfig Translations list - Add ES/AR/FA/ZH to VirtueMindMapCreatorConfig Translations list - Update TaxonomyValidationTests _supportedLanguages from 4 to 8 CSV data for AR/FA/ZH has been 100% complete since PRs #432/#434/#443. CardSets (PDFs) already support 8 languages via FrontFieldConversions. This change extends MindMap SVG generation to the same 8-language scope. Build: 0 errors, 15 warnings (pre-existing) Tests: 149 pass, 6 fail (pre-existing, unrelated), 5 skip Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix(i18n): add Link{Es,Ar,Fa,Zh}Fallback properties for MindMap link cascade Without these computed properties, ~93% of AR/FA/ZH mindmap nodes would have empty links (CSV link_ar/fa/zh coverage is 6-7%). The fallback cascade matches the existing pattern: own lang → EN → FR. Also restores FallaciesLocalizationTests.cs to master (control-break helpers from #449), reversing an erroneous test regression in PR #454. Co-Authored-By: Claude <noreply@anthropic.com> --------- Co-authored-by: Your <your.email@example.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Problème
La carte Mémo Back ne respectait plus la grille spécifiée 7 rangées (familles) × 3 colonnes (sous-familles) × 3 lignes (sous-sous-familles) — « ça saute aux yeux » (jsboige, #443). La grille s'effondrait (Tricherie : 0 sous-famille ; Erreur math/raisonnement : 1).
Cause racine
Le template groupait la grille par marqueurs de coïncidence de nom (
{{#ifCond Famille "==" text_fr}}…), qui ne se déclenchaient que sur les lignes donttext_frcoïncidait par hasard avec leur propre label de niveau. Les campagnes de renommage FR #351 (×27) et #308 (×13) ont changétext_fr→ les coïncidences ont disparu → les familles ont collapse.La donnée taxonomique est correcte (7×3×3 parfait dans le sous-ensemble injecté
carte∈{1,2}, 176 lignes) ; seul le regroupement du template était cassé. Lane ai-01 = template, pas CSV.Correctif
Generation/CardPen/js/main.js— 3 helpers Handlebars « control-break » qui lisent les colonnes taxonomiques invariantes par langue (Sous-Famille/Soussousfamille, présentes dans chaque ligne quelle que soit la langue de rendu). Ils ne portent aucun token de colonne, donc le localiseur (CardSetLocalization.FormatFieldajoute}}) ne peut pas corrompre l'appel :ifFamilyHeader=Sous-Famille=='' && Soussousfamille==''ifSubfamilyHeader=Sous-Famille!='' && Soussousfamille==''ifLeafFirst=Soussousfamille!=''sur première occurrence (rupture de contrôle)Cards/Memo/Argumentum_Memo_Back_fr.json— bascule les 3 conditions de coïncidence vers les nouveaux helpers (les tokens d'affichage{{Famille}}/{{Sous-Famille}}/{{Soussousfamille}}restent → localisation préservée) ; corrige la colorPalette (itère le rowset, 1 swatch par famille-racine — auparavant indices fixes 0/25/…/150 qui dupliquaient Influence et omettaient Obstruction).Template unique partagé → le correctif se propage aux 8 langues.
Validation (axe GÉOMÉTRIE, pas seulement texte)
Sur la donnée réellement injectée (taxonomy WHERE
carte∈{1,2}, 176 lignes) :Notes de déploiement
static.ymlredéploie CardPen au merge → helpersmain.jsdisponibles automatiquement ; template tiré depuis raw-master.argumentum.myia.io) : nécessite un redéploiement de CardPen sur l'IIS pour quemain.jsà jour soit servi lors d'un harvest Debug (handoff po-2023).Refs #443