8000 feat(documents): export a resource or a collection as an evidence PDF by adeelahmad · Pull Request #226 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(documents): export a resource or a collection as an evidence PDF - #226

Merged
adeelahmad merged 4 commits into
mainfrom
claude/project-thread-mbys3a
Oct 9, 2026
Merged

adeelahmad merged 4 commits into
mainfrom
claude/project-thread-mbys3a

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

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 share profile, so no server paths appear in it.

How: GET /resources/{rid}/evidence.pdf and GET /collections/{cid}/evidence.pdf (at most 50 recordings; a fixed list keeps its order, a filter goes oldest first). evidence.py copies plain working copies into a private temp folder under data_dir/tmp, and anytopdf.evidence converts 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

  • 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 change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests (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).
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.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

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
@adeelahmad adeelahmad self-assigned this Oct 7, 2026
claude added 3 commits October 7, 2026 12:21
…-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
@adeelahmad
adeelahmad merged commit 17a3a17 into main Oct 9, 2026
7 checks passed
@adeelahmad
adeelahmad deleted the claude/project-thread-mbys3a branch October 9, 2026 10:26
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.

2 participants

0