tribunal-kit 4.3.1 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/.agent/history/architecture-explorer.html +352 -0
  2. package/.agent/history/architecture-graph.yaml +109 -0
  3. package/.agent/history/graph-cache.json +215 -0
  4. package/.agent/history/snapshots/migrate_refs.js.json +11 -0
  5. package/.agent/history/snapshots/scripts__changelog.js.json +12 -0
  6. package/.agent/history/snapshots/scripts__sync-version.js.json +11 -0
  7. package/.agent/history/snapshots/scripts__validate-payload.js.json +11 -0
  8. package/.agent/history/snapshots/test__integration__bridges.test.js.json +13 -0
  9. package/.agent/history/snapshots/test__integration__init.test.js.json +13 -0
  10. package/.agent/history/snapshots/test__integration__routing.test.js.json +11 -0
  11. package/.agent/history/snapshots/test__integration__swarm_dispatcher.test.js.json +13 -0
  12. package/.agent/history/snapshots/test__integration__wave2.test.js.json +13 -0
  13. package/.agent/history/snapshots/test__unit__args.test.js.json +10 -0
  14. package/.agent/history/snapshots/test__unit__case_law_manager.test.js.json +10 -0
  15. package/.agent/history/snapshots/test__unit__copyDir.test.js.json +13 -0
  16. package/.agent/history/snapshots/test__unit__graph_tools.test.js.json +11 -0
  17. package/.agent/history/snapshots/test__unit__selfInstall.test.js.json +13 -0
  18. package/.agent/history/snapshots/test__unit__semver.test.js.json +10 -0
  19. package/.agent/history/snapshots/test__unit__swarm_dispatcher.test.js.json +11 -0
  20. package/.agent/scripts/dependency_analyzer.js +1 -1
  21. package/.agent/scripts/graph_builder.js +311 -199
  22. package/.agent/scripts/graph_visualizer.js +384 -0
  23. package/.agent/scripts/mutation_runner.js +280 -0
  24. package/.agent/skills/knowledge-graph/SKILL.md +52 -36
  25. package/.agent/skills/testing-patterns/SKILL.md +19 -2
  26. package/.agent/skills/ui-ux-pro-max/SKILL.md +562 -125
  27. package/bin/tribunal-kit.js +129 -1
  28. package/package.json +1 -1
@@ -0,0 +1,352 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Tribunal Architecture Explorer</title>
7
+ <style>
8
+ :root {
9
+ --bg: #09090b;
10
+ --panel-bg: rgba(24, 24, 27, 0.8);
11
+ --border: #27272a;
12
+ --text: #e4e4e7;
13
+ --text-dim: #a1a1aa;
14
+ --critical: #ef4444;
15
+ --high: #f97316;
16
+ --medium: #eab308;
17
+ --low: #3b82f6;
18
+ --edge: rgba(255, 255, 255, 0.1);
19
+ }
20
+ body {
21
+ margin: 0;
22
+ padding: 0;
23
+ background: var(--bg);
24
+ color: var(--text);
25
+ font-family: system-ui, -apple-system, sans-serif;
26
+ overflow: hidden;
27
+ }
28
+ canvas {
29
+ display: block;
30
+ width: 100vw;
31
+ height: 100vh;
32
+ }
33
+ #ui-panel {
34
+ position: absolute;
35
+ top: 20px;
36
+ left: 20px;
37
+ width: 320px;
38
+ background: var(--panel-bg);
39
+ backdrop-filter: blur(12px);
40
+ border: 1px solid var(--border);
41
+ border-radius: 12px;
42
+ padding: 20px;
43
+ box-shadow: 0 10px 30px rgba(0,0,0,0.5);
44
+ pointer-events: none; /* Let clicks pass to canvas if not on panel */
45
+ }
46
+ h1 { margin: 0 0 10px 0; font-size: 1.2rem; font-weight: 600; }
47
+ .stat { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 0.9rem; }
48
+ .stat .val { font-family: monospace; color: white; }
49
+ .legend { margin-top: 20px; display: grid; gap: 8px; font-size: 0.85rem; }
50
+ .legend-item { display: flex; align-items: center; gap: 8px; }
51
+ .dot { width: 10px; height: 10px; border-radius: 50%; }
52
+
53
+ #node-details {
54
+ margin-top: 20px;
55
+ padding-top: 20px;
56
+ border-top: 1px solid var(--border);
57
+ display: none;
58
+ pointer-events: auto;
59
+ }
60
+ #node-details h2 { margin: 0 0 10px 0; font-size: 1rem; word-break: break-all; }
61
+ .detail-row { font-size: 0.85rem; margin-bottom: 4px; color: var(--text-dim); }
62
+ .badge { display: inline-block; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; color: black; }
63
+ ul { margin: 8px 0; padding-left: 20px; font-size: 0.85rem; color: var(--text-dim); max-height: 150px; overflow-y: auto; }
64
+ </style>
65
+ </head>
66
+ <body>
67
+
68
+ <canvas id="graph"></canvas>
69
+
70
+ <div id="ui-panel">
71
+ <h1>Tribunal Architecture</h1>
72
+ <div class="stat"><span>Nodes</span><span class="val" id="stat-nodes">0</span></div>
73
+ <div class="stat"><span>Edges</span><span class="val" id="stat-edges">0</span></div>
74
+
75
+ <div class="legend">
76
+ <div class="legend-item"><div class="dot" style="background: var(--critical)"></div> Critical (>10 dependents)</div>
77
+ <div class="legend-item"><div class="dot" style="background: var(--high)"></div> High (5-10 dependents)</div>
78
+ <div class="legend-item"><div class="dot" style="background: var(--medium)"></div> Medium (2-4 dependents)</div>
79
+ <div class="legend-item"><div class="dot" style="background: var(--low)"></div> Low (0-1 dependents)</div>
80
+ </div>
81
+
82
+ <div id="node-details">
83
+ <h2 id="nd-title">file.js</h2>
84
+ <div class="detail-row">Risk Score: <span id="nd-risk" class="badge">Low</span></div>
85
+ <div class="detail-row">Blast Radius: <span id="nd-blast" style="color:white;font-weight:bold">0</span> files</div>
86
+ <div class="detail-row" style="margin-top:10px">Imports:</div>
87
+ <ul id="nd-imports"></ul>
88
+ <div class="detail-row">Dependents:</div>
89
+ <ul id="nd-dependents"></ul>
90
+ </div>
91
+ </div>
92
+
93
+ <script>
94
+ const rawData = JSON.parse(decodeURIComponent("%7B%0A%20%20%22bin%2Ftribunal-kit.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201777189133916.1414%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22https%22%2C%0A%20%20%20%20%20%20%22child_process%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%0A%20%20%20%20%20%20%22parseArgs%22%2C%0A%20%20%20%20%20%20%22compareSemver%22%2C%0A%20%20%20%20%20%20%22copyDir%22%2C%0A%20%20%20%20%20%20%22countDir%22%2C%0A%20%20%20%20%20%20%22isSelfInstall%22%2C%0A%20%20%20%20%20%20%22CORE_AGENTS%22%2C%0A%20%20%20%20%20%20%22CORE_SKILLS%22%2C%0A%20%20%20%20%20%20%22generateIDEBridges%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%0A%20%20%20%20%20%20%22test%2Funit%2Fargs.test.js%22%2C%0A%20%20%20%20%20%20%22test%2Funit%2FcopyDir.test.js%22%2C%0A%20%20%20%20%20%20%22test%2Funit%2FselfInstall.test.js%22%2C%0A%20%20%20%20%20%20%22test%2Funit%2Fsemver.test.js%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Medium%22%2C%0A%20%20%20%20%22blastRadius%22%3A%204%0A%20%20%7D%2C%0A%20%20%22migrate_refs.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776601517571.4077%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22scripts%2Fchangelog.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776707395005.7876%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22child_process%22%2C%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22scripts%2Fsync-version.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776539656195.906%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22scripts%2Fvalidate-payload.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201777143609713.3955%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Fintegration%2Fbridges.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543968182.8357%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22child_process%22%2C%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22os%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Fintegration%2Finit.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543898784.1787%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22child_process%22%2C%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22os%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Fintegration%2Frouting.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543898785.1748%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22fs%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Fintegration%2Fswarm_dispatcher.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776601326063.697%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22os%22%2C%0A%20%20%20%20%20%20%22..%2F..%2F.agent%2Fscripts%2Fswarm_dispatcher.js%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Fintegration%2Fwave2.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776602944314.9893%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22..%2F..%2F.agent%2Fscripts%2Fskill_integrator.js%22%2C%0A%20%20%20%20%20%20%22..%2F..%2F.agent%2Fscripts%2Fskill_evolution.js%22%2C%0A%20%20%20%20%20%20%22..%2F..%2F.agent%2Fscripts%2Fcase_law_manager.js%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2Fargs.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543898786.9612%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22..%2F..%2Fbin%2Ftribunal-kit%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2Fcase_law_manager.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201777143609717.9287%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22..%2F..%2F.agent%2Fscripts%2Fcase_law_manager%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2FcopyDir.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543898787.971%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22os%22%2C%0A%20%20%20%20%20%20%22..%2F..%2Fbin%2Ftribunal-kit%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2Fgraph_tools.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201777143609718.4546%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22path%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2FselfInstall.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543898788.9712%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22fs%22%2C%0A%20%20%20%20%20%20%22os%22%2C%0A%20%20%20%20%20%20%22..%2F..%2Fbin%2Ftribunal-kit%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2Fsemver.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201776543898789.971%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22..%2F..%2Fbin%2Ftribunal-kit%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%2C%0A%20%20%22test%2Funit%2Fswarm_dispatcher.test.js%22%3A%20%7B%0A%20%20%20%20%22mtimeMs%22%3A%201777143609719.6228%2C%0A%20%20%20%20%22imports%22%3A%20%5B%0A%20%20%20%20%20%20%22path%22%2C%0A%20%20%20%20%20%20%22fs%22%0A%20%20%20%20%5D%2C%0A%20%20%20%20%22exports%22%3A%20%5B%5D%2C%0A%20%20%20%20%22dependents%22%3A%20%5B%5D%2C%0A%20%20%20%20%22riskScore%22%3A%20%22Low%22%2C%0A%20%20%20%20%22blastRadius%22%3A%200%0A%20%20%7D%0A%7D"));
95
+
96
+ const nodes = [];
97
+ const edges = [];
98
+ const nodeMap = new Map();
99
+
100
+ // Build Nodes
101
+ Object.keys(rawData).forEach(file => {
102
+ const info = rawData[file];
103
+ const node = {
104
+ id: file,
105
+ imports: info.imports || [],
106
+ dependents: info.dependents || [],
107
+ riskScore: info.riskScore || 'Low',
108
+ blastRadius: info.blastRadius || 0,
109
+ x: Math.random() * window.innerWidth,
110
+ y: Math.random() * window.innerHeight,
111
+ vx: 0,
112
+ vy: 0,
113
+ radius: Math.min(20, Math.max(5, 5 + (info.blastRadius * 1.5)))
114
+ };
115
+
116
+ if (node.riskScore === 'Critical') node.color = '#ef4444';
117
+ else if (node.riskScore === 'High') node.color = '#f97316';
118
+ else if (node.riskScore === 'Medium') node.color = '#eab308';
119
+ else node.color = '#3b82f6';
120
+
121
+ nodes.push(node);
122
+ nodeMap.set(file, node);
123
+ });
124
+
125
+ // Build Edges
126
+ nodes.forEach(node => {
127
+ node.imports.forEach(imp => {
128
+ if (imp.startsWith('.')) {
129
+ // Try to resolve
130
+ const dir = node.id.split('/').slice(0, -1).join('/');
131
+ let resolved = dir ? dir + '/' + imp.replace('./', '') : imp.replace('./', '');
132
+
133
+ // Normalize standard paths relative to array
134
+ let target = nodes.find(n => n.id === resolved || n.id === resolved + '.js' || n.id === resolved + '.ts');
135
+ if (target) {
136
+ edges.push({ source: node, target: target });
137
+ }
138
+ }
139
+ });
140
+ });
141
+
142
+ document.getElementById('stat-nodes').innerText = nodes.length;
143
+ document.getElementById('stat-edges').innerText = edges.length;
144
+
145
+ // Force Directed Graph Simulation
146
+ const canvas = document.getElementById('graph');
147
+ const ctx = canvas.getContext('2d');
148
+
149
+ function resize() {
150
+ canvas.width = window.innerWidth;
151
+ canvas.height = window.innerHeight;
152
+ }
153
+ window.addEventListener('resize', resize);
154
+ resize();
155
+
156
+ let hoveredNode = null;
157
+ let selectedNode = null;
158
+ let isDragging = false;
159
+
160
+ // Physics constants
161
+ const REPULSION = 2000;
162
+ const SPRING_LENGTH = 100;
163
+ const SPRING_STRENGTH = 0.05;
164
+ const DAMPING = 0.85;
165
+
166
+ function simulate() {
167
+ // Repulsion
168
+ for (let i = 0; i < nodes.length; i++) {
169
+ for (let j = i + 1; j < nodes.length; j++) {
170
+ const n1 = nodes[i];
171
+ const n2 = nodes[j];
172
+ const dx = n2.x - n1.x;
173
+ const dy = n2.y - n1.y;
174
+ let dist = Math.sqrt(dx*dx + dy*dy) || 1;
175
+ if (dist < 300) {
176
+ const force = REPULSION / (dist * dist);
177
+ const fx = (dx / dist) * force;
178
+ const fy = (dy / dist) * force;
179
+ n1.vx -= fx;
180
+ n1.vy -= fy;
181
+ n2.vx += fx;
182
+ n2.vy += fy;
183
+ }
184
+ }
185
+ }
186
+
187
+ // Attraction (Springs)
188
+ edges.forEach(edge => {
189
+ const dx = edge.target.x - edge.source.x;
190
+ const dy = edge.target.y - edge.source.y;
191
+ const dist = Math.sqrt(dx*dx + dy*dy) || 1;
192
+ const force = (dist - SPRING_LENGTH) * SPRING_STRENGTH;
193
+ const fx = (dx / dist) * force;
194
+ const fy = (dy / dist) * force;
195
+
196
+ edge.source.vx += fx;
197
+ edge.source.vy += fy;
198
+ edge.target.vx -= fx;
199
+ edge.target.vy -= fy;
200
+ });
201
+
202
+ // Center gravity
203
+ const cx = canvas.width / 2;
204
+ const cy = canvas.height / 2;
205
+ nodes.forEach(n => {
206
+ n.vx += (cx - n.x) * 0.01;
207
+ n.vy += (cy - n.y) * 0.01;
208
+ });
209
+
210
+ // Update positions
211
+ nodes.forEach(n => {
212
+ if (n === selectedNode && isDragging) return; // don't move dragged node
213
+ n.vx *= DAMPING;
214
+ n.vy *= DAMPING;
215
+ n.x += n.vx;
216
+ n.y += n.vy;
217
+ });
218
+ }
219
+
220
+ function draw() {
221
+ ctx.clearRect(0, 0, canvas.width, canvas.height);
222
+
223
+ // Draw edges
224
+ ctx.lineWidth = 1;
225
+ edges.forEach(edge => {
226
+ let isHighlighted = false;
227
+ if (hoveredNode) {
228
+ isHighlighted = (edge.source === hoveredNode || edge.target === hoveredNode);
229
+ } else if (selectedNode) {
230
+ isHighlighted = (edge.source === selectedNode || edge.target === selectedNode);
231
+ }
232
+
233
+ if (hoveredNode || selectedNode) {
234
+ ctx.strokeStyle = isHighlighted ? 'rgba(255,255,255,0.8)' : 'rgba(255,255,255,0.05)';
235
+ ctx.lineWidth = isHighlighted ? 2 : 1;
236
+ } else {
237
+ ctx.strokeStyle = 'rgba(255,255,255,0.15)';
238
+ ctx.lineWidth = 1;
239
+ }
240
+
241
+ ctx.beginPath();
242
+ ctx.moveTo(edge.source.x, edge.source.y);
243
+ ctx.lineTo(edge.target.x, edge.target.y);
244
+ ctx.stroke();
245
+ });
246
+
247
+ // Draw nodes
248
+ nodes.forEach(n => {
249
+ let opacity = 1;
250
+ if (hoveredNode && n !== hoveredNode && !edges.some(e => (e.source===hoveredNode && e.target===n) || (e.target===hoveredNode && e.source===n))) {
251
+ opacity = 0.2;
252
+ } else if (selectedNode && !hoveredNode && n !== selectedNode && !edges.some(e => (e.source===selectedNode && e.target===n) || (e.target===selectedNode && e.source===n))) {
253
+ opacity = 0.2;
254
+ }
255
+
256
+ ctx.beginPath();
257
+ ctx.arc(n.x, n.y, n.radius, 0, Math.PI * 2);
258
+ ctx.fillStyle = n.color;
259
+ ctx.globalAlpha = opacity;
260
+ ctx.fill();
261
+
262
+ if (n === hoveredNode || n === selectedNode) {
263
+ ctx.strokeStyle = '#fff';
264
+ ctx.lineWidth = 2;
265
+ ctx.stroke();
266
+
267
+ ctx.globalAlpha = 1;
268
+ ctx.fillStyle = '#fff';
269
+ ctx.font = '12px system-ui';
270
+ ctx.fillText(n.id.split('/').pop(), n.x + n.radius + 5, n.y + 4);
271
+ }
272
+ ctx.globalAlpha = 1;
273
+ });
274
+ }
275
+
276
+ function loop() {
277
+ simulate();
278
+ draw();
279
+ requestAnimationFrame(loop);
280
+ }
281
+ loop();
282
+
283
+ // Interaction
284
+ canvas.addEventListener('mousemove', e => {
285
+ const rect = canvas.getBoundingClientRect();
286
+ const mx = e.clientX - rect.left;
287
+ const my = e.clientY - rect.top;
288
+
289
+ if (isDragging && selectedNode) {
290
+ selectedNode.x = mx;
291
+ selectedNode.y = my;
292
+ return;
293
+ }
294
+
295
+ hoveredNode = null;
296
+ for (let i = nodes.length - 1; i >= 0; i--) {
297
+ const n = nodes[i];
298
+ const dx = mx - n.x;
299
+ const dy = my - n.y;
300
+ if (dx*dx + dy*dy < (n.radius + 5)**2) {
301
+ hoveredNode = n;
302
+ break;
303
+ }
304
+ }
305
+ canvas.style.cursor = hoveredNode ? 'pointer' : 'default';
306
+ });
307
+
308
+ canvas.addEventListener('mousedown', e => {
309
+ if (hoveredNode) {
310
+ selectedNode = hoveredNode;
311
+ isDragging = true;
312
+ showDetails(selectedNode);
313
+ } else {
314
+ selectedNode = null;
315
+ document.getElementById('node-details').style.display = 'none';
316
+ }
317
+ });
318
+
319
+ canvas.addEventListener('mouseup', () => { isDragging = false; });
320
+
321
+ function showDetails(n) {
322
+ const panel = document.getElementById('node-details');
323
+ panel.style.display = 'block';
324
+ document.getElementById('nd-title').innerText = n.id;
325
+
326
+ const riskEl = document.getElementById('nd-risk');
327
+ riskEl.innerText = n.riskScore;
328
+ riskEl.style.backgroundColor = n.color;
329
+
330
+ document.getElementById('nd-blast').innerText = n.blastRadius;
331
+
332
+ const importsUl = document.getElementById('nd-imports');
333
+ importsUl.innerHTML = '';
334
+ n.imports.forEach(i => {
335
+ const li = document.createElement('li');
336
+ li.innerText = i;
337
+ importsUl.appendChild(li);
338
+ });
339
+ if(n.imports.length===0) importsUl.innerHTML = '<li>None</li>';
340
+
341
+ const depsUl = document.getElementById('nd-dependents');
342
+ depsUl.innerHTML = '';
343
+ n.dependents.forEach(d => {
344
+ const li = document.createElement('li');
345
+ li.innerText = d;
346
+ depsUl.appendChild(li);
347
+ });
348
+ if(n.dependents.length===0) depsUl.innerHTML = '<li>None</li>';
349
+ }
350
+ </script>
351
+ </body>
352
+ </html>
@@ -0,0 +1,109 @@
1
+ # Auto-generated Architecture Graph by Tribunal Kit
2
+ # DO NOT EDIT MANUALLY - Auto-updates via incremental cache
3
+
4
+ "migrate_refs.js":
5
+ riskScore: "Low"
6
+ blastRadius: 0
7
+ imports:
8
+ - "fs"
9
+ - "path"
10
+ "scripts/changelog.js":
11
+ riskScore: "Low"
12
+ blastRadius: 0
13
+ imports:
14
+ - "child_process"
15
+ - "fs"
16
+ - "path"
17
+ "scripts/sync-version.js":
18
+ riskScore: "Low"
19
+ blastRadius: 0
20
+ imports:
21
+ - "fs"
22
+ - "path"
23
+ "scripts/validate-payload.js":
24
+ riskScore: "Low"
25
+ blastRadius: 0
26
+ imports:
27
+ - "fs"
28
+ - "path"
29
+ "test/integration/bridges.test.js":
30
+ riskScore: "Low"
31
+ blastRadius: 0
32
+ imports:
33
+ - "child_process"
34
+ - "path"
35
+ - "fs"
36
+ - "os"
37
+ "test/integration/init.test.js":
38
+ riskScore: "Low"
39
+ blastRadius: 0
40
+ imports:
41
+ - "child_process"
42
+ - "path"
43
+ - "fs"
44
+ - "os"
45
+ "test/integration/routing.test.js":
46
+ riskScore: "Low"
47
+ blastRadius: 0
48
+ imports:
49
+ - "path"
50
+ - "fs"
51
+ "test/integration/swarm_dispatcher.test.js":
52
+ riskScore: "Low"
53
+ blastRadius: 0
54
+ imports:
55
+ - "path"
56
+ - "fs"
57
+ - "os"
58
+ - "../../.agent/scripts/swarm_dispatcher.js"
59
+ "test/integration/wave2.test.js":
60
+ riskScore: "Low"
61
+ blastRadius: 0
62
+ imports:
63
+ - "fs"
64
+ - "../../.agent/scripts/skill_integrator.js"
65
+ - "../../.agent/scripts/skill_evolution.js"
66
+ - "../../.agent/scripts/case_law_manager.js"
67
+ "test/unit/args.test.js":
68
+ riskScore: "Low"
69
+ blastRadius: 0
70
+ imports:
71
+ - "../../bin/tribunal-kit"
72
+ "test/unit/case_law_manager.test.js":
73
+ riskScore: "Low"
74
+ blastRadius: 0
75
+ imports:
76
+ - "../../.agent/scripts/case_law_manager"
77
+ "test/unit/copyDir.test.js":
78
+ riskScore: "Low"
79
+ blastRadius: 0
80
+ imports:
81
+ - "fs"
82
+ - "path"
83
+ - "os"
84
+ - "../../bin/tribunal-kit"
85
+ "test/unit/graph_tools.test.js":
86
+ riskScore: "Low"
87
+ blastRadius: 0
88
+ imports:
89
+ - "fs"
90
+ - "path"
91
+ "test/unit/selfInstall.test.js":
92
+ riskScore: "Low"
93
+ blastRadius: 0
94
+ imports:
95
+ - "path"
96
+ - "fs"
97
+ - "os"
98
+ - "../../bin/tribunal-kit"
99
+ "test/unit/semver.test.js":
100
+ riskScore: "Low"
101
+ blastRadius: 0
102
+ imports:
103
+ - "../../bin/tribunal-kit"
104
+ "test/unit/swarm_dispatcher.test.js":
105
+ riskScore: "Low"
106
+ blastRadius: 0
107
+ imports:
108
+ - "path"
109
+ - "fs"
@@ -0,0 +1,215 @@
1
+ {
2
+ "bin/tribunal-kit.js": {
3
+ "mtimeMs": 1777189133916.1414,
4
+ "imports": [
5
+ "fs",
6
+ "path",
7
+ "https",
8
+ "child_process"
9
+ ],
10
+ "exports": [
11
+ "parseArgs",
12
+ "compareSemver",
13
+ "copyDir",
14
+ "countDir",
15
+ "isSelfInstall",
16
+ "CORE_AGENTS",
17
+ "CORE_SKILLS",
18
+ "generateIDEBridges"
19
+ ],
20
+ "dependents": [
21
+ "test/unit/args.test.js",
22
+ "test/unit/copyDir.test.js",
23
+ "test/unit/selfInstall.test.js",
24
+ "test/unit/semver.test.js"
25
+ ],
26
+ "riskScore": "Medium",
27
+ "blastRadius": 4
28
+ },
29
+ "migrate_refs.js": {
30
+ "mtimeMs": 1776601517571.4077,
31
+ "imports": [
32
+ "fs",
33
+ "path"
34
+ ],
35
+ "exports": [],
36
+ "dependents": [],
37
+ "riskScore": "Low",
38
+ "blastRadius": 0
39
+ },
40
+ "scripts/changelog.js": {
41
+ "mtimeMs": 1776707395005.7876,
42
+ "imports": [
43
+ "child_process",
44
+ "fs",
45
+ "path"
46
+ ],
47
+ "exports": [],
48
+ "dependents": [],
49
+ "riskScore": "Low",
50
+ "blastRadius": 0
51
+ },
52
+ "scripts/sync-version.js": {
53
+ "mtimeMs": 1776539656195.906,
54
+ "imports": [
55
+ "fs",
56
+ "path"
57
+ ],
58
+ "exports": [],
59
+ "dependents": [],
60
+ "riskScore": "Low",
61
+ "blastRadius": 0
62
+ },
63
+ "scripts/validate-payload.js": {
64
+ "mtimeMs": 1777143609713.3955,
65
+ "imports": [
66
+ "fs",
67
+ "path"
68
+ ],
69
+ "exports": [],
70
+ "dependents": [],
71
+ "riskScore": "Low",
72
+ "blastRadius": 0
73
+ },
74
+ "test/integration/bridges.test.js": {
75
+ "mtimeMs": 1776543968182.8357,
76
+ "imports": [
77
+ "child_process",
78
+ "path",
79
+ "fs",
80
+ "os"
81
+ ],
82
+ "exports": [],
83
+ "dependents": [],
84
+ "riskScore": "Low",
85
+ "blastRadius": 0
86
+ },
87
+ "test/integration/init.test.js": {
88
+ "mtimeMs": 1776543898784.1787,
89
+ "imports": [
90
+ "child_process",
91
+ "path",
92
+ "fs",
93
+ "os"
94
+ ],
95
+ "exports": [],
96
+ "dependents": [],
97
+ "riskScore": "Low",
98
+ "blastRadius": 0
99
+ },
100
+ "test/integration/routing.test.js": {
101
+ "mtimeMs": 1776543898785.1748,
102
+ "imports": [
103
+ "path",
104
+ "fs"
105
+ ],
106
+ "exports": [],
107
+ "dependents": [],
108
+ "riskScore": "Low",
109
+ "blastRadius": 0
110
+ },
111
+ "test/integration/swarm_dispatcher.test.js": {
112
+ "mtimeMs": 1776601326063.697,
113
+ "imports": [
114
+ "path",
115
+ "fs",
116
+ "os",
117
+ "../../.agent/scripts/swarm_dispatcher.js"
118
+ ],
119
+ "exports": [],
120
+ "dependents": [],
121
+ "riskScore": "Low",
122
+ "blastRadius": 0
123
+ },
124
+ "test/integration/wave2.test.js": {
125
+ "mtimeMs": 1776602944314.9893,
126
+ "imports": [
127
+ "fs",
128
+ "../../.agent/scripts/skill_integrator.js",
129
+ "../../.agent/scripts/skill_evolution.js",
130
+ "../../.agent/scripts/case_law_manager.js"
131
+ ],
132
+ "exports": [],
133
+ "dependents": [],
134
+ "riskScore": "Low",
135
+ "blastRadius": 0
136
+ },
137
+ "test/unit/args.test.js": {
138
+ "mtimeMs": 1776543898786.9612,
139
+ "imports": [
140
+ "../../bin/tribunal-kit"
141
+ ],
142
+ "exports": [],
143
+ "dependents": [],
144
+ "riskScore": "Low",
145
+ "blastRadius": 0
146
+ },
147
+ "test/unit/case_law_manager.test.js": {
148
+ "mtimeMs": 1777143609717.9287,
149
+ "imports": [
150
+ "../../.agent/scripts/case_law_manager"
151
+ ],
152
+ "exports": [],
153
+ "dependents": [],
154
+ "riskScore": "Low",
155
+ "blastRadius": 0
156
+ },
157
+ "test/unit/copyDir.test.js": {
158
+ "mtimeMs": 1776543898787.971,
159
+ "imports": [
160
+ "fs",
161
+ "path",
162
+ "os",
163
+ "../../bin/tribunal-kit"
164
+ ],
165
+ "exports": [],
166
+ "dependents": [],
167
+ "riskScore": "Low",
168
+ "blastRadius": 0
169
+ },
170
+ "test/unit/graph_tools.test.js": {
171
+ "mtimeMs": 1777143609718.4546,
172
+ "imports": [
173
+ "fs",
174
+ "path"
175
+ ],
176
+ "exports": [],
177
+ "dependents": [],
178
+ "riskScore": "Low",
179
+ "blastRadius": 0
180
+ },
181
+ "test/unit/selfInstall.test.js": {
182
+ "mtimeMs": 1776543898788.9712,
183
+ "imports": [
184
+ "path",
185
+ "fs",
186
+ "os",
187
+ "../../bin/tribunal-kit"
188
+ ],
189
+ "exports": [],
190
+ "dependents": [],
191
+ "riskScore": "Low",
192
+ "blastRadius": 0
193
+ },
194
+ "test/unit/semver.test.js": {
195
+ "mtimeMs": 1776543898789.971,
196
+ "imports": [
197
+ "../../bin/tribunal-kit"
198
+ ],
199
+ "exports": [],
200
+ "dependents": [],
201
+ "riskScore": "Low",
202
+ "blastRadius": 0
203
+ },
204
+ "test/unit/swarm_dispatcher.test.js": {
205
+ "mtimeMs": 1777143609719.6228,
206
+ "imports": [
207
+ "path",
208
+ "fs"
209
+ ],
210
+ "exports": [],
211
+ "dependents": [],
212
+ "riskScore": "Low",
213
+ "blastRadius": 0
214
+ }
215
+ }