cadrumo.application.live.borrador_100 module¶
Application-owned Modelo 100 borrador snapshot lifecycle.
Borrador100 is the proof-of-concept consumer of the shared snapshot lifecycle
abstraction. The application owns the payload, identity, state machine, and
repository capability; executable composition supplies the encrypted persistence
implementation through Borrador100SnapshotRepository.
- exception BorradorSnapshotNotFoundError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
SnapshotNotFoundErrorRaised when a Modelo 100 borrador snapshot lookup misses by id.
SnapshotNotFoundErrorinheritsCadrumoErrorfirst, so MRO routes__init__through the structured constructor (acceptscontext=/translated_message=kwargs) rather thanKeyError’s C-level constructor. ListingCadrumoErrorexplicitly here would violate C3 linearization.- Parameters:
- Return type:
None
- code¶
- class Borrador100Snapshot(**data)[source]¶
Bases:
BaseModelCaptured Modelo 100 borrador values available to application consumers.
- Parameters:
data (Any)
- snapshot_id: SnapshotId¶
- bucket_id: BucketId¶
- modelo: str¶
- filing_year: FilingYear¶
- period: Period¶
- registry_snapshot_ref: RegistrySnapshotRef¶
- captured_at: datetime¶
- source_url: BorradorSourceUrl¶
- state: SnapshotLifecycleState¶
- binding_values: Mapping[BindingId, _BorradorValue]¶
- superseded_by_snapshot_id: SnapshotId | None¶
- discarded_at: datetime | None¶
- discarded_by: str¶
- discard_reason: str¶
- require_borrador_100_snapshot_coordinates_current(snapshot, *, operation)[source]¶
Return a persisted borrador only when its producing coordinate re-confirms.
- Return type:
- Parameters:
snapshot (Borrador100Snapshot)
operation (PinnedAuthorityOperation)
- borrador_100_snapshot_object_key(bucket_id, snapshot_id)[source]¶
Return the secure-object key for one bucket’s Modelo 100 borrador snapshot.
- derive_borrador_100_snapshot_id(*, filing_year, period, registry_snapshot_ref, captured_at, source_url, binding_values)[source]¶
Return the content-addressed id for one Modelo 100 borrador capture.
The canonical-JSON shape is preserved exactly so existing on-disk snapshot ids remain valid: the core canonical JSON hash does not change the hashed bytes.
- class Borrador100SnapshotRepository(*args, **kwargs)[source]¶
Bases:
SnapshotRepository[Borrador100Snapshot],ProtocolApplication persistence capability for bucket-scoped borrador snapshots.
Encrypted secure-object storage, namespaces, object keys, and persistence errors belong to the outer adapter. Implementations satisfy this structural contract without inheriting application code.
- class Borrador100SnapshotRepositoryFactory(*args, **kwargs)[source]¶
Bases:
ProtocolConstruct the required borrador repository for one profile bucket.
- class Borrador100SnapshotService(*, bucket_id, repository)[source]¶
Bases:
SnapshotService[Borrador100Snapshot,_Borrador100CaptureRequest]Canonical backend service for bucket-scoped Modelo 100 borrador snapshots.
- Parameters:
bucket_id (str)
repository (Borrador100SnapshotRepository)
- capture(*, filing_year, period, captured_at, source_url, binding_values)[source]¶
Execute this public contract operation.
- list_snapshots(*, filing_year=None, state=SnapshotLifecycleState.ACTIVE)[source]¶
Execute this public contract operation.
- Return type:
- Parameters:
filing_year (int | None)
state (SnapshotLifecycleState | None)
- show(snapshot_id, *, operation)[source]¶
Execute this public contract operation.
- Return type:
- Parameters:
snapshot_id (str)
operation (PinnedAuthorityOperation)
- latest_for_year(*, filing_year, operation, period=None)[source]¶
Execute this public contract operation.
- Return type:
- Parameters:
filing_year (int)
operation (PinnedAuthorityOperation)
period (Period | None)