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.ARTCommon::Archivereader first in Phase 3.
Header
- WP:
WP-014 - Title:
TGIFILE.ARTreader as aCommon::Archive(Gen 1) - Pre-flight date:
2026-11-14 - Targets generation(s): 1
- Targets disc(s): Showdown, Phantom
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
- Project worktree on new branch
claude/wp-014fromorigin/main(d05cc81), clean. - Fork
C:\dev\scummvmonscooby-engineat5a88016fea(WP-012), clean and pushed. - Scooby-only build tree from WP-010/012 in the session scratchpad.
TGIFILE.ARTfor both titles is cached intools/exes/showdownandtools/exes/phantom, and the ISOs mount for the end-to-end run.- Name-table check (run 2026-11-14). Both titles’ names are unique, including when compared case-insensitively. They use only
[A-Za-z0-9_], and every ROOM and OBJ id is within its descriptor array. Showdown: 69 / 453 / 1,266. Phantom: 53 / 433 / 1,148. A case-insensitive map is safe.
Doc-vs-tree cross-check
- Integration §4’s implementation note says the “asset entry table” becomes the archive index. That is pre-WP-001 wording: the index is the name table plus the sector descriptors. The close updates §4.
- Member length. A descriptor gives a sector-padded span. The object resource’s own
u32size is smaller. The engine reads the whole span, so streams use the span. The block’s own size is the block parser’s concern.
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
- READY TO EXECUTE
- NOT READY
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.