custom_pack held only a PSIN blob, which is harvested whether or not the archive is selected, so the
spaced-list case passed even if the second archive was dropped. An ordinary blob there now has to appear
for " common, custom_pack ,," and disappear for --archives "".
Suggested in review by @Sigtryggur-Mani-Gudmundsson.
A carve folder with its own index.json (<work>/carve/common, the folder the
gamedata_* tools take) matched no <carve>/<archive>/index.json, so the run
printed "0 strings -> 0 hashes" and exited 0. Treat such a folder as that one
archive; the --out-is-an-input check covers its index.json too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The dictionary is written after the harvest, so `--out` naming an `--extra`
file or a carve folder's `index.json` replaced that input. Refuse it before
scanning with one ERROR line; os.path.samefile also catches a case-only
difference on Windows and macOS. Synthetic regression test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The harvest pattern ended a match after 201 characters and the next match
started in the middle of the same run, so a truncated prefix and a fragment
were added as names and the path component across the cut was lost. The
whole run is matched now and split into its parts as before; a run or a
part longer than 201 characters is not added as a name, which keeps the
longest entry the dictionary could ever hold. Parts are found one at a time,
so a very long run does not build a list of all of them.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
--lookup called .get on whatever the dictionary file held, so a JSON array ended in an AttributeError; the build
read each <carve>/<archive>/index.json with a bare json.load(f)["files"], so a malformed one aborted the run with a
traceback after earlier archives were processed. Both now print one ERROR line naming the file and exit 2.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
"café" and "caf\xe9" are the same Python string, so the Latin-1 check
compared one value with itself and could never fail: with hashdict.joaat
encoding ASCII instead of Latin-1, all 20 tests still passed. It now pins
joaat("caf\xe9") to 0xEEFBF723, the Latin-1 one-at-a-time hash computed
independently; the ASCII mutation fails it (0x2C6DF1F2).
A missing or non-folder carve ended in a traceback from os.listdir. A
carved .bin that an index.json lists but that is gone from disk stopped
the whole build with FileNotFoundError, so a long harvest wrote no
dictionary at all. --lookup died on a value that isn't hex, after
printing the values before it, and on a missing or broken dictionary.
The carve folder is now checked first (exit 2, one line). A listed blob
that can't be read is skipped, counted and named in one warning, and
the dictionary is still written from everything else. --lookup checks
every value before it prints anything (a usage error, exit 2) and
names a dictionary it can't read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>