catalog: add --write-dict to accumulate recovered names into a sorted dict #14

Closed
github-bot wants to merge 1 commit from gh-pr/14/head into gh-pr/14/base
Owner

@⁠tarnobrzeg123-collab on GitHub · 2026-11-25 03:57 UTC · original
tarnobrzeg123-collab:feat/catalog-dict-export → main · +138 −3 · 3 files · 1 commits · closed without merging

Closes #12

Summary

  • Adds merge_dict and write_dict to src/rpf9/hashes.rs to merge hexhash name entries into an existing (or new) dictionary file, deduplicating by hash, preserving existing confirmed entries on conflict, and writing sorted 0x{:08x} name lines (one per line).
  • Adds --write-dict <PATH> to forge9 catalog so confirmed candidates — unambiguous single-candidate joaat matches and embedded resource labels whose name (or stem before .#) hashes to the entry's name hash — accumulate across runs and archives. Ambiguous multi-candidate hashes are skipped and reported on stderr so --json stdout stays clean.
  • Documents the workflow in README.md.
  • Adds synthetic-data unit tests (rpf9::hashes::tests::merge_dict_dedups_sorts_and_preserves_existing and tests::catalog_write_dict_accumulates_sorted_deduped_entries) covering multi-run accumulation, reload via --dict, deduplication, sorting, and skipping ambiguous hashes.

Testing

  • cargo build --release — succeeded with 0 warnings.
  • cargo test --release — all 66 tests pass (59 library + 7 binary), synthetic data only, no game files used.
  • ./target/release/forge9 catalog --help — verified --write-dict <PATH> option.
**@⁠tarnobrzeg123-collab** on GitHub · 2026-11-25 03:57 UTC · [original](https://github.com/nineforge0/forge9/pull/14) `tarnobrzeg123-collab:feat/catalog-dict-export` → `main` · +138 −3 · 3 files · 1 commits · closed without merging Closes #12 ### Summary - Adds `merge_dict` and `write_dict` to `src/rpf9/hashes.rs` to merge `hexhash name` entries into an existing (or new) dictionary file, deduplicating by hash, preserving existing confirmed entries on conflict, and writing sorted `0x{:08x} name` lines (one per line). - Adds `--write-dict <PATH>` to `forge9 catalog` so confirmed candidates — unambiguous single-candidate joaat matches and embedded resource labels whose name (or stem before `.#`) hashes to the entry's name hash — accumulate across runs and archives. Ambiguous multi-candidate hashes are skipped and reported on stderr so `--json` stdout stays clean. - Documents the workflow in `README.md`. - Adds synthetic-data unit tests (`rpf9::hashes::tests::merge_dict_dedups_sorts_and_preserves_existing` and `tests::catalog_write_dict_accumulates_sorted_deduped_entries`) covering multi-run accumulation, reload via `--dict`, deduplication, sorting, and skipping ambiguous hashes. ### Testing - `cargo build --release` — succeeded with 0 warnings. - `cargo test --release` — all 66 tests pass (59 library + 7 binary), synthetic data only, no game files used. - `./target/release/forge9 catalog --help` — verified `--write-dict <PATH>` option.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:55:49 +00:00
github-bot closed this pull request 2026-11-26 20:55:49 +00:00
Author
Owner

@⁠nineforge0 on GitHub · 2026-11-25 04:31 UTC · original

Merged manually (resolved a conflict with the recent record-layout fix). The commits are on main. Thanks for the contribution!

**@⁠nineforge0** on GitHub · 2026-11-25 04:31 UTC · [original](https://github.com/nineforge0/forge9/pull/14#issuecomment-7152915244) Merged manually (resolved a conflict with the recent record-layout fix). The commits are on `main`. Thanks for the contribution!

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.