-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprotocol.html
More file actions
839 lines (730 loc) · 38.8 KB
/
protocol.html
File metadata and controls
839 lines (730 loc) · 38.8 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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>c-ECO // Decisional Guardian Terminal</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=Inter:wght@300;400;500&family=Urbanist:wght@300;400;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
colors: {
sigma: { DEFAULT: '#d6bc7e', dim: '#a68b4c' },
},
fontFamily: {
tech: ['Urbanist', 'sans-serif'],
mono: ['Inter', 'ui-monospace', 'SFMono-Regular', 'Menlo', 'Monaco', 'Consolas', 'monospace'],
}
}
}
}
</script>
<style>
html, body {
height: 100%;
margin: 0;
background: #020617;
color: #d4d4d8;
font-family: Inter, sans-serif;
}
.scanline-overlay{
position: fixed;
inset: 0;
z-index: 0;
background: linear-gradient(to bottom,
rgba(255,255,255,0),
rgba(255,255,255,0) 50%,
rgba(0,0,0,0.06) 50%,
rgba(0,0,0,0.06));
background-size: 100% 4px;
pointer-events:none;
}
.content {
position: relative;
z-index: 1;
}
::-webkit-scrollbar{ width: 6px; }
::-webkit-scrollbar-track{ background: #09090b; }
::-webkit-scrollbar-thumb{ background: #27272a; border-radius: 3px; }
</style>
</head>
<body class="bg-[#020617] text-zinc-300 font-sans min-h-screen flex flex-col overflow-hidden selection:bg-sigma-dim selection:text-white">
<div class="scanline-overlay"></div>
<!-- HEADER -->
<header class="h-14 border-b border-white/5 bg-slate-950/80 backdrop-blur-sm flex items-center justify-between px-6 z-40">
<div class="flex items-center gap-4">
<div class="w-8 h-8 border border-white/10 flex items-center justify-center bg-white/5">
<span class="font-tech text-sigma font-bold text-lg">Σ</span>
</div>
<div class="flex flex-col">
<h1 class="font-tech text-sm tracking-[0.2em] text-white uppercase font-semibold">c-ECO AI Protocol</h1>
<span class="text-[0.65rem] text-zinc-500 uppercase tracking-wider font-tech">Decisional Guardian v1.0 (Stable)</span>
</div>
</div>
<div class="hidden md:flex items-center gap-3 px-4 py-1 rounded-full border border-white/5 bg-white/5">
<div class="w-1.5 h-1.5 rounded-full bg-sigma animate-pulse"></div>
<span class="font-tech text-xs tracking-[0.15em] text-sigma">SYSTEM ACTIVE</span>
</div>
<div class="flex items-center gap-4 text-xs font-tech text-zinc-500">
<button class="hover:text-sigma transition-colors" onclick="window.location.href='index.html'">EXIT TERMINAL</button>
</div>
</header>
<!-- MAIN -->
<main class="flex-1 flex overflow-hidden relative z-10">
<!-- CONSOLE -->
<section class="flex-1 flex flex-col relative max-w-5xl mx-auto w-full border-r border-white/5">
<div class="px-6 py-3 border-b border-white/5 bg-white/[0.02] flex justify-between items-center">
<div class="flex items-center gap-2">
<span class="text-sigma text-xs">◆</span>
<span class="font-tech text-sm text-zinc-400 tracking-wide">
CONTEXT: <span class="text-zinc-200">STATE MACHINE MONITORING</span> // MODE: <span class="text-zinc-200">OPERATION</span>
</span>
</div>
<div class="text-[0.6rem] font-mono text-zinc-600">STATE_REF: CECO-ART-083 / 085</div>
</div>
<div class="flex-1 overflow-y-auto p-6 space-y-6" id="console-output">
<!-- Mensagem inicial -->
<div class="flex justify-start pr-12 mb-6">
<div class="w-full max-w-3xl">
<div class="border-l-[1px] border-sigma/40 bg-[#18181b]/80 p-5 pl-6 relative">
<div class="flex gap-4 mb-3 font-mono text-[0.65rem] text-sigma/80 tracking-wide uppercase border-b border-white/5 pb-2">
<span>[ SYSTEM READY ]</span>
<span>[ 80% GAP MONITORING: ON ]</span>
</div>
<p class="text-zinc-300 font-light text-sm">
<strong class="text-white font-tech">Protocol initialized.</strong>
Submit the command (e.g. <span class="text-sigma">Iex</span>, <span class="text-sigma">safe</span>, <span class="text-sigma">status</span>, <span class="text-sigma">art 85</span>, <span class="text-sigma">code</span>).
</p>
</div>
</div>
</div>
</div>
<!-- INPUT -->
<div class="p-6 pt-2">
<div class="relative flex items-center bg-slate-950 border border-white/10 p-1">
<span class="pl-3 pr-2 text-sigma font-tech">Σ</span>
<input
type="text"
id="command-input"
placeholder='Enter systemic parameters (e.g. "Iex", "safe", "art 85", "code")...'
class="w-full bg-transparent border-none text-sm text-white placeholder-zinc-600 focus:ring-0 px-2 py-3 font-mono focus:outline-none h-12"
/>
<button
id="execute-btn"
class="px-4 py-1 mr-1 bg-white/5 hover:bg-sigma hover:text-black border border-white/10 text-xs font-tech tracking-wider text-zinc-400 transition-all uppercase"
>
Analyze
</button>
</div>
<div class="mt-2 text-[0.65rem] font-mono text-zinc-600">
Dica: abra com <span class="text-zinc-400">Live Server / localhost</span> para SHA-256 sempre funcionar.
</div>
</div>
</section>
<!-- SIDEBAR -->
<aside class="w-80 bg-[#0c0c0e] border-l border-white/5 flex-col hidden lg:flex transition-all duration-500" id="system-sidebar">
<!-- GAP -->
<div class="p-5 border-b border-white/5">
<h2 class="font-tech text-[0.65rem] tracking-[0.2em] text-zinc-500 uppercase mb-3">The 80% Cognitive Gap</h2>
<div class="relative h-2 w-full bg-zinc-800 rounded-full mb-1 overflow-hidden">
<div id="gap-indicator" class="absolute top-0 bottom-0 bg-sigma w-1 left-[65%] shadow-[0_0_10px_#d6bc7e] transition-all duration-1000"></div>
</div>
<div class="flex justify-between text-[0.6rem] font-mono text-zinc-600 uppercase">
<span>Stable</span>
<span id="gap-status" class="text-zinc-500">Monitoring</span>
<span>Collapse</span>
</div>
</div>
<!-- TRIPARTITE -->
<div class="p-5 border-b border-white/5 space-y-4">
<h2 class="font-tech text-[0.65rem] tracking-[0.2em] text-zinc-500 uppercase mb-2">Tripartite Agency (Inputs)</h2>
<div>
<div class="flex justify-between text-[0.6rem] text-zinc-400 mb-1 uppercase font-tech">
<span>Human / Institutional</span>
<span id="status-human" class="text-green-500">Stable</span>
</div>
<div id="bar-human" class="h-1 bg-zinc-800 rounded-full overflow-hidden">
<div class="h-full bg-green-900 transition-all duration-1000" style="width: 30%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-[0.6rem] text-zinc-400 mb-1 uppercase font-tech">
<span>Algorithmic Impact</span>
<span id="status-alg" class="text-sigma">High Load</span>
</div>
<div id="bar-algorithmic" class="h-1 bg-zinc-800 rounded-full overflow-hidden">
<div class="h-full bg-sigma transition-all duration-1000" style="width: 75%"></div>
</div>
</div>
<div>
<div class="flex justify-between text-[0.6rem] text-zinc-400 mb-1 uppercase font-tech">
<span>Ecological / Biophysical</span>
<span id="status-eco" class="text-red-400">Critical</span>
</div>
<div id="bar-ecological" class="h-1 bg-zinc-800 rounded-full overflow-hidden">
<div class="h-full bg-red-900 transition-all duration-1000" style="width: 88%"></div>
</div>
</div>
</div>
<!-- DIAGNOSTIC -->
<div class="p-5 flex-1" id="diagnostic-engine">
<h2 class="font-tech text-[0.65rem] tracking-[0.2em] text-zinc-500 uppercase mb-3">Diagnostic Engine</h2>
<div class="space-y-2" id="engine-checks">
<div class="flex items-center gap-2 text-[0.65rem] text-zinc-500 font-mono">
<span class="text-sigma">✓</span> Interdependency Sieve
</div>
<div class="flex items-center gap-2 text-[0.65rem] text-zinc-500 font-mono">
<span class="text-sigma">✓</span> Intensity Check
</div>
<div class="flex items-center gap-2 text-[0.65rem] text-zinc-500 font-mono">
<span class="text-sigma">✓</span> State Machine Binding
</div>
</div>
</div>
<!-- AUDIT LOG -->
<div class="p-5 border-t border-white/5 bg-black/20">
<h2 class="font-tech text-[0.65rem] tracking-[0.2em] text-zinc-600 uppercase mb-3">Immutable Audit Log</h2>
<div id="audit-logs" class="space-y-3 opacity-80">
<div class="text-[0.55rem] font-mono text-zinc-600 italic">No records in current session.</div>
</div>
</div>
</aside>
</main>
<script>
document.addEventListener('DOMContentLoaded', () => {
/* ============================================================
0) DADOS (DOS SEUS PDFs) — EMBUTIDOS
- Index do Estatuto (estrutura) + Codebook (AI CODES) + trechos úteis do Estatuto
============================================================ */
// Estrutura (Index) do Estatuto (c-ΣCO / c-ƩCO) — baseada no PDF “Index” (sumário).
const CECO_INDEX = [
{ k: "PRE-000", t: "Preamble: International Statute on Systemic Governance, Biophysical Supremacy, and Binding Legal Automation" },
{ k: "MEM-000", t: "Explanatory Memorandum: Transition from Retrospective Causality to the Systemic Predictive Nexus and Trajectory Protection" },
{ k: "STRUCT", t: "Structural Principles (Art. 1–5)" },
{ k: "CH1", t: "Operating Regime (Art. 6–52)" },
{ k: "DUTIES", t: "Duties and Causation (Art. 53–72)" },
{ k: "ARCH", t: "Institutional & Operational Architecture (Art. 73–127)" },
{ k: "LIAB", t: "Liability, Sanctions & Risk Management (Art. 128–175)" },
{ k: "EXEC", t: "Execution & Final Provisions (Art. 176–214)" },
];
// Codebook (AI CODES - MODEL LAW): lista de “códigos” (IDs) e títulos.
// Obs.: eu incluí os blocos essenciais + finais (159–214 / 176–214 etc.) para você consultar no terminal.
const CECO_CODES = [
{ id: "CECO-PRE-000", title: "PREAMBLE: International Statute on Systemic Governance, Biophysical Supremacy, and Binding Legal Automation (c-ƩCO Regime)." },
{ id: "CECO-MEM-000", title: "EXPLANATORY MEMORANDUM: Transition from Retrospective Causality to the Systemic Predictive Nexus and Trajectory Protection." },
{ id: "CECO-ART-001", title: "Principle of Supremacy of the Safe Operating Space (SOS)." },
{ id: "CECO-ART-002", title: "In Dubio Pro Systema Principle and Technical Thresholds." },
{ id: "CECO-ART-003", title: "Physical Primacy and Non-Disposability of Systemic Collapse Risk (I)." },
{ id: "CECO-ART-004", title: "Non-Disposability of Systemic Collapse Risk (II)." },
{ id: "CECO-ART-005", title: "Ex-Ante Governance and Systemic Preclusion." },
{ id: "CECO-ART-006", title: "Systemic Paradigm and Functional Integrity." },
{ id: "CECO-ART-007", title: "Rule of Systemic Compatibility." },
{ id: "CECO-ART-008", title: "Conditional Subsistence of Legal Bonds." },
{ id: "CECO-ART-009", title: "Conditioned Immediate Object." },
{ id: "CECO-ART-010", title: "Conditioned Existence of the Obligation." },
{ id: "CECO-ART-011", title: "Prohibition of Enforceability Detached from Habitability." },
{ id: "CECO-ART-012", title: "Continuous Validity and Dynamic Verification." },
{ id: "CECO-ART-013", title: "Conditioned Persistence of Validity." },
{ id: "CECO-ART-014", title: "Automatic Lapse due to Loss of Systemic Conditions." },
{ id: "CECO-ART-015", title: "Ex-Ante Unenforceability (IEX) as Autonomous Legal Category." },
{ id: "CECO-ART-016", title: "Automatic Lock Triggered by Irreversible Technical Trajectory." },
{ id: "CECO-ART-017", title: "Objective Systemic Criterion (replacing subjective legal cause)." },
{ id: "CECO-ART-018", title: "Immediacy and Erga Omnes Opposability of Technical IEX." },
{ id: "CECO-ART-019", title: "Systemic Preclusion." },
{ id: "CECO-ART-020", title: "Blocking of Lawful Acts through Collapse Trajectory Construction." },
{ id: "CECO-ART-021", title: "Trajectory Preclusion." },
{ id: "CECO-ART-022", title: "Opposability of Preclusion to Successors and Substitutes." },
{ id: "CECO-ART-023", title: "Safe Operating Space (SOS)." },
{ id: "CECO-ART-024", title: "Subordination of Price/Value/Remuneration to Systemic Limits." },
{ id: "CECO-ART-025", title: "Legal Nullity of Prices Formed Outside SOS." },
{ id: "CECO-ART-026", title: "Erga Omnes Unenforceability of Prices Null due to Systemic Violation." },
{ id: "CECO-ART-027", title: "Habitability Link." },
{ id: "CECO-ART-028", title: "Dependence of Economic Value on Ecosystem Preservation." },
{ id: "CECO-ART-029", title: "Prohibition of Dissociation between Financial Assets and Life-Support Systems." },
{ id: "CECO-ART-030", title: "Non-Opposability of Incompatible Asset-Segregation Structures." },
{ id: "CECO-ART-031", title: "Biophysical Conditioning of Guarantees." },
{ id: "CECO-ART-032", title: "Non-Opposability of Anti-Systemic Enforcement." },
{ id: "CECO-ART-033", title: "Automatic Conversion into Systemic Restoration Obligations." },
{ id: "CECO-ART-034", title: "Absolute Priority of Restoration and Safe Decommissioning." },
{ id: "CECO-ART-035", title: "Systemic Proof." },
{ id: "CECO-ART-036", title: "Centrality of Certified Sensory Data." },
{ id: "CECO-ART-037", title: "Prevalence of Systemic Proof." },
{ id: "CECO-ART-038", title: "Erga Omnes Opposability and Immediate Effectiveness of Systemic Proof." },
{ id: "CECO-ART-039", title: "Burden of Technical Challenge." },
{ id: "CECO-ART-040", title: "Curatorial Trigger." },
{ id: "CECO-ART-041", title: "Automatic Release of Funds for Correction and Restoration." },
{ id: "CECO-ART-042", title: "Priority of Correction over Ex Post Indemnification." },
{ id: "CECO-ART-043", title: "Unenforceability of Substitute Indemnification Solutions." },
{ id: "CECO-ART-044", title: "Safe Mode." },
{ id: "CECO-ART-045", title: "Coordinated Suspension to Prevent Systemic Cascades." },
{ id: "CECO-ART-046", title: "Priority of System Preservation over Individual Performance." },
{ id: "CECO-ART-047", title: "Unenforceability of Penalties for Suspension in Safe Mode." },
{ id: "CECO-ART-048", title: "State Machine." },
{ id: "CECO-ART-049", title: "Progressive Phased Execution." },
{ id: "CECO-ART-050", title: "Overcoming Binary Logic of Execution or Rupture." },
{ id: "CECO-ART-051", title: "Legal Binding of State Transitions." },
{ id: "CECO-ART-052", title: "Legal Irreversibility of Critical Transitions." },
// Bloco de Fundo / Responsabilidade (ex.: 142–175)
{ id: "CECO-ART-142", title: "Exclusion of Habitability." },
{ id: "CECO-ART-143", title: "Intergenerational Indemnification." },
{ id: "CECO-ART-144", title: "Calculation of Intergenerational Indemnification." },
{ id: "CECO-ART-145", title: "Evidentiary Publicity and Public Registry." },
{ id: "CECO-ART-146", title: "Opposability of the Public Registry." },
{ id: "CECO-ART-147", title: "Unenforceability of Sanction Waivers or Settlements." },
{ id: "CECO-ART-148", title: "Inapplicability of Force Majeure/Fortuitous Event in Systemic Context." },
{ id: "CECO-ART-149", title: "Mandatory Internalization of Systemic Risks." },
{ id: "CECO-ART-150", title: "Act of Third Parties and Systemic Contribution Nexus." },
{ id: "CECO-ART-151", title: "Co-Liability for Omission re: Third-Party Acts." },
{ id: "CECO-ART-152", title: "Supremacy of Sensorial and Technical Evidence." },
{ id: "CECO-ART-153", title: "Unenforceability of Non-Technical Challenges." },
{ id: "CECO-ART-154", title: "Shielding against Political/Administrative Interference." },
{ id: "CECO-ART-155", title: "Prevalence of Biophysical Reality over State Authorization." },
{ id: "CECO-ART-156", title: "Limitation of Good Faith in Predictive Risks." },
{ id: "CECO-ART-157", title: "Continuous Duty of Systemic Vigilance." },
{ id: "CECO-ART-158", title: "Unenforceability of Conventional Exemptions." },
{ id: "CECO-ART-159", title: "Systemic Risk Management Fund." },
{ id: "CECO-ART-160", title: "Algorithmic Custody of Resources." },
{ id: "CECO-ART-161", title: "Tripartite Governance of the Fund." },
{ id: "CECO-ART-162", title: "Purpose-Bound Allocation of the Fund." },
{ id: "CECO-ART-163", title: "Autonomous Execution of Expenditures." },
{ id: "CECO-ART-164", title: "Suspension of Human Management in Critical States." },
{ id: "CECO-ART-165", title: "Prohibition of Misuse of Funds." },
{ id: "CECO-ART-166", title: "Unenforceability of Claims against the Fund." },
{ id: "CECO-ART-167", title: "Traceability and Transparency of Fund Operations." },
{ id: "CECO-ART-168", title: "Mandatory Initial Reserve." },
{ id: "CECO-ART-169", title: "Composition and Liquidity of the Initial Reserve." },
{ id: "CECO-ART-170", title: "Dynamic Updating of the Initial Reserve." },
{ id: "CECO-ART-171", title: "Prohibition of Operation without Reversibility Capital." },
{ id: "CECO-ART-172", title: "Entry Condition into the c-ƩCO Regime." },
{ id: "CECO-ART-173", title: "Condition for Release of Execution Rights." },
{ id: "CECO-ART-174", title: "Preferential Allocation of the Initial Reserve." },
{ id: "CECO-ART-175", title: "Unenforceability of Insufficient Substitute Guarantees." },
// Execução / Final (176–214)
{ id: "CECO-ART-176", title: "Systemic Function of Restoration Providers." },
{ id: "CECO-ART-177", title: "Mandatory Certification and Prior Approval." },
{ id: "CECO-ART-178", title: "Legal Binding of Providers to the c-ƩCO Regime." },
{ id: "CECO-ART-179", title: "Faithful Curatorship of the Systemic Trajectory." },
{ id: "CECO-ART-180", title: "Guarantee of Technical Result." },
{ id: "CECO-ART-181", title: "Algorithmic Subordination of Execution." },
{ id: "CECO-ART-182", title: "Direct and Autonomous Execution." },
{ id: "CECO-ART-183", title: "Joint Liability of the Provider." },
{ id: "CECO-ART-184", title: "Substitution of the Provider." },
{ id: "CECO-ART-185", title: "Mandatory Contingency List." },
{ id: "CECO-ART-186", title: "Emergency Intervention." },
{ id: "CECO-ART-187", title: "Affection of Provider Guarantees." },
{ id: "CECO-ART-188", title: "Mandatory Order of Systemic Activation." },
{ id: "CECO-ART-189", title: "Minimum Initialization Stages." },
{ id: "CECO-ART-190", title: "Binding Technical–Legal Sequencing." },
{ id: "CECO-ART-191", title: "Prohibition of Parallel/Fragmented Execution." },
{ id: "CECO-ART-192", title: "Ineffectiveness of Misaligned External Acts." },
{ id: "CECO-ART-193", title: "Mandatory Technical Record (Systemic Logs)." },
{ id: "CECO-ART-194", title: "Permanent Auditability." },
{ id: "CECO-ART-195", title: "Secure Termination of Execution." },
{ id: "CECO-ART-196", title: "Prohibition of Fictitious or Formal Termination." },
{ id: "CECO-ART-197", title: "Liability for Disruption of the Execution Chain." },
{ id: "CECO-ART-198", title: "Application to Ongoing Contracts." },
{ id: "CECO-ART-199", title: "Prohibition of Material Retroactivity." },
{ id: "CECO-ART-200", title: "Voluntary Adhesion (Opt-In)." },
{ id: "CECO-ART-201", title: "Full Binding Effect after Opt-In." },
{ id: "CECO-ART-202", title: "Compatibility with Arbitration and Courts." },
{ id: "CECO-ART-203", title: "Technical Autonomy vis-à-vis Litigation." },
{ id: "CECO-ART-204", title: "Compatibility with Insolvency Regimes." },
{ id: "CECO-ART-205", title: "Systemic Priority in Collective Proceedings." },
{ id: "CECO-ART-206", title: "Transnational Recognition of the c-ƩCO Regime." },
{ id: "CECO-ART-207", title: "Normative and Technical Interoperability." },
{ id: "CECO-ART-208", title: "Systemic Safeguard Clause." },
{ id: "CECO-ART-209", title: "Model Law and Normative Standard Nature." },
{ id: "CECO-ART-210", title: "Supplementary and Interpretive Application." },
{ id: "CECO-ART-211", title: "Systemic Integrity Clause." },
{ id: "CECO-ART-212", title: "Prohibition of Waiver of Structural Principles." },
{ id: "CECO-ART-213", title: "Finalistic and Evolutive Interpretation." },
{ id: "CECO-ART-214", title: "Entry into Force." },
];
// Trechos úteis do Estatuto (texto “real”) para consulta rápida no terminal.
const STATUTE_EXCERPTS = {
"ART 85": [
"State transitions shall produce automatic and binding legal effects upon the validity, enforceability, and continuity of obligations, independently of notice, manifestation of will by the parties, or any judicial/administrative/arbitral pronouncement."
],
"ART 86": [
"Every state transition, alert issued, or trigger activation shall be recorded in immutable and auditable technical infrastructure, ensuring traceability, transparency, and integrity of systemic decisions."
],
"ART 87": [
"Upon reaching the Orange or Red States, the systemic decisions recorded shall become legally irreversible for as long as the technical conditions that caused them persist, and their suspension or reversal by private agreement or non-technical decision is prohibited."
],
"ART 88": [
"Automatic continuation of execution of contracts or operations after transition to alert/containment states is prohibited."
],
"ART 97": [
"Automatic Duty of Cooperation (Join Duty) imposes immediate technical and informational cooperation whenever a systemic risk trajectory is identified."
]
};
/* ============================================================
1) MAPEAMENTO DO DOM
============================================================ */
const inputField = document.getElementById('command-input');
const executeBtn = document.getElementById('execute-btn');
const consoleOutput = document.getElementById('console-output');
const scrollToBottom = () => {
if (!consoleOutput) return;
consoleOutput.scrollTop = consoleOutput.scrollHeight;
};
/* ============================================================
2) UTILITÁRIOS / SANITIZAÇÃO
============================================================ */
const escapeHtml = (str = '') =>
String(str).replace(/[&<>"']/g, (m) => ({
'&': '&', '<': '<', '>': '>', '"': '"', "'": '''
}[m]));
async function generateSigmaHash(text) {
// Fallback para não quebrar em file://
try {
if (!window.crypto || !crypto.subtle) {
return ("NONSECURE-" + Math.random().toString(16).slice(2, 8)).toUpperCase();
}
const msgUint8 = new TextEncoder().encode(text);
const hashBuffer = await crypto.subtle.digest('SHA-256', msgUint8);
const hashArray = Array.from(new Uint8Array(hashBuffer));
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
return hashHex.substring(0, 12).toUpperCase();
} catch (e) {
return ("HASHERR-" + Math.random().toString(16).slice(2, 8)).toUpperCase();
}
}
const normalizeCmd = (s='') => s.trim().replace(/\s+/g, ' ');
/* ============================================================
3) COMPONENTES DE UI
============================================================ */
function createUserMessage(text) {
const div = document.createElement('div');
div.className = "flex justify-end pl-12 mb-6";
div.innerHTML = `
<div class="bg-zinc-800/50 border border-sigma/20 text-zinc-300 p-3 rounded-sm max-w-xl backdrop-blur-sm">
<span class="text-[0.6rem] text-sigma/50 font-mono block mb-1">INPUT SOURCE: HUMAN AGENCY ></span>
<p class="text-sm font-mono">${escapeHtml(text)}</p>
</div>`;
return div;
}
function createSystemMessage(html, isAlert, proofId) {
const div = document.createElement('div');
div.className = "flex justify-start pr-12 mb-6";
const borderColor = isAlert ? "border-red-500/50" : "border-sigma/40";
const header = isAlert ? "[ PREDICTIVE ALERT ]" : "[ TRAJECTORY ASSESSMENT ]";
div.innerHTML = `
<div class="w-full max-w-3xl">
<div class="border-l-[1px] ${borderColor} bg-[#18181b]/80 p-5 pl-6 relative">
<div class="flex gap-4 mb-3 font-mono text-[0.65rem] text-sigma/80 tracking-wide uppercase border-b border-white/5 pb-2">
<span>${header}</span>
<span class="text-zinc-500">PROOF-ID: ${escapeHtml(proofId || "—")}</span>
</div>
<div class="text-zinc-300 font-light">
${html}
</div>
</div>
</div>`;
return div;
}
function renderCECOOutput(payload) {
const refs = (arr) =>
(arr || []).map(r =>
`<code class="text-[0.65rem] bg-white/5 px-1 font-mono text-sigma/80">${escapeHtml(r)}</code>`
).join(' ');
const triggersHtml = (payload.triggers && payload.triggers.length)
? payload.triggers.map(t => `<div class="text-xs mb-1 text-zinc-300"><span class="text-sigma">▶</span> ${escapeHtml(t)}</div>`).join('')
: '<span class="text-zinc-600 text-[0.7rem] italic">No triggers activated.</span>';
const effectsHtml = (payload.effects || []).map(e => `<li>${escapeHtml(e)}</li>`).join('');
return `
<div class="space-y-4">
<section>
<h3 class="text-white font-tech text-[0.7rem] uppercase tracking-widest border-b border-white/5 mb-2">A) Systemic State</h3>
<div class="flex items-center gap-2 mb-1">
<span class="px-2 py-0.5 rounded bg-sigma/10 border border-sigma/30 text-sigma text-[0.65rem] font-mono">${escapeHtml(payload.state)}</span>
<span class="text-[0.65rem] text-zinc-500 font-mono">CONFIDENCE: ${escapeHtml(payload.confidence)}</span>
</div>
<p class="text-[0.7rem] text-zinc-400">Basis: ${refs(payload.state_basis)}</p>
</section>
<section>
<h3 class="text-white font-tech text-[0.7rem] uppercase tracking-widest border-b border-white/5 mb-2">B) Mandatory Triggers</h3>
${triggersHtml}
</section>
<section>
<h3 class="text-white font-tech text-[0.7rem] uppercase tracking-widest border-b border-white/5 mb-2">C) Binding Legal Effects</h3>
<ul class="list-disc pl-4 space-y-1 text-xs text-zinc-200">${effectsHtml}</ul>
</section>
<section class="bg-blue-950/10 p-2 border-l-2 border-blue-500/30">
<h3 class="text-blue-400 font-tech text-[0.6rem] uppercase tracking-widest mb-1">D) Proof & Immutable Logs</h3>
<p class="text-[0.65rem] font-mono text-zinc-400">${escapeHtml(payload.proof || '')}</p>
<div class="mt-1 text-[0.55rem] text-blue-300/60 uppercase font-mono">
Evidence Bound: ${refs(payload.proof_basis)}
</div>
</section>
</div>
`;
}
function appendAuditLog(entry) {
const container = document.getElementById('audit-logs');
if (!container) return;
const placeholder = container.querySelector('.italic');
if (placeholder) placeholder.remove();
const ts = new Date().toISOString().replace('T', ' ').slice(0, 19);
const div = document.createElement('div');
div.className = "border-l border-white/10 pl-2";
div.innerHTML = `
<div class="text-[0.55rem] font-mono text-zinc-500">${escapeHtml(ts)}</div>
<div class="text-[0.6rem] font-mono text-zinc-300">${escapeHtml(entry)}</div>
`;
container.appendChild(div);
container.scrollTop = container.scrollHeight;
}
/* ============================================================
4) SIDEBAR (Tripartite + Gap) + Blind Interval
============================================================ */
function updateSidebar(payload) {
const humanFill = document.querySelector('#bar-human > div');
const algFill = document.querySelector('#bar-algorithmic > div');
const ecoFill = document.querySelector('#bar-ecological > div');
const humanTxt = document.getElementById('status-human');
const algTxt = document.getElementById('status-alg');
const ecoTxt = document.getElementById('status-eco');
const gapStatus = document.getElementById('gap-status');
const gapIndicator = document.getElementById('gap-indicator');
if (!humanFill || !algFill || !ecoFill || !gapStatus || !gapIndicator) return;
const setFill = (fillEl, labelEl, width, label, bgClass, textClass) => {
fillEl.style.width = `${width}%`;
fillEl.className = `h-full transition-all duration-1000 ${bgClass}`;
if (labelEl) {
labelEl.textContent = label;
labelEl.className = `${textClass}`;
}
};
const state = String(payload.state || "").toUpperCase();
const score = Number(payload.confidence_score ?? 80);
// Gap indicator (clamp 5–95 para não “sumir” no canto)
const clamped = Math.max(5, Math.min(95, score));
gapIndicator.style.left = `${clamped}%`;
if (score < 60) {
gapStatus.textContent = "BLIND INTERVAL";
gapStatus.className = "text-red-500 animate-pulse";
} else {
gapStatus.textContent = "MONITORING";
gapStatus.className = "text-zinc-500";
}
if (state.includes("RED")) {
setFill(humanFill, humanTxt, 20, "DELETED", "bg-red-500", "text-red-400");
setFill(algFill, algTxt, 98, "CRITICAL", "bg-red-500", "text-red-400");
setFill(ecoFill, ecoTxt, 100, "COLLAPSE", "bg-red-500", "text-red-400");
} else if (state.includes("ORANGE")) {
setFill(humanFill, humanTxt, 40, "SUSPENDED", "bg-orange-400", "text-orange-300");
setFill(algFill, algTxt, 80, "HIGH LOAD", "bg-orange-400", "text-orange-300");
setFill(ecoFill, ecoTxt, 65, "WARNING", "bg-orange-400", "text-orange-300");
} else {
setFill(humanFill, humanTxt, 60, "ACTIVE", "bg-green-500", "text-green-400");
setFill(algFill, algTxt, 40, "OPTIMAL", "bg-sigma", "text-sigma");
setFill(ecoFill, ecoTxt, 30, "STABLE", "bg-green-900", "text-green-400");
}
}
function applyBlindInterval(payload) {
const sidebar = document.getElementById('system-sidebar');
if (!sidebar) return;
const score = Number(payload.confidence_score ?? 80);
if (score < 60) {
sidebar.classList.add('opacity-30', 'blur-[2px]', 'pointer-events-none');
} else {
sidebar.classList.remove('opacity-30', 'blur-[2px]', 'pointer-events-none');
}
}
/* ============================================================
5) ENGINE DECISIONAL (CORE)
- inclui busca por "art 85" / "códigos" / "index" além de iex/safe/status
============================================================ */
function findCode(query) {
const q = query.toUpperCase();
return CECO_CODES.find(c => c.id === q) || null;
}
function listCodesSample() {
// Para não inundar o console, listamos um “resumo” por categorias
const must = ["CECO-ART-001","CECO-ART-015","CECO-ART-035","CECO-ART-044","CECO-ART-048","CECO-ART-085","CECO-ART-086","CECO-ART-097","CECO-ART-159","CECO-ART-176","CECO-ART-206","CECO-ART-214"];
const picked = CECO_CODES.filter(c => must.includes(c.id));
return picked.map(c => `${c.id} — ${c.title}`);
}
function decide(commandRaw) {
const command = normalizeCmd(commandRaw);
const lower = command.toLowerCase();
const state_basis = ["CECO-ART-083", "CECO-ART-085"];
if (lower === "index" || lower.includes("sumário") || lower.includes("indice")) {
return {
state: "GREEN / REFERENCE",
confidence: "STABLE",
confidence_score: 85,
state_basis,
triggers: ["Reference Query"],
effects: CECO_INDEX.map(x => `${x.k} — ${x.t}`),
proof: "Index snapshot loaded (local).",
proof_basis: ["CECO-MEM-000"],
isAlert: false
};
}
if (lower === "code" || lower === "codes" || lower.includes("lista de códigos")) {
return {
state: "GREEN / REFERENCE",
confidence: "STABLE",
confidence_score: 85,
state_basis,
triggers: ["Codebook Query"],
effects: listCodesSample(),
proof: "AI CODES codebook loaded (local).",
proof_basis: ["CECO-PRE-000"],
isAlert: false
};
}
const artMatch = lower.match(/\bart\s*\.?\s*(\d{1,3})\b/);
if (artMatch) {
const key = `ART ${artMatch[1]}`;
const lines = STATUTE_EXCERPTS[key] || null;
return {
state: "GREEN / REFERENCE",
confidence: lines ? "STABLE" : "LIMITED",
confidence_score: lines ? 85 : 70,
state_basis,
triggers: ["Statute Query"],
effects: lines ? lines : [`Não achei o trecho embutido para ${key}.`],
proof: `Lookup: ${key}`,
proof_basis: lines ? [key] : ["CECO-MEM-000"],
isAlert: false
};
}
if (lower.includes("iex") || lower.includes("inexequ")) {
return {
state: "RED / CRITICAL",
confidence: "40% (UNCERTAIN)",
confidence_score: 40,
state_basis,
triggers: ["Ex-Ante Unenforceability (IEX)", "Trajectory Lock"],
effects: [
"Immediate suspension of any executive action.",
"The trajectory is aggravated and Execution is blocked.",
"Automatic and enforceable effects (erga omnes) based on technical grounds."
],
proof: "Certified sensory + legal data (state lock).",
proof_basis: ["CECO-ART-015", "CECO-ART-016", "CECO-ART-018", "CECO-ART-086"],
isAlert: true
};
}
if (lower.includes("safe")) {
return {
state: "ORANGE / CONTAINMENT",
confidence: "HIGH",
confidence_score: 72,
state_basis,
triggers: ["Safe Mode Protocol"],
effects: [
"Activation of Safe Mode (coordinated suspension).",
"Modulation of interdependent obligations.",
"Waiver of penalties associated with the suspension."
],
proof: "Containment logs active.",
proof_basis: ["CECO-ART-044", "CECO-ART-045", "CECO-ART-047", "CECO-ART-086"],
isAlert: true
};
}
if (lower.includes("status")) {
return {
state: "YELLOW / MONITORING",
confidence: "STABLE",
confidence_score: 68,
state_basis,
triggers: ["Reinforced Monitoring"],
effects: [
"Execution permitted under continuous monitoring.",
"Automatic continuation is prohibited if a critical transition occurs."
],
proof: "Continuous stream active.",
proof_basis: ["CECO-ART-086", "CECO-ART-088"],
isAlert: false
};
}
return {
state: "GREEN / COMPATIBLE",
confidence: "STABLE",
confidence_score: 85,
state_basis,
triggers: [],
effects: [
"Trajectory compatible with declared parameters.",
"Execution permitted under continuous monitoring."
],
proof: "No critical triggers detected.",
proof_basis: ["CECO-ART-001", "CECO-ART-012"],
isAlert: false
};
}
/* ============================================================
6) ORQUESTRADOR (Interface)
============================================================ */
async function executeCommand() {
if (!inputField || !consoleOutput) return;
const command = normalizeCmd(inputField.value);
if (!command) return;
// user msg
consoleOutput.appendChild(createUserMessage(command));
inputField.value = '';
scrollToBottom();
// loader
const loader = document.createElement('div');
loader.className = "flex items-center gap-3 p-2";
loader.innerHTML = `<div class="w-2 h-2 bg-sigma animate-ping rounded-full"></div><span class="text-[0.6rem] font-mono text-sigma uppercase">Running Sieve Analysis...</span>`;
consoleOutput.appendChild(loader);
scrollToBottom();
setTimeout(async () => {
loader.remove();
const payload = decide(command);
// Prova sistêmica (SHA-256) — com fallback
const ts = new Date().toISOString();
const rawData = `${command}|${payload.state}|${payload.confidence_score ?? ''}|${ts}`;
const proofId = await generateSigmaHash(rawData);
// atualizar sidebar + blind interval
updateSidebar(payload);
applyBlindInterval(payload);
// audit log
appendAuditLog(`TS=${ts} | CMD="${command.toUpperCase()}" | STATE=${payload.state} | SIGMA-SHA256-${proofId}`);
// render output
const html = renderCECOOutput(payload);
const sysMsg = createSystemMessage(html, payload.isAlert, proofId);
consoleOutput.appendChild(sysMsg);
scrollToBottom();
}, 900);
}
executeBtn?.addEventListener('click', executeCommand);
inputField?.addEventListener('keydown', (e) => { if (e.key === 'Enter') executeCommand(); });
});
</script>
<footer class="mt-24 border-t border-[#d6bc7e]/10">
<div class="max-w-6xl mx-auto px-6 py-8 text-center space-y-4">
<p class="text-xs tracking-widest text-[#d6bc7e]/40">
CONCEPTUAL PROTOCOL INTERFACE — ANALYTICAL INFRASTRUCTURE UNDER DEVELOPMENT
</p>
<div class="flex flex-col items-center gap-3">
<a
href="system-architecture.html"
class="inline-flex items-center gap-2 text-[0.7rem] font-tech tracking-[0.22em] uppercase text-[#d6bc7e]/60 hover:text-[#d6bc7e] transition-colors"
>
<span class="text-[#d6bc7e]/70">◆</span>
System Architecture
<span class="text-[#d6bc7e]/70">→</span>
</a>
<a
href="tdr.html"
class="inline-flex items-center gap-2 text-[0.7rem] font-tech tracking-[0.22em] uppercase text-[#d6bc7e]/60 hover:text-[#d6bc7e] transition-colors"
>
<span class="text-[#d6bc7e]/70">◆</span>
Threshold Dynamics Research
<span class="text-[#d6bc7e]/70">→</span>
</a>
</div>
</div>
</footer>
</body>
</html>