babylon.kernel.schema_registry
Shared JSON Schema registry builder for $ref resolution.
Provides a single, directory-parameterized helper that walks a schemas
directory, loads every *.schema.json file, and assembles a
referencing.Registry keyed by each schema’s $id. This registry
is what Draft 2020-12 validators consult to resolve $ref references
between schema files.
This helper was extracted from two byte-identical private copies
(babylon.intelligence.ai.persona_loader and
babylon.engine.observers.schema_validator) so both call sites share one
implementation. Each call site passes its own schemas directory.
See also
babylon.intelligence.ai.persona_loader: Persona loading call site.
babylon.engine.observers.schema_validator: Observer-output call site.
Functions
|
Build a schema registry for |
- babylon.kernel.schema_registry.build_schema_registry(schemas_dir)[source]
Build a schema registry for
$refresolution.Lazily loads all schemas from
schemas_dirand caches the result. The cache is keyed on the directory argument, so each distinct schemas directory is scanned at most once per process.