ClearMap.config.validators#

ClearMap config validation - public API.

This module exposes stable entrypoints; implementations live in private modules.

Functions#

validate_all(config, *, schemas_dir)

Validate a full multi-section config.

  1. JSON-Schema per section (Draft 2020-12), with typedefs and dynamic enums.

  2. Semantic checks (cross-field / cross-section rules).

Raises AggregatedValidationError with aggregated messages on failure.

validate_static(config, sv)

Validate each section of the config using JSON-Schema (Draft 2020-12). Uses the provided SectionValidators instance to load and cache schemas. Raises AggregatedValidationError with aggregated messages on failure.

run_semantic_checks(config, sv)

Run cross-field / cross-section semantic validation rules.

class ConfigValidator(*args, **kwargs)[source]#

Bases: Protocol

register_validator(fn: ConfigValidator) None[source]#
validate_all(config: Mapping[str, Mapping[str, Any]], *, schemas_dir: Path, sections_validators: SectionValidators | None = None) None[source]#

Validate a full multisection config. This is typically a ConfigCoordinator’s view.

  1. JSON-Schema per section (Draft 2020-12), with typedefs and dynamic enums

  2. Semantic checks (cross-field/cross-section rules)

Raises AggregatedValidationError with aggregated messages on failure.


Sub-packages and modules#