cadrumo.application.diagnostic_models module

Typed contracts shared by application diagnostic report producers.

The reports in this module remain independent from the diagnostic probes that populate them. Their forward references are rebuilt only when a repair probe needs the heavy storage and wizard-status types, preserving the import-light version surface.

class DiagnosticStatus(*values)[source]

Bases: StrEnum

How a single diagnostic check came out.

Ordered by severity in meaning though not by declaration: an overall status is the worst member any check reported.

OK

The check passed and needs no attention.

WARN

The check found something worth reporting that does not block the operation.

FAIL

The check found a condition that blocks the operation it guards.

DiagnosticStatusValue

The same vocabulary for a strict model field or CLI payload surface.

A bare enum under strict validation refuses the plain token a serialised report carries, so those fields take this literal over the members above.

alias of Literal[OK, WARN, FAIL]

class CliVersionReport(**data)[source]

Bases: BaseModel

Version payload rendered by root CLI version surfaces.

Parameters:

data (Any)

package_name: str
package_version: str
class DiagnosticAudience(*values)[source]

Bases: StrEnum

Who a diagnostic check is written for.

Not a severity and not a filter on severity: an internal check can be healthy and an operator check can fail. It says who can act on the result.

OPERATOR

Written for the person running the command, in terms they can act on.

INTERNAL

Written for whoever maintains the installation, not for the operator.

DiagnosticAudienceValue

The same vocabulary for a strict model field or CLI payload surface.

alias of Literal[OPERATOR, INTERNAL]

class DiagnosticFinding(**data)[source]

Bases: BaseModel

One concrete, named sub-finding inside a DiagnosticCheck.

Parameters:

data (Any)

summary: str
detail: str | None
requirement: RequirementValue | None
class DiagnosticCheck(**data)[source]

Bases: BaseModel

One concrete config repair check with an unambiguous recovery outcome.

Parameters:

data (Any)

name: str
status: DiagnosticStatusValue
summary: str
detail: str | None
precondition_verdict: PreconditionVerdict | None
audience: DiagnosticAudienceValue
findings: tuple[DiagnosticFinding, ...]
diagnostic_action_verdict(*, condition_id, evidence_id, values, action_id, argument_bindings=(), missing_argument_names=())[source]

Build one diagnostics-owned actionable failed-condition verdict.

Return type:

PreconditionVerdict

Parameters:
diagnostic_no_recovery_verdict(*, condition_id, evidence_id, values, outcome)[source]

Build one explicit diagnostics-owned closed recovery outcome.

Return type:

PreconditionVerdict

Parameters:
resolved_verdict_binding(argument_name, value)[source]

Bind a concrete diagnostics fact to one catalogue argument.

Return type:

ActionArgumentBinding

Parameters:
missing_verdict_binding(argument_name)[source]

Declare one catalogue argument diagnostics cannot honestly supply.

Return type:

ActionArgumentBinding

Parameters:

argument_name (str)

class SecureObjectIntegrityReport(**data)[source]

Bases: BaseModel

Aggregated decryptability counts across every populated namespace.

Parameters:
namespaces: tuple[DiagnosticSecureObjectNamespace, ...]
readable_total: int
unreadable_total: int
class ConfigRepairReport(**data)[source]

Bases: BaseModel

Composite report rendered by the bare aeat config repair command.

Parameters:
overall: DiagnosticStatusValue
package_name: str
package_version: str
python_version: str
log_file: str
setup: WizardStatusReport | None
secure_objects: SecureObjectIntegrityReport
checks: tuple[DiagnosticCheck, ...]
ensure_models_rebuilt()[source]

Resolve deferred heavy-type forward references on repair report models.

Return type:

None