Skip to Content

lacuna.diagnostics

Installation diagnostics, the engine of `lacuna doctor`.

Generated from Lacuna 0.14.3. For what these do and when to use them, read the guide.

Classes

DiagnosticCheck

class DiagnosticCheck(
    code: str,
    state: DiagnosticState,
    message: str,
    evidence: Mapping[str, JsonValue] = {},
)

One stable, actionable installation check.

FieldTypeDefault
codestrrequired
stateDiagnosticStaterequired
messagestrrequired
evidenceMapping[str, JsonValue]{}

DiagnosticCheck.to_dict

def to_dict() -> dict[str, object]

Return a JSON-compatible check record.

InstallationDiagnostics

class InstallationDiagnostics(
    checks: tuple[DiagnosticCheck, ...],
    distribution_version: str | None,
    native: NativeStatus,
    configuration: Mapping[str, JsonValue],
    dependencies: Mapping[str, JsonValue],
    runtime: Mapping[str, JsonValue],
    schema_version: str = '1',
    diagnostic_version: int = 1,
)

Versioned snapshot of an installed Lacuna runtime.

FieldTypeDefault
checkstuple[DiagnosticCheck, ...]required
distribution_versionstr | Nonerequired
nativeNativeStatusrequired
configurationMapping[str, JsonValue]required
dependenciesMapping[str, JsonValue]required
runtimeMapping[str, JsonValue]required
schema_versionstr'1'
diagnostic_versionint1

InstallationDiagnostics.status

status: DiagnosticState

Return the worst diagnostic state.

InstallationDiagnostics.healthy

healthy: bool

Return whether no release-blocking diagnostic failed.

InstallationDiagnostics.to_dict

def to_dict() -> dict[str, object]

Return a stable machine-readable payload while preserving legacy doctor fields.

InstallationDiagnostics.to_json

def to_json(*, indent: int | None = 2) -> str

Serialize diagnostics with deterministic key ordering.

Functions

diagnose_installation

def diagnose_installation() -> InstallationDiagnostics

Inspect the installed runtime without reading user data or activating plugins.

Enums

DiagnosticState

class DiagnosticState(StrEnum)

Outcome of one operational diagnostic check.

MemberValue
PASS'PASS'
WARN'WARN'
FAIL'FAIL'

Types and constants

DIAGNOSTIC_VERSION

DIAGNOSTIC_VERSION = 1