# Two traces from the original toys

Captured 22 October 2026. The exact timestamp, Node version, original source hashes and harness hash are in `sources.json`. These are bounded program executions with declared test inputs, not recordings of a browser session.

## Reproduce

Keep this directory together. With Node 22:

```sh
node capture.mjs 2026-10-22T20:44:44.891Z
```

The timestamp argument preserves the capture metadata for a byte-for-byte comparison. It does not control program behavior. The script writes `radio.json`, `snake.json`, `trace.txt`, and `sources.json` beside itself. It uses no packages, network requests, credentials, or browser automation.

## Radio: SAMPLE, 100.0 MHz

- `source/radio.js` is a byte-preserved copy of the existing radio implementation. The whole script is evaluated in Node's `vm`; no source text is patched.
- The harness creates the original `FMRadio.Radio`, sets the dial to 100.0 before power-on, and calls its original `power()` method. `window.FM_T` is fixed at 0.7. The tuned signal is 1.
- `Math.random` is supplied by an LCG32 with seed 20261022. Each call updates `state = (1664525 * state + 1013904223) mod 2^32` and returns `state / 2^32`. This is a reproducibility fixture, not the browser's normal random generator.
- Audio buffers have a 48,000 Hz sample rate. The original radio consumes random numbers for its two-second static buffer before SAMPLE draws any note; those calls remain in the random stream.
- A virtual clock invokes the original 40 ms interval callback. The original sequencer schedules slightly ahead of that clock. Capture stops after sixteen main square-wave oscillator starts, from scheduled time 0.05 s through 2.90 s. Radio is then switched off without advancing further callbacks.
- At each square-wave start, the harness copies the original station's published `FMRadio.probs` and records its scheduled frequency. The full record retains all note probabilities and intercepted Web Audio calls, including the upper voice and bass pulse.
- Audio stand-ins record parameter changes, node connections, starts and stops. They do not implement waveform synthesis, mixing, envelopes, filters, an oscilloscope, device output, or autoplay policy. The radio page UI is retained as a source reference but is not executed.

The notes and probabilities come from the running original station, not from a second implementation of its sampler. Pitch names are a display conversion from the captured MIDI note.

## Snake: one deliberately reached compaction

- `source/snake-index.php.txt` preserves the original page bytes. The harness extracts the inline script verbatim, evaluates it, invokes its registered `DOMContentLoaded` callback, and sends keys through its registered `keydown` handler.
- `window.FM_T` is fixed at 0.7, with an initial stored best score of zero. This avoids the high-temperature fake-food branch.
- Food and color/glyph randomness are supplied as an explicit finite stream. Foods run from (9,12) through (23,12), then (23,13) and left through (13,13). Coordinates use the game's zero-based 24×24 grid. The final position is the next food, placed during pickup 25.
- Keys are fifteen Rights, one Down, and nine Lefts. The original steering, collision detection, growth, food placement, timers, compaction and HUD logic all execute. Nothing writes the game's closed-over state.
- A virtual timer advances one original game callback per step. Canvas stand-ins collect painted cells, dense outlines and text; DOM stand-ins retain the counters and window meter. The trace decodes that display output: `draw()` paints food first, then the snake in head-to-tail order.
- After pickup 24, the captured display contains 27 body cells. After pickup 25 it contains six, all with dense outlines, and the compaction count is one. The source checks the 28-cell threshold after adding the new head and compacts before drawing: no 28-cell frame is observed.
- Animation-frame callbacks, pixel rasterization, real browser timing, touch controls and game-over/high-score persistence are not exercised. This selected route demonstrates the compaction mechanism; it is not an evaluation of normal random gameplay or a player's skill.

## Checks and scope

The harness asserts sixteen radio notes, normalized probability distributions, consistent MIDI/frequency output, a fully tuned SAMPLE station, twenty-five successful food pickups, 27 visible snake cells before the final move, six dense cells afterward, exactly one compaction, and complete consumption of the declared snake input stream. These check capture integrity and the intended path; they do not prove every toy behavior correct.

Two executions with the same timestamp and inputs produced byte-identical event records and text. Source hashes identify the exact versions used. Later changes to the live toys need a newly dated capture rather than silently replacing these traces.
