Repository navigation
feat(documents): export a resource or a collection as an evidence PDF - #226
Merged
Merged
Conversation
GET /resources/{rid}/evidence.pdf and /collections/{cid}/evidence.pdf
download one PDF made by anytopdf: each resource's own file (audio and
video with Lens's transcript), searchable, then a provenance page with
every file's SHA-256 and size, with no server paths in it. Made here
(fetched on first use unless Settings > Documents says never) or on a
conversion node (one file as is, more as a zip). Nothing is kept. The
Export menu and a collection's page offer it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0157v73uDLUcBZAxEkB6zGc6
…-mbys3a # Conflicts: # CHANGELOG.md # fastapi_backend/app/domain/anytopdf.py # fastapi_backend/tests/fake_anytopdf.py
…nswers Closing on an unread upload could reset the connection before Lens read the answer, so the too-long check saw a reset instead. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0157v73uDLUcBZAxEkB6zGc6
…-mbys3a # Conflicts: # CHANGELOG.md # fastapi_backend/app/domain/anytopdf.py # fastapi_backend/tests/api/test_anytopdf.py # fastapi_backend/tests/fake_anytopdf.py
21 of 23 tasks
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.
Requested by Adeel · project thread
Description
Before: a resource could be exported only as its transcript text (txt, md, srt, vtt, json), and there was no way to hand on a set of files with proof of where each page came from.
After: a resource's Export menu has Evidence PDF, and a collection's page has an Evidence PDF button. Both download one PDF made by anytopdf: each resource's own file (a document or image as it is, audio or video with Lens's transcript and speaker names, a bare transcript as its text), searchable PDF/A-3 with its chunks embedded, ending in a provenance page with every file's SHA-256 and size. It uses anytopdf's
shareprofile, so no server paths appear in it.How:
GET /resources/{rid}/evidence.pdfandGET /collections/{cid}/evidence.pdf(at most 50 recordings; a fixed list keeps its order, a filter goes oldest first).evidence.pycopies plain working copies into a private temp folder underdata_dir/tmp, andanytopdf.evidenceconverts them in one run, passing Lens's transcripts with--transcript. On a conversion node, which takes one file per job, a single document is sent as it is and anything more goes as one zip, with media sent as its transcript only. anytopdf runs offline, with no plugins or config, exactly as conversions do. If it isn't installed it's fetched on first use, unless Settings › Documents says never to use it (503). Nothing is cached.Motivation and Context
Phase 4 of the anytopdf integration plan: "Export evidence PDF for a recording or project, which an agent can hand on with citations intact." Projects don't exist yet, so collections stand in for them.
Types of changes
!in the title)Checklist:
make hookschecks it on commit).tests/api/test_evidence.py, with a fake anytopdf here and on a node, plus a test against the real 0.4.0 binary that passed locally).docs/accordingly.## UnreleasedinCHANGELOG.md.To refine later: anytopdf's provenance page still prints the temp folder for audio sources and sidecars. Only a fix in anytopdf can remove it.
🤖 Generated with Claude Code
https://claude.ai/code/session_0157v73uDLUcBZAxEkB6zGc6
Generated by Claude Code