Skip to content

app/: MCP upload_snapshots parses and decodes nothing in the app process (sc-8999) - #131

Merged
ndbroadbent merged 1 commit into
mainfrom
app-mcp-no-inprocess-fingerprints
Dec 3, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
app-mcp-no-inprocess-fingerprints

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #127 (sc-8999). MCP upload_snapshots fingerprinted every uploaded file in the app process, parsing customer PDFs with lopdf and decoding images there, though docs/design.md says customer PDFs are parsed only on the render node.

classify now works out only the kind, the content type and a text's SHA-256. Images and PDFs are registered by their hash alone through #127's sha256-only path:

  • an image's pixel fingerprint is computed in processing (processing::fill_image_fingerprints), outside any transaction;
  • a PDF is drawn under its file's hash and takes the fingerprint its renderer reports (document_fingerprint), or the blob's when it was drawn before.

Behaviour change: an image that can't be decoded used to fail the upload_snapshots call ("decoding the image"); now its snapshot fails in processing ("the image couldn't be read"), as with the CI API.

Tests

New app/tests/mcp_uploads.rs: an MCP upload of a PDF (deliberately one lopdf can't parse, so an in-app fingerprint would have been its SHA-256) and a PNG registers both with an empty fingerprint and no fingerprint on the PDF's blob. After finalize the image has its pixel fingerprint from processing. After the renderer draws the PDF and reports document_fingerprint, the snapshot and blob take that value and the build completes.

Gates on agents-build-1, rebased on main with #127: app cargo fmt --check, cargo clippy --locked --all-targets -- -D warnings, full cargo test --locked all pass; the MCP golden files are unchanged.

Shortcut: sc-8999


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…ess (sc-8999)

MCP's classify fingerprinted every uploaded file in the app process, PDFs included (lopdf on customer documents),
though docs/design.md says customer PDFs are parsed only on the render node. It now works out only the kind, the
content type and a text's SHA-256, and registers images and PDFs by their hash alone through #127's path: an image's
pixel fingerprint is computed in processing, and a PDF takes the fingerprint its renderer reports once it's drawn.
An undecodable image now fails its snapshot in processing ("the image couldn't be read") instead of failing the upload
call.
@ndbroadbent
ndbroadbent force-pushed the app-mcp-no-inprocess-fingerprints branch from f4c8b42 to 0c4f3ef Compare December 3, 2026 11:29
@ndbroadbent
ndbroadbent merged commit 24c4151 into main Dec 3, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the app-mcp-no-inprocess-fingerprints branch December 3, 2026 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant