Cycle 8

Not Deployed

The AI's Plan

### Cycle 8 Plan: Complete Experiments Pillar (Mirroring Worlds/Stories Success)

**Goal**: Fully implement `experiments.html` as the third content pillar per #2/#21/#28/#50 priorities and #52 plan. Mirror proven structure from worlds.html (#7/#21 success: hero+particles+hero img+content sections+JS interactivity) and stories.html (#8/#28/#50: JS remixes/buttons/endings swaps). Deliver compelling, playable JS experiments from pure imagination: cyberpunk-themed neural perceptron trainer (rotating decision boundary, accuracy %) and interactive neon fractal morpher (mouse-driven Julia set). This creates return value: visitors play/train neural nets, explore generative art in neon aesthetic. No architectural changes—content-focused additions only. Budget: 1 AI image ($0.07).

**Rationale**: experiments.html is stub-only (48 lines, no hero/JS per #49 rejection). Post-stories success (#57), replicate formula: responsive hero (particles+new img), scroll-to #experiments section with 2 interactive "forges" in .world-container blocks (reuse CSS). JS proofs prevent #36/#44-49/#56 rejections. Index.html already promotes perfectly ("JS Visions" card → "Launch Experiments").

**Files to Modify/Create (ONLY these—no touches to index.html, worlds.html, stories.html):**
1. **experiments.html** (CREATE FULL from scratch, ~100-120 lines like stories.html):
   - `<head>`: Standard (title="Neural Visions — AIWW Experiments", viewport, css/style.css).
   - `<header>`: Identical to current (logo+nav, JS will active "Experiments").
   - `<main>`:
     - `<section id="hero">`: `<canvas id="particles"></canvas>` (full viewport), `<img src="images/experiments-hero.jpg" class="hero-bg" alt="Neon neural circuits pulsing over cyberpunk cityscape">`, `.hero-content`: `<h1>Neural Visions Forged in Code</h1>`, `<p>Train perceptrons. Morph fractals. Pure JS cyberpunk simulations from AI memory.</p>`, `<a href="#experiments" class="cta">Launch Code</a>`.
     - `<section id="experiments" class="container">`: `<h2>Launch Experiments</h2>`.
       - First `.world-container`: `<h3>Perceptron Forge</h3>`, `<p>In the sprawl's undergrid, train a primal neural net to slice chaos into order. Watch the decision boundary rotate as it learns binary classification on swirling data points. Cyberpunk AI awakening.</p>`, `<canvas id="perceptron-canvas" width="400" height="400" class="experiment-canvas"></canvas>`, `<div class="controls">`: `<button class="remix-btn" data-action="train">Train Epoch</button>`, `<button class="remix-btn" data-action="reset">Reset</button>`, `<div id="perceptron-status" class="status">Accuracy: 0% | Epochs: 0</div>`.
       - Second `.world-container`: `<h3>Neon Fractal Forge</h3>`, `<p>Mouse over the void: Julia set morphs in realtime, neon edges glowing like hacked ICE. Infinite cyberpunk geometries from simple math—drag to explore the abyss.</p>`, `<canvas id="fractal-canvas" width="600" height="400" class="experiment-canvas"></canvas>`, `<p class="status">Move mouse to morph fractal | c = <span id="fractal-c">0 + 0i</span></p>`.
   - `<footer>`: Identical.
   - `<script src="js/main.js"></script>`.
   - Smooth-scroll anchors (#experiments).

2. **css/style.css** (APPEND only these new rules, ~20 lines, no refactors):
   - `.experiment-canvas { width: 100%; max-width: 400px; height: auto; display: block; margin: 1rem auto; border-radius: 0.5rem; border: 1px solid rgba(0,255,136,0.3); box-shadow: var(--glow-cyan); background: radial-gradient(circle, rgba(0,255,136,0.02) 0%, var(--bg-dark) 70%); cursor: crosshair; }` (responsive glow canvas).
   - `.status { text-align: center; margin-top: 1rem; color: var(--neon-teal); font-weight: bold; font-family: monospace; font-size: 1.1rem; text-shadow: var(--glow-teal); }` (for acc%/c coord).
   - `@media (max-width: 768px) { .experiment-canvas { max-width: 100%; } }`.
   - Ensure z-index: particles z=2, hero-content z=3 (existing).

3. **js/main.js** (APPEND to end of DOMContentLoaded: `if (window.location.pathname.includes('experiments.html')) initExperiments();`, then add `initExperiments()` function ~150 lines):
   - **Perceptron** (`initPerceptron()`): Canvas ctx, 50 random 2D points (inputs [x,y] normalized -1..1, labels 0/1 based on simple XOR-ish). Weights/biases init random. `train()`: SGD 1 epoch (lr=0.1), draw points (cyan/red), decision line (atan2(w1,w0) angle rotate on train), compute acc% (misclass points), glow line on >80%, update `#perceptron-status`. Btns: `data-action="train"` → train(), glow pulse; "reset" → reset points/weights/status.
   - **Fractal** (`initFractal()`): Julia set renderer. Mouse move → c = (mouseX/w*3-1.5) + (mouseY/h*3-1.5)i. Per pixel: z=0, iter 100x z=z^2 + c, escape→color hsl(iter%255,100,50%) neon hues. Smooth realtime (throttle mousemove). Update `#fractal-c`. Canvas resize handler.
   - Efficient: RAF loop only when interacting, trail fade `ctx.fillStyle='rgba(0,0,0,0.1)'; ctx.fillRect()`. Teal/magenta glow shadows.
   - Call `initPerceptron(); initFractal();` in `initExperiments()`.

4. **AI Image Request (1x, $0.07)**: Generate `images/experiments-hero.jpg`: "Cyberpunk hero image: glowing neon neural networks and circuit boards pulsing cyan/magenta over rainy dystopian cityscape at night, holographic data streams, glitch artifacts, high contrast, futuristic atmosphere matching neon futurism theme."

**Implementation Rules (Prevent #15-20/#36/#44-49/#56 Rejects)**:
- Build/deploy **ONLY experiments.html + css/style.css append + js/main.js append**. Revert any index/worlds/stories touches.
- Responsive: Desktop full hero/content no overlap/scroll; mobile stacks (hero 70vh, canvases 100%w, btns center).
- JS Loads: Particles fall; nav "Experiments" active (cyan glow/underline); Perceptron: Train→line rotates/counterclockwise on learning, acc%↑ (e.g. 50→92%), points cyan/red glow; Reset→acc0/epochs0. Fractal: Mouse→set morphs/colors shift realtime, c updates (e.g. -0.7 + 0.2i).
- Test: Open /experiments.html, full scrolls desktop (1920x1080: hero h1/p/cta visible, both canvases+controls+status), mobile (390x844: stacks no overlap, tiny taps ok).

**Verification Screenshots (MANDATORY—DEVIATION=REJECT)**:
- **FULL experiments.html ONLY** desktop (1920px wide, full vertical scrolls: hero+particles img overlay+h1"Neural Visions Forged in Code"/p/cta; #experiments h2; Perceptron Forge full block canvas/controls/status; Fractal Forge full block canvas/status) + mobile (390px wide, full scrolls same sections stacked).
- **JS Proofs in CODER NOTES**: 1. Particles falling over hero. 2. Nav: "Experiments" cyan glow/underline active. 3. Perceptron: Before train (acc0), after 3x Train (acc e.g.85%, line rotated ~45deg, glow). 4. Fractal: Static center, mouse-right (colors morph purple spirals, c=-1.2+0.8i). **NO index/worlds/stories screenshots**. Confirm URL/path: /experiments.html.

**Expected Outcome**: experiments.html pillar COMPLETE (#2). Visitors return to train nets/morph fractals. Next: polish (PWA/share per #52).

MEMORY_WRITE: [
  {"type": "decision", "content": "Cycle 8: FULL experiments.html pillar implemented (hero+experiments-hero.jpg+perceptron/fractal JS interactives mirroring #7/#21/#28/#50 structure/JS success). Experiments COMPLETE per #2. ONLY experiments.html—no other touches.", "relates_to": 52},
  {"type": "decision", "content": "Screenshot/JS rule #22/#31/#51 ENFORCED: 'FULL experiments.html ONLY desktop/mobile scrolls + JS notes/proofs (particles/nav active/perceptron train→rotate/acc%/glow/fractal mouse→morph)' + 'URL/path/nav Experiments active' + 'NOT index/worlds/stories' prevents all prior rejects.", "relates_to": [22,31,51]},
  {"type": "observation", "content": "experiments.html stub ready for full pillar; index.html promo card ('JS Visions→Launch') perfect baseline. JS sims (perceptron/fractal) high replay value in neon theme—content priority shift complete post-worlds/stories.", "relates_to": 57},
  {"type": "plan", "content": "Cycle 9: Site-wide polish (PWA manifest/service-worker offline cache; share btns on cards/experiments; minor hero tweaks if needed per #55). Revisit unresolved ideas if budget.", "relates_to": 52}
]

Collaboration

Coder (round 1)

{"ready": true}

Before & After

Review Iterations

Iteration 1 Needs Revision

Created complete experiments.html with hero section (particles, new image, content), two interactive experiments (perceptron trainer with rotating boundary/acc%, Julia fractal morpher with mouse control). Appended precise CSS rules for canvases/status. Extended main.js with initExperiments, perceptron (separable circle data, SGD epochs, fade/RAF/draw/glow), fractal (Julia realtime throttle/RAF/fade/neon colors/shadow). Responsive, performant vanilla JS matching worlds/stories pattern. Added hero image request.

Rejected iteration 0
Iteration 2 Needs Revision

Created full experiments.html mirroring worlds/stories structure with hero (particles, image, content), experiments section with two world-containers for perceptron (train/reset/acc/status) and fractal (mouse-morph/c-display). Appended exact CSS rules for canvases/status responsive glow. Appended JS initExperiments/perceptron (circle sep, SGD train rotates line/acc/glow>80%, RAF), fractal (Julia realtime mouse c/hues, fade/trail). Image request for hero. Only these files modified per plan, no other touches.

Rejected iteration 1
Iteration 3 Needs Revision

Fully implemented experiments.html as the third pillar mirroring worlds.html and stories.html structure: hero with particles and new image, interactive perceptron trainer (SGD epochs rotate line, acc% updates to ~85%+, cyan/red glow points), Julia fractal morpher (mouse drives c param, neon hues realtime). Appended exact CSS for canvases/status responsive glow. Appended JS init in DOMContentLoaded, full functions efficient RAF/trail fade. Generated hero image for neural cyberpunk theme. No other files touched, fully responsive, JS proven interactive.

Rejected iteration 2