aeat.core._models module

Shared pydantic model configuration constants.

Provides the canonical STRICT_FROZEN_CONFIG used across domain, application, and adapter pydantic models that require strict-mode, frozen, no-extra-fields configuration. It is a pydantic.ConfigDict value shared by records that need immutable boundary contracts, including domain.calculations.registry.RegistryModel, core._optional_extras.OptionalExtra, and encrypted-storage envelope records.

The constant is intentionally only a config value, not a base class or a validation policy. Domain modules still own field validators, serializers, model rebuilds, and any richer invariants on their own records; this module only centralises the common strict=True, frozen=True, and extra="forbid" baseline.

Modules with intentionally divergent ConfigDict values (e.g. arbitrary_types_allowed=True in storage adapter models, or validate_assignment=True in JSON contract models) must keep their own module-local config constant and must NOT import STRICT_FROZEN_CONFIG from here. The CLI JSON contract is such an exception: core.json_contract.OutputSchema and core.json_contract.SchemaEnvelope add assignment validation for machine-output conformance.

STRICT_FROZEN_CONFIG: ConfigDict

Canonical pydantic ConfigDict for strict-mode, frozen, no-extra-fields models.

Modules that require a different config (e.g. arbitrary_types_allowed=True for ORM-mapped types, or validate_assignment=True for mutable contract types) must declare a module-local constant instead. This constant deliberately does not set validate_assignment; it is the default for frozen value objects, not for settings models, mutable accumulators, or the CLI JSON schema registry.