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

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

Written by the session that drafted WP-143 and ran WP-141, on Jeff’s “Yes, run it here” (2026-12-03). Checked at claim time: no wp-143 branch in the fork; WP-143’s only open PR is its draft, #375; the number is this packet’s (the TV tiles draft that also took it, #376, was renumbered WP-145 in #378). Both claim branches were pushed before anything else.


Dependency check

Prereq Status Notes
WP-094 ✅ Done The rhythm game: the clock, the window, the table.
WP-133 ✅ Done The play self-test lines, through the event path.
WP-141 ✅ Done in its docs PR #374, open The finding this packet acts on.
Fork PR #69 Open The wfr: a click on … line. The packet asks for it merged first; it isn’t, so this branch is cut from #69’s branch and its PR stacks on #69. Once #69 merges, the WP-143 PR shows only its own commits.
D1–D4 Decided, 2026-12-03 All four recommendations (§Decisions).

Repo + disc state

Source read

On e5cbe578a3, wfr_rooms.cpp:

The change (written before the first build)

All in wfr_rooms.{h,cpp}, each marked in a comment as not the original’s, with the WP number:

  1. D1, the cue. On the player’s dance beats the wizard turnWatch()es instead of dance(). With the bar’s idle on beats 8 and 12, he turns to watch on beat 8, and again on 12, as Scooby does on 0 and 4.
  2. D2, the early window (kEarlyWindow = 0.25). In the late part of a beat, a click at beatf − beat ≥ 0.75 is held when the next beat is a player’s beat with a bottle. On that beat’s first tick in its window the held click is taken as the tick’s click, unless a click landed that tick. The window [0.49, 0.75) still loses a click, so a late click can’t count for the next beat. The late end stays 0.49.
  3. D3, a lost click (answerLostClick). Every exit that loses a click lights its bottle for 4 ticks (kLostLightTicks) and plays Sign_In.Click. Its own timer runs beside _lightTimer, and on expiry it darkens only that bottle, and not when the room itself lit that bottle and its light still runs (_roomLit). No colour is called.
  4. The diagnostic line gets two forms: …: early, held for beat <n> when a click is held, and wfr: a click on the <COLOUR> bottle at beat <b.ff> (<ms> ms), taken on beat <n>: <verdict> when it’s taken.

D4: always on, no option.

Expected self-test lines (committed before the first run)

From the source above, with the checks’ fixed random (drawRandom() 1, so the snack line is Correct2). Two ticks a beat in the checks, at 0.2 and 0.7 of it.

Lines that change on purpose:

Line Baseline Expected
clean, play clean … RED (ANIM_WFR_WIZARDTURN_DANCE ANIM_WFR_SCOOBYTURN_DANCE) … at beat 8 … RED (ANIM_WFR_WIZARDTURN_WATCH ANIM_WFR_SCOOBYTURN_DANCE) …; the rest the same
play wrong bottle beat 8 lit -; …; heard from beat 8 Knights.Glass_Breaks.1 … beat 8 lit GREEN; …; heard from beat 8 Sign_In.Click Knights.Glass_Breaks.1 …; the rest the same
play late press beat 8 lit -; …; heard from beat 8 Knights.Glass_Breaks.1 … beat 8 lit - (the press is after the read); heard from beat 8 Sign_In.Click Knights.Glass_Breaks.1 …; the rest the same
play not the player's beats 0-2 lit RED GREEN BLUE; heard -; gap 11 pressed lit -, snacks 1, missed 0 beats 0-2 lit RED RED+GREEN BLUE; heard Sign_In.Click; gap 11 pressed lit RED, snacks 1, missed 0

Every other wizard's rule room check line (entry, missed, lives, song over, hover, first dance, claim, clips, lines, sounds) stays the same. The missed line has no click on a lost exit, so it stays the same too.

New lines:

wizard's rule room check play cue: beats 0-5 the wizard dancing 6 watching 0, Scooby dancing 0 watching 6; beats 8-13 the wizard dancing 0 watching 6, Scooby dancing 6 watching 0
wizard's rule room check play early press: 7.85 RED: at the press lit -, heard -; beat 8 lit RED, heard WFR.Potion_1 Wizards_Rule.Red; snacks 1, missed 0 | 7.70 RED: at the press lit RED, heard Sign_In.Click; beat 8 lit -, heard -; snacks 0, missed 1 | 10.85 RED: at the press lit RED, heard Sign_In.Click; beat 11 lit -, heard Wizards_Rule.Correct2_1_NARRATOR; snacks 1, missed 0 | 15.85 RED: at the press lit RED, heard Sign_In.Click; beat 16 lit PINK, heard -; snacks 1, missed 0
wizard's rule room check play lost click: RED pressed, lit tick by tick RED+GREEN RED+GREEN RED+GREEN RED+GREEN GREEN, heard Sign_In.Click; GREEN pressed, lit tick by tick GREEN GREEN GREEN GREEN GREEN, heard Sign_In.Click; Sign_In.Click found 1

On the original’s rules the play cue line would read the wizard dancing 6 watching 0 on 8–13, and the 7.85 press would be lost.

The diagnostic line’s counts change with the new presses and the new lines. Only the early, held for beat 8 and taken on beat 8: counted forms are new text.

Scope lock

fork:  engines/terraglyph/wfr_rooms.cpp
       engines/terraglyph/wfr_rooms.h
       engines/terraglyph/wfr_check.cpp
docs:  docs/reference/pre-flight-WP-143-2026-12-03.md
       docs/work-packets/WP-143-wfr-turn-cue-timing.md
       docs/work-packets/WORK_INDEX.md
       docs/formats/scooby-exe.md        (the "Departs from the original" note)

Staged by name; git diff --cached --name-only checked against this list before each commit. Forbidden: game data, logs or captures in any repo; the beat rate, the late end of the window, the phrase table or the lives; the miss called on the next beat (out of scope).

Risk review

Risk Likelihood Impact Mitigation
The lost light cuts the room’s own light short, or the other way round. med med A timer of its own; it won’t darken a bottle the room lit while that light runs. The play lost click line checks the bottle the wizard lit, tick by tick.
A held click counts for the wrong beat. low high It’s held only for the next beat, only if that’s a player’s beat with a bottle, and is dropped on that beat’s first in-window tick if not taken. play early press covers a gap and the wizard’s beat next.
The cue comes too late to help on beat 8. med med D1 turns the wizard on beat 8, the player’s first beat, the same moment Scooby turns to dance. It marks the turn rather than announcing it. If Jeff’s live check finds it late, turning him on beat 7 is a one-line change and a new decision, not a silent one.
The self-test passing while the live game fails. med high Exit criterion 3 is Jeff’s own play, at --debuglevel=2, read against the diagnostic line.

Self-test result

Run on fork 5fc9c15e0f (seeded-wp143.log, and seeded-wp143-run2.log as a second sample), against seeded-wp141.log:

Full table in WP-143 §Result.

Verdict

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

Second pass: D5 (2026-12-03)

Jeff’s first live check failed: he clicked the bottles in the right order, each 0.3–0.9 of a beat late. He chose to judge the turn by order (WP-143 D5), which replaces D2. Fork 31a4c93fcd, same scope lock. The changed self-test lines were read against the change after the run, not written down before it. Each is accounted for in WP-143 §D5. A second run is in seeded-wp143-order-run2.log. Verdict stays READY; the live check is Jeff’s.

Third pass: D6 (2026-12-03)

Jeff’s live check 2 passed. He then chose to hold a click from late in beat 7 for the turn (WP-143 D6). Fork 495a4a35de, same scope lock. This time the changed play order line was written to expected-d6.txt before the build, and the run matches it. See WP-143 §D6.

Lessons learned