feat(B-0272): ROM canonical naming via TOSEC/No-Intro datfile lookup#2165
Conversation
…-Intro datfile lookup Add tools/roms/canonicalize.ts: a Bun TS script that parses Logiqx XML datfiles (TOSEC / No-Intro format), hashes ROM files by SHA1, matches against the datfile, and reports canonical names. Dry-run by default; --apply flag renames files. 13 tests covering datfile parsing, SHA1 hashing, directory scanning, match reporting, and rename behavior. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 85e6b5e780
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
Pull request overview
Adds a Bun-based ROM canonicalization tool that hashes ROM files (SHA1), looks up matches in TOSEC/No-Intro Logiqx XML datfiles, and reports/optionally renames files to canonical names—supporting backlog item B-0272.
Changes:
- Introduce
tools/roms/canonicalize.tsCLI with datfile parsing, ROM scanning, SHA1 hashing, and dry-run/apply rename workflow. - Add Bun tests covering datfile parsing, hashing, scanning, matching, and rename behavior.
- Update the B-0272 backlog row with a pre-start checklist.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| tools/roms/canonicalize.ts | New CLI tool to match ROMs against Logiqx XML datfiles and optionally rename to canonical names. |
| tools/roms/canonicalize.test.ts | Test coverage for parsing/hashing/scanning/match+rename behavior. |
| docs/backlog/P1/B-0272-atari-rom-canonical-naming-tosec-lookup-2026-05-08.md | Backlog row updated with pre-start checklist details. |
Decode XML entities in Logiqx ROM names before reporting or applying canonical filenames, and skip unsafe DAT-provided names that contain path separators before constructing rename targets. Focused checks: bun test tools/roms/canonicalize.test.ts; git diff --check. Local typecheck blocked because tsc is not installed in this worktree. Co-Authored-By: Codex <noreply@openai.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 98341db54e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
tools/roms/canonicalize.ts— smallest safe slice of B-0272 (child of B-0083)Usage
What's NOT in this slice
.zipextraction (files must be unzipped first)Test plan
bun test tools/roms/canonicalize.test.ts— 13 pass, 0 faildotnet build -c Release— 0 Warning(s), 0 Error(s)bun run typecheck— clean🤖 Generated with Claude Code