cadrumo.adapters.persistence.storage.runtime module

Storage runtime readiness models.

The runtime is the public diagnostic boundary for profile-bound secure storage. It reports whether the current process is attached to an active profile bucket and has an unlocked bucket session, without exposing key material or constructing repositories. The SecureObjectRepository factories are layered on top of this readiness contract.

class StorageRuntime(**data)[source]

Bases: BaseModel

Current secure-storage runtime state.

This model deliberately carries only redacted diagnostics: route kind, active-session state, and readiness. It does not expose KEK/DEK bytes, profile UUIDs, database URLs, database paths, or storage-root paths.

Parameters:

data (Any)

route_kind: StorageRouteKind
route_attached_to_active_bucket: bool
route_has_database_path: bool
storage_root: Path
bucket_id: BucketId | None
active_session: StorageRuntimeSession | None
readiness: StorageRuntimeReadiness
require_ready()[source]

Raise when this runtime cannot serve profile-bound storage.

Return type:

None

secure_object_repository()[source]

Create a SecureObjectRepository attached to this runtime’s bucket.

Return type:

SecureObjectRepository

inspect_storage_runtime(settings=None, *, now=None)[source]

Return the current profile-bound secure-storage StorageRuntime state.

Return type:

StorageRuntime

Parameters:
inspect_bucket_storage_runtime(bucket_id, settings=None, *, now=None)[source]

Return a StorageRuntime with readiness diagnostics for a named profile bucket.

Explicit database URLs remain fail-closed: when the live settings carry an explicit primary database route, the runtime reports that route as unready instead of synthesizing a clean bucket route.

Return type:

StorageRuntime

Parameters: