crackerjack 0.31.10__py3-none-any.whl → 0.31.13__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.

Potentially problematic release.


This version of crackerjack might be problematic. Click here for more details.

Files changed (155) hide show
  1. crackerjack/CLAUDE.md +288 -705
  2. crackerjack/__main__.py +22 -8
  3. crackerjack/agents/__init__.py +0 -3
  4. crackerjack/agents/architect_agent.py +0 -43
  5. crackerjack/agents/base.py +1 -9
  6. crackerjack/agents/coordinator.py +2 -148
  7. crackerjack/agents/documentation_agent.py +109 -81
  8. crackerjack/agents/dry_agent.py +122 -97
  9. crackerjack/agents/formatting_agent.py +3 -16
  10. crackerjack/agents/import_optimization_agent.py +1174 -130
  11. crackerjack/agents/performance_agent.py +956 -188
  12. crackerjack/agents/performance_helpers.py +229 -0
  13. crackerjack/agents/proactive_agent.py +1 -48
  14. crackerjack/agents/refactoring_agent.py +516 -246
  15. crackerjack/agents/refactoring_helpers.py +282 -0
  16. crackerjack/agents/security_agent.py +393 -90
  17. crackerjack/agents/test_creation_agent.py +1776 -120
  18. crackerjack/agents/test_specialist_agent.py +59 -15
  19. crackerjack/agents/tracker.py +0 -102
  20. crackerjack/api.py +145 -37
  21. crackerjack/cli/handlers.py +48 -30
  22. crackerjack/cli/interactive.py +11 -11
  23. crackerjack/cli/options.py +66 -4
  24. crackerjack/code_cleaner.py +808 -148
  25. crackerjack/config/global_lock_config.py +110 -0
  26. crackerjack/config/hooks.py +43 -64
  27. crackerjack/core/async_workflow_orchestrator.py +247 -97
  28. crackerjack/core/autofix_coordinator.py +192 -109
  29. crackerjack/core/enhanced_container.py +46 -63
  30. crackerjack/core/file_lifecycle.py +549 -0
  31. crackerjack/core/performance.py +9 -8
  32. crackerjack/core/performance_monitor.py +395 -0
  33. crackerjack/core/phase_coordinator.py +281 -94
  34. crackerjack/core/proactive_workflow.py +9 -58
  35. crackerjack/core/resource_manager.py +501 -0
  36. crackerjack/core/service_watchdog.py +490 -0
  37. crackerjack/core/session_coordinator.py +4 -8
  38. crackerjack/core/timeout_manager.py +504 -0
  39. crackerjack/core/websocket_lifecycle.py +475 -0
  40. crackerjack/core/workflow_orchestrator.py +343 -209
  41. crackerjack/dynamic_config.py +50 -9
  42. crackerjack/errors.py +3 -4
  43. crackerjack/executors/async_hook_executor.py +63 -13
  44. crackerjack/executors/cached_hook_executor.py +14 -14
  45. crackerjack/executors/hook_executor.py +100 -37
  46. crackerjack/executors/hook_lock_manager.py +856 -0
  47. crackerjack/executors/individual_hook_executor.py +120 -86
  48. crackerjack/intelligence/__init__.py +0 -7
  49. crackerjack/intelligence/adaptive_learning.py +13 -86
  50. crackerjack/intelligence/agent_orchestrator.py +15 -78
  51. crackerjack/intelligence/agent_registry.py +12 -59
  52. crackerjack/intelligence/agent_selector.py +31 -92
  53. crackerjack/intelligence/integration.py +1 -41
  54. crackerjack/interactive.py +9 -9
  55. crackerjack/managers/async_hook_manager.py +25 -8
  56. crackerjack/managers/hook_manager.py +9 -9
  57. crackerjack/managers/publish_manager.py +57 -59
  58. crackerjack/managers/test_command_builder.py +6 -36
  59. crackerjack/managers/test_executor.py +9 -61
  60. crackerjack/managers/test_manager.py +17 -63
  61. crackerjack/managers/test_manager_backup.py +77 -127
  62. crackerjack/managers/test_progress.py +4 -23
  63. crackerjack/mcp/cache.py +5 -12
  64. crackerjack/mcp/client_runner.py +10 -10
  65. crackerjack/mcp/context.py +64 -6
  66. crackerjack/mcp/dashboard.py +14 -11
  67. crackerjack/mcp/enhanced_progress_monitor.py +55 -55
  68. crackerjack/mcp/file_monitor.py +72 -42
  69. crackerjack/mcp/progress_components.py +103 -84
  70. crackerjack/mcp/progress_monitor.py +122 -49
  71. crackerjack/mcp/rate_limiter.py +12 -12
  72. crackerjack/mcp/server_core.py +16 -22
  73. crackerjack/mcp/service_watchdog.py +26 -26
  74. crackerjack/mcp/state.py +15 -0
  75. crackerjack/mcp/tools/core_tools.py +95 -39
  76. crackerjack/mcp/tools/error_analyzer.py +6 -32
  77. crackerjack/mcp/tools/execution_tools.py +1 -56
  78. crackerjack/mcp/tools/execution_tools_backup.py +35 -131
  79. crackerjack/mcp/tools/intelligence_tool_registry.py +0 -36
  80. crackerjack/mcp/tools/intelligence_tools.py +2 -55
  81. crackerjack/mcp/tools/monitoring_tools.py +308 -145
  82. crackerjack/mcp/tools/proactive_tools.py +12 -42
  83. crackerjack/mcp/tools/progress_tools.py +23 -15
  84. crackerjack/mcp/tools/utility_tools.py +3 -40
  85. crackerjack/mcp/tools/workflow_executor.py +40 -60
  86. crackerjack/mcp/websocket/app.py +0 -3
  87. crackerjack/mcp/websocket/endpoints.py +206 -268
  88. crackerjack/mcp/websocket/jobs.py +213 -66
  89. crackerjack/mcp/websocket/server.py +84 -6
  90. crackerjack/mcp/websocket/websocket_handler.py +137 -29
  91. crackerjack/models/config_adapter.py +3 -16
  92. crackerjack/models/protocols.py +162 -3
  93. crackerjack/models/resource_protocols.py +454 -0
  94. crackerjack/models/task.py +3 -3
  95. crackerjack/monitoring/__init__.py +0 -0
  96. crackerjack/monitoring/ai_agent_watchdog.py +25 -71
  97. crackerjack/monitoring/regression_prevention.py +28 -87
  98. crackerjack/orchestration/advanced_orchestrator.py +44 -78
  99. crackerjack/orchestration/coverage_improvement.py +10 -60
  100. crackerjack/orchestration/execution_strategies.py +16 -16
  101. crackerjack/orchestration/test_progress_streamer.py +61 -53
  102. crackerjack/plugins/base.py +1 -1
  103. crackerjack/plugins/managers.py +22 -20
  104. crackerjack/py313.py +65 -21
  105. crackerjack/services/backup_service.py +467 -0
  106. crackerjack/services/bounded_status_operations.py +627 -0
  107. crackerjack/services/cache.py +7 -9
  108. crackerjack/services/config.py +35 -52
  109. crackerjack/services/config_integrity.py +5 -16
  110. crackerjack/services/config_merge.py +542 -0
  111. crackerjack/services/contextual_ai_assistant.py +17 -19
  112. crackerjack/services/coverage_ratchet.py +44 -73
  113. crackerjack/services/debug.py +25 -39
  114. crackerjack/services/dependency_monitor.py +52 -50
  115. crackerjack/services/enhanced_filesystem.py +14 -11
  116. crackerjack/services/file_hasher.py +1 -1
  117. crackerjack/services/filesystem.py +1 -12
  118. crackerjack/services/git.py +71 -47
  119. crackerjack/services/health_metrics.py +31 -27
  120. crackerjack/services/initialization.py +276 -428
  121. crackerjack/services/input_validator.py +760 -0
  122. crackerjack/services/log_manager.py +16 -16
  123. crackerjack/services/logging.py +7 -6
  124. crackerjack/services/metrics.py +43 -43
  125. crackerjack/services/pattern_cache.py +2 -31
  126. crackerjack/services/pattern_detector.py +26 -63
  127. crackerjack/services/performance_benchmarks.py +20 -45
  128. crackerjack/services/regex_patterns.py +2887 -0
  129. crackerjack/services/regex_utils.py +537 -0
  130. crackerjack/services/secure_path_utils.py +683 -0
  131. crackerjack/services/secure_status_formatter.py +534 -0
  132. crackerjack/services/secure_subprocess.py +605 -0
  133. crackerjack/services/security.py +47 -10
  134. crackerjack/services/security_logger.py +492 -0
  135. crackerjack/services/server_manager.py +109 -50
  136. crackerjack/services/smart_scheduling.py +8 -25
  137. crackerjack/services/status_authentication.py +603 -0
  138. crackerjack/services/status_security_manager.py +442 -0
  139. crackerjack/services/thread_safe_status_collector.py +546 -0
  140. crackerjack/services/tool_version_service.py +1 -23
  141. crackerjack/services/unified_config.py +36 -58
  142. crackerjack/services/validation_rate_limiter.py +269 -0
  143. crackerjack/services/version_checker.py +9 -40
  144. crackerjack/services/websocket_resource_limiter.py +572 -0
  145. crackerjack/slash_commands/__init__.py +52 -2
  146. crackerjack/tools/__init__.py +0 -0
  147. crackerjack/tools/validate_input_validator_patterns.py +262 -0
  148. crackerjack/tools/validate_regex_patterns.py +198 -0
  149. {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/METADATA +197 -12
  150. crackerjack-0.31.13.dist-info/RECORD +178 -0
  151. crackerjack/cli/facade.py +0 -104
  152. crackerjack-0.31.10.dist-info/RECORD +0 -149
  153. {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/WHEEL +0 -0
  154. {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/entry_points.txt +0 -0
  155. {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/licenses/LICENSE +0 -0
@@ -1,5 +1,3 @@
1
- """Intelligence tool registry for MCP server."""
2
-
3
1
  from .intelligence_tools import (
4
2
  analyze_agent_performance,
5
3
  execute_smart_agent_task,
@@ -9,8 +7,6 @@ from .intelligence_tools import (
9
7
 
10
8
 
11
9
  def register_intelligence_tools(mcp_app) -> None:
12
- """Register intelligence system tools with the MCP server."""
13
-
14
10
  @mcp_app.tool()
15
11
  async def execute_smart_task(
16
12
  task_description: str,
@@ -19,18 +15,6 @@ def register_intelligence_tools(mcp_app) -> None:
19
15
  max_agents: int = 3,
20
16
  use_learning: bool = True,
21
17
  ):
22
- """Execute a task using intelligent agent selection.
23
-
24
- Args:
25
- task_description: Description of the task to execute
26
- context_type: Type of task context (architecture, refactoring, testing, etc.)
27
- strategy: Execution strategy (single_best, parallel, sequential, consensus)
28
- max_agents: Maximum number of agents to consider
29
- use_learning: Whether to apply adaptive learning
30
-
31
- Returns:
32
- Dictionary with execution results and metadata
33
- """
34
18
  return await execute_smart_agent_task(
35
19
  task_description,
36
20
  context_type,
@@ -45,16 +29,6 @@ def register_intelligence_tools(mcp_app) -> None:
45
29
  context_type: str = "general",
46
30
  include_analysis: bool = True,
47
31
  ):
48
- """Get intelligent agent recommendation for a task without executing it.
49
-
50
- Args:
51
- task_description: Description of the task
52
- context_type: Type of task context
53
- include_analysis: Whether to include complexity analysis
54
-
55
- Returns:
56
- Dictionary with recommendation details
57
- """
58
32
  return await get_smart_agent_recommendation(
59
33
  task_description,
60
34
  context_type,
@@ -63,18 +37,8 @@ def register_intelligence_tools(mcp_app) -> None:
63
37
 
64
38
  @mcp_app.tool()
65
39
  async def intelligence_system_status():
66
- """Get comprehensive status of the intelligent agent system.
67
-
68
- Returns:
69
- Dictionary with system status and statistics
70
- """
71
40
  return await get_intelligence_system_status()
72
41
 
73
42
  @mcp_app.tool()
74
43
  async def agent_performance_analysis():
75
- """Analyze agent performance and learning insights.
76
-
77
- Returns:
78
- Dictionary with performance analysis and insights
79
- """
80
44
  return await analyze_agent_performance()
@@ -1,5 +1,3 @@
1
- """MCP tools for the Intelligent Agent Selection System."""
2
-
3
1
  import asyncio
4
2
  import logging
5
3
  import typing as t
@@ -16,23 +14,10 @@ async def execute_smart_agent_task(
16
14
  max_agents: int = 3,
17
15
  use_learning: bool = True,
18
16
  ) -> dict[str, t.Any]:
19
- """Execute a task using intelligent agent selection.
20
-
21
- Args:
22
- task_description: Description of the task to execute
23
- context_type: Type of task context (architecture, refactoring, testing, etc.)
24
- strategy: Execution strategy (single_best, parallel, sequential, consensus)
25
- max_agents: Maximum number of agents to consider
26
- use_learning: Whether to apply adaptive learning
27
-
28
- Returns:
29
- Dictionary with execution results and metadata
30
- """
31
17
  get_context()
32
18
  logger = logging.getLogger(__name__)
33
19
 
34
20
  try:
35
- # Parse context type
36
21
  task_context = None
37
22
  context_map = {
38
23
  "architecture": TaskContext.ARCHITECTURE,
@@ -50,7 +35,6 @@ async def execute_smart_agent_task(
50
35
  if context_type.lower() in context_map:
51
36
  task_context = context_map[context_type.lower()]
52
37
 
53
- # Parse strategy
54
38
  strategy_map = {
55
39
  "single_best": ExecutionStrategy.SINGLE_BEST,
56
40
  "parallel": ExecutionStrategy.PARALLEL,
@@ -62,7 +46,6 @@ async def execute_smart_agent_task(
62
46
  strategy.lower(), ExecutionStrategy.SINGLE_BEST
63
47
  )
64
48
 
65
- # Get intelligent agent system
66
49
  system = await get_intelligent_agent_system()
67
50
 
68
51
  logger.info(
@@ -70,14 +53,12 @@ async def execute_smart_agent_task(
70
53
  f"(context: {context_type}, strategy: {strategy})"
71
54
  )
72
55
 
73
- # Execute task
74
56
  result = await system.execute_smart_task(
75
57
  description=task_description,
76
58
  context=task_context,
77
59
  strategy=execution_strategy,
78
60
  )
79
61
 
80
- # Prepare response
81
62
  response = {
82
63
  "success": result.success,
83
64
  "agents_used": result.agents_used,
@@ -90,12 +71,9 @@ async def execute_smart_agent_task(
90
71
  "strategy_used": strategy,
91
72
  }
92
73
 
93
- # Add result based on type
94
74
  if hasattr(result.result, "__dict__"):
95
- # Complex object - convert to dict
96
75
  try:
97
76
  if hasattr(result.result, "success"):
98
- # Looks like FixResult
99
77
  response["fix_result"] = {
100
78
  "success": getattr(result.result, "success", False),
101
79
  "confidence": getattr(result.result, "confidence", 0.0),
@@ -118,7 +96,7 @@ async def execute_smart_agent_task(
118
96
  if result.success:
119
97
  logger.info(
120
98
  f"Smart task completed successfully using {len(result.agents_used)} agents "
121
- f"in {result.execution_time:.2f}s"
99
+ f"in {result.execution_time: .2f}s"
122
100
  )
123
101
  else:
124
102
  logger.warning(f"Smart task failed: {result.recommendations}")
@@ -141,20 +119,9 @@ async def get_smart_agent_recommendation(
141
119
  context_type: str = "general",
142
120
  include_analysis: bool = True,
143
121
  ) -> dict[str, t.Any]:
144
- """Get agent recommendation for a task without executing it.
145
-
146
- Args:
147
- task_description: Description of the task
148
- context_type: Type of task context
149
- include_analysis: Whether to include complexity analysis
150
-
151
- Returns:
152
- Dictionary with recommendation details
153
- """
154
122
  logger = logging.getLogger(__name__)
155
123
 
156
124
  try:
157
- # Parse context type
158
125
  task_context = None
159
126
  context_map = {
160
127
  "architecture": TaskContext.ARCHITECTURE,
@@ -172,10 +139,8 @@ async def get_smart_agent_recommendation(
172
139
  if context_type.lower() in context_map:
173
140
  task_context = context_map[context_type.lower()]
174
141
 
175
- # Get intelligent agent system
176
142
  system = await get_intelligent_agent_system()
177
143
 
178
- # Get recommendation
179
144
  recommendation = await system.get_best_agent_for_task(
180
145
  description=task_description,
181
146
  context=task_context,
@@ -205,7 +170,6 @@ async def get_smart_agent_recommendation(
205
170
  }
206
171
  )
207
172
 
208
- # Add complexity analysis if requested
209
173
  if include_analysis:
210
174
  try:
211
175
  analysis = await system.analyze_task_complexity(task_description)
@@ -228,18 +192,12 @@ async def get_smart_agent_recommendation(
228
192
 
229
193
 
230
194
  async def get_intelligence_system_status() -> dict[str, t.Any]:
231
- """Get comprehensive status of the intelligent agent system.
232
-
233
- Returns:
234
- Dictionary with system status and statistics
235
- """
236
195
  logger = logging.getLogger(__name__)
237
196
 
238
197
  try:
239
198
  system = await get_intelligent_agent_system()
240
199
  status = await system.get_system_status()
241
200
 
242
- # Add additional runtime information
243
201
  status["runtime_info"] = {
244
202
  "system_initialized": system._initialized,
245
203
  "components_loaded": {
@@ -261,24 +219,16 @@ async def get_intelligence_system_status() -> dict[str, t.Any]:
261
219
 
262
220
 
263
221
  async def analyze_agent_performance() -> dict[str, t.Any]:
264
- """Analyze agent performance and learning insights.
265
-
266
- Returns:
267
- Dictionary with performance analysis and insights
268
- """
269
222
  logger = logging.getLogger(__name__)
270
223
 
271
224
  try:
272
225
  system = await get_intelligent_agent_system()
273
226
  await system.initialize()
274
227
 
275
- # Get learning summary
276
228
  learning_summary = system.learning_system.get_learning_summary()
277
229
 
278
- # Get orchestrator stats
279
230
  orchestration_stats = system.orchestrator.get_execution_stats()
280
231
 
281
- # Get agent capabilities overview
282
232
  registry_stats = system.registry.get_agent_stats()
283
233
 
284
234
  performance_analysis = {
@@ -288,7 +238,6 @@ async def analyze_agent_performance() -> dict[str, t.Any]:
288
238
  "analysis_timestamp": asyncio.get_event_loop().time(),
289
239
  }
290
240
 
291
- # Add insights if available
292
241
  if hasattr(system.learning_system, "_learning_insights"):
293
242
  recent_insights = [
294
243
  {
@@ -297,9 +246,7 @@ async def analyze_agent_performance() -> dict[str, t.Any]:
297
246
  "confidence": insight.confidence,
298
247
  "description": insight.description,
299
248
  }
300
- for insight in system.learning_system._learning_insights[
301
- -10:
302
- ] # Last 10 insights
249
+ for insight in system.learning_system._learning_insights[-10:]
303
250
  ]
304
251
  performance_analysis["recent_insights"] = recent_insights
305
252