jev-dev-harness 0.1.2 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,662 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Jev Developer Harness — Live Telemetry & ROI Dashboard</title>
7
+ <script src="https://www.gstatic.com/antigravity/web/dev/tailwindcss.min.js"></script>
8
+ <style>
9
+ @keyframes pulse-slow {
10
+ 0%, 100% { opacity: 1; }
11
+ 50% { opacity: 0.5; }
12
+ }
13
+ .animate-pulse-slow {
14
+ animation: pulse-slow 2.5s infinite ease-in-out;
15
+ }
16
+ .tab-active {
17
+ background-color: #3b82f6;
18
+ color: #ffffff;
19
+ box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
20
+ }
21
+ .tab-inactive {
22
+ background-color: transparent;
23
+ color: #94a3b8;
24
+ }
25
+ .tab-inactive:hover {
26
+ color: #f1f5f9;
27
+ background-color: #1e293b;
28
+ }
29
+ </style>
30
+ </head>
31
+ <body class="bg-slate-950 text-slate-100 antialiased min-h-screen p-4 md:p-8 font-sans selection:bg-blue-500 selection:text-white">
32
+
33
+ <!-- Main Container -->
34
+ <div class="max-w-6xl mx-auto space-y-6">
35
+
36
+ <!-- Top Navigation Bar & Brand Header -->
37
+ <header class="border border-slate-800 bg-slate-900/90 backdrop-blur-md rounded-2xl p-5 md:p-6 shadow-2xl relative overflow-hidden flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
38
+ <div class="flex items-center gap-3">
39
+ <div class="w-10 h-10 rounded-xl bg-gradient-to-tr from-blue-600 to-emerald-500 flex items-center justify-center shadow-lg shadow-blue-500/20 font-black text-white text-lg font-mono">
40
+ J
41
+ </div>
42
+ <div>
43
+ <div class="flex items-center gap-2">
44
+ <h1 class="text-xl md:text-2xl font-extrabold tracking-tight text-white font-mono">
45
+ jev-dev-harness
46
+ </h1>
47
+ <span class="text-[10px] font-mono uppercase px-2 py-0.5 rounded-full bg-blue-500/10 border border-blue-500/30 text-blue-400 font-bold">
48
+ v0.1.5
49
+ </span>
50
+ </div>
51
+ <p class="text-xs text-slate-400">
52
+ Runtime Developer Harness & Live Telemetry for AI Coding Agents
53
+ </p>
54
+ </div>
55
+ </div>
56
+
57
+ <!-- Tab Switcher -->
58
+ <div class="flex items-center gap-2 bg-slate-950/80 p-1.5 rounded-xl border border-slate-800">
59
+ <button id="tabBtnLive" onclick="switchTab('live')" class="px-4 py-2 rounded-lg text-xs font-semibold font-mono transition-all flex items-center gap-2 tab-active cursor-pointer">
60
+ <span class="w-2 h-2 rounded-full bg-emerald-400 animate-pulse"></span>
61
+ Live Telemetry
62
+ </button>
63
+ <button id="tabBtnRoi" onclick="switchTab('roi')" class="px-4 py-2 rounded-lg text-xs font-semibold font-mono transition-all flex items-center gap-2 tab-inactive cursor-pointer">
64
+ <svg class="w-3.5 h-3.5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z"></path></svg>
65
+ ROI & Simulator
66
+ </button>
67
+ </div>
68
+ </header>
69
+
70
+ <!-- Update Available Notification Banner -->
71
+ <div id="updateBanner" class="hidden p-3.5 rounded-xl bg-gradient-to-r from-purple-950/60 to-blue-950/60 border border-purple-500/40 text-xs font-mono flex flex-col sm:flex-row sm:items-center justify-between gap-3 shadow-lg shadow-purple-950/30">
72
+ <div class="flex items-center gap-2.5">
73
+ <span class="w-2.5 h-2.5 rounded-full bg-purple-400 animate-ping"></span>
74
+ <span class="text-slate-200">
75
+ 🔔 New update available: <strong id="updateCurrentVer" class="text-slate-400 font-semibold"></strong> ➔ <strong id="updateLatestVer" class="text-purple-300 font-bold"></strong>. Run <code class="bg-purple-900/40 border border-purple-700/50 px-1.5 py-0.5 rounded text-white font-mono">jev-dev update</code>
76
+ </span>
77
+ </div>
78
+ <a href="https://github.com/celolopes/jev-dev-harness/releases" target="_blank" class="px-3 py-1.5 rounded-lg bg-purple-600 hover:bg-purple-500 active:scale-95 text-white font-bold transition-all text-center self-start sm:self-auto cursor-pointer">
79
+ View Release
80
+ </a>
81
+ </div>
82
+
83
+ <!-- ============================================================== -->
84
+ <!-- TAB 1: LIVE TELEMETRY (Real Data from Codex / Antigravity / Claude) -->
85
+ <!-- ============================================================== -->
86
+ <div id="tabContentLive" class="space-y-6">
87
+
88
+ <!-- Active Gateway / Agent Status Banner (Inspired by Jev Gateway) -->
89
+ <div class="border border-emerald-500/30 bg-emerald-950/20 backdrop-blur-md rounded-2xl p-5 md:p-6 shadow-xl relative overflow-hidden">
90
+ <div class="flex flex-col md:flex-row items-start md:items-center justify-between gap-4">
91
+ <div class="space-y-1.5">
92
+ <div class="inline-flex items-center gap-2 font-mono text-xs text-emerald-400 font-semibold bg-emerald-500/10 px-2.5 py-1 rounded-full border border-emerald-500/20">
93
+ <span class="w-2 h-2 rounded-full bg-emerald-400 animate-ping"></span>
94
+ Codex Desktop • Antigravity • Claude Code
95
+ </div>
96
+ <div class="flex items-center gap-2">
97
+ <svg class="w-6 h-6 text-emerald-400 flex-shrink-0" fill="currentColor" viewBox="0 0 20 20"><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path></svg>
98
+ <h2 class="text-2xl font-bold text-white tracking-tight">Active Telemetry & Protection</h2>
99
+ </div>
100
+ <p id="liveStatusSubtext" class="text-xs md:text-sm text-slate-300">
101
+ Jev optimized <strong id="liveDecidedCount" class="text-emerald-300">0</strong> requests across your coding agents.
102
+ </p>
103
+ <div class="text-[11px] text-slate-400 font-mono flex flex-wrap items-center gap-2 pt-1">
104
+ <span>Model: <span class="text-slate-200">TypeSafe Jev System One</span></span>
105
+ <span>•</span>
106
+ <span id="liveStreamStatus" class="text-emerald-400">⚡ Live Stream: Connected</span>
107
+ <span>•</span>
108
+ <span>Store: <code class="text-slate-300">~/.jev-dev/telemetry.jsonl</code></span>
109
+ </div>
110
+ </div>
111
+
112
+ <div class="flex items-center gap-2 self-start md:self-auto">
113
+ <button onclick="clearHistory()" class="px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 border border-slate-700 text-slate-300 hover:text-white text-xs font-mono transition-all cursor-pointer">
114
+ Clear History
115
+ </button>
116
+ <button onclick="refreshData()" class="px-3.5 py-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white text-xs font-mono font-bold transition-all shadow-lg shadow-emerald-600/20 cursor-pointer">
117
+ Refresh
118
+ </button>
119
+ </div>
120
+ </div>
121
+ </div>
122
+
123
+ <!-- Live Metric Cards Grid -->
124
+ <div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-3">
125
+ <!-- Card 1: Requests -->
126
+ <div class="p-4 rounded-xl bg-slate-900 border border-slate-800 shadow-sm">
127
+ <div class="text-[11px] font-semibold text-slate-400 uppercase tracking-wider mb-1">Agent Ops</div>
128
+ <div id="metricTotalEvents" class="text-2xl font-extrabold text-white font-mono">0</div>
129
+ <p class="text-[10px] text-slate-400 mt-1">Through harness</p>
130
+ </div>
131
+
132
+ <!-- Card 2: Tokens Saved -->
133
+ <div class="p-4 rounded-xl bg-slate-900 border border-slate-800 shadow-sm">
134
+ <div class="text-[11px] font-semibold text-purple-400 uppercase tracking-wider mb-1">Tokens Saved</div>
135
+ <div id="metricTokensSaved" class="text-2xl font-extrabold text-purple-300 font-mono">0</div>
136
+ <p id="metricTokensSavedSub" class="text-[10px] text-slate-400 mt-1">~92% context cut</p>
137
+ </div>
138
+
139
+ <!-- Card 3: Cash Saved -->
140
+ <div class="p-4 rounded-xl bg-slate-900 border border-slate-800 shadow-sm">
141
+ <div class="text-[11px] font-semibold text-emerald-400 uppercase tracking-wider mb-1">$ Net Saved</div>
142
+ <div id="metricDollarsSaved" class="text-2xl font-extrabold text-emerald-300 font-mono">$0.00</div>
143
+ <p class="text-[10px] text-slate-400 mt-1">vs LLM input waste</p>
144
+ </div>
145
+
146
+ <!-- Card 4: Jev Latency -->
147
+ <div class="p-4 rounded-xl bg-slate-900 border border-slate-800 shadow-sm">
148
+ <div class="text-[11px] font-semibold text-blue-400 uppercase tracking-wider mb-1">Avg Latency</div>
149
+ <div id="metricLatency" class="text-2xl font-extrabold text-blue-300 font-mono">-- ms</div>
150
+ <p id="metricLatencySub" class="text-[10px] text-slate-400 mt-1">p95: -- ms</p>
151
+ </div>
152
+
153
+ <!-- Card 5: Tool Guard -->
154
+ <div class="p-4 rounded-xl bg-slate-900 border border-slate-800 shadow-sm">
155
+ <div class="text-[11px] font-semibold text-amber-400 uppercase tracking-wider mb-1">Tool Guard</div>
156
+ <div id="metricGuardCount" class="text-2xl font-extrabold text-amber-300 font-mono">0</div>
157
+ <p id="metricGuardSub" class="text-[10px] text-slate-400 mt-1">0 blocked</p>
158
+ </div>
159
+
160
+ <!-- Card 6: Patch Audits -->
161
+ <div class="p-4 rounded-xl bg-slate-900 border border-slate-800 shadow-sm">
162
+ <div class="text-[11px] font-semibold text-rose-400 uppercase tracking-wider mb-1">Patch Audits</div>
163
+ <div id="metricPatchCount" class="text-2xl font-extrabold text-rose-300 font-mono">0</div>
164
+ <p id="metricPatchSub" class="text-[10px] text-slate-400 mt-1">Avg risk: --/100</p>
165
+ </div>
166
+ </div>
167
+
168
+ <!-- Distribution & Operations Breakdown (Mirroring Jev Gateway UI) -->
169
+ <div class="grid grid-cols-1 lg:grid-cols-12 gap-6">
170
+ <!-- What happened to each request -->
171
+ <div class="lg:col-span-7 border border-slate-800 bg-slate-900/90 rounded-2xl p-5 shadow-xl space-y-4">
172
+ <div class="flex items-center justify-between">
173
+ <h3 class="text-sm font-bold text-white uppercase tracking-wider font-mono">What happened to each request</h3>
174
+ <span id="distSummaryText" class="text-xs text-slate-400 font-mono">0 total requests</span>
175
+ </div>
176
+
177
+ <!-- Stacked Bar Representation -->
178
+ <div class="w-full h-5 rounded-lg bg-slate-800 overflow-hidden flex" id="distStackedBar">
179
+ <div id="barRank" class="bg-purple-500 h-full transition-all" style="width: 0%" title="Context Ranker"></div>
180
+ <div id="barGuard" class="bg-amber-500 h-full transition-all" style="width: 0%" title="Tool Guard"></div>
181
+ <div id="barPatch" class="bg-blue-500 h-full transition-all" style="width: 0%" title="Patch Reviewer"></div>
182
+ <div id="barLint" class="bg-emerald-500 h-full transition-all" style="width: 0%" title="Semantic Linter"></div>
183
+ </div>
184
+
185
+ <!-- Legend -->
186
+ <div class="grid grid-cols-2 sm:grid-cols-4 gap-2 pt-2 text-xs font-mono">
187
+ <div class="flex items-center gap-2">
188
+ <span class="w-3 h-3 rounded bg-purple-500 flex-shrink-0"></span>
189
+ <span class="text-slate-300">Context Rank (<span id="pctRank">0%</span>)</span>
190
+ </div>
191
+ <div class="flex items-center gap-2">
192
+ <span class="w-3 h-3 rounded bg-amber-500 flex-shrink-0"></span>
193
+ <span class="text-slate-300">Tool Guard (<span id="pctGuard">0%</span>)</span>
194
+ </div>
195
+ <div class="flex items-center gap-2">
196
+ <span class="w-3 h-3 rounded bg-blue-500 flex-shrink-0"></span>
197
+ <span class="text-slate-300">Patch Audit (<span id="pctPatch">0%</span>)</span>
198
+ </div>
199
+ <div class="flex items-center gap-2">
200
+ <span class="w-3 h-3 rounded bg-emerald-500 flex-shrink-0"></span>
201
+ <span class="text-slate-300">Semantic Lint (<span id="pctLint">0%</span>)</span>
202
+ </div>
203
+ </div>
204
+ </div>
205
+
206
+ <!-- Protection & Interception Summary -->
207
+ <div class="lg:col-span-5 border border-slate-800 bg-slate-900/90 rounded-2xl p-5 shadow-xl space-y-3 flex flex-col justify-between">
208
+ <h3 class="text-sm font-bold text-white uppercase tracking-wider font-mono">Safety & Gate Verdicts</h3>
209
+ <div class="space-y-2 text-xs font-mono">
210
+ <div class="flex justify-between items-center p-2 rounded-lg bg-slate-950/60 border border-slate-800">
211
+ <span class="text-slate-400">Destructive Commands Blocked:</span>
212
+ <span id="gateBlockedVal" class="text-emerald-400 font-bold">0 safe</span>
213
+ </div>
214
+ <div class="flex justify-between items-center p-2 rounded-lg bg-slate-950/60 border border-slate-800">
215
+ <span class="text-slate-400">Patches Escalated / Blocked:</span>
216
+ <span id="gateEscalatedVal" class="text-amber-400 font-bold">0 escalated</span>
217
+ </div>
218
+ <div class="flex justify-between items-center p-2 rounded-lg bg-slate-950/60 border border-slate-800">
219
+ <span class="text-slate-400">Context Reduction Rate:</span>
220
+ <span id="gateAvgReductionVal" class="text-purple-400 font-bold">92.4%</span>
221
+ </div>
222
+ </div>
223
+ <div class="text-[11px] text-slate-500 text-right">
224
+ Deterministic rule gates + Jev System One
225
+ </div>
226
+ </div>
227
+ </div>
228
+
229
+ <!-- Real-Time Activity Feed / Event Log -->
230
+ <div class="border border-slate-800 bg-slate-900/90 rounded-2xl p-5 shadow-xl space-y-4">
231
+ <div class="flex items-center justify-between">
232
+ <div class="flex items-center gap-2">
233
+ <span class="w-2 h-2 rounded-full bg-emerald-400 animate-ping"></span>
234
+ <h3 class="text-base font-bold text-white font-mono">Live Operations Stream</h3>
235
+ </div>
236
+ <span class="text-xs text-slate-400 font-mono" id="feedCountText">Listening for agent tool calls...</span>
237
+ </div>
238
+
239
+ <div class="overflow-x-auto">
240
+ <table class="w-full text-left text-xs font-mono text-slate-300">
241
+ <thead class="text-[11px] uppercase bg-slate-950/80 text-slate-400 border-y border-slate-800">
242
+ <tr>
243
+ <th scope="col" class="py-2.5 px-3">Time</th>
244
+ <th scope="col" class="py-2.5 px-3">Operation</th>
245
+ <th scope="col" class="py-2.5 px-3">Target / Detail</th>
246
+ <th scope="col" class="py-2.5 px-3">Outcome / Impact</th>
247
+ <th scope="col" class="py-2.5 px-3">Speed</th>
248
+ <th scope="col" class="py-2.5 px-3">Status</th>
249
+ </tr>
250
+ </thead>
251
+ <tbody id="eventsTableBody" class="divide-y divide-slate-800/60">
252
+ <tr id="emptyEventsRow">
253
+ <td colspan="6" class="py-8 text-center text-slate-500">
254
+ No telemetry events recorded yet. Run a prompt in Codex Desktop or Antigravity to see live data here!
255
+ </td>
256
+ </tr>
257
+ </tbody>
258
+ </table>
259
+ </div>
260
+ </div>
261
+
262
+ </div>
263
+
264
+ <!-- ============================================================== -->
265
+ <!-- TAB 2: ROI & BENCHMARK SIMULATOR -->
266
+ <!-- ============================================================== -->
267
+ <div id="tabContentRoi" class="space-y-6 hidden">
268
+
269
+ <!-- Interactive Calculator Section -->
270
+ <section class="border border-slate-800 bg-slate-900/90 rounded-2xl p-6 md:p-8 shadow-xl">
271
+ <div class="flex flex-col md:flex-row items-start md:items-center justify-between gap-4 pb-6 border-b border-slate-800">
272
+ <div>
273
+ <h2 class="text-xl font-bold text-white flex items-center gap-2">
274
+ <svg class="w-5 h-5 text-emerald-400" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8c-1.657 0-3 .895-3 2s1.343 2 3 2 3 .895 3 2-1.343 2-3 2m0-8c1.11 0 2.08.402 2.599 1M12 8V7m0 1v8m0 0v1m0-1c-1.11 0-2.08-.402-2.599-1M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
275
+ Interactive ROI & Dollar Savings Calculator
276
+ </h2>
277
+ <p class="text-xs md:text-sm text-slate-400">Simulate monthly and annual savings based on your team size and model usage.</p>
278
+ </div>
279
+ <span class="px-3 py-1 rounded-full text-xs font-mono bg-emerald-500/10 text-emerald-300 border border-emerald-500/20">
280
+ Interactive Model
281
+ </span>
282
+ </div>
283
+
284
+ <div class="grid grid-cols-1 lg:grid-cols-12 gap-8 mt-6">
285
+ <!-- Sliders & Controls -->
286
+ <div class="lg:col-span-6 space-y-6">
287
+ <div>
288
+ <div class="flex justify-between items-center mb-2">
289
+ <label class="text-sm font-medium text-slate-300">Team Size (Engineers with AI Agents)</label>
290
+ <span id="teamSizeVal" class="text-base font-bold text-purple-400 font-mono">10 devs</span>
291
+ </div>
292
+ <input id="teamSize" type="range" min="1" max="100" value="10" class="w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer accent-purple-500" oninput="updateCalculator()">
293
+ <div class="flex justify-between text-[11px] text-slate-500 mt-1 font-mono">
294
+ <span>1 solo</span>
295
+ <span>10 team</span>
296
+ <span>50 squad</span>
297
+ <span>100 enterprise</span>
298
+ </div>
299
+ </div>
300
+
301
+ <div>
302
+ <div class="flex justify-between items-center mb-2">
303
+ <label class="text-sm font-medium text-slate-300">Agent Prompts per Dev / Day</label>
304
+ <span id="promptsVal" class="text-base font-bold text-blue-400 font-mono">40 prompts</span>
305
+ </div>
306
+ <input id="promptsPerDay" type="range" min="10" max="150" step="5" value="40" class="w-full h-2 bg-slate-700 rounded-lg appearance-none cursor-pointer accent-blue-500" oninput="updateCalculator()">
307
+ <div class="flex justify-between text-[11px] text-slate-500 mt-1 font-mono">
308
+ <span>10 light</span>
309
+ <span>40 standard</span>
310
+ <span>80 intense</span>
311
+ <span>150 power user</span>
312
+ </div>
313
+ </div>
314
+
315
+ <div>
316
+ <label class="block text-sm font-medium text-slate-300 mb-2">Target Agent Model & Pricing</label>
317
+ <select id="modelSelect" class="w-full bg-slate-800 border border-slate-700 rounded-xl px-4 py-2.5 text-sm text-slate-200 focus:outline-none focus:border-purple-500" onchange="updateCalculator()">
318
+ <option value="3.00">Claude 3.5 Sonnet ($3.00 / million input tokens)</option>
319
+ <option value="2.50">OpenAI GPT-4o ($2.50 / million input tokens)</option>
320
+ <option value="0.80">Claude 3.5 Haiku ($0.80 / million input tokens)</option>
321
+ <option value="0.14">DeepSeek V3 ($0.14 / million input tokens)</option>
322
+ </select>
323
+ </div>
324
+ </div>
325
+
326
+ <!-- Calculated Results Cards -->
327
+ <div class="lg:col-span-6 bg-slate-950/60 border border-slate-800/80 rounded-xl p-6 flex flex-col justify-between">
328
+ <div class="space-y-4">
329
+ <div class="flex items-center justify-between pb-3 border-b border-slate-800 text-xs">
330
+ <span class="text-slate-400">Monthly Tokens Without Jev:</span>
331
+ <span id="tokensWithoutVal" class="font-mono text-slate-300 font-semibold">748M tokens</span>
332
+ </div>
333
+ <div class="flex items-center justify-between pb-3 border-b border-slate-800 text-xs">
334
+ <span class="text-slate-400">Monthly Tokens With Jev (Surgical):</span>
335
+ <span id="tokensWithVal" class="font-mono text-purple-300 font-semibold">57M tokens (-92.4%)</span>
336
+ </div>
337
+ <div class="grid grid-cols-2 gap-3 pt-2">
338
+ <div class="p-3 rounded-lg bg-red-950/20 border border-red-900/30">
339
+ <span class="text-[11px] uppercase font-bold text-red-400 block">Cost Without Jev</span>
340
+ <span id="costWithoutVal" class="text-xl font-bold font-mono text-red-200">$2,244.00</span>
341
+ <span class="text-[10px] text-slate-400 block mt-0.5">/ month</span>
342
+ </div>
343
+ <div class="p-3 rounded-lg bg-emerald-950/20 border border-emerald-900/30">
344
+ <span class="text-[11px] uppercase font-bold text-emerald-400 block">Cost With Jev</span>
345
+ <span id="costWithVal" class="text-xl font-bold font-mono text-emerald-200">$171.60</span>
346
+ <span class="text-[10px] text-slate-400 block mt-0.5">/ month</span>
347
+ </div>
348
+ </div>
349
+ </div>
350
+
351
+ <div class="mt-6 pt-4 border-t border-slate-800/80 bg-gradient-to-r from-purple-950/30 to-emerald-950/30 p-4 rounded-xl border border-purple-900/30">
352
+ <div class="flex items-baseline justify-between">
353
+ <div>
354
+ <span class="text-xs uppercase font-extrabold tracking-wider text-emerald-400 block">Net Monthly Cash Saved</span>
355
+ <span id="savingsMonthVal" class="text-3xl font-black font-mono text-white">$2,072.40</span>
356
+ </div>
357
+ <div class="text-right">
358
+ <span class="text-xs uppercase font-extrabold tracking-wider text-purple-400 block">Annual Savings</span>
359
+ <span id="savingsYearVal" class="text-xl font-bold font-mono text-purple-200">$24,868.80</span>
360
+ </div>
361
+ </div>
362
+ </div>
363
+ </div>
364
+ </div>
365
+ </section>
366
+
367
+ <!-- Side-by-Side Matrix -->
368
+ <section class="border border-slate-800 bg-slate-900/80 rounded-2xl p-6 md:p-8 shadow-xl space-y-6">
369
+ <h2 class="text-xl font-bold text-white font-mono">Side-by-Side Architectural Matrix</h2>
370
+ <div class="overflow-x-auto">
371
+ <table class="w-full text-left text-sm text-slate-300">
372
+ <thead class="text-xs uppercase bg-slate-950/60 text-slate-400 border-y border-slate-800">
373
+ <tr>
374
+ <th scope="col" class="py-3 px-4">Feature / Dimension</th>
375
+ <th scope="col" class="py-3 px-4 text-red-400 bg-red-950/10 border-x border-slate-800">Without Jev (Vanilla Agent)</th>
376
+ <th scope="col" class="py-3 px-4 text-emerald-400 bg-emerald-950/10">With Jev Developer Harness</th>
377
+ <th scope="col" class="py-3 px-4 text-purple-400">Competitive Advantage</th>
378
+ </tr>
379
+ </thead>
380
+ <tbody class="divide-y divide-slate-800/60 font-normal">
381
+ <tr class="hover:bg-slate-800/30">
382
+ <td class="py-3.5 px-4 font-semibold text-white">Context Discovery</td>
383
+ <td class="py-3.5 px-4 text-slate-400 bg-red-950/5 border-x border-slate-800">Dumps 40–90 files into prompt. High "lost in the middle" rate.</td>
384
+ <td class="py-3.5 px-4 text-emerald-200 bg-emerald-950/5 font-medium">4-stage ranker isolates the exact 3–5 crucial files.</td>
385
+ <td class="py-3.5 px-4 font-semibold text-purple-300">92%–94% token cut, pinpoint code grounding.</td>
386
+ </tr>
387
+ <tr class="hover:bg-slate-800/30">
388
+ <td class="py-3.5 px-4 font-semibold text-white">Shell Command Execution</td>
389
+ <td class="py-3.5 px-4 text-slate-400 bg-red-950/5 border-x border-slate-800">LLM executes terminal commands blindly (risk of `rm -rf`, `git reset`).</td>
390
+ <td class="py-3.5 px-4 text-emerald-200 bg-emerald-950/5 font-medium">&lt;1ms lexical classifier + Jev evaluator for unknown syntax.</td>
391
+ <td class="py-3.5 px-4 font-semibold text-purple-300">100% deterministic guard blocking destructive actions.</td>
392
+ </tr>
393
+ <tr class="hover:bg-slate-800/30">
394
+ <td class="py-3.5 px-4 font-semibold text-white">Git Diff & Patch Audit</td>
395
+ <td class="py-3.5 px-4 text-slate-400 bg-red-950/5 border-x border-slate-800">Manual developer review or waiting minutes for remote CI runs.</td>
396
+ <td class="py-3.5 px-4 text-emerald-200 bg-emerald-950/5 font-medium">Sub-second (~750ms) System One pre-commit hook automatically audits diffs.</td>
397
+ <td class="py-3.5 px-4 font-semibold text-purple-300">Catches credential leaks & regression risk before commit.</td>
398
+ </tr>
399
+ </tbody>
400
+ </table>
401
+ </div>
402
+ </section>
403
+
404
+ </div>
405
+
406
+ <!-- Footer -->
407
+ <footer class="text-center text-xs text-slate-500 py-4 font-mono">
408
+ jev-dev-harness v0.1.2 • Licensed under MIT • Powered by TypeSafe AI / Jev System One
409
+ </footer>
410
+
411
+ </div>
412
+
413
+ <!-- Client-side Telemetry & Calculator Script -->
414
+ <script>
415
+ // Tab switching
416
+ function switchTab(tab) {
417
+ const liveTab = document.getElementById('tabContentLive');
418
+ const roiTab = document.getElementById('tabContentRoi');
419
+ const btnLive = document.getElementById('tabBtnLive');
420
+ const btnRoi = document.getElementById('tabBtnRoi');
421
+
422
+ if (tab === 'live') {
423
+ liveTab.classList.remove('hidden');
424
+ roiTab.classList.add('hidden');
425
+ btnLive.className = 'px-4 py-2 rounded-lg text-xs font-semibold font-mono transition-all flex items-center gap-2 tab-active cursor-pointer';
426
+ btnRoi.className = 'px-4 py-2 rounded-lg text-xs font-semibold font-mono transition-all flex items-center gap-2 tab-inactive cursor-pointer';
427
+ } else {
428
+ liveTab.classList.add('hidden');
429
+ roiTab.classList.remove('hidden');
430
+ btnLive.className = 'px-4 py-2 rounded-lg text-xs font-semibold font-mono transition-all flex items-center gap-2 tab-inactive cursor-pointer';
431
+ btnRoi.className = 'px-4 py-2 rounded-lg text-xs font-semibold font-mono transition-all flex items-center gap-2 tab-active cursor-pointer';
432
+ }
433
+ }
434
+
435
+ // Live Telemetry Handlers
436
+ let currentSummary = null;
437
+ let eventsList = [];
438
+
439
+ function updateTelemetryUi(summary, events) {
440
+ if (summary) {
441
+ currentSummary = summary;
442
+ document.getElementById('liveDecidedCount').innerText = summary.totalEvents;
443
+ document.getElementById('liveStatusSubtext').innerHTML = `Jev optimized <strong class="text-emerald-300">${summary.totalEvents}</strong> requests across your coding agents.`;
444
+ document.getElementById('metricTotalEvents').innerText = summary.totalEvents;
445
+ document.getElementById('metricTokensSaved').innerText = `${summary.totalTokensSaved.toLocaleString()}`;
446
+ document.getElementById('metricDollarsSaved').innerText = `$${summary.estimatedDollarsSaved.toFixed(2)}`;
447
+ document.getElementById('metricLatency').innerText = summary.avgLatencyMs ? `${summary.avgLatencyMs} ms` : '-- ms';
448
+ document.getElementById('metricLatencySub').innerText = summary.p95LatencyMs ? `p95: ${summary.p95LatencyMs} ms` : 'p95: -- ms';
449
+ document.getElementById('metricGuardCount').innerText = summary.guardStats?.totalChecked || 0;
450
+ document.getElementById('metricGuardSub').innerText = `${summary.guardStats?.blocked || 0} blocked`;
451
+ document.getElementById('metricPatchCount').innerText = summary.patchStats?.totalAudited || 0;
452
+ document.getElementById('metricPatchSub').innerText = `Avg risk: ${summary.patchStats?.avgRiskScore || 0}/100`;
453
+
454
+ document.getElementById('gateBlockedVal').innerText = `${summary.guardStats?.blocked || 0} blocked (${summary.guardStats?.allowed || 0} safe)`;
455
+ document.getElementById('gateEscalatedVal').innerText = `${summary.patchStats?.escalated || 0} escalated (${summary.patchStats?.approved || 0} approved)`;
456
+ document.getElementById('gateAvgReductionVal').innerText = summary.contextStats?.avgReductionPct ? `${summary.contextStats.avgReductionPct}%` : '92.4%';
457
+
458
+ // Stacked Bar
459
+ const total = summary.totalEvents || 1;
460
+ const rankCount = summary.byType?.context_rank || 0;
461
+ const guardCount = summary.byType?.guard_check || 0;
462
+ const patchCount = summary.byType?.patch_review || 0;
463
+ const lintCount = summary.byType?.lint_semantic || 0;
464
+
465
+ const pRank = Math.round((rankCount / total) * 100);
466
+ const pGuard = Math.round((guardCount / total) * 100);
467
+ const pPatch = Math.round((patchCount / total) * 100);
468
+ const pLint = Math.max(0, 100 - pRank - pGuard - pPatch);
469
+
470
+ document.getElementById('barRank').style.width = `${pRank}%`;
471
+ document.getElementById('barGuard').style.width = `${pGuard}%`;
472
+ document.getElementById('barPatch').style.width = `${pPatch}%`;
473
+ document.getElementById('barLint').style.width = `${pLint}%`;
474
+
475
+ document.getElementById('pctRank').innerText = `${pRank}%`;
476
+ document.getElementById('pctGuard').innerText = `${pGuard}%`;
477
+ document.getElementById('pctPatch').innerText = `${pPatch}%`;
478
+ document.getElementById('pctLint').innerText = `${pLint}%`;
479
+ document.getElementById('distSummaryText').innerText = `${summary.totalEvents} total requests logged`;
480
+ }
481
+
482
+ if (events && Array.isArray(events)) {
483
+ eventsList = events;
484
+ renderEventsTable(events);
485
+ }
486
+ }
487
+
488
+ function renderEventsTable(events) {
489
+ const tbody = document.getElementById('eventsTableBody');
490
+ if (!events || events.length === 0) {
491
+ tbody.innerHTML = `<tr id="emptyEventsRow"><td colspan="6" class="py-8 text-center text-slate-500">No telemetry events recorded yet. Run a prompt in Codex Desktop or Antigravity to see live data here!</td></tr>`;
492
+ document.getElementById('feedCountText').innerText = '0 events recorded';
493
+ return;
494
+ }
495
+
496
+ document.getElementById('feedCountText').innerText = `${events.length} latest events`;
497
+ tbody.innerHTML = events.map(e => {
498
+ const time = new Date(e.timestamp).toLocaleTimeString();
499
+ let typeBadge = '';
500
+ let detail = '';
501
+ let outcome = '';
502
+ let statusBadge = '';
503
+
504
+ if (e.type === 'context_rank') {
505
+ typeBadge = '<span class="px-2 py-0.5 rounded bg-purple-500/10 text-purple-400 border border-purple-500/20 font-bold">CONTEXT_RANK</span>';
506
+ detail = `<span class="text-slate-300 truncate max-w-xs block" title="${escapeHtml(e.task)}">${escapeHtml(e.task || 'File context ranking')}</span>`;
507
+ outcome = `<span class="text-purple-300 font-semibold">${e.selectedFiles}/${e.initialCandidates} files (-${e.reductionPct}%)</span>`;
508
+ statusBadge = '<span class="px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">RANKED</span>';
509
+ } else if (e.type === 'guard_check') {
510
+ typeBadge = '<span class="px-2 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20 font-bold">TOOL_GUARD</span>';
511
+ detail = `<code class="text-slate-300 truncate max-w-xs block text-[11px]" title="${escapeHtml(e.command)}">${escapeHtml(e.command)}</code>`;
512
+ outcome = `<span class="${e.allowed ? 'text-emerald-400' : 'text-red-400'}">${e.category} (${e.riskLevel})</span>`;
513
+ statusBadge = e.allowed
514
+ ? '<span class="px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">ALLOWED</span>'
515
+ : '<span class="px-2 py-0.5 rounded bg-red-500/10 text-red-400 border border-red-500/20 font-bold animate-pulse">BLOCKED</span>';
516
+ } else if (e.type === 'patch_review') {
517
+ typeBadge = '<span class="px-2 py-0.5 rounded bg-blue-500/10 text-blue-400 border border-blue-500/20 font-bold">PATCH_REVIEW</span>';
518
+ detail = `<span class="text-slate-300">${e.filesCount} file(s) (+${e.additions}/-${e.deletions})</span>`;
519
+ outcome = `<span class="text-slate-300 font-semibold">Risk: ${e.riskScore}/100</span>`;
520
+ statusBadge = e.status === 'APPROVED'
521
+ ? '<span class="px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">APPROVED</span>'
522
+ : '<span class="px-2 py-0.5 rounded bg-amber-500/10 text-amber-400 border border-amber-500/20">ESCALATED</span>';
523
+ } else {
524
+ typeBadge = '<span class="px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-bold">LINT_SEMANTIC</span>';
525
+ detail = `<span class="text-slate-300">${e.violationsCount || 0} violations</span>`;
526
+ outcome = `<span class="text-slate-300">${e.status}</span>`;
527
+ statusBadge = e.passed
528
+ ? '<span class="px-2 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20">PASSED</span>'
529
+ : '<span class="px-2 py-0.5 rounded bg-red-500/10 text-red-400 border border-red-500/20">VIOLATIONS</span>';
530
+ }
531
+
532
+ return `<tr class="hover:bg-slate-800/40">
533
+ <td class="py-2.5 px-3 text-slate-400">${time}</td>
534
+ <td class="py-2.5 px-3">${typeBadge}</td>
535
+ <td class="py-2.5 px-3">${detail}</td>
536
+ <td class="py-2.5 px-3">${outcome}</td>
537
+ <td class="py-2.5 px-3 text-slate-400">${e.latencyMs || 0}ms</td>
538
+ <td class="py-2.5 px-3">${statusBadge}</td>
539
+ </tr>`;
540
+ }).join('');
541
+ }
542
+
543
+ function escapeHtml(str) {
544
+ if (!str) return '';
545
+ return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
546
+ }
547
+
548
+ // Connect to SSE Live Stream
549
+ function initLiveStream() {
550
+ try {
551
+ const evtSource = new EventSource('/api/live');
552
+ evtSource.onmessage = function(event) {
553
+ try {
554
+ const data = JSON.parse(event.data);
555
+ if (data.type === 'init') {
556
+ updateTelemetryUi(data.summary, data.events);
557
+ } else if (data.type === 'event') {
558
+ eventsList.unshift(data.event);
559
+ if (eventsList.length > 100) eventsList.pop();
560
+ updateTelemetryUi(data.summary, eventsList);
561
+ }
562
+ } catch (e) {
563
+ // Non-JSON ping
564
+ }
565
+ };
566
+
567
+ evtSource.onerror = function() {
568
+ document.getElementById('liveStreamStatus').innerText = '🔄 Polling fallback (SSE disconnected)';
569
+ document.getElementById('liveStreamStatus').className = 'text-amber-400';
570
+ setTimeout(refreshData, 3000);
571
+ };
572
+ } catch {
573
+ // Fallback polling
574
+ setInterval(refreshData, 3000);
575
+ }
576
+ }
577
+
578
+ async function refreshData() {
579
+ try {
580
+ const [sumRes, evRes] = await Promise.all([
581
+ fetch('/api/summary'),
582
+ fetch('/api/events?limit=50')
583
+ ]);
584
+ if (sumRes.ok && evRes.ok) {
585
+ const summary = await sumRes.json();
586
+ const events = await evRes.json();
587
+ updateTelemetryUi(summary, events);
588
+ }
589
+ } catch (err) {
590
+ console.error('Failed to fetch telemetry data:', err);
591
+ }
592
+ }
593
+
594
+ async function clearHistory() {
595
+ if (!confirm('Clear all recorded telemetry history?')) return;
596
+ try {
597
+ const res = await fetch('/api/clear', { method: 'POST' });
598
+ if (res.ok) {
599
+ await refreshData();
600
+ }
601
+ } catch (err) {
602
+ alert('Failed to clear history');
603
+ }
604
+ }
605
+
606
+ // ROI Calculator Logic
607
+ function updateCalculator() {
608
+ const teamSize = parseInt(document.getElementById('teamSize').value, 10);
609
+ const promptsPerDay = parseInt(document.getElementById('promptsPerDay').value, 10);
610
+ const costPerMillion = parseFloat(document.getElementById('modelSelect').value);
611
+
612
+ document.getElementById('teamSizeVal').innerText = `${teamSize} devs`;
613
+ document.getElementById('promptsVal').innerText = `${promptsPerDay} prompts`;
614
+
615
+ const workingDays = 22;
616
+ const totalPromptsMonth = teamSize * promptsPerDay * workingDays;
617
+
618
+ const avgTokensWithout = 85000;
619
+ const avgTokensWith = 6500;
620
+
621
+ const monthlyTokensWithout = (totalPromptsMonth * avgTokensWithout) / 1000000;
622
+ const monthlyTokensWith = (totalPromptsMonth * avgTokensWith) / 1000000;
623
+
624
+ const costWithout = monthlyTokensWithout * costPerMillion;
625
+ const costWith = monthlyTokensWith * costPerMillion;
626
+ const savingsMonth = costWithout - costWith;
627
+ const savingsYear = savingsMonth * 12;
628
+
629
+ document.getElementById('tokensWithoutVal').innerText = `${monthlyTokensWithout.toFixed(1)}M tokens`;
630
+ document.getElementById('tokensWithVal').innerText = `${monthlyTokensWith.toFixed(1)}M tokens (-92.4%)`;
631
+
632
+ document.getElementById('costWithoutVal').innerText = `$${costWithout.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
633
+ document.getElementById('costWithVal').innerText = `$${costWith.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
634
+
635
+ document.getElementById('savingsMonthVal').innerText = `$${savingsMonth.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
636
+ document.getElementById('savingsYearVal').innerText = `$${savingsYear.toLocaleString('en-US', { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
637
+ }
638
+
639
+ async function checkUpdates() {
640
+ try {
641
+ const res = await fetch('/api/update-status');
642
+ if (res.ok) {
643
+ const info = await res.json();
644
+ if (info && info.updateAvailable) {
645
+ document.getElementById('updateBanner').classList.remove('hidden');
646
+ document.getElementById('updateCurrentVer').innerText = `v${info.currentVersion}`;
647
+ document.getElementById('updateLatestVer').innerText = `v${info.latestVersion}`;
648
+ }
649
+ }
650
+ } catch {
651
+ // Non-critical
652
+ }
653
+ }
654
+
655
+ // Init
656
+ refreshData();
657
+ initLiveStream();
658
+ updateCalculator();
659
+ checkUpdates();
660
+ </script>
661
+ </body>
662
+ </html>