Commit History
27 days ago
-
feat(documents): v2 unstructured ingestion, image-token, scoped retrieval
Rifqi Hafizuddin +1: Claude Opus 5.5UNSTRUCTURED_V2_PLAN U1-U5 + the U7 planner-catalog change. - /api/v2/document*: doctypes, upload, process, list for pdf/docx/txt, mirroring Go's shapes; delete stays on Go (U-D7). Parsing v2 (Mistral OCR) -> figures to the private Supabase bucket -> embeddings in the existing `documents` collection tagged parser_version=v2. - POST /api/v2/document/image-token: 1h presigned URLs for asset:// markers, bound-document + owner + key-prefix checks, never persisted. - Retrieval is v2-only and analysis-scoped in SQL (no scope row -> none); scope is part of the Redis key. retrieve_knowledge pushes its scope down, drops a source_id post-filter that never matched, and whitelists metadata. - structured_flow adds the analysis's bound documents to the planner catalog. Live: BUMA PDF -> 28 chunks, 2 figures; figure signed and fetched (200 image/jpeg). Suite 939 passed / 7 skipped; ruff adds nothing; import main OK. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>b848f73