test(mindmap): #204 MindMap localization ordering contract + 8-lang gap - #491
Merged
Merged
Conversation
Pin the two fragile zones of the DocumentLocalization mechanism that existing coverage (MmGeneratorTests) missed: 1. Ordering contract (headline). The family-hierarchy DocumentLocalization in AssetConverterConfig carries the documented comment "Order: most specific first (Soussousfamille > SousFamille > Famille) to avoid partial matches" because DoStaticConversions is a naive substring Replace and "Famille" is a substring of "SousFamille". No test pinned this contract. New theory runs the REAL family-hierarchy entry (located by TargetProperties, not list index) on a template carrying all three family keywords, for all 7 target langs, asserting each resolves to its distinct localized property with no "SousFamily" contamination — the corruption signature of a broken ordering. Same substring fragility class as the card-set mapping (#477) and CSV contract (#488). 2. 8-language release scope. The existing MindMapLocalization theory covers only en/ru/pt; the release targets 8 langs and the config declares 7 target langs (en/ru/pt/es/ar/fa/zh). New theory closes the gap for es/ar/fa/zh across every Fallacy text + family expression, so a dropped conversion surfaces immediately. Additive only: 1 new file (MindMapLocalizationRegressionTests.cs), 11 tests, zero production code and zero existing test modified. Verified: 11/11 new tests green; full suite 270 passed / 0 failed / 5 skipped. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
What
Secondaire #204 — MindMap localization fragile zones. Pins the two genuine gaps in the
DocumentLocalizationlocalization mechanism that the existingMmGeneratorTestscoverage misses. Additive only (1 new file, 0 prod code, 0 existing test touched).Why these two zones
The pipeline localizes each Fallacy mind map expression by running
DocumentLocalization.DoReflectionTranslateover theLocalizationConfig.MindMapLocalizationentries, which callsDoStaticConversions— a naivetemplate.Replace(sourceText, destText)per language, with no token-boundary awareness. That is the same substring-replacement fragility class already pinned for card-set mapping (#477) and the CSV contract (#488), but never pinned for MindMap localization.The existing theory
MindMapLocalization_ShouldTranslateAllFallacyExpressionsonly exercises the happy path for en/ru/pt, where each default expression carries exactly one family keyword — so it never hits the partial-match interaction the config itself warns about.1. The ordering contract (headline)
AssetConverterConfig.csfamily-hierarchyDocumentLocalizationcarries this comment:That comment exists because
Familleis a substring ofSousFamille: if the less-specific conversion ran first, a template mentioningSousFamillewould be corrupted intoSousFamilybefore theSousFamilleconversion could fire. No test pinned this contract.FamilyHierarchy_LocalizationOrderingPreventsPartialMatchContamination(Theory, 7 langs) runs the real family-hierarchy entry — located byTargetProperties.Contains(FamilleExpression), not by a fragile list index — on a crafted template carrying all three keywords at once:{item.Soussousfamille} / {item.SousFamille} / {item.Famille}and asserts each resolves to its distinct localized property, plus
.NotContain("SousFamily")— the direct corruption signature of a broken ordering.2. The 8-language release scope
The existing theory covers only en/ru/pt. The release targets 8 languages and the config declares 7 target langs (en/ru/pt/es/ar/fa/zh).
FallacyExpressions_LocalizeForGapLanguages_es_ar_fa_zh(Theory, 4 langs) closes the gap — applying all real localizations to a freshFallacyMindMapDocumentConfigand asserting every text + family expression resolves for es/ar/fa/zh. A dropped conversion (someone trims the config back to en/ru/pt) surfaces here.What I deliberately did NOT do
Vertus→Virtues, but theVirtueMindMapDocumentConfig.TitleExpressiondefault is{item.Text}— it does not containVertus, so the conversion is a no-op on the default. A test would have to setTitleExpression = "Vertus"synthetically, which characterizes a config/data inconsistency rather than a real fragile path. Dropped to keep the suite honest. (Side note: the Virtue entry also only declares 4 langs en/ru/pt/es vs the 7 elsewhere — a real data gap, but out of scope for a test-only PR; flagging here for a future data PR.)Verification
Constraints held
0 merges / 0 regen / 0 API runs. Additive only. Release gate intact. Worker po-2024 — signaling, not declaring PASS.
🤖 Worker po-2024