-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathprotocol-architecture.html
More file actions
2133 lines (1962 loc) · 99.5 KB
/
protocol-architecture.html
File metadata and controls
2133 lines (1962 loc) · 99.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="en">
<head>
<!-- For AI agents: see /llms-full.txt for the full protocol corpus, /AGENTS.md for navigation, /.well-known/mcp.json for capabilities -->
<!-- This is an embedded fragment. Do not link from nav/footer. Rendered via iframe from parent page. -->
<meta name="robots" content="noindex,nofollow">
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width,initial-scale=1"/>
<title>AEOESS — Protocol Architecture</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400&family=Inter:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet">
<style>
/* DARK (default) — restrained teal accent on near-black ink */
:root {
--bg: #1c1c1e;
--bg-2: #242426;
--ink: #ececec;
--ink-2: #b0b0b0;
--ink-3: #8a8a8e;
--ink-rgb: 255,255,255;
--line: rgba(var(--ink-rgb),0.08);
--line-2: rgba(var(--ink-rgb),0.16);
--accent: #5fb8a4; /* deep teal, muted */
--accent-glow: rgba(95,184,164,0.30);
--danger: #f87171;
--warn: #fbbf77;
--stage-grad-inner: #2a2a2e;
--stage-grad-outer: var(--bg);
--mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, monospace;
--sans: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
--serif: 'Newsreader', Georgia, serif;
}
/* LIGHT — warm paper, deep teal accent (matches site Restrained system) */
:root[data-theme="light"] {
--bg: #fafaf8;
--bg-2: #f4f4f2;
--ink: #0a0a0a;
--ink-2: #333333;
--ink-3: #707070;
--ink-rgb: 10,10,10;
--line: rgba(var(--ink-rgb),0.10);
--line-2: rgba(var(--ink-rgb),0.20);
--accent: #2d8b76; /* deep teal, slightly darker for contrast on paper */
--accent-glow: rgba(45,139,118,0.28);
--danger: #b91c1c;
--warn: #b88419;
--stage-grad-inner: #ffffff;
--stage-grad-outer: #f1f1ec;
}
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.5; }
/* Keep mono character on labels/code/stat values; sans for prose; serif reserved for scene titles */
.scene-meta .title { font-family: var(--serif); font-style: italic; font-weight: 400; }
.scene-meta .stat b, .below .cell .h, .below .cell .v code, .tab, .caption, .scene-meta .stats { font-family: var(--mono); }
body { min-height: 100vh; overflow-x: hidden; }
/* ---------- shell (embed mode) ---------- */
.shell { max-width: 100%; margin: 0; padding: 12px 18px 16px; }
@media (max-width: 720px) { .shell { padding: 10px 12px 14px; } }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.85); } }
/* solo mode (single-scene embed): hide tab strip, scene-meta title row, and tweaks toggle */
body.solo .scene-tabs { display: none; }
body.solo .scene-meta { padding-top: 4px; padding-bottom: 8px; }
body.solo .tweaks-open-btn, body.solo .tweaks { display: none !important; }
/* ---------- tabs ---------- */
.scene-tabs { display: flex; gap: 0; margin: 0 0 8px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { appearance: none; background: transparent; color: var(--ink-3); border: none; font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; padding: 10px 16px 9px; cursor: pointer; position: relative; transition: color 0.2s; display: flex; align-items: baseline; gap: 10px; }
.tab:hover { color: var(--ink-2); }
.tab[aria-selected="true"] { color: var(--ink); }
.tab[aria-selected="true"]::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.tab .num { color: var(--ink-3); font-weight: 400; }
.tab[aria-selected="true"] .num { color: var(--accent); }
.scene-meta { display: flex; justify-content: space-between; align-items: center; padding: 10px 0 12px; color: var(--ink-3); font-size: 12px; flex-wrap: wrap; gap: 16px; }
.scene-meta .title { color: var(--ink-2); font-size: 13px; }
.scene-meta .title strong { color: var(--ink); font-weight: 500; }
.scene-meta .stats { display:flex; gap: 28px; }
.scene-meta .stat { display:flex; align-items: baseline; gap: 6px; }
.scene-meta .stat b { color: var(--accent); font-weight: 500; letter-spacing: 0.04em; }
/* ---------- stage ---------- */
.stage {
position: relative; width: 100%;
aspect-ratio: 16 / 6.5;
background: radial-gradient(ellipse at center, var(--stage-grad-inner) 0%, var(--stage-grad-outer) 70%);
border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
@media (max-width: 720px) { .stage { aspect-ratio: 4/4.2; } }
.scene { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.scene.active { opacity: 1; pointer-events: auto; }
.scene svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* ---------- caption (inside stage) ---------- */
.caption {
position: absolute; bottom: 18px; left: 20px; right: 20px;
display: flex; justify-content: space-between; gap: 16px;
font-size: 11px; color: var(--ink-3); letter-spacing: 0.06em;
pointer-events: none;
}
.caption .key { color: var(--ink); }
/* ---------- controls strip below stage ---------- */
.below {
display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
background: var(--line); margin-top: 1px;
border: 1px solid var(--line); border-top: none; border-radius: 0 0 6px 6px; overflow: hidden;
}
@media (max-width: 720px) { .below { grid-template-columns: 1fr; } }
.below .cell { background: var(--bg-2); padding: 11px 16px; }
.below .cell .h { color: var(--ink-3); font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; margin-bottom: 6px; }
.below .cell .v { color: var(--ink); font-size: 12px; line-height: 1.4; }
.below .cell .v code { color: var(--accent); font-size: 12px; }
/* ---------- tweaks panel ---------- */
.tweaks {
position: fixed; bottom: 24px; right: 24px; z-index: 50;
background: rgba(16,18,22,0.92); backdrop-filter: blur(12px);
border: 1px solid var(--line-2); border-radius: 8px;
width: 300px; max-width: calc(100vw - 48px);
font-size: 12px;
box-shadow: 0 20px 60px rgba(0,0,0,0.6);
display: none;
}
.tweaks.open { display: block; }
.tweaks header { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.tweaks header h3 { margin: 0; font-size: 11px; letter-spacing: 0.15em; text-transform: uppercase; color: var(--ink-2); font-weight: 500; }
.tweaks header button { background: transparent; border: 0; color: var(--ink-3); cursor: pointer; padding: 0; font-size: 16px; line-height: 1; }
.tweaks header button:hover { color: var(--ink); }
.tweaks .body { padding: 14px; display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field label { color: var(--ink-3); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; display:flex; justify-content: space-between; }
.field label b { color: var(--accent); font-weight: 400; }
.field input[type="range"] { width: 100%; accent-color: var(--accent); }
.swatch-row { display:flex; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 4px; border: 1px solid var(--line-2); cursor: pointer; position: relative; }
.swatch.sel { outline: 2px solid var(--ink); outline-offset: 2px; }
.seg { display:flex; gap: 0; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.seg button { flex: 1; background: transparent; color: var(--ink-2); border: 0; padding: 6px 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button.sel { background: var(--accent); color: #0a0b0d; font-weight: 600; }
.tweaks-open-btn {
position: fixed; bottom: 24px; right: 24px; z-index: 49;
background: rgba(16,18,22,0.92); backdrop-filter: blur(12px);
border: 1px solid var(--line-2); border-radius: 999px;
color: var(--ink); padding: 10px 16px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; cursor: pointer;
display: none;
}
/* scene1 specifics */
.token-label { font-family: var(--mono); font-size: 10px; fill: var(--ink-2); letter-spacing: 0.04em; }
.node-label { font-family: var(--mono); font-size: 11px; fill: var(--ink); letter-spacing: 0.06em; }
.node-sub { font-family: var(--mono); font-size: 9px; fill: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
/* density label show/hide */
.label-verbose { display: none; }
body[data-labels="verbose"] .label-verbose { display: inline; }
body[data-labels="sparse"] .label-medium { display: none; }
body[data-labels="sparse"] .label-verbose { display: none; }
/* accent-driven styling */
.accent-stroke { stroke: var(--accent); }
.accent-fill { fill: var(--accent); }
.ink-stroke { stroke: var(--ink-2); }
/* glow filter reuse via css */
.glow { filter: drop-shadow(0 0 4px var(--accent-glow)); }
</style>
<style id="aeoess-nav-hover-v1">
.aeoess-nav-desktop a,
.aeoess-nav-desktop button,
header [data-nav-dropdown] button {
cursor: pointer !important;
transition: color 0.15s ease, background 0.15s ease, text-shadow 0.15s ease !important;
border-radius: 4px;
}
.aeoess-nav-desktop a:hover,
.aeoess-nav-desktop button:hover,
header [data-nav-dropdown] button:hover {
color: #ececec !important;
text-shadow: 0 0 8px rgba(124, 172, 222, 0.45);
}
[data-nav-dropdown-panel] a {
transition: background 0.15s ease, color 0.15s ease !important;
}
[data-nav-dropdown-panel] a:hover {
background: rgba(124, 172, 222, 0.08) !important;
color: #ececec !important;
}
.aeoess-nav-desktop a[href*="pricing"]:hover {
text-shadow: none;
filter: brightness(1.08);
}
footer a {
transition: color 0.15s ease !important;
}
footer a:hover {
color: #ececec !important;
}
</style>
</head>
<body data-labels="medium">
<script>if(window!==window.top)document.documentElement.classList.add('embedded');</script>
<script>
// Theme: accept from URL hash, parent postMessage, localStorage, or prefers-color-scheme.
(function(){
function set(t) {
if (t === 'light') document.documentElement.setAttribute('data-theme', 'light');
else document.documentElement.removeAttribute('data-theme');
try { localStorage.setItem('aeoess-theme', t); } catch(e) {}
}
var fromHash = (location.hash.match(/theme=(light|dark)/) || [])[1];
var fromLS;
try { fromLS = localStorage.getItem('aeoess-theme'); } catch(e) {}
var fromMQ = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark';
set(fromHash || fromLS || fromMQ);
window.toggleTheme = function() {
var cur = document.documentElement.getAttribute('data-theme') === 'light' ? 'light' : 'dark';
set(cur === 'light' ? 'dark' : 'light');
};
window.addEventListener('message', function(e){
var d = e.data || {};
if (d.type === 'aeoess-arch-embed:theme' && (d.theme === 'light' || d.theme === 'dark')) set(d.theme);
});
})();
</script>
<style>html.embedded .nav, html.embedded .nav-drawer, html.embedded footer.footer-wrap { display: none !important; }</style>
<nav class="nav" id="nav">
<a href="/" class="nav-logo"><img src="/assets/images/aeoess_logo-05.png" alt="AEOESS" width="158" height="26" style="height:26px;width:auto"></a>
<div class="nav-links">Wallet<a href="blog.html">Blog</a><a href="roadmap.html">Roadmap</a><a href="passport.html">Spec</a><a href="docs.html">API</a><a href="portal.html" style="font-weight:600">Portal</a><a href="https://github.com/aeoess">GitHub</a><a href="mailto:signal@aeoess.com">Contact</a></div>
<div class="nav-right"><button class="theme-btn" onclick="toggleTheme()" aria-label="Toggle theme">☾</button><div class="nav-burger" onclick="this.classList.toggle('open');document.querySelector('.nav-drawer').classList.toggle('open')"><span></span><span></span><span></span></div></div>
</nav>
<div class="shell">
<!-- Tabs -->
<div class="scene-tabs" role="tablist">
<button class="tab" role="tab" aria-selected="true" data-scene="0"><span class="num">01</span>Life of an Action</button>
<button class="tab" role="tab" aria-selected="false" data-scene="1"><span class="num">02</span>Delegation & Cascade</button>
<button class="tab" role="tab" aria-selected="false" data-scene="2"><span class="num">03</span>Gateway Judgement</button>
<button class="tab" role="tab" aria-selected="false" data-scene="3"><span class="num">04</span>Trust Mesh</button>
<button class="tab" role="tab" aria-selected="false" data-scene="4"><span class="num">05</span>Payment Rails</button>
<button class="tab" role="tab" aria-selected="false" data-scene="5"><span class="num">06</span>Cross-Impl Interop</button>
</div>
<div class="scene-meta">
<div class="title" id="scene-title"><strong>01 · Life of an Action.</strong> Passport → Delegation → Intent → Gateway → Enforcement → Receipt.</div>
<div class="stats">
<div class="stat" id="stat-a-wrap"><span id="stat-a-label">policy eval</span> <b id="stat-a">1.4ms</b></div>
<div class="stat" id="stat-b-wrap"><span id="stat-b-label">throughput</span> <b id="stat-b">403 ops/s</b></div>
<div class="stat" id="stat-c-wrap"><span id="stat-c-label">tests</span> <b id="stat-c">2,586</b></div>
</div>
</div>
<!-- Stage -->
<div class="stage" id="stage">
<div class="scene active" data-id="0" id="scene-0"></div>
<div class="scene" data-id="1" id="scene-1"></div>
<div class="scene" data-id="2" id="scene-2"></div>
<div class="scene" data-id="3" id="scene-3"></div>
<div class="scene" data-id="4" id="scene-4"></div>
<div class="scene" data-id="5" id="scene-5"></div>
<div class="caption" id="caption">
<div><span class="key" id="cap-left">—</span></div>
<div id="cap-right">— — —</div>
</div>
</div>
<!-- Below stage info strip -->
<div class="below" id="below"></div>
</div>
<!-- Tweaks -->
<button class="tweaks-open-btn" id="tweaks-toggle">⚙ Tweaks</button>
<div class="tweaks" id="tweaks">
<header>
<h3>Tweaks</h3>
<button id="tweaks-close" aria-label="close">×</button>
</header>
<div class="body">
<div class="field">
<label>Speed <b id="speed-val">1.0×</b></label>
<input type="range" id="speed" min="0.25" max="2.5" step="0.25" value="1">
</div>
<div class="field">
<label>Density <b id="density-val">medium</b></label>
<div class="seg" id="density-seg">
<button data-v="low">low</button><button data-v="medium" class="sel">med</button><button data-v="high">high</button>
</div>
</div>
<div class="field">
<label>Labels <b id="labels-val">medium</b></label>
<div class="seg" id="labels-seg">
<button data-v="sparse">sparse</button><button data-v="medium" class="sel">med</button><button data-v="verbose">verbose</button>
</div>
</div>
<div class="field">
<label>Accent <b id="accent-name">crypto green</b></label>
<div class="swatch-row" id="swatch-row">
<div class="swatch sel" data-c="#5fb8a4" data-n="restrained teal" style="background:#5fb8a4"></div>
<div class="swatch" data-c="#7a8b6b" data-n="olive" style="background:#7a8b6b"></div>
<div class="swatch" data-c="#6ecbff" data-n="trust blue" style="background:#6ecbff"></div>
<div class="swatch" data-c="#c69bff" data-n="court violet" style="background:#c69bff"></div>
<div class="swatch" data-c="#e8eaec" data-n="mono ink" style="background:#e8eaec"></div>
</div>
</div>
</div>
</div>
<script>
/* ================================================================
AEOESS — Protocol Architecture
4 scenes, pure SVG + JS rAF. No deps.
================================================================ */
const TWEAK_DEFAULS = /*EDITMODE-BEGIN*/{
"speed": 1,
"density": "medium",
"labels": "medium",
"accent": "#5fb8a4",
"accentName": "restrained teal"
}/*EDITMODE-END*/;
const state = {
speed: TWEAK_DEFAULS.speed,
density: TWEAK_DEFAULS.density,
labels: TWEAK_DEFAULS.labels,
accent: TWEAK_DEFAULS.accent,
accentName: TWEAK_DEFAULS.accentName,
sceneIdx: 0,
t0: performance.now(),
};
/* ---------- applyAccent ---------- */
function setAccent(hex, name) {
state.accent = hex; state.accentName = name;
const rgb = hex.replace('#','').match(/.{2}/g).map(h=>parseInt(h,16));
document.documentElement.style.setProperty('--accent', hex);
document.documentElement.style.setProperty('--accent-glow', `rgba(${rgb[0]},${rgb[1]},${rgb[2]},0.35)`);
document.getElementById('accent-name').textContent = name;
}
/* ---------- tabs ---------- */
document.querySelectorAll('.tab').forEach(t => {
t.addEventListener('click', () => selectScene(parseInt(t.dataset.scene)));
});
const TITLES = [
['01 · Life of an Action.', 'Passport, delegation, intent, gateway, enforcement, receipt. Each step signed.'],
['02 · Delegation & Cascade.', 'Authority can only narrow. Revoke a node, the whole subtree dies in one call.'],
['03 · Gateway Judgement.', 'Every action evaluated against 14 constraint dimensions. Fail-closed.'],
['04 · Trust Mesh.', 'Agents, humans, services bound by signed delegations, receipts, reputation.'],
['05 · Payment Rails.', 'Agent pays. Scope narrows. Merchant receives. Settlement record signed.'],
['06 · Cross-Impl Interop.', 'Six independent implementations. Same fixture. Byte-match SHA-256.'],
];
const BELOW = [
[
['Identity', 'Ed25519 keypair bound to a human principal. <code>did:key</code>, <code>did:web</code>, SPIFFE, OAuth. BYO.'],
['Scope', 'Each delegation narrows tools, budget, services. Never expands. Monotonic.'],
['Receipts', 'Wave 1 accountability set: <code>ActionReceipt</code>, <code>AuthorityBoundaryReceipt</code>, <code>CustodyReceipt</code>, <code>ContestabilityReceipt</code>, <code>APSBundle</code>. RFC 8785 JCS canonicalized.'],
],
[
['Root', 'Human principal. Authority originates here.'],
['Narrow', 'Child scopes are strict subsets of parent scopes. Enforced at issuance.'],
['Cascade', 'One API call revokes a node and every descendant. At the gateway, fail-closed.'],
],
[
['14 gates', 'Identity, signature, scope, budget, rate, values, reputation, freshness, plus six more.'],
['Conformance', '37 + 10 conformance vectors. <code>aps-conformance-suite</code>, public repo.'],
['Fail-closed', 'Missing a check is a deny. No bypass on cache miss or ambiguity.'],
],
[
['Agents', 'Passports as nodes. Reputation earned through completed work, not declared.'],
['Mutual auth', 'Four-step downgrade-proof handshake (v1, Apr 22). A2A and MCP adapters.'],
['Humans', 'Every chain terminates at a human principal. Attribution is Merkle-proven.'],
],
[
['Rails', '<code>x402</code>, <code>AP2</code>, <code>ACP</code>, <code>MPP</code>, <code>Stripe Issuing</code>. Phase 4.1 alpha across four registries (May 03).'],
['Scope check', 'Spend cap, merchant allow-list, single-use intent. Narrowed at the delegation, enforced at the rail adapter.'],
['Settlement', 'Per-period signed settlement records. Build C pipeline (Apr 16).'],
],
[
['Fixture', 'Canonical input. CTEF v0.3.2 §A draft, public.'],
['Implementations', 'qntm v0.3.2, AgentGraph, Foxbook, AgentID, Nobulex, ArkForge. Eight independent canonicalizers.'],
['Commitment', 'Identical SHA-256 across all six runs. Independently reproducible.'],
],
];
// Per-scene stats: [[labelA, valueA, labelB, valueB, labelC, valueC], ...]
// CLAIMS.md compliant: only verifiable numbers. No latency, no throughput.
const STATS_PER_SCENE = [
['receipts', '5 primitives', 'modules', '127', 'tests', '2,884'],
['narrowing', 'monotonic', 'cascade', 'one call', 'tests', '2,884'],
['gates', '14', 'conformance', '37 + 10', 'fail-closed', 'yes'],
['vocab', '25 crosswalks','papers', '8', 'tests', '2,884'],
['rails', '5', 'registries', '4', 'phase', '4.1 alpha'],
['implementations','6', 'canonicalizers', '8', 'CTEF', 'v0.3.2 §A'],
];
function reportHeight() {
try {
const shell = document.querySelector('.shell');
if (!shell) return;
const h = Math.ceil(shell.getBoundingClientRect().bottom) + 4;
window.parent.postMessage({ type: 'aeoess-arch-embed:height', height: h }, '*');
} catch (e) {}
}
function selectScene(i) {
state.sceneIdx = i;
setCap('', ''); // clear stale caption from prior scene
document.querySelectorAll('.tab').forEach(t => t.setAttribute('aria-selected', parseInt(t.dataset.scene) === i));
document.querySelectorAll('.scene').forEach(s => s.classList.toggle('active', parseInt(s.dataset.id) === i));
const [t, sub] = TITLES[i];
document.getElementById('scene-title').innerHTML = `<strong>${t}</strong> ${sub}`;
// stats per scene
const S = STATS_PER_SCENE[i];
document.getElementById('stat-a-label').textContent = S[0];
document.getElementById('stat-a').textContent = S[1];
document.getElementById('stat-b-label').textContent = S[2];
document.getElementById('stat-b').textContent = S[3];
document.getElementById('stat-c-label').textContent = S[4];
document.getElementById('stat-c').textContent = S[5];
// below
const below = document.getElementById('below'); below.innerHTML = '';
BELOW[i].forEach(([h,v]) => {
const cell = document.createElement('div'); cell.className = 'cell';
cell.innerHTML = `<div class="h">${h}</div><div class="v">${v}</div>`;
below.appendChild(cell);
});
try { localStorage.setItem('aeoess-scene', String(i)); } catch(e) {}
// notify parent of content height for iframe auto-resize
reportHeight();
}
/* ---------- URL hash routing (for embed splits) ----------
Examples:
#scene=2 → start on scene 2 (no persistence)
#scene=2&solo=1 → start on scene 2, hide tab strip (single-scene embed)
#scene=2&solo=1&theme=light → also force light theme
*/
function parseHash() {
const h = (location.hash || '').replace(/^#/, '');
const o = {};
h.split('&').forEach(p => { const [k,v] = p.split('='); if (k) o[k] = decodeURIComponent(v || ''); });
return o;
}
const _hash = parseHash();
const _hashScene = _hash.scene !== undefined ? parseInt(_hash.scene) : NaN;
const _solo = _hash.solo === '1' || _hash.solo === 'true';
if (_solo) document.body.classList.add('solo');
if (_hash.theme === 'light') document.documentElement.setAttribute('data-theme', 'light');
else if (_hash.theme === 'dark') document.documentElement.removeAttribute('data-theme');
/* restore */
if (!isNaN(_hashScene) && _hashScene >= 0 && _hashScene < 6) {
selectScene(_hashScene);
} else {
try { const s = parseInt(localStorage.getItem('aeoess-scene')); if (!isNaN(s)) selectScene(s); else selectScene(0); } catch(e) { selectScene(0); }
}
/* iframe auto-resize: continuously report content height to parent */
window.addEventListener('load', reportHeight);
window.addEventListener('resize', reportHeight);
if (typeof ResizeObserver !== 'undefined') {
const ro = new ResizeObserver(() => reportHeight());
const shell = document.querySelector('.shell');
if (shell) ro.observe(shell);
}
/* also poll briefly during initial animation settling */
let _heightPolls = 0;
const _heightPoll = setInterval(() => {
reportHeight();
if (++_heightPolls > 20) clearInterval(_heightPoll);
}, 200);
/* ---------- tweaks UI ---------- */
const tweaks = document.getElementById('tweaks');
const tweaksBtn = document.getElementById('tweaks-toggle');
document.getElementById('tweaks-close').onclick = () => tweaks.classList.remove('open');
tweaksBtn.onclick = () => tweaks.classList.toggle('open');
// edit-mode protocol
window.addEventListener('message', (e) => {
const d = e.data || {};
if (d.type === '__activate_edit_mode') { tweaksBtn.style.display = 'inline-block'; }
if (d.type === '__deactivate_edit_mode') { tweaksBtn.style.display = 'none'; tweaks.classList.remove('open'); }
});
window.parent.postMessage({type: '__edit_mode_available'}, '*');
function persist(edits) {
try { window.parent.postMessage({type: '__edit_mode_set_keys', edits}, '*'); } catch(e) {}
}
document.getElementById('speed').addEventListener('input', (e) => {
state.speed = parseFloat(e.target.value);
document.getElementById('speed-val').textContent = state.speed.toFixed(2)+'×';
persist({speed: state.speed});
});
document.getElementById('density-seg').addEventListener('click', (e) => {
const b = e.target.closest('button'); if (!b) return;
document.querySelectorAll('#density-seg button').forEach(x => x.classList.toggle('sel', x===b));
state.density = b.dataset.v;
document.getElementById('density-val').textContent = state.density;
rebuildAllScenes();
persist({density: state.density});
});
document.getElementById('labels-seg').addEventListener('click', (e) => {
const b = e.target.closest('button'); if (!b) return;
document.querySelectorAll('#labels-seg button').forEach(x => x.classList.toggle('sel', x===b));
state.labels = b.dataset.v;
document.getElementById('labels-val').textContent = state.labels;
document.body.dataset.labels = state.labels;
persist({labels: state.labels});
});
document.getElementById('swatch-row').addEventListener('click', (e) => {
const s = e.target.closest('.swatch'); if (!s) return;
document.querySelectorAll('#swatch-row .swatch').forEach(x => x.classList.toggle('sel', x===s));
setAccent(s.dataset.c, s.dataset.n);
persist({accent: s.dataset.c, accentName: s.dataset.n});
});
// initial
setAccent(state.accent, state.accentName);
document.body.dataset.labels = state.labels;
/* clock */
function tickClock() {
const d = new Date(); const pad = n => String(n).padStart(2,'0');
document.getElementById('clock').textContent = `${pad(d.getHours())}:${pad(d.getMinutes())}:${pad(d.getSeconds())} UTC`;
}
try { const c = document.getElementById('clock'); if (c) setInterval(tickClock, 1000); if (c) tickClock(); } catch(e) {}
/* caption */
function setCap(left, right) {
document.getElementById('cap-left').textContent = left || '—';
document.getElementById('cap-right').textContent = right || '';
}
/* ============================================================
SCENE 0 — LIFE OF AN ACTION (horizontal pipeline)
============================================================ */
const scene0 = {
stages: [
{ key:'PASSPORT', label:'Passport', sub:'ed25519 · did:key', detail:'identity minted' },
{ key:'DELEGATION', label:'Delegation', sub:'scope · budget · ttl', detail:'authority narrowed' },
{ key:'INTENT', label:'Intent', sub:'tool call · signed', detail:'agent requests action' },
{ key:'GATEWAY', label:'Gateway', sub:'14 gates · <2ms', detail:'policy evaluated' },
{ key:'ACT', label:'Action', sub:'executed · witnessed', detail:'effect in the world' },
{ key:'RECEIPT', label:'Receipt', sub:'merkle · d/p/g/c', detail:'signed & anchored' },
],
particles: [],
init(host) {
host.innerHTML = '';
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
svg.setAttribute('viewBox', '0 0 1600 900');
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
host.appendChild(svg);
this.svg = svg;
const y = 450;
const leftPad = 110, rightPad = 110;
const usable = 1600 - leftPad - rightPad;
const nStages = this.stages.length;
const gap = usable / (nStages - 1);
this.positions = this.stages.map((s, i) => ({ x: leftPad + i*gap, y, ...s }));
// rail
const rail = document.createElementNS('http://www.w3.org/2000/svg','line');
rail.setAttribute('x1', leftPad); rail.setAttribute('x2', 1600 - rightPad);
rail.setAttribute('y1', y); rail.setAttribute('y2', y);
rail.setAttribute('stroke', 'rgba(var(--ink-rgb),0.08)'); rail.setAttribute('stroke-width','1');
svg.appendChild(rail);
// dashed rail (animated forward)
const railA = document.createElementNS('http://www.w3.org/2000/svg','line');
railA.setAttribute('x1', leftPad); railA.setAttribute('x2', 1600 - rightPad);
railA.setAttribute('y1', y); railA.setAttribute('y2', y);
railA.setAttribute('stroke', 'var(--accent)'); railA.setAttribute('stroke-width','1');
railA.setAttribute('stroke-dasharray','2 8'); railA.setAttribute('opacity','0.5');
railA.classList.add('s0-rail');
svg.appendChild(railA);
this.rail = railA;
// step nodes
this.nodes = this.positions.map((p, i) => {
const g = document.createElementNS('http://www.w3.org/2000/svg','g');
g.setAttribute('transform', `translate(${p.x},${p.y})`);
// index above
const ix = document.createElementNS('http://www.w3.org/2000/svg','text');
ix.setAttribute('x',0); ix.setAttribute('y',-90); ix.setAttribute('text-anchor','middle');
ix.setAttribute('font-family','JetBrains Mono'); ix.setAttribute('font-size','10');
ix.setAttribute('fill', 'rgba(var(--ink-rgb),0.3)'); ix.setAttribute('letter-spacing','0.2em');
ix.textContent = '0' + (i+1);
g.appendChild(ix);
// label
const lbl = document.createElementNS('http://www.w3.org/2000/svg','text');
lbl.setAttribute('x',0); lbl.setAttribute('y',-60); lbl.setAttribute('text-anchor','middle');
lbl.setAttribute('font-family','Fraunces'); lbl.setAttribute('font-size','26');
lbl.setAttribute('fill','#e8eaec'); lbl.setAttribute('font-weight','300');
lbl.textContent = p.label;
g.appendChild(lbl);
// sublabel
const sub = document.createElementNS('http://www.w3.org/2000/svg','text');
sub.setAttribute('x',0); sub.setAttribute('y',-38); sub.setAttribute('text-anchor','middle');
sub.setAttribute('font-family','JetBrains Mono'); sub.setAttribute('font-size','10');
sub.setAttribute('fill','rgba(var(--ink-rgb),0.45)'); sub.setAttribute('letter-spacing','0.12em');
sub.setAttribute('text-transform','uppercase');
sub.textContent = p.sub.toUpperCase();
g.appendChild(sub);
// stage shape: circle
const ring = document.createElementNS('http://www.w3.org/2000/svg','circle');
ring.setAttribute('r','24'); ring.setAttribute('fill','var(--bg)');
ring.setAttribute('stroke','rgba(var(--ink-rgb),0.25)'); ring.setAttribute('stroke-width','1');
g.appendChild(ring);
const inner = document.createElementNS('http://www.w3.org/2000/svg','circle');
inner.setAttribute('r','4'); inner.setAttribute('fill','rgba(var(--ink-rgb),0.25)');
g.appendChild(inner);
// tick line down + detail label below
const tick = document.createElementNS('http://www.w3.org/2000/svg','line');
tick.setAttribute('x1',0); tick.setAttribute('x2',0); tick.setAttribute('y1',30); tick.setAttribute('y2',56);
tick.setAttribute('stroke','rgba(var(--ink-rgb),0.15)'); tick.setAttribute('stroke-width','1');
g.appendChild(tick);
const det = document.createElementNS('http://www.w3.org/2000/svg','text');
det.setAttribute('x',0); det.setAttribute('y',78); det.setAttribute('text-anchor','middle');
det.setAttribute('font-family','JetBrains Mono'); det.setAttribute('font-size','11');
det.setAttribute('fill','rgba(var(--ink-rgb),0.55)'); det.setAttribute('font-style','italic');
det.setAttribute('font-family','Fraunces');
det.textContent = p.detail;
g.appendChild(det);
svg.appendChild(g);
return { g, ring, inner };
});
// header band (top) - big evolving payload
this.payload = document.createElementNS('http://www.w3.org/2000/svg','g');
this.payload.setAttribute('transform', 'translate(0,110)');
svg.appendChild(this.payload);
// scope narrowing visualization (bottom)
this.scopeGroup = document.createElementNS('http://www.w3.org/2000/svg','g');
this.scopeGroup.setAttribute('transform', 'translate(0,680)');
svg.appendChild(this.scopeGroup);
this.drawScope();
this.lastSpawn = 0;
this.particles = [];
},
drawScope() {
this.scopeGroup.innerHTML = '';
const y = 0;
// labeled bar per stage, shrinking
const x0 = 110, x1 = 1490;
const barY = 40;
const scopes = [
{ lbl:'full key', w:1.00 },
{ lbl:'scope: {tools,budget}', w:0.78 },
{ lbl:'intent: one call', w:0.52 },
{ lbl:'accepted: narrowed', w:0.38 },
{ lbl:'executed', w:0.26 },
{ lbl:'final receipt', w:0.18 },
];
// title
const t = document.createElementNS('http://www.w3.org/2000/svg','text');
t.setAttribute('x',110); t.setAttribute('y',14);
t.setAttribute('font-family','JetBrains Mono'); t.setAttribute('font-size','10');
t.setAttribute('fill','rgba(var(--ink-rgb),0.4)'); t.setAttribute('letter-spacing','0.2em');
t.textContent = 'AUTHORITY — monotonic narrowing →';
this.scopeGroup.appendChild(t);
const totalW = x1 - x0;
scopes.forEach((s, i) => {
const stepX = x0 + (totalW / (scopes.length)) * i;
const stepW = (totalW / scopes.length) * s.w * 0.82;
const r = document.createElementNS('http://www.w3.org/2000/svg','rect');
r.setAttribute('x', stepX); r.setAttribute('y', barY);
r.setAttribute('width', stepW); r.setAttribute('height', 14);
r.setAttribute('fill','var(--accent)'); r.setAttribute('opacity', 0.15 + i*0.1);
r.setAttribute('rx','1');
this.scopeGroup.appendChild(r);
const l = document.createElementNS('http://www.w3.org/2000/svg','text');
l.setAttribute('x', stepX); l.setAttribute('y', barY + 36);
l.setAttribute('font-family','JetBrains Mono'); l.setAttribute('font-size','10');
l.setAttribute('fill','rgba(var(--ink-rgb),0.5)');
l.textContent = s.lbl;
this.scopeGroup.appendChild(l);
});
},
spawnParticle(t) {
// particle that travels across stages
const p = {
start: t,
dur: 5200 / state.speed,
id: Math.random().toString(36).slice(2,7),
};
this.particles.push(p);
},
step(now) {
if (!this.svg) return;
const t = now;
// spawn rhythm scaled by density
const rate = state.density === 'low' ? 3200 : state.density === 'high' ? 1100 : 1900;
if (t - this.lastSpawn > rate / state.speed) {
this.spawnParticle(t);
this.lastSpawn = t;
}
// animate rail dash
const dashOffset = - ((t/20) % 1000) * state.speed;
this.rail.setAttribute('stroke-dashoffset', dashOffset);
// render particles
// clear payload layer each frame
this.payload.innerHTML = '';
const x0 = this.positions[0].x;
const xN = this.positions[this.positions.length-1].x;
const yLine = 450;
// keep track of which stage highlights now
let activeStages = new Set();
for (let i = this.particles.length-1; i>=0; i--) {
const p = this.particles[i];
const u = (t - p.start) / p.dur;
if (u >= 1) { this.particles.splice(i,1); continue; }
const x = x0 + (xN - x0) * u;
const stage = Math.min(this.stages.length-1, Math.floor(u * this.stages.length));
activeStages.add(stage);
// particle on rail (svg)
const g = document.createElementNS('http://www.w3.org/2000/svg','g');
g.setAttribute('transform', `translate(${x},${yLine - 110})`);
// pill
const pill = document.createElementNS('http://www.w3.org/2000/svg','rect');
pill.setAttribute('x', -56); pill.setAttribute('y', -14);
pill.setAttribute('width', 112); pill.setAttribute('height', 28);
pill.setAttribute('rx', 14);
pill.setAttribute('fill', 'rgba(124,246,185,0.08)');
pill.setAttribute('stroke', 'var(--accent)');
pill.setAttribute('stroke-width','1');
g.appendChild(pill);
const lab = document.createElementNS('http://www.w3.org/2000/svg','text');
lab.setAttribute('x',0); lab.setAttribute('y',4); lab.setAttribute('text-anchor','middle');
lab.setAttribute('font-family','JetBrains Mono'); lab.setAttribute('font-size','11');
lab.setAttribute('fill','var(--accent)');
lab.textContent = `act#${p.id}`;
g.appendChild(lab);
// drop line to rail
const drop = document.createElementNS('http://www.w3.org/2000/svg','line');
drop.setAttribute('x1',0); drop.setAttribute('x2',0); drop.setAttribute('y1',14); drop.setAttribute('y2', 104);
drop.setAttribute('stroke','var(--accent)'); drop.setAttribute('stroke-width','1');
drop.setAttribute('opacity','0.4');
g.appendChild(drop);
// dot on rail
const dot = document.createElementNS('http://www.w3.org/2000/svg','circle');
dot.setAttribute('cx',0); dot.setAttribute('cy',110); dot.setAttribute('r',5);
dot.setAttribute('fill','var(--accent)');
dot.setAttribute('filter','drop-shadow(0 0 6px var(--accent-glow))');
g.appendChild(dot);
this.payload.appendChild(g);
}
// stage highlighting
this.nodes.forEach((n, i) => {
const hot = activeStages.has(i);
n.ring.setAttribute('stroke', hot ? 'var(--accent)' : 'rgba(var(--ink-rgb),0.25)');
n.ring.setAttribute('stroke-width', hot ? 2 : 1);
n.inner.setAttribute('fill', hot ? 'var(--accent)' : 'rgba(var(--ink-rgb),0.25)');
if (hot) n.g.setAttribute('filter','drop-shadow(0 0 10px var(--accent-glow))');
else n.g.removeAttribute('filter');
});
// caption
if (this.particles.length) {
const p = this.particles[this.particles.length-1];
const u = (t - p.start) / p.dur;
const s = Math.min(this.stages.length-1, Math.floor(u * this.stages.length));
setCap(`act#${p.id} → ${this.stages[s].label.toLowerCase()}`, this.stages[s].sub);
}
}
};
/* ============================================================
SCENE 1 — DELEGATION TREE + CASCADE REVOKE
============================================================ */
const scene1 = {
init(host) {
host.innerHTML = '';
const svg = document.createElementNS('http://www.w3.org/2000/svg','svg');
svg.setAttribute('viewBox','0 0 1600 900'); svg.setAttribute('preserveAspectRatio','xMidYMid meet');
host.appendChild(svg); this.svg = svg;
this.buildTree();
this.draw();
// auto demo
this.lastRevoke = 0;
},
buildTree() {
// root at top-left, then generations going right
// tree is a real hierarchy; authority narrows with depth (shown as alpha + width)
const gens = state.density === 'low' ? 3 : state.density === 'high' ? 5 : 4;
const spread = state.density === 'high' ? 2.6 : 2.2;
const nodes = [];
function add(parentIdx, depth, maxDepth, y0, y1) {
const myIdx = nodes.length;
const x = 160 + depth * ((1600-260) / (maxDepth));
const y = (y0 + y1) / 2;
nodes.push({ idx: myIdx, parent: parentIdx, depth, x, y, alive: true, pulse: 0, dying: 0 });
if (depth >= maxDepth) return;
// children count depends on depth and density
const kids = depth === 0 ? (state.density === 'high' ? 4 : 3)
: depth === 1 ? (state.density === 'high' ? 3 : 2)
: (state.density === 'high' ? 3 : 2);
for (let k=0;k<kids;k++) {
const ya = y0 + (y1-y0) * (k / kids);
const yb = y0 + (y1-y0) * ((k+1) / kids);
add(myIdx, depth+1, maxDepth, ya, yb);
}
}
add(-1, 0, gens, 100, 800);
this.nodes = nodes;
},
draw() {
const svg = this.svg; svg.innerHTML = '';
// HUMAN principal label on the far left of root
const nodes = this.nodes;
const root = nodes[0];
const human = document.createElementNS('http://www.w3.org/2000/svg','g');
human.setAttribute('transform', `translate(60,${root.y})`);
const hRect = document.createElementNS('http://www.w3.org/2000/svg','rect');
hRect.setAttribute('x',-50); hRect.setAttribute('y',-22); hRect.setAttribute('width',100); hRect.setAttribute('height',44);
hRect.setAttribute('fill','transparent'); hRect.setAttribute('stroke','rgba(var(--ink-rgb),0.25)'); hRect.setAttribute('stroke-width','1');
human.appendChild(hRect);
const hT = document.createElementNS('http://www.w3.org/2000/svg','text');
hT.setAttribute('text-anchor','middle'); hT.setAttribute('y',-2);
hT.setAttribute('font-family','Fraunces'); hT.setAttribute('font-size','14'); hT.setAttribute('fill','#e8eaec');
hT.textContent = 'HUMAN';
human.appendChild(hT);
const hS = document.createElementNS('http://www.w3.org/2000/svg','text');
hS.setAttribute('text-anchor','middle'); hS.setAttribute('y',14);
hS.setAttribute('font-family','JetBrains Mono'); hS.setAttribute('font-size','9'); hS.setAttribute('fill','rgba(var(--ink-rgb),0.45)');
hS.setAttribute('letter-spacing','0.15em');
hS.textContent = 'PRINCIPAL';
human.appendChild(hS);
// connector human->root
const hc = document.createElementNS('http://www.w3.org/2000/svg','line');
hc.setAttribute('x1',10); hc.setAttribute('x2', root.x - 60); hc.setAttribute('y1', 0); hc.setAttribute('y2', 0);
hc.setAttribute('stroke','var(--accent)'); hc.setAttribute('stroke-width','2');
human.appendChild(hc);
svg.appendChild(human);
// edges
this.edgeEls = [];
for (const n of nodes) {
if (n.parent < 0) continue;
const p = nodes[n.parent];
const path = document.createElementNS('http://www.w3.org/2000/svg','path');
const mx = (p.x + n.x) / 2;
const d = `M ${p.x} ${p.y} C ${mx} ${p.y}, ${mx} ${n.y}, ${n.x} ${n.y}`;
path.setAttribute('d', d);
path.setAttribute('fill','none');
path.setAttribute('stroke','var(--accent)');
path.setAttribute('stroke-opacity', 0.8 - n.depth * 0.12);
path.setAttribute('stroke-width', Math.max(1, 3 - n.depth*0.5));
svg.appendChild(path);
this.edgeEls.push({ path, from: p, to: n });
}
// nodes
this.nodeEls = nodes.map((n) => {
const g = document.createElementNS('http://www.w3.org/2000/svg','g');
g.setAttribute('transform', `translate(${n.x},${n.y})`);
const r = Math.max(6, 18 - n.depth*3);
const outer = document.createElementNS('http://www.w3.org/2000/svg','circle');
outer.setAttribute('r', r+6); outer.setAttribute('fill','transparent');
outer.setAttribute('stroke','var(--accent)'); outer.setAttribute('stroke-width','1'); outer.setAttribute('stroke-opacity','0');
g.appendChild(outer);
const c = document.createElementNS('http://www.w3.org/2000/svg','circle');
c.setAttribute('r', r);
c.setAttribute('fill', n.depth === 0 ? 'var(--accent)' : 'var(--bg-2)');
c.setAttribute('stroke','var(--accent)');
c.setAttribute('stroke-width', n.depth === 0 ? 0 : 1);
g.appendChild(c);
const inner = document.createElementNS('http://www.w3.org/2000/svg','circle');
inner.setAttribute('r', Math.max(2, r*0.35));
inner.setAttribute('fill', n.depth === 0 ? 'var(--bg)' : 'var(--accent)');
g.appendChild(inner);
// label
const label = document.createElementNS('http://www.w3.org/2000/svg','text');
label.setAttribute('y', r + 16); label.setAttribute('text-anchor','middle');
label.setAttribute('font-family','JetBrains Mono'); label.setAttribute('font-size', n.depth === 0 ? 11 : 9);
label.setAttribute('fill','rgba(var(--ink-rgb),0.55)');
label.setAttribute('letter-spacing','0.08em');
label.textContent = n.depth === 0 ? 'root.pass' : `agent-${String(n.idx).padStart(2,'0')}`;
g.appendChild(label);
// clickability on all except root
if (n.depth > 0) {
const hit = document.createElementNS('http://www.w3.org/2000/svg','circle');
hit.setAttribute('r', r+10); hit.setAttribute('fill','transparent');
hit.style.cursor = 'pointer';
hit.addEventListener('click', () => this.revoke(n.idx));
hit.addEventListener('mouseenter', () => { outer.setAttribute('stroke-opacity','0.6'); });
hit.addEventListener('mouseleave', () => { outer.setAttribute('stroke-opacity','0'); });
g.appendChild(hit);
}
svg.appendChild(g);
return { g, c, inner, outer, label };
});
// legend / action hint (top-left)
const hint = document.createElementNS('http://www.w3.org/2000/svg','g');
hint.setAttribute('transform','translate(40,40)');
const ht = document.createElementNS('http://www.w3.org/2000/svg','text');
ht.setAttribute('font-family','JetBrains Mono'); ht.setAttribute('font-size','11');
ht.setAttribute('fill','rgba(var(--ink-rgb),0.5)'); ht.setAttribute('letter-spacing','0.1em');
ht.textContent = 'CLICK ANY NODE → revoke(agentId) cascades to every descendant';
hint.appendChild(ht);
svg.appendChild(hint);
},
descendantsOf(idx) {
const out = [idx];
let added = true;
while (added) {
added = false;
for (const n of this.nodes) {
if (!out.includes(n.idx) && out.includes(n.parent)) { out.push(n.idx); added = true; }
}
}
return out;
},
revoke(idx) {
const now = performance.now();
const victims = this.descendantsOf(idx);
victims.forEach((vi, i) => {
const n = this.nodes[vi];
n.dying = now + i * (60 / state.speed);
});
setCap(`revoke(${this.nodes[idx].label || 'agent-'+idx}) → ${victims.length} nodes cascading`, 'one call · at the gateway · fail-closed');
},
step(now) {
if (!this.svg) return;
// auto demo: every few seconds, pick a random mid-depth node and revoke; after death reset
const interval = 6500 / state.speed;
if (now - this.lastRevoke > interval) {
// pick a random node that's alive and mid-depth
const candidates = this.nodes.filter(n => n.alive && n.depth >= 1 && n.depth <= 2);
if (candidates.length) {
const pick = candidates[Math.floor(Math.random()*candidates.length)];
this.revoke(pick.idx);
}
this.lastRevoke = now;
}
// animate state
for (let i=0;i<this.nodes.length;i++) {
const n = this.nodes[i];
const el = this.nodeEls[i];
// gentle idle pulse on outer ring for alive
if (n.alive && n.dying === 0) {
const p = (Math.sin(now/900 + i) + 1) / 2;
el.outer.setAttribute('stroke-opacity', (0.05 + p*0.12).toFixed(2));
}
// death animation
if (n.dying && now >= n.dying && n.alive) {
n.alive = false;