Session Prompt — WP-145 execution (Get and Update tiles in the TV library)
Execution session. Paste this as the first message to a fresh session. It claims WP-145, writes its pre-flight, builds the change across the fork, the engine repo and the private repo, runs the exit criteria on the TCL, and opens the PRs. Keep it leashed: no spawned sessions. Every claim about what the TV showed comes from a capture this session made (a screenshot, logcat, a file pulled over
adb) or from Jeff’s own words (DECISIONS 2026-11-21).
Header
- WP: WP-145: beta games appear in the TV library, with Get and Update tiles. It has no EC. The checklist is WP-145 §Exit criteria, ten items.
- Prompt written: 2026-12-04. Session date: 2026-12-04 or later.
- Paired pre-flight:
docs/reference/pre-flight-WP-145-<date>.md. This session writes it as its first step, before any code. Follow pre-flight-WP-137-2026-12-02, the last TV grid packet. - Targets generation(s): any format-1 package. Proven with: the Gen 1
packages (
showdown-en-aug2001,phantomknight-en) and BASS (bass-cd). - Repos:
- The fork:
barefootbetters/scummvm, branchscooby-engine, at38ec347633or later. The base checkoutC:\dev\scummvmis shared, so onlyfetchthere. - Public docs:
barefootbetters/terraglyph-engine. The base checkoutC:\dev\scooby-engineis shared, so work in a worktree underC:\claude-worktrees\. - Private:
barefootbetters/scooby-engine-private, underbeta-data/. The base checkoutC:\dev\scooby-engine-privateis shared, so work in a worktree.
- The fork:
- Placement: WP-144 is
📝 drafted, and when this prompt was written there was no fork
classicsbranch. If the split has landed by the time you start (aclassicsbranch exists, or WP-144 is past Phase B), stop and report. Where this WP lives is Jeff’s call then.
Intent
When the test build starts, it reads the tester’s beta manifest in the background:
- Each game the manifest lists that isn’t installed shows in the library with its cover and a Get band. Choosing it installs the game, and it comes back as a normal tile you can play.
- An installed game with a newer package version shows Update.
All of this is in the debug build only. The release build keeps the stub and changes nothing.
Out of scope:
- Hosting Phase 2: activation codes, device tokens, entitlements.
- Getting the manifest URL onto a device.
- Deltas, background updates, notifications.
- Release builds.
- New covers.
- The engine (
engines/terraglyph/**). - Any change to WP-145’s five decisions.
Authority chain (read order)
C:\Users\jjensen\.claude\CLAUDE.md- wp-lifecycle §Phase 2–4 and steps 5–13
- WP-145, every section. Its
§Background maps the code at
b59ea35fd8. Since then nothing undergui/,backends/ordists/has changed, through38ec347633, so its line numbers hold:gui/launcher.cpp:1787–1842:LauncherGrid::updateListingbuildsGridItemInfos and_domainsin step.gui/widgets/grid.h:51–78:GridItemInfo, with no tile kind.gui/widgets/grid.cpp:72–235:GridItemWidget::drawWidget. Lines:197–210draw the band with a hard-coded_("Play")in two places.backends/platform/android/org/scummvm/scummvm/ScummVMActivity.java:1242and:1368: bothTestFeatures.beforeScummVMStartcalls. Find which one isonCreate’s before you hook in next to it.advanced/.../PackagesActivity.java:234:loadManifest().advanced/.../PackageStore.java::225:fetchManifest.:71:Progress.onProgress(String).:1068:writeJson.:829:pending.json.applyPending.
advanced/.../PackageManifest.java:112:compareVersions.jni-android.cpp::568–580isJNI::setCurrentGame, and:816is itsFIND_METHOD. Follow that recipe, withjni-android.h:102and:163, andScummVM.java:129.dists/android/build.gradle:170–176:advanced/goes into debug andadvanced-stub/into release.
- tv-package-manifest: the format, “Unknown fields are ignored”, resume and verify.
- WP-139 §Result: the Worker, the 404 on a revoked key, criterion 7 (no key anywhere), and the admin scripts.
- WP-137 and WP-138: the band, and the grouping that Get tiles must join.
- Smart-TV guide: the WSL build (libpng
is needed for the grid),
adbover the network from Windows, and the TCL’s build record. - Private:
beta-data/README.md,beta-data/tools/Publish-BetaGame.ps1,Set-BetaTester.ps1, andbeta-data/manifest/beta.json.
Pre-execution checks
- Claim first. None of these exist in any of the three repos: a
WP-145branch other than this session’s, an open PR naming WP-145, or apre-flight-WP-145-*onmain. WP-145 is still 📝 onmain. If any check fails, stop and report. - Re-check the placement line in the Header: no fork
classicsbranch. - Push the docs claim at once. Make a worktree off
origin/mainon branchdocs/wp-145-tv-get-tiles, and push it before anything else. - Fork worktree: run
tools\New-ForkWorktree.ps1 -Branch wp-145-tv-get-tiles. It refuses if the branch exists, which makes it a second claim check. Never work inC:\dev\scummvm. - Private worktree: branch
wp-145-tv-get-tilesfrom the private repo’sorigin/main. - If
origin/scooby-enginehas moved past38ec347633, rungit diff --stat 38ec347633 origin/scooby-engine -- gui backends/platform/android dists/android. If it isn’t empty, re-check every line number above before you rely on it. - The TV. Ask Jeff to turn on Wireless debugging, then use Windows
adb: -adb devices -llists the TCL. Pin a duplicate mDNS entry with-t. - Read the installed versionCode. It is 26041074 or later. - Back upscummvm.iniandpackages/installed.jsonoff the TV before any change, and record their sizes and SHA-256. - Install withadb install -ronly. Never clear data. - WSL build tree: a fresh
/opt/build/wt/wp145, configured as for WP-137, with libpng.
If any check fails, stop and report.
Execution rules
Scope allowlist. Put it in the pre-flight §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-<date>.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 (only if the tool's usage changes)
Anything else in gui/ or backends/, or dists/android/**, has to be
named in the pre-flight with a reason before you touch it.
External actions WP-145 authorizes. WP-145 names each of these, so nothing else is created or changed on the live host:
- Republish the beta manifest with
engineid/gameidadded: BASS by hand (sky/sky), and Showdown and Phantom throughPublish-BetaGame.ps1’s new metadata-only path. - For criterion 5, publish one newer BASS version as a test, and record what you published.
- For criterion 6, revoke Jeff’s tester with
Set-BetaTester.ps1, then restore it toactivein the same step, and show the restore worked.
Forbidden:
engines/terraglyph/**.- Any advanced-mode code in the release source set.
- Game data, captures, keys and the injected app id in any repo, commit, PR
or pasted log. Write
<app-id>,<tv-ip>and<key>. - Removing an installed game for good, or deleting saves. Criterion 2’s removal is keep saves.
- Changing D1–D5.
You MUST:
- Stage explicit paths. Never
git add -Aorgit add .. Before each commit, checkgit diff --cached --name-onlyagainst the allowlist. - Record the open call on D2 in the pre-flight. The install runs on a full-screen Java view, not as progress inside the tile. Ask Jeff once, while the pre-flight is in review: keep D2, or in-tile progress? Then proceed on D2 unless he changes it. Quote his answer.
- Settle these engineering calls in the pre-flight, before the code:
- How C++ finds
available.json: a known path under the packages root, a ConfMan key that Java writes, or a JNI getter. - That a desktop build never looks for the file at all (criterion 9).
- How a get tile keeps
_domainsindex-aligned, so that no launcher action (Start, Edit, Saves, Load) can reach a game that isn’t installed. - Whether the launch fetch skips a metered connection
(
JNI::isConnectionLimited, which WP-145’s Notes leave open).
- How C++ finds
- Keep the release check at 0. Run
strings <release .so and .dex> | grep -c TVPKG_MANIFEST_URLon the release APK before the change, as the baseline, and after it. Both are 0. - Do the leak check by grep, not by eye (criterion 8). Grep these three
for the key’s prefix and for
key=, and quote the counts:- logcat from the whole run;
- the shared diagnostic log;
available.jsonpulled off the TV.
- Build the Windows target too (criterion 9): MSYS2 UCRT64,
./configure --disable-all-engines --enable-engine=terraglyph,make, with 0 new warnings ingui/. Run the desktop launcher with noavailable.json, and show the grid unchanged in a screenshot made by this session. - Drive the TV from Windows
adb, by D-pad keyevents (19–23). Useinput taponly on the Android package screens, never in the ScummVM grid or a game. The TCL remote sends each press twice, so where a step needs Jeff’s hands, tell him that. - Evidence. Label every exit-criterion result with its source: capture
(screenshot, logcat, pulled file), log, or live — Jeff (his words,
quoted). Never write that a tile showed, an install finished or a save
survived without one of these. Raw captures stay outside the repo, under
C:\pcloud\scooby-engine\verification\wp-145-<date>\. ghon the fork always takes-R barefootbetters/scummvm.
Top risks:
- A get tile reaching ConfMan. Edit, Saves or Start on a get tile would act on a game that isn’t there, which is why D1 exists. Test OK, the tray key and the long press on a get tile, and show that each one installs or does nothing.
- Two fetches racing. The hidden screen’s LOAD MANIFEST and the launch
fetch could write
available.jsonat the same time. Write it atomically, with the existingwriteJson(temp file, sync, rename), and keep a single writer. - A restart losing the library position or a save. Check that criterion 3 keeps Phantom’s Guest Book save, by listing the save before the removal and after the reinstall.
- Matching an update to the wrong target. Match a target to a package only
by its path under
packages/<id>/, never by title. Publish-BetaGame.ps1saying “already published”. Today it compares only the zip’s hash. The metadata-only path must update the entry and republish, and must not touch the zip.
Session task
Follow WP-145 §Execution:
- Claim and set up the worktrees, as in the checks above.
- Write
pre-flight-WP-145-<date>.mdand commit it. It holds:- the dependency check: WP-085, WP-096, WP-137, WP-138 and WP-139 are ✅;
- the state of all three repos and the TV, with the backups’ hashes;
- the release-check baseline;
- the scope lock;
- the engineering calls above, and D2 with Jeff’s answer;
- the risks;
- the verdict.
- Add the manifest fields. Change
tv-package-manifest.md, the two Gen 1 file lists andNew-GamePackage.ps1. Then addPublish-BetaGame.ps1’s metadata-only path (private). Then republish: BASS by hand, then Showdown and Phantom through the tool. Fetch the manifest with Jeff’s key and show the three entries carryengineid/gameid. Quote the fetch with<key>. - Java:
- the launch-time fetch hook and its stub;
available.json(no URLs; a 404 deletes it; a network failure keeps it);- the one-package install screen;
- numeric
Progress.
- C++: the tile kind,
updateListing, the Get/Update band, the tray’s Update, and the tickle check onavailable.json’s modified time. - JNI:
installPackage(id)acrossScummVM.java,MyScummVM,_MID_andFIND_METHOD, theJNI::wrapper andjni-android.h. - Build: the debug and release APKs in WSL, plus the Windows target.
Install the debug APK with
install -r. - Run exit criteria 1–10 on the TCL, in WP-145’s order. Run criterion 6 (revoke) last but one, and restore the tester before criterion 7.
- Commit the fork change as
ANDROID: …orGUI: …subjects, one per layer: Java, C++ and JNI. Open the fork PR againstscooby-engine. Open the private PR. Never merge either; Jeff merges. - Close the WP in the docs:
- WP-145 §Result: the engineering calls, D2’s answer, each criterion with its evidence, the PR links, and what was published or changed on the host;
- the exit criteria ticked;
- the WORK_INDEX row ✅, or 🚧 if a PR or a criterion is open;
- the pre-flight’s §Lessons learned.
Open the docs PR.
Close ritual
WP-145 goes ✅ only when all ten exit criteria are met with evidence and Jeff has merged the fork and private PRs. Until then it stays 🚧, and §Result says what’s left.
Report back with the three PR links first. Then say what wasn’t checked, and what is left on the live host: the test BASS version, and the tester’s state.
Restore the TV to the build Jeff wants on it, and say which one is installed.
Remove the fork and private worktrees only after Jeff’s merges (state
MERGED).