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: 1013 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/holographic.html +1 -0
- static/3d/surfaces/agentos.js +468 -0
static/3d/holographic.html
CHANGED
|
@@ -319,6 +319,7 @@ const SURFACES = [
|
|
| 319 |
{ id: "retrievalattn", cat: "attention", title: "Retrieval-Modulated Long-Context Attention · needle recall (MODELED)", mod: "/static/3d/surfaces/retrievalattn.js" },
|
| 320 |
{ id: "whatsnew", cat: "brain", title: "What's New · honest auto-derived estate changelog · recently-added surfaces w/ verbatim labels + citations from real git history (drift-proof)", mod: "/static/3d/surfaces/whatsnew.js" },
|
| 321 |
{ id: "honestywall", cat: "governance", title: "Honesty Wall · live integrity aggregation · reads each surface's OWN honest label VERBATIM + estate honesty invariants → INTACT/DEGRADED/VIOLATED verdict, unsigned SHA-256 receipt-on-write (drift-proof)", mod: "/static/3d/surfaces/honestywall.js" },
|
|
|
|
| 322 |
];
|
| 323 |
|
| 324 |
const stageEl = document.getElementById("stage");
|
|
|
|
| 319 |
{ id: "retrievalattn", cat: "attention", title: "Retrieval-Modulated Long-Context Attention · needle recall (MODELED)", mod: "/static/3d/surfaces/retrievalattn.js" },
|
| 320 |
{ id: "whatsnew", cat: "brain", title: "What's New · honest auto-derived estate changelog · recently-added surfaces w/ verbatim labels + citations from real git history (drift-proof)", mod: "/static/3d/surfaces/whatsnew.js" },
|
| 321 |
{ id: "honestywall", cat: "governance", title: "Honesty Wall · live integrity aggregation · reads each surface's OWN honest label VERBATIM + estate honesty invariants → INTACT/DEGRADED/VIOLATED verdict, unsigned SHA-256 receipt-on-write (drift-proof)", mod: "/static/3d/surfaces/honestywall.js" },
|
| 322 |
+
{ id: "agentos", cat: "governance", flag: true, title: "Agent OS Map · live self-honest operator's-eye map of the agent OS · nodes (daily loop←agentops, trust ledger←anatomy+receipts+honestywall, standing goals←doctrine+locked-8, optional loops←governedagent/governedrag/loopforge/mesh) with LIVE per-node verdict from the honestywall aggregate → OPERATING/DEGRADED/HALTED-HONEST, never OPERATING if anything VIOLATED, unsigned SHA-256 receipt-on-write (drift-proof)", mod: "/static/3d/surfaces/agentos.js" },
|
| 323 |
];
|
| 324 |
|
| 325 |
const stageEl = document.getElementById("stage");
|
static/3d/surfaces/agentos.js
ADDED
|
@@ -0,0 +1,468 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 2 |
+
// © 2026 Lutar, Stephen P. Jr. — SZL Holdings · ORCID 0009-0001-0110-4173 · Doctrine v11
|
| 3 |
+
//
|
| 4 |
+
// surfaces/agentos.js — AGENT OS MAP · live, self-honest operator's-eye map of the agent OS.
|
| 5 |
+
//
|
| 6 |
+
// concept spark: Agentic-OS mapping, @Av1dlive on X
|
| 7 |
+
// https://x.com/Av1dlive/status/2074796427595874636 — we borrow the single-operator-map idea
|
| 8 |
+
// (one map of the whole agent OS: a daily loop, a trust ledger, standing goals, optional loops).
|
| 9 |
+
// We do NOT copy their diagrams or claim Fable-5 specifics. agentos composes ONLY our own
|
| 10 |
+
// governed components and reads every node/edge and every verdict LIVE from the running estate.
|
| 11 |
+
//
|
| 12 |
+
// A NODE/EDGE GRAPH: one mesh per agent-OS node (standing goals, daily loop, trust ledger,
|
| 13 |
+
// optional loops), coloured by its LIVE honesty verdict; edges are the control/data flow
|
| 14 |
+
// between them. A STATE PLATE at the top carries the estate's single map state — OPERATING /
|
| 15 |
+
// DEGRADED / HALTED-HONEST — read VERBATIM from the aggregate. HONEST BY CONSTRUCTION: node
|
| 16 |
+
// presence is derived from the live surface registry and each verdict is sourced from the
|
| 17 |
+
// honestywall aggregate — never a hand-drawn diagram.
|
| 18 |
+
//
|
| 19 |
+
// DATA: live snapshot from GET /api/a11oy/v1/govern/agentos (PURE READ, mints nothing):
|
| 20 |
+
// ok, label (MODELED), state, state_reason,
|
| 21 |
+
// nodes[ { id, title, kind, verdict, backing, backing_kind } ],
|
| 22 |
+
// edges[ { src, dst, flow, label } ],
|
| 23 |
+
// summary{ nodes_present, edges_present, verdict_counts, honestywall_reachable, honestywall_verdict },
|
| 24 |
+
// doctrine{ lambda, locked_proven, trust_ceiling, trust_100_percent, adds_to_locked_8 }.
|
| 25 |
+
//
|
| 26 |
+
// HONESTY LABEL: MODELED — this surface's own top label is MODELED (a derived composed view,
|
| 27 |
+
// not a measurement). Per-node verdicts are read VERBATIM and NEVER upgraded. The map is
|
| 28 |
+
// NEVER OPERATING if any node is VIOLATED. No green "1.0 / VERIFIED" state. Trust 0.97, not 100%.
|
| 29 |
+
// COLOURS: proof-teal 0x3af4c8 (intact/operating), amber 0xf4b23a (degraded/unknown), crimson
|
| 30 |
+
// 0xff5964 (violated/halted), grey 0x42505d (neutral), lattice-blue 0x5b8dee (frame/control),
|
| 31 |
+
// violet-blue 0x8a6bff (standing-goals accent). PURPLE BANNED except 0x8a6bff. No green.
|
| 32 |
+
// 0 RUNTIME CDN. Vendored three.js via page importmap (ctx.THREE).
|
| 33 |
+
// DOCTRINE v11: COMPOSES only — adds NOTHING to the locked-8 {F1,F4,F7,F11,F12,F18,F19,F22} @
|
| 34 |
+
// c7c0ba17; Lambda stays Conjecture 1; introduces no theorem. Degrades grey on 404/error.
|
| 35 |
+
|
| 36 |
+
import { createShowcase } from "./_showcase.js";
|
| 37 |
+
|
| 38 |
+
const ID = "agentos";
|
| 39 |
+
const TITLE = "Agent OS Map · self-honest operator's-eye map (live, drift-proof)";
|
| 40 |
+
|
| 41 |
+
// same-origin, relative — no CDN, no cross-origin fetch. PURE-READ live-map endpoint.
|
| 42 |
+
const EP = "/api/a11oy/v1/govern/agentos";
|
| 43 |
+
|
| 44 |
+
// verdict / state hues — purple BANNED (except 0x8a6bff), no green
|
| 45 |
+
const C_INTACT = 0x3af4c8; // proof-teal — INTACT / OPERATING
|
| 46 |
+
const C_DEGRADED = 0xf4b23a; // amber — DEGRADED / UNKNOWN
|
| 47 |
+
const C_VIOLATED = 0xff5964; // crimson — VIOLATED / HALTED-HONEST
|
| 48 |
+
const C_NEUTRAL = 0x42505d; // grey — neutral / init
|
| 49 |
+
const C_FRAME = 0x5b8dee; // lattice-blue — frame / control edges
|
| 50 |
+
const C_GOALS = 0x8a6bff; // violet-blue — standing-goals accent (only approved purple)
|
| 51 |
+
const C_GRID = 0x1b3a44; // floor colour
|
| 52 |
+
|
| 53 |
+
function _verdictColor(v) {
|
| 54 |
+
const s = String(v || "").toUpperCase();
|
| 55 |
+
if (s === "INTACT") return C_INTACT;
|
| 56 |
+
if (s === "VIOLATED") return C_VIOLATED;
|
| 57 |
+
if (s === "UNKNOWN" || s === "DEGRADED") return C_DEGRADED;
|
| 58 |
+
return C_NEUTRAL;
|
| 59 |
+
}
|
| 60 |
+
function _stateColor(v) {
|
| 61 |
+
const s = String(v || "").toUpperCase();
|
| 62 |
+
if (s === "OPERATING") return C_INTACT;
|
| 63 |
+
if (s === "HALTED-HONEST") return C_VIOLATED;
|
| 64 |
+
return C_DEGRADED; // DEGRADED / init
|
| 65 |
+
}
|
| 66 |
+
|
| 67 |
+
// deterministic layout position (x,y,z) by node kind — an operator's-eye stack: standing goals
|
| 68 |
+
// at the top, the daily loop in the middle, the trust ledger below, optional loops in an arc.
|
| 69 |
+
function _layout(node, optIndex, optCount) {
|
| 70 |
+
const kind = String(node.kind || "");
|
| 71 |
+
if (kind === "goals") return [0, 6.0, 0];
|
| 72 |
+
if (kind === "loop") return [0, 3.0, 0];
|
| 73 |
+
if (kind === "ledger") return [0, 0.2, 0];
|
| 74 |
+
// optional_loop — spread along an arc beneath the daily loop
|
| 75 |
+
const n = Math.max(1, optCount);
|
| 76 |
+
const span = 12.0;
|
| 77 |
+
const step = n > 1 ? span / (n - 1) : 0;
|
| 78 |
+
const x = n > 1 ? -span / 2 + step * optIndex : 0;
|
| 79 |
+
return [x, 1.6, -4.2];
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
let _stage = null, _THREE = null, _ctx = null, _group = null, _show = null;
|
| 83 |
+
let _frameReg = false, _polls = [], _el = {}, _badge = null, _plain = false;
|
| 84 |
+
|
| 85 |
+
let _plate = null; // THREE.Mesh — the map-state plate
|
| 86 |
+
let _nodes = []; // Array<{ id, mesh, verdict, pos }>
|
| 87 |
+
let _edges = []; // Array<{ line, flow }>
|
| 88 |
+
|
| 89 |
+
// live state (all read from JSON; nothing invented)
|
| 90 |
+
const S = {
|
| 91 |
+
label: null, // top honesty label VERBATIM (MODELED)
|
| 92 |
+
state: null, // OPERATING | DEGRADED | HALTED-HONEST
|
| 93 |
+
reason: null,
|
| 94 |
+
nodes: [],
|
| 95 |
+
edges: [],
|
| 96 |
+
present: null,
|
| 97 |
+
vc: {}, // verdict_counts
|
| 98 |
+
hwReach: null,
|
| 99 |
+
hwVerd: null,
|
| 100 |
+
trustCeil: null,
|
| 101 |
+
lambda: null,
|
| 102 |
+
locked: null,
|
| 103 |
+
mode: "init",
|
| 104 |
+
};
|
| 105 |
+
|
| 106 |
+
// =============================================================================
|
| 107 |
+
export function mount(ctx) {
|
| 108 |
+
_ctx = ctx; _stage = ctx.stage; _THREE = ctx.THREE;
|
| 109 |
+
_group = new _THREE.Group();
|
| 110 |
+
_stage.scene.add(_group);
|
| 111 |
+
_stage.camera.position.set(0, 4.2, 20);
|
| 112 |
+
try { if (_stage.controls && _stage.controls.target) { _stage.controls.target.set(0, 2.6, -1); _stage.controls.update(); } } catch (_) {}
|
| 113 |
+
try { _stage.setBloom(true); } catch (_) {}
|
| 114 |
+
|
| 115 |
+
_buildFloor();
|
| 116 |
+
_buildPlate();
|
| 117 |
+
|
| 118 |
+
if (!_frameReg) { _stage.onFrame(_onFrame); _frameReg = true; }
|
| 119 |
+
|
| 120 |
+
_badge = ctx.live.createBadge();
|
| 121 |
+
_polls.push(ctx.live.poll(EP, 8000, _onData, {
|
| 122 |
+
badge: _badge, onState: (m) => { S.mode = m.state; _paintOverlay(); _paintPlate(); },
|
| 123 |
+
}));
|
| 124 |
+
|
| 125 |
+
_buildOverlay();
|
| 126 |
+
return { id: ID, started: true };
|
| 127 |
+
}
|
| 128 |
+
|
| 129 |
+
// =============================================================================
|
| 130 |
+
function _buildFloor() {
|
| 131 |
+
const THREE = _THREE;
|
| 132 |
+
const grid = new THREE.GridHelper(44, 44, C_GRID, 0x0f2027);
|
| 133 |
+
grid.material.opacity = 0.16; grid.material.transparent = true; grid.position.y = -0.01;
|
| 134 |
+
_group.add(grid);
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
function _buildPlate() {
|
| 138 |
+
const THREE = _THREE;
|
| 139 |
+
const g = new THREE.BoxGeometry(7.2, 1.2, 0.6);
|
| 140 |
+
_plate = new THREE.Mesh(g, new THREE.MeshStandardMaterial({
|
| 141 |
+
color: C_DEGRADED, emissive: C_DEGRADED, emissiveIntensity: 0.35,
|
| 142 |
+
transparent: true, opacity: 0.9,
|
| 143 |
+
}));
|
| 144 |
+
_plate.position.set(0, 8.4, 0);
|
| 145 |
+
_group.add(_plate);
|
| 146 |
+
}
|
| 147 |
+
|
| 148 |
+
// Build (or rebuild) the node/edge graph from the CURRENT feed (never a stale hard-coded set).
|
| 149 |
+
function _buildGraph() {
|
| 150 |
+
const THREE = _THREE;
|
| 151 |
+
_disposeGraph();
|
| 152 |
+
|
| 153 |
+
const nodes = Array.isArray(S.nodes) ? S.nodes : [];
|
| 154 |
+
if (!nodes.length) return;
|
| 155 |
+
|
| 156 |
+
// assign layout positions
|
| 157 |
+
const optNodes = nodes.filter((n) => String(n.kind) === "optional_loop");
|
| 158 |
+
const pos = {};
|
| 159 |
+
let oi = 0;
|
| 160 |
+
nodes.forEach((n) => {
|
| 161 |
+
if (String(n.kind) === "optional_loop") { pos[n.id] = _layout(n, oi, optNodes.length); oi++; }
|
| 162 |
+
else { pos[n.id] = _layout(n, 0, optNodes.length); }
|
| 163 |
+
});
|
| 164 |
+
|
| 165 |
+
// edges first (so nodes render on top)
|
| 166 |
+
(Array.isArray(S.edges) ? S.edges : []).forEach((e) => {
|
| 167 |
+
const a = pos[e.src], b = pos[e.dst];
|
| 168 |
+
if (!a || !b) return; // never draw a dangling edge to an absent node
|
| 169 |
+
const geo = new THREE.BufferGeometry().setFromPoints([
|
| 170 |
+
new THREE.Vector3(a[0], a[1], a[2]), new THREE.Vector3(b[0], b[1], b[2]),
|
| 171 |
+
]);
|
| 172 |
+
const col = String(e.flow) === "data" ? C_INTACT : C_FRAME;
|
| 173 |
+
const line = new THREE.Line(geo, new THREE.LineBasicMaterial({
|
| 174 |
+
color: col, transparent: true, opacity: 0.42,
|
| 175 |
+
}));
|
| 176 |
+
_group.add(line);
|
| 177 |
+
_edges.push({ line, flow: String(e.flow) });
|
| 178 |
+
});
|
| 179 |
+
|
| 180 |
+
// nodes
|
| 181 |
+
nodes.forEach((n) => {
|
| 182 |
+
const p = pos[n.id];
|
| 183 |
+
if (!p) return;
|
| 184 |
+
const isGoals = String(n.kind) === "goals";
|
| 185 |
+
const base = _verdictColor(n.verdict);
|
| 186 |
+
const geo = isGoals
|
| 187 |
+
? new THREE.BoxGeometry(1.7, 1.7, 1.7)
|
| 188 |
+
: new THREE.SphereGeometry(0.95, 24, 24);
|
| 189 |
+
const mesh = new THREE.Mesh(geo, new THREE.MeshStandardMaterial({
|
| 190 |
+
color: base, emissive: base, emissiveIntensity: 0.3, transparent: true, opacity: 0.94,
|
| 191 |
+
}));
|
| 192 |
+
mesh.position.set(p[0], p[1], p[2]);
|
| 193 |
+
_group.add(mesh);
|
| 194 |
+
|
| 195 |
+
// a thin accent ring for the standing-goals node (violet-blue, the only approved purple)
|
| 196 |
+
if (isGoals) {
|
| 197 |
+
const ring = new THREE.Mesh(
|
| 198 |
+
new THREE.TorusGeometry(1.5, 0.05, 8, 40),
|
| 199 |
+
new THREE.MeshStandardMaterial({ color: C_GOALS, emissive: C_GOALS, emissiveIntensity: 0.5,
|
| 200 |
+
transparent: true, opacity: 0.7 }));
|
| 201 |
+
ring.position.set(p[0], p[1], p[2]);
|
| 202 |
+
ring.rotation.x = Math.PI / 2;
|
| 203 |
+
_group.add(ring);
|
| 204 |
+
_nodes.push({ id: n.id + ":ring", mesh: ring, verdict: null, pos: p });
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
_nodes.push({ id: n.id, mesh, verdict: String(n.verdict || ""), pos: p });
|
| 208 |
+
});
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
function _disposeGraph() {
|
| 212 |
+
const rm = (o) => {
|
| 213 |
+
if (!o) return;
|
| 214 |
+
try {
|
| 215 |
+
if (o.geometry && o.geometry.dispose) o.geometry.dispose();
|
| 216 |
+
if (o.material) { const ms = Array.isArray(o.material) ? o.material : [o.material]; ms.forEach((m) => m.dispose && m.dispose()); }
|
| 217 |
+
if (_group) _group.remove(o);
|
| 218 |
+
} catch (_) {}
|
| 219 |
+
};
|
| 220 |
+
_nodes.forEach((n) => rm(n.mesh));
|
| 221 |
+
_edges.forEach((e) => rm(e.line));
|
| 222 |
+
_nodes = []; _edges = [];
|
| 223 |
+
}
|
| 224 |
+
|
| 225 |
+
// =============================================================================
|
| 226 |
+
// live data handler — read VERBATIM, never upgrade
|
| 227 |
+
// =============================================================================
|
| 228 |
+
function _onData(j) {
|
| 229 |
+
S.label = (j && j.label ? String(j.label) : "MODELED").toUpperCase();
|
| 230 |
+
S.state = j && j.state ? String(j.state).toUpperCase() : null;
|
| 231 |
+
S.reason = j && j.state_reason ? String(j.state_reason) : null;
|
| 232 |
+
S.nodes = (j && Array.isArray(j.nodes)) ? j.nodes : [];
|
| 233 |
+
S.edges = (j && Array.isArray(j.edges)) ? j.edges : [];
|
| 234 |
+
|
| 235 |
+
const sm = (j && j.summary) || {};
|
| 236 |
+
S.present = typeof sm.nodes_present === "number" ? sm.nodes_present : null;
|
| 237 |
+
S.vc = (sm.verdict_counts && typeof sm.verdict_counts === "object") ? sm.verdict_counts : {};
|
| 238 |
+
S.hwReach = typeof sm.honestywall_reachable === "boolean" ? sm.honestywall_reachable : null;
|
| 239 |
+
S.hwVerd = sm.honestywall_verdict != null ? String(sm.honestywall_verdict) : null;
|
| 240 |
+
|
| 241 |
+
const d = (j && j.doctrine) || {};
|
| 242 |
+
S.trustCeil = typeof d.trust_ceiling === "number" ? d.trust_ceiling : null;
|
| 243 |
+
S.lambda = typeof d.lambda === "string" ? d.lambda : null;
|
| 244 |
+
S.locked = typeof d.locked_proven === "number" ? d.locked_proven : null;
|
| 245 |
+
|
| 246 |
+
_buildGraph();
|
| 247 |
+
_paintPlate();
|
| 248 |
+
_paintOverlay();
|
| 249 |
+
_paintList();
|
| 250 |
+
}
|
| 251 |
+
|
| 252 |
+
// =============================================================================
|
| 253 |
+
function _onFrame() {
|
| 254 |
+
const t = performance.now();
|
| 255 |
+
if (_group) _group.rotation.y = Math.sin(t * 0.00005) * 0.10;
|
| 256 |
+
|
| 257 |
+
const live = S.mode === "live";
|
| 258 |
+
if (_plate) {
|
| 259 |
+
const pulse = 0.35 + (live ? 0.25 : 0.08) * (0.5 + 0.5 * Math.sin(t * 0.003));
|
| 260 |
+
_plate.material.emissiveIntensity = pulse;
|
| 261 |
+
}
|
| 262 |
+
for (let i = 0; i < _nodes.length; i++) {
|
| 263 |
+
const nd = _nodes[i];
|
| 264 |
+
if (!nd.mesh || !nd.mesh.material) continue;
|
| 265 |
+
const violated = nd.verdict === "VIOLATED";
|
| 266 |
+
const base = violated ? 0.6 : (live ? 0.3 : 0.12);
|
| 267 |
+
const wob = 0.15 * (0.5 + 0.5 * Math.sin(t * 0.002 + i));
|
| 268 |
+
nd.mesh.material.emissiveIntensity = base + (live ? wob : 0);
|
| 269 |
+
nd.mesh.material.opacity = live ? 0.94 : 0.4;
|
| 270 |
+
}
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
// =============================================================================
|
| 274 |
+
function _paintPlate() {
|
| 275 |
+
if (!_plate) return;
|
| 276 |
+
const col = _stateColor(S.mode === "live" ? S.state : null);
|
| 277 |
+
_plate.material.color.setHex(col);
|
| 278 |
+
_plate.material.emissive.setHex(col);
|
| 279 |
+
}
|
| 280 |
+
|
| 281 |
+
// =============================================================================
|
| 282 |
+
// overlay (HUD)
|
| 283 |
+
// =============================================================================
|
| 284 |
+
function _buildOverlay() {
|
| 285 |
+
const ctx = _ctx;
|
| 286 |
+
_show = createShowcase(ctx, {
|
| 287 |
+
id: ID, title: TITLE, accent: "#5b8dee", badge: _badge,
|
| 288 |
+
chips: [{ label: "MODELED", text: "composed", name: "lbl" },
|
| 289 |
+
{ label: "—", text: "state", name: "stt" }],
|
| 290 |
+
legend: ["MODELED"],
|
| 291 |
+
});
|
| 292 |
+
const host = _show.body;
|
| 293 |
+
|
| 294 |
+
const sub = document.createElement("div");
|
| 295 |
+
sub.style.cssText = "color:#9fb1bf;font-size:11px;line-height:1.55";
|
| 296 |
+
sub.innerHTML =
|
| 297 |
+
'A live operator’s-eye map of the whole agent OS, composed <b>only</b> from our own ' +
|
| 298 |
+
'governed components: a <b>daily loop</b>, a <b>trust ledger</b>, <b>standing goals</b>, and ' +
|
| 299 |
+
'optional loops. Node presence is derived from the live surface registry; each node’s ' +
|
| 300 |
+
'honesty verdict is read <b>VERBATIM</b> from the honesty-wall aggregate. The map reads ' +
|
| 301 |
+
'<b>OPERATING</b> only when every node is INTACT, <b>DEGRADED</b> when a backing is UNKNOWN, ' +
|
| 302 |
+
'and <b>HALTED-HONEST</b> the instant any node is VIOLATED — it can <b>never</b> render green ' +
|
| 303 |
+
'while something is wrong. Honest by construction, not a hand-drawn diagram. 0 runtime CDN.';
|
| 304 |
+
host.appendChild(sub);
|
| 305 |
+
|
| 306 |
+
const spark = document.createElement("div");
|
| 307 |
+
spark.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.5;border-left:2px solid #8a6bff;padding-left:7px";
|
| 308 |
+
spark.innerHTML =
|
| 309 |
+
'concept spark: Agentic-OS mapping, <b>@Av1dlive on X</b> — we borrow the ' +
|
| 310 |
+
'single-operator-map idea; we do not copy their diagrams or claim Fable-5 specifics. ' +
|
| 311 |
+
'agentos composes only our own governed components.';
|
| 312 |
+
host.appendChild(spark);
|
| 313 |
+
|
| 314 |
+
const card = document.createElement("div");
|
| 315 |
+
card.style.cssText = "background:#0a1117;border:1px solid #1d2a36;border-radius:9px;padding:9px 10px;display:flex;flex-direction:column;gap:6px";
|
| 316 |
+
|
| 317 |
+
const grid = document.createElement("div");
|
| 318 |
+
grid.style.cssText = "display:grid;grid-template-columns:1fr;gap:4px";
|
| 319 |
+
function kpiRow(id, label) {
|
| 320 |
+
const r = document.createElement("div");
|
| 321 |
+
r.style.cssText = "display:flex;justify-content:space-between;gap:10px;font-size:11px";
|
| 322 |
+
const l = document.createElement("span"); l.style.cssText = "color:#9fb1bf"; l.textContent = label;
|
| 323 |
+
const v = document.createElement("b");
|
| 324 |
+
v.id = id;
|
| 325 |
+
v.style.cssText = "font-variant-numeric:tabular-nums;color:#eef3f6;text-align:right;max-width:62%;overflow-wrap:anywhere";
|
| 326 |
+
v.textContent = "—";
|
| 327 |
+
_el[id] = v;
|
| 328 |
+
r.appendChild(l); r.appendChild(v); return r;
|
| 329 |
+
}
|
| 330 |
+
grid.appendChild(kpiRow("ao-state", "map state"));
|
| 331 |
+
grid.appendChild(kpiRow("ao-nodes", "nodes present"));
|
| 332 |
+
grid.appendChild(kpiRow("ao-intact", "nodes INTACT"));
|
| 333 |
+
grid.appendChild(kpiRow("ao-unk", "nodes UNKNOWN"));
|
| 334 |
+
grid.appendChild(kpiRow("ao-viol", "nodes VIOLATED"));
|
| 335 |
+
grid.appendChild(kpiRow("ao-hw", "honesty-wall verdict"));
|
| 336 |
+
grid.appendChild(kpiRow("ao-locked", "locked proofs"));
|
| 337 |
+
grid.appendChild(kpiRow("ao-trust", "trust ceiling"));
|
| 338 |
+
grid.appendChild(kpiRow("ao-lambda", "Λ"));
|
| 339 |
+
card.appendChild(grid);
|
| 340 |
+
host.appendChild(card);
|
| 341 |
+
|
| 342 |
+
// scrollable per-node list (text mirror of the graph).
|
| 343 |
+
const listWrap = document.createElement("div");
|
| 344 |
+
listWrap.style.cssText = "display:flex;flex-direction:column;gap:4px;max-height:170px;overflow:auto";
|
| 345 |
+
_el["list"] = listWrap;
|
| 346 |
+
host.appendChild(listWrap);
|
| 347 |
+
|
| 348 |
+
const leg = document.createElement("div");
|
| 349 |
+
leg.style.cssText = "font-size:9.5px;color:#6b7a86;line-height:1.6";
|
| 350 |
+
leg.innerHTML =
|
| 351 |
+
'<span style="color:#3af4c8">●</span> INTACT / OPERATING ' +
|
| 352 |
+
'<span style="color:#f4b23a">●</span> UNKNOWN / degraded ' +
|
| 353 |
+
'<span style="color:#ff5964">●</span> VIOLATED / halted ' +
|
| 354 |
+
'<span style="color:#8a6bff">◯</span> standing goals. ' +
|
| 355 |
+
'MODELED · verdicts read verbatim, never upgraded · never OPERATING if violated.';
|
| 356 |
+
card.appendChild(leg);
|
| 357 |
+
|
| 358 |
+
const pl = document.createElement("button");
|
| 359 |
+
pl.textContent = "◑ what this means";
|
| 360 |
+
pl.title = "Toggle plain-language explanation for investors & consumers.";
|
| 361 |
+
pl.style.cssText = "font:11px ui-monospace,monospace;padding:5px 11px;border-radius:7px;border:1px solid #3af4c8;background:#08140f;color:#3af4c8;cursor:pointer;width:fit-content";
|
| 362 |
+
pl.addEventListener("click", () => {
|
| 363 |
+
_plain = !_plain;
|
| 364 |
+
pl.style.background = _plain ? "#0f2a20" : "#08140f";
|
| 365 |
+
_applyPlain();
|
| 366 |
+
});
|
| 367 |
+
host.appendChild(pl);
|
| 368 |
+
|
| 369 |
+
const pd = document.createElement("div");
|
| 370 |
+
pd.id = "ao-plain";
|
| 371 |
+
pd.style.cssText = "font-size:10.5px;color:#c9d6df;line-height:1.55;border:1px dashed #26333f;border-radius:7px;padding:7px 9px;display:none";
|
| 372 |
+
_el["plain"] = pd;
|
| 373 |
+
host.appendChild(pd);
|
| 374 |
+
|
| 375 |
+
_paintOverlay();
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
function _applyPlain() {
|
| 379 |
+
const pd = _el["plain"];
|
| 380 |
+
if (!pd) return;
|
| 381 |
+
pd.style.display = _plain ? "block" : "none";
|
| 382 |
+
if (!_plain) return;
|
| 383 |
+
pd.innerHTML =
|
| 384 |
+
"<b>What this means:</b> one honest map of how the agent system actually runs — a daily " +
|
| 385 |
+
"loop, a trust ledger, the standing goals it must obey, and the optional loops it can call. " +
|
| 386 |
+
"Every box is a real, running part of our own platform (nothing is drawn by hand), and each " +
|
| 387 |
+
"one shows whether it is currently honest. If every part checks out the map reads " +
|
| 388 |
+
"<b>OPERATING</b>; if a part can’t be reached it reads <b>DEGRADED</b>; and if any part " +
|
| 389 |
+
"breaks a house rule the whole map reads <b>HALTED-HONEST</b> — it will <b>never</b> claim " +
|
| 390 |
+
"OPERATING while something is wrong. No “verified / 1.0” state.";
|
| 391 |
+
}
|
| 392 |
+
|
| 393 |
+
function _tok(s) {
|
| 394 |
+
if (s === "live") return null;
|
| 395 |
+
if (s === "missing") return "NO-LIVE-DATA";
|
| 396 |
+
if (s === "degraded") return "DEGRADED";
|
| 397 |
+
if (s === "error") return "OFFLINE";
|
| 398 |
+
return "…";
|
| 399 |
+
}
|
| 400 |
+
function _set(id, v) { if (_el[id]) _el[id].textContent = v; }
|
| 401 |
+
function _n(v) { return v == null ? "—" : String(v); }
|
| 402 |
+
|
| 403 |
+
function _paintList() {
|
| 404 |
+
const wrap = _el["list"];
|
| 405 |
+
if (!wrap) return;
|
| 406 |
+
wrap.innerHTML = "";
|
| 407 |
+
(Array.isArray(S.nodes) ? S.nodes : []).forEach((n) => {
|
| 408 |
+
const row = document.createElement("div");
|
| 409 |
+
row.style.cssText = "display:flex;justify-content:space-between;gap:8px;font-size:10.5px;border-bottom:1px solid #12202b;padding:2px 0";
|
| 410 |
+
const left = document.createElement("span");
|
| 411 |
+
left.style.cssText = "color:#c9d6df;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:66%";
|
| 412 |
+
left.textContent = String(n.title || n.id);
|
| 413 |
+
const val = document.createElement("b");
|
| 414 |
+
const hex = "#" + _verdictColor(n.verdict).toString(16).padStart(6, "0");
|
| 415 |
+
val.style.cssText = "color:" + hex + ";font-variant-numeric:tabular-nums";
|
| 416 |
+
val.textContent = String(n.verdict || "—");
|
| 417 |
+
row.appendChild(left); row.appendChild(val);
|
| 418 |
+
wrap.appendChild(row);
|
| 419 |
+
});
|
| 420 |
+
}
|
| 421 |
+
|
| 422 |
+
function _paintOverlay() {
|
| 423 |
+
const t = _tok(S.mode);
|
| 424 |
+
const stt = t || (S.state || "—");
|
| 425 |
+
if (_show) {
|
| 426 |
+
_show.setChip("lbl", S.label || "MODELED", { text: "composed" });
|
| 427 |
+
_show.setChip("stt", stt, { text: "state" });
|
| 428 |
+
}
|
| 429 |
+
_set("ao-state", stt);
|
| 430 |
+
_set("ao-nodes", t || _n(S.present));
|
| 431 |
+
_set("ao-intact", t || _n(S.vc && S.vc.INTACT != null ? S.vc.INTACT : null));
|
| 432 |
+
_set("ao-unk", t || _n(S.vc && S.vc.UNKNOWN != null ? S.vc.UNKNOWN : null));
|
| 433 |
+
_set("ao-viol", t || _n(S.vc && S.vc.VIOLATED != null ? S.vc.VIOLATED : null));
|
| 434 |
+
_set("ao-hw", t || (S.hwVerd || "—"));
|
| 435 |
+
_set("ao-locked", t || (S.locked != null ? String(S.locked) : "—"));
|
| 436 |
+
_set("ao-trust", t || (S.trustCeil != null ? String(S.trustCeil) : "—"));
|
| 437 |
+
_set("ao-lambda", t || (S.lambda || "—"));
|
| 438 |
+
if (_plain) _applyPlain();
|
| 439 |
+
}
|
| 440 |
+
|
| 441 |
+
// =============================================================================
|
| 442 |
+
export function unmount() {
|
| 443 |
+
_polls.forEach((p) => { try { p.stop(); } catch (_) {} }); _polls = [];
|
| 444 |
+
try { if (_show) _show.destroy(); } catch (_) {}
|
| 445 |
+
try {
|
| 446 |
+
_disposeGraph();
|
| 447 |
+
if (_group && _stage) {
|
| 448 |
+
_group.traverse((o) => {
|
| 449 |
+
if (o.geometry && o.geometry.dispose) o.geometry.dispose();
|
| 450 |
+
if (o.material) {
|
| 451 |
+
const ms = Array.isArray(o.material) ? o.material : [o.material];
|
| 452 |
+
ms.forEach((mm) => { if (mm.dispose) mm.dispose(); });
|
| 453 |
+
}
|
| 454 |
+
});
|
| 455 |
+
_stage.scene.remove(_group);
|
| 456 |
+
}
|
| 457 |
+
} catch (_) {}
|
| 458 |
+
_group = _show = null;
|
| 459 |
+
_plate = null; _nodes = []; _edges = [];
|
| 460 |
+
_el = {}; _badge = null; _plain = false; _frameReg = false;
|
| 461 |
+
_stage = _THREE = _ctx = null;
|
| 462 |
+
S.label = S.state = S.reason = null;
|
| 463 |
+
S.nodes = []; S.edges = [];
|
| 464 |
+
S.present = null; S.vc = {}; S.hwReach = null; S.hwVerd = null;
|
| 465 |
+
S.trustCeil = S.lambda = S.locked = null; S.mode = "init";
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
export default { id: ID, title: TITLE, endpoints: [EP], mount, unmount };
|