Add the assets an existing build is missing without re-extracting the data it
already has. Extracts maps (and, with with_gui, the gui/ asset dirs) from
game_dir into the build’s vfs/, then regenerates derived artifacts (the
rkyv game-params blob, with the current parser) from the build’s existing
GameParams.data.
Remove content-addressed objects no longer referenced by any build. An
object is live if it appears in some build’s metadata (the extracted vfs
tree or the derived artifacts). Aborts without deleting anything if any
build’s metadata cannot be read, so in-use objects are never removed.
Remove content-addressed objects no longer referenced by any build present
on disk. Scans every directory under output_base that contains a
metadata.toml, so it stays correct even when builds.toml is out of sync
(e.g. a build directory was deleted manually without GC). Aborts without
removing anything if any metadata file cannot be read, so in-use objects are
never deleted. Returns the number of objects removed.
Migrate a dump base from the legacy vfs_common/ CAS directory to common/,
rewriting every build’s symlinks to point at the new store. Handles both a
clean rename (when common/ doesn’t exist yet) and a merge (when a redump
has already created common/ while old builds still reference vfs_common/).
No-op when the legacy directory is absent. Returns whether a migration ran.
Generate and content-address a build’s derived artifacts: the rkyv game
params blob, its zstd copy, and the English translation catalog’s zstd copy.
The rkyv blob is derived from vfs/content/GameParams.data against the
current wowsunpack::game_params::types schema; the on-disk rkyv is only
consulted as a fallback when the extracted vfs is missing or conversion
fails. Each artifact is stored in the CAS, linked back into build_dir,
and recorded in metadata.derived. Idempotent.
Regenerate derived artifacts for every dumped build (or one build when
only_build is given), then garbage-collect CAS objects no longer
referenced by any build.
Verify that every build in builds.toml is internally consistent: its
metadata.toml parses, every referenced content object exists in the shared
store, and (when check_links is set) every reconstructed symlink resolves
to a readable file. Returns a report per build; the caller decides how to act.