Repository navigation
fix(transcript_cache): fingerprint equal-size in-place rewrites - #573
AshSgDe29071999 wants to merge 1 commit into
Conversation
Add a cheap head/tail content hash alongside size+mtime so an equal-length rewrite that preserves mtime no longer serves stale parsed records. Fixes #560
|
| Filename | Overview |
|---|---|
| tokenjam/core/transcript_cache.py | Adds fingerprint-based validation, but the new unguarded file read breaks tolerant handling of files disappearing during scans. |
| tests/unit/test_transcript_cache.py | Updates the storage helper invocation and adds focused coverage for equal-size, same-mtime rewrites. |
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 1
tokenjam/core/transcript_cache.py:109
**Fingerprint read escapes I/O handling**
When a transcript is deleted, replaced, or becomes unreadable after `stat()` succeeds, `_content_fingerprint` performs a separate unguarded open that raises `OSError`, causing the scan to fail instead of returning the documented empty result.
Reviews (1): Last reviewed commit: "fix(transcript_cache): fingerprint equal..." | Re-trigger Greptile
| except OSError: | ||
| return [] | ||
| size, mtime = st.st_size, st.st_mtime | ||
| fingerprint = _content_fingerprint(path, size) |
There was a problem hiding this comment.
Fingerprint read escapes I/O handling
When a transcript is deleted, replaced, or becomes unreadable after stat() succeeds, _content_fingerprint performs a separate unguarded open that raises OSError, causing the scan to fail instead of returning the documented empty result.
Prompt To Fix With AI
This is a comment left during a code review.
Path: tokenjam/core/transcript_cache.py
Line: 109
Comment:
**Fingerprint read escapes I/O handling**
When a transcript is deleted, replaced, or becomes unreadable after `stat()` succeeds, `_content_fingerprint` performs a separate unguarded open that raises `OSError`, causing the scan to fail instead of returning the documented empty result.
How can I resolve this? If you propose a fix, please make it concise.|
Thanks for this, and sorry to close it. Going with #572, which takes the same Two things decided it. The 64-byte window here means an equal-size, same-mtime The instinct was right and the diff was clean. If you'd like another, there are a |
Agentic contribution tools (Cursor background agents and similar) poll GitHub's search API on `is:open no:assignee label:"good first issue"` — they don't read claim comments. When 15 issues got both labels in one burst, two different tools opened PRs for the same issue within 50 minutes of each other because neither tool's feed reflected the other's claim (public PRs Metabuilder-Labs#572, Metabuilder-Labs#573 against the same issue Metabuilder-Labs#560). Removing the labels the instant a closing PR opens is the lever that actually keeps an issue off those feeds; a comment changes nothing they read. Labels are restored, and only the exact ones this workflow itself removed, if that PR is later closed without merging. Co-Authored-By: Claude Sonnet 5 <[email protected]>
Summary
(size, mtime)so equal-length in-place rewrites that preserve mtime invalidate the parse cache.Fixes #560
Test plan
pytest tests/unit/test_transcript_cache.py -qMade with Cursor