cadrumo.adapters.outbound.storage.records module

Pydantic records and enums for the outbound storage abstraction.

Provider records anchor the storage boundary:

class ProviderKind(*values)[source]

Bases: StrEnum

Closed storage backend selector for adapters.outbound.storage.factory.get_storage_provider().

LOCAL_FILESYSTEM
GOOGLE_DRIVE
class RemoteMirrorIssueKind(*values)[source]

Bases: StrEnum

Remote ciphertext mirror degradation classes carried by RemoteMirrorIssue.

PARTIAL_UPLOAD
PARTIAL_DOWNLOAD
STALE_MIRROR
REVISION_CONFLICT
class ProviderObjectMetadata(**data)[source]

Bases: BaseModel

Per-object metadata returned by storage-provider operations.

Returned by adapters.outbound.storage.protocol.StorageProvider methods: adapters.outbound.storage.protocol.StorageProvider.put(), adapters.outbound.storage.protocol.StorageProvider.get(), and adapters.outbound.storage.protocol.StorageProvider.iter_objects(). provider_object_id is the backend-native identifier (a filesystem path for the local provider, a Drive fileId for the Google Drive provider). The coordinator threads it through subsequent get/delete/patch calls without re-resolving by name.

Parameters:

data (Any)

namespace: str
object_key_hmac: str
provider_object_id: str
byte_length: NonNegativeInt
content_hash: str
written_at: datetime
class ProviderProbeReport(**data)[source]

Bases: BaseModel

Health-check result returned by storage-provider probes.

Returned by adapters.outbound.storage.protocol.StorageProvider.probe(). reachable is True iff the backend endpoint responds at all. writable is True iff a sentinel payload write/delete succeeded; inherently False when the probe runs in read-only mode. root_folder_present is non-None only when the backend supports the notion of an operator-configured root folder (currently Google Drive).

Parameters:

data (Any)

provider_kind: ProviderKind
reachable: bool
writable: bool
read_only: bool
root_folder_present: bool | None
detail: str
class RemoteMirrorObjectManifest(**data)[source]

Bases: BaseModel

One ciphertext object entry recorded in a RemoteMirrorNamespaceManifest.

Parameters:

data (Any)

namespace: str
object_key_hmac: _ObjectKeyHmac
classification: str
schema_version: int
byte_length: NonNegativeInt
ciphertext_hash: _CiphertextHash
storage_revision_id: _StorageRevisionId | None
previous_storage_revision_id: _StorageRevisionId | None
revision_ancestor_ids: tuple[_StorageRevisionId, ...]
row_written_at: datetime
revision_written_at: datetime | None
class RemoteMirrorNamespaceManifest(**data)[source]

Bases: BaseModel

Manifest persisted beside remote ciphertext objects for one namespace.

Built by adapters.outbound.storage.mirror_manifest.build_remote_mirror_namespace_manifest() and persisted by adapters.outbound.storage.mirror_manifest.put_remote_mirror_namespace_manifest().

Parameters:

data (Any)

manifest_schema_version: int
namespace: str
object_count: NonNegativeInt
latest_revision_id: _StorageRevisionId | None
latest_revision_written_at: datetime | None
objects: tuple[RemoteMirrorObjectManifest, ...]
class RemoteMirrorIssue(**data)[source]

Bases: BaseModel

One detected remote mirror degradation in a RemoteMirrorInspection.

Parameters:

data (Any)

kind: RemoteMirrorIssueKind
namespace: str
object_key_hmac: _ObjectKeyHmac | None
detail: str
class RemoteMirrorInspection(**data)[source]

Bases: BaseModel

Typed result returned by remote mirror comparison and inspection helpers.

Parameters:

data (Any)

namespace: str
issues: tuple[RemoteMirrorIssue, ...]
property ok: bool

Return whether the inspection recorded no issues.