aeat.core.corpus_manifest._errors module

Typed error hierarchy for corpus-manifest validation.

Defines the leaf exceptions raised by the corpus-manifest loader and verifier. All inherit from core.errors.AeatError so any caller catching the framework’s base error type also catches manifest failures.

exception CorpusManifestError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: AeatError, ValueError

Base error for any failure in corpus-manifest parsing or validation.

Concrete failure modes derive from this class; callers can catch CorpusManifestError to handle every manifest failure uniformly, or catch a leaf such as CorpusManifestTamperError to react to a specific condition.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception CorpusManifestTamperError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CorpusManifestError

Raised when a manifest’s self-attesting digest does not match its body.

Indicates the manifest body has been edited without recomputing the embedded checksum — usually a sign of corruption or tampering rather than legitimate drift between the manifest and the on-disk corpus (which is signalled by CorpusManifestDriftError).

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception CorpusManifestDriftError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CorpusManifestError

Raised when the on-disk corpus diverges from the manifest’s expectations.

Distinct from CorpusManifestTamperError: the manifest itself is internally consistent, but the files it describes have been added, removed, or modified relative to the manifest’s recorded digests.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception CorpusBundleError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CorpusManifestError

Base error for corpus bundle build/verify failures.

Raised for structural bundle problems (not a zip archive, missing or structurally invalid embedded manifest, unsupported manifest version) that are distinct from a checksum-level verification failure (CorpusBundleVerificationError).

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]
exception CorpusBundleVerificationError(message=None, *, context=None, suggestion=None, translated_message=None)[source]

Bases: CorpusBundleError

Raised when a bundle’s embedded manifest does not match its archived files.

Carries the same missing/unexpected/mismatched vocabulary as CorpusManifestDriftError so a bundle-integrity failure and a live-corpus-drift failure read the same way to an operator; the distinguishing detail is that this failure is about a zip archive’s contents, not the corpus already on disk.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • suggestion (str | None)

  • translated_message (str | None)

Return type:

None

code: ClassVar[ErrorCode]