fix(tag-comparison): stop writing the disk tag-cache inside the sample corpus - #420
Merged
Merged
Conversation
…e_path's parent Both extractors wrote their on-disk cache to fixture_path.parent(), which resolves to the sample corpus itself whenever fixture_path is pointed at a vendor subdirectory (e.g. combined-samples/Olympus). This corrupted the read-only corpus in place on 2026-08-01. Introduce a shared resolve_cache_dir() helper (--tag-cache-dir CLI flag -> OXIDEX_TAG_CACHE_DIR env var -> a temp-dir location keyed by a hash of the canonicalized fixture path) that never inspects fixture_path's parent, and wire both extractors through it. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
swackhamer
force-pushed
the
claude/optimistic-williamson-44fff3
branch
from
August 2, 2026 08:48
cfb53d1 to
7cc07c4
Compare
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
OxiDexExtractor,ExifToolExtractor) derived their on-disk tag-cache directory fromfixture_path.parent(). That resolves to the sample corpus itself wheneverfixture_pathpoints at a vendor subdirectory (e.g.combined-samples/Olympus), and it corrupted the read-only corpus in place on 2026-08-01.extraction::cache_dir::resolve_cache_dir()helper that never inspectsfixture_path's parent. Priority:--tag-cache-dirCLI flag →OXIDEX_TAG_CACHE_DIRenv var → a temp-dir location keyed by an MD5 hash of the canonicalized fixture path.with_cache_dir_overridebuilder, fixed the stale comment referencing the old/tmp/oxidex-exiftool-cache/oxidex-tag-cache/gif.jsonpath, and added the flag tomain.rs.Test plan
.parent()-walk logic (confirmed it fails for the right reason), then verified green against the fix.oxidex_extractor.rsandexiftool_extractor.rs, each asserting the cache dir never lands under an observable fixture parent.cargo test --bin tag-comparison --features tag-comparison-binary— 71/71 passedcargo clippy --bin tag-comparison --features tag-comparison-binary -- -D warnings— cleancargo fmt --all/tmp/oxidex-exiftool-cache/combined-samplesis still exactly 4238 files with no*tag-cache*entries after the test run🤖 Generated with Claude Code