Spaces:
Running
chore(sync): mirror front-door files to Space (hf-sync)
Browse filesAutomated front-door sync from szl-holdings/a11oy main via hf-sync.
Added/updated: cathedral.html, cathedral_genius.html, console/docs.html, console/index.html, console/pricing.html, console/throne-room.html, console/throne-room.js, live_wires.html, pages/api-keys.html, pages/audit.html, pages/ayni.html, pages/brain-dual.html, pages/brain-jack.html, pages/brain.html, pages/chaski.html, pages/codex-kernel.html, pages/company.html, pages/compliance.html, pages/console.html, pages/counter-uas.html, pages/cued-engagement.html, pages/docs.html, pages/energy-ops.html, pages/evidence.html, pages/fabric.html, pages/gap-report.html, pages/harvest.html, pages/hatun-mcp.html, pages/hub.html, pages/integrations.html, pages/landing.html, pages/mesh.html, pages/observability.html, pages/operator_organ.html, pages/pinn.html, pages/pnt.html, pages/pricing.html, pages/run-all.html, pages/sdk.html, pages/security.html, pages/status.html, pages/substrate.html, pages/superpowers.html, pages/throne-room.html, pages/throne-room.js, pages/uds.html, pages/upgrades.html, pages/wallpa.html, pages/warhacker.html, pages/wasi-rikuq.html, pages/wires.html, static/a11oy_cathedral.js, static/cathedral_app.js, static/shared/szl_codename_sanitizer.js, static/shared/szl_holo3d.js, static/shared/szl_label_engine.js, static/shared/szl_receipt_cosign.js
Deleted (gone from GitHub main): (none)
Keeps the served front-door (pages/*.html, console/*.html) identical
to GitHub main so an HF factory rebuild never drops a GitHub edit or
keeps serving a page that was deleted on GitHub.
- pages/fabric.html +190 -7
|
@@ -52,6 +52,25 @@ th{color:var(--mut);font-weight:600}
|
|
| 52 |
.flow .arr{color:var(--mut);font-size:18px}
|
| 53 |
.refresh{background:var(--acc2);color:#06101f;border:0;border-radius:8px;padding:7px 13px;font-weight:700;cursor:pointer;font-size:13px}
|
| 54 |
.stamp{font:12px/1.3 ui-monospace,Menlo,monospace;color:var(--mut)}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
</style></head>
|
| 56 |
<body><div class="wrap">
|
| 57 |
<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>
|
|
@@ -62,7 +81,7 @@ th{color:var(--mut);font-weight:600}
|
|
| 62 |
|
| 63 |
<div class="card">
|
| 64 |
<div style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px">
|
| 65 |
-
<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></div>
|
| 66 |
<button class="refresh" onclick="loadAll()">↻ refresh live</button>
|
| 67 |
</div>
|
| 68 |
<div class="stamp" id="stamp" style="margin-top:8px">loading live fabric state…</div>
|
|
@@ -74,7 +93,34 @@ th{color:var(--mut);font-weight:600}
|
|
| 74 |
<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>
|
| 75 |
</div>
|
| 76 |
|
| 77 |
-
<h2>2 ·
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
<div class="card">
|
| 79 |
<div class="holo" id="holo"></div>
|
| 80 |
<div class="legend">
|
|
@@ -86,17 +132,17 @@ th{color:var(--mut);font-weight:600}
|
|
| 86 |
<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>
|
| 87 |
</div>
|
| 88 |
|
| 89 |
-
<h2>
|
| 90 |
<div class="nodegrid" id="nodes"><div class="note">…</div></div>
|
| 91 |
|
| 92 |
-
<h2>
|
| 93 |
<div class="card">
|
| 94 |
<div class="kpis" id="energy"><div class="note">…</div></div>
|
| 95 |
<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>
|
| 96 |
<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 Khipu ledger: <code>/api/a11oy/v1/energy/provenance</code>.</p>
|
| 97 |
</div>
|
| 98 |
|
| 99 |
-
<h2>
|
| 100 |
<div class="card">
|
| 101 |
<div class="flow">
|
| 102 |
<span class="node">request</span><span class="arr">→</span>
|
|
@@ -113,7 +159,7 @@ th{color:var(--mut);font-weight:600}
|
|
| 113 |
<span class="banner">Roadmap · orbital framing</span>
|
| 114 |
<span id="orbitBadge"></span>
|
| 115 |
</div>
|
| 116 |
-
<h2 style="margin-top:6px">
|
| 117 |
<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>
|
| 118 |
<div class="kpis" id="orbit">
|
| 119 |
<div class="kpi"><div class="k">Terrestrial governed mesh</div><div class="v" id="orbReach">—</div><div class="l" id="orbReachL"></div></div>
|
|
@@ -123,7 +169,7 @@ th{color:var(--mut);font-weight:600}
|
|
| 123 |
</div>
|
| 124 |
|
| 125 |
<div class="foot" id="foot">
|
| 126 |
-
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. 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>.
|
| 127 |
</div>
|
| 128 |
</div>
|
| 129 |
|
|
@@ -249,6 +295,138 @@ function renderOrbit(pool, energy){
|
|
| 249 |
$('orbRm').innerHTML = L('ROADMAP','ANALOGY ONLY');
|
| 250 |
}
|
| 251 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 252 |
async function loadAll(){
|
| 253 |
$('stamp').textContent = 'fetching live fabric state…';
|
| 254 |
try {
|
|
@@ -270,9 +448,14 @@ async function loadAll(){
|
|
| 270 |
renderProv(prov, honest);
|
| 271 |
renderOrbit(pool, energy);
|
| 272 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 273 |
var errs = results.filter(function(r){return r.status==='rejected';});
|
| 274 |
var ts = pool.cached_at || new Date().toISOString();
|
| 275 |
$('stamp').innerHTML = 'live as of <code>'+ts+'</code> · '+L('LIVE','4 ENDPOINTS WIRED') +
|
|
|
|
| 276 |
(errs.length ? ' <span class="err">· '+errs.length+' source(s) unavailable (shown honestly empty)</span>' : '');
|
| 277 |
} catch(e){
|
| 278 |
$('stamp').innerHTML = '<span class="err">fabric load error: '+e+'</span>';
|
|
|
|
| 52 |
.flow .arr{color:var(--mut);font-size:18px}
|
| 53 |
.refresh{background:var(--acc2);color:#06101f;border:0;border-radius:8px;padding:7px 13px;font-weight:700;cursor:pointer;font-size:13px}
|
| 54 |
.stamp{font:12px/1.3 ui-monospace,Menlo,monospace;color:var(--mut)}
|
| 55 |
+
/* --- Live-work panel (the fabric DOES verifiable work) --- */
|
| 56 |
+
.work{display:grid;grid-template-columns:repeat(auto-fit,minmax(330px,1fr));gap:12px;margin-top:6px}
|
| 57 |
+
.wk{background:#0e1422;border:1px solid var(--line);border-radius:11px;padding:14px 16px;display:flex;flex-direction:column}
|
| 58 |
+
.wk h3{margin:0 0 3px;font-size:15px}
|
| 59 |
+
.wk .cap{color:var(--mut);font-size:12px;margin:0 0 10px}
|
| 60 |
+
.wk .state{margin-top:auto}
|
| 61 |
+
.wk .big{font:700 22px/1.15 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;color:var(--acc);word-break:break-word}
|
| 62 |
+
.wk .sub2{color:var(--mut);font-size:12px;margin-top:4px}
|
| 63 |
+
.wk .receipt{font:11px/1.4 ui-monospace,Menlo,Consolas,monospace;color:var(--acc2);word-break:break-all;margin-top:7px}
|
| 64 |
+
.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}
|
| 65 |
+
.wk .pending .why{font-weight:400;letter-spacing:0;text-transform:none;color:var(--mut);display:block;margin-top:5px}
|
| 66 |
+
.wk .qa{display:flex;gap:7px;margin-top:8px}
|
| 67 |
+
.wk .qa input{flex:1;background:#0a1626;border:1px solid var(--line);border-radius:8px;color:var(--ink);padding:7px 9px;font-size:13px}
|
| 68 |
+
.wk .qa button{background:var(--acc2);color:#06101f;border:0;border-radius:8px;padding:7px 12px;font-weight:700;cursor:pointer;font-size:13px}
|
| 69 |
+
.wk .qa button:disabled{opacity:.45;cursor:not-allowed}
|
| 70 |
+
.wk .ans{margin-top:9px;font-size:13px;color:var(--ink)}
|
| 71 |
+
.wk .cite{font:11px/1.4 ui-monospace,Menlo,Consolas,monospace;color:var(--mut);margin-top:6px;word-break:break-all}
|
| 72 |
+
.wk .lbls{margin-top:9px;display:flex;gap:6px;flex-wrap:wrap}
|
| 73 |
+
.wk hr{border:0;border-top:1px solid var(--line);margin:11px 0 0}
|
| 74 |
</style></head>
|
| 75 |
<body><div class="wrap">
|
| 76 |
<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>
|
|
|
|
| 81 |
|
| 82 |
<div class="card">
|
| 83 |
<div style="display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:10px">
|
| 84 |
+
<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>
|
| 85 |
<button class="refresh" onclick="loadAll()">↻ refresh live</button>
|
| 86 |
</div>
|
| 87 |
<div class="stamp" id="stamp" style="margin-top:8px">loading live fabric state…</div>
|
|
|
|
| 93 |
<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>
|
| 94 |
</div>
|
| 95 |
|
| 96 |
+
<h2>2 · Live work — the fabric DOES verifiable work</h2>
|
| 97 |
+
<div class="card">
|
| 98 |
+
<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>
|
| 99 |
+
<div class="work" id="work">
|
| 100 |
+
<div class="wk" id="wk-kverify">
|
| 101 |
+
<h3>K-Verify · governed inference</h3>
|
| 102 |
+
<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>
|
| 103 |
+
<div class="state" id="kv-state"><span class="pending">PENDING<span class="why">probing live endpoint…</span></span></div>
|
| 104 |
+
</div>
|
| 105 |
+
<div class="wk" id="wk-rag">
|
| 106 |
+
<h3>Govern-RAG · ask the doctrine</h3>
|
| 107 |
+
<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>
|
| 108 |
+
<div class="qa" id="rag-qa" style="display:none">
|
| 109 |
+
<input id="rag-q" type="text" placeholder="e.g. How many formulas are locked, and at what kernel?" autocomplete="off">
|
| 110 |
+
<button id="rag-ask" type="button" onclick="askRag()">ask</button>
|
| 111 |
+
</div>
|
| 112 |
+
<div class="state" id="rag-state"><span class="pending">PENDING<span class="why">probing live endpoint…</span></span></div>
|
| 113 |
+
</div>
|
| 114 |
+
<div class="wk" id="wk-watt">
|
| 115 |
+
<h3>Cheapest-watt routing · last decision</h3>
|
| 116 |
+
<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>
|
| 117 |
+
<div class="state" id="watt-state"><span class="pending">PENDING<span class="why">probing live endpoint…</span></span></div>
|
| 118 |
+
</div>
|
| 119 |
+
</div>
|
| 120 |
+
<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>
|
| 121 |
+
</div>
|
| 122 |
+
|
| 123 |
+
<h2>3 · System-of-systems mesh (3D)</h2>
|
| 124 |
<div class="card">
|
| 125 |
<div class="holo" id="holo"></div>
|
| 126 |
<div class="legend">
|
|
|
|
| 132 |
<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>
|
| 133 |
</div>
|
| 134 |
|
| 135 |
+
<h2>4 · Nodes — honest per-node board</h2>
|
| 136 |
<div class="nodegrid" id="nodes"><div class="note">…</div></div>
|
| 137 |
|
| 138 |
+
<h2>5 · Energy — joules MEASURED, climbing</h2>
|
| 139 |
<div class="card">
|
| 140 |
<div class="kpis" id="energy"><div class="note">…</div></div>
|
| 141 |
<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>
|
| 142 |
<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 Khipu ledger: <code>/api/a11oy/v1/energy/provenance</code>.</p>
|
| 143 |
</div>
|
| 144 |
|
| 145 |
+
<h2>6 · Governed router + provenance</h2>
|
| 146 |
<div class="card">
|
| 147 |
<div class="flow">
|
| 148 |
<span class="node">request</span><span class="arr">→</span>
|
|
|
|
| 159 |
<span class="banner">Roadmap · orbital framing</span>
|
| 160 |
<span id="orbitBadge"></span>
|
| 161 |
</div>
|
| 162 |
+
<h2 style="margin-top:6px">7 · Orbital system-of-systems — ROADMAP / analogy (we do NOT run satellites)</h2>
|
| 163 |
<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>
|
| 164 |
<div class="kpis" id="orbit">
|
| 165 |
<div class="kpi"><div class="k">Terrestrial governed mesh</div><div class="v" id="orbReach">—</div><div class="l" id="orbReachL"></div></div>
|
|
|
|
| 169 |
</div>
|
| 170 |
|
| 171 |
<div class="foot" id="foot">
|
| 172 |
+
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>.
|
| 173 |
</div>
|
| 174 |
</div>
|
| 175 |
|
|
|
|
| 295 |
$('orbRm').innerHTML = L('ROADMAP','ANALOGY ONLY');
|
| 296 |
}
|
| 297 |
|
| 298 |
+
// ---- Live-work panel: probe each new capability honestly; render result OR honest PENDING ----
|
| 299 |
+
// Candidate endpoint lists — siblings (PowerD1-D4) may ship under any of these.
|
| 300 |
+
// We take the FIRST that returns valid JSON this sweep; if none do, we render PENDING.
|
| 301 |
+
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'];
|
| 302 |
+
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'];
|
| 303 |
+
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'];
|
| 304 |
+
var RAG_ASK_EPS = ['/api/a11oy/v1/rag/query','/api/a11oy/v1/rag/ask','/api/a11oy/v1/govern-rag/ask','/api/a11oy/rag/query'];
|
| 305 |
+
var RAG_ASK_URL = null; // resolved once a status probe identifies a live RAG surface
|
| 306 |
+
|
| 307 |
+
function pendingHTML(why){ return '<span class="pending">PENDING<span class="why">'+(why||'endpoint not yet live — shown honestly, not fabricated')+'</span></span>'; }
|
| 308 |
+
function shortHash(h){ if(!h) return null; h=String(h); return h.length>20 ? h.slice(0,10)+'…'+h.slice(-6) : h; }
|
| 309 |
+
|
| 310 |
+
// Try a list of endpoints; resolve with {url,data} of the first that returns ok JSON, else null.
|
| 311 |
+
async function firstLive(urls){
|
| 312 |
+
var settled = await Promise.allSettled(urls.map(function(u){ return getJSON(u).then(function(d){ return {url:u, data:d}; }); }));
|
| 313 |
+
for(var i=0;i<settled.length;i++){ if(settled[i].status==='fulfilled' && settled[i].value && settled[i].value.data) return settled[i].value; }
|
| 314 |
+
return null;
|
| 315 |
+
}
|
| 316 |
+
|
| 317 |
+
function renderKVerify(hit){
|
| 318 |
+
var el = $('kv-state');
|
| 319 |
+
if(!hit){ el.innerHTML = pendingHTML('K-Verify endpoint not live this sweep'); return false; }
|
| 320 |
+
var d = hit.data || {};
|
| 321 |
+
var n = (d.n!=null?d.n:(d.count!=null?d.count:(d.items!=null?d.items:(d.total!=null?d.total:null))));
|
| 322 |
+
var pass = (d.pass!=null?d.pass:(d.passed!=null?d.passed:(d.pass_count!=null?d.pass_count:null)));
|
| 323 |
+
var rate = (d.pass_rate!=null?d.pass_rate:(d.accuracy!=null?d.accuracy:null));
|
| 324 |
+
var joules= (d.joules_measured!=null?d.joules_measured:(d.joules!=null?d.joules:(d.measured_joules!=null?d.measured_joules:null)));
|
| 325 |
+
var jmeas = (d.joules_label==='MEASURED') || (typeof joules==='number' && joules>0 && d.joules_label!=='SAMPLE');
|
| 326 |
+
var rh = d.receipt_hash || d.receipt || d.digest || (d.receipt_digest) || ((d.khipu&&d.khipu.hash)||null);
|
| 327 |
+
var verify= d.verify_endpoint || d.receipt_verify_at || '/api/a11oy/khipu/verify';
|
| 328 |
+
if(rate==null && typeof pass==='number' && typeof n==='number' && n>0) rate = pass/n;
|
| 329 |
+
var passStr = (typeof pass==='number' && typeof n==='number') ? (fmt(pass)+'/'+fmt(n)) : (n!=null?fmt(n)+' items':'—');
|
| 330 |
+
var rateStr = (typeof rate==='number') ? (' · '+(rate*100).toFixed(1)+'% pass') : '';
|
| 331 |
+
var html = '<div class="big">'+passStr+'</div>';
|
| 332 |
+
html += '<div class="sub2">items run / passed'+rateStr+'</div>';
|
| 333 |
+
html += '<hr><div class="sub2">energy: <b>'+(joules!=null?fmt(joules)+' J':'—')+'</b> '+(jmeas?L('MEASURED'):L('SAMPLE'))+'</div>';
|
| 334 |
+
if(rh){ html += '<div class="receipt">receipt '+shortHash(rh)+'</div>'; html += '<div class="sub2">verify: <code>'+verify+'</code> '+L('LIVE')+'</div>'; }
|
| 335 |
+
html += '<div class="lbls">'+L('LIVE','GOVERNED INFERENCE')+'</div>';
|
| 336 |
+
el.innerHTML = html;
|
| 337 |
+
return true;
|
| 338 |
+
}
|
| 339 |
+
|
| 340 |
+
function renderRag(hit){
|
| 341 |
+
var el = $('rag-state'); var qa = $('rag-qa');
|
| 342 |
+
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; }
|
| 343 |
+
var d = hit.data || {};
|
| 344 |
+
// Resolve an ask URL: explicit field, sibling of the status path, or default candidate.
|
| 345 |
+
RAG_ASK_URL = d.query_endpoint || d.ask_endpoint || hit.url.replace(/\/(status|health|last)$/,'/query') || RAG_ASK_EPS[0];
|
| 346 |
+
qa.style.display='flex';
|
| 347 |
+
var corpus = d.corpus || d.corpus_id || d.index || null;
|
| 348 |
+
var lastQ = d.last_question || (d.last && d.last.question) || null;
|
| 349 |
+
var lastA = d.last_answer || (d.last && d.last.answer) || d.answer || null;
|
| 350 |
+
var cites = d.citations || (d.last && d.last.citations) || d.sources || null;
|
| 351 |
+
var html = '<div class="sub2">corpus: <b>'+(corpus||'governed corpus')+'</b> '+L('LIVE')+'</div>';
|
| 352 |
+
if(lastA){
|
| 353 |
+
html += '<div class="ans">'+(lastQ?'<b>Q:</b> '+escapeHTML(lastQ)+'<br>':'')+'<b>A:</b> '+escapeHTML(String(lastA))+'</div>';
|
| 354 |
+
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>'; }
|
| 355 |
+
html += '<div class="lbls">'+L('LIVE','GROUNDED + CITED')+'</div>';
|
| 356 |
+
} else {
|
| 357 |
+
html += '<div class="sub2">Ask the doctrine — answers come only from the governed corpus, with citations.</div>';
|
| 358 |
+
}
|
| 359 |
+
el.innerHTML = html;
|
| 360 |
+
return true;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
async function askRag(){
|
| 364 |
+
var q = ($('rag-q')||{}).value || ''; q = q.trim();
|
| 365 |
+
var btn = $('rag-ask'); var el = $('rag-state');
|
| 366 |
+
if(!q){ return; }
|
| 367 |
+
if(!RAG_ASK_URL){ el.innerHTML = pendingHTML('RAG query endpoint not live'); return; }
|
| 368 |
+
btn.disabled = true; var prev = el.innerHTML; el.innerHTML = '<div class="sub2">asking the governed corpus…</div>';
|
| 369 |
+
try {
|
| 370 |
+
var r = await fetch(RAG_ASK_URL, {method:'POST', headers:{'content-type':'application/json','accept':'application/json'}, body: JSON.stringify({question:q, query:q})});
|
| 371 |
+
if(!r.ok) throw new Error('HTTP '+r.status);
|
| 372 |
+
var d = await r.json();
|
| 373 |
+
var ans = d.answer || d.response || (d.last && d.last.answer) || null;
|
| 374 |
+
var cites = d.citations || d.sources || (d.last && d.last.citations) || null;
|
| 375 |
+
var grounded = (d.grounded!==false) && ans;
|
| 376 |
+
var html = '';
|
| 377 |
+
if(grounded){
|
| 378 |
+
html += '<div class="ans"><b>Q:</b> '+escapeHTML(q)+'<br><b>A:</b> '+escapeHTML(String(ans))+'</div>';
|
| 379 |
+
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>'; }
|
| 380 |
+
html += '<div class="lbls">'+L('LIVE','GROUNDED + CITED')+'</div>';
|
| 381 |
+
} else {
|
| 382 |
+
html += '<div class="ans"><b>Q:</b> '+escapeHTML(q)+'<br><b>A:</b> insufficient grounding in the governed corpus — no answer returned.</div>';
|
| 383 |
+
html += '<div class="lbls">'+L('LIVE','HONEST: NO GUESS')+'</div>';
|
| 384 |
+
}
|
| 385 |
+
el.innerHTML = html;
|
| 386 |
+
} catch(e){
|
| 387 |
+
el.innerHTML = '<div class="err">RAG query error: '+escapeHTML(String(e))+'</div>';
|
| 388 |
+
} finally { btn.disabled = false; }
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
function renderWatt(hit){
|
| 392 |
+
var el = $('watt-state');
|
| 393 |
+
if(!hit){ el.innerHTML = pendingHTML('cheapest-watt routing endpoint not live this sweep'); return false; }
|
| 394 |
+
var d = hit.data || {};
|
| 395 |
+
var dec = d.decision || d.last || d;
|
| 396 |
+
var node = dec.node || dec.chosen_node || dec.placed_on || dec.target || null;
|
| 397 |
+
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)));
|
| 398 |
+
var save = (dec.savings_pct!=null?dec.savings_pct:(dec.savings_percent!=null?dec.savings_percent:null));
|
| 399 |
+
var saveAbs = (dec.savings_eur_mwh!=null?dec.savings_eur_mwh:null);
|
| 400 |
+
var label = dec.savings_label || dec.label || (saveAbs!=null||save!=null ? 'MODELED' : null);
|
| 401 |
+
var html = '';
|
| 402 |
+
html += '<div class="big">'+(price!=null?fmt1(price)+' €/MWh':'—')+'</div>';
|
| 403 |
+
html += '<div class="sub2">chosen node: <b>'+(node||'—')+'</b> '+L('LIVE','LOWEST-€ REACHABLE')+'</div>';
|
| 404 |
+
if(save!=null || saveAbs!=null){
|
| 405 |
+
var sv = (save!=null? (save*( save<=1?100:1)).toFixed(1)+'%':'') + (saveAbs!=null? (save!=null?' · ':'')+fmt1(saveAbs)+' €/MWh':'');
|
| 406 |
+
var lk = (label==='MEASURED') ? L('MEASURED') : L('MODELED','ROUTING LAW');
|
| 407 |
+
html += '<hr><div class="sub2">honest savings vs default placement: <b>'+sv+'</b> '+lk+'</div>';
|
| 408 |
+
} else {
|
| 409 |
+
html += '<hr><div class="sub2">savings: — '+L('MODELED','NO BASELINE THIS SWEEP')+'</div>';
|
| 410 |
+
}
|
| 411 |
+
if(dec.receipt_hash||dec.receipt||dec.digest){ html += '<div class="receipt">receipt '+shortHash(dec.receipt_hash||dec.receipt||dec.digest)+'</div>'; }
|
| 412 |
+
el.innerHTML = html;
|
| 413 |
+
return true;
|
| 414 |
+
}
|
| 415 |
+
|
| 416 |
+
function escapeHTML(s){ return String(s).replace(/[&<>"']/g, function(c){ return {'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]; }); }
|
| 417 |
+
|
| 418 |
+
async function loadWork(){
|
| 419 |
+
var probes = await Promise.allSettled([ firstLive(KV_EPS), firstLive(RAG_EPS), firstLive(WATT_EPS) ]);
|
| 420 |
+
var kv = probes[0].status==='fulfilled' ? probes[0].value : null;
|
| 421 |
+
var rag = probes[1].status==='fulfilled' ? probes[1].value : null;
|
| 422 |
+
var watt = probes[2].status==='fulfilled' ? probes[2].value : null;
|
| 423 |
+
var live = 0;
|
| 424 |
+
if(renderKVerify(kv)) live++;
|
| 425 |
+
if(renderRag(rag)) live++;
|
| 426 |
+
if(renderWatt(watt)) live++;
|
| 427 |
+
return live;
|
| 428 |
+
}
|
| 429 |
+
|
| 430 |
async function loadAll(){
|
| 431 |
$('stamp').textContent = 'fetching live fabric state…';
|
| 432 |
try {
|
|
|
|
| 448 |
renderProv(prov, honest);
|
| 449 |
renderOrbit(pool, energy);
|
| 450 |
|
| 451 |
+
// Live-work panel probes independently (never blocks/breaks the core view).
|
| 452 |
+
var workLive = 0;
|
| 453 |
+
try { workLive = await loadWork(); } catch(e){ /* tiles fall back to honest PENDING */ }
|
| 454 |
+
|
| 455 |
var errs = results.filter(function(r){return r.status==='rejected';});
|
| 456 |
var ts = pool.cached_at || new Date().toISOString();
|
| 457 |
$('stamp').innerHTML = 'live as of <code>'+ts+'</code> · '+L('LIVE','4 ENDPOINTS WIRED') +
|
| 458 |
+
' · live work: <b>'+workLive+'/3</b> capabilities surfaced'+(workLive<3?' <span class="note">('+(3-workLive)+' honestly PENDING)</span>':'') +
|
| 459 |
(errs.length ? ' <span class="err">· '+errs.length+' source(s) unavailable (shown honestly empty)</span>' : '');
|
| 460 |
} catch(e){
|
| 461 |
$('stamp').innerHTML = '<span class="err">fabric load error: '+e+'</span>';
|