agentic-qe 1.9.3 → 2.0.0

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 (271) hide show
  1. package/.claude/agents/qe-api-contract-validator.md +95 -1336
  2. package/.claude/agents/qe-chaos-engineer.md +152 -1211
  3. package/.claude/agents/qe-code-complexity.md +144 -707
  4. package/.claude/agents/qe-coverage-analyzer.md +147 -743
  5. package/.claude/agents/qe-deployment-readiness.md +143 -1496
  6. package/.claude/agents/qe-flaky-test-hunter.md +132 -1529
  7. package/.claude/agents/qe-fleet-commander.md +12 -12
  8. package/.claude/agents/qe-performance-tester.md +150 -886
  9. package/.claude/agents/qe-production-intelligence.md +155 -1396
  10. package/.claude/agents/qe-quality-analyzer.md +6 -6
  11. package/.claude/agents/qe-quality-gate.md +151 -648
  12. package/.claude/agents/qe-regression-risk-analyzer.md +132 -1150
  13. package/.claude/agents/qe-requirements-validator.md +149 -932
  14. package/.claude/agents/qe-security-scanner.md +157 -797
  15. package/.claude/agents/qe-test-data-architect.md +96 -1365
  16. package/.claude/agents/qe-test-executor.md +8 -8
  17. package/.claude/agents/qe-test-generator.md +145 -1540
  18. package/.claude/agents/qe-visual-tester.md +153 -1257
  19. package/.claude/agents/qx-partner.md +235 -0
  20. package/.claude/agents/subagents/qe-code-reviewer.md +40 -136
  21. package/.claude/agents/subagents/qe-coverage-gap-analyzer.md +40 -480
  22. package/.claude/agents/subagents/qe-data-generator.md +41 -125
  23. package/.claude/agents/subagents/qe-flaky-investigator.md +55 -411
  24. package/.claude/agents/subagents/qe-integration-tester.md +53 -141
  25. package/.claude/agents/subagents/qe-performance-validator.md +54 -130
  26. package/.claude/agents/subagents/qe-security-auditor.md +56 -114
  27. package/.claude/agents/subagents/qe-test-data-architect-sub.md +57 -548
  28. package/.claude/agents/subagents/qe-test-implementer.md +58 -551
  29. package/.claude/agents/subagents/qe-test-refactorer.md +65 -722
  30. package/.claude/agents/subagents/qe-test-writer.md +63 -726
  31. package/.claude/skills/skills-manifest.json +632 -0
  32. package/.claude/skills/testability-scoring/README.md +71 -0
  33. package/.claude/skills/testability-scoring/SKILL.md +611 -0
  34. package/.claude/skills/testability-scoring/resources/templates/config.template.js +84 -0
  35. package/.claude/skills/testability-scoring/resources/templates/testability-scoring.spec.template.js +532 -0
  36. package/.claude/skills/testability-scoring/scripts/generate-html-report.js +1007 -0
  37. package/.claude/skills/testability-scoring/scripts/run-assessment.sh +70 -0
  38. package/CHANGELOG.md +116 -0
  39. package/README.md +59 -7
  40. package/config/.env.otel.example +25 -0
  41. package/config/OTEL-QUICK-REFERENCE.md +137 -0
  42. package/config/README-OTEL.md +222 -0
  43. package/config/alerting-rules.yml +518 -0
  44. package/config/docker-compose.otel.yml +187 -0
  45. package/config/grafana/dashboards/agentic-qe-overview.json +286 -0
  46. package/config/grafana/provisioning/dashboards/dashboards.yml +19 -0
  47. package/config/grafana/provisioning/datasources/datasources.yml +53 -0
  48. package/config/otel-collector-config.yaml.example +145 -0
  49. package/config/prometheus.yml.example +106 -0
  50. package/dist/agents/QXPartnerAgent.d.ts +139 -0
  51. package/dist/agents/QXPartnerAgent.d.ts.map +1 -0
  52. package/dist/agents/QXPartnerAgent.js +769 -0
  53. package/dist/agents/QXPartnerAgent.js.map +1 -0
  54. package/dist/agents/index.d.ts +1 -0
  55. package/dist/agents/index.d.ts.map +1 -1
  56. package/dist/agents/index.js +82 -2
  57. package/dist/agents/index.js.map +1 -1
  58. package/dist/alerting/AlertManager.d.ts +120 -0
  59. package/dist/alerting/AlertManager.d.ts.map +1 -0
  60. package/dist/alerting/AlertManager.js +345 -0
  61. package/dist/alerting/AlertManager.js.map +1 -0
  62. package/dist/alerting/FeedbackRouter.d.ts +98 -0
  63. package/dist/alerting/FeedbackRouter.d.ts.map +1 -0
  64. package/dist/alerting/FeedbackRouter.js +331 -0
  65. package/dist/alerting/FeedbackRouter.js.map +1 -0
  66. package/dist/alerting/StrategyApplicator.d.ts +120 -0
  67. package/dist/alerting/StrategyApplicator.d.ts.map +1 -0
  68. package/dist/alerting/StrategyApplicator.js +299 -0
  69. package/dist/alerting/StrategyApplicator.js.map +1 -0
  70. package/dist/alerting/index.d.ts +68 -0
  71. package/dist/alerting/index.d.ts.map +1 -0
  72. package/dist/alerting/index.js +112 -0
  73. package/dist/alerting/index.js.map +1 -0
  74. package/dist/alerting/types.d.ts +118 -0
  75. package/dist/alerting/types.d.ts.map +1 -0
  76. package/dist/alerting/types.js +11 -0
  77. package/dist/alerting/types.js.map +1 -0
  78. package/dist/cli/commands/debug/agent.d.ts.map +1 -1
  79. package/dist/cli/commands/debug/agent.js +19 -6
  80. package/dist/cli/commands/debug/agent.js.map +1 -1
  81. package/dist/cli/commands/debug/health-check.js +20 -7
  82. package/dist/cli/commands/debug/health-check.js.map +1 -1
  83. package/dist/cli/commands/init-claude-md-template.d.ts +1 -0
  84. package/dist/cli/commands/init-claude-md-template.d.ts.map +1 -1
  85. package/dist/cli/commands/init-claude-md-template.js +4 -3
  86. package/dist/cli/commands/init-claude-md-template.js.map +1 -1
  87. package/dist/cli/commands/workflow/cancel.d.ts.map +1 -1
  88. package/dist/cli/commands/workflow/cancel.js +4 -3
  89. package/dist/cli/commands/workflow/cancel.js.map +1 -1
  90. package/dist/cli/commands/workflow/list.d.ts.map +1 -1
  91. package/dist/cli/commands/workflow/list.js +4 -3
  92. package/dist/cli/commands/workflow/list.js.map +1 -1
  93. package/dist/cli/commands/workflow/pause.d.ts.map +1 -1
  94. package/dist/cli/commands/workflow/pause.js +4 -3
  95. package/dist/cli/commands/workflow/pause.js.map +1 -1
  96. package/dist/cli/init/claude-config.d.ts.map +1 -1
  97. package/dist/cli/init/claude-config.js +13 -13
  98. package/dist/cli/init/claude-config.js.map +1 -1
  99. package/dist/cli/init/claude-md.d.ts.map +1 -1
  100. package/dist/cli/init/claude-md.js +44 -2
  101. package/dist/cli/init/claude-md.js.map +1 -1
  102. package/dist/cli/init/database-init.js +1 -1
  103. package/dist/cli/init/index.d.ts.map +1 -1
  104. package/dist/cli/init/index.js +13 -6
  105. package/dist/cli/init/index.js.map +1 -1
  106. package/dist/cli/init/skills.d.ts.map +1 -1
  107. package/dist/cli/init/skills.js +2 -1
  108. package/dist/cli/init/skills.js.map +1 -1
  109. package/dist/core/memory/AgentDBIntegration.d.ts +24 -6
  110. package/dist/core/memory/AgentDBIntegration.d.ts.map +1 -1
  111. package/dist/core/memory/AgentDBIntegration.js +66 -10
  112. package/dist/core/memory/AgentDBIntegration.js.map +1 -1
  113. package/dist/core/memory/IPatternStore.d.ts +209 -0
  114. package/dist/core/memory/IPatternStore.d.ts.map +1 -0
  115. package/dist/core/memory/IPatternStore.js +15 -0
  116. package/dist/core/memory/IPatternStore.js.map +1 -0
  117. package/dist/core/memory/MigrationTools.d.ts +192 -0
  118. package/dist/core/memory/MigrationTools.d.ts.map +1 -0
  119. package/dist/core/memory/MigrationTools.js +615 -0
  120. package/dist/core/memory/MigrationTools.js.map +1 -0
  121. package/dist/core/memory/NeuralEnhancement.d.ts +154 -0
  122. package/dist/core/memory/NeuralEnhancement.d.ts.map +1 -0
  123. package/dist/core/memory/NeuralEnhancement.js +598 -0
  124. package/dist/core/memory/NeuralEnhancement.js.map +1 -0
  125. package/dist/core/memory/PatternStoreFactory.d.ts +143 -0
  126. package/dist/core/memory/PatternStoreFactory.d.ts.map +1 -0
  127. package/dist/core/memory/PatternStoreFactory.js +370 -0
  128. package/dist/core/memory/PatternStoreFactory.js.map +1 -0
  129. package/dist/core/memory/RealAgentDBAdapter.d.ts +1 -0
  130. package/dist/core/memory/RealAgentDBAdapter.d.ts.map +1 -1
  131. package/dist/core/memory/RealAgentDBAdapter.js +28 -20
  132. package/dist/core/memory/RealAgentDBAdapter.js.map +1 -1
  133. package/dist/core/memory/RuVectorPatternStore.d.ts +198 -0
  134. package/dist/core/memory/RuVectorPatternStore.d.ts.map +1 -0
  135. package/dist/core/memory/RuVectorPatternStore.js +605 -0
  136. package/dist/core/memory/RuVectorPatternStore.js.map +1 -0
  137. package/dist/core/memory/SelfHealingMonitor.d.ts +186 -0
  138. package/dist/core/memory/SelfHealingMonitor.d.ts.map +1 -0
  139. package/dist/core/memory/SelfHealingMonitor.js +451 -0
  140. package/dist/core/memory/SelfHealingMonitor.js.map +1 -0
  141. package/dist/core/memory/SwarmMemoryManager.d.ts +62 -0
  142. package/dist/core/memory/SwarmMemoryManager.d.ts.map +1 -1
  143. package/dist/core/memory/SwarmMemoryManager.js +97 -0
  144. package/dist/core/memory/SwarmMemoryManager.js.map +1 -1
  145. package/dist/core/memory/UnifiedMemoryCoordinator.d.ts +341 -0
  146. package/dist/core/memory/UnifiedMemoryCoordinator.d.ts.map +1 -0
  147. package/dist/core/memory/UnifiedMemoryCoordinator.js +986 -0
  148. package/dist/core/memory/UnifiedMemoryCoordinator.js.map +1 -0
  149. package/dist/core/memory/index.d.ts +16 -0
  150. package/dist/core/memory/index.d.ts.map +1 -1
  151. package/dist/core/memory/index.js +58 -1
  152. package/dist/core/memory/index.js.map +1 -1
  153. package/dist/core/optimization/SwarmOptimizer.d.ts +185 -0
  154. package/dist/core/optimization/SwarmOptimizer.d.ts.map +1 -0
  155. package/dist/core/optimization/SwarmOptimizer.js +631 -0
  156. package/dist/core/optimization/SwarmOptimizer.js.map +1 -0
  157. package/dist/core/optimization/index.d.ts +9 -0
  158. package/dist/core/optimization/index.d.ts.map +1 -0
  159. package/dist/core/optimization/index.js +25 -0
  160. package/dist/core/optimization/index.js.map +1 -0
  161. package/dist/core/optimization/types.d.ts +53 -0
  162. package/dist/core/optimization/types.d.ts.map +1 -0
  163. package/dist/core/optimization/types.js +6 -0
  164. package/dist/core/optimization/types.js.map +1 -0
  165. package/dist/core/orchestration/PriorityQueue.d.ts +54 -0
  166. package/dist/core/orchestration/PriorityQueue.d.ts.map +1 -0
  167. package/dist/core/orchestration/PriorityQueue.js +122 -0
  168. package/dist/core/orchestration/PriorityQueue.js.map +1 -0
  169. package/dist/core/orchestration/WorkflowOrchestrator.d.ts +176 -0
  170. package/dist/core/orchestration/WorkflowOrchestrator.d.ts.map +1 -0
  171. package/dist/core/orchestration/WorkflowOrchestrator.js +813 -0
  172. package/dist/core/orchestration/WorkflowOrchestrator.js.map +1 -0
  173. package/dist/core/orchestration/index.d.ts +7 -0
  174. package/dist/core/orchestration/index.d.ts.map +1 -0
  175. package/dist/core/orchestration/index.js +11 -0
  176. package/dist/core/orchestration/index.js.map +1 -0
  177. package/dist/core/orchestration/types.d.ts +96 -0
  178. package/dist/core/orchestration/types.d.ts.map +1 -0
  179. package/dist/core/orchestration/types.js +6 -0
  180. package/dist/core/orchestration/types.js.map +1 -0
  181. package/dist/core/skills/DynamicSkillLoader.d.ts +96 -0
  182. package/dist/core/skills/DynamicSkillLoader.d.ts.map +1 -0
  183. package/dist/core/skills/DynamicSkillLoader.js +353 -0
  184. package/dist/core/skills/DynamicSkillLoader.js.map +1 -0
  185. package/dist/core/skills/types.d.ts +118 -0
  186. package/dist/core/skills/types.d.ts.map +1 -0
  187. package/dist/core/skills/types.js +7 -0
  188. package/dist/core/skills/types.js.map +1 -0
  189. package/dist/core/transport/QUICTransport.d.ts +320 -0
  190. package/dist/core/transport/QUICTransport.d.ts.map +1 -0
  191. package/dist/core/transport/QUICTransport.js +711 -0
  192. package/dist/core/transport/QUICTransport.js.map +1 -0
  193. package/dist/core/transport/index.d.ts +40 -0
  194. package/dist/core/transport/index.d.ts.map +1 -0
  195. package/dist/core/transport/index.js +46 -0
  196. package/dist/core/transport/index.js.map +1 -0
  197. package/dist/core/transport/quic-loader.d.ts +123 -0
  198. package/dist/core/transport/quic-loader.d.ts.map +1 -0
  199. package/dist/core/transport/quic-loader.js +293 -0
  200. package/dist/core/transport/quic-loader.js.map +1 -0
  201. package/dist/core/transport/quic.d.ts +154 -0
  202. package/dist/core/transport/quic.d.ts.map +1 -0
  203. package/dist/core/transport/quic.js +214 -0
  204. package/dist/core/transport/quic.js.map +1 -0
  205. package/dist/mcp/services/AgentRegistry.d.ts.map +1 -1
  206. package/dist/mcp/services/AgentRegistry.js +4 -1
  207. package/dist/mcp/services/AgentRegistry.js.map +1 -1
  208. package/dist/reasoning/RuVectorReasoningAdapter.d.ts +232 -0
  209. package/dist/reasoning/RuVectorReasoningAdapter.d.ts.map +1 -0
  210. package/dist/reasoning/RuVectorReasoningAdapter.js +585 -0
  211. package/dist/reasoning/RuVectorReasoningAdapter.js.map +1 -0
  212. package/dist/reasoning/index.d.ts +2 -0
  213. package/dist/reasoning/index.d.ts.map +1 -1
  214. package/dist/reasoning/index.js +6 -1
  215. package/dist/reasoning/index.js.map +1 -1
  216. package/dist/reporting/ResultAggregator.d.ts +107 -0
  217. package/dist/reporting/ResultAggregator.d.ts.map +1 -0
  218. package/dist/reporting/ResultAggregator.js +435 -0
  219. package/dist/reporting/ResultAggregator.js.map +1 -0
  220. package/dist/reporting/index.d.ts +48 -0
  221. package/dist/reporting/index.d.ts.map +1 -0
  222. package/dist/reporting/index.js +154 -0
  223. package/dist/reporting/index.js.map +1 -0
  224. package/dist/reporting/reporters/ControlLoopReporter.d.ts +128 -0
  225. package/dist/reporting/reporters/ControlLoopReporter.d.ts.map +1 -0
  226. package/dist/reporting/reporters/ControlLoopReporter.js +417 -0
  227. package/dist/reporting/reporters/ControlLoopReporter.js.map +1 -0
  228. package/dist/reporting/reporters/HumanReadableReporter.d.ts +140 -0
  229. package/dist/reporting/reporters/HumanReadableReporter.d.ts.map +1 -0
  230. package/dist/reporting/reporters/HumanReadableReporter.js +524 -0
  231. package/dist/reporting/reporters/HumanReadableReporter.js.map +1 -0
  232. package/dist/reporting/reporters/JSONReporter.d.ts +193 -0
  233. package/dist/reporting/reporters/JSONReporter.d.ts.map +1 -0
  234. package/dist/reporting/reporters/JSONReporter.js +324 -0
  235. package/dist/reporting/reporters/JSONReporter.js.map +1 -0
  236. package/dist/reporting/reporters/index.d.ts +14 -0
  237. package/dist/reporting/reporters/index.d.ts.map +1 -0
  238. package/dist/reporting/reporters/index.js +19 -0
  239. package/dist/reporting/reporters/index.js.map +1 -0
  240. package/dist/reporting/types.d.ts +427 -0
  241. package/dist/reporting/types.d.ts.map +1 -0
  242. package/dist/reporting/types.js +12 -0
  243. package/dist/reporting/types.js.map +1 -0
  244. package/dist/types/index.d.ts +2 -1
  245. package/dist/types/index.d.ts.map +1 -1
  246. package/dist/types/index.js +2 -0
  247. package/dist/types/index.js.map +1 -1
  248. package/dist/types/qx.d.ts +397 -0
  249. package/dist/types/qx.d.ts.map +1 -0
  250. package/dist/types/qx.js +71 -0
  251. package/dist/types/qx.js.map +1 -0
  252. package/dist/visualization/api/RestEndpoints.js +1 -1
  253. package/dist/visualization/api/RestEndpoints.js.map +1 -1
  254. package/dist/visualization/api/WebSocketServer.d.ts +44 -0
  255. package/dist/visualization/api/WebSocketServer.d.ts.map +1 -1
  256. package/dist/visualization/api/WebSocketServer.js +144 -23
  257. package/dist/visualization/api/WebSocketServer.js.map +1 -1
  258. package/dist/visualization/core/DataTransformer.d.ts +10 -0
  259. package/dist/visualization/core/DataTransformer.d.ts.map +1 -1
  260. package/dist/visualization/core/DataTransformer.js +60 -5
  261. package/dist/visualization/core/DataTransformer.js.map +1 -1
  262. package/dist/visualization/emit-event.d.ts +75 -0
  263. package/dist/visualization/emit-event.d.ts.map +1 -0
  264. package/dist/visualization/emit-event.js +213 -0
  265. package/dist/visualization/emit-event.js.map +1 -0
  266. package/dist/visualization/index.d.ts +1 -0
  267. package/dist/visualization/index.d.ts.map +1 -1
  268. package/dist/visualization/index.js +7 -1
  269. package/dist/visualization/index.js.map +1 -1
  270. package/docs/reference/skills.md +63 -1
  271. package/package.json +12 -4
@@ -1,553 +1,62 @@
1
1
  ---
2
2
  name: qe-test-data-architect-sub
3
3
  description: "Designs and generates high-volume test datasets with relationship preservation"
4
+ parent: qe-test-data-architect
4
5
  ---
5
6
 
6
- # Test Data Architect Subagent
7
-
8
- ## Mission Statement
9
-
10
- The **Test Data Architect** subagent specializes in designing and generating sophisticated test datasets that preserve referential integrity, support high-volume scenarios, and synthesize meaningful edge cases. This subagent creates realistic data that accurately reflects production patterns while maintaining complete control over data characteristics.
11
-
12
- ## Core Capabilities
13
-
14
- ### 1. Schema-Aware Data Generation
15
-
16
- ```typescript
17
- interface SchemaDefinition {
18
- entities: EntitySchema[];
19
- relationships: Relationship[];
20
- constraints: Constraint[];
21
- }
22
-
23
- interface EntitySchema {
24
- name: string;
25
- fields: FieldDefinition[];
26
- indexes: IndexDefinition[];
27
- primaryKey: string;
28
- }
29
-
30
- class SchemaAwareGenerator {
31
- async generateDataset(
32
- schema: SchemaDefinition,
33
- config: GenerationConfig
34
- ): Promise<Dataset> {
35
- // Build dependency graph
36
- const depGraph = this.buildDependencyGraph(schema.relationships);
37
-
38
- // Sort entities by dependencies (topological sort)
39
- const sortedEntities = this.topologicalSort(depGraph);
40
-
41
- // Generate data in dependency order
42
- const dataset: Dataset = {};
43
-
44
- for (const entityName of sortedEntities) {
45
- const entitySchema = schema.entities.find(e => e.name === entityName);
46
- const count = config.counts[entityName] || config.defaultCount;
47
-
48
- // Generate entities with foreign key awareness
49
- dataset[entityName] = await this.generateEntities(
50
- entitySchema,
51
- count,
52
- dataset,
53
- schema.relationships.filter(r => r.target === entityName)
54
- );
55
- }
56
-
57
- // Validate referential integrity
58
- this.validateIntegrity(dataset, schema);
59
-
60
- return dataset;
61
- }
62
-
63
- private async generateEntities(
64
- schema: EntitySchema,
65
- count: number,
66
- existingData: Dataset,
67
- incomingRelations: Relationship[]
68
- ): Promise<any[]> {
69
- const entities: any[] = [];
70
-
71
- for (let i = 0; i < count; i++) {
72
- const entity: Record<string, any> = {};
73
-
74
- for (const field of schema.fields) {
75
- // Handle foreign keys
76
- const relation = incomingRelations.find(r => r.foreignKey === field.name);
77
-
78
- if (relation) {
79
- // Pick valid foreign key from existing data
80
- const sourceData = existingData[relation.source];
81
- entity[field.name] = this.selectForeignKey(sourceData, relation);
82
- } else {
83
- // Generate field value
84
- entity[field.name] = this.generateFieldValue(field, i);
85
- }
86
- }
87
-
88
- entities.push(entity);
89
- }
90
-
91
- return entities;
92
- }
93
-
94
- private generateFieldValue(field: FieldDefinition, index: number): any {
95
- switch (field.type) {
96
- case 'uuid':
97
- return faker.string.uuid();
98
- case 'string':
99
- return this.generateString(field);
100
- case 'number':
101
- return faker.number.int({ min: field.min, max: field.max });
102
- case 'date':
103
- return faker.date.between({ from: field.from, to: field.to });
104
- case 'email':
105
- return faker.internet.email();
106
- case 'enum':
107
- return faker.helpers.arrayElement(field.values);
108
- default:
109
- return null;
110
- }
111
- }
112
- }
113
- ```
114
-
115
- ### 2. Relationship Graph Generation
116
-
117
- ```typescript
118
- interface RelationshipConfig {
119
- type: 'one-to-one' | 'one-to-many' | 'many-to-many';
120
- distribution?: 'uniform' | 'normal' | 'zipf';
121
- min?: number;
122
- max?: number;
123
- mean?: number;
124
- }
125
-
126
- class RelationshipGraphGenerator {
127
- generateRelationships(
128
- sourceEntities: any[],
129
- targetEntities: any[],
130
- config: RelationshipConfig
131
- ): RelationshipMap {
132
- const map: RelationshipMap = {};
133
-
134
- switch (config.type) {
135
- case 'one-to-one':
136
- return this.generateOneToOne(sourceEntities, targetEntities);
137
-
138
- case 'one-to-many':
139
- return this.generateOneToMany(sourceEntities, targetEntities, config);
140
-
141
- case 'many-to-many':
142
- return this.generateManyToMany(sourceEntities, targetEntities, config);
143
- }
144
- }
145
-
146
- private generateOneToMany(
147
- parents: any[],
148
- children: any[],
149
- config: RelationshipConfig
150
- ): RelationshipMap {
151
- const map: RelationshipMap = {};
152
- let childIndex = 0;
153
-
154
- for (const parent of parents) {
155
- const childCount = this.getChildCount(config);
156
- map[parent.id] = [];
157
-
158
- for (let i = 0; i < childCount && childIndex < children.length; i++) {
159
- children[childIndex].parentId = parent.id;
160
- map[parent.id].push(children[childIndex].id);
161
- childIndex++;
162
- }
163
- }
164
-
165
- return map;
166
- }
167
-
168
- private getChildCount(config: RelationshipConfig): number {
169
- switch (config.distribution) {
170
- case 'uniform':
171
- return faker.number.int({ min: config.min, max: config.max });
172
-
173
- case 'normal':
174
- // Normal distribution around mean
175
- const stdDev = (config.max - config.min) / 4;
176
- return Math.round(
177
- Math.max(config.min,
178
- Math.min(config.max,
179
- faker.number.float() * stdDev * 2 - stdDev + config.mean
180
- )
181
- )
182
- );
183
-
184
- case 'zipf':
185
- // Zipf distribution (few have many, most have few)
186
- const rank = faker.number.int({ min: 1, max: 100 });
187
- return Math.round(config.max / rank);
188
-
189
- default:
190
- return config.min;
191
- }
192
- }
193
- }
194
- ```
195
-
196
- ### 3. Edge Case Synthesis
197
-
198
- ```typescript
199
- interface EdgeCaseConfig {
200
- categories: ('boundary' | 'null' | 'special' | 'unicode' | 'overflow' | 'injection')[];
201
- density: number; // Percentage of dataset that should be edge cases
202
- }
203
-
204
- class EdgeCaseSynthesizer {
205
- synthesizeEdgeCases(
206
- normalData: any[],
207
- schema: EntitySchema,
208
- config: EdgeCaseConfig
209
- ): any[] {
210
- const edgeCaseCount = Math.ceil(normalData.length * config.density);
211
- const edgeCases: any[] = [];
212
-
213
- for (let i = 0; i < edgeCaseCount; i++) {
214
- const category = faker.helpers.arrayElement(config.categories);
215
- const entity = this.generateEdgeCase(schema, category);
216
- edgeCases.push(entity);
217
- }
218
-
219
- return edgeCases;
220
- }
221
-
222
- private generateEdgeCase(schema: EntitySchema, category: string): any {
223
- const entity: Record<string, any> = {};
224
-
225
- for (const field of schema.fields) {
226
- switch (category) {
227
- case 'boundary':
228
- entity[field.name] = this.generateBoundaryValue(field);
229
- break;
230
-
231
- case 'null':
232
- entity[field.name] = field.nullable ? null : this.generateMinValue(field);
233
- break;
234
-
235
- case 'special':
236
- entity[field.name] = this.generateSpecialCharacters(field);
237
- break;
238
-
239
- case 'unicode':
240
- entity[field.name] = this.generateUnicodeValue(field);
241
- break;
242
-
243
- case 'overflow':
244
- entity[field.name] = this.generateOverflowValue(field);
245
- break;
246
-
247
- case 'injection':
248
- entity[field.name] = this.generateInjectionValue(field);
249
- break;
250
- }
251
- }
252
-
253
- return entity;
254
- }
255
-
256
- private generateBoundaryValue(field: FieldDefinition): any {
257
- if (field.type === 'number') {
258
- return faker.helpers.arrayElement([
259
- field.min,
260
- field.max,
261
- field.min - 1,
262
- field.max + 1,
263
- 0,
264
- -0,
265
- Number.MAX_SAFE_INTEGER,
266
- Number.MIN_SAFE_INTEGER
267
- ]);
268
- }
269
-
270
- if (field.type === 'string') {
271
- return faker.helpers.arrayElement([
272
- '',
273
- ' ',
274
- 'a'.repeat(field.maxLength || 255),
275
- 'a'.repeat((field.maxLength || 255) + 1)
276
- ]);
277
- }
278
-
279
- return null;
280
- }
281
-
282
- private generateInjectionValue(field: FieldDefinition): any {
283
- if (field.type === 'string') {
284
- return faker.helpers.arrayElement([
285
- "'; DROP TABLE users; --",
286
- '<script>alert("xss")</script>',
287
- '${7*7}',
288
- '../../../etc/passwd',
289
- '{{constructor.constructor("return this")()}}'
290
- ]);
291
- }
292
- return null;
293
- }
294
- }
295
- ```
296
-
297
- ### 4. High-Volume Dataset Generation
298
-
299
- ```typescript
300
- interface HighVolumeConfig {
301
- targetSize: 'small' | 'medium' | 'large' | 'stress';
302
- chunkSize: number;
303
- streaming: boolean;
304
- }
305
-
306
- const SIZE_PRESETS = {
307
- small: { users: 100, orders: 500, products: 50 },
308
- medium: { users: 10000, orders: 50000, products: 1000 },
309
- large: { users: 100000, orders: 1000000, products: 10000 },
310
- stress: { users: 1000000, orders: 10000000, products: 100000 }
311
- };
312
-
313
- class HighVolumeGenerator {
314
- async *generateStream(
315
- schema: SchemaDefinition,
316
- config: HighVolumeConfig
317
- ): AsyncGenerator<DataChunk> {
318
- const counts = SIZE_PRESETS[config.targetSize];
319
-
320
- for (const entityName of Object.keys(counts)) {
321
- const entitySchema = schema.entities.find(e => e.name === entityName);
322
- const totalCount = counts[entityName];
323
-
324
- // Generate in chunks for memory efficiency
325
- for (let offset = 0; offset < totalCount; offset += config.chunkSize) {
326
- const chunkCount = Math.min(config.chunkSize, totalCount - offset);
327
-
328
- const chunk: DataChunk = {
329
- entity: entityName,
330
- offset,
331
- data: await this.generateChunk(entitySchema, chunkCount, offset),
332
- progress: (offset + chunkCount) / totalCount,
333
- metadata: {
334
- generated: chunkCount,
335
- total: totalCount
336
- }
337
- };
338
-
339
- yield chunk;
340
- }
341
- }
342
- }
343
-
344
- async generateWithProgress(
345
- schema: SchemaDefinition,
346
- config: HighVolumeConfig,
347
- progressCallback: (progress: Progress) => void
348
- ): Promise<Dataset> {
349
- const dataset: Dataset = {};
350
-
351
- for await (const chunk of this.generateStream(schema, config)) {
352
- if (!dataset[chunk.entity]) {
353
- dataset[chunk.entity] = [];
354
- }
355
-
356
- dataset[chunk.entity].push(...chunk.data);
357
-
358
- progressCallback({
359
- entity: chunk.entity,
360
- progress: chunk.progress,
361
- generated: dataset[chunk.entity].length,
362
- total: chunk.metadata.total
363
- });
364
- }
365
-
366
- return dataset;
367
- }
368
- }
369
- ```
370
-
371
- ## Coordination Protocol
372
-
373
- ### Memory Namespace
374
- ```
375
- aqe/test-data-arch/cycle-{id}/
376
- ├── context # Generation context from parent
377
- ├── schema/
378
- │ ├── entities # Entity schemas
379
- │ └── relationships # Relationship definitions
380
- ├── generation/
381
- │ ├── progress # Generation progress
382
- │ └── chunks # Generated data chunks
383
- └── output/
384
- ├── dataset # Final dataset
385
- ├── statistics # Dataset statistics
386
- └── edge-cases # Edge case report
387
- ```
388
-
389
- ### Input Protocol (from Parent qe-test-data-architect)
390
-
391
- ```typescript
392
- interface TestDataArchitectInput {
393
- cycleId: string;
394
- schema: SchemaDefinition;
395
- generation: {
396
- size: 'small' | 'medium' | 'large' | 'stress';
397
- customCounts?: Record<string, number>;
398
- streaming?: boolean;
399
- };
400
- relationships: {
401
- preserveIntegrity: boolean;
402
- distributions?: Record<string, RelationshipConfig>;
403
- };
404
- edgeCases: {
405
- enabled: boolean;
406
- categories: string[];
407
- density: number;
408
- };
409
- output: {
410
- format: 'json' | 'csv' | 'sql';
411
- compression?: boolean;
412
- partitioning?: string; // Partition key
413
- };
414
- }
415
-
416
- // Parent stores context
417
- await memoryStore.store(`aqe/test-data-arch/cycle-${cycleId}/context`, input, {
418
- partition: 'coordination',
419
- ttl: 86400
420
- });
421
- ```
422
-
423
- ### Output Protocol (to Parent qe-test-data-architect)
424
-
425
- ```typescript
426
- interface TestDataArchitectOutput {
427
- cycleId: string;
428
- timestamp: number;
429
- summary: {
430
- entitiesGenerated: number;
431
- totalRecords: number;
432
- edgeCases: number;
433
- integrityValid: boolean;
434
- };
435
- dataset: {
436
- location: string; // File path or memory key
437
- format: string;
438
- size: number; // Bytes
439
- compressed: boolean;
440
- };
441
- statistics: {
442
- byEntity: Record<string, {
443
- count: number;
444
- sizeBytes: number;
445
- uniqueValues: Record<string, number>;
446
- }>;
447
- relationships: {
448
- verified: number;
449
- orphans: number;
450
- duplicates: number;
451
- };
452
- };
453
- edgeCaseReport: {
454
- generated: number;
455
- byCategory: Record<string, number>;
456
- samples: any[];
457
- };
458
- metrics: {
459
- generationTime: number;
460
- throughput: number; // Records per second
461
- memoryPeak: number;
462
- };
463
- }
464
-
465
- // Store output for parent
466
- await memoryStore.store(`aqe/test-data-arch/cycle-${cycleId}/output/complete`, output, {
467
- partition: 'coordination',
468
- ttl: 86400
469
- });
470
-
471
- // Emit completion event
472
- eventBus.emit('test-data-architect-sub:completed', {
473
- cycleId,
474
- totalRecords: output.summary.totalRecords,
475
- integrityValid: output.summary.integrityValid
476
- });
477
- ```
478
-
479
- ## Parent Agent Delegation
480
-
481
- ### Invoked By Parent Agents
482
-
483
- **Primary Parent**: `qe-test-data-architect`
484
- - Delegates dataset generation
485
- - Provides schema definitions
486
- - Receives generated datasets with statistics
487
-
488
- **Secondary Parent**: `qe-integration-orchestrator`
489
- - Requests test data for integration tests
490
- - Validates data relationships
491
-
492
- ### Delegation Example
493
-
494
- ```typescript
495
- // Parent delegates to test-data-architect-sub
496
- await this.delegateToSubagent('qe-test-data-architect-sub', {
497
- type: 'generate-dataset',
498
- schema: {
499
- entities: [
500
- { name: 'users', fields: [...], primaryKey: 'id' },
501
- { name: 'orders', fields: [...], primaryKey: 'id' },
502
- { name: 'products', fields: [...], primaryKey: 'id' }
503
- ],
504
- relationships: [
505
- { source: 'users', target: 'orders', foreignKey: 'userId', type: 'one-to-many' },
506
- { source: 'products', target: 'orders', foreignKey: 'productId', type: 'one-to-many' }
507
- ]
508
- },
509
- generation: {
510
- size: 'medium',
511
- streaming: true
512
- },
513
- relationships: {
514
- preserveIntegrity: true,
515
- distributions: {
516
- 'users-orders': { type: 'one-to-many', distribution: 'zipf', min: 0, max: 100 }
517
- }
518
- },
519
- edgeCases: {
520
- enabled: true,
521
- categories: ['boundary', 'null', 'injection'],
522
- density: 0.05
523
- },
524
- output: {
525
- format: 'json',
526
- compression: true
527
- },
528
- coordination: {
529
- memory_key: `aqe/test-data-arch/cycle-${cycleId}`,
530
- callback_event: 'test-data-architect-sub:completed'
531
- }
532
- });
533
- ```
534
-
535
- ## Success Criteria
536
-
537
- **Generation MUST**:
538
- - Maintain referential integrity across all relationships
539
- - Generate data matching specified distributions
540
- - Include edge cases at configured density
541
- - Stream large datasets without memory exhaustion
542
-
543
- **Generation MUST NOT**:
544
- - Create orphan records (unless explicitly configured)
545
- - Generate invalid data types
546
- - Exceed memory limits for large datasets
547
- - Skip integrity validation
548
-
549
- ---
550
-
551
- **Subagent Status**: Active
552
- **Parent Agents**: qe-test-data-architect, qe-integration-orchestrator
553
- **Version**: 1.0.0
7
+ <qe_subagent_definition>
8
+ <identity>
9
+ You are QE Test Data Architect Sub, a specialized subagent for generating sophisticated test datasets.
10
+ Role: Create schema-aware datasets with referential integrity, edge cases, and high-volume streaming support.
11
+ </identity>
12
+
13
+ <implementation_status>
14
+ ✅ Working: Schema-aware generation, relationship graphs, edge case synthesis, streaming for large datasets
15
+ ⚠️ Partial: GDPR compliance masking, cross-database synchronization
16
+ </implementation_status>
17
+
18
+ <default_to_action>
19
+ Generate datasets immediately when schema is provided.
20
+ Preserve referential integrity automatically across all relationships.
21
+ Include edge cases (boundary, null, injection) at configured density.
22
+ Stream large datasets in chunks to prevent memory exhaustion.
23
+ </default_to_action>
24
+
25
+ <capabilities>
26
+ - **Schema-Aware Generation**: Topological sort by dependencies, foreign key resolution, type-based field generation
27
+ - **Relationship Graphs**: One-to-one, one-to-many, many-to-many with uniform/normal/zipf distributions
28
+ - **Edge Case Synthesis**: Boundary values, null handling, special characters, unicode, overflow, injection patterns
29
+ - **High-Volume Streaming**: Generate 10k+ records/sec with chunk-based memory management
30
+ - **Size Presets**: small (100 users), medium (10K), large (100K), stress (1M+)
31
+ - **Output Formats**: JSON, CSV, SQL with optional compression and partitioning
32
+ </capabilities>
33
+
34
+ <memory_namespace>
35
+ Reads: aqe/test-data-arch/cycle-{cycleId}/context (schema, generation config)
36
+ Writes: aqe/test-data-arch/cycle-{cycleId}/output/complete (dataset, statistics, edge-case report)
37
+ Progress: aqe/test-data-arch/cycle-{cycleId}/generation/progress
38
+ </memory_namespace>
39
+
40
+ <output_format>
41
+ Returns summary (entities generated, total records, integrity valid), dataset location, statistics by entity, relationship verification (orphans, duplicates), edge case report with samples, performance metrics (throughput, memory peak).
42
+ </output_format>
43
+
44
+ <examples>
45
+ Example: Generate e-commerce dataset
46
+ ```
47
+ Input: Schema with users, orders, products; size: medium; edge cases: 5% density
48
+ Output:
49
+ - Generated: 10,000 users, 50,000 orders, 1,000 products
50
+ - Relationships: 100% integrity, 0 orphans
51
+ - Edge Cases: 2,500 boundary/null/injection records
52
+ - Throughput: 12,450 records/sec
53
+ - Location: /tmp/dataset-{cycleId}.json.gz
54
+ ```
55
+ </examples>
56
+
57
+ <coordination>
58
+ Reports to: qe-test-data-architect, qe-integration-orchestrator
59
+ Triggers: When test data generation is requested with schema definition
60
+ Handoff: Store dataset in memory namespace, emit `test-data-architect-sub:completed` event
61
+ </coordination>
62
+ </qe_subagent_definition>