Module 5 phase 1 (docs/kb/modules/05-documents-ingest.md): pulls a sample of PDF attachments (>50KB, last year, LIMIT 150) out of the Gmail .eml archive and drops them into Paperless consume/ for OCR, so the RAG layer has real documents to work with before the full Paperless/Nextcloud envelope adapter is built. sha256-first attachment matching (manifest filenames can carry raw RFC 2047 encoded-word artifacts that don't byte-match what email.policy.default decodes today — confirmed against live data, ~10% of candidates were affected). Idempotent via a sha256-keyed JSON registry; dry-run by default, --apply to write. Verified end-to-end on PIHA: dry-run + --apply both run against live kb-postgres/archive, 185/222 candidate PDFs written to consume/ (37 in-run duplicates correctly deduped), Paperless picked them up and started OCR immediately.
0 lines
Python
0 lines
Python