Pre-Flight — WP-014 — 2026-11-14

Filled-in copy of docs/reference/pre-flight for WP-014. Verdict at the bottom.

Written before any code, on Jeff’s “continue” after PR #40 merged. WORK_INDEX lists the TGIFILE.ART Common::Archive reader first in Phase 3.


Pre-flight intent

Validating readiness for WP-014. Verdict only.

Dependency check

Prereq Status in WORK_INDEX Locked on Notes
WP-012 ✅ Done 2026-11-14 (PR #40 merged) The engine receives the generation. Gen 2/3 never reach run().
WP-001 ✅ Done 2026-11-13 Header, descriptor and name-lookup paths are traced.
WP-006 ✅ Done 2026-11-13 Phantom uses the same format with different counts.

Repo + disc state

Doc-vs-tree cross-check

Scope lock

Allowed paths (this repo):

docs/02-SCUMMVM-INTEGRATION.md   (§4)
docs/formats/tgifile-art.md      (Next steps item 1 only)
docs/work-packets/WP-014-tgifile-art-archive.md
docs/work-packets/WORK_INDEX.md
docs/reference/pre-flight-WP-014-2026-11-14.md

Fork: engines/scooby/** only. New files art_archive.{h,cpp}, added to module.mk.

Forbidden: game data in either repo; changes outside engines/scooby/.

Risk review

Risk Likelihood Impact Mitigation
Reader and probe agree, but both are wrong low med The probe’s layout was traced in Scooby.exe (WP-001) and verified on every block (--verify). Agreement with it is the check this WP needs.
Malformed file crashes the engine low med Check every count and span against the file size before indexing. Test with a truncated copy.
Disc-root vs scooby path med low Add the scooby subdirectory to SearchMan and test from the mounted disc root.
Upstream AI policy (open since WP-010) — — Not settled here. Same attribution as the earlier fork commits.

Verdict

Rationale: the format is fully traced, the data is cached, and the build tree exists.

Prepared by: Claude (WP-001 session, continuing), on Jeff’s “continue” of 2026-11-14 Date: 2026-11-14


After execution — lessons learned

Lesson: detection guards the reader. A truncated or resized TGIFILE.ART fails detection, so only damage beyond the MD5-covered first 5,000 bytes, at the original size, reaches ArtArchive::open(). Corruption tests have to keep the detection signature.

Lesson: under MSYS2, capture engine output with --logfile. A killed scummvm.exe loses buffered stdout, and that cut Phantom’s first log short. --logfile writes lines as they happen. Lines carry a [timestamp] prefix to strip before diffing.

Lesson: PowerShell variables ignore case. A loop counter $t overwrote the path in $T and broke the restore step. Use distinct names.

Scope note: the lock held. One fork commit under engines/scooby/. The ISOs were mounted read-only and dismounted afterwards. The corrupted copy lived in the scratchpad, was restored and hash-checked against the cache, then deleted.