KamoCRM

PriceAssemblyEngine — the deterministic §8.1 PPE core (Phase 2 Slice 13)

Featurekamo-shared-library
Shipped
27 ஜூன், 2026 அன்று 1:36 PM UTC
Author
Kamo
Commit
a972458

The first pure-logic mlos slice: the capstone that composes the shipped catalog resolvers into the authoritative server-side pricing math (doc 02 §8.1 steps 2-4). Ungated stateless @Component (sibling to AdjustmentConditionEvaluator/ **************** — zero repository, no new entity, no schema change. The future MLOSPricingService wires repos + persistence + events. - mergeEligibility(): the §8.1 step-2/3 three-conjunct filter (cell AND guideline AND AUS gate) → EligibilityVerdict, most-severe-blocking precedence with a single principal MlosAdverseActionReasonCode (cell **************** → guideline → AUS-when-required → ELIGIBLE). - assemblePrice(): final_price = base + Σ ADDITIVE + Π MULTIPLICATIVE(stack_order) + margin, respecting cap_value. Additive summed (→ total_adjustments 9,6), then multiplicative factors scale the running subtotal in ascending stack_order (uid tie-break), then margin added last/outside the Π; single final HALF_UP to (9,4). - price(): orchestrates both; output satisfies the MlosPricedProductResult @PrePersist offerable-consistency invariant by construction. - cap_value = additive-only sign-preserving magnitude clamp (cap=0 ⇒ 0 contribution, intended); a multiplicative cap_value is a loud config defect (fail-closed, never mis-price). AUS PASS/NOT_APPLICABLE non-blocking (price-before-AUS; the §8.2 lock-stage hard-stop is the service's). - New: AusGateOutcome enum + **************** PricedProductComputation records. 33 no-DB JUnit5 tests green. Research Workflow (3-reader + synthesis) + 2-agent adversarial review (verdict FIX_THEN_SHIP, zero must-fix; applied the 5 should-fix hardening items: loud multiplicative-cap guard, reason-code-coverage-gap doc, cap=0 + lowest-ruleCode docs, and 6 coverage tests).

All changes

Like what you see shipping?

All of it arrives in your workspace on its own. Start on the free plan and read this page again in a month.

Start Free ForeverView Pricing