dau_core.registry¶
Read-through access to THIS package’s registry of tiles.
Composition IS the registry: the definitions live in dau-core’s hydra
config tree (dau-core/cores.yaml) composed into the ccflow
ModelRegistry at /dau-core/<core-name>, and there is no
Python-literal core list anywhere. These accessors are thin views for
in-process consumers – tests, shell walking, source staging.
They are deliberately NOT part of the tile authoring surface. A third
party declaring a tile needs the models in dau_core.cores; it must
never need this module, which knows only about the tiles dau-core itself
ships. Keeping the two apart is what lets the surface be reachable by an
author who does not have this repository – see
tests/test_public_tile_surface.py, which enforces the direction.
Exceptions¶
Mapping key not found. |
|
Two composed groups declare the same core name. |
Functions¶
|
The composed registry groups, dau-core's own first. |
|
|
|
Every entry name in |
|
The composed core called |
|
Every composed core, name -> definition, dau-core's own first. |
|
|
|
|
|
Every composed core declaring |
|
The one composed core declaring |
|
Dependency-closed, deduplicated source paths for a set of cores — |
Module Contents¶
- exception dau_core.registry.UnknownCoreError[source]¶
Bases:
KeyErrorMapping key not found.
Initialize self. See help(type(self)) for accurate signature.
- exception dau_core.registry.DuplicateCoreError[source]¶
Bases:
ValueErrorTwo composed groups declare the same core name.
Initialize self. See help(type(self)) for accurate signature.
- dau_core.registry._groups() tuple[tuple[str, ccflow.ModelRegistry], ...][source]¶
The composed registry groups, dau-core’s own first.
Composing the packaged defaults when
/dau-coreis absent is what makes every accessor here work from a bare interpreter; a/dau-corea consumer already composed (possibly with overrides) is never reloaded.
- dau_core.registry._entry(group: ccflow.ModelRegistry, name: str) dau_core.cores.CoreDefinition | None[source]¶
nameingroup, building only that one model.A keyed lookup is the whole point: the groups are ccflow
LazyRegistryinstances, so this materializes oneCoreDefinitionwhere reading the group’s items would materialize all of them.
- dau_core.registry._declared_names(group: ccflow.ModelRegistry) tuple[str, ...][source]¶
Every entry name in
group, without building any of its models.
- dau_core.registry.core(name: str) dau_core.cores.CoreDefinition[source]¶
The composed core called
name.A keyed lookup per group, so asking for one tile builds one model. The duplicate check still runs: a name declared by two composed groups is refused here exactly as
loaded_cores()refuses it, because a core name is how every design, spec hash and cached manifest refers to it.
- dau_core.registry.loaded_cores() collections.abc.Mapping[str, dau_core.cores.CoreDefinition][source]¶
Every composed core, name -> definition, dau-core’s own first.
dau-core’s tiles come from its hydra config tree (
dau-core/cores.yaml) composed into the ccflowModelRegistryat/dau-core/<core-name>. Composition IS the registry — there is no Python-literal core list; these accessors are thin read-through views for in-process consumers (tests, dau shell walking). A/dau-coresubregistry a consumer already composed (possibly with overrides) is the source of truth and is never reloaded or overwritten here; the packaged defaults load only when it is absent.A CONTRIBUTED core is a core. A third party composing a
CoreDefinitionunder its own group used to compose successfully, register, and then be invisible to every consumer, because this only ever read/dau-core: the author did everything right and their tile silently vanished, with no error to explain it. AnyCoreDefinitionthe application composed is returned, whichever group holds it.This does not blur the packages.
source_packageis the seam that tells a foreign tile from one of ours, and dau-core’s own guards already scope themselves by it rather than assuming every registered core is theirs. A name collision is raised rather than resolved, because silently preferring one definition is the failure this fixes.
- dau_core.registry.core_for_module(module: str) dau_core.cores.CoreDefinition[source]¶
- dau_core.registry.cores_of_kind(kind: dau_core.cores.CoreKind) tuple[dau_core.cores.CoreDefinition, ...][source]¶
- dau_core.registry.cores_of_role(role: dau_core.cores.CoreRole) tuple[dau_core.cores.CoreDefinition, ...][source]¶
Every composed core declaring
role, in registry order.
- dau_core.registry.core_of_role(role: dau_core.cores.CoreRole) dau_core.cores.CoreDefinition[source]¶
The one composed core declaring
role.The shell-infrastructure roles are jobs exactly one core fills, and a composition selects the core by asking for the job. Zero is a palette with a hole in it; two is an ambiguity nothing here can resolve, and silently taking the first would make the answer depend on registry order, so both refuse.