Commit Graph
6 Commits
Author SHA1 Message Date
Poorvith M PandGitHub 47a44e6ca8 feat: recursively inspect and clean embedded raster data URIs in SVGs, HTML, and Markdown (#87) (#88) 2026-08-16 14:13:08 -07:00
Poorvith M PandGitHub fcebf53358 feat: add native stdlib AVIF and HEIC metadata and C2PA stripping (#84) (#85) 2026-08-15 17:23:21 -07:00
Poorvith M PandGitHub c7200d20c2 feat: add zero-LLM statistical and stylometric AI text detector for CI and audits (#68) (#69) 2026-08-15 14:20:50 -07:00
28eca2d91f fix: markdown frontmatter cleaner crashes and leaks nested AI keys (#25)
clean_markdown() had two bugs in the same loop:

1. It crashed with IndexError on any frontmatter containing a blank
   line, because line[0] was evaluated on an empty string.
2. It kept the nested children of a dropped top-level key, so dropping
   `model:` left `name: claude-opus` behind and produced invalid YAML,
   while still reporting the key as removed.

Rewrite the loop with a `dropping` flag that tracks whether the current
top-level key was dropped, and guard blank/comment lines before
indexing. inspect_markdown() is unchanged (already guards line[0]).

Adds 4 regression tests: blank-line crash, nested-key leak, inspect
round-trip, and comment/list preservation.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Guillaume Meyer (The Opinionated Man) <1385518+guillaumemeyer@users.noreply.github.com>
2026-08-13 19:06:28 -07:00
58a958decd feat: preserve script joiners, flag emoji, and Arabic Cf marks in Layer A (#28)
Layer A already preserves emoji ZWJ/VS glue, but still stripped other
load-bearing invisibles, silently corrupting real text:

- ZWNJ/ZWJ inside complex scripts (Persian می‌روم, Devanagari क्‍ष)
- flag emoji tag sequences (🏴󠁧󠁢󠁳󠁣󠁴󠁿 -> 🏴)
- orthographic Arabic/Syriac Cf marks (U+0600, U+06DD, U+070F, ...)

Extend the existing _decide()/glue machinery: keep ZWNJ/ZWJ when a
neighbour is a complex-script letter, keep tag chars after an emoji
base, and allowlist the orthographic Cf codepoints. The same characters
between plain ASCII stay carriers and are still stripped.
--strip-emoji-glue continues to strip all of them (paranoid mode).

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Guillaume Meyer (The Opinionated Man) <1385518+guillaumemeyer@users.noreply.github.com>
2026-08-13 18:46:03 -07:00
ba42162b66 fix: --json no longer suppresses the residual-signal exit code (#30)
clean_file.py and clean_image.py computed the failure exit code inside
the human-output branch, so `--json` always exited 0 even when the clean
left C2PA/AI signals behind. A script gating on `clean_file --json` would
treat a still-marked file as clean.

Move the residual (and degraded-PDF) decision out of the output branch in
both entry points so the exit code is the same regardless of --json.
Human output is unchanged; degraded best-effort PDF copies stay
non-failures.

Adds tests asserting json and human modes return the same exit code for
residual, clean, and degraded cases.

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 18:44:42 -07:00