cadrumo.core.secure_object_write module¶
Boundary DTO for one prepared secure-object upsert.
SecureObjectWrite is the persistence-boundary contract between a domain
repository port — which declares to_secure_object_write(...) -> SecureObjectWrite
in modelos — and the storage adapter that persists it. It is a
pure value object depending only on core
(STRICT_FROZEN_CONFIG,
SensitivityClass), so a domain port can name it
in a method signature without importing the cadrumo.adapters layer. The storage
adapter (storage) re-exports it unchanged.
See also
SecureObjectWritePublic core facade export for this DTO.
SensitivityClassClassification carried by every prepared secure-object write.
CalculationRevisionCatalogueRepositoryProtocolDomain repository port that can prepare a calculation catalogue write without importing adapters.
ModeloRecordCatalogueRepositoryProtocolDomain repository port that can co-write filing records through the same DTO.
SecureObjectRepositoryStorage adapter that consumes these prepared writes.
save_many()Unit-of-work API that persists one or more prepared writes atomically.
- ABSENT_SECURE_OBJECT_REVISION_ID¶
CAS sentinel requiring that the addressed secure-object row is absent.
- class SecureObjectWrite(**data)[source]¶
Bases:
BaseModelOne encrypted secure-object upsert prepared for a unit of work.
written_atmust be a UTC-aware instant. That contract is enforced at the storage write funnel rather than declared here asUtcInstant: this DTO is imported duringcorepackage initialisation, and reachingcore.timefrom here loadscore.configthrough the clock’s logger and closes an import cycle. The funnel is the honest single owner in any case – the constraint is a storage-substrate fact, not a property of the value. The stored row’s revision id hashes the instant, and SQLite dropstzinfoon write, so an offset-bearing value is persisted as its local wall clock while its revision was derived from the UTC instant: the row commits and then fails its own read-time self-consistency gate permanently.See also
save()Direct write boundary carrying the same UTC-aware contract.
- Parameters:
data (Any)
- namespace: str¶
- object_key: str¶
- classification: SensitivityClass¶
- schema_version: int¶
- written_at: datetime¶
- payload: bytes¶
- write_provenance: str¶
- source_event_id: str | None¶
- expected_revision_id: Hex64Str | None¶