aeat.application.modelo._verification_predicates module¶
Registry-authored predicate runtime for modelo verification.
The verification action feeds this module predicate rows from the selected
RegistrySnapshot. The runtime evaluates
blocking and advisory DSL expressions against calculated casilla values,
profile state, and typed unresolved calculation outcomes, then returns
operator-facing verification findings.
See also
_verification_actionsVerification workflow that resolves the snapshot and persists reports.
VerificationPredicateDefinitionRegistry-authored predicate records evaluated here.
RegistryCalculationUnresolvedOutcomeTyped unresolved engine outcomes converted into verification findings.
ModeloVerificationFindingFinding records returned to the verification report.
- evaluate_advisory_predicate_fires(expression, casilla_values, text_values=mappingproxy({}), profile=None)¶
Return True when a registered ADVISORY predicate condition fires.
- evaluate_predicate_expression(expression, casilla_values, profile)¶
Return True when the predicate holds, False when it is violated.
Supports the DSL operators registered in
KNOWN_VERIFICATION_PREDICATE_OPERATORS:all_nonzero(["id1", "id2", ...])— all ids must have a non-zero value.any_nonzero(["id1", "id2", ...])— at least one id must have a non-zero value.at_most_one_positive(["id1", "id2", ...])— no more than one named casilla may be strictly positive.cap_le_when_positive(["limited_id", "ceiling_id"])— when the ceiling casilla is strictly positive, the limited casilla MUST NOT exceed it.equals(["lhs_id", "rhs_id"])— binary consistency invariant: predicate holds iff the two named casillas hold the same value (M303 official-box projection consistency: box == its semantic source).implies_nonzero(["antecedent_id", "consequent_id"])— material implication with strictly-positive antecedent: predicate holds iff antecedent <= 0 OR consequent != 0.implies_any_nonzero(["antecedent_id", "c1_id", ...])— N-consequent generalisation: predicate holds iff antecedent <= 0 OR at least one listed consequent != 0 (M303 official-Diseño under-declaration shape).profile_field_required("field_name", "applicability_filter")— profile-state-aware conditional non-zero requirement; sibling ofimplies_nonzeroper the dsl-conditional-predicate ADR.
An expression that does not match any registered pattern is treated as holding (i.e. unknown predicates do not block the operator). The authoring-time validator in
_validate_surfacesis the gate against typos reaching this branch.- Return type:
- Parameters:
expression (str)
profile (TaxpayerProfile)
- evaluate_verification_predicates(predicates, casilla_values, profile, text_values=mappingproxy({}))¶
Evaluate Layer 2 cross-casilla predicates into verification findings.
predicatesareVerificationPredicateDefinitionentries from the selected registry snapshot. The returned records areModeloVerificationFindingvalues.text_valuescarries operator-entered raw strings (e.g.input_values_by_casilla_id), independent of the Decimalcasilla_valuesprojection. It defaults to an empty mapping and is consumed by text-aware ADVISORY operators such ascasilla_equals_implies_nonzero; every other operator ignores it.BLOCKING_RULEpredicates use negative logic: the predicate expression must hold, and a violation emits a BLOCKING finding.ADVISORYpredicates use affirmative logic: when their condition fires, the operator receives a WARNING-severity ADVISORY finding and the verified-complete grant remains possible if no blocking findings exist.profileis aTaxpayerProfilethreaded through to support profile-state-aware predicate operators such asprofile_field_requiredandprofile_flag_enabled. Casilla-only operators ignore the parameter.See also
_evaluate_predicate_expression():Evaluates the blocking-rule predicate DSL.
_evaluate_advisory_predicate_fires():Evaluates the advisory predicate DSL.
_classify_verification_outcome():Converts finding severity into report completeness and grant status.
- Return type:
- Parameters:
predicates (tuple[VerificationPredicateDefinition, ...])
profile (TaxpayerProfile)