Commit Graph

75 Commits

Author SHA1 Message Date
Oleksandr Bezdieniezhnykh 64d3f828c8 Merge branch 'dev' into stage
ci/woodpecker/push/build-arm Pipeline failed
2026-04-22 01:37:15 +03:00
Oleksandr Bezdieniezhnykh 3b61dc4564 Update Woodpecker CI configuration to use new registry credentials
ci/woodpecker/manual/build-arm Pipeline was successful
Replaced HARBOR_USER and HARBOR_TOKEN with REGISTRY_USER and REGISTRY_TOKEN for Docker login. Updated image push path to include 'azaion' in the registry URL.
2026-04-21 20:37:54 +03:00
Oleksandr Bezdieniezhnykh 2f6fb41411 [AZ-205] Authenticate to Harbor before pushing build images
Add HARBOR_USER/HARBOR_TOKEN from Woodpecker secrets and a docker login
step before the existing build/push, so pipelines can push to the new
TLS-authenticated Harbor registry.
2026-04-20 04:10:42 +03:00
Oleksandr Bezdieniezhnykh 854cb505af [AZ-204] OCI revision labels + AZAION_REVISION env
Made-with: Cursor
2026-04-20 03:58:47 +03:00
Oleksandr Bezdieniezhnykh 849e32c6ae [AZ-203] Parameterize registry host via REGISTRY_HOST secret
Pipeline reads $REGISTRY_HOST from the Woodpecker global secret
'registry_host' instead of hardcoding 'localhost:5000'. The full
host:port lives in the secret, so Harbor migration (AZ-205) becomes
one secret edit rather than editing every submodule pipeline.

Made-with: Cursor
2026-04-20 03:49:21 +03:00
Roman Meshko 7d897df380 Fixed dynamic ONNX input
Fix dynamic ONNX input
Update docs with correct file name for tests
2026-04-19 20:55:51 +03:00
Oleksandr Bezdieniezhnykh e90ec69131 Sync .cursor from suite (autodev orchestrator + monorepo skills) 2026-04-18 22:04:05 +03:00
Oleksandr Bezdieniezhnykh cc4b5d0c56 Update CI configuration and improve documentation
- Enhanced CI configuration to streamline build processes.
- Updated documentation to clarify setup instructions and usage guidelines.

Made-with: Cursor
2026-04-17 16:43:22 +03:00
Oleksandr Bezdieniezhnykh a41e53fa96 Merge branch 'dev' of https://github.com/azaion/detections into dev 2026-04-17 16:20:27 +03:00
Oleksandr Bezdieniezhnykh 320683a1fd Update coding standards and testing guidelines
- Revised coding rules to emphasize readability, meaningful comments, and maintainability.
- Adjusted thresholds for test coverage on business logic from 80% to 75%, aligning with the new quality standards.
- Enhanced guidelines for handling skipped tests, introducing classifications for legitimate and illegitimate skips.
- Updated the requirements for test scenarios to ensure every test has a clear pass/fail criterion.

Made-with: Cursor
2026-04-17 16:19:32 +03:00
Roman Meshko dcb47f9f17 Changed AGENT.md to have a bridge Cursor <-> Codex 2026-04-15 21:25:40 +03:00
Oleksandr Bezdieniezhnykh 5ad5d81a15 Allow manual CI builds
ci/woodpecker/manual/build-arm Pipeline failed
Made-with: Cursor
2026-04-12 05:41:33 +03:00
Oleksandr Bezdieniezhnykh 7b68e18957 Update coding rules and CI configuration
- Added a new guideline to never suppress errors silently in coding rules.
- Introduced specifications for command files, including markdown format and kebab-case filenames.
- Updated Git workflow to require explicit user permission before pushing or merging changes.
- Adjusted Woodpecker CI configuration to trigger on push events.

Made-with: Cursor
2026-04-12 05:18:39 +03:00
Oleksandr Bezdieniezhnykh 4cbcb6e491 CI: main tag without prefix
Made-with: Cursor
2026-04-12 04:12:03 +03:00
Oleksandr Bezdieniezhnykh 628412d196 update woodpecker add dev branch
Made-with: Cursor
2026-04-11 20:40:29 +03:00
Oleksandr Bezdieniezhnykh 4e308ed11f Update autopilot state to reflect task changes
- Changed current step from 8 (New Task) to 2 (Test Spec) and updated sub_step to Phase 3 (Test Data Validation Gate).
- Added a rollback note detailing the reason for reverting to step 2 due to missing data in expected result CSV files, impacting E2E test verification.

Made-with: Cursor
2026-04-10 18:32:31 +03:00
Oleksandr Bezdieniezhnykh cd1c1855d9 Switch to Woodpecker CI
Made-with: Cursor
2026-04-10 01:28:47 +03:00
Oleksandr Bezdieniezhnykh d41b42c00d Comment out amd64 matrix
Made-with: Cursor
2026-04-09 23:33:18 +03:00
Oleksandr Bezdieniezhnykh 7313e59580 Remove Woodpecker CI configuration file
- Deleted the `.woodpecker.yml` file, which contained the CI configuration for multi-platform builds targeting ARM64 and AMD64 platforms.
- This change simplifies the project by removing obsolete CI settings that are no longer in use.

Made-with: Cursor
2026-04-09 19:51:01 +03:00
Oleksandr Bezdieniezhnykh d3a2300669 Enhance Woodpecker CI configuration for multi-platform builds
- Introduced a matrix configuration to support building for both ARM64 and AMD64 platforms.
- Updated the Dockerfile reference to be dynamic based on the selected platform.
- Modified tag formatting for Docker images to include platform-specific tags, improving clarity in versioning.

Made-with: Cursor
2026-04-09 13:27:49 +03:00
Oleksandr Bezdieniezhnykh f7f167db24 Refactor Jetson deployment scripts and enhance model handling
- Updated Docker configurations for Jetson deployment, including new image specifications in `docker-compose` files.
- Improved `Dockerfile.jetson` with a newer JetPack base image and additional dependencies.
- Streamlined model handling in the inference module, enhancing performance and error management.
- Cleaned up project structure by removing obsolete scripts and improving resource management.

Made-with: Cursor
2026-04-08 06:33:10 +03:00
Oleksandr Bezdieniezhnykh 26900d0aee Update Docker configurations and dependencies for Jetson deployment
- Added image specifications for services in `docker-compose.demo-jetson.yml` and `docker-compose.jetson.yml` to streamline deployment.
- Updated `Dockerfile.gpu` to use the development version of the CUDA runtime for enhanced compatibility.
- Modified `Dockerfile.jetson` to switch to a newer JetPack base image and adjusted the requirements file to include additional dependencies for improved functionality.
- Removed obsolete deployment scripts and calibration cache generation script to clean up the project structure.

Made-with: Cursor
2026-04-06 05:00:08 +03:00
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 834f846dc8 [AZ-180] Enhance setup and improve inference logging
- Added a new Cython extension for the engine factory to the setup configuration.
- Updated the inference module to include additional logging for video batch processing and annotation callbacks.
- Refactored test cases to standardize the detection endpoint responses and include channel IDs in headers for better event handling.
2026-04-03 05:58:55 +03:00
Oleksandr Bezdieniezhnykh 8baa96978b [AZ-180] Refactor detection event handling and improve SSE support
- Updated the detection image endpoint to require a channel ID for event streaming.
- Introduced a new endpoint for streaming detection events, allowing clients to receive real-time updates.
- Enhanced the internal buffering mechanism for detection events to manage multiple channels.
- Refactored the inference module to support the new event handling structure.

Made-with: Cursor
2026-04-03 02:42:05 +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 3984507221 [AZ-180] Fix INT8 conversion: set FP16 flag alongside INT8 for TensorRT 10.x
In TensorRT 10.x, INT8 conversion requires FP16 to be set as a fallback for
network layers (e.g. normalization ops in detection models) that have no INT8
kernel implementation. Without FP16, build_serialized_network can return None
on Jetson for YOLO-type models. INT8 flag is still the primary precision;
FP16 is only the layer-level fallback within the same engine.

Made-with: Cursor
2026-04-02 07:32:16 +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 2ed9ce3336 [AZ-180] Fix pre-existing test failures: patch JWT_SECRET in auth-dependent tests
Tests expecting file storage (image/video write) failed because JWT_SECRET was
not set in the test environment, causing require_auth to return "" (falsy),
skipping the storage block. Both tests now patch main.JWT_SECRET and use a
properly signed JWT.

Made-with: Cursor
2026-04-02 07:23:10 +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 22dd5db0d5 Split document skill into hub + workflow files (601 → 71/376/90/70 lines)
- SKILL.md: hub with frontmatter, principles, mode detection, file index (71 lines)
- workflows/full.md: Full/Focus/Resume modes — Steps 0-7 (376 lines)
- workflows/task.md: Task mode — incremental doc updates (90 lines)
- references/artifacts.md: directory structure, state.json, resumability (70 lines)

Made-with: Cursor
2026-03-31 17:32:24 +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 948b50ae3a [AZ-175] Restore image validation for corrupt/oversized uploads in /detect endpoint
Made-with: Cursor
2026-03-31 06:46:34 +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 fc57d677b4 Refactor type casting in Cython files for improved clarity and consistency
- Updated various Cython files to explicitly cast types, enhancing type safety and readability.
- Adjusted the `engine_name` property in `InferenceEngine` and its subclasses to be set directly in the constructor.
- Modified the `request` method in `_SessionWithBase` to accept `*args` for better flexibility.
- Ensured proper type casting for return values in methods across multiple classes, including `Inference`, `CoreMLEngine`, and `TensorRTEngine`.

These changes aim to streamline the codebase and improve maintainability by enforcing consistent type usage.
2026-03-30 06:17:16 +03:00
Oleksandr Bezdieniezhnykh 3b30a17e11 Update TILE_DUPLICATE_CONFIDENCE_THRESHOLD declaration in constants_inf.pyx to ensure proper type casting to double 2026-03-30 02:59:09 +03:00
Oleksandr Bezdieniezhnykh 38b7c710b3 Remove generated .c files from tracking (already in .gitignore)
Made-with: Cursor
2026-03-30 02:44:49 +03:00
Oleksandr Bezdieniezhnykh ea099d12da Replace threading.Lock with cython.pymutex and upgrade Cython to 3.2.4
Made-with: Cursor
2026-03-30 02:44:30 +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