The module registry is an immutable, read-only view of all discovered modules. It is populated by loading the cache file generated during discovery and is available throughout the engine lifecycle after bootstrapping.
Loading
The registry is initialised by reading the generated cache file. It does not perform any discovery or reflection itself — that is entirely the responsibility of the discovery process. If no cache file exists, the registry cannot be initialised and the engine should error clearly.
ModuleRegistry
ModuleRegistry is an immutable class exposing the following:
- All manifests as a map of
ident -> ModuleManifest
- All enabled module idents as a list
- All disabled module idents as a list
- All registrars for enabled modules as a map of
ident -> ModuleRegistrar
- Lookup of a single
ModuleManifest by ident
- Lookup of a single
ModuleRegistrar by ident
- Check whether a given ident is enabled
- Check whether a given ident is disabled
- Check whether a given ident is present at all
Registrar Lifecycle
The registry holds registrar metadata (ModuleRegistrar) alongside manifests. There is a case for clearing registrar metadata from the registry after the lifecycle phases are complete, since the metadata is only needed during register, boot, and collect. This is left as a future consideration — for now registrars remain in the registry for the full request lifetime.
Tasks
The module registry is an immutable, read-only view of all discovered modules. It is populated by loading the cache file generated during discovery and is available throughout the engine lifecycle after bootstrapping.
Loading
The registry is initialised by reading the generated cache file. It does not perform any discovery or reflection itself — that is entirely the responsibility of the discovery process. If no cache file exists, the registry cannot be initialised and the engine should error clearly.
ModuleRegistry
ModuleRegistryis an immutable class exposing the following:ident -> ModuleManifestident -> ModuleRegistrarModuleManifestby identModuleRegistrarby identRegistrar Lifecycle
The registry holds registrar metadata (
ModuleRegistrar) alongside manifests. There is a case for clearing registrar metadata from the registry after the lifecycle phases are complete, since the metadata is only needed during register, boot, and collect. This is left as a future consideration — for now registrars remain in the registry for the full request lifetime.Tasks
ModuleRegistrywith manifest and registrar maps and all lookup methods