5.1 KiB
Implementation Plan: Dashboard Scenario UI
Branch: 039-dashboard-scenario-ui | Date: 2026-07-13 | Spec: spec.md
Summary
Add a dashboard-level scenario action and a model-first workspace inside /agent. The UI composes 036 run/recovery/gate state, 037 baseline results, and 038 scenario/draft DTOs. Users review a business flow, resolve typed parameters, inspect coverage and draft artifacts, then explicitly save or approve.
Technical Context
Language/Version: TypeScript, Svelte 5.56 runes, SvelteKit, Tailwind semantic tokens
Dependencies: existing fetchApi, AgentChat model family, $lib/ui, i18n, Vitest 4, Testing Library, Playwright
Storage: no frontend persistence of authoritative domain data; run id may be route/session recovery hint only
Testing: L1 model no-render, L2 component UX, Playwright browser flow
Performance Goals: parameter readiness projection under 200ms; 15–100 steps usable at 1366px; no duplicate stream re-render
Constraints: no Svelte 4 syntax, no component-owned business state, no prose parsing, no raw colors, no runtime SQL copy/action; validated SqlEvidenceSpec is preview-only authoring content.
Scale: 100 steps, 50 params, 50 drafts, 19 coverage rows
Constitution Check
| Principle | Result |
|---|---|
| Semantic contracts | PASS — model/actions and C3+ components contracted |
| Decision memory | PASS — composed model, entry action, accessible graph/table, no tool picker |
| Module discipline | PASS — model plus small domain components; decomposition threshold enforced |
| RBAC | PASS — entry/start/save/approve responses render distinct permission state |
| Svelte 5 | PASS — .svelte.ts model, $state/$derived/$effect only where appropriate |
| TDD | PASS — L1 model before L2 components before E2E |
| Attention | PASS — DashboardTesting.* hierarchy and shared dashboard-testing semantics |
Project Structure
frontend/src/
├── lib/api/dashboard-testing.ts
├── lib/models/DashboardScenarioWorkspaceModel.svelte.ts
├── lib/models/__tests__/DashboardScenarioWorkspaceModel.test.ts
├── lib/components/dashboard-testing/
│ ├── ScenarioWorkspace.svelte
│ ├── ScenarioProgressStrip.svelte
│ ├── ScenarioSummary.svelte
│ ├── ScenarioGraph.svelte
│ ├── ScenarioStepTable.svelte
│ ├── ScenarioCoverage.svelte
│ ├── ParameterPanel.svelte
│ ├── BaselineImpactPanel.svelte
│ ├── ArtifactPreviewPanel.svelte
│ └── __tests__/
├── routes/dashboards/[id]/components/DashboardHeader.svelte
├── routes/agent/+page.svelte
└── lib/i18n/locales/{ru,en}/dashboard-testing.json
Delivery Phases
- Types/API client and model fixtures.
- Dashboard entry/context/RBAC path.
- Workspace model and progress/scenario/coverage views.
- Parameter and baseline resolution.
- Draft preview and reused 036 delegated-action/inline-gate flow.
- Responsive/a11y/E2E/regression gates.
No New Backend Domain Logic
039 may require endpoint wiring fixes but must not implement a second validator, comparison engine, artifact generator, approval store, or run lifecycle. Those remain 036–038.
MVP API-Binding & Pipeline-Views Closure (audit 2026-08-07)
Status correction: Компоненты готовы, но факт-чекинг показал: frontend/src/lib/api/dashboard-testing.ts (scenario + verification) не импортируется ни одним модулем; DashboardScenarioWorkspaceModel не делает fetch — данные только через агентские события. Pipeline-компоненты (VerificationStatusBadge, StructureDiffPanel, VerificationHistoryList) существуют, но не привязаны к страницам, а их GET-эндпоинты отсутствуют на backend (037 Gap B). «Validate» на PREPROD не создаёт VerificationRun (037 Gap A).
Closure tasks (tasks.md Phase 9):
- T054 — Bind
WorkspaceModelкdashboard-testing.ts(compile/validate/resolve +setDomainError). - T055 — Автономный evidence/VLM-путь через API-клиент (fallback без агент-стрима).
- T056 — Мок-тест: compile → параметры → recompile → disposition без агента.
- T057 — Привязка pipeline-компонентов к страницам (dashboard hub badge, history, StructureDiff) — зависит от 037 T081.
- T058 — «Verify»-action на PREPROD, POST
/verification-runs— зависит от 037 T080.
Decision point: если продукт сознательно остаётся agent-only для сценариев, зафиксировать в UX-контракте; но pipeline views (AGUI-FR-014..016) всё равно требуют 037 T080/T081 для отображения VerificationRun.
Complexity Tracking
ScenarioWorkspace is decomposed before 400 lines or 40 public model methods. The visual graph must not absorb the accessible step table or parameter logic.