diff --git a/docs/superpowers/specs/2026-06-06-simulator-alteration-preview-design.md b/docs/superpowers/specs/2026-06-06-simulator-alteration-preview-design.md new file mode 100644 index 0000000..94d8194 --- /dev/null +++ b/docs/superpowers/specs/2026-06-06-simulator-alteration-preview-design.md @@ -0,0 +1,242 @@ +# Human Experience Filter — Simulator Alteration Preview (Design) + +**Date:** 2026-06-06 +**Status:** Approved design (pre-implementation) +**Repo:** `human-experience-filter-art` +**Builds on:** the alteration engine of +[`2026-06-05-machine-altered-perception-design.md`](./2026-06-05-machine-altered-perception-design.md) +(the "design" below) and the simulator scaffold of +[`2026-06-04-experience-simulator-design.md`](./2026-06-04-experience-simulator-design.md). +**Revises the design:** §4.3 and §10 — the Left analytical HUD is **no longer a +runtime overlay**; it is **baked into authored variant videos** (see §8 below). +This is a deliberate trade of near-free multilingual support for authorial +precision over the HUD. +**Retires:** the simulator's selection-era "curator's X-ray" view and its +`/api/select` + `/api/catalog/meta` endpoints (the selection model they +visualize was superseded by the alteration model). + +> **Why this exists.** Operator directive (session 0007): *build and design only +> things that run in the simulator, and get the whole experience working the way +> we like in the simulator before moving to hardware.* The slice-1 alteration +> engine (PR #5) is pure logic with **no simulator surface** — you cannot yet turn +> the experience knobs and *see* the result. This design brings the alteration +> into the simulator so the look can be tuned and liked before any Pi/serial work. + +--- + +## 1. Scope + +A browser **alteration preview**: turn the four experience knobs and the content +dial, and see the neutral base footage altered toward the knob state, in real +time, on a looping clip. The purpose is to **tune the look** of the filter and to +**settle the knob→strength calibration by eye** (the open §3-vs-§4.2/§5 question +from session 0006). + +**In scope** +- Live preview of the four experience knobs (Left/Right/Dark/Light) on a looping + base clip. +- **Dark/Light** rendered as a live, deterministic runtime color grade. +- **Left/Right** rendered by selecting a **pre-baked authored variant clip** from + a 5×5 grid and crossfading on change. +- A **calibration panel** that adjusts the grade curve live; the chosen values are + baked back into `player/alteration.py` defaults. +- A **RenderPlan readout** (the project's "X-ray" honesty): always show the exact + numbers the engine produced. +- The content dial's **video on/off** behavior (so "Off" goes to black), driven by + the existing `resolve_content`. +- Placeholder variant generation so the mechanism is testable before the operator + authors real videos. + +**Out of scope (this slice)** — real generative v2v; serial input / the 3⇄4 +framing contract; audio playback (music / white-noise / audio-track); the Pi/mpv +runtime renderer; the full transition/crossfade timing engine; multilingual label +tables; catalog-model changes. These remain later roadmap slices. + +--- + +## 2. Architecture — Python-canonical, thin browser renderer + +`player/alteration.py` stays the **single source of truth** for the alteration +math (handbook §4.2 — deterministic core, thin I/O). The browser owns only +*rendering*. Data flow: + +```mermaid +flowchart LR + subgraph Browser + K[4 experience knobs +
content dial +
calibration sliders] + V["<video> variant + canvas grade"] + RO[RenderPlan readout] + end + subgraph FastAPI [simulator/app.py] + EP["POST /api/alteration"] + CL["GET /api/clips"] + end + ENG["player.alteration.plan_alteration(coord, calibration)"] + K -- "debounced POST {controls, calibration}" --> EP + EP --> ENG --> EP -- "RenderPlan {variant, grade}" --> V + EP --> RO + CL -- "base clip + variant manifest" --> V +``` + +- The browser sends control/calibration changes (debounced) and receives a + `RenderPlan`. Video filtering itself runs continuously in the browser; only a + *plan recompute* makes a round-trip. On localhost these JSON round-trips are + imperceptible. +- "Bake the calibration winner in" = change the `Calibration` defaults in Python. + Nothing in the browser is canonical. + +--- + +## 3. The four axes — how each is rendered + +| Axis | Engine output | Browser rendering | +|---|---|---| +| **Dark / Light** | `ColorGrade.tone` ∈ [−1, 1], center = identity | live color grade on the `