Skip to content

feat: pre-5.0 converter hardening — cross-source universal parity in Python#46

Merged
coryhubbell merged 1 commit into
mainfrom
feat/5x-converter-hardening
Jul 4, 2026
Merged

feat: pre-5.0 converter hardening — cross-source universal parity in Python#46
coryhubbell merged 1 commit into
mainfrom
feat/5x-converter-hardening

Conversation

@coryhubbell

Copy link
Copy Markdown
Owner

Summary

Pre-5.0 tranche: every Python converter now consumes a universal document from any source parser without losing content — bringing the Python engine to parity with the PHP engine's 182-pair coverage before the 5.0.0 breaking release.

The gate

New cross-source fidelity matrix (tests/python/test_universal_matrix.py): 3 real fixtures (Elementor kitchen-sink, DIVI kitchen-sink, real Breakdance export) × 14 target converters, measure_fidelity floor 0.9 per pair. Baseline: 34 of 39 pairs failed. Now: all 39 pass, almost all at 100%.

Changes

  • Bidirectional interchange: translation_bridge.interchange gains element_to_component / document_to_components — the Python mirror of DEVTB_Universal's reverse direction. Both engines' vocabularies now mirror in both directions.
  • All 14 converters hardened (structural recursion for nested section > container > column shapes, canonical widget vocabulary, content-preserving fallbacks — no empty elements for unmapped widgets). kadence/thrive route universal input through the reverse interchange into their existing component pipelines.
  • Fidelity metric fixes: style-value keys (title_color, …) no longer count as content; JSON-shaped outputs compare via decoded string scalars so escaping/multi-line strings never read as loss.
  • API change: Elementor4Converter.convert() returns the structured atomic node list instead of a pre-encoded JSON string (the CLI serializes on write as before).
  • Galleries preserve image URLs/alts over site-local media-library ids.

Built with 5 parallel subagents on disjoint converter files, each independently verified against the matrix; final verification run end-to-end on the merged tree.

Test evidence

Python 306 passed (+44) · PHPUnit 344/5,691 · matrix 39/39 · 3 e2e smokes × 2 engines — all green.

🤖 Generated with Claude Code

…Python

Every Python converter now consumes a universal document from ANY source
parser without losing content, gated by a new cross-source fidelity
matrix (3 real fixtures × 14 targets): 34 of 39 pairs failed at baseline,
all 39 now pass, almost all at 100% content survival.

- tests/python/test_universal_matrix.py: the Python analog of the PHP
  182-pair matrix (measure_fidelity floor 0.9 per pair)
- interchange.py now bidirectional: element_to_component /
  document_to_components mirror DEVTB_Universal (reverse direction)
- Structural recursion in all converters: nested section>container>column
  shapes convert correctly; bare widgets get valid column wrappers
- Canonical widget vocabulary across all 14 converters with
  content-preserving fallbacks (no empty elements for unmapped widgets)
- kadence/thrive route universal input through the reverse interchange
  into their component pipelines (+ content-rescue graft)
- Elementor4Converter.convert() returns structured nodes, not a JSON
  string; galleries preserve URLs over site-local media ids
- Fidelity metric: style keys excluded from content; JSON outputs compare
  via decoded string scalars

Suites: Python 306 · PHP 344/5,691 · matrix 39/39 · 3 e2e smokes × 2
engines — all green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coryhubbell coryhubbell merged commit 0f44e59 into main Jul 4, 2026
10 checks passed
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