hydra.overlay.python.dsl.meta.defs module

Meta-DSL helper for verifying module def-registration completeness.

Mirrors the role of Java’s Defs.checkComplete (overlay/java/hydra-kernel/…/dsl/meta/Defs.java): each Hydra definition in a Python source module is authored as a zero-argument, underscore-prefixed module-level function (e.g. def _fooBar(): return _def(“fooBar”)…), then separately registered by name in the module’s definitions tuple (built by _build_module() or an inline list literal). Omitting a def-producing function from that tuple silently drops it from the generated module. check_complete catches this by calling every def-producing function found in the module and confirming its name appears among the registered definitions.

hydra.overlay.python.dsl.meta.defs.check_complete(module, registered)

Verify every def-producing function declared in module is present in registered.

registered is the definitions tuple/list actually assembled for the module (e.g. module_.definitions). Walks every module-level, zero-argument function whose name starts with a single underscore, calls it, and checks whether the resulting definition’s name is among registered’s names. A call result that isn’t Definition/TypedBinding-shaped (i.e. has no extractable name) is treated as “not a def-producer” and skipped — not every _foo helper produces a definition. Raises AssertionError naming any orphaned function.