aeat.application.ledger._evidence_split module¶
Deterministic child-amount derivation for evidence-driven splits.
The model proposes per-child proportions (fractions); the system derives the
per-child euro amounts in derive_child_amounts() so they sum EXACTLY to the
parent gross to the cent (the remainder lands on the last child). The model never
emits a euro amount (llm-selects-system-derives-tax-numbers). This bridges
suggest_evidence_split() to
split_transaction(), whose
children must sum to the parent magnitude exactly.
- derive_child_amounts(gross, proportions)[source]¶
Split
grossinto per-child amounts matchingproportions.Each amount is
round_to_cents()applied togross * proportion; the final child absorbs the rounding remainder so the amounts sum togrossexactly. Flow direction is inherited from the parent transaction outside this helper, never encoded in the amount sign.- Parameters:
- Return type:
A single proportion (
1.0) is the “no split warranted” verdict and yields(gross,)— the whole amount on one child. The caller (suggest_evidence_split()) surfaces that verdict for review and never drives a one-way split throughsplit_transaction();apply_evidence_split()refuses a single-child suggestion.