registry
registry
¶
Preflight registry: build, validate, register plugin checks.
Classes:
| Name | Description |
|---|---|
PreflightRegistry |
Ordered, name-keyed view of the checks the orchestrator will run. |
Functions:
| Name | Description |
|---|---|
register_preflight_check |
Register a third-party |
reset_preflight_plugins |
Clear all registered plugins and rebuild the registry from core checks. |
build_registry |
Merge one or more check sequences into a validated |
get_registry |
Return the current preflight registry. |
PreflightRegistry(checks)
dataclass
¶
Ordered, name-keyed view of the checks the orchestrator will run.
Constructed by :func:build_registry and treated as immutable.
Iteration yields the PreflightCheck instances themselves (not
their names), so for check in registry reads naturally;
name-based access uses registry[name] / name in registry.
Extend by calling register_preflight_check or rebuilding via
build_registry; never mutate in place.
Attributes:
| Name | Type | Description |
|---|---|---|
checks |
Mapping[str, PreflightCheck]
|
Insertion-ordered mapping from |
names
property
¶
The check names, in registry order.
register_preflight_check(check)
¶
Register a third-party PreflightCheck instance for inclusion in the registry.
Plugin checks are included when the registry is (re)built by
build_registry. The registry is sorted by stage, so each plugin
lands in its stage block after core checks from the same stage rather
than at the absolute end of the registry. The function takes an
instance (not a class) and returns it unchanged, e.g.::
register_preflight_check(MyCheck())
The first dotted segment of name must not match a reserved core
namespace; this is enforced here rather than at class-definition
time so that core checks -- which are registered by direct
inclusion in _CORE_CHECKS -- can legitimately use those
prefixes.
Not thread-safe. Registration is expected at import / boot time -- serialize externally if you call this from multiple threads.
Source code in src/nemo_safe_synthesizer/preflight/registry.py
reset_preflight_plugins()
¶
Clear all registered plugins and rebuild the registry from core checks.
Intended for use in tests and notebooks where a clean registry is
required between runs. Not thread-safe; see register_preflight_check.
Source code in src/nemo_safe_synthesizer/preflight/registry.py
build_registry(*sources)
¶
Merge one or more check sequences into a validated PreflightRegistry.
Entries are stably sorted by stage so plugins registered from
_PLUGIN_CHECKS (typically appended after core) slot into the
appropriate stage block while preserving relative order within a
stage.
Source code in src/nemo_safe_synthesizer/preflight/registry.py
get_registry()
¶
Return the current preflight registry.
The registry is rebuilt each time a plugin is registered via
register_preflight_check or cleared via reset_preflight_plugins.
Always call this function rather than caching the result across
registration boundaries.