Audit and clean up TODOs in vendored nes-rust emulator (Rust)
Session from pi-nes-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk
48msession
1interventions
GOAL
Inventory all @TODO comments in the codebase, assess whether they still made sense from an 8-year-old vendored dependency, and set up a fork to own fixes to that vendored code.
- +0Prompt · +0Inventory the @TODOs in the codebase and review each to see if needed, write findings to a .md
- +0mAgent did · +0mSearched the repo for TODO markers, read through cpu.rs, ppu.rs, apu.rs, register.rs, mapper.rs, rom.rs in the vendored nes_rust crate, and wrote TODO_INVENTORY.md summarizing each TODO with an assessment.
- +7mPrompt · +7mWhat are the urls for the vendored gh repos? Are they actively maintained?
- +7mAgent did · +7mFound the vendored nes_rust crate points to github.com/takahirox/nes-rust, checked its GitHub API metadata, and reported it looked inactive (last push 2020-08-28).
- +9mPrompt · +9mSince the vendor looks abandoned, fork it on GitHub under tmustier and set it up as the maintained copy
- +9mAgent did · +9mCreated VENDOR.md documenting the fork plan, updated README with a Vendored Dependencies section, and added scripts/update-vendor-nes-rust.sh to sync from the fork.
- +22mPrompt · +22mThese TODOs were added by the upstream author 8 years ago, not us — critically review whether they even still make sense
- +24mAgent did · +24mReviewed each TODO for validity against actual NES hardware behavior, flagged several as stale or wrong (e.g. 'throw error on invalid register' is incorrect since hardware ignores invalid writes), and marked each as Delete or Change in TODO_INVENTORY.md.
- +28mAgent did · +28mMirrored the delete/change decisions into the vendored TODO_INVENTORY.md, edited apu.rs, ppu.rs, cpu.rs, lib.rs to remove or rewrite stale TODOs (invalid-register no-ops, greyscale comment, master/slave note, unreachable button mapping, illegal opcode handling), then committed and pushed the changes.
- +46mIntervention · +46mDeveloper noticed two duplicate TODO_INVENTORY.md files (root and vendor) and asked to just keep the vendor one, then had the agent delete the root copy.Why: We ended up with a duplicate inventory file in two places — I wanted a single source of truth in the vendor directory, not two copies to keep in sync.
- +48mOutcome · +48mRoot TODO_INVENTORY.md deleted, vendored inventory kept as sole source; 2 commits pushed to main (chore(nes-rust): clean stale todos, chore: drop root todo inventory).
VERDICT
Next time I'd start by asking the agent to check TODOs critically against actual hardware behavior rather than just listing them, since a chunk of the upstream TODOs turned out to be wrong or stale. The correction that mattered most was catching the duplicate TODO_INVENTORY.md files at the end — the agent happily maintained two copies until I pointed out we only needed one, in the vendor directory.