cadrumo.application.modelo._operator_override_advisory module

Calculate-time advisory when an operator casilla input replaces a computed one.

The bucket aggregation merge lets an operator-supplied casilla value win over a value the source resolvers computed for the same casilla. That precedence is intended: the operator holds facts the engine does not – the provisional prorrata percentage of LIVA art. 105.Uno lives in the profile register, not in the ledger – so the computed figure is a default, not an authority.

What was missing is the disclosure. The override happened in silence, and every casilla it can reach is written into a filed return, so an operator could file a figure differing from the one the engine derived without either value ever being shown beside the other.

The condition is exact rather than heuristic, because both maps are in hand at the merge: signal only where the casilla appears in BOTH and the two values differ. A casilla the engine never computed is not an override, and an operator value equal to the computed one is not a divergence; neither raises anything.

Deliberately direction-agnostic. On a regularizacion neither a higher nor a lower operator figure is presumptively the error, and this codebase’s screens already watch the under-declaration direction far more closely than the over- declaration one – so a screen that fired in only one direction would inherit that blind spot rather than close it.

See also

application.modelo._rate_box_advisory

The sibling advisory this one mirrors in shape and wiring.

collect_operator_override_divergence_diagnostics(revision, *, casilla_inputs, bound_inputs)[source]

Return one advisory per casilla where an operator value replaced a computed one.

Parameters:
  • revision (ModeloRevision) – The ModeloRevision being calculated, read only to name the casilla’s official box number in the message.

  • casilla_inputs (Mapping[TypeAliasType, Decimal]) – The operator-supplied casilla values, as passed to the calculation.

  • bound_inputs (Mapping[TypeAliasType, Decimal]) – The values the source resolvers computed for bound casillas, before the operator merge.

Return type:

tuple[CalculationSourceDiagnostic, ...]

Returns:

Tuple of non-blocking CalculationSourceDiagnostic rows, each naming the casilla and BOTH values, sorted by casilla id. Empty when no operator value diverges from a computed one.