Pre-Flight — WP-141 — 2026-12-03

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

Written by the execution session, from the session prompt docs/sessions/session-WP-141-2026-12-03.md (PR #373, open at claim time). Checked at claim time: WP-141 is 📝 on main (9afd92e), no WP-141 branch in either repository but the session prompt’s own docs/wp-141-session-prompt, and no open PR naming WP-141 but #373 (the prompt). Both claim branches were pushed before anything else.


Dependency check

Prereq Status in WORK_INDEX Notes
WP-083 ✅ Done The room, WizardsRuleRoom.
WP-094 ✅ Done (2026-11-27) The rhythm game: the clock, the window, the table.
WP-133 ✅ Done (2026-12-01) The bottles clicked through handleEvent(); the play self-test lines.

Rule check: every prereq is ✅ Done.

Repo + disc state

Source read

On b59ea35fd8:

The diagnostic line

The fork tip’s log can’t meet exit criterion 1: no line says a click counted, and a click dropped late in a beat logs nothing past the input layer’s click at. Before Jeff’s replay the session added one level-2 line to tick() (wfr_rooms.cpp), behaviour unchanged:

wfr: a click on the <COLOUR> bottle at beat <beat.ff> (<ms> ms): <what came of it>

where what came of it is counted, late in the beat, lost, the wizard's beat, lost, a gap, lost, the beat already played, lost or not the beat's bottle (<COLOUR>), lost. It’s logged at each of the tick’s own exits, not from a second copy of the rule. The replay runs on that build.

Scope lock

fork:  engines/terraglyph/wfr_rooms.cpp
       engines/terraglyph/wfr_rooms.h
       engines/terraglyph/wfr_check.cpp
       engines/terraglyph/terraglyph.cpp     (only if the click path is the cause)
       engines/terraglyph/sound.cpp, sound.h (only if the clock is the cause)
docs:  docs/reference/pre-flight-WP-141-2026-12-03.md
       docs/work-packets/WP-141-wfr-bottles-live-clicks.md
       docs/work-packets/WORK_INDEX.md

Staged by name; git diff --cached --name-only checked against this list before each commit. Forbidden: game data, logs or captures in any repo; a change to the phrase table, the beat rate or the window without the decompile behind it; a “your turn” cue or any other departure from the original before Jeff’s call.

Risk review

Risk Likelihood Impact Mitigation
Fixing the feel and calling it a bug. med high The source read finds the port’s rule equal to the decompile’s. A wider window or a cue is Jeff’s call; the finding goes to him first.
The self-test passing while the live game fails. high (it did) high The play lines set the clock by hand. The verdict rests on Jeff’s replay log, with the diagnostic line.
The diagnostic line misreporting. low med It’s logged at the tick’s own exits; the self-test’s play wrong bottle, play late press and play not the player's lines drive each exit and are diffed against the baseline.
Audio latency (lead 4). low med The log can’t measure what’s heard. The beat lines and Jeff’s click lines show how far off his clicks land; a consistent offset near the window’s edge points here.

Diagnosis

From Jeff’s replay, 2026-12-03 06:58:59–06:59:34, C:\pcloud\scooby-engine\verification\wp-141-2026-12-03\replay1.log (fork e5cbe578a3, --debugflags=script,input,graphics --debuglevel=2). Seven clicks on bottles, each logged twice: once by the input layer and once by the room.

  1. The beat window (timing): the cause. Every lost click was lost to the rule, not the path. Phrase 1 (the wizard: RED GREEN BLUE on beats 0–2, by 1.47 s): no click by the player’s beat 8 (6.03 s), so the glass broke at beat 9 (6.53 s). Jeff’s three clicks came after it: RED at beat 11.12, GREEN at 13.49 and BLUE at 15.10, all a gap, lost. Phrase 2: PINK at beat 23.86, 0.14 of a beat (about 100 ms) before the player’s beat 24: late in the beat, lost. Beat 24 not done, so the glass broke at beat 25. YELLOW at 25.48 then counted, too late for the phrase. RED at 27.17: a gap, lost.
  2. The click path: ruled out. Every click logged click at x,y on <n> OBJ_WFR_BOTTLES, and the room’s line then names the bottle. YELLOW at 25.48, the beat’s own bottle in its window, counted.
  3. The cursor: ruled out. hover <n> OBJ_WFR_BOTTLES, cursor ANIM_CURSOROPEN on every bottle Jeff moved over (sprites 3–7), and the arrow off them.
  4. The clock against the music heard: not the cause. The beat lines run 0.72 s apart on the song’s position, as WP-094 measured. The backend’s buffer is 1024 samples (23 ms at 44.1 kHz, per the run’s own header), so the clock leads what’s heard by tens of milliseconds. That moves the window slightly earlier against the music, the side Jeff’s lost PINK click fell on, so a perfect clock wouldn’t have saved it. The log can’t measure the audible offset itself; it’s small against the 355 ms window either way.

Self-test (self-test). Seeded (random_seed=140) against WP-140’s seeded-wp140.log, which ran this tip’s tree (git diff 0ea2574dab b59ea35fd8 is empty). All 16 wizard's rule room check lines match character for character. The only new lines are the 24 diagnostic ones the checks’ presses produce: counted 18, the wizard's beat, lost 3, not the beat's bottle (RED), lost 1, a gap, lost 1, late in the beat, lost 1. (the beat already played, lost isn’t exercised.) The rest of the diff is the noise floor WP-140 measured: the build stamp, two lip-sync lines and the debug-tools check’s millisecond timing.

Verdict

Prepared by: Claude (WP-141 execution session) Date: 2026-12-03

Lessons learned