Repository navigation
Eval: check E2, saved files segment by segment - #15
Merged
Merged
Conversation
check_files.py parses each saved JPEG or PNG with a parser of its own and applies the protocol's E2 rule: no EXIF, XMP, IPTC or C2PA, no thumbnail, an ICC profile only if every file of the run has the same one, and nothing after the end of the image. Other segments are listed for the authors to judge. Part E of the protocol now gives the PNG equivalents of the rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An ICC profile now passes only if every file of the run carries the very same one, so a profile that only some saved files have (one taken from the input) fails too. PNG chunk CRCs are checked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
06pratyush
requested changes
Oct 28, 2026
06pratyush
left a comment
Collaborator
There was a problem hiding this comment.
Two fixes before this can merge, and one question. #2 to #14 are merged; this PR now sits on main.
- 12 of the 13 new tests fail on Windows (
79 passed, 12 failedforpytest eval/testshere).eval/tests/test_check_files.py:35indexes the report bye['file'].rsplit('/', 1)[-1], but on Windowsstr(path)uses backslashes, so every lookup ('plain.png','exif.jpg', …) raisesKeyError.Path(e['file']).namefixes it; the checker itself is fine. CI runs only the app's tests, which is why this didn't show up there. - The JFIF check lets extra bytes through.
jpeg_name()marks an APP0 JFIF segment clean when its thumbnail size bytes are 0, whatever the segment's length, so bytes appended inside the JFIF header pass E2. A clean JFIF header is exactly 14 bytes plus 3 per thumbnail pixel; failing any other length closes this. The privacy suite intests/checks it the same way. - Question. The description says three test images were saved through the deployed app, one of them stored turned, so they came from the Open Images draw. Part B says one author looks at every sampled image "before any detector runs on it", and
eval/manifest/review.csvis still empty. Were those three reviewed first? If not, please note it, and let's use synthetic images or our own photos for checks like this until the review is done.
🤖 Review written with Claude Code
The tests name files with Path(...).name, so they pass on Windows too. A JFIF segment now passes only at exactly the 14 bytes of a plain header; a longer one, where bytes could hide, or a shorter one fails. The AI-use row now says that the three images saved through the deployed app came from the draw before it was reviewed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
06pratyush
approved these changes
Oct 28, 2026
06pratyush
left a comment
Collaborator
There was a problem hiding this comment.
The fix does what I asked: the JFIF segment must now be exactly 14 bytes, and the new cases cover one with bytes after it (jfif-extra.jpg) and one cut short (jfif-short.jpg). The eval tests pass on Windows at the top of the stack (104, none skipped). Approving.
06pratyush
added a commit
that referenced
this pull request
Oct 28, 2026
Resolves the conflict in docs/ai-use.md, where both sides added a row: keeps both, Shashwat's row for check_files.py (#15, merged first) before this branch's. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
First of the privacy checks (protocol part E): E2, the structure of saved files. Stacked on #14, which is stacked on #13, #12, #10, #9 and #2; merge those first.
What is in it
eval/check_files.py FILES_OR_FOLDERS… [--out report.json]parses every saved JPEG and PNG with a parser of its own, independent of the app'sstripJpegand of the privacy suite's JPEG helper. It applies the protocol's E2 rule:For PNG, the same rule rules out eXIf, tEXt, zTXt, iTXt, tIME and caBX (C2PA) chunks and anything after IEND, and chunk CRCs are checked. Other segments (a comment, an Adobe or MPF segment) are listed for us to judge. A broken file fails without stopping the run, and the script exits with an error if any file fails. The report holds segment names and sizes, never pixels or metadata values.
13 tests on files made to carry each kind of hidden data (91 eval tests in total).
I saved three images from the draw through the deployed app on GitHub Pages in headless Chromium and checked the copies: all three pass, with segments JFIF, DQT, DQT, SOF0, DHT ×4, SOS, no ICC profile and nothing after the end.
After Pratyush's review
Path(...).name, so they pass on Windows (15 E2 tests, 93 eval tests).For both of us
tests/test-results/, would let us runcheck_files.pyon them in CI. That's your call, sincetests/is yours.E1 (exiftool on our own phone photos) needs
exiftool, which isn't installed on my machine yet. E3 (perceptual-hash distance) comes next.🤖 Generated with Claude Code