empathy-framework 4.6.3__py3-none-any.whl → 4.6.5__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.
Files changed (65) hide show
  1. {empathy_framework-4.6.3.dist-info → empathy_framework-4.6.5.dist-info}/METADATA +53 -11
  2. {empathy_framework-4.6.3.dist-info → empathy_framework-4.6.5.dist-info}/RECORD +32 -57
  3. empathy_llm_toolkit/agent_factory/crews/health_check.py +7 -4
  4. empathy_llm_toolkit/agent_factory/decorators.py +3 -2
  5. empathy_llm_toolkit/agent_factory/memory_integration.py +6 -2
  6. empathy_llm_toolkit/contextual_patterns.py +5 -2
  7. empathy_llm_toolkit/git_pattern_extractor.py +8 -4
  8. empathy_llm_toolkit/providers.py +4 -3
  9. empathy_os/__init__.py +1 -1
  10. empathy_os/cli/__init__.py +306 -0
  11. empathy_os/cli/__main__.py +26 -0
  12. empathy_os/cli/commands/__init__.py +8 -0
  13. empathy_os/cli/commands/inspection.py +48 -0
  14. empathy_os/cli/commands/memory.py +56 -0
  15. empathy_os/cli/commands/provider.py +86 -0
  16. empathy_os/cli/commands/utilities.py +94 -0
  17. empathy_os/cli/core.py +32 -0
  18. empathy_os/cli.py +18 -6
  19. empathy_os/cli_unified.py +19 -3
  20. empathy_os/memory/short_term.py +12 -2
  21. empathy_os/project_index/scanner.py +151 -49
  22. empathy_os/socratic/visual_editor.py +9 -4
  23. empathy_os/workflows/bug_predict.py +70 -1
  24. empathy_os/workflows/pr_review.py +6 -0
  25. empathy_os/workflows/security_audit.py +13 -0
  26. empathy_os/workflows/tier_tracking.py +50 -2
  27. wizards/discharge_summary_wizard.py +4 -2
  28. wizards/incident_report_wizard.py +4 -2
  29. empathy_os/meta_workflows/agent_creator 2.py +0 -254
  30. empathy_os/meta_workflows/builtin_templates 2.py +0 -567
  31. empathy_os/meta_workflows/cli_meta_workflows 2.py +0 -1551
  32. empathy_os/meta_workflows/form_engine 2.py +0 -304
  33. empathy_os/meta_workflows/intent_detector 2.py +0 -298
  34. empathy_os/meta_workflows/pattern_learner 2.py +0 -754
  35. empathy_os/meta_workflows/session_context 2.py +0 -398
  36. empathy_os/meta_workflows/template_registry 2.py +0 -229
  37. empathy_os/meta_workflows/workflow 2.py +0 -980
  38. empathy_os/orchestration/pattern_learner 2.py +0 -699
  39. empathy_os/orchestration/real_tools 2.py +0 -938
  40. empathy_os/socratic/__init__ 2.py +0 -273
  41. empathy_os/socratic/ab_testing 2.py +0 -969
  42. empathy_os/socratic/blueprint 2.py +0 -532
  43. empathy_os/socratic/cli 2.py +0 -689
  44. empathy_os/socratic/collaboration 2.py +0 -1112
  45. empathy_os/socratic/domain_templates 2.py +0 -916
  46. empathy_os/socratic/embeddings 2.py +0 -734
  47. empathy_os/socratic/engine 2.py +0 -729
  48. empathy_os/socratic/explainer 2.py +0 -663
  49. empathy_os/socratic/feedback 2.py +0 -767
  50. empathy_os/socratic/forms 2.py +0 -624
  51. empathy_os/socratic/generator 2.py +0 -716
  52. empathy_os/socratic/llm_analyzer 2.py +0 -635
  53. empathy_os/socratic/mcp_server 2.py +0 -751
  54. empathy_os/socratic/session 2.py +0 -306
  55. empathy_os/socratic/storage 2.py +0 -635
  56. empathy_os/socratic/success 2.py +0 -719
  57. empathy_os/socratic/visual_editor 2.py +0 -812
  58. empathy_os/socratic/web_ui 2.py +0 -925
  59. empathy_os/workflows/batch_processing 2.py +0 -310
  60. empathy_os/workflows/release_prep_crew 2.py +0 -968
  61. empathy_os/workflows/test_coverage_boost_crew 2.py +0 -848
  62. {empathy_framework-4.6.3.dist-info → empathy_framework-4.6.5.dist-info}/WHEEL +0 -0
  63. {empathy_framework-4.6.3.dist-info → empathy_framework-4.6.5.dist-info}/entry_points.txt +0 -0
  64. {empathy_framework-4.6.3.dist-info → empathy_framework-4.6.5.dist-info}/licenses/LICENSE +0 -0
  65. {empathy_framework-4.6.3.dist-info → empathy_framework-4.6.5.dist-info}/top_level.txt +0 -0
@@ -1,567 +0,0 @@
1
- """Built-in meta-workflow templates.
2
-
3
- These templates replace the deprecated Crew-based workflows with equivalent
4
- functionality using the meta-workflow system.
5
-
6
- Migration replacements:
7
- - ReleasePreparationCrew → release-prep template
8
- - TestCoverageBoostCrew → test-coverage-boost template
9
- - TestMaintenanceCrew → test-maintenance template
10
- - ManageDocumentationCrew → manage-docs template
11
-
12
- Created: 2026-01-18
13
- Purpose: Provide drop-in replacements for deprecated Crew workflows
14
- """
15
-
16
- from empathy_os.meta_workflows.models import (
17
- AgentCompositionRule,
18
- FormQuestion,
19
- FormSchema,
20
- MetaWorkflowTemplate,
21
- QuestionType,
22
- TierStrategy,
23
- )
24
-
25
- # =============================================================================
26
- # Release Preparation Template
27
- # =============================================================================
28
-
29
- RELEASE_PREP_TEMPLATE = MetaWorkflowTemplate(
30
- template_id="release-prep",
31
- name="Release Preparation",
32
- description="Comprehensive release readiness assessment using multi-agent collaboration",
33
- version="1.0.0",
34
- tags=["release", "quality", "security", "testing", "documentation"],
35
- author="empathy-framework",
36
- estimated_cost_range=(0.10, 0.75),
37
- estimated_duration_minutes=10,
38
- form_schema=FormSchema(
39
- title="Release Preparation Configuration",
40
- description="Configure release readiness checks for your project",
41
- questions=[
42
- FormQuestion(
43
- id="security_scan",
44
- text="Run security vulnerability scan?",
45
- type=QuestionType.BOOLEAN,
46
- default="Yes",
47
- help_text="Scan for OWASP Top 10 vulnerabilities and dependency issues",
48
- ),
49
- FormQuestion(
50
- id="test_coverage_check",
51
- text="Verify test coverage meets threshold?",
52
- type=QuestionType.BOOLEAN,
53
- default="Yes",
54
- help_text="Check that test coverage meets minimum requirements",
55
- ),
56
- FormQuestion(
57
- id="coverage_threshold",
58
- text="Minimum coverage threshold (%)",
59
- type=QuestionType.SINGLE_SELECT,
60
- options=["70%", "80%", "85%", "90%"],
61
- default="80%",
62
- help_text="Tests must meet this coverage percentage",
63
- ),
64
- FormQuestion(
65
- id="quality_review",
66
- text="Run code quality review?",
67
- type=QuestionType.BOOLEAN,
68
- default="Yes",
69
- help_text="Check for code smells, complexity issues, and best practices",
70
- ),
71
- FormQuestion(
72
- id="doc_verification",
73
- text="Verify documentation completeness?",
74
- type=QuestionType.BOOLEAN,
75
- default="Yes",
76
- help_text="Check that all public APIs are documented",
77
- ),
78
- ],
79
- ),
80
- agent_composition_rules=[
81
- AgentCompositionRule(
82
- role="Security Auditor",
83
- base_template="security-analyst",
84
- tier_strategy=TierStrategy.CAPABLE_FIRST,
85
- tools=["grep", "bandit", "safety"],
86
- required_responses={"security_scan": "Yes"},
87
- config_mapping={},
88
- success_criteria=[
89
- "No critical vulnerabilities found",
90
- "All dependencies are secure",
91
- ],
92
- ),
93
- AgentCompositionRule(
94
- role="Test Coverage Analyst",
95
- base_template="test-analyst",
96
- tier_strategy=TierStrategy.PROGRESSIVE,
97
- tools=["pytest", "coverage"],
98
- required_responses={"test_coverage_check": "Yes"},
99
- config_mapping={"coverage_threshold": "min_coverage"},
100
- success_criteria=[
101
- "Coverage meets threshold",
102
- "All tests pass",
103
- ],
104
- ),
105
- AgentCompositionRule(
106
- role="Code Quality Reviewer",
107
- base_template="code-reviewer",
108
- tier_strategy=TierStrategy.PROGRESSIVE,
109
- tools=["ruff", "mypy"],
110
- required_responses={"quality_review": "Yes"},
111
- config_mapping={},
112
- success_criteria=[
113
- "No high-severity issues",
114
- "Complexity within bounds",
115
- ],
116
- ),
117
- AgentCompositionRule(
118
- role="Documentation Specialist",
119
- base_template="doc-reviewer",
120
- tier_strategy=TierStrategy.CHEAP_ONLY,
121
- tools=["pydocstyle"],
122
- required_responses={"doc_verification": "Yes"},
123
- config_mapping={},
124
- success_criteria=[
125
- "All public APIs documented",
126
- "README is current",
127
- ],
128
- ),
129
- ],
130
- )
131
-
132
- # =============================================================================
133
- # Test Coverage Boost Template
134
- # =============================================================================
135
-
136
- TEST_COVERAGE_BOOST_TEMPLATE = MetaWorkflowTemplate(
137
- template_id="test-coverage-boost",
138
- name="Test Coverage Boost",
139
- description="Multi-agent test generation with gap analysis and validation",
140
- version="1.0.0",
141
- tags=["testing", "coverage", "test-generation"],
142
- author="empathy-framework",
143
- estimated_cost_range=(0.15, 1.00),
144
- estimated_duration_minutes=15,
145
- form_schema=FormSchema(
146
- title="Test Coverage Boost Configuration",
147
- description="Configure test generation to improve coverage",
148
- questions=[
149
- FormQuestion(
150
- id="target_coverage",
151
- text="Target coverage percentage",
152
- type=QuestionType.SINGLE_SELECT,
153
- options=["70%", "75%", "80%", "85%", "90%"],
154
- default="80%",
155
- help_text="Generate tests until this coverage is reached",
156
- ),
157
- FormQuestion(
158
- id="test_style",
159
- text="Test style preference",
160
- type=QuestionType.SINGLE_SELECT,
161
- options=["pytest", "unittest", "auto-detect"],
162
- default="auto-detect",
163
- help_text="Test framework style to use",
164
- ),
165
- FormQuestion(
166
- id="prioritize_high_impact",
167
- text="Prioritize high-impact files?",
168
- type=QuestionType.BOOLEAN,
169
- default="Yes",
170
- help_text="Focus on complex, frequently-used code first",
171
- ),
172
- FormQuestion(
173
- id="include_edge_cases",
174
- text="Include edge case tests?",
175
- type=QuestionType.BOOLEAN,
176
- default="Yes",
177
- help_text="Generate tests for boundary conditions",
178
- ),
179
- ],
180
- ),
181
- agent_composition_rules=[
182
- AgentCompositionRule(
183
- role="Gap Analyzer",
184
- base_template="coverage-analyst",
185
- tier_strategy=TierStrategy.PROGRESSIVE,
186
- tools=["pytest-cov", "coverage"],
187
- required_responses={},
188
- config_mapping={"target_coverage": "target_coverage"},
189
- success_criteria=[
190
- "Identified coverage gaps",
191
- "Prioritized files by impact",
192
- ],
193
- ),
194
- AgentCompositionRule(
195
- role="Test Generator",
196
- base_template="test-generator",
197
- tier_strategy=TierStrategy.CAPABLE_FIRST,
198
- tools=["ast", "pytest"],
199
- required_responses={},
200
- config_mapping={
201
- "test_style": "test_style",
202
- "include_edge_cases": "edge_cases",
203
- },
204
- success_criteria=[
205
- "Tests are syntactically correct",
206
- "Tests cover identified gaps",
207
- ],
208
- ),
209
- AgentCompositionRule(
210
- role="Test Validator",
211
- base_template="test-validator",
212
- tier_strategy=TierStrategy.CHEAP_ONLY,
213
- tools=["pytest"],
214
- required_responses={},
215
- config_mapping={},
216
- success_criteria=[
217
- "Generated tests pass",
218
- "Coverage improved",
219
- ],
220
- ),
221
- ],
222
- )
223
-
224
- # =============================================================================
225
- # Test Maintenance Template
226
- # =============================================================================
227
-
228
- TEST_MAINTENANCE_TEMPLATE = MetaWorkflowTemplate(
229
- template_id="test-maintenance",
230
- name="Test Maintenance",
231
- description="Automated test lifecycle management with gap analysis and validation",
232
- version="1.0.0",
233
- tags=["testing", "maintenance", "automation"],
234
- author="empathy-framework",
235
- estimated_cost_range=(0.10, 0.80),
236
- estimated_duration_minutes=12,
237
- form_schema=FormSchema(
238
- title="Test Maintenance Configuration",
239
- description="Configure test maintenance and generation",
240
- questions=[
241
- FormQuestion(
242
- id="mode",
243
- text="Maintenance mode",
244
- type=QuestionType.SINGLE_SELECT,
245
- options=["full", "analyze", "generate", "validate", "report"],
246
- default="full",
247
- help_text="Full runs all agents; other modes run specific phases",
248
- ),
249
- FormQuestion(
250
- id="max_files",
251
- text="Maximum files to process",
252
- type=QuestionType.SINGLE_SELECT,
253
- options=["5", "10", "20", "50"],
254
- default="10",
255
- help_text="Limit number of files to process per run",
256
- ),
257
- FormQuestion(
258
- id="staleness_threshold",
259
- text="Staleness threshold (days)",
260
- type=QuestionType.SINGLE_SELECT,
261
- options=["3", "7", "14", "30"],
262
- default="7",
263
- help_text="Tests older than this are considered stale",
264
- ),
265
- FormQuestion(
266
- id="auto_validation",
267
- text="Enable auto-validation?",
268
- type=QuestionType.BOOLEAN,
269
- default="Yes",
270
- help_text="Automatically run generated tests to verify they work",
271
- ),
272
- ],
273
- ),
274
- agent_composition_rules=[
275
- AgentCompositionRule(
276
- role="Test Analyst",
277
- base_template="test-analyst",
278
- tier_strategy=TierStrategy.PROGRESSIVE,
279
- tools=["pytest-cov", "coverage"],
280
- required_responses={"mode": ["full", "analyze"]},
281
- config_mapping={
282
- "max_files": "max_files_per_run",
283
- "staleness_threshold": "staleness_days",
284
- },
285
- success_criteria=[
286
- "Coverage gaps identified",
287
- "Stale tests detected",
288
- ],
289
- ),
290
- AgentCompositionRule(
291
- role="Test Generator",
292
- base_template="test-generator",
293
- tier_strategy=TierStrategy.CAPABLE_FIRST,
294
- tools=["ast", "pytest"],
295
- required_responses={"mode": ["full", "generate"]},
296
- config_mapping={},
297
- success_criteria=[
298
- "Tests generated for priority files",
299
- ],
300
- ),
301
- AgentCompositionRule(
302
- role="Test Validator",
303
- base_template="test-validator",
304
- tier_strategy=TierStrategy.CHEAP_ONLY,
305
- tools=["pytest"],
306
- required_responses={"mode": ["full", "validate"], "auto_validation": "Yes"},
307
- config_mapping={},
308
- success_criteria=[
309
- "Generated tests pass",
310
- ],
311
- ),
312
- AgentCompositionRule(
313
- role="Test Reporter",
314
- base_template="reporter",
315
- tier_strategy=TierStrategy.CHEAP_ONLY,
316
- tools=[],
317
- required_responses={},
318
- config_mapping={},
319
- success_criteria=[
320
- "Status report generated",
321
- ],
322
- ),
323
- ],
324
- )
325
-
326
- # =============================================================================
327
- # Documentation Management Template
328
- # =============================================================================
329
-
330
- MANAGE_DOCS_TEMPLATE = MetaWorkflowTemplate(
331
- template_id="manage-docs",
332
- name="Documentation Management",
333
- description="Ensure program files are documented and docs stay in sync with code",
334
- version="1.0.0",
335
- tags=["documentation", "docstrings", "readme"],
336
- author="empathy-framework",
337
- estimated_cost_range=(0.08, 0.50),
338
- estimated_duration_minutes=8,
339
- form_schema=FormSchema(
340
- title="Documentation Management Configuration",
341
- description="Configure documentation sync and gap detection",
342
- questions=[
343
- FormQuestion(
344
- id="check_docstrings",
345
- text="Check for missing docstrings?",
346
- type=QuestionType.BOOLEAN,
347
- default="Yes",
348
- help_text="Identify functions and classes without docstrings",
349
- ),
350
- FormQuestion(
351
- id="check_readme",
352
- text="Check README freshness?",
353
- type=QuestionType.BOOLEAN,
354
- default="Yes",
355
- help_text="Verify README reflects recent code changes",
356
- ),
357
- FormQuestion(
358
- id="check_api_docs",
359
- text="Check API documentation?",
360
- type=QuestionType.BOOLEAN,
361
- default="Yes",
362
- help_text="Verify all public APIs are documented",
363
- ),
364
- FormQuestion(
365
- id="suggest_updates",
366
- text="Generate update suggestions?",
367
- type=QuestionType.BOOLEAN,
368
- default="Yes",
369
- help_text="Provide specific recommendations for documentation improvements",
370
- ),
371
- ],
372
- ),
373
- agent_composition_rules=[
374
- AgentCompositionRule(
375
- role="Documentation Analyst",
376
- base_template="doc-analyst",
377
- tier_strategy=TierStrategy.PROGRESSIVE,
378
- tools=["ast", "pydocstyle"],
379
- required_responses={},
380
- config_mapping={
381
- "check_docstrings": "analyze_docstrings",
382
- "check_readme": "analyze_readme",
383
- "check_api_docs": "analyze_api_docs",
384
- },
385
- success_criteria=[
386
- "Documentation gaps identified",
387
- ],
388
- ),
389
- AgentCompositionRule(
390
- role="Documentation Reviewer",
391
- base_template="doc-reviewer",
392
- tier_strategy=TierStrategy.PROGRESSIVE,
393
- tools=[],
394
- required_responses={},
395
- config_mapping={},
396
- success_criteria=[
397
- "Findings validated",
398
- "False positives removed",
399
- ],
400
- ),
401
- AgentCompositionRule(
402
- role="Documentation Synthesizer",
403
- base_template="synthesizer",
404
- tier_strategy=TierStrategy.CAPABLE_FIRST,
405
- tools=[],
406
- required_responses={"suggest_updates": "Yes"},
407
- config_mapping={},
408
- success_criteria=[
409
- "Prioritized action plan created",
410
- ],
411
- ),
412
- ],
413
- )
414
-
415
- # =============================================================================
416
- # Feature Overview Template
417
- # =============================================================================
418
-
419
- FEATURE_OVERVIEW_TEMPLATE = MetaWorkflowTemplate(
420
- template_id="feature-overview",
421
- name="Feature Overview Generator",
422
- description="Generate comprehensive technical documentation for code modules, suitable for architects, engineers, and content creators",
423
- version="1.0.0",
424
- tags=["documentation", "architecture", "insights", "blog"],
425
- author="empathy-framework",
426
- estimated_cost_range=(0.40, 0.80),
427
- estimated_duration_minutes=15,
428
- form_schema=FormSchema(
429
- title="Feature Overview Configuration",
430
- description="Configure technical documentation generation",
431
- questions=[
432
- FormQuestion(
433
- id="target_path",
434
- text="Which module or directory to analyze?",
435
- type=QuestionType.TEXT_INPUT,
436
- default="src/",
437
- help_text="Path to the code you want to document",
438
- ),
439
- FormQuestion(
440
- id="target_audience",
441
- text="Who is the primary audience?",
442
- type=QuestionType.SINGLE_SELECT,
443
- options=["Architects", "Engineers", "Technical Writers", "All"],
444
- default="Architects",
445
- help_text="Tailors the depth and focus of documentation",
446
- ),
447
- FormQuestion(
448
- id="include_blog_summary",
449
- text="Include blog-ready summary?",
450
- type=QuestionType.BOOLEAN,
451
- default="Yes",
452
- help_text="Generate a summary suitable for technical blog posts",
453
- ),
454
- FormQuestion(
455
- id="include_diagrams",
456
- text="Include architecture diagrams?",
457
- type=QuestionType.BOOLEAN,
458
- default="Yes",
459
- help_text="Generate ASCII diagrams showing component relationships",
460
- ),
461
- ],
462
- ),
463
- agent_composition_rules=[
464
- AgentCompositionRule(
465
- role="Code Scanner",
466
- base_template="generic",
467
- tier_strategy=TierStrategy.CAPABLE_FIRST,
468
- tools=["read", "grep", "glob"],
469
- required_responses={},
470
- config_mapping={"target_path": "path"},
471
- success_criteria=[
472
- "modules_identified",
473
- "structure_mapped",
474
- ],
475
- ),
476
- AgentCompositionRule(
477
- role="Insights Reporter",
478
- base_template="generic",
479
- tier_strategy=TierStrategy.CAPABLE_FIRST,
480
- tools=["read"],
481
- required_responses={},
482
- config_mapping={"target_audience": "audience"},
483
- success_criteria=[
484
- "patterns_identified",
485
- "insights_generated",
486
- ],
487
- ),
488
- AgentCompositionRule(
489
- role="Architecture Analyst",
490
- base_template="generic",
491
- tier_strategy=TierStrategy.CAPABLE_FIRST,
492
- tools=["read"],
493
- required_responses={"include_diagrams": "Yes"},
494
- config_mapping={},
495
- success_criteria=[
496
- "diagrams_created",
497
- "relationships_mapped",
498
- ],
499
- ),
500
- AgentCompositionRule(
501
- role="Quality Reviewer",
502
- base_template="generic",
503
- tier_strategy=TierStrategy.PREMIUM_ONLY,
504
- tools=["read"],
505
- required_responses={},
506
- config_mapping={},
507
- success_criteria=[
508
- "accuracy_validated",
509
- "completeness_checked",
510
- ],
511
- ),
512
- AgentCompositionRule(
513
- role="Blog Content Creator",
514
- base_template="generic",
515
- tier_strategy=TierStrategy.PREMIUM_ONLY,
516
- tools=["write"],
517
- required_responses={"include_blog_summary": "Yes"},
518
- config_mapping={"target_audience": "audience"},
519
- success_criteria=[
520
- "blog_summary_created",
521
- "audience_appropriate",
522
- ],
523
- ),
524
- ],
525
- )
526
-
527
- # =============================================================================
528
- # Template Registry
529
- # =============================================================================
530
-
531
- BUILTIN_TEMPLATES = {
532
- "release-prep": RELEASE_PREP_TEMPLATE,
533
- "test-coverage-boost": TEST_COVERAGE_BOOST_TEMPLATE,
534
- "test-maintenance": TEST_MAINTENANCE_TEMPLATE,
535
- "manage-docs": MANAGE_DOCS_TEMPLATE,
536
- "feature-overview": FEATURE_OVERVIEW_TEMPLATE,
537
- }
538
-
539
-
540
- def get_builtin_template(template_id: str) -> MetaWorkflowTemplate | None:
541
- """Get a built-in template by ID.
542
-
543
- Args:
544
- template_id: ID of the template to retrieve
545
-
546
- Returns:
547
- MetaWorkflowTemplate if found, None otherwise
548
- """
549
- return BUILTIN_TEMPLATES.get(template_id)
550
-
551
-
552
- def list_builtin_templates() -> list[str]:
553
- """List all built-in template IDs.
554
-
555
- Returns:
556
- List of template IDs
557
- """
558
- return list(BUILTIN_TEMPLATES.keys())
559
-
560
-
561
- def get_all_builtin_templates() -> dict[str, MetaWorkflowTemplate]:
562
- """Get all built-in templates.
563
-
564
- Returns:
565
- Dictionary mapping template_id → MetaWorkflowTemplate
566
- """
567
- return BUILTIN_TEMPLATES.copy()