WP-134: Gen 1 runtime file lists and package builder

Status: ✅ Done (2026-12-01). Both lists committed, both packages built and verified (§Result). Drafted, pre-flighted (pre-flight-WP-134-2026-12-01, READY) and executed in one session, on one branch. Phase: 5 (polish & distribution). Depends on: the ISO-free feasibility study (§D’s runtime-set rule, §K’s ids); WP-085 and WP-096 (the installer and manifest the package must fit, merged in the fork). Unblocks: a hosted beta package (study §M.4). Hosting and access are a separate WP, not drafted (§Out of scope). Companion EC: — (one session, seven steps, no time-boxing needed). Pre-flight required: Yes. It commits tool scripts under tools/** that produce committed artifacts (the lists). Targets generation(s): Gen 1 only (Showdown, Phantom). Gen 2/3 have no runtime set until their MMFW readers exist (study §L.5). Estimated effort: half a day.


Goal

Make the step from a disc to the zip the TV app installs reproducible: a committed per-title list of the runtime files (name as on the disc, size, SHA-256), and a script that builds the package from those files only, refuses on any missing file or hash mismatch, and prints the manifest values. This is step M.2 of the feasibility study.

Background

Scope

In scope

  1. tools/New-RuntimeFileList.ps1: applies §D’s rule to a disc’s scooby\ folder and writes a JSON list (names as on the disc, size, SHA-256, the source image’s name, size and SHA-256). It stops on any file the rule doesn’t name, and its output is deterministic.
  2. Two lists, hashed from the ISOs in C:\pcloud\scooby-engine\ (mounted read-only): tools/packages/showdown-en-aug2001.json and tools/packages/phantomknight-en.json (ids per study §K), each checked against the study’s counts and totals.
  3. tools/New-GamePackage.ps1: given a list and a source folder, checks every listed file’s size and SHA-256 (refusing before writing anything on a missing file or a mismatch), writes a deflate zip with the files under scooby/, re-checks the zip, and prints the manifest entry (size, sha256, installedSize). Output goes outside every git work tree (default C:\pcloud\scooby-engine\packages\).
  4. Verification: both packages built; each extracted the way the installer does it; --detect and the --debuglevel=11 self-test from each extract, with the resource-check lines compared against a run on the mounted ISO (as study §F.3 did).
  5. A *.zip backstop in .gitignore.

Out of scope

Dependencies

Execution

  1. Claim the number (push claude/wp-134-gen1-packages).
  2. Mount the Showdown Aug 2001 ISO read-only; reuse Phantom’s mount.
  3. Write both lists; check them against study §D and the ISO hashes against §C; run the list script again and compare.
  4. Negative runs of the package script: a source missing every file, a list with one wrong SHA-256, an output folder inside the repo.
  5. Build both packages; rebuild one and compare the SHA-256.
  6. Extract each with java.util.zip.ZipInputStream under the installer’s rules; re-hash every extracted file against the list.
  7. --detect from each extract’s root and its scooby\; the self-test from each extract and from the mounted ISO; compare. Dismount what this session mounted, and check the ISO’s timestamp.

Exit criteria

  1. Both lists are committed, holding hashes only, and match the study: 48 files / 556,351,281 B and 62 files / 540,771,169 B.
  2. Re-running the list script on the same disc gives identical bytes.
  3. The package script refuses a missing file, a hash mismatch and an output folder inside a git work tree, writing no zip in each case.
  4. Both packages build, deflate, with every file under scooby/ and no directory entries; a rebuild gives the same SHA-256.
  5. ZipInputStream extracts each with no refusal; the extracted bytes equal installedSize, and every file’s SHA-256 and name match the list.
  6. --detect finds terraglyph:showdown and terraglyph:phantomknight in each extract.
  7. The self-test’s resource-check lines from each extract equal those from the mounted ISO; any other difference is shown to occur between two ISO runs too.
  8. No game data and no zip is staged; nothing is uploaded.

Deliverables

Result

Executed 2026-12-01. Every exit criterion met.

The lists (exit 1, 2). Hashed from Scooby Doo Showdown in Ghost Town.iso (698caea4…, mounted read-only at H:) and Scooby Doo Phantom of the Knight.iso (e70345a3…, already mounted at K:), both SHA-256s as in study §C.

List Files Bytes Movies Scooby.exe SHA-256 Left out
showdown-en-aug2001 48 556,351,281 42 13284543… binkw32.dll, Scooby.eng
phantomknight-en 62 540,771,169 56 619ea687… BINKW32.DLL, SCOOBY.ENG

Both totals equal the study’s §D. Both Scooby.exe hashes are the ones in the scooby-exe identity table. A second run of the list script gave the same bytes.

The refusals (exit 3). An empty source: refused, every file missing. A list with BK.001’s SHA-256 zeroed: refused after hashing, naming the real and listed values. An output folder inside the worktree: refused before reading anything. No zip or .partial file was left in any case.

The packages (exit 4, 5). In C:\pcloud\scooby-engine\packages\:

Package size sha256 installedSize vs the runtime set
showdown-en-aug2001-1.zip 425,569,015 e5b9bee78c32d6c8e051283f77cf8148a911bd0b954dfb94a24fc55a92a1629f 556,351,281 23.5% smaller
phantomknight-en-1.zip 435,585,544 b36185e774bf74932dfb28fa926ca7cbf33f413aabd76cfe771c7ca5a4d56ef8 540,771,169 19.5% smaller

.NET’s smallest deflate comes out 1.4% (Showdown) and 1.3% (Phantom) larger than the study’s 7-Zip -mx9 zips (419,557,579 and 430,195,502 B). That’s about 6 MB a game, and in return a zip built with no other tool. A rebuild of Showdown gave the same SHA-256: entries go in list order with a fixed timestamp.

java.util.zip.ZipInputStream (JDK 27), driven by the installer’s rules (PackageStore.extract: refused endings, ELF and dex magic, zip-slip), extracted 48 and 62 files, all deflate (method 8), no directory entries. The bytes extracted equal installedSize. Every extracted file’s SHA-256 and the exact case of its name match the list.

The engine (exit 6, 7). The same scummvm.exe for every run: a copy of the fork build in C:\dev\scummvm (built 2026-11-30 11:56, checkout at e1dd7bea63).

  Showdown Phantom
Summary (both runs) art 522 blocks, cel 9,111, room 69, clip 1,165, movie 42: 0 bad; 71 exits, 191 clicks, 78 hints: 0 stuck art 486, cel 5,810, room 53, clip 1,067, movie 56: 0 bad; 82 exits, 174 clicks, 82 hints: 0 stuck
TGIFILE.ART MD5 as the engine logs it ba57da01… both a0c28dd3… both
Art, cel, room, clip and movie check lines 776 = 776, 0 differ 706 = 706, 0 differ
All … check lines 2,207 = 2,207, 0 differ 1,970 each, 36 differ
Unique warning lines 20 = 20 17 vs 18

Phantom’s 36 lines are random choices in its play checks: which voice variant plays (Jane’s screams, the Room of Doors’ lines), where Maria’s items land, the drawbridge’s random flag and banner states, the order of Ewan’s pages. A second run on the ISO differs from the first in the same 36 lines, and every line that differs between the extract and the ISO is one of those. The extra warning (Failed to create stream for Global.940B_1_SCRAPPY: 4 streams playing) is the mixer’s stream limit and appears in the second ISO run too. So the engine sees the same data from the package as from the disc, as study §F.3 found for the hand-built Showdown set.

Hygiene (exit 8). The Showdown ISO was dismounted afterwards with its timestamp unchanged; Phantom’s K: mount was left as found. git status shows only the files under §Deliverables; nothing was uploaded.

TV install (2026-12-02)

Run after the WP merged, at Jeff’s request, on the TCL Smart TV Pro (Android 14) with the test build 2026.4.1-wp132.6 (26041070). No zip left the house:

  showdown-en-aug2001 1 phantomknight-en 1
Space check passed: needs 594.6 MB, 14,446 MB free passed: needs 579.7 MB, 14,322 MB free
SHA-256 verified (e5b9bee7…, 425,569,015 B) verified (b36185e7…, 435,585,544 B)
Extract 48 files in 121 s, each synced 62 files in 115 s, each synced
Added as showdown-win → packages/showdown-en-aug2001/1 phantomknight-win → packages/phantomknight-en/1
Verify (app button) PASS, 48 of 48, 556,351,281 B PASS, 62 of 62, 540,771,169 B
Launch title screen (v1.2); TGIFILE.ART MD5 ba57da01… as on the desktop title screen; TGIFILE.ART MD5 a0c28dd3… as on the desktop

Not done here: playing past the title screen, and a download from a real host (the hosting WP).

Re-check at the WP-087 closeout (study §L.4). Phantom’s list is the disc as it is; the engine’s use of it can still change while WP-087 is open. To re-check: run New-RuntimeFileList.ps1 on the disc again (it stops on a file the rule doesn’t name), then the self-test from the package. A changed list means a new package version.

Notes