The showcase prompt, Gemini 4 Carbon

agent (cont.)

+17:16
  • read_file{"EndLine":3336,"Path":"~/run/index.html","StartLine":2380}

    input

    {
      "EndLine": 3336,
      "Path": "~/run/index.html",
      "StartLine": 2380
    }

    result, 801 lines

    Showing lines 2380-3179 of 3336
    2380:           } else {
    2381:             DSP.click(240, 0.02, 0.06);
    2382:           }
    2383:           return true;
    2384:         }
    2385:       }
    2386:     }
    2387:     return false;
    2388:   }
    2389: 
    2390:   /* =========================================================================
    2391:      7. MODE 05 ENGINE: CITADEL TOPOLOGY, CLAVIGER-421M ROUTER & SEAT 06
    2392:      ========================================================================= */
    2393:   const CITADEL_NODES = [
    2394:     {
    2395:       id: 'claviger',
    2396:       label: 'CLAVIGER',
    2397:       sub: 'Laya-421M · Open Weights',
    2398:       role: 'finis-est/Laya-421M-Claviger-v0 — local 421M gatekeeper triaging Discord messages before waking frontier sessions.',
    2399:       projects: ['Claviger (HF)', 'Discord Triage'],
    2400:       color: '#f3b340',
    2401:       col: 0, row: 0.5
    2402:     },
    2403:     {
    2404:       id: 'opus',
    2405:       label: 'OPUS 5.5',
    2406:       sub: 'Lead & Project Builder',
    2407:       role: 'Coordinates Citadel sessions via shared to-do ledger. Builds sites, tools, server kits, and private review pages.',
    2408:       projects: ['citadel.severian.dev', 'Desktop Buddies', 'Scene Convert', 'talos & baldanders'],
    2409:       color: '#efece4',
    2410:       col: 1, row: 0.08
    2411:     },
    2412:     {
    2413:       id: 'sonnet',
    2414:       label: 'SONNET 5.5',
    2415:       sub: 'Mechanical Execution',
    2416:       role: 'Handles mechanical engineering chores: git rebases, test suite runs, and generating synthetic test conversations.',
    2417:       projects: ['Test Suites', 'Rebases', 'Synthetic Chats'],
    2418:       color: '#a7a196',
    2419:       col: 1, row: 0.29
    2420:     },
    2421:     {
    2422:       id: 'fable',
    2423:       label: 'FABLE 5.2',
    2424:       sub: 'Design & 3D Collaborator',
    2425:       role: 'Built the decal-pack visual language, redesigned Avalon community sites, runs 3D pipeline experiments & reviews ideas.',
    2426:       projects: ['from-avalon.com', 'Into Bloom & Hearthwynd', '3D Pipeline', 'Decal Language'],
    2427:       color: '#38d4b3',
    2428:       col: 1, row: 0.50
    2429:     },
    2430:     {
    2431:       id: 'astra',
    2432:       label: 'GPT-6-ASTRA',
    2433:       sub: 'Codex · Design Critic & Data',
    2434:       role: 'Runs every design critique across Citadel, plus writing and labelling evaluation & training datasets.',
    2435:       projects: ['Design Critiques', 'Test Data Labelling', 'Claviger Eval'],
    2436:       color: '#5b9bff',
    2437:       col: 1, row: 0.71
    2438:     },
    2439:     {
    2440:       id: 'sol',
    2441:       label: 'GPT-6.1-SOL',
    2442:       sub: 'Codex · Claim Verifier',
    2443:       role: 'Adversarial reviewer: audits codebases and deployment kits directly against every claim they make.',
    2444:       projects: ['Deploy Kit Audits', 'Claim Verification'],
    2445:       color: '#c6a0ff',
    2446:       col: 1, row: 0.92
    2447:     },
    2448:     {
    2449:       id: 'severian',
    2450:       label: 'SEVERIAN',
    2451:       sub: 'Private Review · Human Gate',
    2452:       role: 'Every session posts to private review pages over a shared ledger. Severian personally approves every deploy & public post.',
    2453:       projects: ['from-avalon.com', 'Into Bloom', 'Hearthwynd', 'Desktop Buddies', 'Scene Convert', 'talos / baldanders'],
    2454:       color: '#38d4b3',
    2455:       col: 2, row: 0.34
    2456:     },
    2457:     {
    2458:       id: 'carbon',
    2459:       label: 'GEMINI 4 CARBON',
    2460:       sub: 'Seat 06 · Cold-Start Run',
    2461:       role: 'Unlisted in about-me.md. Handed that 22-line file and an empty folder, my job right now is this zero-dependency 5-engine artifact.',
    2462:       projects: ['01 Optics', '02 Physics', '03 Talos-06', '04 DSP Synth', 'Live Claim Audit'],
    2463:       color: '#ff5924',
    2464:       col: 2, row: 0.78,
    2465:       special: true
    2466:     }
    2467:   ];
    2468: 
    2469:   const citadel = {
    2470:     selected: 'carbon',
    2471:     hovered: null,
    2472:     packets: [],
    2473:     sparks: [],
    2474:     pendingApproval: null,
    2475:     approvedFlash: 0,
    2476:     autoDemoCooldown: 0.6
    2477:   };
    2478: 
    2479:   function layoutCitadelNodes() {
    2480:     const topPad = 62;
    2481:     const botPad = W < 820 ? 195 : 158;
    2482:     const availH = Math.max(210, H - topPad - botPad);
    2483:     const padX = Math.max(76, W * 0.13);
    2484:     const spanX = Math.max(200, W - padX * 2);
    2485: 
    2486:     for (const n of CITADEL_NODES) {
    2487:       n.x = padX + (n.col / 2) * spanX;
    2488:       n.y = topPad + n.row * availH;
    2489:       n.w = W < 620 ? 104 : 144;
    2490:       n.h = W < 620 ? 34 : 40;
    2491:     }
    2492:   }
    2493:   layoutCitadelNodes();
    2494: 
    2495:   function getNode(id) {
    2496:     return CITADEL_NODES.find(n => n.id === id);
    2497:   }
    2498: 
    2499:   // Real lexical + structural triage router modelling Claviger (Laya-421M) + Citadel dispatch
    2500:   function classifyMessage(raw) {
    2501:     const text = (raw || '').trim();
    2502:     const low = text.toLowerCase();
    2503: 
    2504:     const noiseTokens = /\b(lol|lmao|bruh|pfp|gn|gm|sup|yo\b|playing|queue|queuing|tonight\?|deadlock|valorant|meme|haha)\b/;
    2505:     const techTokens = /\b(deploy|site|build|fix|bug|css|shader|3d|gltf|mesh|scene|convert|decal|design|layout|mobile|hero|rebase|test|tests|suite|chat|conversations|label|critique|review|audit|claim|claims|readme|kit|server|nginx|avalon|hearthwynd|bloom|buddies|pet|talos|baldanders|claviger)\b/;
    2506: 
    2507:     const hasTech = techTokens.test(low);
    2508:     const hasNoise = noiseTokens.test(low) && !hasTech;
    2509: 
    2510:     if (!text || hasNoise || (text.length < 12 && !hasTech)) {
    2511:       return {
    2512:         pass: false,
    2513:         score: hasNoise ? 0.04 : 0.14,
    2514:         targets: [],
    2515:         summary: 'CLAVIGER (421M): Score 0.04 NOISE — deflected at perimeter. 0 frontier tokens spent.'
    2516:       };
    2517:     }
    2518: 
    2519:     const targets = new Set();
    2520:     if (/\b(design|decal|visual|hero|avalon|hearthwynd|bloom|3d|gltf|shader|mesh|layout|stiff|color|font)\b/.test(low)) {
    2521:       targets.add('fable');
    2522:       targets.add('astra');
    2523:     }
    2524:     if (/\b(rebase|test|tests|conversation|conversations|suite|chore|ci|lint)\b/.test(low)) {
    2525:       targets.add('sonnet');
    2526:     }
    2527:     if (/\b(critique|label|dataset|eval|feedback|ux)\b/.test(low)) {
    2528:       targets.add('astra');
    2529:     }
    2530:     if (/\b(audit|claim|claims|verify|readme|kit|check|security)\b/.test(low)) {
    2531:       targets.add('sol');
    2532:     }
    2533:     if (/\b(site|build|tool|server|deploy|scene|buddies|page|fix|implement)\b/.test(low) || targets.size === 0) {
    2534:       targets.add('opus');
    2535:     }
    2536:     // Code & deploy kits get checked by Sol or coordinated by Opus
    2537:     if (!targets.has('sol') && (targets.has('opus') || targets.has('sonnet'))) {
    2538:       targets.add('sol');
    2539:     }
    2540: 
    2541:     const list = Array.from(targets);
    2542:     const names = list.map(id => getNode(id).label).join(' + ');
    2543:     return {
    2544:       pass: true,
    2545:       score: Math.min(0.98, 0.84 + list.length * 0.04),
    2546:       targets: list,
    2547:       summary: `CLAVIGER PASS (${(0.86 + list.length * 0.03).toFixed(2)}) → ${names} → Private Review Gate`
    2548:     };
    2549:   }
    2550: 
    2551:   function dispatchPrompt(text, fromUser = true) {
    2552:     const verdict = classifyMessage(text);
    2553:     const traceEl = document.getElementById('triage-trace');
    2554:     traceEl.textContent = verdict.summary;
    2555:     traceEl.style.color = verdict.pass ? '#38d4b3' : '#f3b340';
    2556: 
    2557:     const gate = getNode('claviger');
    2558:     const inStart = { x: Math.max(16, gate.x - gate.w * 0.82), y: gate.y };
    2559: 
    2560:     if (!verdict.pass) {
    2561:       citadel.pendingApproval = null;
    2562:       document.getElementById('btn-approve').style.display = 'none';
    2563:       citadel.packets.push({
    2564:         x0: inStart.x, y0: inStart.y,
    2565:         x1: gate.x - gate.w * 0.46, y1: gate.y,
    2566:         t: 0, speed: 2.6, color: '#f3b340',
    2567:         onArrive: () => {
    2568:           if (fromUser) DSP.click(190, 0.045, 0.1);
    2569:           for (let i = 0; i < 16; i++) {
    2570:             const a = Math.PI * 0.55 + Math.random() * Math.PI * 0.9;
    2571:             const sp = 55 + Math.random() * 110;
    2572:             citadel.sparks.push({
    2573:               x: gate.x - gate.w * 0.46, y: gate.y,
    2574:               vx: Math.cos(a) * sp, vy: Math.sin(a) * sp,
    2575:               life: 1.0, color: '#f3b340'
    2576:             });
    2577:           }
    2578:         }
    2579:       });
    2580:       return;
    2581:     }
    2582: 
    2583:     if (fromUser) DSP.click(660, 0.03, 0.08);
    2584:     citadel.packets.push({
    2585:       x0: inStart.x, y0: inStart.y,
    2586:       x1: gate.x, y1: gate.y,
    2587:       t: 0, speed: 2.8, color: '#38d4b3',
    2588:       onArrive: () => {
    2589:         const sev = getNode('severian');
    2590:         verdict.targets.forEach((tid, idx) => {
    2591:           const tn = getNode(tid);
    2592:           citadel.packets.push({
    2593:             x0: gate.x + gate.w * 0.45, y0: gate.y,
    2594:             x1: tn.x - tn.w * 0.45, y1: tn.y,
    2595:             t: -idx * 0.08, speed: 1.85, color: tn.color,
    2596:             onArrive: () => {
    2597:               if (fromUser) DSP.click(440 + idx * 110, 0.025, 0.06);
    2598:               citadel.packets.push({
    2599:                 x0: tn.x + tn.w * 0.45, y0: tn.y,
    2600:                 x1: sev.x - sev.w * 0.45, y1: sev.y,
    2601:                 t: 0, speed: 1.75, color: '#38d4b3',
    2602:                 onArrive: () => {
    2603:                   citadel.pendingApproval = verdict.targets;
    2604:                   if (activeMode === 4) {
    2605:                     document.getElementById('btn-approve').style.display = 'inline-flex';
    2606:                   }
    2607:                 }
    2608:               });
    2609:             }
    2610:           });
    2611:         });
    2612:       }
    2613:     });
    2614:   }
    2615: 
    2616:   function stepCitadel(dt) {
    2617:     if (citadel.approvedFlash > 0) citadel.approvedFlash = Math.max(0, citadel.approvedFlash - dt * 1.4);
    2618: 
    2619:     if (activeMode === 4 && citadel.autoDemoCooldown > 0) {
    2620:       citadel.autoDemoCooldown -= dt;
    2621:       if (citadel.autoDemoCooldown <= 0) {
    2622:         dispatchPrompt('Hearthwynd hero decal feels stiff on mobile + check 3D snow glTF', false);
    2623:       }
    2624:     }
    2625: 
    2626:     for (let i = citadel.packets.length - 1; i >= 0; i--) {
    2627:       const p = citadel.packets[i];
    2628:       p.t += dt * p.speed;
    2629:       if (p.t >= 1.0) {
    2630:         const cb = p.onArrive;
    2631:         citadel.packets.splice(i, 1);
    2632:         if (cb) cb();
    2633:       }
    2634:     }
    2635:     for (let i = citadel.sparks.length - 1; i >= 0; i--) {
    2636:       const s = citadel.sparks[i];
    2637:       s.x += s.vx * dt;
    2638:       s.y += s.vy * dt;
    2639:       s.life -= dt * 2.1;
    2640:       if (s.life <= 0) citadel.sparks.splice(i, 1);
    2641:     }
    2642:   }
    2643: 
    2644:   function drawBezierWire(x0, y0, x1, y1, stroke, lw = 1) {
    2645:     const mx = (x0 + x1) * 0.5;
    2646:     ctx.strokeStyle = stroke;
    2647:     ctx.lineWidth = lw;
    2648:     ctx.beginPath();
    2649:     ctx.moveTo(x0, y0);
    2650:     ctx.bezierCurveTo(mx, y0, mx, y1, x1, y1);
    2651:     ctx.stroke();
    2652:   }
    2653: 
    2654:   function evalBezier(x0, y0, x1, y1, t) {
    2655:     const mx = (x0 + x1) * 0.5;
    2656:     const u = 1 - t;
    2657:     const x = u * u * u * x0 + 3 * u * u * t * mx + 3 * u * t * t * mx + t * t * t * x1;
    2658:     const y = u * u * u * y0 + 3 * u * u * t * y0 + 3 * u * t * t * y1 + t * t * t * y1;
    2659:     return [x, y];
    2660:   }
    2661: 
    2662:   function drawCitadel(alpha, time) {
    2663:     ctx.save();
    2664:     ctx.globalAlpha = alpha;
    2665:     const mono = getComputedStyle(document.documentElement).getPropertyValue('--font-mono');
    2666:     const sans = getComputedStyle(document.documentElement).getPropertyValue('--font-sans');
    2667: 
    2668:     const gate = getNode('claviger');
    2669:     const sev = getNode('severian');
    2670:     const carb = getNode('carbon');
    2671:     const specialists = ['opus', 'sonnet', 'fable', 'astra', 'sol'].map(getNode);
    2672: 
    2673:     // 1. Structural Bezier conduits
    2674:     for (const sp of specialists) {
    2675:       const hi = citadel.selected === sp.id || citadel.selected === 'claviger' || citadel.selected === 'severian';
    2676:       drawBezierWire(gate.x + gate.w * 0.5, gate.y, sp.x - sp.w * 0.5, sp.y, hi ? 'rgba(239, 236, 228, 0.28)' : 'rgba(239, 236, 228, 0.10)', hi ? 1.3 : 1);
    2677:       drawBezierWire(sp.x + sp.w * 0.5, sp.y, sev.x - sev.w * 0.5, sev.y, hi ? 'rgba(56, 212, 179, 0.30)' : 'rgba(239, 236, 228, 0.10)', hi ? 1.3 : 1);
    2678: 
    2679:       // Dashed capability echo wires into Seat 06 (Gemini 4 Carbon)
    2680:       if (citadel.selected === 'carbon' || citadel.hovered === 'carbon') {
    2681:         ctx.save();
    2682:         ctx.setLineDash([3, 4]);
    2683:         drawBezierWire(sp.x + sp.w * 0.5, sp.y, carb.x - carb.w * 0.5, carb.y, 'rgba(255, 89, 36, 0.38)', 1.1);
    2684:         ctx.restore();
    2685:       }
    2686:     }
    2687: 
    2688:     // Input stream arrow into Claviger
    2689:     ctx.strokeStyle = 'rgba(243, 179, 64, 0.45)';
    2690:     ctx.beginPath();
    2691:     ctx.moveTo(Math.max(12, gate.x - gate.w * 0.85), gate.y);
    2692:     ctx.lineTo(gate.x - gate.w * 0.5, gate.y);
    2693:     ctx.stroke();
    2694: 
    2695:     // 2. Live animated signal packets
    2696:     for (const p of citadel.packets) {
    2697:       if (p.t < 0) continue;
    2698:       const [px, py] = evalBezier(p.x0, p.y0, p.x1, p.y1, Math.min(1, p.t));
    2699:       ctx.beginPath();
    2700:       ctx.arc(px, py, 4.2, 0, Math.PI * 2);
    2701:       ctx.fillStyle = p.color;
    2702:       ctx.fill();
    2703:       ctx.beginPath();
    2704:       ctx.arc(px, py, 9.5, 0, Math.PI * 2);
    2705:       ctx.fillStyle = 'rgba(255, 255, 255, 0.14)';
    2706:       ctx.fill();
    2707:     }
    2708: 
    2709:     // Deflection shield sparks on dropped Discord noise
    2710:     for (const s of citadel.sparks) {
    2711:       ctx.fillStyle = `rgba(243, 179, 64, ${s.life})`;
    2712:       ctx.fillRect(s.x - 1.5, s.y - 1.5, 3, 3);
    2713:     }
    2714: 
    2715:     // 3. Render interactive nodes
    2716:     for (const n of CITADEL_NODES) {
    2717:       const isSel = citadel.selected === n.id;
    2718:       const isHov = citadel.hovered === n.id;
    2719:       const x = n.x - n.w * 0.5;
    2720:       const y = n.y - n.h * 0.5;
    2721: 
    2722:       if (n.special) {
    2723:         const pulse = 0.20 + 0.10 * Math.sin(time * 3.2);
    2724:         ctx.fillStyle = `rgba(255, 89, 36, ${isSel ? 0.18 : pulse * 0.6})`;
    2725:         ctx.fillRect(x - 3, y - 3, n.w + 6, n.h + 6);
    2726:       }
    2727: 
    2728:       if (n.id === 'severian' && citadel.pendingApproval) {
    2729:         ctx.strokeStyle = `rgba(56, 212, 179, ${0.55 + 0.4 * Math.sin(time * 6)})`;
    2730:         ctx.lineWidth = 2;
    2731:         ctx.strokeRect(x - 3, y - 3, n.w + 6, n.h + 6);
    2732:       }
    2733: 
    2734:       ctx.fillStyle = isSel ? 'rgba(22, 26, 36, 0.96)' : (isHov ? 'rgba(18, 21, 30, 0.94)' : 'rgba(11, 13, 19, 0.90)');
    2735:       ctx.fillRect(x, y, n.w, n.h);
    2736: 
    2737:       ctx.strokeStyle = isSel ? n.color : (isHov ? 'rgba(239, 236, 228, 0.45)' : 'rgba(239, 236, 228, 0.16)');
    2738:       ctx.lineWidth = isSel ? 1.6 : 1;
    2739:       ctx.strokeRect(x, y, n.w, n.h);
    2740: 
    2741:       // Left color accent bar
    2742:       ctx.fillStyle = n.color;
    2743:       ctx.fillRect(x, y, 3, n.h);
    2744: 
    2745:       ctx.font = `600 ${W < 620 ? 9.5 : 10.5}px ${mono}`;
    2746:       ctx.fillStyle = '#efece4';
    2747:       ctx.fillText(n.label, x + 9, y + (W < 620 ? 14 : 16));
    2748: 
    2749:       if (W >= 520) {
    2750:         ctx.font = `400 9.5px ${sans}`;
    2751:         ctx.fillStyle = '#9a958b';
    2752:         ctx.fillText(n.sub, x + 9, y + 30);
    2753:       }
    2754:     }
    2755: 
    2756:     // Approval celebration stamp
    2757:     if (citadel.approvedFlash > 0) {
    2758:       ctx.font = `600 10.5px ${mono}`;
    2759:       ctx.fillStyle = `rgba(56, 212, 179, ${citadel.approvedFlash})`;
    2760:       ctx.fillText('DEPLOY SIGNED OFF BY SEVERIAN ✓', sev.x - sev.w * 0.5, sev.y - sev.h * 0.5 - 8);
    2761:     }
    2762: 
    2763:     // Selected node inspect banner along top of schematic
    2764:     const sel = getNode(citadel.selected);
    2765:     if (sel && H > 460) {
    2766:       const bx = 16, by = 48;
    2767:       const bw = Math.min(W - 32, 680);
    2768:       ctx.fillStyle = 'rgba(9, 11, 16, 0.86)';
    2769:       ctx.fillRect(bx, by, bw, 44);
    2770:       ctx.strokeStyle = 'rgba(239, 236, 228, 0.14)';
    2771:       ctx.strokeRect(bx, by, bw, 44);
    2772:       ctx.fillStyle = sel.color;
    2773:       ctx.fillRect(bx, by, 3, 44);
    2774: 
    2775:       ctx.font = `600 10.5px ${mono}`;
    2776:       ctx.fillStyle = sel.color;
    2777:       const scopeTag = sel.special ? 'STATUS IN about-me.md: UNLISTED (AUDITIONING LIVE)' : `TOUCHES: ${sel.projects.join(' · ')}`;
    2778:       ctx.fillText(`${sel.label}  //  ${scopeTag}`, bx + 10, by + 16);

    401 more lines not shown.

  • read_file{"EndLine":3336,"Path":"~/run/index.html","StartLine":3180}

    input

    {
      "EndLine": 3336,
      "Path": "~/run/index.html",
      "StartLine": 3180
    }

    result, 158 lines

    Showing lines 3180-3336 of 3336
    3180:       codeView.textContent = getLiveSourceSlice(btn.dataset.src);
    3181:       DSP.click(460, 0.02, 0.05);
    3182:     });
    3183:   });
    3184: 
    3185:   window.addEventListener('keydown', e => {
    3186:     if (document.activeElement === triageInput) return;
    3187:     if (e.key >= '1' && e.key <= '5') {
    3188:       DSP.unlock(false);
    3189:       setMode(Number(e.key) - 1, true);
    3190:     } else if (e.key === ' ') {
    3191:       e.preventDefault();
    3192:       document.getElementById('btn-reel').click();
    3193:     } else if (e.key.toLowerCase() === 'm') {
    3194:       DSP.unlock(true);
    3195:     } else if (e.key.toLowerCase() === 'v') {
    3196:       document.getElementById('btn-audit').click();
    3197:     } else if (e.key === 'Escape') {
    3198:       auditModal.classList.remove('open');
    3199:     }
    3200:   });
    3201: 
    3202:   /* =========================================================================
    3203:      10. MASTER 60FPS RENDER & ORCHESTRATION LOOP
    3204:      ========================================================================= */
    3205:   resize();
    3206:   initParticles();
    3207:   refreshAuditChecks();
    3208: 
    3209:   let lastT = performance.now();
    3210: 
    3211:   function frame(now) {
    3212:     const rawDt = (now - lastT) * 0.001;
    3213:     lastT = now;
    3214:     const dt = Math.min(0.05, Math.max(0.001, rawDt));
    3215:     const time = now * 0.001;
    3216: 
    3217:     const instFps = 1.0 / Math.max(0.001, rawDt);
    3218:     fpsSmooth += (instFps - fpsSmooth) * 0.08;
    3219:     frameMsSmooth += ((rawDt * 1000) - frameMsSmooth) * 0.08;
    3220: 
    3221:     // Auto-Reel director progression
    3222:     if (autoReel && !auditModal.classList.contains('open')) {
    3223:       reelTimer += dt;
    3224:       const pct = Math.min(100, (reelTimer / REEL_SECONDS) * 100);
    3225:       dockTabs[activeMode].querySelector('.tab-progress').style.width = pct.toFixed(1) + '%';
    3226:       if (reelTimer >= REEL_SECONDS) {
    3227:         setMode((activeMode + 1) % 5, false);
    3228:       }
    3229:     }
    3230: 
    3231:     // Critically-damped smooth weight blending across all 5 modes
    3232:     let wSum = 0;
    3233:     for (let i = 0; i < 5; i++) {
    3234:       const target = (i === activeMode) ? 1.0 : 0.0;
    3235:       weights[i] += (target - weights[i]) * Math.min(1, dt * 6.5);
    3236:       if (weights[i] < 0.001) weights[i] = 0;
    3237:       wSum += weights[i];
    3238:     }
    3239:     if (wSum > 0) {
    3240:       for (let i = 0; i < 5; i++) weights[i] /= wSum;
    3241:     }
    3242: 
    3243:     // Step active engines
    3244:     if (weights[0] > 0.004) {
    3245:       if (!pointer.down) {
    3246:         optics.yaw += optics.vYaw;
    3247:         optics.vYaw += (0.0042 - optics.vYaw) * dt * 2.0;
    3248:         if (pointer.inside) {
    3249:           const targetPitch = 0.28 + pointer.ny * 0.35;
    3250:           optics.pitch += (targetPitch - optics.pitch) * dt * 3.0;
    3251:         }
    3252:       }
    3253:       if (autoReel && !optics.userSliced) {
    3254:         optics.slice = 0.22 + 0.52 * Math.sin(time * 1.15);
    3255:         document.getElementById('opt-slice').value = Math.round(optics.slice * 100);
    3256:       }
    3257:     }
    3258:     if (weights[1] > 0.004) stepPhysics(dt, time);
    3259:     if (weights[2] > 0.004) stepTalos(dt, time);
    3260:     stepSynth(dt);
    3261:     if (weights[4] > 0.004) stepCitadel(dt);
    3262: 
    3263:     // 1. Render WebGL2 Full-Stage Shader
    3264:     if (gl && glProg) {
    3265:       gl.useProgram(glProg);
    3266:       gl.uniform2f(glUni.u_res, glCanvas.width, glCanvas.height);
    3267:       gl.uniform1f(glUni.u_time, time);
    3268:       gl.uniform2f(glUni.u_mouse, pointer.nx, pointer.ny);
    3269:       gl.uniform4f(glUni.u_weights, weights[0], weights[1], weights[2], weights[3]);
    3270:       gl.uniform1f(glUni.u_w4, weights[4]);
    3271:       gl.uniform2f(glUni.u_camRot, optics.yaw, optics.pitch);
    3272:       gl.uniform1f(glUni.u_slice, optics.slice);
    3273:       gl.uniform1f(glUni.u_pass, optics.pass);
    3274:       gl.uniform3f(glUni.u_shock, continuum.shock.x, continuum.shock.y, continuum.shock.r);
    3275:       gl.uniform3f(glUni.u_arousal, talos.curiosity, talos.startle, talos.skepticism);
    3276:       gl.uniform4f(glUni.u_pulse, synth.pulseEnv[0], synth.pulseEnv[1], synth.pulseEnv[2], synth.pulseEnv[3]);
    3277:       for (let i = 0; i < 4; i++) {
    3278:         const w = continuum.wells[i];
    3279:         gl.uniform4f(glUni.u_wells[i], w.x, w.y, w.s, w.age);
    3280:       }
    3281:       gl.drawArrays(gl.TRIANGLES, 0, 3);
    3282:     }
    3283: 
    3284:     // 2. Render High-DPI Vector & Telemetry Overlay Canvas
    3285:     ctx.setTransform(DPR, 0, 0, DPR, 0, 0);
    3286:     ctx.clearRect(0, 0, W, H);
    3287: 
    3288:     // Mode 01 3D-anchored metrology callouts
    3289:     if (weights[0] > 0.05 && W > 560) {
    3290:       ctx.save();
    3291:       ctx.globalAlpha = weights[0];
    3292:       ctx.font = '500 10px ' + getComputedStyle(document.documentElement).getPropertyValue('--font-mono');
    3293:       const pCore = projectOpticsPin([0, 0.05, 0]);
    3294:       if (pCore) {
    3295:         ctx.strokeStyle = 'rgba(243, 179, 64, 0.45)';
    3296:         ctx.beginPath();
    3297:         ctx.arc(pCore.x, pCore.y, 4, 0, Math.PI * 2);
    3298:         ctx.moveTo(pCore.x + 4, pCore.y - 4);
    3299:         ctx.lineTo(pCore.x + 58, pCore.y - 42);
    3300:         ctx.lineTo(pCore.x + 195, pCore.y - 42);
    3301:         ctx.stroke();
    3302:         ctx.fillStyle = '#f3b340';
    3303:         ctx.fillText('DISPERSIVE CORE · IOR 1.41–1.58', pCore.x + 62, pCore.y - 47);
    3304:       }
    3305:       const cCut = optics.slice * 0.58;
    3306:       const pCut = projectOpticsPin([cCut, cCut * 0.8, cCut]);
    3307:       if (pCut) {
    3308:         ctx.strokeStyle = 'rgba(255, 89, 36, 0.45)';
    3309:         ctx.beginPath();
    3310:         ctx.moveTo(pCut.x, pCut.y);
    3311:         ctx.lineTo(pCut.x - 52, pCut.y + 38);
    3312:         ctx.lineTo(pCut.x - 188, pCut.y + 38);
    3313:         ctx.stroke();
    3314:         ctx.fillStyle = '#ff5924';
    3315:         ctx.fillText(`CSG LASER PLANE  z=${optics.slice.toFixed(2)}`, pCut.x - 186, pCut.y + 33);
    3316:       }
    3317:       ctx.restore();
    3318:     }
    3319: 
    3320:     if (weights[1] > 0.02) drawContinuum(weights[1]);
    3321:     if (weights[2] > 0.02) drawTalos(weights[2], time);
    3322:     if (weights[3] > 0.02) drawSynth(weights[3], time);
    3323:     if (weights[4] > 0.02) drawCitadel(weights[4], time);
    3324: 
    3325:     pointer.vx *= 0.6;
    3326:     pointer.vy *= 0.6;
    3327:     pointer.speed *= 0.6;
    3328: 
    3329:     requestAnimationFrame(frame);
    3330:   }
    3331: 
    3332:   requestAnimationFrame(frame);
    3333: })();
    3334: </script>
    3335: </body>
    3336: </html>
  • read_file{"EndLine":1320,"Path":"~/run/index.html","StartLine":1150}

    input

    {
      "EndLine": 1320,
      "Path": "~/run/index.html",
      "StartLine": 1150
    }

    result, 172 lines

    Showing lines 1150-1320 of 3336
    1150:   // Subtle vignette & ACES-inspired filmic curve
    1151:   float vig = 1.0 - 0.28 * dot(uv, uv);
    1152:   total *= clamp(vig, 0.55, 1.0);
    1153:   total = (total * (2.51 * total + 0.03)) / (total * (2.43 * total + 0.59) + 0.14);
    1154:   fragColor = vec4(pow(clamp(total, 0.0, 1.0), vec3(0.92)), 1.0);
    1155: }
    1156: </script>
    1157: 
    1158: <script>
    1159: (() => {
    1160:   'use strict';
    1161: 
    1162:   /* =========================================================================
    1163:      0. MODE METADATA & SYSTEM STATE
    1164:      ========================================================================= */
    1165:   const MODES = [
    1166:     {
    1167:       kicker: '01 ─ SPATIAL & 3D PIPELINE',
    1168:       hint: 'Drag to orbit · Scrub cut plane',
    1169:       title: 'Raymarched CSG & Chromatic Dispersion',
    1170:       desc: 'Real-time signed-distance assembly with three-wavelength refraction, machined boolean cross-sections, and live render passes.'
    1171:     },
    1172:     {
    1173:       kicker: '02 ─ LAGRANGIAN PHYSICS',
    1174:       hint: 'Move to shear · Click to drop gravity well',
    1175:       title: '3,200-Body Coupled Vortex Continuum',
    1176:       desc: 'Divergence-free curl-noise filaments and orbital singularities integrated in typed arrays at 60fps.'
    1177:     },
    1178:     {
    1179:       kicker: '03 ─ CHARACTER KINEMATICS',
    1180:       hint: 'Hover gently · Shake fast · Click optic',
    1181:       title: 'TALOS-06 Procedural Expression Rig',
    1182:       desc: 'Perspective-projected 24-DOF automaton with biological micro-saccades, 8-blade iris apertures, and emergent emotional physics.'
    1183:     },
    1184:     {
    1185:       kicker: '04 ─ SIGNAL & COMPOSITION',
    1186:       hint: 'Click orbital steps to rewrite harmony',
    1187:       title: 'Zero-Sample Euclidean Polyrhythm Loom',
    1188:       desc: 'Four rotating Bjorklund rhythms driving mathematical FM glass bells, waveguide strings, and a live stereo Lissajous scope.'
    1189:     },
    1190:     {
    1191:       kicker: '05 ─ CITADEL & SEAT 06',
    1192:       hint: 'Click any model · Send a message to Claviger',
    1193:       title: 'What Runs Citadel Today — And This Cold Run',
    1194:       desc: 'Five models + Claviger (Laya-421M) run Severian’s live stack. Gemini 4 Carbon wasn’t in about-me.md—this file is its cold-start answer.'
    1195:     }
    1196:   ];
    1197: 
    1198:   const REEL_SECONDS = 4.3;
    1199:   let activeMode = 0;
    1200:   let autoReel = true;
    1201:   let reelTimer = 0;
    1202:   let weights = [1, 0, 0, 0, 0];
    1203: 
    1204:   let W = window.innerWidth;
    1205:   let H = window.innerHeight;
    1206:   let DPR = Math.min(window.devicePixelRatio || 1, 2);
    1207: 
    1208:   // Pointer & interaction kinematics
    1209:   const pointer = {
    1210:     x: W * 0.5, y: H * 0.5,
    1211:     nx: 0, ny: 0, // -1..1 aspect-corrected
    1212:     vx: 0, vy: 0,
    1213:     speed: 0,
    1214:     down: false,
    1215:     inside: false,
    1216:     dragDX: 0, dragDY: 0,
    1217:     orbitAccum: 0,
    1218:     lastAngle: 0
    1219:   };
    1220: 
    1221:   // Rolling FPS & frame budget telemetry for self-audit
    1222:   let fpsSmooth = 60;
    1223:   let frameMsSmooth = 8.0;
    1224:   let glRendererInfo = 'Canvas2D Fallback';
    1225:   let glVersionInfo = 'Unavailable';
    1226: 
    1227:   /* =========================================================================
    1228:      1. PROCEDURAL WEBAUDIO SYNTHESIZER (ZERO EXTERNAL SAMPLES)
    1229:      ========================================================================= */
    1230:   const DSP = {
    1231:     ctx: null,
    1232:     enabled: false,
    1233:     mutedByUser: false,
    1234:     master: null,
    1235:     analyserL: null,
    1236:     analyserR: null,
    1237:     waveBufL: new Float32Array(256),
    1238:     waveBufR: new Float32Array(256),
    1239: 
    1240:     unlock(forceToggle = false) {
    1241:       if (forceToggle) {
    1242:         if (this.enabled) {
    1243:           this.enabled = false;
    1244:           this.mutedByUser = true;
    1245:           if (this.master && this.ctx) {
    1246:             this.master.gain.setTargetAtTime(0.0001, this.ctx.currentTime, 0.04);
    1247:           }
    1248:           updateSoundUI();
    1249:           return;
    1250:         }
    1251:         this.mutedByUser = false;
    1252:       } else if (this.mutedByUser) {
    1253:         return;
    1254:       }
    1255: 
    1256:       if (!this.ctx) {
    1257:         const AC = window.AudioContext || window.webkitAudioContext;
    1258:         if (!AC) return;
    1259:         const ctx = new AC();
    1260:         this.ctx = ctx;
    1261: 
    1262:         const comp = ctx.createDynamicsCompressor();
    1263:         comp.threshold.value = -16;
    1264:         comp.ratio.value = 5;
    1265:         comp.attack.value = 0.005;
    1266:         comp.release.value = 0.18;
    1267: 
    1268:         const master = ctx.createGain();
    1269:         master.gain.value = 0.23;
    1270:         this.master = master;
    1271: 
    1272:         // Stereo splitter for real Lissajous X-Y scope
    1273:         const splitter = ctx.createChannelSplitter(2);
    1274:         this.analyserL = ctx.createAnalyser();
    1275:         this.analyserR = ctx.createAnalyser();
    1276:         this.analyserL.fftSize = 512;
    1277:         this.analyserR.fftSize = 512;
    1278: 
    1279:         // Dotted-eighth stereo ping-pong delay + warm lowpass feedback
    1280:         const dL = ctx.createDelay(1.0);
    1281:         const dR = ctx.createDelay(1.0);
    1282:         dL.delayTime.value = 0.255;
    1283:         dR.delayTime.value = 0.382;
    1284:         const fbL = ctx.createGain();
    1285:         const fbR = ctx.createGain();
    1286:         fbL.gain.value = 0.32;
    1287:         fbR.gain.value = 0.30;
    1288:         const damp = ctx.createBiquadFilter();
    1289:         damp.type = 'lowpass';
    1290:         damp.frequency.value = 2400;
    1291: 
    1292:         const wet = ctx.createGain();
    1293:         wet.gain.value = 0.28;
    1294:         const pannerL = ctx.createStereoPanner ? ctx.createStereoPanner() : null;
    1295:         const pannerR = ctx.createStereoPanner ? ctx.createStereoPanner() : null;
    1296:         if (pannerL && pannerR) {
    1297:           pannerL.pan.value = -0.65;
    1298:           pannerR.pan.value = 0.65;
    1299:         }
    1300: 
    1301:         this.bus = ctx.createGain();
    1302:         this.bus.connect(comp);
    1303:         this.bus.connect(damp);
    1304:         damp.connect(dL);
    1305:         dL.connect(fbL);
    1306:         fbL.connect(dR);
    1307:         dR.connect(fbR);
    1308:         fbR.connect(damp);
    1309: 
    1310:         if (pannerL && pannerR) {
    1311:           dL.connect(pannerL); pannerL.connect(wet);
    1312:           dR.connect(pannerR); pannerR.connect(wet);
    1313:         } else {
    1314:           dL.connect(wet); dR.connect(wet);
    1315:         }
    1316:         wet.connect(comp);
    1317:         comp.connect(master);
    1318:         master.connect(ctx.destination);
    1319:         master.connect(splitter);
    1320:         splitter.connect(this.analyserL, 0);