Skip to content

feat(B-0272): ROM canonical naming via TOSEC/No-Intro datfile lookup#2165

Merged
AceHack merged 2 commits into
mainfrom
claim/b0272-rom-canonical-naming-smallest-slice-2026-05-08
May 9, 2026
Merged

feat(B-0272): ROM canonical naming via TOSEC/No-Intro datfile lookup#2165
AceHack merged 2 commits into
mainfrom
claim/b0272-rom-canonical-naming-smallest-slice-2026-05-08

Conversation

@AceHack
Copy link
Copy Markdown
Member

@AceHack AceHack commented May 9, 2026

Summary

  • Add tools/roms/canonicalize.ts — smallest safe slice of B-0272 (child of B-0083)
  • Parses Logiqx XML datfiles (TOSEC / No-Intro format), hashes ROM files by SHA1, matches against the datfile, and reports canonical names with a dry-run/apply workflow
  • 13 tests covering datfile parsing, SHA1 hashing, directory scanning, match + rename behavior

Usage

# Dry-run: report matches without renaming
bun tools/roms/canonicalize.ts --datfile path/to/tosec.dat --dir roms/atari/2600/

# Apply: rename matched files to canonical names
bun tools/roms/canonicalize.ts --datfile path/to/tosec.dat --dir roms/atari/2600/ --apply

What's NOT in this slice

  • .zip extraction (files must be unzipped first)
  • Datfile download/pinning (user supplies the datfile path)
  • License classification (B-0273 scope)
  • Safe/unsafe folder split (B-0273 scope)

Test plan

  • bun test tools/roms/canonicalize.test.ts — 13 pass, 0 fail
  • dotnet build -c Release — 0 Warning(s), 0 Error(s)
  • bun run typecheck — clean

🤖 Generated with Claude Code

…-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>
Copilot AI review requested due to automatic review settings May 9, 2026 02:16
@AceHack AceHack enabled auto-merge (squash) May 9, 2026 02:18
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tools/roms/canonicalize.ts
Comment thread tools/roms/canonicalize.ts
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ts CLI 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.

Comment thread tools/roms/canonicalize.ts
Comment thread tools/roms/canonicalize.ts
Comment thread tools/roms/canonicalize.ts
Comment thread tools/roms/canonicalize.ts
Comment thread tools/roms/canonicalize.ts
Comment thread tools/roms/canonicalize.test.ts
Comment thread tools/roms/canonicalize.ts
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>
@AceHack AceHack merged commit 6298a23 into main May 9, 2026
26 checks passed
@AceHack AceHack deleted the claim/b0272-rom-canonical-naming-smallest-slice-2026-05-08 branch May 9, 2026 02:23
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread tools/roms/canonicalize.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants