Commit Graph

31 Commits

Author SHA1 Message Date
Oleksandr Bezdieniezhnykh 8116b55813 [AZ-180] Refactor inference and engine factory for improved model handling
- Updated the autopilot state to reflect the current task status as in progress.
- Refactored the inference module to streamline model downloading and conversion processes, replacing the download_model method with a more efficient load_source method.
- Introduced asynchronous model building in the inference module to enhance performance during model conversion.
- Enhanced the engine factory to include a new method for building and caching models, improving error handling and logging during the upload process.
- Added calibration cache handling in the Jetson TensorRT engine for better resource management.

Made-with: Cursor
2026-04-03 06:41:11 +03:00
Oleksandr Bezdieniezhnykh 2c35e59a77 [AZ-180] Update Jetson deployment documentation and remove obsolete task file
- Added Jetson-specific deployment instructions to `deploy_scripts.md`, detailing prerequisites and service management.
- Updated `deploy_status_report.md` to reflect the completion of the AZ-180 cycle and the readiness of Jetson support.
- Removed outdated task documentation for Jetson Orin Nano support from the todo list.

Made-with: Cursor
2026-04-02 16:58:57 +03:00
Oleksandr Bezdieniezhnykh 7a7f2a4cdd [AZ-180] Update module and component docs for Jetson/INT8 changes
Made-with: Cursor
2026-04-02 07:25:22 +03:00
Oleksandr Bezdieniezhnykh 2149cd6c08 [AZ-180] Add Jetson Orin Nano support with INT8 TensorRT engine
- Dockerfile.jetson: JetPack 6.x L4T base image (aarch64), TensorRT and PyCUDA from apt
- requirements-jetson.txt: derived from requirements.txt, no pip tensorrt/pycuda
- docker-compose.jetson.yml: runtime: nvidia for NVIDIA Container Runtime
- tensorrt_engine.pyx: convert_from_source accepts optional calib_cache_path; INT8 used when cache present, FP16 fallback; get_engine_filename encodes precision suffix to avoid engine cache confusion
- inference.pyx: init_ai tries INT8 engine then FP16 on lookup; downloads calibration cache before conversion thread; passes cache path through to convert_from_source
- constants_inf: add INT8_CALIB_CACHE_FILE constant
- Unit tests for AC-3 (INT8 flag set when cache provided) and AC-4 (FP16 when no cache)

Made-with: Cursor
2026-04-02 07:12:45 +03:00
Oleksandr Bezdieniezhnykh 097811a67b [AZ-178] Fix Critical/High security findings: auth, CVEs, non-root containers, per-job SSE
- Pin all deps; h11==0.16.0 (CVE-2025-43859), python-multipart>=1.3.1 (CVE-2026-28356), PyJWT==2.12.1
- Add HMAC JWT verification (require_auth FastAPI dependency, JWT_SECRET-gated)
- Fix TokenManager._refresh() to use ADMIN_API_URL instead of ANNOTATIONS_URL
- Rename POST /detect → POST /detect/image (image-only, rejects video files)
- Replace global SSE stream with per-job SSE: GET /detect/{media_id} with event replay buffer
- Apply require_auth to all 4 protected endpoints
- Fix on_annotation/on_status closure to use mutable current_id for correct post-upload event routing
- Add non-root appuser to Dockerfile and Dockerfile.gpu
- Add JWT_SECRET to e2e/docker-compose.test.yml and run-tests.sh
- Update all e2e tests and unit tests for new endpoints and HMAC token signing
- 64/64 tests pass

Made-with: Cursor
2026-04-02 06:32:12 +03:00
Oleksandr Bezdieniezhnykh dac350cbc5 [AZ-178] Update autopilot state and deployment status report
- Update autopilot state to step 14 (Deploy) with status in progress.
- Mark step 12 (Security Audit) and step 13 (Performance Test) as skipped due to previous cycle completion.
- Update deployment status report date to 2026-04-01 and add notes on the implementation and testing of the `POST /detect/video` endpoint.
- Emphasize the need to address security findings before production deployment.

Made-with: Cursor
2026-04-01 05:10:29 +03:00
Oleksandr Bezdieniezhnykh 07c2afb62e [AZ-178] Add real-video streaming test, update e2e tests, mark task done
- Add tests/test_az178_realvideo_streaming.py: integration test that validates
  frame decoding begins while upload is still in progress using a real video fixture
- Add conftest.py: pytest plugin for per-test duration reporting
- Update e2e tests (async_sse, performance, security, streaming_video_upload, video)
  and run-tests.sh for updated test suite
- Move AZ-178 task to done/; add data/ to .gitignore (StreamingBuffer temp files)
- Update autopilot state to step 12 (Security Audit) for new feature cycle

Made-with: Cursor
2026-04-01 05:02:25 +03:00
Oleksandr Bezdieniezhnykh be4cab4fcb [AZ-178] Implement streaming video detection endpoint
- Added `/detect/video` endpoint for true streaming video detection, allowing inference to start as upload bytes arrive.
- Introduced `run_detect_video_stream` method in the inference module to handle video processing from a file-like object.
- Updated media hashing to include a new function for computing hashes directly from files with minimal I/O.
- Enhanced documentation to reflect changes in video processing and API behavior.

Made-with: Cursor
2026-04-01 03:11:43 +03:00
Oleksandr Bezdieniezhnykh e65d8da6a3 [AZ-177] Remove redundant synchronous video pre-writes in /detect endpoint
Made-with: Cursor
2026-04-01 01:12:05 +03:00
Oleksandr Bezdieniezhnykh 1fe9425aa8 [AZ-172] Update documentation for distributed architecture, add Update Docs step to workflow
- Update module docs: main, inference, ai_config, loader_http_client
- Add new module doc: media_hash
- Update component docs: inference_pipeline, api
- Update system-flows (F2, F3) and data_parameters
- Add Task Mode to document skill for incremental doc updates
- Insert Step 11 (Update Docs) in existing-code flow, renumber 11-13 to 12-14

Made-with: Cursor
2026-03-31 17:25:58 +03:00
Oleksandr Bezdieniezhnykh e29606c313 [AZ-172] Mark Step 10 (Run Tests) as done — 42/42 tests passing
Made-with: Cursor
2026-03-31 06:46:44 +03:00
Oleksandr Bezdieniezhnykh da32c2e6bd [AZ-172] Complete distributed architecture implementation — update reports and state
Made-with: Cursor
2026-03-31 06:40:31 +03:00
Oleksandr Bezdieniezhnykh 9411103041 [AZ-176] Remove obsolete path-based detection code from inference pipeline
Made-with: Cursor
2026-03-31 06:39:19 +03:00
Oleksandr Bezdieniezhnykh 40be55ac03 [AZ-175] Media table integration with XxHash64 content hashing and status lifecycle
Made-with: Cursor
2026-03-31 06:36:56 +03:00
Oleksandr Bezdieniezhnykh 6c24d09eab [AZ-173] [AZ-174] Stream-based detection API and DB-driven AI config
Made-with: Cursor
2026-03-31 06:30:22 +03:00
Oleksandr Bezdieniezhnykh 6547c5903a Update autopilot state and dependencies table for architecture shift
- Changed the current step from "Refactor" to "Implement" in the autopilot state, indicating a transition to the next phase of development.
- Updated the dependencies table to reflect the completion of 11 tasks and the addition of 4 new tasks related to the distributed architecture.
- Removed outdated task documentation for AZ-173, AZ-174, AZ-175, and AZ-176 as they are now obsolete following the architectural changes.
- Enhanced the execution order for new tasks, organizing them into batches based on dependencies.

These updates aim to align the project documentation with the current development phase and improve clarity on task management moving forward.
2026-03-31 06:08:44 +03:00
Oleksandr Bezdieniezhnykh 8ce40a9385 Add AIAvailabilityStatus and AIRecognitionConfig classes for AI model management
- Introduced `AIAvailabilityStatus` class to manage the availability status of AI models, including methods for setting status and logging messages.
- Added `AIRecognitionConfig` class to encapsulate configuration parameters for AI recognition, with a static method for creating instances from dictionaries.
- Implemented enums for AI availability states to enhance clarity and maintainability.
- Updated related Cython files to support the new classes and ensure proper type handling.

These changes aim to improve the structure and functionality of the AI model management system, facilitating better status tracking and configuration handling.
2026-03-31 05:49:51 +03:00
Oleksandr Bezdieniezhnykh 86b8f076b7 Update health endpoint and refine test documentation
- Modified the health endpoint to return "None" for AI availability when inference is not initialized, improving clarity on system status.
- Enhanced the test documentation to include handling of skipped tests, emphasizing the need for investigation before proceeding.
- Updated test assertions to ensure proper execution order and prevent premature engine initialization.
- Refactored test cases to streamline performance testing and improve readability, removing unnecessary complexity.

These changes aim to enhance the robustness of the health check and improve the overall testing framework.
2026-03-30 01:17:53 +03:00
Oleksandr Bezdieniezhnykh 5a968edcba Update .gitignore and refine documentation for execution environment
- Added Cython generated files to .gitignore to prevent unnecessary tracking.
- Updated paths in `inference.c` and `coreml_engine.c` to reflect the correct virtual environment.
- Revised the execution environment documentation to clarify hardware dependency checks and local execution instructions, ensuring accurate guidance for users.
- Removed outdated Docker suitability checks and streamlined the assessment process for test execution environments.
2026-03-30 00:53:46 +03:00
Oleksandr Bezdieniezhnykh 27f4aceb52 Refactor inference and AI configuration handling
- Updated the `Inference` class to replace the `get_onnx_engine_bytes` method with `download_model`, allowing for dynamic model loading based on a specified filename.
- Modified the `convert_and_upload_model` method to accept `source_bytes` instead of `onnx_engine_bytes`, enhancing flexibility in model conversion.
- Introduced a new property `engine_name` to the `Inference` class for better access to engine details.
- Adjusted the `AIRecognitionConfig` structure to include a new method pointer `from_dict`, improving configuration handling.
- Updated various test cases to reflect changes in model paths and timeout settings, ensuring consistency and reliability in testing.
2026-03-30 00:22:56 +03:00
Oleksandr Bezdieniezhnykh 6269a7485c fix some cython code 2026-03-29 21:18:18 +03:00
Oleksandr Bezdieniezhnykh 5be53739cd Refactor inference engine and task management: Remove obsolete inference engine and ONNX engine files, update inference processing to utilize batch handling, and enhance task management structure in documentation. Adjust paths for task specifications to align with new directory organization. 2026-03-28 01:04:28 +02:00
Oleksandr Bezdieniezhnykh 4afa1a4eec Refactor autopilot workflows and documentation: Update .gitignore to include binary and media file types, enhance agent command references in documentation, and modify annotation class for improved accessibility. Adjust inference processing to handle batch sizes and streamline test specifications for clarity and consistency across the system. 2026-03-25 05:26:19 +02:00
Oleksandr Bezdieniezhnykh e609586c7c Refactor testing framework to replace integration tests with blackbox tests across various skills and documentation. Update related workflows, templates, and task specifications to align with the new blackbox testing approach. Remove obsolete integration test files and enhance clarity in task management and reporting structures. 2026-03-24 03:38:36 +02:00
Oleksandr Bezdieniezhnykh ae3ad50b9e [AZ-137] Update autopilot state — Implement Tests complete, Refactor next
Made-with: Cursor
2026-03-23 22:36:12 +02:00
Oleksandr Bezdieniezhnykh f0e3737665 [AZ-137] Complete integration test implementation — FINAL report and state update
Made-with: Cursor
2026-03-23 22:35:20 +02:00
Oleksandr Bezdieniezhnykh 861d4f083b [AZ-143] [AZ-145] [AZ-148] Implement video, resilience, and resource limit integration tests
Made-with: Cursor
2026-03-23 22:34:14 +02:00
Oleksandr Bezdieniezhnykh a469579882 [AZ-144] [AZ-146] [AZ-147] Implement negative input, performance, and security integration tests
Made-with: Cursor
2026-03-23 22:28:59 +02:00
Oleksandr Bezdieniezhnykh e593f57884 Update annotation class to make 'time' attribute public and enhance video time formatting in the main processing function. Adjust documentation to reflect changes in test batch progression. 2026-03-23 14:09:15 +02:00
Oleksandr Bezdieniezhnykh 86d8e7e22d [AZ-137] [AZ-138] Decompose test tasks and scaffold E2E test infrastructure
Made-with: Cursor
2026-03-23 14:07:54 +02:00
Oleksandr Bezdieniezhnykh 3165a88f0b Add detailed file index and enhance skill documentation for autopilot, decompose, deploy, plan, and research skills. Introduce tests-only mode in decompose skill, clarify required files for deploy and plan skills, and improve prerequisite checks across skills for better user guidance and workflow efficiency. 2026-03-22 16:15:49 +02:00