5.3 KiB
#region DashboardScenarioUi.DataModel [C:4] [TYPE ADR] [SEMANTICS data-model,ux,scenario,workspace,verification] @BRIEF Agent workspace projection and pipeline verification state models. Two independent state trees — agent-driven and pipeline-driven. @RELATION DEPENDS_ON -> [DashboardScenarioModel.DataModel] @RELATION DEPENDS_ON -> [AgentTestStabilization.DataModel]
Agent Workspace — ScenarioWorkspaceState
Owned by DashboardTesting.WorkspaceModel, composed under AgentChat.Model. ONLY active when the user enters the agent workspace with intent=build_dashboard_test_scenario.
| Atom | Type | Owner/source |
|---|---|---|
| mode | scenario or ordinary chat | UIContext v2 intent |
| scenario | DashboardTestScenario/null | 038 response (via agent) |
| changeRequestContext | ChangeRequestContext/null | authoring input; never guessed by compiler |
| verificationProgram | VerificationProgram/null | 038 content-hashed program preview |
| validation | ScenarioValidationResult/null | 038 response |
| draftPack | DraftPack/null | 038 response |
| selectedPhaseId/selectedStepId | string/null | local navigation |
| parameterDefinitionsDraft | map name → typed definition draft | initialized from scenario ParameterDefinitions; no runtime values |
| parameterDefinitionErrors | map name → message code | local validation |
| baselineSummary | approved/stale/missing/candidate groups | 037 response |
| selectedArtifactId | UUID/null | local preview |
| preview | loading/content/error | 036 opaque preview |
| domainError | typed code/detail/recovery | API result |
| agentRun | AgentRuns.Model reference | 036 authority |
| evidence | ScreenshotEvidence[] | 036 evidence_captured events |
| vlmFindings | VlmFinding[] | 038 step outputs or adapter results |
| selectedEvidenceId | UUID/null | local selection in EvidencePanel |
| selectedFindingId | string/null | local selection; highlights region on screenshot |
| findingDispositions | map finding_id → disposition + comment | local pending changes |
Agent Workspace — Derived Values
- workspaceState from intent, AgentRun status/stage, scenario, draft pack, and domain error;
- canApplyParameterDefinitions when changed definition drafts are valid;
- canGenerateDraft when scenario exists and authoring blockers (for example selectors/baselines) are resolved; runtime ParameterBindings are collected only in 045 launch preflight;
- canRequestSave when draftPack.status=save_eligible, artifacts valid, and no blockers;
- baselineApprovalReady when candidate selected and non-blank reason;
- progress stages from AgentRunModel only.
Agent Workspace — Invariants
- Domain status never derives from assistant text.
- Graph/validation are server-authoritative immutable revisions.
- ParameterDefinition edits cannot modify undeclared fields or create runtime bindings.
- Durable actions delegate to 036 delegated-action policy; only actions requiring authorization render a pending ActionApprovalGate.
- Download/preview never set persisted state.
- SQL is shown only as a read-only validated SqlEvidenceSpec preview (template hash, relation/connection refs, limits, output schema and validation); neither chat nor runtime controls can rewrite it.
- Switching run/context resets all scenario-local selections and drafts.
- Evidence and findings are bound to the owning AgentRun and never cross run boundaries.
- Finding disposition is recorded once per finding; replay of same disposition is idempotent.
- WorkspaceModel is instantiated for analyst-opened agent intents (creation, investigation, revalidation, remediation, load analysis) and MUST NOT activate for pipeline-triggered runs.
Pipeline Views — ReleaseVerificationState
Separate state tree. Lives on deployment/release/dashboard pages. Does NOT require AgentRun, WorkspaceModel, or agent conversation. Populated directly from DashboardTesting.ApiClient fetching VerificationRun (037) data.
| Atom | Type | Owner/source |
|---|---|---|
| verificationRuns | VerificationRun[] | 037 response (via ApiClient) |
| selectedRunId | UUID/null | local selection |
| structureDiff | StructureDiff/null | 037 response for selected run |
| metricResults | ComparisonResult[] | 037 response for selected run |
| overallStatus | pass/warn/fail/blocked/null | derived from selected run |
| structureDispositions | map change.target → confirmed/dismissed | local audit-only state |
Pipeline Views — Derived Values
- latestRun: most recent VerificationRun for the dashboard (for badge);
- runsByTrigger: grouped by trigger for history view;
- canValidate: true when overallStatus != fail and no unresolved CRITICAL structure changes;
- canApproveRelease: true when VerificationRun for release_create trigger has overallStatus = pass.
Pipeline Views — Invariants
- No AgentRun, no WorkspaceModel, no conversation dependency.
- VerificationRun data is read-only projection; disposition buttons record audit state only.
- StructureDiff confirm/dismiss does NOT alter the scenario graph or baseline entries.
- Pipeline views NEVER trigger POST /agent/runs — verification runs are created by backend hooks.
- Badge styling (pass/warn/fail/blocked) always includes icon + text label, never color alone.
- Immutability violation banner occupies full width, uses CRITICAL severity styling, and cannot be dismissed without an investigation ticket.
#endregion DashboardScenarioUi.DataModel