qa360 1.4.5 → 2.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 (209) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/ai.d.ts +41 -0
  3. package/dist/commands/ai.js +499 -0
  4. package/dist/commands/ask.js +12 -12
  5. package/dist/commands/coverage.d.ts +8 -0
  6. package/dist/commands/coverage.js +252 -0
  7. package/dist/commands/explain.d.ts +27 -0
  8. package/dist/commands/explain.js +630 -0
  9. package/dist/commands/flakiness.d.ts +73 -0
  10. package/dist/commands/flakiness.js +435 -0
  11. package/dist/commands/generate.d.ts +66 -0
  12. package/dist/commands/generate.js +438 -0
  13. package/dist/commands/init.d.ts +56 -9
  14. package/dist/commands/init.js +217 -10
  15. package/dist/commands/monitor.d.ts +27 -0
  16. package/dist/commands/monitor.js +225 -0
  17. package/dist/commands/ollama.d.ts +40 -0
  18. package/dist/commands/ollama.js +301 -0
  19. package/dist/commands/pack.d.ts +37 -9
  20. package/dist/commands/pack.js +240 -141
  21. package/dist/commands/regression.d.ts +8 -0
  22. package/dist/commands/regression.js +340 -0
  23. package/dist/commands/repair.d.ts +26 -0
  24. package/dist/commands/repair.js +307 -0
  25. package/dist/commands/retry.d.ts +43 -0
  26. package/dist/commands/retry.js +275 -0
  27. package/dist/commands/run.d.ts +8 -3
  28. package/dist/commands/run.js +45 -31
  29. package/dist/commands/slo.d.ts +8 -0
  30. package/dist/commands/slo.js +327 -0
  31. package/dist/core/adapters/playwright-native-api.d.ts +183 -0
  32. package/dist/core/adapters/playwright-native-api.js +461 -0
  33. package/dist/core/adapters/playwright-ui.d.ts +7 -0
  34. package/dist/core/adapters/playwright-ui.js +29 -1
  35. package/dist/core/ai/anthropic-provider.d.ts +50 -0
  36. package/dist/core/ai/anthropic-provider.js +211 -0
  37. package/dist/core/ai/deepseek-provider.d.ts +81 -0
  38. package/dist/core/ai/deepseek-provider.js +254 -0
  39. package/dist/core/ai/index.d.ts +60 -0
  40. package/dist/core/ai/index.js +18 -0
  41. package/dist/core/ai/llm-client.d.ts +45 -0
  42. package/dist/core/ai/llm-client.js +7 -0
  43. package/dist/core/ai/mock-provider.d.ts +49 -0
  44. package/dist/core/ai/mock-provider.js +121 -0
  45. package/dist/core/ai/ollama-provider.d.ts +78 -0
  46. package/dist/core/ai/ollama-provider.js +192 -0
  47. package/dist/core/ai/openai-provider.d.ts +48 -0
  48. package/dist/core/ai/openai-provider.js +188 -0
  49. package/dist/core/ai/provider-factory.d.ts +160 -0
  50. package/dist/core/ai/provider-factory.js +269 -0
  51. package/dist/core/auth/api-key-provider.d.ts +16 -0
  52. package/dist/core/auth/api-key-provider.js +63 -0
  53. package/dist/core/auth/aws-iam-provider.d.ts +35 -0
  54. package/dist/core/auth/aws-iam-provider.js +177 -0
  55. package/dist/core/auth/azure-ad-provider.d.ts +15 -0
  56. package/dist/core/auth/azure-ad-provider.js +99 -0
  57. package/dist/core/auth/basic-auth-provider.d.ts +26 -0
  58. package/dist/core/auth/basic-auth-provider.js +111 -0
  59. package/dist/core/auth/gcp-adc-provider.d.ts +27 -0
  60. package/dist/core/auth/gcp-adc-provider.js +126 -0
  61. package/dist/core/auth/index.d.ts +238 -0
  62. package/dist/core/auth/index.js +82 -0
  63. package/dist/core/auth/jwt-provider.d.ts +19 -0
  64. package/dist/core/auth/jwt-provider.js +160 -0
  65. package/dist/core/auth/manager.d.ts +84 -0
  66. package/dist/core/auth/manager.js +230 -0
  67. package/dist/core/auth/oauth2-provider.d.ts +17 -0
  68. package/dist/core/auth/oauth2-provider.js +114 -0
  69. package/dist/core/auth/totp-provider.d.ts +31 -0
  70. package/dist/core/auth/totp-provider.js +134 -0
  71. package/dist/core/auth/ui-login-provider.d.ts +26 -0
  72. package/dist/core/auth/ui-login-provider.js +198 -0
  73. package/dist/core/cache/index.d.ts +7 -0
  74. package/dist/core/cache/index.js +6 -0
  75. package/dist/core/cache/lru-cache.d.ts +203 -0
  76. package/dist/core/cache/lru-cache.js +397 -0
  77. package/dist/core/coverage/analyzer.d.ts +101 -0
  78. package/dist/core/coverage/analyzer.js +415 -0
  79. package/dist/core/coverage/collector.d.ts +74 -0
  80. package/dist/core/coverage/collector.js +459 -0
  81. package/dist/core/coverage/config.d.ts +37 -0
  82. package/dist/core/coverage/config.js +156 -0
  83. package/dist/core/coverage/index.d.ts +11 -0
  84. package/dist/core/coverage/index.js +15 -0
  85. package/dist/core/coverage/types.d.ts +267 -0
  86. package/dist/core/coverage/types.js +6 -0
  87. package/dist/core/coverage/vault.d.ts +95 -0
  88. package/dist/core/coverage/vault.js +405 -0
  89. package/dist/core/dashboard/assets.d.ts +6 -0
  90. package/dist/core/dashboard/assets.js +690 -0
  91. package/dist/core/dashboard/index.d.ts +6 -0
  92. package/dist/core/dashboard/index.js +5 -0
  93. package/dist/core/dashboard/server.d.ts +72 -0
  94. package/dist/core/dashboard/server.js +354 -0
  95. package/dist/core/dashboard/types.d.ts +70 -0
  96. package/dist/core/dashboard/types.js +5 -0
  97. package/dist/core/discoverer/index.d.ts +115 -0
  98. package/dist/core/discoverer/index.js +250 -0
  99. package/dist/core/flakiness/index.d.ts +228 -0
  100. package/dist/core/flakiness/index.js +384 -0
  101. package/dist/core/generation/code-formatter.d.ts +111 -0
  102. package/dist/core/generation/code-formatter.js +307 -0
  103. package/dist/core/generation/code-generator.d.ts +144 -0
  104. package/dist/core/generation/code-generator.js +293 -0
  105. package/dist/core/generation/generator.d.ts +40 -0
  106. package/dist/core/generation/generator.js +76 -0
  107. package/dist/core/generation/index.d.ts +30 -0
  108. package/dist/core/generation/index.js +28 -0
  109. package/dist/core/generation/pack-generator.d.ts +107 -0
  110. package/dist/core/generation/pack-generator.js +416 -0
  111. package/dist/core/generation/prompt-builder.d.ts +132 -0
  112. package/dist/core/generation/prompt-builder.js +672 -0
  113. package/dist/core/generation/source-analyzer.d.ts +213 -0
  114. package/dist/core/generation/source-analyzer.js +657 -0
  115. package/dist/core/generation/test-optimizer.d.ts +117 -0
  116. package/dist/core/generation/test-optimizer.js +328 -0
  117. package/dist/core/generation/types.d.ts +214 -0
  118. package/dist/core/generation/types.js +4 -0
  119. package/dist/core/index.d.ts +23 -1
  120. package/dist/core/index.js +39 -0
  121. package/dist/core/pack/validator.js +31 -1
  122. package/dist/core/pack-v2/index.d.ts +9 -0
  123. package/dist/core/pack-v2/index.js +8 -0
  124. package/dist/core/pack-v2/loader.d.ts +62 -0
  125. package/dist/core/pack-v2/loader.js +231 -0
  126. package/dist/core/pack-v2/migrator.d.ts +56 -0
  127. package/dist/core/pack-v2/migrator.js +455 -0
  128. package/dist/core/pack-v2/validator.d.ts +61 -0
  129. package/dist/core/pack-v2/validator.js +577 -0
  130. package/dist/core/regression/detector.d.ts +107 -0
  131. package/dist/core/regression/detector.js +497 -0
  132. package/dist/core/regression/index.d.ts +9 -0
  133. package/dist/core/regression/index.js +11 -0
  134. package/dist/core/regression/trend-analyzer.d.ts +102 -0
  135. package/dist/core/regression/trend-analyzer.js +345 -0
  136. package/dist/core/regression/types.d.ts +222 -0
  137. package/dist/core/regression/types.js +7 -0
  138. package/dist/core/regression/vault.d.ts +87 -0
  139. package/dist/core/regression/vault.js +289 -0
  140. package/dist/core/repair/engine/fixer.d.ts +24 -0
  141. package/dist/core/repair/engine/fixer.js +226 -0
  142. package/dist/core/repair/engine/suggestion-engine.d.ts +18 -0
  143. package/dist/core/repair/engine/suggestion-engine.js +187 -0
  144. package/dist/core/repair/index.d.ts +10 -0
  145. package/dist/core/repair/index.js +13 -0
  146. package/dist/core/repair/repairer.d.ts +90 -0
  147. package/dist/core/repair/repairer.js +284 -0
  148. package/dist/core/repair/types.d.ts +91 -0
  149. package/dist/core/repair/types.js +6 -0
  150. package/dist/core/repair/utils/error-analyzer.d.ts +28 -0
  151. package/dist/core/repair/utils/error-analyzer.js +264 -0
  152. package/dist/core/retry/flakiness-integration.d.ts +60 -0
  153. package/dist/core/retry/flakiness-integration.js +228 -0
  154. package/dist/core/retry/index.d.ts +14 -0
  155. package/dist/core/retry/index.js +16 -0
  156. package/dist/core/retry/retry-engine.d.ts +80 -0
  157. package/dist/core/retry/retry-engine.js +296 -0
  158. package/dist/core/retry/types.d.ts +178 -0
  159. package/dist/core/retry/types.js +52 -0
  160. package/dist/core/retry/vault.d.ts +77 -0
  161. package/dist/core/retry/vault.js +304 -0
  162. package/dist/core/runner/e2e-helpers.d.ts +102 -0
  163. package/dist/core/runner/e2e-helpers.js +153 -0
  164. package/dist/core/runner/phase3-runner.d.ts +101 -2
  165. package/dist/core/runner/phase3-runner.js +559 -24
  166. package/dist/core/self-healing/assertion-healer.d.ts +97 -0
  167. package/dist/core/self-healing/assertion-healer.js +371 -0
  168. package/dist/core/self-healing/engine.d.ts +122 -0
  169. package/dist/core/self-healing/engine.js +538 -0
  170. package/dist/core/self-healing/index.d.ts +10 -0
  171. package/dist/core/self-healing/index.js +11 -0
  172. package/dist/core/self-healing/selector-healer.d.ts +103 -0
  173. package/dist/core/self-healing/selector-healer.js +372 -0
  174. package/dist/core/self-healing/types.d.ts +152 -0
  175. package/dist/core/self-healing/types.js +6 -0
  176. package/dist/core/slo/config.d.ts +107 -0
  177. package/dist/core/slo/config.js +360 -0
  178. package/dist/core/slo/index.d.ts +11 -0
  179. package/dist/core/slo/index.js +15 -0
  180. package/dist/core/slo/sli-calculator.d.ts +92 -0
  181. package/dist/core/slo/sli-calculator.js +364 -0
  182. package/dist/core/slo/slo-tracker.d.ts +148 -0
  183. package/dist/core/slo/slo-tracker.js +379 -0
  184. package/dist/core/slo/types.d.ts +281 -0
  185. package/dist/core/slo/types.js +7 -0
  186. package/dist/core/slo/vault.d.ts +102 -0
  187. package/dist/core/slo/vault.js +427 -0
  188. package/dist/core/tui/index.d.ts +7 -0
  189. package/dist/core/tui/index.js +6 -0
  190. package/dist/core/tui/monitor.d.ts +92 -0
  191. package/dist/core/tui/monitor.js +271 -0
  192. package/dist/core/tui/renderer.d.ts +33 -0
  193. package/dist/core/tui/renderer.js +218 -0
  194. package/dist/core/tui/types.d.ts +63 -0
  195. package/dist/core/tui/types.js +5 -0
  196. package/dist/core/types/pack-v2.d.ts +425 -0
  197. package/dist/core/types/pack-v2.js +8 -0
  198. package/dist/core/vault/index.d.ts +116 -0
  199. package/dist/core/vault/index.js +400 -5
  200. package/dist/core/watch/index.d.ts +7 -0
  201. package/dist/core/watch/index.js +6 -0
  202. package/dist/core/watch/watch-mode.d.ts +213 -0
  203. package/dist/core/watch/watch-mode.js +389 -0
  204. package/dist/index.js +68 -68
  205. package/dist/utils/config.d.ts +5 -0
  206. package/dist/utils/config.js +136 -0
  207. package/package.json +5 -1
  208. package/dist/core/adapters/playwright-api.d.ts +0 -82
  209. package/dist/core/adapters/playwright-api.js +0 -264
@@ -0,0 +1,425 @@
1
+ /**
2
+ * QA360 Pack Configuration v2
3
+ *
4
+ * New version with test_files patterns and auth profiles.
5
+ * Maintains backward compatibility with v1 concepts while adding
6
+ * AI-generated code support and comprehensive authentication.
7
+ */
8
+ /**
9
+ * Pack Configuration v2
10
+ */
11
+ export interface PackConfigV2 {
12
+ version: 2;
13
+ name: string;
14
+ description?: string;
15
+ profile?: string;
16
+ auth?: AuthConfigV2;
17
+ gates: Record<string, GateConfigV2>;
18
+ hooks?: HooksConfig;
19
+ execution?: ExecutionConfigV2;
20
+ variables?: Record<string, string>;
21
+ metadata?: Record<string, unknown>;
22
+ }
23
+ /**
24
+ * Authentication configuration (Pack v2)
25
+ */
26
+ export interface AuthConfigV2 {
27
+ /**
28
+ * Default auth profile for API gates
29
+ */
30
+ api?: string;
31
+ /**
32
+ * Default auth profile for UI gates
33
+ */
34
+ ui?: string;
35
+ /**
36
+ * Named auth profiles
37
+ */
38
+ profiles?: Record<string, AuthProfile>;
39
+ }
40
+ /**
41
+ * Authentication profile definition (Pack v2)
42
+ */
43
+ export interface AuthProfile {
44
+ /**
45
+ * Type of authentication
46
+ */
47
+ type: AuthTypeV2;
48
+ /**
49
+ * Configuration for this auth type
50
+ */
51
+ config: Record<string, unknown>;
52
+ /**
53
+ * Cache/refresh settings
54
+ */
55
+ cache?: AuthCacheConfig;
56
+ }
57
+ /**
58
+ * Authentication types (Pack v2)
59
+ */
60
+ export type AuthTypeV2 = 'none' | 'jwt' | 'oauth2' | 'api_key' | 'bearer' | 'basic' | 'totp' | 'ui_login' | 'gcp_adc' | 'aws_iam' | 'azure_ad';
61
+ /**
62
+ * Auth cache configuration
63
+ */
64
+ export interface AuthCacheConfig {
65
+ enabled?: boolean;
66
+ ttl?: number;
67
+ }
68
+ /**
69
+ * Gate Configuration v2
70
+ */
71
+ export interface GateConfigV2 {
72
+ /**
73
+ * Adapter to use for this gate
74
+ */
75
+ adapter?: string;
76
+ /**
77
+ * Test files to execute (glob patterns)
78
+ * This is the primary way to specify tests in v2
79
+ */
80
+ test_files?: string[];
81
+ /**
82
+ * Legacy inline config (for backward compatibility)
83
+ */
84
+ config?: Record<string, unknown>;
85
+ /**
86
+ * Auth profile to use (overrides default)
87
+ */
88
+ auth?: string;
89
+ /**
90
+ * Budgets for this gate
91
+ */
92
+ budgets?: GateBudgets;
93
+ /**
94
+ * Execution options
95
+ */
96
+ options?: GateOptions;
97
+ /**
98
+ * Whether this gate is enabled
99
+ */
100
+ enabled?: boolean;
101
+ /**
102
+ * Dependencies on other gates
103
+ */
104
+ depends_on?: string[];
105
+ /**
106
+ * Parallel execution within this gate
107
+ */
108
+ parallel?: boolean;
109
+ }
110
+ /**
111
+ * Gate budgets
112
+ */
113
+ export interface GateBudgets {
114
+ max_duration_ms?: number;
115
+ p95_ms?: number;
116
+ p99_ms?: number;
117
+ max_high?: number;
118
+ max_medium?: number;
119
+ max_critical?: number;
120
+ a11y_min?: number;
121
+ perf_min?: number;
122
+ }
123
+ /**
124
+ * Gate execution options
125
+ */
126
+ export interface GateOptions {
127
+ timeout?: number;
128
+ retries?: number;
129
+ continue_on_failure?: boolean;
130
+ parallelism?: number;
131
+ }
132
+ /**
133
+ * Hooks configuration
134
+ */
135
+ export interface HooksConfig {
136
+ beforeAll?: Hook[];
137
+ afterAll?: Hook[];
138
+ beforeEach?: Hook[];
139
+ afterEach?: Hook[];
140
+ }
141
+ /**
142
+ * Single hook definition
143
+ */
144
+ export interface Hook {
145
+ /**
146
+ * Hook type
147
+ */
148
+ type: 'run' | 'wait_on' | 'script' | 'docker';
149
+ /**
150
+ * Command or script to run
151
+ */
152
+ command?: string;
153
+ /**
154
+ * Working directory
155
+ */
156
+ cwd?: string;
157
+ /**
158
+ * Timeout in milliseconds
159
+ */
160
+ timeout?: number;
161
+ /**
162
+ * Environment variables
163
+ */
164
+ env?: Record<string, string>;
165
+ /**
166
+ * Wait_on specific configuration
167
+ */
168
+ wait_for?: {
169
+ resource: string;
170
+ timeout?: number;
171
+ };
172
+ /**
173
+ * Docker compose specific
174
+ */
175
+ compose?: {
176
+ file?: string;
177
+ services?: string[];
178
+ command?: string;
179
+ };
180
+ }
181
+ /**
182
+ * Execution configuration v2
183
+ */
184
+ export interface ExecutionConfigV2 {
185
+ /**
186
+ * Parallel gate execution
187
+ */
188
+ parallel?: boolean;
189
+ /**
190
+ * Maximum concurrency
191
+ */
192
+ max_concurrency?: number;
193
+ /**
194
+ * Default timeout
195
+ */
196
+ default_timeout?: number;
197
+ /**
198
+ * Default retries
199
+ */
200
+ default_retries?: number;
201
+ /**
202
+ * Behavior on failure
203
+ */
204
+ on_failure: 'stop' | 'continue' | 'proceed';
205
+ /**
206
+ * Resource limits
207
+ */
208
+ limits?: ResourceLimits;
209
+ /**
210
+ * Docker compose file for environment
211
+ */
212
+ compose_file?: string;
213
+ /**
214
+ * Hook timeout
215
+ */
216
+ hook_timeout_ms?: number;
217
+ }
218
+ /**
219
+ * Resource limits
220
+ */
221
+ export interface ResourceLimits {
222
+ cpu?: string;
223
+ memory?: string;
224
+ }
225
+ /**
226
+ * Security budgets
227
+ */
228
+ export interface SecurityBudgets {
229
+ sast?: {
230
+ max_critical?: number;
231
+ max_high?: number;
232
+ max_medium?: number;
233
+ };
234
+ dast?: {
235
+ max_critical?: number;
236
+ max_high?: number;
237
+ max_medium?: number;
238
+ };
239
+ secrets?: {
240
+ max_critical?: number;
241
+ max_high?: number;
242
+ };
243
+ deps?: {
244
+ max_critical?: number;
245
+ max_high?: number;
246
+ max_medium?: number;
247
+ };
248
+ }
249
+ /**
250
+ * Performance targets
251
+ */
252
+ export interface PerformanceTargets {
253
+ p95_ms?: number;
254
+ p99_ms?: number;
255
+ throughput_rps?: number;
256
+ error_rate_percent?: number;
257
+ }
258
+ /**
259
+ * Auth type-specific configurations
260
+ */
261
+ /**
262
+ * JWT configuration (Pack v2)
263
+ */
264
+ export interface JWTAuthProfileV2 extends AuthProfile {
265
+ type: 'jwt';
266
+ config: {
267
+ issuer?: string;
268
+ audience?: string;
269
+ subject?: string;
270
+ client_id?: string;
271
+ client_secret?: string;
272
+ token_endpoint?: string;
273
+ scopes?: string[];
274
+ auto_refresh?: boolean;
275
+ };
276
+ }
277
+ /**
278
+ * OAuth2 configuration (Pack v2)
279
+ */
280
+ export interface OAuth2AuthProfileV2 extends AuthProfile {
281
+ type: 'oauth2';
282
+ config: {
283
+ token_url: string;
284
+ client_id: string;
285
+ client_secret?: string;
286
+ scopes?: string[];
287
+ grant_type?: 'client_credentials' | 'authorization_code' | 'password';
288
+ username?: string;
289
+ password?: string;
290
+ };
291
+ }
292
+ /**
293
+ * UI Login configuration (Pack v2)
294
+ */
295
+ export interface UILoginAuthProfileV2 extends AuthProfile {
296
+ type: 'ui_login';
297
+ config: {
298
+ url: string;
299
+ username?: string;
300
+ password?: string;
301
+ username_selector?: string;
302
+ password_selector?: string;
303
+ submit_selector?: string;
304
+ totp_secret?: string;
305
+ session_file?: string;
306
+ };
307
+ }
308
+ /**
309
+ * Cloud ADC configurations
310
+ */
311
+ /**
312
+ * GCP Application Default Credentials (Pack v2)
313
+ */
314
+ export interface GCPADCProfileV2 extends AuthProfile {
315
+ type: 'gcp_adc';
316
+ config: {
317
+ project_id?: string;
318
+ scopes?: string[];
319
+ };
320
+ }
321
+ /**
322
+ * AWS IAM configuration (Pack v2)
323
+ */
324
+ export interface AWSIamProfileV2 extends AuthProfile {
325
+ type: 'aws_iam';
326
+ config: {
327
+ region?: string;
328
+ access_key_id?: string;
329
+ secret_access_key?: string;
330
+ session_token?: string;
331
+ role_arn?: string;
332
+ profile?: string;
333
+ };
334
+ }
335
+ /**
336
+ * Target configurations (for reference in test_files)
337
+ */
338
+ export interface TargetConfig {
339
+ api?: ApiTarget;
340
+ web?: WebTarget;
341
+ }
342
+ /**
343
+ * API target configuration
344
+ */
345
+ export interface ApiTarget {
346
+ baseUrl: string;
347
+ auth?: string;
348
+ headers?: Record<string, string>;
349
+ smoke?: string[];
350
+ requests?: ApiRequest[];
351
+ }
352
+ /**
353
+ * Web target configuration
354
+ */
355
+ export interface WebTarget {
356
+ baseUrl: string;
357
+ auth?: string;
358
+ pages?: WebPage[];
359
+ }
360
+ /**
361
+ * API request specification
362
+ */
363
+ export interface ApiRequest {
364
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
365
+ path: string;
366
+ headers?: Record<string, string>;
367
+ body?: unknown;
368
+ expect?: {
369
+ status?: number | number[];
370
+ responseTime?: string;
371
+ body?: Record<string, unknown>;
372
+ headers?: string[];
373
+ };
374
+ }
375
+ /**
376
+ * Web page specification
377
+ */
378
+ export interface WebPage {
379
+ url: string;
380
+ name?: string;
381
+ actions?: PageAction[];
382
+ }
383
+ /**
384
+ * Page action for UI tests
385
+ */
386
+ export interface PageAction {
387
+ type: 'goto' | 'click' | 'fill' | 'select' | 'wait' | 'screenshot' | 'assert';
388
+ selector?: string;
389
+ value?: string;
390
+ options?: Record<string, unknown>;
391
+ }
392
+ /**
393
+ * Validation result for pack v2
394
+ */
395
+ export interface PackValidationResultV2 {
396
+ valid: boolean;
397
+ version: 2;
398
+ errors: ValidationError[];
399
+ warnings: ValidationError[];
400
+ info?: {
401
+ totalTests?: number;
402
+ gatesCount?: number;
403
+ frameworks?: string[];
404
+ };
405
+ }
406
+ /**
407
+ * Validation error
408
+ */
409
+ export interface ValidationError {
410
+ code: string;
411
+ message: string;
412
+ path?: string;
413
+ line?: number;
414
+ column?: number;
415
+ suggestion?: string;
416
+ }
417
+ /**
418
+ * Migrate v1 to v2 result
419
+ */
420
+ export interface PackMigrationResultV2 {
421
+ success: boolean;
422
+ migrated: PackConfigV2;
423
+ changes: string[];
424
+ warnings: string[];
425
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * QA360 Pack Configuration v2
3
+ *
4
+ * New version with test_files patterns and auth profiles.
5
+ * Maintains backward compatibility with v1 concepts while adding
6
+ * AI-generated code support and comprehensive authentication.
7
+ */
8
+ export {};
@@ -50,6 +50,68 @@ export interface FindingRecord {
50
50
  fingerprint?: string;
51
51
  created_at: number;
52
52
  }
53
+ /**
54
+ * Flakiness history record - tracks test reliability over time
55
+ */
56
+ export interface FlakinessRecord {
57
+ id?: number;
58
+ run_id: string;
59
+ test_id: string;
60
+ test_name: string;
61
+ gate: string;
62
+ file_path: string;
63
+ score: number;
64
+ category: 'legendary' | 'solid' | 'good' | 'shaky' | 'unstable';
65
+ total_runs: number;
66
+ successful_runs: number;
67
+ avg_duration_ms: number;
68
+ pattern_type?: string;
69
+ suggested_fix?: string;
70
+ confidence?: number;
71
+ first_seen: number;
72
+ last_seen: number;
73
+ current_streak?: number;
74
+ streak_type?: 'pass' | 'fail';
75
+ created_at: number;
76
+ }
77
+ /**
78
+ * Flakiness pattern detection record
79
+ */
80
+ export interface FlakinessPatternRecord {
81
+ id?: number;
82
+ test_id: string;
83
+ test_name: string;
84
+ pattern_type: 'timing' | 'race_condition' | 'external_dependency' | 'environment_specific' | 'selector_issue' | 'unknown';
85
+ description: string;
86
+ suggested_fix: string;
87
+ confidence: number;
88
+ auto_fix_possible: boolean;
89
+ first_detected: number;
90
+ last_detected: number;
91
+ detection_count: number;
92
+ created_at: number;
93
+ updated_at: number;
94
+ }
95
+ /**
96
+ * Flakiness quarantine record
97
+ */
98
+ export interface QuarantineRecord {
99
+ id?: number;
100
+ test_id: string;
101
+ test_name: string;
102
+ gate: string;
103
+ file_path: string;
104
+ reason: string;
105
+ score: number;
106
+ category: 'shaky' | 'unstable';
107
+ quarantined_at: number;
108
+ quarantined_by: string;
109
+ resolved_at?: number;
110
+ resolved_by?: string;
111
+ notes?: string;
112
+ created_at: number;
113
+ updated_at: number;
114
+ }
53
115
  export interface ArtifactRecord {
54
116
  sha256: string;
55
117
  mime_type: string;
@@ -125,6 +187,55 @@ export declare class EvidenceVault {
125
187
  * Record security/quality finding
126
188
  */
127
189
  recordFinding(runId: string, finding: Omit<FindingRecord, 'id' | 'run_id' | 'created_at'>): Promise<number>;
190
+ /**
191
+ * Record flakiness analysis result
192
+ */
193
+ recordFlakiness(runId: string, flakiness: Omit<FlakinessRecord, 'id' | 'created_at' | 'run_id'>): Promise<number>;
194
+ /**
195
+ * Record detected flakiness pattern
196
+ */
197
+ recordFlakinessPattern(pattern: Omit<FlakinessPatternRecord, 'id' | 'created_at' | 'updated_at' | 'first_detected' | 'last_detected' | 'detection_count'>): Promise<number>;
198
+ /**
199
+ * Add test to quarantine
200
+ */
201
+ addToQuarantine(quarantine: Omit<QuarantineRecord, 'id' | 'created_at' | 'updated_at'>): Promise<number>;
202
+ /**
203
+ * Remove test from quarantine
204
+ */
205
+ removeFromQuarantine(testId: string, resolvedBy: string, notes?: string): Promise<void>;
206
+ /**
207
+ * Get flakiness history for a test
208
+ */
209
+ getFlakinessHistory(testId: string, limit?: number): Promise<FlakinessRecord[]>;
210
+ /**
211
+ * Get flakiness history for a run
212
+ */
213
+ getRunFlakiness(runId: string): Promise<FlakinessRecord[]>;
214
+ /**
215
+ * Get all quarantined tests
216
+ */
217
+ getQuarantinedTests(includeResolved?: boolean): Promise<QuarantineRecord[]>;
218
+ /**
219
+ * Get quarantine record for a test
220
+ */
221
+ getQuarantine(testId: string): Promise<QuarantineRecord | null>;
222
+ /**
223
+ * Get flakiness pattern for a test
224
+ */
225
+ getFlakinessPattern(testId: string, patternType: string): Promise<FlakinessPatternRecord | null>;
226
+ /**
227
+ * Get flakiness trends for a test
228
+ */
229
+ getFlakinessTrends(testId: string, days?: number): Promise<{
230
+ testId: string;
231
+ currentScore: number;
232
+ averageScore: number;
233
+ trend: 'improving' | 'stable' | 'degrading';
234
+ dataPoints: Array<{
235
+ date: number;
236
+ score: number;
237
+ }>;
238
+ }>;
128
239
  /**
129
240
  * Store artifact in CAS and link to run
130
241
  */
@@ -189,6 +300,11 @@ export declare class EvidenceVault {
189
300
  private insertFinding;
190
301
  private insertArtifact;
191
302
  private insertRunArtifact;
303
+ private insertFlakiness;
304
+ private insertFlakinessPattern;
305
+ private updateFlakinessPattern;
306
+ private insertQuarantine;
307
+ private updateQuarantine;
192
308
  private generateFindingFingerprint;
193
309
  /**
194
310
  * Initialize database connection