|
fix: code review critical and high issues
- tenacity+structlog: replace before_sleep_log with structlog-compatible lambda to prevent TypeError on retry - NormalizedProperty: filter AI response dict by allowed dataclass fields before unpacking to avoid TypeError on unknown keys - property_pipeline: remove duplicate update_status(failed) from _stage_normalize - security: add URL validator (SSRF protection) for ImageDownloader and archive-check - ai prompts: replace raw <user_data> tags with JSON-serialized payload to mitigate prompt injection - queue_worker: wrap _process_one in try/except so DB errors don't kill the loop - image processing: parallelize with asyncio.gather + Semaphore(3) - ai services: unify OllamaFatalError handling — all propagate instead of swallow - router_properties: catch only pydantic.ValidationError/ValueError in ingest, let infrastructure errors return 500 Co-Authored-By: Claude <noreply@anthropic.com> |
|---|
|
|
| src/vmk_data_collector/api/v1/router_properties.py |
|---|
| src/vmk_data_collector/core/circuit_breaker.py |
|---|
| src/vmk_data_collector/core/security.py 0 → 100644 |
|---|
| src/vmk_data_collector/services/ai_enricher.py |
|---|
| src/vmk_data_collector/services/ai_image_analyzer.py |
|---|
| src/vmk_data_collector/services/ai_normalizer.py |
|---|
| src/vmk_data_collector/services/image_downloader.py |
|---|
| src/vmk_data_collector/services/ollama_client.py |
|---|
| src/vmk_data_collector/services/property_pipeline.py |
|---|
| src/vmk_data_collector/services/queue_worker.py |
|---|
| tests/__init__.py 0 → 100644 |
|---|
| tests/conftest.py 0 → 100644 |
|---|
| tests/integration/__init__.py 0 → 100644 |
|---|
| tests/integration/test_api_ingest.py 0 → 100644 |
|---|
| tests/integration/test_health.py 0 → 100644 |
|---|
| tests/unit/__init__.py 0 → 100644 |
|---|
| tests/unit/test_ai_enricher.py 0 → 100644 |
|---|
| tests/unit/test_ai_image_analyzer.py 0 → 100644 |
|---|
| tests/unit/test_ai_normalizer.py 0 → 100644 |
|---|
| tests/unit/test_circuit_breaker.py 0 → 100644 |
|---|
| tests/unit/test_exceptions.py 0 → 100644 |
|---|
| tests/unit/test_image_downloader.py 0 → 100644 |
|---|
| tests/unit/test_ollama_client.py 0 → 100644 |
|---|
| tests/unit/test_property_pipeline.py 0 → 100644 |
|---|
| tests/unit/test_queue_worker.py 0 → 100644 |
|---|