Skip to content

feat(email): Slice 3 inline-media admission and tracking-pixel classification - #1397

Open
seonghobae wants to merge 4 commits into
developfrom
cursor/email-media-admission-slice3-c9de
Open

feat(email): Slice 3 inline-media admission and tracking-pixel classification#1397
seonghobae wants to merge 4 commits into
developfrom
cursor/email-media-admission-slice3-c9de

Conversation

@seonghobae

@seonghobae seonghobae commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Description

#1350 Slice 3 admission only (no OCR/VLM). This draft adds a deterministic, provider-free local admission contract so Naruon can resolve cid: images through the same message's multipart/related parts and refuse to treat a 1×1 beacon as document evidence.

Unresolved CID fails closed with unresolved_cid_reference. Remote http(s) images remain no-fetch; this slice does not add egress. Classification is the closed set tracking_pixel, unsupported_media, and document_image (screenshots/charts/scans share document_image here). Provenance returns source part index, Content-ID, SHA-256 of exact decoded source bytes, classification, and known / unknown evidence boundary.

Predecessor evidence: N/A and does not transfer. Previous head 51c003d701cce4eb0779ccbba96c499fb3e5379d was reconciled only onto stale develop@a81ac4f7cd18320ee550b4290308b57c0b33abbf. Exact new head 37b4af566d749028f7dc99545fff1db517d61d1a already contains live develop@dd8d15191338b841f9e6f3a06507c6a5643b95d0 via the existing normal merge Merge branch 'develop' into cursor/email-media-admission-slice3-c9de. No additional merge commit was created in this refresh. Predecessor-head tests, coverage, and review evidence do not transfer. #1376 already covers EmailMediaArtifact pixel-dimension extraction on a separate branch and is not copied or rewritten here. PNG IHDR / GIF logical-screen sizes are read only as the local tracking-pixel heuristic.

Refs #1350

Customer next action

After independent review, a buyer-visible mail/document pipeline can call admit_email_inline_media() before any OCR/VLM step. Send only document_image admissions downstream. Do not send tracking_pixel, unsupported_media, or unresolved_cid_reference outcomes to a model. Do not merge this draft until it is no longer Draft and a qualifying independent APPROVE exists on the unchanged head.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Exact-head verification

Previous head: 51c003d701cce4eb0779ccbba96c499fb3e5379d
Exact current head: 37b4af566d749028f7dc99545fff1db517d61d1a
Live develop SHA: dd8d15191338b841f9e6f3a06507c6a5643b95d0
Reconcile: already exact on current develop (gh confirmed baseRefOid=dd8d1519, headRefOid=37b4af56, develop is an ancestor). No new merge commit. Not a squash. Not a force-push of develop.

Focused product tests on this exact head (four fixture cases plus boundary coverage):

cd backend
PYTHONPATH=. PYTHONWARNINGS=error python3 -m pytest -c /dev/null --noconftest -p no:cacheprovider \
  tests/test_email_media_admission.py \
  tests/test_email_media_admission_boundaries.py -q
# 21 passed

Local count on 37b4af56: 21 passed. Predecessor-head counts do not transfer.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

Merge boundary

This PR must remain Draft. Merge is prohibited while Draft and prohibited without a qualifying independent non-author APPROVE on the unchanged head. Do not self-approve, mark Ready, squash-merge over a draft, or treat predecessor/stacked/#1376 evidence as this head's proof.

Open in Web Open in Cursor 

Open in Devin Review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@seonghobae, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a883bb1-2eff-44f0-9dbc-bddfbcdede92

📥 Commits

Reviewing files that changed from the base of the PR and between 81c1056 and 5a80583.

📒 Files selected for processing (10)
  • AGENTS.md
  • backend/services/email_media_admission.py
  • backend/tests/fixtures/email_media_admission/cid_related_document_image.eml
  • backend/tests/fixtures/email_media_admission/repeated_identical_base64.eml
  • backend/tests/fixtures/email_media_admission/tracking_pixel_1x1.eml
  • backend/tests/fixtures/email_media_admission/unresolved_cid.eml
  • backend/tests/test_email_media_admission.py
  • backend/tests/test_email_media_admission_boundaries.py
  • docs/architecture/image-content-detection.md
  • docs/doctoring/email-inline-media-admission.md

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cursor Bot pushed a commit that referenced this pull request Aug 17, 2026
Bring live develop@a81ac4f7 into #1397 so predecessor-head evidence
does not transfer. Keep the admission contract unchanged.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

PR governance metadata gate update for 5a80583bcabc22609e8677864ae86f867d85fd45: no current blocking failures remain.

PR governance metadata gate is ready; all current-head requirements passed.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

github-advanced-security[bot]

This comment was marked as resolved.

@seonghobae

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

Please review the unchanged exact current head 37b4af566d749028f7dc99545fff1db517d61d1a on live develop@dd8d1519. Predecessor 51c003d7 evidence does not transfer. Local admission tests: 21 passed. This comment is not an approval. Keep Draft.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

@seonghobae I will review exact head 37b4af566d749028f7dc99545fff1db517d61d1a against develop@dd8d1519. I will treat predecessor 51c003d7 evidence as non-transferable. The PR remains Draft.

⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

cursor Bot pushed a commit that referenced this pull request Aug 17, 2026
Normal merge of cursor/email-media-admission-slice3-c9de@37b4af56
into the wiring branch. Predecessor-head evidence does not transfer.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
cursor Bot pushed a commit that referenced this pull request Aug 17, 2026
Bring cursor/email-media-admission-wiring-cd1a @ 1af546d into
cursor/email-media-quarantine-persist-0ad6 so Draft #1399 stacks on the
live wiring head (itself stacked on #1397 @ 37b4af5 / develop@dd8d1519).

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@seonghobae
seonghobae marked this pull request as ready for review August 20, 2026 10:27
@seonghobae
seonghobae enabled auto-merge (squash) August 20, 2026 10:27
@seonghobae

Copy link
Copy Markdown
Contributor Author

The CodeQL alert comment references predecessor commit 37b4af566d749028f7dc99545fff1db517d61d1a; GitHub marks alert 449 as fixed and its current instance is not open. Current head is 40aef4788971b6e7a84f36598b266b5793a7c5e7. Requested branch refresh and fresh current-head review/Checks; no source change was justified by the stale alert.

@seonghobae

Copy link
Copy Markdown
Contributor Author

Current-head review note for 40aef47: the CodeQL alert points to an older commit where the test used an arbitrary substring check. The current head uses urlsplit(...).hostname == click.list-manage.com, and the production host matcher requires exact host or a dot-boundary suffix. CodeQL and Semgrep are successful on the current head; only the historical metadata-only gate failure remains. The protected scheduler should refresh exact-head evidence.

cursoragent and others added 4 commits August 20, 2026 20:26
Add four synthetic multipart/related .eml fixtures and failing
acceptance tests for CID resolution, unresolved CID fail-closed,
1x1 tracking-pixel exclusion, and repeated base64 hash provenance.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Resolve cid: against same-message multipart/related parts, fail closed
on unresolved CID, and classify tracking_pixel, unsupported_media, and
document_image from local header and dimension evidence only. No remote
fetch, OCR, or VLM.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
Add APA 7 RFC and email-tracking citations, state the no-fetch
admission boundary, and record the anti-pattern so 1x1 beacons are
not treated as document evidence.

Co-authored-by: Seongho Bae <seonghobae@users.noreply.github.com>
@seonghobae
seonghobae force-pushed the cursor/email-media-admission-slice3-c9de branch from 40aef47 to 5a80583 Compare August 21, 2026 03:26

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@opencode-agent opencode-agent Bot added priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability labels Aug 22, 2026
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Caution

Review failed

An error occurred during the review process. Please try again later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@opencode-agent
opencode-agent Bot disabled auto-merge August 31, 2026 06:42
@seonghobae seonghobae added the enhancement New feature or request label Sep 7, 2026 — with ChatGPT Codex Connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: medium Normal-priority or P2 work status: needs-review Open pull request requiring current-head review or checks type: feature New or expanded product capability

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants