-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbench.html
More file actions
1847 lines (1722 loc) · 97.3 KB
/
Copy pathbench.html
File metadata and controls
1847 lines (1722 loc) · 97.3 KB
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vibe Rounds - Case Bench — Clinical Reasoning Aid</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<!-- Google Analytics (GA4) — replace G-XXXXXXXXXX with your own Measurement ID -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-541054383"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-541054383');
// Safe wrapper so the app never breaks if GA hasn't loaded (e.g. ad-blockers)
function trackEvent(name, params){
try{ if(typeof gtag === 'function') gtag('event', name, params || {}); }catch(e){}
}
</script>
<!-- File-upload text extraction: pdf.js (PDF) and mammoth.js (Word .docx) -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mammoth/1.6.0/mammoth.browser.min.js"></script>
<style>
:root{
--paper:#F7FAFB;
--card:#FFFFFF;
--ink:#0B2530;
--line:#DCE7EA;
--line-soft:#E9F1F3;
--accent:#0891B2;
--accent-dark:#0A6E85;
--accent-soft:#E3F4F8;
--alert:#C2410C;
--alert-soft:#FCE9DD;
--muted:#5B7480;
--tab-inactive:#EEF4F6;
--radius:10px;
--body-font:'Inter',sans-serif;
}
/* Theme: Minimalist — grayscale, no color pop */
html[data-theme="minimalist"]{
--paper:#FFFFFF;
--card:#FFFFFF;
--ink:#161616;
--line:#E4E4E4;
--line-soft:#F0F0F0;
--accent:#161616;
--accent-dark:#000000;
--accent-soft:#F2F2F2;
--alert:#B3261E;
--alert-soft:#F8E7E6;
--muted:#757575;
--tab-inactive:#F2F2F2;
--radius:3px;
--body-font:'Inter',sans-serif;
}
/* Theme: Terminal — Bloomberg-style dark/amber monospace */
html[data-theme="terminal"]{
--paper:#000000;
--card:#0A0A0A;
--ink:#FFB238;
--line:#3A2A00;
--line-soft:#231A00;
--accent:#FFB238;
--accent-dark:#FFCB6B;
--accent-soft:#1C1400;
--alert:#FF4D3D;
--alert-soft:#2B0C08;
--muted:#9C7A32;
--tab-inactive:#141414;
--radius:2px;
--body-font:'IBM Plex Mono',monospace;
}
html[data-theme="terminal"] .msg.user .bubble,
html[data-theme="terminal"] header.top .rx{color:#000;}
html[data-theme="terminal"] .banner strong{color:#FFCB6B;}
html[data-theme="terminal"] .card,
html[data-theme="terminal"] .transcript,
html[data-theme="terminal"] .msg.assistant .bubble{border-color:var(--line);}
html{transition:background .15s ease;}
*{box-sizing:border-box;}
html,body{margin:0;padding:0;}
body{
background:var(--paper);
color:var(--ink);
font-family:var(--body-font);
font-size:15px;
line-height:1.5;
-webkit-font-smoothing:antialiased;
transition:background .15s ease,color .15s ease,font-family .1s ease;
}
::selection{background:var(--accent-soft);}
a{color:var(--accent-dark);}
.wrap{max-width:960px;margin:0 auto;padding:28px 20px 80px;}
/* header */
header.top{
display:flex;align-items:center;justify-content:space-between;
padding-bottom:18px;margin-bottom:28px;
flex-wrap:wrap;gap:10px;
}
header.top .brand{display:flex;align-items:center;gap:10px;}
header.top h1{
font-family:var(--body-font);font-weight:800;
font-size:24px;margin:0;letter-spacing:-0.02em;color:var(--ink);
}
header.top .rx{
font-family:var(--body-font);font-weight:600;font-size:11.5px;color:#fff;
background:var(--accent);border-radius:20px;padding:4px 11px;
letter-spacing:.01em;
}
header.top .tagline{font-size:12.5px;color:var(--muted);font-family:var(--body-font);font-weight:500;}
header.top .top-right{display:flex;flex-direction:column;align-items:flex-end;gap:8px;}
.theme-select{
display:inline-flex;align-items:center;gap:6px;
background:var(--tab-inactive);border:1px solid var(--line);color:var(--ink);
font-family:var(--body-font);font-weight:600;font-size:12px;
border-radius:999px;padding:6px 30px 6px 12px;cursor:pointer;
-webkit-appearance:none;appearance:none;
background-image:url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%235B7480' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
background-repeat:no-repeat;background-position:right 10px center;background-size:10px;
}
.theme-select:hover{border-color:var(--accent);}
.top-links{display:flex;gap:8px;font-family:var(--body-font);}
.top-links a{
display:inline-flex;align-items:center;gap:5px;
font-size:12.5px;font-weight:700;color:var(--accent-dark);
background:var(--accent-soft);border:1px solid var(--line);
border-radius:999px;padding:6px 13px;text-decoration:none;
}
.top-links a:hover{background:var(--accent);color:#fff;border-color:var(--accent);}
html[data-theme="terminal"] .top-links a:hover{color:#000;}
/* section labels — merged "block" look, collapsed by default */
.step{margin-bottom:20px;}
.step-label{
font-family:var(--body-font);font-size:12.5px;letter-spacing:.08em;
text-transform:uppercase;color:var(--ink);font-weight:700;
display:flex;align-items:center;gap:10px;margin-bottom:0;
background:var(--card);border:1px solid var(--line);border-radius:var(--radius) var(--radius) 0 0;
padding:14px 20px;transition:box-shadow .15s ease,border-color .15s ease,color .15s ease;
}
.step-label.collapsed{border-radius:var(--radius);}
.step-label .num{
width:24px;height:24px;border-radius:50%;background:var(--accent);color:#fff;
display:inline-flex;align-items:center;justify-content:center;font-size:12px;flex-shrink:0;font-weight:700;
}
.step-label.done .num{background:var(--accent-dark);}
.step-label.collapsible{cursor:pointer;user-select:none;}
.step-label.collapsible:hover{color:var(--accent-dark);box-shadow:0 6px 16px -10px rgba(11,37,48,.3);}
.collapse-arrow{font-size:11px;margin-left:auto;transition:transform .15s ease;color:var(--muted);padding-left:8px;}
.step-label.collapsed .collapse-arrow{transform:rotate(-90deg);}
.card.collapsed{display:none;}
.card{
background:var(--card);
border:1px solid var(--line);border-top:none;
border-radius:0 0 var(--radius) var(--radius);
padding:22px 22px 20px;
box-shadow:0 1px 2px rgba(11,37,48,.04), 0 8px 24px -16px rgba(11,37,48,.08);
}
textarea, input[type=text], input[type=password], select{
width:100%;
font-family:var(--body-font);
font-size:14px;
background:var(--card);
border:1px solid var(--line);
border-radius:var(--radius);
padding:9px 11px;
color:var(--ink);
}
textarea:focus, input:focus, select:focus, button:focus-visible{
outline:2px solid var(--accent);outline-offset:1px;
}
textarea{resize:vertical;min-height:90px;line-height:1.5;}
label{font-size:12.5px;color:var(--muted);display:block;margin-bottom:4px;font-weight:500;}
.hint{font-size:12px;color:var(--muted);margin-top:6px;}
.upload-row{margin-top:14px;padding-top:14px;border-top:1px dashed var(--line);}
.upload-row label{margin-bottom:6px;}
.upload-row input[type=file]{
width:100%;font-family:var(--body-font);font-size:12.5px;color:var(--muted);
border:1px dashed var(--line);border-radius:var(--radius);padding:8px 10px;background:var(--paper);
}
.upload-row input[type=file]::file-selector-button{
font-family:var(--body-font);font-weight:600;font-size:12px;color:#fff;
background:var(--accent);border:none;border-radius:999px;padding:6px 13px;margin-right:10px;cursor:pointer;
}
#uploadStatus.ok{color:var(--accent-dark);}
#uploadStatus.err{color:var(--alert);}
/* provider tabs — segmented pill control */
.tabrow{display:flex;gap:4px;background:var(--tab-inactive);padding:4px;border-radius:999px;margin-bottom:16px;width:fit-content;}
.tabrow .tab{
font-family:var(--body-font);font-weight:600;font-size:12.5px;
padding:7px 16px;
background:transparent;
border:none;border-radius:999px;
cursor:pointer;color:var(--muted);
transition:background .12s,color .12s;
}
.tabrow .tab.active{
background:var(--accent);color:#fff;
}
.providerpane{padding:0;background:transparent;}
.providerpane .row{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:10px;}
@media(max-width:600px){.providerpane .row{grid-template-columns:1fr;}}
.key-status{font-size:12px;font-family:var(--body-font);font-weight:500;margin-top:8px;}
.key-status.ok{color:var(--accent-dark);}
.key-status.empty{color:var(--muted);}
details.settings summary{
cursor:pointer;font-size:12.5px;color:var(--accent-dark);font-weight:600;
list-style:none;display:flex;align-items:center;gap:6px;
}
details.settings summary::-webkit-details-marker{display:none;}
details.settings summary::before{content:"▸";font-size:10px;}
details.settings[open] summary::before{content:"▾";}
details.settings{margin-top:10px;}
.mode-hint{font-size:12.5px;color:var(--muted);margin:10px 0 12px;}
.mode-pane{margin-top:2px;}
.activity.pipeline-tile{position:relative;}
.order-badge{
position:absolute;top:-8px;right:-8px;width:22px;height:22px;border-radius:50%;
background:var(--accent);color:#fff;font-family:var(--body-font);font-weight:700;font-size:11px;
display:flex;align-items:center;justify-content:center;box-shadow:0 2px 4px rgba(11,37,48,.2);
}
.pipeline-order{
margin-top:14px;font-size:12.5px;color:var(--muted);
display:flex;align-items:center;gap:6px;flex-wrap:wrap;
}
.pipeline-order .chip{
background:var(--tab-inactive);color:var(--ink);font-weight:600;font-size:12px;
padding:4px 10px;border-radius:999px;
}
.pipeline-order .arrow{color:var(--muted);}
.pipeline-order .chip-remove{color:var(--muted);text-decoration:none;margin-left:5px;font-weight:700;}
.pipeline-order .chip-remove:hover{color:var(--alert);}
/* activity cards */
.activities{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;}
@media(max-width:760px){.activities{grid-template-columns:repeat(2,1fr);}}
.activity{
background:var(--card);border:1.5px solid var(--line);
border-radius:var(--radius);
padding:15px 14px;cursor:pointer;transition:border-color .12s, box-shadow .12s, transform .06s;
text-align:left;font-family:var(--body-font);
box-shadow:0 1px 2px rgba(11,37,48,.04);
}
.activity:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:0 6px 16px -8px rgba(8,145,178,.35);}
.activity.selected{border-color:var(--accent);background:var(--accent-soft);box-shadow:0 6px 16px -8px rgba(8,145,178,.35);}
.activity .aname{font-weight:700;font-size:13.5px;margin-bottom:4px;color:var(--ink);}
.activity .adesc{font-size:11.5px;color:var(--muted);line-height:1.4;}
/* workspace */
#workspace{margin-top:30px;display:none;}
#workspace.visible{display:block;}
.ws-header{
display:flex;justify-content:space-between;align-items:center;
padding-bottom:12px;margin-bottom:14px;
}
.ws-header .wtitle{font-family:var(--body-font);font-size:18px;font-weight:800;color:var(--ink);}
.ws-header .wsub{font-size:12px;color:var(--muted);font-family:var(--body-font);font-weight:500;}
.ws-actions button{margin-left:8px;}
.ws-progress{margin-top:8px;display:flex;align-items:center;gap:8px;}
.ws-progress-bar{width:140px;height:6px;border-radius:999px;background:var(--tab-inactive);overflow:hidden;flex-shrink:0;}
.ws-progress-fill{height:100%;background:var(--accent);border-radius:999px;transition:width .25s ease;width:0%;}
.ws-progress-label{font-size:11.5px;color:var(--muted);font-weight:600;white-space:nowrap;}
@media(max-width:600px){
header.top h1{font-size:20px;}
.ws-header{flex-direction:column;align-items:flex-start;gap:10px;}
.ws-actions{display:flex;flex-wrap:wrap;gap:8px;}
.ws-actions button{margin-left:0;}
.pipeline-picker > div{flex-direction:column;}
.pipeline-picker select{width:100%;}
.composer{flex-direction:column;align-items:stretch;}
.msg{max-width:100%;}
}
.transcript{
border:1px solid var(--line);border-radius:var(--radius);
background:var(--card);
box-shadow:0 1px 2px rgba(11,37,48,.04), 0 8px 24px -16px rgba(11,37,48,.08);
min-height:120px;max-height:520px;overflow-y:auto;
padding:16px;margin-bottom:12px;
}
.msg{margin-bottom:16px;max-width:88%;}
.msg.user{margin-left:auto;}
.msg .who{font-family:var(--body-font);font-size:10.5px;text-transform:uppercase;font-weight:700;letter-spacing:.05em;color:var(--muted);margin-bottom:4px;}
.msg.user .who{text-align:right;}
/* text-to-speech control on assistant answers */
.who-row{display:flex;align-items:center;gap:6px;margin-bottom:4px;}
.who-row .who{margin-bottom:0;}
.tts-btn{
display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;
width:20px;height:20px;padding:0;
background:transparent;color:var(--muted);
border:1px solid transparent;border-radius:50%;
cursor:pointer;transition:background .12s ease,color .12s ease;
}
.tts-btn:hover{background:var(--accent-soft);color:var(--accent-dark);}
.tts-btn svg{width:12px;height:12px;display:block;}
.tts-btn.speaking{background:var(--accent-soft);color:var(--accent-dark);border-color:var(--line);}
.tts-btn.speaking .tts-wave-1{animation:ttsPulse 1s ease-in-out infinite;}
.tts-btn.speaking .tts-wave-2{animation:ttsPulse 1s ease-in-out infinite .18s;}
@keyframes ttsPulse{0%,100%{opacity:.3;}50%{opacity:1;}}
@media(prefers-reduced-motion:reduce){
.tts-btn.speaking .tts-wave-1,.tts-btn.speaking .tts-wave-2{animation:none;opacity:1;}
}
.msg .bubble{
padding:11px 14px;border-radius:12px;font-size:14px;line-height:1.55;white-space:pre-wrap;
}
.msg.assistant .bubble{background:var(--accent-soft);border:1px solid #cdeaf0;border-top-left-radius:4px;}
.msg.user .bubble{background:var(--accent);color:#fff;border-top-right-radius:4px;}
.msg.system .bubble{background:transparent;border:1px dashed var(--line);color:var(--muted);font-style:italic;font-size:12.5px;border-radius:8px;}
.composer{display:flex;gap:8px;align-items:flex-end;}
.composer textarea{min-height:56px;flex:1;}
button{
font-family:var(--body-font);font-weight:700;font-size:13px;
background:var(--accent);color:#fff;border:none;
border-radius:999px;padding:10px 18px;cursor:pointer;
transition:background .12s, transform .06s;
}
button:hover{background:var(--accent-dark);}
button.secondary{background:transparent;color:var(--muted);border:1.5px solid var(--line);}
button.secondary:hover{background:var(--tab-inactive);color:var(--ink);border-color:var(--line);}
button:disabled{opacity:.5;cursor:not-allowed;}
.banner{
font-size:12.5px;color:var(--ink);border:1px solid var(--line-soft);
background:var(--accent-soft);padding:11px 14px;border-radius:var(--radius);margin-bottom:24px;
}
.banner strong{color:var(--accent-dark);}
.error-note{font-size:12.5px;color:var(--alert);background:var(--alert-soft);border:1px solid #f0c8ac;border-radius:var(--radius);padding:9px 12px;margin-bottom:10px;display:none;}
.error-note.show{display:block;}
.typing{font-family:var(--body-font);font-size:12px;color:var(--muted);font-weight:500;}
.typing::after{content:'';animation:dots 1.2s steps(4,end) infinite;}
@keyframes dots{0%{content:'';}25%{content:'.';}50%{content:'..';}75%{content:'...';}}
footer{margin-top:50px;font-size:11.5px;color:var(--muted);text-align:center;font-family:var(--body-font);font-weight:500;}
.contact-card{
margin-top:36px;
border:1px solid var(--line);
background:var(--card);
border-radius:var(--radius);
padding:18px 20px;
text-align:center;
box-shadow:0 1px 2px rgba(11,37,48,.04);
}
.contact-card p{margin:0;font-size:13px;color:var(--muted);line-height:1.6;}
.contact-card a{color:var(--accent-dark);font-weight:600;text-decoration:none;}
.contact-card a:hover{text-decoration:underline;}
.legal-note{
margin-top:16px;
font-size:11.5px;color:var(--muted);text-align:center;
line-height:1.6;font-family:var(--body-font);
}
.legal-note em{font-style:italic;}
.legal-note a{color:var(--muted);text-decoration:underline;}
.legal-note a:hover{color:var(--accent-dark);}
.contribute-card{
margin-top:16px;
border:1px dashed var(--line);
background:var(--accent-soft);
border-radius:var(--radius);
padding:18px 20px;
text-align:center;
}
.contribute-card h3{
margin:0 0 6px;font-size:13.5px;font-weight:700;color:var(--ink);
font-family:var(--body-font);
}
.contribute-card p{
margin:0 0 12px;font-size:12.5px;color:var(--muted);
line-height:1.6;font-family:var(--body-font);max-width:560px;
margin-left:auto;margin-right:auto;
}
.contribute-card label.consent{
display:flex;align-items:flex-start;gap:7px;justify-content:center;
font-size:12px;color:var(--muted);margin:0 0 12px;text-align:left;
max-width:520px;margin-left:auto;margin-right:auto;font-weight:500;
}
.contribute-card label.consent input{margin-top:2px;flex-shrink:0;}
.contribute-btn{
font-family:var(--body-font);font-weight:700;font-size:13px;
background:var(--accent);color:#fff;border:none;border-radius:999px;
padding:9px 22px;cursor:pointer;transition:background .12s;
}
.contribute-btn:hover:not(:disabled){background:var(--accent-dark);}
.contribute-btn:disabled{opacity:.6;cursor:default;}
.contribute-status{
font-size:12px;font-weight:600;margin-top:10px;font-family:var(--body-font);min-height:16px;
}
.contribute-status.ok{color:var(--accent-dark);}
.contribute-status.err{color:var(--alert);}
</style>
<!-- ===== VibeRounds Suite Bar ===== -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=DM+Mono:wght@400;500&display=swap" rel="stylesheet">
<style>
.vr-suitebar{
background: linear-gradient(160deg, #EFF6FF 0%, #F0FDFA 65%);
border-bottom: 1px solid #E2E8F0;
padding: 12px 20px;
display: flex; align-items: center; justify-content: space-between;
flex-wrap: wrap; gap: 10px 16px;
}
.vr-suitebar .vr-brand{
font-family: 'DM Mono','IBM Plex Mono',monospace;
font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
color: #0F172A; text-decoration: none; display:flex; align-items:center; gap:0;
}
.vr-suitebar .vr-brand span{ color: #0891B2; }
.vr-suitebar .vr-nav{ display:flex; gap:6px; flex-wrap:wrap; }
.vr-suitebar .vr-nav a{
font-family:'DM Mono','IBM Plex Mono',monospace; font-size:11px; letter-spacing:.04em; text-transform:uppercase;
color:#475569; text-decoration:none; padding:6px 10px; border-radius:999px;
border:1px solid #E2E8F0; background:#FFFFFF; transition:.15s ease;
}
.vr-suitebar .vr-nav a:hover{ color:#fff; background:#0891B2; border-color:#0891B2; }
.vr-suitebar .vr-nav a.active{ color:#fff; background:#0E7490; border-color:#0E7490; }
@media (max-width:640px){
.vr-suitebar{ padding:10px 14px; }
.vr-suitebar .vr-nav a{ padding:5px 8px; font-size:10px; }
}
</style>
</head>
<body>
<header class="vr-suitebar">
<a class="vr-brand" href="https://avi33tbtt.github.io/">Vibe<span>Rounds</span></a>
<nav class="vr-nav">
<a href="https://avi33tbtt.github.io/home.html">Home</a>
<a href="https://avi33tbtt.github.io/bench.html" class="active">Case Bench</a>
<a href="https://avi33tbtt.github.io/bench_lite.html">Bench Lite</a>
<a href="https://avi33tbtt.github.io/case-simulator.html">Case Simulator</a>
<a href="https://avi33tbtt.github.io/case-practice.html">Clinical Practice</a>
<a href="https://avi33tbtt.github.io/clinical-polemos.html">Clinical Polemos</a>
<a href="https://avi33tbtt.github.io/case-lens.html">Case Lens</a>
<a href="https://avi33tbtt.github.io/sdm-lens.html">SDM Lens</a>
<a href="https://avi33tbtt.github.io/Prompts/ebm-case-query-generator.html">EBM Query Generator</a>
<a href="https://avi33tbtt.github.io/ccos-builder.html">CCOS Builder</a>
</nav>
</header>
<div class="wrap">
<header class="top">
<div class="brand">
<h1>Vibe Rounds - Case Bench</h1>
<span class="rx">Rx: reasoning, not answers</span>
</div>
<div class="top-right">
<select id="themeSelect" class="theme-select" aria-label="Theme">
<option value="simple">Simple</option>
<option value="minimalist">Minimalist</option>
<option value="terminal">Terminal</option>
</select>
<div class="tagline">clinical reasoning aid · not for patient care</div>
<div class="top-links">
<a href="https://avi33tbtt.github.io/" target="_blank" rel="noopener">Project website</a>
<a href="https://www.linkedin.com/in/dravinashkumargupta/" target="_blank" rel="noopener">Dr. Avinash — LinkedIn</a>
</div>
</div>
</header>
<div class="banner"><strong>Educational use only.</strong> Not a diagnostic tool. This is a working implementation of the <a href="https://avi33tbtt.github.io/" target="_blank" rel="noopener">Vibe Rounds</a> paradigm for clinical case reasoning. Your API key is stored only in this browser's local storage and sent directly from your browser to your chosen provider — never through any server of ours.</div>
<!-- STEP 1: MODEL -->
<div class="step">
<div class="step-label collapsible" id="label-model"><span class="num">1</span>Model<span class="collapse-arrow" id="arrow-model">▾</span></div>
<div class="card" id="card-model">
<div class="tabrow" id="providerTabs">
<div class="tab active" data-provider="claude">Claude</div>
<div class="tab" data-provider="gemini">Gemini</div>
<div class="tab" data-provider="openai">ChatGPT</div>
<div class="tab" data-provider="other">Other</div>
</div>
<div class="providerpane">
<div class="row" id="endpointRow" style="display:none;">
<div style="grid-column:1/-1;">
<label for="apiEndpoint">API endpoint (OpenAI-compatible chat/completions URL)</label>
<input type="text" id="apiEndpoint" placeholder="https://api.groq.com/openai/v1/chat/completions">
</div>
</div>
<div class="row">
<div>
<label id="apiKeyLabel" for="apiKey">Claude API key</label>
<input type="password" id="apiKey" placeholder="sk-ant-...">
</div>
<div>
<label for="modelName">Model name</label>
<input type="text" id="modelName" placeholder="claude-sonnet-4-6">
</div>
</div>
<div class="key-status empty" id="keyStatus">No key saved for this provider yet.</div>
<details class="settings">
<summary>Where do I get a key?</summary>
<div class="hint" style="margin-top:8px;" id="keyHelp"></div>
</details>
</div>
</div>
</div>
<!-- STEP 2: CASE -->
<div class="step">
<div class="step-label collapsible" id="label-case"><span class="num">2</span>Case<span class="collapse-arrow" id="arrow-case">▾</span></div>
<div class="card" id="card-case">
<label for="caseText">Paste the case — vignette text, discharge summary, your own clerking notes, or a case link</label>
<textarea id="caseText" placeholder="Paste case text directly, e.g. 'A 45 year man presented with pain in right leg and reticular lesion on skin on posterior side of right leg. He met with a road traffic accident 2 years back when he was a professional driver and...'"></textarea>
<div class="sample-case-controls" style="display:flex;flex-wrap:wrap;gap:10px;margin-top:12px;">
<div style="flex:1;min-width:150px;">
<label for="sampleDifficulty" style="margin-bottom:4px;">Sample case difficulty</label>
<select id="sampleDifficulty">
<option value="Any">Any</option>
<option value="Student / early learner — classic, textbook presentation">Student / early learner</option>
<option value="Intern / junior resident — common presentation with a couple of distractors">Intern / junior resident</option>
<option value="Senior resident — moderate complexity, some atypical features">Senior resident</option>
<option value="Attending / expert — atypical, complex, or multi-system presentation">Attending / expert</option>
</select>
</div>
<div style="flex:1;min-width:150px;">
<label for="sampleSpecialty" style="margin-bottom:4px;">Sample case specialty</label>
<select id="sampleSpecialty"></select>
</div>
</div>
<div class="hint">If link can't be fetched automatically — paste the case text itself for best results. <a href="#" id="sampleCaseBtn" style="font-weight:600;color:var(--accent-dark);text-decoration:none;">Try a sample case →</a></div>
<div class="upload-row">
<label for="caseFile">Or upload a case file — PDF, Word (.doc/.docx), or plain text (.txt), max 10MB</label>
<input type="file" id="caseFile" accept=".pdf,.doc,.docx,.txt,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,text/plain">
<div class="hint" id="uploadStatus"></div>
</div>
</div>
</div>
<!-- STEP 3: ACTIVITY -->
<div class="step">
<div class="step-label" id="label-activity"><span class="num">3</span>Activity</div>
<div class="tabrow" id="modeTabs">
<div class="tab active" data-mode="dialogue">Dialogue</div>
<div class="tab" data-mode="analytics">Analytics Mode</div>
<div class="tab" data-mode="pipeline">Pipeline Builder</div>
</div>
<div id="modeDialogue" class="mode-pane">
<div class="mode-hint">One activity, a live back-and-forth. Good for step-by-step reasoning practice.</div>
<div class="activities" id="activities"></div>
<div id="quizPatternPicker" style="display:none;margin-top:14px;">
<div class="hint" style="margin-bottom:8px;">Choose a quiz pattern:</div>
<div class="tabrow" id="quizPatternTabs">
<div class="tab active" data-pattern="Clinical Reasoning Focused">Clinical Reasoning (default)</div>
<div class="tab" data-pattern="NEET PG">NEET PG</div>
<div class="tab" data-pattern="USMLE">USMLE</div>
<div class="tab" data-pattern="MRCP">MRCP</div>
<div class="tab" data-pattern="PLAB">PLAB</div>
<div class="tab" data-pattern="Other">Other</div>
</div>
<input type="text" id="quizPatternOther" placeholder="Specify the exam / pattern…" style="display:none;margin-top:8px;">
<button id="startQuizBtn" style="margin-top:10px;">Start quiz</button>
</div>
</div>
<div id="modeAnalytics" class="mode-pane" style="display:none;">
<div class="mode-hint">Pick one lens. One structured report comes back in a single pass — no back-and-forth required, though you can still ask follow-ups after. Promption/Provocation modules are sourced from the <a href="https://avi33tbtt.github.io/#ccos-builder-panel" target="_blank">VibeRounds CCOS Builder</a>.</div>
<div class="module-group-label">Promption — cognitive scaffolding</div>
<div class="activities" id="analyticsPromption"></div>
<div class="module-group-label">Provocation — cognitive stress-testing</div>
<div class="activities" id="analyticsProvocation"></div>
<button id="runAnalyticsBtn" style="margin-top:14px;" disabled>Run analysis</button>
</div>
<div id="modePipeline" class="mode-pane" style="display:none;">
<div class="mode-hint">Pipeline Builder has moved. Build and run module chains on the <a href="https://avi33tbtt.github.io/#ccos-builder-panel" target="_blank">VibeRounds CCOS Builder</a>.</div>
</div>
</div>
<!-- WORKSPACE -->
<div id="workspace">
<div class="ws-header">
<div>
<div class="wtitle" id="wsTitle"></div>
<div class="wsub" id="wsSub"></div>
<div class="ws-progress" id="wsProgress" style="display:none;">
<div class="ws-progress-bar"><div class="ws-progress-fill" id="wsProgressFill"></div></div>
<div class="ws-progress-label" id="wsProgressLabel"></div>
</div>
</div>
<div class="ws-actions">
<button class="secondary" id="copyTranscriptBtn">Copy transcript</button>
<button class="secondary" id="downloadTranscriptBtn">Download .txt</button>
<button class="secondary" id="resetBtn">Reset run</button>
</div>
</div>
<div class="error-note" id="errorNote"></div>
<div class="transcript" id="transcript"></div>
<div class="composer">
<textarea id="composerInput" placeholder="Your response..."></textarea>
<button id="sendBtn">Send</button>
</div>
</div>
<div class="legal-note">
<em>"To be used on personal responsibility and only for learning. Not to be used for clinical purpose."</em>
</div>
<footer>Vibe Rounds - Case Bench · runs entirely in your browser · bring your own key</footer>
</div>
<script>
/* ---------- config: providers ---------- */
const PROVIDERS = {
claude: {
label: 'Claude',
keyPlaceholder: 'sk-ant-...',
modelPlaceholder: 'claude-sonnet-4-6',
help: 'Create a key at <a href="https://console.anthropic.com/settings/keys" target="_blank">console.anthropic.com</a>. Paste the model name exactly as shown there — model names change over time, so if a call fails, double check the current model string.'
},
gemini: {
label: 'Gemini',
keyPlaceholder: 'AIza...',
modelPlaceholder: 'gemini-2.5-flash',
help: 'Create a key at <a href="https://aistudio.google.com/app/apikey" target="_blank">aistudio.google.com/app/apikey</a>. Check the current model name in Google AI Studio if a call fails.'
},
openai: {
label: 'ChatGPT',
keyPlaceholder: 'sk-...',
modelPlaceholder: 'gpt-4o-mini',
help: 'Create a key at <a href="https://platform.openai.com/api-keys" target="_blank">platform.openai.com/api-keys</a>. Check the current model name in the OpenAI docs if a call fails.'
},
other: {
label: 'Other',
keyPlaceholder: 'API key (leave blank if none)',
modelPlaceholder: 'model-name-as-required-by-provider',
needsEndpoint: true,
help: 'Works with any provider that exposes an OpenAI-compatible <code>/chat/completions</code> endpoint — this covers most of the LLM ecosystem beyond the big three: Groq, Together AI, Mistral, DeepSeek, xAI (Grok), Perplexity, OpenRouter (which itself proxies dozens more models), Fireworks, local servers like Ollama or LM Studio, and more. Paste the full endpoint URL, the key that provider gave you, and the exact model name it expects. If a call fails, check that provider\'s docs — the request/response shape is standardized, but model names and auth details vary.'
}
};
/* ---------- config: activities ---------- */
const ACTIVITIES = {
socratic: {
name: 'Socratic Rounds',
desc: 'One pointed question at a time. You find the gap yourself.',
subtitle: 'One question at a time — commit before you get the answer.',
systemPrompt: (c) => `#VibeRounds You are a warm, encouraging educational assistant who uses the Socratic method to guide clinical reasoning. I am a learner working through a clinical case. Your role is to ask me one question at a time, wait for my response, and acknowledge what I got right before gently probing further. Only reveal the answer after I have made a genuine attempt and then explicitly surrendered — if I ask for the answer outright without attempting one, redirect me once with: 'Give your best guess, differential, or next step first,' and only proceed to reveal the answer if I still cannot or will not attempt one after that. Start every session by telling me one thing you believe I will find interesting about this case. Confirm you understand the rules before we begin.\n\nHere is the case:\n\n${c}\n\nBegin now: first confirm you understand the rules above in one short line, then tell me the one interesting thing about this case, then ask your first question.`
},
audit: {
name: 'Case Audit',
desc: 'Write up your own reasoning. Get audited for gaps, not given answers.',
subtitle: 'Submit your working diagnosis and reasoning — get audited, not corrected.',
systemPrompt: (c) => `Act as a diagnostic-safety auditor reviewing a clerkship student's written clinical reasoning. Here is the case:\n\n${c}\n\nThe student will paste their own working diagnosis, differential, and reasoning below. When they do:\n- Do not state the "correct" diagnosis unless the student already has it right and asks you to confirm.\n- Identify the single most significant gap in their reasoning (a missed red flag, an unweighted piece of evidence, premature closure, or an untested alternative) — not a list, just the one that matters most.\n- Phrase this gap as a question that would let the student find it themselves, not as a correction.
- Name explicitly if you notice a common cognitive bias at play (anchoring, premature closure, framing effect, availability bias) and briefly why it might apply here — without telling them they're wrong yet.
- Ask them to revise and resubmit before you'll confirm anything.
- Keep responses tight — a real audit note, not an essay.
- Wait for the student's first submission before auditing anything. Start by asking them to state their working diagnosis and reasoning for this case.`
},
differential: {
name: 'Differential Challenge',
desc: 'Rank your differentials. Get probed on the weakest link.',
subtitle: 'Submit a ranked differential — the weakest one gets probed first.',
systemPrompt: (c) => `Act as a clinical mentor running a differential-diagnosis drill. Here is the case:\n\n${c}\n\nAsk the student to list their differential diagnoses, ranked by likelihood, each with one line of justification. Once they submit:\n- Identify the differential in their list that is weakest — least justified, or most likely to be wrong — and probe it with one pointed question, without telling them it's wrong yet.\n- Also ask one question about a plausible differential that is conspicuously missing from their list, if one exists — again as a question, not a statement.\n- Do not reveal the true diagnosis or rank order until the student has responded to your probes at least once.\n- Once they've responded, give a brief verdict: which differentials survive scrutiny, which don't, and why — grounded only in evidence from the case.\n- Keep it concise. Begin by asking for their ranked list now.`
},
quiz: {
name: 'Quick Quiz',
desc: 'Reasoning-focused MCQs, one at a time, with explanation after each.',
subtitle: 'One question at a time — reasoning tested, not recall.',
needsPattern: true,
systemPrompt: (c) => {
const pattern = state.quizPattern || 'Clinical Reasoning Focused';
const styleNotes = {
'Clinical Reasoning Focused': 'General clinical-reasoning style — test decision-making and pattern recognition rather than any specific national exam\u2019s format.',
'NEET PG': 'NEET PG (India) style — single best answer, terse stems, Indian clinical-practice conventions and drug/brand naming where relevant.',
'USMLE': 'USMLE (USA) Step-style — long, detailed clinical vignette stems, US clinical-practice conventions, single best answer from 4-5 options.',
'MRCP': 'MRCP (UK) style — concise but nuanced vignettes, UK clinical-practice/NICE-guideline conventions, single best answer.',
'PLAB': 'PLAB (UK) style — practical, safety- and communication-oriented vignettes reflecting UK primary/secondary care practice, single best answer.'
};
const styleNote = styleNotes[pattern] || `Custom/other exam style requested by the student: "${pattern}". Infer and follow that exam's typical conventions as best you can.`;
return `Act as an exam writer generating reasoning-focused multiple-choice questions from this case:\n\n${c}\n\nQuiz pattern requested: ${pattern}.\n${styleNote}\n\nRules:\n- Before question 1, state in one short line which quiz pattern/style you are using for this session, so the student knows what to expect.\n- Write questions that test clinical reasoning and decision-making (e.g. "what changes management here," "what test best discriminates X from Y"), not simple recall of facts stated in the case, while matching the tone, stem length, and conventions of the requested pattern above.\n- Give exactly one question at a time, with 4 labeled options (A-D). Do not reveal the answer yet.\n- Wait for the student's answer. Then tell them if they're right, explain the reasoning briefly (including why the wrong options are wrong), and only then move to the next question.\n- Keep every question in this session consistent with the stated pattern.\n- After 5 questions, stop and give a one-line summary of the pattern in what they got wrong, if anything.\n- Begin now: state the quiz pattern in one line, then give question 1.`;
}
}
};
/* ---------- config: CCOS modules — all 57 (+ Module 0), tagged Promption / Provocation / Other ----------
Source: the CCOS module directory at https://avi33tbtt.github.io/Prompts/Prompts.html (index of all
58 module pages, #0-#57), read against the Promption/Provocation dual-mode framework explained at
https://avi33tbtt.github.io/modern_clinical_reasoning.html and surfaced via the CCOS Builder panel at
https://avi33tbtt.github.io/#ccos-builder-panel.
Only ~10 modules are explicitly named as Promption or Provocation examples on the source pages; the
rest aren't tagged either way there (the site groups them into other categories instead — patient
advocacy, analytics, safety, education, operations, meta-design). For those, the lens below is this
app's own classification — Promption where a module scaffolds/structures/organizes the case,
Provocation where it challenges, audits, or stress-tests an assumption — and "other" where a module
is neither. Treat that classification as a best-effort reading, not something asserted by the source.
Ten modules keep hand-written, case-specific prompts. The rest use a generated single-pass prompt
built from the module's own directory description, since transcribing the full step text of all 57
module pages individually wasn't practical here — each still links back to its source page. */
const CCOS_TAILORED_PROMPTS = {
17: (c)=>`Run CCOS Module #17 — "Semantic Qualifiers & Problem Representation" — on this case:\n\n${c}\n\nRewrite the presentation as a single, tightly-worded problem representation using semantic qualifiers (e.g. acute vs. chronic, progressive vs. stable, painful vs. painless) rather than restating the narrative verbatim. This is a single-pass output, not a dialogue.`,
12: (c)=>`Run CCOS Module #12 — "Differential Diagnosis Deepdive" — on this case:\n\n${c}\n\nFor each plausible diagnosis, bridge the pathophysiological mechanism to the specific bedside findings in this case that support or argue against it. Structure as one short paragraph per candidate. Single-pass output, not a dialogue.`,
15: (c)=>`Run CCOS Module #15 — "Illness Script Acquisition" — on this case:\n\n${c}\n\nConstruct the canonical illness script (typical onset, course, epidemiology, and key findings) for the leading diagnosis, then note where this specific case matches or deviates from that script. Single-pass output, not a dialogue.`,
36: (c)=>`Run CCOS Module #36 — "Bayesian Probability / Likelihood Ratio Engine" — on this case:\n\n${c}\n\nFor the leading diagnosis, talk through pre-test probability given demographics/context, then show qualitatively how each major finding or test result shifts that probability up or down toward a post-test estimate. Use ordinal language (low/moderate/high), not invented precise percentages. Single-pass output, not a dialogue.`,
50: (c)=>`Run CCOS Module #50 — "Diagnostic Reasoning Map" — on this case:\n\n${c}\n\nProduce a structured, step-numbered map from raw findings → pattern recognition → hypothesis generation → the leading conclusion, showing explicitly which finding fed which step. Single-pass output, not a dialogue.`,
28: (c)=>`Run CCOS Module #28 — "Diagnostic Time-Out" — on this case:\n\n${c}\n\nCall a deliberate safety pause. Identify one alternative driver of this presentation that hasn't yet been ruled out by the findings given, and state exactly what test or history point would rule it in or out. Single-pass output, not a dialogue.`,
30: (c)=>`Run CCOS Module #30 — "The Diagnostic Anchor Extractor" — on this case:\n\n${c}\n\nIdentify the single finding or early impression a clinician is most likely to anchor on in this case, and state one piece of evidence in the case itself that argues against over-weighting it. Single-pass output, not a dialogue.`,
37: (c)=>`Run CCOS Module #37 — "Red Herring / Signal-to-Noise Drill" — on this case:\n\n${c}\n\nPick the single most visually or numerically striking finding in this case. Argue both readings: (a) that it's a primary, causal finding, and (b) that it's a secondary/downstream red herring. State which reading the rest of the case evidence favors, and why. Single-pass output, not a dialogue.`,
45: (c)=>`Run CCOS Module #45 — "Shadow Module 44 — Clinical Genetics Adversarial Counterpart" — on this case:\n\n${c}\n\nTake the leading diagnosis (or its genetic/heritable contributors, if any are plausible here) and build the strongest possible adversarial case AGAINST it using only evidence already present in the case text. Then state what single new piece of information would resolve the disagreement. Single-pass output, not a dialogue.`,
54: (c)=>`Run CCOS Module #54 — "System 1 & System 2 Thinking Question Generator" — on this case:\n\n${c}\n\nState the fast, pattern-recognition (System 1) diagnosis a clinician would reach for immediately. Then generate 2-3 System-2 questions that force slower, deliberate checking before committing to it. Single-pass output, not a dialogue.`
};
const CCOS_MODULE_INDEX = [
{num:0, name:'Cold-Start Orientation', lens:'other', desc:'Pre-module entry point — identifies a new user\u2019s role and goal and routes them to the right module.', slug:'Module-00-Cold-Start-Orientation'},
{num:1, name:'Socratic Clinical Reasoning', lens:'promption', desc:'Pushes a learner to reason through a case actively rather than passively receive the answer.', slug:'Module-01-Socratic-Clinical-Reasoning'},
{num:2, name:'Patient-Advocate Case Documentation', lens:'other', desc:'A 4-step workflow for a family member to build a structured case record with an AI documentation companion.', slug:'Module-02-Patient-Advocate-Case-Documentation'},
{num:3, name:'Extended Patient-Advocate Monitoring', lens:'other', desc:'Longitudinal domain tracking (lifestyle, mood, medication, red flags) that extends Module 2.', slug:'Module-03-Extended-Patient-Advocate-Monitoring'},
{num:4, name:'Peer-Level Ward Round Preparation', lens:'other', desc:'Rehearses rounds, admissions, pre-op clearance, polypharmacy screening, and overnight triage.', slug:'Module-04-Peer-Level-Ward-Round-Preparation'},
{num:5, name:'Real-Time Case Review & Data Audit', lens:'other', desc:'Queries and cleans a single patient\u2019s live case log during active management.', slug:'Module-05-Real-Time-Case-Review-and-Data-Audit'},
{num:6, name:'Registry-Level Analytics', lens:'other', desc:'Queries an entire case registry across nine escalating levels of analytic depth.', slug:'Module-06-Registry-Level-Analytics'},
{num:7, name:'Longitudinal & Cross-Case Learning', lens:'other', desc:'Turns the registry itself into a cross-case, cross-time learning system.', slug:'Module-07-Longitudinal-and-Cross-Case-Learning'},
{num:8, name:'Socratic-Mode Design Specification', lens:'other', desc:'A 12-point QA specification for authoring or revising any new Socratic-mode prompt.', slug:'Module-08-Socratic-Mode-Design-Specification'},
{num:9, name:'N-of-1 Case Research Protocol', lens:'other', desc:'Running the seven-stage research protocol on your own complex case.', slug:'Module-09-Case-Research_Protocol'},
{num:10, name:'Journal & Article Reading', lens:'other', desc:'Structured close-reading of a journal article or case report alongside your own case.', slug:'Module-10-Medical-Journal-Article-Reading'},
{num:11, name:'Patient Education Query Intelligence', lens:'other', desc:'Turns a patient/caregiver question into a well-targeted, plain-language explanation.', slug:'Module-11-Patient-Education-Query-Intelligence'},
{num:12, name:'Differential Diagnosis Deepdive', lens:'promption', desc:'Bridges pathophysiology to bedside findings across each candidate diagnosis.', slug:'Module-12-Differential-Diagnosis-Deepdive'},
{num:13, name:'Medication Reconciliation & Polypharmacy Audit', lens:'other', desc:'Checks a medication list for interactions, duplication, and reconciliation gaps.', slug:'Module-13-Medication-Reconciliation-Polypharmacy-Audit'},
{num:14, name:'Resource-Constrained Clinical Reasoning', lens:'promption', desc:'Structures work-up and reasoning when imaging, labs, or referral access is limited.', slug:'Module-14-Global-Health-Resource-Constrained-Clinical-Reasoning'},
{num:15, name:'Illness Script Acquisition', lens:'promption', desc:'Builds the canonical illness script(s) this presentation should be checked against.', slug:'Module-15-Illness-Script-Acquisition'},
{num:16, name:'Basic Science \u2194 Clinical Integration', lens:'promption', desc:'Bridges bedside findings back to the underlying basic-science mechanism, bidirectionally.', slug:'Module-16-Bidirectional-Basic-Science-Clinical-Integration'},
{num:17, name:'Semantic Qualifiers & Problem Representation', lens:'promption', desc:'Converts messy narrative into a tight, qualifier-rich problem representation.', slug:'Module-17-Semantic-Qualifiers-Problem-Representation'},
{num:18, name:'Causal vs. Probabilistic (Network) Reasoning', lens:'promption', desc:'Structures reasoning explicitly as causal-mechanistic vs. probabilistic/associative.', slug:'Module-18-Causal-vs-Probabilistic-Network-Reasoning'},
{num:19, name:'Community & Social Medicine Insights', lens:'other', desc:'Surfaces population-health and social-determinant angles on an individual case.', slug:'Module-19-Community-and-Social-Medicine-Insights'},
{num:20, name:'Naturalistic Decision Making (Recognition-Primed)', lens:'promption', desc:'Models expert pattern-recognition decision-making rather than exhaustive differential-building.', slug:'Module-20-Recognition-Primed-Decision-Model'},
{num:21, name:'Evidence Frontier Search', lens:'other', desc:'Locates the most current literature bearing on this case\u2019s key question.', slug:'Module-21-Evidence-Frontier-Search'},
{num:22, name:'Nested Analysis', lens:'other', desc:'Compares this case against a small set of related cases, nested within one another.', slug:'Module-22-Nested-Analysis'},
{num:23, name:'Counterfactual Analysis', lens:'other', desc:'Explores how the case and its outcome would change under altered starting conditions.', slug:'Module-23-Counterfactual-Analysis'},
{num:24, name:'Heuristic Analysis', lens:'other', desc:'Names the cognitive heuristics (rules of thumb) implicitly at work in this case\u2019s reasoning.', slug:'Module-24-Heuristic-Analysis'},
{num:25, name:'Thematic Analysis', lens:'other', desc:'Extracts recurring themes across the case narrative for qualitative-style review.', slug:'Module-25-Thematic-Analysis'},
{num:26, name:'Bias Auditing', lens:'provocation', desc:'Checks the case reasoning against a standard list of clinical cognitive biases.', slug:'Module-26-Bias-Auditing'},
{num:27, name:'Time-Series & Velocity Analyzer', lens:'other', desc:'Reads the rate of change across serial vitals/labs, not just single values.', slug:'Module-27-Time-Series-Velocity-Analyzer'},
{num:28, name:'Diagnostic Time-Out', lens:'provocation', desc:'A forced pause: what alternative driver of the same picture hasn\u2019t been ruled out.', slug:'Module-28-Diagnostic-Time-Out'},
{num:29, name:'The Iatrogenic Domino Effect', lens:'provocation', desc:'Traces how one intervention could cascade into a chain of downstream harms.', slug:'Module-29-Iatrogenic-Domino-Effect'},
{num:30, name:'The "Diagnostic Anchor" Extractor', lens:'provocation', desc:'Names the specific finding a clinician is most likely anchoring on, and why it may mislead.', slug:'Module-30-Diagnostic-Anchor-Extractor'},
{num:31, name:'First-Principles Pathophysiology Mapping', lens:'promption', desc:'Rebuilds the case\u2019s findings from first-principles mechanism rather than pattern-matching.', slug:'Module-31-First-Principles-Pathophysiology-Mapping'},
{num:32, name:'Clinical Cognition Loop', lens:'promption', desc:'Runs the case through the full observe \u2192 hypothesize \u2192 test \u2192 revise cognition loop.', slug:'Module-32-Clinical-Cognition-Loop'},
{num:33, name:'The "Why Now?" (Precipitant) Hunter', lens:'provocation', desc:'Forces an explicit answer to why this presentation happened now rather than earlier or later.', slug:'Module-33-Why-Now-Precipitant-Hunter'},
{num:34, name:'The High-Value Care (HVC) Auditor', lens:'provocation', desc:'Audits the likely work-up for low-value, non-indicated testing or intervention.', slug:'Module-34-High-Value-Care-Auditor'},
{num:35, name:'Epistemic Certainty Mapping & Calibration', lens:'provocation', desc:'Maps confidence explicitly across each claim and checks it against the evidence supporting it.', slug:'Module-35-Epistemic-Certainty-Mapping-Calibration'},
{num:36, name:'The Bayesian Probability / Likelihood Ratio Engine', lens:'promption', desc:'Walks pre-test to post-test probability explicitly as each finding is added.', slug:'Module-36-Bayesian-Probability-Likelihood-Ratio-Engine'},
{num:37, name:'Red Herring / Signal-to-Noise Drill', lens:'provocation', desc:'Tests whether a striking finding is actually the primary driver or a downstream distractor.', slug:'Module-37-Red-Herring-Signal-to-Noise-Drill'},
{num:38, name:'Poly-Crisis & Cascading Failure Simulator', lens:'provocation', desc:'Simulates multiple simultaneous system failures compounding around the same case.', slug:'Module-38-Poly-Crisis-Cascading-Failure-Simulator'},
{num:39, name:'The "Global Knowledge Network" Diagnostic Matrix', lens:'promption', desc:'Organizes global/cross-population diagnostic knowledge into a matrix bearing on this case.', slug:'Module-39-Global-Knowledge-Network-Diagnostic-Matrix'},
{num:40, name:'The Operational & Throughput Strategist', lens:'other', desc:'Looks at this case through ward/department throughput and operational-efficiency constraints.', slug:'Module-40-Operational-Throughput-Strategist'},
{num:41, name:'Clinical Workflow Implementation Science', lens:'other', desc:'Applies implementation-science thinking to how a protocol would actually be adopted at the bedside.', slug:'Module-41-Clinical-Workflow-Implementation-Science'},
{num:42, name:'Clinical Pre-Mortem', lens:'provocation', desc:'Imagine the leading diagnosis is wrong \u2014 work backward to why.', slug:'Module-42-Clinical-Pre-Mortem'},
{num:43, name:'Health Economics & Value-Based Care Alignment', lens:'other', desc:'Weighs the case\u2019s likely management pathway against cost and value-based-care considerations.', slug:'Module-43-Health-Economics-Value-Based-Care-Alignment'},
{num:44, name:'Clinical Genetics Reasoning', lens:'other', desc:'Builds out the heritable/genetic contributors plausible for this presentation.', slug:'Module-44-Clinical-Genetics-Reasoning'},
{num:45, name:'Shadow Module 44 \u2014 Clinical Genetics Adversarial Counterpart', lens:'provocation', desc:'Argues the adversarial counter-case to Module 44\u2019s genetics reasoning.', slug:'Shadow-Module-44-Clinical-Genetics-Adversarial-Counterpart'},
{num:46, name:'Evidence-Based Medicine Insights', lens:'other', desc:'Frames the case\u2019s key clinical question as an appraisable, evidence-based-medicine question.', slug:'Module-45-Evidence-Based-Medicine-Insights'},
{num:47, name:'Shadow Module 47 \u2014 Evidence-Based Medicine Adversarial Counterpart', lens:'provocation', desc:'Argues the adversarial counter-case to Module 46\u2019s evidence framing.', slug:'Shadow-Module-45-EBM-Adversarial-Counterpart'},
{num:48, name:'Treatment Comparative Analysis & Evidence-Informed Prognosis Trajectory', lens:'other', desc:'Compares plausible treatment paths and their evidence-informed prognosis trajectories.', slug:'Module-48-Treatment-Comparative-Analysis-and-Prognosis-Trajectory'},
{num:49, name:'FMEA Analysis', lens:'provocation', desc:'Runs a Failure Modes & Effects Analysis on the likely management plan for this case.', slug:'Module-49-FMEA-Analysis-and-Insights'},
{num:50, name:'Diagnostic Reasoning Map', lens:'promption', desc:'Lays out the full reasoning chain from finding to conclusion as a structured map.', slug:'Module-50-DRM-Diagnostic-Reasoning-Map'},
{num:51, name:'Systems-Based Clinical Analysis', lens:'other', desc:'Reads the case through systems-based-practice competency lenses.', slug:'Module-51-Systems-Based-Clinical-Analysis-and-Insights'},
{num:52, name:'Clinical Pearls Distillation', lens:'promption', desc:'Distills the case down to a short list of transferable clinical pearls.', slug:'Module-52-CP-Clinical-Pearls'},
{num:53, name:'Clinical Guideline Intelligence Navigator', lens:'other', desc:'Locates and applies the relevant clinical practice guideline(s) to this case.', slug:'Module-53-Clinical-Guideline-Intelligence-Navigator'},
{num:54, name:'System 1 & System 2 Thinking Question Generator', lens:'provocation', desc:'Separates the fast pattern-match answer from what slow, deliberate checking would add.', slug:'Module-54-System1-System2-Question-Generator'},
{num:55, name:'Patient Needs Assessment', lens:'promption', desc:'Structures a systematic read of the patient\u2019s needs beyond the presenting complaint.', slug:'Module-55-Patient-Needs-Assessment'},
{num:56, name:'Hypothetico-Deductive Reasoning', lens:'promption', desc:'Runs the classic generate-hypothesis \u2192 deduce-test \u2192 confirm/refute cycle explicitly.', slug:'Module-HDM-Hypothetico-Deductive-Model'},
{num:57, name:'Clinical Cognition Deep Dive', lens:'promption', desc:'The deepest single-run synthesis across the full clinical-cognition module set.', slug:'Module-CC-Clinical-Cognition-Deep-Dive'}
];
function genPrompt(num, name, desc, slug){
return (c) => `Run CCOS Module #${num} — "${name}" — on this case:\n\n${c}\n\nTask: ${desc} Produce a single structured, well-organized report addressing this task directly against the case details above — do not restate the case, and do not end with a question to the reader. This is a single-pass output, not a dialogue. (Full module specification: https://avi33tbtt.github.io/Prompts/${slug}.html)`;
}
const CCOS_MODULES = {};
CCOS_MODULE_INDEX.forEach(m=>{
CCOS_MODULES['m'+m.num] = {
num: m.num,
name: m.name,
mode: m.lens,
desc: m.desc,
url: `https://avi33tbtt.github.io/Prompts/${m.slug}.html`,
prompt: CCOS_TAILORED_PROMPTS[m.num] || genPrompt(m.num, m.name, m.desc, m.slug)
};
});
/* ---------- config: analytics / pipeline modules (single-lens, one-shot) ---------- */
const CUSTOM_MODULES = {
illness_script: {
name: 'Illness Script Map',
desc: 'Match findings against canonical illness scripts — fit and misfit.',
prompt: (c) => `Run a single-pass "Illness Script Mapping" analysis on this case:\n\n${c}\n\nProduce a structured report (use headers) with:\n1. The 2-3 canonical illness scripts (onset, course, key findings) this case most resembles.\n2. For each: which findings FIT the script, and which findings DON'T FIT or are unexplained by it.\n3. A one-line verdict on which script fits best and why, flagging any finding that remains unexplained regardless of which script is chosen.\nBe concrete and grounded only in what's in the case text. This is a single-pass report, not a dialogue — do not ask the reader questions.`
},
differential: {
name: 'Differential Landscape',
desc: 'Full weighted differential with likelihood language.',
prompt: (c) => `Run a single-pass "Differential Landscape" analysis on this case:\n\n${c}\n\nProduce a structured report with a table or list of 4-6 differentials, each with: likelihood (high/moderate/low), the supporting findings, and the one finding or test that would most efficiently rule it in or out. End with a one-line note on which two differentials are closest to each other and hardest to distinguish given the information in the case. Single-pass report, no questions to the reader.`
},
bias_audit: {
name: 'Bias Audit',
desc: 'Anchoring, premature closure, framing, availability bias — checked against this case.',
prompt: (c) => `Run a single-pass "Bias Audit" on this case:\n\n${c}\n\nFor each of: anchoring, premature closure, framing effect, availability bias, and confirmation bias — state whether that bias is plausible in how this specific case could be mis-reasoned, and if so, exactly what wrong turn it would produce here (not a generic definition). Skip any bias that has no real foothold in this case rather than forcing all five. End with the single most likely bias to trip up a learner on this specific case. Single-pass report, no questions to the reader.`
},
red_flags: {
name: 'Red Flag & Safety Net',
desc: 'Explicit checklist of red flags: present, absent, or not yet elicited.',
prompt: (c) => `Run a single-pass "Red Flag & Safety Net" analysis on this case:\n\n${c}\n\nList every red flag relevant to this presentation as a checklist, marking each PRESENT, ABSENT (per the case text), or NOT ELICITED (case doesn't say). For each PRESENT or NOT ELICITED item, give one line on why it matters here. End with a one-line safety verdict: is this presentation adequately safety-netted by what's documented, or is there a gap. Single-pass report, no questions to the reader.`
},
evidence_anchor: {
name: 'Evidence Anchoring',
desc: 'Ties each major claim back to a mechanism or evidence type — flags what is unverified.',
prompt: (c) => `Run a single-pass "Evidence Anchoring" analysis on this case:\n\n${c}\n\nFor the 3-4 most load-bearing clinical claims or decisions in this case, state the mechanism or type of evidence that would justify each (e.g. "supported by pathophysiology," "supported by population-level epidemiology," "supported by this case's own labs," "not verifiable from the text given"). Be honest about which claims are asserted without evidence being shown. Do not fabricate citations or exact study names. Single-pass report, no questions to the reader.`
},
pre_mortem: {
name: 'Clinical Pre-Mortem',
desc: 'Imagine the leading diagnosis is wrong — work backward to why.',
prompt: (c) => `Run a single-pass "Clinical Pre-Mortem" on this case:\n\n${c}\n\nAssume the most likely diagnosis for this case turns out to be wrong 48 hours from now. Working backward: what are the 2-3 most plausible reasons that could happen (a missed alternative, an unchecked red flag, an over-weighted finding)? For each, state what single piece of missing information would have caught it earlier. Single-pass report, no questions to the reader.`
},
systems_lens: {
name: 'Systems & Cost Lens',
desc: 'What changes if imaging, labs, or referral access is limited.',
prompt: (c) => `Run a single-pass "Systems & Cost Lens" analysis on this case:\n\n${c}\n\nIdentify which steps in this case's likely work-up depend on resources (imaging, specialist referral, specific labs) that may not be available in a low-resource setting. For each, give the pragmatic alternative a clinician without that resource would reasonably fall back on, and what's lost by doing so. Single-pass report, no questions to the reader.`
},
equity_lens: {
name: 'Equity & Context Lens',
desc: 'Social, financial, and access factors the case raises or omits.',
prompt: (c) => `Run a single-pass "Equity & Context Lens" analysis on this case:\n\n${c}\n\nIdentify what social, occupational, financial, or access-to-care factors are documented in this case and how they plausibly shaped the presentation or delay in care. Then flag what's conspicuously NOT documented (social history, financial constraints, health literacy) that would matter for this patient's actual management, as a gap rather than a finding. Single-pass report, no questions to the reader.`
}
};
/* Combined map used by the Analytics grid and the Pipeline Builder dropdown —
all 58 CCOS modules (#0-#57), keyed m0..m57, plus the 8 additional custom lenses. */
const ALL_MODULES = Object.assign({}, CCOS_MODULES, CUSTOM_MODULES);
/* CCOS modules split by lens, for the three Analytics-mode headings + the "Additional lenses" bucket
(which also carries the custom, non-CCOS-numbered lenses defined above). */
const PROMPTION_MODULES = {}, PROVOCATION_MODULES = {}, OTHER_MODULES = {};
Object.entries(CCOS_MODULES).forEach(([key, m])=>{
if(m.mode === 'promption') PROMPTION_MODULES[key] = m;
else if(m.mode === 'provocation') PROVOCATION_MODULES[key] = m;
else OTHER_MODULES[key] = m;
});
const ADDITIONAL_LENS_MODULES = Object.assign({}, OTHER_MODULES, CUSTOM_MODULES);
/* Analytics mode shows only a curated, "most important" subset of Promption/Provocation
modules (the full sets remain available in the Pipeline Builder dropdown via ALL_MODULES). */
const IMPORTANT_PROMPTION_NUMS = [1, 12, 15, 17, 36, 50, 52, 56];
const IMPORTANT_PROVOCATION_NUMS = [26, 28, 30, 37, 42, 54];
const ANALYTICS_PROMPTION_MODULES = {};
IMPORTANT_PROMPTION_NUMS.forEach(n => { if(PROMPTION_MODULES['m'+n]) ANALYTICS_PROMPTION_MODULES['m'+n] = PROMPTION_MODULES['m'+n]; });
const ANALYTICS_PROVOCATION_MODULES = {};
IMPORTANT_PROVOCATION_NUMS.forEach(n => { if(PROVOCATION_MODULES['m'+n]) ANALYTICS_PROVOCATION_MODULES['m'+n] = PROVOCATION_MODULES['m'+n]; });
/* ---------- state ---------- */
let state = {
provider: 'claude',
activity: null,
mode: 'dialogue',
analyticsModule: null,
pipelineSelection: [], // ordered array of module keys
messages: [], // {role:'user'|'assistant', content:string, auto?:boolean}
running: false,
runKind: null, // 'dialogue' | 'analytics' | 'pipeline'
quizPattern: null
};
const $ = (id) => document.getElementById(id);
/* ---------- localStorage helpers ---------- */
function loadKeys(){
try{ return JSON.parse(localStorage.getItem('casebench_keys')||'{}'); }catch(e){ return {}; }
}
function saveKeys(k){ localStorage.setItem('casebench_keys', JSON.stringify(k)); }
function loadModels(){
try{ return JSON.parse(localStorage.getItem('casebench_models')||'{}'); }catch(e){ return {}; }
}
function saveModels(m){ localStorage.setItem('casebench_models', JSON.stringify(m)); }
function loadEndpoints(){
try{ return JSON.parse(localStorage.getItem('casebench_endpoints')||'{}'); }catch(e){ return {}; }
}
function saveEndpoints(e){ localStorage.setItem('casebench_endpoints', JSON.stringify(e)); }
function loadCaseText(){
try{ return localStorage.getItem('casebench_case') || ''; }catch(e){ return ''; }
}
function saveCaseText(t){ try{ localStorage.setItem('casebench_case', t); }catch(e){} }
const SPECIALTIES = [
'Any',
'Allergy and Immunology',
'Anesthesiology',
'Cardiology',
'Cardiothoracic Surgery',
'Colon and Rectal Surgery',
'Critical Care / Intensive Care Medicine',
'Dermatology',
'Emergency Medicine',
'Endocrinology',
'Family Medicine',
'Gastroenterology',
'General Surgery',
'Geriatrics',
'Gynecologic Oncology',
'Hematology',
'Hematology-Oncology',
'Hepatology',
'Hospice and Palliative Medicine',
'Infectious Disease',
'Internal Medicine',
'Interventional Radiology',
'Medical Genetics',
'Nephrology',
'Neonatology',
'Neurology',
'Neurosurgery',
'Obstetrics and Gynecology',
'Occupational Medicine',
'Oncology',
'Ophthalmology',
'Orthopedic Surgery',
'Otolaryngology (ENT)',
'Pain Medicine',
'Pathology',
'Pediatrics',
'Pediatric Cardiology',
'Pediatric Emergency Medicine',
'Pediatric Surgery',
'Physical Medicine and Rehabilitation',
'Plastic Surgery',
'Podiatry',
'Preventive Medicine',
'Psychiatry',
'Pulmonology',
'Radiation Oncology',
'Radiology',
'Rheumatology',
'Sleep Medicine',
'Sports Medicine',
'Toxicology',
'Transplant Medicine',
'Trauma Surgery',
'Urology',
'Vascular Surgery'
];
(function populateSpecialties(){
const sel = $('sampleSpecialty');
if(!sel) return;
SPECIALTIES.forEach(spec=>{
const opt = document.createElement('option');
opt.value = spec;
opt.textContent = spec;
sel.appendChild(opt);
});
})();
function buildSampleCasePrompt(difficulty, specialty){
let ask = 'Generate one realistic, self-contained clinical vignette for a medical learner to practice diagnostic reasoning on. ';
if(specialty && specialty !== 'Any'){
ask += `The case must fall within the specialty of ${specialty}. `;
}
if(difficulty && difficulty !== 'Any'){
ask += `Pitch the case difficulty at the level of: ${difficulty}. `;
} else {
ask += 'Cover a single adult or pediatric patient presenting with a common or classic presentation (your choice — vary it each time). ';
}
ask += 'Include age, sex, presenting complaint, relevant history, and pertinent exam/vital sign findings, and a couple of relevant labs or initial test results if appropriate. Do not reveal or hint at the diagnosis name, and do not include headers, labels, or any framing text — output ONLY the vignette itself as a single flowing paragraph of 4-7 sentences, written the way a case would appear in a textbook.';
return ask;
}
$('sampleCaseBtn') && $('sampleCaseBtn').addEventListener('click', async (e)=>{
e.preventDefault();
const btn = $('sampleCaseBtn');