Skip to content

Quick bug bag: six independent small fixes (#29, #30, #31, #32, #33, #36)#49

Open
dbqpdb wants to merge 6 commits into
masterfrom
fix/quick-bug-bag
Open

Quick bug bag: six independent small fixes (#29, #30, #31, #32, #33, #36)#49
dbqpdb wants to merge 6 commits into
masterfrom
fix/quick-bug-bag

Conversation

@dbqpdb

@dbqpdb dbqpdb commented May 14, 2026

Copy link
Copy Markdown
Owner

Summary

Six independent small fixes from the bug bag, each in its own commit so they can be reviewed and reverted individually.

Test plan

  • TestRLM().run_all_tests() — all four tests pass.
  • test_entered_move_processing — now runs the assertion that previously was always-truthy; passes.
  • Verified no debug-dict output during normal move parsing.
  • (Manual) play a game to confirm clean gameplay output.

Known limitations / out of scope

🤖 Generated with Claude Code

dbqpdb and others added 6 commits May 14, 2026 16:34
The final clause compared self.new_en_passant_square to itself instead
of to move_to_match.new_en_passant_square, so two Move objects that
differed only in their generated en-passant square compared equal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The file contained only "import rlm.py" which is invalid Python (module
names don't include the .py extension). It had no main guard and was
unreferenced, so deleting rather than fixing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The Exception(...) was constructed but never raised, so setting an
invalid square name silently did nothing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
assert(cond, "msg") parses as a non-empty tuple, which is always truthy,
so the assertion passed regardless of the comparison. Rewrote as the
proper assert <cond>, <msg> form.

grep -nE 'assert\(' rlm.py found this as the only instance.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
setdefault mutates the dict when the key is missing, so any unrecognized
file character (typo'd square name, None, etc.) was being permanently
added to the class-level FILE_TO_IDX_DICT and persisting across every
Board instance for the life of the process.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The function unconditionally dumped a multi-line dict to the terminal
on every call, cluttering gameplay output every time a human entered a
move. Added verbose=False kwarg; existing callers default to quiet.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

1 participant