nvikou commited on
Commit
60e7ddd
·
verified ·
1 Parent(s): b1a7f6f

Metrics side-by-side overview; CRAG arch diagram; clear pipeline steps

Browse files
Files changed (4) hide show
  1. BUILD_STAMP.txt +2 -2
  2. static/app.js +13 -5
  3. static/index.html +82 -57
  4. static/styles.css +205 -1
BUILD_STAMP.txt CHANGED
@@ -1,2 +1,2 @@
1
- # Build stamp — force Space rebuild 2026-09-18d
2
- BUILD_ID=20260918d
 
1
+ # Build stamp — force Space rebuild 2026-09-18e
2
+ BUILD_ID=20260918e
static/app.js CHANGED
@@ -178,11 +178,19 @@ function renderContext(data) {
178
 
179
  const traceList = document.getElementById("trace-list");
180
  traceList.innerHTML = "";
181
- (data.trace || []).forEach((t) => {
182
- const li = document.createElement("li");
183
- li.textContent = t;
184
- traceList.appendChild(li);
185
- });
 
 
 
 
 
 
 
 
186
 
187
  document.getElementById("diag-supported").textContent = data.supported
188
  ? "Oui"
 
178
 
179
  const traceList = document.getElementById("trace-list");
180
  traceList.innerHTML = "";
181
+ const steps = data.trace || [];
182
+ if (!steps.length) {
183
+ traceList.innerHTML =
184
+ '<li class="muted">En attente — posez une question</li>';
185
+ } else {
186
+ steps.forEach((t, i) => {
187
+ const li = document.createElement("li");
188
+ li.innerHTML =
189
+ `<span class="step-idx">${i + 1}</span>` +
190
+ `<span class="step-text">${escapeHtml(t)}</span>`;
191
+ traceList.appendChild(li);
192
+ });
193
+ }
194
 
195
  document.getElementById("diag-supported").textContent = data.supported
196
  ? "Oui"
static/index.html CHANGED
@@ -7,7 +7,7 @@
7
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
  <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap" rel="stylesheet" />
10
- <link rel="stylesheet" href="/static/styles.css?v=20260918d" />
11
  </head>
12
  <body>
13
  <div class="app-shell">
@@ -98,9 +98,9 @@
98
  </div>
99
 
100
  <div class="insight-block">
101
- <div class="insight-label">Étapes</div>
102
- <ol class="plain-list numbered" id="trace-list">
103
- <li class="muted">—</li>
104
  </ol>
105
  </div>
106
 
@@ -137,30 +137,36 @@
137
  <span id="metrics-generated"></span>
138
  </p>
139
 
140
- <h2 class="section-title">Retrieval</h2>
141
- <div class="score-row" id="retrieval-grid"></div>
142
-
143
- <h2 class="section-title">Qualité de réponse</h2>
144
- <div class="score-row" id="quality-grid"></div>
145
-
146
- <h2 class="section-title">Temps</h2>
147
- <div class="score-row" id="time-grid"></div>
148
-
149
- <h2 class="section-title">Vue d’ensemble</h2>
150
- <div class="result-table-wrap">
151
- <table class="result-table">
152
- <thead>
153
- <tr>
154
- <th>Mesure</th>
155
- <th>Classique</th>
156
- <th>Corrective</th>
157
- <th>Écart</th>
158
- </tr>
159
- </thead>
160
- <tbody id="metrics-tbody"></tbody>
161
- </table>
 
 
 
 
 
 
 
162
  </div>
163
- <p class="footnote" id="metrics-footnote"></p>
164
  </div>
165
  </section>
166
 
@@ -168,40 +174,59 @@
168
  <div class="intro">
169
  <h1>Architecture</h1>
170
  <p>
171
- Quatre étapes. Si la recherche est faible, le système corrige
172
- avant d’écrire.
173
  </p>
174
  </div>
175
- <ol class="flow">
176
- <li>
177
- <span class="flow-num">01</span>
178
- <div>
179
- <h2>Recherche</h2>
180
- <p>Documents internes (PDF, MD, CSV) via embeddings.</p>
181
- </div>
182
- </li>
183
- <li>
184
- <span class="flow-num">02</span>
185
- <div>
186
- <h2>Jugement</h2>
187
- <p>Chaque passage est noté : assez bon, ambigu, ou trop faible.</p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
188
  </div>
189
- </li>
190
- <li>
191
- <span class="flow-num">03</span>
192
- <div>
193
- <h2>Correction</h2>
194
- <p>Filtrage, reformulation, ou SQL lecture seule sur les ventes.</p>
 
 
 
195
  </div>
196
- </li>
197
- <li>
198
- <span class="flow-num">04</span>
199
- <div>
200
- <h2>Réponse contrôlée</h2>
201
- <p>Génération sourcée, vérification, ou refus si non soutenu.</p>
 
202
  </div>
203
- </li>
204
- </ol>
 
205
  <p class="closing-note">
206
  Données locales · SQL SQLite sécurisé · pas d’invention hors preuves.
207
  </p>
@@ -209,6 +234,6 @@
209
 
210
  </main>
211
  </div>
212
- <script src="/static/app.js?v=20260918d"></script>
213
  </body>
214
  </html>
 
7
  <link rel="preconnect" href="https://fonts.googleapis.com" />
8
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
9
  <link href="https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700&family=Syne:wght@600;700;800&display=swap" rel="stylesheet" />
10
+ <link rel="stylesheet" href="/static/styles.css?v=20260918e" />
11
  </head>
12
  <body>
13
  <div class="app-shell">
 
98
  </div>
99
 
100
  <div class="insight-block">
101
+ <div class="insight-label">Étapes du pipeline</div>
102
+ <ol class="step-list" id="trace-list">
103
+ <li class="muted">En attente — posez une question</li>
104
  </ol>
105
  </div>
106
 
 
137
  <span id="metrics-generated"></span>
138
  </p>
139
 
140
+ <div class="metrics-layout">
141
+ <div class="metrics-cards">
142
+ <h2 class="section-title">Retrieval</h2>
143
+ <div class="score-row" id="retrieval-grid"></div>
144
+
145
+ <h2 class="section-title">Qualité de réponse</h2>
146
+ <div class="score-row" id="quality-grid"></div>
147
+
148
+ <h2 class="section-title">Temps</h2>
149
+ <div class="score-row score-row-tight" id="time-grid"></div>
150
+ </div>
151
+
152
+ <aside class="metrics-overview">
153
+ <h2 class="section-title">Vue d’ensemble</h2>
154
+ <div class="result-table-wrap">
155
+ <table class="result-table">
156
+ <thead>
157
+ <tr>
158
+ <th>Mesure</th>
159
+ <th>Classique</th>
160
+ <th>Corrective</th>
161
+ <th>Écart</th>
162
+ </tr>
163
+ </thead>
164
+ <tbody id="metrics-tbody"></tbody>
165
+ </table>
166
+ </div>
167
+ <p class="footnote" id="metrics-footnote"></p>
168
+ </aside>
169
  </div>
 
170
  </div>
171
  </section>
172
 
 
174
  <div class="intro">
175
  <h1>Architecture</h1>
176
  <p>
177
+ Pipeline Corrective RAG : la récupération est contrôlée et corrigée
178
+ avant la génération.
179
  </p>
180
  </div>
181
+
182
+ <div class="arch-flow" aria-label="Schéma Corrective RAG">
183
+ <div class="arch-node">
184
+ <div class="arch-title">Question utilisateur</div>
185
+ </div>
186
+ <div class="arch-arrow" aria-hidden="true"><span></span></div>
187
+
188
+ <div class="arch-node">
189
+ <div class="arch-kicker">1</div>
190
+ <div class="arch-title">Recherche vectorielle interne</div>
191
+ <div class="arch-note">Embeddings · index local</div>
192
+ </div>
193
+ <div class="arch-arrow" aria-hidden="true"><span></span></div>
194
+
195
+ <div class="arch-node">
196
+ <div class="arch-kicker">2</div>
197
+ <div class="arch-title">Évaluateur de pertinence</div>
198
+ <div class="arch-note">LLM structured output</div>
199
+ </div>
200
+ <div class="arch-arrow" aria-hidden="true"><span></span></div>
201
+
202
+ <div class="arch-branches">
203
+ <div class="arch-branch correct">
204
+ <div class="arch-branch-label">CORRECT</div>
205
+ <p>3A · Filtrer / reranker les passages</p>
206
+ <div class="arch-mini-arrow" aria-hidden="true"><span></span></div>
207
+ <p>4 · Génération sourcée</p>
208
  </div>
209
+ <div class="arch-branch ambiguous">
210
+ <div class="arch-branch-label">AMBIGUOUS</div>
211
+ <p>3B · Réécrire la requête</p>
212
+ <div class="arch-mini-arrow" aria-hidden="true"><span></span></div>
213
+ <p>Recherche complémentaire</p>
214
+ <div class="arch-mini-arrow" aria-hidden="true"><span></span></div>
215
+ <p>Fusion sources</p>
216
+ <div class="arch-mini-arrow" aria-hidden="true"><span></span></div>
217
+ <p>4 · Génération sourcée</p>
218
  </div>
219
+ <div class="arch-branch incorrect">
220
+ <div class="arch-branch-label">INCORRECT</div>
221
+ <p>3C · Écarter le contexte faible</p>
222
+ <div class="arch-mini-arrow" aria-hidden="true"><span></span></div>
223
+ <p>Recherche SQL / autre corpus</p>
224
+ <div class="arch-mini-arrow" aria-hidden="true"><span></span></div>
225
+ <p>Réponse ou refus justifié</p>
226
  </div>
227
+ </div>
228
+ </div>
229
+
230
  <p class="closing-note">
231
  Données locales · SQL SQLite sécurisé · pas d’invention hors preuves.
232
  </p>
 
234
 
235
  </main>
236
  </div>
237
+ <script src="/static/app.js?v=20260918e"></script>
238
  </body>
239
  </html>
static/styles.css CHANGED
@@ -472,6 +472,204 @@ body {
472
  gap: 12px;
473
  }
474
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
475
  .score-card {
476
  background: var(--surface);
477
  border: 1px solid var(--line);
@@ -614,10 +812,16 @@ body {
614
  }
615
 
616
  @media (max-width: 980px) {
617
- .workspace {
 
 
618
  grid-template-columns: 1fr;
619
  }
620
 
 
 
 
 
621
  .insight-panel {
622
  min-height: 0;
623
  }
 
472
  gap: 12px;
473
  }
474
 
475
+ .score-row-tight {
476
+ grid-template-columns: repeat(3, minmax(0, 1fr));
477
+ }
478
+
479
+ .metrics-layout {
480
+ display: grid;
481
+ grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
482
+ gap: 20px;
483
+ align-items: start;
484
+ }
485
+
486
+ .metrics-overview {
487
+ position: sticky;
488
+ top: 16px;
489
+ }
490
+
491
+ .metrics-overview .section-title {
492
+ margin-top: 0;
493
+ }
494
+
495
+ .step-list {
496
+ margin: 0;
497
+ padding: 0;
498
+ list-style: none;
499
+ display: flex;
500
+ flex-direction: column;
501
+ gap: 8px;
502
+ }
503
+
504
+ .step-list li {
505
+ display: grid;
506
+ grid-template-columns: 22px 1fr;
507
+ gap: 8px;
508
+ align-items: start;
509
+ font-size: 0.8rem;
510
+ line-height: 1.4;
511
+ color: var(--ink-2);
512
+ }
513
+
514
+ .step-idx {
515
+ width: 20px;
516
+ height: 20px;
517
+ border-radius: 50%;
518
+ background: rgba(27, 79, 70, 0.12);
519
+ color: var(--accent);
520
+ font-size: 0.7rem;
521
+ font-weight: 700;
522
+ display: grid;
523
+ place-items: center;
524
+ flex-shrink: 0;
525
+ }
526
+
527
+ .step-text {
528
+ min-width: 0;
529
+ word-break: break-word;
530
+ }
531
+
532
+ /* Architecture flowchart */
533
+ .arch-flow {
534
+ display: flex;
535
+ flex-direction: column;
536
+ align-items: center;
537
+ gap: 0;
538
+ max-width: 980px;
539
+ }
540
+
541
+ .arch-node {
542
+ width: min(100%, 420px);
543
+ background: var(--surface);
544
+ border: 1px solid var(--line);
545
+ padding: 14px 16px;
546
+ text-align: center;
547
+ }
548
+
549
+ .arch-kicker {
550
+ font-size: 0.7rem;
551
+ font-weight: 700;
552
+ letter-spacing: 0.08em;
553
+ color: var(--accent);
554
+ margin-bottom: 4px;
555
+ }
556
+
557
+ .arch-title {
558
+ font-family: var(--font-display);
559
+ font-weight: 700;
560
+ font-size: 1rem;
561
+ }
562
+
563
+ .arch-note {
564
+ margin-top: 4px;
565
+ font-size: 0.8rem;
566
+ color: var(--ink-3);
567
+ }
568
+
569
+ .arch-arrow {
570
+ width: 2px;
571
+ height: 28px;
572
+ background: var(--line);
573
+ position: relative;
574
+ margin: 4px 0;
575
+ }
576
+
577
+ .arch-arrow span,
578
+ .arch-mini-arrow span {
579
+ position: absolute;
580
+ left: 50%;
581
+ width: 8px;
582
+ height: 8px;
583
+ border-right: 2px solid var(--accent);
584
+ border-bottom: 2px solid var(--accent);
585
+ transform: translateX(-50%) rotate(45deg);
586
+ animation: arrow-pulse 1.4s ease-in-out infinite;
587
+ }
588
+
589
+ .arch-arrow span {
590
+ bottom: -2px;
591
+ }
592
+
593
+ .arch-mini-arrow {
594
+ width: 2px;
595
+ height: 18px;
596
+ background: var(--line);
597
+ position: relative;
598
+ margin: 6px auto;
599
+ }
600
+
601
+ .arch-mini-arrow span {
602
+ bottom: -2px;
603
+ }
604
+
605
+ .arch-branches {
606
+ display: grid;
607
+ grid-template-columns: repeat(3, minmax(0, 1fr));
608
+ gap: 12px;
609
+ width: 100%;
610
+ margin-top: 8px;
611
+ }
612
+
613
+ .arch-branch {
614
+ background: var(--surface);
615
+ border: 1px solid var(--line);
616
+ padding: 14px 12px;
617
+ text-align: center;
618
+ font-size: 0.82rem;
619
+ color: var(--ink-2);
620
+ line-height: 1.4;
621
+ }
622
+
623
+ .arch-branch p {
624
+ margin: 0;
625
+ }
626
+
627
+ .arch-branch-label {
628
+ font-weight: 800;
629
+ font-size: 0.75rem;
630
+ letter-spacing: 0.06em;
631
+ margin-bottom: 8px;
632
+ }
633
+
634
+ .arch-branch.correct {
635
+ border-color: rgba(27, 79, 70, 0.35);
636
+ background: rgba(27, 79, 70, 0.06);
637
+ }
638
+
639
+ .arch-branch.correct .arch-branch-label {
640
+ color: var(--accent);
641
+ }
642
+
643
+ .arch-branch.ambiguous {
644
+ border-color: rgba(106, 79, 29, 0.35);
645
+ background: rgba(241, 235, 224, 0.7);
646
+ }
647
+
648
+ .arch-branch.ambiguous .arch-branch-label {
649
+ color: var(--warn-ink);
650
+ }
651
+
652
+ .arch-branch.incorrect {
653
+ border-color: rgba(139, 46, 46, 0.3);
654
+ background: rgba(139, 46, 46, 0.06);
655
+ }
656
+
657
+ .arch-branch.incorrect .arch-branch-label {
658
+ color: #8b2e2e;
659
+ }
660
+
661
+ @keyframes arrow-pulse {
662
+ 0%,
663
+ 100% {
664
+ opacity: 0.35;
665
+ transform: translateX(-50%) translateY(0) rotate(45deg);
666
+ }
667
+ 50% {
668
+ opacity: 1;
669
+ transform: translateX(-50%) translateY(3px) rotate(45deg);
670
+ }
671
+ }
672
+
673
  .score-card {
674
  background: var(--surface);
675
  border: 1px solid var(--line);
 
812
  }
813
 
814
  @media (max-width: 980px) {
815
+ .workspace,
816
+ .metrics-layout,
817
+ .arch-branches {
818
  grid-template-columns: 1fr;
819
  }
820
 
821
+ .metrics-overview {
822
+ position: static;
823
+ }
824
+
825
  .insight-panel {
826
  min-height: 0;
827
  }