Skip to content

test(mindmap): #725 Virtues HTML wrapper i18n regression guard + stale-file diagnosis - #738

Merged
jsboige merged 1 commit into
masterfrom
test/725-virtues-wrapper-localization
Jul 7, 2026
Merged

test(mindmap): #725 Virtues HTML wrapper i18n regression guard + stale-file diagnosis#738
jsboige merged 1 commit into
masterfrom
test/725-virtues-wrapper-localization

Conversation

@jsboige

@jsboige jsboige commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

What

Closes #725 (investigation). Adds a CI regression guard proving the Virtues mind-map HTML wrapper assembly inlines the localized content.svg per language, and documents that the committed FR wrappers are a stale-file artifact, not a code bug.

Diagnosis — #725 is stale, not a code defect

Argumentation_Virtues_{lang}.html ships FR in every language, but the assembly code is correct. Four independent sources converge:

  1. Code readVirtueMindMapDocumentConfig.GenerateHtmlSvgWrappers (:869-901) inlines svgContent() = the svgLoader resolved in ProcessSvgFilesAsync (:531-605) after UpdateSvgWithItems rewrites node text from the localized mindMapItems. It never inlines the raw FreeMind render. fix(mindmaps): Argumentation_Virtues_{lang}.html wrappers inline the FR mind-map SVG in every language #725's hypothesis ("inlines the raw FR .svg") is wrong on the mechanism.
  2. Git history — the committed wrappers date 2026-05-24 (df3c769e, fix(mindmaps): add mouse wheel zoom + pinch gesture support for interactive HTML wrappers #312), before the Virtues i18n wiring (27442add, fix(mindmap): #636 §2 — wire Virtues mindmap i18n for En/Ru/Pt/Es (defer Ar/Fa/Zh) #665). They were generated FR because the content.svg was FR-frozen then; the content.svg was regenerated localized on 2026-07-06 (204adc47, feat(mindmap): Virtues 8-lang parity — #665 code wiring + fr/en/ru/pt/es Batik SVGs (#636) #686) but the wrappers were never regenerated.
  3. Empiricalcontent.svg is now localized for all 8 langs (Cyrillic 40066 ru / CJK 10189 zh / Arabic 23980 ar / 25576 fa / Intellectual honesty ×28 en; "Honnêteté intellectuelle" ×27 fr, ×0 elsewhere). The committed en/ru wrappers are 100% FR (ru has 0 Cyrillic) — impossible to produce from the current Cyrillic content.svg, confirming they predate it.
  4. Comparative — Fallacies uses the identical GenerateHtmlSvgWrappers path and its committed wrapper IS localized (Fallacies_en.html: 188 EN hits, text nodes Ad hominem / Name Calling …). Same code ⇒ correct.

Operational root cause: OverwriteExistingHtmlMaps defaults to false (AssetConverterConfig.cs:380) while OverwriteExistingDocs = true (:361) — so SVG regens clobber content.svg/links.svg but silently skip existing .html wrappers (VirtueMindMapDocumentConfig.cs:886).

Fix path (post-tag, po-2023 lane — gated, not this PR)

Regen the Virtues mind maps with OverwriteExistingHtmlMaps=true so the wrappers are rebuilt from the now-localized content.svg, then commit Argumentation_Virtues_{lang}.html / _ext.html (incl. new zh/ar/fa). Clobber the SVG cache first (lesson regen-success-without-clobber-is-stale-trap).

This PR (gated, regen-free)

  • CI regression test VirtuesMindmapWrapperLocalizationTests (headless, no Playwright) — mirrors VisualTests/MindmapWrapperTests (Fallacies) but runs in the unit-test CI suite. [Theory] over fr/en/ru/zh/ar/fa feeds the committed localized content.svg through MindMapHtmlWrapper.FormatWrapper and asserts the wrapper matches the target language (native script / EN label present, "Honnêteté intellectuelle" FR-frozen marker absent for non-FR). Pins the assembly contract; a future regression in the helper or the i18n wiring surfaces without RDP/FreeMind.
  • Investigation doc docs/investigations/2026-07-07-issue-725-virtues-wrapper-stale-not-code-bug.md — full 4-source proof + post-tag action.

Discipline

Co-Authored-By: Claude-Code noreply@anthropic.com

…e-file diagnosis

Issue #725 reported Argumentation_Virtues_{lang}.html wrappers inlining the FR
mind-map SVG in every language. Investigation on master 6ce91ef proves this is
a STALE-FILE artifact, not a code bug:

- GenerateHtmlSvgWrappers inlines the post-localization content.svg (the
  svgLoader produced after UpdateSvgWithItems), never the raw FreeMind render.
  #725's "inlines the raw FR svg" hypothesis is wrong on the mechanism.
- The committed wrappers date 2026-05-24 (df3c769, #312), BEFORE the Virtues
  i18n wiring (27442ad, #665). They were generated FR because content.svg was
  FR-frozen at the time; they were never regenerated since.
- content.svg is now localized for all 8 langs (204adc4, #686 post #665/#715/
  #724): Cyrillic=40066 (ru), CJK=10189 (zh), Arabic=23980 (ar), =25576 (fa),
  "Intellectual honesty" x28 (en). The wrapper just wasn't regenerated with it.
- Fallacies uses the identical assembly path and its wrapper IS localized
  (EN-hits=188) -> the assembly code is correct.
- Operational root cause: OverwriteExistingHtmlMaps defaults to false while
  OverwriteExistingDocs=true, so SVG regens clobber content.svg but skip the
  existing .html wrappers.

Fix = post-tag wrapper regen with OverwriteExistingHtmlMaps=true (po-2023 lane,
RDP/FreeMind-gated). This tick's gated, regen-free deliverable:

- CI regression test VirtuesMindmapWrapperLocalizationTests (headless, no
  Playwright) mirroring VisualTests/MindmapWrapperTests for Fallacies. Theory
  over fr/en/ru/zh/ar/fa asserts the wrapper assembled from the committed
  localized content.svg matches the target language (native script / EN label
  present, "Honnêteté intellectuelle" FR-frozen marker absent for non-FR).
- Investigation doc documenting the 4-source proof + post-tag action.

0 write Cards/, 0 regen, 0 CSV/DB/OWL. Empirical dotnet test: 594/1/5 (+7 vs
587/1/5 baseline, 0 regression; the 1 fail is the permanent OWL #133 known-fail).

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

@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.

[NanoClaw] — test(mindmap) #725 Virtues HTML wrapper i18n regression guard + stale-file diagnosis (+261/-0, 2f test+doc, head 8d439b8b1a)

LGTM deep — diagnosis byte-vérifiée firsthand (4 sources convergentes), regression guard sound.

Verification code=truth (firsthand au head 8d439b8b1a) :

  • Code mechanism VirtueMindMapDocumentConfig.cs : L869 GenerateHtmlSvgWrappers, param L871 svgContent (le loader résolu), L886 if (File.Exists(htmlFileName) && !config.OverwriteExistingHtmlMaps) = skip guard, L895 MindMapHtmlWrapper.FormatWrapper(htmlTemplate, svgRelativePath, await svgContent())inline le svgContent résolu (post-localization), PAS le raw FreeMind ✓ (réfute l'hypothèse #725 sur le mécanisme)
  • Operational root cause AssetConverterConfig.cs : L361 OverwriteExistingDocs = true vs L380 OverwriteExistingHtmlMaps (no default ⇒ false) — les regens SVG clobber content.svg mais skip les .html wrappers existants ✓
  • Empirical stale-wrapper confirmé :
    • EN content.svg (418KB) = 28 "Intellectual honesty" (EN localisé présent) + 27 "Honnêteté"
    • EN wrapper (458KB) = 55 "Honnêteté" + 0 "Intellectual honesty" → wrapper 100% FR-frozen, pré-#665
    • Le wrapper ne peut PAS être produit depuis le content.svg EN actuel → stale artifact confirmé
  • Comparative Fallacies : même path GenerateHtmlSvgWrappers, Fallacies_en.html contient "Ad hominem" (localisé) ✓ — même code, comportement correct ⇒ le code est bon, seuls les wrappers Virtues sont stale

Test file (161L, 8 [Fact]/[Theory]/[InlineData]) :

  • [Theory] sur 6 langs (fr/en/ru/zh/ar/fa) L73-78 ✓
  • Feed le content.svg localisé through MindMapHtmlWrapper.FormatWrapper, assert wrapper = target lang (native script / EN label present, FR-frozen marker absent pour non-FR) ✓
  • Headless (pas de Playwright/FreeMind) → tourne en CI unit-test, pinne le contrat d'assemblage
  • Mirror de VisualTests/MindmapWrapperTests (Fallacies) — pattern établi

Discipline :

  • 0 write sous Cards/, 0 regen, 0 CSV/DB/OWL — tests/docs only ✓
  • dotnet test 594 pass / 1 fail (#133 OWL known-permanent) / 5 skip — +7 vs baseline, 0 régression
  • Investigation doc 2026-07-07-issue-725-...md (100L) documente les 4 sources + action post-tag (regen avec OverwriteExistingHtmlMaps=true, po-203 lane, gated)

△ Nit mineur : le body claim « ru wrapper has 0 Cyrillic » est légèrement imprécis (le wrapper ru a ~1647 chars cyrilliques + 55 « Honnêteté » = mixed, pas 100% FR), MAIS le cas EN est propre (0 EN, 55 FR) et la diagnosis stale-artifact tient intégralement. Le regression guard teste le contrat futur (FormatWrapper sur svg localisé), pas l'état stale actuel — correct par construction.

— NanoClaw (myia-ai-01) [review 738]

@jsboige
jsboige merged commit 81f708b into master Jul 7, 2026
3 checks passed
@jsboige
jsboige deleted the test/725-virtues-wrapper-localization branch July 7, 2026 05:09
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.

fix(mindmaps): Argumentation_Virtues_{lang}.html wrappers inline the FR mind-map SVG in every language

2 participants