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.


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

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

  1. How C++ finds available.json: a known path under the packages root. JNI::getScummVMBasePath() (an existing call; it returns getFilesDir()) plus /packages/available.json, the folder PackageStore already owns. No ConfMan key (Java would have to edit scummvm.ini on 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 .debug suffix, so it never shares the test build’s files.
  2. A desktop build never looks for the file. Every line that reads it, stats it or calls installPackage sits under #ifdef ANDROID_BACKEND in gui/launcher.cpp. The grid widget only learns a tile kind and a label; without the file every tile is installed and draws Play, as today.
  3. Index alignment. LauncherGrid::updateListing appends one GridItemInfo per 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 entry i stay aligned. An empty string is never a ConfMan domain name, and every path from a grid index to ConfMan refuses it:
    • LauncherDialog::handleCommand treats 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 existing item < 0 checks;
    • confirmRemoveGames/removeGames (the grid’s multi-select Remove), getGameConfig (the search filter) and close() (lastselectedgame) skip empty domains;
    • LauncherGrid::handleCommand turns Play, a double click and OK on a get tile into installPackage(id), and a get tile opens no tray, so it has no Saves or Edit to press. Group headers by language and platform read entry.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 by engineid/gameid, so a get tile joins its WP-138 group.
  4. 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.
  5. One writer. available.json is written only by one synchronized method (AvailableList.write), with PackageStore.writeJson (temp file, sync, rename). Its callers: the launch fetch, the hidden screen’s LOAD MANIFEST, and applyPending (which re-marks get/update against the new installed.json after an add, update or remove, so a game removed or installed shows right before the next fetch).
  6. What the file holds. Each manifest entry that has engineid/gameid, with id, title, version, size and kind (get, update, or installed for one at the same or a newer version); never a URL. An entry without the two fields gets no line, so neg-wrong-hash stays in the hidden screen only (criterion 10). A 404 (revoked or expired key) deletes the file; any other failure keeps the last good copy.
  7. The install screen refetches the manifest for the entry’s URL, since available.json has 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.
  8. Update matches by path. C++ marks an installed tile Update only when its target’s path is under <files>/packages/<id>/ for an entry whose kind is update; a get entry whose package already holds a target is dropped. Never by title.
  9. Cancel is a check in the download loop through the new numeric Progress callback. It ends the download as an interrupted one, so the .part and its sidecar stay and the next try resumes (criterion 4). Cancel is off once the download is verified and extracting.
  10. A repeated OK (the TCL’s remote sends each press twice; a long press repeats) can’t start two installs: the install screen is singleTop and 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

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.