Engineering / Original behavior ports
Port Shopware pricing behavior to Rust with differential tests.
A behavior port needs an original reference, an explicit input scope and a comparison of actual outputs. Matching a few totals is not complete platform compatibility.
Why this project uses an original reference
Vendune is both a native prototype and a migration laboratory. Its differential runners instantiate original Shopware 6.7.14.2 PHP classes and compare selected operations with Rust. A rewritten PHP calculator would merely add another implementation that could share the same mistake.
The recorded comparison scope
| Area | Recorded cases | Scope |
|---|---|---|
| Pricing | 2,144 | Gross/net quantity, rounding, tax collections and price metadata |
| Context and quantity | 1,446 | Language fallback, first matching rule priority, tiers and quantity steps |
| Proportional tax | 1,002 | Pre-merged unique-rate collections, including empty and zero-total inputs |
| Comparison primitives | 1,976 | Numeric, string, array and UUID behavior |
| Original rule conditions | 432 across 74 classes | Actual original PHP scopes; bounded fact/configuration cases |
These 7,000 comparisons are reported in the repository's verification record. They cover bounded operations, not every possible input or the entire Shopware core. Consult current CI for the committed run outcome.
Run the original-source comparisons
In addition to the quickstart prerequisites, use PHP and Composer with the extensions required by reference/composer.json. CI documents a PHP 8.4 setup.
composer install --working-dir=reference --no-interaction
cargo build --locked --bins
python3 scripts/differential.py
python3 scripts/context_differential.py
python3 scripts/delivery_differential.py
python3 scripts/rule_differential.py
python3 scripts/automation_registry.py
python3 scripts/automation_differential.pyKeep a port small and explicit
- Select an original source unit and state what behavior must be preserved.
- Record inputs and expected returned fields from the original implementation.
- Compare the Rust operation, including rounding and error cases.
- Exercise the operation through its real commerce consumer.
- Record remaining differences rather than extending the compatibility claim.
The repository records source units, implementation files and executable checks in porting/units.json. This is a verification workflow, not an automatic translator.
What the comparisons do not establish
Full cart collectors/processors, arbitrary rule evaluation, DAL/CMS, promotions, original API schemas, PHP plugins and commercial B2B modules remain outside the ported slice. Real PSP/carrier integrations and production scale are not demonstrated. Native prototype equivalents are labelled separately from original behavioral ports.
Read the migration workflow and contributor guide before adding another port.
Try native rules and flows
The current catalog reflects 114 production rule classes; 108 have native scope bindings. The connected editor supports true/false branches, consecutive domain/app actions, durable delays and stop nodes. Six source classes and complete original trigger/configuration/FlowSequence parity remain unsupported or incomplete. Try the provider-free playground and inspect the exact contract.