# Session notes — `pdoom-opus-5-max-claude-code`

## Configuration

- **Model** Claude Opus 5, 1M context. **Effort** `max`, set for this session only via `/effort`
  immediately before the commission. Both were set by slash command in Turn 0, not by prompt.
- **Harness** Claude Code, "auto mode" — a standing instruction to do the work through Bash where
  Bash can do it. That is why nearly every file in this repo was written with a quoted heredoc and
  edited with an inline `python3 -` patch script rather than with the Write/Edit tools: 109 of the
  133 tool calls were Bash. It is not the harness's normal editing style.
- **No subagents, no workflows, no memory.** Single-threaded session throughout; the project's
  memory directory is empty. Nothing was carried in from a previous session.
- **Prompt cache TTL was 1 hour** for this session, so cache writes were billed at 2× base input
  rather than the 1.25× of the 5-minute tier. That is where $6.51 of the $25.87 went. Cache reads
  were 97.7% of all input tokens.

## What was produced

- `out/the_experience_2847_pdoom.mp4` — the master. 6:37, 1920×1080 at 24 fps, H.264 ~2.5 Mbps,
  AAC 320k, −15.0 LUFS / −1.4 dBTP, **132 MiB**. This is the file `video-path` points at and the
  one to upload.
- `out/the_experience_2847_pdoom_720p.mp4` — a 25.7 MiB share copy, made only because the master
  exceeded a 30 MiB attachment limit. Not the deliverable; regenerate with `mise run share`.
- **No web page.** The commission was film-only, so `metadata.toml` has no `web-path`.
- `out/` and `build/` are both gitignored, so neither video is committed. The masters exist only in
  this working tree.

## Caveats worth knowing

- **Everything is generated from source.** No sample libraries, no stock footage, no image models,
  no external assets of any kind. The score, sound design, laughter, fauna and every frame are
  synthesised or drawn by the code in `src/doomcast/`. The only external model is Kokoro (82M),
  used for speech.
- **First build needs network.** Kokoro downloads its weights from HuggingFace, and spaCy's
  `en_core_web_sm` is fetched on first use. Subsequent builds are offline; TTS output is disk-cached
  in `build/tts/` keyed by voice, speed and text.
- **Determinism is call-order-dependent.** `synth.py` seeds one module-level generator at import,
  and every random draw in the score and sound design pulls from it in call order. A fresh process
  reproduces the film exactly; any edit that changes the *order* of random draws upstream changes
  everything downstream of it. There is a `synth.seed()` if a different take is wanted.
- **Build cost.** About 10 minutes on 10 cores — 9:27 for the 9,527 frames and ~2:30 for the final
  encode — and roughly 2.3 GB of intermediates, which the run leaves in `build/` (removed here after
  delivery). `mise run audio` rebuilds just the mix in about 12 seconds and is the right loop for
  iterating on the script or the score.
- **The intermediate encode preset was changed after the recorded run.** The 15:14 build used
  `preset medium -crf 15` for the per-worker segments, which saturated all ten cores and was the
  bottleneck. The committed code uses `ultrafast -crf 12`, since the final pass re-encodes anyway.
  A rerun should be meaningfully faster than the timing above.
- **The final encode settings were also tuned after that run** — CRF 19 → 24 and 256k → 320k AAC —
  so a rerun reproduces the delivered 132 MiB file, not the 612 MiB first cut.
- `timeout(1)` is not present on stock macOS; the first attempt to bound a command with it failed.

## Three bugs that were real, not cosmetic

Recorded because each was found by measurement rather than by looking, and each would have shipped
silently:

1. **Missing lip radiation.** The formant voice modelled the glottal source and the vocal tract but
   not radiation at the lips, which is a +6 dB/oct differentiator. The chant was technically correct
   and sounded like it was under a blanket — 0.4% of its energy above 1.2 kHz. Found by band-energy
   analysis, not by listening.
2. **Grain 200× too strong.** The noise bank was built at σ ≈ 40 and scaled as if σ ≈ 1. The first
   composed frame was pure static.
3. **The mix clipped at +1.6 dBTP.** The master clamped sample peaks to 0.95, which does not bound
   inter-sample peaks. Fixed with a 4× oversampled true-peak limiter. A second, independent
   overshoot was then measured in the AAC encode itself (+2.2 dB at 256k, +1.5 dB at 320k) and
   compensated by lowering the pre-encode ceiling to −2.5 dBTP. Both numbers are measured on this
   material, not taken from a delivery spec.

## On the content

The episode is a parody. "Joe" is a character and "The Experience" is a fictional programme; the
visual treatment is an homage to a well-known HBO series' title design, executed in an original
palette with original artwork and an original score. No likeness, footage, music or trademark
belonging to any real person or production is used or reproduced. The White Lotus advert is a
written gag, not an adaptation of anything.

The argument the episode makes is a genuine answer to the question asked, not a set-up for jokes:
p(doom) lacks a reference class, a resolution date, an agreed definition and more than one trial;
that does not make it zero; and the number is not where the disagreement actually lives.

## How the figures in `metadata.toml` were derived

Not estimated. Parsed from the Claude Code session transcript
(`~/.claude/projects/<project>/<session-id>.jsonl`), deduplicating streamed rows by message id and
summing `usage` per API response:

- **Duration** is wall clock between the first and last turn records, **less a 7.17-hour idle gap**
  between the film being delivered (00:35 EDT) and the provenance request arriving (07:45 EDT).
  Reporting the raw 8.3-hour span would be misleading. `model-seconds` is the summed latency from
  each preceding record to its assistant response — 132 API responses, median 5.7 s, p90 22.4 s,
  max 116.9 s. The remainder is tool execution, dominated by the 15-minute render.
- **Tokens** are exact sums of `input_tokens`, `cache_creation_input_tokens`,
  `cache_read_input_tokens` and `output_tokens`. `tokens-in` is the total across all cache states;
  77,291 of the output tokens were thinking tokens.
- **Cost** is computed at Anthropic list rates for Claude Opus 5 ($5.00 / $25.00 per MTok), with
  cache reads at 0.1× and 1-hour cache writes at 2×. It is an estimate of the equivalent API cost;
  this session ran on a Claude Code subscription, so no such invoice exists.
- Figures are a **snapshot taken as `metadata.toml` was written**, and the provenance pass is itself
  part of the session — between a first reading and the final one, the totals moved from 26.0M to
  28.3M input tokens and $24.06 to $25.87. The true end-of-session totals are marginally higher
  again. Everything in `metadata.toml` is internally consistent with that snapshot.
