Pre-Flight — WP-004 — 2026-11-13

Filled-in copy of docs/reference/pre-flight for WP-004. Verdict at the bottom.

Written before the first clip probe, as the WP-002 and WP-001 lessons ask. The session continues the WP-001 session on Jeff’s “continue” after PR #32: WP-001 already resolved the index layout as a lead, so this WP’s open work is the codec.


Pre-flight intent

Validating readiness for WP-004. Verdict only.

Dependency check

Prereq Status in WORK_INDEX Locked on Notes
none listed (Depends on: —) n/a n/a WP-004 has no prereqs.
WP-001 (informs scope) ✅ Done 2026-11-13 Resolved the index layout and the header’s third field (audio-archives §Index table). Exit criteria #3 and #4 are largely met by that lead; this WP confirms them and does #1, #2, #5. The sound-file reader in Scooby.exe (audio_SoundFile_ctor, 0x43C5A0) is the code anchor for the clip format.

Repo + disc state

Showdown: C:\dev\scooby-engine\tools\exes\showdown\{Music.dat, Sfx.dat, Voice.dat, Scooby.exe}

Scope lock

Allowed paths for WP-004:

tools/probe_audio.py
docs/formats/audio-archives.md
docs/formats/scooby-exe.md               (audio rows of the Resource loading map / follow-ups only)
tools/ghidra-scripts/wp001-labels.txt    (new audio labels only)
docs/work-packets/WP-004-audio-archive-decode.md
docs/work-packets/WORK_INDEX.md
docs/01-VISION.md                        (audio-archives subsection + Phase 1 exit criterion #3 line only)
docs/reference/pre-flight-WP-004-2026-11-13.md

Local-only (gitignored, never committed): extracted clips and decoded WAVs under tools/samples/, decompiler output in the session scratchpad.

Forbidden: game data and any extracted or decoded audio, committed anywhere; engines/scooby/**; other format docs.

Exit check: git diff --name-only origin/main..HEAD before opening the PR.

Risk review

Risk Likelihood Impact Mitigation
Copyright leak: an extracted clip staged for commit med high Clips go to tools/samples/ only (gitignored). WP-004 deliverable “clip at tools/samples/audio-clip-0.<ext>” is local by that rule. Exit check before the PR.
Codec named by analogy: “looks like IMA ADPCM” without a decode med high A codec counts as identified only when the engine’s own decode path or a magic/header ties it, and a decode of the clip produces audio that ffprobe reads with sane parameters. Listening is Jeff’s call; the doc says what was and wasn’t heard.
Generalising from one clip: one file’s format assumed for all three med med Check the clip header on every entry of all three files, not a sample
Miles licensing: codec is Miles MSS low med WP-004 §Notes: flag for 02-SCUMMVM-INTEGRATION.md §6 rather than act

Verdict

Rationale: no prereqs; inputs SHA-locked; the index is already known, so the clip format is the only unknown, with a code anchor to trace it from.

Prepared by: Claude (WP-001 session, continuing), on Jeff’s “continue” of 2026-11-13 Date: 2026-11-13


After execution — lessons learned

Lesson: check decoded audio against a signal metric, not just a parse. The first reading put the PCM right after the lip-sync block. Every header check passed, ffprobe was happy, and the files were the right length. But voice clips with an odd-length lip-sync block came out as noise, with the bytes off by one. A cheap metric caught it: mean Δsample / mean sample , which is about 0.3 for real audio and 1.1 or more for noise. The engine’s read position (the sector after the header) then explained the error. probe_audio.py --verify now runs that metric on every clip.

Scope note: one file outside the allowlist changed. docs/work-packets/WP-001-ghidra-session.md gets a one-anchor link fix (#index-table-wp-001-lead → #index-records), because this WP renamed that section of audio-archives.md. It is a link fix with no new fact, which the lifecycle treats as trivial. The alternative was a dead anchor.