feat(agent+ui): fullstack agent module refactoring + UI/UX improvements

## Backend: agent module GRACE-Poly compliance
- Split app.py (749→~280 lines) into _tool_resolver, _confirmation, _persistence
- All 18 naked functions wrapped in #region/#endregion contracts
- Fixed @DEFGROUP→@defgroup typos; added @DATA_CONTRACT, @SIDE_EFFECT, CoT logs
- Conversation list API: added last_role, has_tool_calls, has_error, risk_level fields
- Message state detection: Russian/English error patterns (недоступен, unavailable)
- State field preserved in save_conversation messages
- HITL titles: descriptive tool names instead of generic "HITL resume"

## Backend: conversation title generation (two-layer)
- Layer 1: clean_title() — rule-based, strips file markers, pre-fetch blocks, JSON/CSV,
  URLs, code; truncates at 80 chars word boundary (25 unit tests, all edge cases)
- Layer 2: generate_llm_title() — async best-effort LLM titling via /v1/chat/completions
  with per-conversation lock, graceful degradation on failure

## Frontend: conversation list indicators (orthogonal system)
- Status dot (green/yellow/red/blue) per conversation state
- Icon column: tool activity, errors, waiting, completed
- Risk stripe (left border accent) + message count badge + relative time
- Fixed group labels: "Сегодня"/"Вчера" instead of "3 ч"/"5 ч"
- Hide "Окружение: —" when env is empty

## Frontend: guardrails card verification + fixes
- Confirmed all interaction modes: Enter/click confirm, Escape/click deny
- Auto-populate envId from environmentContextStore in DashboardDetailModel
- Better error message: missing_context_hint with recovery guidance

## Design system: semantic tokens
- Added category-* gradient tokens to tailwind.config.js
- Sidebar + Breadcrumbs use semantic tokens (10 categories)
- Raw Tailwind reduced from ~50 to 6 occurrences
- Added skip-to-content link in root layout (+layout.svelte)
- Added aria-label on DashboardDataGrid row checkboxes

## Protocol: INV_7 pragmatic exception
- Modules may exceed 400 lines when contract-dense (every function has #region)
- Recorded in semantics-core SKILL.md with rationale

Total: 5841+ contracts, 2993+ edges, backend 41/41, frontend 2501/2501
This commit is contained in:
2026-06-30 15:21:05 +03:00
parent 5aa5fc1fc6
commit b61252667d
33 changed files with 2076 additions and 374 deletions

View File

@@ -95,6 +95,19 @@ export default {
git: '#fb923c',
system: '#38bdf8',
},
// ── Category gradient tokens (sidebar/breadcrumb icons) ──
category: {
dashboards: { from: '#e0f2fe', to: '#bae6fd', text: '#0369a1', ring: '#7dd3fc' }, // sky
datasets: { from: '#dcfce7', to: '#bbf7d0', text: '#15803d', ring: '#86efac' }, // emerald→success
migration: { from: '#ffedd5', to: '#fed7aa', text: '#c2410c', ring: '#fdba74' }, // orange→warning
git: { from: '#f3e8ff', to: '#e9d5ff', text: '#7e22ce', ring: '#d8b4fe' }, // purple
translation: { from: '#cffafe', to: '#99f6e4', text: '#0f766e', ring: '#5eead4' }, // cyan/teal→info
validation: { from: '#fef3c7', to: '#fde68a', text: '#a16207', ring: '#fcd34d' }, // amber
reports: { from: '#ede9fe', to: '#ddd6fe', text: '#6d28d9', ring: '#c4b5fd' }, // violet
tools: { from: '#f1f5f9', to: '#e2e8f0', text: '#334155', ring: '#94a3b8' }, // slate→surface
admin: { from: '#ffe4e6', to: '#fecdd3', text: '#be123c', ring: '#fda4af' }, // rose→destructive
maintenance: { from: '#ffedd5', to: '#fed7aa', text: '#c2410c', ring: '#fdba74' }, // orange→warning
},
},
width: {
sidebar: '240px',