chat_image: test that fails if the take(MAX+1) read bound is removed #12

Merged
eureka merged 1 commit from eureka/chat-image-read-bound into main 2026-11-08 09:36:07 +00:00
Owner

Follow-up to #11 (Heimdall review). The read bound was unreachable by tests: load() refuses an over-cap file on its length first. Extracts read_bounded and pins it: a file grown past the cap reads exactly MAX_BYTES+1 bytes. Verified by mutation: removing .take(MAX_BYTES + 1) fails the new test; restored it passes (16 chat_image tests).

🤖 Generated with Claude Code

Follow-up to #11 (Heimdall review). The read bound was unreachable by tests: load() refuses an over-cap file on its length first. Extracts `read_bounded` and pins it: a file grown past the cap reads exactly MAX_BYTES+1 bytes. Verified by mutation: removing `.take(MAX_BYTES + 1)` fails the new test; restored it passes (16 chat_image tests). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
load() refuses an over-cap file on its length first, so the take(MAX_BYTES + 1) on the read was
reachable only by a file that grew after that check and no test could see it. read_bounded holds the
read; its test grows a file past the cap and requires the read to stop at MAX_BYTES + 1.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
eureka merged commit 8c85ee4455 into main 2026-11-08 09:36:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Huginn!12
No description provided.