Coverage for src / lexigram / contracts / admin / health_payload.py: 100%

10 statements  

« prev     ^ index     » next       coverage.py v7.13.5, created at 2026-08-15 18:58 +0800

1"""Structured health-check result for the admin dashboard.""" 

2 

3from __future__ import annotations 

4 

5from dataclasses import dataclass 

6 

7from lexigram.contracts.core.health import HealthStatus 

8 

9 

10@dataclass(frozen=True) 

11class HealthCheckPayload: 

12 """Structured result of an admin-contributed health check. 

13 

14 Replaces the prose ``str`` previously returned by 

15 ``BaseAdminContributor.render_health_check`` — the host (``WidgetController``) 

16 owns turning this into HTML, so every contributor's health check renders 

17 with the same badge/status presentation. 

18 """ 

19 

20 status: HealthStatus 

21 component: str 

22 detail: str = "" 

23 latency_ms: float | None = None 

24 

25 

26__all__ = ["HealthCheckPayload"]