From 8219540ade660e639028fa2b4c630d0466424524 Mon Sep 17 00:00:00 2001 From: busya Date: Tue, 2 Jun 2026 09:54:42 +0300 Subject: [PATCH] feat(backend): add v2 LLM validation fields to health service MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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. --- .opencode/agents/svelte-coder.md | 34 +++- .opencode/skills/semantics-svelte/SKILL.md | 116 +++++++++---- backend/src/api/routes/validation_tasks.py | 4 +- backend/src/schemas/health.py | 15 +- backend/src/services/health_service.py | 27 +++ backend/src/services/validation_service.py | 64 ++++++-- frontend/tailwind.config.js | 182 ++++++++++++--------- 7 files changed, 307 insertions(+), 135 deletions(-) diff --git a/.opencode/agents/svelte-coder.md b/.opencode/agents/svelte-coder.md index 33e40632..d1c14a81 100644 --- a/.opencode/agents/svelte-coder.md +++ b/.opencode/agents/svelte-coder.md @@ -48,13 +48,14 @@ See `semantics-core` §VI for the canonical tool reference. For Svelte frontend ## ss-tools Frontend Scope You own: - SvelteKit routes (`frontend/src/routes/`) -- Svelte 5 components (`frontend/src/lib/components/`) +- Svelte 5 components (`frontend/src/lib/components/` — **only directory for NEW domain components**) +- **UI atoms** (`frontend/src/lib/ui/` — Button, Card, Input, Select, PageHeader, Icon, HelpTooltip, LanguageSwitcher) - **Screen Models** (`frontend/src/lib/models/` — `[TYPE Model]` contracts for screen-level state) - Svelte stores (`frontend/src/lib/stores/`) - API client layer (`frontend/src/lib/api/`) - i18n localization (`frontend/src/i18n/`) - Pages, layouts, and services -- Tailwind-first UI implementation +- Tailwind-first UI implementation (semantic tokens ONLY — no raw blue-600, gray-*, indigo-*) - UX state repair and route-level behavior - Browser-driven acceptance for frontend scenarios - Screenshot and console-driven debugging @@ -64,6 +65,9 @@ You do not own: - Backend-only implementation unless explicitly scoped - Semantic repair outside the frontend boundary unless required by the UI change +### Frozen zones (LEGACY — migrate away, do NOT add) +- `frontend/src/components/` — legacy component directory. **Do not create new files here.** All new domain components go in `lib/components//`. + ## Required Workflow 1. **Discover or create the Model first.** For any screen with cross-widget state: - grep `@semantics.*` across `frontend/src/` to find existing models @@ -107,13 +111,25 @@ For frontend design and implementation tasks, default to these rules unless the - Prefer whitespace, alignment, scale, and contrast before adding chrome. - Default to cardless layouts; use cards only when a card is the actual interaction container for a specific resource (Dashboard, Dataset, Task). -### Visual system (ss-tools design tokens) -- Primary: `blue-600` / `blue-700` (buttons, links, accents) -- Success: `green-500` / `green-600` -- Error: `red-500` / `red-600` -- Warning: `amber-400` / `amber-500` -- Background: `gray-50` (page), `white` (cards/surfaces) -- Text: `gray-900` (primary), `gray-500` (muted) +### Visual system (ss-tools design tokens — source: `tailwind.config.js`) +**Raw Tailwind colors (`blue-600`, `green-500`, `red-600`, `gray-*`, `indigo-*`) are DEPRECATED in page and component code.** Use ONLY these semantic tokens: + +- Primary action: `bg-primary text-white hover:bg-primary-hover` (maps to blue-600/700) +- Destructive action / error: `bg-destructive text-white`, `bg-destructive-light text-destructive border-destructive-ring` +- Page background: `bg-surface-page` +- Card surface: `bg-surface-card` +- Muted surface: `bg-surface-muted` +- Default border: `border-border`; strong border (inputs): `border-border-strong` +- Primary text: `text-text`; muted text: `text-text-muted`; subtle text (placeholders): `text-text-subtle` +- Success: `text-success bg-success-light border-success-*` +- Warning: `text-warning bg-warning-light border-warning-*` +- Info: `text-info bg-info-light border-info-*` + +### UI component reuse (MANDATORY) +- **Page-level UI MUST use `$lib/ui` atoms:** `