cadrumo.application.diagnostics_run_health_ports module

Application-owned contract for local diagnostic run telemetry.

The run-health use cases aggregate timing and outcome facts, but they do not choose where those facts are stored. DiagnosticRunTelemetryPort keeps the application independent of the outbound LLM recorder while DiagnosticRunRecord gives every diagnostic projection one validated shape. The outbound adapter translates its storage record and failures at the composition boundary.

class DiagnosticRunRecord(**data)[source]

Bases: BaseModel

One timing/outcome fact supplied to the diagnostic run-health service.

Parameters:

data (Any)

run_id: str
caller: str
provider: str
model: str
duration_ms: NonNegativeInt
succeeded: bool
error_kind: str
started_at: UtcInstant
exception DiagnosticRunTelemetryError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

A diagnostic telemetry read failed at the outbound boundary.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
class DiagnosticAuthProbeResult(**data)[source]

Bases: BaseModel

Safe auth-readiness facts needed by the run-health projection.

Parameters:

data (Any)

provider: str
configured: bool
persisted_session_present: bool
persisted_session_expired: bool | None
persisted_session_state: str
probe_summary: str
class DiagnosticAuthProbePort(*args, **kwargs)[source]

Bases: Protocol

Read-only auth probe required by the diagnostic run-health service.

probe()[source]

Return the redacted local auth-readiness facts for diagnostics.

Return type:

DiagnosticAuthProbeResult

class DiagnosticRunTelemetryPort(*args, **kwargs)[source]

Bases: Protocol

Read-only local run telemetry required by diagnostic projections.

load_records(*, since, until)[source]

Return validated run facts within the inclusive date window.

Return type:

tuple[DiagnosticRunRecord, ...]

Parameters:
  • since (date | None)

  • until (date | None)