aeat.adapters.outbound.storage._mirror_manifest module¶
Remote ciphertext mirror manifest construction, persistence, and inspection.
This module converts
adapters.persistence.storage.sql.secure_objects.SecureObjectRawRow
records into RemoteMirrorNamespaceManifest payloads, stores those
payloads through StorageProvider under
REMOTE_MIRROR_MANIFEST_NAMESPACE, and reports mirror drift as
RemoteMirrorInspection records. Google sync uses the inspection
helpers to distinguish partial uploads, partial downloads, stale mirrors, and
revision conflicts without exposing plaintext secure-object payloads.
- build_remote_mirror_namespace_manifest(namespace, rows)[source]¶
Build a
RemoteMirrorNamespaceManifestfor one ciphertext namespace.Only rows whose
adapters.persistence.storage.sql.secure_objects.SecureObjectRawRownamespace matchesnamespaceare included. Each row becomes aRemoteMirrorObjectManifest, and the latest revision watermark is derived from the newestrevision_written_atamong those entries.- Return type:
- Parameters:
namespace (str)
rows (Iterable[SecureObjectRawRow])
- put_remote_mirror_namespace_manifest(provider, manifest)[source]¶
Persist
manifestthroughproviderand return its metadata.The manifest JSON is written as an object in
REMOTE_MIRROR_MANIFEST_NAMESPACEwith acore.hashing.sha256_hex()content hash.- Return type:
- Returns:
The provider’s
ProviderObjectMetadatafor the manifest object.- Parameters:
provider (StorageProvider)
manifest (RemoteMirrorNamespaceManifest)
- get_remote_mirror_namespace_manifest(provider, namespace)[source]¶
Return the stored
RemoteMirrorNamespaceManifestfornamespace.Missing manifest objects return
None. Malformed manifest payloads are translated toOutboundStorageIntegrityErrorso callers can handle them through theadapters.outbound.storage.OutboundStorageErrorhierarchy.- Return type:
- Parameters:
provider (StorageProvider)
namespace (str)
- inspect_remote_mirror_upload(provider, expected_manifest)[source]¶
Detect remote upload drift for the expected namespace manifest.
- Return type:
- Returns:
A
RemoteMirrorInspectiondescribing the drift between the expected manifest and the remote mirror. Issues useRemoteMirrorIssueKindvalues such asPARTIAL_UPLOAD,STALE_MIRROR, andREVISION_CONFLICT.- Parameters:
provider (StorageProvider)
expected_manifest (RemoteMirrorNamespaceManifest)
- inspect_remote_mirror_download(provider, remote_manifest)[source]¶
Inspect whether every object in
remote_manifestis downloadable.Missing objects, unreadable objects, integrity failures, and provider metadata drift are reported as
PARTIAL_DOWNLOADissues on the returnedRemoteMirrorInspection.- Return type:
- Parameters:
provider (StorageProvider)
remote_manifest (RemoteMirrorNamespaceManifest)
- compare_remote_mirror_manifests(*, local, remote)[source]¶
Compare two namespace manifests and return a
RemoteMirrorInspection.The comparison classifies absent entries, stale remote revisions, and divergent revision lineages as
RemoteMirrorIssuerecords.- Return type:
- Parameters:
local (RemoteMirrorNamespaceManifest)
remote (RemoteMirrorNamespaceManifest)