crackerjack 0.33.0__py3-none-any.whl → 0.33.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.

Potentially problematic release.


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

Files changed (198) hide show
  1. crackerjack/__main__.py +1350 -34
  2. crackerjack/adapters/__init__.py +17 -0
  3. crackerjack/adapters/lsp_client.py +358 -0
  4. crackerjack/adapters/rust_tool_adapter.py +194 -0
  5. crackerjack/adapters/rust_tool_manager.py +193 -0
  6. crackerjack/adapters/skylos_adapter.py +231 -0
  7. crackerjack/adapters/zuban_adapter.py +560 -0
  8. crackerjack/agents/base.py +7 -3
  9. crackerjack/agents/coordinator.py +271 -33
  10. crackerjack/agents/documentation_agent.py +9 -15
  11. crackerjack/agents/dry_agent.py +3 -15
  12. crackerjack/agents/formatting_agent.py +1 -1
  13. crackerjack/agents/import_optimization_agent.py +36 -180
  14. crackerjack/agents/performance_agent.py +17 -98
  15. crackerjack/agents/performance_helpers.py +7 -31
  16. crackerjack/agents/proactive_agent.py +1 -3
  17. crackerjack/agents/refactoring_agent.py +16 -85
  18. crackerjack/agents/refactoring_helpers.py +7 -42
  19. crackerjack/agents/security_agent.py +9 -48
  20. crackerjack/agents/test_creation_agent.py +356 -513
  21. crackerjack/agents/test_specialist_agent.py +0 -4
  22. crackerjack/api.py +6 -25
  23. crackerjack/cli/cache_handlers.py +204 -0
  24. crackerjack/cli/cache_handlers_enhanced.py +683 -0
  25. crackerjack/cli/facade.py +100 -0
  26. crackerjack/cli/handlers.py +224 -9
  27. crackerjack/cli/interactive.py +6 -4
  28. crackerjack/cli/options.py +642 -55
  29. crackerjack/cli/utils.py +2 -1
  30. crackerjack/code_cleaner.py +58 -117
  31. crackerjack/config/global_lock_config.py +8 -48
  32. crackerjack/config/hooks.py +53 -62
  33. crackerjack/core/async_workflow_orchestrator.py +24 -34
  34. crackerjack/core/autofix_coordinator.py +3 -17
  35. crackerjack/core/enhanced_container.py +4 -13
  36. crackerjack/core/file_lifecycle.py +12 -89
  37. crackerjack/core/performance.py +2 -2
  38. crackerjack/core/performance_monitor.py +15 -55
  39. crackerjack/core/phase_coordinator.py +104 -204
  40. crackerjack/core/resource_manager.py +14 -90
  41. crackerjack/core/service_watchdog.py +62 -95
  42. crackerjack/core/session_coordinator.py +149 -0
  43. crackerjack/core/timeout_manager.py +14 -72
  44. crackerjack/core/websocket_lifecycle.py +13 -78
  45. crackerjack/core/workflow_orchestrator.py +171 -174
  46. crackerjack/docs/INDEX.md +11 -0
  47. crackerjack/docs/generated/api/API_REFERENCE.md +10895 -0
  48. crackerjack/docs/generated/api/CLI_REFERENCE.md +109 -0
  49. crackerjack/docs/generated/api/CROSS_REFERENCES.md +1755 -0
  50. crackerjack/docs/generated/api/PROTOCOLS.md +3 -0
  51. crackerjack/docs/generated/api/SERVICES.md +1252 -0
  52. crackerjack/documentation/__init__.py +31 -0
  53. crackerjack/documentation/ai_templates.py +756 -0
  54. crackerjack/documentation/dual_output_generator.py +765 -0
  55. crackerjack/documentation/mkdocs_integration.py +518 -0
  56. crackerjack/documentation/reference_generator.py +977 -0
  57. crackerjack/dynamic_config.py +55 -50
  58. crackerjack/executors/async_hook_executor.py +10 -15
  59. crackerjack/executors/cached_hook_executor.py +117 -43
  60. crackerjack/executors/hook_executor.py +8 -34
  61. crackerjack/executors/hook_lock_manager.py +26 -183
  62. crackerjack/executors/individual_hook_executor.py +13 -11
  63. crackerjack/executors/lsp_aware_hook_executor.py +270 -0
  64. crackerjack/executors/tool_proxy.py +417 -0
  65. crackerjack/hooks/lsp_hook.py +79 -0
  66. crackerjack/intelligence/adaptive_learning.py +25 -10
  67. crackerjack/intelligence/agent_orchestrator.py +2 -5
  68. crackerjack/intelligence/agent_registry.py +34 -24
  69. crackerjack/intelligence/agent_selector.py +5 -7
  70. crackerjack/interactive.py +17 -6
  71. crackerjack/managers/async_hook_manager.py +0 -1
  72. crackerjack/managers/hook_manager.py +79 -1
  73. crackerjack/managers/publish_manager.py +44 -8
  74. crackerjack/managers/test_command_builder.py +1 -15
  75. crackerjack/managers/test_executor.py +1 -3
  76. crackerjack/managers/test_manager.py +98 -7
  77. crackerjack/managers/test_manager_backup.py +10 -9
  78. crackerjack/mcp/cache.py +2 -2
  79. crackerjack/mcp/client_runner.py +1 -1
  80. crackerjack/mcp/context.py +191 -68
  81. crackerjack/mcp/dashboard.py +7 -5
  82. crackerjack/mcp/enhanced_progress_monitor.py +31 -28
  83. crackerjack/mcp/file_monitor.py +30 -23
  84. crackerjack/mcp/progress_components.py +31 -21
  85. crackerjack/mcp/progress_monitor.py +50 -53
  86. crackerjack/mcp/rate_limiter.py +6 -6
  87. crackerjack/mcp/server_core.py +17 -16
  88. crackerjack/mcp/service_watchdog.py +2 -1
  89. crackerjack/mcp/state.py +4 -7
  90. crackerjack/mcp/task_manager.py +11 -9
  91. crackerjack/mcp/tools/core_tools.py +173 -32
  92. crackerjack/mcp/tools/error_analyzer.py +3 -2
  93. crackerjack/mcp/tools/execution_tools.py +8 -10
  94. crackerjack/mcp/tools/execution_tools_backup.py +42 -30
  95. crackerjack/mcp/tools/intelligence_tool_registry.py +7 -5
  96. crackerjack/mcp/tools/intelligence_tools.py +5 -2
  97. crackerjack/mcp/tools/monitoring_tools.py +33 -70
  98. crackerjack/mcp/tools/proactive_tools.py +24 -11
  99. crackerjack/mcp/tools/progress_tools.py +5 -8
  100. crackerjack/mcp/tools/utility_tools.py +20 -14
  101. crackerjack/mcp/tools/workflow_executor.py +62 -40
  102. crackerjack/mcp/websocket/app.py +8 -0
  103. crackerjack/mcp/websocket/endpoints.py +352 -357
  104. crackerjack/mcp/websocket/jobs.py +40 -57
  105. crackerjack/mcp/websocket/monitoring_endpoints.py +2935 -0
  106. crackerjack/mcp/websocket/server.py +7 -25
  107. crackerjack/mcp/websocket/websocket_handler.py +6 -17
  108. crackerjack/mixins/__init__.py +0 -2
  109. crackerjack/mixins/error_handling.py +1 -70
  110. crackerjack/models/config.py +12 -1
  111. crackerjack/models/config_adapter.py +49 -1
  112. crackerjack/models/protocols.py +122 -122
  113. crackerjack/models/resource_protocols.py +55 -210
  114. crackerjack/monitoring/ai_agent_watchdog.py +13 -13
  115. crackerjack/monitoring/metrics_collector.py +426 -0
  116. crackerjack/monitoring/regression_prevention.py +8 -8
  117. crackerjack/monitoring/websocket_server.py +643 -0
  118. crackerjack/orchestration/advanced_orchestrator.py +11 -6
  119. crackerjack/orchestration/coverage_improvement.py +3 -3
  120. crackerjack/orchestration/execution_strategies.py +26 -6
  121. crackerjack/orchestration/test_progress_streamer.py +8 -5
  122. crackerjack/plugins/base.py +2 -2
  123. crackerjack/plugins/hooks.py +7 -0
  124. crackerjack/plugins/managers.py +11 -8
  125. crackerjack/security/__init__.py +0 -1
  126. crackerjack/security/audit.py +6 -35
  127. crackerjack/services/anomaly_detector.py +392 -0
  128. crackerjack/services/api_extractor.py +615 -0
  129. crackerjack/services/backup_service.py +2 -2
  130. crackerjack/services/bounded_status_operations.py +15 -152
  131. crackerjack/services/cache.py +127 -1
  132. crackerjack/services/changelog_automation.py +395 -0
  133. crackerjack/services/config.py +15 -9
  134. crackerjack/services/config_merge.py +19 -80
  135. crackerjack/services/config_template.py +506 -0
  136. crackerjack/services/contextual_ai_assistant.py +48 -22
  137. crackerjack/services/coverage_badge_service.py +171 -0
  138. crackerjack/services/coverage_ratchet.py +27 -25
  139. crackerjack/services/debug.py +3 -3
  140. crackerjack/services/dependency_analyzer.py +460 -0
  141. crackerjack/services/dependency_monitor.py +14 -11
  142. crackerjack/services/documentation_generator.py +491 -0
  143. crackerjack/services/documentation_service.py +675 -0
  144. crackerjack/services/enhanced_filesystem.py +6 -5
  145. crackerjack/services/enterprise_optimizer.py +865 -0
  146. crackerjack/services/error_pattern_analyzer.py +676 -0
  147. crackerjack/services/file_hasher.py +1 -1
  148. crackerjack/services/git.py +8 -25
  149. crackerjack/services/health_metrics.py +10 -8
  150. crackerjack/services/heatmap_generator.py +735 -0
  151. crackerjack/services/initialization.py +11 -30
  152. crackerjack/services/input_validator.py +5 -97
  153. crackerjack/services/intelligent_commit.py +327 -0
  154. crackerjack/services/log_manager.py +15 -12
  155. crackerjack/services/logging.py +4 -3
  156. crackerjack/services/lsp_client.py +628 -0
  157. crackerjack/services/memory_optimizer.py +19 -87
  158. crackerjack/services/metrics.py +42 -33
  159. crackerjack/services/parallel_executor.py +9 -67
  160. crackerjack/services/pattern_cache.py +1 -1
  161. crackerjack/services/pattern_detector.py +6 -6
  162. crackerjack/services/performance_benchmarks.py +18 -59
  163. crackerjack/services/performance_cache.py +20 -81
  164. crackerjack/services/performance_monitor.py +27 -95
  165. crackerjack/services/predictive_analytics.py +510 -0
  166. crackerjack/services/quality_baseline.py +234 -0
  167. crackerjack/services/quality_baseline_enhanced.py +646 -0
  168. crackerjack/services/quality_intelligence.py +785 -0
  169. crackerjack/services/regex_patterns.py +618 -524
  170. crackerjack/services/regex_utils.py +43 -123
  171. crackerjack/services/secure_path_utils.py +5 -164
  172. crackerjack/services/secure_status_formatter.py +30 -141
  173. crackerjack/services/secure_subprocess.py +11 -92
  174. crackerjack/services/security.py +9 -41
  175. crackerjack/services/security_logger.py +12 -24
  176. crackerjack/services/server_manager.py +124 -16
  177. crackerjack/services/status_authentication.py +16 -159
  178. crackerjack/services/status_security_manager.py +4 -131
  179. crackerjack/services/thread_safe_status_collector.py +19 -125
  180. crackerjack/services/unified_config.py +21 -13
  181. crackerjack/services/validation_rate_limiter.py +5 -54
  182. crackerjack/services/version_analyzer.py +459 -0
  183. crackerjack/services/version_checker.py +1 -1
  184. crackerjack/services/websocket_resource_limiter.py +10 -144
  185. crackerjack/services/zuban_lsp_service.py +390 -0
  186. crackerjack/slash_commands/__init__.py +2 -7
  187. crackerjack/slash_commands/run.md +2 -2
  188. crackerjack/tools/validate_input_validator_patterns.py +14 -40
  189. crackerjack/tools/validate_regex_patterns.py +19 -48
  190. {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/METADATA +196 -25
  191. crackerjack-0.33.2.dist-info/RECORD +229 -0
  192. crackerjack/CLAUDE.md +0 -207
  193. crackerjack/RULES.md +0 -380
  194. crackerjack/py313.py +0 -234
  195. crackerjack-0.33.0.dist-info/RECORD +0 -187
  196. {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/WHEEL +0 -0
  197. {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/entry_points.txt +0 -0
  198. {crackerjack-0.33.0.dist-info → crackerjack-0.33.2.dist-info}/licenses/LICENSE +0 -0
@@ -1,8 +1,9 @@
1
1
  import typing as t
2
+ import warnings
2
3
  from enum import Enum
3
4
 
4
5
  import typer
5
- from pydantic import BaseModel, field_validator
6
+ from pydantic import BaseModel, field_validator, model_validator
6
7
 
7
8
 
8
9
  class BumpOption(str, Enum):
@@ -12,7 +13,7 @@ class BumpOption(str, Enum):
12
13
  interactive = "interactive"
13
14
 
14
15
  def __str__(self) -> str:
15
- return self.value
16
+ return str(self.value)
16
17
 
17
18
 
18
19
  class Options(BaseModel):
@@ -21,16 +22,13 @@ class Options(BaseModel):
21
22
  no_config_updates: bool = False
22
23
  update_precommit: bool = False
23
24
  publish: BumpOption | None = None
25
+ all: BumpOption | None = None
24
26
  bump: BumpOption | None = None
25
27
  verbose: bool = False
26
28
  debug: bool = False
27
- clean: bool = False
28
- test: bool = False
29
29
  benchmark: bool = False
30
30
  test_workers: int = 0
31
31
  test_timeout: int = 0
32
- all: BumpOption | None = None
33
- ai_agent: bool = False
34
32
  start_mcp_server: bool = False
35
33
  stop_mcp_server: bool = False
36
34
  restart_mcp_server: bool = False
@@ -61,8 +59,18 @@ class Options(BaseModel):
61
59
  stop_websocket_server: bool = False
62
60
  restart_websocket_server: bool = False
63
61
  websocket_port: int | None = None
62
+ start_zuban_lsp: bool = False
63
+ stop_zuban_lsp: bool = False
64
+ restart_zuban_lsp: bool = False
65
+ no_zuban_lsp: bool = False
66
+ zuban_lsp_port: int = 8677
67
+ zuban_lsp_mode: str = "tcp"
68
+ zuban_lsp_timeout: int = 30
69
+ enable_lsp_hooks: bool = False
64
70
  dev: bool = False
65
71
  dashboard: bool = False
72
+ unified_dashboard: bool = False
73
+ unified_dashboard_port: int | None = None
66
74
  max_iterations: int = 5
67
75
  enterprise_batch: str | None = None
68
76
  monitor_dashboard: str | None = None
@@ -76,18 +84,140 @@ class Options(BaseModel):
76
84
  global_lock_dir: str | None = None
77
85
  quick: bool = False
78
86
  thorough: bool = False
87
+ clear_cache: bool = False
88
+ cache_stats: bool = False
89
+
90
+ # Semantic field names (new primary interface)
91
+ strip_code: bool | None = None # Replaces clean
92
+ run_tests: bool = False # Replaces test
93
+ ai_fix: bool | None = None # Replaces ai_agent
94
+ full_release: BumpOption | None = None # Replaces all
95
+ show_progress: bool | None = None # Replaces track_progress
96
+ advanced_monitor: bool | None = None # Replaces enhanced_monitor
97
+ coverage_report: bool | None = None # Replaces coverage_status
98
+ clean_releases: bool | None = None # Replaces cleanup_pypi
99
+
100
+ # Documentation and changelog generation fields
101
+ generate_docs: bool = False
102
+ docs_format: str = "markdown"
103
+ validate_docs: bool = False
104
+ generate_changelog: bool = False
105
+ changelog_version: str | None = None
106
+ changelog_since: str | None = None
107
+ changelog_dry_run: bool = False
108
+ auto_version: bool = False
109
+ version_since: str | None = None
110
+ accept_version: bool = False
111
+
112
+ # Intelligent features
113
+ smart_commit: bool = False
114
+
115
+ # Analytics and visualization features
116
+ heatmap: bool = False
117
+ heatmap_type: str = "error_frequency"
118
+ heatmap_output: str | None = None
119
+ anomaly_detection: bool = False
120
+ anomaly_sensitivity: float = 2.0
121
+ anomaly_report: str | None = None
122
+ predictive_analytics: bool = False
123
+ prediction_periods: int = 10
124
+ analytics_dashboard: str | None = None
125
+
126
+ # Configuration management features
127
+ check_config_updates: bool = False
128
+ apply_config_updates: bool = False
129
+ diff_config: str | None = None
130
+ config_interactive: bool = False
131
+ refresh_cache: bool = False
132
+
133
+ # Enterprise features
134
+ enterprise_optimizer: bool = False
135
+ enterprise_profile: str | None = None
136
+ enterprise_report: str | None = None
137
+ mkdocs_integration: bool = False
138
+ mkdocs_serve: bool = False
139
+ mkdocs_theme: str = "material"
140
+ mkdocs_output: str | None = None
141
+ contextual_ai: bool = False
142
+ ai_recommendations: int = 5
143
+ ai_help_query: str | None = None
144
+
145
+ def _map_legacy_flag(
146
+ self, old_attr: str, new_attr: str, deprecation_msg: str | None = None
147
+ ) -> None:
148
+ """Helper to map legacy flag to new flag with optional deprecation warning."""
149
+ old_value = getattr(self, old_attr)
150
+ new_value = getattr(self, new_attr)
151
+
152
+ if old_value and new_value is None:
153
+ setattr(self, new_attr, old_value)
154
+ if deprecation_msg:
155
+ warnings.warn(deprecation_msg, DeprecationWarning, stacklevel=4)
156
+ elif new_value is not None:
157
+ setattr(self, old_attr, new_value)
158
+
159
+ @model_validator(mode="after")
160
+ def handle_legacy_mappings(self) -> "Options":
161
+ """Handle backward compatibility for deprecated flags."""
162
+ # Map flags without deprecation warnings
163
+ self._map_legacy_flag("all", "full_release")
164
+ self._map_legacy_flag("track_progress", "show_progress")
165
+ self._map_legacy_flag("enhanced_monitor", "advanced_monitor")
166
+ self._map_legacy_flag("coverage_status", "coverage_report")
167
+ self._map_legacy_flag("cleanup_pypi", "clean_releases")
168
+
169
+ return self
170
+
171
+ @property
172
+ def test(self) -> bool:
173
+ """Compatibility property for run_tests field."""
174
+ return self.run_tests
175
+
176
+ @test.setter
177
+ def test(self, value: bool) -> None:
178
+ """Setter for test property."""
179
+ self.run_tests = value
180
+
181
+ @property
182
+ def ai_agent(self) -> bool:
183
+ """Compatibility property for ai_fix field."""
184
+ return bool(self.ai_fix)
185
+
186
+ @ai_agent.setter
187
+ def ai_agent(self, value: bool) -> None:
188
+ """Setter for ai_agent property."""
189
+ self.ai_fix = value if self.ai_fix is not None else value
190
+
191
+ @property
192
+ def clean(self) -> bool:
193
+ """Compatibility property for strip_code field."""
194
+ return bool(self.strip_code)
195
+
196
+ @clean.setter
197
+ def clean(self, value: bool) -> None:
198
+ """Setter for clean property."""
199
+ self.strip_code = value
200
+
201
+ @property
202
+ def update_docs_index(self) -> bool:
203
+ """Compatibility property for generate_docs field."""
204
+ return self.generate_docs
205
+
206
+ @update_docs_index.setter
207
+ def update_docs_index(self, value: bool) -> None:
208
+ """Setter for update_docs_index property."""
209
+ self.generate_docs = value
79
210
 
80
211
  @property
81
212
  def effective_max_iterations(self) -> int:
82
- """Get the effective max iterations based on quick/thorough flags."""
83
213
  if self.quick:
84
- return 3 # Quick mode: 3 iterations for CI/CD
214
+ return 2
85
215
  if self.thorough:
86
- return 8 # Thorough mode: 8 iterations for complex refactoring
87
- return self.max_iterations # Default: 5 iterations
216
+ return 8
217
+ return self.max_iterations
88
218
 
89
219
  @classmethod
90
- @field_validator("publish", "bump", mode="before")
220
+ @field_validator("publish", "bump", "full_release", mode="before")
91
221
  def validate_bump_options(cls, value: t.Any) -> BumpOption | None:
92
222
  if value is None:
93
223
  return None
@@ -102,6 +232,17 @@ class Options(BaseModel):
102
232
  msg,
103
233
  )
104
234
 
235
+ @classmethod
236
+ @field_validator("zuban_lsp_mode", mode="before")
237
+ def validate_zuban_lsp_mode(cls, value: t.Any) -> str:
238
+ if value is None:
239
+ return "tcp"
240
+ valid_modes = ["tcp", "stdio"]
241
+ if value.lower() not in valid_modes:
242
+ msg = f"Invalid zuban LSP mode: {value}. Must be one of: {', '.join(valid_modes)}"
243
+ raise ValueError(msg)
244
+ return str(value).lower()
245
+
105
246
 
106
247
  CLI_OPTIONS = {
107
248
  "commit": typer.Option(
@@ -134,7 +275,17 @@ CLI_OPTIONS = {
134
275
  None,
135
276
  "-p",
136
277
  "--publish",
137
- help="Bump version and publish to PyPI (patch, minor, major). Use 'interactive' to be prompted for version selection.",
278
+ help=(
279
+ "Bump version and publish to PyPI (patch, minor, major). "
280
+ "Use 'interactive' to be prompted for version selection."
281
+ ),
282
+ case_sensitive=False,
283
+ ),
284
+ "all": typer.Option(
285
+ None,
286
+ "-a",
287
+ "--all",
288
+ help="Full release workflow: bump version, run quality checks, and publish (patch, minor, major).",
138
289
  case_sensitive=False,
139
290
  ),
140
291
  "bump": typer.Option(
@@ -144,13 +295,6 @@ CLI_OPTIONS = {
144
295
  help="Bump version (patch, minor, major).",
145
296
  case_sensitive=False,
146
297
  ),
147
- "clean": typer.Option(
148
- False,
149
- "-x",
150
- "--clean",
151
- help="Remove docstrings, line comments, and unnecessary whitespace from source code with automatic backup protection (doesn't affect test files).",
152
- ),
153
- "test": typer.Option(False, "-t", "--test", help="Run tests."),
154
298
  "benchmark": typer.Option(
155
299
  False,
156
300
  "--benchmark",
@@ -159,12 +303,18 @@ CLI_OPTIONS = {
159
303
  "test_workers": typer.Option(
160
304
  0,
161
305
  "--test-workers",
162
- help="Number of parallel workers for running tests (0 = auto-detect, 1 = disable parallelization).",
306
+ help=(
307
+ "Number of parallel workers for running tests "
308
+ "(0 = auto-detect, 1 = disable parallelization)."
309
+ ),
163
310
  ),
164
311
  "test_timeout": typer.Option(
165
312
  0,
166
313
  "--test-timeout",
167
- help="Timeout in seconds for individual tests (0 = use default based on project size).",
314
+ help=(
315
+ "Timeout in seconds for individual tests "
316
+ "(0 = use default based on project size)."
317
+ ),
168
318
  ),
169
319
  "skip_hooks": typer.Option(
170
320
  False,
@@ -180,14 +330,10 @@ CLI_OPTIONS = {
180
330
  "comp": typer.Option(
181
331
  False,
182
332
  "--comp",
183
- help="Run only comprehensive hooks (type checking, security, complexity analysis).",
184
- ),
185
- "all": typer.Option(
186
- None,
187
- "-a",
188
- "--all",
189
- help="Run with `-x -t -p <patch|minor|major> -c` development options).",
190
- case_sensitive=False,
333
+ help=(
334
+ "Run only comprehensive hooks (type checking, security, "
335
+ "complexity analysis)."
336
+ ),
191
337
  ),
192
338
  "create_pr": typer.Option(
193
339
  False,
@@ -196,11 +342,6 @@ CLI_OPTIONS = {
196
342
  "--new-pull-request",
197
343
  help="Create a new pull request to the upstream repository.",
198
344
  ),
199
- "ai_agent": typer.Option(
200
- False,
201
- "--ai-agent",
202
- help="Enable AI agent mode with autonomous auto-fixing.",
203
- ),
204
345
  "start_mcp_server": typer.Option(
205
346
  False,
206
347
  "--start-mcp-server",
@@ -230,22 +371,33 @@ CLI_OPTIONS = {
230
371
  "enable_pyrefly": typer.Option(
231
372
  False,
232
373
  "--enable-pyrefly",
233
- help="Enable pyrefly experimental type checking (requires experimental hooks mode).",
374
+ help=(
375
+ "Enable pyrefly experimental type checking "
376
+ "(requires experimental hooks mode)."
377
+ ),
234
378
  ),
235
379
  "enable_ty": typer.Option(
236
380
  False,
237
381
  "--enable-ty",
238
- help="Enable ty experimental type verification (requires experimental hooks mode).",
382
+ help=(
383
+ "Enable ty experimental type verification "
384
+ "(requires experimental hooks mode)."
385
+ ),
239
386
  ),
240
387
  "no_git_tags": typer.Option(
241
388
  False,
242
389
  "--no-git-tags",
243
- help="Skip creating git tags during version bumping (tags are created by default).",
390
+ help=(
391
+ "Skip creating git tags during version bumping "
392
+ "(tags are created by default)."
393
+ ),
244
394
  ),
245
395
  "skip_version_check": typer.Option(
246
396
  False,
247
397
  "--skip-version-check",
248
- help="Skip version consistency verification between pyproject.toml and git tags.",
398
+ help=(
399
+ "Skip version consistency verification between pyproject.toml and git tags."
400
+ ),
249
401
  ),
250
402
  "start_websocket_server": typer.Option(
251
403
  False,
@@ -267,30 +419,98 @@ CLI_OPTIONS = {
267
419
  "--websocket-port",
268
420
  help="Port for WebSocket server when using --start-mcp-server (e.g., 8675).",
269
421
  ),
422
+ "start_zuban_lsp": typer.Option(
423
+ False,
424
+ "--start-zuban-lsp",
425
+ help="Start Zuban LSP server for real-time type checking.",
426
+ ),
427
+ "stop_zuban_lsp": typer.Option(
428
+ False,
429
+ "--stop-zuban-lsp",
430
+ help="Stop all running Zuban LSP servers.",
431
+ ),
432
+ "restart_zuban_lsp": typer.Option(
433
+ False,
434
+ "--restart-zuban-lsp",
435
+ help="Restart Zuban LSP server (stop and start again).",
436
+ ),
437
+ "no_zuban_lsp": typer.Option(
438
+ False,
439
+ "--no-zuban-lsp",
440
+ help="Disable automatic Zuban LSP server startup.",
441
+ ),
442
+ "zuban_lsp_port": typer.Option(
443
+ 8677,
444
+ "--zuban-lsp-port",
445
+ help="Port for Zuban LSP server (default: 8677).",
446
+ ),
447
+ "zuban_lsp_mode": typer.Option(
448
+ "tcp",
449
+ "--zuban-lsp-mode",
450
+ help="Transport mode for Zuban LSP: tcp or stdio (default: tcp).",
451
+ ),
452
+ "zuban_lsp_timeout": typer.Option(
453
+ 30,
454
+ "--zuban-lsp-timeout",
455
+ help="Timeout in seconds for LSP server operations (default: 30).",
456
+ ),
457
+ "enable_lsp_hooks": typer.Option(
458
+ False,
459
+ "--enable-lsp-hooks",
460
+ help="Enable LSP-optimized hook execution for faster type checking.",
461
+ ),
270
462
  "watchdog": typer.Option(
271
463
  False,
272
464
  "--watchdog",
273
- help="Start service watchdog to monitor and auto-restart MCP and WebSocket servers.",
465
+ help=(
466
+ "Start service watchdog to monitor and auto-restart "
467
+ "MCP and WebSocket servers."
468
+ ),
274
469
  ),
275
470
  "monitor": typer.Option(
276
471
  False,
277
472
  "--monitor",
278
- help="Start multi-project progress monitor with WebSocket polling, watchdog services, and autodiscovery.",
473
+ help=(
474
+ "Start multi-project progress monitor with WebSocket polling, "
475
+ "watchdog services, and autodiscovery."
476
+ ),
279
477
  ),
280
478
  "enhanced_monitor": typer.Option(
281
479
  False,
282
480
  "--enhanced-monitor",
283
- help="Start enhanced progress monitor with advanced MetricCard widgets and modern web UI patterns.",
481
+ help=(
482
+ "Start enhanced progress monitor with advanced MetricCard widgets "
483
+ "and modern web UI patterns."
484
+ ),
284
485
  ),
285
486
  "dev": typer.Option(
286
487
  False,
287
488
  "--dev",
288
- help="Enable development mode for progress monitors (enables textual --dev mode).",
489
+ help=(
490
+ "Enable development mode for progress monitors "
491
+ "(enables textual --dev mode)."
492
+ ),
289
493
  ),
290
494
  "dashboard": typer.Option(
291
495
  False,
292
496
  "--dashboard",
293
- help="Start the comprehensive dashboard with system metrics, job tracking, and performance monitoring.",
497
+ help=(
498
+ "Start the comprehensive dashboard with system metrics, "
499
+ "job tracking, and performance monitoring."
500
+ ),
501
+ ),
502
+ "unified_dashboard": typer.Option(
503
+ False,
504
+ "--unified-dashboard",
505
+ help=(
506
+ "Start the unified monitoring dashboard with real-time WebSocket streaming, "
507
+ "web UI, and comprehensive system metrics aggregation."
508
+ ),
509
+ ),
510
+ "unified_dashboard_port": typer.Option(
511
+ None,
512
+ "--unified-dashboard-port",
513
+ help="Port for unified dashboard server (default: 8675).",
294
514
  ),
295
515
  "max_iterations": typer.Option(
296
516
  5,
@@ -300,7 +520,7 @@ CLI_OPTIONS = {
300
520
  "ai_debug": typer.Option(
301
521
  False,
302
522
  "--ai-debug",
303
- help="Enable verbose debugging for AI agent mode (implies --ai-agent).",
523
+ help="Enable verbose debugging for AI auto-fixing mode (implies --ai-fix).",
304
524
  ),
305
525
  "job_id": typer.Option(
306
526
  None,
@@ -326,7 +546,10 @@ CLI_OPTIONS = {
326
546
  "orchestration_ai_mode": typer.Option(
327
547
  "single-agent",
328
548
  "--orchestration-ai-mode",
329
- help="AI coordination mode: single-agent, multi-agent, coordinator (default: single-agent).",
549
+ help=(
550
+ "AI coordination mode: single-agent, multi-agent, coordinator "
551
+ "(default: single-agent)."
552
+ ),
330
553
  ),
331
554
  "coverage_status": typer.Option(
332
555
  False,
@@ -346,12 +569,17 @@ CLI_OPTIONS = {
346
569
  "boost_coverage": typer.Option(
347
570
  True,
348
571
  "--boost-coverage/--no-boost-coverage",
349
- help="Automatically improve test coverage after successful workflow execution (default: True).",
572
+ help=(
573
+ "Automatically improve test coverage after successful "
574
+ "workflow execution (default: True)."
575
+ ),
350
576
  ),
351
577
  "disable_global_locks": typer.Option(
352
578
  False,
353
579
  "--disable-global-locks",
354
- help="Disable global locking (allow concurrent hook execution across sessions).",
580
+ help=(
581
+ "Disable global locking (allow concurrent hook execution across sessions)."
582
+ ),
355
583
  ),
356
584
  "global_lock_timeout": typer.Option(
357
585
  600,
@@ -378,6 +606,259 @@ CLI_OPTIONS = {
378
606
  "--thorough",
379
607
  help="Thorough mode: Run with maximum 8 iterations (for complex refactoring).",
380
608
  ),
609
+ "clear_cache": typer.Option(
610
+ False,
611
+ "--clear-cache",
612
+ help="Clear all caches (hook results, file hashes, agent decisions) and exit.",
613
+ ),
614
+ "cache_stats": typer.Option(
615
+ False,
616
+ "--cache-stats",
617
+ help="Display cache statistics (hit rates, sizes, entries) and exit.",
618
+ ),
619
+ # New semantic CLI options with backward compatibility
620
+ "strip_code": typer.Option(
621
+ None,
622
+ "-x",
623
+ "--strip-code",
624
+ help="Remove docstrings, line comments, and unnecessary whitespace from source code with automatic backup protection (doesn't affect test files).",
625
+ ),
626
+ "run_tests": typer.Option(
627
+ False,
628
+ "-t",
629
+ "--run-tests",
630
+ help=(
631
+ "Execute the test suite with automatic worker detection "
632
+ "and timeout handling."
633
+ ),
634
+ ),
635
+ "ai_fix": typer.Option(
636
+ None,
637
+ "--ai-fix",
638
+ help=(
639
+ "Enable AI-powered automatic fixing of code quality issues "
640
+ "and test failures."
641
+ ),
642
+ ),
643
+ "full_release": typer.Option(
644
+ None,
645
+ "-a",
646
+ "--full-release",
647
+ help="Complete release workflow: strip code, run tests, bump version, and publish. Equivalent to `-x -t -p <version> -c`.",
648
+ case_sensitive=False,
649
+ ),
650
+ "show_progress": typer.Option(
651
+ None,
652
+ "--show-progress",
653
+ help=(
654
+ "Display detailed progress tracking during execution. "
655
+ "[Semantic alias for --track-progress]"
656
+ ),
657
+ ),
658
+ "advanced_monitor": typer.Option(
659
+ None,
660
+ "--advanced-monitor",
661
+ help=(
662
+ "Enable advanced monitoring dashboard with detailed metrics "
663
+ "and analytics. [Semantic alias for --enhanced-monitor]"
664
+ ),
665
+ ),
666
+ "coverage_report": typer.Option(
667
+ None,
668
+ "--coverage-report",
669
+ help=(
670
+ "Display comprehensive coverage analysis and report. "
671
+ "[Semantic alias for --coverage-status]"
672
+ ),
673
+ ),
674
+ "clean_releases": typer.Option(
675
+ None,
676
+ "--clean-releases",
677
+ help=(
678
+ "Clean up old releases from PyPI, keeping only the most recent "
679
+ "versions. [Semantic alias for --cleanup-pypi]"
680
+ ),
681
+ ),
682
+ "generate_docs": typer.Option(
683
+ False,
684
+ "--generate-docs",
685
+ help=(
686
+ "Generate comprehensive API documentation from source code "
687
+ "with AST analysis and cross-references."
688
+ ),
689
+ ),
690
+ "docs_format": typer.Option(
691
+ "markdown",
692
+ "--docs-format",
693
+ help="Documentation output format: 'markdown' (default), 'rst', or 'html'.",
694
+ ),
695
+ "validate_docs": typer.Option(
696
+ False,
697
+ "--validate-docs",
698
+ help="Validate existing documentation for completeness and consistency.",
699
+ ),
700
+ "generate_changelog": typer.Option(
701
+ False,
702
+ "--generate-changelog",
703
+ help="Generate changelog entries from git commits.",
704
+ ),
705
+ "changelog_version": typer.Option(
706
+ None,
707
+ "--changelog-version",
708
+ help="Version number for changelog generation (default: next version).",
709
+ ),
710
+ "changelog_since": typer.Option(
711
+ None,
712
+ "--changelog-since",
713
+ help="Generate changelog since this version/tag (default: last release).",
714
+ ),
715
+ "changelog_dry_run": typer.Option(
716
+ False,
717
+ "--changelog-dry-run",
718
+ help="Preview changelog generation without writing to file.",
719
+ ),
720
+ "auto_version": typer.Option(
721
+ False,
722
+ "--auto-version",
723
+ help="Automatically analyze changes and recommend version bump.",
724
+ ),
725
+ "version_since": typer.Option(
726
+ None,
727
+ "--version-since",
728
+ help="Analyze changes since this version/tag for version bump recommendation.",
729
+ ),
730
+ "accept_version": typer.Option(
731
+ False,
732
+ "--accept-version",
733
+ help="Automatically accept version bump recommendation without confirmation.",
734
+ ),
735
+ "smart_commit": typer.Option(
736
+ False,
737
+ "--smart-commit",
738
+ help="Generate intelligent commit messages based on code changes using AI analysis.",
739
+ ),
740
+ "heatmap": typer.Option(
741
+ False,
742
+ "--heatmap",
743
+ help="Generate visual heat map analysis of code quality patterns and error distributions.",
744
+ ),
745
+ "heatmap_type": typer.Option(
746
+ "error_frequency",
747
+ "--heatmap-type",
748
+ help="Type of heat map to generate: error_frequency, complexity, quality_metrics, test_failures.",
749
+ ),
750
+ "heatmap_output": typer.Option(
751
+ None,
752
+ "--heatmap-output",
753
+ help="Output file path for heat map data (JSON/CSV) or HTML visualization.",
754
+ ),
755
+ "anomaly_detection": typer.Option(
756
+ False,
757
+ "--anomaly-detection",
758
+ help="Enable ML-based anomaly detection for quality metrics monitoring.",
759
+ ),
760
+ "anomaly_sensitivity": typer.Option(
761
+ 2.0,
762
+ "--anomaly-sensitivity",
763
+ help="Sensitivity level for anomaly detection (1.0=very sensitive, 3.0=less sensitive).",
764
+ ),
765
+ "anomaly_report": typer.Option(
766
+ None,
767
+ "--anomaly-report",
768
+ help="Output file path for anomaly detection report (JSON format).",
769
+ ),
770
+ "predictive_analytics": typer.Option(
771
+ False,
772
+ "--predictive-analytics",
773
+ help="Enable predictive analytics for quality metrics forecasting and trend analysis.",
774
+ ),
775
+ "prediction_periods": typer.Option(
776
+ 10,
777
+ "--prediction-periods",
778
+ help="Number of future periods to predict (default: 10).",
779
+ ),
780
+ "analytics_dashboard": typer.Option(
781
+ None,
782
+ "--analytics-dashboard",
783
+ help="Output file path for analytics dashboard (HTML format).",
784
+ ),
785
+ # Enterprise features
786
+ "enterprise_optimizer": typer.Option(
787
+ False,
788
+ "--enterprise-optimizer",
789
+ help="Enable enterprise-scale optimization engine with resource monitoring and scaling analysis.",
790
+ ),
791
+ "enterprise_profile": typer.Option(
792
+ None,
793
+ "--enterprise-profile",
794
+ help="Enterprise optimization profile: balanced, performance, memory, throughput.",
795
+ ),
796
+ "enterprise_report": typer.Option(
797
+ None,
798
+ "--enterprise-report",
799
+ help="Output file path for enterprise optimization report (JSON format).",
800
+ ),
801
+ "mkdocs_integration": typer.Option(
802
+ False,
803
+ "--mkdocs-integration",
804
+ help="Generate complete MkDocs documentation site with Material theme and automation.",
805
+ ),
806
+ "mkdocs_serve": typer.Option(
807
+ False,
808
+ "--mkdocs-serve",
809
+ help="Start MkDocs development server after building documentation site.",
810
+ ),
811
+ "mkdocs_theme": typer.Option(
812
+ "material",
813
+ "--mkdocs-theme",
814
+ help="MkDocs theme to use for documentation generation (default: material).",
815
+ ),
816
+ "mkdocs_output": typer.Option(
817
+ None,
818
+ "--mkdocs-output",
819
+ help="Output directory for MkDocs site generation (default: ./docs_site).",
820
+ ),
821
+ "contextual_ai": typer.Option(
822
+ False,
823
+ "--contextual-ai",
824
+ help="Enable contextual AI assistant with project-specific recommendations and insights.",
825
+ ),
826
+ "ai_recommendations": typer.Option(
827
+ 5,
828
+ "--ai-recommendations",
829
+ help="Maximum number of AI recommendations to display (default: 5).",
830
+ ),
831
+ "ai_help_query": typer.Option(
832
+ None,
833
+ "--ai-help-query",
834
+ help="Get contextual help for specific query using AI assistant.",
835
+ ),
836
+ # Configuration management features
837
+ "check_config_updates": typer.Option(
838
+ False,
839
+ "--check-config-updates",
840
+ help="Check for available configuration template updates.",
841
+ ),
842
+ "apply_config_updates": typer.Option(
843
+ False,
844
+ "--apply-config-updates",
845
+ help="Apply available configuration template updates.",
846
+ ),
847
+ "diff_config": typer.Option(
848
+ None,
849
+ "--diff-config",
850
+ help="Show diff preview for a specific configuration type.",
851
+ ),
852
+ "config_interactive": typer.Option(
853
+ False,
854
+ "--config-interactive",
855
+ help="Apply configuration updates interactively with confirmations.",
856
+ ),
857
+ "refresh_cache": typer.Option(
858
+ False,
859
+ "--refresh-cache",
860
+ help="Refresh pre-commit cache to ensure fresh environment.",
861
+ ),
381
862
  }
382
863
 
383
864
 
@@ -389,10 +870,7 @@ def create_options(
389
870
  verbose: bool,
390
871
  debug: bool,
391
872
  publish: BumpOption | None,
392
- all: BumpOption | None,
393
873
  bump: BumpOption | None,
394
- clean: bool,
395
- test: bool,
396
874
  benchmark: bool,
397
875
  test_workers: int,
398
876
  test_timeout: int,
@@ -400,11 +878,18 @@ def create_options(
400
878
  fast: bool,
401
879
  comp: bool,
402
880
  create_pr: bool,
403
- ai_agent: bool,
404
881
  async_mode: bool,
405
882
  experimental_hooks: bool,
406
883
  enable_pyrefly: bool,
407
884
  enable_ty: bool,
885
+ start_zuban_lsp: bool,
886
+ stop_zuban_lsp: bool,
887
+ restart_zuban_lsp: bool,
888
+ no_zuban_lsp: bool,
889
+ zuban_lsp_port: int,
890
+ zuban_lsp_mode: str,
891
+ zuban_lsp_timeout: int,
892
+ enable_lsp_hooks: bool,
408
893
  no_git_tags: bool,
409
894
  skip_version_check: bool,
410
895
  orchestrated: bool,
@@ -413,6 +898,8 @@ def create_options(
413
898
  orchestration_ai_mode: str,
414
899
  dev: bool,
415
900
  dashboard: bool,
901
+ unified_dashboard: bool,
902
+ unified_dashboard_port: int | None,
416
903
  max_iterations: int,
417
904
  coverage_status: bool,
418
905
  coverage_goal: float | None,
@@ -424,6 +911,53 @@ def create_options(
424
911
  global_lock_dir: str | None,
425
912
  quick: bool,
426
913
  thorough: bool,
914
+ clear_cache: bool,
915
+ cache_stats: bool,
916
+ generate_docs: bool,
917
+ docs_format: str,
918
+ validate_docs: bool,
919
+ generate_changelog: bool,
920
+ changelog_version: str | None,
921
+ changelog_since: str | None,
922
+ changelog_dry_run: bool,
923
+ auto_version: bool,
924
+ version_since: str | None,
925
+ accept_version: bool,
926
+ smart_commit: bool,
927
+ heatmap: bool,
928
+ heatmap_type: str,
929
+ heatmap_output: str | None,
930
+ anomaly_detection: bool,
931
+ anomaly_sensitivity: float,
932
+ anomaly_report: str | None,
933
+ predictive_analytics: bool,
934
+ prediction_periods: int,
935
+ analytics_dashboard: str | None,
936
+ # Enterprise features
937
+ enterprise_optimizer: bool,
938
+ enterprise_profile: str | None,
939
+ enterprise_report: str | None,
940
+ mkdocs_integration: bool,
941
+ mkdocs_serve: bool,
942
+ mkdocs_theme: str,
943
+ mkdocs_output: str | None,
944
+ contextual_ai: bool,
945
+ ai_recommendations: int,
946
+ ai_help_query: str | None,
947
+ check_config_updates: bool,
948
+ apply_config_updates: bool,
949
+ diff_config: str | None,
950
+ config_interactive: bool,
951
+ refresh_cache: bool,
952
+ # New semantic parameters
953
+ strip_code: bool | None = None,
954
+ run_tests: bool = False,
955
+ ai_fix: bool | None = None,
956
+ full_release: BumpOption | None = None,
957
+ show_progress: bool | None = None,
958
+ advanced_monitor: bool | None = None,
959
+ coverage_report: bool | None = None,
960
+ clean_releases: bool | None = None,
427
961
  ) -> Options:
428
962
  return Options(
429
963
  commit=commit,
@@ -434,21 +968,25 @@ def create_options(
434
968
  debug=debug,
435
969
  publish=publish,
436
970
  bump=bump,
437
- clean=clean,
438
- test=test,
439
971
  benchmark=benchmark,
440
972
  test_workers=test_workers,
441
973
  test_timeout=test_timeout,
442
974
  skip_hooks=skip_hooks,
443
975
  fast=fast,
444
976
  comp=comp,
445
- all=all,
446
- ai_agent=ai_agent,
447
977
  create_pr=create_pr,
448
978
  async_mode=async_mode,
449
979
  experimental_hooks=experimental_hooks,
450
980
  enable_pyrefly=enable_pyrefly,
451
981
  enable_ty=enable_ty,
982
+ start_zuban_lsp=start_zuban_lsp,
983
+ stop_zuban_lsp=stop_zuban_lsp,
984
+ restart_zuban_lsp=restart_zuban_lsp,
985
+ no_zuban_lsp=no_zuban_lsp,
986
+ zuban_lsp_port=zuban_lsp_port,
987
+ zuban_lsp_mode=zuban_lsp_mode,
988
+ zuban_lsp_timeout=zuban_lsp_timeout,
989
+ enable_lsp_hooks=enable_lsp_hooks,
452
990
  no_git_tags=no_git_tags,
453
991
  skip_version_check=skip_version_check,
454
992
  orchestrated=orchestrated,
@@ -457,6 +995,8 @@ def create_options(
457
995
  orchestration_ai_mode=orchestration_ai_mode,
458
996
  dev=dev,
459
997
  dashboard=dashboard,
998
+ unified_dashboard=unified_dashboard,
999
+ unified_dashboard_port=unified_dashboard_port,
460
1000
  max_iterations=max_iterations,
461
1001
  coverage_status=coverage_status,
462
1002
  coverage_goal=coverage_goal,
@@ -468,4 +1008,51 @@ def create_options(
468
1008
  global_lock_dir=global_lock_dir,
469
1009
  quick=quick,
470
1010
  thorough=thorough,
1011
+ clear_cache=clear_cache,
1012
+ cache_stats=cache_stats,
1013
+ generate_docs=generate_docs,
1014
+ docs_format=docs_format,
1015
+ validate_docs=validate_docs,
1016
+ generate_changelog=generate_changelog,
1017
+ changelog_version=changelog_version,
1018
+ changelog_since=changelog_since,
1019
+ changelog_dry_run=changelog_dry_run,
1020
+ auto_version=auto_version,
1021
+ version_since=version_since,
1022
+ accept_version=accept_version,
1023
+ smart_commit=smart_commit,
1024
+ heatmap=heatmap,
1025
+ heatmap_type=heatmap_type,
1026
+ heatmap_output=heatmap_output,
1027
+ anomaly_detection=anomaly_detection,
1028
+ anomaly_sensitivity=anomaly_sensitivity,
1029
+ anomaly_report=anomaly_report,
1030
+ predictive_analytics=predictive_analytics,
1031
+ prediction_periods=prediction_periods,
1032
+ analytics_dashboard=analytics_dashboard,
1033
+ # Enterprise features
1034
+ enterprise_optimizer=enterprise_optimizer,
1035
+ enterprise_profile=enterprise_profile,
1036
+ enterprise_report=enterprise_report,
1037
+ mkdocs_integration=mkdocs_integration,
1038
+ mkdocs_serve=mkdocs_serve,
1039
+ mkdocs_theme=mkdocs_theme,
1040
+ mkdocs_output=mkdocs_output,
1041
+ contextual_ai=contextual_ai,
1042
+ ai_recommendations=ai_recommendations,
1043
+ ai_help_query=ai_help_query,
1044
+ check_config_updates=check_config_updates,
1045
+ apply_config_updates=apply_config_updates,
1046
+ diff_config=diff_config,
1047
+ config_interactive=config_interactive,
1048
+ refresh_cache=refresh_cache,
1049
+ # New semantic parameters
1050
+ strip_code=strip_code,
1051
+ run_tests=run_tests,
1052
+ ai_fix=ai_fix,
1053
+ full_release=full_release,
1054
+ show_progress=show_progress,
1055
+ advanced_monitor=advanced_monitor,
1056
+ coverage_report=coverage_report,
1057
+ clean_releases=clean_releases,
471
1058
  )