empathy-framework 4.8.0__py3-none-any.whl → 4.9.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.
- {empathy_framework-4.8.0.dist-info → empathy_framework-4.9.1.dist-info}/METADATA +64 -25
- {empathy_framework-4.8.0.dist-info → empathy_framework-4.9.1.dist-info}/RECORD +28 -39
- empathy_os/__init__.py +2 -2
- empathy_os/cache/hash_only.py +3 -6
- empathy_os/cache/hybrid.py +3 -6
- empathy_os/cli_legacy.py +1 -27
- empathy_os/cli_unified.py +0 -25
- empathy_os/memory/__init__.py +5 -19
- empathy_os/memory/short_term.py +132 -10
- empathy_os/memory/types.py +4 -0
- empathy_os/models/registry.py +4 -4
- empathy_os/project_index/scanner.py +3 -2
- empathy_os/socratic/ab_testing.py +1 -1
- empathy_os/workflow_commands.py +9 -9
- empathy_os/workflows/__init__.py +4 -4
- empathy_os/workflows/base.py +8 -54
- empathy_os/workflows/bug_predict.py +2 -2
- empathy_os/workflows/history.py +5 -3
- empathy_os/workflows/perf_audit.py +4 -4
- empathy_os/workflows/progress.py +22 -324
- empathy_os/workflows/routing.py +0 -5
- empathy_os/workflows/security_audit.py +0 -189
- empathy_os/workflows/security_audit_phase3.py +26 -2
- empathy_os/workflows/test_gen.py +7 -7
- empathy_os/vscode_bridge 2.py +0 -173
- empathy_os/workflows/output.py +0 -410
- empathy_os/workflows/progressive/README 2.md +0 -454
- empathy_os/workflows/progressive/__init__ 2.py +0 -92
- empathy_os/workflows/progressive/cli 2.py +0 -242
- empathy_os/workflows/progressive/core 2.py +0 -488
- empathy_os/workflows/progressive/orchestrator 2.py +0 -701
- empathy_os/workflows/progressive/reports 2.py +0 -528
- empathy_os/workflows/progressive/telemetry 2.py +0 -280
- empathy_os/workflows/progressive/test_gen 2.py +0 -514
- empathy_os/workflows/progressive/workflow 2.py +0 -628
- {empathy_framework-4.8.0.dist-info → empathy_framework-4.9.1.dist-info}/WHEEL +0 -0
- {empathy_framework-4.8.0.dist-info → empathy_framework-4.9.1.dist-info}/entry_points.txt +0 -0
- {empathy_framework-4.8.0.dist-info → empathy_framework-4.9.1.dist-info}/licenses/LICENSE +0 -0
- {empathy_framework-4.8.0.dist-info → empathy_framework-4.9.1.dist-info}/top_level.txt +0 -0
|
@@ -1,242 +0,0 @@
|
|
|
1
|
-
"""CLI commands for progressive workflow management.
|
|
2
|
-
|
|
3
|
-
Provides commands for:
|
|
4
|
-
- Listing saved results
|
|
5
|
-
- Viewing detailed reports
|
|
6
|
-
- Generating analytics
|
|
7
|
-
- Cleaning up old results
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
import argparse
|
|
11
|
-
import sys
|
|
12
|
-
|
|
13
|
-
from empathy_os.workflows.progressive.reports import (
|
|
14
|
-
cleanup_old_results,
|
|
15
|
-
format_cost_analytics_report,
|
|
16
|
-
generate_cost_analytics,
|
|
17
|
-
list_saved_results,
|
|
18
|
-
load_result_from_disk,
|
|
19
|
-
)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
def cmd_list_results(args: argparse.Namespace) -> int:
|
|
23
|
-
"""List all saved progressive workflow results.
|
|
24
|
-
|
|
25
|
-
Args:
|
|
26
|
-
args: Parsed command line arguments
|
|
27
|
-
|
|
28
|
-
Returns:
|
|
29
|
-
Exit code (0 for success)
|
|
30
|
-
"""
|
|
31
|
-
storage_path = args.storage_path or ".empathy/progressive_runs"
|
|
32
|
-
results = list_saved_results(storage_path)
|
|
33
|
-
|
|
34
|
-
if not results:
|
|
35
|
-
print(f"No results found in {storage_path}")
|
|
36
|
-
return 0
|
|
37
|
-
|
|
38
|
-
print(f"\n📋 Found {len(results)} progressive workflow results:\n")
|
|
39
|
-
print(f"{'Task ID':<40} {'Workflow':<15} {'Cost':<10} {'Savings':<12} {'Success'}")
|
|
40
|
-
print("─" * 90)
|
|
41
|
-
|
|
42
|
-
for result in results:
|
|
43
|
-
task_id = result.get("task_id", "unknown")
|
|
44
|
-
workflow = result.get("workflow", "unknown")[:14]
|
|
45
|
-
cost = result.get("total_cost", 0.0)
|
|
46
|
-
savings = result.get("cost_savings_percent", 0.0)
|
|
47
|
-
success = "✅" if result.get("success", False) else "❌"
|
|
48
|
-
|
|
49
|
-
print(f"{task_id:<40} {workflow:<15} ${cost:<9.2f} {savings:>6.1f}% {success}")
|
|
50
|
-
|
|
51
|
-
print()
|
|
52
|
-
return 0
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
def cmd_show_report(args: argparse.Namespace) -> int:
|
|
56
|
-
"""Show detailed report for a specific task.
|
|
57
|
-
|
|
58
|
-
Args:
|
|
59
|
-
args: Parsed command line arguments
|
|
60
|
-
|
|
61
|
-
Returns:
|
|
62
|
-
Exit code (0 for success, 1 for error)
|
|
63
|
-
"""
|
|
64
|
-
task_id = args.task_id
|
|
65
|
-
storage_path = args.storage_path or ".empathy/progressive_runs"
|
|
66
|
-
|
|
67
|
-
try:
|
|
68
|
-
result_data = load_result_from_disk(task_id, storage_path)
|
|
69
|
-
|
|
70
|
-
if args.json:
|
|
71
|
-
import json
|
|
72
|
-
print(json.dumps(result_data, indent=2))
|
|
73
|
-
else:
|
|
74
|
-
# Show human-readable report
|
|
75
|
-
report = result_data.get("report", "")
|
|
76
|
-
if report:
|
|
77
|
-
print(report)
|
|
78
|
-
else:
|
|
79
|
-
print("No report found for this task")
|
|
80
|
-
|
|
81
|
-
return 0
|
|
82
|
-
|
|
83
|
-
except FileNotFoundError as e:
|
|
84
|
-
print(f"Error: {e}", file=sys.stderr)
|
|
85
|
-
return 1
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
def cmd_analytics(args: argparse.Namespace) -> int:
|
|
89
|
-
"""Show cost optimization analytics.
|
|
90
|
-
|
|
91
|
-
Args:
|
|
92
|
-
args: Parsed command line arguments
|
|
93
|
-
|
|
94
|
-
Returns:
|
|
95
|
-
Exit code (0 for success)
|
|
96
|
-
"""
|
|
97
|
-
storage_path = args.storage_path or ".empathy/progressive_runs"
|
|
98
|
-
analytics = generate_cost_analytics(storage_path)
|
|
99
|
-
|
|
100
|
-
if analytics["total_runs"] == 0:
|
|
101
|
-
print(f"No results found in {storage_path}")
|
|
102
|
-
return 0
|
|
103
|
-
|
|
104
|
-
if args.json:
|
|
105
|
-
import json
|
|
106
|
-
print(json.dumps(analytics, indent=2))
|
|
107
|
-
else:
|
|
108
|
-
report = format_cost_analytics_report(analytics)
|
|
109
|
-
print(report)
|
|
110
|
-
|
|
111
|
-
return 0
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
def cmd_cleanup(args: argparse.Namespace) -> int:
|
|
115
|
-
"""Clean up old progressive workflow results.
|
|
116
|
-
|
|
117
|
-
Args:
|
|
118
|
-
args: Parsed command line arguments
|
|
119
|
-
|
|
120
|
-
Returns:
|
|
121
|
-
Exit code (0 for success)
|
|
122
|
-
"""
|
|
123
|
-
storage_path = args.storage_path or ".empathy/progressive_runs"
|
|
124
|
-
retention_days = args.retention_days
|
|
125
|
-
dry_run = args.dry_run
|
|
126
|
-
|
|
127
|
-
deleted, retained = cleanup_old_results(
|
|
128
|
-
storage_path=storage_path,
|
|
129
|
-
retention_days=retention_days,
|
|
130
|
-
dry_run=dry_run
|
|
131
|
-
)
|
|
132
|
-
|
|
133
|
-
if dry_run:
|
|
134
|
-
print("\n🔍 Dry run mode - no files deleted\n")
|
|
135
|
-
print(f"Would delete: {deleted} results older than {retention_days} days")
|
|
136
|
-
print(f"Would retain: {retained} recent results")
|
|
137
|
-
else:
|
|
138
|
-
print("\n🗑️ Cleanup complete\n")
|
|
139
|
-
print(f"Deleted: {deleted} results older than {retention_days} days")
|
|
140
|
-
print(f"Retained: {retained} recent results")
|
|
141
|
-
|
|
142
|
-
return 0
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
def create_parser() -> argparse.ArgumentParser:
|
|
146
|
-
"""Create argument parser for progressive CLI.
|
|
147
|
-
|
|
148
|
-
Returns:
|
|
149
|
-
Configured argument parser
|
|
150
|
-
"""
|
|
151
|
-
parser = argparse.ArgumentParser(
|
|
152
|
-
prog="empathy progressive",
|
|
153
|
-
description="Manage progressive tier escalation workflows"
|
|
154
|
-
)
|
|
155
|
-
|
|
156
|
-
parser.add_argument(
|
|
157
|
-
"--storage-path",
|
|
158
|
-
type=str,
|
|
159
|
-
default=None,
|
|
160
|
-
help="Custom storage path (default: .empathy/progressive_runs)"
|
|
161
|
-
)
|
|
162
|
-
|
|
163
|
-
subparsers = parser.add_subparsers(dest="command", help="Available commands")
|
|
164
|
-
|
|
165
|
-
# List command
|
|
166
|
-
list_parser = subparsers.add_parser(
|
|
167
|
-
"list",
|
|
168
|
-
help="List all saved progressive workflow results"
|
|
169
|
-
)
|
|
170
|
-
list_parser.set_defaults(func=cmd_list_results)
|
|
171
|
-
|
|
172
|
-
# Show command
|
|
173
|
-
show_parser = subparsers.add_parser(
|
|
174
|
-
"show",
|
|
175
|
-
help="Show detailed report for a specific task"
|
|
176
|
-
)
|
|
177
|
-
show_parser.add_argument(
|
|
178
|
-
"task_id",
|
|
179
|
-
type=str,
|
|
180
|
-
help="Task ID to display"
|
|
181
|
-
)
|
|
182
|
-
show_parser.add_argument(
|
|
183
|
-
"--json",
|
|
184
|
-
action="store_true",
|
|
185
|
-
help="Output in JSON format"
|
|
186
|
-
)
|
|
187
|
-
show_parser.set_defaults(func=cmd_show_report)
|
|
188
|
-
|
|
189
|
-
# Analytics command
|
|
190
|
-
analytics_parser = subparsers.add_parser(
|
|
191
|
-
"analytics",
|
|
192
|
-
help="Show cost optimization analytics"
|
|
193
|
-
)
|
|
194
|
-
analytics_parser.add_argument(
|
|
195
|
-
"--json",
|
|
196
|
-
action="store_true",
|
|
197
|
-
help="Output in JSON format"
|
|
198
|
-
)
|
|
199
|
-
analytics_parser.set_defaults(func=cmd_analytics)
|
|
200
|
-
|
|
201
|
-
# Cleanup command
|
|
202
|
-
cleanup_parser = subparsers.add_parser(
|
|
203
|
-
"cleanup",
|
|
204
|
-
help="Clean up old progressive workflow results"
|
|
205
|
-
)
|
|
206
|
-
cleanup_parser.add_argument(
|
|
207
|
-
"--retention-days",
|
|
208
|
-
type=int,
|
|
209
|
-
default=30,
|
|
210
|
-
help="Number of days to retain results (default: 30)"
|
|
211
|
-
)
|
|
212
|
-
cleanup_parser.add_argument(
|
|
213
|
-
"--dry-run",
|
|
214
|
-
action="store_true",
|
|
215
|
-
help="Show what would be deleted without actually deleting"
|
|
216
|
-
)
|
|
217
|
-
cleanup_parser.set_defaults(func=cmd_cleanup)
|
|
218
|
-
|
|
219
|
-
return parser
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
def main(argv: list[str] | None = None) -> int:
|
|
223
|
-
"""Main entry point for progressive CLI.
|
|
224
|
-
|
|
225
|
-
Args:
|
|
226
|
-
argv: Command line arguments (defaults to sys.argv[1:])
|
|
227
|
-
|
|
228
|
-
Returns:
|
|
229
|
-
Exit code
|
|
230
|
-
"""
|
|
231
|
-
parser = create_parser()
|
|
232
|
-
args = parser.parse_args(argv)
|
|
233
|
-
|
|
234
|
-
if not hasattr(args, "func"):
|
|
235
|
-
parser.print_help()
|
|
236
|
-
return 1
|
|
237
|
-
|
|
238
|
-
return args.func(args)
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
if __name__ == "__main__":
|
|
242
|
-
sys.exit(main())
|