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.
- crackerjack/CLAUDE.md +288 -705
- crackerjack/__main__.py +22 -8
- crackerjack/agents/__init__.py +0 -3
- crackerjack/agents/architect_agent.py +0 -43
- crackerjack/agents/base.py +1 -9
- crackerjack/agents/coordinator.py +2 -148
- crackerjack/agents/documentation_agent.py +109 -81
- crackerjack/agents/dry_agent.py +122 -97
- crackerjack/agents/formatting_agent.py +3 -16
- crackerjack/agents/import_optimization_agent.py +1174 -130
- crackerjack/agents/performance_agent.py +956 -188
- crackerjack/agents/performance_helpers.py +229 -0
- crackerjack/agents/proactive_agent.py +1 -48
- crackerjack/agents/refactoring_agent.py +516 -246
- crackerjack/agents/refactoring_helpers.py +282 -0
- crackerjack/agents/security_agent.py +393 -90
- crackerjack/agents/test_creation_agent.py +1776 -120
- crackerjack/agents/test_specialist_agent.py +59 -15
- crackerjack/agents/tracker.py +0 -102
- crackerjack/api.py +145 -37
- crackerjack/cli/handlers.py +48 -30
- crackerjack/cli/interactive.py +11 -11
- crackerjack/cli/options.py +66 -4
- crackerjack/code_cleaner.py +808 -148
- crackerjack/config/global_lock_config.py +110 -0
- crackerjack/config/hooks.py +43 -64
- crackerjack/core/async_workflow_orchestrator.py +247 -97
- crackerjack/core/autofix_coordinator.py +192 -109
- crackerjack/core/enhanced_container.py +46 -63
- crackerjack/core/file_lifecycle.py +549 -0
- crackerjack/core/performance.py +9 -8
- crackerjack/core/performance_monitor.py +395 -0
- crackerjack/core/phase_coordinator.py +281 -94
- crackerjack/core/proactive_workflow.py +9 -58
- crackerjack/core/resource_manager.py +501 -0
- crackerjack/core/service_watchdog.py +490 -0
- crackerjack/core/session_coordinator.py +4 -8
- crackerjack/core/timeout_manager.py +504 -0
- crackerjack/core/websocket_lifecycle.py +475 -0
- crackerjack/core/workflow_orchestrator.py +343 -209
- crackerjack/dynamic_config.py +50 -9
- crackerjack/errors.py +3 -4
- crackerjack/executors/async_hook_executor.py +63 -13
- crackerjack/executors/cached_hook_executor.py +14 -14
- crackerjack/executors/hook_executor.py +100 -37
- crackerjack/executors/hook_lock_manager.py +856 -0
- crackerjack/executors/individual_hook_executor.py +120 -86
- crackerjack/intelligence/__init__.py +0 -7
- crackerjack/intelligence/adaptive_learning.py +13 -86
- crackerjack/intelligence/agent_orchestrator.py +15 -78
- crackerjack/intelligence/agent_registry.py +12 -59
- crackerjack/intelligence/agent_selector.py +31 -92
- crackerjack/intelligence/integration.py +1 -41
- crackerjack/interactive.py +9 -9
- crackerjack/managers/async_hook_manager.py +25 -8
- crackerjack/managers/hook_manager.py +9 -9
- crackerjack/managers/publish_manager.py +57 -59
- crackerjack/managers/test_command_builder.py +6 -36
- crackerjack/managers/test_executor.py +9 -61
- crackerjack/managers/test_manager.py +17 -63
- crackerjack/managers/test_manager_backup.py +77 -127
- crackerjack/managers/test_progress.py +4 -23
- crackerjack/mcp/cache.py +5 -12
- crackerjack/mcp/client_runner.py +10 -10
- crackerjack/mcp/context.py +64 -6
- crackerjack/mcp/dashboard.py +14 -11
- crackerjack/mcp/enhanced_progress_monitor.py +55 -55
- crackerjack/mcp/file_monitor.py +72 -42
- crackerjack/mcp/progress_components.py +103 -84
- crackerjack/mcp/progress_monitor.py +122 -49
- crackerjack/mcp/rate_limiter.py +12 -12
- crackerjack/mcp/server_core.py +16 -22
- crackerjack/mcp/service_watchdog.py +26 -26
- crackerjack/mcp/state.py +15 -0
- crackerjack/mcp/tools/core_tools.py +95 -39
- crackerjack/mcp/tools/error_analyzer.py +6 -32
- crackerjack/mcp/tools/execution_tools.py +1 -56
- crackerjack/mcp/tools/execution_tools_backup.py +35 -131
- crackerjack/mcp/tools/intelligence_tool_registry.py +0 -36
- crackerjack/mcp/tools/intelligence_tools.py +2 -55
- crackerjack/mcp/tools/monitoring_tools.py +308 -145
- crackerjack/mcp/tools/proactive_tools.py +12 -42
- crackerjack/mcp/tools/progress_tools.py +23 -15
- crackerjack/mcp/tools/utility_tools.py +3 -40
- crackerjack/mcp/tools/workflow_executor.py +40 -60
- crackerjack/mcp/websocket/app.py +0 -3
- crackerjack/mcp/websocket/endpoints.py +206 -268
- crackerjack/mcp/websocket/jobs.py +213 -66
- crackerjack/mcp/websocket/server.py +84 -6
- crackerjack/mcp/websocket/websocket_handler.py +137 -29
- crackerjack/models/config_adapter.py +3 -16
- crackerjack/models/protocols.py +162 -3
- crackerjack/models/resource_protocols.py +454 -0
- crackerjack/models/task.py +3 -3
- crackerjack/monitoring/__init__.py +0 -0
- crackerjack/monitoring/ai_agent_watchdog.py +25 -71
- crackerjack/monitoring/regression_prevention.py +28 -87
- crackerjack/orchestration/advanced_orchestrator.py +44 -78
- crackerjack/orchestration/coverage_improvement.py +10 -60
- crackerjack/orchestration/execution_strategies.py +16 -16
- crackerjack/orchestration/test_progress_streamer.py +61 -53
- crackerjack/plugins/base.py +1 -1
- crackerjack/plugins/managers.py +22 -20
- crackerjack/py313.py +65 -21
- crackerjack/services/backup_service.py +467 -0
- crackerjack/services/bounded_status_operations.py +627 -0
- crackerjack/services/cache.py +7 -9
- crackerjack/services/config.py +35 -52
- crackerjack/services/config_integrity.py +5 -16
- crackerjack/services/config_merge.py +542 -0
- crackerjack/services/contextual_ai_assistant.py +17 -19
- crackerjack/services/coverage_ratchet.py +44 -73
- crackerjack/services/debug.py +25 -39
- crackerjack/services/dependency_monitor.py +52 -50
- crackerjack/services/enhanced_filesystem.py +14 -11
- crackerjack/services/file_hasher.py +1 -1
- crackerjack/services/filesystem.py +1 -12
- crackerjack/services/git.py +71 -47
- crackerjack/services/health_metrics.py +31 -27
- crackerjack/services/initialization.py +276 -428
- crackerjack/services/input_validator.py +760 -0
- crackerjack/services/log_manager.py +16 -16
- crackerjack/services/logging.py +7 -6
- crackerjack/services/metrics.py +43 -43
- crackerjack/services/pattern_cache.py +2 -31
- crackerjack/services/pattern_detector.py +26 -63
- crackerjack/services/performance_benchmarks.py +20 -45
- crackerjack/services/regex_patterns.py +2887 -0
- crackerjack/services/regex_utils.py +537 -0
- crackerjack/services/secure_path_utils.py +683 -0
- crackerjack/services/secure_status_formatter.py +534 -0
- crackerjack/services/secure_subprocess.py +605 -0
- crackerjack/services/security.py +47 -10
- crackerjack/services/security_logger.py +492 -0
- crackerjack/services/server_manager.py +109 -50
- crackerjack/services/smart_scheduling.py +8 -25
- crackerjack/services/status_authentication.py +603 -0
- crackerjack/services/status_security_manager.py +442 -0
- crackerjack/services/thread_safe_status_collector.py +546 -0
- crackerjack/services/tool_version_service.py +1 -23
- crackerjack/services/unified_config.py +36 -58
- crackerjack/services/validation_rate_limiter.py +269 -0
- crackerjack/services/version_checker.py +9 -40
- crackerjack/services/websocket_resource_limiter.py +572 -0
- crackerjack/slash_commands/__init__.py +52 -2
- crackerjack/tools/__init__.py +0 -0
- crackerjack/tools/validate_input_validator_patterns.py +262 -0
- crackerjack/tools/validate_regex_patterns.py +198 -0
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/METADATA +197 -12
- crackerjack-0.31.13.dist-info/RECORD +178 -0
- crackerjack/cli/facade.py +0 -104
- crackerjack-0.31.10.dist-info/RECORD +0 -149
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/WHEEL +0 -0
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.31.10.dist-info → crackerjack-0.31.13.dist-info}/licenses/LICENSE +0 -0
|
@@ -9,12 +9,6 @@ from ..models.protocols import OptionsProtocol
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class ProactiveWorkflowPipeline:
|
|
12
|
-
"""Enhanced workflow pipeline with proactive architectural planning.
|
|
13
|
-
|
|
14
|
-
This pipeline adds a planning phase before each iteration to prevent
|
|
15
|
-
issues through intelligent architecture rather than reactive fixing.
|
|
16
|
-
"""
|
|
17
|
-
|
|
18
12
|
def __init__(self, project_path: Path) -> None:
|
|
19
13
|
self.project_path = project_path
|
|
20
14
|
self.logger = logging.getLogger(__name__)
|
|
@@ -23,22 +17,18 @@ class ProactiveWorkflowPipeline:
|
|
|
23
17
|
async def run_complete_workflow_with_planning(
|
|
24
18
|
self, options: OptionsProtocol
|
|
25
19
|
) -> bool:
|
|
26
|
-
"""Execute workflow with proactive planning phases."""
|
|
27
20
|
self.logger.info("Starting proactive workflow with architectural planning")
|
|
28
21
|
|
|
29
22
|
start_time = time.time()
|
|
30
23
|
|
|
31
24
|
try:
|
|
32
|
-
# Phase 1: Initial architectural assessment
|
|
33
25
|
assessment = await self._assess_codebase_architecture()
|
|
34
26
|
|
|
35
27
|
if assessment.needs_planning:
|
|
36
28
|
self.logger.info("Codebase requires architectural planning")
|
|
37
29
|
|
|
38
|
-
# Phase 2: Create comprehensive architectural plan
|
|
39
30
|
architectural_plan = await self._create_comprehensive_plan(assessment)
|
|
40
31
|
|
|
41
|
-
# Phase 3: Execute workflow following the plan
|
|
42
32
|
result = await self._execute_planned_workflow(
|
|
43
33
|
options, architectural_plan
|
|
44
34
|
)
|
|
@@ -46,33 +36,29 @@ class ProactiveWorkflowPipeline:
|
|
|
46
36
|
self.logger.info(
|
|
47
37
|
"Codebase is architecturally sound, using standard workflow"
|
|
48
38
|
)
|
|
49
|
-
|
|
39
|
+
|
|
50
40
|
result = await self._execute_standard_workflow(options)
|
|
51
41
|
|
|
52
42
|
execution_time = time.time() - start_time
|
|
53
|
-
self.logger.info(f"Proactive workflow completed in {execution_time
|
|
43
|
+
self.logger.info(f"Proactive workflow completed in {execution_time: .2f}s")
|
|
54
44
|
|
|
55
45
|
return result
|
|
56
46
|
|
|
57
47
|
except Exception as e:
|
|
58
48
|
self.logger.exception(f"Proactive workflow failed: {e}")
|
|
59
|
-
|
|
49
|
+
|
|
60
50
|
return await self._execute_standard_workflow(options)
|
|
61
51
|
|
|
62
52
|
async def _assess_codebase_architecture(self) -> "ArchitecturalAssessment":
|
|
63
|
-
"""Assess the codebase to determine if proactive planning is needed."""
|
|
64
53
|
self.logger.info("Assessing codebase architecture...")
|
|
65
54
|
|
|
66
|
-
# Initialize architect coordinator if needed
|
|
67
55
|
if not self._architect_agent_coordinator:
|
|
68
56
|
agent_context = AgentContext(project_path=self.project_path)
|
|
69
57
|
self._architect_agent_coordinator = AgentCoordinator(agent_context)
|
|
70
58
|
self._architect_agent_coordinator.initialize_agents()
|
|
71
59
|
|
|
72
|
-
# Create test issues to assess complexity
|
|
73
60
|
test_issues = await self._identify_potential_issues()
|
|
74
61
|
|
|
75
|
-
# Determine if planning is beneficial
|
|
76
62
|
needs_planning = self._evaluate_planning_need(test_issues)
|
|
77
63
|
|
|
78
64
|
return ArchitecturalAssessment(
|
|
@@ -83,13 +69,8 @@ class ProactiveWorkflowPipeline:
|
|
|
83
69
|
)
|
|
84
70
|
|
|
85
71
|
async def _identify_potential_issues(self) -> list[Issue]:
|
|
86
|
-
"""Identify potential architectural issues in the codebase."""
|
|
87
|
-
# This would integrate with static analysis tools
|
|
88
|
-
# For now, create representative issues based on common patterns
|
|
89
|
-
|
|
90
72
|
potential_issues = []
|
|
91
73
|
|
|
92
|
-
# Check for complexity hotspots (would use real analysis)
|
|
93
74
|
potential_issues.extend(
|
|
94
75
|
(
|
|
95
76
|
Issue(
|
|
@@ -114,12 +95,6 @@ class ProactiveWorkflowPipeline:
|
|
|
114
95
|
return potential_issues
|
|
115
96
|
|
|
116
97
|
def _evaluate_planning_need(self, issues: list[Issue]) -> bool:
|
|
117
|
-
"""Evaluate if proactive planning would be beneficial."""
|
|
118
|
-
# Planning is beneficial for:
|
|
119
|
-
# 1. Multiple complex issues
|
|
120
|
-
# 2. Architectural issues (complexity, DRY, performance)
|
|
121
|
-
# 3. Projects with many interdependencies
|
|
122
|
-
|
|
123
98
|
complex_issues = [
|
|
124
99
|
issue
|
|
125
100
|
for issue in issues
|
|
@@ -127,18 +102,16 @@ class ProactiveWorkflowPipeline:
|
|
|
127
102
|
in {IssueType.COMPLEXITY, IssueType.DRY_VIOLATION, IssueType.PERFORMANCE}
|
|
128
103
|
]
|
|
129
104
|
|
|
130
|
-
# Need planning if we have 2+ complex issues
|
|
131
105
|
return len(complex_issues) >= 2
|
|
132
106
|
|
|
133
107
|
async def _create_comprehensive_plan(
|
|
134
108
|
self, assessment: "ArchitecturalAssessment"
|
|
135
109
|
) -> dict[str, t.Any]:
|
|
136
|
-
"""Create comprehensive architectural plan based on assessment."""
|
|
137
110
|
self.logger.info("Creating comprehensive architectural plan...")
|
|
138
111
|
|
|
139
|
-
|
|
112
|
+
if self._architect_agent_coordinator is None:
|
|
113
|
+
raise RuntimeError("ArchitectAgentCoordinator is not initialized")
|
|
140
114
|
|
|
141
|
-
# Use ArchitectAgent to create the plan
|
|
142
115
|
architect = self._architect_agent_coordinator._get_architect_agent()
|
|
143
116
|
|
|
144
117
|
if not architect:
|
|
@@ -149,7 +122,6 @@ class ProactiveWorkflowPipeline:
|
|
|
149
122
|
"patterns": ["default"],
|
|
150
123
|
}
|
|
151
124
|
|
|
152
|
-
# Create plan for the most complex issue as representative
|
|
153
125
|
complex_issues = [
|
|
154
126
|
issue
|
|
155
127
|
for issue in assessment.potential_issues
|
|
@@ -160,7 +132,6 @@ class ProactiveWorkflowPipeline:
|
|
|
160
132
|
primary_issue = complex_issues[0]
|
|
161
133
|
base_plan = await architect.plan_before_action(primary_issue)
|
|
162
134
|
|
|
163
|
-
# Extend to comprehensive workflow plan
|
|
164
135
|
comprehensive_plan = base_plan | {
|
|
165
136
|
"phases": [
|
|
166
137
|
"configuration_setup",
|
|
@@ -190,24 +161,20 @@ class ProactiveWorkflowPipeline:
|
|
|
190
161
|
async def _execute_planned_workflow(
|
|
191
162
|
self, options: OptionsProtocol, plan: dict[str, t.Any]
|
|
192
163
|
) -> bool:
|
|
193
|
-
"""Execute workflow following the architectural plan."""
|
|
194
164
|
strategy = plan.get("strategy", "basic_reactive")
|
|
195
165
|
phases = plan.get("phases", ["standard_workflow"])
|
|
196
166
|
|
|
197
167
|
self.logger.info(f"Executing {strategy} workflow with {len(phases)} phases")
|
|
198
168
|
|
|
199
|
-
# Execute each phase according to the plan
|
|
200
169
|
for phase in phases:
|
|
201
170
|
success = await self._execute_workflow_phase(phase, options, plan)
|
|
202
171
|
if not success and phase in (
|
|
203
172
|
"configuration_setup",
|
|
204
173
|
"architectural_refactoring",
|
|
205
174
|
):
|
|
206
|
-
# Critical phases - fail fast
|
|
207
175
|
self.logger.error(f"Critical phase {phase} failed")
|
|
208
176
|
return False
|
|
209
177
|
elif not success:
|
|
210
|
-
# Non-critical phases - log and continue
|
|
211
178
|
self.logger.warning(f"Phase {phase} had issues but continuing")
|
|
212
179
|
|
|
213
180
|
return True
|
|
@@ -215,10 +182,8 @@ class ProactiveWorkflowPipeline:
|
|
|
215
182
|
async def _execute_workflow_phase(
|
|
216
183
|
self, phase: str, options: OptionsProtocol, plan: dict[str, t.Any]
|
|
217
184
|
) -> bool:
|
|
218
|
-
"""Execute a specific workflow phase."""
|
|
219
185
|
self.logger.info(f"Executing phase: {phase}")
|
|
220
186
|
|
|
221
|
-
# Different phase implementations
|
|
222
187
|
if phase == "configuration_setup":
|
|
223
188
|
return await self._setup_with_architecture(options, plan)
|
|
224
189
|
elif phase == "fast_hooks_with_architecture":
|
|
@@ -229,38 +194,31 @@ class ProactiveWorkflowPipeline:
|
|
|
229
194
|
return await self._comprehensive_validation(options, plan)
|
|
230
195
|
elif phase == "pattern_learning":
|
|
231
196
|
return await self._learn_and_cache_patterns(plan)
|
|
232
|
-
|
|
197
|
+
|
|
233
198
|
return await self._execute_standard_workflow(options)
|
|
234
199
|
|
|
235
200
|
async def _setup_with_architecture(
|
|
236
201
|
self, options: OptionsProtocol, plan: dict[str, t.Any]
|
|
237
202
|
) -> bool:
|
|
238
|
-
"""Setup phase with architectural considerations."""
|
|
239
203
|
self.logger.info("Setting up project with architectural planning")
|
|
240
|
-
|
|
241
|
-
# For now, return success as architecture is already integrated
|
|
204
|
+
|
|
242
205
|
return True
|
|
243
206
|
|
|
244
207
|
async def _run_fast_hooks_with_planning(
|
|
245
208
|
self, options: OptionsProtocol, plan: dict[str, t.Any]
|
|
246
209
|
) -> bool:
|
|
247
|
-
"""Run fast hooks with architectural awareness."""
|
|
248
210
|
self.logger.info("Running fast hooks with architectural planning")
|
|
249
|
-
|
|
250
|
-
# Enhanced to use architectural patterns from the plan
|
|
211
|
+
|
|
251
212
|
return True
|
|
252
213
|
|
|
253
214
|
async def _perform_architectural_refactoring(
|
|
254
215
|
self, options: OptionsProtocol, plan: dict[str, t.Any]
|
|
255
216
|
) -> bool:
|
|
256
|
-
"""Perform refactoring following architectural plan."""
|
|
257
217
|
self.logger.info("Performing architectural refactoring")
|
|
258
218
|
|
|
259
|
-
# Use ArchitectAgent to guide refactoring
|
|
260
219
|
if self._architect_agent_coordinator:
|
|
261
220
|
architect = self._architect_agent_coordinator._get_architect_agent()
|
|
262
221
|
if architect:
|
|
263
|
-
# This would apply the architectural patterns
|
|
264
222
|
patterns = plan.get("patterns", [])
|
|
265
223
|
self.logger.info(f"Applying architectural patterns: {patterns}")
|
|
266
224
|
return True
|
|
@@ -270,21 +228,17 @@ class ProactiveWorkflowPipeline:
|
|
|
270
228
|
async def _comprehensive_validation(
|
|
271
229
|
self, options: OptionsProtocol, plan: dict[str, t.Any]
|
|
272
230
|
) -> bool:
|
|
273
|
-
"""Validate results against architectural plan."""
|
|
274
231
|
self.logger.info("Performing comprehensive validation")
|
|
275
232
|
validation_steps = plan.get("validation", [])
|
|
276
233
|
|
|
277
234
|
for step in validation_steps:
|
|
278
235
|
self.logger.info(f"Validating: {step}")
|
|
279
|
-
# Implement specific validation logic
|
|
280
236
|
|
|
281
237
|
return True
|
|
282
238
|
|
|
283
239
|
async def _learn_and_cache_patterns(self, plan: dict[str, t.Any]) -> bool:
|
|
284
|
-
"""Learn from successful patterns and cache them."""
|
|
285
240
|
self.logger.info("Learning and caching successful patterns")
|
|
286
241
|
|
|
287
|
-
# Cache successful patterns from the plan
|
|
288
242
|
if self._architect_agent_coordinator:
|
|
289
243
|
architect = self._architect_agent_coordinator._get_architect_agent()
|
|
290
244
|
if architect and hasattr(architect, "get_cached_patterns"):
|
|
@@ -294,15 +248,12 @@ class ProactiveWorkflowPipeline:
|
|
|
294
248
|
return True
|
|
295
249
|
|
|
296
250
|
async def _execute_standard_workflow(self, options: OptionsProtocol) -> bool:
|
|
297
|
-
"""Fallback to standard workflow execution."""
|
|
298
251
|
self.logger.info("Executing standard workflow (fallback)")
|
|
299
|
-
|
|
252
|
+
|
|
300
253
|
return True
|
|
301
254
|
|
|
302
255
|
|
|
303
256
|
class ArchitecturalAssessment:
|
|
304
|
-
"""Assessment of codebase architecture for planning decisions."""
|
|
305
|
-
|
|
306
257
|
def __init__(
|
|
307
258
|
self,
|
|
308
259
|
needs_planning: bool,
|