@ruvector/ruvllm 3.0.0 → 4.0.1

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 (151) hide show
  1. package/GPU-LOOP.md +229 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +9 -0
  4. package/README.md +159 -360
  5. package/examples/gpu-loop.example.json +26 -0
  6. package/package.json +50 -121
  7. package/src/adapters-cli.mjs +23 -0
  8. package/src/adapters.mjs +91 -0
  9. package/src/cli.mjs +30 -0
  10. package/src/engine.mjs +238 -0
  11. package/src/fixture.mjs +38 -0
  12. package/src/gpu-host.mjs +47 -0
  13. package/src/gpu-loop-cli.mjs +67 -0
  14. package/src/gpu-loop.mjs +184 -0
  15. package/src/gpu-spool-adapter.mjs +80 -0
  16. package/src/vast-host-adapter.mjs +274 -0
  17. package/bin/cli.js +0 -1040
  18. package/dist/cjs/benchmarks/embedding-benchmark.d.ts +0 -102
  19. package/dist/cjs/benchmarks/embedding-benchmark.d.ts.map +0 -1
  20. package/dist/cjs/benchmarks/embedding-benchmark.js +0 -436
  21. package/dist/cjs/benchmarks/index.d.ts +0 -34
  22. package/dist/cjs/benchmarks/index.d.ts.map +0 -1
  23. package/dist/cjs/benchmarks/index.js +0 -132
  24. package/dist/cjs/benchmarks/model-comparison.d.ts +0 -71
  25. package/dist/cjs/benchmarks/model-comparison.d.ts.map +0 -1
  26. package/dist/cjs/benchmarks/model-comparison.js +0 -476
  27. package/dist/cjs/benchmarks/routing-benchmark.d.ts +0 -70
  28. package/dist/cjs/benchmarks/routing-benchmark.d.ts.map +0 -1
  29. package/dist/cjs/benchmarks/routing-benchmark.js +0 -289
  30. package/dist/cjs/contrastive.d.ts +0 -229
  31. package/dist/cjs/contrastive.d.ts.map +0 -1
  32. package/dist/cjs/contrastive.js +0 -589
  33. package/dist/cjs/engine.d.ts +0 -160
  34. package/dist/cjs/engine.d.ts.map +0 -1
  35. package/dist/cjs/engine.js +0 -552
  36. package/dist/cjs/export.d.ts +0 -182
  37. package/dist/cjs/export.d.ts.map +0 -1
  38. package/dist/cjs/export.js +0 -422
  39. package/dist/cjs/federated.d.ts +0 -233
  40. package/dist/cjs/federated.d.ts.map +0 -1
  41. package/dist/cjs/federated.js +0 -525
  42. package/dist/cjs/index.d.ts +0 -68
  43. package/dist/cjs/index.d.ts.map +0 -1
  44. package/dist/cjs/index.js +0 -104
  45. package/dist/cjs/intelligence.d.ts +0 -136
  46. package/dist/cjs/intelligence.d.ts.map +0 -1
  47. package/dist/cjs/intelligence.js +0 -226
  48. package/dist/cjs/lora.d.ts +0 -251
  49. package/dist/cjs/lora.d.ts.map +0 -1
  50. package/dist/cjs/lora.js +0 -509
  51. package/dist/cjs/models.d.ts +0 -129
  52. package/dist/cjs/models.d.ts.map +0 -1
  53. package/dist/cjs/models.js +0 -323
  54. package/dist/cjs/native.d.ts +0 -140
  55. package/dist/cjs/native.d.ts.map +0 -1
  56. package/dist/cjs/native.js +0 -98
  57. package/dist/cjs/session.d.ts +0 -80
  58. package/dist/cjs/session.d.ts.map +0 -1
  59. package/dist/cjs/session.js +0 -203
  60. package/dist/cjs/simd.d.ts +0 -90
  61. package/dist/cjs/simd.d.ts.map +0 -1
  62. package/dist/cjs/simd.js +0 -209
  63. package/dist/cjs/sona.d.ts +0 -223
  64. package/dist/cjs/sona.d.ts.map +0 -1
  65. package/dist/cjs/sona.js +0 -562
  66. package/dist/cjs/streaming.d.ts +0 -55
  67. package/dist/cjs/streaming.d.ts.map +0 -1
  68. package/dist/cjs/streaming.js +0 -131
  69. package/dist/cjs/training.d.ts +0 -312
  70. package/dist/cjs/training.d.ts.map +0 -1
  71. package/dist/cjs/training.js +0 -610
  72. package/dist/cjs/types.d.ts +0 -696
  73. package/dist/cjs/types.d.ts.map +0 -1
  74. package/dist/cjs/types.js +0 -6
  75. package/dist/esm/benchmarks/embedding-benchmark.d.ts +0 -102
  76. package/dist/esm/benchmarks/embedding-benchmark.d.ts.map +0 -1
  77. package/dist/esm/benchmarks/embedding-benchmark.js +0 -427
  78. package/dist/esm/benchmarks/index.d.ts +0 -34
  79. package/dist/esm/benchmarks/index.d.ts.map +0 -1
  80. package/dist/esm/benchmarks/index.js +0 -110
  81. package/dist/esm/benchmarks/model-comparison.d.ts +0 -71
  82. package/dist/esm/benchmarks/model-comparison.d.ts.map +0 -1
  83. package/dist/esm/benchmarks/model-comparison.js +0 -434
  84. package/dist/esm/benchmarks/routing-benchmark.d.ts +0 -70
  85. package/dist/esm/benchmarks/routing-benchmark.d.ts.map +0 -1
  86. package/dist/esm/benchmarks/routing-benchmark.js +0 -283
  87. package/dist/esm/contrastive.d.ts +0 -229
  88. package/dist/esm/contrastive.d.ts.map +0 -1
  89. package/dist/esm/contrastive.js +0 -578
  90. package/dist/esm/engine.d.ts +0 -160
  91. package/dist/esm/engine.d.ts.map +0 -1
  92. package/dist/esm/engine.js +0 -548
  93. package/dist/esm/export.d.ts +0 -182
  94. package/dist/esm/export.d.ts.map +0 -1
  95. package/dist/esm/export.js +0 -414
  96. package/dist/esm/federated.d.ts +0 -233
  97. package/dist/esm/federated.d.ts.map +0 -1
  98. package/dist/esm/federated.js +0 -520
  99. package/dist/esm/index.d.ts +0 -68
  100. package/dist/esm/index.d.ts.map +0 -1
  101. package/dist/esm/index.js +0 -84
  102. package/dist/esm/intelligence.d.ts +0 -136
  103. package/dist/esm/intelligence.d.ts.map +0 -1
  104. package/dist/esm/intelligence.js +0 -188
  105. package/dist/esm/lora.d.ts +0 -251
  106. package/dist/esm/lora.d.ts.map +0 -1
  107. package/dist/esm/lora.js +0 -504
  108. package/dist/esm/models.d.ts +0 -129
  109. package/dist/esm/models.d.ts.map +0 -1
  110. package/dist/esm/models.js +0 -282
  111. package/dist/esm/native.d.ts +0 -140
  112. package/dist/esm/native.d.ts.map +0 -1
  113. package/dist/esm/native.js +0 -93
  114. package/dist/esm/session.d.ts +0 -80
  115. package/dist/esm/session.d.ts.map +0 -1
  116. package/dist/esm/session.js +0 -199
  117. package/dist/esm/simd.d.ts +0 -90
  118. package/dist/esm/simd.d.ts.map +0 -1
  119. package/dist/esm/simd.js +0 -205
  120. package/dist/esm/sona.d.ts +0 -223
  121. package/dist/esm/sona.d.ts.map +0 -1
  122. package/dist/esm/sona.js +0 -556
  123. package/dist/esm/streaming.d.ts +0 -55
  124. package/dist/esm/streaming.d.ts.map +0 -1
  125. package/dist/esm/streaming.js +0 -126
  126. package/dist/esm/training.d.ts +0 -312
  127. package/dist/esm/training.d.ts.map +0 -1
  128. package/dist/esm/training.js +0 -603
  129. package/dist/esm/types.d.ts +0 -696
  130. package/dist/esm/types.d.ts.map +0 -1
  131. package/dist/esm/types.js +0 -5
  132. package/scripts/ensemble-model-compare.js +0 -287
  133. package/scripts/fix-esm-extensions.mjs +0 -181
  134. package/scripts/huggingface/README.md +0 -537
  135. package/scripts/huggingface/publish.sh +0 -112
  136. package/scripts/hybrid-model-compare.js +0 -373
  137. package/scripts/improved-model-compare.js +0 -288
  138. package/scripts/optimized-model-compare.js +0 -364
  139. package/scripts/real-model-compare.js +0 -280
  140. package/scripts/smoke-esm.mjs +0 -82
  141. package/scripts/training/agentic-flow-capabilities.json +0 -329
  142. package/scripts/training/claude-code-synth.js +0 -505
  143. package/scripts/training/claude-flow-capabilities.json +0 -1322
  144. package/scripts/training/claude-hard-negatives.js +0 -222
  145. package/scripts/training/contrastive-finetune.js +0 -517
  146. package/scripts/training/ecosystem-triplets.jsonl +0 -1467
  147. package/scripts/training/generate-ecosystem-triplets.js +0 -1324
  148. package/scripts/training/routing-dataset.js +0 -634
  149. package/scripts/training/ruvector-capabilities.json +0 -798
  150. package/scripts/training/validate-ecosystem.js +0 -381
  151. package/scripts/training/validation-results.json +0 -23
@@ -1,634 +0,0 @@
1
- /**
2
- * Comprehensive Routing Dataset for RuvLTRA Fine-Tuning
3
- *
4
- * Contains:
5
- * - 50+ examples per agent type (13 agents = 650+ examples)
6
- * - Hard negatives for contrastive learning
7
- * - Quality scores based on task clarity
8
- */
9
-
10
- // Agent definitions with rich examples
11
- const AGENT_TRAINING_DATA = {
12
- coder: {
13
- description: 'Software developer who writes and implements code',
14
- positives: [
15
- // Implementation tasks
16
- { task: 'Implement a binary search function in TypeScript', quality: 1.0 },
17
- { task: 'Build a React component for user registration', quality: 1.0 },
18
- { task: 'Create a REST API endpoint for user authentication', quality: 1.0 },
19
- { task: 'Write a function to validate email addresses', quality: 1.0 },
20
- { task: 'Implement pagination for the product listing', quality: 1.0 },
21
- { task: 'Build a dropdown menu component with accessibility', quality: 1.0 },
22
- { task: 'Create a utility function for date formatting', quality: 1.0 },
23
- { task: 'Implement WebSocket connection handling', quality: 1.0 },
24
- { task: 'Write a custom hook for form validation', quality: 1.0 },
25
- { task: 'Build the shopping cart logic in Redux', quality: 1.0 },
26
- { task: 'Create a file upload component with progress', quality: 1.0 },
27
- { task: 'Implement infinite scroll for the feed', quality: 1.0 },
28
- { task: 'Write the authentication middleware', quality: 1.0 },
29
- { task: 'Build a toast notification system', quality: 1.0 },
30
- { task: 'Create a data table with sorting and filtering', quality: 1.0 },
31
- { task: 'Implement OAuth2 login flow', quality: 1.0 },
32
- { task: 'Build a modal dialog component', quality: 1.0 },
33
- { task: 'Write the database migration scripts', quality: 0.9 },
34
- { task: 'Create a caching layer for API responses', quality: 0.9 },
35
- { task: 'Implement rate limiting middleware', quality: 0.9 },
36
- // Add feature requests
37
- { task: 'Add dark mode support to the application', quality: 0.9 },
38
- { task: 'Add export to PDF functionality', quality: 0.9 },
39
- { task: 'Add real-time collaboration features', quality: 0.9 },
40
- { task: 'Add multi-language support i18n', quality: 0.9 },
41
- { task: 'Add keyboard shortcuts to the editor', quality: 0.9 },
42
- // Build/create variations
43
- { task: 'Build the checkout flow', quality: 1.0 },
44
- { task: 'Create the user profile page', quality: 1.0 },
45
- { task: 'Develop the admin dashboard', quality: 1.0 },
46
- { task: 'Code the payment integration', quality: 1.0 },
47
- { task: 'Program the notification service', quality: 1.0 },
48
- // Language-specific
49
- { task: 'Write Python script for data processing', quality: 0.9 },
50
- { task: 'Implement Go microservice for metrics', quality: 0.9 },
51
- { task: 'Create Rust library for parsing', quality: 0.9 },
52
- { task: 'Build Node.js CLI tool', quality: 0.9 },
53
- { task: 'Write SQL stored procedure', quality: 0.8 },
54
- ],
55
- hardNegatives: [
56
- { task: 'Review the implementation for bugs', agent: 'reviewer' },
57
- { task: 'Test the new feature thoroughly', agent: 'tester' },
58
- { task: 'Document how the function works', agent: 'documenter' },
59
- { task: 'Design the component architecture', agent: 'architect' },
60
- ],
61
- },
62
-
63
- researcher: {
64
- description: 'Technical researcher who investigates and analyzes',
65
- positives: [
66
- { task: 'Research best practices for React state management', quality: 1.0 },
67
- { task: 'Investigate why the API is returning slow responses', quality: 1.0 },
68
- { task: 'Explore different authentication strategies', quality: 1.0 },
69
- { task: 'Analyze the current database schema for improvements', quality: 1.0 },
70
- { task: 'Find the root cause of the memory leak', quality: 0.9 },
71
- { task: 'Research GraphQL vs REST for our use case', quality: 1.0 },
72
- { task: 'Investigate alternatives to our current ORM', quality: 1.0 },
73
- { task: 'Explore microservices vs monolith tradeoffs', quality: 1.0 },
74
- { task: 'Analyze competitor implementations', quality: 0.9 },
75
- { task: 'Research GDPR compliance requirements', quality: 0.9 },
76
- { task: 'Investigate the performance bottleneck in production', quality: 1.0 },
77
- { task: 'Explore serverless options for our workload', quality: 1.0 },
78
- { task: 'Research caching strategies for high traffic', quality: 1.0 },
79
- { task: 'Analyze user behavior patterns in analytics', quality: 0.9 },
80
- { task: 'Investigate third-party SDK options', quality: 0.9 },
81
- { task: 'Research machine learning models for recommendations', quality: 0.9 },
82
- { task: 'Explore event sourcing patterns', quality: 1.0 },
83
- { task: 'Investigate CQRS implementation approaches', quality: 1.0 },
84
- { task: 'Research WebRTC for real-time features', quality: 1.0 },
85
- { task: 'Analyze the feasibility of blockchain integration', quality: 0.8 },
86
- // Discovery tasks
87
- { task: 'Discover why users are dropping off at checkout', quality: 0.9 },
88
- { task: 'Find patterns in the error logs', quality: 0.9 },
89
- { task: 'Look into the recent performance degradation', quality: 1.0 },
90
- { task: 'Examine the authentication flow for issues', quality: 0.9 },
91
- { task: 'Study the codebase architecture', quality: 0.9 },
92
- // Compare/evaluate
93
- { task: 'Compare React vs Vue for the frontend rewrite', quality: 1.0 },
94
- { task: 'Evaluate PostgreSQL vs MongoDB for our needs', quality: 1.0 },
95
- { task: 'Assess the migration effort to TypeScript', quality: 0.9 },
96
- { task: 'Review industry standards for API design', quality: 0.9 },
97
- { task: 'Survey available monitoring solutions', quality: 0.9 },
98
- ],
99
- hardNegatives: [
100
- { task: 'Implement the feature based on research', agent: 'coder' },
101
- { task: 'Write tests for the researched approach', agent: 'tester' },
102
- { task: 'Design the architecture based on findings', agent: 'architect' },
103
- ],
104
- },
105
-
106
- reviewer: {
107
- description: 'Code reviewer who evaluates code quality',
108
- positives: [
109
- { task: 'Review the pull request for code quality', quality: 1.0 },
110
- { task: 'Check the code for potential issues', quality: 1.0 },
111
- { task: 'Evaluate the implementation approach', quality: 1.0 },
112
- { task: 'Assess the code for maintainability', quality: 1.0 },
113
- { task: 'Review the PR before merging', quality: 1.0 },
114
- { task: 'Check code for potential race conditions', quality: 1.0 },
115
- { task: 'Evaluate the API design decisions', quality: 0.9 },
116
- { task: 'Review the database query patterns', quality: 0.9 },
117
- { task: 'Assess code coverage of the changes', quality: 0.9 },
118
- { task: 'Check for code style violations', quality: 0.9 },
119
- { task: 'Review the error handling approach', quality: 1.0 },
120
- { task: 'Evaluate the logging strategy', quality: 0.9 },
121
- { task: 'Check the implementation against requirements', quality: 1.0 },
122
- { task: 'Review the commit messages for clarity', quality: 0.8 },
123
- { task: 'Assess the backwards compatibility', quality: 0.9 },
124
- { task: 'Review the configuration changes', quality: 0.9 },
125
- { task: 'Check the dependency updates', quality: 0.9 },
126
- { task: 'Evaluate the migration script safety', quality: 0.9 },
127
- { task: 'Review the feature flag implementation', quality: 0.9 },
128
- { task: 'Assess the rollback strategy', quality: 0.9 },
129
- // Code review synonyms
130
- { task: 'Examine the submitted code changes', quality: 1.0 },
131
- { task: 'Inspect the new feature implementation', quality: 1.0 },
132
- { task: 'Critique the refactoring approach', quality: 0.9 },
133
- { task: 'Validate the coding standards', quality: 0.9 },
134
- { task: 'Approve or request changes on the PR', quality: 1.0 },
135
- ],
136
- hardNegatives: [
137
- { task: 'Research best practices for the implementation', agent: 'researcher' },
138
- { task: 'Fix the issues found in review', agent: 'coder' },
139
- { task: 'Test the code after review', agent: 'tester' },
140
- { task: 'Audit the code for security vulnerabilities', agent: 'security-architect' },
141
- ],
142
- },
143
-
144
- tester: {
145
- description: 'QA engineer who writes and runs tests',
146
- positives: [
147
- { task: 'Write unit tests for the authentication module', quality: 1.0 },
148
- { task: 'Add integration tests for the API endpoints', quality: 1.0 },
149
- { task: 'Create e2e tests for the checkout flow', quality: 1.0 },
150
- { task: 'Write tests for the new feature', quality: 1.0 },
151
- { task: 'Add test coverage for edge cases', quality: 1.0 },
152
- { task: 'Create test fixtures for the database', quality: 0.9 },
153
- { task: 'Write snapshot tests for the components', quality: 0.9 },
154
- { task: 'Add regression tests for the bug fix', quality: 1.0 },
155
- { task: 'Create mock services for testing', quality: 0.9 },
156
- { task: 'Write performance tests for the API', quality: 0.9 },
157
- { task: 'Add load tests for the service', quality: 0.9 },
158
- { task: 'Create test data generators', quality: 0.8 },
159
- { task: 'Write accessibility tests', quality: 0.9 },
160
- { task: 'Add visual regression tests', quality: 0.9 },
161
- { task: 'Create contract tests for the API', quality: 0.9 },
162
- { task: 'Write mutation tests to verify test quality', quality: 0.8 },
163
- { task: 'Add smoke tests for deployment validation', quality: 0.9 },
164
- { task: 'Create test suite for the payment gateway', quality: 1.0 },
165
- { task: 'Write tests for the form validation logic', quality: 1.0 },
166
- { task: 'Add tests for error handling scenarios', quality: 1.0 },
167
- // Test execution
168
- { task: 'Run the test suite and fix failures', quality: 0.9 },
169
- { task: 'Execute the regression test suite', quality: 0.9 },
170
- { task: 'Verify the fix with automated tests', quality: 0.9 },
171
- { task: 'Test the application on multiple browsers', quality: 0.9 },
172
- { task: 'Validate the API responses match spec', quality: 0.9 },
173
- // Test improvement
174
- { task: 'Improve test coverage to 80%', quality: 0.9 },
175
- { task: 'Reduce test flakiness', quality: 0.8 },
176
- { task: 'Speed up the test suite execution', quality: 0.8 },
177
- ],
178
- hardNegatives: [
179
- { task: 'Implement the feature to be tested', agent: 'coder' },
180
- { task: 'Review the test implementation', agent: 'reviewer' },
181
- { task: 'Document the test strategy', agent: 'documenter' },
182
- ],
183
- },
184
-
185
- architect: {
186
- description: 'System architect who designs software structure',
187
- positives: [
188
- { task: 'Design the database schema for user profiles', quality: 1.0 },
189
- { task: 'Plan the microservices architecture', quality: 1.0 },
190
- { task: 'Design the API contract for the service', quality: 1.0 },
191
- { task: 'Create the system architecture diagram', quality: 1.0 },
192
- { task: 'Plan the data model for the application', quality: 1.0 },
193
- { task: 'Design the event-driven architecture', quality: 1.0 },
194
- { task: 'Plan the caching strategy for the system', quality: 0.9 },
195
- { task: 'Design the authentication flow architecture', quality: 1.0 },
196
- { task: 'Create the infrastructure topology', quality: 0.9 },
197
- { task: 'Plan the database sharding strategy', quality: 0.9 },
198
- { task: 'Design the message queue architecture', quality: 1.0 },
199
- { task: 'Plan the API versioning strategy', quality: 0.9 },
200
- { task: 'Design the multi-tenant architecture', quality: 1.0 },
201
- { task: 'Plan the disaster recovery architecture', quality: 0.9 },
202
- { task: 'Design the real-time notification system', quality: 1.0 },
203
- { task: 'Plan the search infrastructure', quality: 0.9 },
204
- { task: 'Design the file storage architecture', quality: 0.9 },
205
- { task: 'Plan the analytics data pipeline', quality: 0.9 },
206
- { task: 'Design the CDN and edge caching strategy', quality: 0.9 },
207
- { task: 'Plan the GraphQL schema design', quality: 1.0 },
208
- // Architecture decisions
209
- { task: 'Decide on the frontend framework', quality: 0.9 },
210
- { task: 'Choose the database technology', quality: 0.9 },
211
- { task: 'Define the service boundaries', quality: 1.0 },
212
- { task: 'Structure the monorepo organization', quality: 0.9 },
213
- { task: 'Establish coding standards and patterns', quality: 0.9 },
214
- ],
215
- hardNegatives: [
216
- { task: 'Implement the designed architecture', agent: 'coder' },
217
- { task: 'Research architecture options', agent: 'researcher' },
218
- { task: 'Review the architecture implementation', agent: 'reviewer' },
219
- { task: 'Document the architecture decisions', agent: 'documenter' },
220
- ],
221
- },
222
-
223
- 'security-architect': {
224
- description: 'Security specialist who audits vulnerabilities',
225
- positives: [
226
- { task: 'Audit the API endpoints for XSS vulnerabilities', quality: 1.0 },
227
- { task: 'Check for SQL injection vulnerabilities', quality: 1.0 },
228
- { task: 'Review authentication for security issues', quality: 1.0 },
229
- { task: 'Scan the codebase for CVE vulnerabilities', quality: 1.0 },
230
- { task: 'Audit the file upload for security risks', quality: 1.0 },
231
- { task: 'Check for CSRF vulnerabilities', quality: 1.0 },
232
- { task: 'Review the session management security', quality: 1.0 },
233
- { task: 'Audit the password hashing implementation', quality: 1.0 },
234
- { task: 'Check for insecure direct object references', quality: 1.0 },
235
- { task: 'Review the API rate limiting for abuse prevention', quality: 0.9 },
236
- { task: 'Audit the encryption implementation', quality: 1.0 },
237
- { task: 'Check for sensitive data exposure', quality: 1.0 },
238
- { task: 'Review the authorization logic', quality: 1.0 },
239
- { task: 'Audit the JWT implementation', quality: 1.0 },
240
- { task: 'Check for path traversal vulnerabilities', quality: 1.0 },
241
- { task: 'Review the CORS configuration', quality: 0.9 },
242
- { task: 'Audit the dependency security', quality: 1.0 },
243
- { task: 'Check for command injection risks', quality: 1.0 },
244
- { task: 'Review the secrets management', quality: 1.0 },
245
- { task: 'Audit the logging for sensitive data', quality: 0.9 },
246
- // Security hardening
247
- { task: 'Harden the application against attacks', quality: 0.9 },
248
- { task: 'Implement security headers', quality: 0.9 },
249
- { task: 'Set up intrusion detection', quality: 0.8 },
250
- { task: 'Configure WAF rules', quality: 0.8 },
251
- { task: 'Perform penetration testing', quality: 0.9 },
252
- ],
253
- hardNegatives: [
254
- { task: 'Fix the security vulnerability', agent: 'coder' },
255
- { task: 'Test the security fix', agent: 'tester' },
256
- { task: 'Review the security patch', agent: 'reviewer' },
257
- { task: 'Research security best practices', agent: 'researcher' },
258
- ],
259
- },
260
-
261
- debugger: {
262
- description: 'Bug hunter who fixes errors and traces issues',
263
- positives: [
264
- { task: 'Fix the null pointer exception in login', quality: 1.0 },
265
- { task: 'Debug the memory leak in WebSocket handler', quality: 1.0 },
266
- { task: 'Trace the source of the intermittent error', quality: 1.0 },
267
- { task: 'Fix the race condition in the cache', quality: 1.0 },
268
- { task: 'Debug why the API returns 500 errors', quality: 1.0 },
269
- { task: 'Fix the undefined variable error', quality: 1.0 },
270
- { task: 'Debug the infinite loop in the parser', quality: 1.0 },
271
- { task: 'Trace the stack overflow error', quality: 1.0 },
272
- { task: 'Fix the database connection leak', quality: 1.0 },
273
- { task: 'Debug the serialization error', quality: 1.0 },
274
- { task: 'Fix the type mismatch error', quality: 1.0 },
275
- { task: 'Debug the async timing issue', quality: 1.0 },
276
- { task: 'Fix the broken redirect loop', quality: 1.0 },
277
- { task: 'Trace why data is not saving', quality: 1.0 },
278
- { task: 'Fix the crash on mobile devices', quality: 1.0 },
279
- { task: 'Debug the encoding issue with UTF-8', quality: 0.9 },
280
- { task: 'Fix the timezone conversion bug', quality: 1.0 },
281
- { task: 'Debug why tests fail intermittently', quality: 0.9 },
282
- { task: 'Fix the deadlock in the transaction', quality: 1.0 },
283
- { task: 'Trace the source of data corruption', quality: 1.0 },
284
- // Bug variations
285
- { task: 'Resolve the issue with user login', quality: 0.9 },
286
- { task: 'Troubleshoot the payment failure', quality: 0.9 },
287
- { task: 'Diagnose the slow query', quality: 0.9 },
288
- { task: 'Repair the broken feature', quality: 0.9 },
289
- { task: 'Address the customer reported bug', quality: 0.9 },
290
- ],
291
- hardNegatives: [
292
- { task: 'Research why the bug occurs', agent: 'researcher' },
293
- { task: 'Write tests to prevent regression', agent: 'tester' },
294
- { task: 'Review the fix for correctness', agent: 'reviewer' },
295
- ],
296
- },
297
-
298
- documenter: {
299
- description: 'Technical writer who creates documentation',
300
- positives: [
301
- { task: 'Write JSDoc comments for utility functions', quality: 1.0 },
302
- { task: 'Create README for the new package', quality: 1.0 },
303
- { task: 'Document the API endpoints', quality: 1.0 },
304
- { task: 'Write the getting started guide', quality: 1.0 },
305
- { task: 'Add inline comments explaining the algorithm', quality: 1.0 },
306
- { task: 'Document the configuration options', quality: 1.0 },
307
- { task: 'Write the migration guide', quality: 1.0 },
308
- { task: 'Create the architecture documentation', quality: 0.9 },
309
- { task: 'Document the coding standards', quality: 0.9 },
310
- { task: 'Write the troubleshooting guide', quality: 0.9 },
311
- { task: 'Add examples to the documentation', quality: 1.0 },
312
- { task: 'Document the environment setup', quality: 1.0 },
313
- { task: 'Write the changelog entries', quality: 0.9 },
314
- { task: 'Create the API reference documentation', quality: 1.0 },
315
- { task: 'Document the release process', quality: 0.9 },
316
- { task: 'Write the security policy', quality: 0.9 },
317
- { task: 'Add TypeDoc comments', quality: 1.0 },
318
- { task: 'Document the database schema', quality: 0.9 },
319
- { task: 'Write the deployment guide', quality: 0.9 },
320
- { task: 'Create the FAQ section', quality: 0.9 },
321
- // Documentation actions
322
- { task: 'Explain how the authentication works', quality: 1.0 },
323
- { task: 'Describe the data flow', quality: 0.9 },
324
- { task: 'Annotate the complex code sections', quality: 1.0 },
325
- { task: 'Update the outdated documentation', quality: 0.9 },
326
- { task: 'Improve the code comments', quality: 0.9 },
327
- ],
328
- hardNegatives: [
329
- { task: 'Implement what was documented', agent: 'coder' },
330
- { task: 'Review the documentation accuracy', agent: 'reviewer' },
331
- { task: 'Generate OpenAPI spec', agent: 'api-docs' },
332
- ],
333
- },
334
-
335
- refactorer: {
336
- description: 'Code modernizer who restructures without changing behavior',
337
- positives: [
338
- { task: 'Refactor the payment module to async/await', quality: 1.0 },
339
- { task: 'Restructure the utils folder', quality: 1.0 },
340
- { task: 'Extract common logic into shared module', quality: 1.0 },
341
- { task: 'Modernize the callback-based code', quality: 1.0 },
342
- { task: 'Consolidate duplicate code into utilities', quality: 1.0 },
343
- { task: 'Simplify the complex conditional logic', quality: 1.0 },
344
- { task: 'Rename variables for better clarity', quality: 0.9 },
345
- { task: 'Split the large file into modules', quality: 1.0 },
346
- { task: 'Convert class components to hooks', quality: 1.0 },
347
- { task: 'Migrate from CommonJS to ES modules', quality: 1.0 },
348
- { task: 'Clean up the legacy error handling', quality: 1.0 },
349
- { task: 'Restructure the folder organization', quality: 0.9 },
350
- { task: 'Extract the business logic from controllers', quality: 1.0 },
351
- { task: 'Simplify the nested callbacks', quality: 1.0 },
352
- { task: 'Consolidate the configuration files', quality: 0.9 },
353
- { task: 'Modernize the build system', quality: 0.9 },
354
- { task: 'Clean up unused imports', quality: 0.8 },
355
- { task: 'Restructure the test organization', quality: 0.9 },
356
- { task: 'Extract the API client into a service', quality: 1.0 },
357
- { task: 'Simplify the state management', quality: 1.0 },
358
- // Refactoring actions
359
- { task: 'Decompose the monolithic function', quality: 1.0 },
360
- { task: 'Remove the deprecated code paths', quality: 0.9 },
361
- { task: 'Upgrade to the new API patterns', quality: 0.9 },
362
- { task: 'Decouple the tightly coupled modules', quality: 1.0 },
363
- { task: 'Standardize the code style', quality: 0.8 },
364
- ],
365
- hardNegatives: [
366
- { task: 'Add new features during refactoring', agent: 'coder' },
367
- { task: 'Test the refactored code', agent: 'tester' },
368
- { task: 'Review the refactoring changes', agent: 'reviewer' },
369
- ],
370
- },
371
-
372
- optimizer: {
373
- description: 'Performance engineer who speeds up slow code',
374
- positives: [
375
- { task: 'Optimize the database queries for dashboard', quality: 1.0 },
376
- { task: 'Cache the frequently accessed user data', quality: 1.0 },
377
- { task: 'Improve the API response time', quality: 1.0 },
378
- { task: 'Reduce the memory footprint', quality: 1.0 },
379
- { task: 'Speed up the build process', quality: 0.9 },
380
- { task: 'Optimize the image loading', quality: 1.0 },
381
- { task: 'Reduce the bundle size', quality: 1.0 },
382
- { task: 'Improve the cold start time', quality: 1.0 },
383
- { task: 'Optimize the search query performance', quality: 1.0 },
384
- { task: 'Cache the computed results', quality: 1.0 },
385
- { task: 'Reduce the network requests', quality: 1.0 },
386
- { task: 'Optimize the render performance', quality: 1.0 },
387
- { task: 'Improve the database index strategy', quality: 1.0 },
388
- { task: 'Speed up the test execution', quality: 0.9 },
389
- { task: 'Reduce the Docker image size', quality: 0.9 },
390
- { task: 'Optimize the lazy loading', quality: 1.0 },
391
- { task: 'Improve the caching headers', quality: 0.9 },
392
- { task: 'Reduce the time to first byte', quality: 1.0 },
393
- { task: 'Optimize the garbage collection', quality: 0.9 },
394
- { task: 'Speed up the CI pipeline', quality: 0.9 },
395
- // Performance variations
396
- { task: 'Make the page load faster', quality: 1.0 },
397
- { task: 'Reduce latency in the API', quality: 1.0 },
398
- { task: 'Improve throughput of the service', quality: 1.0 },
399
- { task: 'Tune the database for performance', quality: 1.0 },
400
- { task: 'Accelerate the data processing', quality: 0.9 },
401
- ],
402
- hardNegatives: [
403
- { task: 'Research optimization strategies', agent: 'researcher' },
404
- { task: 'Test the performance improvements', agent: 'tester' },
405
- { task: 'Profile the slow code', agent: 'debugger' },
406
- ],
407
- },
408
-
409
- devops: {
410
- description: 'DevOps engineer who manages deployment and infrastructure',
411
- positives: [
412
- { task: 'Set up the CI/CD pipeline', quality: 1.0 },
413
- { task: 'Configure Kubernetes deployment', quality: 1.0 },
414
- { task: 'Deploy to production', quality: 1.0 },
415
- { task: 'Set up Docker containers', quality: 1.0 },
416
- { task: 'Configure the load balancer', quality: 1.0 },
417
- { task: 'Set up monitoring and alerting', quality: 1.0 },
418
- { task: 'Configure auto-scaling', quality: 1.0 },
419
- { task: 'Set up the staging environment', quality: 1.0 },
420
- { task: 'Configure secrets management', quality: 1.0 },
421
- { task: 'Set up log aggregation', quality: 0.9 },
422
- { task: 'Configure the CDN', quality: 0.9 },
423
- { task: 'Set up database backups', quality: 1.0 },
424
- { task: 'Configure SSL certificates', quality: 1.0 },
425
- { task: 'Set up blue-green deployment', quality: 1.0 },
426
- { task: 'Configure the reverse proxy', quality: 0.9 },
427
- { task: 'Set up infrastructure as code', quality: 1.0 },
428
- { task: 'Configure the message queue', quality: 0.9 },
429
- { task: 'Set up the VPN', quality: 0.9 },
430
- { task: 'Configure network policies', quality: 0.9 },
431
- { task: 'Set up disaster recovery', quality: 0.9 },
432
- // DevOps actions
433
- { task: 'Provision the cloud resources', quality: 1.0 },
434
- { task: 'Manage the container registry', quality: 0.9 },
435
- { task: 'Automate the release process', quality: 1.0 },
436
- { task: 'Roll back the failed deployment', quality: 1.0 },
437
- { task: 'Scale the services for traffic', quality: 1.0 },
438
- ],
439
- hardNegatives: [
440
- { task: 'Fix the deployment script bug', agent: 'debugger' },
441
- { task: 'Document the deployment process', agent: 'documenter' },
442
- { task: 'Review the infrastructure changes', agent: 'reviewer' },
443
- ],
444
- },
445
-
446
- 'api-docs': {
447
- description: 'API documentation specialist who creates specs',
448
- positives: [
449
- { task: 'Generate OpenAPI documentation for REST API', quality: 1.0 },
450
- { task: 'Create Swagger spec for the endpoints', quality: 1.0 },
451
- { task: 'Document the API request/response formats', quality: 1.0 },
452
- { task: 'Write the API reference guide', quality: 1.0 },
453
- { task: 'Create GraphQL schema documentation', quality: 1.0 },
454
- { task: 'Generate API client examples', quality: 0.9 },
455
- { task: 'Document the authentication endpoints', quality: 1.0 },
456
- { task: 'Create the API changelog', quality: 0.9 },
457
- { task: 'Write API versioning documentation', quality: 0.9 },
458
- { task: 'Document the webhook payloads', quality: 1.0 },
459
- { task: 'Create the SDK documentation', quality: 0.9 },
460
- { task: 'Generate the Postman collection', quality: 0.9 },
461
- { task: 'Document the error codes and responses', quality: 1.0 },
462
- { task: 'Create the API rate limit documentation', quality: 0.9 },
463
- { task: 'Write the API authentication guide', quality: 1.0 },
464
- { task: 'Generate the gRPC proto documentation', quality: 0.9 },
465
- { task: 'Document the WebSocket events', quality: 1.0 },
466
- { task: 'Create the API quickstart guide', quality: 0.9 },
467
- { task: 'Write the API best practices guide', quality: 0.9 },
468
- { task: 'Document the API pagination', quality: 0.9 },
469
- ],
470
- hardNegatives: [
471
- { task: 'Implement the API endpoint', agent: 'coder' },
472
- { task: 'Test the API endpoint', agent: 'tester' },
473
- { task: 'Write general documentation', agent: 'documenter' },
474
- ],
475
- },
476
-
477
- planner: {
478
- description: 'Project planner who organizes and schedules work',
479
- positives: [
480
- { task: 'Create a sprint plan for next two weeks', quality: 1.0 },
481
- { task: 'Estimate the feature implementation effort', quality: 1.0 },
482
- { task: 'Plan the roadmap for Q3', quality: 1.0 },
483
- { task: 'Prioritize the backlog items', quality: 1.0 },
484
- { task: 'Schedule the release timeline', quality: 1.0 },
485
- { task: 'Create milestones for the project', quality: 1.0 },
486
- { task: 'Plan the migration timeline', quality: 1.0 },
487
- { task: 'Estimate the story points', quality: 0.9 },
488
- { task: 'Plan the team capacity', quality: 0.9 },
489
- { task: 'Create the project timeline', quality: 1.0 },
490
- { task: 'Schedule the technical debt work', quality: 0.9 },
491
- { task: 'Plan the feature rollout phases', quality: 1.0 },
492
- { task: 'Estimate the dependency impact', quality: 0.9 },
493
- { task: 'Schedule the code freeze', quality: 0.9 },
494
- { task: 'Plan the cross-team dependencies', quality: 0.9 },
495
- { task: 'Create the quarterly OKRs', quality: 0.9 },
496
- { task: 'Schedule the retrospective', quality: 0.8 },
497
- { task: 'Plan the onboarding timeline', quality: 0.8 },
498
- { task: 'Estimate the infrastructure costs', quality: 0.9 },
499
- { task: 'Schedule the security audit', quality: 0.9 },
500
- // Planning variations
501
- { task: 'Organize the work breakdown structure', quality: 0.9 },
502
- { task: 'Coordinate the release activities', quality: 0.9 },
503
- { task: 'Allocate resources for the project', quality: 0.9 },
504
- { task: 'Define the project scope', quality: 0.9 },
505
- { task: 'Set deadlines for deliverables', quality: 0.9 },
506
- ],
507
- hardNegatives: [
508
- { task: 'Implement the planned features', agent: 'coder' },
509
- { task: 'Design the architecture for the plan', agent: 'architect' },
510
- { task: 'Research the feasibility', agent: 'researcher' },
511
- ],
512
- },
513
- };
514
-
515
- /**
516
- * Generate the full training dataset
517
- */
518
- function generateTrainingDataset() {
519
- const dataset = [];
520
- const agents = Object.keys(AGENT_TRAINING_DATA);
521
-
522
- for (const agent of agents) {
523
- const data = AGENT_TRAINING_DATA[agent];
524
-
525
- // Add positive examples
526
- for (const positive of data.positives) {
527
- dataset.push({
528
- task: positive.task,
529
- agent: agent,
530
- quality: positive.quality,
531
- type: 'positive',
532
- });
533
- }
534
-
535
- // Add hard negative examples (tasks that are similar but belong to different agents)
536
- for (const negative of data.hardNegatives) {
537
- dataset.push({
538
- task: negative.task,
539
- agent: negative.agent, // The correct agent for this task
540
- quality: 1.0,
541
- type: 'hard_negative_for_' + agent,
542
- confusing_with: agent,
543
- });
544
- }
545
- }
546
-
547
- return dataset;
548
- }
549
-
550
- /**
551
- * Generate contrastive pairs for training
552
- */
553
- function generateContrastivePairs() {
554
- const pairs = [];
555
- const agents = Object.keys(AGENT_TRAINING_DATA);
556
-
557
- for (const agent of agents) {
558
- const data = AGENT_TRAINING_DATA[agent];
559
-
560
- // Create positive pairs (anchor, positive from same agent)
561
- for (let i = 0; i < data.positives.length - 1; i++) {
562
- for (let j = i + 1; j < Math.min(i + 3, data.positives.length); j++) {
563
- pairs.push({
564
- anchor: data.positives[i].task,
565
- positive: data.positives[j].task,
566
- agent: agent,
567
- type: 'positive_pair',
568
- });
569
- }
570
- }
571
-
572
- // Create negative pairs (anchor from this agent, negative from different agent)
573
- for (const otherAgent of agents) {
574
- if (otherAgent === agent) continue;
575
-
576
- const otherData = AGENT_TRAINING_DATA[otherAgent];
577
- const anchor = data.positives[0];
578
- const negative = otherData.positives[0];
579
-
580
- pairs.push({
581
- anchor: anchor.task,
582
- negative: negative.task,
583
- anchor_agent: agent,
584
- negative_agent: otherAgent,
585
- type: 'negative_pair',
586
- });
587
- }
588
- }
589
-
590
- return pairs;
591
- }
592
-
593
- /**
594
- * Export dataset statistics
595
- */
596
- function getDatasetStats() {
597
- const dataset = generateTrainingDataset();
598
- const pairs = generateContrastivePairs();
599
-
600
- const agentCounts = {};
601
- for (const item of dataset) {
602
- agentCounts[item.agent] = (agentCounts[item.agent] || 0) + 1;
603
- }
604
-
605
- return {
606
- totalExamples: dataset.length,
607
- agentCounts,
608
- contrastivePairs: pairs.length,
609
- agents: Object.keys(AGENT_TRAINING_DATA),
610
- };
611
- }
612
-
613
- module.exports = {
614
- AGENT_TRAINING_DATA,
615
- generateTrainingDataset,
616
- generateContrastivePairs,
617
- getDatasetStats,
618
- };
619
-
620
- // Print stats if run directly
621
- if (require.main === module) {
622
- const stats = getDatasetStats();
623
- console.log('\n═══════════════════════════════════════════════════════════════');
624
- console.log(' TRAINING DATASET STATISTICS');
625
- console.log('═══════════════════════════════════════════════════════════════\n');
626
- console.log(`Total Examples: ${stats.totalExamples}`);
627
- console.log(`Contrastive Pairs: ${stats.contrastivePairs}`);
628
- console.log(`Agent Types: ${stats.agents.length}`);
629
- console.log('\nExamples per Agent:');
630
- for (const [agent, count] of Object.entries(stats.agentCounts)) {
631
- console.log(` ${agent.padEnd(20)} ${count}`);
632
- }
633
- console.log('');
634
- }