cadrumo.application.modelo.edit_services module

Edit admission, schema projection, parsing, and preflight for the Modelo Edit Contract V1.

Behind cadrumo.application.modelo. This module owns the read-only half of the edit contract: it independently re-resolves a target, projects the registry-declared permitted surface, and rechecks a submission before execution. It never writes – persistence and the guarded compare-and-swap commit belong to revision_persistence and _edit_execution.

A ModeloWorkspaceBaselineV1 read-consistency token is never accepted here as mutation authority: every coordinate below is independently re-resolved from the target and the current catalogues, never copied from a Workspace read.

RESPONSIBLE_OWNER

The owner recorded on every refusal and advisory the modelo edit surface raises.

reconfirm_modelo_edit_baseline(baseline, *, work_catalogue, calculation_catalogue)[source]

Recheck every baseline coordinate against the current catalogues.

Returns None when nothing has drifted, or the exact typed compare-and-swap refusal naming every coordinate that disagreed. Shared by preflight (D3) and, once execution lands, the guarded commit point (D6) so both recheck through one comparison.

Return type:

TypeAliasType | None

Parameters:
writable_scalar_entry(baseline, casilla_id)[source]

Return the baseline’s writable-scalar surface entry for casilla_id, or None.

Return type:

ModeloEditWritableScalarSurfaceEntryV1 | None

Parameters:
DETAIL_ROW_NATURAL_KEY_SEPARATOR

The one separator a compound detail-row natural key is joined on.

Declared once because both the key derivation here and the operation wire form that carries the key’s components must agree on it exactly; two literals would be free to drift into addressing different rows.

detail_row_identity_components(row)[source]

Return the row’s declared identity fields, unjoined and in declared order.

The components and the joined key are the SAME facts read from the same declaration, which is why they live together: a caller that needs the parts must never obtain them by splitting the key. Splitting cannot be made correct – a component containing the separator is indistinguishable from a boundary once joined – so the only safe direction is components first, key derived.

Return type:

tuple[str, ...]

Parameters:

row (Modelo184MemberRow | Modelo232VinculadaRow | Modelo349OperadorRow | Modelo349RectificacionRow | Modelo347ContraparteRow | Modelo210AgrupacionRentaRow)

detail_row_natural_key(row)[source]

Return the row’s own already-declared business key, joined for compound keys.

Never a minted or positional identity – see ModeloEditDetailRowAddressV1.

Return type:

str

Parameters:

row (Modelo184MemberRow | Modelo232VinculadaRow | Modelo349OperadorRow | Modelo349RectificacionRow | Modelo347ContraparteRow | Modelo210AgrupacionRentaRow)

validate_scalar_intent(baseline, address, kind)[source]

Return a refusal when kind is not a permitted intent for the addressed casilla, else None.

Return type:

TypeAliasType | None

Parameters: