agentic-qe 3.8.13 → 3.9.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 (359) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +48 -0
  3. package/dist/adapters/a2ui/integration/agui-sync.js +2 -1
  4. package/dist/audit/witness-chain.js +15 -3
  5. package/dist/boot/fast-paths.d.ts +24 -0
  6. package/dist/boot/fast-paths.js +43 -0
  7. package/dist/boot/parallel-prefetch.d.ts +26 -0
  8. package/dist/boot/parallel-prefetch.js +36 -0
  9. package/dist/cli/bundle.js +12 -9431
  10. package/dist/cli/chunks/adapter-WBR5NXS3.js +2 -0
  11. package/dist/cli/chunks/agent-booster-wasm-PQYB7VRU.js +2 -0
  12. package/dist/cli/chunks/agent-handler-QDAB5NQS.js +33 -0
  13. package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +2 -0
  14. package/dist/cli/chunks/audit-S7JUYYVP.js +3 -0
  15. package/dist/cli/chunks/base-2WXOSMBQ.js +2 -0
  16. package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +2 -0
  17. package/dist/cli/chunks/brain-handler-PPEGDCN4.js +68 -0
  18. package/dist/cli/chunks/branch-enumerator-XK4V5W7L.js +7 -0
  19. package/dist/cli/chunks/browser-PALA5PL3.js +4 -0
  20. package/dist/cli/chunks/browser-workflow-42F7GK5T.js +2 -0
  21. package/dist/cli/chunks/chunk-24FKIJNC.js +15 -0
  22. package/dist/cli/chunks/chunk-263XS447.js +2 -0
  23. package/dist/cli/chunks/chunk-2BZFNEN2.js +4 -0
  24. package/dist/cli/chunks/chunk-2E5NQNSU.js +180 -0
  25. package/dist/cli/chunks/chunk-2I7J3O6V.js +2 -0
  26. package/dist/cli/chunks/chunk-3ADGXLTM.js +14 -0
  27. package/dist/cli/chunks/chunk-3IHG3WOY.js +12 -0
  28. package/dist/cli/chunks/chunk-3IUNFTIF.js +2 -0
  29. package/dist/cli/chunks/chunk-3JPRUND5.js +2 -0
  30. package/dist/cli/chunks/chunk-3NZLZHJI.js +2 -0
  31. package/dist/cli/chunks/chunk-3THRQEZ2.js +95 -0
  32. package/dist/cli/chunks/chunk-3ZOONQG6.js +2 -0
  33. package/dist/cli/chunks/chunk-4B6NCELM.js +2 -0
  34. package/dist/cli/chunks/chunk-4I2IOUS4.js +2 -0
  35. package/dist/cli/chunks/chunk-4VBTXZRM.js +2 -0
  36. package/dist/cli/chunks/chunk-4VUPRTVX.js +3 -0
  37. package/dist/cli/chunks/chunk-4YOMLWEK.js +70 -0
  38. package/dist/cli/chunks/chunk-4YS3IJ45.js +2 -0
  39. package/dist/cli/chunks/chunk-5SKGFSKD.js +2 -0
  40. package/dist/cli/chunks/chunk-5T2ZQWKF.js +27 -0
  41. package/dist/cli/chunks/chunk-62ADTHV7.js +2 -0
  42. package/dist/cli/chunks/chunk-6EOS7KX2.js +2 -0
  43. package/dist/cli/chunks/chunk-6SVX4DJC.js +6 -0
  44. package/dist/cli/chunks/chunk-72WOAVK6.js +2 -0
  45. package/dist/cli/chunks/chunk-7R6YMLVS.js +3 -0
  46. package/dist/cli/chunks/chunk-7VDBAVTY.js +2 -0
  47. package/dist/cli/chunks/chunk-AFLLQ5PP.js +15 -0
  48. package/dist/cli/chunks/chunk-AKE543X2.js +2 -0
  49. package/dist/cli/chunks/chunk-B36CDR4U.js +2 -0
  50. package/dist/cli/chunks/chunk-B6LLWYQ6.js +2 -0
  51. package/dist/cli/chunks/chunk-BDIEMZ22.js +91 -0
  52. package/dist/cli/chunks/chunk-BGXNSCXX.js +4 -0
  53. package/dist/cli/chunks/chunk-BLBRY5UD.js +2 -0
  54. package/dist/cli/chunks/chunk-BPWXXEH2.js +3029 -0
  55. package/dist/cli/chunks/chunk-BR26T7ZS.js +180 -0
  56. package/dist/cli/chunks/chunk-BTREG4IW.js +2 -0
  57. package/dist/cli/chunks/chunk-BULKFVYX.js +2 -0
  58. package/dist/cli/chunks/chunk-BXAXGEFC.js +24 -0
  59. package/dist/cli/chunks/chunk-CL6POIX4.js +2 -0
  60. package/dist/cli/chunks/chunk-CS2KS7LP.js +2 -0
  61. package/dist/cli/chunks/chunk-CWFB6BSA.js +316 -0
  62. package/dist/cli/chunks/chunk-DRT3WKQW.js +2 -0
  63. package/dist/cli/chunks/chunk-EHDQJQ6Y.js +27 -0
  64. package/dist/cli/chunks/chunk-ESVQ6MEB.js +2 -0
  65. package/dist/cli/chunks/chunk-FEKY7T6Q.js +2 -0
  66. package/dist/cli/chunks/chunk-FGA7VIFR.js +7 -0
  67. package/dist/cli/chunks/chunk-FIA6X7UL.js +2 -0
  68. package/dist/cli/chunks/chunk-GAOJV3OX.js +2 -0
  69. package/dist/cli/chunks/chunk-GKNNSCLC.js +5 -0
  70. package/dist/cli/chunks/chunk-GPQ57KA4.js +2 -0
  71. package/dist/cli/chunks/chunk-GRUUQAR6.js +2 -0
  72. package/dist/cli/chunks/chunk-HRO6OZQD.js +2 -0
  73. package/dist/cli/chunks/chunk-HY6PMO5W.js +66 -0
  74. package/dist/cli/chunks/chunk-IAV2JMIX.js +167 -0
  75. package/dist/cli/chunks/chunk-IFNIIK34.js +21 -0
  76. package/dist/cli/chunks/chunk-IGJPMN4I.js +3 -0
  77. package/dist/cli/chunks/chunk-J3KWWR6Z.js +1 -0
  78. package/dist/cli/chunks/chunk-JBANAPWG.js +2 -0
  79. package/dist/cli/chunks/chunk-JJO7Y4H3.js +604 -0
  80. package/dist/cli/chunks/chunk-JRYGQO2W.js +2 -0
  81. package/dist/cli/chunks/chunk-JXM26HEE.js +2 -0
  82. package/dist/cli/chunks/chunk-JZSDOIXA.js +2 -0
  83. package/dist/cli/chunks/chunk-KP5NUODU.js +3 -0
  84. package/dist/cli/chunks/chunk-LHJQD2VU.js +750 -0
  85. package/dist/cli/chunks/chunk-LNQIY6BP.js +2 -0
  86. package/dist/cli/chunks/chunk-MDUHYUHF.js +2 -0
  87. package/dist/cli/chunks/chunk-MV6CMOJQ.js +65 -0
  88. package/dist/cli/chunks/chunk-MZOFWJTM.js +2 -0
  89. package/dist/cli/chunks/chunk-N2NS2PHA.js +45 -0
  90. package/dist/cli/chunks/chunk-N4TL73TH.js +314 -0
  91. package/dist/cli/chunks/chunk-N5UXCLFI.js +2 -0
  92. package/dist/cli/chunks/chunk-NZ2VCPN4.js +2 -0
  93. package/dist/cli/chunks/chunk-OF4D7MYI.js +2 -0
  94. package/dist/cli/chunks/chunk-OI5NGQO2.js +2 -0
  95. package/dist/cli/chunks/chunk-OLHKGP35.js +2 -0
  96. package/dist/cli/chunks/chunk-QOVHWZEP.js +1 -0
  97. package/dist/cli/chunks/chunk-RFSN6IDA.js +79 -0
  98. package/dist/cli/chunks/chunk-RTGGL7D7.js +4 -0
  99. package/dist/cli/chunks/chunk-RU5WAHB7.js +3 -0
  100. package/dist/cli/chunks/chunk-SUSEVMZT.js +2 -0
  101. package/dist/cli/chunks/chunk-TLHP5EII.js +2 -0
  102. package/dist/cli/chunks/chunk-TWUWL5EJ.js +2 -0
  103. package/dist/cli/chunks/chunk-U5RN7YQW.js +2 -0
  104. package/dist/cli/chunks/chunk-UFUVUO3J.js +2 -0
  105. package/dist/cli/chunks/chunk-UQHYFOBX.js +16 -0
  106. package/dist/cli/chunks/chunk-VOS4NQSF.js +2 -0
  107. package/dist/cli/chunks/chunk-VSVXUTJN.js +256 -0
  108. package/dist/cli/chunks/chunk-WBQSXPBI.js +2 -0
  109. package/dist/cli/chunks/chunk-WGMPEW2T.js +2 -0
  110. package/dist/cli/chunks/chunk-WIEC7VKK.js +2 -0
  111. package/dist/cli/chunks/chunk-WJ3DLOXF.js +14 -0
  112. package/dist/cli/chunks/chunk-X3KI6JOY.js +9 -0
  113. package/dist/cli/chunks/chunk-X5IJGWYG.js +2 -0
  114. package/dist/cli/chunks/chunk-XIBDETCS.js +146 -0
  115. package/dist/cli/chunks/chunk-XLRQYLWW.js +2 -0
  116. package/dist/cli/chunks/chunk-XO6PVK2P.js +3 -0
  117. package/dist/cli/chunks/chunk-XRE2HCWG.js +3 -0
  118. package/dist/cli/chunks/chunk-XT2V2322.js +2 -0
  119. package/dist/cli/chunks/chunk-Y7BHKZFJ.js +18 -0
  120. package/dist/cli/chunks/chunk-YAGODYIG.js +59 -0
  121. package/dist/cli/chunks/chunk-YANUP2RO.js +2 -0
  122. package/dist/cli/chunks/chunk-YPFOCNOE.js +30 -0
  123. package/dist/cli/chunks/chunk-YR6ZZGH7.js +81 -0
  124. package/dist/cli/chunks/chunk-YVA65UZL.js +2 -0
  125. package/dist/cli/chunks/chunk-YW2THB5Q.js +2 -0
  126. package/dist/cli/chunks/chunk-ZAPS3UGQ.js +20 -0
  127. package/dist/cli/chunks/chunk-ZDATDCYN.js +2 -0
  128. package/dist/cli/chunks/ci-J374KDLI.js +81 -0
  129. package/dist/cli/chunks/ci-output-7JN7F6CI.js +2 -0
  130. package/dist/cli/chunks/claude-flow-setup-245JLJCN.js +2 -0
  131. package/dist/cli/chunks/client-MCSNSH2C.js +2 -0
  132. package/dist/cli/chunks/cline-installer-LBA2M5N3.js +4 -0
  133. package/dist/cli/chunks/code-U4N4WONM.js +38 -0
  134. package/dist/cli/chunks/code-index-extractor-A57Z6BO4.js +3 -0
  135. package/dist/cli/chunks/codex-installer-UXMK2N4T.js +8 -0
  136. package/dist/cli/chunks/completions-W66BSCOE.js +1364 -0
  137. package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +2 -0
  138. package/dist/cli/chunks/continuedev-installer-LRFZ2SJM.js +14 -0
  139. package/dist/cli/chunks/copilot-installer-CQ3JYBIB.js +3 -0
  140. package/dist/cli/chunks/cost-tracker-4F723RB6.js +2 -0
  141. package/dist/cli/chunks/coverage-4PUEQXAY.js +27 -0
  142. package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +2 -0
  143. package/dist/cli/chunks/cursor-installer-JZEDEDHA.js +3 -0
  144. package/dist/cli/chunks/daemon-B7TWGHXQ.js +19 -0
  145. package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +2 -0
  146. package/dist/cli/chunks/detect-L6ZZHUSX.js +2 -0
  147. package/dist/cli/chunks/domain-handler-FT5FLZWL.js +25 -0
  148. package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +2 -0
  149. package/dist/cli/chunks/dream-4TDBIYED.js +2 -0
  150. package/dist/cli/chunks/esm-node-2PKHKOTS.js +2 -0
  151. package/dist/cli/chunks/eval-GHMPFGWV.js +15 -0
  152. package/dist/cli/chunks/fast-paths-B3R647KN.js +2 -0
  153. package/dist/cli/chunks/feature-flags-DWS7ARSX.js +2 -0
  154. package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +2 -0
  155. package/dist/cli/chunks/file-discovery-QFPA6GMV.js +2 -0
  156. package/dist/cli/chunks/fleet-EKOKMOMW.js +43 -0
  157. package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +2 -0
  158. package/dist/cli/chunks/heartbeat-handler-MBBS4IBU.js +48 -0
  159. package/dist/cli/chunks/heartbeat-scheduler-XDGMOT7X.js +2 -0
  160. package/dist/cli/chunks/hnsw-index-YO7CT23I.js +2 -0
  161. package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +2 -0
  162. package/dist/cli/chunks/hooks-L5VLZGEK.js +101 -0
  163. package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +2 -0
  164. package/dist/cli/chunks/hypergraph-handler-3HDGB5SZ.js +35 -0
  165. package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +2 -0
  166. package/dist/cli/chunks/init-handler-JDET6WUN.js +68 -0
  167. package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +2 -0
  168. package/dist/cli/chunks/kernel-YNDTVKIW.js +2 -0
  169. package/dist/cli/chunks/kilocode-installer-GZZG5AFW.js +4 -0
  170. package/dist/cli/chunks/kiro-installer-IWNY5TKH.js +74 -0
  171. package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +2 -0
  172. package/dist/cli/chunks/learning-722ZNSZ6.js +107 -0
  173. package/dist/cli/chunks/llm-router-DNAV746L.js +30 -0
  174. package/dist/cli/chunks/load-Y3GCUFM4.js +2 -0
  175. package/dist/cli/chunks/load-test-GZUBXFF3.js +2 -0
  176. package/dist/cli/chunks/mcp-LKPIBZ3W.js +2 -0
  177. package/dist/cli/chunks/memory-L57MLFOP.js +32 -0
  178. package/dist/cli/chunks/memory-backend-3NQIZUXE.js +2 -0
  179. package/dist/cli/chunks/memory-handlers-MDZQ7HVW.js +2 -0
  180. package/dist/cli/chunks/opencode-installer-4HUB36H5.js +3 -0
  181. package/dist/cli/chunks/orchestrator-QHSBB2UC.js +371 -0
  182. package/dist/cli/chunks/pipeline-D3QER35Z.js +19 -0
  183. package/dist/cli/chunks/platform-T4E7Q3RD.js +2 -0
  184. package/dist/cli/chunks/plugin-JHW2YPRC.js +27 -0
  185. package/dist/cli/chunks/prime-radiant-advanced-wasm-G7CFNNQV.js +2 -0
  186. package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +2 -0
  187. package/dist/cli/chunks/protocol-handler-2BQQ4HDM.js +20 -0
  188. package/dist/cli/chunks/prove-UQ6JFT73.js +3 -0
  189. package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +2 -0
  190. package/dist/cli/chunks/quality-JRZYMC77.js +7 -0
  191. package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +2 -0
  192. package/dist/cli/chunks/real-embeddings-GK63VF35.js +2 -0
  193. package/dist/cli/chunks/roocode-installer-F4E2LAYR.js +4 -0
  194. package/dist/cli/chunks/router-RJGHWDQ3.js +2 -0
  195. package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +2 -0
  196. package/dist/cli/chunks/routing-handler-VNKFUUGB.js +20 -0
  197. package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +8 -0
  198. package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +2 -0
  199. package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +2 -0
  200. package/dist/cli/chunks/safe-db-G22E5ROA.js +2 -0
  201. package/dist/cli/chunks/schedule-Y7VVCPYV.js +2 -0
  202. package/dist/cli/chunks/scheduler-AUQIFQB7.js +2 -0
  203. package/dist/cli/chunks/security-EBEG2OPU.js +14 -0
  204. package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +2 -0
  205. package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +2 -0
  206. package/dist/cli/chunks/status-handler-VZ32M4G4.js +45 -0
  207. package/dist/cli/chunks/structural-health-K6LRCKV6.js +2 -0
  208. package/dist/cli/chunks/sync-MHSHNLIM.js +23 -0
  209. package/dist/cli/chunks/task-handler-JNOIBZ2G.js +49 -0
  210. package/dist/cli/chunks/task-handlers-P5DSUKND.js +2 -0
  211. package/dist/cli/chunks/test-DO22BNIL.js +33 -0
  212. package/dist/cli/chunks/test-scheduling-VLRQZEFL.js +15 -0
  213. package/dist/cli/chunks/token-bootstrap-4VJKGVMK.js +2 -0
  214. package/dist/cli/chunks/token-usage-LG3PXRXH.js +25 -0
  215. package/dist/cli/chunks/transformers-GY7SIKEU.js +2 -0
  216. package/dist/cli/chunks/tree-sitter-wasm-parser-FT2KB66N.js +2 -0
  217. package/dist/cli/chunks/types-QJGNBKP2.js +2 -0
  218. package/dist/cli/chunks/unified-memory-XYGENQUT.js +2 -0
  219. package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +2 -0
  220. package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +2 -0
  221. package/dist/cli/chunks/validate-VQCRSVNQ.js +21 -0
  222. package/dist/cli/chunks/validate-swarm-A5DHAWTP.js +14 -0
  223. package/dist/cli/chunks/vibium-RZBSL4EB.js +2 -0
  224. package/dist/cli/chunks/visual-security-V47BLGJM.js +2 -0
  225. package/dist/cli/chunks/web-tree-sitter-7C4NXEOF.js +2 -0
  226. package/dist/cli/chunks/windsurf-installer-ES3KPQG3.js +7 -0
  227. package/dist/cli/chunks/witness-chain-BR63P4A7.js +2 -0
  228. package/dist/cli/chunks/workflow-JETHX4ML.js +51 -0
  229. package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +2 -0
  230. package/dist/cli/chunks/wrappers-WP5RH745.js +2 -0
  231. package/dist/cli/commands/daemon.d.ts +13 -0
  232. package/dist/cli/commands/daemon.js +224 -0
  233. package/dist/cli/commands/hooks-handlers/hooks-shared.js +2 -1
  234. package/dist/cli/commands/plugin.d.ts +12 -0
  235. package/dist/cli/commands/plugin.js +135 -0
  236. package/dist/cli/commands/workflow.d.ts +10 -0
  237. package/dist/cli/commands/workflow.js +587 -0
  238. package/dist/cli/handlers/brain-handler.js +13 -8
  239. package/dist/cli/handlers/heartbeat-handler.d.ts +1 -0
  240. package/dist/cli/handlers/heartbeat-handler.js +20 -10
  241. package/dist/cli/handlers/hypergraph-handler.js +3 -3
  242. package/dist/cli/handlers/init-handler.js +10 -9
  243. package/dist/cli/handlers/interfaces.d.ts +4 -4
  244. package/dist/cli/index.js +159 -638
  245. package/dist/cli/lazy-registry.d.ts +27 -0
  246. package/dist/cli/lazy-registry.js +70 -0
  247. package/dist/context/compaction/context-budget.d.ts +71 -0
  248. package/dist/context/compaction/context-budget.js +120 -0
  249. package/dist/context/compaction/index.d.ts +96 -0
  250. package/dist/context/compaction/index.js +259 -0
  251. package/dist/context/compaction/llm-caller-adapter.d.ts +14 -0
  252. package/dist/context/compaction/llm-caller-adapter.js +47 -0
  253. package/dist/context/compaction/tier1-microcompact.d.ts +33 -0
  254. package/dist/context/compaction/tier1-microcompact.js +47 -0
  255. package/dist/context/compaction/tier2-session-summary.d.ts +72 -0
  256. package/dist/context/compaction/tier2-session-summary.js +172 -0
  257. package/dist/context/compaction/tier3-llm-compact.d.ts +65 -0
  258. package/dist/context/compaction/tier3-llm-compact.js +166 -0
  259. package/dist/context/compaction/tier4-reactive.d.ts +54 -0
  260. package/dist/context/compaction/tier4-reactive.js +129 -0
  261. package/dist/coordination/consensus/providers/claude-provider.d.ts +1 -0
  262. package/dist/coordination/consensus/providers/claude-provider.js +23 -3
  263. package/dist/domains/test-generation/generators/base-test-generator.d.ts +1 -1
  264. package/dist/domains/test-generation/generators/base-test-generator.js +11 -11
  265. package/dist/domains/test-generation/generators/go-test-generator.js +12 -12
  266. package/dist/domains/test-generation/generators/junit5-generator.js +9 -9
  267. package/dist/domains/test-generation/generators/kotlin-junit-generator.js +10 -10
  268. package/dist/domains/test-generation/generators/pytest-generator.js +8 -8
  269. package/dist/domains/test-generation/generators/swift-testing-generator.js +8 -8
  270. package/dist/domains/test-generation/generators/test-value-helpers.d.ts +20 -0
  271. package/dist/domains/test-generation/generators/test-value-helpers.js +48 -0
  272. package/dist/domains/test-generation/generators/xunit-generator.js +11 -11
  273. package/dist/hooks/cross-phase-hooks.d.ts +11 -0
  274. package/dist/hooks/cross-phase-hooks.js +73 -9
  275. package/dist/hooks/security/config-snapshot.d.ts +21 -0
  276. package/dist/hooks/security/config-snapshot.js +33 -0
  277. package/dist/hooks/security/exit-codes.d.ts +28 -0
  278. package/dist/hooks/security/exit-codes.js +33 -0
  279. package/dist/hooks/security/index.d.ts +15 -0
  280. package/dist/hooks/security/index.js +15 -0
  281. package/dist/hooks/security/ssrf-guard.d.ts +25 -0
  282. package/dist/hooks/security/ssrf-guard.js +69 -0
  283. package/dist/index.d.ts +1 -1
  284. package/dist/index.js +1 -2
  285. package/dist/init/init-wizard-hooks.js +15 -1
  286. package/dist/init/phases/07-hooks.js +2 -2
  287. package/dist/init/settings-merge.js +3 -7
  288. package/dist/kernel/kernel.js +35 -0
  289. package/dist/kernel/memory-backend.js +3 -1
  290. package/dist/mcp/bundle.js +416 -362
  291. package/dist/mcp/entry.js +132 -77
  292. package/dist/mcp/http-server.js +4 -1
  293. package/dist/mcp/index.d.ts +2 -2
  294. package/dist/mcp/index.js +5 -4
  295. package/dist/mcp/middleware/batch-executor.d.ts +46 -0
  296. package/dist/mcp/middleware/batch-executor.js +150 -0
  297. package/dist/mcp/middleware/microcompact.d.ts +97 -0
  298. package/dist/mcp/middleware/microcompact.js +179 -0
  299. package/dist/mcp/middleware/middleware-chain.d.ts +37 -0
  300. package/dist/mcp/middleware/middleware-chain.js +60 -0
  301. package/dist/mcp/protocol-server.d.ts +16 -0
  302. package/dist/mcp/protocol-server.js +140 -36
  303. package/dist/mcp/services/session-durability-middleware.d.ts +22 -0
  304. package/dist/mcp/services/session-durability-middleware.js +64 -0
  305. package/dist/mcp/services/session-resume.d.ts +29 -0
  306. package/dist/mcp/services/session-resume.js +221 -0
  307. package/dist/mcp/services/session-store.d.ts +84 -0
  308. package/dist/mcp/services/session-store.js +163 -0
  309. package/dist/mcp/tool-registry.d.ts +9 -0
  310. package/dist/mcp/tool-registry.js +30 -1
  311. package/dist/mcp/types.d.ts +1 -0
  312. package/dist/plugins/cache.d.ts +44 -0
  313. package/dist/plugins/cache.js +149 -0
  314. package/dist/plugins/index.d.ts +15 -0
  315. package/dist/plugins/index.js +15 -0
  316. package/dist/plugins/lifecycle.d.ts +67 -0
  317. package/dist/plugins/lifecycle.js +175 -0
  318. package/dist/plugins/manifest.d.ts +45 -0
  319. package/dist/plugins/manifest.js +173 -0
  320. package/dist/plugins/resolver.d.ts +37 -0
  321. package/dist/plugins/resolver.js +80 -0
  322. package/dist/plugins/security.d.ts +23 -0
  323. package/dist/plugins/security.js +125 -0
  324. package/dist/plugins/sources/github.d.ts +17 -0
  325. package/dist/plugins/sources/github.js +77 -0
  326. package/dist/plugins/sources/local.d.ts +20 -0
  327. package/dist/plugins/sources/local.js +32 -0
  328. package/dist/plugins/sources/npm.d.ts +18 -0
  329. package/dist/plugins/sources/npm.js +82 -0
  330. package/dist/shared/llm/retry.d.ts +5 -2
  331. package/dist/shared/llm/retry.js +7 -3
  332. package/dist/shared/prompt-cache-latch.d.ts +41 -0
  333. package/dist/shared/prompt-cache-latch.js +63 -0
  334. package/dist/shared/retry-engine.d.ts +77 -0
  335. package/dist/shared/retry-engine.js +194 -0
  336. package/dist/workers/daemon.d.ts +8 -0
  337. package/dist/workers/daemon.js +13 -0
  338. package/dist/workers/quality-daemon/ci-monitor.d.ts +55 -0
  339. package/dist/workers/quality-daemon/ci-monitor.js +147 -0
  340. package/dist/workers/quality-daemon/coverage-delta.d.ts +72 -0
  341. package/dist/workers/quality-daemon/coverage-delta.js +135 -0
  342. package/dist/workers/quality-daemon/git-watcher.d.ts +51 -0
  343. package/dist/workers/quality-daemon/git-watcher.js +209 -0
  344. package/dist/workers/quality-daemon/index.d.ts +119 -0
  345. package/dist/workers/quality-daemon/index.js +343 -0
  346. package/dist/workers/quality-daemon/nightly-consolidation.d.ts +74 -0
  347. package/dist/workers/quality-daemon/nightly-consolidation.js +136 -0
  348. package/dist/workers/quality-daemon/notification-service.d.ts +67 -0
  349. package/dist/workers/quality-daemon/notification-service.js +178 -0
  350. package/dist/workers/quality-daemon/persistent-memory.d.ts +31 -0
  351. package/dist/workers/quality-daemon/persistent-memory.js +30 -0
  352. package/dist/workers/quality-daemon/priority-queue.d.ts +97 -0
  353. package/dist/workers/quality-daemon/priority-queue.js +126 -0
  354. package/dist/workers/quality-daemon/test-suggester.d.ts +50 -0
  355. package/dist/workers/quality-daemon/test-suggester.js +121 -0
  356. package/dist/workers/worker-manager.js +2 -1
  357. package/package.json +1 -1
  358. package/dist/mcp/server.d.ts +0 -46
  359. package/dist/mcp/server.js +0 -802
@@ -0,0 +1,178 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Notification Service
3
+ *
4
+ * Delivers notifications via:
5
+ * - File-based: JSON files in `.agentic-qe/notifications/`
6
+ * - Webhook: POST to configured URL (with IMP-07 SSRF protection)
7
+ *
8
+ * Notification types: gate_failure, coverage_drop, flaky_detected, suggestion_available
9
+ */
10
+ import { writeFileSync, mkdirSync, readdirSync, readFileSync, unlinkSync } from 'fs';
11
+ import { join, resolve } from 'path';
12
+ const DEFAULTS = {
13
+ notificationsDir: resolve(process.cwd(), '.agentic-qe', 'notifications'),
14
+ maxNotifications: 200,
15
+ };
16
+ export class NotificationService {
17
+ notificationsDir;
18
+ maxNotifications;
19
+ webhookUrl;
20
+ urlValidator;
21
+ _sentCount = 0;
22
+ constructor(options) {
23
+ this.notificationsDir = options?.notificationsDir ?? DEFAULTS.notificationsDir;
24
+ this.maxNotifications = options?.maxNotifications ?? DEFAULTS.maxNotifications;
25
+ this.webhookUrl = options?.webhookUrl;
26
+ this.urlValidator = options?.urlValidator;
27
+ }
28
+ get sentCount() {
29
+ return this._sentCount;
30
+ }
31
+ /**
32
+ * Initialize the notifications directory.
33
+ */
34
+ initialize() {
35
+ mkdirSync(this.notificationsDir, { recursive: true });
36
+ }
37
+ /**
38
+ * Send a notification.
39
+ */
40
+ async send(notification) {
41
+ const full = {
42
+ ...notification,
43
+ id: `notif-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
44
+ timestamp: Date.now(),
45
+ read: false,
46
+ };
47
+ // File-based delivery
48
+ this.writeToFile(full);
49
+ // Webhook delivery (if configured)
50
+ if (this.webhookUrl) {
51
+ await this.sendWebhook(full);
52
+ }
53
+ this._sentCount++;
54
+ this.pruneOldNotifications();
55
+ return full;
56
+ }
57
+ /**
58
+ * List recent notifications.
59
+ */
60
+ list(options) {
61
+ const limit = options?.limit ?? 50;
62
+ try {
63
+ const files = readdirSync(this.notificationsDir)
64
+ .filter((f) => f.endsWith('.json'))
65
+ .sort()
66
+ .reverse(); // newest first
67
+ const notifications = [];
68
+ for (const file of files) {
69
+ if (notifications.length >= limit)
70
+ break;
71
+ try {
72
+ const content = readFileSync(join(this.notificationsDir, file), 'utf-8');
73
+ const notif = JSON.parse(content);
74
+ if (options?.unreadOnly && notif.read)
75
+ continue;
76
+ if (options?.type && notif.type !== options.type)
77
+ continue;
78
+ notifications.push(notif);
79
+ }
80
+ catch {
81
+ // corrupt file, skip
82
+ }
83
+ }
84
+ return notifications;
85
+ }
86
+ catch {
87
+ return [];
88
+ }
89
+ }
90
+ /**
91
+ * Mark a notification as read.
92
+ */
93
+ markRead(id) {
94
+ try {
95
+ // Exact suffix match to prevent substring collisions (Finding 4)
96
+ const files = readdirSync(this.notificationsDir).filter((f) => f.endsWith(`-${id}.json`));
97
+ if (files.length === 0)
98
+ return false;
99
+ const filePath = join(this.notificationsDir, files[0]);
100
+ const content = JSON.parse(readFileSync(filePath, 'utf-8'));
101
+ const updated = { ...content, read: true };
102
+ writeFileSync(filePath, JSON.stringify(updated, null, 2));
103
+ return true;
104
+ }
105
+ catch {
106
+ return false;
107
+ }
108
+ }
109
+ /**
110
+ * Clear all notifications.
111
+ */
112
+ clear() {
113
+ try {
114
+ const files = readdirSync(this.notificationsDir).filter((f) => f.endsWith('.json'));
115
+ for (const file of files) {
116
+ unlinkSync(join(this.notificationsDir, file));
117
+ }
118
+ return files.length;
119
+ }
120
+ catch {
121
+ return 0;
122
+ }
123
+ }
124
+ // ============================================================================
125
+ // Private
126
+ // ============================================================================
127
+ writeToFile(notification) {
128
+ try {
129
+ mkdirSync(this.notificationsDir, { recursive: true });
130
+ const filename = `${notification.timestamp}-${notification.id}.json`;
131
+ const filePath = join(this.notificationsDir, filename);
132
+ writeFileSync(filePath, JSON.stringify(notification, null, 2));
133
+ }
134
+ catch (err) {
135
+ console.debug('[NotificationService] Failed to write notification:', err);
136
+ }
137
+ }
138
+ async sendWebhook(notification) {
139
+ if (!this.webhookUrl)
140
+ return;
141
+ // IMP-07 SSRF guard: validate URL before sending
142
+ if (this.urlValidator && !this.urlValidator(this.webhookUrl)) {
143
+ console.warn('[NotificationService] Webhook URL blocked by SSRF guard:', this.webhookUrl);
144
+ return;
145
+ }
146
+ try {
147
+ const response = await fetch(this.webhookUrl, {
148
+ method: 'POST',
149
+ headers: { 'Content-Type': 'application/json' },
150
+ body: JSON.stringify(notification),
151
+ signal: AbortSignal.timeout(5000),
152
+ });
153
+ if (!response.ok) {
154
+ console.debug(`[NotificationService] Webhook returned ${response.status}`);
155
+ }
156
+ }
157
+ catch (err) {
158
+ console.debug('[NotificationService] Webhook delivery failed:', err);
159
+ }
160
+ }
161
+ pruneOldNotifications() {
162
+ try {
163
+ const files = readdirSync(this.notificationsDir)
164
+ .filter((f) => f.endsWith('.json'))
165
+ .sort();
166
+ if (files.length <= this.maxNotifications)
167
+ return;
168
+ const toRemove = files.slice(0, files.length - this.maxNotifications);
169
+ for (const file of toRemove) {
170
+ unlinkSync(join(this.notificationsDir, file));
171
+ }
172
+ }
173
+ catch {
174
+ // best-effort pruning
175
+ }
176
+ }
177
+ }
178
+ //# sourceMappingURL=notification-service.js.map
@@ -0,0 +1,31 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Persistent WorkerMemory Adapter
3
+ *
4
+ * Bridges the WorkerMemory interface to the unified SQLite persistence
5
+ * layer (UnifiedMemoryManager). All daemon state is persisted to the
6
+ * `quality-daemon` namespace in kv_store, surviving restarts.
7
+ *
8
+ * Resolves Finding 2: CLI daemon previously used throwaway in-memory Map.
9
+ */
10
+ import type { WorkerMemory } from '../interfaces';
11
+ /**
12
+ * Interface matching the subset of UnifiedMemoryManager we need,
13
+ * to avoid circular dependency on the full kernel module.
14
+ */
15
+ export interface KVBackend {
16
+ kvGet<T>(key: string, namespace?: string): Promise<T | undefined>;
17
+ kvSet(key: string, value: unknown, namespace?: string, ttl?: number): Promise<void>;
18
+ kvSearch(pattern: string, namespace?: string, limit?: number): Promise<string[]>;
19
+ }
20
+ /**
21
+ * WorkerMemory backed by unified SQLite persistence.
22
+ * All keys are stored in the 'quality-daemon' namespace.
23
+ */
24
+ export declare class PersistentWorkerMemory implements WorkerMemory {
25
+ private readonly backend;
26
+ constructor(backend: KVBackend);
27
+ get<T>(key: string): Promise<T | undefined>;
28
+ set<T>(key: string, value: T): Promise<void>;
29
+ search(pattern: string): Promise<string[]>;
30
+ }
31
+ //# sourceMappingURL=persistent-memory.d.ts.map
@@ -0,0 +1,30 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Persistent WorkerMemory Adapter
3
+ *
4
+ * Bridges the WorkerMemory interface to the unified SQLite persistence
5
+ * layer (UnifiedMemoryManager). All daemon state is persisted to the
6
+ * `quality-daemon` namespace in kv_store, surviving restarts.
7
+ *
8
+ * Resolves Finding 2: CLI daemon previously used throwaway in-memory Map.
9
+ */
10
+ const NAMESPACE = 'quality-daemon';
11
+ /**
12
+ * WorkerMemory backed by unified SQLite persistence.
13
+ * All keys are stored in the 'quality-daemon' namespace.
14
+ */
15
+ export class PersistentWorkerMemory {
16
+ backend;
17
+ constructor(backend) {
18
+ this.backend = backend;
19
+ }
20
+ async get(key) {
21
+ return this.backend.kvGet(key, NAMESPACE);
22
+ }
23
+ async set(key, value) {
24
+ await this.backend.kvSet(key, value, NAMESPACE);
25
+ }
26
+ async search(pattern) {
27
+ return this.backend.kvSearch(pattern, NAMESPACE);
28
+ }
29
+ }
30
+ //# sourceMappingURL=persistent-memory.js.map
@@ -0,0 +1,97 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Priority Queue
3
+ *
4
+ * 3-level priority queue for daemon task scheduling:
5
+ * - 'now': Quality gate failures, critical alerts (processed immediately)
6
+ * - 'next': New commits, coverage changes (processed on next tick)
7
+ * - 'later': Nightly consolidation, pattern pruning (processed during idle)
8
+ */
9
+ export type QueuePriority = 'now' | 'next' | 'later';
10
+ export interface QueueItem<T = unknown> {
11
+ readonly id: string;
12
+ readonly priority: QueuePriority;
13
+ readonly payload: T;
14
+ readonly createdAt: number;
15
+ readonly source: string;
16
+ /** Max age in ms before the item is discarded as stale */
17
+ readonly ttlMs?: number;
18
+ }
19
+ /**
20
+ * Typed payloads for known daemon task types.
21
+ */
22
+ export interface GitCommitPayload {
23
+ readonly type: 'git_commit';
24
+ readonly branch: string;
25
+ readonly commitHash: string;
26
+ readonly changedFiles: string[];
27
+ }
28
+ export interface CoverageDeltaPayload {
29
+ readonly type: 'coverage_delta';
30
+ readonly previousSnapshot: string;
31
+ readonly currentSnapshot: string;
32
+ }
33
+ export interface GateFailurePayload {
34
+ readonly type: 'gate_failure';
35
+ readonly gateName: string;
36
+ readonly score: number;
37
+ readonly threshold: number;
38
+ }
39
+ export interface NightlyPayload {
40
+ readonly type: 'nightly';
41
+ readonly tasks: string[];
42
+ }
43
+ export interface CIFailurePayload {
44
+ readonly type: 'ci_failure';
45
+ readonly workflowName: string;
46
+ readonly runId: number;
47
+ readonly conclusion: string;
48
+ }
49
+ export type DaemonTaskPayload = GitCommitPayload | CoverageDeltaPayload | GateFailurePayload | NightlyPayload | CIFailurePayload;
50
+ /**
51
+ * A bounded, 3-level priority queue with optional TTL expiry.
52
+ */
53
+ export declare class PriorityQueue<T = DaemonTaskPayload> {
54
+ private queues;
55
+ private _maxSize;
56
+ constructor(maxSize?: number);
57
+ /**
58
+ * Enqueue an item at the given priority level.
59
+ * Returns false if queue is full.
60
+ */
61
+ enqueue(item: QueueItem<T>): boolean;
62
+ /**
63
+ * Dequeue the highest-priority item.
64
+ * Within a priority level, FIFO order is maintained.
65
+ * Stale items (past TTL) are silently skipped.
66
+ */
67
+ dequeue(): QueueItem<T> | undefined;
68
+ /**
69
+ * Peek at the next item without removing it.
70
+ */
71
+ peek(): QueueItem<T> | undefined;
72
+ /**
73
+ * Drain all items at a specific priority level.
74
+ */
75
+ drainPriority(priority: QueuePriority): QueueItem<T>[];
76
+ /**
77
+ * Remove all expired items across all queues.
78
+ */
79
+ pruneExpired(): number;
80
+ /**
81
+ * Total number of items across all priority levels.
82
+ */
83
+ get size(): number;
84
+ /**
85
+ * Per-priority counts.
86
+ */
87
+ get depths(): Record<QueuePriority, number>;
88
+ /**
89
+ * Whether there are any items queued.
90
+ */
91
+ get isEmpty(): boolean;
92
+ /**
93
+ * Clear all items.
94
+ */
95
+ clear(): void;
96
+ }
97
+ //# sourceMappingURL=priority-queue.d.ts.map
@@ -0,0 +1,126 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Priority Queue
3
+ *
4
+ * 3-level priority queue for daemon task scheduling:
5
+ * - 'now': Quality gate failures, critical alerts (processed immediately)
6
+ * - 'next': New commits, coverage changes (processed on next tick)
7
+ * - 'later': Nightly consolidation, pattern pruning (processed during idle)
8
+ */
9
+ const PRIORITY_ORDER = {
10
+ now: 0,
11
+ next: 1,
12
+ later: 2,
13
+ };
14
+ /**
15
+ * A bounded, 3-level priority queue with optional TTL expiry.
16
+ */
17
+ export class PriorityQueue {
18
+ queues = {
19
+ now: [],
20
+ next: [],
21
+ later: [],
22
+ };
23
+ _maxSize;
24
+ constructor(maxSize = 1000) {
25
+ this._maxSize = maxSize;
26
+ }
27
+ /**
28
+ * Enqueue an item at the given priority level.
29
+ * Returns false if queue is full.
30
+ */
31
+ enqueue(item) {
32
+ if (this.size >= this._maxSize) {
33
+ return false;
34
+ }
35
+ this.queues[item.priority].push(item);
36
+ return true;
37
+ }
38
+ /**
39
+ * Dequeue the highest-priority item.
40
+ * Within a priority level, FIFO order is maintained.
41
+ * Stale items (past TTL) are silently skipped.
42
+ */
43
+ dequeue() {
44
+ const now = Date.now();
45
+ for (const priority of ['now', 'next', 'later']) {
46
+ const queue = this.queues[priority];
47
+ while (queue.length > 0) {
48
+ const item = queue.shift();
49
+ if (item.ttlMs && now - item.createdAt > item.ttlMs) {
50
+ continue; // expired, skip
51
+ }
52
+ return item;
53
+ }
54
+ }
55
+ return undefined;
56
+ }
57
+ /**
58
+ * Peek at the next item without removing it.
59
+ */
60
+ peek() {
61
+ const now = Date.now();
62
+ for (const priority of ['now', 'next', 'later']) {
63
+ const queue = this.queues[priority];
64
+ for (const item of queue) {
65
+ if (!item.ttlMs || now - item.createdAt <= item.ttlMs) {
66
+ return item;
67
+ }
68
+ }
69
+ }
70
+ return undefined;
71
+ }
72
+ /**
73
+ * Drain all items at a specific priority level.
74
+ */
75
+ drainPriority(priority) {
76
+ const items = this.queues[priority].splice(0);
77
+ const now = Date.now();
78
+ return items.filter((item) => !item.ttlMs || now - item.createdAt <= item.ttlMs);
79
+ }
80
+ /**
81
+ * Remove all expired items across all queues.
82
+ */
83
+ pruneExpired() {
84
+ let pruned = 0;
85
+ const now = Date.now();
86
+ for (const priority of ['now', 'next', 'later']) {
87
+ const before = this.queues[priority].length;
88
+ this.queues[priority] = this.queues[priority].filter((item) => !item.ttlMs || now - item.createdAt <= item.ttlMs);
89
+ pruned += before - this.queues[priority].length;
90
+ }
91
+ return pruned;
92
+ }
93
+ /**
94
+ * Total number of items across all priority levels.
95
+ */
96
+ get size() {
97
+ return (this.queues.now.length +
98
+ this.queues.next.length +
99
+ this.queues.later.length);
100
+ }
101
+ /**
102
+ * Per-priority counts.
103
+ */
104
+ get depths() {
105
+ return {
106
+ now: this.queues.now.length,
107
+ next: this.queues.next.length,
108
+ later: this.queues.later.length,
109
+ };
110
+ }
111
+ /**
112
+ * Whether there are any items queued.
113
+ */
114
+ get isEmpty() {
115
+ return this.size === 0;
116
+ }
117
+ /**
118
+ * Clear all items.
119
+ */
120
+ clear() {
121
+ this.queues.now = [];
122
+ this.queues.next = [];
123
+ this.queues.later = [];
124
+ }
125
+ }
126
+ //# sourceMappingURL=priority-queue.js.map
@@ -0,0 +1,50 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Test Suggester
3
+ *
4
+ * Analyzes uncovered code from coverage delta and generates
5
+ * test case suggestions. Stores suggestions in memory for
6
+ * retrieval via MCP tools.
7
+ */
8
+ import type { WorkerMemory } from '../interfaces';
9
+ import type { CoverageGap } from './coverage-delta';
10
+ export interface TestSuggestion {
11
+ readonly id: string;
12
+ readonly file: string;
13
+ readonly uncoveredLines: number[];
14
+ readonly suggestedTestType: 'unit' | 'integration' | 'e2e';
15
+ readonly description: string;
16
+ readonly priority: 'high' | 'medium' | 'low';
17
+ readonly estimatedEffort: 'small' | 'medium' | 'large';
18
+ readonly createdAt: number;
19
+ readonly status: 'pending' | 'accepted' | 'dismissed';
20
+ }
21
+ export interface TestSuggesterOptions {
22
+ /** Memory key prefix for storing suggestions */
23
+ memoryPrefix?: string;
24
+ /** Maximum suggestions to store */
25
+ maxSuggestions?: number;
26
+ /** Minimum risk score to generate a suggestion */
27
+ minRiskScore?: number;
28
+ }
29
+ export declare class TestSuggester {
30
+ private options;
31
+ constructor(options?: TestSuggesterOptions);
32
+ /**
33
+ * Generate test suggestions from coverage gaps.
34
+ */
35
+ suggest(gaps: CoverageGap[], changedFiles: string[], memory: WorkerMemory): Promise<TestSuggestion[]>;
36
+ /**
37
+ * Retrieve pending suggestions from memory.
38
+ */
39
+ getPending(memory: WorkerMemory): Promise<TestSuggestion[]>;
40
+ /**
41
+ * Update the status of a suggestion.
42
+ */
43
+ updateStatus(id: string, status: 'accepted' | 'dismissed', memory: WorkerMemory): Promise<boolean>;
44
+ private determinePriority;
45
+ private determineTestType;
46
+ private estimateEffort;
47
+ private generateDescription;
48
+ private storeSuggestions;
49
+ }
50
+ //# sourceMappingURL=test-suggester.d.ts.map
@@ -0,0 +1,121 @@
1
+ /**
2
+ * IMP-10: QE Quality Daemon — Test Suggester
3
+ *
4
+ * Analyzes uncovered code from coverage delta and generates
5
+ * test case suggestions. Stores suggestions in memory for
6
+ * retrieval via MCP tools.
7
+ */
8
+ const DEFAULTS = {
9
+ memoryPrefix: 'quality-daemon:suggestions',
10
+ maxSuggestions: 100,
11
+ minRiskScore: 0.3,
12
+ };
13
+ export class TestSuggester {
14
+ options;
15
+ constructor(options) {
16
+ this.options = { ...DEFAULTS, ...options };
17
+ }
18
+ /**
19
+ * Generate test suggestions from coverage gaps.
20
+ */
21
+ async suggest(gaps, changedFiles, memory) {
22
+ const suggestions = [];
23
+ // Filter gaps by minimum risk score
24
+ const significantGaps = gaps.filter((g) => g.riskScore >= this.options.minRiskScore);
25
+ for (const gap of significantGaps) {
26
+ const isChanged = changedFiles.includes(gap.file);
27
+ const priority = this.determinePriority(gap, isChanged);
28
+ const testType = this.determineTestType(gap.file);
29
+ const effort = this.estimateEffort(gap);
30
+ suggestions.push({
31
+ id: `suggestion-${Date.now()}-${suggestions.length}`,
32
+ file: gap.file,
33
+ uncoveredLines: gap.uncoveredLines.slice(0, 50), // cap line list
34
+ suggestedTestType: testType,
35
+ description: this.generateDescription(gap, testType),
36
+ priority,
37
+ estimatedEffort: effort,
38
+ createdAt: Date.now(),
39
+ status: 'pending',
40
+ });
41
+ }
42
+ // Sort by priority (high first)
43
+ suggestions.sort((a, b) => {
44
+ const order = { high: 0, medium: 1, low: 2 };
45
+ return order[a.priority] - order[b.priority];
46
+ });
47
+ // Cap to max
48
+ const capped = suggestions.slice(0, this.options.maxSuggestions);
49
+ // Store in memory
50
+ await this.storeSuggestions(capped, memory);
51
+ return capped;
52
+ }
53
+ /**
54
+ * Retrieve pending suggestions from memory.
55
+ */
56
+ async getPending(memory) {
57
+ const stored = await memory.get(`${this.options.memoryPrefix}:list`);
58
+ return (stored ?? []).filter((s) => s.status === 'pending');
59
+ }
60
+ /**
61
+ * Update the status of a suggestion.
62
+ */
63
+ async updateStatus(id, status, memory) {
64
+ const stored = await memory.get(`${this.options.memoryPrefix}:list`);
65
+ if (!stored)
66
+ return false;
67
+ const idx = stored.findIndex((s) => s.id === id);
68
+ if (idx === -1)
69
+ return false;
70
+ // Create updated list (immutable pattern)
71
+ const updated = stored.map((s, i) => i === idx ? { ...s, status } : s);
72
+ await memory.set(`${this.options.memoryPrefix}:list`, updated);
73
+ return true;
74
+ }
75
+ // ============================================================================
76
+ // Private
77
+ // ============================================================================
78
+ determinePriority(gap, isRecentlyChanged) {
79
+ if (gap.riskScore > 0.8)
80
+ return 'high';
81
+ if (isRecentlyChanged || gap.riskScore > 0.5)
82
+ return 'medium';
83
+ return 'low';
84
+ }
85
+ determineTestType(file) {
86
+ if (file.includes('/api/') || file.includes('/routes/') || file.includes('/handlers/')) {
87
+ return 'integration';
88
+ }
89
+ if (file.includes('/e2e/') || file.includes('/pages/') || file.includes('/views/')) {
90
+ return 'e2e';
91
+ }
92
+ return 'unit';
93
+ }
94
+ estimateEffort(gap) {
95
+ if (gap.uncoveredLines.length <= 10)
96
+ return 'small';
97
+ if (gap.uncoveredLines.length <= 50)
98
+ return 'medium';
99
+ return 'large';
100
+ }
101
+ generateDescription(gap, testType) {
102
+ const lineCount = gap.uncoveredLines.length;
103
+ const coverage = Math.round(gap.currentCoverage);
104
+ return (`Add ${testType} tests for ${gap.file} ` +
105
+ `(${lineCount} uncovered lines, ${coverage}% coverage, ` +
106
+ `risk ${(gap.riskScore * 100).toFixed(0)}%)`);
107
+ }
108
+ async storeSuggestions(suggestions, memory) {
109
+ // Merge with existing suggestions (keep dismissed/accepted, replace pending)
110
+ const existing = await memory.get(`${this.options.memoryPrefix}:list`);
111
+ const kept = (existing ?? []).filter((s) => s.status !== 'pending');
112
+ const merged = [...kept, ...suggestions].slice(-this.options.maxSuggestions);
113
+ await memory.set(`${this.options.memoryPrefix}:list`, merged);
114
+ await memory.set(`${this.options.memoryPrefix}:count`, {
115
+ pending: suggestions.length,
116
+ total: merged.length,
117
+ lastUpdated: Date.now(),
118
+ });
119
+ }
120
+ }
121
+ //# sourceMappingURL=test-suggester.js.map
@@ -55,7 +55,8 @@ class InMemoryWorkerMemory {
55
55
  this.store.set(key, value);
56
56
  }
57
57
  async search(pattern) {
58
- const regex = new RegExp(pattern.replace(/\*/g, '.*'));
58
+ const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&');
59
+ const regex = new RegExp(escaped.replace(/\*/g, '.*'));
59
60
  return Array.from(this.store.keys()).filter((key) => regex.test(key));
60
61
  }
61
62
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agentic-qe",
3
- "version": "3.8.13",
3
+ "version": "3.9.0",
4
4
  "description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",