File size: 2,637 Bytes
f1c3ff2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**
 * Compact per-page guides used by Help menu jump links and the help chatbot.
 * Detailed copy for PageIntro lives in content/pageHelp.ts; this file is the
 * short "what / why / key actions" index.
 */
import type { PageId } from '../context/LabelEvalContext';
import { PAGE_HELP } from '../content/pageHelp';

export interface PageGuide {
  pageId: PageId;
  title: string;
  summary: string;
  keyActions: string[];
}

const PAGE_TITLES: Record<PageId, string> = {
  command: 'Command Center',
  overview: 'Overview',
  datasets: 'Datasets',
  'label-generation': 'Label Generation',
  'rare-events': 'Rare Events',
  raremine: 'Rare-Event Miner',
  quality: 'Quality Engine',
  regression: 'Regression',
  rca: 'Root Cause Lab',
  triage: 'Triage',
  review: 'Human Review',
  training: 'Training',
  models: 'Models',
  evaluation: 'Evaluation Records',
  audit: 'Audit',
  pipeline: 'Pipeline Architecture',
  hillclimb: 'Hill Climbing EM',
  vitis: 'Hardware Acceleration',
  ssam: 'SSAM Safety',
  'safety-odd': 'ODD Coverage',
  'safety-gates': 'Release Gates',
  'safety-evidence': 'Evidence Package',
  'safety-ssam': 'SSAM Conflicts',
  'safety-calibration': 'Calibration',
  'safety-discrepancy': 'Discrepancy Mining',
  'safety-scenarios': 'Scenario DB',
  'safety-search': 'Semantic Search',
  seqeval: 'Sequential Regression',
  bevfusion: 'Perception Engines',
  'scenario-composer': 'Scenario Composer',
  'pipeline-builder': 'Pipeline Builder',
  'my-dashboard': 'My Dashboard',
  retro: 'Retrospective Analyzer',
  'closed-loop-lab': 'Closed-Loop Lab',
  'launch-readiness': 'Launch Readiness',
  studio2: 'Studio 2.0 Governance',
  legacy: 'Legacy Studio',
  'production-readiness': 'Production Readiness',
  rotr: 'ROTR Control Center',
};

/** Split an actions blurb into short bullet-like action phrases. */
function actionsFromBlurb(actions: string): string[] {
  return actions
    .split(/[.;]\s+/)
    .map((s) => s.replace(/^and\s+/i, '').trim())
    .filter((s) => s.length > 12)
    .slice(0, 5);
}

export const PAGE_GUIDES: Record<PageId, PageGuide> = Object.fromEntries(
  (Object.keys(PAGE_TITLES) as PageId[]).map((id) => {
    const help = PAGE_HELP[id];
    return [
      id,
      {
        pageId: id,
        title: PAGE_TITLES[id],
        summary: help.subtitle,
        keyActions: actionsFromBlurb(help.actions),
      } satisfies PageGuide,
    ];
  })
) as Record<PageId, PageGuide>;

export const PAGE_GUIDE_LIST: PageGuide[] = (Object.keys(PAGE_TITLES) as PageId[]).map(
  (id) => PAGE_GUIDES[id]
);

export function getPageGuide(id: PageId): PageGuide {
  return PAGE_GUIDES[id];
}