mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 09:06:31 +00:00
[AZ-172] Complete distributed architecture implementation — update reports and state
Made-with: Cursor
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
# Dependencies Table
|
# Dependencies Table
|
||||||
|
|
||||||
**Date**: 2026-03-31
|
**Date**: 2026-03-31
|
||||||
**Total Tasks**: 15 (11 done + 4 new)
|
**Total Tasks**: 15 (11 test + 4 feature — all done)
|
||||||
**Total Complexity Points**: 43
|
**Total Complexity Points**: 43
|
||||||
|
|
||||||
## Completed Tasks (Steps 4-6)
|
## Completed Tasks (Steps 4-6: Tests)
|
||||||
|
|
||||||
| Task | Name | Complexity | Dependencies | Epic | Status |
|
| Task | Name | Complexity | Dependencies | Epic | Status |
|
||||||
|------|------|-----------|-------------|------|--------|
|
|------|------|-----------|-------------|------|--------|
|
||||||
@@ -20,25 +20,11 @@
|
|||||||
| AZ-147 | test_security | 2 | AZ-138 | AZ-137 | done |
|
| AZ-147 | test_security | 2 | AZ-138 | AZ-137 | done |
|
||||||
| AZ-148 | test_resource_limits | 3 | AZ-138, AZ-142 | AZ-137 | done |
|
| AZ-148 | test_resource_limits | 3 | AZ-138, AZ-142 | AZ-137 | done |
|
||||||
|
|
||||||
## New Tasks (Step 8 — Distributed Architecture)
|
## Completed Tasks (Step 9: Distributed Architecture)
|
||||||
|
|
||||||
| Task | Name | Complexity | Dependencies | Epic | Status |
|
| Task | Name | Complexity | Dependencies | Epic | Status |
|
||||||
|------|------|-----------|-------------|------|--------|
|
|------|------|-----------|-------------|------|--------|
|
||||||
| AZ-173 | stream_based_run_detect | 3 | None | AZ-172 | todo |
|
| AZ-173 | stream_based_run_detect | 3 | None | AZ-172 | done |
|
||||||
| AZ-174 | db_driven_ai_config | 2 | None | AZ-172 | todo |
|
| AZ-174 | db_driven_ai_config | 2 | None | AZ-172 | done |
|
||||||
| AZ-175 | media_table_integration | 2 | AZ-173 | AZ-172 | todo |
|
| AZ-175 | media_table_integration | 2 | AZ-173 | AZ-172 | done |
|
||||||
| AZ-176 | cleanup_obsolete_path_code | 1 | AZ-173, AZ-174 | AZ-172 | todo |
|
| AZ-176 | cleanup_obsolete_path_code | 1 | AZ-173, AZ-174 | AZ-172 | done |
|
||||||
|
|
||||||
## Execution Order (New Tasks)
|
|
||||||
|
|
||||||
**Batch 1** (no internal dependencies):
|
|
||||||
- AZ-173: stream_based_run_detect (3 pts) — PyAV byte-stream decoding
|
|
||||||
- AZ-174: db_driven_ai_config (2 pts) — fetch config from annotations service
|
|
||||||
|
|
||||||
**Batch 2** (depends on AZ-173):
|
|
||||||
- AZ-175: media_table_integration (2 pts) — Media record lifecycle
|
|
||||||
|
|
||||||
**Batch 3** (depends on AZ-173 + AZ-174):
|
|
||||||
- AZ-176: cleanup_obsolete_path_code (1 pt) — remove old path-based code
|
|
||||||
|
|
||||||
**New tasks total**: 4 tasks, 8 complexity points, 3 batches
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Batch Report
|
||||||
|
|
||||||
|
**Batch**: 7 (Feature Batch 3)
|
||||||
|
**Tasks**: AZ-176
|
||||||
|
**Date**: 2026-03-31
|
||||||
|
|
||||||
|
## Task Results
|
||||||
|
|
||||||
|
| Task | Status | Files Modified | Tests | AC Coverage | Issues |
|
||||||
|
|------|--------|---------------|-------|-------------|--------|
|
||||||
|
| AZ-176_cleanup_obsolete_path_code | Done | 1 file | 14/14 unit pass | 5/5 ACs covered | None |
|
||||||
|
|
||||||
|
## AC Test Coverage: All covered
|
||||||
|
## Code Review Verdict: PASS
|
||||||
|
## Auto-Fix Attempts: 0
|
||||||
|
## Stuck Agents: None
|
||||||
|
|
||||||
|
## Commit: 9411103
|
||||||
|
|
||||||
|
## Next Batch: All tasks complete
|
||||||
@@ -0,0 +1,65 @@
|
|||||||
|
# Final Implementation Report — Distributed Architecture
|
||||||
|
|
||||||
|
**Date**: 2026-03-31
|
||||||
|
**Epic**: AZ-172 (Distributed Architecture Adaptation)
|
||||||
|
**Tasks**: 4 implemented, 0 blocked
|
||||||
|
|
||||||
|
## Summary
|
||||||
|
|
||||||
|
All 4 tasks from the distributed architecture epic have been successfully implemented across 3 batches. The detection service now operates in a distributed architecture where media is received as byte streams rather than local file paths, AI configuration is fetched from the database via the annotations service, and media records are managed with proper status lifecycle tracking.
|
||||||
|
|
||||||
|
## Batch Summary
|
||||||
|
|
||||||
|
| Batch | Tasks | Complexity | Verdict | Commit |
|
||||||
|
|-------|-------|-----------|---------|--------|
|
||||||
|
| 1 (sequential) | AZ-173, AZ-174 | 5 pts | PASS_WITH_WARNINGS | 6c24d09 |
|
||||||
|
| 2 | AZ-175 | 2 pts | PASS_WITH_WARNINGS | 40be55a |
|
||||||
|
| 3 | AZ-176 | 1 pt | PASS | 9411103 |
|
||||||
|
|
||||||
|
**Total**: 8 complexity points, 3 batches, 0 blockers
|
||||||
|
|
||||||
|
## Key Changes
|
||||||
|
|
||||||
|
### AZ-173: Stream-Based Detection API
|
||||||
|
- New `run_detect_video` and `run_detect_image` methods accept bytes instead of file paths
|
||||||
|
- PyAV library for video stream decoding from memory buffers
|
||||||
|
- Simultaneous disk write and frame processing via background thread
|
||||||
|
- Image decoding via `cv2.imdecode` from bytes buffer
|
||||||
|
|
||||||
|
### AZ-174: DB-Driven AI Configuration
|
||||||
|
- `AIRecognitionConfig.paths` field removed
|
||||||
|
- Configuration fetched from annotations service `GET /api/users/{userId}/ai-settings`
|
||||||
|
- JWT userId extraction via `TokenManager.decode_user_id`
|
||||||
|
- Multi-format field name mapping (snake_case, camelCase, PascalCase)
|
||||||
|
- Fallback to sensible defaults if service unreachable
|
||||||
|
|
||||||
|
### AZ-175: Media Table Integration
|
||||||
|
- XxHash64 content hashing with sampling algorithm
|
||||||
|
- Media record creation via annotations service `POST /api/media`
|
||||||
|
- Persistent file storage at configurable directories
|
||||||
|
- MediaStatus lifecycle: New(1) → AIProcessing(2) → AIProcessed(3) / Error(6)
|
||||||
|
|
||||||
|
### AZ-176: Cleanup Obsolete Path-Based Code
|
||||||
|
- Removed `is_video`, `run_detect`, `_process_video` (cv2.VideoCapture), `_process_images` (cv2.imread)
|
||||||
|
- Cleaned up dead imports (mimetypes, pathlib.Path)
|
||||||
|
|
||||||
|
## Test Results
|
||||||
|
|
||||||
|
- Unit tests: 14/14 passed
|
||||||
|
- New dependencies: `av==14.2.0`, `xxhash==3.5.0`
|
||||||
|
|
||||||
|
## Files Modified
|
||||||
|
|
||||||
|
| File | Changes |
|
||||||
|
|------|---------|
|
||||||
|
| `src/inference.pyx` | Stream-based methods, removed path-based methods |
|
||||||
|
| `src/main.py` | Media lifecycle, DB config, upload handling |
|
||||||
|
| `src/ai_config.pxd` | Removed `paths` field |
|
||||||
|
| `src/ai_config.pyx` | Removed `paths` from init/from_dict |
|
||||||
|
| `src/loader_http_client.pyx` | `fetch_user_ai_settings`, `fetch_media_path` |
|
||||||
|
| `src/loader_http_client.pxd` | Method declarations |
|
||||||
|
| `src/media_hash.py` | New — XxHash64 content hashing |
|
||||||
|
| `requirements.txt` | Added `av`, `xxhash` |
|
||||||
|
| `e2e/mocks/annotations/app.py` | New mock endpoints |
|
||||||
|
| `e2e/tests/test_async_sse.py` | Adapted for new API |
|
||||||
|
| `e2e/tests/test_video.py` | Adapted for new API |
|
||||||
@@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
## Current Step
|
## Current Step
|
||||||
flow: existing-code
|
flow: existing-code
|
||||||
step: 9
|
step: 10
|
||||||
name: Implement
|
name: Run Tests
|
||||||
status: in_progress
|
status: not_started
|
||||||
sub_step: 0
|
sub_step: 0
|
||||||
retry_count: 0
|
retry_count: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user