quality-intelligence-engine 2.2.2 → 2.2.4

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 (257) hide show
  1. package/.github/workflows/playwright.yml +27 -0
  2. package/.github/workflows/quality-intelligence.yml +45 -0
  3. package/CHANGELOG.md +164 -0
  4. package/REFACTORING_SUMMARY.md +417 -0
  5. package/artifacts/failure-analysis/run-1769595909824-login_with_valid_user.md +25 -0
  6. package/artifacts/failure-analysis/run-1769596445203-login_with_valid_user.md +25 -0
  7. package/artifacts/failure-analysis/run-1769596573162-login_with_valid_user.md +34 -0
  8. package/artifacts/failure-analysis/run-1769596591727-login_with_valid_user.md +25 -0
  9. package/artifacts/failure-analysis/run-1769596600117-login_with_valid_user.md +34 -0
  10. package/artifacts/failure-analysis/run-1769596782107-login_with_valid_user.md +32 -0
  11. package/artifacts/failure-analysis/run-1769596940770-login_with_valid_user.md +28 -0
  12. package/artifacts/failure-analysis/run-1769596960417-login_with_valid_user.md +28 -0
  13. package/artifacts/failure-analysis/run-1769596981303-login_with_valid_user.md +28 -0
  14. package/artifacts/failure-analysis/run-1769597351831-login_with_valid_user.md +21 -0
  15. package/artifacts/failure-analysis/run-1769597486816-login_with_valid_user.md +21 -0
  16. package/artifacts/failure-analysis/run-1769599708378-login_with_valid_user.md +22 -0
  17. package/artifacts/failure-analysis/run-1769600327960-login_with_valid_user.md +22 -0
  18. package/artifacts/failure-analysis/run-1769600596201-saucedemo__login_fails_with_wrong_password_fail.md +22 -0
  19. package/artifacts/failure-analysis/run-1769600682675-saucedemo__login_fails_with_wrong_password_fail.md +22 -0
  20. package/artifacts/failure-analysis/run-1769602090701-saucedemo__add_to_cart_button_is_hidden_fail.md +30 -0
  21. package/artifacts/failure-analysis/run-1769602090701-saucedemo__cart_count_updates_to_2_after_adding_one_item_fail.md +30 -0
  22. package/artifacts/failure-analysis/run-1769602090701-saucedemo__checkout_navigates_to_payment_page_directly_fail.md +30 -0
  23. package/artifacts/failure-analysis/run-1769602090701-saucedemo__inventory_shows_10_products_fail.md +30 -0
  24. package/artifacts/failure-analysis/run-1769602090701-saucedemo__products_sorted_high_to_low_start_with_999_fail.md +30 -0
  25. package/artifacts/failure-history/1769696674298.json +9 -0
  26. package/artifacts/failure-history/1769697768622.json +10 -0
  27. package/artifacts/failure-history/1769697923557.json +10 -0
  28. package/artifacts/failure-history/1769698160213.json +11 -0
  29. package/artifacts/failure-history/1769698353440.json +11 -0
  30. package/artifacts/failure-history/1769698763306.json +11 -0
  31. package/artifacts/failure-history/1769698878947.json +11 -0
  32. package/artifacts/failure-history/1769699909817.json +11 -0
  33. package/artifacts/failure-history/1769703130913.json +11 -0
  34. package/artifacts/failure-history/1769703142113.json +11 -0
  35. package/artifacts/failure-history/1769703158978.json +11 -0
  36. package/artifacts/failure-history/1769703406025.json +11 -0
  37. package/artifacts/failure-history/1769703422720.json +11 -0
  38. package/artifacts/failure-history/1769703518837.json +11 -0
  39. package/artifacts/failure-history/1769703530419.json +11 -0
  40. package/artifacts/failure-history/1769703577078.json +11 -0
  41. package/artifacts/failure-history/1769704067098.json +11 -0
  42. package/artifacts/failure-history/1769704074618.json +11 -0
  43. package/artifacts/failure-history/1769704084948.json +11 -0
  44. package/artifacts/failure-history/1769704091950.json +11 -0
  45. package/artifacts/failure-history/1769704435355.json +11 -0
  46. package/artifacts/failure-history/1769704832871.json +11 -0
  47. package/artifacts/failure-history/1769707051830.json +11 -0
  48. package/artifacts/failure-history/1769739820395.json +11 -0
  49. package/artifacts/failure-history/1769739820400.json +11 -0
  50. package/artifacts/failure-history/1769742422254.json +11 -0
  51. package/artifacts/failure-history/1769743106016.json +11 -0
  52. package/artifacts/failure-history/1769743121857.json +11 -0
  53. package/artifacts/failure-history/1769750875212.json +11 -0
  54. package/artifacts/failure-history/1769750880790.json +11 -0
  55. package/artifacts/failure-history/1769761177923.json +11 -0
  56. package/artifacts/failure-history/1769761191176.json +11 -0
  57. package/bin/qi.ts +37 -0
  58. package/config/agent.config.json +18 -0
  59. package/data/failures/fingerprints/0ded7b45.json +10 -0
  60. package/data/failures/fingerprints/2437666a.json +8 -0
  61. package/data/failures/fingerprints/3746e3b4.json +42 -0
  62. package/data/failures/fingerprints/533e258f.json +10 -0
  63. package/data/failures/fingerprints/56b547d3.json +10 -0
  64. package/data/failures/fingerprints/693661fa.json +10 -0
  65. package/data/failures/fingerprints/789126b1.json +8 -0
  66. package/data/failures/fingerprints/936d995e.json +10 -0
  67. package/data/failures/fingerprints/ba5f6c0a.json +10 -0
  68. package/data/failures/fingerprints/f148a261.json +56 -0
  69. package/data/failures/fingerprints/fa14440f.json +14 -0
  70. package/data/failures/registry.json +57 -0
  71. package/data/flakiness/history.json +71 -0
  72. package/dist/bin/qi.js +0 -0
  73. package/dist/src/intelligence/failure-fingerprinting/failure.classifier.js +5 -1
  74. package/dist/src/intelligence/failure-fingerprinting/failure.tracker.js +5 -0
  75. package/dist/src/playwright/qi.reporter.js +17 -0
  76. package/final.sanity.test.ts +46 -0
  77. package/input/raw-failure.json +36 -0
  78. package/input/raw-pass.json +33 -0
  79. package/output/run-2026-01-28_02-48-38-420/BACKEND_API_FAILURE-AuthController.java-/users/{id}/analysis.md +50 -0
  80. package/output/run-2026-01-28_02-48-38-420/TEST_FAILURE-Unknown--/analysis.md +50 -0
  81. package/output/run-2026-01-28_02-48-52-140/BACKEND_API_FAILURE-AuthController.java-/users/{id}/analysis.md +50 -0
  82. package/output/run-2026-01-28_02-48-52-140/TEST_FAILURE-Unknown--/analysis.md +50 -0
  83. package/output/run-2026-01-28_03-13-16-302/BACKEND_API_FAILURE-AuthController.java-/users/{id}/analysis.md +50 -0
  84. package/output/run-2026-01-28_03-13-16-302/PASS-checkout.spec.ts-API_WARNING/analysis.md +49 -0
  85. package/output/run-2026-01-28_03-13-16-302/PASS-login.spec.ts-FLAKY_PASS/analysis.md +49 -0
  86. package/output/run-2026-01-28_03-13-16-302/TEST_FAILURE-Unknown--/analysis.md +50 -0
  87. package/output/run-2026-01-28_03-29-49-786/BACKEND_API_FAILURE-AuthController.java-/users/{id}/analysis.md +50 -0
  88. package/package.json +4 -10
  89. package/playwright-results/.last-run.json +17 -0
  90. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium/error-context.md +31 -0
  91. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium/test-failed-1.png +0 -0
  92. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium/trace.zip +0 -0
  93. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium/video.webm +0 -0
  94. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium-retry1/error-context.md +31 -0
  95. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium-retry1/test-failed-1.png +0 -0
  96. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium-retry1/trace.zip +0 -0
  97. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--chromium-retry1/video.webm +0 -0
  98. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox/error-context.md +31 -0
  99. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox/test-failed-1.png +0 -0
  100. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox/trace.zip +0 -0
  101. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox/video.webm +0 -0
  102. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox-retry1/error-context.md +31 -0
  103. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox-retry1/test-failed-1.png +0 -0
  104. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox-retry1/trace.zip +0 -0
  105. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--firefox-retry1/video.webm +0 -0
  106. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit/error-context.md +31 -0
  107. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit/test-failed-1.png +0 -0
  108. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit/trace.zip +0 -0
  109. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit/video.webm +0 -0
  110. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit-retry1/error-context.md +31 -0
  111. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit-retry1/test-failed-1.png +0 -0
  112. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit-retry1/trace.zip +0 -0
  113. package/playwright-results/saucedemo-email-like-valid-d5dc6-rname-format-rejected-FAIL--webkit-retry1/video.webm +0 -0
  114. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium/error-context.md +112 -0
  115. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium/test-failed-1.png +0 -0
  116. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium/trace.zip +0 -0
  117. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium/video.webm +0 -0
  118. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium-retry1/error-context.md +112 -0
  119. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium-retry1/test-failed-1.png +0 -0
  120. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium-retry1/trace.zip +0 -0
  121. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--chromium-retry1/video.webm +0 -0
  122. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox/error-context.md +112 -0
  123. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox/test-failed-1.png +0 -0
  124. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox/trace.zip +0 -0
  125. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox/video.webm +0 -0
  126. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox-retry1/error-context.md +112 -0
  127. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox-retry1/test-failed-1.png +0 -0
  128. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox-retry1/trace.zip +0 -0
  129. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--firefox-retry1/video.webm +0 -0
  130. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit/error-context.md +112 -0
  131. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit/test-failed-1.png +0 -0
  132. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit/trace.zip +0 -0
  133. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit/video.webm +0 -0
  134. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit-retry1/error-context.md +112 -0
  135. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit-retry1/test-failed-1.png +0 -0
  136. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit-retry1/trace.zip +0 -0
  137. package/playwright-results/saucedemo-numeric-mismatch-7c4f3-to-cart-button-hidden-FAIL--webkit-retry1/video.webm +0 -0
  138. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium/error-context.md +112 -0
  139. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium/test-failed-1.png +0 -0
  140. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium/trace.zip +0 -0
  141. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium/video.webm +0 -0
  142. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium-retry1/error-context.md +112 -0
  143. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium-retry1/test-failed-1.png +0 -0
  144. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium-retry1/trace.zip +0 -0
  145. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--chromium-retry1/video.webm +0 -0
  146. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox/error-context.md +112 -0
  147. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox/test-failed-1.png +0 -0
  148. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox/trace.zip +0 -0
  149. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox/video.webm +0 -0
  150. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox-retry1/error-context.md +112 -0
  151. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox-retry1/test-failed-1.png +0 -0
  152. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox-retry1/trace.zip +0 -0
  153. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--firefox-retry1/video.webm +0 -0
  154. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit/error-context.md +112 -0
  155. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit/test-failed-1.png +0 -0
  156. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit/trace.zip +0 -0
  157. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit/video.webm +0 -0
  158. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit-retry1/error-context.md +112 -0
  159. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit-retry1/test-failed-1.png +0 -0
  160. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit-retry1/trace.zip +0 -0
  161. package/playwright-results/saucedemo-numeric-mismatch-cd423-entory-count-mismatch-FAIL--webkit-retry1/video.webm +0 -0
  162. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium/error-context.md +31 -0
  163. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium/test-failed-1.png +0 -0
  164. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium/trace.zip +0 -0
  165. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium/video.webm +0 -0
  166. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium-retry1/error-context.md +31 -0
  167. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium-retry1/test-failed-1.png +0 -0
  168. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium-retry1/trace.zip +0 -0
  169. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--chromium-retry1/video.webm +0 -0
  170. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox/error-context.md +31 -0
  171. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox/test-failed-1.png +0 -0
  172. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox/trace.zip +0 -0
  173. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox/video.webm +0 -0
  174. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox-retry1/error-context.md +31 -0
  175. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox-retry1/test-failed-1.png +0 -0
  176. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox-retry1/trace.zip +0 -0
  177. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--firefox-retry1/video.webm +0 -0
  178. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit/error-context.md +31 -0
  179. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit/test-failed-1.png +0 -0
  180. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit/trace.zip +0 -0
  181. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit/video.webm +0 -0
  182. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit-retry1/error-context.md +31 -0
  183. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit-retry1/test-failed-1.png +0 -0
  184. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit-retry1/trace.zip +0 -0
  185. package/playwright-results/saucedemo-numeric-mismatch-f085e-E-unauthorized-access-FAIL--webkit-retry1/video.webm +0 -0
  186. package/playwright.config.ts +42 -0
  187. package/quality-intelligence-engine-2.2.0.tgz +0 -0
  188. package/quality-intelligence-engine-2.2.2.tgz +0 -0
  189. package/sanity.test.ts +33 -0
  190. package/src/adapters/playwright-folder.adapter.ts +85 -0
  191. package/src/adapters/playwright-json.adapter.ts +49 -0
  192. package/src/adapters/playwright.adapter.ts +44 -0
  193. package/src/cli/qi-test.ts +20 -0
  194. package/src/cli/qi.ts +67 -0
  195. package/src/cli/ui/divider.ts +9 -0
  196. package/src/cli/ui/failureLogger.ts +33 -0
  197. package/src/configLoader.ts +70 -0
  198. package/src/console/issue-view.ts +193 -0
  199. package/src/failure-analysis/failure-analyzer.ts +43 -0
  200. package/src/final-run.ts +174 -0
  201. package/src/final-runner.ts +31 -0
  202. package/src/fixtures/networkCollector.ts +27 -0
  203. package/src/history/failure-history.store.ts +23 -0
  204. package/src/history/failure-history.types.ts +12 -0
  205. package/src/history/failure-trend.analyzer.ts +49 -0
  206. package/src/index.ts +10 -0
  207. package/src/integrations/ci/ci-annotator.ts +42 -0
  208. package/src/intelligence/confidence-calibration.engine.ts +41 -0
  209. package/src/intelligence/decision-intelligence/confidence.engine.ts +18 -0
  210. package/src/intelligence/decision-intelligence/decision.config.ts +18 -0
  211. package/src/intelligence/decision-intelligence/decision.engine.ts +30 -0
  212. package/src/intelligence/decision-intelligence/decision.types.ts +15 -0
  213. package/src/intelligence/failure-fingerprinting/failure.classifier.ts +61 -0
  214. package/src/intelligence/failure-fingerprinting/failure.store.ts +42 -0
  215. package/src/intelligence/failure-fingerprinting/failure.tracker.ts +28 -0
  216. package/src/intelligence/failure-fingerprinting/fingerprint.generator.ts +28 -0
  217. package/src/intelligence/failure-fingerprinting/fingerprint.types.ts +14 -0
  218. package/src/intelligence/flakiness-intelligence/flakiness.analyzer.ts +23 -0
  219. package/src/intelligence/flakiness-intelligence/flakiness.fingerprint.ts +14 -0
  220. package/src/intelligence/flakiness-intelligence/flakiness.store.ts +24 -0
  221. package/src/intelligence/flakiness-intelligence/flakiness.tracker.ts +42 -0
  222. package/src/intelligence/flakiness-intelligence/flakiness.types.ts +8 -0
  223. package/src/intelligence/intelligence.pipeline.ts +20 -0
  224. package/src/intelligence/llm-explainer.ts +29 -0
  225. package/src/intelligence/root-cause/rootcause.engine.ts +46 -0
  226. package/src/intelligence/trend-intelligence/trend.engine.ts +42 -0
  227. package/src/markdownWriter.ts +68 -0
  228. package/src/normalizer.ts +31 -0
  229. package/src/passAnalyzer.ts +38 -0
  230. package/src/pipeline/ai.summarizer.ts +39 -0
  231. package/src/pipeline/failure-analysis.pipeline.ts +13 -0
  232. package/src/pipeline/failure-grouping.pipeline.ts +67 -0
  233. package/src/playwright/qi.reporter.ts +26 -0
  234. package/src/reporter.ts +88 -0
  235. package/src/reporters/qi-reporter.js +34 -0
  236. package/src/rules.ts +35 -0
  237. package/src/runManager.ts +21 -0
  238. package/src/runner.ts +12 -0
  239. package/src/runtime/networkCollector.ts +36 -0
  240. package/src/stackParser.ts +22 -0
  241. package/src/test-run.ts +59 -0
  242. package/src/types/analysis-result.ts +16 -0
  243. package/src/types/failure.types.ts +28 -0
  244. package/src/types/playwright-failure.ts +10 -0
  245. package/src/types.ts +102 -0
  246. package/src/utils/artifact.locator.ts +42 -0
  247. package/src/utils/confidence-constants.ts +111 -0
  248. package/src/utils/file-utils.ts +146 -0
  249. package/src/v2/llm/llm-advisor.ts +22 -0
  250. package/src/v2/pipeline/v2-intelligence.pipeline.ts +21 -0
  251. package/src/v2/self-healing/self-healer.ts +60 -0
  252. package/src/v2/trace-intelligence/trace-analyzer.ts +42 -0
  253. package/src/v2-test-run.ts +74 -0
  254. package/tests/fixtures.ts +40 -0
  255. package/tests/saucedemo-login-validation.spec.ts +74 -0
  256. package/tsconfig.json +16 -0
  257. package/tsconfig.playwright.json +13 -0
@@ -0,0 +1,31 @@
1
+ # Page snapshot
2
+
3
+ ```yaml
4
+ - generic [ref=e3]:
5
+ - generic [ref=e4]: Swag Labs
6
+ - generic [ref=e5]:
7
+ - generic [ref=e9]:
8
+ - generic [ref=e10]:
9
+ - textbox "Username" [ref=e11]: locked_out_user
10
+ - img [ref=e12]
11
+ - generic [ref=e14]:
12
+ - textbox "Password" [ref=e15]: secret_sauce
13
+ - img [ref=e16]
14
+ - 'heading "Epic sadface: Sorry, this user has been locked out." [level=3] [ref=e19]':
15
+ - button [ref=e20] [cursor=pointer]:
16
+ - img [ref=e21]
17
+ - text: "Epic sadface: Sorry, this user has been locked out."
18
+ - button "Login" [ref=e23] [cursor=pointer]
19
+ - generic [ref=e25]:
20
+ - generic [ref=e26]:
21
+ - heading "Accepted usernames are:" [level=4] [ref=e27]
22
+ - text: standard_user
23
+ - text: locked_out_user
24
+ - text: problem_user
25
+ - text: performance_glitch_user
26
+ - text: error_user
27
+ - text: visual_user
28
+ - generic [ref=e28]:
29
+ - heading "Password for all users:" [level=4] [ref=e29]
30
+ - text: secret_sauce
31
+ ```
@@ -0,0 +1,31 @@
1
+ # Page snapshot
2
+
3
+ ```yaml
4
+ - generic [ref=e3]:
5
+ - generic [ref=e4]: Swag Labs
6
+ - generic [ref=e5]:
7
+ - generic [ref=e9]:
8
+ - generic [ref=e10]:
9
+ - textbox "Username" [ref=e11]: locked_out_user
10
+ - img [ref=e12]
11
+ - generic [ref=e14]:
12
+ - textbox "Password" [ref=e15]: secret_sauce
13
+ - img [ref=e16]
14
+ - 'heading "Epic sadface: Sorry, this user has been locked out." [level=3] [ref=e19]':
15
+ - button [ref=e20] [cursor=pointer]:
16
+ - img [ref=e21]
17
+ - text: "Epic sadface: Sorry, this user has been locked out."
18
+ - button "Login" [ref=e23] [cursor=pointer]
19
+ - generic [ref=e25]:
20
+ - generic [ref=e26]:
21
+ - heading "Accepted usernames are:" [level=4] [ref=e27]
22
+ - text: standard_user
23
+ - text: locked_out_user
24
+ - text: problem_user
25
+ - text: performance_glitch_user
26
+ - text: error_user
27
+ - text: visual_user
28
+ - generic [ref=e28]:
29
+ - heading "Password for all users:" [level=4] [ref=e29]
30
+ - text: secret_sauce
31
+ ```
@@ -0,0 +1,42 @@
1
+ import { defineConfig } from '@playwright/test';
2
+
3
+ export default defineConfig({
4
+ testDir: './tests',
5
+
6
+ // Retry logic
7
+ retries: process.env.CI ? 2 : 1,
8
+
9
+ // Timeout settings
10
+ timeout: 30000,
11
+
12
+ // Reporter configuration
13
+ reporter: [
14
+ ['json', { outputFile: 'playwright-report/report.json' }],
15
+ ['./src/reporters/qi-reporter.js'],
16
+ // Add GitHub Actions reporter in CI
17
+ ...(process.env.CI ? [['github' as const]] : [])
18
+ ],
19
+
20
+ use: {
21
+ // Base URL configuration
22
+ baseURL: process.env.BASE_URL || 'https://www.saucedemo.com',
23
+
24
+ // Action timeout
25
+ actionTimeout: 10000,
26
+
27
+ // Screenshots, videos, and traces
28
+ screenshot: 'only-on-failure',
29
+ video: 'retain-on-failure',
30
+ trace: 'retain-on-failure',
31
+
32
+ // Headless mode - false for local dev, true for CI
33
+ headless: process.env.CI ? true : false,
34
+ },
35
+
36
+ // Browser projects
37
+ projects: [
38
+ { name: 'chromium', use: { browserName: 'chromium' } },
39
+ { name: 'firefox', use: { browserName: 'firefox' } },
40
+ { name: 'webkit', use: { browserName: 'webkit' } }
41
+ ]
42
+ });
package/sanity.test.ts ADDED
@@ -0,0 +1,33 @@
1
+ import { trackFailure } from './src/intelligence/failure-fingerprinting/failure.tracker'
2
+ import { trackFlakiness } from './src/intelligence/flakiness-intelligence/flakiness.tracker'
3
+
4
+ // ---- SIMULATE RUN ID ----
5
+ const runId = Number(process.argv[2]) || 1
6
+
7
+ console.log(`\n🚀 SANITY RUN: ${runId}\n`)
8
+
9
+ // ---- DAY 7: FAILURE INTELLIGENCE ----
10
+ const failureResult = trackFailure(
11
+ {
12
+ failureType: 'assertion',
13
+ pageRoute: '/checkout',
14
+ primaryLocator: '#total',
15
+ assertionIntent: 'total price matches sum',
16
+ errorClass: 'expect'
17
+ },
18
+ runId,
19
+ 'checkout.spec.ts'
20
+ )
21
+
22
+ console.log('Day 7 → Failure Result:', failureResult)
23
+
24
+ // ---- DAY 8: FLAKINESS INTELLIGENCE ----
25
+ const outcome = runId % 2 === 0 ? 'PASS' : 'FAIL'
26
+
27
+ const flakinessResult = trackFlakiness(
28
+ 'checkout.spec.ts',
29
+ '/checkout',
30
+ outcome
31
+ )
32
+
33
+ console.log('Day 8 → Flakiness Result:', flakinessResult)
@@ -0,0 +1,85 @@
1
+ // src/adapters/playwright-folder.adapter.ts
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import { FailureAnalysisResult } from "../types/failure.types";
6
+
7
+ /**
8
+ * Improved Playwright failure folder parser
9
+ * Focus: reduce UNKNOWN classifications
10
+ */
11
+ export function parsePlaywrightFailureFolders(
12
+ resultsDir: string
13
+ ): FailureAnalysisResult[] {
14
+ const fullDir = path.resolve(resultsDir);
15
+
16
+ if (!fs.existsSync(fullDir)) {
17
+ throw new Error(`Playwright results directory not found: ${fullDir}`);
18
+ }
19
+
20
+ const entries = fs.readdirSync(fullDir, { withFileTypes: true });
21
+ const failures: FailureAnalysisResult[] = [];
22
+
23
+ for (const entry of entries) {
24
+ if (!entry.isDirectory()) continue;
25
+
26
+ const name = entry.name;
27
+ if (!name.includes("FAIL")) continue;
28
+
29
+ const lower = name.toLowerCase();
30
+ let classification = "UNKNOWN";
31
+
32
+ // 🔢 Numeric / data mismatches
33
+ if (
34
+ lower.includes("numeric-mismatch") ||
35
+ lower.includes("count") ||
36
+ lower.includes("total") ||
37
+ lower.includes("sum") ||
38
+ lower.includes("price")
39
+ ) {
40
+ classification = "NUMERIC_MISMATCH";
41
+ }
42
+
43
+ // 🔐 Auth / permission issues
44
+ else if (
45
+ lower.includes("unauthorized") ||
46
+ lower.includes("forbidden") ||
47
+ lower.includes("permission")
48
+ ) {
49
+ classification = "AUTH_BUG";
50
+ }
51
+
52
+ // ⏱ Timeouts / waits
53
+ else if (
54
+ lower.includes("timeout") ||
55
+ lower.includes("timed-out") ||
56
+ lower.includes("wait")
57
+ ) {
58
+ classification = "TIMEOUT";
59
+ }
60
+
61
+ // 🧭 UI / locator issues
62
+ else if (
63
+ lower.includes("locator") ||
64
+ lower.includes("not-visible") ||
65
+ lower.includes("hidden") ||
66
+ lower.includes("detached")
67
+ ) {
68
+ classification = "UI_STATE";
69
+ }
70
+
71
+ // 🔁 Retry / flaky signal
72
+ else if (lower.includes("retry")) {
73
+ classification = "FLAKY";
74
+ }
75
+
76
+ failures.push({
77
+ testName: name,
78
+ classification,
79
+ failureType: classification,
80
+ message: `Derived from Playwright folder name: ${name}`
81
+ });
82
+ }
83
+
84
+ return failures;
85
+ }
@@ -0,0 +1,49 @@
1
+ // src/adapters/playwright-json.adapter.ts
2
+
3
+ import fs from "fs";
4
+ import path from "path";
5
+ import { FailureAnalysisResult } from "../types/failure.types";
6
+
7
+ /**
8
+ * Converts Playwright JSON report → FailureAnalysisResult[]
9
+ */
10
+ export function parsePlaywrightJsonReport(
11
+ reportPath: string
12
+ ): FailureAnalysisResult[] {
13
+ const fullPath = path.resolve(reportPath);
14
+ const raw = fs.readFileSync(fullPath, "utf-8");
15
+ const report = JSON.parse(raw);
16
+
17
+ const failures: FailureAnalysisResult[] = [];
18
+
19
+ for (const suite of report.suites ?? []) {
20
+ for (const spec of suite.specs ?? []) {
21
+ for (const test of spec.tests ?? []) {
22
+ for (const result of test.results ?? []) {
23
+ if (result.status === "failed") {
24
+ const error = result.error?.message ?? "";
25
+
26
+ let classification = "UNKNOWN";
27
+
28
+ if (error.includes("toHaveCount")) {
29
+ classification = "NUMERIC_MISMATCH";
30
+ } else if (error.includes("timeout")) {
31
+ classification = "TIMEOUT";
32
+ } else if (error.includes("locator")) {
33
+ classification = "LOCATOR_CHANGED";
34
+ }
35
+
36
+ failures.push({
37
+ testName: test.title,
38
+ classification,
39
+ failureType: classification,
40
+ message: error
41
+ });
42
+ }
43
+ }
44
+ }
45
+ }
46
+ }
47
+
48
+ return failures;
49
+ }
@@ -0,0 +1,44 @@
1
+ import fs from 'fs'
2
+ import path from 'path'
3
+ import { PlaywrightFailure } from '../types/playwright-failure'
4
+
5
+ export function readPlaywrightFailures(reportDir: string): PlaywrightFailure[] {
6
+ const reportFile = path.join(reportDir, 'report.json')
7
+
8
+ if (!fs.existsSync(reportFile)) {
9
+ throw new Error(
10
+ `Playwright JSON report not found.\nExpected at: ${reportFile}`
11
+ )
12
+ }
13
+
14
+ const raw = JSON.parse(fs.readFileSync(reportFile, 'utf-8'))
15
+ const failures: PlaywrightFailure[] = []
16
+
17
+ for (const suite of raw.suites ?? []) {
18
+ for (const spec of suite.specs ?? []) {
19
+ for (const test of spec.tests ?? []) {
20
+ const failedResults = test.results?.filter(
21
+ (r: any) => r.status === 'failed'
22
+ )
23
+
24
+ if (!failedResults || failedResults.length === 0) continue
25
+
26
+ const firstFailure = failedResults[0]
27
+ const error = firstFailure.error
28
+
29
+ failures.push({
30
+ testName: spec.title,
31
+ errorMessage: error?.message ?? 'Unknown error',
32
+ stack: error?.stack,
33
+
34
+ filePath: error?.location?.file ?? spec.file,
35
+ lineNumber: error?.location?.line ?? spec.line ?? 0,
36
+
37
+ retryCount: failedResults.length - 1
38
+ })
39
+ }
40
+ }
41
+ }
42
+
43
+ return failures
44
+ }
@@ -0,0 +1,20 @@
1
+ import { spawn } from 'child_process';
2
+
3
+ export function runQiTest(args: string[]) {
4
+ const playwrightArgs = [
5
+ 'playwright',
6
+ 'test',
7
+ '--config',
8
+ 'playwright.config.ts',
9
+ ...args
10
+ ];
11
+
12
+ const child = spawn('npx', playwrightArgs, {
13
+ stdio: 'inherit',
14
+ shell: true
15
+ });
16
+
17
+ child.on('exit', code => {
18
+ process.exit(code ?? 0);
19
+ });
20
+ }
package/src/cli/qi.ts ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+ // src/cli/qi.ts
3
+
4
+ import { runQualityIntelligence } from "../runner";
5
+ import { FailureAnalysisResult } from "../types/failure.types";
6
+
7
+ /**
8
+ * Core CLI runner (reusable)
9
+ */
10
+ export async function runQiCli(input: string) {
11
+ const results = await runQualityIntelligence(input);
12
+
13
+ if (!Array.isArray(results) || results.length === 0) {
14
+ console.log("No failures detected.");
15
+ return;
16
+ }
17
+
18
+ for (const f of results as FailureAnalysisResult[]) {
19
+ const testName = f.testName ?? "UNKNOWN_TEST";
20
+ const isExpected = testName.includes("EXPECTED");
21
+
22
+ console.log("=================================");
23
+ console.log(`Test Name : ${testName}${isExpected ? " (EXPECTED)" : ""}`);
24
+ console.log(`Failure Type : ${f.failureType ?? f.classification}`);
25
+ console.log(`Confidence : ${f.confidence ?? "N/A"}\n`);
26
+
27
+ if (f.rootCause?.length) {
28
+ console.log("Root Cause:");
29
+ for (const line of f.rootCause) {
30
+ console.log(` - ${line}`);
31
+ }
32
+ console.log();
33
+ }
34
+
35
+ if (f.evidence?.length) {
36
+ console.log("Evidence:");
37
+ for (const line of f.evidence) {
38
+ console.log(` - ${line}`);
39
+ }
40
+ console.log();
41
+ }
42
+
43
+ if (f.diagnosis?.length) {
44
+ console.log("Diagnosis:");
45
+ for (const line of f.diagnosis) {
46
+ console.log(` - ${line}`);
47
+ }
48
+ console.log();
49
+ }
50
+ }
51
+ }
52
+
53
+ /**
54
+ * CLI ENTRY POINT
55
+ * Allows: npx qi <path>
56
+ */
57
+ async function main() {
58
+ const input = process.argv[2] ?? "playwright-results";
59
+ await runQiCli(input);
60
+ }
61
+
62
+ if (process.argv[1]?.includes("qi")) {
63
+ main().catch(err => {
64
+ console.error("QI CLI failed:", err);
65
+ process.exit(1);
66
+ });
67
+ }
@@ -0,0 +1,9 @@
1
+ export function divider(title?: string, width = 60): string {
2
+ const line = '━'.repeat(width)
3
+
4
+ if (!title) {
5
+ return `\n${line}\n`
6
+ }
7
+
8
+ return `\n${line}\n${title}\n${line}\n`
9
+ }
@@ -0,0 +1,33 @@
1
+ type FailureLogInput = {
2
+ testName: string
3
+ failureType: string
4
+ confidence: number
5
+ file: string
6
+ line: number
7
+ rootCause: string
8
+ severity: string
9
+ priority: string
10
+ }
11
+
12
+ export function logFailure(input: FailureLogInput) {
13
+ const confidencePercent = Math.round(input.confidence * 100)
14
+
15
+ console.log(`
16
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
17
+ ❌ Automation Test Failure
18
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
19
+
20
+ Test Name : ${input.testName}
21
+ Failure Type : ${input.failureType}
22
+ Severity : ${input.severity}
23
+ Priority : ${input.priority}
24
+ Confidence : ${confidencePercent}%
25
+
26
+ Failure Location:
27
+ - Test File : ${input.file}
28
+ - Line Number : ${input.line}
29
+
30
+ Root Cause:
31
+ - ${input.rootCause}
32
+ `)
33
+ }
@@ -0,0 +1,70 @@
1
+ import { QIConfig } from './types';
2
+ import { readJsonFile, resolvePath } from './utils/file-utils';
3
+
4
+ /**
5
+ * Validate configuration object structure
6
+ */
7
+ function validateConfig(config: unknown): config is QIConfig {
8
+ if (typeof config !== 'object' || config === null) {
9
+ return false;
10
+ }
11
+
12
+ const cfg = config as Record<string, unknown>;
13
+
14
+ // Validate engine section
15
+ if (
16
+ typeof cfg.engine !== 'object' ||
17
+ cfg.engine === null
18
+ ) {
19
+ return false;
20
+ }
21
+
22
+ const engine = cfg.engine as Record<string, unknown>;
23
+ if (
24
+ typeof engine.mode !== 'string' ||
25
+ typeof engine.confidenceThresholds !== 'object'
26
+ ) {
27
+ return false;
28
+ }
29
+
30
+ return true;
31
+ }
32
+
33
+ /**
34
+ * Load and validate configuration
35
+ */
36
+ export function loadConfig(): QIConfig {
37
+ try {
38
+ const configPath = resolvePath('config', 'agent.config.json');
39
+ const config = readJsonFile<unknown>(configPath);
40
+
41
+ if (!validateConfig(config)) {
42
+ throw new Error('Invalid configuration structure');
43
+ }
44
+
45
+ return config;
46
+ } catch (error) {
47
+ console.error('❌ Failed to load configuration:', error);
48
+ console.error('\n💡 Using default configuration');
49
+
50
+ // Return safe defaults
51
+ return {
52
+ engine: {
53
+ mode: 'standard',
54
+ confidenceThresholds: {
55
+ fail: 0.85,
56
+ passRisk: 0.6
57
+ }
58
+ },
59
+ output: {
60
+ writeMarkdown: true,
61
+ maxHistoryRuns: 10
62
+ },
63
+ passAnalysis: {
64
+ enable: true,
65
+ reportFlakyPass: true,
66
+ reportApiWarnings: true
67
+ }
68
+ };
69
+ }
70
+ }