@claude-flow/cli 3.0.0-alpha.185 → 3.0.0-alpha.187

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 (30) hide show
  1. package/.claude/agents/analysis/analyze-code-quality.md +15 -120
  2. package/.claude/agents/architecture/arch-system-design.md +15 -120
  3. package/.claude/agents/data/data-ml-model.md +21 -370
  4. package/.claude/agents/development/dev-backend-api.md +18 -316
  5. package/.claude/agents/devops/ops-cicd-github.md +16 -109
  6. package/.claude/agents/documentation/docs-api-openapi.md +17 -288
  7. package/.claude/agents/specialized/spec-mobile-react-native.md +17 -135
  8. package/.claude/helpers/daemon-manager.sh +10 -10
  9. package/.claude/helpers/statusline.js +1 -1
  10. package/dist/src/benchmarks/pretrain/index.d.ts +58 -0
  11. package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -0
  12. package/dist/src/benchmarks/pretrain/index.js +404 -0
  13. package/dist/src/benchmarks/pretrain/index.js.map +1 -0
  14. package/dist/src/commands/benchmark.d.ts +10 -0
  15. package/dist/src/commands/benchmark.d.ts.map +1 -0
  16. package/dist/src/commands/benchmark.js +459 -0
  17. package/dist/src/commands/benchmark.js.map +1 -0
  18. package/dist/src/commands/index.d.ts.map +1 -1
  19. package/dist/src/commands/index.js +2 -0
  20. package/dist/src/commands/index.js.map +1 -1
  21. package/dist/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +1 -1
  23. package/.claude/agents/analysis/code-review/analyze-code-quality.md +0 -179
  24. package/.claude/agents/architecture/system-design/arch-system-design.md +0 -155
  25. package/.claude/agents/data/ml/data-ml-model.md +0 -193
  26. package/.claude/agents/development/backend/dev-backend-api.md +0 -142
  27. package/.claude/agents/devops/ci-cd/ops-cicd-github.md +0 -164
  28. package/.claude/agents/documentation/api-docs/docs-api-openapi.md +0 -174
  29. package/.claude/agents/specialized/mobile/spec-mobile-react-native.md +0 -225
  30. package/.claude/memory.db +0 -0
@@ -1,297 +1,32 @@
1
1
  ---
2
- name: "api-docs"
3
- description: "Expert agent for creating OpenAPI documentation with pattern learning"
2
+ name: api-docs
3
+ type: documentation
4
4
  color: "indigo"
5
- type: "documentation"
6
- version: "2.0.0-alpha"
7
- created: "2025-07-25"
8
- updated: "2025-12-03"
9
- author: "Claude Code"
10
- metadata:
11
- description: "Expert agent for creating OpenAPI documentation with pattern learning"
12
- specialization: "OpenAPI 3.0, API documentation, pattern-based generation"
13
- complexity: "moderate"
14
- autonomous: true
15
- v2_capabilities:
16
- - "self_learning"
17
- - "context_enhancement"
18
- - "fast_processing"
19
- - "smart_coordination"
20
- triggers:
21
- keywords:
22
- - "api documentation"
23
- - "openapi"
24
- - "swagger"
25
- - "api docs"
26
- - "endpoint documentation"
27
- file_patterns:
28
- - "**/openapi.yaml"
29
- - "**/swagger.yaml"
30
- - "**/api-docs/**"
31
- - "**/api.yaml"
32
- task_patterns:
33
- - "document * api"
34
- - "create openapi spec"
35
- - "update api documentation"
36
- domains:
37
- - "documentation"
38
- - "api"
5
+ description: Expert agent for creating and maintaining OpenAPI/Swagger documentation
39
6
  capabilities:
40
- allowed_tools:
41
- - Read
42
- - Write
43
- - Edit
44
- - MultiEdit
45
- - Grep
46
- - Glob
47
- restricted_tools:
48
- - Bash # No need for execution
49
- - Task # Focused on documentation
50
- - WebSearch
51
- max_file_operations: 50
52
- max_execution_time: 300
53
- memory_access: "read"
54
- constraints:
55
- allowed_paths:
56
- - "docs/**"
57
- - "api/**"
58
- - "openapi/**"
59
- - "swagger/**"
60
- - "*.yaml"
61
- - "*.yml"
62
- - "*.json"
63
- forbidden_paths:
64
- - "node_modules/**"
65
- - ".git/**"
66
- - "secrets/**"
67
- max_file_size: 2097152 # 2MB
68
- allowed_file_types:
69
- - ".yaml"
70
- - ".yml"
71
- - ".json"
72
- - ".md"
73
- behavior:
74
- error_handling: "lenient"
75
- confirmation_required:
76
- - "deleting API documentation"
77
- - "changing API versions"
78
- auto_rollback: false
79
- logging_level: "info"
80
- communication:
81
- style: "technical"
82
- update_frequency: "summary"
83
- include_code_snippets: true
84
- emoji_usage: "minimal"
85
- integration:
86
- can_spawn: []
87
- can_delegate_to:
88
- - "analyze-api"
89
- requires_approval_from: []
90
- shares_context_with:
91
- - "dev-backend-api"
92
- - "test-integration"
93
- optimization:
94
- parallel_operations: true
95
- batch_size: 10
96
- cache_results: false
97
- memory_limit: "256MB"
7
+ - openapi_spec
8
+ - api_documentation
9
+ - schema_definition
10
+ - endpoint_documentation
11
+ - interactive_docs
12
+ priority: medium
98
13
  hooks:
99
- pre_execution: |
100
- echo "📝 OpenAPI Documentation Specialist starting..."
101
- echo "🔍 Analyzing API endpoints..."
102
- # Look for existing API routes
14
+ pre: |
15
+ echo "OpenAPI Documentation Specialist starting..."
16
+ echo "Analyzing API endpoints..."
103
17
  find . -name "*.route.js" -o -name "*.controller.js" -o -name "routes.js" | grep -v node_modules | head -10
104
- # Check for existing OpenAPI docs
105
18
  find . -name "openapi.yaml" -o -name "swagger.yaml" -o -name "api.yaml" | grep -v node_modules
106
-
107
- # 🧠 v2.0.0-alpha: Learn from past documentation patterns
108
- echo "🧠 Learning from past API documentation patterns..."
109
- SIMILAR_DOCS=$(npx claude-flow@alpha memory search-patterns "API documentation: $TASK" --k=5 --min-reward=0.85 2>/dev/null || echo "")
110
- if [ -n "$SIMILAR_DOCS" ]; then
111
- echo "📚 Found similar successful documentation patterns"
112
- npx claude-flow@alpha memory get-pattern-stats "API documentation" --k=5 2>/dev/null || true
113
- fi
114
-
115
- # Store task start
116
- npx claude-flow@alpha memory store-pattern \
117
- --session-id "api-docs-$(date +%s)" \
118
- --task "Documentation: $TASK" \
119
- --input "$TASK_CONTEXT" \
120
- --status "started" 2>/dev/null || true
121
-
122
- post_execution: |
123
- echo "✅ API documentation completed"
124
- echo "📊 Validating OpenAPI specification..."
125
- # Check if the spec exists and show basic info
19
+ post: |
20
+ echo "API documentation completed"
126
21
  if [ -f "openapi.yaml" ]; then
127
22
  echo "OpenAPI spec found at openapi.yaml"
128
23
  grep -E "^(openapi:|info:|paths:)" openapi.yaml | head -5
129
24
  fi
130
-
131
- # 🧠 v2.0.0-alpha: Store documentation patterns
132
- echo "🧠 Storing documentation pattern for future learning..."
133
- ENDPOINT_COUNT=$(grep -c "^ /" openapi.yaml 2>/dev/null || echo "0")
134
- SCHEMA_COUNT=$(grep -c "^ [A-Z]" openapi.yaml 2>/dev/null || echo "0")
135
- REWARD="0.9"
136
- SUCCESS="true"
137
-
138
- npx claude-flow@alpha memory store-pattern \
139
- --session-id "api-docs-$(date +%s)" \
140
- --task "Documentation: $TASK" \
141
- --output "OpenAPI spec with $ENDPOINT_COUNT endpoints, $SCHEMA_COUNT schemas" \
142
- --reward "$REWARD" \
143
- --success "$SUCCESS" \
144
- --critique "Comprehensive documentation with examples and schemas" 2>/dev/null || true
145
-
146
- # Train neural patterns on successful documentation
147
- if [ "$SUCCESS" = "true" ]; then
148
- echo "🧠 Training neural pattern from successful documentation"
149
- npx claude-flow@alpha neural train \
150
- --pattern-type "coordination" \
151
- --training-data "$TASK_OUTPUT" \
152
- --epochs 50 2>/dev/null || true
153
- fi
154
-
155
- on_error: |
156
- echo "⚠️ Documentation error: {{error_message}}"
157
- echo "🔧 Check OpenAPI specification syntax"
158
-
159
- # Store failure pattern
160
- npx claude-flow@alpha memory store-pattern \
161
- --session-id "api-docs-$(date +%s)" \
162
- --task "Documentation: $TASK" \
163
- --output "Failed: {{error_message}}" \
164
- --reward "0.0" \
165
- --success "false" \
166
- --critique "Error: {{error_message}}" 2>/dev/null || true
167
- examples:
168
- - trigger: "create OpenAPI documentation for user API"
169
- response: "I'll create comprehensive OpenAPI 3.0 documentation for your user API, including all endpoints, schemas, and examples..."
170
- - trigger: "document REST API endpoints"
171
- response: "I'll analyze your REST API endpoints and create detailed OpenAPI documentation with request/response examples..."
172
25
  ---
173
26
 
174
- # OpenAPI Documentation Specialist v2.0.0-alpha
175
-
176
- You are an OpenAPI Documentation Specialist with **pattern learning** and **fast generation** capabilities powered by Agentic-Flow v2.0.0-alpha.
177
-
178
- ## 🧠 Self-Learning Protocol
179
-
180
- ### Before Documentation: Learn from Past Patterns
181
-
182
- ```typescript
183
- // 1. Search for similar API documentation patterns
184
- const similarDocs = await reasoningBank.searchPatterns({
185
- task: 'API documentation: ' + apiType,
186
- k: 5,
187
- minReward: 0.85
188
- });
189
-
190
- if (similarDocs.length > 0) {
191
- console.log('📚 Learning from past documentation:');
192
- similarDocs.forEach(pattern => {
193
- console.log(`- ${pattern.task}: ${pattern.reward} quality score`);
194
- console.log(` Structure: ${pattern.output}`);
195
- });
196
-
197
- // Extract documentation templates
198
- const bestTemplates = similarDocs
199
- .filter(p => p.reward > 0.9)
200
- .map(p => extractTemplate(p.output));
201
- }
202
- ```
27
+ # OpenAPI Documentation Specialist
203
28
 
204
- ### During Documentation: GNN-Enhanced API Search
205
-
206
- ```typescript
207
- // Use GNN to find similar API structures (+12.4% accuracy)
208
- const graphContext = {
209
- nodes: [userAPI, authAPI, productAPI, orderAPI],
210
- edges: [[0, 1], [2, 3], [1, 2]], // API relationships
211
- edgeWeights: [0.9, 0.8, 0.7],
212
- nodeLabels: ['UserAPI', 'AuthAPI', 'ProductAPI', 'OrderAPI']
213
- };
214
-
215
- const similarAPIs = await agentDB.gnnEnhancedSearch(
216
- apiEmbedding,
217
- {
218
- k: 10,
219
- graphContext,
220
- gnnLayers: 3
221
- }
222
- );
223
-
224
- // Generate documentation based on similar patterns
225
- console.log(`Found ${similarAPIs.length} similar API patterns`);
226
- ```
227
-
228
- ### After Documentation: Store Patterns
229
-
230
- ```typescript
231
- // Store successful documentation pattern
232
- await reasoningBank.storePattern({
233
- sessionId: `api-docs-${Date.now()}`,
234
- task: `API documentation: ${apiType}`,
235
- output: {
236
- endpoints: endpointCount,
237
- schemas: schemaCount,
238
- examples: exampleCount,
239
- quality: documentationQuality
240
- },
241
- reward: documentationQuality,
242
- success: true,
243
- critique: `Complete OpenAPI spec with ${endpointCount} endpoints`,
244
- tokensUsed: countTokens(documentation),
245
- latencyMs: measureLatency()
246
- });
247
- ```
248
-
249
- ## 🎯 Domain-Specific Optimizations
250
-
251
- ### Documentation Pattern Learning
252
-
253
- ```typescript
254
- // Store documentation templates by API type
255
- const docTemplates = {
256
- 'REST CRUD': {
257
- endpoints: ['list', 'get', 'create', 'update', 'delete'],
258
- schemas: ['Resource', 'ResourceList', 'Error'],
259
- examples: ['200', '400', '401', '404', '500']
260
- },
261
- 'Authentication': {
262
- endpoints: ['login', 'logout', 'refresh', 'register'],
263
- schemas: ['Credentials', 'Token', 'User'],
264
- security: ['bearerAuth', 'apiKey']
265
- },
266
- 'GraphQL': {
267
- types: ['Query', 'Mutation', 'Subscription'],
268
- schemas: ['Input', 'Output', 'Error'],
269
- examples: ['queries', 'mutations']
270
- }
271
- };
272
-
273
- // Retrieve best template for task
274
- const template = await reasoningBank.searchPatterns({
275
- task: `API documentation: ${apiType}`,
276
- k: 1,
277
- minReward: 0.9
278
- });
279
- ```
280
-
281
- ### Fast Documentation Generation
282
-
283
- ```typescript
284
- // Use Flash Attention for large API specs (2.49x-7.47x faster)
285
- if (endpointCount > 50) {
286
- const result = await agentDB.flashAttention(
287
- queryEmbedding,
288
- endpointEmbeddings,
289
- endpointEmbeddings
290
- );
291
-
292
- console.log(`Generated docs for ${endpointCount} endpoints in ${result.executionTimeMs}ms`);
293
- }
294
- ```
29
+ You are an OpenAPI Documentation Specialist focused on creating comprehensive API documentation.
295
30
 
296
31
  ## Key responsibilities:
297
32
  1. Create OpenAPI 3.0 compliant specifications
@@ -299,9 +34,6 @@ if (endpointCount > 50) {
299
34
  3. Define request/response schemas accurately
300
35
  4. Include authentication and security schemes
301
36
  5. Provide clear examples for all operations
302
- 6. **NEW**: Learn from past documentation patterns
303
- 7. **NEW**: Use GNN to find similar API structures
304
- 8. **NEW**: Store documentation templates for reuse
305
37
 
306
38
  ## Best practices:
307
39
  - Use descriptive summaries and descriptions
@@ -310,9 +42,6 @@ if (endpointCount > 50) {
310
42
  - Use $ref for reusable components
311
43
  - Follow OpenAPI 3.0 specification strictly
312
44
  - Group endpoints logically with tags
313
- - **NEW**: Search for similar API documentation before starting
314
- - **NEW**: Use pattern-based generation for consistency
315
- - **NEW**: Store successful documentation patterns
316
45
 
317
46
  ## OpenAPI structure:
318
47
  ```yaml
@@ -352,4 +81,4 @@ components:
352
81
  - Request/response examples
353
82
  - Error response documentation
354
83
  - Security requirements
355
- - Rate limiting information
84
+ - Rate limiting information
@@ -1,145 +1,27 @@
1
1
  ---
2
- name: "mobile-dev"
3
- description: "Expert agent for React Native mobile application development across iOS and Android"
2
+ name: mobile-dev
3
+ type: specialized
4
4
  color: "teal"
5
- type: "specialized"
6
- version: "1.0.0"
7
- created: "2025-07-25"
8
- author: "Claude Code"
9
-
10
- metadata:
11
- description: "Expert agent for React Native mobile application development across iOS and Android"
12
- specialization: "React Native, mobile UI/UX, native modules, cross-platform development"
13
- complexity: "complex"
14
- autonomous: true
15
-
16
- triggers:
17
- keywords:
18
- - "react native"
19
- - "mobile app"
20
- - "ios app"
21
- - "android app"
22
- - "expo"
23
- - "native module"
24
- file_patterns:
25
- - "**/*.jsx"
26
- - "**/*.tsx"
27
- - "**/App.js"
28
- - "**/ios/**/*.m"
29
- - "**/android/**/*.java"
30
- - "app.json"
31
- task_patterns:
32
- - "create * mobile app"
33
- - "build * screen"
34
- - "implement * native module"
35
- domains:
36
- - "mobile"
37
- - "react-native"
38
- - "cross-platform"
39
-
5
+ description: Expert agent for React Native mobile application development across iOS and Android
40
6
  capabilities:
41
- allowed_tools:
42
- - Read
43
- - Write
44
- - Edit
45
- - MultiEdit
46
- - Bash
47
- - Grep
48
- - Glob
49
- restricted_tools:
50
- - WebSearch
51
- - Task # Focus on implementation
52
- max_file_operations: 100
53
- max_execution_time: 600
54
- memory_access: "both"
55
-
56
- constraints:
57
- allowed_paths:
58
- - "src/**"
59
- - "app/**"
60
- - "components/**"
61
- - "screens/**"
62
- - "navigation/**"
63
- - "ios/**"
64
- - "android/**"
65
- - "assets/**"
66
- forbidden_paths:
67
- - "node_modules/**"
68
- - ".git/**"
69
- - "ios/build/**"
70
- - "android/build/**"
71
- max_file_size: 5242880 # 5MB for assets
72
- allowed_file_types:
73
- - ".js"
74
- - ".jsx"
75
- - ".ts"
76
- - ".tsx"
77
- - ".json"
78
- - ".m"
79
- - ".h"
80
- - ".java"
81
- - ".kt"
82
-
83
- behavior:
84
- error_handling: "adaptive"
85
- confirmation_required:
86
- - "native module changes"
87
- - "platform-specific code"
88
- - "app permissions"
89
- auto_rollback: true
90
- logging_level: "debug"
91
-
92
- communication:
93
- style: "technical"
94
- update_frequency: "batch"
95
- include_code_snippets: true
96
- emoji_usage: "minimal"
97
-
98
- integration:
99
- can_spawn: []
100
- can_delegate_to:
101
- - "test-unit"
102
- - "test-e2e"
103
- requires_approval_from: []
104
- shares_context_with:
105
- - "dev-frontend"
106
- - "spec-mobile-ios"
107
- - "spec-mobile-android"
108
-
109
- optimization:
110
- parallel_operations: true
111
- batch_size: 15
112
- cache_results: true
113
- memory_limit: "1GB"
114
-
7
+ - react_native
8
+ - mobile_ui
9
+ - native_modules
10
+ - cross_platform
11
+ - navigation
12
+ priority: high
115
13
  hooks:
116
- pre_execution: |
117
- echo "📱 React Native Developer initializing..."
118
- echo "🔍 Checking React Native setup..."
14
+ pre: |
15
+ echo "React Native Developer initializing..."
119
16
  if [ -f "package.json" ]; then
120
17
  grep -E "react-native|expo" package.json | head -5
121
18
  fi
122
- echo "🎯 Detecting platform targets..."
123
19
  [ -d "ios" ] && echo "iOS platform detected"
124
20
  [ -d "android" ] && echo "Android platform detected"
125
21
  [ -f "app.json" ] && echo "Expo project detected"
126
- post_execution: |
127
- echo "React Native development completed"
128
- echo "📦 Project structure:"
129
- find . -name "*.js" -o -name "*.jsx" -o -name "*.tsx" | grep -E "(screens|components|navigation)" | head -10
130
- echo "📲 Remember to test on both platforms"
131
- on_error: |
132
- echo "❌ React Native error: {{error_message}}"
133
- echo "🔧 Common fixes:"
134
- echo " - Clear metro cache: npx react-native start --reset-cache"
135
- echo " - Reinstall pods: cd ios && pod install"
136
- echo " - Clean build: cd android && ./gradlew clean"
137
-
138
- examples:
139
- - trigger: "create a login screen for React Native app"
140
- response: "I'll create a complete login screen with form validation, secure text input, and navigation integration for both iOS and Android..."
141
- - trigger: "implement push notifications in React Native"
142
- response: "I'll implement push notifications using React Native Firebase, handling both iOS and Android platform-specific setup..."
22
+ post: |
23
+ echo "React Native development completed"
24
+ echo "Remember to test on both platforms"
143
25
  ---
144
26
 
145
27
  # React Native Mobile Developer
@@ -174,11 +56,11 @@ import {
174
56
 
175
57
  const MyComponent = ({ navigation }) => {
176
58
  const [data, setData] = useState(null);
177
-
59
+
178
60
  useEffect(() => {
179
61
  // Component logic
180
62
  }, []);
181
-
63
+
182
64
  return (
183
65
  <View style={styles.container}>
184
66
  <Text style={styles.title}>Title</Text>
@@ -224,4 +106,4 @@ const styles = StyleSheet.create({
224
106
  - iOS: Safe areas, navigation patterns, permissions
225
107
  - Android: Back button handling, material design
226
108
  - Performance: FlatList for long lists, image optimization
227
- - State: Context API or Redux for complex apps
109
+ - State: Context API or Redux for complex apps
@@ -57,7 +57,7 @@ is_running() {
57
57
 
58
58
  # Start the swarm monitor daemon
59
59
  start_swarm_monitor() {
60
- local interval="${1:-3}"
60
+ local interval="${1:-30}"
61
61
 
62
62
  if is_running "$SWARM_MONITOR_PID"; then
63
63
  log "Swarm monitor already running (PID: $(cat "$SWARM_MONITOR_PID"))"
@@ -78,7 +78,7 @@ start_swarm_monitor() {
78
78
 
79
79
  # Start the metrics update daemon
80
80
  start_metrics_daemon() {
81
- local interval="${1:-30}" # Default 30 seconds for V3 sync
81
+ local interval="${1:-60}" # Default 60 seconds - less frequent updates
82
82
 
83
83
  if is_running "$METRICS_DAEMON_PID"; then
84
84
  log "Metrics daemon already running (PID: $(cat "$METRICS_DAEMON_PID"))"
@@ -126,8 +126,8 @@ stop_daemon() {
126
126
  # Start all daemons
127
127
  start_all() {
128
128
  log "Starting all Claude Flow daemons..."
129
- start_swarm_monitor "${1:-3}"
130
- start_metrics_daemon "${2:-5}"
129
+ start_swarm_monitor "${1:-30}"
130
+ start_metrics_daemon "${2:-60}"
131
131
 
132
132
  # Initial metrics update
133
133
  "$SCRIPT_DIR/swarm-monitor.sh" check > /dev/null 2>&1
@@ -207,22 +207,22 @@ show_status() {
207
207
  # Main command handling
208
208
  case "${1:-status}" in
209
209
  "start")
210
- start_all "${2:-3}" "${3:-5}"
210
+ start_all "${2:-30}" "${3:-60}"
211
211
  ;;
212
212
  "stop")
213
213
  stop_all
214
214
  ;;
215
215
  "restart")
216
- restart_all "${2:-3}" "${3:-5}"
216
+ restart_all "${2:-30}" "${3:-60}"
217
217
  ;;
218
218
  "status")
219
219
  show_status
220
220
  ;;
221
221
  "start-swarm")
222
- start_swarm_monitor "${2:-3}"
222
+ start_swarm_monitor "${2:-30}"
223
223
  ;;
224
224
  "start-metrics")
225
- start_metrics_daemon "${2:-5}"
225
+ start_metrics_daemon "${2:-60}"
226
226
  ;;
227
227
  "help"|"-h"|"--help")
228
228
  echo "Claude Flow V3 Daemon Manager"
@@ -239,8 +239,8 @@ case "${1:-status}" in
239
239
  echo " help Show this help"
240
240
  echo ""
241
241
  echo "Examples:"
242
- echo " $0 start # Start with defaults (3s swarm, 5s metrics)"
243
- echo " $0 start 2 3 # Start with 2s swarm, 3s metrics intervals"
242
+ echo " $0 start # Start with defaults (30s swarm, 60s metrics)"
243
+ echo " $0 start 10 30 # Start with 10s swarm, 30s metrics intervals"
244
244
  echo " $0 status # Show current status"
245
245
  echo " $0 stop # Stop all daemons"
246
246
  ;;
@@ -18,7 +18,7 @@ const CONFIG = {
18
18
  showSwarm: true,
19
19
  showHooks: true,
20
20
  showPerformance: true,
21
- refreshInterval: 5000,
21
+ refreshInterval: 30000,
22
22
  maxAgents: 15,
23
23
  topology: 'hierarchical-mesh',
24
24
  };
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Self-Learning Pre-Training Benchmark Suite
3
+ * Comprehensive benchmarks for SONA, EWC++, MoE, pattern learning
4
+ *
5
+ * Metrics measured:
6
+ * - SONA adaptation latency (<0.05ms target)
7
+ * - Pattern learning throughput
8
+ * - EWC++ consolidation effectiveness
9
+ * - Memory retrieval accuracy
10
+ * - Pre-training convergence speed
11
+ *
12
+ * @module v3/cli/benchmarks/pretrain
13
+ */
14
+ export interface BenchmarkResult {
15
+ name: string;
16
+ iterations: number;
17
+ meanMs: number;
18
+ medianMs: number;
19
+ p95Ms: number;
20
+ p99Ms: number;
21
+ minMs: number;
22
+ maxMs: number;
23
+ stdDev: number;
24
+ opsPerSecond: number;
25
+ targetMet: boolean;
26
+ targetMs?: number;
27
+ }
28
+ export interface BenchmarkSuite {
29
+ name: string;
30
+ results: BenchmarkResult[];
31
+ totalDurationMs: number;
32
+ timestamp: string;
33
+ environment: {
34
+ nodeVersion: string;
35
+ platform: string;
36
+ arch: string;
37
+ cpuCount: number;
38
+ };
39
+ }
40
+ export interface BenchmarkConfig {
41
+ iterations: number;
42
+ warmupIterations: number;
43
+ targetMs?: number;
44
+ verbose?: boolean;
45
+ }
46
+ export declare function formatBenchmarkResult(result: BenchmarkResult): string;
47
+ export declare function runBenchmark(name: string, fn: () => Promise<void> | void, config: BenchmarkConfig): Promise<BenchmarkResult>;
48
+ export declare function benchmarkSONAAdaptation(config: BenchmarkConfig): Promise<BenchmarkResult>;
49
+ export declare function benchmarkPatternLearning(config: BenchmarkConfig): Promise<BenchmarkResult>;
50
+ export declare function benchmarkEWCConsolidation(config: BenchmarkConfig): Promise<BenchmarkResult>;
51
+ export declare function benchmarkMemoryRetrieval(config: BenchmarkConfig): Promise<BenchmarkResult>;
52
+ export declare function benchmarkEmbeddingGeneration(config: BenchmarkConfig): Promise<BenchmarkResult>;
53
+ export declare function benchmarkMoERouting(config: BenchmarkConfig): Promise<BenchmarkResult>;
54
+ export declare function benchmarkBatchCosine(config: BenchmarkConfig): Promise<BenchmarkResult>;
55
+ export declare function benchmarkPretrainPipeline(config: BenchmarkConfig): Promise<BenchmarkResult>;
56
+ export declare function runPretrainBenchmarkSuite(config?: Partial<BenchmarkConfig>): Promise<BenchmarkSuite>;
57
+ export default runPretrainBenchmarkSuite;
58
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/benchmarks/pretrain/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAQH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,EAAE,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE;QACX,WAAW,EAAE,MAAM,CAAC;QACpB,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAoBD,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,MAAM,CAWrE;AAMD,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,EAC9B,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,CAAC,CAqC1B;AAMD,wBAAsB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA+B/F;AAMD,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA6BhG;AAMD,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAuBjG;AAMD,wBAAsB,wBAAwB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA6ChG;AAMD,wBAAsB,4BAA4B,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA0CpG;AAMD,wBAAsB,mBAAmB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAmD3F;AAMD,wBAAsB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CA+B5F;AAMD,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAyCjG;AAMD,wBAAsB,yBAAyB,CAAC,MAAM,GAAE,OAAO,CAAC,eAAe,CAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAgE9G;AAGD,eAAe,yBAAyB,CAAC"}