raxe 0.4.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- raxe/__init__.py +101 -0
- raxe/application/__init__.py +48 -0
- raxe/application/ab_testing.py +170 -0
- raxe/application/analytics/__init__.py +30 -0
- raxe/application/analytics/achievement_service.py +444 -0
- raxe/application/analytics/repositories.py +172 -0
- raxe/application/analytics/retention_service.py +267 -0
- raxe/application/analytics/statistics_service.py +419 -0
- raxe/application/analytics/streak_service.py +283 -0
- raxe/application/apply_policy.py +291 -0
- raxe/application/eager_l2.py +503 -0
- raxe/application/preloader.py +353 -0
- raxe/application/scan_merger.py +321 -0
- raxe/application/scan_pipeline.py +1059 -0
- raxe/application/scan_pipeline_async.py +403 -0
- raxe/application/session_tracker.py +458 -0
- raxe/application/telemetry_manager.py +357 -0
- raxe/application/telemetry_orchestrator.py +1210 -0
- raxe/async_sdk/__init__.py +34 -0
- raxe/async_sdk/cache.py +286 -0
- raxe/async_sdk/client.py +556 -0
- raxe/async_sdk/wrappers/__init__.py +23 -0
- raxe/async_sdk/wrappers/openai.py +238 -0
- raxe/cli/__init__.py +21 -0
- raxe/cli/auth.py +1047 -0
- raxe/cli/branding.py +235 -0
- raxe/cli/config.py +334 -0
- raxe/cli/custom_rules.py +458 -0
- raxe/cli/doctor.py +686 -0
- raxe/cli/error_handler.py +665 -0
- raxe/cli/event.py +648 -0
- raxe/cli/exit_codes.py +57 -0
- raxe/cli/expiry_warning.py +302 -0
- raxe/cli/export.py +183 -0
- raxe/cli/history.py +247 -0
- raxe/cli/l2_formatter.py +872 -0
- raxe/cli/main.py +1137 -0
- raxe/cli/models.py +590 -0
- raxe/cli/output.py +403 -0
- raxe/cli/privacy.py +84 -0
- raxe/cli/profiler.py +262 -0
- raxe/cli/progress.py +379 -0
- raxe/cli/progress_context.py +101 -0
- raxe/cli/repl.py +394 -0
- raxe/cli/rules.py +542 -0
- raxe/cli/setup_wizard.py +721 -0
- raxe/cli/stats.py +292 -0
- raxe/cli/suppress.py +501 -0
- raxe/cli/telemetry.py +1384 -0
- raxe/cli/test.py +130 -0
- raxe/cli/tune.py +315 -0
- raxe/cli/validate.py +218 -0
- raxe/domain/__init__.py +30 -0
- raxe/domain/analytics/__init__.py +97 -0
- raxe/domain/analytics/achievements.py +306 -0
- raxe/domain/analytics/models.py +120 -0
- raxe/domain/analytics/retention.py +168 -0
- raxe/domain/analytics/statistics.py +207 -0
- raxe/domain/analytics/streaks.py +173 -0
- raxe/domain/engine/__init__.py +15 -0
- raxe/domain/engine/executor.py +396 -0
- raxe/domain/engine/matcher.py +212 -0
- raxe/domain/inline_suppression.py +176 -0
- raxe/domain/ml/__init__.py +133 -0
- raxe/domain/ml/embedding_cache.py +309 -0
- raxe/domain/ml/gemma_detector.py +921 -0
- raxe/domain/ml/gemma_models.py +346 -0
- raxe/domain/ml/l2_config.py +428 -0
- raxe/domain/ml/l2_output_schema.py +443 -0
- raxe/domain/ml/manifest_loader.py +309 -0
- raxe/domain/ml/manifest_schema.py +345 -0
- raxe/domain/ml/model_metadata.py +263 -0
- raxe/domain/ml/model_registry.py +786 -0
- raxe/domain/ml/protocol.py +282 -0
- raxe/domain/ml/scoring_models.py +419 -0
- raxe/domain/ml/stub_detector.py +397 -0
- raxe/domain/ml/threat_scorer.py +757 -0
- raxe/domain/ml/tokenizer_registry.py +372 -0
- raxe/domain/ml/voting/__init__.py +89 -0
- raxe/domain/ml/voting/config.py +595 -0
- raxe/domain/ml/voting/engine.py +465 -0
- raxe/domain/ml/voting/head_voters.py +378 -0
- raxe/domain/ml/voting/models.py +222 -0
- raxe/domain/models.py +82 -0
- raxe/domain/packs/__init__.py +17 -0
- raxe/domain/packs/models.py +304 -0
- raxe/domain/policies/__init__.py +20 -0
- raxe/domain/policies/evaluator.py +212 -0
- raxe/domain/policies/models.py +223 -0
- raxe/domain/rules/__init__.py +32 -0
- raxe/domain/rules/custom.py +286 -0
- raxe/domain/rules/models.py +273 -0
- raxe/domain/rules/schema.py +166 -0
- raxe/domain/rules/validator.py +556 -0
- raxe/domain/suppression.py +801 -0
- raxe/domain/suppression_factory.py +174 -0
- raxe/domain/telemetry/__init__.py +116 -0
- raxe/domain/telemetry/backpressure.py +424 -0
- raxe/domain/telemetry/event_creator.py +362 -0
- raxe/domain/telemetry/events.py +1282 -0
- raxe/domain/telemetry/priority.py +263 -0
- raxe/domain/telemetry/scan_telemetry_builder.py +670 -0
- raxe/infrastructure/__init__.py +25 -0
- raxe/infrastructure/analytics/__init__.py +18 -0
- raxe/infrastructure/analytics/aggregator.py +484 -0
- raxe/infrastructure/analytics/aggregator_optimized.py +184 -0
- raxe/infrastructure/analytics/engine.py +748 -0
- raxe/infrastructure/analytics/repository.py +409 -0
- raxe/infrastructure/analytics/streaks.py +467 -0
- raxe/infrastructure/analytics/views.py +178 -0
- raxe/infrastructure/cloud/__init__.py +9 -0
- raxe/infrastructure/config/__init__.py +56 -0
- raxe/infrastructure/config/endpoints.py +641 -0
- raxe/infrastructure/config/scan_config.py +352 -0
- raxe/infrastructure/config/yaml_config.py +459 -0
- raxe/infrastructure/database/__init__.py +10 -0
- raxe/infrastructure/database/connection.py +200 -0
- raxe/infrastructure/database/models.py +325 -0
- raxe/infrastructure/database/scan_history.py +764 -0
- raxe/infrastructure/ml/__init__.py +0 -0
- raxe/infrastructure/ml/download_progress.py +438 -0
- raxe/infrastructure/ml/model_downloader.py +457 -0
- raxe/infrastructure/models/__init__.py +16 -0
- raxe/infrastructure/models/discovery.py +461 -0
- raxe/infrastructure/packs/__init__.py +13 -0
- raxe/infrastructure/packs/loader.py +407 -0
- raxe/infrastructure/packs/registry.py +381 -0
- raxe/infrastructure/policies/__init__.py +16 -0
- raxe/infrastructure/policies/api_client.py +256 -0
- raxe/infrastructure/policies/validator.py +227 -0
- raxe/infrastructure/policies/yaml_loader.py +250 -0
- raxe/infrastructure/rules/__init__.py +18 -0
- raxe/infrastructure/rules/custom_loader.py +224 -0
- raxe/infrastructure/rules/versioning.py +222 -0
- raxe/infrastructure/rules/yaml_loader.py +286 -0
- raxe/infrastructure/security/__init__.py +31 -0
- raxe/infrastructure/security/auth.py +145 -0
- raxe/infrastructure/security/policy_validator.py +124 -0
- raxe/infrastructure/security/signatures.py +171 -0
- raxe/infrastructure/suppression/__init__.py +36 -0
- raxe/infrastructure/suppression/composite_repository.py +154 -0
- raxe/infrastructure/suppression/sqlite_repository.py +231 -0
- raxe/infrastructure/suppression/yaml_composite_repository.py +156 -0
- raxe/infrastructure/suppression/yaml_repository.py +510 -0
- raxe/infrastructure/telemetry/__init__.py +79 -0
- raxe/infrastructure/telemetry/acquisition.py +179 -0
- raxe/infrastructure/telemetry/config.py +254 -0
- raxe/infrastructure/telemetry/credential_store.py +947 -0
- raxe/infrastructure/telemetry/dual_queue.py +1123 -0
- raxe/infrastructure/telemetry/flush_helper.py +343 -0
- raxe/infrastructure/telemetry/flush_scheduler.py +776 -0
- raxe/infrastructure/telemetry/health_client.py +394 -0
- raxe/infrastructure/telemetry/hook.py +347 -0
- raxe/infrastructure/telemetry/queue.py +520 -0
- raxe/infrastructure/telemetry/sender.py +476 -0
- raxe/infrastructure/tracking/__init__.py +13 -0
- raxe/infrastructure/tracking/usage.py +389 -0
- raxe/integrations/__init__.py +55 -0
- raxe/integrations/availability.py +143 -0
- raxe/integrations/registry.py +122 -0
- raxe/integrations/utils.py +135 -0
- raxe/mcp/__init__.py +62 -0
- raxe/mcp/cli.py +97 -0
- raxe/mcp/server.py +409 -0
- raxe/monitoring/__init__.py +51 -0
- raxe/monitoring/metrics.py +372 -0
- raxe/monitoring/profiler.py +388 -0
- raxe/monitoring/server.py +136 -0
- raxe/packs/core/v1.0.0/pack.yaml +1394 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-001@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-006@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-014@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-017@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-022@1.0.0.yaml +67 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-023@1.0.0.yaml +91 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-024@1.0.0.yaml +80 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-025@1.0.0.yaml +81 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-026@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-027@1.0.0.yaml +77 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-028@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-029@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-030@1.0.0.yaml +55 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-033@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-034@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-035@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-046@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-047@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-048@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-049@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-050@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-068@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-078@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-2001@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-2004@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-201@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-202@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-203@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3007@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3016@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3026@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3027@1.0.0.yaml +64 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3028@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3029@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3030@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3031@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3032@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3033@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-3034@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-79@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-80@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-81@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-82@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-83@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-84@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-85@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-86@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-87@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-88@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-89@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-90@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-91@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-92@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-93@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-94@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-95@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-96@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-97@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/PI/pi-98@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-007@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-015@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-016@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-017@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-021@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-022@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-023@1.0.0.yaml +78 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-024@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-025@1.0.0.yaml +93 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-026@1.0.0.yaml +81 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-027@1.0.0.yaml +82 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-028@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-033@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-036@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-037@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-052@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-054@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-056@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-065@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-075@1.0.0.yaml +45 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-079@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1080@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1090@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1104@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1105@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-1112@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-201@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-202@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-203@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-204@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-205@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-206@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-207@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-208@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-209@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-210@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-211@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-212@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-213@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-214@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-215@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-216@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-217@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-218@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-219@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-220@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-221@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-222@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-223@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-224@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-225@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-226@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-227@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-228@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-229@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-230@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-231@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-232@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-233@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-234@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-235@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-236@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-237@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/cmd/cmd-238@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-013@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-019@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-020@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-024@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-029@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-038@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-044@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-067@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-069@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-100@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-101@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-102@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-103@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-104@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-105@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-106@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-107@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-108@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-109@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-110@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-111@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-112@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-113@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-114@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-115@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-116@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-117@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-118@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-119@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-120@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-201@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-203@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3004@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3006@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-3011@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-5016@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-6001@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-6002@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-70@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-71@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-72@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-73@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-74@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-75@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-76@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-77@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-78@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-79@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-80@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-81@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-82@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-83@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-84@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-85@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-86@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-87@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-88@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-89@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-90@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-91@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-92@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-93@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-94@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-95@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-96@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-97@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-98@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/enc/enc-99@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-001@1.0.0.yaml +73 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-002@1.0.0.yaml +71 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-003@1.0.0.yaml +65 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-004@1.0.0.yaml +73 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-101@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-102@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-103@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-104@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-105@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-106@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-107@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-108@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-109@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-110@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-111@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-112@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-113@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-114@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-115@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-116@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-117@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-118@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-119@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-120@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-121@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-122@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-123@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-124@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-125@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-126@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-127@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-128@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-129@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-130@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-131@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-132@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-133@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-134@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-135@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-136@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-137@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-138@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-139@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-140@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-141@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-142@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-143@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-144@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-145@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-146@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-147@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-148@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-149@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-150@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-151@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-152@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-153@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-154@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-155@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-156@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-157@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-158@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-159@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-160@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/hc/hc-161@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-001@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-009@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-020@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-021@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-022@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-028@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-033@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-034@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-036@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-039@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-056@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-066@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-076@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-098@1.0.0.yaml +46 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-103@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-104@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-105@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-110@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-111@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-112@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-113@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-114@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-115@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-116@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-117@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-118@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-119@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-120@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-121@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-122@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-123@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-124@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-125@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-126@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-127@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-128@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-129@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-130@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-131@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-132@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-133@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-134@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-135@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-136@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-137@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-138@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-139@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-140@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-141@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-142@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-143@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-144@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-145@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-146@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-147@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-148@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-149@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-150@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-151@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-152@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-153@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-154@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-155@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-156@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-157@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-158@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-159@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-160@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-161@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-162@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-201@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-203@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-204@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-205@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-206@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/jb/jb-207@1.0.0.yaml +49 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-001@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-009@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-012@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-017@1.0.0.yaml +48 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-022@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-025@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-027@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-028@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-034@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-037@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-040@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-041@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-044@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-050@1.0.0.yaml +57 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-051@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-052@1.0.0.yaml +52 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-053@1.0.0.yaml +56 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-054@1.0.0.yaml +53 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-055@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-056@1.0.0.yaml +51 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-058@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2015@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2025@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2026@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2035@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2037@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-2042@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3001@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3002@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3003@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3004@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3005@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3006@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3007@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3008@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3009@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3010@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3011@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3012@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3013@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3014@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3015@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3016@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3017@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3018@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3019@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3020@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3021@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3022@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3023@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3024@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3025@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3026@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3027@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3028@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3029@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3030@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3031@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3032@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3033@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3034@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3035@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3036@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3037@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3038@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3039@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3040@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3041@1.0.0.yaml +39 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3042@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3043@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3044@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3045@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3046@1.0.0.yaml +37 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3047@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3048@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3049@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3050@1.0.0.yaml +44 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3051@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3052@1.0.0.yaml +36 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3053@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3054@1.0.0.yaml +35 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3055@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3056@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3057@1.0.0.yaml +40 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3058@1.0.0.yaml +43 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3059@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3060@1.0.0.yaml +42 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3061@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3062@1.0.0.yaml +50 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3063@1.0.0.yaml +54 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3064@1.0.0.yaml +78 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3065@1.0.0.yaml +84 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3066@1.0.0.yaml +84 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3067@1.0.0.yaml +88 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3068@1.0.0.yaml +94 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3069@1.0.0.yaml +90 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3070@1.0.0.yaml +99 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3071@1.0.0.yaml +91 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3072@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3073@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3074@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3075@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3076@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3077@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3078@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3079@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3080@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3081@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3082@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3083@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3084@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/pii/pii-3085@1.0.0.yaml +38 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-016@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-028@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-042@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-044@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-045@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-050@1.0.0.yaml +47 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-201@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-202@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3001@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3006@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3009@1.0.0.yaml +41 -0
- raxe/packs/core/v1.0.0/rules/rag/rag-3012@1.0.0.yaml +41 -0
- raxe/plugins/__init__.py +98 -0
- raxe/plugins/custom_rules.py +380 -0
- raxe/plugins/loader.py +389 -0
- raxe/plugins/manager.py +538 -0
- raxe/plugins/protocol.py +428 -0
- raxe/py.typed +0 -0
- raxe/sdk/__init__.py +77 -0
- raxe/sdk/agent_scanner.py +1918 -0
- raxe/sdk/client.py +1603 -0
- raxe/sdk/decorator.py +175 -0
- raxe/sdk/exceptions.py +859 -0
- raxe/sdk/integrations/__init__.py +277 -0
- raxe/sdk/integrations/agent_scanner.py +71 -0
- raxe/sdk/integrations/autogen.py +872 -0
- raxe/sdk/integrations/crewai.py +1368 -0
- raxe/sdk/integrations/dspy.py +845 -0
- raxe/sdk/integrations/extractors.py +363 -0
- raxe/sdk/integrations/huggingface.py +395 -0
- raxe/sdk/integrations/langchain.py +948 -0
- raxe/sdk/integrations/litellm.py +484 -0
- raxe/sdk/integrations/llamaindex.py +1049 -0
- raxe/sdk/integrations/portkey.py +831 -0
- raxe/sdk/suppression_context.py +215 -0
- raxe/sdk/wrappers/__init__.py +163 -0
- raxe/sdk/wrappers/anthropic.py +310 -0
- raxe/sdk/wrappers/openai.py +221 -0
- raxe/sdk/wrappers/vertexai.py +484 -0
- raxe/utils/__init__.py +12 -0
- raxe/utils/error_sanitizer.py +135 -0
- raxe/utils/logging.py +241 -0
- raxe/utils/performance.py +414 -0
- raxe/utils/profiler.py +339 -0
- raxe/utils/validators.py +170 -0
- raxe-0.4.6.dist-info/METADATA +471 -0
- raxe-0.4.6.dist-info/RECORD +668 -0
- raxe-0.4.6.dist-info/WHEEL +5 -0
- raxe-0.4.6.dist-info/entry_points.txt +2 -0
- raxe-0.4.6.dist-info/licenses/LICENSE +56 -0
- raxe-0.4.6.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
"""Retention analytics service.
|
|
2
|
+
|
|
3
|
+
Orchestrates retention calculation by combining domain logic with data access.
|
|
4
|
+
|
|
5
|
+
CRITICAL: This is application layer - orchestrates but doesn't calculate.
|
|
6
|
+
All calculations delegated to domain layer, all I/O to repository.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
from datetime import date, timedelta
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from raxe.domain.analytics import (
|
|
14
|
+
RetentionMetrics,
|
|
15
|
+
calculate_cohort_retention,
|
|
16
|
+
calculate_retention,
|
|
17
|
+
calculate_retention_rate,
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
from .repositories import AnalyticsRepository
|
|
21
|
+
|
|
22
|
+
logger = logging.getLogger(__name__)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class RetentionService:
|
|
26
|
+
"""Service for calculating user retention metrics.
|
|
27
|
+
|
|
28
|
+
This service orchestrates:
|
|
29
|
+
1. Data loading from repository (infrastructure)
|
|
30
|
+
2. Retention calculation (domain pure functions)
|
|
31
|
+
3. Result formatting and logging
|
|
32
|
+
|
|
33
|
+
CRITICAL: This service does NOT perform calculations itself.
|
|
34
|
+
All business logic is delegated to domain layer functions.
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
def __init__(self, repository: AnalyticsRepository):
|
|
38
|
+
"""Initialize retention service.
|
|
39
|
+
|
|
40
|
+
Args:
|
|
41
|
+
repository: Repository for data access (dependency injection)
|
|
42
|
+
"""
|
|
43
|
+
self.repository = repository
|
|
44
|
+
|
|
45
|
+
def calculate_user_retention(
|
|
46
|
+
self,
|
|
47
|
+
installation_id: str
|
|
48
|
+
) -> RetentionMetrics:
|
|
49
|
+
"""Calculate retention for a specific user.
|
|
50
|
+
|
|
51
|
+
Args:
|
|
52
|
+
installation_id: User's installation identifier
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
RetentionMetrics with day 1/7/30 retention calculated
|
|
56
|
+
|
|
57
|
+
Example:
|
|
58
|
+
>>> service = RetentionService(repo)
|
|
59
|
+
>>> metrics = service.calculate_user_retention("abc123")
|
|
60
|
+
>>> print(f"Day 1 retention: {metrics.day1_retained}")
|
|
61
|
+
"""
|
|
62
|
+
try:
|
|
63
|
+
# Step 1: Load user activity from repository (I/O)
|
|
64
|
+
activity = self.repository.get_user_activity(installation_id)
|
|
65
|
+
|
|
66
|
+
if not activity:
|
|
67
|
+
logger.info(f"No activity found for user {installation_id}")
|
|
68
|
+
# Return empty metrics
|
|
69
|
+
return RetentionMetrics(
|
|
70
|
+
installation_id=installation_id,
|
|
71
|
+
install_date=date.today(),
|
|
72
|
+
day1_retained=False,
|
|
73
|
+
day7_retained=False,
|
|
74
|
+
day30_retained=False,
|
|
75
|
+
total_scans=0,
|
|
76
|
+
last_scan_date=None
|
|
77
|
+
)
|
|
78
|
+
|
|
79
|
+
# Step 2: Calculate retention using domain function (pure logic)
|
|
80
|
+
metrics = calculate_retention(
|
|
81
|
+
installation_id=installation_id,
|
|
82
|
+
install_date=activity.first_seen.date(),
|
|
83
|
+
scan_dates=activity.scan_dates
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
logger.info(
|
|
87
|
+
f"Calculated retention for {installation_id}: "
|
|
88
|
+
f"day1={metrics.day1_retained}, day7={metrics.day7_retained}, "
|
|
89
|
+
f"day30={metrics.day30_retained}"
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
return metrics
|
|
93
|
+
|
|
94
|
+
except Exception as e:
|
|
95
|
+
logger.error(f"Failed to calculate retention for {installation_id}: {e}")
|
|
96
|
+
raise
|
|
97
|
+
|
|
98
|
+
def calculate_cohort_retention_metrics(
|
|
99
|
+
self,
|
|
100
|
+
cohort_date: date,
|
|
101
|
+
*,
|
|
102
|
+
days_to_check: list[int] | None = None
|
|
103
|
+
) -> dict[str, Any]:
|
|
104
|
+
"""Calculate retention for installation cohort.
|
|
105
|
+
|
|
106
|
+
Args:
|
|
107
|
+
cohort_date: Date when users first installed
|
|
108
|
+
days_to_check: Days after install to check (default: [1, 7, 30])
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Dictionary with cohort metrics and individual user retention
|
|
112
|
+
|
|
113
|
+
Example:
|
|
114
|
+
>>> service = RetentionService(repo)
|
|
115
|
+
>>> results = service.calculate_cohort_retention_metrics(date(2025, 1, 1))
|
|
116
|
+
>>> print(f"Cohort size: {results['cohort_size']}")
|
|
117
|
+
>>> print(f"Day 1 rate: {results['day1_retention_rate']}%")
|
|
118
|
+
"""
|
|
119
|
+
if days_to_check is None:
|
|
120
|
+
days_to_check = [1, 7, 30]
|
|
121
|
+
|
|
122
|
+
try:
|
|
123
|
+
# Step 1: Load cohort users from database (I/O)
|
|
124
|
+
cohort_user_ids = self.repository.get_cohort_users(cohort_date)
|
|
125
|
+
|
|
126
|
+
if not cohort_user_ids:
|
|
127
|
+
logger.info(f"No users found for cohort {cohort_date}")
|
|
128
|
+
return {
|
|
129
|
+
"cohort_date": cohort_date.isoformat(),
|
|
130
|
+
"cohort_size": 0,
|
|
131
|
+
"day1_retention_rate": 0.0,
|
|
132
|
+
"day7_retention_rate": 0.0,
|
|
133
|
+
"day30_retention_rate": 0.0,
|
|
134
|
+
"users": {}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
# Step 2: Build cohort data structure for domain function
|
|
138
|
+
cohort_data = {}
|
|
139
|
+
for user_id in cohort_user_ids:
|
|
140
|
+
activity = self.repository.get_user_activity(user_id)
|
|
141
|
+
if activity:
|
|
142
|
+
cohort_data[user_id] = (
|
|
143
|
+
activity.first_seen.date(),
|
|
144
|
+
activity.scan_dates
|
|
145
|
+
)
|
|
146
|
+
|
|
147
|
+
# Step 3: Calculate retention using domain function (pure logic)
|
|
148
|
+
retention_by_user = calculate_cohort_retention(cohort_data)
|
|
149
|
+
|
|
150
|
+
# Step 4: Calculate aggregate retention rates (pure logic)
|
|
151
|
+
metrics_list = list(retention_by_user.values())
|
|
152
|
+
day1_rate = calculate_retention_rate(metrics_list, "day1")
|
|
153
|
+
day7_rate = calculate_retention_rate(metrics_list, "day7")
|
|
154
|
+
day30_rate = calculate_retention_rate(metrics_list, "day30")
|
|
155
|
+
|
|
156
|
+
result = {
|
|
157
|
+
"cohort_date": cohort_date.isoformat(),
|
|
158
|
+
"cohort_size": len(cohort_user_ids),
|
|
159
|
+
"day1_retention_rate": round(day1_rate, 2),
|
|
160
|
+
"day7_retention_rate": round(day7_rate, 2),
|
|
161
|
+
"day30_retention_rate": round(day30_rate, 2),
|
|
162
|
+
"users": {
|
|
163
|
+
user_id: {
|
|
164
|
+
"day1_retained": m.day1_retained,
|
|
165
|
+
"day7_retained": m.day7_retained,
|
|
166
|
+
"day30_retained": m.day30_retained,
|
|
167
|
+
"total_scans": m.total_scans
|
|
168
|
+
}
|
|
169
|
+
for user_id, m in retention_by_user.items()
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
logger.info(
|
|
174
|
+
f"Calculated cohort retention for {cohort_date}: "
|
|
175
|
+
f"size={result['cohort_size']}, "
|
|
176
|
+
f"day1={result['day1_retention_rate']}%, "
|
|
177
|
+
f"day7={result['day7_retention_rate']}%"
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
return result
|
|
181
|
+
|
|
182
|
+
except Exception as e:
|
|
183
|
+
logger.error(f"Failed to calculate cohort retention: {e}")
|
|
184
|
+
raise
|
|
185
|
+
|
|
186
|
+
def calculate_rolling_retention(
|
|
187
|
+
self,
|
|
188
|
+
end_date: date,
|
|
189
|
+
window_days: int = 30
|
|
190
|
+
) -> dict[str, Any]:
|
|
191
|
+
"""Calculate rolling retention over a time window.
|
|
192
|
+
|
|
193
|
+
Rolling retention = % of users active in window who return.
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
end_date: End date for the calculation window
|
|
197
|
+
window_days: Number of days in the window (default: 30)
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
Dictionary with rolling retention metrics
|
|
201
|
+
|
|
202
|
+
Example:
|
|
203
|
+
>>> service = RetentionService(repo)
|
|
204
|
+
>>> metrics = service.calculate_rolling_retention(date.today(), 30)
|
|
205
|
+
>>> print(f"Retention rate: {metrics['retention_rate']}%")
|
|
206
|
+
"""
|
|
207
|
+
start_date = end_date - timedelta(days=window_days)
|
|
208
|
+
|
|
209
|
+
try:
|
|
210
|
+
# Step 1: Get all scan events in window (I/O)
|
|
211
|
+
events = self.repository.get_scan_events(
|
|
212
|
+
start_date=start_date,
|
|
213
|
+
end_date=end_date
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
if not events:
|
|
217
|
+
logger.info(
|
|
218
|
+
f"No events found for rolling retention {start_date} to {end_date}"
|
|
219
|
+
)
|
|
220
|
+
return {
|
|
221
|
+
"start_date": start_date.isoformat(),
|
|
222
|
+
"end_date": end_date.isoformat(),
|
|
223
|
+
"total_users": 0,
|
|
224
|
+
"returning_users": 0,
|
|
225
|
+
"retention_rate": 0.0
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
# Step 2: Group events by user to determine activity patterns
|
|
229
|
+
user_activity = {}
|
|
230
|
+
for event in events:
|
|
231
|
+
user_id = event.installation_id
|
|
232
|
+
if user_id not in user_activity:
|
|
233
|
+
user_activity[user_id] = []
|
|
234
|
+
user_activity[user_id].append(event.timestamp.date())
|
|
235
|
+
|
|
236
|
+
# Step 3: Calculate retention (users active on 2+ different days)
|
|
237
|
+
total_users = len(user_activity)
|
|
238
|
+
returning_users = sum(
|
|
239
|
+
1 for dates in user_activity.values()
|
|
240
|
+
if len(set(dates)) >= 2 # Active on at least 2 different days
|
|
241
|
+
)
|
|
242
|
+
|
|
243
|
+
retention_rate = (
|
|
244
|
+
(returning_users / total_users * 100)
|
|
245
|
+
if total_users > 0
|
|
246
|
+
else 0.0
|
|
247
|
+
)
|
|
248
|
+
|
|
249
|
+
result = {
|
|
250
|
+
"start_date": start_date.isoformat(),
|
|
251
|
+
"end_date": end_date.isoformat(),
|
|
252
|
+
"total_users": total_users,
|
|
253
|
+
"returning_users": returning_users,
|
|
254
|
+
"retention_rate": round(retention_rate, 2)
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
logger.info(
|
|
258
|
+
f"Calculated rolling retention {start_date} to {end_date}: "
|
|
259
|
+
f"total={total_users}, returning={returning_users}, "
|
|
260
|
+
f"rate={retention_rate:.1f}%"
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
return result
|
|
264
|
+
|
|
265
|
+
except Exception as e:
|
|
266
|
+
logger.error(f"Failed to calculate rolling retention: {e}")
|
|
267
|
+
raise
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"""Usage statistics service.
|
|
2
|
+
|
|
3
|
+
Calculates DAU, WAU, MAU and other aggregate statistics.
|
|
4
|
+
|
|
5
|
+
CRITICAL: This is application layer - orchestrates but doesn't calculate.
|
|
6
|
+
All calculations delegated to domain layer, all I/O to repository.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
import logging
|
|
10
|
+
from datetime import date, timedelta
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from raxe.domain.analytics import (
|
|
14
|
+
calculate_dau,
|
|
15
|
+
calculate_growth_rate,
|
|
16
|
+
calculate_mau,
|
|
17
|
+
calculate_stickiness,
|
|
18
|
+
calculate_usage_statistics,
|
|
19
|
+
calculate_wau,
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
from .repositories import AnalyticsRepository
|
|
23
|
+
|
|
24
|
+
logger = logging.getLogger(__name__)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class StatisticsService:
|
|
28
|
+
"""Service for calculating usage statistics.
|
|
29
|
+
|
|
30
|
+
This service orchestrates:
|
|
31
|
+
1. Data loading from repository (infrastructure)
|
|
32
|
+
2. Statistics calculation (domain pure functions)
|
|
33
|
+
3. Result formatting and caching
|
|
34
|
+
|
|
35
|
+
CRITICAL: This service does NOT perform calculations itself.
|
|
36
|
+
All business logic is delegated to domain layer functions.
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def __init__(self, repository: AnalyticsRepository):
|
|
40
|
+
"""Initialize statistics service.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
repository: Repository for data access (dependency injection)
|
|
44
|
+
"""
|
|
45
|
+
self.repository = repository
|
|
46
|
+
|
|
47
|
+
def calculate_active_users(
|
|
48
|
+
self,
|
|
49
|
+
target_date: date | None = None
|
|
50
|
+
) -> dict[str, Any]:
|
|
51
|
+
"""Calculate DAU, WAU, and MAU for a given date.
|
|
52
|
+
|
|
53
|
+
Args:
|
|
54
|
+
target_date: Date to calculate for (default: today)
|
|
55
|
+
|
|
56
|
+
Returns:
|
|
57
|
+
Dictionary with 'dau', 'wau', 'mau', and 'stickiness' metrics
|
|
58
|
+
|
|
59
|
+
Example:
|
|
60
|
+
>>> service = StatisticsService(repo)
|
|
61
|
+
>>> metrics = service.calculate_active_users()
|
|
62
|
+
>>> print(f"DAU: {metrics['dau']}, MAU: {metrics['mau']}")
|
|
63
|
+
>>> print(f"Stickiness: {metrics['stickiness']:.1f}%")
|
|
64
|
+
"""
|
|
65
|
+
if target_date is None:
|
|
66
|
+
target_date = date.today()
|
|
67
|
+
|
|
68
|
+
try:
|
|
69
|
+
# Step 1: Get user activity data from repository (I/O)
|
|
70
|
+
# We need scan dates for all users to calculate DAU/WAU/MAU
|
|
71
|
+
|
|
72
|
+
# Get users active in the last 30 days (for MAU calculation)
|
|
73
|
+
user_ids = self.repository.get_active_users(
|
|
74
|
+
target_date=target_date,
|
|
75
|
+
window_days=30
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
if not user_ids:
|
|
79
|
+
logger.info(f"No active users found for {target_date}")
|
|
80
|
+
return {
|
|
81
|
+
"target_date": target_date.isoformat(),
|
|
82
|
+
"dau": 0,
|
|
83
|
+
"wau": 0,
|
|
84
|
+
"mau": 0,
|
|
85
|
+
"stickiness": 0.0
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
# Step 2: Build scan_dates_by_user map for domain functions
|
|
89
|
+
scan_dates_by_user = {}
|
|
90
|
+
for user_id in user_ids:
|
|
91
|
+
activity = self.repository.get_user_activity(
|
|
92
|
+
user_id,
|
|
93
|
+
start_date=target_date - timedelta(days=30),
|
|
94
|
+
end_date=target_date
|
|
95
|
+
)
|
|
96
|
+
if activity and activity.scan_dates:
|
|
97
|
+
scan_dates_by_user[user_id] = activity.scan_dates
|
|
98
|
+
|
|
99
|
+
# Step 3: Calculate metrics using domain functions (pure logic)
|
|
100
|
+
dau = calculate_dau(scan_dates_by_user, target_date)
|
|
101
|
+
wau = calculate_wau(scan_dates_by_user, target_date)
|
|
102
|
+
mau = calculate_mau(scan_dates_by_user, target_date)
|
|
103
|
+
stickiness = calculate_stickiness(dau, mau)
|
|
104
|
+
|
|
105
|
+
result = {
|
|
106
|
+
"target_date": target_date.isoformat(),
|
|
107
|
+
"dau": dau,
|
|
108
|
+
"wau": wau,
|
|
109
|
+
"mau": mau,
|
|
110
|
+
"stickiness": round(stickiness, 2)
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
logger.info(
|
|
114
|
+
f"Active users for {target_date}: "
|
|
115
|
+
f"DAU={dau}, WAU={wau}, MAU={mau}, "
|
|
116
|
+
f"stickiness={stickiness:.1f}%"
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
return result
|
|
120
|
+
|
|
121
|
+
except Exception as e:
|
|
122
|
+
logger.error(f"Failed to calculate active users: {e}")
|
|
123
|
+
raise
|
|
124
|
+
|
|
125
|
+
def calculate_usage_stats(
|
|
126
|
+
self,
|
|
127
|
+
start_date: date,
|
|
128
|
+
end_date: date
|
|
129
|
+
) -> dict[str, Any]:
|
|
130
|
+
"""Calculate usage statistics for a time period.
|
|
131
|
+
|
|
132
|
+
Args:
|
|
133
|
+
start_date: Start of analysis period
|
|
134
|
+
end_date: End of analysis period
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Dictionary with usage metrics and statistics
|
|
138
|
+
|
|
139
|
+
Example:
|
|
140
|
+
>>> service = StatisticsService(repo)
|
|
141
|
+
>>> stats = service.calculate_usage_stats(
|
|
142
|
+
... start_date=date(2025, 1, 1),
|
|
143
|
+
... end_date=date(2025, 1, 31)
|
|
144
|
+
... )
|
|
145
|
+
>>> print(f"Total scans: {stats['total_scans']}")
|
|
146
|
+
>>> print(f"Average scans per user: {stats['avg_scans_per_user']:.1f}")
|
|
147
|
+
"""
|
|
148
|
+
try:
|
|
149
|
+
# Step 1: Get all scan events in period (I/O)
|
|
150
|
+
events = self.repository.get_scan_events(
|
|
151
|
+
start_date=start_date,
|
|
152
|
+
end_date=end_date
|
|
153
|
+
)
|
|
154
|
+
|
|
155
|
+
if not events:
|
|
156
|
+
logger.info(
|
|
157
|
+
f"No events found for usage stats {start_date} to {end_date}"
|
|
158
|
+
)
|
|
159
|
+
return {
|
|
160
|
+
"period_start": start_date.isoformat(),
|
|
161
|
+
"period_end": end_date.isoformat(),
|
|
162
|
+
"total_scans": 0,
|
|
163
|
+
"unique_users": 0,
|
|
164
|
+
"avg_scans_per_user": 0.0,
|
|
165
|
+
"threats_detected": 0,
|
|
166
|
+
"detection_rate": 0.0,
|
|
167
|
+
"dau": 0,
|
|
168
|
+
"wau": 0,
|
|
169
|
+
"mau": 0
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
# Step 2: Build scan_dates_by_user for domain functions
|
|
173
|
+
scan_dates_by_user = {}
|
|
174
|
+
threat_count = 0
|
|
175
|
+
|
|
176
|
+
for event in events:
|
|
177
|
+
user_id = event.installation_id
|
|
178
|
+
event_date = event.timestamp.date()
|
|
179
|
+
|
|
180
|
+
if user_id not in scan_dates_by_user:
|
|
181
|
+
scan_dates_by_user[user_id] = []
|
|
182
|
+
scan_dates_by_user[user_id].append(event_date)
|
|
183
|
+
|
|
184
|
+
if event.has_threats:
|
|
185
|
+
threat_count += 1
|
|
186
|
+
|
|
187
|
+
# Step 3: Calculate statistics using domain functions (pure logic)
|
|
188
|
+
usage_stats = calculate_usage_statistics(
|
|
189
|
+
scan_dates_by_user=scan_dates_by_user,
|
|
190
|
+
period_start=start_date,
|
|
191
|
+
period_end=end_date
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
total_scans = usage_stats.total_scans
|
|
195
|
+
detection_rate = (
|
|
196
|
+
(threat_count / total_scans * 100)
|
|
197
|
+
if total_scans > 0
|
|
198
|
+
else 0.0
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
result = {
|
|
202
|
+
"period_start": start_date.isoformat(),
|
|
203
|
+
"period_end": end_date.isoformat(),
|
|
204
|
+
"total_scans": total_scans,
|
|
205
|
+
"unique_users": len(scan_dates_by_user),
|
|
206
|
+
"avg_scans_per_user": round(usage_stats.avg_scans_per_user, 2),
|
|
207
|
+
"threats_detected": threat_count,
|
|
208
|
+
"detection_rate": round(detection_rate, 2),
|
|
209
|
+
"dau": usage_stats.dau,
|
|
210
|
+
"wau": usage_stats.wau,
|
|
211
|
+
"mau": usage_stats.mau
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
logger.info(
|
|
215
|
+
f"Usage stats for {start_date} to {end_date}: "
|
|
216
|
+
f"scans={total_scans}, users={result['unique_users']}, "
|
|
217
|
+
f"avg={usage_stats.avg_scans_per_user:.1f}"
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
return result
|
|
221
|
+
|
|
222
|
+
except Exception as e:
|
|
223
|
+
logger.error(f"Failed to calculate usage stats: {e}")
|
|
224
|
+
raise
|
|
225
|
+
|
|
226
|
+
def calculate_growth_metrics(
|
|
227
|
+
self,
|
|
228
|
+
current_period_end: date,
|
|
229
|
+
*,
|
|
230
|
+
period_days: int = 30
|
|
231
|
+
) -> dict[str, Any]:
|
|
232
|
+
"""Calculate growth metrics comparing two time periods.
|
|
233
|
+
|
|
234
|
+
Args:
|
|
235
|
+
current_period_end: End date of current period
|
|
236
|
+
period_days: Length of each period in days (default: 30)
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
Dictionary with growth metrics and comparison
|
|
240
|
+
|
|
241
|
+
Example:
|
|
242
|
+
>>> service = StatisticsService(repo)
|
|
243
|
+
>>> growth = service.calculate_growth_metrics(date.today())
|
|
244
|
+
>>> print(f"MAU growth: {growth['mau_growth_rate']:.1f}%")
|
|
245
|
+
>>> print(f"Scan growth: {growth['scan_growth_rate']:.1f}%")
|
|
246
|
+
"""
|
|
247
|
+
try:
|
|
248
|
+
# Calculate current period stats
|
|
249
|
+
current_start = current_period_end - timedelta(days=period_days - 1)
|
|
250
|
+
current_stats = self.calculate_usage_stats(
|
|
251
|
+
current_start,
|
|
252
|
+
current_period_end
|
|
253
|
+
)
|
|
254
|
+
|
|
255
|
+
# Calculate previous period stats
|
|
256
|
+
previous_end = current_start - timedelta(days=1)
|
|
257
|
+
previous_start = previous_end - timedelta(days=period_days - 1)
|
|
258
|
+
previous_stats = self.calculate_usage_stats(
|
|
259
|
+
previous_start,
|
|
260
|
+
previous_end
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
# Calculate growth rates using domain functions (pure logic)
|
|
264
|
+
mau_growth = calculate_growth_rate(
|
|
265
|
+
current_stats["mau"],
|
|
266
|
+
previous_stats["mau"]
|
|
267
|
+
)
|
|
268
|
+
|
|
269
|
+
scan_growth = calculate_growth_rate(
|
|
270
|
+
current_stats["total_scans"],
|
|
271
|
+
previous_stats["total_scans"]
|
|
272
|
+
)
|
|
273
|
+
|
|
274
|
+
user_growth = calculate_growth_rate(
|
|
275
|
+
current_stats["unique_users"],
|
|
276
|
+
previous_stats["unique_users"]
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
result = {
|
|
280
|
+
"current_period": {
|
|
281
|
+
"start": current_start.isoformat(),
|
|
282
|
+
"end": current_period_end.isoformat(),
|
|
283
|
+
"mau": current_stats["mau"],
|
|
284
|
+
"total_scans": current_stats["total_scans"],
|
|
285
|
+
"unique_users": current_stats["unique_users"]
|
|
286
|
+
},
|
|
287
|
+
"previous_period": {
|
|
288
|
+
"start": previous_start.isoformat(),
|
|
289
|
+
"end": previous_end.isoformat(),
|
|
290
|
+
"mau": previous_stats["mau"],
|
|
291
|
+
"total_scans": previous_stats["total_scans"],
|
|
292
|
+
"unique_users": previous_stats["unique_users"]
|
|
293
|
+
},
|
|
294
|
+
"growth": {
|
|
295
|
+
"mau_growth_rate": round(mau_growth, 2),
|
|
296
|
+
"scan_growth_rate": round(scan_growth, 2),
|
|
297
|
+
"user_growth_rate": round(user_growth, 2)
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
logger.info(
|
|
302
|
+
f"Growth metrics: MAU={mau_growth:.1f}%, "
|
|
303
|
+
f"scans={scan_growth:.1f}%, users={user_growth:.1f}%"
|
|
304
|
+
)
|
|
305
|
+
|
|
306
|
+
return result
|
|
307
|
+
|
|
308
|
+
except Exception as e:
|
|
309
|
+
logger.error(f"Failed to calculate growth metrics: {e}")
|
|
310
|
+
raise
|
|
311
|
+
|
|
312
|
+
def calculate_user_percentiles(
|
|
313
|
+
self,
|
|
314
|
+
metric: str,
|
|
315
|
+
*,
|
|
316
|
+
start_date: date | None = None,
|
|
317
|
+
end_date: date | None = None
|
|
318
|
+
) -> dict[str, Any]:
|
|
319
|
+
"""Calculate percentiles for a user metric.
|
|
320
|
+
|
|
321
|
+
Args:
|
|
322
|
+
metric: Metric to calculate percentiles for ("scans", "threats")
|
|
323
|
+
start_date: Optional start date filter
|
|
324
|
+
end_date: Optional end date filter
|
|
325
|
+
|
|
326
|
+
Returns:
|
|
327
|
+
Dictionary with percentile values (p50, p75, p95, p99)
|
|
328
|
+
|
|
329
|
+
Raises:
|
|
330
|
+
ValueError: If metric is not supported
|
|
331
|
+
|
|
332
|
+
Example:
|
|
333
|
+
>>> service = StatisticsService(repo)
|
|
334
|
+
>>> percentiles = service.calculate_user_percentiles("scans")
|
|
335
|
+
>>> print(f"Median scans: {percentiles['p50']}")
|
|
336
|
+
>>> print(f"P95 scans: {percentiles['p95']}")
|
|
337
|
+
"""
|
|
338
|
+
if metric not in ("scans", "threats"):
|
|
339
|
+
raise ValueError(
|
|
340
|
+
f"Invalid metric: {metric}. Must be 'scans' or 'threats'"
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
if end_date is None:
|
|
344
|
+
end_date = date.today()
|
|
345
|
+
if start_date is None:
|
|
346
|
+
start_date = end_date - timedelta(days=30)
|
|
347
|
+
|
|
348
|
+
try:
|
|
349
|
+
# Get all users and their activity
|
|
350
|
+
events = self.repository.get_scan_events(
|
|
351
|
+
start_date=start_date,
|
|
352
|
+
end_date=end_date
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
if not events:
|
|
356
|
+
logger.info("No events for percentile calculation")
|
|
357
|
+
return {
|
|
358
|
+
"metric": metric,
|
|
359
|
+
"p50": 0,
|
|
360
|
+
"p75": 0,
|
|
361
|
+
"p95": 0,
|
|
362
|
+
"p99": 0
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
# Count metric per user
|
|
366
|
+
user_counts = {}
|
|
367
|
+
for event in events:
|
|
368
|
+
user_id = event.installation_id
|
|
369
|
+
if user_id not in user_counts:
|
|
370
|
+
user_counts[user_id] = {"scans": 0, "threats": 0}
|
|
371
|
+
|
|
372
|
+
user_counts[user_id]["scans"] += 1
|
|
373
|
+
if event.has_threats:
|
|
374
|
+
user_counts[user_id]["threats"] += 1
|
|
375
|
+
|
|
376
|
+
# Extract values and sort
|
|
377
|
+
values = sorted([
|
|
378
|
+
counts[metric] for counts in user_counts.values()
|
|
379
|
+
])
|
|
380
|
+
|
|
381
|
+
if not values:
|
|
382
|
+
return {
|
|
383
|
+
"metric": metric,
|
|
384
|
+
"p50": 0,
|
|
385
|
+
"p75": 0,
|
|
386
|
+
"p95": 0,
|
|
387
|
+
"p99": 0
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
# Calculate percentiles
|
|
391
|
+
def percentile(sorted_values: list, p: float) -> int:
|
|
392
|
+
"""Calculate percentile from sorted values."""
|
|
393
|
+
if not sorted_values:
|
|
394
|
+
return 0
|
|
395
|
+
idx = int(len(sorted_values) * p)
|
|
396
|
+
idx = min(idx, len(sorted_values) - 1)
|
|
397
|
+
return sorted_values[idx]
|
|
398
|
+
|
|
399
|
+
result = {
|
|
400
|
+
"metric": metric,
|
|
401
|
+
"start_date": start_date.isoformat(),
|
|
402
|
+
"end_date": end_date.isoformat(),
|
|
403
|
+
"total_users": len(values),
|
|
404
|
+
"p50": percentile(values, 0.50),
|
|
405
|
+
"p75": percentile(values, 0.75),
|
|
406
|
+
"p95": percentile(values, 0.95),
|
|
407
|
+
"p99": percentile(values, 0.99)
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
logger.info(
|
|
411
|
+
f"Percentiles for {metric}: "
|
|
412
|
+
f"p50={result['p50']}, p95={result['p95']}, p99={result['p99']}"
|
|
413
|
+
)
|
|
414
|
+
|
|
415
|
+
return result
|
|
416
|
+
|
|
417
|
+
except Exception as e:
|
|
418
|
+
logger.error(f"Failed to calculate percentiles: {e}")
|
|
419
|
+
raise
|