Pre-Flight — WP-073 — 2026-11-18
Filled-in copy of docs/reference/pre-flight for WP-073. Verdict at the bottom.
Nothing on main, in the fork or in an open PR touched
ROOM_P31_KST.
Header
- WP:
WP-073 - Title: Phantom’s Knights of the Snack Table: the serving set piece (Gen 1)
- Pre-flight date:
2026-11-18 - Targets generation(s): 1
- Targets disc(s): Phantom (Showdown has no such room)
Pre-flight intent
Validating readiness for
WP-073. Verdict only.
Dependency check
| Prereq | Status in WORK_INDEX |
Locked on | Notes |
|---|---|---|---|
| WP-025 | ✅ Done | 2026-11-14 | Set pieces start without the toolbar, as their room classes have it. |
| WP-055 | ✅ Done | 2026-11-16 | Pie Noon, the parallel framework KST shares (its asserts still name it). |
| WP-057 | ✅ Done | 2026-11-15 | A room’s Room::Actor sprite (the drawbridge’s flags), as the knights are. |
Repo + disc state
- Project worktree on new branch
claude/wp-073frommain(WP-072 merged), clean. - Fork on
scooby-engineatdf99151f9b, clean, in sync. - Phantom.
Scope lock
Allowed paths (this repo):
docs/formats/scooby-exe.md (Knights of the Snack Table)
docs/work-packets/WP-073-kst.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-073-2026-11-18.md
Fork: engines/scooby/**, staged by name. New files kst_rooms.{h,cpp} and the check in kst_check.cpp; a factory line, the module entries, the check’s declaration and its call.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| The class is the biggest of the group (~671 lines, with knight, Shaggy and drink sub-controllers). | — | medium | The deterministic surface (the markers, the sprites, the quota, the clips, the exit) is proved against the reference; the serving loop is modelled from the trace and confirmed live, not simulated tick-exact. |
| It is Phantom’s Pie Noon, and might share the class. | — | low | The two titles share no room name; it is a separate class (0x419700) with the same framework and copied asserts, not a shared one — so no split and no WP-055 reuse. |
| The marker arrays’ sort key. | — | medium | Read from the trace: each array sorts by the placement’s y, the x following; the knights’ x is 40 less. |
Verdict
- READY TO EXECUTE
- NOT READY
Prepared by: Claude (WP-073 session) Date: 2026-11-18
After execution — lessons learned
Lesson: read which coordinate the claim’s insertion sorts by, not just that it sorts. Each of KST’s marker arrays (0x41A970) is kept sorted ascending by the placement’s y, with the x in a parallel array; the knights’ x is read 40 less (0x45EE50), the gang entering from off the left. A first pass sorted by x and stored y alongside — and the reference, written the same way, matched the engine zero-differ while both misread the trace. Re-reading the decompile (the compare is param_1 < *pfVar8 where param_1 is the y, and 0x419110 later reads the knight’s y from the bench-end array) showed the key is y. Both sides were fixed to y, the knights’ x to 40 less, and bench-floor to y only, before anything shipped. A line-for-line match proves the engine equals the reference; it does not prove either is faithful — only an independent reading of the trace does that.
Lesson: a timed set piece’s check scopes to its deterministic surface. KST’s tick is rand()-and-frame-counter driven (knights spawn on a rand() % 0x48 + 0x24 timer, a finished round plays a random Correct<n> line). The check proves what a static read of the art and the binary fully determines — the class, the markers, the sprites, the quota by level, the clips, the exit — and the live run confirms the serving loop and the dining-room exit, rather than asserting the timing tick-exact. The counter’s live value ((game+0xAC)+0x30) is set but not asserted.
Lesson: an eased approach never reaches its target. The knights’ walk, modelled as x += (target − x) × k, asymptotes toward the seat and never satisfies x ≥ target, so a knight never arrives, never is served, and the room never exits. The fix arrives within a small threshold of the target. The deterministic check never exercised the loop, so only the live run caught it.
Lesson: KST is Phantom’s Pie Noon, not a shared class. The asserts in enter still read “…specified in Pie Noon”, but the two titles share no room name; it is a separate class (0x419700) with the same framework, not the shared one Brad’s three levels or the armory and its slide are. No split, and no WP-055 reuse.
Scope note: one fork commit of 7 files staged by name: the class and its check in new files, a factory line, the module entries, the check’s declaration and its call.