aeat.adapters.persistence.storage.bucket package

Per-bucket directory model under <aeat-root>/buckets/<bucket-id>/.

Pydantic v2 strict records, error types, and filesystem primitives that compose the multi-bucket on-disk layout. The facade exposes BucketPaths / bucket_paths() / provision_bucket_directory() for the db/, blobs/, and audit/ tree; BucketManifest, ManifestKdfParams, BucketKeySchedule, and BucketLifecycleStatus for the plaintext manifest; and read_manifest() / write_manifest() for strict TOML I/O.

The manifest is discovery metadata only: bucket identity, operator label, UTC timestamps, public Argon2id KDF parameters and salt, recovery-enrollment state, idle-lock setting, key schedule, schema version, and lifecycle mirror. It must not contain passphrases, derived keys, wrapped DEKs, recovery secrets, taxpayer payloads, or secure-object ciphertext. Keystore helpers (keystore_root(), keystore_path(), and validate_keystore_separation()) enforce that custody material lives outside the buckets/ tree and the per-bucket database directory.

The sealed-archive surface re-exports ExportArchiveHeader, SealedArchiveContents, write_sealed_archive(), and read_sealed_archive() for application-level bucket export/import. These helpers own archive shape and metadata normalisation only; profile payload composition remains in application.user_profile, while application.bucket_maintenance orchestrates operator-facing export and import.

See also

BucketManifest

Strict per-bucket manifest record stored beside the bucket directory.

ExportArchiveHeader

Plaintext frontmatter for sealed bucket-export archives.

write_sealed_archive()

Host-metadata-normalising writer for sealed export archives.

read_sealed_archive()

Reader that validates archive member order and header shape before returning encrypted payload bytes.

application.bucket_maintenance

Application service facade that composes these archive primitives with profile lifecycle and domain event history.

Submodules