Skip to content

Fix the restored-wording cache on Windows - #95

Merged
assassin808 merged 3 commits into
mainfrom
fix/original-text-windows-cache
Nov 10, 2026
Merged

assassin808 merged 3 commits into
mainfrom
fix/original-text-windows-cache

Conversation

@assassin808

Copy link
Copy Markdown
Contributor

Main has been red on Windows since #94 (run 42820806358). In test_original_text.py:137, the second fill was not answered from the cache.

Root cause. hs_original_text.py wrote the restored protocol.json with Path.write_text, which turns \n into \r\n on Windows. But it recorded the sha256 of the \n text, so the cached file never matched its own record. This affected more than the test:

  • every readiness check restored the study again;
  • the app's run (restoredProtocolText, which checks the file's sha256) would refuse the cached copy on Windows.

Fix. Write the exact bytes that are hashed, using write_bytes. status.json is written the same way. The test now also checks that the cached file's sha256 is the recorded one and that the file contains no \r\n.

Only this fix is in this PR. The review follow-ups come in a separate PR on top of it.

🤖 Generated with Claude Code

assassin808 and others added 3 commits November 10, 2026 06:16
The helper wrote the restored protocol.json with write_text, which on Windows turns
\n into \r\n, while it recorded the sha256 of the \n text. The cached copy then never
matched its record: every check restored again, and the app's run would refuse the copy.
Write the exact bytes that are hashed (status.json too), and test that the cached
file's sha256 is its recorded one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…h the platform separator

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t names), in the test and the pin lookup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@assassin808
assassin808 merged commit 9a49a8b into main Nov 10, 2026
2 checks passed
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