- DashboardHealthItem schema: add run_id, policy_id, execution_path, issues_count, timings, token_usage, screenshot_paths, chunk_count, dashboard_name fields for v2 LLM validation reporting. - HealthService: populate v2 fields from validation run records. - ValidationService: update to support v2 validation run fields. - validation_tasks route: minor fix for v2 field handling. - tailwind.config.js: refactor design tokens — add success/warning/info palettes, surface/border/text hierarchy, semantic action colors. - Agent configs: update svelte-coder and semantics-svelte for .svelte.ts runes and Screen Model patterns.
52 lines
1.6 KiB
Python
52 lines
1.6 KiB
Python
# #region HealthSchemas [C:3] [TYPE Module] [SEMANTICS pydantic, health, schema, dashboard, dashboard-health-item]
|
|
# @BRIEF Pydantic schemas for dashboard health summary — includes v2 LLM validation fields.
|
|
# @LAYER Domain
|
|
# @RELATION DEPENDS_ON -> [EXT:Library:pydantic]
|
|
|
|
from datetime import datetime
|
|
from typing import Any
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
# #region DashboardHealthItem [TYPE Class]
|
|
# @BRIEF Represents the latest health status of a single dashboard, with v2 LLM validation data.
|
|
class DashboardHealthItem(BaseModel):
|
|
record_id: str | None = None
|
|
dashboard_id: str
|
|
dashboard_slug: str | None = None
|
|
dashboard_title: str | None = None
|
|
environment_id: str
|
|
status: str = Field(..., pattern="^(PASS|WARN|FAIL|UNKNOWN)$")
|
|
last_check: datetime
|
|
task_id: str | None = None
|
|
run_id: str | None = None
|
|
policy_id: str | None = None
|
|
summary: str | None = None
|
|
# v2 LLM validation fields
|
|
execution_path: str | None = None # "screenshot" or "text_only"
|
|
issues_count: int = 0
|
|
timings: dict[str, Any] | None = None
|
|
token_usage: dict[str, Any] | None = None
|
|
screenshot_paths: list[str] | None = None
|
|
chunk_count: int | None = None
|
|
dashboard_name: str | None = None # human-readable alias for dashboard_title
|
|
|
|
|
|
# #endregion DashboardHealthItem
|
|
|
|
|
|
# #region HealthSummaryResponse [TYPE Class]
|
|
# @BRIEF Aggregated health summary for all dashboards.
|
|
class HealthSummaryResponse(BaseModel):
|
|
items: list[DashboardHealthItem]
|
|
pass_count: int
|
|
warn_count: int
|
|
fail_count: int
|
|
unknown_count: int
|
|
|
|
|
|
# #endregion HealthSummaryResponse
|
|
|
|
# #endregion HealthSchemas
|