# Neural Forge — Progression & Psychology Design

This file documents *why* the course is built the way it is — the behavioral
loops, the unlock economy, and the cryptographic glue that ties them together.

## The four loops

### 1. The Curiosity Loop (per concept)
- **Hook**: a vivid scene or surprising claim ("the entire transformer is one
  equation, written twelve times").
- **Tension**: a clearly-stated question the student now wants answered.
- **Release**: the math, derived live with the student.
- **Reward**: a small "aha" worked example.

Borrowed from: ARG storytelling, Andy Matuschak / Quantum Country mnemonic medium.

### 2. The Mastery Loop (per module)
- Pre-test → see where you are
- Learn → math + code lab
- Boss Fight → graded implementation
- Forge Gate → password puzzle proving you understood
- Unlock → new tool that lets you see further

Borrowed from: Zelda (key → door → tool → bigger world); roguelikes; Khan Academy mastery.

### 3. The Identity Loop (per phase)
At the end of each phase (4 modules) the student earns a **Title**:

| Phase | Title | What it confers |
|---|---|---|
| I (1–4) | **The Initiate** | Access to a private discord-style forum + the right to grade Phase-I submissions of newer students |
| II (5–8) | **The Builder** | Access to a free credits pool on a shared GPU sandbox |
| III (9–12) | **The Architect** | Cosmetic site theme + access to "labs" — opt-in research seminars |
| IV (13–16) | **The Researcher** | Co-author byline on the next course revision; arXiv submission credits |

Borrowed from: martial arts belts; academic ranks; Stack Overflow privileges.

### 4. The Author Loop (lifetime)
The student doesn't just consume the course — they *extend* it. Final unlock
includes write access to the "Field Notes" wiki where students publish their own
mini-modules. New cohorts learn from those notes. Each cited contribution earns
a permanent shoutout on the student's profile.

Borrowed from: Wikipedia; the open-source contribution loop.

---

## The Forge Gate password system

Each gate is a **content-derived password**: the student computes some specific
number, vector, or string by hand or with the code they wrote. They type it
into the unlock box. If correct, the next module's seal opens.

**Why it works:**
1. The puzzle is impossible to brute force casually (numerical answers, not
   multiple choice).
2. The puzzle is impossible to skip with web search — every gate is parameterized
   by the student's session ID so the numbers vary slightly.
3. The puzzle is *exactly* a sanity check on the module's core skill. If you can
   pass the gate, you understood the module.

Implementation: each module page contains an answer-hash check in client JS.
The hash is `SHA-256(answer_string + session_salt)`. Correct entry sets a
`localStorage` key `forge.module_N.unlocked = true` and posts a Forge Key —
a 4-byte hex string also derived from the hash — to the hub page.

**Forge Keys** are displayed prominently on the student's profile and can be:
- copy-pasted to share progress
- exchanged in a leaderboard
- redeemed for cosmetic upgrades to the hub interface (theme packs, particle
  effects on the progress bar, animated avatars)

### Sample gate code (vanilla JS, no deps)

```js
async function checkForgeGate(input, expected_sha256) {
  const enc = new TextEncoder().encode(input.trim());
  const buf = await crypto.subtle.digest('SHA-256', enc);
  const hex = [...new Uint8Array(buf)]
    .map(b => b.toString(16).padStart(2, '0')).join('');
  return hex === expected_sha256;
}
```

The course hub never stores the answer plaintext. Even an inspect-element-savvy
student can only see the hash. They still have to compute the answer.

---

## The Unlock Economy — Why the rewards are software

Cosmetic XP bars get old fast. Real motivation comes from getting **more
capable** as you progress. So every module rewards the student with a *tool*
they couldn't use before:

| Module | Tool | What it does |
|---|---|---|
| 1 | MatrixLab | Live matrix-vector visualizer; drag basis vectors |
| 2 | GradientScope | Loss surface explorer with gradient arrows |
| 3 | SpectraScope | Eigenvalue & SVD visualization |
| 4 | LossLab | Try any loss function with live gradient |
| 5 | NeuronForge | Drag-and-drop neuron playground |
| 6 | BackpropArena | Step-debug backprop on a graph you draw |
| 7 | OptiTrack | Race three optimizers on your loss surface |
| 8 | DeepStack | Per-layer gradient visualization |
| 9 | EmbedExplorer | Live t-SNE/UMAP of embeddings |
| 10 | SeqLab | Hidden-state evolution per token |
| 11 | AttentionMap | Live attention pattern per head per layer |
| 12 | BlockBuilder | Lego-style transformer assembler |
| 13 | ScaleScope | Predicted loss curves from hyperparameters |
| 14 | KernelLab | Triton playground with CUDA reference |
| 15 | TrainerHub | Full pretrain+SFT+DPO launcher |
| 16 | ResearchLab | Full training cluster + experiment tracker + arXiv stub |

Each tool is **also** an instructional artifact — the student can see how it's
built (its source is auto-shown in a side panel) and modify it. Bonus puzzles
hidden in each tool grant "Easter Eggs": secret titles, alternate themes, or
priority access to office hours.

---

## Flavor personalization

At signup the student picks two **flavors** (Hacker, Mathematician, Linguist,
Artist, Scientist, Builder). This does three things:

1. **Cosmetic** — site theme, font, accent color, mascot.
2. **Content** — each module exposes an optional "side-quest" track tailored to
   the flavor. The Hacker gets extra Rust/CUDA challenges; the Linguist gets
   tokenization deep dives in 5 languages; the Artist gets generative-poetry mini-
   projects.
3. **Examples** — code labs use examples from the flavor's domain. Linguists
   train on multilingual corpora; Artists train on poem corpora; Builders run a
   quantization deploy.

The flavor is stored in `localStorage.forge.flavor` and the module HTMLs pull
in the relevant side-quest blocks via `<template>` selection.

---

## Anti-cheat philosophy

We don't fight cheating; we make it *unrewarding*. If you skip Module 11,
Module 12's lab requires you to assemble multi-head attention by hand. If you
can do it, you didn't cheat — you took a different path. We do not gate on time
spent or "watch this video to completion." We gate on artifacts: code, numbers,
proofs.

The only un-skippable bit is the Forge Gate password. And the password is the
last thing a cheater would bother to compute, because it requires the math to
already be in their head.

---

## Anti-burnout

The course is designed for 60–80 hours of total focus. We deliberately *limit*
the daily streak — the hub UI says "you've been forging for 45 minutes — go
walk." Students who try to grind get the **Mindful Pace** badge for taking
breaks. Spaced repetition cards (Quantum Country–style) live in the hub and
prompt the student weekly.

---

## Measurement

The hub instruments (locally, no server) which puzzles take longest, which code
labs cause the most retries, and which Forge Gates need the most hint reveals.
This becomes a self-improving curriculum: future versions of the course
auto-rewrite the modules with the highest friction-to-learning ratio.
