crackerjack 0.37.9__py3-none-any.whl → 0.45.2__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.
- crackerjack/README.md +19 -0
- crackerjack/__init__.py +30 -1
- crackerjack/__main__.py +342 -1263
- crackerjack/adapters/README.md +18 -0
- crackerjack/adapters/__init__.py +27 -5
- crackerjack/adapters/_output_paths.py +167 -0
- crackerjack/adapters/_qa_adapter_base.py +309 -0
- crackerjack/adapters/_tool_adapter_base.py +706 -0
- crackerjack/adapters/ai/README.md +65 -0
- crackerjack/adapters/ai/__init__.py +5 -0
- crackerjack/adapters/ai/claude.py +853 -0
- crackerjack/adapters/complexity/README.md +53 -0
- crackerjack/adapters/complexity/__init__.py +10 -0
- crackerjack/adapters/complexity/complexipy.py +641 -0
- crackerjack/adapters/dependency/__init__.py +22 -0
- crackerjack/adapters/dependency/pip_audit.py +418 -0
- crackerjack/adapters/format/README.md +72 -0
- crackerjack/adapters/format/__init__.py +11 -0
- crackerjack/adapters/format/mdformat.py +313 -0
- crackerjack/adapters/format/ruff.py +516 -0
- crackerjack/adapters/lint/README.md +47 -0
- crackerjack/adapters/lint/__init__.py +11 -0
- crackerjack/adapters/lint/codespell.py +273 -0
- crackerjack/adapters/lsp/README.md +49 -0
- crackerjack/adapters/lsp/__init__.py +27 -0
- crackerjack/adapters/{rust_tool_manager.py → lsp/_manager.py} +3 -3
- crackerjack/adapters/{skylos_adapter.py → lsp/skylos.py} +59 -7
- crackerjack/adapters/{zuban_adapter.py → lsp/zuban.py} +3 -6
- crackerjack/adapters/refactor/README.md +59 -0
- crackerjack/adapters/refactor/__init__.py +12 -0
- crackerjack/adapters/refactor/creosote.py +318 -0
- crackerjack/adapters/refactor/refurb.py +406 -0
- crackerjack/adapters/refactor/skylos.py +494 -0
- crackerjack/adapters/sast/README.md +132 -0
- crackerjack/adapters/sast/__init__.py +32 -0
- crackerjack/adapters/sast/_base.py +201 -0
- crackerjack/adapters/sast/bandit.py +423 -0
- crackerjack/adapters/sast/pyscn.py +405 -0
- crackerjack/adapters/sast/semgrep.py +241 -0
- crackerjack/adapters/security/README.md +111 -0
- crackerjack/adapters/security/__init__.py +17 -0
- crackerjack/adapters/security/gitleaks.py +339 -0
- crackerjack/adapters/type/README.md +52 -0
- crackerjack/adapters/type/__init__.py +12 -0
- crackerjack/adapters/type/pyrefly.py +402 -0
- crackerjack/adapters/type/ty.py +402 -0
- crackerjack/adapters/type/zuban.py +522 -0
- crackerjack/adapters/utility/README.md +51 -0
- crackerjack/adapters/utility/__init__.py +10 -0
- crackerjack/adapters/utility/checks.py +884 -0
- crackerjack/agents/README.md +264 -0
- crackerjack/agents/__init__.py +40 -12
- crackerjack/agents/base.py +1 -0
- crackerjack/agents/claude_code_bridge.py +641 -0
- crackerjack/agents/coordinator.py +49 -53
- crackerjack/agents/dry_agent.py +187 -3
- crackerjack/agents/enhanced_coordinator.py +279 -0
- crackerjack/agents/enhanced_proactive_agent.py +185 -0
- crackerjack/agents/error_middleware.py +53 -0
- crackerjack/agents/formatting_agent.py +6 -8
- crackerjack/agents/helpers/__init__.py +9 -0
- crackerjack/agents/helpers/performance/__init__.py +22 -0
- crackerjack/agents/helpers/performance/performance_ast_analyzer.py +357 -0
- crackerjack/agents/helpers/performance/performance_pattern_detector.py +909 -0
- crackerjack/agents/helpers/performance/performance_recommender.py +572 -0
- crackerjack/agents/helpers/refactoring/__init__.py +22 -0
- crackerjack/agents/helpers/refactoring/code_transformer.py +536 -0
- crackerjack/agents/helpers/refactoring/complexity_analyzer.py +344 -0
- crackerjack/agents/helpers/refactoring/dead_code_detector.py +437 -0
- crackerjack/agents/helpers/test_creation/__init__.py +19 -0
- crackerjack/agents/helpers/test_creation/test_ast_analyzer.py +216 -0
- crackerjack/agents/helpers/test_creation/test_coverage_analyzer.py +643 -0
- crackerjack/agents/helpers/test_creation/test_template_generator.py +1031 -0
- crackerjack/agents/performance_agent.py +121 -1152
- crackerjack/agents/refactoring_agent.py +156 -655
- crackerjack/agents/semantic_agent.py +479 -0
- crackerjack/agents/semantic_helpers.py +356 -0
- crackerjack/agents/test_creation_agent.py +19 -1605
- crackerjack/api.py +5 -7
- crackerjack/cli/README.md +394 -0
- crackerjack/cli/__init__.py +1 -1
- crackerjack/cli/cache_handlers.py +23 -18
- crackerjack/cli/cache_handlers_enhanced.py +1 -4
- crackerjack/cli/facade.py +70 -8
- crackerjack/cli/formatting.py +13 -0
- crackerjack/cli/handlers/__init__.py +85 -0
- crackerjack/cli/handlers/advanced.py +103 -0
- crackerjack/cli/handlers/ai_features.py +62 -0
- crackerjack/cli/handlers/analytics.py +479 -0
- crackerjack/cli/handlers/changelog.py +271 -0
- crackerjack/cli/handlers/config_handlers.py +16 -0
- crackerjack/cli/handlers/coverage.py +84 -0
- crackerjack/cli/handlers/documentation.py +280 -0
- crackerjack/cli/handlers/main_handlers.py +497 -0
- crackerjack/cli/handlers/monitoring.py +371 -0
- crackerjack/cli/handlers.py +249 -49
- crackerjack/cli/interactive.py +8 -5
- crackerjack/cli/options.py +203 -110
- crackerjack/cli/semantic_handlers.py +292 -0
- crackerjack/cli/version.py +19 -0
- crackerjack/code_cleaner.py +60 -24
- crackerjack/config/README.md +472 -0
- crackerjack/config/__init__.py +256 -0
- crackerjack/config/global_lock_config.py +191 -54
- crackerjack/config/hooks.py +188 -16
- crackerjack/config/loader.py +239 -0
- crackerjack/config/settings.py +141 -0
- crackerjack/config/tool_commands.py +331 -0
- crackerjack/core/README.md +393 -0
- crackerjack/core/async_workflow_orchestrator.py +79 -53
- crackerjack/core/autofix_coordinator.py +22 -9
- crackerjack/core/container.py +10 -9
- crackerjack/core/enhanced_container.py +9 -9
- crackerjack/core/performance.py +1 -1
- crackerjack/core/performance_monitor.py +5 -3
- crackerjack/core/phase_coordinator.py +1018 -634
- crackerjack/core/proactive_workflow.py +3 -3
- crackerjack/core/retry.py +275 -0
- crackerjack/core/service_watchdog.py +167 -23
- crackerjack/core/session_coordinator.py +187 -382
- crackerjack/core/timeout_manager.py +161 -44
- crackerjack/core/workflow/__init__.py +21 -0
- crackerjack/core/workflow/workflow_ai_coordinator.py +863 -0
- crackerjack/core/workflow/workflow_event_orchestrator.py +1107 -0
- crackerjack/core/workflow/workflow_issue_parser.py +714 -0
- crackerjack/core/workflow/workflow_phase_executor.py +1158 -0
- crackerjack/core/workflow/workflow_security_gates.py +400 -0
- crackerjack/core/workflow_orchestrator.py +1247 -953
- crackerjack/data/README.md +11 -0
- crackerjack/data/__init__.py +8 -0
- crackerjack/data/models.py +79 -0
- crackerjack/data/repository.py +210 -0
- crackerjack/decorators/README.md +180 -0
- crackerjack/decorators/__init__.py +35 -0
- crackerjack/decorators/error_handling.py +649 -0
- crackerjack/decorators/error_handling_decorators.py +334 -0
- crackerjack/decorators/helpers.py +58 -0
- crackerjack/decorators/patterns.py +281 -0
- crackerjack/decorators/utils.py +58 -0
- crackerjack/docs/README.md +11 -0
- crackerjack/docs/generated/api/CLI_REFERENCE.md +1 -1
- crackerjack/documentation/README.md +11 -0
- crackerjack/documentation/ai_templates.py +1 -1
- crackerjack/documentation/dual_output_generator.py +11 -9
- crackerjack/documentation/reference_generator.py +104 -59
- crackerjack/dynamic_config.py +52 -61
- crackerjack/errors.py +1 -1
- crackerjack/events/README.md +11 -0
- crackerjack/events/__init__.py +16 -0
- crackerjack/events/telemetry.py +175 -0
- crackerjack/events/workflow_bus.py +346 -0
- crackerjack/exceptions/README.md +301 -0
- crackerjack/exceptions/__init__.py +5 -0
- crackerjack/exceptions/config.py +4 -0
- crackerjack/exceptions/tool_execution_error.py +245 -0
- crackerjack/executors/README.md +591 -0
- crackerjack/executors/__init__.py +2 -0
- crackerjack/executors/async_hook_executor.py +539 -77
- crackerjack/executors/cached_hook_executor.py +3 -3
- crackerjack/executors/hook_executor.py +967 -102
- crackerjack/executors/hook_lock_manager.py +31 -22
- crackerjack/executors/individual_hook_executor.py +66 -32
- crackerjack/executors/lsp_aware_hook_executor.py +136 -57
- crackerjack/executors/progress_hook_executor.py +282 -0
- crackerjack/executors/tool_proxy.py +23 -7
- crackerjack/hooks/README.md +485 -0
- crackerjack/hooks/lsp_hook.py +8 -9
- crackerjack/intelligence/README.md +557 -0
- crackerjack/interactive.py +37 -10
- crackerjack/managers/README.md +369 -0
- crackerjack/managers/async_hook_manager.py +41 -57
- crackerjack/managers/hook_manager.py +449 -79
- crackerjack/managers/publish_manager.py +81 -36
- crackerjack/managers/test_command_builder.py +290 -12
- crackerjack/managers/test_executor.py +93 -8
- crackerjack/managers/test_manager.py +1082 -75
- crackerjack/managers/test_progress.py +118 -26
- crackerjack/mcp/README.md +374 -0
- crackerjack/mcp/cache.py +25 -2
- crackerjack/mcp/client_runner.py +35 -18
- crackerjack/mcp/context.py +9 -9
- crackerjack/mcp/dashboard.py +24 -8
- crackerjack/mcp/enhanced_progress_monitor.py +34 -23
- crackerjack/mcp/file_monitor.py +27 -6
- crackerjack/mcp/progress_components.py +45 -34
- crackerjack/mcp/progress_monitor.py +6 -9
- crackerjack/mcp/rate_limiter.py +11 -7
- crackerjack/mcp/server.py +2 -0
- crackerjack/mcp/server_core.py +187 -55
- crackerjack/mcp/service_watchdog.py +12 -9
- crackerjack/mcp/task_manager.py +2 -2
- crackerjack/mcp/tools/README.md +27 -0
- crackerjack/mcp/tools/__init__.py +2 -0
- crackerjack/mcp/tools/core_tools.py +75 -52
- crackerjack/mcp/tools/execution_tools.py +87 -31
- crackerjack/mcp/tools/intelligence_tools.py +2 -2
- crackerjack/mcp/tools/proactive_tools.py +1 -1
- crackerjack/mcp/tools/semantic_tools.py +584 -0
- crackerjack/mcp/tools/utility_tools.py +180 -132
- crackerjack/mcp/tools/workflow_executor.py +87 -46
- crackerjack/mcp/websocket/README.md +31 -0
- crackerjack/mcp/websocket/app.py +11 -1
- crackerjack/mcp/websocket/event_bridge.py +188 -0
- crackerjack/mcp/websocket/jobs.py +27 -4
- crackerjack/mcp/websocket/monitoring/__init__.py +25 -0
- crackerjack/mcp/websocket/monitoring/api/__init__.py +19 -0
- crackerjack/mcp/websocket/monitoring/api/dependencies.py +141 -0
- crackerjack/mcp/websocket/monitoring/api/heatmap.py +154 -0
- crackerjack/mcp/websocket/monitoring/api/intelligence.py +199 -0
- crackerjack/mcp/websocket/monitoring/api/metrics.py +203 -0
- crackerjack/mcp/websocket/monitoring/api/telemetry.py +101 -0
- crackerjack/mcp/websocket/monitoring/dashboard.py +18 -0
- crackerjack/mcp/websocket/monitoring/factory.py +109 -0
- crackerjack/mcp/websocket/monitoring/filters.py +10 -0
- crackerjack/mcp/websocket/monitoring/metrics.py +64 -0
- crackerjack/mcp/websocket/monitoring/models.py +90 -0
- crackerjack/mcp/websocket/monitoring/utils.py +171 -0
- crackerjack/mcp/websocket/monitoring/websocket_manager.py +78 -0
- crackerjack/mcp/websocket/monitoring/websockets/__init__.py +17 -0
- crackerjack/mcp/websocket/monitoring/websockets/dependencies.py +126 -0
- crackerjack/mcp/websocket/monitoring/websockets/heatmap.py +176 -0
- crackerjack/mcp/websocket/monitoring/websockets/intelligence.py +291 -0
- crackerjack/mcp/websocket/monitoring/websockets/metrics.py +291 -0
- crackerjack/mcp/websocket/monitoring_endpoints.py +16 -2930
- crackerjack/mcp/websocket/server.py +1 -3
- crackerjack/mcp/websocket/websocket_handler.py +107 -6
- crackerjack/models/README.md +308 -0
- crackerjack/models/__init__.py +10 -1
- crackerjack/models/config.py +639 -22
- crackerjack/models/config_adapter.py +6 -6
- crackerjack/models/protocols.py +1167 -23
- crackerjack/models/pydantic_models.py +320 -0
- crackerjack/models/qa_config.py +145 -0
- crackerjack/models/qa_results.py +134 -0
- crackerjack/models/results.py +35 -0
- crackerjack/models/semantic_models.py +258 -0
- crackerjack/models/task.py +19 -3
- crackerjack/models/test_models.py +60 -0
- crackerjack/monitoring/README.md +11 -0
- crackerjack/monitoring/ai_agent_watchdog.py +5 -4
- crackerjack/monitoring/metrics_collector.py +4 -3
- crackerjack/monitoring/regression_prevention.py +4 -3
- crackerjack/monitoring/websocket_server.py +4 -241
- crackerjack/orchestration/README.md +340 -0
- crackerjack/orchestration/__init__.py +43 -0
- crackerjack/orchestration/advanced_orchestrator.py +20 -67
- crackerjack/orchestration/cache/README.md +312 -0
- crackerjack/orchestration/cache/__init__.py +37 -0
- crackerjack/orchestration/cache/memory_cache.py +338 -0
- crackerjack/orchestration/cache/tool_proxy_cache.py +340 -0
- crackerjack/orchestration/config.py +297 -0
- crackerjack/orchestration/coverage_improvement.py +13 -6
- crackerjack/orchestration/execution_strategies.py +6 -6
- crackerjack/orchestration/hook_orchestrator.py +1398 -0
- crackerjack/orchestration/strategies/README.md +401 -0
- crackerjack/orchestration/strategies/__init__.py +39 -0
- crackerjack/orchestration/strategies/adaptive_strategy.py +630 -0
- crackerjack/orchestration/strategies/parallel_strategy.py +237 -0
- crackerjack/orchestration/strategies/sequential_strategy.py +299 -0
- crackerjack/orchestration/test_progress_streamer.py +1 -1
- crackerjack/plugins/README.md +11 -0
- crackerjack/plugins/hooks.py +3 -2
- crackerjack/plugins/loader.py +3 -3
- crackerjack/plugins/managers.py +1 -1
- crackerjack/py313.py +191 -0
- crackerjack/security/README.md +11 -0
- crackerjack/services/README.md +374 -0
- crackerjack/services/__init__.py +8 -21
- crackerjack/services/ai/README.md +295 -0
- crackerjack/services/ai/__init__.py +7 -0
- crackerjack/services/ai/advanced_optimizer.py +878 -0
- crackerjack/services/{contextual_ai_assistant.py → ai/contextual_ai_assistant.py} +5 -3
- crackerjack/services/ai/embeddings.py +444 -0
- crackerjack/services/ai/intelligent_commit.py +328 -0
- crackerjack/services/ai/predictive_analytics.py +510 -0
- crackerjack/services/api_extractor.py +5 -3
- crackerjack/services/bounded_status_operations.py +45 -5
- crackerjack/services/cache.py +249 -318
- crackerjack/services/changelog_automation.py +7 -3
- crackerjack/services/command_execution_service.py +305 -0
- crackerjack/services/config_integrity.py +83 -39
- crackerjack/services/config_merge.py +9 -6
- crackerjack/services/config_service.py +198 -0
- crackerjack/services/config_template.py +13 -26
- crackerjack/services/coverage_badge_service.py +6 -4
- crackerjack/services/coverage_ratchet.py +53 -27
- crackerjack/services/debug.py +18 -7
- crackerjack/services/dependency_analyzer.py +4 -4
- crackerjack/services/dependency_monitor.py +13 -13
- crackerjack/services/documentation_generator.py +4 -2
- crackerjack/services/documentation_service.py +62 -33
- crackerjack/services/enhanced_filesystem.py +81 -27
- crackerjack/services/enterprise_optimizer.py +1 -1
- crackerjack/services/error_pattern_analyzer.py +10 -10
- crackerjack/services/file_filter.py +221 -0
- crackerjack/services/file_hasher.py +5 -7
- crackerjack/services/file_io_service.py +361 -0
- crackerjack/services/file_modifier.py +615 -0
- crackerjack/services/filesystem.py +80 -109
- crackerjack/services/git.py +99 -5
- crackerjack/services/health_metrics.py +4 -6
- crackerjack/services/heatmap_generator.py +12 -3
- crackerjack/services/incremental_executor.py +380 -0
- crackerjack/services/initialization.py +101 -49
- crackerjack/services/log_manager.py +2 -2
- crackerjack/services/logging.py +120 -68
- crackerjack/services/lsp_client.py +12 -12
- crackerjack/services/memory_optimizer.py +27 -22
- crackerjack/services/monitoring/README.md +30 -0
- crackerjack/services/monitoring/__init__.py +9 -0
- crackerjack/services/monitoring/dependency_monitor.py +678 -0
- crackerjack/services/monitoring/error_pattern_analyzer.py +676 -0
- crackerjack/services/monitoring/health_metrics.py +716 -0
- crackerjack/services/monitoring/metrics.py +587 -0
- crackerjack/services/{performance_benchmarks.py → monitoring/performance_benchmarks.py} +100 -14
- crackerjack/services/{performance_cache.py → monitoring/performance_cache.py} +21 -15
- crackerjack/services/{performance_monitor.py → monitoring/performance_monitor.py} +10 -6
- crackerjack/services/parallel_executor.py +166 -55
- crackerjack/services/patterns/__init__.py +142 -0
- crackerjack/services/patterns/agents.py +107 -0
- crackerjack/services/patterns/code/__init__.py +15 -0
- crackerjack/services/patterns/code/detection.py +118 -0
- crackerjack/services/patterns/code/imports.py +107 -0
- crackerjack/services/patterns/code/paths.py +159 -0
- crackerjack/services/patterns/code/performance.py +119 -0
- crackerjack/services/patterns/code/replacement.py +36 -0
- crackerjack/services/patterns/core.py +212 -0
- crackerjack/services/patterns/documentation/__init__.py +14 -0
- crackerjack/services/patterns/documentation/badges_markdown.py +96 -0
- crackerjack/services/patterns/documentation/comments_blocks.py +83 -0
- crackerjack/services/patterns/documentation/docstrings.py +89 -0
- crackerjack/services/patterns/formatting.py +226 -0
- crackerjack/services/patterns/operations.py +339 -0
- crackerjack/services/patterns/security/__init__.py +23 -0
- crackerjack/services/patterns/security/code_injection.py +122 -0
- crackerjack/services/patterns/security/credentials.py +190 -0
- crackerjack/services/patterns/security/path_traversal.py +221 -0
- crackerjack/services/patterns/security/unsafe_operations.py +216 -0
- crackerjack/services/patterns/templates.py +62 -0
- crackerjack/services/patterns/testing/__init__.py +18 -0
- crackerjack/services/patterns/testing/error_patterns.py +107 -0
- crackerjack/services/patterns/testing/pytest_output.py +126 -0
- crackerjack/services/patterns/tool_output/__init__.py +16 -0
- crackerjack/services/patterns/tool_output/bandit.py +72 -0
- crackerjack/services/patterns/tool_output/other.py +97 -0
- crackerjack/services/patterns/tool_output/pyright.py +67 -0
- crackerjack/services/patterns/tool_output/ruff.py +44 -0
- crackerjack/services/patterns/url_sanitization.py +114 -0
- crackerjack/services/patterns/utilities.py +42 -0
- crackerjack/services/patterns/utils.py +339 -0
- crackerjack/services/patterns/validation.py +46 -0
- crackerjack/services/patterns/versioning.py +62 -0
- crackerjack/services/predictive_analytics.py +21 -8
- crackerjack/services/profiler.py +280 -0
- crackerjack/services/quality/README.md +415 -0
- crackerjack/services/quality/__init__.py +11 -0
- crackerjack/services/quality/anomaly_detector.py +392 -0
- crackerjack/services/quality/pattern_cache.py +333 -0
- crackerjack/services/quality/pattern_detector.py +479 -0
- crackerjack/services/quality/qa_orchestrator.py +491 -0
- crackerjack/services/{quality_baseline.py → quality/quality_baseline.py} +163 -2
- crackerjack/services/{quality_baseline_enhanced.py → quality/quality_baseline_enhanced.py} +4 -1
- crackerjack/services/{quality_intelligence.py → quality/quality_intelligence.py} +180 -16
- crackerjack/services/regex_patterns.py +58 -2987
- crackerjack/services/regex_utils.py +55 -29
- crackerjack/services/secure_status_formatter.py +42 -15
- crackerjack/services/secure_subprocess.py +35 -2
- crackerjack/services/security.py +16 -8
- crackerjack/services/server_manager.py +40 -51
- crackerjack/services/smart_scheduling.py +46 -6
- crackerjack/services/status_authentication.py +3 -3
- crackerjack/services/thread_safe_status_collector.py +1 -0
- crackerjack/services/tool_filter.py +368 -0
- crackerjack/services/tool_version_service.py +9 -5
- crackerjack/services/unified_config.py +43 -351
- crackerjack/services/vector_store.py +689 -0
- crackerjack/services/version_analyzer.py +6 -4
- crackerjack/services/version_checker.py +14 -8
- crackerjack/services/zuban_lsp_service.py +5 -4
- crackerjack/slash_commands/README.md +11 -0
- crackerjack/slash_commands/init.md +2 -12
- crackerjack/slash_commands/run.md +84 -50
- crackerjack/tools/README.md +11 -0
- crackerjack/tools/__init__.py +30 -0
- crackerjack/tools/_git_utils.py +105 -0
- crackerjack/tools/check_added_large_files.py +139 -0
- crackerjack/tools/check_ast.py +105 -0
- crackerjack/tools/check_json.py +103 -0
- crackerjack/tools/check_jsonschema.py +297 -0
- crackerjack/tools/check_toml.py +103 -0
- crackerjack/tools/check_yaml.py +110 -0
- crackerjack/tools/codespell_wrapper.py +72 -0
- crackerjack/tools/end_of_file_fixer.py +202 -0
- crackerjack/tools/format_json.py +128 -0
- crackerjack/tools/mdformat_wrapper.py +114 -0
- crackerjack/tools/trailing_whitespace.py +198 -0
- crackerjack/tools/validate_regex_patterns.py +7 -3
- crackerjack/ui/README.md +11 -0
- crackerjack/ui/dashboard_renderer.py +28 -0
- crackerjack/ui/templates/README.md +11 -0
- crackerjack/utils/console_utils.py +13 -0
- crackerjack/utils/dependency_guard.py +230 -0
- crackerjack/utils/retry_utils.py +275 -0
- crackerjack/workflows/README.md +590 -0
- crackerjack/workflows/__init__.py +46 -0
- crackerjack/workflows/actions.py +811 -0
- crackerjack/workflows/auto_fix.py +444 -0
- crackerjack/workflows/container_builder.py +499 -0
- crackerjack/workflows/definitions.py +443 -0
- crackerjack/workflows/engine.py +177 -0
- crackerjack/workflows/event_bridge.py +242 -0
- {crackerjack-0.37.9.dist-info → crackerjack-0.45.2.dist-info}/METADATA +678 -98
- crackerjack-0.45.2.dist-info/RECORD +478 -0
- {crackerjack-0.37.9.dist-info → crackerjack-0.45.2.dist-info}/WHEEL +1 -1
- crackerjack/managers/test_manager_backup.py +0 -1075
- crackerjack/mcp/tools/execution_tools_backup.py +0 -1011
- crackerjack/mixins/__init__.py +0 -3
- crackerjack/mixins/error_handling.py +0 -145
- crackerjack/services/config.py +0 -358
- crackerjack/ui/server_panels.py +0 -125
- crackerjack-0.37.9.dist-info/RECORD +0 -231
- /crackerjack/adapters/{rust_tool_adapter.py → lsp/_base.py} +0 -0
- /crackerjack/adapters/{lsp_client.py → lsp/_client.py} +0 -0
- {crackerjack-0.37.9.dist-info → crackerjack-0.45.2.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.37.9.dist-info → crackerjack-0.45.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crackerjack
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.45.2
|
|
4
4
|
Summary: Crackerjack Python project management tool
|
|
5
5
|
Project-URL: documentation, https://github.com/lesleslie/crackerjack
|
|
6
6
|
Project-URL: homepage, https://github.com/lesleslie/crackerjack
|
|
@@ -18,62 +18,76 @@ Classifier: Topic :: Software Development :: Testing
|
|
|
18
18
|
Classifier: Topic :: Utilities
|
|
19
19
|
Classifier: Typing :: Typed
|
|
20
20
|
Requires-Python: >=3.13
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
21
|
+
Requires-Dist: acb>=0.31.18
|
|
22
|
+
Requires-Dist: aiofiles>=25.1.0
|
|
23
|
+
Requires-Dist: aiohttp>=3.13.2
|
|
24
|
+
Requires-Dist: bandit>=1.9.2
|
|
25
|
+
Requires-Dist: bevy>=3.1.0b12
|
|
24
26
|
Requires-Dist: codespell>=2.4.1
|
|
25
|
-
Requires-Dist: complexipy>=
|
|
26
|
-
Requires-Dist: creosote>=4.0
|
|
27
|
-
Requires-Dist: fastapi>=0.
|
|
28
|
-
Requires-Dist: fastmcp>=2.
|
|
29
|
-
Requires-Dist: hatchling>=1.
|
|
30
|
-
Requires-Dist: hypothesis>=6.
|
|
31
|
-
Requires-Dist: jinja2>=3.1
|
|
32
|
-
Requires-Dist: keyring>=25.
|
|
33
|
-
Requires-Dist: mcp>=
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
27
|
+
Requires-Dist: complexipy>=5.1.0
|
|
28
|
+
Requires-Dist: creosote>=4.1.0
|
|
29
|
+
Requires-Dist: fastapi>=0.124.0
|
|
30
|
+
Requires-Dist: fastmcp>=2.13.2
|
|
31
|
+
Requires-Dist: hatchling>=1.28.0
|
|
32
|
+
Requires-Dist: hypothesis>=6.148.7
|
|
33
|
+
Requires-Dist: jinja2>=3.1.6
|
|
34
|
+
Requires-Dist: keyring>=25.7.0
|
|
35
|
+
Requires-Dist: mcp-common>=0.3.3
|
|
36
|
+
Requires-Dist: mcp>=1.23.3
|
|
37
|
+
Requires-Dist: mdformat-ruff>=0.1.3
|
|
38
|
+
Requires-Dist: mdformat>=1.0.0
|
|
39
|
+
Requires-Dist: nltk>=3.9.2
|
|
40
|
+
Requires-Dist: numpy>=2.3.5
|
|
41
|
+
Requires-Dist: onnxruntime>=1.23.2
|
|
42
|
+
Requires-Dist: pip-audit>=2.10.0
|
|
43
|
+
Requires-Dist: psutil>=7.1.3
|
|
44
|
+
Requires-Dist: pydantic>=2.12.5
|
|
37
45
|
Requires-Dist: pyleak>=0.1.14
|
|
38
|
-
Requires-Dist: pyright>=1.1.
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
Requires-Dist: pytest-
|
|
41
|
-
Requires-Dist: pytest-
|
|
42
|
-
Requires-Dist: pytest-
|
|
43
|
-
Requires-Dist: pytest-
|
|
44
|
-
Requires-Dist: pytest-
|
|
45
|
-
Requires-Dist: pytest>=8.
|
|
46
|
-
Requires-Dist:
|
|
47
|
-
Requires-Dist:
|
|
48
|
-
Requires-Dist:
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist:
|
|
51
|
-
Requires-Dist:
|
|
52
|
-
Requires-Dist:
|
|
53
|
-
Requires-Dist:
|
|
54
|
-
Requires-Dist:
|
|
55
|
-
Requires-Dist:
|
|
56
|
-
Requires-Dist:
|
|
57
|
-
Requires-Dist:
|
|
58
|
-
Requires-Dist:
|
|
59
|
-
Requires-Dist:
|
|
60
|
-
Requires-Dist:
|
|
61
|
-
Requires-Dist:
|
|
46
|
+
Requires-Dist: pyright>=1.1.407
|
|
47
|
+
Requires-Dist: pyscn>=1.5.0
|
|
48
|
+
Requires-Dist: pytest-asyncio>=1.3.0
|
|
49
|
+
Requires-Dist: pytest-benchmark>=5.2.3
|
|
50
|
+
Requires-Dist: pytest-cov>=7.0.0
|
|
51
|
+
Requires-Dist: pytest-mock>=3.15.1
|
|
52
|
+
Requires-Dist: pytest-timeout>=2.4.0
|
|
53
|
+
Requires-Dist: pytest-xdist>=3.8.0
|
|
54
|
+
Requires-Dist: pytest>=9.0.2
|
|
55
|
+
Requires-Dist: pyyaml>=6.0.3
|
|
56
|
+
Requires-Dist: refurb>=2.2.0
|
|
57
|
+
Requires-Dist: rich>=14.2.0
|
|
58
|
+
Requires-Dist: ruff>=0.14.8
|
|
59
|
+
Requires-Dist: scikit-learn>=1.7.2
|
|
60
|
+
Requires-Dist: scipy-stubs>=1.16.3.3
|
|
61
|
+
Requires-Dist: scipy>=1.16.3
|
|
62
|
+
Requires-Dist: session-mgmt-mcp>=0.9.8
|
|
63
|
+
Requires-Dist: skylos>=2.5.3
|
|
64
|
+
Requires-Dist: structlog>=25.5.0
|
|
65
|
+
Requires-Dist: textual>=6.8.0
|
|
66
|
+
Requires-Dist: tomli-w>=1.2.0
|
|
67
|
+
Requires-Dist: transformers>=4.57.3
|
|
68
|
+
Requires-Dist: typer>=0.20.0
|
|
69
|
+
Requires-Dist: types-aiofiles>=25.1.0.20251011
|
|
70
|
+
Requires-Dist: types-psutil>=7.1.3.20251202
|
|
71
|
+
Requires-Dist: types-pyyaml>=6.0.12.20250915
|
|
72
|
+
Requires-Dist: uv-bump>=0.3.2
|
|
73
|
+
Requires-Dist: uv>=0.9.16
|
|
74
|
+
Requires-Dist: uvicorn>=0.38.0
|
|
62
75
|
Requires-Dist: vulture>=2.14
|
|
63
|
-
Requires-Dist: watchdog>=6
|
|
76
|
+
Requires-Dist: watchdog>=6.0.0
|
|
64
77
|
Requires-Dist: websockets>=15.0.1
|
|
65
|
-
Requires-Dist: zuban>=0.0
|
|
78
|
+
Requires-Dist: zuban>=0.3.0
|
|
66
79
|
Description-Content-Type: text/markdown
|
|
67
80
|
|
|
68
81
|
# Crackerjack: Advanced AI-Driven Python Development Platform
|
|
69
82
|
|
|
83
|
+
[](https://github.com/lesleslie/crackerjack)
|
|
70
84
|
[](https://www.python.org/downloads/)
|
|
71
85
|
[](https://pytest.org)
|
|
72
86
|
[](https://github.com/astral-sh/ruff)
|
|
73
87
|
[](https://github.com/astral-sh/uv)
|
|
74
|
-
[](https://github.com/lesleslie/crackerjack)
|
|
75
89
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
76
|
-

|
|
77
91
|
|
|
78
92
|
## 🎯 Purpose
|
|
79
93
|
|
|
@@ -81,11 +95,11 @@ Description-Content-Type: text/markdown
|
|
|
81
95
|
|
|
82
96
|
### What is "Crackerjack"?
|
|
83
97
|
|
|
84
|
-
**
|
|
98
|
+
**crack·er·jack** ˈkra-kər-ˌjak (noun): *A person or thing of marked excellence or ability; first-rate; exceptional.*
|
|
85
99
|
|
|
86
100
|
Just as the name suggests, Crackerjack makes your Python projects first-rate through:
|
|
87
101
|
|
|
88
|
-
- **🧠 Proactive AI Architecture**:
|
|
102
|
+
- **🧠 Proactive AI Architecture**: 12 specialized AI agents prevent issues before they occur
|
|
89
103
|
- **⚡ Autonomous Quality**: Intelligent auto-fixing with architectural planning
|
|
90
104
|
- **🛡️ Zero-Compromise Standards**: 100% test coverage, complexity ≤15, security-first patterns
|
|
91
105
|
- **🔄 Learning System**: Gets smarter with every project, caching successful patterns
|
|
@@ -99,9 +113,9 @@ Just as the name suggests, Crackerjack makes your Python projects first-rate thr
|
|
|
99
113
|
|
|
100
114
|
```bash
|
|
101
115
|
# Traditional workflow
|
|
102
|
-
pip install black isort flake8 mypy pytest
|
|
116
|
+
pip install black isort flake8 mypy pytest
|
|
103
117
|
# Configure each tool individually
|
|
104
|
-
# Set up
|
|
118
|
+
# Set up git hooks manually
|
|
105
119
|
# Remember different commands for each tool
|
|
106
120
|
```
|
|
107
121
|
|
|
@@ -134,19 +148,130 @@ Crackerjack is built on the following core principles:
|
|
|
134
148
|
- **Auto-Discovery:** Prefer intelligent auto-discovery of configurations and settings over manual configuration whenever possible, reducing setup friction and configuration errors
|
|
135
149
|
- **Static Typing:** Static typing is essential for all development
|
|
136
150
|
|
|
151
|
+
## Crackerjack vs Pre-commit: Architecture & Features
|
|
152
|
+
|
|
153
|
+
Crackerjack and pre-commit solve related but different problems. While pre-commit is a language-agnostic git hook manager, Crackerjack is a comprehensive Python development platform with quality enforcement built-in.
|
|
154
|
+
|
|
155
|
+
### Architectural Differences
|
|
156
|
+
|
|
157
|
+
| Aspect | Pre-commit | Crackerjack |
|
|
158
|
+
|--------|-----------|-------------|
|
|
159
|
+
| **Execution Model** | Wrapper framework that spawns subprocesses for each hook | Direct tool invocation with ACB adapter architecture |
|
|
160
|
+
| **Concurrency** | Synchronous sequential execution (one hook at a time) | **Async-first with 11 concurrent adapters** - true parallel execution |
|
|
161
|
+
| **Performance** | Overhead from framework wrapper + subprocess spawning | Zero wrapper overhead, 70% cache hit rate, 50% faster workflows |
|
|
162
|
+
| **Language Focus** | Language-agnostic (Python, Go, Rust, Docker, etc.) | Python-first with native tool implementations |
|
|
163
|
+
| **Configuration** | YAML-based `.pre-commit-config.yaml` with repo URLs | Python-based configuration with intelligent defaults |
|
|
164
|
+
| **Hook Management** | Clones repos, manages environments per hook | Native Python tools + direct UV invocation |
|
|
165
|
+
|
|
166
|
+
### Feature Comparison
|
|
167
|
+
|
|
168
|
+
#### Quality Hooks & Tools
|
|
169
|
+
|
|
170
|
+
| Feature | Pre-commit | Crackerjack |
|
|
171
|
+
|---------|-----------|-------------|
|
|
172
|
+
| **Code Formatting** | ✅ Via hooks (black, ruff, etc.) | ✅ Native Ruff integration + mdformat |
|
|
173
|
+
| **Linting** | ✅ Via hooks (flake8, pylint, etc.) | ✅ Native Ruff + codespell |
|
|
174
|
+
| **Type Checking** | ✅ Via hooks (mypy, pyright) | ✅ **Zuban** (20-200x faster than pyright) |
|
|
175
|
+
| **Security Scanning** | ✅ Via hooks (bandit, gitleaks) | ✅ Native bandit + gitleaks integration |
|
|
176
|
+
| **Dead Code Detection** | ✅ Via vulture hook | ✅ **Skylos** (20x faster than vulture) |
|
|
177
|
+
| **Complexity Analysis** | ❌ Not built-in | ✅ Native complexipy integration |
|
|
178
|
+
| **Dependency Validation** | ❌ Not built-in | ✅ Native creosote unused dependency detection |
|
|
179
|
+
| **Custom Python Tools** | ✅ Via `repo: local` hooks | ✅ 6 native tools in `crackerjack/tools/` |
|
|
180
|
+
|
|
181
|
+
#### Development Workflow
|
|
182
|
+
|
|
183
|
+
| Feature | Pre-commit | Crackerjack |
|
|
184
|
+
|---------|-----------|-------------|
|
|
185
|
+
| **Git Integration** | ✅ Pre-commit, pre-push, commit-msg hooks | ✅ Git hooks + intelligent commit messages |
|
|
186
|
+
| **Testing Framework** | ❌ Not included | ✅ Built-in pytest with coverage ratchet |
|
|
187
|
+
| **CI/CD Integration** | ✅ Via `pre-commit run --all-files` | ✅ Unified `--ci` mode with quality + tests |
|
|
188
|
+
| **Version Management** | ❌ Not included | ✅ Intelligent version bumping + AI recommendations |
|
|
189
|
+
| **Publishing** | ❌ Not included | ✅ PyPI publishing with UV authentication |
|
|
190
|
+
| **Hook Stages** | ✅ Multiple stages (commit, push, merge, manual) | ✅ Fast (~5s) vs Comprehensive (~30s) strategies |
|
|
191
|
+
| **Retry Logic** | ❌ No built-in retry | ✅ Automatic retry for formatting hooks |
|
|
192
|
+
| **Parallel Execution** | ✅ Limited parallelism (sequential by default) | ✅ **Async-first architecture**: 11 concurrent adapters, 76% speedup |
|
|
193
|
+
|
|
194
|
+
#### Advanced Features
|
|
195
|
+
|
|
196
|
+
| Feature | Pre-commit | Crackerjack |
|
|
197
|
+
|---------|-----------|-------------|
|
|
198
|
+
| **AI Integration** | ❌ Not built-in | ✅ 12 specialized AI agents + auto-fixing |
|
|
199
|
+
| **Dependency Injection** | ❌ Not applicable | ✅ ACB framework with protocol-based DI |
|
|
200
|
+
| **Caching** | ✅ Per-file hash caching | ✅ Content-based caching (70% hit rate) |
|
|
201
|
+
| **MCP Server** | ❌ Not included | ✅ Built-in MCP server for Claude integration |
|
|
202
|
+
| **Monitoring Dashboard** | ❌ Not included | ✅ Real-time WebSocket dashboard |
|
|
203
|
+
| **Configuration Management** | ✅ YAML + `--config` flag | ✅ ACB Settings with YAML + local overrides |
|
|
204
|
+
| **Auto-Update** | ✅ `pre-commit autoupdate` | ⚠️ Manual UV dependency updates |
|
|
205
|
+
| **Language Support** | ✅ 15+ languages (Python, Go, Rust, Docker, etc.) | ✅ Python + external tools (gitleaks, etc.) |
|
|
206
|
+
|
|
207
|
+
#### Configuration & Ease of Use
|
|
208
|
+
|
|
209
|
+
| Feature | Pre-commit | Crackerjack |
|
|
210
|
+
|---------|-----------|-------------|
|
|
211
|
+
| **Setup Complexity** | Medium (YAML config + `pre-commit install`) | Low (single `python -m crackerjack`) |
|
|
212
|
+
| **Configuration Format** | YAML with repo URLs and hook IDs | Python settings with intelligent defaults |
|
|
213
|
+
| **Hook Discovery** | Manual (add repos to `.pre-commit-config.yaml`) | Automatic (17 tools pre-configured) |
|
|
214
|
+
| **Tool Installation** | Auto (pre-commit manages environments) | UV-based (one virtual environment) |
|
|
215
|
+
| **Learning Curve** | Medium (understand repos, hooks, stages) | Low (unified Python commands) |
|
|
216
|
+
|
|
217
|
+
### When to Use Each
|
|
218
|
+
|
|
219
|
+
**Choose Pre-commit when:**
|
|
220
|
+
|
|
221
|
+
- ✅ Working with multiple languages (Go, Rust, Docker, etc.)
|
|
222
|
+
- ✅ Need language-agnostic hook framework
|
|
223
|
+
- ✅ Want to use hooks from community repositories
|
|
224
|
+
- ✅ Polyglot projects requiring diverse tooling
|
|
225
|
+
- ✅ Simple YAML-based configuration preferred
|
|
226
|
+
|
|
227
|
+
**Choose Crackerjack when:**
|
|
228
|
+
|
|
229
|
+
- ✅ Python-focused development (Python 3.13+)
|
|
230
|
+
- ✅ Want comprehensive development platform (testing, publishing, AI)
|
|
231
|
+
- ✅ Need maximum performance (async architecture, Rust tools, caching, 11x parallelism)
|
|
232
|
+
- ✅ Desire AI-powered auto-fixing and recommendations
|
|
233
|
+
- ✅ Want unified workflow (quality + tests + publishing in one command)
|
|
234
|
+
- ✅ Prefer Python-based configuration over YAML
|
|
235
|
+
- ✅ Need advanced features (coverage ratchet, MCP integration, dashboards)
|
|
236
|
+
|
|
237
|
+
### Migration from Pre-commit
|
|
238
|
+
|
|
239
|
+
Crackerjack can **coexist** with pre-commit if needed, but most Python projects can fully migrate:
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
# Remove pre-commit (optional)
|
|
243
|
+
pre-commit uninstall
|
|
244
|
+
rm .pre-commit-config.yaml
|
|
245
|
+
|
|
246
|
+
# Install crackerjack
|
|
247
|
+
uv tool install crackerjack
|
|
248
|
+
|
|
249
|
+
# Run quality checks (replaces pre-commit run --all-files)
|
|
250
|
+
python -m crackerjack
|
|
251
|
+
|
|
252
|
+
# With tests (comprehensive workflow)
|
|
253
|
+
python -m crackerjack --run-tests
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Note**: Crackerjack Phase 8 successfully migrated from pre-commit framework to direct tool invocation, achieving 50% performance improvement while maintaining full compatibility with existing quality standards.
|
|
257
|
+
|
|
137
258
|
## Table of Contents
|
|
138
259
|
|
|
139
|
-
- [
|
|
140
|
-
- [
|
|
141
|
-
- [
|
|
142
|
-
- [
|
|
143
|
-
- [
|
|
144
|
-
- [
|
|
145
|
-
- [
|
|
146
|
-
- [
|
|
147
|
-
- [
|
|
148
|
-
- [
|
|
149
|
-
- [
|
|
260
|
+
- [Crackerjack vs Pre-commit](<#crackerjack-vs-pre-commit-architecture--features>)
|
|
261
|
+
- [Installation](<#installation>)
|
|
262
|
+
- [Quick Start](<#quick-start>)
|
|
263
|
+
- [AI Auto-Fix Features](<#ai-auto-fix-features>)
|
|
264
|
+
- [Core Workflow](<#core-workflow>)
|
|
265
|
+
- [Core Features](<#core-features>)
|
|
266
|
+
- [ACB Architecture & Performance](<#-acb-architecture--performance>)
|
|
267
|
+
- [Adapters](<#adapters>)
|
|
268
|
+
- [Configuration Management](<#-configuration-management-acb-settings--configuration-templates>)
|
|
269
|
+
- [MCP Server Configuration](<#mcp-server-configuration>)
|
|
270
|
+
- [Quality Hook Modes](<#quality-hook-modes>)
|
|
271
|
+
- [Command Reference](<#command-reference>)
|
|
272
|
+
- [Style Guide](<#style-guide>)
|
|
273
|
+
- [Publishing & Version Management](<#publishing--version-management>)
|
|
274
|
+
- [Troubleshooting](<#-troubleshooting>)
|
|
150
275
|
|
|
151
276
|
## Installation
|
|
152
277
|
|
|
@@ -158,14 +283,26 @@ Crackerjack is built on the following core principles:
|
|
|
158
283
|
### Install UV
|
|
159
284
|
|
|
160
285
|
```bash
|
|
286
|
+
# Recommended: Official installer script
|
|
287
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
288
|
+
|
|
289
|
+
# Alternative: Using pipx
|
|
161
290
|
pipx install uv
|
|
291
|
+
|
|
292
|
+
# Alternative: Using Homebrew (macOS)
|
|
293
|
+
brew install uv
|
|
162
294
|
```
|
|
163
295
|
|
|
164
296
|
### Install Crackerjack
|
|
165
297
|
|
|
166
298
|
```bash
|
|
299
|
+
# Recommended: Using UV (fastest)
|
|
300
|
+
uv tool install crackerjack
|
|
301
|
+
|
|
302
|
+
# Alternative: Using pip
|
|
167
303
|
pip install crackerjack
|
|
168
|
-
|
|
304
|
+
|
|
305
|
+
# For existing project: Add as dependency
|
|
169
306
|
uv add crackerjack
|
|
170
307
|
```
|
|
171
308
|
|
|
@@ -214,7 +351,7 @@ Limited tool-specific auto-fixes for simple formatting issues:
|
|
|
214
351
|
|
|
215
352
|
The AI agent intelligently fixes:
|
|
216
353
|
|
|
217
|
-
- **Type Errors (
|
|
354
|
+
- **Type Errors (zuban)**: Adds missing annotations, fixes type mismatches
|
|
218
355
|
- **🔒 Security Issues (bandit)**: Comprehensive security hardening including:
|
|
219
356
|
- **Shell Injection Prevention**: Removes `shell=True` from subprocess calls
|
|
220
357
|
- **Weak Cryptography**: Replaces MD5/SHA1 with SHA256
|
|
@@ -235,6 +372,12 @@ The AI agent intelligently fixes:
|
|
|
235
372
|
# Standard AI agent mode (recommended)
|
|
236
373
|
python -m crackerjack --ai-fix --run-tests --verbose
|
|
237
374
|
|
|
375
|
+
# Preview fixes without applying (dry-run mode)
|
|
376
|
+
python -m crackerjack --dry-run --run-tests --verbose
|
|
377
|
+
|
|
378
|
+
# Custom iteration limit
|
|
379
|
+
python -m crackerjack --ai-fix --max-iterations 15
|
|
380
|
+
|
|
238
381
|
# MCP server with WebSocket support (localhost:8675)
|
|
239
382
|
python -m crackerjack --start-mcp-server
|
|
240
383
|
|
|
@@ -242,6 +385,43 @@ python -m crackerjack --start-mcp-server
|
|
|
242
385
|
python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
243
386
|
```
|
|
244
387
|
|
|
388
|
+
#### MCP Integration
|
|
389
|
+
|
|
390
|
+
When using crackerjack via MCP tools (session-mgmt-mcp):
|
|
391
|
+
|
|
392
|
+
```python
|
|
393
|
+
# ✅ CORRECT - Use semantic command + ai_agent_mode parameter
|
|
394
|
+
crackerjack_run(command="test", ai_agent_mode=True)
|
|
395
|
+
|
|
396
|
+
# ✅ CORRECT - With additional arguments
|
|
397
|
+
crackerjack_run(command="check", args="--verbose", ai_agent_mode=True, timeout=600)
|
|
398
|
+
|
|
399
|
+
# ✅ CORRECT - Dry-run mode
|
|
400
|
+
crackerjack_run(command="test", args="--dry-run", ai_agent_mode=True)
|
|
401
|
+
|
|
402
|
+
# ❌ WRONG - Don't put flags in command parameter
|
|
403
|
+
crackerjack_run(command="--ai-fix -t") # This will error!
|
|
404
|
+
|
|
405
|
+
# ❌ WRONG - Don't use --ai-fix in args
|
|
406
|
+
crackerjack_run(command="test", args="--ai-fix") # Use ai_agent_mode=True instead
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
#### Configuration
|
|
410
|
+
|
|
411
|
+
Auto-fix requires:
|
|
412
|
+
|
|
413
|
+
1. **Anthropic API key**: Set environment variable
|
|
414
|
+
|
|
415
|
+
```bash
|
|
416
|
+
export ANTHROPIC_API_KEY=sk-ant-...
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
1. **Configuration file**: `settings/adapters.yml`
|
|
420
|
+
|
|
421
|
+
```yaml
|
|
422
|
+
ai: claude
|
|
423
|
+
```
|
|
424
|
+
|
|
245
425
|
#### Key Benefits
|
|
246
426
|
|
|
247
427
|
- **Zero Configuration**: No complex flag combinations needed
|
|
@@ -252,7 +432,7 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
252
432
|
|
|
253
433
|
#### 🤖 Specialized Agent Architecture
|
|
254
434
|
|
|
255
|
-
**
|
|
435
|
+
**12 Specialized AI Agents** for comprehensive code quality improvements:
|
|
256
436
|
|
|
257
437
|
- **🔒 SecurityAgent**: Fixes shell injections, weak crypto, token exposure, unsafe library usage
|
|
258
438
|
- **♻️ RefactoringAgent**: Reduces complexity ≤15, extracts helper methods, applies SOLID principles
|
|
@@ -263,6 +443,9 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
263
443
|
- **🧪 TestCreationAgent**: Fixes test failures, missing fixtures, dependency issues
|
|
264
444
|
- **📦 ImportOptimizationAgent**: Removes unused imports, restructures import statements
|
|
265
445
|
- **🔬 TestSpecialistAgent**: Advanced testing scenarios, fixture management
|
|
446
|
+
- **🔍 SemanticAgent**: Advanced semantic analysis, code comprehension, intelligent refactoring suggestions based on business logic understanding
|
|
447
|
+
- **🏗️ ArchitectAgent**: High-level architectural patterns, design recommendations, system-level optimization strategies
|
|
448
|
+
- **🎯 EnhancedProactiveAgent**: Proactive issue prevention, predictive quality monitoring, optimization before problems occur
|
|
266
449
|
|
|
267
450
|
**Agent Coordination Features**:
|
|
268
451
|
|
|
@@ -273,7 +456,7 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
273
456
|
#### Security & Safety Features
|
|
274
457
|
|
|
275
458
|
- **Command Validation**: All AI modifications are validated for safety
|
|
276
|
-
- **
|
|
459
|
+
- **Advanced-Grade Regex**: Centralized pattern system eliminates dangerous regex issues
|
|
277
460
|
- **No Shell Injection**: Uses secure subprocess execution with validated patterns
|
|
278
461
|
- **Rollback Support**: All changes can be reverted via git
|
|
279
462
|
- **Human Review**: Review AI-generated changes before commit
|
|
@@ -285,7 +468,7 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
285
468
|
- **🦅 Skylos** (Dead Code Detection): Replaces vulture with **20x performance improvement**
|
|
286
469
|
|
|
287
470
|
- Rust-powered dead code detection and import analysis
|
|
288
|
-
- Seamlessly integrates with
|
|
471
|
+
- Seamlessly integrates with crackerjack's quality workflow
|
|
289
472
|
- Zero configuration changes required
|
|
290
473
|
|
|
291
474
|
- **🔍 Zuban** (Type Checking): Replaces pyright with **20-200x performance improvement**
|
|
@@ -296,7 +479,7 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
296
479
|
|
|
297
480
|
**Performance Benefits**:
|
|
298
481
|
|
|
299
|
-
- **Faster Development Cycles**:
|
|
482
|
+
- **Faster Development Cycles**: Quality hooks complete in seconds, not minutes
|
|
300
483
|
- **Improved Developer Experience**: Near-instantaneous feedback during development
|
|
301
484
|
- **Seamless Integration**: Works transparently with existing crackerjack workflows
|
|
302
485
|
- **Zero Breaking Changes**: Same CLI interface, dramatically better performance
|
|
@@ -322,19 +505,19 @@ python -m crackerjack --ai-fix --run-tests # Complete workflow optimized
|
|
|
322
505
|
|
|
323
506
|
**Optimal Execution Order**:
|
|
324
507
|
|
|
325
|
-
- **Fast hooks first** → **retry once if any fail** (formatting fixes cascade to other issues)
|
|
326
|
-
- **Code cleaning** → Remove TODO detection, apply standardized patterns
|
|
327
|
-
- **Post-cleaning fast hooks sanity check** → Ensure cleaning didn't introduce issues
|
|
328
|
-
- **Full test suite** → Collect ALL test failures (don't stop on first)
|
|
329
|
-
- **Comprehensive hooks** → Collect ALL quality issues on clean codebase
|
|
330
|
-
- **AI batch fixing** → Process all collected issues intelligently
|
|
508
|
+
- **Fast hooks first** # → **retry once if any fail** (formatting fixes cascade to other issues)
|
|
509
|
+
- **Code cleaning** # → Remove TODO detection, apply standardized patterns
|
|
510
|
+
- **Post-cleaning fast hooks sanity check** # → Ensure cleaning didn't introduce issues
|
|
511
|
+
- **Full test suite** # → Collect ALL test failures (don't stop on first)
|
|
512
|
+
- **Comprehensive hooks** # → Collect ALL quality issues on clean codebase
|
|
513
|
+
- **AI batch fixing** # → Process all collected issues intelligently
|
|
331
514
|
|
|
332
515
|
**With AI integration:**
|
|
333
516
|
|
|
334
517
|
- `--ai-fix` flag enables automatic error resolution with specialized sub-agents
|
|
335
518
|
- MCP server allows AI agents to run crackerjack commands with real-time progress tracking
|
|
336
519
|
- Structured error output for programmatic fixes with confidence scoring
|
|
337
|
-
-
|
|
520
|
+
- Advanced-grade regex pattern system ensures safe automated text transformations
|
|
338
521
|
|
|
339
522
|
## Core Features
|
|
340
523
|
|
|
@@ -348,15 +531,15 @@ python -m crackerjack --ai-fix --run-tests # Complete workflow optimized
|
|
|
348
531
|
|
|
349
532
|
- **Automated Code Cleaning:** Removes unnecessary docstrings, line comments, and trailing whitespace
|
|
350
533
|
- **Consistent Code Formatting:** Enforces a unified style using [Ruff](https://github.com/astral-sh/ruff), the lightning-fast Python linter and formatter
|
|
351
|
-
- **Comprehensive
|
|
352
|
-
- **Interactive Checks:** Supports interactive
|
|
534
|
+
- **Comprehensive Quality Hooks:** Direct tool invocation with no wrapper overhead - runs Python tools, Rust analyzers, and security scanners efficiently
|
|
535
|
+
- **Interactive Checks:** Supports interactive quality checks (like `refurb`, `bandit`, and `pyright`) to fix issues in real-time
|
|
353
536
|
- **Static Type Checking:** Enforces type safety with Pyright integration
|
|
354
537
|
|
|
355
538
|
### Testing & Coverage Ratchet System
|
|
356
539
|
|
|
357
540
|
- **Built-in Testing:** Automatically runs tests using `pytest` with intelligent parallelization
|
|
358
541
|
- **Coverage Ratchet:** Revolutionary coverage system that targets 100% - coverage can only increase, never decrease
|
|
359
|
-
- **Milestone Celebrations:** Progress tracking with milestone achievements (15%, 20%, 25%... → 100%)
|
|
542
|
+
- **Milestone Celebrations:** Progress tracking with milestone achievements (15%, 20%, 25%... # → 100%)
|
|
360
543
|
- **No Arbitrary Limits:** Replaced traditional hard limits with continuous improvement toward perfection
|
|
361
544
|
- **Visual Progress:** Rich terminal displays showing journey to 100% coverage
|
|
362
545
|
- **Benchmark Testing:** Performance regression detection and monitoring
|
|
@@ -380,7 +563,7 @@ python -m crackerjack --run-tests
|
|
|
380
563
|
# Example output:
|
|
381
564
|
# 🎉 Coverage improved from 10.11% to 15.50%!
|
|
382
565
|
# 🏆 Milestone achieved: 15% coverage!
|
|
383
|
-
# 📈 Progress: [███░░░░░░░░░░░░░░░░░] 15.50% → 100%
|
|
566
|
+
# 📈 Progress: [███░░░░░░░░░░░░░░░░░] 15.50% # → 100%
|
|
384
567
|
# 🎯 Next milestone: 20% (+4.50% needed)
|
|
385
568
|
```
|
|
386
569
|
|
|
@@ -389,9 +572,324 @@ python -m crackerjack --run-tests
|
|
|
389
572
|
- **Intelligent Commit Messages:** Analyzes git changes and suggests descriptive commit messages based on file types and modifications
|
|
390
573
|
- **Commit and Push:** Commits and pushes your changes with standardized commit messages
|
|
391
574
|
- **Pull Request Creation:** Creates pull requests to upstream repositories on GitHub or GitLab
|
|
392
|
-
- **
|
|
575
|
+
- **Git Hook Integration:** Ensures code quality before commits with fast, direct tool execution
|
|
576
|
+
|
|
577
|
+
## ⚡ ACB Architecture & Performance
|
|
578
|
+
|
|
579
|
+
Crackerjack is built on the **ACB (Asynchronous Component Base)** framework, providing advanced-grade dependency injection, intelligent caching, and parallel execution.
|
|
580
|
+
|
|
581
|
+
### What is ACB?
|
|
582
|
+
|
|
583
|
+
[ACB](https://github.com/lesleslie/acb) is a lightweight dependency injection framework that enables:
|
|
584
|
+
|
|
585
|
+
- **Module-level registration** via `depends.set()` for clean dependency management
|
|
586
|
+
- **Runtime-checkable protocols** ensuring type safety across all components
|
|
587
|
+
- **Async-first design** with lifecycle management and timeout strategies
|
|
588
|
+
- **Clean separation of concerns** through adapters, orchestrators, and services
|
|
589
|
+
|
|
590
|
+
### Architecture Overview
|
|
591
|
+
|
|
592
|
+
**ACB Workflow Engine (Default since Phase 4.2)**
|
|
593
|
+
|
|
594
|
+
```
|
|
595
|
+
User Command # → BasicWorkflowEngine (ACB)
|
|
596
|
+
↓
|
|
597
|
+
Workflow Selection (Standard/Fast/Comprehensive/Test)
|
|
598
|
+
↓
|
|
599
|
+
Action Handlers (run_fast_hooks, run_code_cleaning, run_comprehensive_hooks, run_test_workflow)
|
|
600
|
+
↓
|
|
601
|
+
asyncio.to_thread() for non-blocking execution
|
|
602
|
+
↓
|
|
603
|
+
WorkflowPipeline (DI-injected via context)
|
|
604
|
+
↓
|
|
605
|
+
Phase Execution (_run_fast_hooks_phase, _run_comprehensive_hooks_phase, etc.)
|
|
606
|
+
↓
|
|
607
|
+
HookManager + TestManager (Manager Layer: 80% compliant)
|
|
608
|
+
↓
|
|
609
|
+
Direct adapter.check() calls (No subprocess overhead)
|
|
610
|
+
↓
|
|
611
|
+
ToolProxyCacheAdapter (Content-based caching, 70% hit rate)
|
|
612
|
+
↓
|
|
613
|
+
Parallel Execution (Up to 11 concurrent adapters)
|
|
614
|
+
↓
|
|
615
|
+
Results Aggregation with real-time console output
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
**Legacy Orchestrator Path** (opt-out with `--use-legacy-orchestrator`)
|
|
619
|
+
|
|
620
|
+
```
|
|
621
|
+
User Command # → WorkflowOrchestrator (Legacy)
|
|
622
|
+
↓
|
|
623
|
+
SessionCoordinator (@depends.inject + protocols)
|
|
624
|
+
↓
|
|
625
|
+
PhaseCoordinator (Orchestration Layer)
|
|
626
|
+
↓
|
|
627
|
+
HookManager + TestManager
|
|
628
|
+
↓
|
|
629
|
+
[Same execution path as ACB from here...]
|
|
630
|
+
```
|
|
631
|
+
|
|
632
|
+
**Architecture Compliance (Phase 2-4.2 Audit Results)**
|
|
633
|
+
|
|
634
|
+
| Layer | Compliance | Status | Notes |
|
|
635
|
+
|-------|-----------|--------|-------|
|
|
636
|
+
| **ACB Workflows** | 95% | ✅ Production | **Default since Phase 4.2** - Real-time output, non-blocking |
|
|
637
|
+
| **CLI Handlers** | 90% | ✅ Excellent | Gold standard: `@depends.inject` + `Inject[Protocol]` |
|
|
638
|
+
| **Services** | 95% | ✅ Excellent | Phase 3 refactored, consistent constructors |
|
|
639
|
+
| **Managers** | 80% | ✅ Good | Protocol-based injection, minor improvements needed |
|
|
640
|
+
| **Legacy Orchestration** | 70% | ⚠️ Opt-out | Available with `--use-legacy-orchestrator` |
|
|
641
|
+
| **Coordinators** | 70% | ⚠️ Mixed | Phase coordinators ✅, async needs standardization |
|
|
642
|
+
| **Agent System** | 40% | 📋 Legacy | Uses `AgentContext` pattern (predates ACB) |
|
|
643
|
+
|
|
644
|
+
**Key Architectural Patterns**
|
|
645
|
+
|
|
646
|
+
```python
|
|
647
|
+
# ✅ GOLD STANDARD Pattern (from CLI Handlers)
|
|
648
|
+
from acb.depends import depends, Inject
|
|
649
|
+
from crackerjack.models.protocols import Console
|
|
650
|
+
|
|
651
|
+
|
|
652
|
+
@depends.inject
|
|
653
|
+
def setup_environment(console: Inject[Console] = None, verbose: bool = False) -> None:
|
|
654
|
+
"""Protocol-based injection with @depends.inject decorator."""
|
|
655
|
+
console.print("[green]Environment ready[/green]")
|
|
656
|
+
|
|
657
|
+
|
|
658
|
+
# ❌ ANTI-PATTERN: Avoid manual fallbacks
|
|
659
|
+
def setup_environment_wrong(console: Console | None = None):
|
|
660
|
+
self.console = console or Console() # Bypasses DI container
|
|
661
|
+
```
|
|
662
|
+
|
|
663
|
+
### Performance Benefits
|
|
664
|
+
|
|
665
|
+
| Metric | Legacy | ACB Workflows (Phase 4.2) | Improvement |
|
|
666
|
+
|--------|--------|----------------------------|-------------|
|
|
667
|
+
| **Fast Hooks** | ~45s | ~48s | Comparable |
|
|
668
|
+
| **Full Workflow** | ~60s | ~90s | Real-time output |
|
|
669
|
+
| **Console Output** | Buffered | **Real-time streaming** | UX improvement |
|
|
670
|
+
| **Event Loop** | Sync (blocking) | **Async (non-blocking)** | Responsive |
|
|
671
|
+
| **Cache Hit Rate** | 0% | **70%** | New capability |
|
|
672
|
+
| **Concurrent Adapters** | 1 | **11** | 11x parallelism |
|
|
673
|
+
| **DI Context** | Manual | **Protocol-based injection** | Type safety |
|
|
674
|
+
|
|
675
|
+
### Core Components
|
|
676
|
+
|
|
677
|
+
#### 1. Quality Assurance Adapters
|
|
678
|
+
|
|
679
|
+
**Location:** `crackerjack/adapters/`
|
|
680
|
+
|
|
681
|
+
ACB-registered adapters for all quality checks:
|
|
682
|
+
|
|
683
|
+
- **Format:** Ruff formatting, mdformat
|
|
684
|
+
- **Lint:** Codespell, complexity analysis
|
|
685
|
+
- **Security:** Bandit security scanning, Gitleaks secret detection
|
|
686
|
+
- **Type:** Zuban type checking (20-200x faster than Pyright)
|
|
687
|
+
- **Refactor:** Creosote (unused dependencies), Refurb (Python idioms)
|
|
688
|
+
- **Complexity:** Complexipy analysis
|
|
689
|
+
- **Utility:** Various validation checks
|
|
690
|
+
- **AI:** Claude integration for intelligent auto-fixing
|
|
691
|
+
|
|
692
|
+
#### 2. Hook Orchestrator
|
|
693
|
+
|
|
694
|
+
**Location:** `crackerjack/orchestration/hook_orchestrator.py`
|
|
695
|
+
|
|
696
|
+
Features:
|
|
697
|
+
|
|
698
|
+
- **Dual execution mode:** Legacy (pre-commit CLI) + ACB (direct adapters)
|
|
699
|
+
- **Dependency resolution:** Intelligent hook ordering (e.g., format before lint)
|
|
700
|
+
- **Adaptive strategies:** Fast, comprehensive, or dependency-aware execution
|
|
701
|
+
- **Graceful degradation:** Timeout strategies prevent hanging
|
|
702
|
+
|
|
703
|
+
#### 3. Cache Adapters
|
|
704
|
+
|
|
705
|
+
**Location:** `crackerjack/orchestration/cache/`
|
|
706
|
+
|
|
707
|
+
Two caching strategies:
|
|
708
|
+
|
|
709
|
+
- **ToolProxyCache:** Content-based caching with file hash verification
|
|
710
|
+
- **MemoryCache:** In-memory LRU cache for testing
|
|
711
|
+
|
|
712
|
+
Benefits:
|
|
713
|
+
|
|
714
|
+
- **70% cache hit rate** in typical workflows
|
|
715
|
+
- **Content-aware invalidation:** Only re-runs when files actually change
|
|
716
|
+
- **Configurable TTL:** Default 3600s (1 hour)
|
|
717
|
+
|
|
718
|
+
#### 4. MCP Server Integration
|
|
719
|
+
|
|
720
|
+
**Location:** `crackerjack/mcp/`
|
|
393
721
|
|
|
394
|
-
|
|
722
|
+
ACB-registered services:
|
|
723
|
+
|
|
724
|
+
- **MCPServerService:** FastMCP server for AI agent integration
|
|
725
|
+
- **ErrorCache:** Pattern tracking for AI fix recommendations
|
|
726
|
+
- **JobManager:** WebSocket job tracking and progress streaming
|
|
727
|
+
- **WebSocketSecurityConfig:** Security hardening (localhost-only, rate limiting)
|
|
728
|
+
|
|
729
|
+
### Migration from Pre-commit
|
|
730
|
+
|
|
731
|
+
Crackerjack has migrated from pre-commit subprocess calls to direct ACB adapter execution:
|
|
732
|
+
|
|
733
|
+
**Old Approach (Pre-commit):**
|
|
734
|
+
|
|
735
|
+
```bash
|
|
736
|
+
pre-commit run ruff --all-files # Subprocess overhead
|
|
737
|
+
```
|
|
738
|
+
|
|
739
|
+
**New Approach (ACB):**
|
|
740
|
+
|
|
741
|
+
```bash
|
|
742
|
+
python -m crackerjack --fast # Direct Python API, 70% faster
|
|
743
|
+
```
|
|
744
|
+
|
|
745
|
+
**Migration Guide:** See `docs/README.md` (Migration Notes)
|
|
746
|
+
|
|
747
|
+
### Configuration Management (ACB Settings & Configuration Templates)
|
|
748
|
+
|
|
749
|
+
Crackerjack utilizes a **dual configuration system** to handle both runtime application settings and project configuration templates:
|
|
750
|
+
|
|
751
|
+
#### 1. Runtime Configuration (ACB Settings)
|
|
752
|
+
|
|
753
|
+
**ACB Settings** manages application runtime configuration:
|
|
754
|
+
|
|
755
|
+
**Before (11 config files, ~1,808 LOC):**
|
|
756
|
+
|
|
757
|
+
```python
|
|
758
|
+
from crackerjack.models.config import WorkflowOptions, HookConfig
|
|
759
|
+
from crackerjack.orchestration.config import OrchestrationConfig
|
|
760
|
+
# ... multiple configuration imports
|
|
761
|
+
```
|
|
762
|
+
|
|
763
|
+
**After (1 settings file, ~300 LOC):**
|
|
764
|
+
|
|
765
|
+
```python
|
|
766
|
+
from acb.depends import depends
|
|
767
|
+
from crackerjack.config import CrackerjackSettings
|
|
768
|
+
|
|
769
|
+
settings = depends.get(CrackerjackSettings)
|
|
770
|
+
# Auto-loads from: env vars (CRACKERJACK_*), .env file, defaults
|
|
771
|
+
```
|
|
772
|
+
|
|
773
|
+
**Benefits:**
|
|
774
|
+
|
|
775
|
+
- **83% LOC reduction** in configuration code
|
|
776
|
+
- **Automatic environment variable loading** (CRACKERJACK\_\* prefix)
|
|
777
|
+
- **Type validation** via Pydantic
|
|
778
|
+
- **Single source of truth** for all runtime settings
|
|
779
|
+
- **Backward compatible** - Public API unchanged (`create_workflow_options()`)
|
|
780
|
+
|
|
781
|
+
#### 2. Project Configuration Templates (ConfigTemplateService)
|
|
782
|
+
|
|
783
|
+
**ConfigTemplateService** manages project-level configuration templates for files like `.pre-commit-config.yaml` and `pyproject.toml`:
|
|
784
|
+
|
|
785
|
+
```bash
|
|
786
|
+
# Check for available configuration updates
|
|
787
|
+
python -m crackerjack --check-config-updates
|
|
788
|
+
|
|
789
|
+
# Show diff for specific configuration type
|
|
790
|
+
python -m crackerjack --diff-config pre-commit
|
|
791
|
+
|
|
792
|
+
# Apply configuration updates interactively
|
|
793
|
+
python -m crackerjack --apply-config-updates --config-interactive
|
|
794
|
+
|
|
795
|
+
# Refresh configuration cache
|
|
796
|
+
python -m crackerjack --refresh-cache
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
**ConfigTemplateService Benefits:**
|
|
800
|
+
|
|
801
|
+
- **Version-based tracking** - Each configuration has version control
|
|
802
|
+
- **User-controlled updates** - Explicit approval required for changes
|
|
803
|
+
- **Diff visibility** - Shows changes before applying
|
|
804
|
+
- **Cache management** - Automatic pre-commit cache invalidation
|
|
805
|
+
- **Template management** - Centralized configuration templates as code
|
|
806
|
+
|
|
807
|
+
**Config Merge Service (Initialization)**
|
|
808
|
+
|
|
809
|
+
The ConfigMergeService handles intelligent configuration merging during project initialization:
|
|
810
|
+
|
|
811
|
+
```python
|
|
812
|
+
# Used by InitializationService for new project setup
|
|
813
|
+
merge_result = config_merge_service.smart_merge_pyproject(
|
|
814
|
+
source_config, target_path, project_name
|
|
815
|
+
)
|
|
816
|
+
```
|
|
817
|
+
|
|
818
|
+
**For Complete Configuration System Details:** See `docs/README.md` (Project Structure and Coding Standards).
|
|
819
|
+
|
|
820
|
+
**Migration Details:** See `docs/README.md` (Migration Notes)
|
|
821
|
+
|
|
822
|
+
### Using ACB Dependency Injection
|
|
823
|
+
|
|
824
|
+
Example: Custom QA Adapter
|
|
825
|
+
|
|
826
|
+
```python
|
|
827
|
+
import uuid
|
|
828
|
+
from contextlib import suppress
|
|
829
|
+
from acb.depends import depends
|
|
830
|
+
from crackerjack.adapters._qa_adapter_base import QAAdapterBase
|
|
831
|
+
|
|
832
|
+
# Module-level registration (ACB pattern)
|
|
833
|
+
MODULE_ID = uuid.UUID("01937d86-xxxx-xxxx-xxxx-xxxxxxxxxxxx")
|
|
834
|
+
MODULE_STATUS = "stable"
|
|
835
|
+
|
|
836
|
+
|
|
837
|
+
class CustomAdapter(QAAdapterBase):
|
|
838
|
+
@property
|
|
839
|
+
def adapter_name(self) -> str:
|
|
840
|
+
return "Custom Checker"
|
|
841
|
+
|
|
842
|
+
@property
|
|
843
|
+
def module_id(self) -> uuid.UUID:
|
|
844
|
+
return MODULE_ID
|
|
845
|
+
|
|
846
|
+
async def check(self, files, config):
|
|
847
|
+
# Your quality check logic here
|
|
848
|
+
return QAResult(passed=True, issues=[])
|
|
849
|
+
|
|
850
|
+
|
|
851
|
+
# Register with DI container
|
|
852
|
+
with suppress(Exception):
|
|
853
|
+
depends.set(CustomAdapter)
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
### Performance Optimization
|
|
857
|
+
|
|
858
|
+
#### Intelligent Caching
|
|
859
|
+
|
|
860
|
+
- **Content-based keys:** `{hook_name}:{config_hash}:{content_hash}`
|
|
861
|
+
- **File hash verification:** Detects actual file changes, not just timestamps
|
|
862
|
+
- **LRU eviction:** Automatic cleanup of old entries
|
|
863
|
+
|
|
864
|
+
#### Parallel Execution
|
|
865
|
+
|
|
866
|
+
- **Dependency-aware scheduling:** Runs independent hooks in parallel
|
|
867
|
+
- **Semaphore control:** Prevents resource exhaustion
|
|
868
|
+
- **Async I/O:** 76% faster for I/O-bound operations
|
|
869
|
+
|
|
870
|
+
#### Timeout Strategies
|
|
871
|
+
|
|
872
|
+
- **Graceful degradation:** Continues execution even if one hook times out
|
|
873
|
+
- **Configurable limits:** Default 60s per hook, 300s overall
|
|
874
|
+
- **Context managers:** Automatic cleanup on timeout
|
|
875
|
+
|
|
876
|
+
### ACB Benefits
|
|
877
|
+
|
|
878
|
+
1. **Type Safety:** Runtime-checkable protocols ensure correctness
|
|
879
|
+
1. **Testability:** Easy mocking with `depends.get()`
|
|
880
|
+
1. **Maintainability:** Clear separation between adapters and orchestration
|
|
881
|
+
1. **Observability:** Structured logging with context fields
|
|
882
|
+
1. **Security:** Input validation, timeout protection, origin validation
|
|
883
|
+
1. **Performance:** 47% faster overall execution with intelligent caching
|
|
884
|
+
|
|
885
|
+
### Documentation
|
|
886
|
+
|
|
887
|
+
- See `docs/README.md` for consolidated documentation and references.
|
|
888
|
+
- **Code Review Report:** Available from maintainers
|
|
889
|
+
|
|
890
|
+
**Status:** ✅ Production Ready (as of 2025-10-09)
|
|
891
|
+
|
|
892
|
+
## 🛡️ Advanced-Grade Pattern Management System
|
|
395
893
|
|
|
396
894
|
### Advanced Regex Pattern Validation
|
|
397
895
|
|
|
@@ -426,7 +924,7 @@ MAX_ITERATIONS = 10 # Iterative application limit
|
|
|
426
924
|
|
|
427
925
|
# Iterative fixes for complex cases
|
|
428
926
|
pattern.apply_iteratively("pytest - hypothesis - specialist")
|
|
429
|
-
# → "pytest-hypothesis-specialist"
|
|
927
|
+
# # → "pytest-hypothesis-specialist"
|
|
430
928
|
|
|
431
929
|
# Performance monitoring capabilities
|
|
432
930
|
pattern.get_performance_stats(text, iterations=100)
|
|
@@ -438,35 +936,35 @@ pattern.get_performance_stats(text, iterations=100)
|
|
|
438
936
|
|
|
439
937
|
```python
|
|
440
938
|
# PyPI tokens (word boundaries prevent false matches)
|
|
441
|
-
"pypi-AgEIcHlwaS5vcmcCJGE4M2Y3ZjI" → "pypi-****"
|
|
939
|
+
"pypi-AgEIcHlwaS5vcmcCJGE4M2Y3ZjI" # → "pypi-****"
|
|
442
940
|
|
|
443
941
|
# GitHub personal access tokens (exactly 40 chars)
|
|
444
|
-
"ghp_1234567890abcdef1234567890abcdef1234" → "ghp_****"
|
|
942
|
+
"ghp_1234567890abcdef1234567890abcdef1234" # → "ghp_****"
|
|
445
943
|
|
|
446
944
|
# Generic long tokens (32+ chars with word boundaries)
|
|
447
|
-
"secret_key=abcdef1234567890abcdef1234567890abcdef" → "secret_key=****"
|
|
945
|
+
"secret_key=abcdef1234567890abcdef1234567890abcdef" # → "secret_key=****"
|
|
448
946
|
```
|
|
449
947
|
|
|
450
948
|
**Subprocess Security Fixes**:
|
|
451
949
|
|
|
452
950
|
```python
|
|
453
951
|
# Automatic shell injection prevention
|
|
454
|
-
subprocess.run(cmd, shell=True) → subprocess.run(cmd.split())
|
|
455
|
-
subprocess.call(cmd, shell=True) → subprocess.call(cmd.split())
|
|
952
|
+
subprocess.run(cmd, shell=True) # → subprocess.run(cmd.split())
|
|
953
|
+
subprocess.call(cmd, shell=True) # → subprocess.call(cmd.split())
|
|
456
954
|
```
|
|
457
955
|
|
|
458
956
|
**Unsafe Library Replacements**:
|
|
459
957
|
|
|
460
958
|
```python
|
|
461
|
-
# Weak crypto → Strong crypto
|
|
462
|
-
hashlib.md5(data) → hashlib.sha256(data)
|
|
463
|
-
hashlib.sha1(data) → hashlib.sha256(data)
|
|
959
|
+
# Weak crypto # → Strong crypto
|
|
960
|
+
hashlib.md5(data) # → hashlib.sha256(data)
|
|
961
|
+
hashlib.sha1(data) # → hashlib.sha256(data)
|
|
464
962
|
|
|
465
|
-
# Insecure random → Cryptographic random
|
|
466
|
-
random.choice(options) → secrets.choice(options)
|
|
963
|
+
# Insecure random # → Cryptographic random
|
|
964
|
+
random.choice(options) # → secrets.choice(options)
|
|
467
965
|
|
|
468
|
-
# Unsafe YAML → Safe YAML
|
|
469
|
-
yaml.load(file) → yaml.safe_load(file)
|
|
966
|
+
# Unsafe YAML # → Safe YAML
|
|
967
|
+
yaml.load(file) # → yaml.safe_load(file)
|
|
470
968
|
```
|
|
471
969
|
|
|
472
970
|
#### Pattern Validation Requirements
|
|
@@ -495,7 +993,23 @@ yaml.load(file) → yaml.safe_load(file)
|
|
|
495
993
|
python -m crackerjack.tools.validate_regex_usage
|
|
496
994
|
```
|
|
497
995
|
|
|
498
|
-
This
|
|
996
|
+
This advanced-grade pattern management system has **eliminated all regex-related spacing and security issues** that previously plagued the codebase, providing a robust foundation for safe text processing operations.
|
|
997
|
+
|
|
998
|
+
## Adapters
|
|
999
|
+
|
|
1000
|
+
Adapters connect Crackerjack to external tools and subsystems (e.g., Ruff, Zuban, Bandit) using ACB patterns. Each adapter exposes typed settings, async initialization, and standardized results.
|
|
1001
|
+
|
|
1002
|
+
- AI — Claude-powered code fixes: [crackerjack/adapters/ai/README.md](<./crackerjack/adapters/ai/README.md>)
|
|
1003
|
+
- Complexity — Code complexity analysis (Complexipy): [crackerjack/adapters/complexity/README.md](<./crackerjack/adapters/complexity/README.md>)
|
|
1004
|
+
- Format — Python/Markdown formatting (Ruff, Mdformat): [crackerjack/adapters/format/README.md](<./crackerjack/adapters/format/README.md>)
|
|
1005
|
+
- Lint — Spelling and simple linters (Codespell): [crackerjack/adapters/lint/README.md](<./crackerjack/adapters/lint/README.md>)
|
|
1006
|
+
- LSP — Rust tools with LSP (Zuban, Skylos): [crackerjack/adapters/lsp/README.md](<./crackerjack/adapters/lsp/README.md>)
|
|
1007
|
+
- Refactor — Modernization, dead code, unused deps (Refurb, Skylos, Creosote): [crackerjack/adapters/refactor/README.md](<./crackerjack/adapters/refactor/README.md>)
|
|
1008
|
+
- Security — Static analysis and secrets (Bandit, Gitleaks, Pyscn): [crackerjack/adapters/security/README.md](<./crackerjack/adapters/security/README.md>)
|
|
1009
|
+
- Type — Static type checking (Zuban, Pyrefly, Ty): [crackerjack/adapters/type/README.md](<./crackerjack/adapters/type/README.md>)
|
|
1010
|
+
- Utility — Config-driven checks (EOF newline, regex, size, lock): [crackerjack/adapters/utility/README.md](<./crackerjack/adapters/utility/README.md>)
|
|
1011
|
+
|
|
1012
|
+
Quick index: [crackerjack/adapters/README.md](<./crackerjack/adapters/README.md>).
|
|
499
1013
|
|
|
500
1014
|
## MCP Server Configuration
|
|
501
1015
|
|
|
@@ -505,10 +1019,10 @@ Model Context Protocol (MCP) enables AI agents to interact directly with Cracker
|
|
|
505
1019
|
|
|
506
1020
|
### Setup MCP Server
|
|
507
1021
|
|
|
508
|
-
1. **Install MCP
|
|
1022
|
+
1. **Install development dependencies (includes MCP tools):**
|
|
509
1023
|
|
|
510
1024
|
```bash
|
|
511
|
-
uv sync --group
|
|
1025
|
+
uv sync --group dev
|
|
512
1026
|
```
|
|
513
1027
|
|
|
514
1028
|
1. **Start the MCP server:**
|
|
@@ -662,9 +1176,9 @@ keyring set https://upload.pypi.org/legacy/ __token__
|
|
|
662
1176
|
}
|
|
663
1177
|
```
|
|
664
1178
|
|
|
665
|
-
##
|
|
1179
|
+
## Quality Hook Modes
|
|
666
1180
|
|
|
667
|
-
Crackerjack runs
|
|
1181
|
+
Crackerjack runs quality checks in a two-stage process for optimal development workflow:
|
|
668
1182
|
|
|
669
1183
|
### Hook Details
|
|
670
1184
|
|
|
@@ -678,7 +1192,7 @@ Crackerjack runs hooks in a two-stage process for optimal development workflow:
|
|
|
678
1192
|
|
|
679
1193
|
**Comprehensive Hooks (~30 seconds):**
|
|
680
1194
|
|
|
681
|
-
-
|
|
1195
|
+
- Zuban type checking
|
|
682
1196
|
- Bandit security analysis
|
|
683
1197
|
- Dead code detection (vulture)
|
|
684
1198
|
- Dependency analysis (creosote)
|
|
@@ -709,6 +1223,70 @@ python -m crackerjack --all patch
|
|
|
709
1223
|
python -m crackerjack --ai-fix
|
|
710
1224
|
```
|
|
711
1225
|
|
|
1226
|
+
## Quick Reference Index
|
|
1227
|
+
|
|
1228
|
+
**📋 Command Index by Use Case**
|
|
1229
|
+
|
|
1230
|
+
| Use Case | Command | Description |
|
|
1231
|
+
|----------|---------|-------------|
|
|
1232
|
+
| **Basic Quality Check** | `python -m crackerjack` | Run quality checks only |
|
|
1233
|
+
| **Quality + Tests** | `python -m crackerjack --run-tests` | Quality checks with test suite |
|
|
1234
|
+
| **AI Auto-Fix** | `python -m crackerjack --ai-fix --run-tests` | AI-powered fixing + tests (recommended) |
|
|
1235
|
+
| **Full Release** | `python -m crackerjack --all patch` | Version bump, quality checks, publish |
|
|
1236
|
+
| **Quick Publish** | `python -m crackerjack --publish patch` | Version bump + publish only |
|
|
1237
|
+
| **Start MCP Server** | `python -m crackerjack --start-mcp-server` | Launch MCP agent integration |
|
|
1238
|
+
| **Monitoring Dashboard** | `python -m crackerjack --dashboard` | Comprehensive monitoring view |
|
|
1239
|
+
| **AI Debugging** | `python -m crackerjack --ai-debug --run-tests` | Verbose AI debugging mode |
|
|
1240
|
+
| **Coverage Status** | `python -m crackerjack --coverage-status` | Show coverage ratchet progress |
|
|
1241
|
+
| **Clear Caches** | `python -m crackerjack --clear-cache` | Reset all cache data |
|
|
1242
|
+
| **Fast Iteration** | `python -m crackerjack --skip-hooks` | Skip quality checks during dev |
|
|
1243
|
+
| **Documentation** | `python -m crackerjack --generate-docs` | Generate API documentation |
|
|
1244
|
+
| **Advanced Features** | See `docs/README.md` | Advanced flags and workflows |
|
|
1245
|
+
|
|
1246
|
+
**📑 Alphabetical Flag Reference**
|
|
1247
|
+
|
|
1248
|
+
| Flag | Short | Description |
|
|
1249
|
+
|------|-------|-------------|
|
|
1250
|
+
| `--ai-debug` | - | Verbose debugging for AI auto-fixing |
|
|
1251
|
+
| `--ai-fix` | - | Enable AI-powered auto-fixing |
|
|
1252
|
+
| `--all` | `-a` | Full release workflow (bump, test, publish) |
|
|
1253
|
+
| `--benchmark` | - | Run tests in benchmark mode |
|
|
1254
|
+
| `--boost-coverage` | - | Auto-improve test coverage (default) |
|
|
1255
|
+
| `--bump` | `-b` | Bump version (patch/minor/major/auto) |
|
|
1256
|
+
| `--cache-stats` | - | Display cache statistics |
|
|
1257
|
+
| `--clear-cache` | - | Clear all caches and exit |
|
|
1258
|
+
| `--commit` | `-c` | Commit and push changes to Git |
|
|
1259
|
+
| `--comp` | - | Run only comprehensive hooks |
|
|
1260
|
+
| `--coverage-status` | - | Show coverage ratchet status |
|
|
1261
|
+
| `--dashboard` | - | Start comprehensive monitoring dashboard |
|
|
1262
|
+
| `--debug` | - | Enable debug output |
|
|
1263
|
+
| `--dev` | - | Enable development mode for monitors |
|
|
1264
|
+
| `--enhanced-monitor` | - | Advanced monitoring with patterns |
|
|
1265
|
+
| `--fast` | - | Run only fast hooks |
|
|
1266
|
+
| `--generate-docs` | - | Generate API documentation |
|
|
1267
|
+
| `--interactive` | `-i` | Use Rich UI interface |
|
|
1268
|
+
| `--monitor` | - | Multi-project progress monitor |
|
|
1269
|
+
| `--orchestrated` | - | Advanced orchestrated workflow mode |
|
|
1270
|
+
| `--publish` | `-p` | Bump version and publish to PyPI |
|
|
1271
|
+
| `--quick` | - | Quick mode (3 iterations, for CI/CD) |
|
|
1272
|
+
| `--restart-mcp-server` | - | Restart MCP server |
|
|
1273
|
+
| `--run-tests` | `-t` | Execute test suite |
|
|
1274
|
+
| `--skip-hooks` | `-s` | Skip pre-commit hooks |
|
|
1275
|
+
| `--start-mcp-server` | - | Start MCP server |
|
|
1276
|
+
| `--stop-mcp-server` | - | Stop MCP server |
|
|
1277
|
+
| `--strip-code` | `-x` | Remove docstrings/comments |
|
|
1278
|
+
| `--thorough` | - | Thorough mode (8 iterations) |
|
|
1279
|
+
| `--unified-dashboard` | - | Unified real-time dashboard |
|
|
1280
|
+
| `--verbose` | `-v` | Enable verbose output |
|
|
1281
|
+
| `--watchdog` | - | Service watchdog with auto-restart |
|
|
1282
|
+
|
|
1283
|
+
**🔗 Related Documentation**
|
|
1284
|
+
|
|
1285
|
+
- **Advanced Features**: See `docs/README.md` - consolidated advanced flags
|
|
1286
|
+
- **Developer Guide**: [CLAUDE.md](<./CLAUDE.md>) - AI assistant guidelines and developer commands
|
|
1287
|
+
|
|
1288
|
+
______________________________________________________________________
|
|
1289
|
+
|
|
712
1290
|
## Command Reference
|
|
713
1291
|
|
|
714
1292
|
**Core Workflow Commands:**
|
|
@@ -1082,7 +1660,7 @@ python -m crackerjack --start-mcp-server --verbose
|
|
|
1082
1660
|
## Contributing
|
|
1083
1661
|
|
|
1084
1662
|
1. Fork and clone the repository
|
|
1085
|
-
1. Run `uv sync --
|
|
1663
|
+
1. Run `uv sync --group dev` to install dependencies
|
|
1086
1664
|
1. Ensure `python -m crackerjack` passes all checks
|
|
1087
1665
|
1. Submit pull request
|
|
1088
1666
|
|
|
@@ -1096,3 +1674,5 @@ ______________________________________________________________________
|
|
|
1096
1674
|
|
|
1097
1675
|
**Issues:** [GitHub Issues](https://github.com/lesleslie/crackerjack/issues)
|
|
1098
1676
|
**Repository:** [GitHub](https://github.com/lesleslie/crackerjack)
|
|
1677
|
+
|
|
1678
|
+
# Test
|