- Move agent code from backend/src/agent/ to agent/src/ss_tools/agent/ - Extract shared stdlib-only utilities to shared/src/ss_tools/shared/ - Add #region/#endregion contracts to all ~140 functions (INV_1 compliance) - Update docker files, entrypoint, build scripts for new package layout - Backend now imports ss_tools.shared._llm_health (no gradio/langchain deps) - Add specs for 036-039 feature plans
9.4 KiB
#region DashboardScenarioUi.UxReference [C:4] [TYPE ADR] [SEMANTICS ux,reference,scenario,dashboard-testing] @BRIEF UX reference for the Dashboard Test Scenario Agent workspace and dashboard entry point. @RELATION DEPENDS_ON -> [DashboardScenarioUi.Spec] @RATIONALE The user experience is centered on approving a business scenario, not selecting implementation technologies. @REJECTED Primary dropdown options for Playwright, SQL, and XLSX were rejected because they expose implementation details and conflict with unique cross-tool scenario generation.
Feature Branch: 039-dashboard-scenario-ui
Created: 2026-07-07 | Status: Draft
1. User Persona & Context
- Who is the user?: QA engineer, dashboard owner, or analyst responsible for repeatable dashboard validation.
- What is their goal?: Generate a unique dashboard test scenario, provide business parameters, inspect generated artifacts, and approve durable changes.
- Context: Svelte UI in superset-tools; entry from dashboard page into
/agentwith scenario intent.
2. Happy Path Narrative
The user opens a dashboard and clicks "Создать сценарий тестирования". The agent analyzes the dashboard, presents a proposed scenario flow with browser, Superset API, XLSX, assertion, evidence, and report steps. The user fills required business parameters, previews generated artifacts and baseline impacts, then confirms save or keeps the artifacts as draft.
3. Interface Mockups
Dashboard Entry
┌─────────────────────────────────────────────────────────────────────────────┐
│ Dashboard: FI-0080 Env: ss-dev │
├─────────────────────────────────────────────────────────────────────────────┤
│ [Открыть в Superset] [Валидация] [Документация] │
│ │
│ [Создать сценарий тестирования] │
└─────────────────────────────────────────────────────────────────────────────┘
Agent Workspace
┌─────────────────────────────────────────────────────────────────────────────┐
│ 🧪 Dashboard Test Scenario Agent ● connected │
├─────────────────────────────────────────────────────────────────────────────┤
│ Context: FI-0080 | dashboard_id=42 | env=ss-dev │
│ Progress: [Context ✓] → [Inspect ✓] → [Scenario …] → [Parameters] → [Save] │
└─────────────────────────────────────────────────────────────────────────────┘
Scenario Preview
┌──────────────────────── Предложенный сценарий ──────────────────────────────┐
│ Цель: проверить фильтры, метрику и XLSX выгрузку │
│ Steps: 18 | Tools: browser, Superset API, XLSX, assertions, report │
│ │
│ № Step Tool Expected │
│ 1 Открыть дашборд browser dashboard_loaded │
│ 2 Применить фильтры browser filter_state.normalized │
│ 3 Выполнить chart query Superset API metric returned │
│ 4 Скачать XLSX browser xlsx.file │
│ 5 Сравнить с baseline assertion pass/fail/inconclusive │
│ │
│ [Открыть граф] [Заполнить параметры] [Сгенерировать draft] │
└─────────────────────────────────────────────────────────────────────────────┘
Parameter Panel
┌──────────────────────── Параметры сценария ─────────────────────────────────┐
│ Дата тестирования [2026-05-29____________________] │
│ Контрагент [АСК___________________________] │
│ Baseline mode [использовать approved или создать candidate ▼] │
│ Проверять XLSX [✓] │
│ Делать screenshots [✓] │
│ │
│ [Применить] [Сбросить] │
└─────────────────────────────────────────────────────────────────────────────┘
Artifact Preview
┌──────────────────────── Generated draft ────────────────────────────────────┐
│ dashboard_42_test_scenario/ │
│ ├── scenario.yaml ✓ valid │
│ ├── runner.plan.json ✓ valid │
│ ├── xlsx_assertions.py ⚠ needs review │
│ ├── report_template.md ✓ valid │
│ └── baseline_candidates.yaml ⚠ approval required │
│ │
│ [Preview file] [Download draft] [Save to repository] │
└─────────────────────────────────────────────────────────────────────────────┘
Baseline Approval
┌──────────────────────── Baseline approval ──────────────────────────────────┐
│ Metric: Просроченная ДЗ │
│ Filters: Дата=2026-05-29, Контрагент=АСК │
│ Candidate: 1 234 567.89 from Superset API │
│ Existing baseline: none │
│ Reason required: [Initial approved QA baseline________________________] │
│ │
│ [Confirm approval] [Keep draft] [Deny] │
└─────────────────────────────────────────────────────────────────────────────┘
4. Error Experience
Scenario A: Superset Analysis Fails
- System Response: Error card identifies Superset API status and dashboard context.
- Recovery: Retry, switch environment, or continue with manual-only scenario shell.
Scenario B: Unresolved Blockers
- System Response: Save action is disabled for executable artifacts; blockers are grouped by step.
- Recovery: Fill parameter, provide selector hint, convert to human checkpoint, or remove step.
Scenario C: User Leaves Mid-Generation
- System Response: On return,
/agentdisplays recoverable run id and latest draft state. - Recovery: Resume preview, discard draft, or restart analysis.
5. Tone & Voice
- Style: Clear, operational, confidence-aware.
- Terminology: Use "scenario", "draft", "artifact", "baseline", "Superset API", "human checkpoint". Avoid "SQL check" for this feature.
#endregion DashboardScenarioUi.UxReference