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
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
"""
|
|
3
|
-
Pre-commit hook to validate regex pattern usage.
|
|
4
|
-
|
|
5
|
-
This script ensures all regex patterns use validated patterns from
|
|
6
|
-
crackerjack.services.regex_patterns instead of raw re.sub() calls.
|
|
7
|
-
|
|
8
|
-
CRITICAL: Prevents spacing issues by catching bad regex patterns before they
|
|
9
|
-
enter the codebase.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
1
|
import ast
|
|
13
2
|
import re
|
|
14
3
|
import sys
|
|
15
4
|
from pathlib import Path
|
|
16
5
|
|
|
17
|
-
# Patterns that indicate regex usage
|
|
18
6
|
REGEX_IMPORTS = {
|
|
19
7
|
"re",
|
|
20
8
|
"regex",
|
|
@@ -35,42 +23,32 @@ REGEX_FUNCTIONS = {
|
|
|
35
23
|
"regex.compile",
|
|
36
24
|
}
|
|
37
25
|
|
|
38
|
-
|
|
26
|
+
|
|
39
27
|
ALLOWED_PATTERNS = {
|
|
40
|
-
# Simple string operations are OK
|
|
41
28
|
r"re\.escape\(",
|
|
42
|
-
r"re\.compile\(r?['\"]\\\\[wd]",
|
|
43
|
-
#
|
|
44
|
-
r"# REGEX OK:", # Comment-based exemption
|
|
45
|
-
# Validation in regex_patterns.py itself
|
|
29
|
+
r"re\.compile\(r?['\"]\\\\[wd]",
|
|
30
|
+
r"# REGEX OK: ",
|
|
46
31
|
r"crackerjack/services/regex_patterns\.py$",
|
|
47
|
-
# Regex validation tools themselves
|
|
48
32
|
r"tools/validate_regex_patterns_standalone\.py$",
|
|
49
33
|
r"crackerjack/tools/validate_regex_patterns\.py$",
|
|
50
|
-
# Test files that legitimately test regex patterns
|
|
51
34
|
r"tests/test_.*\.py$",
|
|
52
|
-
# Core security and subprocess files that need regex for parsing
|
|
53
35
|
r"crackerjack/services/secure_subprocess\.py$",
|
|
54
36
|
r"crackerjack/mcp/tools/core_tools\.py$",
|
|
55
|
-
# Intelligence and workflow files with legitimate parsing needs
|
|
56
37
|
r"crackerjack/intelligence/agent_selector\.py$",
|
|
57
38
|
r"crackerjack/managers/test_.*\.py$",
|
|
58
39
|
r"crackerjack/core/async_workflow_orchestrator\.py$",
|
|
59
|
-
# Agent files that use validated patterns with dynamic escaping
|
|
60
40
|
r"crackerjack/agents/.*\.py$",
|
|
61
41
|
}
|
|
62
42
|
|
|
63
43
|
FORBIDDEN_REPLACEMENT_PATTERNS = [
|
|
64
|
-
r"\\g\s
|
|
65
|
-
r"\\g<\s+\d+>", #
|
|
66
|
-
r"\\g<\d+\s+>", #
|
|
44
|
+
r"\\g\s+<\s*\d+\s*>", # Only match when there are spaces before <
|
|
45
|
+
r"\\g<\s+\d+>", # Spaces after opening <
|
|
46
|
+
r"\\g<\d+\s+>", # Spaces before closing >
|
|
67
47
|
]
|
|
68
48
|
|
|
69
49
|
|
|
70
50
|
class RegexVisitor(ast.NodeVisitor):
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
def __init__(self, file_path: Path):
|
|
51
|
+
def __init__(self, file_path: Path) -> None:
|
|
74
52
|
self.file_path = file_path
|
|
75
53
|
self.issues: list[tuple[int, str]] = []
|
|
76
54
|
self.has_regex_import = False
|
|
@@ -79,20 +57,17 @@ class RegexVisitor(ast.NodeVisitor):
|
|
|
79
57
|
)
|
|
80
58
|
|
|
81
59
|
def visit_Import(self, node: ast.Import) -> None:
|
|
82
|
-
"""Check for regex module imports."""
|
|
83
60
|
for alias in node.names:
|
|
84
61
|
if alias.name in REGEX_IMPORTS:
|
|
85
62
|
self.has_regex_import = True
|
|
86
63
|
self.generic_visit(node)
|
|
87
64
|
|
|
88
65
|
def visit_ImportFrom(self, node: ast.ImportFrom) -> None:
|
|
89
|
-
"""Check for regex imports from modules."""
|
|
90
66
|
if node.module in REGEX_IMPORTS:
|
|
91
67
|
self.has_regex_import = True
|
|
92
68
|
self.generic_visit(node)
|
|
93
69
|
|
|
94
70
|
def visit_Call(self, node: ast.Call) -> None:
|
|
95
|
-
"""Check for regex function calls."""
|
|
96
71
|
if self.allowed_file:
|
|
97
72
|
self.generic_visit(node)
|
|
98
73
|
return
|
|
@@ -100,12 +75,10 @@ class RegexVisitor(ast.NodeVisitor):
|
|
|
100
75
|
func_name = self._get_function_name(node.func)
|
|
101
76
|
|
|
102
77
|
if func_name in REGEX_FUNCTIONS:
|
|
103
|
-
# Check for bad replacement syntax in arguments
|
|
104
78
|
for arg in node.args:
|
|
105
79
|
if isinstance(arg, ast.Constant) and isinstance(arg.value, str):
|
|
106
80
|
self._check_replacement_syntax(arg.value, node.lineno)
|
|
107
81
|
|
|
108
|
-
# Flag non-whitelisted regex usage
|
|
109
82
|
if not self._is_exempted_line(node.lineno):
|
|
110
83
|
self.issues.append(
|
|
111
84
|
(
|
|
@@ -118,7 +91,6 @@ class RegexVisitor(ast.NodeVisitor):
|
|
|
118
91
|
self.generic_visit(node)
|
|
119
92
|
|
|
120
93
|
def _get_function_name(self, func_node: ast.AST) -> str:
|
|
121
|
-
"""Extract function name from AST node."""
|
|
122
94
|
if isinstance(func_node, ast.Name):
|
|
123
95
|
return func_node.id
|
|
124
96
|
elif isinstance(func_node, ast.Attribute):
|
|
@@ -128,32 +100,34 @@ class RegexVisitor(ast.NodeVisitor):
|
|
|
128
100
|
return ""
|
|
129
101
|
|
|
130
102
|
def _check_replacement_syntax(self, replacement: str, line_no: int) -> None:
|
|
131
|
-
"""Check for forbidden replacement syntax patterns."""
|
|
132
103
|
for pattern in FORBIDDEN_REPLACEMENT_PATTERNS:
|
|
133
104
|
if re.search(pattern, replacement):
|
|
134
105
|
self.issues.append(
|
|
135
106
|
(
|
|
136
107
|
line_no,
|
|
137
108
|
f"CRITICAL: Bad replacement syntax detected: '{replacement}'. "
|
|
138
|
-
f"Use \\g<1> not \\g
|
|
109
|
+
f"Use \\g<1> not \\g<1>",
|
|
139
110
|
)
|
|
140
111
|
)
|
|
141
112
|
|
|
142
113
|
def _is_exempted_line(self, line_no: int) -> bool:
|
|
143
|
-
"""Check if line has exemption comment."""
|
|
144
114
|
from contextlib import suppress
|
|
145
115
|
|
|
146
116
|
with suppress(OSError, UnicodeDecodeError):
|
|
147
117
|
with self.file_path.open(encoding="utf-8") as f:
|
|
148
118
|
lines = f.readlines()
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
119
|
+
# Check current line and next 5 lines for exemption comments
|
|
120
|
+
# This handles multi-line statements
|
|
121
|
+
for offset in range(6): # Check lines: current, +1, +2, +3, +4, +5
|
|
122
|
+
check_line = line_no - 1 + offset
|
|
123
|
+
if check_line < len(lines):
|
|
124
|
+
line = lines[check_line]
|
|
125
|
+
if "# REGEX OK:" in line or "# regex ok:" in line.lower():
|
|
126
|
+
return True
|
|
152
127
|
return False
|
|
153
128
|
|
|
154
129
|
|
|
155
130
|
def validate_file(file_path: Path) -> list[tuple[int, str]]:
|
|
156
|
-
"""Validate a single Python file for regex pattern usage."""
|
|
157
131
|
try:
|
|
158
132
|
content = file_path.read_text(encoding="utf-8")
|
|
159
133
|
except (OSError, UnicodeDecodeError) as e:
|
|
@@ -170,17 +144,14 @@ def validate_file(file_path: Path) -> list[tuple[int, str]]:
|
|
|
170
144
|
|
|
171
145
|
|
|
172
146
|
def main(file_paths: list[str]) -> int:
|
|
173
|
-
"""Main validation function for pre-commit hook."""
|
|
174
147
|
exit_code = 0
|
|
175
148
|
|
|
176
149
|
for file_path_str in file_paths:
|
|
177
150
|
file_path = Path(file_path_str)
|
|
178
151
|
|
|
179
|
-
# Skip non-Python files
|
|
180
152
|
if file_path.suffix != ".py":
|
|
181
153
|
continue
|
|
182
154
|
|
|
183
|
-
# Skip files that don't exist
|
|
184
155
|
if not file_path.exists():
|
|
185
156
|
continue
|
|
186
157
|
|
|
@@ -188,9 +159,9 @@ def main(file_paths: list[str]) -> int:
|
|
|
188
159
|
|
|
189
160
|
if issues:
|
|
190
161
|
exit_code = 1
|
|
191
|
-
print(f"\n❌ {file_path}:")
|
|
162
|
+
print(f"\n❌ {file_path}: ")
|
|
192
163
|
for line_no, message in issues:
|
|
193
|
-
print(f"
|
|
164
|
+
print(f" Line {line_no}: {message}")
|
|
194
165
|
|
|
195
166
|
if exit_code == 0:
|
|
196
167
|
print("✅ All regex patterns validated successfully!")
|
|
@@ -198,7 +169,7 @@ def main(file_paths: list[str]) -> int:
|
|
|
198
169
|
print("\n" + "=" * 80)
|
|
199
170
|
print("REGEX VALIDATION FAILED")
|
|
200
171
|
print("=" * 80)
|
|
201
|
-
print("To fix these issues:")
|
|
172
|
+
print("To fix these issues: ")
|
|
202
173
|
print("1. Use patterns from crackerjack.services.regex_patterns")
|
|
203
174
|
print("2. Add new patterns to SAFE_PATTERNS with comprehensive tests")
|
|
204
175
|
print("3. Use '# REGEX OK: reason' comment for legitimate exceptions")
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: crackerjack
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 0.33.1
|
|
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
|
|
7
7
|
Project-URL: repository, https://github.com/lesleslie/crackerjack
|
|
@@ -47,16 +47,22 @@ Requires-Dist: pyyaml>=6.0.2
|
|
|
47
47
|
Requires-Dist: refurb>=2.1
|
|
48
48
|
Requires-Dist: rich>=14.1
|
|
49
49
|
Requires-Dist: ruff>=0.12.9
|
|
50
|
+
Requires-Dist: scipy>=1.14.0
|
|
51
|
+
Requires-Dist: skylos>=2.1.2
|
|
50
52
|
Requires-Dist: structlog>=24.4
|
|
51
53
|
Requires-Dist: textual>=0.89
|
|
52
54
|
Requires-Dist: tomli-w>=1.2
|
|
53
55
|
Requires-Dist: tomli>=2.2.1
|
|
54
56
|
Requires-Dist: typer>=0.16
|
|
57
|
+
Requires-Dist: types-aiofiles>=24.1.0.20240626
|
|
58
|
+
Requires-Dist: types-psutil>=6.0.0.12
|
|
59
|
+
Requires-Dist: types-pyyaml>=6.0.12.12
|
|
55
60
|
Requires-Dist: uv>=0.7.20
|
|
56
61
|
Requires-Dist: uvicorn>=0.32.1
|
|
57
62
|
Requires-Dist: vulture>=2.14
|
|
58
63
|
Requires-Dist: watchdog>=6
|
|
59
64
|
Requires-Dist: websockets>=15.0.1
|
|
65
|
+
Requires-Dist: zuban>=0.0.22
|
|
60
66
|
Description-Content-Type: text/markdown
|
|
61
67
|
|
|
62
68
|
# Crackerjack: Advanced AI-Driven Python Development Platform
|
|
@@ -67,6 +73,7 @@ Description-Content-Type: text/markdown
|
|
|
67
73
|
[](https://github.com/astral-sh/uv)
|
|
68
74
|
[](https://github.com/pre-commit/pre-commit)
|
|
69
75
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
76
|
+

|
|
70
77
|
|
|
71
78
|
## 🎯 Purpose
|
|
72
79
|
|
|
@@ -103,8 +110,8 @@ pip install black isort flake8 mypy pytest pre-commit
|
|
|
103
110
|
```bash
|
|
104
111
|
pip install crackerjack
|
|
105
112
|
python -m crackerjack # Setup + quality checks
|
|
106
|
-
python -m crackerjack -
|
|
107
|
-
python -m crackerjack
|
|
113
|
+
python -m crackerjack --run-tests # Add testing
|
|
114
|
+
python -m crackerjack --all patch # Full release workflow
|
|
108
115
|
```
|
|
109
116
|
|
|
110
117
|
**Key differentiators:**
|
|
@@ -200,7 +207,7 @@ Limited tool-specific auto-fixes for simple formatting issues:
|
|
|
200
207
|
1. **🚀 Run All Checks**: Fast hooks, comprehensive hooks, full test suite
|
|
201
208
|
1. **🔍 Analyze Failures**: AI parses error messages, identifies root causes
|
|
202
209
|
1. **🤖 Intelligent Fixes**: AI reads source code and makes targeted modifications
|
|
203
|
-
1. **🔄 Repeat**: Continue until ALL checks pass (up to
|
|
210
|
+
1. **🔄 Repeat**: Continue until ALL checks pass (up to 8 iterations)
|
|
204
211
|
1. **🎉 Perfect Quality**: Zero manual intervention required
|
|
205
212
|
|
|
206
213
|
#### Comprehensive Coverage
|
|
@@ -226,7 +233,7 @@ The AI agent intelligently fixes:
|
|
|
226
233
|
|
|
227
234
|
```bash
|
|
228
235
|
# Standard AI agent mode (recommended)
|
|
229
|
-
python -m crackerjack --ai-
|
|
236
|
+
python -m crackerjack --ai-fix --run-tests --verbose
|
|
230
237
|
|
|
231
238
|
# MCP server with WebSocket support (localhost:8675)
|
|
232
239
|
python -m crackerjack --start-mcp-server
|
|
@@ -271,6 +278,40 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
271
278
|
- **Rollback Support**: All changes can be reverted via git
|
|
272
279
|
- **Human Review**: Review AI-generated changes before commit
|
|
273
280
|
|
|
281
|
+
#### ⚡ High-Performance Rust Tool Integration
|
|
282
|
+
|
|
283
|
+
**Ultra-Fast Static Analysis Tools**:
|
|
284
|
+
|
|
285
|
+
- **🦅 Skylos** (Dead Code Detection): Replaces vulture with **20x performance improvement**
|
|
286
|
+
|
|
287
|
+
- Rust-powered dead code detection and import analysis
|
|
288
|
+
- Seamlessly integrates with existing pre-commit workflows
|
|
289
|
+
- Zero configuration changes required
|
|
290
|
+
|
|
291
|
+
- **🔍 Zuban** (Type Checking): Replaces pyright with **20-200x performance improvement**
|
|
292
|
+
|
|
293
|
+
- Lightning-fast type checking and static analysis
|
|
294
|
+
- Drop-in replacement for slower Python-based tools
|
|
295
|
+
- Maintains full compatibility with existing configurations
|
|
296
|
+
|
|
297
|
+
**Performance Benefits**:
|
|
298
|
+
|
|
299
|
+
- **Faster Development Cycles**: Pre-commit hooks complete in seconds, not minutes
|
|
300
|
+
- **Improved Developer Experience**: Near-instantaneous feedback during development
|
|
301
|
+
- **Seamless Integration**: Works transparently with existing crackerjack workflows
|
|
302
|
+
- **Zero Breaking Changes**: Same CLI interface, dramatically better performance
|
|
303
|
+
|
|
304
|
+
**Implementation Details**:
|
|
305
|
+
|
|
306
|
+
```bash
|
|
307
|
+
# These commands now benefit from Rust tool speed improvements:
|
|
308
|
+
python -m crackerjack # Dead code detection 20x faster
|
|
309
|
+
python -m crackerjack --run-tests # Type checking 20-200x faster
|
|
310
|
+
python -m crackerjack --ai-fix --run-tests # Complete workflow optimized
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
**Benchmark Results**: Real-world performance measurements show consistent **6,000+ operations/second** throughput with **600KB+/second** data processing capabilities during comprehensive quality checks.
|
|
314
|
+
|
|
274
315
|
## Core Workflow
|
|
275
316
|
|
|
276
317
|
**Enhanced three-stage quality enforcement with intelligent code cleaning:**
|
|
@@ -290,7 +331,7 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
290
331
|
|
|
291
332
|
**With AI integration:**
|
|
292
333
|
|
|
293
|
-
- `--ai-
|
|
334
|
+
- `--ai-fix` flag enables automatic error resolution with specialized sub-agents
|
|
294
335
|
- MCP server allows AI agents to run crackerjack commands with real-time progress tracking
|
|
295
336
|
- Structured error output for programmatic fixes with confidence scoring
|
|
296
337
|
- Enterprise-grade regex pattern system ensures safe automated text transformations
|
|
@@ -331,10 +372,10 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
331
372
|
|
|
332
373
|
```bash
|
|
333
374
|
# Show coverage progress
|
|
334
|
-
python -m crackerjack --coverage-
|
|
375
|
+
python -m crackerjack --coverage-report
|
|
335
376
|
|
|
336
377
|
# Run tests with ratchet system
|
|
337
|
-
python -m crackerjack -
|
|
378
|
+
python -m crackerjack --run-tests
|
|
338
379
|
|
|
339
380
|
# Example output:
|
|
340
381
|
# 🎉 Coverage improved from 10.11% to 15.50%!
|
|
@@ -649,7 +690,7 @@ Crackerjack runs hooks in a two-stage process for optimal development workflow:
|
|
|
649
690
|
python -m crackerjack
|
|
650
691
|
|
|
651
692
|
# Skip hooks if you only want setup/cleaning
|
|
652
|
-
python -m crackerjack -
|
|
693
|
+
python -m crackerjack --skip-hooks
|
|
653
694
|
```
|
|
654
695
|
|
|
655
696
|
### Common Commands
|
|
@@ -659,32 +700,139 @@ python -m crackerjack -s
|
|
|
659
700
|
python -m crackerjack
|
|
660
701
|
|
|
661
702
|
# With testing
|
|
662
|
-
python -m crackerjack -
|
|
703
|
+
python -m crackerjack --run-tests
|
|
663
704
|
|
|
664
705
|
# Full release workflow
|
|
665
|
-
python -m crackerjack
|
|
706
|
+
python -m crackerjack --all patch
|
|
666
707
|
|
|
667
708
|
# AI agent mode
|
|
668
|
-
python -m crackerjack --ai-
|
|
709
|
+
python -m crackerjack --ai-fix
|
|
669
710
|
```
|
|
670
711
|
|
|
671
712
|
## Command Reference
|
|
672
713
|
|
|
673
|
-
**Core Commands:**
|
|
714
|
+
**Core Workflow Commands:**
|
|
674
715
|
|
|
675
716
|
```bash
|
|
676
|
-
|
|
677
|
-
python -m crackerjack
|
|
678
|
-
python -m crackerjack -
|
|
717
|
+
# Quality checks and development
|
|
718
|
+
python -m crackerjack # Quality checks only
|
|
719
|
+
python -m crackerjack --run-tests # Quality checks + tests
|
|
720
|
+
python -m crackerjack --ai-fix --run-tests # AI auto-fixing + tests (recommended)
|
|
721
|
+
|
|
722
|
+
# Release workflow
|
|
723
|
+
python -m crackerjack --all patch # Full release workflow
|
|
724
|
+
python -m crackerjack --publish patch # Version bump + publish
|
|
679
725
|
```
|
|
680
726
|
|
|
681
|
-
**
|
|
727
|
+
**AI-Powered Development:**
|
|
728
|
+
|
|
729
|
+
```bash
|
|
730
|
+
python -m crackerjack --ai-fix # AI auto-fixing mode
|
|
731
|
+
python -m crackerjack --ai-debug --run-tests # AI debugging with verbose output
|
|
732
|
+
python -m crackerjack --ai-fix --run-tests --verbose # Full AI workflow
|
|
733
|
+
python -m crackerjack --orchestrated # Advanced orchestrated workflow
|
|
734
|
+
python -m crackerjack --quick # Quick mode (3 iterations max)
|
|
735
|
+
python -m crackerjack --thorough # Thorough mode (8 iterations max)
|
|
736
|
+
```
|
|
682
737
|
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
-
|
|
687
|
-
-
|
|
738
|
+
**Monitoring & Observability:**
|
|
739
|
+
|
|
740
|
+
```bash
|
|
741
|
+
python -m crackerjack --dashboard # Comprehensive monitoring dashboard
|
|
742
|
+
python -m crackerjack --unified-dashboard # Unified real-time dashboard
|
|
743
|
+
python -m crackerjack --monitor # Multi-project progress monitor
|
|
744
|
+
python -m crackerjack --enhanced-monitor # Enhanced monitoring with patterns
|
|
745
|
+
python -m crackerjack --watchdog # Service watchdog (auto-restart)
|
|
746
|
+
```
|
|
747
|
+
|
|
748
|
+
**MCP Server Management:**
|
|
749
|
+
|
|
750
|
+
```bash
|
|
751
|
+
python -m crackerjack --start-mcp-server # Start MCP server
|
|
752
|
+
python -m crackerjack --stop-mcp-server # Stop MCP server
|
|
753
|
+
python -m crackerjack --restart-mcp-server # Restart MCP server
|
|
754
|
+
python -m crackerjack --start-websocket-server # Start WebSocket server
|
|
755
|
+
```
|
|
756
|
+
|
|
757
|
+
**Performance & Caching:**
|
|
758
|
+
|
|
759
|
+
```bash
|
|
760
|
+
python -m crackerjack --cache-stats # Display cache statistics
|
|
761
|
+
python -m crackerjack --clear-cache # Clear all caches
|
|
762
|
+
python -m crackerjack --benchmark # Run in benchmark mode
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
**Coverage Management:**
|
|
766
|
+
|
|
767
|
+
```bash
|
|
768
|
+
python -m crackerjack --coverage-status # Show coverage ratchet status
|
|
769
|
+
python -m crackerjack --coverage-goal 85.0 # Set explicit coverage target
|
|
770
|
+
python -m crackerjack --no-coverage-ratchet # Disable coverage ratchet temporarily
|
|
771
|
+
python -m crackerjack --boost-coverage # Auto-improve test coverage (default)
|
|
772
|
+
python -m crackerjack --no-boost-coverage # Disable coverage improvements
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
**Zuban LSP Server Management:**
|
|
776
|
+
|
|
777
|
+
```bash
|
|
778
|
+
python -m crackerjack --start-zuban-lsp # Start Zuban LSP server
|
|
779
|
+
python -m crackerjack --stop-zuban-lsp # Stop Zuban LSP server
|
|
780
|
+
python -m crackerjack --restart-zuban-lsp # Restart Zuban LSP server
|
|
781
|
+
python -m crackerjack --no-zuban-lsp # Disable automatic LSP startup
|
|
782
|
+
python -m crackerjack --zuban-lsp-port 8677 # Custom LSP port
|
|
783
|
+
python -m crackerjack --zuban-lsp-mode tcp # Transport mode (tcp/stdio)
|
|
784
|
+
python -m crackerjack --zuban-lsp-timeout 30 # LSP operation timeout
|
|
785
|
+
python -m crackerjack --enable-lsp-hooks # Enable LSP-optimized hooks
|
|
786
|
+
```
|
|
787
|
+
|
|
788
|
+
**Documentation Generation:**
|
|
789
|
+
|
|
790
|
+
```bash
|
|
791
|
+
python -m crackerjack --generate-docs # Generate comprehensive API docs
|
|
792
|
+
python -m crackerjack --docs-format markdown # Documentation format (markdown/rst/html)
|
|
793
|
+
python -m crackerjack --validate-docs # Validate existing documentation
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
**Global Locking & Concurrency:**
|
|
797
|
+
|
|
798
|
+
```bash
|
|
799
|
+
python -m crackerjack --disable-global-locking # Allow concurrent execution
|
|
800
|
+
python -m crackerjack --global-lock-timeout 600 # Lock timeout in seconds
|
|
801
|
+
python -m crackerjack --cleanup-stale-locks # Clean stale lock files (default)
|
|
802
|
+
python -m crackerjack --no-cleanup-stale-locks # Don't clean stale locks
|
|
803
|
+
python -m crackerjack --global-lock-dir ~/.crackerjack/locks # Custom lock directory
|
|
804
|
+
```
|
|
805
|
+
|
|
806
|
+
**Git & Version Control:**
|
|
807
|
+
|
|
808
|
+
```bash
|
|
809
|
+
python -m crackerjack --no-git-tags # Skip creating git tags
|
|
810
|
+
python -m crackerjack --skip-version-check # Skip version consistency verification
|
|
811
|
+
```
|
|
812
|
+
|
|
813
|
+
**Experimental Features:**
|
|
814
|
+
|
|
815
|
+
```bash
|
|
816
|
+
python -m crackerjack --experimental-hooks # Enable experimental pre-commit hooks
|
|
817
|
+
python -m crackerjack --enable-pyrefly # Enable pyrefly type checking (experimental)
|
|
818
|
+
python -m crackerjack --enable-ty # Enable ty type verification (experimental)
|
|
819
|
+
```
|
|
820
|
+
|
|
821
|
+
**Common Options:**
|
|
822
|
+
|
|
823
|
+
- `-i, --interactive`: Rich UI interface with better experience
|
|
824
|
+
- `-v, --verbose`: Detailed output for debugging
|
|
825
|
+
- `-c, --commit`: Auto-commit and push changes to Git
|
|
826
|
+
- `--skip-hooks`: Skip quality checks during development iteration
|
|
827
|
+
- `--strip-code`: Remove docstrings/comments for production
|
|
828
|
+
- `--dev`: Enable development mode for progress monitors
|
|
829
|
+
- `--fast`: Run only fast hooks (formatting and basic checks)
|
|
830
|
+
- `--comp`: Run only comprehensive hooks (type checking, security, complexity)
|
|
831
|
+
- `--quick`: Quick mode (3 iterations max, ideal for CI/CD)
|
|
832
|
+
- `--thorough`: Thorough mode (8 iterations max, for complex refactoring)
|
|
833
|
+
- `--debug`: Enable debug output with detailed information
|
|
834
|
+
- `--no-config-update`: Do not update configuration files
|
|
835
|
+
- `--update-precommit`: Update pre-commit hooks configuration
|
|
688
836
|
|
|
689
837
|
## Style Guide
|
|
690
838
|
|
|
@@ -732,9 +880,9 @@ echo ".env" >> .gitignore
|
|
|
732
880
|
### Version Management
|
|
733
881
|
|
|
734
882
|
```bash
|
|
735
|
-
python -m crackerjack
|
|
736
|
-
python -m crackerjack
|
|
737
|
-
python -m crackerjack
|
|
883
|
+
python -m crackerjack --publish patch # 1.0.0 -> 1.0.1
|
|
884
|
+
python -m crackerjack --publish minor # 1.0.0 -> 1.1.0
|
|
885
|
+
python -m crackerjack --publish major # 1.0.0 -> 2.0.0
|
|
738
886
|
```
|
|
739
887
|
|
|
740
888
|
### 🛡️ Security Considerations
|
|
@@ -789,6 +937,15 @@ python -m crackerjack.mcp.progress_monitor <job_id> ws://localhost:8675
|
|
|
789
937
|
|
|
790
938
|
For enhanced AI-assisted development with conversation memory and context persistence, consider using the [session-mgmt-mcp](https://github.com/lesleslie/session-mgmt-mcp) server alongside Crackerjack:
|
|
791
939
|
|
|
940
|
+
## 🤝 Session-mgmt Integration (Enhanced)
|
|
941
|
+
|
|
942
|
+
**Automatic for Git Projects:**
|
|
943
|
+
|
|
944
|
+
- Session management starts automatically
|
|
945
|
+
- No manual `/start` or `/end` needed
|
|
946
|
+
- Checkpoints auto-compact when necessary
|
|
947
|
+
- Works seamlessly with `python -m crackerjack`
|
|
948
|
+
|
|
792
949
|
**Benefits of Combined Usage:**
|
|
793
950
|
|
|
794
951
|
- **🧠 Persistent Learning**: Session-mgmt remembers your error patterns and successful fixes
|
|
@@ -796,6 +953,7 @@ For enhanced AI-assisted development with conversation memory and context persis
|
|
|
796
953
|
- **📊 Quality Tracking**: Monitors your project's quality score evolution over time
|
|
797
954
|
- **🔄 Workflow Optimization**: Learns from your development patterns to suggest improvements
|
|
798
955
|
- **🎯 Intelligent Coordination**: The two servers share insights for smarter assistance
|
|
956
|
+
- **🚀 Zero Manual Intervention**: Fully automatic lifecycle for git repositories
|
|
799
957
|
|
|
800
958
|
**Quick Setup:**
|
|
801
959
|
|
|
@@ -814,6 +972,19 @@ For enhanced AI-assisted development with conversation memory and context persis
|
|
|
814
972
|
}
|
|
815
973
|
```
|
|
816
974
|
|
|
975
|
+
**Example Workflow:**
|
|
976
|
+
|
|
977
|
+
```bash
|
|
978
|
+
# Just start working - session auto-initializes!
|
|
979
|
+
python -m crackerjack --ai-fix --run-tests
|
|
980
|
+
|
|
981
|
+
# Checkpoint periodically (auto-compacts if needed)
|
|
982
|
+
/checkpoint
|
|
983
|
+
|
|
984
|
+
# Quit any way - session auto-saves
|
|
985
|
+
/quit # or Cmd+Q, or network disconnect
|
|
986
|
+
```
|
|
987
|
+
|
|
817
988
|
**How They Work Together:**
|
|
818
989
|
|
|
819
990
|
- **Crackerjack** handles code quality enforcement, testing, and release management
|