aeat.core.resources._repository module¶
ResourceCacheRepository base for the resource-management API.
Every read-only bundled-data resource in the project is exposed
through one ResourceRepository implementation. The
repository owns its loader and its Identity Map cache; consumers
go through ResourceRegistry instead of importing loader
functions directly.
The base class implements the get(key) / clear_cache
contract on top of an unbounded dict[K, T]. Subclasses
override _load(key) -> T to perform the actual file read
and Pydantic validation. The cache strategy is documented in
the resource-management-api ADR: process-lifetime memoisation,
no eviction, because the bundled data is immutable per install.
- class ResourceCacheRepository[source]¶
Bases:
GenericDefault Repository implementation with an Identity Map cache.
Subclasses override
_load()to read and validate one resource per key. The base class owns the cache behind theResourceRepositoryprotocol; subclasses never touch it directly.- get(key)[source]¶
Return the resource for
key, loading on first access.- Return type:
T
- Parameters:
key (K)