Session Prompt — WP-096 execution (package storage and download reliability)
Execution session. Paste this as the first message to a fresh session. Keep it leashed: no spawned sessions. Every device claim comes from a capture made in this session (the 2026-11-21 fabrication incident in DECISIONS is why).
Header
- WP: WP-096, with EC-014.
- Prompt written: 2026-11-28. Session date: fill in when run.
- Paired pre-flight: pre-flight-WP-096-2026-11-28,
verdict READY, signed against public
maina3f251776193+ PR #246, and fork6b5b02c53b. - Targets generation(s): N-A (no engine code). Targets disc(s): N-A (BASS freeware and a synthetic package).
- Repos:
- The fork worktree
C:\claude-worktrees\scummvm-wp-096-tv-package-reliability, branchwp-096-tv-package-reliability. It already exists; it is the claim. - Public docs
barefootbetters/terraglyph-engine: work in a worktree underC:\claude-worktrees\. - Shared checkouts: stage explicit paths only.
- The fork worktree
Intent
Deliver WP-096 scope sections 1, 2, 3 and 5 on the fork branch, one commit each in that order, and prove section 4 (preservation) by test. Verify every exit criterion on the TCL 65Q77K through EC-014. Then update the manifest doc, write §Result with the measured headroom, and open the fork PR.
Out of scope: R2 or any production host and access scheme; hosting any licensed data; freeing space for the user; package building; the release build gaining any advanced-mode code; engine detection; manifest format 2; any fork path outside the scope lock.
Authority chain (read order)
C:\Users\jjensen\.claude\CLAUDE.md- wp-lifecycle §Phase 3 and §Phase 4
- The paired pre-flight, especially §Code facts, §Engineering calls, §Scope lock and §Risk review
- WP-096, every section, including §Filler safeguards
- EC-014
- tv-package-manifest and WP-085 §Result (the installer as built)
- Smart-TV guide: the build steps, libpng,
and
adbover the network from Windows - The ISO-free feasibility study §G–§H (the sizes)
- Private: the injected id comes from
/root/.gradle/gradle.properties. Never copy it into a public file, the fork, a commit message, PR text or a pasted log; write<app-id>.
Pre-execution checks
- PR #246 is merged, and public
mainincludes it and this prompt. If WP-096, EC-014 ortv-package-manifest.mdchanged since, stop: the READY may be stale. - The fork worktree is clean on
wp-096-tv-package-reliability, with HEAD at or after6b5b02c53b. Iforigin/scooby-enginemoved, rungit diff --stat 6b5b02c53b origin/scooby-engine -- backends/platform/android dists/android. If it isn’t empty, stop and re-check the pre-flight’s code facts. - The toolchain matches the pre-flight table (
android-37.0, NDK23.2.8568313,liboboe.a399a790e…, libpng16 v7ac1a2ca89…). - The TV. Ask Jeff to turn on Wireless debugging, then use Windows
adb: - [ ]adb devices -llists the TCL. If Wireless debugging was reset, Jeff reads a pairing address and code off the TV foradb pair. If the TV is listed twice (two mDNS names), pin every command with-t <transport>. - [ ]adb shell df /datashows at least 2 GiB free, or stop. At pre-flight it had ≈16.3 GiB free. - [ ]adb shell pm list packagesshows the WP-085 test app (quote it as<app-id>). - Any
/sdcard/wp096-filler/left on the TV is removed.
If any check fails, stop and report it. Don’t proceed on mismatched state.
Execution rules
Scope allowlist (verbatim from the pre-flight):
fork: backends/platform/android/advanced/**
backends/platform/android/advanced-stub/** (only if needed; say why)
dists/android/** (only if needed; say why)
public: docs/work-packets/WP-096-tv-package-reliability.md
docs/execution-checklists/EC-014-tv-package-reliability.md
docs/reference/tv-package-manifest.md
docs/reference/pre-flight-WP-096-2026-11-28.md (§Lessons learned only)
docs/work-packets/WORK_INDEX.md (WP-096 row, Last updated)
dashboard.json (tv-package-reliability)
tools/Invoke-TvFiller.ps1 (new)
External, already authorized by Jeff: one new tv-test-packages release
with the synthetic zip and its two manifests. Nothing else is created.
Forbidden:
engines/terraglyph/**and every other fork path.- The private id or label anywhere public.
- Game data, keys and credentials.
- Writing on the TV outside
/sdcard/wp096-filler/and the app’s own storage. - Going below 256 MiB free on the TV.
- Changing D1–D4 or the safeguards.
Commit conventions:
- Fork:
ANDROID: …subjects, one commit per scope section. - Docs:
docs(WP-096): …. - Every commit ends with
Co-Authored-By: Claude Opus 5.5 <[email protected]>. - Before each commit, run the pre-flight’s exit check and the id grep.
Top risks, as instructions:
- Filler. Use only
tools/Invoke-TvFiller.ps1, and only after its Ctrl+C dry run passes. Checkdfat the start and end of every filler step. Never leave a filler behind. Rangeacross the redirect. Check in the JVM harness, against the real GitHub URL, that the header survives the redirect before you test on the TV. If it doesn’t, follow redirects by hand, HTTPS only.- The
onCreatesweep must keep.partfiles. Relaunch the app between the kill and the retry in EC-014 Step 4. - Power cut. Run it last, once, after
kill -9andadb rebootpass. Tell Jeff when to pull the plug, and quote his confirmation. - Evidence. Check no EC-014 box without a capture. Quote logs with
<app-id>and<tv-ip>. Raw captures stay local.
Session task
Follow WP-096 §Execution steps 2–4:
- Scope 1 (preflight).
- The space check:
getAllocatableBytes, with thegetUsableSpacefallback. - The optional
installedSizefield. - The post-download central-directory check.
- The refusal message.
ENOSPChandling.- The debug free-space override.
- The space check:
- Scope 2 (resume).
- The
.partfile and its sidecar. RangeandIf-Range.- Accept
206inopen(); restart on200,416or a changed validator. - The sweep keeps
.partfiles.
- The
- Scope 3 (integrity).
packages/<id>/<version>.files.jsonand the Verify action. - Scope 5 (interrupted install).
fsyncevery extracted file before the rename.- Sync the JSON temp file before its rename.
- The start-up sweep rules.
- Exercise the JVM harness (space arithmetic, the resume decision table,
.files.jsoncomparison,Rangeacross the redirect). Then build armeabi-v7a debug and release, and run EC-014 Steps 1–6 on the TCL. - Update
tv-package-manifest.md, write WP-096 §Result (with the headroom measurement and extract time with and withoutfsync), and fill in EC-014. Open the fork PR and the docs PR.
Outputs this session MUST produce: the fork PR with the four section commits;
tools/Invoke-TvFiller.ps1; the updated manifest doc; WP-096 §Result; EC-014
filled in; the WORK_INDEX row and dashboard milestone updated.
Outputs this session MUST NOT produce (log them as follow-ups instead): an R2 bucket or access setup; a “free up space” UI; a package-building script; any engine change; manifest format 2.
Close ritual
- Every WP-096 exit criterion is checked with evidence. If any isn’t, the WP stays 🚧, and §Result says what’s open.
git diff --cached --name-onlyin each repo matches the allowlist. The id grep is clean.- Fill in the pre-flight’s §Lessons learned (or write “No lessons learned”).
- WORK_INDEX: flip WP-096 to ✅ only when every criterion holds, and update the dashboard milestone to match.
- Open the PRs, then report to Jeff: what landed, each criterion’s evidence, the measured headroom, and any follow-ups.