Rewrite upload_document() to use rag_platform sanitize + DocumentProcessor:
- File type whitelist validation (8 allowed types, reject .exe/.sh)
- File size limit (50MB) + zip bomb detection for ZIP-based formats
- DocumentProcessor.parse() (with content sanitization) + segment()
- Return chunks preview, status="segmenting" (pending vectorization)
Add POST /kb-management/documents/preview endpoint:
- Pre-upload preview with adjustable chunk_size/chunk_overlap
- Same security validation as upload, no document record created
Add POST /kb-management/documents/{id}/vectorize placeholder:
- Returns 503 — full async vectorization deferred to U8 (TaskIQ)
Test: update test_upload_document assertion (status "indexed" → "segmenting")
|
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_atomic_write.py | ||
| test_chat_team.py | ||
| test_event_queue_integration.py | ||
| test_evolution_dashboard.py | ||
| test_kb_management.py | ||
| test_portal_routes.py | ||
| test_portal_ws_background.py | ||
| test_settings_routes.py | ||
| test_skill_management.py | ||
| test_terminal_routes.py | ||
| test_workflow_routes.py | ||