File size: 5,851 Bytes
5385772
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>RootCauseArena β€” Repair Strategy System V3</title>
  <meta name="description" content="An interactive simulation where an AI agent learns to diagnose and repair cascading system failures in real-time." />
  <link rel="preconnect" href="https://fonts.googleapis.com" />
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
  <link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet" />
  <link rel="stylesheet" href="/static/style.css" />
</head>
<body>

  <!-- ── HEADER ───────────────────────────────────────────── -->
  <header class="site-header">
    <div class="header-brand">
      <span class="brand-icon">⚑</span>
      <div>
        <h1 class="brand-title">RootCauseArena</h1>
        <p class="brand-subtitle">Repair Strategy System V3 Β· Hidden State Β· Multi-Root</p>
      </div>
    </div>
    <div class="header-status" id="server-status-badge">
      <span class="status-dot"></span>
      <span class="status-text">Connecting…</span>
    </div>
  </header>

  <!-- ── MAIN LAYOUT ──────────────────────────────────────── -->
  <main class="app-layout">

    <!-- LEFT: Control Panel -->
    <aside class="panel control-panel">
      <section class="panel-section">
        <h2 class="section-label">Mission Select</h2>
        <div class="task-grid" id="task-grid">
          <!-- Populated by JS -->
        </div>
      </section>

      <section class="panel-section">
        <h2 class="section-label">Episode Stats</h2>
        <div class="stat-grid">
          <div class="stat-card">
            <span class="stat-value" id="stat-step">β€”</span>
            <span class="stat-label">Step</span>
          </div>
          <div class="stat-card">
            <span class="stat-value" id="stat-reward">β€”</span>
            <span class="stat-label">Reward</span>
          </div>
          <div class="stat-card">
            <span class="stat-value" id="stat-inspections">β€”</span>
            <span class="stat-label">Inspections</span>
          </div>
          <div class="stat-card">
            <span class="stat-value" id="stat-max">β€”</span>
            <span class="stat-label">Max Steps</span>
          </div>
        </div>
        <div class="progress-bar-wrap">
          <div class="progress-bar-label">
            <span>Episode Progress</span>
            <span id="progress-pct">0%</span>
          </div>
          <div class="progress-track">
            <div class="progress-fill" id="progress-fill"></div>
          </div>
        </div>
      </section>

      <section class="panel-section">
        <h2 class="section-label">Action Console</h2>
        <div class="action-targets" id="action-targets">
          <!-- Populated by JS -->
        </div>
        <div class="action-buttons" id="action-buttons">
          <!-- Populated by JS -->
        </div>
        <button class="btn btn-secondary w-full mt" id="btn-no-op" disabled>
          ⏸ Wait / No-op
        </button>
      </section>

      <section class="panel-section">
        <button class="btn btn-danger w-full" id="btn-run-baseline">
          πŸ€– Run Baseline Agent
        </button>
      </section>
    </aside>

    <!-- CENTER: System Grid -->
    <div class="center-column">
      <div class="system-header">
        <h2 class="section-label">System Health Grid</h2>
        <div class="episode-status-badge" id="episode-badge">SELECT A MISSION</div>
      </div>

      <div class="components-grid" id="components-grid">
        <!-- Component cards injected by JS -->
        <div class="no-session-overlay" id="no-session-overlay">
          <div class="no-session-content">
            <div class="no-session-icon">πŸ› </div>
            <p>Select a mission and press <strong>Start Episode</strong></p>
          </div>
        </div>
      </div>

      <!-- Baseline Results Table -->
      <div class="baseline-section" id="baseline-section" style="display:none">
        <h2 class="section-label">Baseline Agent Results</h2>
        <table class="results-table" id="baseline-table">
          <thead>
            <tr>
              <th>Task</th>
              <th>Steps</th>
              <th>Reward</th>
              <th>Score</th>
              <th>Efficiency</th>
              <th>Status</th>
            </tr>
          </thead>
          <tbody id="baseline-tbody"></tbody>
        </table>
      </div>
    </div>

    <!-- RIGHT: Log Console -->
    <aside class="panel log-panel">
      <div class="log-header">
        <h2 class="section-label">Diagnostic Console</h2>
        <button class="btn-icon" id="btn-clear-logs" title="Clear logs">βœ•</button>
      </div>
      <div class="log-console" id="log-console">
        <div class="log-entry log-info">
          <span class="log-ts">00:00</span>
          <span class="log-msg">System initialised. Awaiting mission…</span>
        </div>
      </div>
    </aside>

  </main>

  <!-- Start Episode Modal Overlay -->
  <div class="modal-overlay" id="modal-overlay" style="display:none">
    <div class="modal">
      <h3 class="modal-title" id="modal-title">Starting Episode…</h3>
      <p class="modal-body" id="modal-body">Initialising environment, please wait.</p>
      <button class="btn btn-primary" id="modal-confirm">Begin Mission</button>
      <button class="btn btn-ghost" id="modal-cancel">Cancel</button>
    </div>
  </div>

  <script src="/static/app.js"></script>
</body>
</html>