Why: - Implements plan 001 Phase 3's upload orchestration. Changes: - ObjectStorage port and MinIO adapter, thread-offloaded per ADR-0017. - Tenant-scoped repositories for api_keys, source_files, ingestion_jobs. - upload_source_file implementing the two-transaction shape with (tenant_id, domain, content_sha256) idempotency. Impact: - This phase stores bytes only -- chunks_indexed is always 0 until Phase 4/5 add parsing/embedding.
18 lines
470 B
Python
18 lines
470 B
Python
"""Upload-validation failures (ADR-0008). No HTTP knowledge here —
|
|
`src/api/errors.py` maps these to status codes.
|
|
"""
|
|
|
|
|
|
class FilesError(Exception):
|
|
"""Base class for file-upload failures."""
|
|
|
|
|
|
class InvalidUploadError(FilesError):
|
|
"""Missing domain, empty file, or content that doesn't match its
|
|
declared extension. Maps to `400`.
|
|
"""
|
|
|
|
|
|
class FileTooLargeError(FilesError):
|
|
"""The upload exceeds `INGESTION_MAX_UPLOAD_SIZE_MB`. Maps to `413`."""
|