Spaces:
Running
Running
deploy(hf): sync szl-holdings/a11oy@main derived COPY set
Browse filesReusable Dockerfile-COPY-derived deploy from szl-holdings/a11oy main.
Files: 946 Pruned: 0
Derived from Dockerfile COPY sources (NO hand-maintained allowlist).
Signed-off-by: SZL Holdings <noreply@szlholdings.ai>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- static/3d/surfaces/anatomy.js +168 -0
static/3d/surfaces/anatomy.js
CHANGED
|
@@ -66,6 +66,12 @@ const C_DEGRADED = 0x8a97a3; // gray — honest degraded
|
|
| 66 |
const C_AYNI = 0x39d3c4; // teal — reciprocity balanced
|
| 67 |
const C_AYNI_OFF = 0xe8c074; // amber — out of balance
|
| 68 |
const C_RESERVOIR = 0x6fb1ff; // blue — SAMPLE work-credit tank
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
|
| 70 |
// The three YARQA dispersal organs, in canonical loop order around the ring.
|
| 71 |
const ORGAN_ANGLES = { WAQAYCHAQ: Math.PI * 0.5, KAMAY: Math.PI * 1.1666, RIKUY: Math.PI * 1.8333 };
|
|
@@ -78,6 +84,11 @@ let _organs = {}; // name -> { group, core, halo, sprite }
|
|
| 78 |
let _reservoir = null, _reservoirFill = null, _reservoirMat = null;
|
| 79 |
let _ayniGroup = null, _ayniBeam = null, _ayniL = null, _ayniR = null;
|
| 80 |
let _beatComet = null; // the single traveling beat
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
let _hud = {}; // DOM HUD field refs
|
| 82 |
let _last = null; // last live JSON
|
| 83 |
let _meta = { state: "init", label: null };
|
|
@@ -261,6 +272,34 @@ function _buildScene() {
|
|
| 261 |
grid.position.y = -5.2;
|
| 262 |
grid.material.transparent = true; grid.material.opacity = 0.4;
|
| 263 |
_root.add(grid);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 264 |
}
|
| 265 |
|
| 266 |
// ---------------------------------------------------------------------------
|
|
@@ -329,8 +368,51 @@ function _buildHUD() {
|
|
| 329 |
hm.appendChild(f.row);
|
| 330 |
});
|
| 331 |
_show.body.appendChild(hm);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 332 |
}
|
| 333 |
|
|
|
|
|
|
|
| 334 |
// W28 — LIVE organ-health render: map a real per-role upstream probe onto its HUD row.
|
| 335 |
// The probe returns { up, status_code, latency_ms, label, note }. up:false is honest
|
| 336 |
// OFFLINE (amber/gray), never re-colored to look healthy; unreachable stays OFFLINE.
|
|
@@ -461,6 +543,71 @@ function _onData(json, meta) {
|
|
| 461 |
_hud.ayni.style.color = ok ? "#39d3c4" : "#e8c074";
|
| 462 |
}
|
| 463 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 464 |
// ---- live honesty chips (verbatim label; never upgraded) ---------------
|
| 465 |
if (_show) {
|
| 466 |
_show.setChip("joules", joulesLabel, { text: "joules" });
|
|
@@ -527,6 +674,25 @@ function _frame() {
|
|
| 527 |
}
|
| 528 |
}
|
| 529 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 530 |
// gentle whole-loop rotation for the Holograph "above/below plane" feel
|
| 531 |
if (_root) _root.rotation.y += degraded ? 0.0008 : 0.0022;
|
| 532 |
}
|
|
@@ -578,6 +744,8 @@ function unmount() {
|
|
| 578 |
_ctx = null; _stage = null; _THREE = null; _handle = null;
|
| 579 |
_root = null; _overlay = null; _show = null; _ring = null; _ringMat = null;
|
| 580 |
_beats = null; _beatMat = null; _beatPhase = null; _beatComet = null;
|
|
|
|
|
|
|
| 581 |
_organs = {}; _reservoir = null; _reservoirFill = null; _reservoirMat = null;
|
| 582 |
_ayniGroup = null; _ayniBeam = null; _ayniL = null; _ayniR = null;
|
| 583 |
_hud = {}; _last = null; _meta = { state: "init", label: null }; _lastReceipt = "";
|
|
|
|
| 66 |
const C_AYNI = 0x39d3c4; // teal — reciprocity balanced
|
| 67 |
const C_AYNI_OFF = 0xe8c074; // amber — out of balance
|
| 68 |
const C_RESERVOIR = 0x6fb1ff; // blue — SAMPLE work-credit tank
|
| 69 |
+
// WAVE 2 — GOVERNED LIVING-BRAIN belief-tier palette (blue/violet-blue/teal/greys;
|
| 70 |
+
// PURPLE BANNED). Verbatim doctrine labels, never re-coloured to look "proven".
|
| 71 |
+
const C_TIER_CONJ = 0x8a97a3; // grey — CONJECTURE (advisory, never truth)
|
| 72 |
+
const C_TIER_CORR = 0x5b8dee; // violet-blue — CORROBORATED
|
| 73 |
+
const C_TIER_LOAD = 0x39d3c4; // teal — LOAD-BEARING (hub)
|
| 74 |
+
const C_QUARANTINE = 0xe8c074; // amber — QUARANTINED (honest, not written)
|
| 75 |
|
| 76 |
// The three YARQA dispersal organs, in canonical loop order around the ring.
|
| 77 |
const ORGAN_ANGLES = { WAQAYCHAQ: Math.PI * 0.5, KAMAY: Math.PI * 1.1666, RIKUY: Math.PI * 1.8333 };
|
|
|
|
| 84 |
let _reservoir = null, _reservoirFill = null, _reservoirMat = null;
|
| 85 |
let _ayniGroup = null, _ayniBeam = null, _ayniL = null, _ayniR = null;
|
| 86 |
let _beatComet = null; // the single traveling beat
|
| 87 |
+
// WAVE 2 — governed brain-loop cognition core (glows with reinforced-edge count,
|
| 88 |
+
// coloured by the dominant live belief tier). MODELED — a derived view, not truth.
|
| 89 |
+
let _cognition = null, _cognitionMat = null, _cognitionHalo = null, _cognitionHaloMat = null;
|
| 90 |
+
let _brainGlow = 0; // target glow from real reinforced_edges count
|
| 91 |
+
let _brainTierColor = C_TIER_CONJ;
|
| 92 |
let _hud = {}; // DOM HUD field refs
|
| 93 |
let _last = null; // last live JSON
|
| 94 |
let _meta = { state: "init", label: null };
|
|
|
|
| 272 |
grid.position.y = -5.2;
|
| 273 |
grid.material.transparent = true; grid.material.opacity = 0.4;
|
| 274 |
_root.add(grid);
|
| 275 |
+
|
| 276 |
+
// DEMO #23 — WAVE 2 COGNITION CORE: the harvested brain as an ACTIVE ORGAN that
|
| 277 |
+
// DRIVES metered inference. Its glow scales with the REAL reinforced-edge count
|
| 278 |
+
// from /anatomy/loop.brain.health; its colour is the dominant live belief tier
|
| 279 |
+
// (grey CONJECTURE / blue CORROBORATED / teal LOAD-BEARING). MODELED, not truth.
|
| 280 |
+
const cogGeo = new THREE.IcosahedronGeometry(0.85, 2);
|
| 281 |
+
_cognitionMat = new THREE.MeshStandardMaterial({
|
| 282 |
+
color: C_TIER_CONJ, emissive: C_TIER_CONJ, emissiveIntensity: 0.3,
|
| 283 |
+
metalness: 0.4, roughness: 0.35, transparent: true, opacity: 0.9, wireframe: true,
|
| 284 |
+
});
|
| 285 |
+
_cognition = new THREE.Mesh(cogGeo, _cognitionMat);
|
| 286 |
+
_cognition.position.set(0, 2.6, 0);
|
| 287 |
+
_root.add(_cognition);
|
| 288 |
+
|
| 289 |
+
const cogHaloGeo = new THREE.RingGeometry(1.1, 1.35, 56);
|
| 290 |
+
_cognitionHaloMat = new THREE.MeshBasicMaterial({
|
| 291 |
+
color: C_TIER_CONJ, transparent: true, opacity: 0.0, side: THREE.DoubleSide,
|
| 292 |
+
blending: THREE.AdditiveBlending, depthWrite: false,
|
| 293 |
+
});
|
| 294 |
+
_cognitionHalo = new THREE.Mesh(cogHaloGeo, _cognitionHaloMat);
|
| 295 |
+
_cognitionHalo.position.copy(_cognition.position);
|
| 296 |
+
_root.add(_cognitionHalo);
|
| 297 |
+
try {
|
| 298 |
+
const cb = _ctx.label.billboard(THREE, "MODELED",
|
| 299 |
+
{ text: "COGNITION · brain drives metered inference", scale: 0.42,
|
| 300 |
+
position: [0, 3.8, 0] });
|
| 301 |
+
_root.add(cb);
|
| 302 |
+
} catch (_) {}
|
| 303 |
}
|
| 304 |
|
| 305 |
// ---------------------------------------------------------------------------
|
|
|
|
| 368 |
hm.appendChild(f.row);
|
| 369 |
});
|
| 370 |
_show.body.appendChild(hm);
|
| 371 |
+
|
| 372 |
+
// WAVE 2 — GOVERNED LIVING-BRAIN loop readout (read live from /anatomy/loop.brain).
|
| 373 |
+
const bh = document.createElement("div");
|
| 374 |
+
bh.style.cssText = "font:10.5px ui-monospace,Menlo,monospace;color:#9fb1bf;line-height:1.5;" +
|
| 375 |
+
"margin-top:10px;border-top:1px solid #1d2a36;padding-top:8px;";
|
| 376 |
+
bh.textContent = "governed brain loop · brain DRIVES metered inference (POST /anatomy/pulse) — " +
|
| 377 |
+
"graph grows ONLY via receipted inference; salience is Λ-advisory (≤0.97), never truth";
|
| 378 |
+
_show.body.appendChild(bh);
|
| 379 |
+
|
| 380 |
+
const bf = document.createElement("div");
|
| 381 |
+
bf.style.cssText = "display:flex;flex-direction:column;gap:5px;margin-top:6px;";
|
| 382 |
+
const mkb = (key, lbl) => { const f = _row(lbl); _hud[key] = f.val; bf.appendChild(f.row); };
|
| 383 |
+
mkb("brainGraph", "brain · source graph");
|
| 384 |
+
mkb("brainReceipts", "brain · receipts (chain)");
|
| 385 |
+
mkb("brainEdges", "brain · reinforced edges");
|
| 386 |
+
mkb("brainAudit", "brain · self-audit demotions");
|
| 387 |
+
_show.body.appendChild(bf);
|
| 388 |
+
|
| 389 |
+
// belief-tier pills — verbatim doctrine labels, colour-coded, never upgraded.
|
| 390 |
+
const pillsWrap = document.createElement("div");
|
| 391 |
+
pillsWrap.style.cssText = "display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;";
|
| 392 |
+
const mkpill = (key, label, color) => {
|
| 393 |
+
const p = document.createElement("span");
|
| 394 |
+
p.style.cssText = "font:10px ui-monospace,Menlo,monospace;padding:2px 8px;border-radius:10px;" +
|
| 395 |
+
"border:1px solid " + _hex(color) + ";color:" + _hex(color) + ";background:rgba(0,0,0,0.25);";
|
| 396 |
+
p.textContent = label + " · 0";
|
| 397 |
+
_hud[key] = p;
|
| 398 |
+
pillsWrap.appendChild(p);
|
| 399 |
+
};
|
| 400 |
+
mkpill("pillConj", "CONJECTURE", C_TIER_CONJ);
|
| 401 |
+
mkpill("pillCorr", "CORROBORATED", C_TIER_CORR);
|
| 402 |
+
mkpill("pillLoad", "LOAD-BEARING", C_TIER_LOAD);
|
| 403 |
+
mkpill("pillQuar", "QUARANTINED", C_QUARANTINE);
|
| 404 |
+
_show.body.appendChild(pillsWrap);
|
| 405 |
+
|
| 406 |
+
// top-k Λ-advisory salience list (honest empty when the brain graph is unavailable).
|
| 407 |
+
_hud.salienceList = document.createElement("div");
|
| 408 |
+
_hud.salienceList.style.cssText = "display:flex;flex-direction:column;gap:3px;margin-top:8px;" +
|
| 409 |
+
"font:10px ui-monospace,Menlo,monospace;color:#9fb1bf;";
|
| 410 |
+
_hud.salienceList.textContent = "salience · NO-LIVE-DATA";
|
| 411 |
+
_show.body.appendChild(_hud.salienceList);
|
| 412 |
}
|
| 413 |
|
| 414 |
+
function _hex(c) { return "#" + ("000000" + (c >>> 0).toString(16)).slice(-6); }
|
| 415 |
+
|
| 416 |
// W28 — LIVE organ-health render: map a real per-role upstream probe onto its HUD row.
|
| 417 |
// The probe returns { up, status_code, latency_ms, label, note }. up:false is honest
|
| 418 |
// OFFLINE (amber/gray), never re-colored to look healthy; unreachable stays OFFLINE.
|
|
|
|
| 543 |
_hud.ayni.style.color = ok ? "#39d3c4" : "#e8c074";
|
| 544 |
}
|
| 545 |
|
| 546 |
+
// ---- WAVE 2: GOVERNED LIVING-BRAIN loop (read live from json.brain) -----
|
| 547 |
+
const brain = (json && json.brain) || {};
|
| 548 |
+
const health = brain.health || {};
|
| 549 |
+
const belief = health.belief || {};
|
| 550 |
+
const byTier = belief.by_tier || {};
|
| 551 |
+
const conj = Number(byTier.CONJECTURE || 0);
|
| 552 |
+
const corr = Number(byTier.CORROBORATED || 0);
|
| 553 |
+
const load = Number(byTier["LOAD-BEARING"] || 0);
|
| 554 |
+
const quar = Number(belief.quarantined || 0);
|
| 555 |
+
const edges = Number(health.reinforced_edges || 0);
|
| 556 |
+
const avail = !!brain.available;
|
| 557 |
+
|
| 558 |
+
if (_hud.brainGraph) {
|
| 559 |
+
_hud.brainGraph.textContent = avail
|
| 560 |
+
? `${health.source_node_count || 0} nodes (${health.label || "MODELED"})`
|
| 561 |
+
: "NO-LIVE-DATA";
|
| 562 |
+
_hud.brainGraph.style.color = avail ? "#eef3f6" : "#7d8a96";
|
| 563 |
+
}
|
| 564 |
+
if (_hud.brainReceipts) {
|
| 565 |
+
const ok = health.chain_ok;
|
| 566 |
+
_hud.brainReceipts.textContent = avail
|
| 567 |
+
? `${health.receipts || 0} ${ok ? "✓ chain-ok" : "✗ chain-broken"}`
|
| 568 |
+
: "NO-LIVE-DATA";
|
| 569 |
+
_hud.brainReceipts.style.color = !avail ? "#7d8a96" : (ok ? "#39d3c4" : "#e8c074");
|
| 570 |
+
}
|
| 571 |
+
if (_hud.brainEdges) _hud.brainEdges.textContent = avail ? String(edges) : "NO-LIVE-DATA";
|
| 572 |
+
if (_hud.brainAudit) {
|
| 573 |
+
const d = Number(health.self_audit_demotions || 0);
|
| 574 |
+
_hud.brainAudit.textContent = avail ? String(d) : "NO-LIVE-DATA";
|
| 575 |
+
_hud.brainAudit.style.color = d > 0 ? "#e8c074" : "#eef3f6";
|
| 576 |
+
}
|
| 577 |
+
if (_hud.pillConj) _hud.pillConj.textContent = `CONJECTURE · ${conj}`;
|
| 578 |
+
if (_hud.pillCorr) _hud.pillCorr.textContent = `CORROBORATED · ${corr}`;
|
| 579 |
+
if (_hud.pillLoad) _hud.pillLoad.textContent = `LOAD-BEARING · ${load}`;
|
| 580 |
+
if (_hud.pillQuar) _hud.pillQuar.textContent = `QUARANTINED · ${quar}`;
|
| 581 |
+
|
| 582 |
+
// dominant belief tier drives the cognition-core colour (honest, never upgraded).
|
| 583 |
+
_brainTierColor = load > 0 ? C_TIER_LOAD : (corr > 0 ? C_TIER_CORR : C_TIER_CONJ);
|
| 584 |
+
// glow scales with the REAL reinforced-edge count (log-mapped; 0 -> dark honestly).
|
| 585 |
+
_brainGlow = (avail && edges > 0) ? Math.min(1, Math.log10(1 + edges) / 2) : 0;
|
| 586 |
+
|
| 587 |
+
const sal = Array.isArray(brain.salience) ? brain.salience : [];
|
| 588 |
+
if (_hud.salienceList) {
|
| 589 |
+
if (!avail || sal.length === 0) {
|
| 590 |
+
_hud.salienceList.textContent = "salience · NO-LIVE-DATA";
|
| 591 |
+
} else {
|
| 592 |
+
_hud.salienceList.textContent = "";
|
| 593 |
+
const head = document.createElement("div");
|
| 594 |
+
head.style.color = "#7d8a96";
|
| 595 |
+
head.textContent = "top load-bearing salience · Λ-advisory (≤0.97)";
|
| 596 |
+
_hud.salienceList.appendChild(head);
|
| 597 |
+
sal.slice(0, 5).forEach((s) => {
|
| 598 |
+
const r = document.createElement("div");
|
| 599 |
+
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;";
|
| 600 |
+
const t = document.createElement("span");
|
| 601 |
+
t.textContent = String(s.title || s.id || "—").slice(0, 34);
|
| 602 |
+
const v = document.createElement("span");
|
| 603 |
+
v.style.color = "#39d3c4";
|
| 604 |
+
v.textContent = (s.salience != null ? Number(s.salience).toFixed(3) : "—");
|
| 605 |
+
r.appendChild(t); r.appendChild(v);
|
| 606 |
+
_hud.salienceList.appendChild(r);
|
| 607 |
+
});
|
| 608 |
+
}
|
| 609 |
+
}
|
| 610 |
+
|
| 611 |
// ---- live honesty chips (verbatim label; never upgraded) ---------------
|
| 612 |
if (_show) {
|
| 613 |
_show.setChip("joules", joulesLabel, { text: "joules" });
|
|
|
|
| 674 |
}
|
| 675 |
}
|
| 676 |
|
| 677 |
+
// WAVE 2 cognition core — glow eased toward the real reinforced-edge load, tinted
|
| 678 |
+
// by the dominant belief tier; slow spin so it reads as a live "thinking" organ.
|
| 679 |
+
if (_cognition && _cognitionMat) {
|
| 680 |
+
_cognition.rotation.y += 0.006;
|
| 681 |
+
_cognition.rotation.x += 0.003;
|
| 682 |
+
const g = degraded ? 0 : _brainGlow;
|
| 683 |
+
const pulse = 0.5 + 0.5 * Math.sin(_t * 2.2);
|
| 684 |
+
_cognitionMat.color.setHex(_brainTierColor);
|
| 685 |
+
_cognitionMat.emissive.setHex(_brainTierColor);
|
| 686 |
+
_cognitionMat.emissiveIntensity = 0.2 + 0.9 * g * (0.6 + 0.4 * pulse);
|
| 687 |
+
const s = 1 + 0.12 * g * pulse;
|
| 688 |
+
_cognition.scale.setScalar(s);
|
| 689 |
+
if (_cognitionHaloMat) {
|
| 690 |
+
_cognitionHaloMat.color.setHex(_brainTierColor);
|
| 691 |
+
_cognitionHaloMat.opacity = g * (0.15 + 0.35 * pulse);
|
| 692 |
+
}
|
| 693 |
+
if (_cognitionHalo) _cognitionHalo.rotation.z += 0.01;
|
| 694 |
+
}
|
| 695 |
+
|
| 696 |
// gentle whole-loop rotation for the Holograph "above/below plane" feel
|
| 697 |
if (_root) _root.rotation.y += degraded ? 0.0008 : 0.0022;
|
| 698 |
}
|
|
|
|
| 744 |
_ctx = null; _stage = null; _THREE = null; _handle = null;
|
| 745 |
_root = null; _overlay = null; _show = null; _ring = null; _ringMat = null;
|
| 746 |
_beats = null; _beatMat = null; _beatPhase = null; _beatComet = null;
|
| 747 |
+
_cognition = null; _cognitionMat = null; _cognitionHalo = null; _cognitionHaloMat = null;
|
| 748 |
+
_brainGlow = 0; _brainTierColor = C_TIER_CONJ;
|
| 749 |
_organs = {}; _reservoir = null; _reservoirFill = null; _reservoirMat = null;
|
| 750 |
_ayniGroup = null; _ayniBeam = null; _ayniL = null; _ayniR = null;
|
| 751 |
_hud = {}; _last = null; _meta = { state: "init", label: null }; _lastReceipt = "";
|