cadrumo.application.modelo.calculation_route module

Canonical staged resolver ownership for the production modelo calculation route.

class CalculationRouteResolverOwnership(stage, resolver_type, resolver_id, owned_sources)[source]

Bases: object

One class-owned resolver identity at its production route stage.

Parameters:
stage: TypeAliasType
resolver_type: type[ModeloSourceResolver]
resolver_id: str
owned_sources: tuple[BindingSourceKind, ...]
class CalculationRouteManualOwnership(stage, resolver_type, resolver_id, owned_sources)[source]

Bases: object

The sole manual-input pseudo-owner on the production route.

Parameters:
stage: Literal['manual']
resolver_type: Literal[None]
resolver_id: Literal['manual_input']
owned_sources: tuple[Literal[<BindingSourceKind.MANUAL_INPUT: 'manual_input'>]]
class CalculationRouteDesignConstantOwnership(stage, resolver_type, resolver_id, owned_sources)[source]

Bases: object

The sole design-constant pseudo-owner on the production route.

A SIBLING of the manual-input pseudo-owner rather than a widening of it, and the distinction is the point: manual input arrives from the operator, while a design constant is already carried on its own binding selector because AEAT’s diseño fixes it. Folding the second into the first would have meant relaxing that row’s Literal pins until they admitted a second member – exactly the widen-the-matcher move the governing decision refuses. Declaring a new owner keeps every existing pin intact and makes the new route enumerable.

Neither pseudo-owner names a resolver class: there is no aggregation to run, so there is nothing for a ModeloSourceResolver to do. Enrolment here is what keeps the kind out of the novel-source refusal, which exists so a source nobody routed cannot resolve to a silent blank.

Parameters:
stage: Literal['manual']
resolver_type: Literal[None]
resolver_id: Literal['design_constant']
owned_sources: tuple[Literal[<BindingSourceKind.DESIGN_CONSTANT: 'design_constant'>]]
validate_calculation_route_resolver_ownership(ownership)[source]

Refuse identity, stage, pseudo-owner, and source-disposition drift.

Return type:

None

Parameters:

ownership (tuple[CalculationRouteOwnership, ...])

MESH_ONLY_SOURCES: frozenset[BindingSourceKind]

The two routed sources no registry row may declare.

They own a resolver but are absent from the binding provider union on purpose: an AEAT borrador value and a wallet decision arrive at runtime, so “not a registry binding source” is a type error rather than a hand-written refusal. They are therefore the only sources the route may own without a registration.

validate_calculation_route_against_binding_registrations(ownership)[source]

Refuse any disagreement between the route table and the registration table.

The binding registrations are the enrollment authority and carry each kind’s resolver id and stage; the route table is where those resolvers actually live. Only this module sees both, because the domain registration table must not import application code, so the join is asserted here at import time and a drift in either direction – a registration naming a route that does not exist, a deferred kind that turns out to be routed, or a routed source with no registration at all – refuses before anything resolves.

Returns the enrolled source set, so the published constant cannot be built from an unverified table.

Return type:

frozenset[BindingSourceKind]

Parameters:

ownership (tuple[CalculationRouteOwnership, ...])

require_calculation_route_resolver(stage, resolver)[source]

Refuse a runtime resolver absent from its canonical production stage.

Return type:

None

Parameters:
  • stage (CalculationRouteStage)

  • resolver (object)