Spaces:
Running
Running
File size: 35,313 Bytes
111b0a8 f3e16bc 111b0a8 f3e16bc 0a3aaab f3e16bc 3523b8e 5684452 55e5019 5684452 f3e16bc 5c76c33 54cac00 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 0a3aaab 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 f3e16bc 111b0a8 f3e16bc 0a3aaab 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 5c76c33 f3e16bc 111b0a8 f3e16bc 0a3aaab f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 111b0a8 f3e16bc 0a3aaab f3e16bc 111b0a8 f3e16bc 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e b5398aa 111b0a8 b5398aa 111b0a8 b5398aa 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e b5398aa 3523b8e b5398aa 111b0a8 b5398aa 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e 111b0a8 3523b8e b5398aa 3523b8e b5398aa 3523b8e 111b0a8 b5398aa 111b0a8 b5398aa 3523b8e 111b0a8 b5398aa 3523b8e 111b0a8 3523b8e f3e16bc 111b0a8 f3e16bc 3523b8e f3e16bc 111b0a8 f3e16bc 0a3aaab 5684452 55e5019 f3e16bc | 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 | <!DOCTYPE html>
<html lang="en"><head>
<meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1">
<title>Governed Distributed Compute Fabric · a11oy</title>
<meta name="description" content="The Governed Distributed Compute Fabric — one unified system-of-systems view. Sovereign signal. Signed receipt. No node left dark. Sovereign GPU mesh under one governed router, honest TCP reachability, joules MEASURED per node, doctrine-locked. Terrestrial-proven core; orbital is a clearly-labeled ROADMAP frame. 0 runtime CDN.">
<!-- SZL Estate shared modules (byte-identical cross-app), served in-image at /static/shared (0 CDN). -->
<script src="/static/shared/szl_label_engine.js"></script>
<script src="/static/shared/szl_holo3d.js"></script>
<style>
:root{--bg:#0b0e14;--card:#121826;--ink:#e8eef7;--mut:#8aa0bf;--acc:#5ad1c0;--acc2:#7aa2ff;--line:#243149;--warn:#e0c060;--bad:#ff5c5c;--ok:#16c784;--orbit:#b07cff}
*{box-sizing:border-box}
body{margin:0;font:15px/1.55 -apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;background:var(--bg);color:var(--ink)}
.wrap{max-width:1180px;margin:0 auto;padding:30px 20px 96px}
h1{font-size:28px;margin:0 0 4px;letter-spacing:.2px}
h2{font-size:18px;margin:34px 0 10px;border-bottom:1px solid var(--line);padding-bottom:6px}
.sub{color:var(--mut);margin:0 0 14px}
.card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:16px 18px;margin:14px 0}
code{background:#0a1626;padding:1px 5px;border-radius:5px;color:var(--acc);font-size:12px}
a{color:var(--acc);text-decoration:none}a:hover{text-decoration:underline}
nav a{margin-right:14px;font-weight:600}
.note{color:var(--mut);font-size:13px}
.foot{margin-top:40px;color:var(--mut);font-size:12px;border-top:1px solid var(--line);padding-top:14px}
table{width:100%;border-collapse:collapse;font-size:13px}
th,td{text-align:left;padding:7px 9px;border-bottom:1px solid var(--line);vertical-align:top}
th{color:var(--mut);font-weight:600}
.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px}
.kpi{background:#0e1422;border:1px solid var(--line);border-radius:11px;padding:13px 15px}
.kpi .v{font:700 24px/1.1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--acc)}
.kpi .k{color:var(--mut);font-size:12px;margin-bottom:6px}
.kpi .l{margin-top:8px}
.holo{height:420px;width:100%;border-radius:12px;overflow:hidden;position:relative}
.legend{display:flex;flex-wrap:wrap;gap:14px;margin-top:10px;font-size:12px;color:var(--mut)}
.legend .sw{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:6px;vertical-align:middle}
.nodegrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(255px,1fr));gap:12px;margin-top:6px}
.nd{background:#0e1422;border:1px solid var(--line);border-radius:11px;padding:13px 15px}
.nd h3{margin:0 0 4px;font-size:15px}
.nd .ep{font:12px/1.4 ui-monospace,Menlo,Consolas,monospace;color:var(--mut);word-break:break-all}
.nd .row{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px;align-items:center}
.nd .joule{margin-top:9px;font:12px/1.3 ui-monospace,Menlo,Consolas,monospace;color:var(--ink)}
.dot{width:9px;height:9px;border-radius:50%;display:inline-block;margin-right:6px}
.dot.up{background:var(--ok)}.dot.down{background:var(--bad)}
.sov{font-size:11px;font-weight:700;letter-spacing:.04em}
.orbit{background:linear-gradient(180deg,#150d28 0%,#0e0a1c 100%);border:1px solid #3a2a5e;border-radius:12px;padding:16px 18px;margin:14px 0}
.orbit h2{color:#cdb4ff;border-bottom-color:#3a2a5e}
.orbit .band{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:8px}
.banner{display:inline-block;background:#2a1c47;border:1px solid #5a3fa0;color:#d9c6ff;font:800 12px/1 ui-monospace,Menlo,monospace;letter-spacing:.12em;padding:7px 12px;border-radius:8px;text-transform:uppercase}
.err{color:var(--bad);font-size:13px}
.muted-num{color:var(--mut)}
.hl{color:var(--acc2);font-weight:700}
.flow{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;padding:8px 0}
.flow .node{background:#16264a;border:1px solid var(--line);border-radius:10px;padding:8px 13px;font-weight:700;color:var(--acc2);font-size:13px}
.flow .arr{color:var(--mut);font-size:18px}
.refresh{background:var(--acc2);color:#06101f;border:0;border-radius:8px;padding:7px 13px;font-weight:700;cursor:pointer;font-size:13px}
.stamp{font:12px/1.3 ui-monospace,Menlo,monospace;color:var(--mut)}
/* --- Live-work panel (the fabric DOES verifiable work) --- */
.work{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:12px;margin-top:6px}
.wk{background:#0e1422;border:1px solid var(--line);border-radius:11px;padding:14px 16px;display:flex;flex-direction:column}
.wk h3{margin:0 0 3px;font-size:15px}
.wk .cap{color:var(--mut);font-size:12px;margin:0 0 10px}
.wk .state{margin-top:auto}
.wk .big{font:700 22px/1.15 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--acc);word-break:break-word}
.wk .sub2{color:var(--mut);font-size:12px;margin-top:4px}
.wk .receipt{font:11px/1.4 ui-monospace,Menlo,Consolas,monospace;color:var(--acc2);word-break:break-all;margin-top:7px}
.wk .pending{display:inline-block;background:#241c14;border:1px solid #4a3a1e;color:var(--warn);font:700 11px/1 ui-monospace,Menlo,monospace;letter-spacing:.06em;padding:6px 10px;border-radius:7px;text-transform:uppercase}
.wk .pending .why{font-weight:400;letter-spacing:0;text-transform:none;color:var(--mut);display:block;margin-top:5px}
.wk .qa{display:flex;gap:7px;margin-top:8px}
.wk .qa input{flex:1;background:#0a1626;border:1px solid var(--line);border-radius:8px;color:var(--ink);padding:7px 9px;font-size:13px}
.wk .qa button{background:var(--acc2);color:#06101f;border:0;border-radius:8px;padding:7px 12px;font-weight:700;cursor:pointer;font-size:13px}
.wk .qa button:disabled{opacity:.45;cursor:not-allowed}
.wk .ans{margin-top:9px;font-size:13px;color:var(--ink)}
.wk .cite{font:11px/1.4 ui-monospace,Menlo,Consolas,monospace;color:var(--mut);margin-top:6px;word-break:break-all}
.wk .lbls{margin-top:9px;display:flex;gap:6px;flex-wrap:wrap}
.wk hr{border:0;border-top:1px solid var(--line);margin:11px 0 0}
</style> <link rel="stylesheet" href="/assets/szl-flow.css" data-szl-flow-asset="style" />
<link rel="stylesheet" href="/assets/szl-holo-v2.css" data-szl-holo-asset="style-v2" />
</head>
<body><div class="wrap">
<nav class="note"><a href="/">home</a><a href="/mesh">/mesh</a><a href="/wires">/wires</a><a href="/observability">/observability</a><a href="/holo">/holo</a></nav>
<h1>Governed Distributed Compute Fabric</h1>
<p class="sub" style="font-weight:700;color:var(--acc);margin-bottom:6px">Sovereign signal. Signed receipt. No node left dark.</p>
<p class="sub">The <b>Governed Distributed Compute Fabric</b> as one unified system-of-systems view. Sovereign GPU mesh + honest TCP reachability + joules <b>MEASURED</b> per node + one governed OpenAI-compatible router + doctrine-locked provenance. <span class="hl">Terrestrial governed mesh is the proven core; orbital is a clearly-labeled ROADMAP frame.</span> Doctrine v11 · Λ = Conjecture 1 · 0 runtime CDN.</p>
<p class="note" style="margin:0 0 14px">The fabric unites your sovereign nodes — each request governed by the trust score (Λ), recorded in the signed-receipt ledger, and relayed under one governed router — into a single honest system-of-systems.</p>
<div class="card">
<div style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px">
<div class="note">Live sources (no fabrication): <code>/api/a11oy/v1/compute-pool-hardened</code> · <code>/api/a11oy/v1/energy/operator/status</code> · <code>/api/a11oy/v1/honest</code> · <code>/api/a11oy/provenance</code> · <span class="hl">live-work</span> (K-Verify · Govern-RAG · cheapest-watt, each probed independently, honestly PENDING until deployed)</div>
<button class="refresh" onclick="loadAll()">↻ refresh live</button>
</div>
<div class="stamp" id="stamp" style="margin-top:8px">loading live fabric state…</div>
</div>
<h2>1 · Fabric at a glance</h2>
<div class="card">
<div class="kpis" id="kpis"><div class="note">…</div></div>
<p class="note" style="margin-top:14px">Every figure is honestly labeled. <b>Reachability</b> is a real TCP probe THIS sweep — a timeout/refusal is reachable=false with the reason, never fabricated. <b>Joules</b> are MEASURED only via the on-box exporter (nodes with no exporter read SAMPLE / 0). <b>Sovereign</b> is a property of owned hardware, passed through, never inferred from reachability.</p>
</div>
<h2>2 · Live work — the fabric DOES verifiable work</h2>
<div class="card">
<p class="note" style="margin:0 0 12px">The mesh does not just <i>prove it exists</i> — it does governed, receipted work. Three new capabilities surface here <b>as they go live</b>. Each tile probes its own endpoint independently via <code>Promise.allSettled</code>: a capability that is not yet deployed renders an honest <span style="color:var(--warn);font-weight:700">PENDING</span> with the reason — <b>never a fabricated result</b>.</p>
<div class="work" id="work">
<div class="wk" id="wk-kverify">
<h3>K-Verify · governed inference</h3>
<p class="cap">A signed inference run over <code>k-verify-benchmark-v1</code>: N items, pass-rate, joules MEASURED, and a receipt hash you can verify.</p>
<div class="state" id="kv-state"><span class="pending">PENDING<span class="why">probing live endpoint…</span></span></div>
</div>
<div class="wk" id="wk-rag">
<h3>Govern-RAG · ask the doctrine</h3>
<p class="cap">Ask a question; the fabric answers <b>only</b> from its own governed corpus, with citations. No corpus hit = honest "insufficient grounding," never a guess.</p>
<div class="qa" id="rag-qa" style="display:none">
<input id="rag-q" type="text" placeholder="e.g. How many formulas are locked, and at what kernel?" autocomplete="off">
<button id="rag-ask" type="button" onclick="askRag()">ask</button>
</div>
<div class="state" id="rag-state"><span class="pending">PENDING<span class="why">probing live endpoint…</span></span></div>
</div>
<div class="wk" id="wk-watt">
<h3>Cheapest-watt routing · last decision</h3>
<p class="cap">The governed router places each job on the lowest-€/MWh reachable node. Savings are labeled <b>honestly</b> — MEASURED only where a meter exists, else MODELED.</p>
<div class="state" id="watt-state"><span class="pending">PENDING<span class="why">probing live endpoint…</span></span></div>
</div>
</div>
<p class="note" style="margin-top:12px">Honesty contract: a tile only shows a <b>result</b> when its endpoint actually returned one this sweep. Joules are <b>MEASURED</b> only on the on-box exporter node; routing savings are <b>MEASURED</b> where a meter exists and <b>MODELED</b> (clearly labeled) otherwise. Receipts are <b>tamper-EVIDENT</b> (SHA3 hash-chain), not tamper-proof. No fused VRAM is implied by any "work" shown here — placement is horizontal.</p>
</div>
<h2>3 · System-of-systems mesh (3D)</h2>
<div class="card">
<div class="holo" id="holo"></div>
<div class="legend">
<span><span class="sw" style="background:#16c784"></span>reachable (LIVE TCP probe)</span>
<span><span class="sw" style="background:#ff5c5c"></span>unreachable this sweep (honest)</span>
<span><span class="sw" style="background:#7aa2ff"></span>sovereign owned GPU/CPU</span>
<span><span class="sw" style="background:#e0c060"></span>hosted-inference failover (non-sovereign)</span>
</div>
<p class="note" style="margin-top:12px"><b>Scaling model — honest:</b> nodes scale <span class="hl">horizontally (placement + load-balance)</span> under one governed router. VRAM does <b>NOT</b> merge across the network — there is <b>no fused/combined VRAM</b>. The router places each job on a reachable node; it does not pool memory across machines.</p>
</div>
<h2>4 · Nodes — honest per-node board</h2>
<div class="nodegrid" id="nodes"><div class="note">…</div></div>
<h2>5 · Energy — joules MEASURED, climbing</h2>
<div class="card">
<div class="kpis" id="energy"><div class="note">…</div></div>
<table id="byNode" style="margin-top:14px"><tr><th>node</th><th>jobs</th><th>tokens</th><th>joules</th><th>label</th></tr></table>
<p class="note" style="margin-top:12px">Joules are MEASURED via the on-box exporter (node <code id="expnode">betterwithage</code>). Nodes without a local exporter contribute SAMPLE jobs (joules unmeasured) — shown honestly, never imputed. Signed receipts fold into the signed-receipt ledger: <code>/api/a11oy/v1/energy/provenance</code>.</p>
</div>
<h2>6 · Governed router + provenance</h2>
<div class="card">
<div class="flow">
<span class="node">request</span><span class="arr">→</span>
<span class="node">governed router</span><span class="arr">→</span>
<span class="node">placement (Λ-gated)</span><span class="arr">→</span>
<span class="node">sovereign node / failover</span><span class="arr">→</span>
<span class="node">signed receipt → ledger</span>
</div>
<div id="prov" class="note" style="margin-top:8px">…</div>
</div>
<div class="orbit">
<div class="band">
<span class="banner">Roadmap · orbital framing</span>
<span id="orbitBadge"></span>
</div>
<h2 style="margin-top:6px">7 · Orbital system-of-systems — ROADMAP / analogy (we do NOT run satellites)</h2>
<p class="note">The same governance primitives the terrestrial mesh PROVES on real metal — honest reachability, joules MEASURED per node, Λ-gated placement, signed-receipt provenance — are exactly what distributed / edge / <b>orbital</b> compute system-of-systems will require. <span style="color:#cdb4ff;font-weight:700">This band is the vision frame, clearly labeled ROADMAP.</span> SZL does <b>not</b> operate satellites; nothing in the mesh above is orbital. We prove on terrestrial metal what the orbital-architecture crowd only asserts.</p>
<div class="kpis" id="orbit">
<div class="kpi"><div class="k">Terrestrial governed mesh</div><div class="v" id="orbReach">—</div><div class="l" id="orbReachL"></div></div>
<div class="kpi"><div class="k">Per-node energy accounting</div><div class="v">joules</div><div class="l" id="orbJ"></div></div>
<div class="kpi"><div class="k">Edge / orbital placement</div><div class="v">vision</div><div class="l" id="orbRm"></div></div>
</div>
</div>
<div class="foot" id="foot">
HONEST: all numbers above carry an explicit label — LIVE (real backend wired) · MEASURED (on-box exporter) · MODELED (deterministic, labeled) · ROADMAP (vision, not deployed). No fused/combined VRAM is claimed anywhere — nodes scale horizontally (placement + load-balance); memory does not merge across the network. The <b>live-work</b> tiles surface a capability only when its endpoint returns a real result this sweep; otherwise they render an honest PENDING and never fabricate. Orbital is analogy/ROADMAP; SZL does not run satellites. Reachability is a real TCP probe, never fabricated. trust < 100% · tamper-EVIDENT not tamper-proof · Λ = Conjecture 1 · locked = 8 {F1,F4,F7,F11,F12,F18,F19,F22} @ kernel <code id="kernel">c7c0ba17</code> (749/14/163). SLSA L1 honest · L2 attested · L3 roadmap. Canonical numbers <a href="https://github.com/szl-holdings/.github/blob/main/.github/data/lean_numbers.json" target="_blank" rel="noopener">lean_numbers.json</a>.
</div>
</div>
<script>
"use strict";
var L = (window.SZLLabels && window.SZLLabels.badgeHTML) ? function(k,t){ return window.SZLLabels.badgeHTML(k, t?{label:t}:undefined); } : function(k,t){ return '<span class="szl-pill">'+(t||k)+'</span>'; };
function $(id){ return document.getElementById(id); }
function fmt(n){ if(n==null||isNaN(n)) return '—'; return Number(n).toLocaleString('en-US',{maximumFractionDigits:0}); }
function fmt1(n){ if(n==null||isNaN(n)) return '—'; return Number(n).toLocaleString('en-US',{maximumFractionDigits:1}); }
async function getJSON(url){ var r = await fetch(url, {headers:{'accept':'application/json'}}); if(!r.ok) throw new Error(url+' HTTP '+r.status); return r.json(); }
var holoScene = null;
function buildHolo(pool){
var mount = $('holo');
if(!window.SZLHolo || !window.SZLHolo.Scene){ mount.innerHTML = '<p class="note" style="padding:18px">3D kit unavailable — node board below carries the full honest state.</p>'; return; }
mount.innerHTML = '';
// λ here is a presentation parameter (Conjecture 1, <1.0), NOT a measured value.
holoScene = new window.SZLHolo.Scene(mount, { title: 'GOVERNED DISTRIBUTED COMPUTE FABRIC', lambda: 0.42, autoRotate: true });
var nodes = (pool.nodes||[]);
// hub = the governed router (the host running this service / hetzner-box-cpu self node anchors center)
var specNodes = [{ id:'router', label:'governed router', pos:[0,0,0], locked:true }];
var R = 1.15;
nodes.forEach(function(n, i){
var ang = (i / Math.max(1,nodes.length)) * Math.PI * 2;
var y = (n.kind === 'hosted-inference') ? 0.55 : -0.25; // failover ring sits above
specNodes.push({
id: n.name,
label: n.name + (n.reachable ? ' ✓' : ' ✕'),
pos: [R*Math.cos(ang), y, R*Math.sin(ang)],
// lower lambda => greener/larger (more trust); reachable+sovereign = most trusted
lambda: n.reachable ? (n.sovereign ? 0.22 : 0.40) : 0.80
});
});
var edges = nodes.map(function(n){ return { from:'router', to:n.name }; });
holoScene.addGraph({ nodes: specNodes, edges: edges });
// pulse the signed-receipt flow along the first reachable sovereign edge
holoScene.start();
// Override the SAMPLE HUD badge: this scene is bound to LIVE topology + MEASURED energy.
try {
var lbl = mount.querySelector('[data-szl-holo-labels]');
if(lbl){ lbl.innerHTML = L('LIVE','LIVE TOPOLOGY') + ' ' + L('MEASURED','JOULES MEASURED') + ' ' + L('ROADMAP','ORBITAL = ROADMAP'); }
} catch(e){}
}
function renderKpis(pool, energy){
var c = pool.counts || {};
var html = '';
html += kpi('Nodes total', fmt(c.nodes_total), L('LIVE'));
html += kpi('Reachable this sweep', fmt(c.nodes_reachable), L('LIVE','LIVE TCP PROBE'));
html += kpi('Sovereign GPU reachable', fmt(c.gpu_nodes_reachable), L('LIVE'));
html += kpi('Joules total', fmt(energy.joules_measured_total), L('MEASURED'));
html += kpi('Jobs completed', fmt(energy.jobs_completed||energy.jobs_done), L('MEASURED'));
html += kpi('Scaling', 'horizontal', L('MODELED','PLACEMENT + LB'));
$('kpis').innerHTML = html;
}
function kpi(k,v,label){ return '<div class="kpi"><div class="k">'+k+'</div><div class="v">'+v+'</div><div class="l">'+(label||'')+'</div></div>'; }
function renderNodes(pool, energy){
var byNode = energy.by_node || {};
var html = '';
(pool.nodes||[]).forEach(function(n){
var bn = byNode[n.name] || {};
var jmeas = bn.joules_measured;
var hasMeas = (typeof jmeas === 'number' && jmeas > 0);
var jLabel = hasMeas ? L('MEASURED') : L('SAMPLE','SAMPLE / NO EXPORTER');
var jVal = hasMeas ? (fmt1(jmeas)+' J') : '0 J (unmeasured)';
var sov = n.sovereign ? '<span class="sov" style="color:#7aa2ff">SOVEREIGN (owned)</span>' : '<span class="sov" style="color:#e0c060">HOSTED FAILOVER</span>';
var reach = n.reachable
? '<span><span class="dot up"></span>reachable</span> ' + L('LIVE','LIVE TCP')
: '<span><span class="dot down"></span>unreachable: '+(n.detail||'?')+'</span> ' + L('LIVE','HONEST');
html += '<div class="nd"><h3>'+n.name+'</h3>'+
'<div class="note">'+n.kind+'</div>'+
'<div class="ep">'+(n.endpoint||'')+'</div>'+
'<div class="row">'+reach+'</div>'+
'<div class="row">'+sov+'</div>'+
'<div class="joule">energy: '+jVal+' '+jLabel+
(bn.jobs!=null ? ' <span class="muted-num">· '+fmt(bn.jobs)+' jobs · '+fmt(bn.tokens)+' tok</span>' : '')+
'</div></div>';
});
$('nodes').innerHTML = html;
}
function renderEnergy(energy){
var html = '';
html += kpi('Joules MEASURED total', fmt(energy.joules_measured_total), L('MEASURED'));
html += kpi('Measured token-joules', fmt(energy.measured_token_joules), L('MEASURED'));
html += kpi('Measured jobs', fmt(energy.measured_jobs), L('MEASURED'));
html += kpi('Sample jobs (unmeasured)', fmt(energy.sample_jobs), L('SAMPLE'));
html += kpi('Grid price', fmt1(energy.grid_price_eur_mwh)+' €/MWh', L('LIVE'));
html += kpi('Power sample', fmt1(energy.power_w_sample)+' W', L('SAMPLE'));
$('energy').innerHTML = html;
if(energy.exporter_node) $('expnode').textContent = energy.exporter_node;
var bn = energy.by_node || {};
var rows = '<tr><th>node</th><th>jobs</th><th>tokens</th><th>joules</th><th>label</th></tr>';
Object.keys(bn).forEach(function(k){
var v = bn[k]; var has = (typeof v.joules_measured==='number' && v.joules_measured>0);
rows += '<tr><td><b>'+k+'</b></td><td>'+fmt(v.jobs)+'</td><td>'+fmt(v.tokens)+'</td><td>'+(has?fmt1(v.joules_measured)+' J':'0 (unmeasured)')+'</td><td>'+(has?L('MEASURED'):L('SAMPLE'))+'</td></tr>';
});
$('byNode').innerHTML = rows;
}
function renderProv(prov, honest){
var slsa = (honest && honest.footer) ? '' : '';
var dl = (honest && honest.doctrine_lock) || {};
var html = '';
html += '<p>SLSA: <b>'+(prov.slsa||'L1')+'</b> — L1 honest · L2 attested · L3 roadmap. '+L('LIVE')+' Λ = '+(dl.lambda||'Conjecture 1')+' '+L('LIVE','CONJECTURE 1')+'</p>';
if(prov.khipu_dsse){
html += '<p>Provenance per answer: signed-receipt substrate · keyid <code>'+(prov.khipu_dsse.keyid||'?')+'</code> · verify at <code>'+(prov.khipu_dsse.verify_endpoint||'/api/a11oy/v1/govern/verify')+'</code>. tamper-EVIDENT (SHA3-256 hash-chain), not tamper-proof.</p>';
}
if(dl.locked_formula_ids){
html += '<p>Doctrine lock: <code>'+(dl.declarations||749)+'/'+(dl.axioms||14)+'/'+(dl.sorries||163)+'</code> @ kernel <code>'+(dl.commit||'c7c0ba17')+'</code> · locked = '+(dl.locked_formula_count||8)+' {'+(dl.locked_formula_ids||[]).join(',')+'} '+L('LIVE')+'</p>';
if(dl.commit) $('kernel').textContent = dl.commit;
}
$('prov').innerHTML = html;
}
function renderOrbit(pool, energy){
var c = pool.counts || {};
$('orbitBadge').innerHTML = L('ROADMAP','VISION FRAME — NOT DEPLOYED');
$('orbReach').textContent = fmt(c.nodes_reachable) + '/' + fmt(c.nodes_total);
$('orbReachL').innerHTML = L('LIVE','PROVEN ON METAL');
$('orbJ').innerHTML = L('MEASURED','PER-NODE, REAL');
$('orbRm').innerHTML = L('ROADMAP','ANALOGY ONLY');
}
// ---- Live-work panel: probe each new capability honestly; render result OR honest PENDING ----
// Candidate endpoint lists — siblings (PowerD1-D4) may ship under any of these.
// We take the FIRST that returns valid JSON this sweep; if none do, we render PENDING.
var KV_EPS = ['/api/a11oy/v1/kverify/summary','/api/a11oy/v1/kverify/status','/api/a11oy/v1/k-verify/summary','/api/a11oy/v1/k-verify/status','/api/a11oy/v1/verify/run/last','/api/a11oy/v1/kverify/last'];
var RAG_EPS = ['/api/a11oy/v1/rag/status','/api/a11oy/v1/rag/last','/api/a11oy/v1/govern-rag/status','/api/a11oy/rag/status','/api/a11oy/v1/rag/health'];
var WATT_EPS = ['/api/a11oy/v1/energy/cheapest-watt','/api/a11oy/v1/routing/cheapest-watt','/api/a11oy/v1/energy/routing/last','/api/a11oy/v1/route/cheapest/last','/api/a11oy/v1/energy/routing/decision'];
var RAG_ASK_EPS = ['/api/a11oy/v1/rag/query','/api/a11oy/v1/rag/ask','/api/a11oy/v1/govern-rag/ask','/api/a11oy/rag/query'];
var RAG_ASK_URL = null; // resolved once a status probe identifies a live RAG surface
function pendingHTML(why){ return '<span class="pending">PENDING<span class="why">'+(why||'endpoint not yet live — shown honestly, not fabricated')+'</span></span>'; }
function shortHash(h){ if(!h) return null; h=String(h); return h.length>20 ? h.slice(0,10)+'…'+h.slice(-6) : h; }
// Try a list of endpoints; resolve with {url,data} of the first that returns ok JSON, else null.
async function firstLive(urls){
var settled = await Promise.allSettled(urls.map(function(u){ return getJSON(u).then(function(d){ return {url:u, data:d}; }); }));
for(var i=0;i<settled.length;i++){ if(settled[i].status==='fulfilled' && settled[i].value && settled[i].value.data) return settled[i].value; }
return null;
}
function renderKVerify(hit){
var el = $('kv-state');
if(!hit){ el.innerHTML = pendingHTML('K-Verify endpoint not live this sweep'); return false; }
var d = hit.data || {};
// Honest idle state: endpoint is LIVE but no run has executed yet this process.
// Surface that truthfully — never synthesize a zero-item "run" that didn't happen.
var runData = d.run || d.last_run || d.summary || d;
var hasRun = (d.ran === true) || (d.ran == null && (runData.n!=null || runData.count!=null || runData.items!=null || runData.total!=null || runData.pass!=null));
if(!hasRun){
el.innerHTML = '<div class="sub2"><b>endpoint live</b> '+L('LIVE','GOVERNED INFERENCE')+'</div>'+
'<div class="sub2">no run yet this process — a signed run posts N items, pass-rate, joules MEASURED + a receipt hash. Shown honestly: no fabricated run.</div>';
return true;
}
d = runData;
var n = (d.n!=null?d.n:(d.count!=null?d.count:(d.items!=null?d.items:(d.total!=null?d.total:null))));
var pass = (d.pass!=null?d.pass:(d.passed!=null?d.passed:(d.pass_count!=null?d.pass_count:null)));
var rate = (d.pass_rate!=null?d.pass_rate:(d.accuracy!=null?d.accuracy:null));
var joules= (d.joules_measured!=null?d.joules_measured:(d.joules!=null?d.joules:(d.measured_joules!=null?d.measured_joules:null)));
var jmeas = (d.joules_label==='MEASURED') || (typeof joules==='number' && joules>0 && d.joules_label!=='SAMPLE');
var rh = d.receipt_hash || d.receipt || d.digest || (d.receipt_digest) || ((d.khipu&&d.khipu.hash)||null);
var verify= d.verify_endpoint || d.receipt_verify_at || '/api/a11oy/khipu/verify';
if(rate==null && typeof pass==='number' && typeof n==='number' && n>0) rate = pass/n;
var passStr = (typeof pass==='number' && typeof n==='number') ? (fmt(pass)+'/'+fmt(n)) : (n!=null?fmt(n)+' items':'—');
var rateStr = (typeof rate==='number') ? (' · '+(rate*100).toFixed(1)+'% pass') : '';
var html = '<div class="big">'+passStr+'</div>';
html += '<div class="sub2">items run / passed'+rateStr+'</div>';
html += '<hr><div class="sub2">energy: <b>'+(joules!=null?fmt(joules)+' J':'—')+'</b> '+(jmeas?L('MEASURED'):L('SAMPLE'))+'</div>';
if(rh){ html += '<div class="receipt">receipt '+shortHash(rh)+'</div>'; html += '<div class="sub2">verify: <code>'+verify+'</code> '+L('LIVE')+'</div>'; }
html += '<div class="lbls">'+L('LIVE','GOVERNED INFERENCE')+'</div>';
el.innerHTML = html;
return true;
}
function renderRag(hit){
var el = $('rag-state'); var qa = $('rag-qa');
if(!hit){ qa.style.display='none'; el.innerHTML = pendingHTML('Govern-RAG endpoint not live this sweep — ask-box activates when it is'); RAG_ASK_URL=null; return false; }
var d = hit.data || {};
// Resolve an ask URL: explicit field, sibling of the status path, or default candidate.
RAG_ASK_URL = d.query_endpoint || d.ask_endpoint || hit.url.replace(/\/(status|health|last)$/,'/query') || RAG_ASK_EPS[0];
qa.style.display='flex';
var idx = d.index || {};
var chunks = idx.chunks || (d.corpus && d.corpus.chunks) || null;
var files = idx.files || null;
var repos = idx.repos || null;
var lastQ = d.last_question || (d.last && d.last.question) || null;
var lastA = d.last_answer || (d.last && d.last.answer) || d.answer || null;
var cites = d.citations || (d.last && d.last.citations) || d.sources || null;
var stat = [];
if(chunks!=null) stat.push(fmt(chunks)+' chunks');
if(files!=null) stat.push(fmt(files)+' files');
if(repos!=null) stat.push(fmt(repos)+' repos');
var html = '<div class="sub2">governed corpus indexed: <b>'+(stat.length?stat.join(' · '):'ready')+'</b> '+L('LIVE')+'</div>';
// Only show a 'last answer' if it carries a real grounded answer string (status citations are not answers).
if(lastA && typeof lastA==='string'){
html += '<div class="ans">'+(lastQ?'<b>Q:</b> '+escapeHTML(lastQ)+'<br>':'')+'<b>A:</b> '+escapeHTML(String(lastA))+'</div>';
if(cites && cites.length){ html += '<div class="cite">cited: '+cites.map(function(c){ return escapeHTML(typeof c==='string'?c:(c.citation||c.path||c.source||c.id||c.doc||JSON.stringify(c))); }).join(' · ')+'</div>'; }
html += '<div class="lbls">'+L('LIVE','GROUNDED + CITED')+'</div>';
} else {
html += '<div class="sub2">Ask the doctrine — answers come only from the governed corpus, with citations; off-corpus returns insufficient grounding.</div>';
}
el.innerHTML = html;
return true;
}
async function askRag(){
var q = ($('rag-q')||{}).value || ''; q = q.trim();
var btn = $('rag-ask'); var el = $('rag-state');
if(!q){ return; }
if(!RAG_ASK_URL){ el.innerHTML = pendingHTML('RAG query endpoint not live'); return; }
btn.disabled = true; var prev = el.innerHTML; el.innerHTML = '<div class="sub2">asking the governed corpus…</div>';
try {
var r = await fetch(RAG_ASK_URL, {method:'POST', headers:{'content-type':'application/json','accept':'application/json'}, body: JSON.stringify({question:q, query:q})});
if(!r.ok) throw new Error('HTTP '+r.status);
var d = await r.json();
var ans = d.answer || d.response || (d.last && d.last.answer) || null;
var cites = d.citations || d.sources || (d.last && d.last.citations) || null;
var grounded = (d.grounded!==false) && ans;
var html = '';
if(grounded){
html += '<div class="ans"><b>Q:</b> '+escapeHTML(q)+'<br><b>A:</b> '+escapeHTML(String(ans))+'</div>';
if(cites && cites.length){ html += '<div class="cite">cited: '+cites.map(function(c){ return escapeHTML(typeof c==='string'?c:(c.id||c.source||c.doc||JSON.stringify(c))); }).join(' · ')+'</div>'; }
html += '<div class="lbls">'+L('LIVE','GROUNDED + CITED')+'</div>';
} else {
html += '<div class="ans"><b>Q:</b> '+escapeHTML(q)+'<br><b>A:</b> insufficient grounding in the governed corpus — no answer returned.</div>';
html += '<div class="lbls">'+L('LIVE','HONEST: NO GUESS')+'</div>';
}
el.innerHTML = html;
} catch(e){
el.innerHTML = '<div class="err">RAG query error: '+escapeHTML(String(e))+'</div>';
} finally { btn.disabled = false; }
}
function renderWatt(hit){
var el = $('watt-state');
if(!hit){ el.innerHTML = pendingHTML('cheapest-watt routing endpoint not live this sweep'); return false; }
var d = hit.data || {};
// Real shape: latest_decision.decision (nested) -> recent_decisions[0] -> flat fallback.
var dec = (d.latest_decision && d.latest_decision.decision) || (d.recent_decisions && d.recent_decisions[0]) || d.decision || d.last || d;
if(typeof dec !== 'object' || dec === null) dec = d;
var node = dec.chosen_node || dec.node || dec.placed_on || dec.target || null;
var price = (dec.grid_price_eur_mwh!=null?dec.grid_price_eur_mwh:(dec.price_eur_mwh!=null?dec.price_eur_mwh:(dec.eur_mwh!=null?dec.eur_mwh:null)));
var priceL= dec.grid_price_label || 'MEASURED';
var save = (dec.saving!=null?dec.saving:(dec.savings_pct!=null?dec.savings_pct:(dec.savings_percent!=null?dec.savings_percent:null)));
var saveLabel = dec.saving_label || dec.savings_label || dec.label || null;
var reason = dec.reason || dec.detail || null;
var chHead = (d.chain && d.chain.head) || dec.receipt_hash || dec.receipt || dec.digest || null;
var html = '';
html += '<div class="big">'+(price!=null?fmt1(price)+' €/MWh':'—')+'</div>';
html += '<div class="sub2">live grid price at decision '+(priceL==='MEASURED'?L('MEASURED'):L('LIVE'))+'</div>';
if(node){
html += '<hr><div class="sub2">chosen node: <b>'+escapeHTML(node)+'</b> '+L('LIVE','LOWEST-€ REACHABLE')+'</div>';
if(save!=null){
var sv = (typeof save==='number') ? ((save<=1?(save*100):save).toFixed(1)+'%') : escapeHTML(String(save));
var lk = (saveLabel==='MEASURED') ? L('MEASURED') : L('MODELED','ROUTING LAW');
html += '<div class="sub2">honest savings vs most-expensive comparable: <b>'+sv+'</b> '+lk+'</div>';
}
} else {
// No placement this tick is an HONEST outcome, not a gap — surface the reason verbatim.
html += '<hr><div class="sub2"><b>no placement this tick</b> '+L('LIVE','HONEST: NO FABRICATED SAVING')+'</div>';
if(reason) html += '<div class="sub2">'+escapeHTML(reason)+'</div>';
}
if(chHead){ html += '<div class="receipt">receipt-chain '+shortHash(chHead)+(d.chain&&d.chain.length!=null?' · len '+fmt(d.chain.length):'')+'</div>'; }
el.innerHTML = html;
return true;
}
function escapeHTML(s){ return String(s).replace(/[&<>"']/g, function(c){ return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]; }); }
async function loadWork(){
var probes = await Promise.allSettled([ firstLive(KV_EPS), firstLive(RAG_EPS), firstLive(WATT_EPS) ]);
var kv = probes[0].status==='fulfilled' ? probes[0].value : null;
var rag = probes[1].status==='fulfilled' ? probes[1].value : null;
var watt = probes[2].status==='fulfilled' ? probes[2].value : null;
var live = 0;
if(renderKVerify(kv)) live++;
if(renderRag(rag)) live++;
if(renderWatt(watt)) live++;
return live;
}
async function loadAll(){
$('stamp').textContent = 'fetching live fabric state…';
try {
var results = await Promise.allSettled([
getJSON('/api/a11oy/v1/compute-pool-hardened'),
getJSON('/api/a11oy/v1/energy/operator/status'),
getJSON('/api/a11oy/v1/honest'),
getJSON('/api/a11oy/provenance')
]);
var pool = results[0].status==='fulfilled' ? results[0].value : {counts:{},nodes:[]};
var energy = results[1].status==='fulfilled' ? results[1].value : {by_node:{}};
var honest = results[2].status==='fulfilled' ? results[2].value : {};
var prov = results[3].status==='fulfilled' ? results[3].value : {};
renderKpis(pool, energy);
buildHolo(pool);
renderNodes(pool, energy);
renderEnergy(energy);
renderProv(prov, honest);
renderOrbit(pool, energy);
// Live-work panel probes independently (never blocks/breaks the core view).
var workLive = 0;
try { workLive = await loadWork(); } catch(e){ /* tiles fall back to honest PENDING */ }
var errs = results.filter(function(r){return r.status==='rejected';});
var ts = pool.cached_at || new Date().toISOString();
$('stamp').innerHTML = 'live as of <code>'+ts+'</code> · '+L('LIVE','4 ENDPOINTS WIRED') +
' · live work: <b>'+workLive+'/3</b> capabilities surfaced'+(workLive<3?' <span class="note">('+(3-workLive)+' honestly PENDING)</span>':'') +
(errs.length ? ' <span class="err">· '+errs.length+' source(s) unavailable (shown honestly empty)</span>' : '');
} catch(e){
$('stamp').innerHTML = '<span class="err">fabric load error: '+e+'</span>';
}
}
loadAll();
</script>
<script src="/assets/szl-flow.js" defer data-szl-flow-asset="script"></script>
<script src="/assets/szl-holo-v2.js" defer data-szl-holo-asset="script-v2"></script>
</body></html>
|