{"job_id":"anim-job-b2312672-12dc-4455-939a-af09d09c4ec9","request_id":"test-physics-halflife-fef4a9a4-ee3c-4109-9b59-ca80c158fc36-1778702709883","status":"complete","asset":{"primary_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2312672-12dc-4455-939a-af09d09c4ec9/walkthrough.mp4","thumbnail_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2312672-12dc-4455-939a-af09d09c4ec9/thumb.jpg","transcript_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2312672-12dc-4455-939a-af09d09c4ec9/transcript.vtt","interactive_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2312672-12dc-4455-939a-af09d09c4ec9/index.html","scenefile_url":"https://storage.googleapis.com/pupiltree-animation-assets/anim-job-b2312672-12dc-4455-939a-af09d09c4ec9/scene-source.json","duration_seconds":15,"byte_size":260167,"renderer":"html_three_js_local","parameters":{"style":"auto","executor":"native_render_executor","localPath":"/app/storage/assets/anim-job-b2312672-12dc-4455-939a-af09d09c4ec9","interactivity":"none","renderer_style":"three_js","durationSeconds":15,"render_manifest":{"jobId":"anim-job-b2312672-12dc-4455-939a-af09d09c4ec9","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-fef4a9a4-ee3c-4109-9b59-ca80c158fc36-1778702709883","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    li{font-size:0.9rem;line-height:1.4;}\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 nuclei never fully disappear—the exponential truth</p>\n    <p class=\"formula\">N(t) = N₀ × (1/2)^(t/T½)</p>\n    <label class=\"control\"><span>Half-Life (T½): <strong id=\"v-halflife\">3</strong> s</span><input id=\"c-halflife\" type=\"range\" min=\"1\" max=\"8\" step=\"0.5\" value=\"3\"/></label>\n    <label class=\"control\"><span>Time Scale: <strong id=\"v-timescale\">1×</strong></span><input id=\"c-timescale\" type=\"range\" min=\"0.5\" max=\"3\" step=\"0.5\" value=\"1\"/></label>\n    <ul>\n      <li><strong style=\"color:var(--red);\">❌ Myth:</strong> After 2 half-lives, all nuclei are gone.</li>\n      <li><strong style=\"color:var(--green);\">✓ Truth:</strong> After 2 half-lives, 25% remain. After 10 half-lives, ~0.1% remain.</li>\n      <li>The decay is <em>exponential</em>, never reaching zero—mathematically infinite tail.</li>\n      <li>Watch the bars shrink by 50% each half-life, and the graph curve asymptote to zero.</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\":8,\"step\":0.5,\"value\":3,\"units\":\"s\"},{\"key\":\"timescale\",\"label\":\"Time Scale\",\"min\":0.5,\"max\":3,\"step\":0.5,\"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  \n  let lastTs=0;\n  let globalTime=0;\n  let nucleiStates=[];\n  const decayedTrail=[];\n  \n  function glowDot(x,y,r,color,a){\n    const g=ctx.createRadialGradient(x,y,0,x,y,r*2.6);\n    g.addColorStop(0,color.replace('ALPHA',String(a)));\n    g.addColorStop(1,color.replace('ALPHA','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;ctx.beginPath();ctx.moveTo(x1,y1);ctx.lineTo(x2,y2);ctx.stroke();\n    ctx.fillStyle=color;ctx.beginPath();ctx.moveTo(x2,y2);ctx.lineTo(x2-s*nx+s*0.4*ny,y2-s*ny-s*0.4*nx);ctx.lineTo(x2-s*nx-s*0.4*ny,y2-s*ny+s*0.4*nx);ctx.fill();\n  }\n  \n  function initNuclei(){\n    nucleiStates=[];\n    for(let i=0;i<100;i++){\n      nucleiStates.push({\n        x:Math.random()*200+50,\n        y:Math.random()*200+50,\n        vx:(Math.random()-0.5)*60,\n        vy:(Math.random()-0.5)*60,\n        alive:true,\n        decayTime:Math.random()*1000\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    \n    const halflife=Number(document.getElementById('c-halflife').value);\n    const timescale=Number(document.getElementById('c-timescale').value);\n    globalTime+=dt*timescale;\n    \n    // Update nuclei decay states\n    let remaining=0;\n    for(let n of nucleiStates){\n      if(n.alive){\n        const r=Math.random();\n        const decayRate=Math.log(2)/halflife;\n        if(Math.exp(-decayRate*globalTime)<r){\n          n.alive=false;\n          decayedTrail.push({x:n.x,y:n.y,t:0});\n        }else{\n          remaining++;\n          n.x+=n.vx*dt;n.y+=n.vy*dt;\n          if(n.x<20||n.x>280)n.vx*=-1;\n          if(n.y<20||n.y>280)n.vy*=-1;\n          n.x=Math.max(20,Math.min(280,n.x));\n          n.y=Math.max(20,Math.min(280,n.y));\n        }\n      }\n    }\n    \n    // Decay trail age\n    for(let i=decayedTrail.length-1;i>=0;i--){\n      decayedTrail[i].t+=dt;\n      if(decayedTrail[i].t>0.8)decayedTrail.splice(i,1);\n    }\n    \n    // ===== DRAW =====\n    ctx.clearRect(0,0,W,H);\n    \n    // Background grid & labels\n    ctx.fillStyle='rgba(100,140,160,0.08)';\n    ctx.font=Math.round(H*0.032)+'px sans-serif';\n    for(let i=0;i<=4;i++){\n      const ypos=i*H*0.2;\n      ctx.fillRect(0,ypos,W,1);\n      ctx.fillStyle='var(--muted)';\n      ctx.fillText((i*25)+'%',W-60,ypos+20);\n      ctx.fillStyle='rgba(100,140,160,0.08)';\n    }\n    \n    // LEFT SECTION: Animated nuclei container\n    const boxL=50,boxT=50,boxW=280,boxH=280;\n    ctx.strokeStyle='#445862';ctx.lineWidth=2;ctx.strokeRect(boxL,boxT,boxW,boxH);\n    ctx.fillStyle='rgba(47,74,87,0.15)';ctx.fillRect(boxL,boxT,boxW,boxH);\n    \n    // Draw decay particles (fading trails)\n    ctx.globalAlpha=0.6;\n    for(let d of decayedTrail){\n      const fade=1-(d.t/0.8);\n      glowDot(boxL+d.x,boxT+d.y,5,'rgba(222,127,118,ALPHA)',fade*0.8);\n    }\n    ctx.globalAlpha=1;\n    \n    // Draw living nuclei\n    for(let n of nucleiStates){\n      if(n.alive){\n        glowDot(boxL+n.x,boxT+n.y,4,'rgba(135,232,168,ALPHA)',0.9);\n        ctx.fillStyle='#87e8a8';\n        ctx.beginPath();ctx.arc(boxL+n.x,boxT+n.y,3.5,0,Math.PI*2);ctx.fill();\n      }\n    }\n    \n    // Label left box\n    ctx.fillStyle='var(--accent)';\n    ctx.font=Math.round(H*0.036)+'px sans-serif';\n    ctx.fillText('Nuclei Decay',boxL+10,boxT-12);\n    \n    // RIGHT SECTION: Decay bars for half-lives\n    const barX=W*0.55,barY=H*0.15,barH=H*0.7;\n    ctx.font=Math.round(H*0.028)+'px sans-serif';\n    ctx.fillStyle='var(--accent)';\n    ctx.fillText('Remaining After Each Half-Life',barX+10,barY-10);\n    \n    const numHLives=6;\n    const barSpacing=barH/(numHLives+1);\n    for(let i=0;i<numHLives;i++){\n      const fraction=Math.pow(0.5,i);\n      const barLen=200*fraction;\n      const y=barY+i*barSpacing;\n      \n      // Background bar\n      ctx.fillStyle='rgba(100,140,160,0.15)';\n      ctx.fillRect(barX+40,y,200,25);\n      \n      // Animated fill bar\n      ctx.fillStyle='#63b3ff';\n      ctx.fillRect(barX+40,y,barLen,25);\n      \n      // Glow on active bar\n      if(Math.abs(globalTime-i*halflife)<halflife*0.3){\n        const pulse=0.3+0.2*Math.sin(globalTime*6);\n        ctx.shadowColor='rgba(99,179,255,0.6)';\n        ctx.shadowBlur=12;\n        ctx.fillStyle='rgba(99,179,255,'+pulse+')';\n        ctx.fillRect(barX+40,y,barLen,25);\n        ctx.shadowColor='transparent';\n      }\n      \n      // Label: percentage\n      const pct=Math.round(fraction*100);\n      ctx.fillStyle='var(--text)';\n      ctx.textAlign='right';\n      ctx.fillText(pct+'%',barX+250,y+18);\n      ctx.textAlign='left';\n      \n      // Half-life marker\n      ctx.fillStyle='var(--muted)';\n      ctx.font=Math.round(H*0.024)+'px sans-serif';\n      ctx.fillText(i+'T½',barX+10,y+18);\n    }\n    \n    // BOTTOM: Live graph trace\n    const graphX=W*0.55,graphY=barY+barH+H*0.1,graphW=280,graphH=120;\n    ctx.strokeStyle='#445862';ctx.lineWidth=1;ctx.strokeRect(graphX,graphY,graphW,graphH);\n    ctx.fillStyle='rgba(47,74,87,0.1)';ctx.fillRect(graphX,graphY,graphW,graphH);\n    \n    ctx.fillStyle='var(--muted)';\n    ctx.font=Math.round(H*0.022)+'px sans-serif';\n    ctx.fillText('Decay Curve',graphX+8,graphY-5);\n    \n    // Draw exponential decay curve\n    ctx.strokeStyle='#e5ba67';\n    ctx.lineWidth=2.5;\n    ctx.beginPath();\n    let first=true;\n    for(let t=0;t<=10*halflife;t+=halflife*0.1){\n      const frac=Math.pow(0.5,t/halflife);\n      const px=graphX+10+(graphW-20)*(t/(10*halflife));\n      const py=graphY+graphH-15-frac*(graphH-30);\n      if(first){ctx.moveTo(px,py);first=false;}\n      else ctx.lineTo(px,py);\n    }\n    ctx.stroke();\n    \n    // Current time marker on graph\n    const tFrac","remediationGoal":"Close concept_misunderstanding for physics."},"rendererStyle":"three_js"}}},"metadata":{"rendered_at":"2026-05-13T20:10:22.663Z","cache_hit":false,"cost_usd":0},"error":null}