Goal
services/ai exposes POST /v1/extract (contract contracts/ai-service.openapi.yaml): docling parses PDF and EML into segments with locators, Gemini on Vertex eu extracts three header fields, and a deterministic verifier checks every quote.
Acceptance criteria
Not part of this task
- All fields and positions, XLSX/DOCX/MSG/scans, eval gate (Epic 2)
Affected areas
services/ai/
contracts/ai-service.openapi.yaml
Test plan
| Criterion |
Check |
| grounding verifier |
pytest unit tests incl. normalisation of numbers and dates |
| contract |
contract test against the OpenAPI schema |
| end to end |
pytest with a recorded model response at the HTTP boundary (synthetic mail) |
Security/Privacy affected?
Yes – document content reaches an external LLM: EU endpoint, synthetic data only, no content in logs. Prompt-injection case in the tests.
Epic: #2 · Architecture: docs/decisions/ADR-0001-pilot-architecture.md
Goal
services/aiexposesPOST /v1/extract(contractcontracts/ai-service.openapi.yaml): docling parses PDF and EML into segments with locators, Gemini on Vertexeuextracts three header fields, and a deterministic verifier checks every quote.Acceptance criteria
value | null,statusfound/uncertain/missing, evidence{segmentId, quote}for company, contact person, requested delivery dateunverifiedeuendpoint (ADR-0001 open points)Not part of this task
Affected areas
services/ai/contracts/ai-service.openapi.yamlTest plan
Security/Privacy affected?
Yes – document content reaches an external LLM: EU endpoint, synthetic data only, no content in logs. Prompt-injection case in the tests.
Epic: #2 · Architecture:
docs/decisions/ADR-0001-pilot-architecture.md