Spaces:
Sleeping
Sleeping
Mentor AMP Frontend commited on
Commit ·
eb48dcc
1
Parent(s): a546a80
Wire mock data workflows and interactive Mentor chat
Browse files- progress.json +53 -3
- src/components/ui/WorkspaceToolbar.tsx +5 -1
- src/context/AppContext.tsx +7 -3
- src/context/context.ts +10 -1
- src/index.css +8 -0
- src/pages/ExecutionScreens.tsx +15 -2
- src/pages/InputScreens.tsx +3 -3
- src/pages/InvestigationScreens.tsx +5 -3
- src/pages/MentorScreens.tsx +24 -5
- src/pages/ResultScreens.tsx +4 -4
- src/types.ts +1 -1
progress.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
{
|
| 2 |
"project": "Mentor AMP Volt frontend",
|
| 3 |
"space": "Samfredoly/jor",
|
| 4 |
-
"lastUpdated": "2026-09-28T19:
|
| 5 |
-
"currentMilestone": "functionality-
|
| 6 |
"milestones": [
|
| 7 |
{
|
| 8 |
"id": "foundation",
|
|
@@ -167,6 +167,33 @@
|
|
| 167 |
"remainingNextBatch": [
|
| 168 |
"Backend persistence and real compute integrations, if later authorized"
|
| 169 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 170 |
}
|
| 171 |
],
|
| 172 |
"structure": {
|
|
@@ -249,7 +276,7 @@
|
|
| 249 |
"anchorElements": 0,
|
| 250 |
"hrefAttributes": 0
|
| 251 |
},
|
| 252 |
-
"status": "
|
| 253 |
"p0Findings": 5,
|
| 254 |
"p1Findings": 8,
|
| 255 |
"p2Findings": 6,
|
|
@@ -262,6 +289,29 @@
|
|
| 262 |
"Prototype persistence and real downloads",
|
| 263 |
"Remove legacy modules and add route coverage tests",
|
| 264 |
"Accessibility and responsive QA"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
]
|
| 266 |
}
|
| 267 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"project": "Mentor AMP Volt frontend",
|
| 3 |
"space": "Samfredoly/jor",
|
| 4 |
+
"lastUpdated": "2026-09-28T19:12:55Z",
|
| 5 |
+
"currentMilestone": "mock-functionality-workflows-complete",
|
| 6 |
"milestones": [
|
| 7 |
{
|
| 8 |
"id": "foundation",
|
|
|
|
| 167 |
"remainingNextBatch": [
|
| 168 |
"Backend persistence and real compute integrations, if later authorized"
|
| 169 |
]
|
| 170 |
+
},
|
| 171 |
+
{
|
| 172 |
+
"id": "mock-functionality-workflows-complete",
|
| 173 |
+
"status": "complete",
|
| 174 |
+
"implemented": [
|
| 175 |
+
"Interactive Mentor chat box with mock evidence-backed responses",
|
| 176 |
+
"Results Explorer Trace this value \u2192 Trace Explorer",
|
| 177 |
+
"Results Explorer Add to Scratchpad \u2192 Scratchpad context",
|
| 178 |
+
"Investigate Compare with another run \u2192 selectable mock run pair",
|
| 179 |
+
"Investigate Ask Mentor about this branch \u2192 Mentor workspace",
|
| 180 |
+
"Run monitor pause/resume/cancel/log drawer/recovery transitions",
|
| 181 |
+
"Validation Center issue rows \u2192 targeted input detail views",
|
| 182 |
+
"Shared workspace mock search submit and filter/view state feedback",
|
| 183 |
+
"Typed investigation intent handoff through AppContext"
|
| 184 |
+
],
|
| 185 |
+
"verified": [
|
| 186 |
+
"Browser: Results Trace this value opened Investigate Trace Explorer",
|
| 187 |
+
"Browser: Investigate Compare with another run opened selectable run list",
|
| 188 |
+
"Browser: Investigate Ask Mentor opened Mentor workspace",
|
| 189 |
+
"Browser: Mentor message submitted and mock response with citations rendered",
|
| 190 |
+
"Build passed",
|
| 191 |
+
"Lint passed with zero warnings and errors"
|
| 192 |
+
],
|
| 193 |
+
"remaining": [
|
| 194 |
+
"Persist mock search/filter selections into collection-level filtering across every library",
|
| 195 |
+
"Real file downloads and backend persistence when backend scope is authorized"
|
| 196 |
+
]
|
| 197 |
}
|
| 198 |
],
|
| 199 |
"structure": {
|
|
|
|
| 276 |
"anchorElements": 0,
|
| 277 |
"hrefAttributes": 0
|
| 278 |
},
|
| 279 |
+
"status": "mock-workflows-wired",
|
| 280 |
"p0Findings": 5,
|
| 281 |
"p1Findings": 8,
|
| 282 |
"p2Findings": 6,
|
|
|
|
| 289 |
"Prototype persistence and real downloads",
|
| 290 |
"Remove legacy modules and add route coverage tests",
|
| 291 |
"Accessibility and responsive QA"
|
| 292 |
+
],
|
| 293 |
+
"implementedNow": [
|
| 294 |
+
"Interactive Mentor chat box with mock evidence-backed responses",
|
| 295 |
+
"Results Explorer Trace this value \u2192 Trace Explorer",
|
| 296 |
+
"Results Explorer Add to Scratchpad \u2192 Scratchpad context",
|
| 297 |
+
"Investigate Compare with another run \u2192 selectable mock run pair",
|
| 298 |
+
"Investigate Ask Mentor about this branch \u2192 Mentor workspace",
|
| 299 |
+
"Run monitor pause/resume/cancel/log drawer/recovery transitions",
|
| 300 |
+
"Validation Center issue rows \u2192 targeted input detail views",
|
| 301 |
+
"Shared workspace mock search submit and filter/view state feedback",
|
| 302 |
+
"Typed investigation intent handoff through AppContext"
|
| 303 |
+
],
|
| 304 |
+
"verifiedNow": [
|
| 305 |
+
"Browser: Results Trace this value opened Investigate Trace Explorer",
|
| 306 |
+
"Browser: Investigate Compare with another run opened selectable run list",
|
| 307 |
+
"Browser: Investigate Ask Mentor opened Mentor workspace",
|
| 308 |
+
"Browser: Mentor message submitted and mock response with citations rendered",
|
| 309 |
+
"Build passed",
|
| 310 |
+
"Lint passed with zero warnings and errors"
|
| 311 |
+
],
|
| 312 |
+
"remainingNextImplementation": [
|
| 313 |
+
"Persist mock search/filter selections into collection-level filtering across every library",
|
| 314 |
+
"Real file downloads and backend persistence when backend scope is authorized"
|
| 315 |
]
|
| 316 |
}
|
| 317 |
}
|
src/components/ui/WorkspaceToolbar.tsx
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
import { ChevronDown, Filter, Plus, Search, SlidersHorizontal, Upload } from 'lucide-react'
|
| 2 |
import type { ReactNode } from 'react'
|
|
|
|
| 3 |
import { useApp } from '../../context/useApp'
|
| 4 |
|
| 5 |
export function WorkspaceToolbar({ searchPlaceholder, action, actionIcon = <Plus size={15} />, onAction }: { searchPlaceholder: string; action: string; actionIcon?: ReactNode; onAction?: () => void }) {
|
| 6 |
const { notify } = useApp()
|
| 7 |
-
|
|
|
|
|
|
|
|
|
|
| 8 |
}
|
| 9 |
|
| 10 |
export function ImportToolbar({ searchPlaceholder, action = 'Import input' }: { searchPlaceholder: string; action?: string }) {
|
|
|
|
| 1 |
import { ChevronDown, Filter, Plus, Search, SlidersHorizontal, Upload } from 'lucide-react'
|
| 2 |
import type { ReactNode } from 'react'
|
| 3 |
+
import { useState } from 'react'
|
| 4 |
import { useApp } from '../../context/useApp'
|
| 5 |
|
| 6 |
export function WorkspaceToolbar({ searchPlaceholder, action, actionIcon = <Plus size={15} />, onAction }: { searchPlaceholder: string; action: string; actionIcon?: ReactNode; onAction?: () => void }) {
|
| 7 |
const { notify } = useApp()
|
| 8 |
+
const [query, setQuery] = useState('')
|
| 9 |
+
const [tool, setTool] = useState<'filters' | 'view' | null>(null)
|
| 10 |
+
const submitSearch = () => { if (query.trim()) notify(`Mock search applied: ${query.trim()}`) }
|
| 11 |
+
return <div className="filter-bar panel"><div className="search-field"><Search size={16} /><input value={query} onChange={event => setQuery(event.target.value)} onKeyDown={event => { if (event.key === 'Enter') submitSearch() }} aria-label={searchPlaceholder} placeholder={searchPlaceholder} /><button className="toolbar-search-submit" aria-label="Apply search" onClick={submitSearch}>↵</button></div><button className={`filter-chip ${tool === 'filters' ? 'filter-chip-active' : ''}`} onClick={() => { setTool(tool === 'filters' ? null : 'filters'); notify('Mock filters ready') }}><Filter size={14} />Filters <ChevronDown size={14} /></button><button className={`filter-chip ${tool === 'view' ? 'filter-chip-active' : ''}`} onClick={() => { setTool(tool === 'view' ? null : 'view'); notify('Mock view options ready') }}><SlidersHorizontal size={14} />View <ChevronDown size={14} /></button>{tool && <span className="toolbar-state">{tool === 'filters' ? 'Status: all · Owner: all' : 'View: list · Sort: updated'}</span>}<button className="button button-primary" onClick={() => onAction ? onAction() : notify(`${action} flow opened`)}>{actionIcon}{action}</button></div>
|
| 12 |
}
|
| 13 |
|
| 14 |
export function ImportToolbar({ searchPlaceholder, action = 'Import input' }: { searchPlaceholder: string; action?: string }) {
|
src/context/AppContext.tsx
CHANGED
|
@@ -1,10 +1,14 @@
|
|
| 1 |
import { useCallback, useMemo, useState, type ReactNode } from 'react'
|
| 2 |
-
import { AppContext } from './context'
|
|
|
|
| 3 |
|
| 4 |
export function AppProvider({ children }: { children: ReactNode }) {
|
| 5 |
-
const [activeScreen, setActiveScreen] = useState<
|
| 6 |
const [toast, setToast] = useState('')
|
|
|
|
| 7 |
const notify = useCallback((message: string) => { setToast(message); window.setTimeout(() => setToast(''), 2600) }, [])
|
| 8 |
-
const
|
|
|
|
|
|
|
| 9 |
return <AppContext.Provider value={value}>{children}</AppContext.Provider>
|
| 10 |
}
|
|
|
|
| 1 |
import { useCallback, useMemo, useState, type ReactNode } from 'react'
|
| 2 |
+
import { AppContext, type InvestigationIntent } from './context'
|
| 3 |
+
import type { ScreenName } from '../types'
|
| 4 |
|
| 5 |
export function AppProvider({ children }: { children: ReactNode }) {
|
| 6 |
+
const [activeScreen, setActiveScreen] = useState<ScreenName>('Dashboard')
|
| 7 |
const [toast, setToast] = useState('')
|
| 8 |
+
const [investigationIntent, setInvestigationIntent] = useState<InvestigationIntent>(null)
|
| 9 |
const notify = useCallback((message: string) => { setToast(message); window.setTimeout(() => setToast(''), 2600) }, [])
|
| 10 |
+
const openInvestigation = useCallback((intent: NonNullable<InvestigationIntent>) => { setInvestigationIntent(intent); setActiveScreen(intent.kind === 'mentor' ? 'Mentor' : 'Investigate') }, [])
|
| 11 |
+
const clearInvestigationIntent = useCallback(() => setInvestigationIntent(null), [])
|
| 12 |
+
const value = useMemo(() => ({ activeScreen, setActiveScreen, toast, notify, investigationIntent, openInvestigation, clearInvestigationIntent }), [activeScreen, toast, notify, investigationIntent, openInvestigation, clearInvestigationIntent])
|
| 13 |
return <AppContext.Provider value={value}>{children}</AppContext.Provider>
|
| 14 |
}
|
src/context/context.ts
CHANGED
|
@@ -1,5 +1,14 @@
|
|
| 1 |
import { createContext } from 'react'
|
| 2 |
import type { ScreenName } from '../types'
|
| 3 |
|
| 4 |
-
export type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
export const AppContext = createContext<AppContextValue | undefined>(undefined)
|
|
|
|
| 1 |
import { createContext } from 'react'
|
| 2 |
import type { ScreenName } from '../types'
|
| 3 |
|
| 4 |
+
export type InvestigationIntent = { kind: 'trace' | 'compare' | 'mentor' | 'scratchpad'; runId?: string; metric?: string; question?: string } | null
|
| 5 |
+
export type AppContextValue = {
|
| 6 |
+
activeScreen: ScreenName
|
| 7 |
+
setActiveScreen: (screen: ScreenName) => void
|
| 8 |
+
toast: string
|
| 9 |
+
notify: (message: string) => void
|
| 10 |
+
investigationIntent: InvestigationIntent
|
| 11 |
+
openInvestigation: (intent: NonNullable<InvestigationIntent>) => void
|
| 12 |
+
clearInvestigationIntent: () => void
|
| 13 |
+
}
|
| 14 |
export const AppContext = createContext<AppContextValue | undefined>(undefined)
|
src/index.css
CHANGED
|
@@ -85,3 +85,11 @@ html, body, #root, .app-shell { overflow-x: hidden; }
|
|
| 85 |
/* Admin / Settings */
|
| 86 |
.settings-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.7fr); gap:12px; }.settings-list { padding:8px 16px; }.settings-row { display:grid; width:100%; grid-template-columns:35px 1fr 18px; gap:10px; align-items:center; min-height:73px; border:0; border-top:1px solid #edf0f1; background:transparent; color:#778390; text-align:left; }.settings-row:hover { background:#f7fbe9; }.settings-row > span:nth-child(2) { display:flex; flex-direction:column; gap:5px; }.settings-row b { color:#2b3c51; font-size:11px; }.settings-row small { color:#87929e; font-size:9px; }.settings-icon { display:grid; height:30px; width:30px; place-items:center; border-radius:7px; background:#eff8da; color:#669323; }.settings-icon-dark { background:#16231b; color:#b9ee51; }.settings-status { height:fit-content; }.settings-status > .settings-icon { margin-bottom:10px; }
|
| 87 |
@media (max-width:900px) { .settings-grid { grid-template-columns:1fr; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
/* Admin / Settings */
|
| 86 |
.settings-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(280px,.7fr); gap:12px; }.settings-list { padding:8px 16px; }.settings-row { display:grid; width:100%; grid-template-columns:35px 1fr 18px; gap:10px; align-items:center; min-height:73px; border:0; border-top:1px solid #edf0f1; background:transparent; color:#778390; text-align:left; }.settings-row:hover { background:#f7fbe9; }.settings-row > span:nth-child(2) { display:flex; flex-direction:column; gap:5px; }.settings-row b { color:#2b3c51; font-size:11px; }.settings-row small { color:#87929e; font-size:9px; }.settings-icon { display:grid; height:30px; width:30px; place-items:center; border-radius:7px; background:#eff8da; color:#669323; }.settings-icon-dark { background:#16231b; color:#b9ee51; }.settings-status { height:fit-content; }.settings-status > .settings-icon { margin-bottom:10px; }
|
| 87 |
@media (max-width:900px) { .settings-grid { grid-template-columns:1fr; } }
|
| 88 |
+
|
| 89 |
+
/* Interactive Mentor mock chat */
|
| 90 |
+
.mentor-chat { margin:16px 0; border:1px solid #dfe8e8; border-radius:9px; background:#fbfdfb; overflow:hidden; }.mentor-chat-head { display:flex; align-items:center; justify-content:space-between; border-bottom:1px solid #e7eded; padding:11px 13px; }.mentor-chat-head > span { display:flex; align-items:center; gap:7px; color:#527b1d; }.mentor-chat-head b { color:#2b3d51; font-size:10px; }.mentor-chat-head small { color:#87929e; font-size:8px; }.mentor-messages { display:flex; max-height:310px; flex-direction:column; gap:10px; overflow:auto; padding:13px; }.mentor-message { display:flex; max-width:92%; align-items:flex-start; gap:8px; }.mentor-message-user { align-self:flex-end; flex-direction:row-reverse; }.mentor-message-avatar { display:grid; flex:none; height:25px; width:25px; place-items:center; border-radius:50%; background:#eaf5d4; color:#669223; }.mentor-message-user .mentor-message-avatar { background:#17241b; color:#c1f35b; }.mentor-message p { margin:0; border-radius:8px; padding:9px 11px; background:#f0f6ed; color:#4f6072; font-size:10px; line-height:1.5; }.mentor-message-user p { background:#e8f5bd; color:#3f5d18; }.mentor-message-citations { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }.mentor-message-citations span { display:inline-flex; align-items:center; gap:3px; color:#6f8e2c; font-size:8px; }.mentor-prompts { display:flex; flex-wrap:wrap; gap:5px; padding:0 13px 10px; }.mentor-prompts button { border:1px solid #dce8c6; border-radius:15px; background:#f4fbdc; padding:6px 9px; color:#668621; font-size:8px; }.mentor-composer { display:flex; gap:7px; border-top:1px solid #e7eded; padding:10px; background:#fff; }.mentor-composer input { min-width:0; flex:1; border:1px solid #dce5e6; border-radius:7px; outline:none; padding:9px 10px; color:#536274; font:10px inherit; }.mentor-composer input:focus { border-color:#aee64c; box-shadow:0 0 0 2px #eff8d9; }.mentor-composer button { display:grid; height:34px; width:36px; place-items:center; border:0; border-radius:7px; background:#a9e942; color:#2f500e; }
|
| 91 |
+
|
| 92 |
+
/* Mock execution controls and investigation run comparison */
|
| 93 |
+
.execution-log-drawer { display:flex; flex-direction:column; gap:6px; margin:12px 0; border:1px solid #e2ebde; border-radius:7px; background:#f5faef; padding:10px; color:#64775f; font-size:9px; }.execution-log-drawer span { display:flex; align-items:center; gap:6px; }.execution-log-drawer svg { color:#75aa2e; }.monitor-controls button:disabled { cursor:not-allowed; opacity:.55; }.compare-run-list { display:flex; flex-direction:column; gap:6px; padding:10px; }.compare-run-list button { display:grid; grid-template-columns:1fr auto 18px; gap:14px; align-items:center; border:1px solid #edf0f1; border-radius:8px; background:#fff; padding:14px; color:#6e7b89; text-align:left; }.compare-run-list button:hover, .compare-run-list .compare-run-selected { border-color:#b4e95c; background:#f2fbd9; }.compare-run-list button span { display:flex; flex-direction:column; gap:5px; }.compare-run-list button b { color:#314158; font-size:11px; }.compare-run-list button small { font-size:9px; }.compare-run-list button strong { color:#2f4d13; font-size:12px; }
|
| 94 |
+
|
| 95 |
+
.toolbar-search-submit { border:0; background:transparent; color:#85919b; cursor:pointer; font-size:13px; }.filter-chip-active { border-color:#b8e967 !important; background:#f0fbd7 !important; color:#608522 !important; }.toolbar-state { white-space:nowrap; border-radius:5px; background:#f4f7f3; padding:6px 8px; color:#718087; font-size:8px; }
|
src/pages/ExecutionScreens.tsx
CHANGED
|
@@ -7,12 +7,25 @@ import { WorkspaceToolbar } from '../components/ui/WorkspaceToolbar'
|
|
| 7 |
type RunView = 'library' | 'create' | 'monitor' | 'recovery'
|
| 8 |
const runSets = [['GAAP Reserve Pack','2 Projection Sets','Base · Low rate · High rate','2 reports','Running'],['Monthly VM-21 Pack','1 Projection Set','VM-21 deterministic','1 report','Completed'],['Pricing Sensitivity Pack','3 Projection Sets','12 sensitivities','0 reports','Stale']]
|
| 9 |
|
| 10 |
-
export function RunSetsPage() {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
function RunSetEditor({ onBack, onCreate }: { onBack: () => void; onCreate: () => void }) { const { notify } = useApp(); return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Run Set Library</button><div className="panel detail-workspace-head"><div><span className="eyebrow">Run Set · create / edit</span><h2 className="section-title">GAAP Reserve Pack</h2><p className="muted">Select Projection Sets, scenario ranges, report definitions, and trace scope before submission.</p></div><StatusBadge status="Validated" /></div><div className="run-editor-grid"><div className="panel"><EditorSection title="Projection Sets" icon={<Workflow size={17} />} rows={['MYGA GAAP Reserve · v1.0','MYGA Low Rate Sensitivity · v0.8']} /><EditorSection title="Scenario range" icon={<GitCompare size={17} />} rows={['Base scenario','Low Interest Rate','High interest']} /><EditorSection title="Reports and capture" icon={<FileText size={17} />} rows={['GAAP Reserve — Executive Summary','Trace/debug capture enabled']} /></div><aside className="panel"><span className="eyebrow">Immutable snapshot</span><h2 className="section-title">Preflight</h2><div className="preflight-list"><span><Check size={15} />Projection compatibility</span><span><Check size={15} />Input versions pinned</span><span><Check size={15} />Formula lineage captured</span><span><Check size={15} />Report attachment valid</span></div><button className="button button-primary full-button" onClick={onCreate}><Play size={15} />Submit to Execution Center</button><button className="button button-secondary full-button" onClick={() => notify('Run Set saved as draft')}>Save draft</button></aside></div></div> }
|
| 13 |
|
| 14 |
function EditorSection({ title, icon, rows }: { title: string; icon: React.ReactNode; rows: string[] }) { return <section className="editor-section"><div><span className="editor-section-icon">{icon}</span><b>{title}</b><button><Plus size={14} /></button></div>{rows.map(row => <label key={row}><input type="checkbox" defaultChecked />{row}<Check size={14} /></label>)}</section> }
|
| 15 |
|
| 16 |
-
function RunMonitor({
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
function RunRecovery({ onBack, onRetry }: { onBack: () => void; onRetry: () => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to monitor</button><div className="panel recovery-hero"><AlertTriangle size={22} /><div><span className="eyebrow">Execution recovery</span><h2 className="section-title">One job failed during report capture</h2><p className="muted">The immutable Run Set snapshot is preserved. Retry can resume from the failed job without mutating completed outputs.</p></div><StatusBadge status="Needs review" /></div><div className="recovery-grid"><div className="panel"><h2 className="section-title">Failure details</h2><div className="failure-code"><b>REPORT_CAPTURE_TIMEOUT</b><small>Executive Summary · Report definition v2.1</small><code>Worker exceeded 90s response window while resolving 3 scenario dimensions.</code></div><div className="preflight-list"><span><Check size={15} />Completed projection outputs preserved</span><span><Check size={15} />Source versions remain pinned</span><span><AlertTriangle size={15} />Report artifact must be regenerated</span></div></div><aside className="panel"><h2 className="section-title">Recovery actions</h2><button className="button button-primary full-button" onClick={onRetry}><RotateCcw size={15} />Retry failed job</button><button className="button button-secondary full-button"><RefreshCw size={15} />Refresh report definition</button><button className="button button-secondary full-button"><FileText size={15} />Open execution logs</button></aside></div></div> }
|
|
|
|
| 7 |
type RunView = 'library' | 'create' | 'monitor' | 'recovery'
|
| 8 |
const runSets = [['GAAP Reserve Pack','2 Projection Sets','Base · Low rate · High rate','2 reports','Running'],['Monthly VM-21 Pack','1 Projection Set','VM-21 deterministic','1 report','Completed'],['Pricing Sensitivity Pack','3 Projection Sets','12 sensitivities','0 reports','Stale']]
|
| 9 |
|
| 10 |
+
export function RunSetsPage() {
|
| 11 |
+
const { notify } = useApp()
|
| 12 |
+
const [view, setView] = useState<RunView>('library')
|
| 13 |
+
const [executionStatus, setExecutionStatus] = useState<'Running' | 'Paused' | 'Cancelled'>('Running')
|
| 14 |
+
if (view === 'create') return <RunSetEditor onBack={() => setView('library')} onCreate={() => { setExecutionStatus('Running'); setView('monitor'); notify('Run Set submitted to Execution Center') }} />
|
| 15 |
+
if (view === 'monitor') return <RunMonitor status={executionStatus} onBack={() => setView('library')} onRecovery={() => setView('recovery')} onPause={() => { setExecutionStatus('Paused'); notify('Run paused at job 14 of 22') }} onResume={() => { setExecutionStatus('Running'); notify('Run resumed from checkpoint') }} onCancel={() => { setExecutionStatus('Cancelled'); notify('Run cancelled; completed outputs preserved') }} />
|
| 16 |
+
if (view === 'recovery') return <RunRecovery onBack={() => setView('monitor')} onRetry={() => { setExecutionStatus('Running'); setView('monitor'); notify('Retry queued from failed report job') }} />
|
| 17 |
+
return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search Run Sets, runs, scenarios..." action="New Run Set" actionIcon={<Plus size={15} />} onAction={() => setView('create')} /><div className="execution-subnav"><button className="execution-subnav-active">Run Set Library</button><button onClick={() => setView('monitor')}>Execution Monitor</button><button onClick={() => setView('recovery')}>Recovery</button></div><div className="run-library-summary"><span><small>Run Sets</small><b>18</b></span><span><small>Ready to run</small><b>11</b></span><span><small>Active executions</small><b>4</b></span><span><small>Needs recovery</small><b>1</b></span></div><div className="panel table-panel"><div className="panel-title-row"><div><span className="eyebrow">Execution lifecycle</span><h2 className="section-title">Run Set Library</h2><p className="muted">Projection Sets become immutable execution snapshots only when a Run Set is submitted.</p></div><StatusBadge status="Validated" /></div><div className="run-set-table">{runSets.map(([name,sets,scenarios,reports,status]) => <button className="run-set-row" key={name} onClick={() => status === 'Running' ? setView('monitor') : notify(`${name} detail opened with pinned inputs and outputs`)}><b>{name}</b><span>{sets}</span><span>{scenarios}</span><span>{reports}</span><span><StatusBadge status={status as 'Running' | 'Completed' | 'Stale'} /></span><ArrowRight size={16} /></button>)}</div></div></div>
|
| 18 |
+
}
|
| 19 |
|
| 20 |
function RunSetEditor({ onBack, onCreate }: { onBack: () => void; onCreate: () => void }) { const { notify } = useApp(); return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Run Set Library</button><div className="panel detail-workspace-head"><div><span className="eyebrow">Run Set · create / edit</span><h2 className="section-title">GAAP Reserve Pack</h2><p className="muted">Select Projection Sets, scenario ranges, report definitions, and trace scope before submission.</p></div><StatusBadge status="Validated" /></div><div className="run-editor-grid"><div className="panel"><EditorSection title="Projection Sets" icon={<Workflow size={17} />} rows={['MYGA GAAP Reserve · v1.0','MYGA Low Rate Sensitivity · v0.8']} /><EditorSection title="Scenario range" icon={<GitCompare size={17} />} rows={['Base scenario','Low Interest Rate','High interest']} /><EditorSection title="Reports and capture" icon={<FileText size={17} />} rows={['GAAP Reserve — Executive Summary','Trace/debug capture enabled']} /></div><aside className="panel"><span className="eyebrow">Immutable snapshot</span><h2 className="section-title">Preflight</h2><div className="preflight-list"><span><Check size={15} />Projection compatibility</span><span><Check size={15} />Input versions pinned</span><span><Check size={15} />Formula lineage captured</span><span><Check size={15} />Report attachment valid</span></div><button className="button button-primary full-button" onClick={onCreate}><Play size={15} />Submit to Execution Center</button><button className="button button-secondary full-button" onClick={() => notify('Run Set saved as draft')}>Save draft</button></aside></div></div> }
|
| 21 |
|
| 22 |
function EditorSection({ title, icon, rows }: { title: string; icon: React.ReactNode; rows: string[] }) { return <section className="editor-section"><div><span className="editor-section-icon">{icon}</span><b>{title}</b><button><Plus size={14} /></button></div>{rows.map(row => <label key={row}><input type="checkbox" defaultChecked />{row}<Check size={14} /></label>)}</section> }
|
| 23 |
|
| 24 |
+
function RunMonitor({ status, onBack, onRecovery, onPause, onResume, onCancel }: { status: 'Running' | 'Paused' | 'Cancelled'; onBack: () => void; onRecovery: () => void; onPause: () => void; onResume: () => void; onCancel: () => void }) {
|
| 25 |
+
const { notify } = useApp()
|
| 26 |
+
const [logsOpen, setLogsOpen] = useState(false)
|
| 27 |
+
const progress = status === 'Cancelled' ? 63 : status === 'Paused' ? 63 : 71
|
| 28 |
+
return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Run Set Library</button><div className="panel monitor-hero"><div><span className="eyebrow">Execution Center · GAAP Reserve Pack</span><h2 className="section-title">Run monitor</h2><p className="muted">Immutable snapshot JR-20261231-001 · started 09:42 AM</p></div><StatusBadge status={status === 'Cancelled' ? 'Needs review' : status} /></div><div className="monitor-grid"><div className="panel"><div className="panel-title-row"><h2 className="section-title">Workload progress</h2><button className="view-all" onClick={() => setLogsOpen(!logsOpen)}><FileText size={14} />{logsOpen ? 'Hide logs' : 'Logs'}</button></div><div className="monitor-progress"><span style={{ width: `${progress}%` }} /></div><div className="progress-meta"><span>{progress}% · {status === 'Cancelled' ? '14' : status === 'Paused' ? '14' : '16'} of 22 jobs complete</span><b>{status === 'Running' ? 'ETA 03:18' : status}</b></div>{logsOpen && <div className="execution-log-drawer"><span><Check size={13} />09:42:11 · Snapshot pinned</span><span><Check size={13} />09:43:02 · Input compatibility passed</span><span><Clock3 size={13} />09:45:30 · Report capture queued</span></div>}<div className="job-list">{['MYGA GAAP Reserve · Base','MYGA GAAP Reserve · Low rate','MYGA Low Rate Sensitivity · Base','Report capture · Executive Summary'].map((job,index) => <div key={job}><span>{index < 2 ? <Check size={15} /> : <Clock3 size={15} />}</span><b>{job}</b><small>{status === 'Cancelled' && index > 1 ? 'Cancelled' : index < 2 ? 'Completed' : index === 2 ? status : 'Queued'}</small></div>)}</div></div><aside className="panel"><h2 className="section-title">Compute and controls</h2><div className="compute-options"><span className="compute-selected"><Cpu size={17} /><b>GPU</b><small>NVIDIA A10G</small></span><span><Server size={17} /><b>CPU</b><small>64 vCPU</small></span></div><div className="monitor-controls">{status === 'Running' ? <button onClick={onPause}><Pause size={15} />Pause</button> : status === 'Paused' ? <button onClick={onResume}><Play size={15} />Resume</button> : <button onClick={() => notify('Cancelled run is read-only')}><StopCircle size={15} />Cancelled</button>}<button onClick={onCancel} disabled={status === 'Cancelled'}><StopCircle size={15} />Cancel</button><button onClick={onRecovery}><AlertTriangle size={15} />Recovery</button></div></aside></div></div>
|
| 29 |
+
}
|
| 30 |
|
| 31 |
function RunRecovery({ onBack, onRetry }: { onBack: () => void; onRetry: () => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to monitor</button><div className="panel recovery-hero"><AlertTriangle size={22} /><div><span className="eyebrow">Execution recovery</span><h2 className="section-title">One job failed during report capture</h2><p className="muted">The immutable Run Set snapshot is preserved. Retry can resume from the failed job without mutating completed outputs.</p></div><StatusBadge status="Needs review" /></div><div className="recovery-grid"><div className="panel"><h2 className="section-title">Failure details</h2><div className="failure-code"><b>REPORT_CAPTURE_TIMEOUT</b><small>Executive Summary · Report definition v2.1</small><code>Worker exceeded 90s response window while resolving 3 scenario dimensions.</code></div><div className="preflight-list"><span><Check size={15} />Completed projection outputs preserved</span><span><Check size={15} />Source versions remain pinned</span><span><AlertTriangle size={15} />Report artifact must be regenerated</span></div></div><aside className="panel"><h2 className="section-title">Recovery actions</h2><button className="button button-primary full-button" onClick={onRetry}><RotateCcw size={15} />Retry failed job</button><button className="button button-secondary full-button"><RefreshCw size={15} />Refresh report definition</button><button className="button button-secondary full-button"><FileText size={15} />Open execution logs</button></aside></div></div> }
|
src/pages/InputScreens.tsx
CHANGED
|
@@ -8,10 +8,10 @@ import { WorkspaceToolbar } from '../components/ui/WorkspaceToolbar'
|
|
| 8 |
type InputView = 'library' | 'liability' | 'asset' | 'assumptions' | 'factors' | 'projection' | 'validation'
|
| 9 |
const inputRows = [['Liability Inforce','MYGA liability file','v2026.12','24,810 records','Validated'],['Asset Inforce','MYGA asset holdings','v2026.11','8,402 records','Validated'],['Assumption Tables','MYGA reserve assumptions','v3.2','18 dimensions','Validated'],['Factor Tables','Surrender and mortality factors','v1.8','42,116 cells','Needs review'],['Projection Inputs','Q4 valuation controls','v2026.12','26 fields','Validated']]
|
| 10 |
|
| 11 |
-
export function InputLibraryPage() { const [view, setView] = useState<InputView>('library'); const select = (next: InputView) => setView(next); if (view !== 'library') return <InputDetailView view={view} onBack={() => select('library')} />; return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search input libraries, tables, mappings..." action="Import input" actionIcon={<Upload size={15} />} /><div className="input-subnav">{[['library','Input Library'],['liability','Liability Inforce'],['asset','Asset Inforce'],['assumptions','Assumption Tables'],['factors','Factor Tables'],['projection','Projection Inputs'],['validation','Validation Center']].map(([key,label]) => <button className={view === key ? 'input-subnav-active' : ''} key={key} onClick={() => select(key as InputView)}>{label}</button>)}</div><div className="model-summary-grid"><SummaryTile icon={<Database size={18} />} label="Input objects" value="24" tone="dark" /><SummaryTile icon={<Check size={18} />} label="Validated" value="19" /><SummaryTile icon={<AlertTriangle size={18} />} label="Needs review" value="3" /><SummaryTile icon={<Link2 size={18} />} label="Mappings" value="42" /></div><div className="panel table-panel"><div className="panel-title-row"><div><span className="eyebrow">MYGA · Model v3.2 · GAAP</span><h2 className="section-title">Input Library</h2><p className="muted">Versioned input objects connected to the active model and projection scope.</p></div><button className="view-all" onClick={() => select('validation')}><ShieldCheck size={14} />Validation Center</button></div><div className="input-table">{inputRows.map(([name,detail,version,count,status]) => <button className="input-row" key={name} onClick={() => select(name === 'Liability Inforce' ? 'liability' : name === 'Asset Inforce' ? 'asset' : name === 'Assumption Tables' ? 'assumptions' : name === 'Factor Tables' ? 'factors' : 'projection')}><span className="model-name"><span className="model-icon"><Database size={16} /></span><span><b>{name}</b><small>{detail}</small></span></span><span>{version}</span><span>MYGA · GAAP</span><span>{count}</span><span><StatusBadge status={status as 'Validated' | 'Needs review'} /></span><ArrowRight size={17} /></button>)}</div></div><div className="workspace-callout"><ShieldCheck size={20} /><span><b>3 issues need review</b><small>All blocking mappings are complete. Review factor-table warnings before the next projection run.</small></span><button onClick={() => select('validation')}>Review issues <ArrowRight size={15} /></button></div></div> }
|
| 12 |
|
| 13 |
-
function InputDetailView({ view, onBack }: { view: InputView; onBack: () => void }) { const { notify } = useApp(); const config: Record<Exclude<InputView,'library'>, { title: string; eyebrow: string; description: string }> = { liability: { title: 'Liability Inforce', eyebrow: 'Input object · imported detail', description: 'Preview records, map segments and confirm existing versus future-purchase scope.' }, asset: { title: 'Asset Inforce', eyebrow: 'Input object · imported detail', description: 'Review holdings, portfolio mapping, and downstream asset cash-flow consumers.' }, assumptions: { title: 'Assumption Tables', eyebrow: 'Table editor · versioned dimensions', description: 'Inspect effective dates, slices, sparse behavior, and selected assumption cells.' }, factors: { title: 'Factor Tables', eyebrow: 'Reference table · needs review', description: 'Review surrender and mortality factors with issue-level validation.' }, projection: { title: 'Projection Inputs', eyebrow: 'Projection scope · Q4 valuation controls', description: 'Set projection-level controls without mutating the shared input library.' }, validation: { title: 'Validation Center', eyebrow: 'Cross-workspace issue queue', description: 'Jump from validation issues to the exact input, mapping, or projection control.' } }; const item = config[view as Exclude<InputView, 'library'>]; return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Input Library</button><div className="panel detail-workspace-head"><div><span className="eyebrow">{item.eyebrow}</span><h2 className="section-title">{item.title}</h2><p className="muted">{item.description}</p></div><StatusBadge status={view === 'factors' ? 'Needs review' : 'Validated'} /></div>{view === 'validation' ? <ValidationIssues onOpen={() =>
|
| 14 |
|
| 15 |
function InputEditor({ view, onNotify }: { view: InputView; onNotify: (message: string) => void }) { const isTable = view === 'assumptions' || view === 'factors'; return <div className="input-detail-grid"><div className="panel"><div className="panel-title-row"><h2 className="section-title">{isTable ? 'Dimension and slice preview' : 'Source and mapping preview'}</h2><button className="view-all" onClick={() => onNotify('Import wizard opened')}><Upload size={14} />Import new version</button></div><div className="input-preview-grid">{(isTable ? ['Effective date','Scenario','Age band','Policy year','Cell value','Sparse cells'] : ['Source file','Imported at','Records','Segments / LOB','Existing business','Future purchases']).map((label,index) => <span key={label}><small>{label}</small><b>{['2026-12-31','Base scenario','All bands','Year 5','4.25%','18 cells'][index] ?? 'MYGA liability file'}</b></span>)}</div>{isTable ? <div className="factor-grid">{['Year','Base','Low rate','High rate'].map(label => <b key={label}>{label}</b>)}{['1','2','3','4','5','6'].flatMap(year => [<span key={`${year}-a`}>{year}</span>,<span key={`${year}-b`}>4.10%</span>,<span key={`${year}-c`}>4.25%</span>,<span key={`${year}-d`}>4.55%</span>])}</div> : <div className="mapping-flow"><span><FileText size={18} />Source records<b>24,810</b></span><ArrowRight size={18} /><span><Layers3 size={18} />Mapped segments<b>12 / 12</b></span><ArrowRight size={18} /><span><Database size={18} />Projection inputs<b>Ready</b></span></div>}</div><aside className="panel"><span className="eyebrow">Validation and provenance</span><h2 className="section-title">Checks</h2><div className="check-list"><span><Check size={15} />Schema compatible</span><span><Check size={15} />Effective dates covered</span><span className={view === 'factors' ? 'check-warning' : ''}>{view === 'factors' ? <AlertTriangle size={15} /> : <Check size={15} />} {view === 'factors' ? '3 cells need review' : 'No blocking issues'}</span></div><button className="button button-primary full-button" onClick={() => onNotify('Input changes saved')}>Save and validate <Check size={15} /></button><button className="button button-secondary full-button" onClick={() => onNotify('Mentor context opened')}>Ask Mentor <ArrowRight size={15} /></button></aside></div> }
|
| 16 |
|
| 17 |
-
function ValidationIssues({ onOpen }: { onOpen: () => void }) { return <div className="panel validation-issues"><div className="panel-title-row"><div><h2 className="section-title">Open issues</h2><p className="muted">Warnings are non-blocking; resolve before publishing the next Run Set.</p></div><button className="button button-primary"><Check size={15} />Run validation</button></div>{[['Factor Tables','Three lapse-rate cells are outside the expected calibration range.','Needs review'],['Asset Inforce','One portfolio mapping uses an older source version.','Needs review'],['Projection Inputs','Trace capture scope is not explicitly selected.','Needs review']].map(([title,body,status]) => <button className="issue-row" key={title} onClick={onOpen}><AlertTriangle size={18} /><span><b>{title}</b><small>{body}</small></span><StatusBadge status={status as 'Needs review'} /><ArrowRight size={16} /></button>)}</div> }
|
|
|
|
| 8 |
type InputView = 'library' | 'liability' | 'asset' | 'assumptions' | 'factors' | 'projection' | 'validation'
|
| 9 |
const inputRows = [['Liability Inforce','MYGA liability file','v2026.12','24,810 records','Validated'],['Asset Inforce','MYGA asset holdings','v2026.11','8,402 records','Validated'],['Assumption Tables','MYGA reserve assumptions','v3.2','18 dimensions','Validated'],['Factor Tables','Surrender and mortality factors','v1.8','42,116 cells','Needs review'],['Projection Inputs','Q4 valuation controls','v2026.12','26 fields','Validated']]
|
| 10 |
|
| 11 |
+
export function InputLibraryPage() { const [view, setView] = useState<InputView>('library'); const select = (next: InputView) => setView(next); if (view !== 'library') return <InputDetailView view={view} onBack={() => select('library')} onNavigate={select} />; return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search input libraries, tables, mappings..." action="Import input" actionIcon={<Upload size={15} />} /><div className="input-subnav">{[['library','Input Library'],['liability','Liability Inforce'],['asset','Asset Inforce'],['assumptions','Assumption Tables'],['factors','Factor Tables'],['projection','Projection Inputs'],['validation','Validation Center']].map(([key,label]) => <button className={view === key ? 'input-subnav-active' : ''} key={key} onClick={() => select(key as InputView)}>{label}</button>)}</div><div className="model-summary-grid"><SummaryTile icon={<Database size={18} />} label="Input objects" value="24" tone="dark" /><SummaryTile icon={<Check size={18} />} label="Validated" value="19" /><SummaryTile icon={<AlertTriangle size={18} />} label="Needs review" value="3" /><SummaryTile icon={<Link2 size={18} />} label="Mappings" value="42" /></div><div className="panel table-panel"><div className="panel-title-row"><div><span className="eyebrow">MYGA · Model v3.2 · GAAP</span><h2 className="section-title">Input Library</h2><p className="muted">Versioned input objects connected to the active model and projection scope.</p></div><button className="view-all" onClick={() => select('validation')}><ShieldCheck size={14} />Validation Center</button></div><div className="input-table">{inputRows.map(([name,detail,version,count,status]) => <button className="input-row" key={name} onClick={() => select(name === 'Liability Inforce' ? 'liability' : name === 'Asset Inforce' ? 'asset' : name === 'Assumption Tables' ? 'assumptions' : name === 'Factor Tables' ? 'factors' : 'projection')}><span className="model-name"><span className="model-icon"><Database size={16} /></span><span><b>{name}</b><small>{detail}</small></span></span><span>{version}</span><span>MYGA · GAAP</span><span>{count}</span><span><StatusBadge status={status as 'Validated' | 'Needs review'} /></span><ArrowRight size={17} /></button>)}</div></div><div className="workspace-callout"><ShieldCheck size={20} /><span><b>3 issues need review</b><small>All blocking mappings are complete. Review factor-table warnings before the next projection run.</small></span><button onClick={() => select('validation')}>Review issues <ArrowRight size={15} /></button></div></div> }
|
| 12 |
|
| 13 |
+
function InputDetailView({ view, onBack, onNavigate }: { view: InputView; onBack: () => void; onNavigate: (view: InputView) => void }) { const { notify } = useApp(); const config: Record<Exclude<InputView,'library'>, { title: string; eyebrow: string; description: string }> = { liability: { title: 'Liability Inforce', eyebrow: 'Input object · imported detail', description: 'Preview records, map segments and confirm existing versus future-purchase scope.' }, asset: { title: 'Asset Inforce', eyebrow: 'Input object · imported detail', description: 'Review holdings, portfolio mapping, and downstream asset cash-flow consumers.' }, assumptions: { title: 'Assumption Tables', eyebrow: 'Table editor · versioned dimensions', description: 'Inspect effective dates, slices, sparse behavior, and selected assumption cells.' }, factors: { title: 'Factor Tables', eyebrow: 'Reference table · needs review', description: 'Review surrender and mortality factors with issue-level validation.' }, projection: { title: 'Projection Inputs', eyebrow: 'Projection scope · Q4 valuation controls', description: 'Set projection-level controls without mutating the shared input library.' }, validation: { title: 'Validation Center', eyebrow: 'Cross-workspace issue queue', description: 'Jump from validation issues to the exact input, mapping, or projection control.' } }; const item = config[view as Exclude<InputView, 'library'>]; return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Input Library</button><div className="panel detail-workspace-head"><div><span className="eyebrow">{item.eyebrow}</span><h2 className="section-title">{item.title}</h2><p className="muted">{item.description}</p></div><StatusBadge status={view === 'factors' ? 'Needs review' : 'Validated'} /></div>{view === 'validation' ? <ValidationIssues onOpen={(target) => onNavigate(target === 'Factor Tables' ? 'factors' : target === 'Asset Inforce' ? 'asset' : 'projection')} /> : <InputEditor view={view} onNotify={notify} />}</div> }
|
| 14 |
|
| 15 |
function InputEditor({ view, onNotify }: { view: InputView; onNotify: (message: string) => void }) { const isTable = view === 'assumptions' || view === 'factors'; return <div className="input-detail-grid"><div className="panel"><div className="panel-title-row"><h2 className="section-title">{isTable ? 'Dimension and slice preview' : 'Source and mapping preview'}</h2><button className="view-all" onClick={() => onNotify('Import wizard opened')}><Upload size={14} />Import new version</button></div><div className="input-preview-grid">{(isTable ? ['Effective date','Scenario','Age band','Policy year','Cell value','Sparse cells'] : ['Source file','Imported at','Records','Segments / LOB','Existing business','Future purchases']).map((label,index) => <span key={label}><small>{label}</small><b>{['2026-12-31','Base scenario','All bands','Year 5','4.25%','18 cells'][index] ?? 'MYGA liability file'}</b></span>)}</div>{isTable ? <div className="factor-grid">{['Year','Base','Low rate','High rate'].map(label => <b key={label}>{label}</b>)}{['1','2','3','4','5','6'].flatMap(year => [<span key={`${year}-a`}>{year}</span>,<span key={`${year}-b`}>4.10%</span>,<span key={`${year}-c`}>4.25%</span>,<span key={`${year}-d`}>4.55%</span>])}</div> : <div className="mapping-flow"><span><FileText size={18} />Source records<b>24,810</b></span><ArrowRight size={18} /><span><Layers3 size={18} />Mapped segments<b>12 / 12</b></span><ArrowRight size={18} /><span><Database size={18} />Projection inputs<b>Ready</b></span></div>}</div><aside className="panel"><span className="eyebrow">Validation and provenance</span><h2 className="section-title">Checks</h2><div className="check-list"><span><Check size={15} />Schema compatible</span><span><Check size={15} />Effective dates covered</span><span className={view === 'factors' ? 'check-warning' : ''}>{view === 'factors' ? <AlertTriangle size={15} /> : <Check size={15} />} {view === 'factors' ? '3 cells need review' : 'No blocking issues'}</span></div><button className="button button-primary full-button" onClick={() => onNotify('Input changes saved')}>Save and validate <Check size={15} /></button><button className="button button-secondary full-button" onClick={() => onNotify('Mentor context opened')}>Ask Mentor <ArrowRight size={15} /></button></aside></div> }
|
| 16 |
|
| 17 |
+
function ValidationIssues({ onOpen }: { onOpen: (target: 'Factor Tables' | 'Asset Inforce' | 'Projection Inputs') => void }) { return <div className="panel validation-issues"><div className="panel-title-row"><div><h2 className="section-title">Open issues</h2><p className="muted">Warnings are non-blocking; resolve before publishing the next Run Set.</p></div><button className="button button-primary" onClick={() => onOpen('Factor Tables')}><Check size={15} />Run validation</button></div>{[['Factor Tables','Three lapse-rate cells are outside the expected calibration range.','Needs review'],['Asset Inforce','One portfolio mapping uses an older source version.','Needs review'],['Projection Inputs','Trace capture scope is not explicitly selected.','Needs review']].map(([title,body,status]) => <button className="issue-row" key={title} onClick={() => onOpen(title as 'Factor Tables' | 'Asset Inforce' | 'Projection Inputs')}><AlertTriangle size={18} /><span><b>{title}</b><small>{body}</small></span><StatusBadge status={status as 'Needs review'} /><ArrowRight size={16} /></button>)}</div> }
|
src/pages/InvestigationScreens.tsx
CHANGED
|
@@ -5,11 +5,13 @@ import { WorkspaceToolbar } from '../components/ui/WorkspaceToolbar'
|
|
| 5 |
import { IconBubble } from '../components/ui/IconBubble'
|
| 6 |
import { useApp } from '../context/useApp'
|
| 7 |
|
| 8 |
-
type InvestigationView = 'trace' | 'saved' | 'scratchpad'
|
| 9 |
type TraceNode = { title: string; meta: string; kind: 'result' | 'formula' | 'input' | 'output' }
|
| 10 |
const nodes: TraceNode[] = [{ title: 'Net reserve', meta: '$1,245.6M · Result', kind: 'result' }, { title: 'reserve_t', meta: 'Formula · v4.1', kind: 'formula' }, { title: 'lapse_rate', meta: '4.25% · Year 5', kind: 'input' }, { title: 'mat-001', meta: 'Source table · v1.8', kind: 'input' }]
|
| 11 |
-
export function InvestigationWorkspacePage() { const [view,setView] = useState<InvestigationView>('trace'); return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search saved investigations, trace roots, notes..." action="New investigation" actionIcon={<Plus size={15} />} onAction={() => setView('trace')} /><div className="investigation-subnav"><button className={view === 'trace' ? 'investigation-subnav-active' : ''} onClick={() => setView('trace')}><GitBranch size={14} />Trace Explorer</button><button className={view === 'saved' ? 'investigation-subnav-active' : ''} onClick={() => setView('saved')}><Save size={14} />Saved Investigations</button><button className={view === 'scratchpad' ? 'investigation-subnav-active' : ''} onClick={() => setView('scratchpad')}><Code2 size={14} />Scratchpad</button></div>{view === 'trace' ? <TraceExplorer onScratchpad={() => setView('scratchpad')} /> : view === 'saved' ? <SavedInvestigations onOpen={() => setView('trace')} /> : <ScratchpadNotebook onBack={() => setView('trace')} />}</div> }
|
| 12 |
-
function TraceExplorer({ onScratchpad }: { onScratchpad: () => void }) { const { notify } = useApp(); const [direction,setDirection] = useState<'backward'|'forward'>('backward'); const [branch,setBranch] = useState('lapse_rate'); const [pinned,setPinned] = useState<string[]>(['Net reserve']); return <div className="workspace-stack"><div className="panel trace-header"><div><span className="eyebrow">Trace Explorer · root result preserved</span><h2 className="section-title">Why did net reserve change?</h2><p className="muted">Run JR-20261231-001 · Model v3.2 · Base scenario · 2026-12-31</p></div><StatusBadge status="Completed" /></div><div className="trace-controls"><button className={direction === 'backward' ? 'trace-control-active' : ''} onClick={() => setDirection('backward')}><ArrowLeft size={14} />Trace backward</button><button className={direction === 'forward' ? 'trace-control-active' : ''} onClick={() => setDirection('forward')}><ArrowRight size={14} />Trace forward</button><span className="trace-context"><Lock size={13} />Root locked · branch exploration enabled</span></div><div className="trace-breadcrumb"><span>Result</span><ArrowRight size={13} /><span>Net reserve</span><ArrowRight size={13} /><span>{direction === 'backward' ? branch : 'Projection output'}</span></div><div className="trace-path-panel panel"><div className="panel-title-row"><div><h2 className="section-title">{direction === 'backward' ? 'Contributing path' : 'Dependent path'}</h2><p className="muted">Every node retains exact value, time, scenario, source, and version context.</p></div><button className="view-all" onClick={() => setPinned([...pinned, branch])}><Flag size={14} />Pin checkpoint</button></div><div className="trace-node-path">{nodes.map((node,index) => <div className="trace-path-segment" key={node.title}><button className={`trace-node-card trace-kind-${node.kind} ${branch === node.title ? 'trace-node-card-selected' : ''}`} onClick={() => setBranch(node.title)}><span>{node.kind === 'result' ? <Table2 size={16} /> : node.kind === 'formula' ? <Code2 size={16} /> : <Database size={16} />}</span><b>{node.title}</b><small>{node.meta}</small><em>Open source</em></button>{index < nodes.length - 1 && <ArrowRight size={17} />}</div>)}</div></div><div className="trace-bottom-grid"><div className="panel"><div className="panel-title-row"><h2 className="section-title">Pinned checkpoints</h2><span>{pinned.length} pinned</span></div>{pinned.map((item,index) => <div className="checkpoint-row" key={`${item}-${index}`}><Flag size={15} fill="currentColor" /><span><b>{item}</b><small>Run JR-20261231-001 · Base scenario</small></span><button onClick={() => setBranch(item)}>Return</button><button aria-label="Remove checkpoint" onClick={() => setPinned(pinned.filter((_,i) => i !== index))}><X size={14} /></button></div>)}</div><aside className="panel"><h2 className="section-title">Investigation actions</h2><button className="button button-primary full-button" onClick={
|
|
|
|
|
|
|
| 13 |
function SavedInvestigations({ onOpen }: { onOpen: () => void }) { const saved = [['Why did net reserve change?','MYGA Base · Base scenario · 2026-12-31','3 checkpoints · Mentor explanation'],['What drives DAC unlock in year 7?','FIA VM-21 · Deterministic · 2026-12-31','2 checkpoints · comparison'],['Impact of rate shock on surrender?','MYGA Base · Low Interest Rate · 2026-12-31','1 checkpoint · note']]; return <div className="workspace-stack"><div className="panel detail-workspace-head"><div><span className="eyebrow">Saved Investigations</span><h2 className="section-title">Analytical context</h2><p className="muted">Saved roots, paths, pins, notes, run versions, and Mentor explanations are preserved together.</p></div><button className="button button-secondary"><Search size={15} />Filter</button></div><div className="panel saved-investigation-list">{saved.map(item => <button className="saved-investigation-card" key={item[0]} onClick={onOpen}><IconBubble lime><Flag size={15} fill="currentColor" /></IconBubble><span><b>{item[0]}</b><small>{item[1]}</small><em>{item[2]}</em></span><StatusBadge status="Validated" /><ArrowRight size={16} /></button>)}</div></div> }
|
| 14 |
function ScratchpadNotebook({ onBack }: { onBack: () => void }) { const { notify } = useApp(); const [frozen,setFrozen] = useState(false); const [blocks,setBlocks] = useState(['linked','note','comparison']); const addBlock = (block:string) => setBlocks([...blocks,block]); return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Trace Explorer</button><div className="panel notebook-header"><div><span className="eyebrow">Scratchpad · analytical notebook</span><h2 className="section-title">Reserve driver investigation</h2><p className="muted">Experiment safely without mutating production logic. Imported facts remain linked to their source.</p></div><div className="notebook-actions"><button className="button button-secondary" onClick={() => setFrozen(!frozen)}>{frozen ? <Unlock size={15} /> : <Lock size={15} />}{frozen ? 'Unfreeze references' : 'Freeze snapshot'}</button><button className="button button-primary" onClick={() => notify('Scratchpad saved')}><Save size={15} />Save notebook</button></div></div><div className="notebook-toolbar"><span>Blocks</span><button onClick={() => addBlock('linked')}><Database size={14} />Linked value</button><button onClick={() => addBlock('table')}><Table2 size={14} />Table</button><button onClick={() => addBlock('chart')}><BarChart3 size={14} />Chart</button><button onClick={() => addBlock('formula')}><Code2 size={14} />Formula</button><button onClick={() => addBlock('note')}><FileText size={14} />Note</button><button onClick={() => addBlock('mentor')}><MessageCircle size={14} />Mentor</button></div><div className="notebook-layout"><div className="notebook-canvas">{blocks.map((block,index) => <NotebookBlock key={`${block}-${index}`} type={block} frozen={frozen} index={index} onRemove={() => setBlocks(blocks.filter((_,i) => i !== index))} />)}</div><aside className="panel notebook-sidebar"><h2 className="section-title">Experiment controls</h2><div className="check-list"><span><Check size={15} />Production values remain unchanged</span><span><Check size={15} />Every linked value cites provenance</span><span>{frozen ? <Lock size={15} /> : <RefreshCw size={15} />}{frozen ? 'Snapshot frozen' : 'Linked references refreshable'}</span></div><button className="button button-primary full-button" onClick={() => notify('Baseline comparison opened')}><GitCompare size={15} />Compare baseline</button><button className="button button-secondary full-button" onClick={() => notify('Experiment promoted for review')}><ArrowRight size={15} />Promote for review</button><button className="button button-secondary full-button" onClick={() => notify('Experimental changes discarded')}><Trash2 size={15} />Discard experiment</button></aside></div></div> }
|
| 15 |
function NotebookBlock({ type, frozen, index, onRemove }: { type: string; frozen: boolean; index: number; onRemove: () => void }) { const content: Record<string,{title:string; body:string; icon:ReactNode}> = { linked:{title:'Linked value · net_reserve',body:'$1,245.6M · Run JR-20261231-001 · 2026',icon:<Database size={16} />}, note:{title:'Note',body:'Lapse-rate contribution is positive in Year 5 and partially offset by interest.',icon:<FileText size={16} />}, comparison:{title:'Baseline vs experiment',body:'Base $1,245.6M → Experiment $1,282.4M · +2.95%',icon:<GitCompare size={16} />}, table:{title:'Table block · driver impact',body:'Interest −120 bps · Expense −80.5 bps · Lapse +210 bps',icon:<Table2 size={16} />}, chart:{title:'Chart block · reserve movement',body:'Chart linked to Results Explorer output',icon:<BarChart3 size={16} />}, formula:{title:'Formula block · experimental',body:'reserve_t + lapse_adjustment × 0.01',icon:<Code2 size={16} />}, mentor:{title:'Mentor explanation',body:'Verified facts and interpretation cited separately.',icon:<Sparkles size={16} />} }; const item=content[type] ?? content.note; return <div className={`notebook-block notebook-${type}`}><div className="notebook-block-head"><span>{item.icon}</span><b>{item.title}</b><small>{frozen ? 'Frozen snapshot' : `Block ${index+1}`}</small><button onClick={onRemove}><X size={14} /></button></div><p>{item.body}</p><div className="notebook-provenance"><span><Link2Icon />Source linked</span><span>{frozen ? <Lock size={12} /> : <RefreshCw size={12} />} {frozen ? 'Frozen' : 'Refreshable'}</span></div></div> }
|
|
|
|
| 5 |
import { IconBubble } from '../components/ui/IconBubble'
|
| 6 |
import { useApp } from '../context/useApp'
|
| 7 |
|
| 8 |
+
type InvestigationView = 'trace' | 'saved' | 'scratchpad' | 'compare'
|
| 9 |
type TraceNode = { title: string; meta: string; kind: 'result' | 'formula' | 'input' | 'output' }
|
| 10 |
const nodes: TraceNode[] = [{ title: 'Net reserve', meta: '$1,245.6M · Result', kind: 'result' }, { title: 'reserve_t', meta: 'Formula · v4.1', kind: 'formula' }, { title: 'lapse_rate', meta: '4.25% · Year 5', kind: 'input' }, { title: 'mat-001', meta: 'Source table · v1.8', kind: 'input' }]
|
| 11 |
+
export function InvestigationWorkspacePage() { const { investigationIntent, openInvestigation } = useApp(); const [view,setView] = useState<InvestigationView>(investigationIntent?.kind === 'compare' ? 'compare' : investigationIntent?.kind === 'scratchpad' ? 'scratchpad' : 'trace'); const compare = () => setView('compare'); const mentor = () => openInvestigation({ kind: 'mentor', question: 'Explain this investigation branch' }); return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search saved investigations, trace roots, notes..." action="New investigation" actionIcon={<Plus size={15} />} onAction={() => setView('trace')} /><div className="investigation-subnav"><button className={view === 'trace' ? 'investigation-subnav-active' : ''} onClick={() => setView('trace')}><GitBranch size={14} />Trace Explorer</button><button className={view === 'saved' ? 'investigation-subnav-active' : ''} onClick={() => setView('saved')}><Save size={14} />Saved Investigations</button><button className={view === 'scratchpad' ? 'investigation-subnav-active' : ''} onClick={() => setView('scratchpad')}><Code2 size={14} />Scratchpad</button></div>{view === 'trace' ? <TraceExplorer onScratchpad={() => setView('scratchpad')} onCompare={compare} onMentor={mentor} /> : view === 'saved' ? <SavedInvestigations onOpen={() => setView('trace')} /> : view === 'compare' ? <CompareRuns onBack={() => setView('trace')} onTrace={() => setView('trace')} /> : <ScratchpadNotebook onBack={() => setView('trace')} />}</div> }
|
| 12 |
+
function TraceExplorer({ onScratchpad, onCompare, onMentor }: { onScratchpad: () => void; onCompare: () => void; onMentor: () => void }) { const { notify } = useApp(); const [direction,setDirection] = useState<'backward'|'forward'>('backward'); const [branch,setBranch] = useState('lapse_rate'); const [pinned,setPinned] = useState<string[]>(['Net reserve']); return <div className="workspace-stack"><div className="panel trace-header"><div><span className="eyebrow">Trace Explorer · root result preserved</span><h2 className="section-title">Why did net reserve change?</h2><p className="muted">Run JR-20261231-001 · Model v3.2 · Base scenario · 2026-12-31</p></div><StatusBadge status="Completed" /></div><div className="trace-controls"><button className={direction === 'backward' ? 'trace-control-active' : ''} onClick={() => setDirection('backward')}><ArrowLeft size={14} />Trace backward</button><button className={direction === 'forward' ? 'trace-control-active' : ''} onClick={() => setDirection('forward')}><ArrowRight size={14} />Trace forward</button><span className="trace-context"><Lock size={13} />Root locked · branch exploration enabled</span></div><div className="trace-breadcrumb"><span>Result</span><ArrowRight size={13} /><span>Net reserve</span><ArrowRight size={13} /><span>{direction === 'backward' ? branch : 'Projection output'}</span></div><div className="trace-path-panel panel"><div className="panel-title-row"><div><h2 className="section-title">{direction === 'backward' ? 'Contributing path' : 'Dependent path'}</h2><p className="muted">Every node retains exact value, time, scenario, source, and version context.</p></div><button className="view-all" onClick={() => setPinned([...pinned, branch])}><Flag size={14} />Pin checkpoint</button></div><div className="trace-node-path">{nodes.map((node,index) => <div className="trace-path-segment" key={node.title}><button className={`trace-node-card trace-kind-${node.kind} ${branch === node.title ? 'trace-node-card-selected' : ''}`} onClick={() => setBranch(node.title)}><span>{node.kind === 'result' ? <Table2 size={16} /> : node.kind === 'formula' ? <Code2 size={16} /> : <Database size={16} />}</span><b>{node.title}</b><small>{node.meta}</small><em>Open source</em></button>{index < nodes.length - 1 && <ArrowRight size={17} />}</div>)}</div></div><div className="trace-bottom-grid"><div className="panel"><div className="panel-title-row"><h2 className="section-title">Pinned checkpoints</h2><span>{pinned.length} pinned</span></div>{pinned.map((item,index) => <div className="checkpoint-row" key={`${item}-${index}`}><Flag size={15} fill="currentColor" /><span><b>{item}</b><small>Run JR-20261231-001 · Base scenario</small></span><button onClick={() => setBranch(item)}>Return</button><button aria-label="Remove checkpoint" onClick={() => setPinned(pinned.filter((_,i) => i !== index))}><X size={14} /></button></div>)}</div><aside className="panel"><h2 className="section-title">Investigation actions</h2><button className="button button-primary full-button" onClick={onCompare}><GitCompare size={15} />Compare with another run</button><button className="button button-secondary full-button" onClick={onScratchpad}><Plus size={15} />Add path to Scratchpad</button><button className="button button-secondary full-button" onClick={onMentor}><Sparkles size={15} />Ask Mentor about this branch</button><button className="button button-secondary full-button" onClick={() => notify('Investigation saved')}><Save size={15} />Save investigation</button></aside></div></div> }
|
| 13 |
+
|
| 14 |
+
function CompareRuns({ onBack, onTrace }: { onBack: () => void; onTrace: () => void }) { const [selected, setSelected] = useState('JR-20261230-004'); const runs = [['JR-20261230-004', 'Monthly VM-21 Pack', 'VM-21 Deterministic', '$1,088.2M'], ['JR-20261228-002', 'Pricing Sensitivity Pack', 'Low Interest Rate', '$998.1M'], ['JR-20261227-006', 'GAAP Reserve Pack', 'High lapse stress', '$1,412.7M']]; return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Trace Explorer</button><div className="panel detail-workspace-head"><div><span className="eyebrow">Investigation · compare another run</span><h2 className="section-title">Compare the active trace with another run</h2><p className="muted">Current root: JR-20261231-001 · Net reserve · $1,245.6M</p></div><StatusBadge status="Validated" /></div><div className="compare-run-list panel">{runs.map(run => <button className={selected === run[0] ? 'compare-run-selected' : ''} key={run[0]} onClick={() => setSelected(run[0])}><span><b>{run[0]}</b><small>{run[1]} · {run[2]}</small></span><strong>{run[3]}</strong><ArrowRight size={16} /></button>)}</div><div className="workspace-callout"><GitCompare size={19} /><span><b>Run pair ready</b><small>Compare driver contributions, changed assumptions, and trace paths against {selected}.</small></span><button onClick={onTrace}>Open paired trace <ArrowRight size={15} /></button></div></div> }
|
| 15 |
function SavedInvestigations({ onOpen }: { onOpen: () => void }) { const saved = [['Why did net reserve change?','MYGA Base · Base scenario · 2026-12-31','3 checkpoints · Mentor explanation'],['What drives DAC unlock in year 7?','FIA VM-21 · Deterministic · 2026-12-31','2 checkpoints · comparison'],['Impact of rate shock on surrender?','MYGA Base · Low Interest Rate · 2026-12-31','1 checkpoint · note']]; return <div className="workspace-stack"><div className="panel detail-workspace-head"><div><span className="eyebrow">Saved Investigations</span><h2 className="section-title">Analytical context</h2><p className="muted">Saved roots, paths, pins, notes, run versions, and Mentor explanations are preserved together.</p></div><button className="button button-secondary"><Search size={15} />Filter</button></div><div className="panel saved-investigation-list">{saved.map(item => <button className="saved-investigation-card" key={item[0]} onClick={onOpen}><IconBubble lime><Flag size={15} fill="currentColor" /></IconBubble><span><b>{item[0]}</b><small>{item[1]}</small><em>{item[2]}</em></span><StatusBadge status="Validated" /><ArrowRight size={16} /></button>)}</div></div> }
|
| 16 |
function ScratchpadNotebook({ onBack }: { onBack: () => void }) { const { notify } = useApp(); const [frozen,setFrozen] = useState(false); const [blocks,setBlocks] = useState(['linked','note','comparison']); const addBlock = (block:string) => setBlocks([...blocks,block]); return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Trace Explorer</button><div className="panel notebook-header"><div><span className="eyebrow">Scratchpad · analytical notebook</span><h2 className="section-title">Reserve driver investigation</h2><p className="muted">Experiment safely without mutating production logic. Imported facts remain linked to their source.</p></div><div className="notebook-actions"><button className="button button-secondary" onClick={() => setFrozen(!frozen)}>{frozen ? <Unlock size={15} /> : <Lock size={15} />}{frozen ? 'Unfreeze references' : 'Freeze snapshot'}</button><button className="button button-primary" onClick={() => notify('Scratchpad saved')}><Save size={15} />Save notebook</button></div></div><div className="notebook-toolbar"><span>Blocks</span><button onClick={() => addBlock('linked')}><Database size={14} />Linked value</button><button onClick={() => addBlock('table')}><Table2 size={14} />Table</button><button onClick={() => addBlock('chart')}><BarChart3 size={14} />Chart</button><button onClick={() => addBlock('formula')}><Code2 size={14} />Formula</button><button onClick={() => addBlock('note')}><FileText size={14} />Note</button><button onClick={() => addBlock('mentor')}><MessageCircle size={14} />Mentor</button></div><div className="notebook-layout"><div className="notebook-canvas">{blocks.map((block,index) => <NotebookBlock key={`${block}-${index}`} type={block} frozen={frozen} index={index} onRemove={() => setBlocks(blocks.filter((_,i) => i !== index))} />)}</div><aside className="panel notebook-sidebar"><h2 className="section-title">Experiment controls</h2><div className="check-list"><span><Check size={15} />Production values remain unchanged</span><span><Check size={15} />Every linked value cites provenance</span><span>{frozen ? <Lock size={15} /> : <RefreshCw size={15} />}{frozen ? 'Snapshot frozen' : 'Linked references refreshable'}</span></div><button className="button button-primary full-button" onClick={() => notify('Baseline comparison opened')}><GitCompare size={15} />Compare baseline</button><button className="button button-secondary full-button" onClick={() => notify('Experiment promoted for review')}><ArrowRight size={15} />Promote for review</button><button className="button button-secondary full-button" onClick={() => notify('Experimental changes discarded')}><Trash2 size={15} />Discard experiment</button></aside></div></div> }
|
| 17 |
function NotebookBlock({ type, frozen, index, onRemove }: { type: string; frozen: boolean; index: number; onRemove: () => void }) { const content: Record<string,{title:string; body:string; icon:ReactNode}> = { linked:{title:'Linked value · net_reserve',body:'$1,245.6M · Run JR-20261231-001 · 2026',icon:<Database size={16} />}, note:{title:'Note',body:'Lapse-rate contribution is positive in Year 5 and partially offset by interest.',icon:<FileText size={16} />}, comparison:{title:'Baseline vs experiment',body:'Base $1,245.6M → Experiment $1,282.4M · +2.95%',icon:<GitCompare size={16} />}, table:{title:'Table block · driver impact',body:'Interest −120 bps · Expense −80.5 bps · Lapse +210 bps',icon:<Table2 size={16} />}, chart:{title:'Chart block · reserve movement',body:'Chart linked to Results Explorer output',icon:<BarChart3 size={16} />}, formula:{title:'Formula block · experimental',body:'reserve_t + lapse_adjustment × 0.01',icon:<Code2 size={16} />}, mentor:{title:'Mentor explanation',body:'Verified facts and interpretation cited separately.',icon:<Sparkles size={16} />} }; const item=content[type] ?? content.note; return <div className={`notebook-block notebook-${type}`}><div className="notebook-block-head"><span>{item.icon}</span><b>{item.title}</b><small>{frozen ? 'Frozen snapshot' : `Block ${index+1}`}</small><button onClick={onRemove}><X size={14} /></button></div><p>{item.body}</p><div className="notebook-provenance"><span><Link2Icon />Source linked</span><span>{frozen ? <Lock size={12} /> : <RefreshCw size={12} />} {frozen ? 'Frozen' : 'Refreshable'}</span></div></div> }
|
src/pages/MentorScreens.tsx
CHANGED
|
@@ -1,11 +1,30 @@
|
|
| 1 |
-
import { useState } from 'react'
|
| 2 |
-
import { ArrowLeft, ArrowRight, Check, Filter, Flag, MessageCircle, Plus, ShieldCheck, Sparkles } from 'lucide-react'
|
| 3 |
import { investigations } from '../data/fixtures'
|
| 4 |
import { useApp } from '../context/useApp'
|
| 5 |
import { IconBubble } from '../components/ui/IconBubble'
|
| 6 |
import { StatusBadge } from '../components/ui/StatusBadge'
|
| 7 |
|
| 8 |
type MentorView = 'context' | 'history'
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { useState, type FormEvent } from 'react'
|
| 2 |
+
import { ArrowLeft, ArrowRight, Check, Filter, Flag, MessageCircle, Plus, Send, ShieldCheck, Sparkles, User } from 'lucide-react'
|
| 3 |
import { investigations } from '../data/fixtures'
|
| 4 |
import { useApp } from '../context/useApp'
|
| 5 |
import { IconBubble } from '../components/ui/IconBubble'
|
| 6 |
import { StatusBadge } from '../components/ui/StatusBadge'
|
| 7 |
|
| 8 |
type MentorView = 'context' | 'history'
|
| 9 |
+
type ChatMessage = { id: number; role: 'user' | 'assistant'; text: string; citations?: string[] }
|
| 10 |
+
const mockReplies = [
|
| 11 |
+
{ match: ['why', 'reserve'], text: 'Net reserve increased 6.99%. The largest positive contribution is the Year 5 lapse-rate assumption at +210 bps. Lower interest-rate and expense assumptions partially offset the movement.', citations: ['Results Explorer · JR-20261231-001', 'mat-001 · lapse_rate', 'reserve_t · formula v4.1'] },
|
| 12 |
+
{ match: ['lapse'], text: 'The lapse-rate contribution is positive in Year 5 because the selected path is above the prior-period assumption. Compare Base scenario with Low Interest Rate to isolate the scenario effect.', citations: ['Scenario Comparison · Base vs Low Interest Rate', 'Projection Set · MYGA GAAP Reserve'] },
|
| 13 |
+
{ match: ['formula', 'trace'], text: 'The result traces through reserve_t, then lapse_rate and mat-001. I can preserve this path in Scratchpad without changing production logic.', citations: ['Trace Explorer · reserve_t', 'Scratchpad · frozen references available'] },
|
| 14 |
+
]
|
| 15 |
+
|
| 16 |
+
export function MentorWorkspacePage() {
|
| 17 |
+
const [view, setView] = useState<MentorView>('context')
|
| 18 |
+
const { notify } = useApp()
|
| 19 |
+
return <div className="workspace-stack"><div className="mentor-subnav"><button className={view === 'context' ? 'mentor-subnav-active' : ''} onClick={() => setView('context')}><Sparkles size={15} />Contextual Mentor</button><button className={view === 'history' ? 'mentor-subnav-active' : ''} onClick={() => setView('history')}><MessageCircle size={15} />Mentor History</button></div>{view === 'context' ? <ContextMentor onHistory={() => setView('history')} onNotify={notify} /> : <MentorHistory onBack={() => setView('context')} onNotify={notify} />}</div>
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
function ContextMentor({ onHistory, onNotify }: { onHistory: () => void; onNotify: (message: string) => void }) {
|
| 23 |
+
const [messages, setMessages] = useState<ChatMessage[]>([{ id: 1, role: 'assistant', text: 'I am ready to explain the active MYGA result. Ask about the reserve movement, a driver, a formula, a scenario, or the next investigation step.', citations: ['Model v3.2 · active context', 'Run JR-20261231-001 · completed'] }])
|
| 24 |
+
const [draft, setDraft] = useState('')
|
| 25 |
+
const answer = (question: string) => { const normalized = question.toLowerCase(); const found = mockReplies.find(reply => reply.match.some(term => normalized.includes(term))); return found ?? { text: 'Based on the active model context, I can help investigate that. Start with the net reserve result, a driver such as lapse_rate, the reserve_t formula, or a Base versus Low Interest Rate comparison.', citations: ['Mentor mock context · MYGA Reserve Model v3.2', 'Evidence mode enabled'] } }
|
| 26 |
+
const send = (event?: FormEvent) => { event?.preventDefault(); const question = draft.trim(); if (!question) return; const reply = answer(question); setMessages(current => [...current, { id: Date.now(), role: 'user', text: question }, { id: Date.now() + 1, role: 'assistant', text: reply.text, citations: reply.citations }]); setDraft('') }
|
| 27 |
+
return <div className="mentor-layout"><div className="panel mentor-main"><div className="panel-title-row"><div><span className="eyebrow">Contextual Mentor · mock AI conversation</span><h2 className="section-title">Ask about this result</h2></div><button className="view-all" onClick={onHistory}>History <ArrowRight size={14} /></button></div><div className="mentor-question"><IconBubble lime><Sparkles size={21} /></IconBubble><div><b>Why did net reserve change?</b><small>MYGA Base · Base scenario · 2026-12-31 · Run JR-20261231-001</small></div></div><div className="mentor-answer"><div className="answer-label"><Check size={14} />Verified model facts</div><p>Net reserve increased <strong>6.99%</strong>. The largest positive contribution is the Year 5 lapse-rate assumption at <strong>+210 bps</strong>.</p><div className="mentor-citations"><span>Source: Results Explorer</span><span>Source: mat-001</span><span>Formula: reserve_t v4.1</span></div></div><div className="mentor-chat"><div className="mentor-chat-head"><span><MessageCircle size={15} /><b>Interactive Mentor</b></span><small>Mock response mode · evidence-first</small></div><div className="mentor-messages">{messages.map(message => <div className={`mentor-message mentor-message-${message.role}`} key={message.id}><span className="mentor-message-avatar">{message.role === 'assistant' ? <Sparkles size={14} /> : <User size={14} />}</span><div><p>{message.text}</p>{message.citations && <div className="mentor-message-citations">{message.citations.map(citation => <span key={citation}><Check size={11} />{citation}</span>)}</div>}</div></div>)}</div><div className="mentor-prompts">{['Why did reserve change?', 'Trace the lapse driver', 'Compare scenarios'].map(prompt => <button key={prompt} onClick={() => { setDraft(prompt); }}>{prompt}</button>)}</div><form className="mentor-composer" onSubmit={send}><input value={draft} onChange={event => setDraft(event.target.value)} placeholder="Ask Mentor about the active model context..." aria-label="Ask Mentor" /><button type="submit" aria-label="Send message"><Send size={16} /></button></form></div><div className="mentor-answer interpretation"><div className="answer-label"><Sparkles size={14} />AI interpretation</div><p>The lapse-rate change appears to be the primary driver, partially offset by lower interest-rate and expense assumptions.</p><div className="mentor-next-step"><Flag size={15} /><span><b>Suggested next step</b><small>Compare Base and Low Interest Rate scenarios in Results Explorer.</small></span><button onClick={() => onNotify('Scenario comparison opened')}>Compare <ArrowRight size={14} /></button></div></div><div className="button-row"><button className="button button-primary" onClick={() => onNotify('Scratchpad experiment created')}><Plus size={15} />Propose scratchpad experiment</button><button className="button button-secondary" onClick={() => onNotify('Mentor feedback saved')}><Check size={15} />Helpful</button></div></div><aside className="panel mentor-history"><div className="panel-title-row"><h2 className="section-title">Guardrails</h2><ShieldCheck size={18} /></div><div className="guardrail-card"><ShieldCheck size={17} /><span><b>No silent mutation</b><small>Mentor can propose changes, but production logic requires explicit evidence review and approval.</small></span></div><div className="guardrail-card"><Check size={17} /><span><b>Evidence required</b><small>Every answer separates verified model facts from AI interpretation and cites source objects.</small></span></div><button className="button button-secondary full-button" onClick={onHistory}>Open Mentor History</button></aside></div>
|
| 28 |
+
}
|
| 29 |
+
|
| 30 |
+
function MentorHistory({ onBack, onNotify }: { onBack: () => void; onNotify: (message: string) => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Contextual Mentor</button><div className="panel"><div className="panel-title-row"><div><span className="eyebrow">Dedicated workspace</span><h2 className="section-title">Mentor History</h2><p className="muted">Saved questions, verified evidence, interpretations, and proposed next steps.</p></div><button className="view-all" onClick={() => onNotify('Mentor history filters opened')}><Filter size={14} />Filters</button></div><div className="mentor-history-table">{investigations.map(item => <button key={item.title} onClick={() => onNotify(`${item.title} restored with context`)}><IconBubble lime><Sparkles size={15} /></IconBubble><span><b>{item.title}</b><small>{item.model} · {item.scenario} · {item.period}</small></span><StatusBadge status="Validated" /><small>{item.time}</small><ArrowRight size={15} /></button>)}</div></div></div> }
|
src/pages/ResultScreens.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import { useState } from 'react'
|
| 2 |
import { ArrowLeft, ArrowRight, BarChart3, Check, Download, Filter, GitBranch, GitCompare, LineChart, Plus, Table2, Target, TrendingDown } from 'lucide-react'
|
| 3 |
import { useApp } from '../context/useApp'
|
| 4 |
import { MetricCard } from '../components/ui/MetricCard'
|
|
@@ -6,9 +6,9 @@ import { StatusBadge } from '../components/ui/StatusBadge'
|
|
| 6 |
import { WorkspaceToolbar } from '../components/ui/WorkspaceToolbar'
|
| 7 |
|
| 8 |
type ResultView = 'explorer' | 'history' | 'compare' | 'variance'
|
| 9 |
-
export function ResultsExplorerPage() { const { notify } = useApp(); const [view, setView] = useState<ResultView>('explorer'); return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search runs, results, outputs, investigations..." action="Compare runs" actionIcon={<GitCompare size={15} />} onAction={() => setView('compare')} /><div className="results-subnav"><button className={view === 'explorer' ? 'results-subnav-active' : ''} onClick={() => setView('explorer')}>Results Explorer</button><button className={view === 'history' ? 'results-subnav-active' : ''} onClick={() => setView('history')}>Run History</button><button className={view === 'compare' ? 'results-subnav-active' : ''} onClick={() => setView('compare')}>Compare runs</button><button className={view === 'variance' ? 'results-subnav-active' : ''} onClick={() => setView('variance')}>Driver / Variance</button></div>{view === 'explorer' && <Explorer onNotify={notify} onCompare={() => setView('compare')} />}{view === 'history' && <History onOpen={() => setView('explorer')} />}{view === 'compare' && <Compare onBack={() => setView('explorer')} onVariance={() => setView('variance')} />}{view === 'variance' && <Variance onBack={() => setView('compare')} />}</div> }
|
| 10 |
-
function Explorer({ onNotify, onCompare }: { onNotify: (m: string) => void; onCompare: () => void }) { return <><div className="result-metrics"><MetricCard icon={<Table2 size={22} />} label="Net reserve" value="$2.2B" sub="MYGA Base · 2026-12-31" /><MetricCard light icon={<LineChart size={22} />} label="Change vs prior" value="+6.99%" sub="Primary driver: lapse_rate" /><MetricCard icon={<Target size={22} />} label="Outputs captured" value="28" sub="5 published outputs" /><MetricCard light icon={<GitBranch size={22} />} label="Trace ready" value="100%" sub="All values have lineage" /></div><div className="results-layout"><div className="panel results-explorer"><div className="panel-title-row"><div><span className="eyebrow">Run JR-20261231-001</span><h2 className="section-title">MYGA Base · GAAP Reserve</h2></div><div className="button-row"><button className="view-all" onClick={() => onNotify('Result filters opened')}><Filter size={14} />Filters</button><button className="view-all" onClick={onCompare}><GitCompare size={14} />Compare</button><button className="view-all" onClick={() => onNotify('Results
|
| 11 |
function History({ onOpen }: { onOpen: () => void }) { return <div className="panel"><div className="panel-title-row"><div><span className="eyebrow">Results provenance</span><h2 className="section-title">Run History</h2><p className="muted">Every result remains linked to its model, input, scenario, formula, and compute snapshot.</p></div><button className="view-all"><Filter size={14} />Filters</button></div><div className="history-table">{[['JR-20261231-001','GAAP Reserve Pack','MYGA Base','2026-12-31','Completed'],['JR-20261230-004','Monthly VM-21 Pack','VM-21 Deterministic','2026-12-31','Completed'],['JR-20261228-002','Pricing Sensitivity Pack','Low Interest Rate','2026-12-31','Stale']].map(row => <button key={row[0]} onClick={onOpen}><span><b>{row[0]}</b><small>{row[1]}</small></span><span>{row[2]}</span><span>{row[3]}</span><StatusBadge status={row[4] as 'Completed' | 'Stale'} /><ArrowRight size={16} /></button>)}</div></div> }
|
| 12 |
function Compare({ onBack, onVariance }: { onBack: () => void; onVariance: () => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Results Explorer</button><div className="panel comparison-header"><div><span className="eyebrow">Run comparison</span><h2 className="section-title">Base vs Low Interest Rate</h2><p className="muted">Model v3.2 · same input snapshot · scenario-only difference</p></div><StatusBadge status="Validated" /></div><div className="comparison-grid"><CompareCard label="Base scenario" value="$1,245.6M" change="Reference" icon={<Check size={18} />} /><CompareCard label="Low Interest Rate" value="$998.1M" change="−19.9%" icon={<TrendingDown size={18} />} negative /></div><div className="panel"><div className="panel-title-row"><h2 className="section-title">Changed dimensions</h2><button className="button button-secondary" onClick={onVariance}><BarChart3 size={15} />Open driver variance</button></div><div className="changed-dimensions">{['Interest rate curve','Lapse rate','Net reserve','Expense load'].map((label,index) => <div key={label}><span>{label}</span><b>{['−125 bps','+0.12%','−247.5M','Unchanged'][index]}</b><small>{index === 2 ? 'Output difference' : 'Input / assumption'}</small></div>)}</div></div></div> }
|
| 13 |
-
function CompareCard({ label, value, change, icon, negative }: { label: string; value: string; change: string; icon:
|
| 14 |
function Variance({ onBack }: { onBack: () => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to comparison</button><div className="panel variance-hero"><div><span className="eyebrow">Driver / Variance View</span><h2 className="section-title">What explains the −$247.5M change?</h2><p className="muted">Contribution analysis preserves the exact run pair and output lineage.</p></div><StatusBadge status="Validated" /></div><div className="panel"><div className="waterfall"><div className="waterfall-bar positive-bar" style={{ height: '72%' }}><span>+35M</span></div><div className="waterfall-bar negative-bar" style={{ height: '44%' }}><span>−120M</span></div><div className="waterfall-bar negative-bar" style={{ height: '31%' }}><span>−82M</span></div><div className="waterfall-bar negative-bar" style={{ height: '20%' }}><span>−80.5M</span></div><div className="waterfall-bar total-bar" style={{ height: '55%' }}><span>−247.5M</span></div></div><div className="waterfall-labels"><span>Mortality</span><span>Interest</span><span>Lapse</span><span>Expense</span><span>Net change</span></div></div></div> }
|
|
|
|
| 1 |
+
import { useState, type ReactNode } from 'react'
|
| 2 |
import { ArrowLeft, ArrowRight, BarChart3, Check, Download, Filter, GitBranch, GitCompare, LineChart, Plus, Table2, Target, TrendingDown } from 'lucide-react'
|
| 3 |
import { useApp } from '../context/useApp'
|
| 4 |
import { MetricCard } from '../components/ui/MetricCard'
|
|
|
|
| 6 |
import { WorkspaceToolbar } from '../components/ui/WorkspaceToolbar'
|
| 7 |
|
| 8 |
type ResultView = 'explorer' | 'history' | 'compare' | 'variance'
|
| 9 |
+
export function ResultsExplorerPage() { const { notify, openInvestigation } = useApp(); const [view, setView] = useState<ResultView>('explorer'); const trace = () => openInvestigation({ kind: 'trace', runId: 'JR-20261231-001', metric: 'net_reserve' }); const scratchpad = () => openInvestigation({ kind: 'scratchpad', runId: 'JR-20261231-001', metric: 'net_reserve' }); return <div className="workspace-stack"><WorkspaceToolbar searchPlaceholder="Search runs, results, outputs, investigations..." action="Compare runs" actionIcon={<GitCompare size={15} />} onAction={() => setView('compare')} /><div className="results-subnav"><button className={view === 'explorer' ? 'results-subnav-active' : ''} onClick={() => setView('explorer')}>Results Explorer</button><button className={view === 'history' ? 'results-subnav-active' : ''} onClick={() => setView('history')}>Run History</button><button className={view === 'compare' ? 'results-subnav-active' : ''} onClick={() => setView('compare')}>Compare runs</button><button className={view === 'variance' ? 'results-subnav-active' : ''} onClick={() => setView('variance')}>Driver / Variance</button></div>{view === 'explorer' && <Explorer onNotify={notify} onCompare={() => setView('compare')} onTrace={trace} onScratchpad={scratchpad} />}{view === 'history' && <History onOpen={() => setView('explorer')} />}{view === 'compare' && <Compare onBack={() => setView('explorer')} onVariance={() => setView('variance')} />}{view === 'variance' && <Variance onBack={() => setView('compare')} />}</div> }
|
| 10 |
+
function Explorer({ onNotify, onCompare, onTrace, onScratchpad }: { onNotify: (m: string) => void; onCompare: () => void; onTrace: () => void; onScratchpad: () => void }) { return <><div className="result-metrics"><MetricCard icon={<Table2 size={22} />} label="Net reserve" value="$2.2B" sub="MYGA Base · 2026-12-31" /><MetricCard light icon={<LineChart size={22} />} label="Change vs prior" value="+6.99%" sub="Primary driver: lapse_rate" /><MetricCard icon={<Target size={22} />} label="Outputs captured" value="28" sub="5 published outputs" /><MetricCard light icon={<GitBranch size={22} />} label="Trace ready" value="100%" sub="All values have lineage" /></div><div className="results-layout"><div className="panel results-explorer"><div className="panel-title-row"><div><span className="eyebrow">Run JR-20261231-001</span><h2 className="section-title">MYGA Base · GAAP Reserve</h2></div><div className="button-row"><button className="view-all" onClick={() => onNotify('Result filters opened')}><Filter size={14} />Filters</button><button className="view-all" onClick={onCompare}><GitCompare size={14} />Compare</button><button className="view-all" onClick={() => onNotify('Results export prepared as CSV')}><Download size={14} />Export</button></div></div><div className="chart-large"><div className="chart-line chart-line-one" /><div className="chart-line chart-line-two" /><span>2026</span><span>2030</span><span>2035</span><span>2040</span><span>2045</span></div><div className="result-grid">{['2026','2027','2028','2029','2030'].map((year,index) => <button className="result-row" key={year} onClick={onTrace}><span>{year}</span><b>{['1,245.6M','1,302.8M','1,348.2M','1,397.1M','1,452.7M'][index]}</b><span className="positive">+{[6.2,4.6,3.5,3.6,4.0][index]}%</span><span>{(4.25 + index * .06).toFixed(2)}%</span><span className="trace-link"><GitBranch size={13} />Trace value</span></button>)}</div></div><aside className="panel result-inspector"><span className="eyebrow">Selected result</span><h2 className="section-title">Net reserve</h2><strong className="inspector-value">$1,245.6M</strong><StatusBadge status="Completed" /><div className="inspector-section"><span>Provenance</span><b>Run JR-20261231-001</b><small>Model v3.2 · Base scenario · GAAP</small></div><button className="button button-primary full-button" onClick={onTrace}><GitBranch size={15} />Trace this value</button><button className="button button-secondary full-button" onClick={onScratchpad}><Plus size={15} />Add to Scratchpad</button></aside></div></> }
|
| 11 |
function History({ onOpen }: { onOpen: () => void }) { return <div className="panel"><div className="panel-title-row"><div><span className="eyebrow">Results provenance</span><h2 className="section-title">Run History</h2><p className="muted">Every result remains linked to its model, input, scenario, formula, and compute snapshot.</p></div><button className="view-all"><Filter size={14} />Filters</button></div><div className="history-table">{[['JR-20261231-001','GAAP Reserve Pack','MYGA Base','2026-12-31','Completed'],['JR-20261230-004','Monthly VM-21 Pack','VM-21 Deterministic','2026-12-31','Completed'],['JR-20261228-002','Pricing Sensitivity Pack','Low Interest Rate','2026-12-31','Stale']].map(row => <button key={row[0]} onClick={onOpen}><span><b>{row[0]}</b><small>{row[1]}</small></span><span>{row[2]}</span><span>{row[3]}</span><StatusBadge status={row[4] as 'Completed' | 'Stale'} /><ArrowRight size={16} /></button>)}</div></div> }
|
| 12 |
function Compare({ onBack, onVariance }: { onBack: () => void; onVariance: () => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to Results Explorer</button><div className="panel comparison-header"><div><span className="eyebrow">Run comparison</span><h2 className="section-title">Base vs Low Interest Rate</h2><p className="muted">Model v3.2 · same input snapshot · scenario-only difference</p></div><StatusBadge status="Validated" /></div><div className="comparison-grid"><CompareCard label="Base scenario" value="$1,245.6M" change="Reference" icon={<Check size={18} />} /><CompareCard label="Low Interest Rate" value="$998.1M" change="−19.9%" icon={<TrendingDown size={18} />} negative /></div><div className="panel"><div className="panel-title-row"><h2 className="section-title">Changed dimensions</h2><button className="button button-secondary" onClick={onVariance}><BarChart3 size={15} />Open driver variance</button></div><div className="changed-dimensions">{['Interest rate curve','Lapse rate','Net reserve','Expense load'].map((label,index) => <div key={label}><span>{label}</span><b>{['−125 bps','+0.12%','−247.5M','Unchanged'][index]}</b><small>{index === 2 ? 'Output difference' : 'Input / assumption'}</small></div>)}</div></div></div> }
|
| 13 |
+
function CompareCard({ label, value, change, icon, negative }: { label: string; value: string; change: string; icon: ReactNode; negative?: boolean }) { return <div className="panel compare-card"><span className="compare-card-icon">{icon}</span><span><small>{label}</small><strong>{value}</strong><b className={negative ? 'negative' : ''}>{change}</b></span></div> }
|
| 14 |
function Variance({ onBack }: { onBack: () => void }) { return <div className="workspace-stack"><button className="back-link" onClick={onBack}><ArrowLeft size={15} />Back to comparison</button><div className="panel variance-hero"><div><span className="eyebrow">Driver / Variance View</span><h2 className="section-title">What explains the −$247.5M change?</h2><p className="muted">Contribution analysis preserves the exact run pair and output lineage.</p></div><StatusBadge status="Validated" /></div><div className="panel"><div className="waterfall"><div className="waterfall-bar positive-bar" style={{ height: '72%' }}><span>+35M</span></div><div className="waterfall-bar negative-bar" style={{ height: '44%' }}><span>−120M</span></div><div className="waterfall-bar negative-bar" style={{ height: '31%' }}><span>−82M</span></div><div className="waterfall-bar negative-bar" style={{ height: '20%' }}><span>−80.5M</span></div><div className="waterfall-bar total-bar" style={{ height: '55%' }}><span>−247.5M</span></div></div><div className="waterfall-labels"><span>Mortality</span><span>Interest</span><span>Lapse</span><span>Expense</span><span>Net change</span></div></div></div> }
|
src/types.ts
CHANGED
|
@@ -6,7 +6,7 @@ export type ScreenName = 'Dashboard' | 'Models' | 'Inputs' | 'Scenarios' | 'Form
|
|
| 6 |
export type NavItem = { label: ScreenName; icon: LucideIcon; group?: string }
|
| 7 |
export type ModelStatus = 'Validated' | 'Needs review' | 'Draft'
|
| 8 |
export type LineageStatus = 'Shared' | 'Inherited' | 'Overridden' | 'Local'
|
| 9 |
-
export type ExecutionStatus = 'Completed' | 'Running' | 'Stale' | 'Validated' | 'Needs review'
|
| 10 |
|
| 11 |
export type Model = { name: string; version: string; basis: string; product: string; status: ModelStatus; updated: string; owner: string; runs: number }
|
| 12 |
export type RunRecord = { name: string; scenario: string; date: string; modified: string }
|
|
|
|
| 6 |
export type NavItem = { label: ScreenName; icon: LucideIcon; group?: string }
|
| 7 |
export type ModelStatus = 'Validated' | 'Needs review' | 'Draft'
|
| 8 |
export type LineageStatus = 'Shared' | 'Inherited' | 'Overridden' | 'Local'
|
| 9 |
+
export type ExecutionStatus = 'Completed' | 'Running' | 'Paused' | 'Cancelled' | 'Stale' | 'Validated' | 'Needs review'
|
| 10 |
|
| 11 |
export type Model = { name: string; version: string; basis: string; product: string; status: ModelStatus; updated: string; owner: string; runs: number }
|
| 12 |
export type RunRecord = { name: string; scenario: string; date: string; modified: string }
|