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
- The study verified a Gen 1 runtime set by running the engine without the
other files (§D, §F):
Scooby.exe,TGIFILE.ART,object.ini,Sfx.dat,Voice.dat,Music.datand everyBK.NNN. That’s 48 files and 556,351,281 B for Showdown (Aug 2001) and 62 files and 540,771,169 B for Phantom. It recommended shipping only that set to Google TVs, as a deflate zip (§I option C, §K). - The installer (WP-085, hardened in WP-096) downloads one zip per game from a
manifest (format 1: id, version,
size, SHA-256, URL, and since WP-096
installedSize), extracts it withZipInputStreamunder data-only rules, and checks free space first. - The study’s zips were built by hand with 7-Zip. Nothing recorded which files went in, so a package couldn’t be rebuilt or checked.
Scope
In scope
tools/New-RuntimeFileList.ps1: applies §D’s rule to a disc’sscooby\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.- Two lists, hashed from the ISOs in
C:\pcloud\scooby-engine\(mounted read-only):tools/packages/showdown-en-aug2001.jsonandtools/packages/phantomknight-en.json(ids per study §K), each checked against the study’s counts and totals. 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 underscooby/, re-checks the zip, and prints the manifest entry (size,sha256,installedSize). Output goes outside every git work tree (defaultC:\pcloud\scooby-engine\packages\).- Verification: both packages built; each extracted the way the installer
does it;
--detectand the--debuglevel=11self-test from each extract, with the resource-check lines compared against a run on the mounted ISO (as study §F.3 did). - A
*.zipbackstop in.gitignore.
Out of scope
- Hosting and access (R2, presigned URLs or a Worker gate, study §L.3). Nothing is uploaded. Its own WP, once Jeff picks the scheme.
- The Feb 2001 Showdown pressing. It isn’t detected (study §F.2); it would need a detection entry first (study §M.5).
- Detecting without
Scooby.exe(study §J.5, §L.2): an engine change. - A manifest format 2 with a per-file list: the lists here hold what it would carry, but the app doesn’t read one.
- A hosted download to the TV. WP-085 and WP-096 already proved the installer’s download path with BASS; downloading these packages belongs with the hosting WP’s end-to-end test (study §M.4). The install path from a staged zip was run on the TV after this WP merged, at Jeff’s request (§TV install).
Dependencies
- PowerShell 7; .NET’s
System.IO.Compression(deflate). - The two ISOs (SHA-256 in study §C). Phantom’s may be mounted already by the WP-087 closeout session; reuse it and don’t dismount it.
- A fork build of
scummvm.exewith the TerraGlyph engine, run from the MSYS2 UCRT64 shell; a JDK for theZipInputStreamcheck.
Execution
- Claim the number (push
claude/wp-134-gen1-packages). - Mount the Showdown Aug 2001 ISO read-only; reuse Phantom’s mount.
- Write both lists; check them against study §D and the ISO hashes against §C; run the list script again and compare.
- Negative runs of the package script: a source missing every file, a list with one wrong SHA-256, an output folder inside the repo.
- Build both packages; rebuild one and compare the SHA-256.
- Extract each with
java.util.zip.ZipInputStreamunder the installer’s rules; re-hash every extracted file against the list. --detectfrom each extract’s root and itsscooby\; 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
- Both lists are committed, holding hashes only, and match the study: 48 files / 556,351,281 B and 62 files / 540,771,169 B.
- Re-running the list script on the same disc gives identical bytes.
- 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.
- Both packages build, deflate, with every file under
scooby/and no directory entries; a rebuild gives the same SHA-256. ZipInputStreamextracts each with no refusal; the extracted bytes equalinstalledSize, and every file’s SHA-256 and name match the list.--detectfindsterraglyph:showdownandterraglyph:phantomknightin each extract.- 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.
- No game data and no zip is staged; nothing is uploaded.
Deliverables
- Committed:
tools/New-RuntimeFileList.ps1,tools/New-GamePackage.ps1,tools/packages/(README.mdand the two JSON lists), the.gitignorebackstop, this WP, its pre-flight, the WORK_INDEX row, and a pointer in the study’s §M. - Local only:
C:\pcloud\scooby-engine\packages\showdown-en-aug2001-1.zipandphantomknight-en-1.zip; the run logs (session scratchpad).
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).
--detect:terraglyph:showdownfrom the Showdown extract’s root and itsscooby\;terraglyph:phantomknightfrom Phantom’s.- Self-test (
--debuglevel=11, stopped aftermovie check), extract vs ISO:
| 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:
- The manifest (both entries as §Result prints them, with a
never-fetched
https://packages.invalid/…zip URL) was put in a secret GitHub gist on Jeff’s account, the only HTTPS host involved. It holds ids, titles, sizes and hashes, no game data. - The zips went over
adbinto the app’sfiles/packages/.staging/as complete<id>-1.zip.partfiles with matching sidecars, one at a time: installing one package clears every other package’s staging. The installer then re-hashes the file, logs Reusing the complete download … not fetching it again, and goes on as after a real download. - The library: the earlier hand-copied entries
showdown-winandphantomknight-winwere removed fromscummvm.inifirst (backupscummvm.ini.bak-wp134), so--addwould take the packages. It re-created both under the same names, so the existingshowdown-win.00Nsaves still belong to the game.
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
- The manifest entry prints a placeholder
urluntil the hosting WP decides where packages live;-Urlfills it in. versionis the package’s revision. A different pressing or language is a new list with its own id (study §K).