Skip to content

fix(pipeline): Pipeline Recovery - October 2025 Corrections - #116

Merged
jsboige merged 75 commits into
masterfrom
fix/recovery-october-2025
Mar 24, 2026
Merged

fix(pipeline): Pipeline Recovery - October 2025 Corrections#116
jsboige merged 75 commits into
masterfrom
fix/recovery-october-2025

Conversation

@jsboige

@jsboige jsboige commented Feb 20, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR consolidates the pipeline recovery work from the fix/recovery-october-2025 branch. It includes fixes for dimension issues, DPI standardization, CSS styling for new game variants, multilingual generation, and back matching fixes.

Recent Changes (Mar 14, 2026)

✅ Multilingual Generation Enabled

  • Set LocalizationConfig.Enabled = true in AssetConverterConfig.cs
  • Generate PDFs for FR, EN, RU, PT (79 PDFs total vs 11 FR-only)
  • All TarotCards generated successfully for all languages

✅ FR Fallacies Backs Fixed

  • Root cause: Harvest file had empty Backs.Images: {}
  • Fix: Regenerate harvest to include card_001 back
  • Result: All 201 TarotCards FR now have correct backs

✅ AlternateFaceAndBack Ordering Validated

  • Confirmed: Cards WITH backs processed first (Back + Face alternating)
  • Cards WITHOUT backs added at end (Face only)

Original Changes (October 2025)

Issue #1: Poker Dimensions (P1) ✅

  • Fixed poker card width from 58mm → 63.5mm (standard poker size)
  • File: WebBasedGeneratorConfig.cs

Issue #2: Rules CSS Styling (P1) ✅

  • Added distinct color themes for 4 new game variants
  • File: Argumentum_Rules_fr.json

Issue #3: Rules DPI (P2) ✅

  • Standardized DPI from 500 → 300 in Rules templates

Test Results

Language TarotCards Size Backs
FR 139MB 201 with back
EN 322MB Correct
RU 129MB Correct
PT 322MB Correct

Test Plan

  • Generate PDFs for all 4 languages
  • Visual validation of PDF content
  • Verify multilingual text is correct
  • Test Print&Play formats

Related Issues


🤖 Generated with Claude Code

jsboige and others added 30 commits August 1, 2025 20:00
Ajoute une section détaillée dans TESTING_ARCHITECTURE.md pour clarifier
des points cruciaux découverts lors de la stabilisation récente.

-   Précise que les tests ImageFileGenerator sont des mocks et ne
    valident pas le pipeline de production visuel.
-   Renforce l'obligation d'utiliser le script run-converter-tests.ps1.
-   Mentionne les efforts de stabilisation pour donner un contexte sur la
    fiabilité actuelle de la suite.

Cette mise à jour est essentielle (SDDD) pour aligner la connaissance
de l'équipe sur l'état réel et les limites de nos tests.
- Implement robust Kestrel server process management with TaskCompletionSource to prevent race conditions.
- Fix multiple TimeoutExceptions in Playwright by rewriting the interaction logic to correctly handle the CardPen iframe.
- The new logic now waits for reliable completion signals (#zipButton) instead of phantom elements (#dpi).
- The pipeline infrastructure is now deterministic. Subsequent failures can be attributed to application logic, not stability issues.
- HarvestManager: preserve template rscount (don't force to 0)
- HarvestManager: add RewriteImagePathsToAbsoluteUrls for GitHub assets
- HarvestManager: calculate expected image count with rscount/rsstyle
- frame.js: restore domtoimage.getFontsBefore() preloading
- frame.js: restore scale (dpi/96) and cachedFonts options
- main.js: remove redundant cardRenderingComplete script

These changes restore the Golden Master (April 2024) behavior for
CardPen image generation with proper font handling and DPI scaling.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
WebBasedGeneratorConfig.cs:
- LocalCardpenUrl: localhost:5258 -> argumentum.myia.io
- FallaciesWeb DPI: 200 -> 400 (high quality)
- Virtues Enabled: false -> true
- FallaciesWeb A0: HeightMM 72 -> 69mm (fit on 1 page)
- Add NbColumns=11 and Padding=2 for A0 layout
- Remove temporary "Restored" configs (now redundant)

CardSetInfo.cs:
- Add logging for JSON path selection (debug vs release)
- Transform relative paths to absolute URLs for local CardPen

PdfManager.cs & CardSetDocumentConfig.cs:
- Minor refactoring and logging improvements

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Rule.cs:
- Restore GetId() to return first 20 alphanumeric chars of Text
- Was returning string.Empty (critical bug causing empty IDs)
- Add PrintAndPlay property mapping for print_and_play column

CsvBase.cs:
- Replace silent MissingFieldFound=null with logging callback
- Now logs missing fields for debugging instead of ignoring

ArgumentVirtue.cs:
- Add Id mapping to ClassMap (was missing, caused Virtues without ID)

These fixes address critical CSV parsing issues identified during
the pipeline recovery investigation.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add CardSetInfoTests.cs with tests for:
- GetJsonFilePath debug vs release mode selection
- GetCardSetDocument local CardPen path transformation
- CSS/mustache path rewriting (../../Cards/ -> /Cards/)
- Null handling for empty JSON paths

These tests validate the CardPen configuration loading logic
critical for proper asset path resolution.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
CLAUDE.md:
- Add comprehensive guide for Claude Code agents
- Document pipeline architecture, build commands, config system
- Add "Leçons Apprises" section with rscount, CSS, domtoimage tips
- Document debugging tips and known fragile areas

CardPen:
- Add symlinks (Fallacies, Memo, Rules, Scenarii) for local IIS
- Add doc/ folder (examples.html, howto.html, index.html)
- Update package.json and launchSettings.json for local dev

Tools:
- Add PdfPreviewExtractor utility
- Add Setup-CardPenHost.ps1 IIS configuration script

Docs:
- Update SDDD grounding document
- Add April 2024 config archaeology report

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove duplicate /Cards/ prefix from GitHub base URL in
RewriteImagePathsToAbsoluteUrls(). The regex already captures
the full path including "Cards/", so the base URL should not
include it.

Before: .../master/Cards/ + Cards/Scenarii/... = .../Cards/Cards/Scenarii/...
After:  .../master/ + Cards/Scenarii/... = .../Cards/Scenarii/... (correct)

This should fix the empty Scenarii harvest issue.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add missing CsvType for Scenarii DataSet in AssetConverterConfig.cs
- Add fallback in HarvestManager for CardSets without CsvType (generates
  synthetic IDs like card_001, card_002, etc.)
- The Scenarii harvest was empty because the code returned early when
  CsvType was null, skipping the image download step

Fixes Scenarii cards not being generated (empty harvest file).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add new debugging tip for "Harvest vide + Dpi=0" symptom
- Document the critical CsvType requirement for DataSets
- Include code example showing correct vs incorrect DataSet config

This helps future sessions quickly diagnose empty harvest files.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Virtues CSS fixes:
- Change flex-flow from 'column wrap' to 'column nowrap' to prevent overflow
- Add -webkit-font-variant-ligatures: no-common-ligatures for text clarity
- Convert relative image path to absolute GitHub URL

Rules naming improvement:
- Add RowIndex property to CsvBase for sequential tracking
- Change Rule.GetId() to return "Rules_01", "Rules_02" format
- Files are now named predictably instead of truncated text

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Revert CSV escaping that broke PapaParse parsing in CardPen.
The previous code converted real newlines in quoted CSV cells to
literal "\n" strings, causing Scenarii cards to render empty.

PapaParse correctly handles newlines within quoted CSV cells -
no transformation needed (verified in April 2024 Golden Master).

Fixes: Scenarii cards rendering with empty content

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Root virtues (depth=0) had white backgrounds because the CSS class
'argumentsVertueux' was missing from the template. Added gray color
scheme (#555555 background) matching the Fallacies family hierarchy.

This ensures all 8 virtue families have proper color coding:
- argumentsVertueux (root): gray
- argumentPertinent: purple
- présentationIntègre: pink
- exactitudeMathématique: teal
- raisonnementValide: green
- langageRigoureux: blue
- honnêtetéIntellectuelle: yellow
- débatRespectueux: red

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Relative paths (../../Cards/...) don't resolve correctly with
local CardPen. Converted to absolute GitHub raw URLs for reliability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
RowsetNb=14 was grouping 14 CSV rows per card, but the Scenarii
template expects 1 row per card (simple variables like {{titre}},
not arrays). Removing RowsetNb lets the template's rscount=1 take
effect, generating one card per scenario.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Pipeline FR is now fully functional:
- All CardSets generating correctly (Fallacies, Virtues, Scenarii, Rules, Memo)
- 11 PDFs generated successfully
- Added RowsetNb vs rscount critical documentation
- Updated Pipeline Recovery Status with final counts

Key fix: Removed RowsetNb=14 for Scenarii (commit 9b19d5e) - template
expects rscount=1 (1 CSV row per card).

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- PrintAndPlayDocument: restore null handling for back cards synchronization
  * Removed filter that caused dimension mismatch between backs and fronts
  * Backs and fronts must have same count for proper recto-verso alignment
  * Regression from commit 6bd802f

- FallaciesWeb A0: increase to 12 columns (was 11)
  * Ensures poster fits on single A0 page instead of 2 pages

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Change default DocumentFormat to AlternateFaceAndBack (was BackFirstOneDocPerBack)
- Increase A0 poster logo/header height from /20 to /10
- Add Translations config for Print&Play documents (EN/RU/PT)
- Add null check in CardSetLocalization for missing CardSetDocuments
- Enable LocalizationConfig by default
- Set SkipConfigFile=true (tuple serialization workaround)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jsboige and others added 25 commits March 19, 2026 03:12
Upgrade AutoMapper from 12.0.1 to 14.0.0 to address CVE GHSA-rvv3-g6hj-g44x.
Build and tests pass (18/21, 1 unrelated SVG snapshot failure).

Issue #120

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SvgPostProcessingTests failed because the snapshot reference file
was never created. Now auto-generates the snapshot if missing.

Result: 19 pass, 0 fail, 2 skipped (integration tests)

Closes #110

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Google Spreadsheet (source of truth) renamed 4 Virtues families:
- argumentsVertueux → argumentValable
- exactitudeMathématique → rigueurMathématique
- langageRigoureux → langageExact
- débatRespectueux → échangeEnrichissant

Added CSS class aliases so both old and new names work.
This fixes 102/223 cards (46%) that had white backgrounds.

3 rows still have empty family_fr_camelcase (needs spreadsheet fix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…export

- Remove duplicate IMindMapItem interface from CsvBase.cs (was conflicting
  with Mindmapper/IMindMapItem.cs, causing InvalidCastException at runtime)
- Add explicit Pk implementation to Fallacy.cs
- Add using Mindmapper to Virtue.cs and ParallelDocumentCreatorConfigBase.cs
- Fix Virtue.PK to have setter (required by interface)
- Replace invalid Freeplane -X ConvertToSvg with Groovy script approach
  (ConvertToSvg is not a valid menu item key in Freeplane 1.13+)
- Auto-generate export_to_svg.groovy in Freeplane scripts directory

Fixes: all 4 failing unit tests now pass (19/19 green)
Refs: #128

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

The Interpolate extension method cached compiled expressions using only
the template string as key, ignoring parameter types. When Fallacy mindmaps
were generated first, the cached expression for {item.Text} was typed to
Fallacy. When Virtues followed, the same cache key was reused, causing
"Object of type 'Virtue' cannot be converted to type 'Fallacy'" crash.

Fix: include parameter type names in the cache key.

Issue #127

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tue types

The Interpolate() extension method cached compiled expressions by
expression string only, ignoring parameter types. When Fallacies were
processed first, the cached delegate for "{item.Text}" expected a
Fallacy parameter. When Virtues reused the same expression, the cached
Fallacy delegate was invoked with a Virtue object, causing a crash.

Fix: include parameter type names in the cache key to differentiate
expressions used with different entity types.

Refs: #127

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This is the canonical interface definition used by FallacyMindMapDocumentConfig
and VirtueMindMapDocumentConfig. The duplicate in CsvBase.cs was removed in
commit 574b5a7.

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

- Add .gitignore patterns for Validation PNGs/PDFs, comparison_output/,
  .playwright-mcp/, and Argumentum_ru_Validation/
- Track useful validation scripts (check_pdf_dimensions.py, extract_pdf_pages.py,
  pdf_to_img.py) and multilingual validation report
- Track merge-rules-cards.py utility

Reduces untracked files from 109 to 0.

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

- Add DocumentLocalization for DocumentName property: replaces `_fr.` suffix
  with `_en.`/`_ru.`/`_pt.` in .mm filenames for non-French languages
- Fix TryAutomateSvgConversion: use GUI mode (not headless -S -N) because
  Freeplane's HeadlessMapViewController cannot render SVG (no graphics context)
- Fix EnsureGroovyExportScript: deploy to %APPDATA%\Freeplane user scripts
  directory instead of Freeplane installation directory
- Add mm2svg.py: Python/Graphviz fallback for .mm→SVG conversion when
  Freeplane GUI is not available (produces hierarchical layout, not radial)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Apply same GUI-mode SVG export fix to VirtueMindMapDocumentConfig.cs
  (was using headless -S -N which cannot render SVG)
- Change FreeplanePath from freeplane.bat to freeplane.exe
  (freeplane.bat calls java which is not in PATH)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Integrate tstephen/mindmap two-step XSLT pipeline (polyfill.xslt + mm2svg.xslt)
as fallback when Freeplane GUI export fails. XSLT files are embedded resources.
Both FallacyMindMapDocumentConfig and VirtueMindMapDocumentConfig now try
Freeplane first, then XSLT, before falling back to manual prompt.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Validates the two-step XSLT pipeline (polyfill + mm2svg) produces valid SVG
with all expected mind map nodes from a .mm input file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
All 4 documented CSV mapping issues verified and confirmed resolved:
- Rule.GetId() now returns sequential IDs via RowIndex
- print_and_play column properly mapped with .Optional()
- ArgumentVirtue uses Pk property mapped to CSV pk column
- MissingFieldFound now logs warnings instead of silent null

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- CreateVirtueMindmap_ShouldCreateNonEmptyFile: validates Virtue .mm generation
- XsltConversion_WithGeneratedMm_ShouldProduceValidSvg: end-to-end test of
  pipeline-generated .mm through XSLT two-step SVG conversion
- Added simple-virtues.csv test asset with 6 nodes (root + 2 families + 3 children)
- Test suite: 22/22 pass, 2 skipped (Freeplane integration)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…sInteractive=false

The test hung because Program.IsInteractive was not set to false, causing
DisplaySvgFileNotFoundMessage to wait for console keypress when SVG file
was not found after .mm generation. Added try/finally with IsInteractive guard.

Test suite: 23/23 pass, 1 skipped (Freeplane only)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Regression tests for the cache key fix (commit 94fee27) that prevented
Fallacy/Virtue type collisions in the expression cache. Tests verify:
- Same expression with different types doesn't collide
- Same expression with same type reuses cache correctly
- Type-specific properties resolve properly
- Multi-parameter expressions work

Test suite: 27/27 pass, 1 skipped

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace Freeplane Groovy SVG export (which never worked headless) with:
- FreeMind GUI automation via C# SendKeys (File > Export > SVG)
- Automatic menu exploration (tries Down×7..10 to find Exporter item)
- XSLT fallback (mm2svg.xslt) when FreeMind GUI unavailable

Changes:
- Add FreeMindPath config (C:\Program Files (x86)\FreeMind\FreeMind.exe)
- Switch TFM to net9.0-windows + UseWindowsForms for SendKeys support
- TryFreeMindSvgExport() in Fallacy/Virtue MindMapDocumentConfig
- Pipeline tested: 9 .mm + 22 .svg + 8 .html generated across 4 languages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rewrite TryFreeMindSvgExport to be deterministic and robust:
- Single keystroke sequence: Alt+F, 8×DOWN, RIGHT, 12×DOWN, 3×ENTER
  (verified manually on FreeMind 1.0.1 FR)
- Clean recovery files (~/.freemind/FM_*.mm, *.lck) before each launch
  to prevent recovery dialog blocking automation
- Poll for window appearance instead of fixed 15s sleep
- Detect export success via file modification timestamp (not size)
- Static mutex (FreeMindLock) prevents concurrent GUI automation
- Sequential document processing (foreach instead of Task.WhenAll)
- Centralize automation in FallacyMindMapDocumentConfig (Virtue delegates)
- Remove XSLT fallback (was overwriting valid FreeMind SVGs)
- Enable Mindmapper in default pipeline Mode

Validated: Fallacies_fr.svg (2610 KB) + Virtues_fr.svg (610 KB) exported
successfully via automated FreeMind GUI.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Path.GetExtension only returns the last extension (.svg), not the
compound extension (.links.svg). Use EndsWith instead to match
SVGMap DocumentName against processed file paths.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The CSV was modified on March 17 (reduced from 24 to 18 records),
breaking the CSS color assignments which are keyed by absolute card
index. Restored from .csv.bak (March 4) which aligns with the
template CSS selectors.

Re-harvest required to regenerate Rules card images.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Reorganize Markdown content across the 24 Rules cards to fix
page break issues while maintaining the CSS color scheme:

- Le dernier beau parleur (10-14): merge Installation into card 11,
  split Déroulé steps across cards 12-13
- Le moulin à baratin (15-19): merge Installation into card 16,
  combine Déroulé + Fin de partie, separate Variantes
- La parlote coinchée (20-24): merge Installation into card 21,
  split the 1691-char card 23 into Enchères/Tours de jeu,
  fix numbering bug (two ### 2. headings)

Source spreadsheet: https://docs.google.com/spreadsheets/d/1jnhlod6PLgvVI-Qgrz3sTYytMgnrMyZrHcc8htPn_DQ
Note: spreadsheet must be updated after visual validation.

Also adds po-2023 work plan for SVG export + Rules re-harvest.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Resolved 27 conflicts by accepting recovery branch version:
- 10 PNG assets (Fallacy-front)
- 2 CSV files (Taxonomy, Virtues)
- 15 code files (C#, JS, config)

Recovery branch contains working pipeline:
- 79 PDFs, 4209 images, 4 languages
- 27/27 tests pass
- FreeMind GUI + XSLT SVG export
@jsboige
jsboige merged commit 5dce5b9 into master Mar 24, 2026
1 check passed
jsboige added a commit that referenced this pull request Mar 26, 2026
PR #116 merge into master then back into branch caused 166 build errors.
Root cause: merge resolved conflicts using master versions of 14 files
that our branch had refactored (ConverterMode [Flags] enum, SVGFreemindMap
properties, Arrowlink class, DatasetUpdater API, Logger file logging, etc.)

Restored all affected files to their correct branch versions (eb57e5b).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jsboige added a commit that referenced this pull request Mar 26, 2026
Merge fix for PR #116 merge regression (166 build errors → 0)
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.

1 participant