mirror of
https://github.com/storytold/wordcraft.git
synced 2026-10-24 10:27:44 -06:00
CodeRabbit (#3252): installed_path() searched the filesystem unconditionally, so a dictionary given directly with install_dictionary (a user-picked one, or a test fixture) was reported as the file of a same-named dictionary that happened to also be installed, even though spelling was actually using the in-memory one, not that file. Added a DICT_IN_MEMORY flag to both modules, set in install_dictionary and cleared in reload_dictionary; installed_path() now returns None immediately when it's set, before even searching the filesystem. Tried adding a dedicated test that calls install_dictionary() and asserts installed_path() is None. It made dictionaries_folder_is_ searched_first flaky (~15-35% of runs across repeated local testing): ru's and cs's own test modules already call install_dictionary() directly in several tests of their own, sharing the same process-wide static, and dictionaries_folder_is_searched_first's exact-path assertion for Russian/Czech could observe whichever one last touched it. Reverted the dedicated test; the production fix alone never touches that shared state (it's a pure read-only check) and caused no flakiness by itself across 25 repeated runs. Instead, narrowed dictionaries_folder_is_searched_first's Russian/Czech assertion to the language only, not the exact path, since unlike the other four languages, installed_path() for these two is now sensitive to concurrently-running tests' legitimate in-memory installs. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>