Pre-Flight — WP-076 — 2026-11-19
Filled-in copy of docs/reference/pre-flight for WP-076. Verdict at the bottom.
Nothing on main, in the fork or in an open PR touches
ROOM_P27_Below_BalconyorROOM_P27A_Below_Balcony_Door(checked 2026-11-19: noWP-076packet, nowp-076branch local or onorigin, only the WP-011 docs PR #128 open).
Header
- WP:
WP-076 - Title: Phantom’s below-the-balcony and its door — the last group-7 packet (Gen 1)
- Pre-flight date:
2026-11-19 - Targets generation(s): 1
- Targets disc(s): Phantom (Showdown has neither room)
Pre-flight intent
Validating readiness for
WP-076. Not implementing, not editing engine code, not annotating Ghidra. Verdict only.
Dependency check
The last room of the Phantom audit’s group 7, the maze; WP-074 landed the entry (hedge maze and maze map), WP-075 the interior (centre, fountain, well), and this closes the group with below-the-balcony and its door.
| Prereq | Status in WORK_INDEX |
Locked on | Notes |
|---|---|---|---|
| WP-018 | ✅ Done | 2026-11-14 | Hotspots and exits: the vines/hotspots and the ways between the rooms. |
| WP-021 | ✅ Done | 2026-11-14 | Clickables: the vines and the ball answer a click. |
| WP-023 | ✅ Done | 2026-11-14 | The inventory: OBJ_INV_SHARP_SHEARS (sharpened in WP-069’s arena), OBJ_INV_BALL_BLUE, OBJ_INV_BOTTLE_FULL. |
| WP-057 | ✅ Done | 2026-11-16 | Phantom’s new game and first room. |
| WP-072 | ✅ Done | 2026-11-18 | The royal gallery — the door’s exit target (ROOM_P07_Royal_Gallery) and the Jester’s ball-taking it shares. |
| WP-074 | ✅ Done | 2026-11-19 | The maze map’s BALCONY marker (handler 0x42A9A0) jumps straight to ROOM_P27_Below_Balcony; its MazeCenterFromGarden flag is cleared on the centre’s entry from below the balcony. |
| WP-075 | ✅ Done | 2026-11-19 | The maze interior — the sibling rooms; MazeCenterRoom reads the balcony-start flag this room clears. |
Rule check: every prereq is ✅ Done. Phase ordering holds — this is a Phase 4 (game-logic) room port on top of the resource and front-end lanes already closed.
Repo + disc state
- Docs repo (
C:\dev\scooby-engine) clean, onmainafter the execution worktree is cut from a fresh fetch. - Fork base checkout (
C:\dev\scummvm) onscooby-engineatd09a0a2af2(WP-075), clean, in sync withorigin/scooby-engine. - Dedicated fork worktree — the claim (executor’s first action).
tools/New-ForkWorktree.ps1 -Branch claude/wp-076-<run-id>, forked from a freshly fetchedorigin/scooby-engine, base checkout left clean onscooby-engine. The branch name is the claim:New-ForkWorktree.ps1refuses if it exists locally or onorigin, catching a concurrent session before any work starts (the WP-075 collision, 2026-11-19). Not yet created — this draft reserves the gate; cutting the worktree is the first step of the execution session. - Phantom.
ghphwarm (PhantomScooby.exe, md5c5fdb9a0c8f26dfec98f0148ecf505fa, imagebase0x400000). The two classes areROOM_P27_Below_Balcony(0x40F220, vtable0x45E750, 206 lines) andROOM_P27A_Below_Balcony_Door(0x4106B0, vtable0x45E850, 109 lines), per the audit’s group-7 table.
Scope lock
Allowed paths (this repo):
docs/formats/scooby-exe.md (below the balcony and its door)
docs/work-packets/WP-076-below-balcony.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-076-2026-11-19.md
Fork: engines/scooby/**, staged by name. New files below_balcony_rooms.{h,cpp} and below_balcony_check.cpp; a factory line, the module entries, the check’s declaration and its call. No edit to a sibling room expected: WP-074’s maze map already jumps to the BALCONY marker, and WP-072’s royal gallery is the door’s exit target — both already exist. If the trace surfaces a one-line hook into a sibling class (as WP-075 needed in maze_rooms.cpp), it is staged by name and called out at execution, not silently widened.
Forbidden: game data from the discs (copyright — never commit); engines/scooby/** beyond the files above; ScummVM upstream paths outside engines/scooby/.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Ghidra’s underscored labels mask the dotted clip names (the WP-074/075 trap). | med | medium | Read the string bytes (StrAt) and probe the disc’s sound index; probe the numbered/voice lines by prefix (Sound::hasClipPrefix), keep exact findClip for flat sfx ids. A found 0 on a name that is right is the tell. |
| The audit’s slot list is a starting point, not the source. | med | medium | Verify against the binary: ROOM_P27_Below_Balcony overrides tick, reset, event, claim, save, load (no opening — the audit lists none); the door overrides tick, reset, enter, event, claim. Anchor the vtable slot semantics (+0x1c save, +0x20 load, +0x24 exit/destination, +0x30 opening) on the throne class 0x45EC1C. |
The Jester member is cross-class and already ported. The door runs the Jester tick (0x4107D0, one of the four callers alongside the room of doors, royal gallery and well) and takes OBJ_INV_BALL_BLUE. |
med | low | Reuse the existing Jester member (+0xBC) and its TAKES_BLUE/BlueBallTaken path as the royal gallery and well do — do not re-implement it inside the balcony classes. |
| Shared misreading (reference and engine encode the same wrong trace). | low | medium | Two sessions trace both classes (PlayBallScene/ShowBall/VineClicks, the sharp-shears cut, the door’s ball and bottle, the gallery exit) independently and agree before the check is trusted, on top of the engine == reference match and the disc sound-index probe (the WP-073/074/075 move). |
| Generation / disc conflation. | low | medium | Every claim is Gen 1 Phantom; Showdown has neither room and the check asserts it prints so, as WP-075’s did. |
Verdict
- READY TO EXECUTE — dependency, scope and risk gates all pass.
- NOT READY
Open action (not a blocker): cut the dedicated fork worktree — tools/New-ForkWorktree.ps1 -Branch claude/wp-076-<run-id> — as the execution session’s first step. That is the claim (per the WP-075 collision lesson); it is deliberately left for the executor so this draft does not hold a branch open.
Companion artifacts the lifecycle expects alongside this gate (see wp-lifecycle): the WP-076-below-balcony.md packet and its WORK_INDEX row are not yet authored. Author them before (or with) opening the execution session so the dependency check reads against a real WORK_INDEX entry.
Prepared by: Claude (WP-076 drafting session) Date: 2026-11-19
After execution — lessons learned
- “ghph warm” was stale. This gate recorded the Phantom program as warm in
Ghidra, but the only project on disk (
ghidra/scooby.gpr) held Showdown (md5f03358ef…), not Phantom (c5fdb9a0…) — the addresses0x40F220/0x4106B0land mid-function there. The executor imported Phantom into a throwaway scratchpad project (analyzeHeadless -import … -readOnly), which left the committed project untouched and took ~60 s. Future Phantom WPs should either re-import Phantom or not assume the shared project is on the title they need; “warm” is per-title and the single project holds one program at a time. - The ball-flag byte block is not the
Scooby.inikey order. Assuming it was mislabelled three of this packet’s flags. The reliable anchors are the gallery (0x416500setsRedBallFoundatgame+0x25b) and the Jester (0x412B80, all six balls byTAKES_*):0x25b/0x25c/0x25dare Red/Blue/Yellow Found,0x25eisBlueBallSeen,0x25f/0x260/0x261the Taken trio. Decompile the function that touches the whole group, don’t infer order from the key list. - The two-independent-trace move caught the mechanics cleanly but shared the flag-offset table (the second session was handed the same assumed map), so it did not catch the naming slip — the binary anchor did. Lesson: hand the second trace the raw addresses, not a pre-resolved name map, where a map is the thing in question.