Pre-Flight — WP-145 — 2026-12-04
Filled-in copy of docs/reference/pre-flight for WP-145. Verdict at the bottom.
Written by the execution session from session-WP-145-2026-12-04, before any code. No companion EC: the checklist is WP-145 §Exit criteria.
Header
- WP:
WP-145 - Title: Beta games appear in the TV library: Get and Update tiles
- Pre-flight date:
2026-12-04 - Targets generation(s): any format-1 package; proven with the Gen 1 packages (
showdown-en-aug2001,phantomknight-en) and BASS (bass-cd) - Targets disc(s): none read; the Gen 1 ISOs are only re-hashed and re-packaged by
Publish-BetaGame.ps1’s metadata-only path
Dependency check
| Prereq | Status in WORK_INDEX |
Notes |
|---|---|---|
| WP-085 | 🚧 | The package store, the manifest and the hidden screen are merged (fork #13) and on the TV. Its open items (criterion 3, import with no computer; the gamepad) don’t touch this packet. |
| WP-096 | ✅ | Resume, verify, the atomic writeJson. |
| WP-137 | ✅ | The play band this packet relabels. |
| WP-138 | ✅ | The series, publisher and year metadata that Get tiles group by. |
| WP-139 | ✅ | The Worker, the per-tester manifest, the 404 for a revoked key. |
Rule check: WP-145’s header lists WP-085 as ✅; the index row still says 🚧. The part WP-145 builds on (the store) is merged and installed, so this is noted, not blocking, as WP-137’s pre-flight did for WP-104.
Placement: no fork classics branch (git ls-remote of the fork,
2026-12-04), and WP-144 is 📝. The fork work targets scooby-engine.
Repo + device state
- Claim: no
WP-145branch, open PR orpre-flight-WP-145-*in the docs repo, the fork or the private repo; WP-145 📝 onmain(c0b425f). Docs branchdocs/wp-145-tv-get-tilespushed first with an empty claim commit (8f4ff61). - Fork worktree:
tools\New-ForkWorktree.ps1 -Branch wp-145-tv-get-tiles, fromorigin/scooby-engine @ 38ec347633, the session prompt’s base, so the line map in WP-145 §Background holds. - Private worktree: branch
wp-145-tv-get-tilesfrom the private repo’sorigin/main @ 48d204c. - TV: TCL 65Q77K (“Smart TV Pro”) over Windows
adb, one device entry. Test build versionCode 26041074 (2026.4.1-wp138.1). No release build of the app is installed.adb install -ronly, never clear data. -
Backups, pulled with
run-asbefore any change, kept underC:\pcloud\scooby-engine\verification\wp-145-2026-12-04\:File Bytes SHA-256 files/scummvm.ini1,932 46D3B17B…59C103516files/packages/installed.json525 692B92BD…D066A88FEInstalled:
bass-cd1.2.1,showdown-en-aug20011,phantomknight-en1. Targetssky,showdown-win,phantomknight-win, each underfiles/packages/<id>/. - Saves before any change (
files/saves/):phantomknight-win.001SHA-25646727669…5c56ef9f(the Guest Book save),SKY-VM.001744e2571…babcee5f2,SKY-VM.SAV3246886c…b370ba. - The stored manifest URL is on the TV (
tv_packagesprefs), onbeta-data.barefootbetters.com. Fetched from Windows with it: HTTP 200, 1,464 bytes, four entries (bass-cd1.2,showdown-en-aug20011,phantomknight-en1,neg-wrong-hash1), none withengineid/gameid. - WSL build tree:
/opt/build/wt/wp145, a copy of WP-138’s tree with the fork tip synced over by content, configured as WP-137 (--host=android-arm-v7a --disable-all-engines --enable-engine=terraglyph,sky --with-png-prefix=/opt/build/png-v7a --disable-debug --enable-release).
Release-check baseline
strings over the release APK’s libscummvm.so and every classes*.dex,
grep -c TVPKG_MANIFEST_URL, on ScummVM-release-unsigned.apk built in
/opt/build/wt/wp145 from 38ec347633 before the change (APK SHA-256
9b0d8b4a9d6422f0…):
| File | TVPKG_MANIFEST_URL |
available.json |
TVPackages |
|---|---|---|---|
lib/armeabi-v7a/libscummvm.so |
0 | 0 | 0 |
classes.dex |
0 | 0 | 0 |
Baseline: 0. After the change it must still be 0; available.json
will appear in the .so (call 1), never in the release .dex.
Scope lock
fork: gui/launcher.cpp, gui/launcher.h (only if needed)
gui/widgets/grid.cpp, gui/widgets/grid.h
backends/platform/android/advanced/**
backends/platform/android/advanced-stub/**
backends/platform/android/org/scummvm/scummvm/ScummVM.java
backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java
backends/platform/android/jni-android.cpp, jni-android.h
public: docs/reference/pre-flight-WP-145-2026-12-04.md
docs/reference/tv-package-manifest.md
docs/work-packets/WP-145-tv-get-tiles.md
docs/work-packets/WORK_INDEX.md
tools/packages/*.json, tools/packages/README.md
tools/New-GamePackage.ps1
private: beta-data/tools/Publish-BetaGame.ps1
beta-data/manifest/beta.json
beta-data/README.md (the tool's usage changes)
Nothing else in gui/, backends/ or dists/android/**. The new install
screen is a new activity, so it needs an entry in
backends/platform/android/advanced/AndroidManifest.xml, which is inside
advanced/**.
Engineering calls
- How C++ finds
available.json: a known path under the packages root.JNI::getScummVMBasePath()(an existing call; it returnsgetFilesDir()) plus/packages/available.json, the folderPackageStorealready owns. No ConfMan key (Java would have to editscummvm.inion every start) and no new getter (D3 allows one new C++ → Java call,installPackage). The release build reads the same path but nothing ever writes it there: the release stub writes no file, and the release app id has no.debugsuffix, so it never shares the test build’s files. - A desktop build never looks for the file. Every line that reads it,
stats it or calls
installPackagesits under#ifdef ANDROID_BACKENDingui/launcher.cpp. The grid widget only learns a tile kind and a label; without the file every tile isinstalledand draws Play, as today. - Index alignment.
LauncherGrid::updateListingappends oneGridItemInfoper get tile after the ConfMan games, and pushes an empty string into_domains(and the title into_domainTitles) for each, so_domains[i]and grid entryistay aligned. An empty string is never a ConfMan domain name, and every path from a grid index to ConfMan refuses it:LauncherDialog::handleCommandtreats an entry with an empty domain as no selection (item = -1) before it looks the domain up, so Start, Edit, Saves (load), Record and Remove return at their existingitem < 0checks;confirmRemoveGames/removeGames(the grid’s multi-select Remove),getGameConfig(the search filter) andclose()(lastselectedgame) skip empty domains;LauncherGrid::handleCommandturns Play, a double click and OK on a get tile intoinstallPackage(id), and a get tile opens no tray, so it has no Saves or Edit to press. Group headers by language and platform readentry.domain, which is null for a get tile; those two cases fall back to “not detected”. Series, publisher, engine and year come from the metadata pack byengineid/gameid, so a get tile joins its WP-138 group.
- Metered connections: the launch fetch doesn’t skip them. The manifest is about 1.5 KB; nothing large moves until the tester picks a tile, and the install screen shows the download size first. Skipping would leave a metered tester with stale tiles for a saving of one small request. The fetch logs whether the network is metered.
- One writer.
available.jsonis written only by one synchronized method (AvailableList.write), withPackageStore.writeJson(temp file, sync, rename). Its callers: the launch fetch, the hidden screen’s LOAD MANIFEST, andapplyPending(which re-marks get/update against the newinstalled.jsonafter an add, update or remove, so a game removed or installed shows right before the next fetch). - What the file holds. Each manifest entry that has
engineid/gameid, withid,title,version,sizeandkind(get,update, orinstalledfor one at the same or a newer version); never a URL. An entry without the two fields gets no line, soneg-wrong-hashstays in the hidden screen only (criterion 10). A 404 (revoked or expired key) deletes the file; any other failure keeps the last good copy. - The install screen refetches the manifest for the entry’s URL, since
available.jsonhas none. Offline, that fails first, with a plain message and a way back (criterion 7). A 404 there says the game isn’t available any more. - Update matches by path. C++ marks an installed tile Update only
when its target’s
pathis under<files>/packages/<id>/for an entry whose kind isupdate; a get entry whose package already holds a target is dropped. Never by title. - Cancel is a check in the download loop through the new numeric
Progresscallback. It ends the download as an interrupted one, so the.partand its sidecar stay and the next try resumes (criterion 4). Cancel is off once the download is verified and extracting. - A repeated OK (the TCL’s remote sends each press twice; a long press
repeats) can’t start two installs: the install screen is
singleTopand refuses a second id while one runs.
Decision D2 (open for Jeff)
D2: the install runs on a full-screen Java view opened from the tile, not as progress inside the tile. Asked once during this review: keep D2, or ask for in-tile progress.
Jeff’s answer (2026-12-04, asked once during this review): “Keep D2 (Recommended)”. The install runs on the full-screen Java view; no in-tile progress.
Risks
- A get tile reaching ConfMan (Edit, Saves, Start on a game that isn’t there). Covered by call 3; tested on the TV with OK, a long press and the remote’s Menu key on a get tile.
- Two fetches racing. One writer (call 5).
- A restart losing the position or a save. Criterion 3 lists
phantomknight-win.001before the removal and after the reinstall. - Matching an update to the wrong target. By path only (call 8).
Publish-BetaGame.ps1saying “already published”. The metadata-only path updates the entry when the zip is the same butengineid/gameiddiffer, republishes the manifest, and never touches the zip. The tool reads file lists from the engine repo’sorigin/main, where the new fields aren’t yet, so it gains-EngineRefto read them from this WP’s docs branch.- The key in a log. The fetch logs the host only, as
fetchManifestdoes; exceptions carryHTTP <code> from <host>. Criterion 8 greps.
Verdict
READY. The prerequisites are met or noted, the claim is pushed, the TV’s files and saves are backed up and hashed, the release baseline is 0, and D2 stands as drafted.
After execution — lessons learned
Lesson: check a drawing rule against the covers the TV actually has. WP-137’s band is drawn only when the cover leaves room under it, and every TerraGlyph cover fills its slot. A Get tile therefore had no band and looked installed until the first TV capture. A desk review of grid.cpp couldn’t have caught it; a capture of a real tile did. When a WP adds a new state to an existing widget, capture each state on the device before calling the drawing done.
Lesson: on Android 14, test Back on the device, not in the code. The app opts in to predictive back (enableOnBackInvokedCallback in values-v34), so an activity’s onKeyDown(KEYCODE_BACK) never runs. The install screen closed while its download went on. Any new activity in the app needs an OnBackInvokedCallback from API 34, as ScummVMEvents has.
Lesson: this tree’s Gradle incremental javac drops same-package classes. After a change to one class, compileDebugJavaWithJavac failed with “cannot find symbol” for classes beside it. Forcing --rerun-tasks on the two compile tasks fixed it every time. The WSL build script for a TV test build should force it rather than trust the incremental step.
Lesson: offline on the TCL without losing adb. Turning Wi-Fi off drops adb, and cmd connectivity has no per-app firewall on this firmware. Pointing private DNS at a name that doesn’t resolve (private_dns_mode hostname, private_dns_specifier an .invalid name) cuts every lookup while adb, which connects by IP, stays up. Read both settings first and put them back (settings delete when they were unset).
Lesson: WSL’s /tmp doesn’t survive a restart. The build script’s copy of the source under /tmp was gone on the second day and the build failed on a missing folder. The script now creates it first.