Repository navigation
Expand file tree
/
Copy pathdemo.html
More file actions
executable file
·1211 lines (1172 loc) · 32.5 KB
/
Copy pathdemo.html
File metadata and controls
executable file
·1211 lines (1172 loc) · 32.5 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="zh-CN">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SitHub Review Console</title>
<style>
:root {
color-scheme: light;
--page: #f4f6f8;
--panel: #ffffff;
--panel-soft: #f9fafb;
--ink: #17202a;
--muted: #667085;
--line: #d9dee7;
--line-strong: #c3cad6;
--blue: #2256c7;
--blue-soft: #e8eefc;
--green: #157a5c;
--green-soft: #e4f5ee;
--red: #b42318;
--red-soft: #fde8e6;
--amber: #a05a00;
--amber-soft: #fff2d4;
--cyan: #0e7490;
--cyan-soft: #e1f4f8;
--shadow: 0 12px 30px rgba(27, 39, 54, .08);
--radius: 8px;
}
* { box-sizing: border-box; }
html { min-width: 320px; }
body {
margin: 0;
min-height: 100vh;
font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
color: var(--ink);
background:
linear-gradient(180deg, #fbfcfd 0, var(--page) 240px),
var(--page);
letter-spacing: 0;
}
button, textarea, input {
font: inherit;
letter-spacing: 0;
}
button {
cursor: pointer;
}
.topbar {
position: sticky;
top: 0;
z-index: 20;
height: 58px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 0 22px;
background: rgba(255,255,255,.92);
border-bottom: 1px solid var(--line);
backdrop-filter: blur(12px);
}
.brand {
display: flex;
align-items: center;
min-width: 0;
gap: 12px;
}
.mark {
width: 34px;
height: 34px;
border-radius: 8px;
display: grid;
place-items: center;
color: #fff;
background: #1d2939;
font-weight: 800;
}
.brand-title {
display: grid;
gap: 1px;
min-width: 0;
}
.brand-title strong {
font-size: 15px;
white-space: nowrap;
}
.brand-title span {
color: var(--muted);
font-size: 12px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.top-actions {
display: flex;
align-items: center;
gap: 8px;
min-width: 0;
}
.status-pill, .icon-button, .command-button, .filter-button, .scenario-button {
min-height: 34px;
border: 1px solid var(--line);
border-radius: 7px;
background: #fff;
color: var(--ink);
}
.status-pill {
display: inline-flex;
align-items: center;
gap: 7px;
padding: 0 11px;
color: var(--muted);
font-size: 12px;
}
.dot {
width: 8px;
height: 8px;
border-radius: 99px;
background: var(--green);
}
.icon-button {
width: 36px;
display: grid;
place-items: center;
color: var(--muted);
text-decoration: none;
}
.icon-button:hover,
.command-button:hover,
.filter-button:hover {
border-color: var(--line-strong);
background: var(--panel-soft);
}
.page {
width: min(1440px, calc(100% - 28px));
margin: 0 auto;
padding: 20px 0 38px;
}
.workspace {
display: grid;
grid-template-columns: 278px minmax(0, 1fr);
gap: 16px;
align-items: start;
}
.sidebar,
.panel,
.metric,
.event-row,
.inspector,
.report-preview,
.terminal {
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
}
.sidebar {
position: sticky;
top: 76px;
padding: 14px;
box-shadow: var(--shadow);
}
.sidebar h1 {
margin: 0 0 6px;
font-size: 20px;
line-height: 1.15;
}
.sidebar p {
margin: 0 0 14px;
color: var(--muted);
font-size: 13px;
line-height: 1.45;
}
.scenario-list {
display: grid;
gap: 8px;
}
.scenario-button {
width: 100%;
min-height: 72px;
padding: 10px;
display: grid;
gap: 5px;
text-align: left;
}
.scenario-button.active {
border-color: var(--blue);
background: var(--blue-soft);
}
.scenario-button strong {
font-size: 13px;
}
.scenario-button span {
color: var(--muted);
font-size: 12px;
line-height: 1.35;
}
.sidebar-divider {
height: 1px;
margin: 14px 0;
background: var(--line);
}
.command-stack {
display: grid;
gap: 8px;
}
.command-button {
width: 100%;
min-height: 38px;
padding: 0 10px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
color: var(--muted);
font-size: 12px;
}
.command-button code {
overflow: hidden;
text-overflow: ellipsis;
}
.main {
min-width: 0;
display: grid;
gap: 14px;
}
.context-strip {
min-height: 86px;
display: grid;
grid-template-columns: minmax(0, 1fr) auto;
align-items: center;
gap: 16px;
padding: 18px 20px;
background: var(--panel);
border: 1px solid var(--line);
border-radius: var(--radius);
box-shadow: var(--shadow);
}
.context-title {
min-width: 0;
}
.context-title h2 {
margin: 0 0 6px;
font-size: 24px;
line-height: 1.15;
overflow-wrap: anywhere;
}
.context-title p {
margin: 0;
color: var(--muted);
font-size: 13px;
line-height: 1.45;
}
.branch-card {
width: min(360px, 42vw);
display: grid;
gap: 8px;
padding: 12px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--panel-soft);
}
.branch-line {
display: grid;
grid-template-columns: 76px minmax(0, 1fr);
gap: 8px;
align-items: center;
font-size: 12px;
}
.branch-line span {
color: var(--muted);
}
.branch-line code {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.metrics {
display: grid;
grid-template-columns: repeat(5, minmax(0, 1fr));
gap: 10px;
}
.metric {
min-height: 92px;
padding: 14px;
display: grid;
align-content: space-between;
gap: 10px;
}
.metric-label {
color: var(--muted);
font-size: 12px;
}
.metric-value {
font-size: 22px;
line-height: 1;
font-weight: 800;
overflow-wrap: anywhere;
}
.metric-note {
color: var(--muted);
font-size: 12px;
}
.tone-pass { color: var(--green); }
.tone-warn { color: var(--amber); }
.tone-fail { color: var(--red); }
.tone-info { color: var(--blue); }
.review-grid {
display: grid;
grid-template-columns: minmax(0, 1fr) 390px;
gap: 14px;
}
.panel {
min-width: 0;
overflow: hidden;
}
.panel-head {
min-height: 52px;
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
padding: 0 14px;
border-bottom: 1px solid var(--line);
}
.panel-head h3 {
margin: 0;
font-size: 15px;
}
.panel-head span {
color: var(--muted);
font-size: 12px;
}
.filters {
display: flex;
gap: 6px;
flex-wrap: wrap;
}
.filter-button {
min-height: 30px;
padding: 0 10px;
font-size: 12px;
color: var(--muted);
}
.filter-button.active {
color: #fff;
border-color: var(--blue);
background: var(--blue);
}
.event-list {
display: grid;
gap: 8px;
padding: 12px;
}
.event-row {
min-height: 78px;
display: grid;
grid-template-columns: 5px minmax(0, 1fr) auto;
gap: 12px;
align-items: stretch;
padding: 0 12px 0 0;
overflow: hidden;
}
.event-row button {
display: contents;
}
.event-row.active {
outline: 2px solid rgba(34, 86, 199, .22);
}
.event-bar {
width: 5px;
background: var(--blue);
}
.event-row[data-severity="breaking"] .event-bar { background: var(--red); }
.event-row[data-severity="changed"] .event-bar { background: var(--amber); }
.event-row[data-category="script"] .event-bar { background: var(--cyan); }
.event-main {
min-width: 0;
padding: 11px 0;
}
.event-meta {
display: flex;
align-items: center;
gap: 8px;
margin-bottom: 5px;
}
.tag {
display: inline-flex;
min-height: 22px;
align-items: center;
padding: 0 8px;
border-radius: 99px;
background: #eef1f5;
color: var(--muted);
font-size: 11px;
font-weight: 700;
white-space: nowrap;
}
.tag.breaking { background: var(--red-soft); color: var(--red); }
.tag.changed { background: var(--amber-soft); color: var(--amber); }
.tag.info { background: var(--blue-soft); color: var(--blue); }
.tag.script { background: var(--cyan-soft); color: var(--cyan); }
.event-title {
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
line-height: 1.45;
overflow-wrap: anywhere;
}
.event-summary {
color: var(--muted);
font-size: 12px;
line-height: 1.45;
margin-top: 4px;
overflow-wrap: anywhere;
}
.event-impact {
align-self: center;
width: 84px;
text-align: right;
color: var(--muted);
font-size: 12px;
}
.inspector {
position: sticky;
top: 76px;
overflow: hidden;
}
.inspector-body {
padding: 14px;
display: grid;
gap: 12px;
}
.detail-block {
display: grid;
gap: 7px;
}
.detail-block h4 {
margin: 0;
color: var(--muted);
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
}
.detail-block p {
margin: 0;
font-size: 13px;
line-height: 1.48;
}
.token-list {
display: flex;
flex-wrap: wrap;
gap: 6px;
}
.token {
max-width: 100%;
min-height: 24px;
display: inline-flex;
align-items: center;
padding: 0 8px;
border: 1px solid var(--line);
border-radius: 6px;
background: var(--panel-soft);
color: var(--ink);
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
overflow-wrap: anywhere;
}
.flow {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
padding: 12px;
}
.flow-step {
min-height: 78px;
padding: 10px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: var(--panel-soft);
display: grid;
gap: 5px;
}
.flow-step strong {
font-size: 13px;
}
.flow-step span {
color: var(--muted);
font-size: 12px;
line-height: 1.35;
}
.two-column {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 14px;
}
.report-preview,
.terminal {
min-width: 0;
overflow: hidden;
}
.preview-body,
.terminal-body {
padding: 14px;
}
.report-lines {
display: grid;
gap: 8px;
}
.report-line {
display: grid;
grid-template-columns: 116px minmax(0, 1fr);
gap: 10px;
font-size: 13px;
}
.report-line span:first-child {
color: var(--muted);
}
.report-line span:last-child {
overflow-wrap: anywhere;
}
.terminal-body {
background: #111827;
}
.terminal pre {
margin: 0;
color: #e5e7eb;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
line-height: 1.6;
overflow-x: auto;
white-space: pre;
}
.diff-panel {
display: grid;
gap: 0;
padding: 12px;
max-height: 370px;
overflow: auto;
}
.diff-line {
min-height: 24px;
padding: 3px 8px;
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
font-size: 12px;
line-height: 1.45;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.diff-line.add { background: var(--green-soft); color: #065f46; }
.diff-line.remove { background: var(--red-soft); color: #8a1f16; }
.diff-line.same { color: #475467; }
.toast {
position: fixed;
right: 18px;
bottom: 18px;
z-index: 30;
display: none;
min-height: 38px;
align-items: center;
padding: 0 14px;
border: 1px solid var(--line);
border-radius: var(--radius);
background: #fff;
box-shadow: var(--shadow);
color: var(--muted);
font-size: 13px;
}
.toast.visible { display: flex; }
@media (max-width: 1120px) {
.workspace { grid-template-columns: 1fr; }
.sidebar { position: static; }
.scenario-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.command-stack { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.review-grid { grid-template-columns: 1fr; }
.inspector { position: static; }
}
@media (max-width: 860px) {
.topbar { padding: 0 14px; }
.status-pill { display: none; }
.context-strip { grid-template-columns: 1fr; }
.branch-card { width: 100%; }
.metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-column { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
.page { width: min(100% - 18px, 1440px); }
.scenario-list,
.command-stack,
.metrics,
.flow {
grid-template-columns: 1fr;
}
.context-title h2 { font-size: 20px; }
.event-row { grid-template-columns: 5px minmax(0, 1fr); }
.event-impact { display: none; }
.report-line { grid-template-columns: 1fr; gap: 3px; }
}
</style>
</head>
<body>
<header class="topbar">
<div class="brand">
<div class="mark">S</div>
<div class="brand-title">
<strong>SitHub Review Console</strong>
<span>Skill 语义 diff、测试和版本门禁</span>
</div>
</div>
<div class="top-actions">
<span class="status-pill"><span class="dot"></span>local preview</span>
<a class="icon-button" href="./prompt-lifecycle-demo.html" aria-label="Open prompt lifecycle demo">LC</a>
<a class="icon-button" href="https://github.com/OpenRaiser/SitHub" target="_blank" rel="noreferrer" aria-label="Open GitHub">GH</a>
</div>
</header>
<main class="page">
<div class="workspace">
<aside class="sidebar">
<h1>评审场景</h1>
<p>选择一个 Skill 变更,查看 `sit` 如何把文件修改转成评审信号。</p>
<div class="scenario-list" id="scenario-list"></div>
<div class="sidebar-divider"></div>
<div class="command-stack" id="command-stack"></div>
</aside>
<section class="main" aria-live="polite">
<section class="context-strip">
<div class="context-title">
<h2 id="scenario-title"></h2>
<p id="scenario-summary"></p>
</div>
<div class="branch-card">
<div class="branch-line"><span>Baseline</span><code id="baseline-ref"></code></div>
<div class="branch-line"><span>Current</span><code id="current-ref"></code></div>
<div class="branch-line"><span>Package</span><code id="package-name"></code></div>
</div>
</section>
<section class="metrics" id="metrics"></section>
<section class="panel">
<div class="panel-head">
<h3>控制回路</h3>
<span id="loop-caption"></span>
</div>
<div class="flow" id="flow"></div>
</section>
<div class="review-grid">
<section class="panel">
<div class="panel-head">
<h3>语义事件</h3>
<div class="filters" id="filters"></div>
</div>
<div class="event-list" id="event-list"></div>
</section>
<aside class="inspector">
<div class="panel-head">
<h3>事件详情</h3>
<span id="inspector-count"></span>
</div>
<div class="inspector-body" id="inspector-body"></div>
</aside>
</div>
<div class="two-column">
<section class="report-preview">
<div class="panel-head">
<h3>PR 摘要</h3>
<span id="report-status"></span>
</div>
<div class="preview-body">
<div class="report-lines" id="report-lines"></div>
</div>
</section>
<section class="terminal">
<div class="panel-head">
<h3>命令输出</h3>
<span id="terminal-label"></span>
</div>
<div class="terminal-body">
<pre id="terminal-output"></pre>
</div>
</section>
</div>
<section class="panel">
<div class="panel-head">
<h3>文本 diff 片段</h3>
<span id="diff-caption"></span>
</div>
<div class="diff-panel" id="diff-panel"></div>
</section>
</section>
</div>
</main>
<div class="toast" id="toast">copied</div>
<script>
const scenarios = [
{
id: "pwb",
title: "paper-webpage-builder 0.4.0 -> 0.5.0",
short: "Prompt + 多脚本能力面增强",
summary: "新增 PDF 扫描、表格抽取、引用草稿和图像 manifest,验证脚本摘要能让 reviewer 看懂工具行为变化。",
package: "paper-webpage-builder",
baseline: "a4d0f92 / v0.4.0",
current: "5c11542 / v0.5.0",
validation: "pass",
tests: "3/3",
risk: "review-required",
bump: "minor",
versionGate: "passed",
sourceLabel: "真实实验对象",
events: [
{
category: "manifest",
severity: "changed",
impact: "minor",
message: "MANIFEST changed version: '0.4.0' -> '0.5.0'",
summary: "按语义 diff 建议完成 minor bump,version gate 可通过。"
},
{
category: "prompt",
severity: "changed",
impact: "review",
message: "PROMPT changed skill: SKILL.md -> SKILL.md (+17 -8)",
summary: "工作流增加 PDF 扫描、表格 ledger、citation block 和新的图像转换流程。",
details: {
headings: ["Paper Webpage Builder", "Workflow", "Scripts"],
variables: []
}
},
{
category: "script",
severity: "changed",
impact: "review",
message: "SCRIPT added scripts/scan_pdf.py",
summary: "PDF-only 输入现在能生成 title/authors/abstract/sections/captions/links 库存。",
details: {
doc: "Extract a compact content inventory from a paper PDF",
cliArgs: ["pdf", "--include-image-objects"],
functions: ["extract_title", "extract_authors", "extract_abstract", "extract_sections", "extract_links"],
imports: ["argparse", "re", "shutil", "subprocess", "pathlib", "fitz"],
external: ["pdfinfo", "pdftotext"],
review: "需要用 pdf_with_assets golden 或专项 PDF case 覆盖。"
}
},
{
category: "script",
severity: "changed",
impact: "review",
message: "SCRIPT added scripts/extract_tables.py",
summary: "LaTeX 表格可导出为 JSON ledger,降低遗漏 central table 的概率。",
details: {
doc: "Extract every LaTeX table into a JSON ledger for the central-table check",
cliArgs: ["paper_tex", "--max-rows", "--format"],
functions: ["read_with_inputs", "split_rows", "split_into_header_and_data", "emit_json"],
review: "需要关注 multicolumn/multirow 近似展开是否影响表格核对。"
}
},
{
category: "script",
severity: "changed",
impact: "review",
message: "SCRIPT changed scripts/convert_figures.sh",
summary: "Shell shim 保持兼容,同时委派到新的 Python 图像转换器。",
details: {
usage: ["convert_figures.sh <source_images_dir> <target_figures_dir> [dpi] [--legacy]"],
delegates: ["convert_figures.py"],
external: ["gs"],
changes: ["added usage: --legacy", "added delegates: convert_figures.py"]
}
},
{
category: "script",
severity: "changed",
impact: "review",
message: "SCRIPT changed scripts/scan_paper.py",
summary: "TeX 扫描器现在递归读取 input/include,并处理非 UTF-8 文件。",
details: {
changes: ["added functions: read_text_with_warning, read_with_inputs", "added imports: sys", "updated module description"],
cliArgs: ["paper_tex"],
functions: ["strip_comments", "read_with_inputs", "find_braced", "main"]
}
}
],
diff: [
["same", "## Workflow"],
["remove", "- Run scripts/scan_paper.py <paper.tex> when a TeX source exists."],
["add", "+ Run scripts/scan_paper.py <paper.tex>. Multi-file projects are followed automatically."],
["add", "+ Run scripts/scan_pdf.py <paper.pdf> when only a PDF is available."],
["add", "+ Run scripts/extract_tables.py <paper.tex> to seed the table ledger."],
["same", ""],
["remove", "- Convert PDF figures to PNG/SVG-friendly web assets."],
["add", "+ Convert figures with scripts/convert_figures.py and write figures.manifest.json."]
],
terminal: [
"Skill Diff",
"Baseline: paper-webpage-builder@0.4.0",
"Current: paper-webpage-builder@0.5.0",
"Risk: review-required",
"Suggested version bump: minor",
"",
"[script]",
" - SCRIPT added scripts/scan_pdf.py",
" summary: added python script: Extract a compact content inventory from a paper PDF",
" cli args: pdf, --include-image-objects",
" external commands: pdfinfo, pdftotext",
" - SCRIPT changed scripts/convert_figures.sh",
" delegates: convert_figures.py"
]
},
{
id: "schema",
title: "paper-taxonomy-mapper 0.1.0 -> 0.2.0",
short: "required schema 字段新增",
summary: "输出 schema 新增 required 字段并调整 oneOf/allOf,`sit` 应该阻断低于 major 的版本变化。",
package: "paper-taxonomy-mapper",
baseline: "v0.1.0",
current: "v0.2.0",
validation: "pass",
tests: "3/3",
risk: "breaking-change",
bump: "major",
versionGate: "blocked if minor",
sourceLabel: "内置示例包",
events: [
{
category: "schema",
severity: "breaking",
impact: "major",
message: "SCHEMA output property added confidence (required)",
summary: "下游旧消费者缺少 confidence 时会失败。"
},
{
category: "schema",
severity: "breaking",
impact: "major",
message: "SCHEMA output property added evidence (required)",
summary: "输出契约变严格,要求 major bump。"
},
{
category: "schema",
severity: "breaking",
impact: "major",
message: "SCHEMA output allOf branch added allOf[1]",
summary: "组合 schema 增加约束,属于潜在破坏性变化。"
},
{
category: "prompt",
severity: "changed",
impact: "review",
message: "PROMPT changed classify: classify.md -> classify.md (+11 -2)",
summary: "prompt 要求输出 evidence 和 confidence。"
},
{
category: "golden",
severity: "changed",
impact: "review",
message: "GOLDEN expected changed benchmark-001",
summary: "golden case 已同步新的输出契约。"
}
],
diff: [
["same", "properties:"],
["same", " paper_type: { enum: [benchmark, method, survey] }"],
["add", "+ confidence: { type: string }"],
["add", "+ evidence: { type: array }"],
["add", "+ research_area: { type: string }"],
["add", "+ required: [paper_type, confidence, evidence, research_area]"]
],
terminal: [
"Risk: breaking-change",
"Suggested version bump: major",
"",
"commit blocked: semantic changes require at least a major version bump",
"reason: required output properties were added"
]
},
{
id: "docs",
title: "Prompt wording patch",
short: "说明文字和报告措辞微调",
summary: "只调整描述和报告文字,没有 schema、runner、resource 或 golden 行为变化。",
package: "sample-skill",
baseline: "HEAD~1",
current: "HEAD",
validation: "pass",
tests: "1/1",
risk: "review-required",
bump: "minor",
versionGate: "passed",
sourceLabel: "轻量示例",
events: [
{
category: "prompt",
severity: "changed",
impact: "review",
message: "PROMPT changed system: system.md -> system.md (+4 -1)",
summary: "默认按 prompt 变化给 review-required,避免行为漂移不可见。"
},
{
category: "risk",
severity: "changed",
impact: "minor",
message: "RISK review-required",
summary: "无 schema breaking,但仍建议 minor bump。"
}
],
diff: [
["same", "Return a compact JSON answer."],
["remove", "- Keep the response short."],
["add", "+ Keep the response concise and cite evidence when available."],
["add", "+ If evidence is missing, set evidence to an empty array."]
],
terminal: [
"Validation: pass",
"Golden tests: pass",
"Risk: review-required",
"Suggested version bump: minor"
]
}
];
let activeScenario = scenarios[0];
let activeFilter = "all";
let selectedEvent = 0;
const $ = (id) => document.getElementById(id);
function escapeHtml(value) {
return String(value)
.replace(/&/g, "&")
.replace(/</g, "<")
.replace(/>/g, ">")
.replace(/"/g, """);
}
function toneForRisk(risk) {
if (risk === "breaking-change") return "tone-fail";
if (risk === "review-required") return "tone-warn";
return "tone-pass";
}
function severityLabel(severity) {
if (severity === "breaking") return "breaking";
if (severity === "changed") return "changed";
return "info";
}
function categoryLabel(category) {
const labels = {
manifest: "manifest",
prompt: "prompt",
script: "script",
schema: "schema",
golden: "golden",
risk: "risk"
};
return labels[category] || category;
}
function renderScenarioList() {
$("scenario-list").innerHTML = scenarios.map((scenario) => `
<button class="scenario-button ${scenario.id === activeScenario.id ? "active" : ""}" data-scenario="${scenario.id}">
<strong>${escapeHtml(scenario.title)}</strong>
<span>${escapeHtml(scenario.short)}</span>
</button>
`).join("");
}
function renderCommands() {
const commands = [
`sit diff ${activeScenario.baseline}..${activeScenario.current}`,
`sit test ${activeScenario.package} --run`,
`sit pr-summary ${activeScenario.baseline}..${activeScenario.current}`
];
$("command-stack").innerHTML = commands.map((command) => `
<button class="command-button" data-copy="${escapeHtml(command)}">
<code>${escapeHtml(command)}</code>
<span>copy</span>
</button>
`).join("");
}
function renderContext() {
$("scenario-title").textContent = activeScenario.title;
$("scenario-summary").textContent = activeScenario.summary;
$("baseline-ref").textContent = activeScenario.baseline;
$("current-ref").textContent = activeScenario.current;
$("package-name").textContent = activeScenario.package;
$("loop-caption").textContent = activeScenario.sourceLabel;
}
function renderMetrics() {