Pre-Flight — WP-085 — 2026-11-26
Filled-in copy of docs/reference/pre-flight for WP-085, run from the pre-flight session prompt. Verdict at the bottom. The execution prompt is session-WP-085-2026-11-26.
Nothing had been done before this session (checked 2026-11-26): no
pre-flight-WP-085-*file onmain, nowp-085-tv-app-pipelinebranch locally or on the fork’sorigin, no fork worktree, no fork PR mentioning WP-085, and no other session running it. Every device and toolchain fact below comes from a command run in this session.
Header
- WP:
WP-085 - Title: Google TV app pipeline: library, import, test packages and updates
- Pre-flight date:
2026-11-26 - Signed against: public
mainb221f4f286f0; forkorigin/scooby-engineff490ad9449f - Follows: the decision session (D0–D4 answered 2026-11-26, decision).
- Targets generation(s): N-A for engine code. TerraGlyph is compiled in and
smoke-tested with Gen 1 (Showdown) data;
engines/terraglyph/**is not touched. - Targets disc(s): Showdown (smoke test only), plus the Beneath a Steel Sky freeware CD (not a TerraGlyph title).
Pre-flight intent
Validating readiness for
WP-085. Not implementing, not building, not installing anything on the TV. Verdict only, plus the claim (the fork worktree) and the execution prompt.
Dependency check
| Prereq | Status in WORK_INDEX |
Locked on | Notes |
|---|---|---|---|
| WP-079 | ✅ GO | 2026-11-22 | Read from the index row: Showdown closeout GO. Its TV build path is proven on the TCL 65Q77K per the smart-TV guide |
Rule check: the only prereq is done. WP-085 is a Phase 5 (polish and distribution) WP; it needs no rights holder because it distributes no game.
Repo + disc state
Pre-execution checks from the session prompt:
- Public
mainincludese2b0bd5:git merge-base --is-ancestor e2b0bd5 origin/main→ 0. Headb221f4f286f0. WP-085 says “ready for pre-flight”. - Private
mainincludesb8f2fdc(--is-ancestor→ 0; it is the head). The candidates section shows the chosen name and id (not repeated here). origin/scooby-enginefetched:ff490ad9449f94b95769bb715f489c3d21c8e194, unchanged since WP-085 §Background was written, so its Android-port facts stand.- No
wp-085-tv-app-pipelinebranch locally or on the fork’sorigin(git branch -a --list '*085*'empty), and no fork PR mentions WP-085 (gh pr list -R barefootbetters/scummvm --state all --search WP-085empty).
Working trees:
- Docs work in worktrees, not the shared checkouts: public
C:\claude-worktrees\scooby-engine-wp-085-preflightand privateC:\claude-worktrees\scooby-engine-private-wp-085-preflight, both on branchdocs/wp-085-preflightoff theirorigin/main. - The claim (fork worktree).
tools\New-ForkWorktree.ps1 -Branch wp-085-tv-app-pipeline→C:\claude-worktrees\scummvm-wp-085-tv-app-pipeline, branchwp-085-tv-app-pipeline, baseorigin/scooby-engine @ ff490ad944. HEADff490ad9449f94b95769bb715f489c3d21c8e194. The base checkoutC:\dev\scummvmstays clean (git status --porcelainempty) onscooby-engine.
Android-port facts, re-confirmed in the worktree at ff490ad9449f:
| Fact | Where |
|---|---|
applicationId "org.scummvm.scummvm" |
dists/android/build.gradle:27 |
applicationIdSuffix ".debug" (debug build type) |
dists/android/build.gradle:96 |
namespace = "org.scummvm.scummvm" |
dists/android/build.gradle:17 |
app_name = “ScummVM” (app_name_debug = “ScummVM (debug)”) |
dists/android/res/values/strings.xml:3-4 |
Label @string/app_name${nameSuffix}, icon @mipmap/scummvm, TV banner @drawable/leanback_icon |
dists/android/AndroidManifest.xml:67,69,73,93 |
GAMES_BUNDLE_DIRECTORY copied into assets/games/ |
backends/platform/android/android.mk:59-61 |
androidbundlerelease → ./gradlew bundleRelease -PsplitAssets |
backends/platform/android/android.mk:84,96 |
| DLC store URL commented “temporary mock api” | backends/dlc/scummvmcloud.cpp:89 |
| DLC store created only in the SDL backend | backends/platform/sdl/sdl.cpp:108-109 (and kFeatureDLC at :233); no DLC reference in backends/platform/android/ |
SAFFSTree.java present |
backends/platform/android/org/scummvm/scummvm/SAFFSTree.java |
Toolchain (WSL 2, Ubuntu 26.04.1 LTS, kernel 6.18.58.1; SDK at
/opt/android-sdk, with ANDROID_SDK_ROOT and ANDROID_NDK_ROOT exported in
root’s login profile):
| Item | Output |
|---|---|
| SDK platform | ls $ANDROID_SDK_ROOT/platforms → android-37.0 |
| NDK | ls …/ndk → 23.2.8568313; source.properties Pkg.Revision = 23.2.8568313 |
| Build tools, platform tools | build-tools/36.0.0; adb 1.0.41 (37.0.3-16887417) |
| Command-line tools | cmdline-tools/latest Pkg.Revision=23.0, including apkanalyzer (used by EC-008 Step 3) |
| JDK | OpenJDK 17.0.21.1 |
| Oboe | 1.11.0 (/opt/build/oboe), headers in the NDK sysroot (16 files) |
| Oboe arm64-v8a | /opt/build/oboe-build (ANDROID_PLATFORM=android-21); installed liboboe.a SHA-256 a9003f2c…eb5e3e, same as the build output |
| Oboe armeabi-v7a | /opt/build/oboe-build-v7a (ANDROID_PLATFORM=android-16, ANDROID_ABI=armeabi-v7a); installed liboboe.a SHA-256 399a790e…f843dd61, same as the build output. llvm-nm -u lists only __stack_chk_fail and __stack_chk_guard, no __vsprintf_chk |
Device: the TCL 65Q77K. Jeff opened Wireless debugging. adb pair to the
address he read off failed with protocol fault (couldn't read status
message), but the PC was already trusted: the TV reconnected on its own over
mDNS, as the smart-TV guide
describes. (The address Jeff read off differed from the one mDNS reported,
which is the likely cause of the pairing error.) Captured 2026-11-26, with the
TV’s LAN address and serial replaced as in the guide:
adb mdns services
adb-<serial> _adb._tcp <tv-ip>:5555
adb-<serial>-<id> _adb-tls-pairing._tcp <tv-ip>:<pairing-port>
adb-<serial>-<id> _adb-tls-connect._tcp <tv-ip>:<connect-port>
adb devices -l
adb-<serial>-<id>._adb-tls-connect._tcp device product:G08_4K_US model:Smart_TV_Pro device:G08
getprop ro.product.cpu.abilist = armeabi-v7a,armeabi
getprop ro.product.cpu.abilist64 = (empty)
getprop ro.build.version.release = 14 (SDK 34)
So execution builds android-arm-v7a only (the 32-bit Oboe above). The TV
already has org.scummvm.scummvm.debug (the WP-079 smoke build); the WP-085
app’s own id installs beside it.
Bluetooth peripherals: not confirmed. Jeff hasn’t yet confirmed that the
keyboard, mouse and gamepad are on hand and paired. dumpsys input at capture
time listed only the TV’s own devices: its Bluetooth remote (BT_RC923A_B1),
IR receiver, keypad, and virtual remote and search devices. No external keyboard,
mouse or gamepad was connected. They’re first needed at EC-008 Step 1, so the
execution prompt makes them a pre-execution check with a dumpsys input
capture (§Verdict).
ISO / extract paths in use (all outside every repo):
Showdown: P:\scooby-engine\Showdown.iso (ISO SHA-256 B9CF0618…F4FDDAEF;
\scooby\Scooby.exe SHA-256 1328454334…AF7478, the WP-079/EC-006 identity;
showdown.cd present). Mounted read-only to hash, then unmounted.
BASS: P:\games\BeneathASteelSky\bass-cd-1.2.zip (69,377,781 bytes;
SHA-256 53209b9400eab6fd7fa71518b2f357c8de75cfeaa5ba57024575ab79cc974593: MATCH).
Downloaded 2026-11-26 from downloads.scummvm.org on Jeff's go.
Showdown is Jeff’s own disc data. It’s never hosted, and reaches the TV only
by a non-public route (USB or adb push).
Questions put to Jeff
Asked 2026-11-26, recommendation first. The answers are the option labels Jeff picked.
| # | Question | Jeff’s answer |
|---|---|---|
| Q1 | Keeping the package id private on the public fork | “Inject at build time (Rec)” |
| Q2 | The test-package repo’s name | “tv-test-packages (Rec)”, so barefootbetters/tv-test-packages. It’s created on Jeff’s go during Milestone 3, not in this session |
| Q3 | Placeholder icon and banner for sideloaded test builds | “Placeholders OK (Rec)” |
| (data) | Download the BASS zip to P:\games\BeneathASteelSky\ |
“Yes, download it (Rec)” |
Q1, checked against the code. The id, label, icon and banner can all come
from Gradle properties without changing namespace:
applicationId(build.gradle:27) is a plaindefaultConfigvalue, soapplicationId findProperty('tvAppId') ?: "org.scummvm.scummvm"keeps the neutral default.namespace(:17) is separate and staysorg.scummvm.scummvm, soR,BuildConfigand every Java package are unchanged.- No Java, C++ or XML file under
backends/platform/android/ordists/android/hard-codesorg.scummvm.scummvmas a string (a grep outsidepackage/importlines finds none). The code usesgetPackageName()(ScummVMActivity.java:1115,1952…), and the manifest’ssharedUserIdis already${applicationId}(AndroidManifest.xml:6). - The label, icon and banner are manifest attributes (
:67,69,73,93), so they becomemanifestPlaceholderswith the current values as defaults. The real art is a resource directory outside the repo, added tores.srcDirsonly when the property names it, under resource names ScummVM doesn’t use, so there are no duplicate-resource merge errors. - Where the values live: a Gradle user-level properties file in the build
environment (
/root/.gradle/gradle.propertiesin WSL), outside every repo. The properties aretvAppId,tvAppLabelandtvAppResDir. Gradle reads that file on every build, soandroid.mkneeds no-Ppassthrough. The values and the placeholder art are recorded in the private repo (private/tv-app-identity/). This is a static check; Milestone 1’s first build proves it (EC-008 Step 1, the launcher tile).
Engineering calls (Claude’s, with reasoning)
1. Download, verify and extract in Java, not a port of backends/dlc/.
- Java route: the JDK and Android SDK already provide
HttpsURLConnection,MessageDigest(SHA-256),ZipInputStreamandorg.json. ScummVM’s own add/detection is reached without new C++: the activity can restart the ScummVM thread with new args (ScummVMActivity.java:1341-1348,onNewIntent), and--add --path=<dir> --recursive --no-exitrunsaddGames()and stays in the launcher (base/commandLine.cpp:2056,2194-2197;exitis a boolean option at:998). Estimate: about 500–800 lines of new Java, and no C++ beyond an optional JNI hook if the restart route proves awkward. - DLC port:
backends/dlc/is 516 lines plusgui/dlcsdialog.*(160). It would also need the Android backend to create a store and reportkFeatureDLC(the SDL pattern atsdl.cpp:108,233);configureenabling DLC for Android (configure:6408, which needs_http); a SHA-256 implementation, becausecommon/has none (a grep for sha256 finds nothing); a manifest adapter, becausescummvmcloud.cpp:57expects FirebaseScummVMCloudobjects; and update and rollback logic, which it lacks entirely. That’s larger, it’s C++ across more files, and it’s no better. - Call: Java. It matches WP-085 §Scope 10’s preference.
2. D4, keeping the advanced mode out of the Play build: build-type source sets.
- The advanced-mode classes go in their own Java source directory
(
backends/platform/android/advanced/), added only to the debug build type’s source set. The release build type gets a same-named stub (backends/platform/android/advanced-stub/) that reports “not available”, somaincode compiles in both. The release build, which is the Play build, then contains no advanced-mode class at all, whatever R8 does. - Why not the alternatives: a product flavor doubles the variants and moves the
APK output paths that
android.mk:76-99hard-codes. ABuildConfigflag or a compile-time define leaves the code in the binary and relies on dead-code stripping. The test build is therefore the debug build (id<injected id>.debug), which is what WP-085’s sideload testing installs anyway. - How EC-008 Step 3 checks it: on the release APK (or the AAB’s base APK),
apkanalyzer dex packages --defined-only <apk>lists noorg.scummvm.scummvm.advancedpackage (proguard-rules.prois-dontobfuscate, so the class names survive R8). Andunzip -p <apk> 'classes*.dex' | strings | grep -c <manifest-URL sentinel>returns 0. Both outputs are captured.
3. Where extracted packages live: getFilesDir()/packages/<id>/<version>/,
with downloads staged in getFilesDir()/packages/.staging/.
updateStartSettingsprunes only game domains whose path is under<assets>/gamesand no longer exists (android.cpp:477-509).- On an app update,
updateAssetsToInternalMemory()deletes the data dir’s top-level files but skips folders (ScummVMActivity.java:2400-2403,internalAppFolderCleanup), and fully resyncs onlyassets/anddoc/(:2581-2582,assetsFolderCleanupat:2422-2451). - The data dir is
getFilesDir()(:1899). Apackages/folder there therefore survives updates and is removed on uninstall, as saves are. - Staging inside the same folder keeps the verified swap a same-filesystem rename, and the cache dir isn’t used because Android may clear it mid-download.
- An update unpacks the new version beside the old one and switches the game’s
pathonly after it verifies, which is Milestone 4’s rollback guarantee.
Scope lock
Anything not listed is forbidden.
Fork (C:\claude-worktrees\scummvm-wp-085-tv-app-pipeline, branch
wp-085-tv-app-pipeline):
dists/android/** (build.gradle, AndroidManifest.xml, res/, proguard-rules.pro)
backends/platform/android/** (Java incl. advanced/ and advanced-stub/, android.cpp/.h, jni-android.*, android.mk)
configure (only if the build needs it; say why in the commit)
ports.mk (only if the build needs it; say why in the commit)
Public docs repo (barefootbetters/terraglyph-engine):
docs/reference/tv-package-manifest.md (new: the manifest format, WP-085 §Deliverables)
docs/work-packets/WP-085-tv-app-pipeline.md (§Result, exit criteria, status)
docs/execution-checklists/EC-008-tv-app-pipeline.md
docs/work-packets/WORK_INDEX.md (the WP-085 row and current-state line)
docs/reference/pre-flight-WP-085-2026-11-26.md (§Lessons learned only)
Private repo (barefootbetters/scooby-engine-private):
private/tv-app-identity/** (the injected values, a properties template, placeholder art)
private/commercial-strategy.md (only to link the identity record)
Local only, never staged: /root/.gradle/gradle.properties, the identity
res directory outside the fork, build outputs, captures with device serials,
and everything under P:\games\ and P:\scooby-engine\.
Forbidden (any change fails the WP):
engines/terraglyph/**and any other fork path outside the list above (base/,common/,gui/,backends/dlc/, other backends).- The product name or package id in any public file or in the fork, including commit messages, branch names, PR text and logs pasted into public docs.
- Game data in any repo, signing keys, endpoint credentials.
- Creating
barefootbetters/tv-test-packagesor any other external resource without Jeff’s go at Milestone 3. - Changing D0–D4.
Exit check (before every commit):
git diff --cached --name-only # each repo; match against the lists above
git diff origin/scooby-engine..HEAD --name-only # the fork branch, before the PR
Also grep the staged diff for the private name and id before every fork or
public commit. Any hit is a leak: git restore --staged and remove it.
Risk review
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Package id or name leaks through the public fork (Q1) | med | high | Values only in the Gradle user properties and the private repo; the fork keeps org.scummvm.scummvm defaults; the staged-diff grep for the private name and id before every commit; the PR text is reviewed for both before it opens |
| The app downloads executable code (WP-085 exit criterion 6) | low | high | Packages are data zips only. The extractor refuses entries ending .so, .dex, .jar or .apk, and files that start with ELF (7F 45 4C 46) or dex (dex\n) magic. The §Result code-review note greps the fork diff for DexClassLoader, PathClassLoader, InMemoryDexClassLoader, System.load, Runtime.exec and PackageInstaller (expected: none) |
Zip-slip: an entry like ../../x writes outside the package dir |
low | high | Each entry’s canonical path must stay under the target dir, or the package is refused; EC-008 Step 3’s wrong-hash test gets a second negative test with such an entry |
| Game data reaches git | low | high | Staging stays on P:\, outside every repo; the fork’s .gitignore doesn’t cover zips, so git diff --cached --name-only before every commit is the guard |
| Collision on the shared checkouts | low | med | Fork work only in the claimed worktree; docs work in worktrees; explicit-path staging |
| The TCL’s system file picker is missing or limited (Milestone 2’s first gap) | med | med | Record it as a gap; adb push and the cloud dialog are the other routes; at least one route must work without a computer (exit criterion 3) |
The 32-bit Oboe link fails (__vsprintf_chk) |
low | med | The installed armeabi-v7a liboboe.a was built for android-16 and has no _chk symbol beyond the stack protector (checked above); if it recurs, rebuild per the smart-TV guide |
| The test build is the debug build, so Milestone 4’s update test is debug over debug | med | low | Bump versionCode between the two sideloaded builds; the release path is WP-084’s |
Two apps claim the scummvm: intent scheme (AndroidManifest.xml, the SplashActivity filter) beside the installed org.scummvm.scummvm.debug |
low | low | Note it if a chooser appears; changing the scheme is out of scope |
| Device evidence claimed without a capture (the 2026-11-21 lesson) | low | high | No EC-008 box checked without a logcat excerpt, command output or screenshot; Jeff’s live confirmations are quoted as his |
| Peripherals unavailable at Step 1 | med | med | The execution prompt’s pre-check captures dumpsys input showing each one before Step 1 |
Verdict
- READY TO EXECUTE. Every section above carries concrete content. The claim is made, the toolchain, device and test data are checked, Q1–Q3 are answered, and the three engineering calls are made.
- NOT READY
One item carried forward, not a blocker: Jeff’s confirmation that the
Bluetooth keyboard, mouse and gamepad are on hand and paired. None was
connected at capture time. They’re first used in EC-008 Step 1’s input
checks, after the Milestone 1 build and install, so the execution prompt makes
a dumpsys input capture showing all three a pre-execution check. The session
stops there if any is missing.
Reviewer: Claude (Opus 5.5), pre-flight session for Jeff Date: 2026-11-26
A READY verdict authorizes opening the execution session. It doesn’t
authorize any change beyond the §Scope lock. It goes stale if public main or
origin/scooby-engine moves in a way that touches WP-085, EC-008 or the
Android port (wp-lifecycle §Phase 2).
After execution: lessons learned
Filled in 2026-11-27, after execution (WP-085 §Result).
- Find out which
adbreached the TV. This pre-flight recordedadb1.0.41 (37.0.3) without saying whose: it was Windowsadb(winget platform-tools), not WSL’s. WSL runs in NAT mode, whereadb mdns servicesfinds nothing, which cost a round trip at execution. Builds run in WSL; the TV is driven from Windows. - Check the build’s optional libraries against the UI it targets. The
pre-flight checked Oboe, but not PNG. ScummVM’s grid launcher aborts
without libpng (“No PNG support compiled”). It crashed the app on the TV,
and the WP-079 app too once its grid view was turned on. A
grep USE_PNG config.hwould have caught it. - Probe the platform before planning import routes.
cmd package query-activities -a android.intent.action.OPEN_DOCUMENT_TREEshows in one command that this Google TV has no system picker: onlycom.android.tv.frameworkpackagestubshandles it. Run as the app,lson the USB stick shows Android 14 blocks reading it by path. Both are pre-flight checks. They’d have shown that exit criterion 3 depends on the cloud route alone. - Test input on the real remote early. The TCL remote reports every
press twice, and its ring sends OK when pressed near the edge. A D-pad
gesture designed on paper failed by hand. Record
getevent -ltfrom each input device at Step 1. - Two apps that look alike on one TV get confused. The WP-079 debug
app (ScummVM) sat next to the test app, and live checks twice ran in the
wrong one. Hide the other app for the run (
pm disable-user, data kept), or give the test app art that’s clearly different from the start. - Confirm what the peripherals are before Step 1. “Keyboard, mouse,
gamepad” turned out to be one keyboard-with-touchpad, with no gamepad. A
dumpsys inputwith Jeff at the TV, before building, would have shown it.