feat: pre-5.0 converter hardening — cross-source universal parity in Python#46
Merged
Merged
Conversation
…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>
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.
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_fidelityfloor 0.9 per pair. Baseline: 34 of 39 pairs failed. Now: all 39 pass, almost all at 100%.Changes
translation_bridge.interchangegainselement_to_component/document_to_components— the Python mirror ofDEVTB_Universal's reverse direction. Both engines' vocabularies now mirror in both directions.section > container > columnshapes, 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.title_color, …) no longer count as content; JSON-shaped outputs compare via decoded string scalars so escaping/multi-line strings never read as loss.Elementor4Converter.convert()returns the structured atomic node list instead of a pre-encoded JSON string (the CLI serializes on write as before).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