agentic-qe 2.5.3 → 2.5.5
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.
- package/.claude/commands/aqe-costs.md +509 -0
- package/CHANGELOG.md +72 -0
- package/README.md +1 -1
- package/dist/agents/SONALifecycleManager.d.ts +226 -0
- package/dist/agents/SONALifecycleManager.d.ts.map +1 -0
- package/dist/agents/SONALifecycleManager.js +563 -0
- package/dist/agents/SONALifecycleManager.js.map +1 -0
- package/dist/agents/index.d.ts +2 -0
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +7 -1
- package/dist/agents/index.js.map +1 -1
- package/dist/core/memory/HNSWVectorMemory.js +1 -1
- package/dist/core/metrics/InferenceCostTracker.d.ts +293 -0
- package/dist/core/metrics/InferenceCostTracker.d.ts.map +1 -0
- package/dist/core/metrics/InferenceCostTracker.js +461 -0
- package/dist/core/metrics/InferenceCostTracker.js.map +1 -0
- package/dist/core/metrics/index.d.ts +1 -0
- package/dist/core/metrics/index.d.ts.map +1 -1
- package/dist/core/metrics/index.js +7 -1
- package/dist/core/metrics/index.js.map +1 -1
- package/dist/core/routing/AdaptiveModelRouter.d.ts +17 -0
- package/dist/core/routing/AdaptiveModelRouter.d.ts.map +1 -1
- package/dist/core/routing/AdaptiveModelRouter.js +117 -0
- package/dist/core/routing/AdaptiveModelRouter.js.map +1 -1
- package/dist/core/routing/ModelRules.d.ts +2 -0
- package/dist/core/routing/ModelRules.d.ts.map +1 -1
- package/dist/core/routing/ModelRules.js +82 -0
- package/dist/core/routing/ModelRules.js.map +1 -1
- package/dist/core/routing/types.d.ts +14 -1
- package/dist/core/routing/types.d.ts.map +1 -1
- package/dist/core/routing/types.js +7 -0
- package/dist/core/routing/types.js.map +1 -1
- package/dist/mcp/server-instructions.d.ts +1 -1
- package/dist/mcp/server-instructions.js +1 -1
- package/dist/mcp/services/AgentRegistry.d.ts +35 -0
- package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
- package/dist/mcp/services/AgentRegistry.js +126 -1
- package/dist/mcp/services/AgentRegistry.js.map +1 -1
- package/dist/mcp/tools/qe/accessibility/video-vision-analyzer.d.ts +8 -1
- package/dist/mcp/tools/qe/accessibility/video-vision-analyzer.d.ts.map +1 -1
- package/dist/mcp/tools/qe/accessibility/video-vision-analyzer.js +134 -46
- package/dist/mcp/tools/qe/accessibility/video-vision-analyzer.js.map +1 -1
- package/dist/mcp/tools/qe/accessibility/webvtt-generator.d.ts.map +1 -1
- package/dist/mcp/tools/qe/accessibility/webvtt-generator.js +11 -4
- package/dist/mcp/tools/qe/accessibility/webvtt-generator.js.map +1 -1
- package/dist/telemetry/metrics/collectors/cost.d.ts.map +1 -1
- package/dist/telemetry/metrics/collectors/cost.js +6 -0
- package/dist/telemetry/metrics/collectors/cost.js.map +1 -1
- package/package.json +9 -2
|
@@ -0,0 +1,509 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aqe-costs
|
|
3
|
+
description: Display inference cost analysis and savings from local vs cloud providers
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# AQE Inference Costs
|
|
7
|
+
|
|
8
|
+
Display comprehensive inference cost analysis showing local vs cloud inference costs and estimated savings.
|
|
9
|
+
|
|
10
|
+
## Usage
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
aqe costs [options]
|
|
14
|
+
# or
|
|
15
|
+
/aqe-costs [options]
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Options
|
|
19
|
+
|
|
20
|
+
| Option | Type | Default | Description |
|
|
21
|
+
|--------|------|---------|-------------|
|
|
22
|
+
| `--period` | string | `24h` | Time period: 1h, 24h, 7d, 30d, all |
|
|
23
|
+
| `--provider` | string | - | Filter by provider: ruvllm, anthropic, openrouter, openai |
|
|
24
|
+
| `--format` | string | `text` | Output format: text, json |
|
|
25
|
+
| `--detailed` | boolean | `false` | Show detailed per-request breakdown |
|
|
26
|
+
| `--reset` | boolean | `false` | Reset cost tracking data |
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### Basic Cost Report
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
aqe costs
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Displays cost summary for the last 24 hours with savings analysis.
|
|
37
|
+
|
|
38
|
+
### Weekly Cost Analysis
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
aqe costs --period 7d
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Shows cost trends and savings over the past 7 days.
|
|
45
|
+
|
|
46
|
+
### Provider-Specific Costs
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
aqe costs --provider ruvllm
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Displays costs for local ruvllm inference only.
|
|
53
|
+
|
|
54
|
+
### Detailed Breakdown
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
aqe costs --detailed
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Shows per-request cost breakdown with agent and task attribution.
|
|
61
|
+
|
|
62
|
+
### JSON Export for Dashboards
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
aqe costs --format json > costs.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Exports cost data in JSON format for integration with monitoring dashboards.
|
|
69
|
+
|
|
70
|
+
### Reset Cost Data
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
aqe costs --reset
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Clears all tracked cost data (useful for testing or new billing periods).
|
|
77
|
+
|
|
78
|
+
## Integration with Claude Code
|
|
79
|
+
|
|
80
|
+
### Cost Monitoring Agent
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
// Use Claude Code's Task tool for cost monitoring
|
|
84
|
+
Task("Monitor inference costs", `
|
|
85
|
+
Analyze AQE inference costs and provide recommendations:
|
|
86
|
+
- Check cost trends over the past 24 hours
|
|
87
|
+
- Identify high-cost agents or tasks
|
|
88
|
+
- Calculate savings from local inference
|
|
89
|
+
- Recommend optimizations to reduce cloud costs
|
|
90
|
+
|
|
91
|
+
Store findings in memory: aqe/costs/analysis/{timestamp}
|
|
92
|
+
`, "qe-quality-gate")
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Automated Cost Reporting Workflow
|
|
96
|
+
|
|
97
|
+
```javascript
|
|
98
|
+
// Daily cost report generation
|
|
99
|
+
[Single Message]:
|
|
100
|
+
Task("Generate cost report", "Create daily inference cost summary", "qe-quality-gate")
|
|
101
|
+
Task("Analyze cost trends", "Identify cost optimization opportunities", "qe-quality-gate")
|
|
102
|
+
|
|
103
|
+
TodoWrite({ todos: [
|
|
104
|
+
{content: "Fetch cost data from tracker", status: "in_progress", activeForm: "Fetching data"},
|
|
105
|
+
{content: "Calculate savings metrics", status: "in_progress", activeForm: "Calculating savings"},
|
|
106
|
+
{content: "Generate recommendations", status: "pending", activeForm: "Generating recommendations"},
|
|
107
|
+
{content: "Store report in memory", status: "pending", activeForm: "Storing report"}
|
|
108
|
+
]})
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Expected Outputs
|
|
112
|
+
|
|
113
|
+
### Text Format (Default)
|
|
114
|
+
|
|
115
|
+
```
|
|
116
|
+
Inference Cost Report
|
|
117
|
+
====================
|
|
118
|
+
|
|
119
|
+
Period: 2025-12-15T00:00:00Z to 2025-12-15T23:59:59Z
|
|
120
|
+
|
|
121
|
+
Overall Metrics:
|
|
122
|
+
Total Requests: 1,248
|
|
123
|
+
Total Tokens: 3,456,789
|
|
124
|
+
Total Cost: $5.2340
|
|
125
|
+
Requests/Hour: 52.0
|
|
126
|
+
Cost/Hour: $0.2181
|
|
127
|
+
|
|
128
|
+
Cost Savings Analysis:
|
|
129
|
+
Actual Cost: $5.2340
|
|
130
|
+
Cloud Baseline Cost: $18.7650
|
|
131
|
+
Total Savings: $13.5310 (72.1%)
|
|
132
|
+
Local Requests: 892 (71.5%)
|
|
133
|
+
Cloud Requests: 356 (28.5%)
|
|
134
|
+
|
|
135
|
+
By Provider:
|
|
136
|
+
🏠 ruvllm:
|
|
137
|
+
Requests: 892
|
|
138
|
+
Tokens: 2,234,567
|
|
139
|
+
Cost: $0.0000
|
|
140
|
+
Avg Cost/Request: $0.000000
|
|
141
|
+
Top Model: meta-llama/llama-3.1-8b-instruct
|
|
142
|
+
|
|
143
|
+
☁️ anthropic:
|
|
144
|
+
Requests: 245
|
|
145
|
+
Tokens: 891,234
|
|
146
|
+
Cost: $4.5678
|
|
147
|
+
Avg Cost/Request: $0.018644
|
|
148
|
+
Top Model: claude-sonnet-4-5-20250929
|
|
149
|
+
|
|
150
|
+
☁️ openrouter:
|
|
151
|
+
Requests: 111
|
|
152
|
+
Tokens: 330,988
|
|
153
|
+
Cost: $0.6662
|
|
154
|
+
Avg Cost/Request: $0.006002
|
|
155
|
+
Top Model: meta-llama/llama-3.1-70b-instruct
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
### JSON Format
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"timestamp": "2025-12-15T23:59:59Z",
|
|
163
|
+
"period": {
|
|
164
|
+
"start": "2025-12-15T00:00:00Z",
|
|
165
|
+
"end": "2025-12-15T23:59:59Z"
|
|
166
|
+
},
|
|
167
|
+
"overall": {
|
|
168
|
+
"totalRequests": 1248,
|
|
169
|
+
"totalTokens": 3456789,
|
|
170
|
+
"totalCost": 5.234,
|
|
171
|
+
"requestsPerHour": 52.0,
|
|
172
|
+
"costPerHour": 0.2181
|
|
173
|
+
},
|
|
174
|
+
"savings": {
|
|
175
|
+
"actualCost": 5.234,
|
|
176
|
+
"cloudBaselineCost": 18.765,
|
|
177
|
+
"totalSavings": 13.531,
|
|
178
|
+
"savingsPercentage": 72.1,
|
|
179
|
+
"localRequestPercentage": 71.5,
|
|
180
|
+
"cloudRequestPercentage": 28.5,
|
|
181
|
+
"localRequests": 892,
|
|
182
|
+
"cloudRequests": 356,
|
|
183
|
+
"totalRequests": 1248
|
|
184
|
+
},
|
|
185
|
+
"byProvider": {
|
|
186
|
+
"ruvllm": {
|
|
187
|
+
"provider": "ruvllm",
|
|
188
|
+
"providerType": "local",
|
|
189
|
+
"requestCount": 892,
|
|
190
|
+
"inputTokens": 1489711,
|
|
191
|
+
"outputTokens": 744856,
|
|
192
|
+
"totalTokens": 2234567,
|
|
193
|
+
"totalCost": 0,
|
|
194
|
+
"avgCostPerRequest": 0,
|
|
195
|
+
"topModel": "meta-llama/llama-3.1-8b-instruct",
|
|
196
|
+
"modelCounts": {
|
|
197
|
+
"meta-llama/llama-3.1-8b-instruct": 892
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"anthropic": {
|
|
201
|
+
"provider": "anthropic",
|
|
202
|
+
"providerType": "cloud",
|
|
203
|
+
"requestCount": 245,
|
|
204
|
+
"inputTokens": 594156,
|
|
205
|
+
"outputTokens": 297078,
|
|
206
|
+
"totalTokens": 891234,
|
|
207
|
+
"totalCost": 4.5678,
|
|
208
|
+
"avgCostPerRequest": 0.018644,
|
|
209
|
+
"topModel": "claude-sonnet-4-5-20250929",
|
|
210
|
+
"modelCounts": {
|
|
211
|
+
"claude-sonnet-4-5-20250929": 187,
|
|
212
|
+
"claude-3-5-haiku-20241022": 58
|
|
213
|
+
}
|
|
214
|
+
},
|
|
215
|
+
"openrouter": {
|
|
216
|
+
"provider": "openrouter",
|
|
217
|
+
"providerType": "cloud",
|
|
218
|
+
"requestCount": 111,
|
|
219
|
+
"inputTokens": 220659,
|
|
220
|
+
"outputTokens": 110329,
|
|
221
|
+
"totalTokens": 330988,
|
|
222
|
+
"totalCost": 0.6662,
|
|
223
|
+
"avgCostPerRequest": 0.006002,
|
|
224
|
+
"topModel": "meta-llama/llama-3.1-70b-instruct",
|
|
225
|
+
"modelCounts": {
|
|
226
|
+
"meta-llama/llama-3.1-70b-instruct": 111
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Detailed Format
|
|
234
|
+
|
|
235
|
+
```
|
|
236
|
+
Inference Cost Report (Detailed)
|
|
237
|
+
================================
|
|
238
|
+
|
|
239
|
+
Period: 2025-12-15T00:00:00Z to 2025-12-15T23:59:59Z
|
|
240
|
+
|
|
241
|
+
Recent Requests (Last 20):
|
|
242
|
+
|
|
243
|
+
[2025-12-15T23:58:45Z] ruvllm/meta-llama/llama-3.1-8b-instruct
|
|
244
|
+
Agent: qe-test-generator
|
|
245
|
+
Tokens: 1,234 input / 567 output = 1,801 total
|
|
246
|
+
Cost: $0.0000
|
|
247
|
+
|
|
248
|
+
[2025-12-15T23:57:23Z] anthropic/claude-sonnet-4-5-20250929
|
|
249
|
+
Agent: qe-quality-gate
|
|
250
|
+
Task: quality-check-456
|
|
251
|
+
Tokens: 3,456 input / 1,789 output = 5,245 total
|
|
252
|
+
Cost: $0.0372
|
|
253
|
+
|
|
254
|
+
[2025-12-15T23:56:12Z] ruvllm/meta-llama/llama-3.1-8b-instruct
|
|
255
|
+
Agent: qe-test-executor
|
|
256
|
+
Task: test-run-789
|
|
257
|
+
Tokens: 876 input / 432 output = 1,308 total
|
|
258
|
+
Cost: $0.0000
|
|
259
|
+
|
|
260
|
+
... (17 more)
|
|
261
|
+
|
|
262
|
+
Provider Summary:
|
|
263
|
+
🏠 Local (ruvllm, onnx): 892 requests (71.5%)
|
|
264
|
+
☁️ Cloud (anthropic, openrouter, openai): 356 requests (28.5%)
|
|
265
|
+
|
|
266
|
+
Cost Optimization Recommendations:
|
|
267
|
+
✓ Excellent local inference usage (71.5%)
|
|
268
|
+
✓ Saving $13.53 per day vs full cloud inference
|
|
269
|
+
💡 Consider migrating more quality-gate checks to local inference
|
|
270
|
+
💡 Estimated monthly savings: $405.93
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
## Memory Operations
|
|
274
|
+
|
|
275
|
+
### Input Memory Keys
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
# Retrieve stored cost data
|
|
279
|
+
npx claude-flow@alpha memory retrieve --key "aqe/costs/tracker-data"
|
|
280
|
+
|
|
281
|
+
# Retrieve previous cost reports
|
|
282
|
+
npx claude-flow@alpha memory retrieve --key "aqe/costs/reports/latest"
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Output Memory Keys
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
# Store cost report
|
|
289
|
+
npx claude-flow@alpha memory store \
|
|
290
|
+
--key "aqe/costs/reports/${timestamp}" \
|
|
291
|
+
--value '{"totalCost": 5.234, "savings": 13.531}'
|
|
292
|
+
|
|
293
|
+
# Store cost optimization recommendations
|
|
294
|
+
npx claude-flow@alpha memory store \
|
|
295
|
+
--key "aqe/costs/recommendations" \
|
|
296
|
+
--value '[{"action": "migrate-to-local", "potentialSavings": 13.53}]'
|
|
297
|
+
```
|
|
298
|
+
|
|
299
|
+
## Cost Tracking API
|
|
300
|
+
|
|
301
|
+
### Track Inference Request
|
|
302
|
+
|
|
303
|
+
```typescript
|
|
304
|
+
import { getInferenceCostTracker } from 'agentic-qe/core/metrics';
|
|
305
|
+
|
|
306
|
+
const tracker = getInferenceCostTracker();
|
|
307
|
+
|
|
308
|
+
// Track local inference (free)
|
|
309
|
+
tracker.trackRequest({
|
|
310
|
+
provider: 'ruvllm',
|
|
311
|
+
model: 'meta-llama/llama-3.1-8b-instruct',
|
|
312
|
+
tokens: {
|
|
313
|
+
inputTokens: 1000,
|
|
314
|
+
outputTokens: 500,
|
|
315
|
+
totalTokens: 1500,
|
|
316
|
+
},
|
|
317
|
+
agentId: 'qe-test-generator',
|
|
318
|
+
taskId: 'task-123',
|
|
319
|
+
});
|
|
320
|
+
|
|
321
|
+
// Track cloud inference
|
|
322
|
+
tracker.trackRequest({
|
|
323
|
+
provider: 'anthropic',
|
|
324
|
+
model: 'claude-sonnet-4-5-20250929',
|
|
325
|
+
tokens: {
|
|
326
|
+
inputTokens: 2000,
|
|
327
|
+
outputTokens: 1000,
|
|
328
|
+
totalTokens: 3000,
|
|
329
|
+
},
|
|
330
|
+
agentId: 'qe-quality-gate',
|
|
331
|
+
});
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Get Cost Report
|
|
335
|
+
|
|
336
|
+
```typescript
|
|
337
|
+
import { getInferenceCostTracker, formatCostReport } from 'agentic-qe/core/metrics';
|
|
338
|
+
|
|
339
|
+
const tracker = getInferenceCostTracker();
|
|
340
|
+
|
|
341
|
+
// Get report for last 24 hours
|
|
342
|
+
const report = tracker.getCostReport();
|
|
343
|
+
|
|
344
|
+
// Format as text
|
|
345
|
+
const textReport = formatCostReport(report);
|
|
346
|
+
console.log(textReport);
|
|
347
|
+
|
|
348
|
+
// Get savings
|
|
349
|
+
console.log(`Total savings: $${report.savings.totalSavings.toFixed(2)}`);
|
|
350
|
+
console.log(`Savings rate: ${report.savings.savingsPercentage.toFixed(1)}%`);
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
## Cost Optimization Strategies
|
|
354
|
+
|
|
355
|
+
### 1. Maximize Local Inference
|
|
356
|
+
|
|
357
|
+
Route routine tasks to local inference:
|
|
358
|
+
- Test generation with predictable patterns
|
|
359
|
+
- Coverage analysis
|
|
360
|
+
- Simple quality checks
|
|
361
|
+
|
|
362
|
+
**Potential Savings:** Up to 90% cost reduction
|
|
363
|
+
|
|
364
|
+
### 2. Use Cloud for Complex Tasks
|
|
365
|
+
|
|
366
|
+
Reserve cloud inference for:
|
|
367
|
+
- Security scanning requiring latest threat intelligence
|
|
368
|
+
- Complex quality gate decisions
|
|
369
|
+
- High-stakes production validations
|
|
370
|
+
|
|
371
|
+
**Balance:** Quality vs Cost
|
|
372
|
+
|
|
373
|
+
### 3. Hybrid Approach
|
|
374
|
+
|
|
375
|
+
Implement fallback strategy:
|
|
376
|
+
```javascript
|
|
377
|
+
// Try local first, fallback to cloud if needed
|
|
378
|
+
async function generateTests(spec) {
|
|
379
|
+
try {
|
|
380
|
+
return await localInference(spec);
|
|
381
|
+
} catch (err) {
|
|
382
|
+
return await cloudInference(spec);
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
**Result:** Optimal cost-quality balance
|
|
388
|
+
|
|
389
|
+
### 4. Monitor and Optimize
|
|
390
|
+
|
|
391
|
+
Regular cost reviews:
|
|
392
|
+
```bash
|
|
393
|
+
# Weekly review
|
|
394
|
+
aqe costs --period 7d --detailed
|
|
395
|
+
|
|
396
|
+
# Identify high-cost agents
|
|
397
|
+
# Migrate eligible workloads to local
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
**Target:** >70% local inference ratio
|
|
401
|
+
|
|
402
|
+
## Performance Characteristics
|
|
403
|
+
|
|
404
|
+
- **Time Complexity**: O(n) where n = number of tracked requests
|
|
405
|
+
- **Target Time**: <100ms for report generation
|
|
406
|
+
- **Memory Usage**: ~1KB per request (with TTL pruning)
|
|
407
|
+
- **Storage**: In-memory with 24-hour TTL (default)
|
|
408
|
+
- **Persistence**: Optional export to memory store
|
|
409
|
+
|
|
410
|
+
## Cost Estimation Models
|
|
411
|
+
|
|
412
|
+
### Local Inference (ruvllm, ONNX)
|
|
413
|
+
- **Cost**: $0.00 per token
|
|
414
|
+
- **Note**: Infrastructure costs (compute, storage) not included
|
|
415
|
+
|
|
416
|
+
### Cloud Inference
|
|
417
|
+
|
|
418
|
+
**Anthropic Claude Sonnet 4.5** (January 2025):
|
|
419
|
+
- Input: $3.00 per 1M tokens
|
|
420
|
+
- Output: $15.00 per 1M tokens
|
|
421
|
+
- Cache write: $3.75 per 1M tokens (25% premium)
|
|
422
|
+
- Cache read: $0.30 per 1M tokens (90% discount)
|
|
423
|
+
|
|
424
|
+
**OpenRouter** (99% savings vs Claude):
|
|
425
|
+
- Llama 3.1 8B: $0.03 input / $0.15 output per 1M tokens
|
|
426
|
+
- Llama 3.1 70B: $0.18 input / $0.90 output per 1M tokens
|
|
427
|
+
|
|
428
|
+
**OpenAI GPT-4 Turbo**:
|
|
429
|
+
- Input: $10.00 per 1M tokens
|
|
430
|
+
- Output: $30.00 per 1M tokens
|
|
431
|
+
|
|
432
|
+
## Use Cases
|
|
433
|
+
|
|
434
|
+
### Daily Cost Monitoring
|
|
435
|
+
```bash
|
|
436
|
+
aqe costs
|
|
437
|
+
# Quick check of daily costs and savings
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### Monthly Budget Review
|
|
441
|
+
```bash
|
|
442
|
+
aqe costs --period 30d --format json > monthly-costs.json
|
|
443
|
+
# Export for finance review
|
|
444
|
+
```
|
|
445
|
+
|
|
446
|
+
### Cost Optimization Analysis
|
|
447
|
+
```bash
|
|
448
|
+
aqe costs --detailed
|
|
449
|
+
# Identify high-cost agents and tasks for optimization
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### CI/CD Cost Tracking
|
|
453
|
+
```bash
|
|
454
|
+
aqe costs --period 1h --format json
|
|
455
|
+
# Track costs per CI/CD pipeline run
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
## Error Handling
|
|
459
|
+
|
|
460
|
+
### No Data Available
|
|
461
|
+
|
|
462
|
+
```bash
|
|
463
|
+
⚠️ No inference requests tracked in the specified period.
|
|
464
|
+
|
|
465
|
+
Use 'aqe costs --period all' to see all-time data.
|
|
466
|
+
```
|
|
467
|
+
|
|
468
|
+
**Solution:** Inference tracking may need to be enabled.
|
|
469
|
+
|
|
470
|
+
### Invalid Period
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
❌ Error: Invalid period '5y'
|
|
474
|
+
|
|
475
|
+
Valid periods: 1h, 24h, 7d, 30d, all
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
**Solution:** Use a supported time period.
|
|
479
|
+
|
|
480
|
+
### Provider Not Found
|
|
481
|
+
|
|
482
|
+
```bash
|
|
483
|
+
⚠️ Warning: No requests found for provider 'unknown'
|
|
484
|
+
|
|
485
|
+
Available providers: ruvllm, anthropic, openrouter, openai, onnx
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
**Solution:** Check provider name spelling.
|
|
489
|
+
|
|
490
|
+
## Integration with Other Commands
|
|
491
|
+
|
|
492
|
+
- `/aqe-fleet-status` - View agent status with cost attribution
|
|
493
|
+
- `/aqe-execute` - Track execution costs
|
|
494
|
+
- `/aqe-generate` - Track generation costs
|
|
495
|
+
- `/aqe-report` - Include cost analysis in quality reports
|
|
496
|
+
|
|
497
|
+
## Privacy and Security
|
|
498
|
+
|
|
499
|
+
- **No PII**: Cost data contains no prompt content or sensitive information
|
|
500
|
+
- **Aggregated Only**: Individual request details stored in memory only
|
|
501
|
+
- **TTL Protection**: Data automatically expires after retention period
|
|
502
|
+
- **Local Storage**: All data stored in local memory, not sent externally
|
|
503
|
+
|
|
504
|
+
## See Also
|
|
505
|
+
|
|
506
|
+
- `/aqe-fleet-status` - Fleet health and status
|
|
507
|
+
- `/aqe-report` - Quality reports
|
|
508
|
+
- `/aqe-benchmark` - Performance benchmarking
|
|
509
|
+
- [Pricing Configuration](../../src/telemetry/metrics/collectors/pricing-config.ts)
|
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,78 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [2.5.5] - 2025-12-15
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
#### SONA Lifecycle Integration (Issue #144)
|
|
15
|
+
Complete Sleep-Optimized Neural Architecture integration with Agent Registry for seamless memory coordination.
|
|
16
|
+
|
|
17
|
+
- **SONALifecycleManager** (`src/core/learning/SONALifecycleManager.ts`) - 717 lines
|
|
18
|
+
- Automatic lifecycle hooks: `onAgentSpawn`, `onTaskComplete`, `cleanupAgent`
|
|
19
|
+
- Real-time experience capture from agent task completions
|
|
20
|
+
- Memory consolidation triggers during agent cleanup
|
|
21
|
+
- Integration with AgentRegistry for fleet-wide coordination
|
|
22
|
+
- 56 unit tests + 16 integration tests (72 total tests)
|
|
23
|
+
|
|
24
|
+
- **Inference Cost Tracking** (`src/core/metrics/InferenceCostTracker.ts`) - 679 lines
|
|
25
|
+
- Track local vs cloud inference costs in real-time
|
|
26
|
+
- Support for multiple providers: ruvllm, anthropic, openrouter, openai, onnx
|
|
27
|
+
- Cost savings analysis comparing local inference to cloud baseline
|
|
28
|
+
- Multi-format reporting (text, JSON) with provider breakdown
|
|
29
|
+
- 30 unit tests with comprehensive coverage
|
|
30
|
+
|
|
31
|
+
- **AdaptiveModelRouter Local Routing**
|
|
32
|
+
- Local model preference for routine tasks via RuvLLM
|
|
33
|
+
- Intelligent routing: local for simple tasks, cloud for complex
|
|
34
|
+
- Fallback cascade: ruvllm → openrouter → anthropic
|
|
35
|
+
- Cost optimization targeting 70%+ local inference
|
|
36
|
+
|
|
37
|
+
### Fixed
|
|
38
|
+
|
|
39
|
+
- **Video Vision Analyzer** - Fixed multimodal analysis pipeline
|
|
40
|
+
- Corrected frame extraction and analysis workflow
|
|
41
|
+
- Improved accessibility caption generation
|
|
42
|
+
|
|
43
|
+
- **MCP Handler Tests** (Issue #39) - 36 files, 647+ lines
|
|
44
|
+
- Fixed flaky tests in coordination handlers
|
|
45
|
+
- Stabilized workflow-create, workflow-execute, event-emit tests
|
|
46
|
+
- Improved test isolation and cleanup
|
|
47
|
+
|
|
48
|
+
### Technical Details
|
|
49
|
+
|
|
50
|
+
**Database Schema**:
|
|
51
|
+
- `learning_experiences` - Agent task outcomes with rewards
|
|
52
|
+
- `q_values` - Reinforcement learning state-action values
|
|
53
|
+
- `events` - System events for pattern analysis
|
|
54
|
+
- `dream_cycles` - Nightly consolidation records
|
|
55
|
+
- `synthesized_patterns` - Cross-agent pattern extraction
|
|
56
|
+
|
|
57
|
+
**Verified Integration**:
|
|
58
|
+
- Real agent execution proof: Database entry ID 563
|
|
59
|
+
- Q-value updates from task orchestration
|
|
60
|
+
- Event emission for agent lifecycle tracking
|
|
61
|
+
|
|
62
|
+
### Testing
|
|
63
|
+
|
|
64
|
+
- 102 new tests total (56 + 30 + 16)
|
|
65
|
+
- All new code tests passing
|
|
66
|
+
- Regression suite: 55 passed, 5 skipped (pre-existing issues)
|
|
67
|
+
|
|
68
|
+
## [2.5.4] - 2025-12-15
|
|
69
|
+
|
|
70
|
+
### Fixed
|
|
71
|
+
|
|
72
|
+
- **Security Alert #41: Incomplete Multi-Character Sanitization** - WebVTT generator security fix
|
|
73
|
+
- HTML tag sanitization now applies repeatedly until no more changes occur
|
|
74
|
+
- Prevents bypass with nested tags like `<<script>script>`
|
|
75
|
+
- Fixes CWE-1333 incomplete multi-character sanitization vulnerability
|
|
76
|
+
|
|
77
|
+
- **Flaky Test: test-execution.test.ts Retry Test** - CI stability fix
|
|
78
|
+
- Root cause: Mock called original implementation which uses 90% random success rate
|
|
79
|
+
- Fix: Return deterministic "passed" result instead of random-based simulation
|
|
80
|
+
- Eliminates ~10% random failure rate that required CI workflow re-runs
|
|
81
|
+
|
|
10
82
|
## [2.5.3] - 2025-12-15
|
|
11
83
|
|
|
12
84
|
### Fixed
|
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<img alt="NPM Downloads" src="https://img.shields.io/npm/dw/agentic-qe">
|
|
10
10
|
|
|
11
11
|
|
|
12
|
-
**Version 2.5.
|
|
12
|
+
**Version 2.5.5** | [Changelog](CHANGELOG.md) | [Contributors](CONTRIBUTORS.md) | [Issues](https://github.com/proffesor-for-testing/agentic-qe/issues) | [Discussions](https://github.com/proffesor-for-testing/agentic-qe/discussions)
|
|
13
13
|
|
|
14
14
|
> AI-powered test automation that learns from every task, switches between 300+ AI models on-the-fly, scores code testability, visualizes agent activity in real-time, and improves autonomously overnight — with built-in safety guardrails and full observability.
|
|
15
15
|
|