Module

health.base

Base validator interface for health checks.

All validators should inherit from BaseValidator and implement the validate() method.

Classes

BaseValidator abstract
Base class for all health check validators. Each validator should: 1. Have a clear name (e.g., "Na…
3

Base class for all health check validators.

Each validator should:

  1. Have a clear name (e.g., "Navigation", "Cache Integrity")
  2. Implement validate() to return a list of CheckResult objects
  3. Be fast (target: < 100ms for most validators)
  4. Be independent (no dependencies on other validators)
Inherits from ABC

Attributes

Name Type Description
name str
description str
enabled_by_default bool

Methods 2

validate
Run validation checks and return results.
2 list[CheckResult]
def validate(self, site: Site, build_context: BuildContext | Any | None = None) -> list[CheckResult]

Run validation checks and return results.

Parameters 2
site Site

The Site object being validated

build_context BuildContext | Any | None

Optional BuildContext with cached artifacts (e.g., knowledge graph). Use Any in type hint to avoid circular imports at runtime.

Returns

list[CheckResult]

List of CheckResult objects (errors, warnings, info, or success)

is_enabled
Check if this validator is enabled in config.
1 bool
def is_enabled(self, config: dict[str, Any]) -> bool

Check if this validator is enabled in config.

Parameters 1
config dict[str, Any]

Site configuration dictionary

Returns

bool

True if validator should run

Internal Methods 1
__repr__
0 str
def __repr__(self) -> str
Returns

str