const q=s=>document.querySelector(s),qa=s=>[...document.querySelectorAll(s)];fetch('./data/results.json').then(r=>r.json()).then(d=>{q('#hero').textContent=d.hero;q('#cost').textContent=d.cost;const sel=q('#stage');d.stages.forEach(s=>sel.add(new Option(`${s.label} — ${s.status}`,s.id)));function draw(){const s=d.stages.find(x=>x.id===sel.value);q('#stagecard').innerHTML=`
${s.label}
${s.status}
Strict exact: ${s.exact??'not qualified'}/22 · holdout ${s.holdout??'—'}/18 · canary ${s.canary??'—'}/4
Open model repository
`}sel.onchange=draw;draw();q('#stats').innerHTML=`${d.statistics.parser}Unsafe generations: ${d.statistics.unsafe}${d.statistics.stage4_vs_stage2}${d.statistics.stage4_vs_stage3}`;q('#prod').textContent=`Converted ${d.production.converted}; canary ${d.production.canary}; ${d.production.scope}.`;q('#jensen').textContent=`${d.jensen.status}; Lean-valid ${d.jensen.lean_valid}; RH PROVED: ${d.jensen.rh_proved}.`;q('#taxonomy').innerHTML=d.failure_taxonomy.map(x=>`${x}`).join('');q('#artifacts').innerHTML=d.stages.map(s=>`${s.label}`).join('')+`Training dataset`});qa('.tabs button').forEach(b=>b.onclick=()=>{qa('.tabs button').forEach(x=>x.setAttribute('aria-selected','false'));b.setAttribute('aria-selected','true');qa('.panel').forEach(p=>p.hidden=p.id!==b.dataset.tab)})