aeat.adapters.persistence.storage.bucket._output_language_hint module

Bucket-local last-known output-language hint.

The encrypted user-profile record remains the authority for preferences.output_language. This sidecar carries only the last successfully persisted supported language code so critical storage failures can render in the profile language when the bucket DEK cannot be unwrapped.

normalize_output_language_hint(value)[source]

Return value as a supported output-language code, or None.

Return type:

str | None

Parameters:

value (object)

bucket_output_language_hint_path(*, storage_root, bucket_id)[source]

Return the bucket-local output-language hint path.

Return type:

Path

Parameters:
  • storage_root (Path)

  • bucket_id (str)

read_bucket_output_language_hint(*, storage_root, bucket_id)[source]

Read a supported bucket output-language hint, failing soft on absence or drift.

Return type:

str | None

Parameters:
  • storage_root (Path)

  • bucket_id (str)

write_bucket_output_language_hint(*, storage_root, bucket_id, language)[source]

Atomically persist a supported bucket output-language hint.

Returns True when a hint was written and False when language is unsupported. Unsupported values never reach disk.

Return type:

bool

Parameters:
clear_bucket_output_language_hint(*, storage_root, bucket_id)[source]

Remove the bucket output-language hint if it exists.

Return type:

None

Parameters:
  • storage_root (Path)

  • bucket_id (str)