mirror of
https://github.com/azaion/detections.git
synced 2026-04-22 11:06:32 +00:00
[AZ-137] [AZ-138] Decompose test tasks and scaffold E2E test infrastructure
Made-with: Cursor
This commit is contained in:
@@ -85,6 +85,29 @@
|
||||
| Annotations Service | HTTP POST | Bearer JWT | None observed | Exception silently caught |
|
||||
| Annotations Auth | HTTP POST | Refresh token | None observed | Exception silently caught |
|
||||
|
||||
#### Annotations Service Contract
|
||||
|
||||
Detections → Annotations is the primary outbound integration. During async media detection (`POST /detect/{media_id}`), each detection batch is posted to the Annotations service for persistence and downstream sync.
|
||||
|
||||
**Endpoint:** `POST {ANNOTATIONS_URL}/annotations`
|
||||
|
||||
**Trigger:** Each valid annotation batch during F3 (async media detection), only when the original client request included an Authorization header.
|
||||
|
||||
**Payload sent by Detections:** `mediaId`, `source` (AI=0), `videoTime`, list of Detection objects (`centerX`, `centerY`, `width`, `height`, `classNum`, `label`, `confidence`), and optional base64 `image`. `userId` is not included — resolved from the JWT by Annotations. The Annotations API contract also accepts `description`, `affiliation`, and `combatReadiness` on each Detection, but Detections does not populate these.
|
||||
|
||||
**Responses:** 201 Created, 400 Bad Request (missing image/mediaId), 404 Not Found (unknown mediaId).
|
||||
|
||||
**Auth:** Bearer JWT forwarded from the client. For long-running video, auto-refreshed via `POST {ANNOTATIONS_URL}/auth/refresh` (TokenManager, 60s pre-expiry window).
|
||||
|
||||
**Downstream effect (Annotations side):**
|
||||
1. Annotation persisted to local PostgreSQL (image hashed to XxHash64 ID)
|
||||
2. SSE event published to UI subscribers
|
||||
3. Annotation ID enqueued to `annotations_queue_records` → FailsafeProducer → RabbitMQ Stream (`azaion-annotations`) for central DB sync and AI training
|
||||
|
||||
**Failure isolation:** All POST failures are silently caught. Detection processing and SSE streaming continue regardless of Annotations service availability.
|
||||
|
||||
See `_docs/02_document/modules/main.md` § "Annotations Service Integration" for field-level schema detail.
|
||||
|
||||
## 6. Non-Functional Requirements
|
||||
|
||||
| Requirement | Target | Measurement | Priority |
|
||||
|
||||
Reference in New Issue
Block a user