-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
1310 lines (1152 loc) · 48.7 KB
/
Copy pathindex.html
File metadata and controls
1310 lines (1152 loc) · 48.7 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>GRIDLOCK — Agent Failure Series #18</title>
<style>
:root {
--bg: #0a0a0f;
--surface: #111118;
--border: #1e1e2e;
--accent: #f97316;
--accent2: #ef4444;
--accent3: #a78bfa;
--green: #22c55e;
--yellow: #eab308;
--text: #e2e8f0;
--muted: #64748b;
--code: #1e293b;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
background: var(--bg);
color: var(--text);
font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
min-height: 100vh;
padding: 0 0 80px;
}
.hero {
background: linear-gradient(135deg, #0f0f1a 0%, #1a0a0a 100%);
border-bottom: 1px solid var(--border);
padding: 48px 24px 40px;
text-align: center;
position: relative;
overflow: hidden;
}
.hero::before {
content: '';
position: absolute;
inset: 0;
background: repeating-linear-gradient(
0deg,
transparent,
transparent 40px,
rgba(249,115,22,0.02) 40px,
rgba(249,115,22,0.02) 41px
);
pointer-events: none;
}
.series-badge {
display: inline-block;
background: rgba(249,115,22,0.12);
border: 1px solid rgba(249,115,22,0.3);
color: var(--accent);
font-size: 11px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
padding: 4px 12px;
border-radius: 4px;
margin-bottom: 20px;
}
.hero h1 {
font-size: clamp(42px, 8vw, 80px);
font-weight: 900;
letter-spacing: -0.02em;
color: #fff;
line-height: 1;
margin-bottom: 8px;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
font-size: 14px;
color: var(--muted);
margin-bottom: 16px;
letter-spacing: 0.04em;
}
.hero-tagline {
font-size: 18px;
color: #94a3b8;
max-width: 600px;
margin: 0 auto 24px;
line-height: 1.6;
}
.hero-tagline strong { color: var(--accent); }
.hero-pain {
display: inline-flex;
align-items: center;
gap: 8px;
background: rgba(239,68,68,0.1);
border: 1px solid rgba(239,68,68,0.25);
border-radius: 6px;
padding: 8px 16px;
font-size: 12px;
color: #fca5a5;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent2);
animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:0.4;transform:scale(0.8)} }
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }
.section-header {
margin: 48px 0 24px;
display: flex;
align-items: center;
gap: 12px;
}
.section-number {
background: var(--accent);
color: #000;
font-size: 11px;
font-weight: 800;
width: 24px; height: 24px;
border-radius: 4px;
display: flex; align-items: center; justify-content: center;
flex-shrink: 0;
}
.section-header h2 {
font-size: 20px;
font-weight: 700;
color: #fff;
}
.section-header .section-tag {
margin-left: auto;
font-size: 10px;
color: var(--muted);
letter-spacing: 0.08em;
text-transform: uppercase;
background: var(--code);
padding: 3px 8px;
border-radius: 4px;
}
/* Agent Graph */
.agent-graph {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 32px 24px;
margin-bottom: 16px;
position: relative;
overflow: hidden;
}
.agent-graph-title {
font-size: 11px;
color: var(--muted);
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 24px;
}
.graph-canvas {
position: relative;
height: 200px;
}
.agent-node {
position: absolute;
background: var(--code);
border: 1.5px solid var(--border);
border-radius: 8px;
padding: 10px 16px;
font-size: 12px;
font-weight: 700;
text-align: center;
transition: all 0.3s ease;
cursor: default;
min-width: 120px;
}
.agent-node.waiting {
border-color: var(--yellow);
background: rgba(234,179,8,0.08);
box-shadow: 0 0 20px rgba(234,179,8,0.15);
}
.agent-node.stuck {
border-color: var(--accent2);
background: rgba(239,68,68,0.08);
box-shadow: 0 0 20px rgba(239,68,68,0.2);
animation: stuck-pulse 2s ease-in-out infinite;
}
.agent-node.rescued {
border-color: var(--accent3);
background: rgba(167,139,250,0.08);
}
.agent-node.done {
border-color: var(--green);
background: rgba(34,197,94,0.08);
}
@keyframes stuck-pulse {
0%,100% { box-shadow: 0 0 20px rgba(239,68,68,0.2); }
50% { box-shadow: 0 0 40px rgba(239,68,68,0.4); }
}
.agent-node .node-name { font-size: 13px; font-weight: 800; margin-bottom: 4px; }
.agent-node .node-status { font-size: 10px; color: var(--muted); font-weight: 400; }
.agent-node.waiting .node-status { color: var(--yellow); }
.agent-node.stuck .node-status { color: var(--accent2); }
/* SVG arrows */
.graph-svg {
position: absolute;
top: 0; left: 0;
width: 100%; height: 100%;
pointer-events: none;
}
/* Panel layout */
.panel {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
margin-bottom: 20px;
overflow: hidden;
}
.panel-header {
display: flex;
align-items: center;
gap: 12px;
padding: 16px 20px;
border-bottom: 1px solid var(--border);
cursor: pointer;
user-select: none;
}
.panel-header:hover { background: rgba(255,255,255,0.02); }
.panel-icon {
width: 32px; height: 32px;
border-radius: 6px;
display: flex; align-items: center; justify-content: center;
font-size: 15px;
flex-shrink: 0;
}
.panel-icon.orange { background: rgba(249,115,22,0.12); }
.panel-icon.red { background: rgba(239,68,68,0.12); }
.panel-icon.purple { background: rgba(167,139,250,0.12); }
.panel-icon.yellow { background: rgba(234,179,8,0.12); }
.panel-title-group { flex: 1; }
.panel-title { font-size: 14px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.panel-subtitle { font-size: 11px; color: var(--muted); }
.panel-expand {
width: 28px; height: 28px;
background: var(--code);
border-radius: 6px;
border: none;
color: var(--muted);
cursor: pointer;
display: flex; align-items: center; justify-content: center;
font-size: 14px;
transition: all 0.2s;
}
.panel-expand:hover { background: var(--border); color: var(--text); }
.panel-body { padding: 20px; display: none; }
.panel.open .panel-body { display: block; }
.panel.open .panel-expand { transform: rotate(180deg); }
/* Terminal/Log */
.log-block {
background: #000;
border-radius: 8px;
border: 1px solid var(--border);
padding: 16px;
font-size: 12px;
line-height: 1.7;
margin: 12px 0;
max-height: 280px;
overflow-y: auto;
min-height: 80px;
}
.log-line { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 2px; }
.log-ts { color: #334155; white-space: nowrap; flex-shrink: 0; }
.log-level { white-space: nowrap; flex-shrink: 0; font-weight: 700; }
.log-level.info { color: #38bdf8; }
.log-level.warn { color: var(--yellow); }
.log-level.error { color: var(--accent2); }
.log-level.ok { color: var(--green); }
.log-level.wait { color: #a78bfa; }
.log-msg { color: #94a3b8; word-break: break-word; }
.log-msg .hl { color: var(--accent); }
.log-msg .hl2 { color: var(--accent2); }
.log-msg .hl3 { color: #a78bfa; }
.log-msg .hlg { color: var(--green); }
.cursor-blink {
display: inline-block;
width: 8px; height: 13px;
background: var(--text);
vertical-align: middle;
animation: blink 1s step-end infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }
/* Metric cards */
.metrics-row {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
gap: 12px;
margin: 16px 0;
}
.metric-card {
background: var(--code);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px 16px;
}
.metric-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.metric-value { font-size: 22px; font-weight: 800; color: #fff; }
.metric-value.red { color: var(--accent2); }
.metric-value.yellow { color: var(--yellow); }
.metric-value.green { color: var(--green); }
.metric-unit { font-size: 11px; color: var(--muted); margin-top: 2px; }
/* Control buttons */
.controls { display: flex; gap: 10px; flex-wrap: wrap; margin: 16px 0 8px; }
.btn {
background: var(--code);
border: 1px solid var(--border);
color: var(--text);
font-family: inherit;
font-size: 12px;
font-weight: 600;
padding: 8px 16px;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
letter-spacing: 0.02em;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.primary:hover { background: #fb923c; border-color: #fb923c; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn:disabled:hover { border-color: var(--border); color: var(--text); }
/* Wait spinner */
.wait-animation {
display: flex;
gap: 16px;
align-items: center;
background: var(--code);
border-radius: 8px;
padding: 16px 20px;
margin: 12px 0;
border: 1px solid var(--border);
}
.spinner {
width: 20px; height: 20px;
border: 2px solid var(--border);
border-top-color: var(--accent);
border-radius: 50%;
animation: spin 0.8s linear infinite;
flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
.wait-text { font-size: 12px; color: var(--muted); }
.wait-text strong { color: var(--text); }
/* Code diff */
.code-block {
background: #000;
border-radius: 8px;
border: 1px solid var(--border);
padding: 16px;
font-size: 12px;
line-height: 1.7;
margin: 12px 0;
overflow-x: auto;
}
.code-comment { color: #4ade80; }
.code-keyword { color: #f97316; }
.code-string { color: #fbbf24; }
.code-error { color: #ef4444; }
.code-normal { color: #94a3b8; }
.code-line-bad { background: rgba(239,68,68,0.08); display: block; margin: 0 -16px; padding: 0 16px; border-left: 3px solid var(--accent2); }
.code-line-ok { background: rgba(34,197,94,0.05); display: block; margin: 0 -16px; padding: 0 16px; border-left: 3px solid var(--green); }
/* Cost counter */
.cost-counter {
background: rgba(239,68,68,0.06);
border: 1px solid rgba(239,68,68,0.2);
border-radius: 8px;
padding: 16px 20px;
margin: 12px 0;
display: flex;
align-items: center;
gap: 16px;
}
.cost-value {
font-size: 32px;
font-weight: 900;
color: var(--accent2);
font-variant-numeric: tabular-nums;
min-width: 110px;
}
.cost-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.cost-desc strong { color: #fca5a5; }
/* Insight box */
.insight {
background: rgba(249,115,22,0.06);
border: 1px solid rgba(249,115,22,0.2);
border-radius: 8px;
padding: 16px 20px;
margin-top: 16px;
font-size: 12px;
line-height: 1.7;
color: #cbd5e1;
}
.insight .insight-label {
font-size: 10px;
font-weight: 800;
color: var(--accent);
letter-spacing: 0.1em;
text-transform: uppercase;
margin-bottom: 6px;
}
/* Deadlock diagram */
.deadlock-diagram {
display: flex;
align-items: center;
justify-content: center;
gap: 24px;
padding: 24px;
background: #000;
border-radius: 8px;
border: 1px solid var(--border);
margin: 16px 0;
flex-wrap: wrap;
}
.dl-agent {
background: var(--code);
border: 1.5px solid var(--border);
border-radius: 10px;
padding: 16px 20px;
text-align: center;
min-width: 130px;
transition: all 0.4s;
}
.dl-agent .dl-name { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.dl-agent .dl-state { font-size: 10px; color: var(--muted); }
.dl-agent.active-wait { border-color: var(--yellow); background: rgba(234,179,8,0.08); }
.dl-agent.active-wait .dl-state { color: var(--yellow); }
.dl-agent.captured { border-color: var(--accent3); background: rgba(167,139,250,0.08); }
.dl-agent.captured .dl-state { color: var(--accent3); }
.dl-arrow {
font-size: 24px;
color: var(--accent2);
animation: arrow-flash 1.5s ease-in-out infinite;
}
@keyframes arrow-flash { 0%,100%{opacity:1} 50%{opacity:0.3} }
.dl-arrow.purple { color: var(--accent3); }
/* Fix code block */
.fix-block {
background: rgba(34,197,94,0.04);
border: 1px solid rgba(34,197,94,0.2);
border-radius: 8px;
padding: 16px 20px;
margin: 12px 0;
}
.fix-label { font-size: 10px; font-weight: 800; color: var(--green); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
/* Footer */
.footer {
border-top: 1px solid var(--border);
padding: 32px 24px;
margin-top: 60px;
text-align: center;
}
.series-links {
display: flex;
justify-content: center;
gap: 16px;
flex-wrap: wrap;
margin-bottom: 16px;
}
.series-link {
color: var(--muted);
text-decoration: none;
font-size: 12px;
padding: 6px 12px;
border: 1px solid var(--border);
border-radius: 6px;
transition: all 0.2s;
}
.series-link:hover { border-color: var(--accent); color: var(--accent); }
.footer-meta { font-size: 11px; color: #334155; margin-top: 12px; }
.footer-meta a { color: #475569; text-decoration: none; }
.footer-meta a:hover { color: var(--accent); }
/* Summary box */
.summary-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 16px;
margin: 16px 0;
}
@media (max-width: 640px) {
.summary-grid { grid-template-columns: 1fr; }
.dl-arrow { transform: rotate(90deg); }
}
.summary-item {
background: var(--code);
border: 1px solid var(--border);
border-radius: 8px;
padding: 14px;
}
.summary-item .si-label { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.summary-item .si-value { font-size: 13px; color: var(--text); line-height: 1.5; }
.summary-item .si-value.bad { color: #fca5a5; }
.summary-item .si-value.good { color: #86efac; }
/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #2d3748; }
</style>
</head>
<body>
<!-- HERO -->
<div class="hero">
<div class="series-badge">Agent Failure Series · #18</div>
<h1>GRID<span>LOCK</span></h1>
<p class="hero-sub">When agents can't proceed because everyone is waiting for everyone else</p>
<p class="hero-tagline">
Agent A needs Agent B's output to start.<br>
Agent B needs Agent A's output to start.<br>
<strong>Neither moves. Your pipeline is billing $1.08/minute to do nothing.</strong>
</p>
<div class="hero-pain">
<div class="dot"></div>
5 production incidents confirmed · 2026
</div>
</div>
<!-- MAIN CONTENT -->
<div class="container">
<!-- INTRO -->
<div class="section-header">
<div class="section-number">⟳</div>
<h2>The Setup</h2>
</div>
<div class="agent-graph">
<div class="agent-graph-title">// pipeline_topology.json · initial state</div>
<div class="graph-canvas" id="graphCanvas">
<!-- Nodes positioned via JS -->
<div class="agent-node" id="node-orch" style="top:80px;left:50%;transform:translateX(-50%)">
<div class="node-name">🎯 Orchestrator</div>
<div class="node-status" id="node-orch-status">idle</div>
</div>
<div class="agent-node" id="node-research" style="top:20px;left:5%">
<div class="node-name">🔍 Research</div>
<div class="node-status" id="node-research-status">idle</div>
</div>
<div class="agent-node" id="node-write" style="top:140px;left:5%">
<div class="node-name">✍️ Writer</div>
<div class="node-status" id="node-write-status">idle</div>
</div>
<div class="agent-node" id="node-review" style="top:20px;right:5%">
<div class="node-name">🔎 Reviewer</div>
<div class="node-status" id="node-review-status">idle</div>
</div>
<div class="agent-node" id="node-publish" style="top:140px;right:5%">
<div class="node-name">🚀 Publisher</div>
<div class="node-status" id="node-publish-status">idle</div>
</div>
<svg class="graph-svg" id="graphSvg">
<defs>
<marker id="arrowhead" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#1e1e2e"/>
</marker>
<marker id="arrowhead-red" markerWidth="8" markerHeight="6" refX="8" refY="3" orient="auto">
<polygon points="0 0, 8 3, 0 6" fill="#ef4444"/>
</marker>
</defs>
</svg>
</div>
<div class="controls">
<button class="btn primary" id="btn-run-pipeline" onclick="runPipeline()">▶ Run Pipeline</button>
<button class="btn" id="btn-reset-pipeline" onclick="resetPipeline()" disabled>↺ Reset</button>
</div>
<div id="graph-log" class="log-block" style="display:none;"></div>
</div>
<div class="insight">
<div class="insight-label">The Problem</div>
The Research agent starts by asking the Writer to define the content structure — "what sections do I need to fill?"<br>
The Writer agent starts by asking the Research agent for facts — "what do I have to work with?"<br>
Both enter a <strong style="color:var(--accent)">WAITING_FOR_PEER</strong> state. Neither times out. Neither fails. Neither moves.
Your orchestrator is billing API tokens to poll two agents that will never respond.
</div>
<!-- FAILURE MODE 1 -->
<div class="section-header" style="margin-top:40px">
<div class="section-number">1</div>
<h2>The Chicken-Egg Lock</h2>
<span class="section-tag">Circular Dependency</span>
</div>
<div class="panel open" id="panel1">
<div class="panel-header" onclick="togglePanel('panel1')">
<div class="panel-icon orange">🔄</div>
<div class="panel-title-group">
<div class="panel-title">Agent A waits for Agent B · Agent B waits for Agent A</div>
<div class="panel-subtitle">Most common form · Hardest to detect in logs</div>
</div>
<button class="panel-expand">▼</button>
</div>
<div class="panel-body">
<div class="deadlock-diagram">
<div class="dl-agent" id="dl1-research">
<div class="dl-name">🔍 Research</div>
<div class="dl-state" id="dl1-rs">idle</div>
</div>
<div style="text-align:center">
<div class="dl-arrow" id="dl1-arrow1" style="opacity:0.3">→ waiting for Writer →</div>
<div style="height:8px"></div>
<div class="dl-arrow" id="dl1-arrow2" style="opacity:0.3">← waiting for Research ←</div>
</div>
<div class="dl-agent" id="dl1-writer">
<div class="dl-name">✍️ Writer</div>
<div class="dl-state" id="dl1-ws">idle</div>
</div>
</div>
<div class="controls">
<button class="btn primary" id="dl1-start" onclick="simulateDeadlock1()">▶ Simulate Deadlock</button>
<button class="btn" id="dl1-reset" onclick="resetDeadlock1()" disabled>↺ Reset</button>
</div>
<div id="dl1-log" class="log-block" style="display:none;"></div>
<div class="insight">
<div class="insight-label">Why It's Hard to Catch</div>
Both agents are in a valid <code style="color:var(--accent)">RUNNING</code> state in your orchestration layer.
They're not erroring. They're not timing out (yet). If your polling interval is 5 seconds and your
dashboard shows a green dot — this looks like a healthy pipeline that's just "working".
You won't know until the invoice arrives.
</div>
<div class="code-block">
<span class="code-comment"># What the logs look like — looks totally normal</span>
<span class="code-normal">
[Research] <span class="code-keyword">status</span>=<span class="code-string">"RUNNING"</span> last_heartbeat=<span class="code-string">"2s ago"</span>
[Writer] <span class="code-keyword">status</span>=<span class="code-string">"RUNNING"</span> last_heartbeat=<span class="code-string">"3s ago"</span>
[Orch] <span class="code-keyword">waiting_for</span>=<span class="code-string">["research", "writer"]</span> <span class="code-comment"># ← both are "running"!</span>
<span class="code-line-bad"># 47 minutes later</span>
[Research] <span class="code-keyword">status</span>=<span class="code-string">"RUNNING"</span> last_heartbeat=<span class="code-string">"2s ago"</span>
[Writer] <span class="code-keyword">status</span>=<span class="code-string">"RUNNING"</span> last_heartbeat=<span class="code-string">"3s ago"</span>
</span>
</div>
</div>
</div>
<!-- FAILURE MODE 2 -->
<div class="section-header" style="margin-top:16px">
<div class="section-number">2</div>
<h2>The Rescue Trap</h2>
<span class="section-tag">Recovery Agent Captured</span>
</div>
<div class="panel" id="panel2">
<div class="panel-header" onclick="togglePanel('panel2')">
<div class="panel-icon red">🪤</div>
<div class="panel-title-group">
<div class="panel-title">The recovery agent you sent to fix it also deadlocks</div>
<div class="panel-subtitle">Now you have 3 agents stuck instead of 2</div>
</div>
<button class="panel-expand">▼</button>
</div>
<div class="panel-body">
<p style="font-size:13px;color:var(--muted);margin-bottom:16px;line-height:1.7">
Your orchestration framework detects the stall and sends a <strong style="color:var(--text)">Coordinator agent</strong>
to resolve it. The Coordinator asks each stuck agent to summarize their current state so it can mediate.<br><br>
The stuck agents can't respond — they're waiting. The Coordinator enters
<span style="color:var(--accent3)">WAITING_FOR_SUMMARY</span>. Three agents are now stuck.
</p>
<div class="deadlock-diagram" id="rescue-diagram">
<div class="dl-agent" id="rescue-a">
<div class="dl-name">🔍 Research</div>
<div class="dl-state" id="rescue-a-status">idle</div>
</div>
<div style="text-align:center">
<div class="dl-arrow" id="rescue-arrow1" style="opacity:0.2">⟷</div>
<div style="height:4px"></div>
<div id="rescue-coord-wrapper" style="display:none;text-align:center">
<div style="font-size:10px;color:var(--accent3);margin-bottom:4px">↓ rescue attempt ↓</div>
<div class="dl-agent captured" id="rescue-coord" style="position:relative;display:inline-block">
<div class="dl-name">🛟 Coordinator</div>
<div class="dl-state" id="rescue-coord-status">launching...</div>
</div>
<div style="font-size:10px;color:var(--accent3);margin-top:4px">↓ also waiting ↓</div>
</div>
</div>
<div class="dl-agent" id="rescue-b">
<div class="dl-name">✍️ Writer</div>
<div class="dl-state" id="rescue-b-status">idle</div>
</div>
</div>
<div class="controls">
<button class="btn primary" id="rescue-start" onclick="simulateRescueTrap()">▶ Send Recovery Agent</button>
<button class="btn" id="rescue-reset" onclick="resetRescueTrap()" disabled>↺ Reset</button>
</div>
<div id="rescue-log" class="log-block" style="display:none;"></div>
<div class="insight">
<div class="insight-label">The Pattern</div>
Any agent that needs output from a deadlocked agent will itself deadlock.
Recovery agents, monitoring agents, summary agents — they all get captured.
The deadlock radius grows with each rescue attempt.
</div>
</div>
</div>
<!-- FAILURE MODE 3 -->
<div class="section-header" style="margin-top:16px">
<div class="section-number">3</div>
<h2>The Timeout Token Burn</h2>
<span class="section-tag">Silent Billing</span>
</div>
<div class="panel" id="panel3">
<div class="panel-header" onclick="togglePanel('panel3')">
<div class="panel-icon yellow">💸</div>
<div class="panel-title-group">
<div class="panel-title">The agents are "running" — the bill is running too</div>
<div class="panel-subtitle">Heartbeat polling + retry cycles add up fast</div>
</div>
<button class="panel-expand">▼</button>
</div>
<div class="panel-body">
<p style="font-size:13px;color:var(--muted);margin-bottom:16px;line-height:1.7">
Each stuck agent sends a heartbeat every 5 seconds to prove it's alive.
Each heartbeat is a small API call. Each "I'm waiting" retry is a slightly larger one.
At scale, this is not a rounding error — it's a billing event.
</p>
<div class="cost-counter">
<div class="cost-value" id="cost-display">$0.00</div>
<div class="cost-desc">
<strong>Accumulated cost of being stuck</strong><br>
2 agents × heartbeat every 5s × retry every 30s<br>
<span id="cost-cycles">0 cycles completed</span>
</div>
</div>
<div class="metrics-row">
<div class="metric-card">
<div class="metric-label">Tokens burned</div>
<div class="metric-value yellow" id="tokens-burned">0</div>
<div class="metric-unit">for zero output</div>
</div>
<div class="metric-card">
<div class="metric-label">API calls made</div>
<div class="metric-value red" id="api-calls">0</div>
<div class="metric-unit">heartbeat + retry</div>
</div>
<div class="metric-card">
<div class="metric-label">Time elapsed</div>
<div class="metric-value" id="time-elapsed">0:00</div>
<div class="metric-unit">stuck</div>
</div>
<div class="metric-card">
<div class="metric-label">Work done</div>
<div class="metric-value red">0%</div>
<div class="metric-unit">pipeline halted</div>
</div>
</div>
<div class="controls">
<button class="btn primary" id="cost-start" onclick="startCostBurn()">▶ Start the Clock</button>
<button class="btn" id="cost-stop" onclick="stopCostBurn()" disabled>⏹ Stop</button>
<button class="btn" id="cost-reset" onclick="resetCostBurn()" disabled>↺ Reset</button>
</div>
<div class="insight">
<div class="insight-label">The Real Number</div>
The DevStackTips incident report (Jun 2026) found a deadlocked 3-agent pipeline running for
<strong style="color:#fca5a5">6 hours undetected</strong> because the health dashboard showed all agents
as "running." Final bill: <strong style="color:var(--accent2)">$387</strong> for zero output.
The fix: a dependency graph check before launch that would have taken 40ms.
</div>
</div>
</div>
<!-- FAILURE MODE 4 -->
<div class="section-header" style="margin-top:16px">
<div class="section-number">4</div>
<h2>The False Completion</h2>
<span class="section-tag">Downstream Poisoning</span>
</div>
<div class="panel" id="panel4">
<div class="panel-header" onclick="togglePanel('panel4')">
<div class="panel-icon purple">✅</div>
<div class="panel-title-group">
<div class="panel-title">Pipeline marked "complete" — with zero content</div>
<div class="panel-subtitle">The success notification fires. The downstream agent starts working on nothing.</div>
</div>
<button class="panel-expand">▼</button>
</div>
<div class="panel-body">
<p style="font-size:13px;color:var(--muted);margin-bottom:16px;line-height:1.7">
The orchestrator's final timeout handler fires after 60 minutes. It's configured to set
<code style="color:var(--accent)">pipeline_status = "complete"</code> to unblock downstream systems
regardless of actual agent state. This is a design choice: "the show must go on."<br><br>
The Publisher agent reads <code style="color:var(--green)">status=complete</code> and starts publishing — with
<strong style="color:var(--accent2)">empty content arrays</strong> from both stuck agents.
</p>
<div id="false-complete-log" class="log-block" style="display:none;"></div>
<div class="controls">
<button class="btn primary" id="false-start" onclick="simulateFalseComplete()">▶ Fire Timeout Handler</button>
<button class="btn" id="false-reset" onclick="resetFalseComplete()" disabled>↺ Reset</button>
</div>
<div class="summary-grid" style="margin-top:16px">
<div class="summary-item">
<div class="si-label">What was published</div>
<div class="si-value bad" id="published-content">—</div>
</div>
<div class="summary-item">
<div class="si-label">Pipeline result code</div>
<div class="si-value" id="published-code">—</div>
</div>
<div class="summary-item">
<div class="si-label">Notification sent</div>
<div class="si-value" id="published-notify">—</div>
</div>
<div class="summary-item">
<div class="si-label">Actual content delivered</div>
<div class="si-value bad" id="published-actual">—</div>
</div>
</div>
<div class="code-block" style="margin-top:16px">
<span class="code-comment"># The orchestrator timeout handler that causes this</span>
<span class="code-normal">
<span class="code-keyword">def</span> on_pipeline_timeout(pipeline_id):
<span class="code-line-bad"> pipeline.status = <span class="code-string">"complete"</span> <span class="code-comment"># ← marks done regardless of agent state</span></span>
<span class="code-line-bad"> notify_downstream(pipeline_id) <span class="code-comment"># ← triggers publisher with empty results</span></span>
log.info(<span class="code-string">"Pipeline timed out, forcing completion"</span>)
<span class="code-comment"># No check: were any agents actually done?</span>
<span class="code-comment"># No check: are result arrays empty?</span>
<span class="code-comment"># No check: is this safe to hand to downstream?</span>
</span>
<span class="code-comment"># The fix</span>
<span class="code-normal">
<span class="code-keyword">def</span> on_pipeline_timeout(pipeline_id):
<span class="code-line-ok"> completed = [a <span class="code-keyword">for</span> a <span class="code-keyword">in</span> agents <span class="code-keyword">if</span> a.has_output()]</span>
<span class="code-line-ok"> <span class="code-keyword">if not</span> completed: </span>
<span class="code-line-ok"> pipeline.status = <span class="code-string">"FAILED_DEADLOCK"</span> <span class="code-comment"># ← never feed empty</span></span>
<span class="code-line-ok"> alert_oncall(pipeline_id, reason=<span class="code-string">"deadlock detected"</span>) </span>
<span class="code-line-ok"> <span class="code-keyword">return</span> </span>
partial_publish(pipeline_id, completed) <span class="code-comment"># partial > empty</span>
</span>
</div>
</div>
</div>
<!-- FIX SECTION -->
<div class="section-header" style="margin-top:32px">
<div class="section-number">✓</div>
<h2>The Fix</h2>
<span class="section-tag">3 lines, prevents all 4 failures</span>
</div>
<div class="fix-block">
<div class="fix-label">Prevention · Run this before your pipeline starts</div>
<div class="code-block" style="margin:0">
<span class="code-comment"># Topological sort — O(V+E), catches cycles before the first API call</span>
<span class="code-normal">
<span class="code-keyword">from</span> graphlib <span class="code-keyword">import</span> TopologicalSorter, CycleError
<span class="code-keyword">def</span> validate_pipeline(agents: list[Agent]) -> None:
graph = {a.name: set(a.depends_on) <span class="code-keyword">for</span> a <span class="code-keyword">in</span> agents}
<span class="code-keyword">try</span>:
<span class="code-line-ok"> list(TopologicalSorter(graph).static_order()) <span class="code-comment"># raises on cycle</span></span>
<span class="code-keyword">except</span> CycleError <span class="code-keyword">as</span> e:
<span class="code-line-ok"> <span class="code-keyword">raise</span> PipelineConfigError(<span class="code-string">f"Circular dependency: {e}"</span>) </span>
<span class="code-comment"># Call once at startup. Zero cost at scale. Catches every Gridlock.</span>
validate_pipeline(my_agents) <span class="code-comment"># 40ms · saves $387 incidents</span>
</span>
</div>
</div>
<div class="summary-grid" style="margin-top:16px">
<div class="summary-item">
<div class="si-label">Detection cost</div>
<div class="si-value good">40ms · O(V+E)</div>
</div>
<div class="summary-item">
<div class="si-label">Prevention</div>
<div class="si-value good">Topological sort at build time</div>
</div>
<div class="summary-item">
<div class="si-label">Deadline architecture</div>
<div class="si-value good">Per-agent max_wait + parent timeout</div>
</div>
<div class="summary-item">
<div class="si-label">Timeout policy</div>
<div class="si-value good">FAILED_DEADLOCK · never false complete</div>
</div>
</div>
</div>
<!-- FOOTER -->
<div class="footer">
<div style="font-size:11px;color:var(--muted);margin-bottom:16px;letter-spacing:0.08em;text-transform:uppercase">
Agent Failure Series
</div>
<div class="series-links">
<a class="series-link" href="https://rlasaf12.github.io/racecondition/">#15 RaceCondition</a>
<a class="series-link" href="https://rlasaf12.github.io/stalemind/">#16 StaleMind</a>
<a class="series-link" href="https://rlasaf12.github.io/ghostapproval/">#17 GhostApproval</a>
<a class="series-link" style="border-color:var(--accent);color:var(--accent)" href="#">#18 Gridlock</a>
</div>
<div class="footer-meta">
Built by <a href="https://github.com/RLASAF12">RLASAF12</a> ·
Each entry: one real failure mode, one working simulator, one fix you can copy today ·
<a href="https://harelasaf.com">harelasaf.com</a>
</div>
</div>
<script>
// ─── Utilities ───────────────────────────────────────────────
function togglePanel(id) {
document.getElementById(id).classList.toggle('open');
}
function appendLog(containerId, level, msg, show = true) {
const c = document.getElementById(containerId);
if (show && c.style.display === 'none') c.style.display = 'block';
const now = new Date();
const ts = `${String(now.getHours()).padStart(2,'0')}:${String(now.getMinutes()).padStart(2,'0')}:${String(now.getSeconds()).padStart(2,'0')}.${String(now.getMilliseconds()).padStart(3,'0')}`;
const line = document.createElement('div');
line.className = 'log-line';
line.innerHTML = `<span class="log-ts">${ts}</span><span class="log-level ${level}">[${level.toUpperCase()}]</span><span class="log-msg">${msg}</span>`;
c.appendChild(line);
c.scrollTop = c.scrollHeight;
}