Repository navigation
test: pin that drawImage caches by the path exactly as given - #72
Merged
Merged
Conversation
Every drawImage test passed str(path), leaving the cache-key semantics unguarded: a pathlib.Path is accepted and hits the cache for an equal Path, while different spellings of one file are separate entries. Pin both and document them in the docstring and README. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (performed inline in a headless dispatch; this is not an independent review):
Findings:
No blocking items. The PR is ready to merge. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage B (unit-test expansion) cycle for
drawImage's cache key. No production behavior is changed; the only edits tographik.pyare to its docstring.drawImagetest passedstr(path), so what the cache does with any other kind offilePathwas unguarded.test_draw_image_accepts_a_pathlib_path_and_caches_itpins that apathlib.Pathis accepted, draws correctly, and that a fresh but equalPathis served from the cache (one load).test_draw_image_caches_by_the_path_as_given_not_the_file_it_namespins that the key is the argument exactly as given, with no normalization:str(abs),Path(abs),"red.bmp"and"./red.bmp"naming one file are four entries, each loaded once and then cached.drawImagedocstring and the READMEdrawImagebullet now state both facts.Mutation check: with
filePath = str(filePath)inserted ahead of the cache lookup, both new tests fail. With it removed again, both pass.Skipped issues
Every open issue was deferred because each needs a maintainer decision or touches a path excluded from autonomous change:
.github/workflows/, which is excluded from autonomous change.Test plan
python3 -m py_compile src/main/python/preponderous/graphik/graphik.pypytest: 155 passed (153 before, plus 2 new), under the dummy SDL driver configured inconftest.pyNo tracking issue: this gap was found during triage.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson