crackerjack 0.32.0__py3-none-any.whl → 0.33.1__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/__main__.py +1350 -34
- crackerjack/adapters/__init__.py +17 -0
- crackerjack/adapters/lsp_client.py +358 -0
- crackerjack/adapters/rust_tool_adapter.py +194 -0
- crackerjack/adapters/rust_tool_manager.py +193 -0
- crackerjack/adapters/skylos_adapter.py +231 -0
- crackerjack/adapters/zuban_adapter.py +560 -0
- crackerjack/agents/base.py +7 -3
- crackerjack/agents/coordinator.py +271 -33
- crackerjack/agents/documentation_agent.py +9 -15
- crackerjack/agents/dry_agent.py +3 -15
- crackerjack/agents/formatting_agent.py +1 -1
- crackerjack/agents/import_optimization_agent.py +36 -180
- crackerjack/agents/performance_agent.py +17 -98
- crackerjack/agents/performance_helpers.py +7 -31
- crackerjack/agents/proactive_agent.py +1 -3
- crackerjack/agents/refactoring_agent.py +16 -85
- crackerjack/agents/refactoring_helpers.py +7 -42
- crackerjack/agents/security_agent.py +9 -48
- crackerjack/agents/test_creation_agent.py +356 -513
- crackerjack/agents/test_specialist_agent.py +0 -4
- crackerjack/api.py +6 -25
- crackerjack/cli/cache_handlers.py +204 -0
- crackerjack/cli/cache_handlers_enhanced.py +683 -0
- crackerjack/cli/facade.py +100 -0
- crackerjack/cli/handlers.py +224 -9
- crackerjack/cli/interactive.py +6 -4
- crackerjack/cli/options.py +642 -55
- crackerjack/cli/utils.py +2 -1
- crackerjack/code_cleaner.py +58 -117
- crackerjack/config/global_lock_config.py +8 -48
- crackerjack/config/hooks.py +53 -62
- crackerjack/core/async_workflow_orchestrator.py +24 -34
- crackerjack/core/autofix_coordinator.py +3 -17
- crackerjack/core/enhanced_container.py +64 -6
- crackerjack/core/file_lifecycle.py +12 -89
- crackerjack/core/performance.py +2 -2
- crackerjack/core/performance_monitor.py +15 -55
- crackerjack/core/phase_coordinator.py +257 -218
- crackerjack/core/resource_manager.py +14 -90
- crackerjack/core/service_watchdog.py +62 -95
- crackerjack/core/session_coordinator.py +149 -0
- crackerjack/core/timeout_manager.py +14 -72
- crackerjack/core/websocket_lifecycle.py +13 -78
- crackerjack/core/workflow_orchestrator.py +558 -240
- crackerjack/docs/INDEX.md +11 -0
- crackerjack/docs/generated/api/API_REFERENCE.md +10895 -0
- crackerjack/docs/generated/api/CLI_REFERENCE.md +109 -0
- crackerjack/docs/generated/api/CROSS_REFERENCES.md +1755 -0
- crackerjack/docs/generated/api/PROTOCOLS.md +3 -0
- crackerjack/docs/generated/api/SERVICES.md +1252 -0
- crackerjack/documentation/__init__.py +31 -0
- crackerjack/documentation/ai_templates.py +756 -0
- crackerjack/documentation/dual_output_generator.py +765 -0
- crackerjack/documentation/mkdocs_integration.py +518 -0
- crackerjack/documentation/reference_generator.py +977 -0
- crackerjack/dynamic_config.py +55 -50
- crackerjack/executors/async_hook_executor.py +10 -15
- crackerjack/executors/cached_hook_executor.py +117 -43
- crackerjack/executors/hook_executor.py +8 -34
- crackerjack/executors/hook_lock_manager.py +26 -183
- crackerjack/executors/individual_hook_executor.py +13 -11
- crackerjack/executors/lsp_aware_hook_executor.py +270 -0
- crackerjack/executors/tool_proxy.py +417 -0
- crackerjack/hooks/lsp_hook.py +79 -0
- crackerjack/intelligence/adaptive_learning.py +25 -10
- crackerjack/intelligence/agent_orchestrator.py +2 -5
- crackerjack/intelligence/agent_registry.py +34 -24
- crackerjack/intelligence/agent_selector.py +5 -7
- crackerjack/interactive.py +17 -6
- crackerjack/managers/async_hook_manager.py +0 -1
- crackerjack/managers/hook_manager.py +79 -1
- crackerjack/managers/publish_manager.py +66 -13
- crackerjack/managers/test_command_builder.py +5 -17
- crackerjack/managers/test_executor.py +1 -3
- crackerjack/managers/test_manager.py +109 -7
- crackerjack/managers/test_manager_backup.py +10 -9
- crackerjack/mcp/cache.py +2 -2
- crackerjack/mcp/client_runner.py +1 -1
- crackerjack/mcp/context.py +191 -68
- crackerjack/mcp/dashboard.py +7 -5
- crackerjack/mcp/enhanced_progress_monitor.py +31 -28
- crackerjack/mcp/file_monitor.py +30 -23
- crackerjack/mcp/progress_components.py +31 -21
- crackerjack/mcp/progress_monitor.py +50 -53
- crackerjack/mcp/rate_limiter.py +6 -6
- crackerjack/mcp/server_core.py +161 -32
- crackerjack/mcp/service_watchdog.py +2 -1
- crackerjack/mcp/state.py +4 -7
- crackerjack/mcp/task_manager.py +11 -9
- crackerjack/mcp/tools/core_tools.py +174 -33
- crackerjack/mcp/tools/error_analyzer.py +3 -2
- crackerjack/mcp/tools/execution_tools.py +15 -12
- crackerjack/mcp/tools/execution_tools_backup.py +42 -30
- crackerjack/mcp/tools/intelligence_tool_registry.py +7 -5
- crackerjack/mcp/tools/intelligence_tools.py +5 -2
- crackerjack/mcp/tools/monitoring_tools.py +33 -70
- crackerjack/mcp/tools/proactive_tools.py +24 -11
- crackerjack/mcp/tools/progress_tools.py +5 -8
- crackerjack/mcp/tools/utility_tools.py +20 -14
- crackerjack/mcp/tools/workflow_executor.py +62 -40
- crackerjack/mcp/websocket/app.py +8 -0
- crackerjack/mcp/websocket/endpoints.py +352 -357
- crackerjack/mcp/websocket/jobs.py +40 -57
- crackerjack/mcp/websocket/monitoring_endpoints.py +2935 -0
- crackerjack/mcp/websocket/server.py +7 -25
- crackerjack/mcp/websocket/websocket_handler.py +6 -17
- crackerjack/mixins/__init__.py +3 -0
- crackerjack/mixins/error_handling.py +145 -0
- crackerjack/models/config.py +21 -1
- crackerjack/models/config_adapter.py +49 -1
- crackerjack/models/protocols.py +176 -107
- crackerjack/models/resource_protocols.py +55 -210
- crackerjack/models/task.py +3 -0
- crackerjack/monitoring/ai_agent_watchdog.py +13 -13
- crackerjack/monitoring/metrics_collector.py +426 -0
- crackerjack/monitoring/regression_prevention.py +8 -8
- crackerjack/monitoring/websocket_server.py +643 -0
- crackerjack/orchestration/advanced_orchestrator.py +11 -6
- crackerjack/orchestration/coverage_improvement.py +3 -3
- crackerjack/orchestration/execution_strategies.py +26 -6
- crackerjack/orchestration/test_progress_streamer.py +8 -5
- crackerjack/plugins/base.py +2 -2
- crackerjack/plugins/hooks.py +7 -0
- crackerjack/plugins/managers.py +11 -8
- crackerjack/security/__init__.py +0 -1
- crackerjack/security/audit.py +90 -105
- crackerjack/services/anomaly_detector.py +392 -0
- crackerjack/services/api_extractor.py +615 -0
- crackerjack/services/backup_service.py +2 -2
- crackerjack/services/bounded_status_operations.py +15 -152
- crackerjack/services/cache.py +127 -1
- crackerjack/services/changelog_automation.py +395 -0
- crackerjack/services/config.py +18 -11
- crackerjack/services/config_merge.py +30 -85
- crackerjack/services/config_template.py +506 -0
- crackerjack/services/contextual_ai_assistant.py +48 -22
- crackerjack/services/coverage_badge_service.py +171 -0
- crackerjack/services/coverage_ratchet.py +41 -17
- crackerjack/services/debug.py +3 -3
- crackerjack/services/dependency_analyzer.py +460 -0
- crackerjack/services/dependency_monitor.py +14 -11
- crackerjack/services/documentation_generator.py +491 -0
- crackerjack/services/documentation_service.py +675 -0
- crackerjack/services/enhanced_filesystem.py +6 -5
- crackerjack/services/enterprise_optimizer.py +865 -0
- crackerjack/services/error_pattern_analyzer.py +676 -0
- crackerjack/services/file_hasher.py +1 -1
- crackerjack/services/git.py +41 -45
- crackerjack/services/health_metrics.py +10 -8
- crackerjack/services/heatmap_generator.py +735 -0
- crackerjack/services/initialization.py +30 -33
- crackerjack/services/input_validator.py +5 -97
- crackerjack/services/intelligent_commit.py +327 -0
- crackerjack/services/log_manager.py +15 -12
- crackerjack/services/logging.py +4 -3
- crackerjack/services/lsp_client.py +628 -0
- crackerjack/services/memory_optimizer.py +409 -0
- crackerjack/services/metrics.py +42 -33
- crackerjack/services/parallel_executor.py +416 -0
- crackerjack/services/pattern_cache.py +1 -1
- crackerjack/services/pattern_detector.py +6 -6
- crackerjack/services/performance_benchmarks.py +250 -576
- crackerjack/services/performance_cache.py +382 -0
- crackerjack/services/performance_monitor.py +565 -0
- crackerjack/services/predictive_analytics.py +510 -0
- crackerjack/services/quality_baseline.py +234 -0
- crackerjack/services/quality_baseline_enhanced.py +646 -0
- crackerjack/services/quality_intelligence.py +785 -0
- crackerjack/services/regex_patterns.py +605 -524
- crackerjack/services/regex_utils.py +43 -123
- crackerjack/services/secure_path_utils.py +5 -164
- crackerjack/services/secure_status_formatter.py +30 -141
- crackerjack/services/secure_subprocess.py +11 -92
- crackerjack/services/security.py +61 -30
- crackerjack/services/security_logger.py +18 -22
- crackerjack/services/server_manager.py +124 -16
- crackerjack/services/status_authentication.py +16 -159
- crackerjack/services/status_security_manager.py +4 -131
- crackerjack/services/terminal_utils.py +0 -0
- crackerjack/services/thread_safe_status_collector.py +19 -125
- crackerjack/services/unified_config.py +21 -13
- crackerjack/services/validation_rate_limiter.py +5 -54
- crackerjack/services/version_analyzer.py +459 -0
- crackerjack/services/version_checker.py +1 -1
- crackerjack/services/websocket_resource_limiter.py +10 -144
- crackerjack/services/zuban_lsp_service.py +390 -0
- crackerjack/slash_commands/__init__.py +2 -7
- crackerjack/slash_commands/run.md +2 -2
- crackerjack/tools/validate_input_validator_patterns.py +14 -40
- crackerjack/tools/validate_regex_patterns.py +19 -48
- {crackerjack-0.32.0.dist-info → crackerjack-0.33.1.dist-info}/METADATA +197 -26
- crackerjack-0.33.1.dist-info/RECORD +229 -0
- crackerjack/CLAUDE.md +0 -207
- crackerjack/RULES.md +0 -380
- crackerjack/py313.py +0 -234
- crackerjack-0.32.0.dist-info/RECORD +0 -180
- {crackerjack-0.32.0.dist-info → crackerjack-0.33.1.dist-info}/WHEEL +0 -0
- {crackerjack-0.32.0.dist-info → crackerjack-0.33.1.dist-info}/entry_points.txt +0 -0
- {crackerjack-0.32.0.dist-info → crackerjack-0.33.1.dist-info}/licenses/LICENSE +0 -0
|
@@ -90,7 +90,7 @@ class HookExecutor:
|
|
|
90
90
|
)
|
|
91
91
|
|
|
92
92
|
def _print_strategy_header(self, strategy: HookStrategy) -> None:
|
|
93
|
-
self.console.print("\n" + "-" *
|
|
93
|
+
self.console.print("\n" + "-" * 74)
|
|
94
94
|
if strategy.name == "fast":
|
|
95
95
|
self.console.print(
|
|
96
96
|
"[bold bright_cyan]🔍 HOOKS[/bold bright_cyan] [bold bright_white]Running code quality checks[/bold bright_white]",
|
|
@@ -103,7 +103,7 @@ class HookExecutor:
|
|
|
103
103
|
self.console.print(
|
|
104
104
|
f"[bold bright_cyan]🔍 HOOKS[/bold bright_cyan] [bold bright_white]Running {strategy.name} hooks[/bold bright_white]",
|
|
105
105
|
)
|
|
106
|
-
self.console.print("-" *
|
|
106
|
+
self.console.print("-" * 74 + "\n")
|
|
107
107
|
|
|
108
108
|
def _execute_sequential(self, strategy: HookStrategy) -> list[HookResult]:
|
|
109
109
|
results: list[HookResult] = []
|
|
@@ -170,17 +170,11 @@ class HookExecutor:
|
|
|
170
170
|
def _run_hook_subprocess(
|
|
171
171
|
self, hook: HookDefinition
|
|
172
172
|
) -> subprocess.CompletedProcess[str]:
|
|
173
|
-
"""Run hook subprocess with comprehensive security validation."""
|
|
174
|
-
# Get sanitized environment
|
|
175
173
|
clean_env = self._get_clean_environment()
|
|
176
174
|
|
|
177
|
-
# Use secure subprocess execution
|
|
178
175
|
try:
|
|
179
|
-
# Pre-commit must run from repository root
|
|
180
|
-
# For crackerjack package structure, the repo root is pkg_path itself
|
|
181
176
|
repo_root = self.pkg_path
|
|
182
|
-
|
|
183
|
-
# Use direct subprocess execution for hooks
|
|
177
|
+
|
|
184
178
|
return subprocess.run(
|
|
185
179
|
hook.get_command(),
|
|
186
180
|
cwd=repo_root,
|
|
@@ -188,10 +182,9 @@ class HookExecutor:
|
|
|
188
182
|
timeout=hook.timeout,
|
|
189
183
|
capture_output=True,
|
|
190
184
|
text=True,
|
|
191
|
-
check=False,
|
|
185
|
+
check=False,
|
|
192
186
|
)
|
|
193
187
|
except Exception as e:
|
|
194
|
-
# Log security issues but convert to subprocess-compatible result
|
|
195
188
|
security_logger = get_security_logger()
|
|
196
189
|
security_logger.log_subprocess_failure(
|
|
197
190
|
command=hook.get_command(),
|
|
@@ -199,7 +192,6 @@ class HookExecutor:
|
|
|
199
192
|
error_output=str(e),
|
|
200
193
|
)
|
|
201
194
|
|
|
202
|
-
# Return a failed CompletedProcess for consistency
|
|
203
195
|
return subprocess.CompletedProcess(
|
|
204
196
|
args=hook.get_command(), returncode=1, stdout="", stderr=str(e)
|
|
205
197
|
)
|
|
@@ -221,9 +213,7 @@ class HookExecutor:
|
|
|
221
213
|
result: subprocess.CompletedProcess[str],
|
|
222
214
|
duration: float,
|
|
223
215
|
) -> HookResult:
|
|
224
|
-
# Formatting hooks return 1 when they fix files, which is success
|
|
225
216
|
if hook.is_formatting and result.returncode == 1:
|
|
226
|
-
# Check if files were modified (successful formatting)
|
|
227
217
|
output_text = result.stdout + result.stderr
|
|
228
218
|
if "files were modified by this hook" in output_text:
|
|
229
219
|
status = "passed"
|
|
@@ -255,7 +245,6 @@ class HookExecutor:
|
|
|
255
245
|
|
|
256
246
|
error_output = (result.stdout + result.stderr).strip()
|
|
257
247
|
|
|
258
|
-
# For formatting hooks that successfully modified files, don't report as issues
|
|
259
248
|
if hook.is_formatting and "files were modified by this hook" in error_output:
|
|
260
249
|
return []
|
|
261
250
|
|
|
@@ -376,13 +365,6 @@ class HookExecutor:
|
|
|
376
365
|
return updated_results
|
|
377
366
|
|
|
378
367
|
def _get_clean_environment(self) -> dict[str, str]:
|
|
379
|
-
"""
|
|
380
|
-
Get a sanitized environment for hook execution.
|
|
381
|
-
|
|
382
|
-
This method now delegates to the secure subprocess utilities
|
|
383
|
-
for comprehensive environment sanitization with security logging.
|
|
384
|
-
"""
|
|
385
|
-
# Create base environment with essential variables
|
|
386
368
|
clean_env = {
|
|
387
369
|
"HOME": os.environ.get("HOME", ""),
|
|
388
370
|
"USER": os.environ.get("USER", ""),
|
|
@@ -392,14 +374,12 @@ class HookExecutor:
|
|
|
392
374
|
"TERM": os.environ.get("TERM", "xterm-256color"),
|
|
393
375
|
}
|
|
394
376
|
|
|
395
|
-
# Handle PATH sanitization with venv filtering
|
|
396
377
|
system_path = os.environ.get("PATH", "")
|
|
397
378
|
if system_path:
|
|
398
379
|
venv_bin = str(Path(self.pkg_path) / ".venv" / "bin")
|
|
399
|
-
path_parts = [p for p in system_path.split(":") if p != venv_bin]
|
|
400
|
-
clean_env["PATH"] = ":".join(path_parts)
|
|
380
|
+
path_parts = [p for p in system_path.split(": ") if p != venv_bin]
|
|
381
|
+
clean_env["PATH"] = ": ".join(path_parts)
|
|
401
382
|
|
|
402
|
-
# Define Python-specific variables to exclude
|
|
403
383
|
python_vars_to_exclude = {
|
|
404
384
|
"VIRTUAL_ENV",
|
|
405
385
|
"PYTHONPATH",
|
|
@@ -411,18 +391,15 @@ class HookExecutor:
|
|
|
411
391
|
"POETRY_ACTIVE",
|
|
412
392
|
}
|
|
413
393
|
|
|
414
|
-
# Add other safe environment variables
|
|
415
394
|
security_logger = get_security_logger()
|
|
416
395
|
original_count = len(os.environ)
|
|
417
396
|
filtered_count = 0
|
|
418
397
|
|
|
419
398
|
for key, value in os.environ.items():
|
|
420
399
|
if key not in python_vars_to_exclude and key not in clean_env:
|
|
421
|
-
# Additional security filtering
|
|
422
400
|
if not key.startswith(
|
|
423
401
|
("PYTHON", "PIP_", "CONDA_", "VIRTUAL_", "__PYVENV")
|
|
424
402
|
):
|
|
425
|
-
# Check for dangerous environment variables
|
|
426
403
|
if key not in {"LD_PRELOAD", "DYLD_INSERT_LIBRARIES", "IFS", "PS4"}:
|
|
427
404
|
clean_env[key] = value
|
|
428
405
|
else:
|
|
@@ -435,12 +412,11 @@ class HookExecutor:
|
|
|
435
412
|
else:
|
|
436
413
|
filtered_count += 1
|
|
437
414
|
|
|
438
|
-
|
|
439
|
-
if filtered_count > 5: # Only log if substantial filtering
|
|
415
|
+
if filtered_count > 5:
|
|
440
416
|
security_logger.log_subprocess_environment_sanitized(
|
|
441
417
|
original_count=original_count,
|
|
442
418
|
sanitized_count=len(clean_env),
|
|
443
|
-
filtered_vars=[],
|
|
419
|
+
filtered_vars=[],
|
|
444
420
|
)
|
|
445
421
|
|
|
446
422
|
return clean_env
|
|
@@ -451,6 +427,4 @@ class HookExecutor:
|
|
|
451
427
|
results: list[HookResult],
|
|
452
428
|
success: bool,
|
|
453
429
|
) -> None:
|
|
454
|
-
# Summary is handled by PhaseCoordinator to avoid duplicate messages
|
|
455
|
-
# Individual hook results are already displayed above
|
|
456
430
|
pass
|