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).

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)

  1. C:\Users\jjensen\.claude\CLAUDE.md
  2. wp-lifecycle §Phase 3 and §Phase 4
  3. The paired pre-flight, especially §Code facts, §Engineering calls, §Scope lock and §Risk review
  4. WP-096, every section, including §Filler safeguards
  5. EC-014
  6. tv-package-manifest and WP-085 §Result (the installer as built)
  7. Smart-TV guide: the build steps, libpng, and adb over the network from Windows
  8. The ISO-free feasibility study §G–§H (the sizes)
  9. 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

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:

Commit conventions:

Top risks, as instructions:

Session task

Follow WP-096 §Execution steps 2–4:

  1. Scope 1 (preflight).
    • The space check: getAllocatableBytes, with the getUsableSpace fallback.
    • The optional installedSize field.
    • The post-download central-directory check.
    • The refusal message.
    • ENOSPC handling.
    • The debug free-space override.
  2. Scope 2 (resume).
    • The .part file and its sidecar.
    • Range and If-Range.
    • Accept 206 in open(); restart on 200, 416 or a changed validator.
    • The sweep keeps .part files.
  3. Scope 3 (integrity). packages/<id>/<version>.files.json and the Verify action.
  4. Scope 5 (interrupted install).
    • fsync every extracted file before the rename.
    • Sync the JSON temp file before its rename.
    • The start-up sweep rules.
  5. Exercise the JVM harness (space arithmetic, the resume decision table, .files.json comparison, Range across the redirect). Then build armeabi-v7a debug and release, and run EC-014 Steps 1–6 on the TCL.
  6. Update tv-package-manifest.md, write WP-096 §Result (with the headroom measurement and extract time with and without fsync), 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

  1. Every WP-096 exit criterion is checked with evidence. If any isn’t, the WP stays 🚧, and §Result says what’s open.
  2. git diff --cached --name-only in each repo matches the allowlist. The id grep is clean.
  3. Fill in the pre-flight’s §Lessons learned (or write “No lessons learned”).
  4. WORK_INDEX: flip WP-096 to ✅ only when every criterion holds, and update the dashboard milestone to match.
  5. Open the PRs, then report to Jeff: what landed, each criterion’s evidence, the measured headroom, and any follow-ups.