feat(backend): deliver Phase 3 document and voice integration

Add authenticated upload, review, retry and knowledge-selection HTTP flows with bounded JSON processing and frozen OCR policy.

Preserve Gemini/OpenAI provider selection and fenced lifecycle semantics; retain FAQ preambles and uncertain vision candidates, and expose opt-in uncalibrated voice transport diagnostics.

Include frontend integration examples, aligned contracts and deterministic regressions. Validation: 1767 provider-free tests passed; all 404 PostgreSQL scenarios have passing evidence across the documented runs.
This commit is contained in:
11linear11
2026-10-09 17:43:52 -04:00
parent 9be47191d6
commit a73a496c54
67 changed files with 5988 additions and 234 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
"""Trusted admin review services; HTTP authentication/Origin/CSRF is not implemented."""
"""Trusted admin review services; HTTP identity/Origin/CSRF is enforced by the API."""
import base64
import json
from uuid import UUID, uuid4
@@ -92,7 +92,7 @@ class SqlReviewRepository:
if after is not None:
matches = [i for i, p in enumerate(pointers) if p["evidence_sha256"] == after]
if not matches:
raise IntakeError("REVIEW_STALE", "Review cursor no longer available")
raise IntakeError("VALIDATION_ERROR", "Review cursor no longer available")
start = matches[0] + 1
from app.modules.documents.extraction_artifacts import bounded_json_size
remaining = document["processing_profile"]["extraction"]["max_extraction_artifact_bytes"]