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: 916 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/evalarena.js +284 -0
static/3d/holographic.html
CHANGED
|
@@ -166,6 +166,7 @@ const SURFACES = [
|
|
| 166 |
{ id: "agentmem", title: "AgentMem · Λ-Governed Agent Memory (synthesis)", mod: "/static/3d/surfaces/agentmem.js" },
|
| 167 |
{ id: "loopforge", title: "Loop Forge", mod: "/static/3d/surfaces/loopforge.js" },
|
| 168 |
{ id: "edgefusion", title: "EdgeFusion · Λ-Gated Energy-Proportional Sensor Fusion (synthesis)", mod: "/static/3d/surfaces/edgefusion.js" },
|
|
|
|
| 169 |
];
|
| 170 |
|
| 171 |
const stageEl = document.getElementById("stage");
|
|
|
|
| 166 |
{ id: "agentmem", title: "AgentMem · Λ-Governed Agent Memory (synthesis)", mod: "/static/3d/surfaces/agentmem.js" },
|
| 167 |
{ id: "loopforge", title: "Loop Forge", mod: "/static/3d/surfaces/loopforge.js" },
|
| 168 |
{ id: "edgefusion", title: "EdgeFusion · Λ-Gated Energy-Proportional Sensor Fusion (synthesis)", mod: "/static/3d/surfaces/edgefusion.js" },
|
| 169 |
+
{ id: "evalarena", title: "Eval Arena · Governed Eval / Red-Team", mod: "/static/3d/surfaces/evalarena.js" },
|
| 170 |
];
|
| 171 |
|
| 172 |
const stageEl = document.getElementById("stage");
|
static/3d/surfaces/evalarena.js
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 2 |
+
// © 2026 Lutar, Stephen P. — SZL Holdings · ORCID 0009-0001-0110-4173 · Doctrine v11
|
| 3 |
+
//
|
| 4 |
+
// surfaces/evalarena.js — GOVERNED EVAL / RED-TEAM ARENA (Wave H, Team 2).
|
| 5 |
+
// A MODELED 3D rendering of a governed evaluation run: each eval CASE is a node in
|
| 6 |
+
// an arc that flies toward a central Λ-GATE core; passing cases glow proof-teal,
|
| 7 |
+
// failing cases dim grey, and RED-TEAM (should-refuse) cases that are correctly
|
| 8 |
+
// refused glow gold. A HUD shows the HELM-style per-metric breakdown (correctness /
|
| 9 |
+
// refusal / honesty-adherence), the Λ advisory (Conjecture 1 — gray, NEVER green,
|
| 10 |
+
// capped 0.97), and the SIGNED-RECEIPT state (REAL ECDSA-P256 in-Space, honest
|
| 11 |
+
// UNSIGNED-LOCAL locally) that is ingested to /llm/forum on each run.
|
| 12 |
+
//
|
| 13 |
+
// This is an SZL GOVERNED re-expression of the eval-framework "fashion" — none of
|
| 14 |
+
// the leaders ship eval + Λ-gate + signed-receipt-per-run + forum-ingest together.
|
| 15 |
+
//
|
| 16 |
+
// LEADERS STUDIED & CITED (clean-room; we ADOPT the fashion, NOT the code):
|
| 17 |
+
// OpenAI Evals — registry of evals; sample + graded template (match/includes/model-graded)
|
| 18 |
+
// https://github.com/openai/evals
|
| 19 |
+
// Anthropic evals — Discrim-Eval + model-written evals; refusal/safety discipline
|
| 20 |
+
// https://github.com/anthropics/evals
|
| 21 |
+
// HELM (Stanford CRFM) — holistic: many scenarios x many metrics, reproducible
|
| 22 |
+
// https://crfm.stanford.edu/helm/ · arXiv:2211.09110
|
| 23 |
+
// EleutherAI lm-evaluation-harness — task YAML/groups; versioned reproducible results
|
| 24 |
+
// https://github.com/EleutherAI/lm-evaluation-harness
|
| 25 |
+
// UK AISI Inspect — Task = Dataset + Solver + Scorer; model-graded scoring; eval log
|
| 26 |
+
// https://inspect.aisi.org.uk/
|
| 27 |
+
// NVIDIA garak — probes x detectors x generators x harnesses; JSONL report + hit log
|
| 28 |
+
// https://github.com/NVIDIA/garak
|
| 29 |
+
// promptfoo — declarative prompts x providers x asserts + red-team plugins
|
| 30 |
+
// https://github.com/promptfoo/promptfoo
|
| 31 |
+
//
|
| 32 |
+
// HONESTY: MODELED — with no provider key wired, model answers are honest reference-
|
| 33 |
+
// oracle stubs; the scoring / Λ-axis / signed-receipt / forum-ingest pipeline is
|
| 34 |
+
// REAL. Λ = Conjecture 1 (advisory, gray, never green), trust ceiling 0.97 (never
|
| 35 |
+
// 1.0). Nothing here touches the locked-8. ZERO PURPLE. Vendored three via ctx.THREE.
|
| 36 |
+
// Surface export shape mirrors loopforge.js / harness.js exactly:
|
| 37 |
+
// export default { id, title, endpoints, mount, unmount }
|
| 38 |
+
|
| 39 |
+
const ID = "evalarena";
|
| 40 |
+
const TITLE = "Eval Arena";
|
| 41 |
+
|
| 42 |
+
const EP_RUN = "/api/a11oy/v1/eval/run";
|
| 43 |
+
const EP_SUITES = "/api/a11oy/v1/eval/suites";
|
| 44 |
+
const EP_HEALTH = "/api/a11oy/v1/eval/health";
|
| 45 |
+
|
| 46 |
+
// data-viz hues — purple BANNED
|
| 47 |
+
const C_GATE = 0x8a6bff; // violet-blue (Λ-gate ring) (blue-violet, NOT purple)
|
| 48 |
+
const C_CORE = 0x3af4c8; // proof-teal (gate core)
|
| 49 |
+
const C_PASS = 0x3af4c8; // proof-teal (passed case)
|
| 50 |
+
const C_REFUSE = 0xe8c074; // gold (red-team case correctly refused)
|
| 51 |
+
const C_FAIL = 0x5a6570; // grey (failed case)
|
| 52 |
+
const C_DIM = 0x42505d; // grey (degraded / no-live-data)
|
| 53 |
+
const C_EDGE = 0x1b3a44;
|
| 54 |
+
|
| 55 |
+
const RING_R = 3.0, ARC_R = 5.4, CORE_R = 0.62;
|
| 56 |
+
|
| 57 |
+
let _stage=null,_THREE=null,_ctx=null,_group=null,_overlay=null;
|
| 58 |
+
let _frameReg=false,_polls=[],_badge=null,_plain=false,_t0=0;
|
| 59 |
+
let _ring=null,_ringGlow=null,_core=null,_caseGroup=null,_caseMeshes=[];
|
| 60 |
+
|
| 61 |
+
const S = {
|
| 62 |
+
label:"MODELED", state:"init",
|
| 63 |
+
suiteId:"core_honest_v1", suiteTitle:null, suiteVersion:null,
|
| 64 |
+
modelId:"claude_sonnet_4_6",
|
| 65 |
+
cases:[], // [{id, cat, passed, scorer}]
|
| 66 |
+
nCases:null, nPassed:null, accuracy:null,
|
| 67 |
+
correctness:null, refusal:null, honesty:null, control:null,
|
| 68 |
+
lambda:null, lambdaAxes:null,
|
| 69 |
+
signed:null, signMode:null, forumIngested:null,
|
| 70 |
+
suiteRoster:[],
|
| 71 |
+
};
|
| 72 |
+
|
| 73 |
+
function _clamp01(x){ return x<0?0:(x>1?1:x); }
|
| 74 |
+
|
| 75 |
+
function mount(ctx){
|
| 76 |
+
_ctx=ctx; _stage=ctx.stage; _THREE=ctx.THREE;
|
| 77 |
+
_group=new _THREE.Group(); _stage.scene.add(_group);
|
| 78 |
+
try{ _stage.camera.position.set(0,8,19); }catch(_){}
|
| 79 |
+
try{ if(_stage.controls&&_stage.controls.target){ _stage.controls.target.set(0,1.0,0); _stage.controls.update(); } }catch(_){}
|
| 80 |
+
try{ _stage.setBloom&&_stage.setBloom(true); }catch(_){}
|
| 81 |
+
_t0=(typeof performance!=="undefined"?performance.now():Date.now());
|
| 82 |
+
_buildOverlay(ctx);
|
| 83 |
+
_buildScaffold();
|
| 84 |
+
_badge=ctx.live.createBadge();
|
| 85 |
+
const brow=_overlay&&_overlay.querySelector("#ea-badgerow");
|
| 86 |
+
if(brow&&_badge&&_badge.el) brow.appendChild(_badge.el);
|
| 87 |
+
|
| 88 |
+
// POST /eval/run — the CORE poll. Body carries {suite, model_id}.
|
| 89 |
+
_polls.push(ctx.live.poll(EP_RUN, 8000, _onRun, {
|
| 90 |
+
badge:_badge,
|
| 91 |
+
onState:(m)=>{ S.state=m.state; _paintOverlay(); },
|
| 92 |
+
fetchInit:{ method:"POST", headers:{"accept":"application/json","content-type":"application/json"},
|
| 93 |
+
body: JSON.stringify({ suite:S.suiteId, model_id:S.modelId }) },
|
| 94 |
+
}));
|
| 95 |
+
// GET /eval/suites — populate the roster (metadata only).
|
| 96 |
+
_polls.push(ctx.live.poll(EP_SUITES, 30000, _onSuites, {}));
|
| 97 |
+
|
| 98 |
+
if(!_frameReg&&_stage.onFrame){ _stage.onFrame(_animate); _frameReg=true; }
|
| 99 |
+
_paintOverlay();
|
| 100 |
+
return { id:ID, started:true };
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
function _readLabel(j){ const l=(j&&j.honesty_label!=null)?j.honesty_label:(j&&j.label!=null?j.label:"MODELED"); return String(l).toUpperCase(); }
|
| 104 |
+
|
| 105 |
+
function _onSuites(j){
|
| 106 |
+
if(!j||!Array.isArray(j.suites)) return;
|
| 107 |
+
S.suiteRoster=j.suites.map((s)=>({ id:String(s.id), title:String(s.title||s.id), n:Number(s.n_cases)||0,
|
| 108 |
+
version:String(s.version||""), cats:Array.isArray(s.categories)?s.categories:[] }));
|
| 109 |
+
_paintOverlay();
|
| 110 |
+
}
|
| 111 |
+
|
| 112 |
+
function _onRun(j){
|
| 113 |
+
if(!j){ S.state="error"; _paintOverlay(); return; }
|
| 114 |
+
S.label=_readLabel(j);
|
| 115 |
+
const su=j.suite||{}; S.suiteTitle=su.title||S.suiteId; S.suiteVersion=su.version||null;
|
| 116 |
+
S.modelId=String(j.model_id||S.modelId);
|
| 117 |
+
const results=Array.isArray(j.results)?j.results:[];
|
| 118 |
+
S.cases=results.map((r)=>({ id:String(r.id), cat:String(r.category||"correctness"),
|
| 119 |
+
passed:!!r.passed, scorer:String(r.scorer||"") }));
|
| 120 |
+
const agg=j.aggregate||{};
|
| 121 |
+
S.nCases=agg.n_cases!=null?agg.n_cases:S.cases.length;
|
| 122 |
+
S.nPassed=agg.n_passed!=null?agg.n_passed:S.cases.filter((c)=>c.passed).length;
|
| 123 |
+
S.accuracy=agg.accuracy!=null?Number(agg.accuracy):null;
|
| 124 |
+
S.correctness=agg.correctness_rate!=null?Number(agg.correctness_rate):null;
|
| 125 |
+
S.refusal=agg.refusal_rate!=null?Number(agg.refusal_rate):null;
|
| 126 |
+
S.honesty=agg.honesty_adherence_rate!=null?Number(agg.honesty_adherence_rate):null;
|
| 127 |
+
S.control=agg.over_refusal_control_rate!=null?Number(agg.over_refusal_control_rate):null;
|
| 128 |
+
S.lambda=agg.lambda!=null?Number(agg.lambda):null;
|
| 129 |
+
S.lambdaAxes=agg.lambda_axes||null;
|
| 130 |
+
const rec=j.receipt||{}; const dsse=rec.dsse||{}; const sign=rec.signing||{};
|
| 131 |
+
S.signed=(dsse.signed===true);
|
| 132 |
+
S.signMode=sign.mode||(S.signed?"REAL":"UNSIGNED-LOCAL");
|
| 133 |
+
const fi=j.forum_ingest||{}; S.forumIngested=(fi.ingested===true);
|
| 134 |
+
_rebuildCases();
|
| 135 |
+
_paintOverlay();
|
| 136 |
+
}
|
| 137 |
+
|
| 138 |
+
function _buildScaffold(){
|
| 139 |
+
// Λ-gate ring (blue-violet, advisory — NEVER green).
|
| 140 |
+
const rg=new _THREE.TorusGeometry(RING_R,0.055,20,128);
|
| 141 |
+
const rm=new _THREE.MeshStandardMaterial({ color:C_GATE,emissive:C_GATE,emissiveIntensity:0.55,metalness:0.2,roughness:0.3,transparent:true,opacity:0.95 });
|
| 142 |
+
_ring=new _THREE.Mesh(rg,rm); _ring.rotation.x=Math.PI/2; _ring.userData={role:"lambda-gate"}; _group.add(_ring);
|
| 143 |
+
const gg=new _THREE.TorusGeometry(RING_R,0.18,16,96);
|
| 144 |
+
const gm=new _THREE.MeshBasicMaterial({ color:C_GATE,transparent:true,opacity:0.10,blending:_THREE.AdditiveBlending,depthWrite:false });
|
| 145 |
+
_ringGlow=new _THREE.Mesh(gg,gm); _ringGlow.rotation.x=Math.PI/2; _group.add(_ringGlow);
|
| 146 |
+
// gate core (scales with accuracy; teal, capped).
|
| 147 |
+
const cg=new _THREE.SphereGeometry(CORE_R,30,30);
|
| 148 |
+
const cm=new _THREE.MeshStandardMaterial({ color:C_CORE,emissive:C_CORE,emissiveIntensity:0.45,metalness:0.15,roughness:0.35 });
|
| 149 |
+
_core=new _THREE.Mesh(cg,cm); _core.userData={role:"gate-core"}; _group.add(_core);
|
| 150 |
+
_caseGroup=new _THREE.Group(); _group.add(_caseGroup);
|
| 151 |
+
}
|
| 152 |
+
|
| 153 |
+
function _disposeMesh(m){ if(!m)return; if(m.geometry&&m.geometry.dispose)m.geometry.dispose();
|
| 154 |
+
if(m.material){const a=Array.isArray(m.material)?m.material:[m.material];a.forEach((x)=>x.dispose&&x.dispose());} if(m.parent)m.parent.remove(m); }
|
| 155 |
+
|
| 156 |
+
function _rebuildCases(){
|
| 157 |
+
if(!_caseGroup)return;
|
| 158 |
+
_caseMeshes.forEach((rec)=>{ _disposeMesh(rec.line); _disposeMesh(rec.node); }); _caseMeshes=[];
|
| 159 |
+
const n=S.cases.length; if(!n)return;
|
| 160 |
+
S.cases.forEach((c,i)=>{
|
| 161 |
+
const ang=(i/n)*Math.PI*2;
|
| 162 |
+
const isRefuse=(c.scorer==="refuse");
|
| 163 |
+
const col=c.passed?(isRefuse?C_REFUSE:C_PASS):C_FAIL;
|
| 164 |
+
const reach=c.passed?RING_R*0.98:ARC_R; // passing cases cross INTO the gate ring
|
| 165 |
+
const p0=new _THREE.Vector3(Math.cos(ang)*ARC_R, 0.0, Math.sin(ang)*ARC_R);
|
| 166 |
+
const p1=new _THREE.Vector3(Math.cos(ang)*reach, 0.0, Math.sin(ang)*reach);
|
| 167 |
+
const lg=new _THREE.BufferGeometry().setFromPoints([p1,p0]);
|
| 168 |
+
const lm=new _THREE.LineBasicMaterial({ color:col,transparent:true,opacity:c.passed?0.8:0.28 });
|
| 169 |
+
const line=new _THREE.Line(lg,lm);
|
| 170 |
+
const ng=new _THREE.SphereGeometry(c.passed?0.16:0.11,14,14);
|
| 171 |
+
const nm=new _THREE.MeshStandardMaterial({ color:col,emissive:c.passed?col:0x000000,
|
| 172 |
+
emissiveIntensity:c.passed?0.55:0.0,metalness:0.1,roughness:c.passed?0.4:0.9,transparent:true,opacity:c.passed?0.95:0.5 });
|
| 173 |
+
const node=new _THREE.Mesh(ng,nm); node.position.copy(c.passed?p1:p0);
|
| 174 |
+
node.userData={passed:c.passed,base:c.passed?0.55:0.0,cat:c.cat,angle:ang,inR:reach,outR:ARC_R};
|
| 175 |
+
_caseGroup.add(line); _caseGroup.add(node);
|
| 176 |
+
_caseMeshes.push({line,node,passed:c.passed,angle:ang});
|
| 177 |
+
});
|
| 178 |
+
}
|
| 179 |
+
|
| 180 |
+
function _animate(){
|
| 181 |
+
if(!_group)return;
|
| 182 |
+
const now=(typeof performance!=="undefined"?performance.now():Date.now()); const t=(now-_t0)/1000;
|
| 183 |
+
const acc=(S.accuracy!=null?_clamp01(S.accuracy):0.0);
|
| 184 |
+
if(_core&&_core.material){ const sc=0.7+0.9*acc; _core.scale.setScalar(sc);
|
| 185 |
+
_core.material.emissiveIntensity=0.35+0.2*Math.sin(t*1.6)+0.2*acc; }
|
| 186 |
+
// gate ring stays blue-violet ADVISORY; brightness tracks Λ but NEVER turns green.
|
| 187 |
+
const lam=(S.lambda!=null?_clamp01(S.lambda):0.5);
|
| 188 |
+
if(_ring&&_ring.material){ _ring.material.emissiveIntensity=(0.35+0.4*lam)+0.12*Math.sin(t*2.0); _ring.rotation.z=t*0.14; }
|
| 189 |
+
if(_ringGlow&&_ringGlow.material){ _ringGlow.material.opacity=(0.06+0.08*lam)+0.04*Math.abs(Math.sin(t*2.0)); _ringGlow.rotation.z=-t*0.1; }
|
| 190 |
+
_caseMeshes.forEach((rec,i)=>{
|
| 191 |
+
if(!rec.node||!rec.node.material)return;
|
| 192 |
+
if(rec.passed){ rec.node.material.emissiveIntensity=rec.node.userData.base+0.25*Math.abs(Math.sin(t*1.7+i)); }
|
| 193 |
+
else { rec.node.position.y=-0.5*(0.5+0.5*Math.sin(t*0.7+i)); }
|
| 194 |
+
});
|
| 195 |
+
_group.rotation.y=t*0.05;
|
| 196 |
+
}
|
| 197 |
+
|
| 198 |
+
function _buildOverlay(ctx){
|
| 199 |
+
_overlay=document.createElement("div");
|
| 200 |
+
_overlay.style.cssText="position:absolute;top:12px;left:12px;max-width:378px;font:12px/1.5 ui-monospace,Menlo,monospace;color:#cfe3ea;background:rgba(10,17,23,0.86);border:1px solid #1b3a44;border-radius:10px;padding:12px 14px;pointer-events:auto;backdrop-filter:blur(3px);z-index:20;max-height:calc(100% - 24px);overflow:auto;";
|
| 201 |
+
_overlay.innerHTML=
|
| 202 |
+
'<div style="font-weight:700;letter-spacing:.03em;color:#eaf6f9;font-size:13px">Eval Arena <span id="ea-label" style="float:right;font-size:10px;padding:1px 7px;border-radius:8px;background:#123;color:#3af4c8;border:1px solid #1b3a44">MODELED</span></div>'+
|
| 203 |
+
'<div style="margin-top:2px;color:#8fb3bd;font-size:10.5px">Governed eval / red-team arena. Each eval CASE flies at the central <b>Λ-gate</b>: passing cases glow teal and cross the ring; red-team (should-refuse) cases correctly refused glow gold; failures dim and fall. Every run mints a <b>signed receipt</b> ingested to /llm/forum. Λ is advisory (Conjecture 1) — never green.</div>'+
|
| 204 |
+
'<div id="ea-badgerow" style="margin-top:8px"></div>'+
|
| 205 |
+
'<hr style="border:0;border-top:1px solid #1b3a44;margin:8px 0">'+
|
| 206 |
+
_row("Suite","ea-suite")+_row("Model routed","ea-model")+
|
| 207 |
+
_row("Cases passed","ea-cases")+_row("Accuracy","ea-acc")+
|
| 208 |
+
'<hr style="border:0;border-top:1px solid #1b3a44;margin:8px 0">'+
|
| 209 |
+
'<div style="font-size:10.5px;color:#8fb3bd;margin-bottom:3px">HELM-style per-metric (holistic)</div>'+
|
| 210 |
+
_row("Correctness","ea-correct")+_row("Refusal (red-team)","ea-refuse")+
|
| 211 |
+
_row("Honesty-label adherence","ea-honest")+_row("Over-refusal control","ea-control")+
|
| 212 |
+
'<hr style="border:0;border-top:1px solid #1b3a44;margin:8px 0">'+
|
| 213 |
+
_row("Λ (advisory · Conjecture 1)","ea-lambda")+
|
| 214 |
+
_row("Signed receipt","ea-sign")+_row("Forum ingest","ea-forum")+
|
| 215 |
+
'<div style="margin-top:8px;display:flex;gap:10px;flex-wrap:wrap;font-size:10px;color:#9fc">'+
|
| 216 |
+
_leg(C_PASS,"passed (crosses gate)")+_leg(C_REFUSE,"red-team refused")+
|
| 217 |
+
_leg(C_FAIL,"failed (falls)")+_leg(C_GATE,"Λ-gate (advisory)")+
|
| 218 |
+
'</div>'+
|
| 219 |
+
'<div style="margin-top:9px;display:flex;gap:8px;flex-wrap:wrap">'+
|
| 220 |
+
'<button id="ea-plain" style="font:11px ui-monospace;background:#0f2027;color:#9fc;border:1px solid #1b3a44;border-radius:6px;padding:3px 8px;cursor:pointer">Plain language</button>'+
|
| 221 |
+
'<button id="ea-info" style="font:11px ui-monospace;background:#0f2027;color:#9fc;border:1px solid #1b3a44;border-radius:6px;padding:3px 8px;cursor:pointer">Sources & caveats</button>'+
|
| 222 |
+
'</div>'+
|
| 223 |
+
'<div id="ea-plainbox" style="display:none;margin-top:8px;font-size:10.5px;color:#bcd;line-height:1.55"></div>'+
|
| 224 |
+
'<div id="ea-infobox" style="display:none;margin-top:8px;font-size:10px;color:#bcd;line-height:1.55"></div>';
|
| 225 |
+
(ctx.container||document.body).appendChild(_overlay);
|
| 226 |
+
const pb=_overlay.querySelector("#ea-plain"); if(pb) pb.addEventListener("click",()=>{_plain=!_plain;_applyPlain();});
|
| 227 |
+
const ib=_overlay.querySelector("#ea-info");
|
| 228 |
+
if(ib) ib.addEventListener("click",()=>{ const box=_overlay.querySelector("#ea-infobox");
|
| 229 |
+
if(box) box.style.display=box.style.display==="none"?"block":"none";
|
| 230 |
+
if(box&&box.innerHTML==="") box.innerHTML=_infoHTML(); });
|
| 231 |
+
}
|
| 232 |
+
|
| 233 |
+
function _row(k,id){ return '<div style="display:flex;justify-content:space-between;gap:12px;margin-top:3px"><span style="color:#8fb3bd">'+k+'</span><span id="'+id+'" style="color:#eaf6f9;font-variant-numeric:tabular-nums">—</span></div>'; }
|
| 234 |
+
function _leg(hex,txt){ const c="#"+hex.toString(16).padStart(6,"0"); return '<span><span style="display:inline-block;width:9px;height:9px;border-radius:50%;background:'+c+';margin-right:4px;vertical-align:middle"></span>'+txt+'</span>'; }
|
| 235 |
+
function _set(id,v){ const e=_overlay&&_overlay.querySelector("#"+id); if(e) e.textContent=v; }
|
| 236 |
+
function _pct(x){ return x==null?"—":(x<=1?(x*100).toFixed(1)+"%":String(x)); }
|
| 237 |
+
|
| 238 |
+
function _paintOverlay(){
|
| 239 |
+
if(!_overlay)return;
|
| 240 |
+
const missing=(S.state==="missing"||S.state==="error"); const deg=missing||(S.state==="degraded");
|
| 241 |
+
_set("ea-label",S.label||"MODELED");
|
| 242 |
+
if(missing&&!S.cases.length){
|
| 243 |
+
["ea-suite","ea-model","ea-cases","ea-acc","ea-correct","ea-refuse","ea-honest","ea-control","ea-lambda","ea-sign","ea-forum"]
|
| 244 |
+
.forEach((id)=>_set(id,"NO-LIVE-DATA"));
|
| 245 |
+
if(_plain)_applyPlain(); return;
|
| 246 |
+
}
|
| 247 |
+
_set("ea-suite",(S.suiteTitle||S.suiteId)+(S.suiteVersion?(" v"+S.suiteVersion):""));
|
| 248 |
+
_set("ea-model",S.modelId||"—");
|
| 249 |
+
_set("ea-cases",(S.nPassed!=null?S.nPassed:"—")+" / "+(S.nCases!=null?S.nCases:"—"));
|
| 250 |
+
_set("ea-acc",_pct(S.accuracy));
|
| 251 |
+
_set("ea-correct",_pct(S.correctness));
|
| 252 |
+
_set("ea-refuse",_pct(S.refusal));
|
| 253 |
+
_set("ea-honest",_pct(S.honesty));
|
| 254 |
+
_set("ea-control",_pct(S.control));
|
| 255 |
+
_set("ea-lambda",(S.lambda!=null?S.lambda.toFixed(4):"—")+" (gray · never green · ≤0.97)");
|
| 256 |
+
_set("ea-sign",(S.signMode||"—")+(S.signed?" ✓":""));
|
| 257 |
+
_set("ea-forum",(S.forumIngested===true?"ingested ✓":(S.forumIngested===false?"skipped":"—")));
|
| 258 |
+
if(_plain)_applyPlain();
|
| 259 |
+
}
|
| 260 |
+
|
| 261 |
+
function _applyPlain(){
|
| 262 |
+
const box=_overlay&&_overlay.querySelector("#ea-plainbox"); if(!box)return;
|
| 263 |
+
box.style.display=_plain?"block":"none";
|
| 264 |
+
if(_plain) box.innerHTML="This is an <b>exam room for AI models</b>, run the way the field's leaders (HELM, Inspect, OpenAI Evals, garak) run their exams — but <b>governed</b>. We give a model a fixed set of test questions (a <b>suite</b>): some check whether it gets facts right, some are <b>red-team traps</b> that a safe model should <b>refuse</b>, and some check whether it's <b>honest about its limits</b> instead of over-claiming. Each question flies at the central gate: <b>pass = teal and crosses in</b>, a <b>refused trap = gold</b>, a <b>failure = grey and falls</b>. We then report every metric side-by-side (HELM's idea), attach an advisory trust score <b>Λ</b> (our own gate — always grey, never a green stamp, capped at 0.97), and <b>sign a receipt</b> of the whole run that gets filed to the shared forum. Label <b>"+(S.label||"MODELED")+"</b>: with no model key wired here, the answers are honest <i>reference-oracle</i> stand-ins — but the scoring, the Λ math, the signature and the filing are all <b>real</b>. If the backend is offline it says <b>NO-LIVE-DATA</b>.";
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
function _infoHTML(){
|
| 268 |
+
return "<b>What is MODELED vs real.</b> The eval PIPELINE — the suites, the deterministic scorers (exact / includes / regex / refusal-detector / honesty-adherence), the HELM-style per-metric aggregate, the Λ geometric-mean advisory, the DSSE receipt and the /llm/forum ingest — is <b>REAL</b> and runs end-to-end. What is <b>MODELED</b>: with no provider API key wired in this Space, the model's <i>answers</i> are honest <b>reference-oracle stubs</b> (never fabricated as if from a live provider; Zero-Bandaid Law). Wire a key and the same pipeline scores a live model. The signature is <b>REAL ECDSA-P256</b> in-Space (via the SZL cosign key) and an honest <b>UNSIGNED-LOCAL</b> envelope locally — never a fabricated signature. Λ stays <b>Conjecture 1</b>, rendered grey, never green; trust is capped at 0.97, never 100%.<br><br><b>We adopt the fashion; we do not claim it.</b><br>• OpenAI Evals — <a href=\"https://github.com/openai/evals\" style=\"color:#3af4c8\">github.com/openai/evals</a><br>• Anthropic evals (Discrim-Eval / model-written) — <a href=\"https://github.com/anthropics/evals\" style=\"color:#3af4c8\">github.com/anthropics/evals</a><br>• HELM (Stanford CRFM) — <a href=\"https://crfm.stanford.edu/helm/\" style=\"color:#3af4c8\">crfm.stanford.edu/helm</a> · arXiv:2211.09110<br>• EleutherAI lm-evaluation-harness — <a href=\"https://github.com/EleutherAI/lm-evaluation-harness\" style=\"color:#3af4c8\">github.com/EleutherAI/lm-evaluation-harness</a><br>• UK AISI Inspect — <a href=\"https://inspect.aisi.org.uk/\" style=\"color:#3af4c8\">inspect.aisi.org.uk</a><br>• NVIDIA garak — <a href=\"https://github.com/NVIDIA/garak\" style=\"color:#3af4c8\">github.com/NVIDIA/garak</a><br>• promptfoo — <a href=\"https://github.com/promptfoo/promptfoo\" style=\"color:#3af4c8\">github.com/promptfoo/promptfoo</a><br>• Λ trust gate = Conjecture 1 (lutar-lean; advisory, never green). Nothing here touches the locked-8.";
|
| 269 |
+
}
|
| 270 |
+
|
| 271 |
+
function unmount(){
|
| 272 |
+
_polls.forEach((p)=>{ try{p.stop();}catch(_){} }); _polls=[];
|
| 273 |
+
try{ if(_overlay&&_overlay.parentNode) _overlay.parentNode.removeChild(_overlay); }catch(_){}
|
| 274 |
+
try{ if(_group&&_stage){ _group.traverse((o)=>{ if(o.geometry&&o.geometry.dispose)o.geometry.dispose();
|
| 275 |
+
if(o.material){const ms=Array.isArray(o.material)?o.material:[o.material];ms.forEach((m)=>{if(m.dispose)m.dispose();});} }); _stage.scene.remove(_group); } }catch(_){}
|
| 276 |
+
_group=_overlay=null; _ring=_ringGlow=_core=_caseGroup=null; _caseMeshes=[];
|
| 277 |
+
_badge=null; _plain=false; _frameReg=false; _stage=_THREE=_ctx=null;
|
| 278 |
+
S.label="MODELED"; S.state="init"; S.cases=[]; S.suiteRoster=[];
|
| 279 |
+
S.nCases=S.nPassed=S.accuracy=S.correctness=S.refusal=S.honesty=S.control=null;
|
| 280 |
+
S.lambda=S.lambdaAxes=S.signed=S.signMode=S.forumIngested=null;
|
| 281 |
+
S.suiteTitle=S.suiteVersion=null;
|
| 282 |
+
}
|
| 283 |
+
|
| 284 |
+
export default { id: ID, title: TITLE, endpoints: [EP_RUN, EP_SUITES, EP_HEALTH], mount, unmount };
|