{"job_id":"anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083","request_id":"test-physics-halflife-1b2ba770-6450-4b1c-a815-8b28db3d7c87-1778704510421","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083/scene-source.json","duration_seconds":15,"byte_size":502302,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-cfb9123c-8a99-4f7f-845e-4ff7079b7083","request":{"gap":{"topic":"radioactive-half-life","severity":"dangerous","error_type":"concept_misunderstanding","memory_state":"fragile","display_topic":"Radioactive Decay — Half-Life","common_wrong_answer":"After two half-lives, all radioactive nuclei have decayed.","confidence_at_error":"high","correct_understanding":"Each half-life reduces remaining nuclei by half: N(t) = N₀ × (1/2)^(t/T½). It is exponential — never reaches exactly zero."},"target":{"style":"auto","render":{"fps":30,"format":"mp4","resolution":"1920x1080","include_thumbnail":true,"include_transcript":true},"audience":{"tone":"neutral_instructional","grade":"12","language":"en"},"interactivity":"none","duration_seconds":15},"context":{"chapter":{"name":"Nuclei","ncert_class":12,"ncert_chapter_number":13},"sub_topics":[{"topic":"Radioactive Decay","key_concepts":["half-life","decay constant","activity","exponential decay"]}]},"metadata":{"priority":"normal"},"exam_type":"neet","asset_type":"simulation","request_id":"test-physics-halflife-1b2ba770-6450-4b1c-a815-8b28db3d7c87-1778704510421","subject_area":"physics"},"renderer":"html_three_js_local","storyboard":{"beats":[{"label":"Topic","visual":"Show the topic title and the key physical context.","narration":"Radioactive Decay — Half-Life"},{"label":"Mistake","visual":"Show the wrong approach and why it seems plausible.","narration":"After two half-lives, all radioactive nuclei have decayed."},{"label":"Correction","visual":"Show the right approach step by step.","narration":"Each half-life reduces remaining nuclei by half: N(t) = N₀ × (1/2)^(t/T½). It is exponential — never reaches exactly zero."},{"label":"Concept","visual":"Highlight the key formula and the governing relationship.","narration":"half-life. decay constant. activity"}],"title":"Radioactive Decay — Half-Life","sceneCode":"<!doctype html>\n<html lang=\"en\">\n<head>\n  <meta charset=\"utf-8\"/>\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n  <title>Radioactive Decay Half-Life Remediation</title>\n  <style>\n    :root{--bg:#0f1418;--panel:#182228;--line:#2e3e46;--accent:#e5ba67;--text:#f4f1ea;--muted:#c8d4da;--blue:#63b3ff;--green:#87e8a8;--red:#de7f76;}\n    *{box-sizing:border-box;}\n    body{margin:0;font-family:\"Plus Jakarta Sans\",\"Manrope\",ui-sans-serif,system-ui,sans-serif;background:radial-gradient(120% 90% at 20% -5%,#24343d 0%,var(--bg) 55%);color:var(--text);}\n    main{min-height:100vh;display:grid;grid-template-columns:minmax(300px,380px) 1fr;}\n    aside{border-right:1px solid var(--line);background:linear-gradient(180deg,rgba(31,46,53,.86),rgba(24,34,40,.92));padding:24px;overflow:auto;backdrop-filter:blur(6px);}\n    section{padding:24px;display:grid;place-items:center;}\n    h1{margin:0 0 10px;font-size:1.65rem;line-height:1.15;}\n    .sub{margin:0 0 16px;color:var(--muted);}\n    .formula{margin:0 0 14px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#11191e;color:var(--accent);font-family:ui-monospace,monospace;font-size:0.9rem;box-shadow:inset 0 0 28px rgba(229,186,103,.08);}\n    .control{display:grid;gap:6px;margin:12px 0;}\n    .control input{width:100%;accent-color:var(--accent);}\n    ul{margin:14px 0 0 18px;padding:0;color:var(--muted);display:grid;gap:6px;}\n    .stage{width:min(1020px,95%);aspect-ratio:16/9;border:1px solid #445862;border-radius:14px;position:relative;overflow:hidden;background:radial-gradient(circle at 50% 38%,#2f4a57,#0f1418 72%);box-shadow:0 18px 60px rgba(0,0,0,.45), inset 0 0 90px rgba(255,255,255,.03);}\n    .stage::before{content:\"\";position:absolute;inset:0;background:linear-gradient(180deg,rgba(255,255,255,.06),transparent 34%);pointer-events:none;}\n    .legend{position:absolute;right:12px;top:12px;padding:8px 10px;border-radius:10px;border:1px solid #465a64;background:rgba(9,14,18,.58);font-size:0.8rem;color:var(--muted);backdrop-filter:blur(4px);}\n    @media(max-width:900px){main{grid-template-columns:1fr;}aside{border-right:0;border-bottom:1px solid var(--line);}}\n  </style>\n</head>\n<body>\n<main>\n  <aside>\n    <h1>Radioactive Decay</h1>\n    <p class=\"sub\">Why \"all gone at 2 half-lives\" is wrong</p>\n    <p class=\"formula\">N(t) = N₀ × (½)^(t/T½)</p>\n    <label class=\"control\"><span>Half-life (T½): <strong id=\"v-halflife\">3</strong> sec</span><input id=\"c-halflife\" type=\"range\" min=\"1\" max=\"6\" step=\"0.5\" value=\"3\"/></label>\n    <label class=\"control\"><span>Initial count: <strong id=\"v-initial\">1000</strong></span><input id=\"c-initial\" type=\"range\" min=\"100\" max=\"2000\" step=\"100\" value=\"1000\"/></label>\n    <label class=\"control\"><span>Speed: <strong id=\"v-speed\">1</strong>×</span><input id=\"c-speed\" type=\"range\" min=\"0.2\" max=\"3\" step=\"0.2\" value=\"1\"/></label>\n    <ul>\n      <li><strong style=\"color:var(--red);\">Myth:</strong> At t=2×T½, <em>all</em> nuclei decay</li>\n      <li><strong style=\"color:var(--green);\">Truth:</strong> Each T½ halves remainder:<br/>T½: 50% left<br/>2×T½: 25% left<br/>3×T½: 12.5% left</li>\n      <li><strong style=\"color:var(--blue);\">Math:</strong> Exponential never touches zero</li>\n      <li>Watch the graph curve &amp; particle count</li>\n    </ul>\n  </aside>\n  <section>\n    <div class=\"stage\" id=\"stage\">\n      <div class=\"legend\" id=\"legend\">Ready</div>\n      <canvas id=\"sim-cv\" style=\"position:absolute;inset:0;width:100%;height:100%;\"></canvas>\n    </div>\n  </section>\n</main>\n<script>\nconst controls = [{\"key\":\"halflife\",\"label\":\"Half-life\",\"min\":1,\"max\":6,\"step\":0.5,\"value\":3,\"units\":\"sec\"},{\"key\":\"initial\",\"label\":\"Initial count\",\"min\":100,\"max\":2000,\"step\":100,\"value\":1000,\"units\":\"nuclei\"},{\"key\":\"speed\",\"label\":\"Speed\",\"min\":0.2,\"max\":3,\"step\":0.2,\"value\":1,\"units\":\"×\"}];\nfor(const c of controls){\n  const inp=document.getElementById('c-'+c.key);\n  const out=document.getElementById('v-'+c.key);\n  inp?.addEventListener('input',()=>{out.textContent=inp.value;window.updateModel?.();});\n}\n(function(){\n  const cv=document.getElementById('sim-cv');\n  const ctx=cv.getContext('2d');\n  function resize(){const r=cv.getBoundingClientRect();if(r.width>0){cv.width=r.width;cv.height=r.height;}}\n  resize();new ResizeObserver(resize).observe(cv);\n  let lastTs=0;\n  let globalTime=0;\n  let particles=[];\n  let graphPoints=[];\n  \n  function glowDot(x,y,r,color,a){\n    const g=ctx.createRadialGradient(x,y,0,x,y,r*2.6);\n    const rgb=color.match(/\\d+/g);\n    g.addColorStop(0,'rgba('+rgb[0]+','+rgb[1]+','+rgb[2]+','+a+')');\n    g.addColorStop(1,'rgba('+rgb[0]+','+rgb[1]+','+rgb[2]+',0)');\n    ctx.fillStyle=g;ctx.beginPath();ctx.arc(x,y,r*2.6,0,Math.PI*2);ctx.fill();\n  }\n  \n  function arrow(x1,y1,x2,y2,color){\n    const dx=x2-x1,dy=y2-y1,l=Math.sqrt(dx*dx+dy*dy);\n    if(l<2)return;\n    const nx=dx/l,ny=dy/l,s=10;\n    ctx.strokeStyle=color;ctx.lineWidth=2;\n    ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;ctx.beginPath();\n    ctx.moveTo(x2,y2);\n    ctx.lineTo(x2-s*nx+s*0.4*ny,y2-s*ny-s*0.4*nx);\n    ctx.lineTo(x2-s*nx-s*0.4*ny,y2-s*ny+s*0.4*nx);\n    ctx.fill();\n  }\n  \n  function initParticles(N0){\n    particles=[];\n    for(let i=0;i<N0;i++){\n      particles.push({\n        x:Math.random()*200+50,\n        y:Math.random()*200+50,\n        vx:(Math.random()-0.5)*40,\n        vy:(Math.random()-0.5)*40,\n        age:Math.random()*100,\n        decayed:false\n      });\n    }\n  }\n  \n  function tick(ts){\n    const dt=Math.min(0.04,(ts-lastTs)/1000);lastTs=ts;\n    const W=cv.width,H=cv.height;\n    const halfLife=parseFloat(document.getElementById('c-halflife').value);\n    const N0=parseInt(document.getElementById('c-initial').value);\n    const speed=parseFloat(document.getElementById('c-speed').value);\n    globalTime+=dt*speed;\n    \n    if(particles.length===0){\n      initParticles(N0);\n      globalTime=0;\n      graphPoints=[];\n    }\n    \n    const decayConstant=Math.LN2/halfLife;\n    const currentN=N0*Math.exp(-decayConstant*globalTime);\n    \n    for(let i=0;i<particles.length;i++){\n      const p=particles[i];\n      if(!p.decayed){\n        const survivalProb=Math.exp(-decayConstant*(globalTime+p.age/1000));\n        if(Math.random()>survivalProb){\n          p.decayed=true;\n        }else{\n          p.x+=p.vx*dt;p.y+=p.vy*dt;\n          if(p.x<40||p.x>280)p.vx*=-1;\n          if(p.y<40||p.y>280)p.vy*=-1;\n          p.x=Math.max(40,Math.min(280,p.x));\n          p.y=Math.max(40,Math.min(280,p.y));\n        }\n      }\n    }\n    \n    graphPoints.push({t:globalTime,n:currentN});\n    if(graphPoints.length>200)graphPoints.shift();\n    \n    ctx.clearRect(0,0,W,H);\n    ctx.fillStyle='rgba(15,20,24,0.3)';ctx.fillRect(0,0,W,H);\n    \n    // Draw particle chamber (left)\n    ctx.fillStyle='rgba(45,74,87,0.2)';\n    ctx.fillRect(40,50,240,240);\n    ctx.strokeStyle='#445862';ctx.lineWidth=1;\n    ctx.strokeRect(40,50,240,240);\n    \n    const activeCount=particles.filter(p=>!p.decayed).length;\n    for(let i=0;i<particles.length;i++){\n      const p=particles[i];\n      if(!p.decayed){\n        glowDot(p.x,p.y,3,'rgb(99,179,255)',0.6);\n        ctx.fillStyle='rgb(99,179,255)';\n        ctx.beginPath();ctx.arc(p.x,p.y,3,0,Math.PI*2);ctx.fill();\n      }\n    }\n    \n    // Draw decay indicator zones\n    const zoneX=350;\n    ctx.fillStyle='rgba(222,127,118,0.15)';\n    ctx.fillRect(zoneX,50,140,70);\n    ctx.strokeStyle='rgb(222,127,118)';ctx.lineWidth=1;\n    ctx.strokeRect(zoneX,50,140,70);\n    ctx.fillStyle='rgb(222,127,118)';\n    ctx.font=Math.round(H*0.03)+'px sans-serif';\n    ctx.textAlign='center';ctx.fillText('Decayed',zoneX+70,85);\n    const decayedCount=particles.filter(p=>p.decayed).length;\n    ctx.font=Math.round(H*0.048)+'px sans-serif';\n    ctx.fillText(String(decayedCount),zoneX+70,120);\n    \n    // Draw active indicator\n    ctx.fillStyle='rgba(135,232,168,0.15)';\n    ctx.fillRect(zoneX,150,140,70);\n    ctx.strokeStyle='rgb(135,232,168)';ctx.lineWidth=1;\n    ctx.strokeRect(zoneX,150,140,70);\n    ctx.fillStyle='rgb(135,232,168)';\n    ctx.font=Math.round(H*0.03)+'px sans-serif';\n    ctx.textAlign='center';ctx.fillText('Active',zoneX+70,185);\n    ctx.font=Math.round(H*0.048)+'px sans-serif';\n    ctx.fillText(String(activeCount),zoneX+70,220);\n    \n    // Draw decay curve (bottom right)\n    const graphX=zoneX;\n    const graphY=280;\n    const graphW=140;\n    const graphH=70;\n    ctx.fillStyle='rgba(45,74,87,0.3)';\n    ctx.fillRect(graphX,graphY,graphW,graphH);\n    ctx.strokeStyle='#445862';ctx.lineWidth=1;\n    ctx.strokeRect(graphX,graphY,graphW,graphH);\n    \n    // Axis labels\n    ctx.fillStyle='var(--muted)';ctx.font=Math.round(H*0.025)+'px sans-serif';\n    ctx.textAlign='right';ctx.fillText('N(t)',graphX-3,graphY-5);\n    \n    // Draw exponential decay curve\n    ctx.strokeStyle='rgb(229,186,103)';ctx.lineWidth=2;\n    ctx.beginPath();\n    for(let i=0;i<graphPoints.length;i++){\n      const pt=graphPoints[i];\n      const px=graphX+5+(pt.t/(halfLife*3))*130;\n      const py=graphY+graphH-10-(pt.n/N0)*60;\n      if(i===0)ctx.moveTo(px,py);\n      else ctx.lineTo(px,py);\n    }\n    ctx.stroke();\n    \n    // Draw half-life markers\n    ctx.strokeStyle='rgb(99,179,255)';ctx.lineWidth=1;ctx.setLineDash([3,3]);\n    for(let hl=1;hl<=3;hl++){\n      const x=graphX+5+(hl*halfLife/(halfLife*3))*130;\n      ctx.beginPath();ctx.moveTo(x,graphY+graphH);ctx.lineTo(x,graphY+graphH+8);ctx.stroke();\n      ctx.fillStyle='rgb(99,179,255)';ctx.font=Math.round(H*0.02)+'px sans-serif';\n      ctx.textAlign='center';ctx.fillText(hl+'×T½',x,graphY+graphH+18);\n    }\n    ctx.setLineDash([]);\n    \n    // Draw theoretical prediction lines at 2×T½\n    const twoHalfLifeX=graphX+5+(2*halfLife/(halfLife*3))*130;\n    ctx.strokeStyle='rgba(222,127,118,0.5)';ctx.lineWidth=2;ctx.setLineDash([5,5]);\n    ctx.beginPath();ctx.moveTo(twoHalfLifeX,graphY);ctx.lineTo(twoHalfLifeX,graphY+graphH);ctx.stroke();\n    ctx.setLineDash([]);\n    \n    ctx.fillStyle='rgb(222,127,118)';ctx.font=Math.round(H*0","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T20:39:45.972Z","cache_hit":false,"cost_usd":0},"error":null}