Vendune

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

AreaRecorded casesScope
Pricing2,144Gross/net quantity, rounding, tax collections and price metadata
Context and quantity1,446Language fallback, first matching rule priority, tiers and quantity steps
Proportional tax1,002Pre-merged unique-rate collections, including empty and zero-total inputs
Comparison primitives1,976Numeric, string, array and UUID behavior
Original rule conditions432 across 74 classesActual 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.py

Keep a port small and explicit

  1. Select an original source unit and state what behavior must be preserved.
  2. Record inputs and expected returned fields from the original implementation.
  3. Compare the Rust operation, including rounding and error cases.
  4. Exercise the operation through its real commerce consumer.
  5. 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.

Use the feature matrix as the precise boundary. “Tested pricing port” does not mean “drop-in Shopware replacement.”

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.