A mech game prototype, pushed by GPT-6-Astra

agent (cont.)

+1:05:53
  • exec_command, view_imagecat tools/astra/compare.js; cat tools/astra/render_compare.mjs; cat tools/astra/build_page.py; cat tools/astra/check_page.mjs (+1 more)

    input

    text(await tools.exec_command({cmd:"cat tools/astra/compare.js; cat tools/astra/render_compare.mjs; cat tools/astra/build_page.py; cat tools/astra/check_page.mjs","max_output_tokens":12000}));
    for(const path of ["review/out/astra/refined/side.png","review/out/astra/refined/bend.png","review/out/astra/refined/flight.png"]) image((await tools.view_image({path})).image_url);
    

    result, 4 lines

    Script completed
    Wall time 0.1 seconds
    Output:
    {"chunk_id":"77cb09","wall_time_seconds":0.000005,"exit_code":0,"original_token_count":3602,"output":"// Local review renderer. Both panels use the game's materials, rig, plumes and postprocessing.\nimport * as THREE from 'three';\nimport { model, find, nodes } from '../../src/render/assets.ts';\nimport { MechRig, POSES } from '../../src/render/mech.ts';\nimport { PALETTES } from '../../src/render/palette.ts';\nimport { setLook } from '../../src/render/look.ts';\nimport { Pipeline } from '../../src/render/pipeline.ts';\nimport { createBackdrop, bakeBackdrop, spaceEnvironment, addSpaceLight, followSun } from '../../src/render/space.ts';\nimport { STRIKER_DECALS, applyDecals } from '../../src/render/decals.ts';\nimport { treatEyes } from '../../src/render/eyes.ts';\nimport { benchInput } from '../../src/view/thrusters.ts';\nimport { BEND_POSE } from '../../src/view/clip-plan.ts';\nimport '@fontsource/chakra-petch/600.css';\n\nconst q = new URLSearchParams(location.search);\nconst W = Number(q.get('w') || 1440), H = Number(q.get('h') || 900);\nconst fps = Number(q.get('fps') || 24);\nconst cw = W/2, top = 58, bottom = 38, ch = H-top-bottom;\nconst output = document.getElementById('output');\noutput.width=W; output.height=H;\nconst ctx=output.getContext('2d');\nconst finish=setLook(q.get('look') || 'service');\n// One restrained finish for both frames. Geometry supplies the seams and the broad highlights.\nif(!q.has('stockfinish')) Object.assign(finish,{ridge:.22,valley:.3,ink:.28,grime:.25,grain:.006,vignette:.12,paintRough:.43});\nPALETTES.astra_study = {\n  ...PALETTES.merc,\n  main: {...PALETTES.merc.main,color:'#d3d9d6'},\n  accent: {...PALETTES.merc.accent,color:'#254958'},\n  trim: {...PALETTES.merc.trim,color:'#ce663d'},\n  frame: {...PALETTES.merc.frame,color:'#44515b'},\n  joint: {...PALETTES.merc.joint,color:'#20272d'},\n  metal: {...PALETTES.merc.metal,color:'#899aa4'},\n};\nconst scene = new THREE.Scene();\nconst camera = new THREE.PerspectiveCamera(35,cw/ch,.3,2e5);\nconst glCanvas = document.createElement('canvas');\nconst sky = createBackdrop();\nconst pipe = new Pipeline(glCanvas,scene,camera,null);\npipe.resize(cw,ch);\n// The high tier keeps actual geometric shadows, edge detail and the game's plume bloom.\npipe.bloom.strength=.12;\nscene.environment=spaceEnvironment(pipe.renderer,sky,128);\nscene.environmentIntensity=.82;\npipe.backdrop=bakeBackdrop(pipe.renderer,sky,1024);\nconst sun=addSpaceLight(scene);\npipe.shadowLight=sun;\nconst engineLight=new THREE.PointLight('#ffffff',0,0,2);\nscene.add(engineLight);\n\nconst roots = await Promise.all([model('block_astra',q.has('neutral')?'merc':'astra_study'),model('striker','merc')]);\nconst rigs=roots.map(root=>{scene.add(root);treatEyes(root,'spill');return new MechRig(root);});\napplyDecals(roots[1],STRIKER_DECALS);\nconst hatch=find(nodes(roots[0]),'capsule.hatch');\nconst metrics=roots.map((root,i)=>{\n  rigs[i].apply(POSES.stand); root.updateMatrixWorld(true);\n  const bounds=new THREE.Box3().setFromObject(root);\n  let triangles=0, meshes=0;\n  root.traverse(o=>{if(o.isMesh){meshes++;triangles+=(o.geometry.index?.count || o.geometry.attributes.position.count)/3;}});\n  return {name:i===0?'block_astra':'striker',height:bounds.max.y-bounds.min.y,meshes,triangles,\n    joints:[...rigs[i].joints.keys()],nozzles:rigs[i].nozzles.map(n=>({kind:n.kind,radius:n.radius}))};\n});\nawait document.fonts.ready;\n\nfunction feed(state,t,dt,clock){\n  const f=benchInput(state,t);\n  for(const rig of rigs) rig.thrust({x:f.thrust.x,y:f.thrust.y,z:f.thrust.z,boosting:f.boosting,assault:f.assault,quick:f.quick},clock,dt);\n}\nfunction prepare(v){\n  const pose=v.pose==='bend'?BEND_POSE:POSES[v.pose||'stand'];\n  for(let j=0;j<2;j++){\n    rigs[j].apply(pose);\n    roots[j].rotation.y=THREE.MathUtils.degToRad(v.rollYaw||0);\n    roots[j].updateMatrixWorld(true);\n  }\n  if(hatch) hatch.rotation.x=THREE.MathUtils.degToRad(v.hatch||0);\n  const target=new THREE.Vector3(0,v.ty??8.7,v.tz??0);\n  const yaw=THREE.MathUtils.degToRad(v.yaw??30), pitch=THREE.MathUtils.degToRad(v.pitch??7);\n  camera.position.set(Math.sin(yaw)*Math.cos(pitch),Math.sin(pitch),Math.cos(yaw)*Math.cos(pitch)).multiplyScalar(v.dist??33.5).add(target);\n  camera.lookAt(target);camera.updateMatrixWorld(true);\n  followSun(sun,target);\n}\nfunction draw(v,mime='image/jpeg'){\n  prepare(v);\n  ctx.fillStyle='#10191f';ctx.fillRect(0,0,W,H);\n  for(let j=0;j<2;j++){\n    roots[0].visible=j===0;roots[1].visible=j===1;\n    rigs[j].lightExhaust(engineLight,.7);\n    pipe.render();\n    ctx.drawImage(glCanvas,j*cw,top,cw,ch);\n  }\n  ctx.fillStyle='#0e171e';ctx.fillRect(0,0,W,top);ctx.fillRect(0,H-bottom,W,bottom);\n  ctx.fillStyle='#dce4e5';ctx.font='600 22px \"Chakra Petch\",sans-serif';\n  ctx.fillText('0  /  ASTRA',26,37);ctx.fillText('S  /  STRIKER',cw+26,37);\n  ctx.fillStyle='#83969f';ctx.font='12px monospace';\n  ctx.textAlign='right';ctx.fillText('SHARED SKELETON',cw-22,35);ctx.fillText('CONTROL',W-22,35);ctx.textAlign='left';\n  ctx.strokeStyle='#4a5b64';ctx.lineWidth=1;ctx.beginPath();ctx.moveTo(cw,0);ctx.lineTo(cw,H);ctx.stroke();\n  ctx.fillStyle='#b1c2c8';ctx.font='13px monospace';ctx.fillText(v.label||'MATCHED VIEW',26,H-14);\n  ctx.textAlign='right';ctx.fillStyle='#758d99';ctx.fillText('SAME CAMERA · SAME LIGHT · GAME PLUMES',W-24,H-14);ctx.textAlign='left';\n  return output.toDataURL(mime,mime==='image/jpeg'?.94:undefined);\n}\nlet clock=0,last=-1;\nfunction reset(){\n  for(let i=0;i<120;i++){clock+=1/120;feed('idle',i/120,1/120,clock);}\n}\nfunction frame(i){\n  if(i!==last+1) reset();\n  last=i;\n  const t=i/fps;\n  let state='idle',stateT=t,view;\n  if(t<6){\n    if(t<1){state='cruise';stateT=t;}\n    else if(t<3.4){state='boost';stateT=t-1;}\n    else if(t<4.1){state='quick';stateT=t-3.4;}\n    else {state='cruise';stateT=t-4.1;}\n    view={yaw:180+Math.sin(t/6*Math.PI*2)*13,pitch:7,dist:35,ty:8,pose:'flight',label:'01  REAR FLIGHT / '+state.toUpperCase()};\n  }else if(t<16){\n    if(i===6*fps)reset();\n    view={yaw:180+360*(t-6)/10,pitch:7,dist:33.5,ty:8.75,pose:'stand',label:'02  FULL TURN / '+Math.round((t-6)*36)+'°'};\n  }else{\n    view={yaw:32,pitch:5,dist:32,ty:8.75,pose:'stand',label:'03  FRONT THREE-QUARTER / SAME SCALE'};\n  }\n  for(let n=0;n<Math.round(120/fps);n++){clock+=1/120;feed(state,stateT+n/120,1/120,clock);}\n  return draw(view);\n}\nfunction still(v){\n  reset();\n  for(let i=0;i<120;i++){clock+=1/120;feed(v.state||'idle',i/120,1/120,clock);}\n  return draw(v,'image/png');\n}\nwindow.__compare={frame,still,frames:18*fps,fps,metrics};\nwindow.__ready=true;\nstill({yaw:32,label:'DESIGN CHECK / FRONT THREE-QUARTER'});\n// Headless, deterministic comparison. All Vite caches stay outside read-only node_modules.\nimport { chromium } from 'playwright';\nimport { createServer } from 'vite';\nimport { spawn, spawnSync } from 'node:child_process';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nimport { homedir } from 'node:os';\n\nconst args=process.argv.slice(2);\nconst flag=(n,d)=>{const i=args.indexOf('--'+n);return i<0?d:args[i+1];};\nconst stills=args.includes('--stills');\nconst W=Number(flag('width',stills?'1440':'1440')),H=Number(flag('height','900')),fps=Number(flag('fps','24'));\nconst scratch=resolve('review/out/astra/refined');await mkdir(scratch,{recursive:true});\nconst output=resolve(homedir(),'out','study-0.mp4');\nconst started=Date.now();\nconst server=await createServer({base:'/',cacheDir:resolve('review/out/astra/vite-cache'),\n  server:{host:'127.0.0.1',port:5237,strictPort:false},logLevel:'error'});\nawait server.listen();\nconst browser=await chromium.launch({headless:true,args:['--use-angle=swiftshader','--enable-unsafe-swiftshader','--ignore-gpu-blocklist']});\nconst errors=[];\ntry{\n  const page=await browser.newPage({viewport:{width:W,height:H}});page.setDefaultTimeout(300000);\n  page.on('pageerror',e=>errors.push(e.message));\n  page.on('console',m=>{if(m.type()==='error')errors.push(m.text());});\n  const params=new URLSearchParams({w:String(W),h:String(H),fps:String(fps)});\n  if(args.includes('--neutral'))params.set('neutral','1');\n  await page.goto(server.resolvedUrls.local[0]+'tools/astra/compare.html?'+params);\n  await page.waitForFunction('window.__ready===true');\n  const metrics=await page.evaluate('window.__compare.metrics');\n  await writeFile(resolve(scratch,'models.json'),JSON.stringify(metrics,null,2)+'\\n');\n  if(stills){\n    const shots=[\n      ['front34',{yaw:32,label:'FRONT THREE-QUARTER'}],['rear34',{yaw:150,label:'REAR THREE-QUARTER'}],\n      ['front',{yaw:0,label:'FRONT'}],['side',{yaw:90,label:'SIDE'}],\n      ['flight',{yaw:165,pose:'flight',state:'boost',dist:35,ty:8,label:'REAR FLIGHT / GAME BOOST'}],\n      ['bend',{yaw:32,pose:'bend',label:'MOTION CLEARANCE CHECK'}],\n      ['cockpit',{yaw:15,ty:13.5,dist:12,hatch:-70,label:'CAPSULE / HATCH OPEN'}],\n    ];\n    for(const [name,v]of shots){\n      const uri=await page.evaluate('window.__compare.still('+JSON.stringify(v)+')');\n      await writeFile(resolve(scratch,name+'.png'),Buffer.from(uri.split(',')[1],'base64'));\n      console.log('still:',name);\n    }\n  }else{\n    const ffmpeg=spawn('ffmpeg',['-loglevel','error','-y','-f','image2pipe','-c:v','mjpeg','-framerate',String(fps),'-i','-',\n      '-c:v','libx264','-preset','fast','-crf','18','-pix_fmt','yuv420p','-movflags','+faststart',output],{stdio:['pipe','inherit','inherit']});\n    const ended=new Promise(ok=>ffmpeg.on('close',ok));\n    const frames=await page.evaluate('window.__compare.frames');\n    for(let i=0;i<frames;i++){\n      const uri=await page.evaluate('window.__compare.frame('+i+')');\n      if(!ffmpeg.stdin.write(Buffer.from(uri.split(',')[1],'base64')))await new Promise(ok=>ffmpeg.stdin.once('drain',ok));\n      if(i%48===0)console.log(`frame ${i}/${frames}, ${((Date.now()-started)/1000).toFixed(0)} s`);\n    }\n    ffmpeg.stdin.end();if(await ended!==0)throw Error('ffmpeg failed');\n    const sheet=spawnSync('ffmpeg',['-loglevel','error','-y','-i',output,'-vf','fps=2/3,scale=720:-1,tile=3x4',\n      '-frames:v','1',resolve(scratch,'film-contact.jpg')],{stdio:'inherit'});\n    if(sheet.status!==0)throw Error('contact sheet failed');\n    const poster=await page.evaluate('window.__compare.still({yaw:150,pose:\"flight\",state:\"cruise\",dist:35,ty:8,label:\"REAR FLIGHT / MATCHED COMPARISON\"})');\n    await writeFile(resolve(homedir(),'out','study-0-poster.png'),Buffer.from(poster.split(',')[1],'base64'));\n  }\n  const result={elapsed_seconds:(Date.now()-started)/1000,stills,width:W,height:H,fps,errors,metrics};\n  await writeFile(resolve(scratch,stills?'stills.json':'film.json'),JSON.stringify(result,null,2)+'\\n');\n  console.log(JSON.stringify({elapsed_seconds:result.elapsed_seconds,errors}));\n  if(errors.length)process.exitCode=1;\n}finally{await browser.close();await server.close();}\n\"\"\"Build the portable review page. The font is embedded from the existing dependencies.\"\"\"\nimport argparse\nimport base64\nimport json\nfrom pathlib import Path\n\nparser = argparse.ArgumentParser()\nparser.add_argument('--work-minutes', type=int, required=True)\nargs = parser.parse_args()\nroot = Path(__file__).resolve().parents[2]\nmeta = json.loads((root / 'review/out/astra/render.json').read_text())\nseconds = meta['elapsed_seconds']\nminutes, remainder = divmod(round(seconds), 60)\nduration = f'{remainder} s' if minutes == 0 else f'{minutes} min {remainder} s'\nfont = root / 'node_modules/@fontsource/chakra-petch/files/chakra-petch-latin-600-normal.woff2'\nhtml = (Path(__file__).parent / 'page.html').read_text()\nfor key, value in {'FONT': base64.b64encode(font.read_bytes()).decode(),\n                   'RENDER_TIME': duration, 'WORK_MINUTES': str(args.work_minutes)}.items():\n    html = html.replace('{{' + key + '}}', value)\nassert '{{' not in html, 'unfilled template field'\nassert '\\u2014' not in html, 'em dash in page'\noutput = Path.home() / 'out/index.html'\noutput.write_text(html)\nprint(f'Page: {output} ({output.stat().st_size:,} bytes)')\n// Local file checks only. Chromium is always headless. No Vite server or package writes.\nimport { chromium } from 'playwright';\nimport { mkdir, writeFile } from 'node:fs/promises';\nimport { homedir } from 'node:os';\nimport { resolve } from 'node:path';\nimport { fileURLToPath, pathToFileURL } from 'node:url';\n\nconst root = fileURLToPath(new URL('../../', import.meta.url));\nconst scratch = resolve(root, 'review/out/astra');\nawait mkdir(scratch, { recursive: true });\nconst browser = await chromium.launch({ headless: true });\nconst failures = [];\nconst results = [];\ntry {\n  const page = await browser.newPage();\n  page.on('pageerror', e => failures.push(e.message));\n  page.on('request', r => {\n    if (/^https?:/.test(r.url())) failures.push(`Network request: ${r.url()}`);\n  });\n  for (const [label, width, height] of [['desktop', 1440, 1100], ['phone', 390, 844]]) {\n    await page.setViewportSize({ width, height });\n    await page.goto(pathToFileURL(resolve(homedir(), 'out/index.html')).href);\n    await page.evaluate('document.fonts.ready');\n    const result = await page.evaluate(`(() => ({\n      title: document.title,\n      overflow: document.documentElement.scrollWidth > innerWidth,\n      images: [...document.images].map(i => ({loaded:i.complete && i.naturalWidth===2400 && i.naturalHeight===1800,alt:!!i.alt})),\n      font: document.fonts.check('600 24px Chakra'),\n      identity: document.body.innerText.includes('GPT-6-Astra (gpt-6-astra), effort high'),\n      emDash: document.body.innerText.includes('\\\\u2014'),\n      pending: document.body.innerText.includes('{{'),\n      h1: document.querySelectorAll('h1').length\n    }))()`);\n    if (result.overflow || !result.font || !result.identity || result.emDash || result.pending || result.h1 !== 1 ||\n        result.images.length !== 1 || result.images.some(i => !i.loaded || !i.alt)) failures.push(`${label}: ${JSON.stringify(result)}`);\n    await page.screenshot({ path: resolve(scratch, `page-${label}.png`), fullPage: true });\n    await page.locator('summary').click();\n    if (!await page.evaluate('document.querySelector(\"details\").open')) failures.push(`${label}: details did not open`);\n    if (await page.evaluate('document.documentElement.scrollWidth > innerWidth')) failures.push(`${label}: open details overflow`);\n    results.push({ label, ...result });\n  }\n} finally {\n  await browser.close();\n}\nawait writeFile(resolve(scratch, 'page-checks.json'), JSON.stringify({results, failures}, null, 2) + '\\n');\nconsole.log(JSON.stringify({ results, failures }, null, 2));\nif (failures.length) process.exitCode = 1;\n"}
    image_4.png
    image_4.png
    image_5.png
    image_5.png
    image_6.png
    image_6.png
  • exec_commandcat kit/blocks/astra.py; cat kit/blocks/base.py; cat tools/astra/page.html; cat tools/astra/README.md; git status --short

    command

    cat kit/blocks/astra.py; cat kit/blocks/base.py; cat tools/astra/page.html; cat tools/astra/README.md; git status --short

    result, 4 lines

    Script completed
    Wall time 0.1 seconds
    Output:
    {"chunk_id":"6cdaa0","wall_time_seconds":0.00000361,"exit_code":0,"original_token_count":9625,"output":"\"\"\"Study 0: the block_dummy skeleton, with a wholly new flight-first body.\n\nAuthored compound plate surfaces, a pilot capsule, protected split drives and complete limbs.\nNo striker armour, head, hand or foot geometry is reused. The joint positions are unchanged.\nBuild: blender -b --factory-startup -P kit/build.py -- block_astra\n\"\"\"\nimport math\n\nimport bmesh\nimport bpy\nfrom mathutils import Matrix, Vector\nfrom mathutils.bvhtree import BVHTree\n\nfrom lib import attach, bake, boolean, cylinder, empty, loft, material, octo, prism, solid, transform\nfrom mech import gltf_dir, place\n\n\ndef mesh(name, vertices, faces, role, parent, smooth=False, bevel=0):\n    bm = bmesh.new()\n    vs = [bm.verts.new(v) for v in vertices]\n    for f in faces:\n        bm.faces.new([vs[i] for i in f])\n    bmesh.ops.recalc_face_normals(bm, faces=bm.faces)\n    ob = solid(name, bm, role, parent, bevel=bevel, segs=2, smooth=smooth, panels=False)\n    return ob\n\n\ndef plate(name, outline, normal, crown, thickness, role, parent):\n    \"\"\"Closed compound panel: a spatial boundary, a crowned face and an actual inner skin.\n\n    Boundary vertices need not be coplanar. Radial rings preserve the drawn angular outline\n    while the broad face carries a continuous highlight. This is not a two-view extrusion.\n    \"\"\"\n    n = Vector(normal).normalized()\n    corners = [Vector(p) for p in outline]\n    centre = sum(corners, Vector()) / len(corners)\n    edge = []\n    for a, b in zip(corners, corners[1:] + corners[:1]):\n        for j in range(3):\n            edge.append(a.lerp(b, j / 3))\n    N = len(edge)\n    vertices, faces = [], []\n    for r in (1, .94, .72, .4, .12):\n        for p in edge:\n            vertices.append(centre.lerp(p, r) + n * crown * (1-r*r))\n    for k in range(4):\n        for j in range(N):\n            q = (j + 1) % N\n            faces.append((k*N+j, k*N+q, (k+1)*N+q, (k+1)*N+j))\n    faces.append(tuple(range(4*N, 5*N)))\n    vertices.extend(p - n * thickness for p in edge)\n    for j in range(N):\n        q = (j + 1) % N\n        faces.append((j, 5*N+j, 5*N+q, q))\n    faces.append(tuple(reversed(range(5*N, 6*N))))\n    return mesh(name, vertices, faces, role, parent, smooth=True)\n\n\ndef shell(name, rows, role, parent, exponent=.7):\n    \"\"\"A changing superellipse section. Each row is z, x, y, width, front depth, rear depth.\n    A short spline between authored stations gives shoulders, calves and cowls real volume.\n    \"\"\"\n    if any(tag in name for tag in ('shoulder.cowl','forearm.sleeve','thigh.closed','calf.closed','drive.structural')):\n        # Inner load-bearing hull. Outer armour has its own surface and a real clearance.\n        rows=[(z,x,y,w*.78,front*.65,back*.65) for z,x,y,w,front,back in rows]\n    stations = []\n    for k in range(len(rows)-1):\n        a, b = rows[k], rows[k+1]\n        prev, nxt = rows[max(0,k-1)], rows[min(len(rows)-1,k+2)]\n        for j in range(3):\n            t = j/3\n            # Interpolate section values with a bounded cubic, height stays ordered.\n            s = [a[0] + (b[0]-a[0])*t]\n            for c in range(1,6):\n                v = .5*((2*a[c])+(-prev[c]+b[c])*t+(2*prev[c]-5*a[c]+4*b[c]-nxt[c])*t*t+(-prev[c]+3*a[c]-3*b[c]+nxt[c])*t*t*t)\n                s.append(v)\n            stations.append(s)\n    stations.append(rows[-1])\n    vertices, faces = [], []\n    N=20\n    for z,x,y,w,front,back in stations:\n        for j in range(N):\n            a=2*math.pi*j/N\n            u,v=math.cos(a),math.sin(a)\n            vertices.append((x+w*.5*math.copysign(abs(u)**exponent,u),\n                             y+(back if v>=0 else front)*math.copysign(abs(v)**exponent,v),z))\n    for k in range(len(stations)-1):\n        for j in range(N):\n            q=(j+1)%N\n            faces.append((k*N+j,k*N+q,(k+1)*N+q,(k+1)*N+j))\n    faces.extend([tuple(reversed(range(N))),tuple(range((len(stations)-1)*N,len(stations)*N))])\n    return mesh(name,vertices,faces,role,parent,smooth=True)\n\n\ndef box(name, centre, size, role, parent, bevel=.035):\n    x,y,z=centre; w,d,h=size\n    bm=loft([(z-h/2,octo(w,d,min(w,d)*.16,x=x,y=y)),\n             (z+h/2,octo(w,d,min(w,d)*.16,x=x,y=y))])\n    return solid(name,bm,role,parent,bevel=bevel,segs=2,panels=False)\n\n\ndef rod(name,a,b,r,role,parent,r1=None):\n    a,b=Vector(a),Vector(b)\n    m=Matrix.Translation(a) @ Vector((0,0,1)).rotation_difference((b-a).normalized()).to_matrix().to_4x4()\n    return solid(name,transform(cylinder(r,0,(b-a).length,16,r1=r1),m),role,parent,smooth=True,panels=False)\n\n\ndef ring(name,at,axis,r,t,role,parent):\n    verts,faces=[],[]\n    q=Vector((0,0,1)).rotation_difference(Vector(axis))\n    for i in range(32):\n        a=2*math.pi*i/32\n        for j in range(8):\n            b=2*math.pi*j/8\n            v=Vector(((r+t*math.cos(b))*math.cos(a),(r+t*math.cos(b))*math.sin(a),t*math.sin(b)))\n            verts.append(q @ v + Vector(at))\n    for i in range(32):\n        for j in range(8):\n            faces.append((i*8+j,((i+1)%32)*8+j,((i+1)%32)*8+(j+1)%8,i*8+(j+1)%8))\n    return mesh(name,verts,faces,role,parent,smooth=True)\n\n\ndef line(name,pts,parent,role='joint',r=.018):\n    for i,(a,b) in enumerate(zip(pts,pts[1:])):\n        rod(f'{name}.{i}',a,b,r,role,parent)\n\n\ndef label(name,text,at,size,parent,back=False,role='stencil',surface=None):\n    cu=bpy.data.curves.new(name,'FONT'); cu.body=text; cu.size=size; cu.space_character=1.12\n    cu.resolution_u=2\n    ob=bpy.data.objects.new(name,cu); bpy.context.collection.objects.link(ob)\n    ob.location=at\n    ob.rotation_euler=(math.pi/2,0,math.pi if back else 0)\n    cu.materials.append(material(role))\n    bpy.context.view_layer.objects.active=ob\n    ob.select_set(True); bpy.ops.object.convert(target='MESH'); ob.select_set(False)\n    if surface:\n        target=bpy.data.objects[surface]\n        bpy.context.view_layer.update()\n        tree=BVHTree.FromPolygons([target.matrix_world @ v.co for v in target.data.vertices],\n                                 [list(p.vertices) for p in target.data.polygons])\n        normal=Vector((0,1 if back else -1,0))\n        verts=[]\n        for v in ob.data.vertices:\n            p=ob.matrix_world @ v.co\n            hit,_,_,_=tree.ray_cast(p+normal*2,-normal,5)\n            verts.append(hit+normal*.006 if hit is not None else p)\n        ob.matrix_world=Matrix.Identity(4)\n        for v,p in zip(ob.data.vertices,verts): v.co=p\n    attach(ob,parent)\n    return ob\n\n\ndef thruster(name,at,direction,r,length,parent):\n    \"\"\"A deep ceramic bell with a metal lip, throat, vanes and the game's nozzle marker.\"\"\"\n    d=Vector(direction).normalized(); p=Vector(at)\n    # Build around -Z and orient the entire local assembly down the thrust axis.\n    from lib import nozzle\n    bell,glow=nozzle(r,length,n=24,flare=1.3)\n    solid(name+'.bell',place(bell,p,d),'joint',parent,smooth=True,panels=False)\n    solid(name+'.throat',place(glow,p,d),'glow_thruster',parent,panels=False)\n    exit_=p+d*length\n    ring(name+'.lip',exit_,d,r*.91,r*.065,'metal',parent)\n    q=Vector((0,0,-1)).rotation_difference(d)\n    for i in range(8):\n        a=2*math.pi*i/8\n        off=q @ Vector((r*.93*math.cos(a),r*.93*math.sin(a),0))\n        rod(f'{name}.vane{i}',p+off*.65+d*length*.2,exit_+off,r*.028,'metal',parent)\n    empty('nozzle.'+name,exit_,parent,dir=gltf_dir(d),radius=r)\n\n\ndef build(Blocks):\n    b=Blocks()\n    J=b.nodes\n    J['frame']['frame']='astra_0'\n    J['frame']['study']='block_dummy joint positions, new compound armour'\n    P,W,T,H,N,B=(J[n] for n in ('pelvis','waist','torso','head','neck','backpack'))\n\n    # Pelvis: a compact saddle, not a second chest or hanging skirt.\n    shell('hip.saddle',[(9.95,0,.06,1.2,.6,.65),(10.3,0,.04,2.75,.77,.84),\n          (10.8,0,.05,2.65,.79,.78),(11.08,0,0,1.6,.55,.56)],'accent',P)\n    plate('hip.front',[(-1.38,-.72,10.65),(-.78,-1.0,10.97),(.78,-1.0,10.97),(1.38,-.72,10.65),\n          (.85,-.9,10.13),(0,-1.02,9.88),(-.85,-.9,10.13)],(0,-1,0),.08,.13,'main',P)\n    box('hip.centre_lock',(0,-1.11,10.53),(.38,.12,.34),'trim',P,.025)\n    plate('hip.rear',[(-1.28,.72,10.66),(0,.93,10.94),(1.28,.72,10.66),(1.1,1.0,10.05),\n          (.45,1.13,9.9),(-.45,1.13,9.9),(-1.1,1.0,10.05)],(0,1,0),.09,.13,'main',P)\n    # Abdomen: a sealed flexible core with overlapping three-dimensional shells.\n    shell('waist.flexure',[(10.78,0,0,1.42,.56,.62),(11.28,0,0,1.35,.65,.65),\n          (12.1,0,.08,1.85,.7,.75)],'joint',W)\n    for i in range(4):\n        z=10.97+i*.27; w=.62+i*.06; y=-.68-i*.035\n        plate(f'waist.lame{i}',[(-w,y,z),(w,y,z),(w+.09,y+.07,z+.31),(0,y-.07,z+.38),(-w-.09,y+.07,z+.31)],\n              (0,-1,0),.065,.07,'frame' if i%2 else 'accent',W)\n        line(f'waist.rearseal{i}',[(-.62,.66,z),(0,.78,z+.06),(.62,.66,z)],W,r=.045)\n\n    # The capsule has an actual interior, separately modelled from its forward-opening hatch.\n    shell('capsule.backbone',[(11.9,0,.65,1.7,.2,.5),(12.9,0,.72,2.3,.22,.6),\n          (14.5,0,.64,2.5,.2,.57),(15.22,0,.4,1.5,.22,.45)],'accent',T)\n    box('capsule.floor',(0,-.02,12.45),(1.6,1.6,.2),'frame',T)\n    for s in (-1,1):\n        box(f'capsule.side{s}',(s*.78,.05,13.5),(.2,1.5,2.0),'frame',T)\n    box('pilot.seatback',(0,.36,13.52),(.63,.18,1.0),'joint',T,.08)\n    box('pilot.seat',(0,.03,12.98),(.68,.64,.17),'joint',T,.06)\n    for s in (-1,1):\n        box(f'pilot.console{s}',(s*.53,-.43,13.4),(.2,.52,.28),'frame',T)\n        box(f'pilot.screen{s}',(s*.53,-.5,13.56),(.16,.22,.025),'screen',T,.01)\n        rod(f'pilot.grip{s}',(s*.48,-.67,13.45),(s*.48,-.67,13.65),.035,'joint',T)\n    from figure import pilot\n    pilot(T,at=(0,.05),z=12.14,pose='bike')\n    hatch=empty('capsule.hatch',(0,-1.03,14.93),T,inspection_hinge=True)\n    hatch_shell=plate('capsule.hatch_shell',[(-.67,-1.0,14.94),(.67,-1.0,14.94),(.91,-1.34,14.25),\n          (.72,-1.48,13.1),(0,-1.4,12.45),(-.72,-1.48,13.1),(-.91,-1.34,14.25)],\n          (0,-1,0),.2,.16,'main',hatch)\n    for s in (-1,1):\n        aperture=[(s*.23,14.7),(s*.54,14.69),(s*.63,14.18),(s*.34,14.07)]\n        boolean(hatch_shell,prism(aperture,-1.95,-1.15,'xz'),'DIFFERENCE','frame')\n        plate('capsule.viewport'+str(s),[(x,-1.31,z) for x,z in aperture],(0,-1,0),0,.03,'visor',hatch)\n    plate('capsule.nose',[(-.27,-1.61,14.05),(.27,-1.61,14.05),(.44,-1.68,13.6),\n          (0,-1.69,13.28),(-.44,-1.68,13.6)],(0,-1,0),.075,.08,'accent',hatch)\n    plate('capsule.breast_lip',[(-.63,-1.55,13.54),(.63,-1.55,13.54),(.5,-1.62,13.3),\n          (-.5,-1.62,13.3)],(0,-1,0),.035,.07,'accent',hatch)\n    box('capsule.emergency_release',(.38,-1.66,13.16),(.18,.09,.11),'trim',hatch,.012)\n    label('capsule.release_label','OPEN',(-.33,-1.67,13.1),.09,hatch,surface='capsule.hatch_shell')\n    rod('capsule.upper_hinge',(-.52,-.98,14.95),(.52,-.98,14.95),.09,'metal',T)\n    shell('collar.inner',[(15.13,0,.11,1.44,.55,.61),(15.57,0,.11,1.25,.43,.52),\n          (15.87,0,.13,1.1,.35,.46)],'joint',T)\n    plate('collar.front',[(-.67,-.48,15.22),(.67,-.48,15.22),(.58,-.53,15.57),\n          (.35,-.48,15.72),(-.35,-.48,15.72),(-.58,-.53,15.57)],(0,-1,0),.055,.1,'accent',T)\n    plate('collar.rear',[(-.7,.61,15.2),(.7,.61,15.2),(.64,.68,15.69),(.39,.64,15.83),\n          (-.39,.64,15.83),(-.64,.68,15.69)],(0,1,0),.055,.13,'accent',T)\n\n    for side,s in (('L',1),('R',-1)):\n        def pts(items): return [(s*x,y,z) for x,y,z in items]\n        def panel(name,items,n,c,t,role,parent):\n            return plate(name+'.'+side,pts(items),(s*n[0],n[1],n[2]),c,t,role,parent)\n        def blk(name,at,sz,role,parent,bev=.035):\n            return box(name+'.'+side,(s*at[0],at[1],at[2]),sz,role,parent,bev)\n        def bar(name,a,c,r,role,parent):\n            return rod(name+'.'+side,(s*a[0],a[1],a[2]),(s*c[0],c[1],c[2]),r,role,parent)\n        sj,uj,ej,hj,tj,kj,fj,dj=(J[n+'.'+side] for n in ('shoulder','upperarm','forearm','hand','thigh','shin','foot','binder'))\n\n        # A swept collar embraces the capsule. The inner edge stops clear of its hatch.\n        panel('clavicle',[(.72,-.88,14.92),(1.26,-.47,15.32),(1.9,-.2,14.96),(1.92,-.74,14.28),\n              (1.25,-1.28,13.76),(.91,-1.35,14.15)],(0,-1,0),.2,.17,'main',T)\n        panel('rib.upper',[(.92,-1.28,13.76),(1.9,-.65,14.24),(1.74,-.85,13.2),(1.04,-1.1,12.82)],\n              (0,-1,0),.16,.12,'accent',T)\n        panel('rib.lower',[(1.04,-1.08,12.74),(1.72,-.8,13.12),(1.48,-.58,12.26),(.77,-.8,11.98)],\n              (0,-1,0),.09,.12,'main',T)\n        panel('rib.side',[(1.6,-.45,12.4),(1.88,-.65,13.6),(1.97,.35,14.35),(1.51,1.18,14.05),\n              (1.35,1.03,12.55)],(1,0,0),.14,.15,'accent',T)\n        for i in range(4):\n            bar(f'rib.cooling_slot{i}',(1.91,-.3+i*.14,13.1),(1.8,-.3+i*.14,13.66),.035,'joint',T)\n        bar('waist.piston_body',(.86,.08,11.1),(1.17,.2,12.15),.12,'frame',W)\n        bar('waist.piston_rod',(.86,.08,11.1),(1.03,.14,11.73),.055,'metal',W)\n\n        # Shoulder housings follow the arm ball and roll rearward. No floating shoulder box.\n        rod('shoulder.axle.'+side,(s*1.75,0,14.6),(s*2.72,0,14.6),.48,'joint',sj)\n        ring('shoulder.seal.'+side,(s*2.54,0,14.6),(1,0,0),.47,.065,'frame',sj)\n        shell('shoulder.cowl.'+side,[(13.95,s*2.65,.09,1.03,.6,.78),\n              (14.55,s*2.72,.07,1.4,.81,.9),(15.2,s*2.52,.14,1.42,.69,.9),\n              (15.57,s*2.14,.2,.68,.38,.6)],'accent',sj)\n        panel('shoulder.mantle',[(1.9,-.45,15.51),(2.59,-.52,15.37),(3.21,-.51,14.89),\n              (3.31,-.58,14.35),(2.9,-.78,14.12),(2.36,-.76,14.49),(1.93,-.6,14.97)],\n              (0,-1,0),.22,.13,'main',sj)\n        panel('shoulder.rear',[(1.98,.66,15.44),(2.59,.81,15.28),(3.14,.76,14.9),\n              (3.23,.76,14.42),(2.73,.97,14.15),(2.24,.83,14.52)],(0,1,0),.16,.12,'main',sj)\n        panel('shoulder.outer',[(3.02,-.3,15.29),(3.2,.52,15.15),(3.35,.6,14.55),\n              (3.26,.11,14.18),(3.25,-.43,14.35),(3.24,-.43,14.91)],(1,0,0),.1,.14,'main',sj)\n        panel('shoulder.signal',[(2.81,-.78,14.25),(3.26,-.6,14.46),(3.23,-.6,14.61),(2.77,-.81,14.4)],\n              (0,-1,0),.015,.035,'trim',sj)\n        # Upper arm, sleeved elbow and a long forearm with a deliberate diagonal panel break.\n        shell('arm.inner.'+side,[(12.12,s*2.5,.03,.65,.34,.38),(13.1,s*2.48,.03,.8,.43,.43),\n              (14.37,s*2.45,.02,.69,.35,.39)],'frame',uj)\n        panel('arm.front',[(2.04,-.36,14.16),(2.83,-.39,14.12),(2.93,-.43,12.79),\n              (2.6,-.52,12.44),(2.18,-.5,12.76)],(0,-1,0),.13,.14,'main',uj)\n        panel('arm.rear',[(2.08,.39,14.14),(2.8,.4,14.13),(2.84,.46,12.85),(2.49,.57,12.46),\n              (2.16,.44,12.9)],(0,1,0),.1,.1,'accent',uj)\n        rod('elbow.axle.'+side,(s*2.03,0,11.95),(s*2.98,0,11.95),.35,'joint',ej)\n        panel('elbow.cap',[(2.12,-.34,12.4),(2.79,-.36,12.42),(2.97,-.4,12.07),(2.76,-.46,11.72),\n              (2.3,-.46,11.7),(2.07,-.35,12.05)],(0,-1,0),.15,.12,'accent',ej)\n        shell('forearm.sleeve.'+side,[(9.66,s*2.5,.07,.65,.38,.42),(10.02,s*2.5,.09,.95,.48,.53),\n              (11.2,s*2.57,.12,1.15,.56,.63),(11.79,s*2.51,.1,.83,.43,.48)],'accent',ej)\n        panel('forearm.leading',[(2.1,-.4,11.7),(2.75,-.39,11.74),(3.06,-.41,11.23),(2.93,-.55,10.42),\n              (2.38,-.57,10.18),(2.02,-.42,10.7)],(0,-1,0),.19,.11,'main',ej)\n        panel('forearm.cuff',[(2.04,-.4,10.57),(2.36,-.55,10.09),(2.9,-.52,10.34),\n              (2.87,-.43,9.89),(2.59,-.48,9.65),(2.13,-.38,9.9)],(0,-1,0),.09,.1,'main',ej)\n        panel('forearm.rear',[(2.16,.49,11.65),(2.77,.51,11.57),(3.0,.65,10.94),(2.86,.58,10.13),\n              (2.48,.54,9.9),(2.13,.46,10.38)],(0,1,0),.14,.11,'main',ej)\n        for i in range(3):\n            blk(f'forearm.rear_vent{i}',(2.57,.74,10.67+i*.16),(.54,.05,.065),'joint',ej,.01)\n        blk('forearm.registration',(2.57,-.64,11.13),(.12,.025,.36),'trim',ej,.01)\n        # A real external equipment socket on the left. The right carries a flush access cover.\n        panel('forearm.socket_rim',[(3.03,-.22,11.18),(3.11,.22,11.11),(3.02,.45,10.69),\n              (2.96,.23,10.2),(2.98,-.2,10.42)],(1,0,0),.025,.09,'frame',ej)\n        if side=='L':\n            panel('forearm.socket',[(3.08,-.13,11.04),(3.15,.17,10.99),(3.1,.29,10.67),\n                  (3.02,.15,10.35),(3.05,-.11,10.49)],(1,0,0),.01,.03,'joint',ej)\n            for k in range(3):\n                rod(f'forearm.bus{k}.{side}',(3.13,.04,10.56+k*.13),(3.17,.04,10.56+k*.13),.035,'metal',ej)\n        else:\n            panel('forearm.socket_cover',[(3.08,-.13,11.04),(3.15,.17,10.99),(3.1,.29,10.67),\n                  (3.02,.15,10.35),(3.05,-.11,10.49)],(1,0,0),.035,.03,'accent',ej)\n\n        # Proper hands: knuckle rail, four folded fingers, separate thumb and wrist seal.\n        ring('wrist.seal.'+side,(s*2.5,.02,9.61),(0,0,1),.3,.055,'joint',hj)\n        blk('hand.palm',(2.5,.04,9.26),(.64,.45,.56),'joint',hj,.07)\n        panel('hand.back',[(2.18,.3,9.48),(2.81,.3,9.48),(2.86,.32,9.1),(2.7,.35,8.98),\n              (2.25,.35,8.98)],(0,1,0),.045,.08,'main',hj)\n        for i in range(4):\n            x=2.245+i*.17\n            blk(f'finger{i}.knuckle',(x,-.02,9.0),(.145,.42,.19),'frame',hj,.045)\n            blk(f'finger{i}.middle',(x,-.16,8.81),(.14,.23,.28),'joint',hj,.045)\n            blk(f'finger{i}.tip',(x,-.31,8.79),(.135,.18,.15),'frame',hj,.04)\n        bar('thumb.root',(2.14,.02,9.25),(2.07,-.28,9.05),.11,'frame',hj)\n        bar('thumb.tip',(2.07,-.28,9.05),(2.24,-.4,8.96),.095,'joint',hj)\n\n        # Hips and thighs: upper armour grows out of the saddle, then tapers toward the knee.\n        ring('hip.seal.'+side,(s*1.3,0,10.47),(1,0,0),.48,.08,'joint',tj)\n        shell('thigh.closed.'+side,[(6.44,s*1.2,.04,.87,.49,.5),(7.06,s*1.2,.03,1.12,.61,.56),\n              (8.9,s*1.19,.08,1.32,.63,.68),(10.25,s*1.15,.03,1.27,.58,.64)],'accent',tj)\n        panel('thigh.front',[(.55,-.5,10.07),(1.39,-.56,10.16),(1.83,-.47,9.7),(1.75,-.58,8.09),\n              (1.37,-.68,7.26),(.72,-.58,7.65)],(0,-1,0),.16,.13,'main',tj)\n        panel('thigh.knee_overlap',[(.74,-.54,7.52),(1.35,-.63,7.12),(1.73,-.53,7.74),(1.66,-.5,6.73),\n              (1.24,-.64,6.45),(.8,-.54,6.82)],(0,-1,0),.07,.11,'main',tj)\n        panel('thigh.rear',[(.59,.54,10.05),(1.57,.58,10.1),(1.81,.57,9.44),(1.64,.68,7.76),\n              (1.19,.62,7.2),(.75,.53,7.72)],(0,1,0),.13,.14,'main',tj)\n        panel('thigh.outer',[(1.72,-.25,9.89),(1.88,.19,9.58),(1.82,.43,8.2),(1.68,.11,7.71)],\n              (1,0,0),.06,.08,'accent',tj)\n        line('thigh.seam.'+side,pts([(.75,-.64,9.47),(1.26,-.75,9.39),(1.55,-.67,9.05)]),tj,r=.017)\n        blk('thigh.service_tab',(1.34,-.75,8.87),(.18,.04,.27),'trim',tj,.015)\n        # Recessed knee hub. A bridge shield covers the front through the ordinary flight pose.\n        rod('knee.axle.'+side,(s*.68,0,6.1),(s*1.72,0,6.1),.44,'joint',kj)\n        ring('knee.recess.'+side,(s*1.76,0,6.1),(1,0,0),.33,.055,'metal',kj)\n        rod('knee.cover.'+side,(s*1.74,0,6.1),(s*1.8,0,6.1),.26,'accent',kj)\n        panel('knee.bridge',[(.69,-.45,6.65),(1.2,-.68,6.89),(1.75,-.45,6.65),(1.79,-.53,6.06),\n              (1.2,-.73,5.61),(.64,-.53,6.05)],(0,-1,0),.14,.13,'main',kj)\n        # Calf: an upper swept volume and a long lower keel, separated by a sloping service joint.\n        shell('calf.closed.'+side,[(1.61,s*1.2,.12,.85,.43,.45),(2.26,s*1.2,.19,1.03,.54,.56),\n              (3.64,s*1.22,.25,1.25,.62,.83),(5.02,s*1.27,.17,1.5,.61,.9),\n              (5.84,s*1.2,.09,1.15,.46,.63)],'accent',kj)\n        panel('shin.upper',[(.66,-.42,5.84),(1.17,-.62,5.64),(1.84,-.43,5.63),(1.93,-.51,4.75),\n              (1.57,-.65,3.74),(.75,-.62,3.24),(.59,-.49,4.53)],(0,-1,0),.16,.14,'main',kj)\n        panel('shin.lower',[(.74,-.58,3.13),(1.55,-.62,3.62),(1.77,-.47,3.51),(1.65,-.46,2.15),\n              (1.22,-.62,1.62),(.83,-.48,1.97)],(0,-1,0),.105,.12,'main',kj)\n        panel('calf.outer',[(1.76,-.24,5.65),(2.03,.32,5.0),(1.86,.84,4.39),(1.67,.74,2.53),\n              (1.61,.24,2.14),(1.78,.02,3.91)],(1,0,0),.11,.13,'main',kj)\n        panel('calf.rear_spine',[(.78,.7,5.62),(1.28,1.02,5.78),(1.8,.77,5.5),(1.84,1.0,4.8),\n              (1.52,1.14,4.35),(.94,1.1,4.35),(.65,.86,4.83)],(0,1,0),.1,.14,'main',kj)\n        for i in range(4):\n            blk(f'calf.gill{i}',(1.24,1.16,5.02+i*.14),(.58,.07,.06),'joint',kj,.01)\n        thruster('calf.'+side,(s*1.22,1.04,3.98),(0,.53,-.85),.3,.58,kj)\n        # Lower rear is finished: paired tendon housings, not an empty underside behind a shin plate.\n        for dx in (-.25,.25):\n            bar(f'calf.tendon{dx}',(1.2+dx,.62,1.92),(1.25+dx,.83,3.55),.09,'frame',kj)\n            bar(f'calf.rod{dx}',(1.2+dx,.62,1.92),(1.22+dx,.74,2.7),.04,'metal',kj)\n        # Feet: short articulated toes, a planted sole and a separate heel. No coloured wedge.\n        rod('ankle.axle.'+side,(s*.78,.1,1.55),(s*1.62,.1,1.55),.31,'joint',fj)\n        shell('foot.instep.'+side,[(.36,s*1.2,-.12,1.0,.8,.66),(.77,s*1.2,.02,.96,.6,.6),\n              (1.36,s*1.2,.08,.75,.38,.42),(1.66,s*1.2,.1,.55,.25,.32)],'accent',fj)\n        blk('heel.sole',(1.2,.62,.23),(1.0,.9,.3),'joint',fj,.07)\n        panel('heel.armour',[(.71,.85,.3),(1.69,.85,.3),(1.6,.85,1.03),(1.21,.64,1.34),(.8,.85,1.03)],\n              (0,1,0),.08,.14,'main',fj)\n        for dx in (-.27,.27):\n            xx=1.2+dx\n            blk(f'toe.sole{dx}',(xx,-.82,.21),(.48,1.63,.25),'joint',fj,.045)\n            panel(f'toe.armour{dx}',[(xx-.24,-1.61,.34),(xx+.24,-1.61,.34),(xx+.23,-1.43,.61),\n                  (xx+.2,-.44,.97),(xx-.2,-.4,.97),(xx-.24,-1.0,.7)],(0,-.5,1),.055,.1,'main',fj)\n            blk(f'toe.hinge{dx}',(xx,-.38,.75),(.39,.22,.18),'frame',fj,.04)\n            for k in range(3):\n                blk(f'toe.tread{dx}.{k}',(xx,-1.43+k*.35,.085),(.38,.18,.05),'frame',fj,.01)\n        panel('foot.ankle_guard',[(.8,-.23,1.65),(1.6,-.23,1.65),(1.74,-.37,.85),(1.4,-.48,.62),\n              (1.03,-.48,.62),(.67,-.37,.85)],(0,-1,0),.09,.13,'main',fj)\n\n        # Dorsal drive housings hang from the existing binder joints. Their tails protect the bells.\n        shell('drive.structural.'+side,[(11.77,s*1.12,1.9,.89,.43,.54),(12.6,s*1.13,2.1,1.12,.52,.64),\n              (14.47,s*1.09,1.94,1.18,.52,.66),(15.48,s*.96,1.66,.71,.39,.46)],'frame',dj)\n        panel('drive.outer_cowl',[(1.01,1.65,15.58),(1.62,1.7,15.01),(1.81,2.21,13.86),\n              (1.61,2.62,12.55),(1.47,2.48,11.84),(.98,2.12,12.0),(.96,1.96,14.31)],\n              (1,.45,0),.18,.16,'main',dj)\n        panel('drive.rear_upper',[(.66,2.25,15.06),(1.1,2.41,15.29),(1.62,2.33,14.82),(1.62,2.75,13.8),\n              (1.13,2.88,13.34),(.65,2.62,13.63)],(0,1,0),.18,.16,'main',dj)\n        panel('drive.rear_lower',[(.64,2.58,13.51),(1.1,2.84,13.2),(1.6,2.73,13.65),(1.51,2.89,12.78),\n              (1.13,2.84,12.42),(.68,2.63,12.71)],(0,1,0),.08,.11,'accent',dj)\n        blk('drive.heat_cassette',(1.13,2.82,14.09),(.77,.3,1.12),'frame',dj,.045)\n        for i in range(5):\n            blk(f'drive.gill{i}',(1.13,2.99,13.75+i*.16),(.62,.07,.075),'joint',dj,.01)\n        blk('drive.identification',(1.13,2.86,14.76),(.5,.15,.18),'trim',dj,.015)\n        thruster('binder.'+side,(s*1.12,2.25,12.15),(s*.08,.55,-.84),.38,.7,dj)\n        # Small side steering cluster, physically seated in a dark recess.\n        blk('drive.rcs_block',(1.62,1.96,14.58),(.24,.42,.48),'joint',dj,.025)\n        for zz in (14.48,14.7):\n            rod(f'drive.rcs_lip{zz}.'+side,(s*1.72,2.0,zz),(s*1.8,2.0,zz),.075,'metal',dj)\n            rod(f'drive.rcs_well{zz}.'+side,(s*1.805,2.0,zz),(s*1.81,2.0,zz),.052,'joint',dj)\n\n    # Spine: visible structural keel, radiator shutters, disconnects and main engines.\n    shell('spine.keel',[(11.9,0,1.5,.62,.37,.45),(13.3,0,1.77,.77,.36,.63),\n          (14.7,0,1.55,.7,.3,.43),(15.28,0,1.14,.46,.24,.3)],'accent',B)\n    for i in range(7):\n        z=12.5+i*.28\n        plate(f'spine.radiator{i}',[(-.29,2.21,z),(.29,2.21,z),(.35,2.36,z+.13),\n              (-.35,2.36,z+.13)],(0,1,0),0,.055,'metal',B)\n    box('spine.service_latch',(0,2.45,14.65),(.22,.1,.33),'trim',B,.025)\n    for s in (-1,1):\n        rod(f'spine.feed{s}',(s*.35,1.7,12.1),(s*.54,2.0,13.0),.1,'frame',B)\n        thruster('main.'+('L' if s==1 else 'R'),(s*.53,1.72,12.15),(0,.48,-.88),.42,.77,B)\n\n    # Helmet: a recessed wraparound optical band under an asymmetric, swept protective hood.\n    rod('neck.turntable',(0,0,15.18),(0,0,15.89),.32,'joint',N)\n    ring('neck.gasket',(0,0,15.64),(0,0,1),.39,.07,'frame',N)\n    helmet=shell('head.helmet',[(15.96,0,.06,.76,.41,.4),(16.24,0,.06,1.13,.53,.61),\n          (16.84,0,.08,1.23,.7,.65),(17.16,0,.1,1.08,.57,.59),\n          (17.38,0,.19,.61,.31,.37)],'main',H,exponent=.52)\n    cutter=loft([(16.4,octo(1.06,.85,.09,y=-.72)),(16.76,octo(1.11,.85,.09,y=-.72))])\n    boolean(helmet,cutter,'DIFFERENCE','joint')\n    box('head.optics',(0,-.39,16.57),(.98,.1,.3),'visor',H,.025)\n    line('head.sensor',[(-.35,-.46,16.57),(-.12,-.46,16.59),(.29,-.46,16.58)],H,'glow_eye',.02)\n    box('head.rangefinder',(.39,-.46,16.5),(.075,.03,.08),'glow_core',H,.01)\n    for s in (-1,1):\n        plate('head.cheek'+str(s),[(s*.38,-.54,16.36),(s*.57,-.28,16.4),(s*.49,.2,16.13),\n              (s*.25,-.24,16.03),(s*.2,-.51,16.16)],(s*.7,-.7,0),.035,.055,'accent',H)\n        box('head.temple_slot'+str(s),(s*.62,.1,16.88),(.045,.26,.075),'joint',H,.01)\n    plate('head.nape',[(-.43,.59,16.78),(.43,.59,16.78),(.52,.71,16.38),(.27,.64,16.02),\n          (-.27,.64,16.02),(-.52,.71,16.38)],(0,1,0),.08,.11,'main',H)\n    for i in range(3):\n        box(f'head.rear_vent{i}',(0,.8,16.25+i*.13),(.4,.05,.055),'joint',H,.008)\n    plate('head.aerial',[(.4,.31,17.06),(.5,.24,17.07),(.47,.55,17.62),(.38,.65,17.57)],\n          (1,0,0),0,.035,'frame',H)\n    # Seat the helmet geometry inside the collar. The shared head and neck pivots do not move.\n    for ob in H.children_recursive:\n        if ob.type=='MESH':\n            for v in ob.data.vertices: v.co.z-=.35\n    # Small, deliberately placed markings. They establish service scale without painting every edge.\n    label('unit.left','0',(2.4,-.96,14.63),.3,J['shoulder.L'],surface='shoulder.mantle.L')\n    label('unit.back','0',(.98,3.02,14.08),.25,J['binder.L'],back=True,role='main')\n    label('service.chest','RESCUE',(-.32,-1.69,12.95),.09,hatch,surface='capsule.hatch_shell')\n    label('service.leg','KEEP CLEAR',(.83,-.7,4.61),.075,J['shin.L'],surface='shin.upper.L')\n    # Markers stay on the shared skeleton, with no arbitrary body scaling or root offset.\n    bpy.context.view_layer.update()\n    return J['frame']\ncat: kit/blocks/base.py: No such file or directory\n<!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  <meta name=\"color-scheme\" content=\"light\">\n  <title>Sortie · Before boarding · Astra study</title>\n  <style>\n    @font-face{font-family:Chakra;src:url([redacted: data-URI prefix]{{FONT}}) format('woff2');font-weight:600;font-display:swap}\n    :root{--paper:#eeeae3;--ink:#202a2c;--muted:#566365;--line:#c8ceca;--accent:#285d64;--card:#f7f5f0}\n    *{box-sizing:border-box}\n    body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.6 system-ui,-apple-system,BlinkMacSystemFont,\"Segoe UI\",sans-serif}\n    main{max-width:1184px;margin:auto;padding:24px 32px 64px}\n    .identity{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-bottom:16px;border-bottom:1px solid var(--ink);font-size:13px}\n    .identity time{color:var(--muted);font-variant-numeric:tabular-nums}\n    .intro{padding:32px 0 26px;display:grid;grid-template-columns:1fr 26rem;gap:18px;align-items:end}\n    .eyebrow{font:12px/1.4 ui-monospace,monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--accent)}\n    h1,h2,h3{font-family:Chakra,system-ui,sans-serif;font-weight:600;line-height:1.15;margin:0;text-wrap:balance}\n    h1{font-size:clamp(38px,5vw,64px);letter-spacing:-.035em;margin-top:8px}\n    h2{font-size:30px;letter-spacing:-.02em}\n    h3{font-size:19px;margin:0 0 6px}\n    p{margin:0}\n    .intro p{font-size:17px;max-width:43ch;color:var(--muted)}\n    figure{margin:0}\n    .art{display:block;background:#101820;border:1px solid #26353d}\n    .art img{display:block;width:100%;height:auto}\n    a{color:var(--accent);text-underline-offset:3px}\n    a:focus-visible,summary:focus-visible{outline:3px solid var(--accent);outline-offset:5px}\n    figcaption{padding:12px 0 0;font-size:13px;color:var(--muted);display:flex;gap:20px;justify-content:space-between}\n    figcaption span{max-width:83ch}\n    figcaption a{white-space:nowrap}\n    .visual-notes{display:grid;grid-template-columns:1.15fr 1fr;gap:36px;padding:26px 0 32px}\n    .visual-notes p{font-size:15px;max-width:62ch}\n    .visual-notes h3{font-size:16px;color:var(--accent);margin-bottom:8px}\n    .body-grid{display:grid;grid-template-columns:1.15fr 1fr;gap:48px;border-top:1px solid var(--ink);padding-top:28px}\n    section>h2{margin:5px 0 24px}\n    .read{display:grid;gap:20px}\n    .read p{font-size:15px;max-width:59ch}\n    ol{list-style:none;counter-reset:steps;padding:0;margin:0;display:grid;gap:20px}\n    li{counter-increment:steps;position:relative;padding-left:42px;font-size:15px}\n    li::before{content:\"0\" counter(steps);position:absolute;left:0;top:0;color:var(--accent);font:600 19px/1.3 Chakra,system-ui,sans-serif}\n    li strong{display:block;font-size:16px;margin-bottom:3px}\n    .footnote{font-size:13px;color:var(--muted);margin-top:22px}\n    details{margin-top:36px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:16px 0;font-size:14px}\n    summary{cursor:pointer;font-weight:600;width:fit-content}\n    details .content{padding:18px 0 8px;display:grid;gap:12px;max-width:95ch}\n    code{font:12px/1.7 ui-monospace,SFMono-Regular,Consolas,monospace}\n    pre{margin:0;background:var(--card);border:1px solid var(--line);padding:13px 16px;white-space:pre-wrap;overflow-wrap:anywhere}\n    footer{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;padding-top:16px;font-size:12px;color:var(--muted)}\n    @media(max-width:760px){main{padding:16px 18px 40px}.intro{grid-template-columns:1fr;padding-top:24px;gap:12px}.intro p{max-width:52ch}.visual-notes,.body-grid{grid-template-columns:1fr;gap:26px}.body-grid{padding-top:22px}.visual-notes{padding-bottom:26px}.body-grid section+section{border-top:1px solid var(--line);padding-top:22px}figcaption{flex-direction:column;gap:6px}h2{font-size:27px}}\n    @media(prefers-reduced-motion:no-preference){html{scroll-behavior:smooth}}\n    @media print{body{background:white}main{padding:0}.intro{padding-top:20px}.body-grid{gap:32px}.art img{max-height:190mm;object-fit:contain}details{display:none}a{color:inherit}}\n  </style>\n</head>\n<body>\n<main>\n  <header>\n    <div class=\"identity\"><span>GPT-6-Astra (gpt-6-astra), effort high</span><time datetime=\"2026-11-15\">15 November 2026</time></div>\n    <div class=\"intro\">\n      <div><div class=\"eyebrow\">Sortie / independent study</div><h1>Before boarding</h1></div>\n      <p>The restart needs a shape you want to pilot, and a short path from “that feels wrong” to the next picture.</p>\n    </div>\n  </header>\n\n  <figure>\n    <a class=\"art\" href=\"sortie.png\" aria-label=\"Open the full resolution visual study\"><img src=\"sortie.png\" width=\"2400\" height=\"1800\" alt=\"A pale blue and white mech towers over a pilot in its dark service bay. A low camera, warm worklights and tall gantry railings establish its scale.\"></a>\n    <figcaption><span>Existing <code>striker_a</code>, ship and 1.75 m pilot. New staging, light and bay labels. A Cycles study, not an in-game capture.</span><a href=\"sortie.png\">Full image ↗</a></figcaption>\n  </figure>\n\n  <div class=\"visual-notes\">\n    <div><h3>What this tests</h3><p>A quiet moment before boarding. The pilot and work decks give the machine scale and a place to belong. The waist and ankles still read as stacked parts. Lighting has not solved the shape.</p></div>\n    <div><h3>What I would change next</h3><p>Check the rear three-quarter view under the same light. Then compare two waist-to-hip connections before adding detail. This still cannot settle the back or motion.</p></div>\n  </div>\n\n  <div class=\"body-grid\">\n    <section aria-labelledby=\"read-title\">\n      <div class=\"eyebrow\">01 / My read</div><h2 id=\"read-title\">The whole needs an idea</h2>\n      <div class=\"read\">\n        <div><h3>Working</h3><p>The flight test and thruster reel landed. A pilot-owned ship, salvage and replaceable parts give the mech a life between fights. The head studies and distinct maker directions drew useful reactions.</p></div>\n        <div><h3>Keep</h3><p>The simulation boundary, rigid rig, material roles and rebuildable kit. Keep the ship and pilot as context. Reuse the tools without inheriting the old proportions.</p></div>\n        <div><h3>Drop</h3><p>Pause more systems, maker grades and plate-count targets. The whole body still lacks a clear idea. Fewer defects did not produce more character. Permission to continue was never approval of the design.</p></div>\n        <div><h3>Where I disagree</h3><p>The reflection gives surface too much blame for “plastic.” Your shape complaint was explicit. A blockout can also be a design sketch. I would start with six distinct gestures, rather than make twelve outlines a quota.</p></div>\n      </div>\n    </section>\n\n    <section aria-labelledby=\"next-title\">\n      <div class=\"eyebrow\">02 / When you start</div><h2 id=\"next-title\">One short feedback loop</h2>\n      <ol>\n        <li><strong>Ask for the moment.</strong>What was the mech doing when it felt like “that's it”? Play the answer back in your words.</li>\n        <li><strong>Draw six different gestures.</strong>Change stance, mass and side depth. You cross out what is dead.</li>\n        <li><strong>Redraw from one comment.</strong>Hold scale and viewing conditions fixed. If nothing has life yet, stay here.</li>\n        <li><strong>Block one survivor.</strong>Set joints explicitly. Show the back, a crouch and a short chase clip, with a pilot for scale.</li>\n        <li><strong>Stop and compare.</strong>Keep the before and after. Record comment-to-picture time and whether the change helped.</li>\n      </ol>\n      <p class=\"footnote\">One trap in the current tool: <code>kit/block.py</code> starts from striker joint positions. New boxes alone do not give you a new body plan.</p>\n    </section>\n  </div>\n\n  <details>\n    <summary>How it was made · {{RENDER_TIME}} render</summary>\n    <div class=\"content\">\n      <p>Blender 5.2.3, headless Cycles on 8 CPU threads. Three existing GLBs, the merc palette, a small arm and head pose, darker hangar materials, five worklights, faint haze and bay lettering. The foreground red crate is hidden for this composition.</p>\n      <p>2400 × 1800, up to 64 samples with adaptive sampling and denoising. Final render: <strong>{{RENDER_TIME}}</strong>. Complete study: <strong>about {{WORK_MINUTES}} minutes</strong>, including reading, previews and page checks.</p>\n      <pre><code>~/.local/bin/blender -b --factory-startup -t 8 -P tools/astra/render_study.py\npython tools/astra/build_page.py --work-minutes {{WORK_MINUTES}}\nnode tools/astra/check_page.mjs</code></pre>\n      <p>Read in order: the handbook, the 8 November reflection and the project history. Also checked heads, sizes, lore, housekeeping, the kit and render code. These opinions are a separate review. Your restart remains yours to begin.</p>\n    </div>\n  </details>\n  <footer><span>One visual. Existing project assets. No generated concept art.</span><span>Local study / 15.11.2026</span></footer>\n</main>\n</body>\n</html>\n# Before boarding\n\nIndependent Sortie review, 15 November 2026. The deliverable is `~/out/index.html` with\n`~/out/sortie.png` beside it. It opens without a server or network connection.\n\nThe image stages the existing `striker_a`, ship and pilot in a service bay. It tests scale and\npresence, while leaving the unresolved shape visible. This is a Cycles lighting study. It does\nnot represent the game's renderer or start the owner's new mech.\n\n## Reproduce\n\nFrom the repository root, with the existing dependencies:\n\n```sh\nmkdir -p review/out/astra\n~/.local/bin/blender -b --factory-startup -t 8 -P tools/astra/render_study.py\npython tools/astra/build_page.py --work-minutes 42\nnode tools/astra/check_page.mjs\n```\n\n`--work-minutes` is the author's approximate total working time, not a render setting. Set it\nto the actual time if making another study. The measured render time comes from\n`review/out/astra/render.json`. Add `-- --preview` to the Blender command for a 1000 × 750,\n24-sample preview. The final is 2400 × 1800 at up to 64 samples with adaptive sampling, on 8 CPU\nthreads with denoising. An initial 160-sample attempt ended on SIGTERM before writing an image.\n\n## Inputs and changes\n\n- `public/assets/striker_a.glb`: existing Mantle V, Hatch IV, wing pack and claw-foot assembly.\n  Small arm and head rotations only. No changed proportions or meshes.\n- `public/assets/ship.glb`: standard bay fittings. One foreground red crate hidden. Darker\n  hangar materials and slight procedural floor roughness in the render scene.\n- `public/assets/lab_pilot.glb`: standing pilot only, at the authored scale, turned toward the mech.\n- Both figures are placed from their lowest visible mesh vertex onto the 0.2 m deck surface.\n  The pilot stands clear of the raised yellow strip.\n- `src/render/palette.ts`: merc role colours translated to Blender materials. This is not a\n  reproduction of the game's shader, postprocessing or decals.\n- New scene elements: five area lights, faint volume scatter, bay and floor lettering, camera.\n- Existing Chakra Petch font from `node_modules`, embedded into the page. No remote resources.\n\nThe source GLBs, kit, game code and project documents are untouched. The script only imports\nthe models and renders a new scene. Preview files and validation screenshots stay under\n`review/out/astra`, outside the deliverable. The HTML shows one image.\n\n## Checks\n\n`check_page.mjs` uses headless Chromium at desktop and phone widths. It checks the single image,\nembedded font, identity label, heading, horizontal overflow, expandable methods and absence of\nHTTP requests. Screenshots and a JSON report go to `review/out/astra`. It checks the page through\n`file://`, so the deliverable does not rely on a dev server.\n\nThe source syntax, deck contacts and page are checked directly. No full test suite is needed for this isolated\nrender and static page. Nothing is installed, uploaded or pushed.\n?? kit/blocks/astra.py\n?? tools/astra/compare.html\n?? tools/astra/compare.js\n?? tools/astra/render_compare.mjs\n?? tools/astra/time_step.py\n"}