agentic-qe 3.11.4 → 3.12.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 (449) hide show
  1. package/.claude/helpers/.helpers-version +1 -0
  2. package/.claude/helpers/auto-memory-hook.mjs +35 -3
  3. package/.claude/helpers/brain-checkpoint.cjs +16 -1
  4. package/.claude/helpers/helpers.manifest.json +12 -0
  5. package/.claude/helpers/hook-handler.cjs +26 -5
  6. package/.claude/helpers/intelligence.cjs +14 -1
  7. package/.claude/hooks/aqe-hook.cjs +57 -10
  8. package/.claude/skills/skills-manifest.json +1 -1
  9. package/CHANGELOG.md +110 -0
  10. package/assets/skills/skills-manifest.json +1 -1
  11. package/dist/adapters/a2a/auth/routes.js +59 -28
  12. package/dist/audit/witness-chain.d.ts +25 -0
  13. package/dist/audit/witness-chain.js +69 -22
  14. package/dist/audit/witness-key-manager.d.ts +11 -0
  15. package/dist/audit/witness-key-manager.js +24 -0
  16. package/dist/cli/brain-commands.js +2 -1
  17. package/dist/cli/bundle.js +6 -6
  18. package/dist/cli/chunks/adapter-6IWRIHF3.js +2 -0
  19. package/dist/cli/chunks/{agent-booster-wasm-62I6ZNRW.js → agent-booster-wasm-IO54X6IQ.js} +2 -2
  20. package/dist/cli/chunks/{agent-handler-E2TZKKBS.js → agent-handler-A57SZUCW.js} +2 -2
  21. package/dist/cli/chunks/{agent-memory-branch-JHAHC2NH.js → agent-memory-branch-BX7LRFGN.js} +2 -2
  22. package/dist/cli/chunks/aqe-learning-engine-FSF5U67K.js +2 -0
  23. package/dist/cli/chunks/{arena-72ZV65BR.js → arena-UTC4YY6Y.js} +4 -4
  24. package/dist/cli/chunks/{arena-KLG3YSSR.js → arena-Y3XTX6O7.js} +2 -2
  25. package/dist/cli/chunks/audit-L4RL2AOY.js +3 -0
  26. package/dist/cli/chunks/base-2CKCJU3O.js +2 -0
  27. package/dist/cli/chunks/{hnswlib-node-LAFK5QZ4.js → better-sqlite3-LRDXKYOJ.js} +2 -2
  28. package/dist/cli/chunks/brain-handler-OHDPI5TQ.js +89 -0
  29. package/dist/cli/chunks/{branch-enumerator-C7MPNYT7.js → branch-enumerator-ZRXE2CQ7.js} +2 -2
  30. package/dist/cli/chunks/{browser-UUDUDYLR.js → browser-NT33FG76.js} +2 -2
  31. package/dist/cli/chunks/browser-workflow-UGYJE64S.js +2 -0
  32. package/dist/cli/chunks/{chunk-7QTB5XIQ.js → chunk-27JCWG5J.js} +2 -2
  33. package/dist/cli/chunks/{chunk-3FJZMQJ7.js → chunk-2ALNNXFF.js} +2 -2
  34. package/dist/cli/chunks/{chunk-LMJUMUQJ.js → chunk-2AOOIAW3.js} +4 -4
  35. package/dist/cli/chunks/{chunk-CNF3ZWLM.js → chunk-2AR4B3DI.js} +2 -2
  36. package/dist/cli/chunks/{chunk-7ADD2ZQL.js → chunk-2KHDGC7N.js} +2 -2
  37. package/dist/cli/chunks/{chunk-P6S6ZVB5.js → chunk-2UMCB7AH.js} +1 -1
  38. package/dist/cli/chunks/{chunk-HH6NCBSP.js → chunk-335GHVJV.js} +22 -22
  39. package/dist/cli/chunks/{chunk-2WPSMQIL.js → chunk-36MPDANH.js} +1 -1
  40. package/dist/cli/chunks/{chunk-Y4AXOHW4.js → chunk-3AFNXU45.js} +1 -1
  41. package/dist/cli/chunks/{chunk-SL3SNOO2.js → chunk-3B4XXFKD.js} +2 -2
  42. package/dist/cli/chunks/{chunk-7IKWF2AD.js → chunk-4GU656WM.js} +1 -1
  43. package/dist/cli/chunks/{chunk-IQBZBUP5.js → chunk-4SALW7OT.js} +2 -2
  44. package/dist/cli/chunks/{chunk-TCVEKRPI.js → chunk-5FR5GBUT.js} +2 -2
  45. package/dist/cli/chunks/chunk-5VBPIJUZ.js +65 -0
  46. package/dist/cli/chunks/chunk-5XFX25AJ.js +4 -0
  47. package/dist/cli/chunks/{chunk-QSDIY3E2.js → chunk-5YGESYBC.js} +1 -1
  48. package/dist/cli/chunks/{chunk-5U2WHPXL.js → chunk-62RELCU6.js} +1 -1
  49. package/dist/cli/chunks/{chunk-QJ5NCYJ3.js → chunk-64M3FFM4.js} +2 -2
  50. package/dist/cli/chunks/{chunk-BMQDELPA.js → chunk-6JNNZGI2.js} +1 -1
  51. package/dist/cli/chunks/{chunk-U34OZXD6.js → chunk-6X3RJBA3.js} +2 -2
  52. package/dist/cli/chunks/{chunk-AE6HXMOG.js → chunk-72VZGAMJ.js} +1 -1
  53. package/dist/cli/chunks/{chunk-4JFH3MVA.js → chunk-7F7U2HUH.js} +1 -1
  54. package/dist/cli/chunks/{chunk-A4OMK3FO.js → chunk-7HJHXSYT.js} +2 -2
  55. package/dist/cli/chunks/chunk-7WX3MKRS.js +2 -0
  56. package/dist/cli/chunks/{chunk-O7PVZ32A.js → chunk-7ZIVDGSN.js} +1 -1
  57. package/dist/cli/chunks/{chunk-EZRHSHOQ.js → chunk-AAATFEIL.js} +2 -2
  58. package/dist/cli/chunks/{chunk-TQ373GGI.js → chunk-AEX75YGI.js} +2 -2
  59. package/dist/cli/chunks/chunk-BA6U7NSR.js +2 -0
  60. package/dist/cli/chunks/chunk-BB4OVXWF.js +14 -0
  61. package/dist/cli/chunks/{chunk-GRQ36XUH.js → chunk-BBC526PL.js} +2 -2
  62. package/dist/cli/chunks/{chunk-EONKMHKO.js → chunk-BGRJZH5Q.js} +2 -2
  63. package/dist/cli/chunks/{chunk-XQ6DW5FV.js → chunk-BUYPRUNY.js} +2 -2
  64. package/dist/cli/chunks/{chunk-TU6YN43Q.js → chunk-BZPF6GTL.js} +1 -1
  65. package/dist/cli/chunks/{chunk-TPMBFARK.js → chunk-C4SZSPXY.js} +67 -22
  66. package/dist/cli/chunks/{chunk-D6CKKNYC.js → chunk-C6GYLCTX.js} +2 -2
  67. package/dist/cli/chunks/{chunk-YNK6SUPU.js → chunk-CC5G3K4X.js} +2 -2
  68. package/dist/cli/chunks/{chunk-ADFKY3X2.js → chunk-CHO54B34.js} +2 -2
  69. package/dist/cli/chunks/{chunk-WQZ2WRO4.js → chunk-CMGYUCM7.js} +1 -1
  70. package/dist/cli/chunks/{chunk-QMC5MTBV.js → chunk-CSEEGX5T.js} +2 -2
  71. package/dist/cli/chunks/{chunk-FSGMRQFC.js → chunk-CVGXB7IX.js} +2 -2
  72. package/dist/cli/chunks/{chunk-5VSQAGA2.js → chunk-DQDFACYW.js} +1 -1
  73. package/dist/cli/chunks/chunk-DR7PCO3S.js +153 -0
  74. package/dist/cli/chunks/{chunk-D5S47YUS.js → chunk-DTOE3NYW.js} +3 -3
  75. package/dist/cli/chunks/{chunk-WZYNY3VF.js → chunk-DXOMRWDC.js} +1 -1
  76. package/dist/cli/chunks/{chunk-HJ24KMC2.js → chunk-EGH3H7QO.js} +1 -1
  77. package/dist/cli/chunks/{chunk-JFLSQH2X.js → chunk-EM2JIIAQ.js} +2 -2
  78. package/dist/cli/chunks/{chunk-MWFJC5HR.js → chunk-ESDGCTC4.js} +1 -1
  79. package/dist/cli/chunks/{chunk-SRVTNG6L.js → chunk-EZE2HRQB.js} +2 -2
  80. package/dist/cli/chunks/{chunk-ZFCVT43J.js → chunk-FEEMJDUF.js} +2 -2
  81. package/dist/cli/chunks/{chunk-HJO4RNOW.js → chunk-FI5SSLEF.js} +2 -2
  82. package/dist/cli/chunks/{chunk-XHRLBJTM.js → chunk-FKPUPQQT.js} +2 -2
  83. package/dist/cli/chunks/{chunk-ODZSQVEW.js → chunk-FOPS6DRZ.js} +1 -1
  84. package/dist/cli/chunks/{chunk-AQIEK4SY.js → chunk-FU5RNEXV.js} +2 -2
  85. package/dist/cli/chunks/{chunk-PQUXFSN6.js → chunk-FZIHOMGY.js} +2 -2
  86. package/dist/cli/chunks/{chunk-Z2REKBD6.js → chunk-FZRU73M4.js} +2 -2
  87. package/dist/cli/chunks/{chunk-NBBLPDJX.js → chunk-G5JQLUUO.js} +2 -2
  88. package/dist/cli/chunks/{chunk-4BFCLSDN.js → chunk-G6LR7FK7.js} +2 -2
  89. package/dist/cli/chunks/{chunk-QEVX4GWF.js → chunk-G6RKUEGL.js} +2 -2
  90. package/dist/cli/chunks/{chunk-HWBMYR5W.js → chunk-GCF42L7M.js} +5 -5
  91. package/dist/cli/chunks/{chunk-TSWF3AGQ.js → chunk-GGMQOEZZ.js} +2 -2
  92. package/dist/cli/chunks/{chunk-PFWJQPUC.js → chunk-HAEUPIKW.js} +2 -2
  93. package/dist/cli/chunks/{chunk-63QUN3JK.js → chunk-HDJMD6UH.js} +1 -1
  94. package/dist/cli/chunks/{chunk-JPENUVCI.js → chunk-HW62TB4T.js} +1 -1
  95. package/dist/cli/chunks/{chunk-WMIRAD3J.js → chunk-I6WHYRWB.js} +2 -2
  96. package/dist/cli/chunks/{chunk-YZ5EQR37.js → chunk-ICK3B24H.js} +2 -2
  97. package/dist/cli/chunks/{chunk-FRFVN6AA.js → chunk-IDLNLSQI.js} +2 -2
  98. package/dist/cli/chunks/{chunk-VQU7DMEY.js → chunk-IJUYHIKN.js} +2 -2
  99. package/dist/cli/chunks/{chunk-6JUOH6L4.js → chunk-IKVNYK7Y.js} +2 -2
  100. package/dist/cli/chunks/{chunk-ZKCKOQJI.js → chunk-JOBCMNTP.js} +2 -2
  101. package/dist/cli/chunks/{chunk-ARPBG6FQ.js → chunk-JYX7AZHE.js} +2 -2
  102. package/dist/cli/chunks/{chunk-SFDUT5WM.js → chunk-JYXSVSH2.js} +2 -2
  103. package/dist/cli/chunks/{chunk-VJGHRWMH.js → chunk-K5SN66B4.js} +2 -2
  104. package/dist/cli/chunks/{chunk-DNOU2HVQ.js → chunk-KDLYTJ5C.js} +2 -2
  105. package/dist/cli/chunks/{chunk-T76RFXQX.js → chunk-KI5BP4X5.js} +2 -2
  106. package/dist/cli/chunks/{chunk-7AWK43JN.js → chunk-KJWQ7ENF.js} +2 -2
  107. package/dist/cli/chunks/{chunk-BRLUNIR4.js → chunk-KN5GOEYK.js} +2 -2
  108. package/dist/cli/chunks/{chunk-VKJQAKYG.js → chunk-KZ37VHMJ.js} +2 -2
  109. package/dist/cli/chunks/{chunk-NV3TXXOW.js → chunk-KZMRU7DL.js} +2 -2
  110. package/dist/cli/chunks/{chunk-LLUPRGOR.js → chunk-L5ZLOW3K.js} +2 -2
  111. package/dist/cli/chunks/{chunk-THKZVOZV.js → chunk-LMJUQWR7.js} +1 -1
  112. package/dist/cli/chunks/{chunk-2KNFS3L5.js → chunk-MBF3Q7FQ.js} +1 -1
  113. package/dist/cli/chunks/chunk-MDT3LIXS.js +2 -0
  114. package/dist/cli/chunks/{chunk-B5XUWHKQ.js → chunk-MJPYNGZ7.js} +1 -1
  115. package/dist/cli/chunks/{chunk-UCYTY4LG.js → chunk-MK3J7JVZ.js} +2 -2
  116. package/dist/cli/chunks/{chunk-MCT4CD5M.js → chunk-MUAHFGIX.js} +2 -2
  117. package/dist/cli/chunks/{chunk-3SBUL72V.js → chunk-MUV56BPK.js} +2 -2
  118. package/dist/cli/chunks/{chunk-WNMDWP5A.js → chunk-NLHISTL2.js} +2 -2
  119. package/dist/cli/chunks/{chunk-UJMTKXPI.js → chunk-NNGCUJWQ.js} +2 -2
  120. package/dist/cli/chunks/chunk-NW7G57NR.js +27 -0
  121. package/dist/cli/chunks/{chunk-3SRPFBU7.js → chunk-O3C5RRDQ.js} +3 -3
  122. package/dist/cli/chunks/{chunk-AYGEWPN4.js → chunk-OHSVDMF7.js} +1 -1
  123. package/dist/cli/chunks/{chunk-AJXGGTX7.js → chunk-OPIWFXME.js} +1 -1
  124. package/dist/cli/chunks/{chunk-ZSBJNE35.js → chunk-P52YORQG.js} +2 -2
  125. package/dist/cli/chunks/chunk-PM566XEO.js +2 -0
  126. package/dist/cli/chunks/chunk-POKMJTD2.js +2 -0
  127. package/dist/cli/chunks/{chunk-GOQ4P2PB.js → chunk-PQMLIVGV.js} +2 -2
  128. package/dist/cli/chunks/{chunk-IB3ZPLFA.js → chunk-PT3FTGKZ.js} +2 -2
  129. package/dist/cli/chunks/{chunk-U3AVZGQA.js → chunk-Q5YRPS4P.js} +1 -1
  130. package/dist/cli/chunks/{chunk-5Z4FBCBK.js → chunk-QJ6H2HQQ.js} +1 -1
  131. package/dist/cli/chunks/{chunk-DRMHVY4T.js → chunk-RG552ROA.js} +4 -4
  132. package/dist/cli/chunks/{chunk-PEIQDQXN.js → chunk-RHC7TFPU.js} +2 -2
  133. package/dist/cli/chunks/{chunk-JNQN5DNS.js → chunk-RMFRFING.js} +1 -1
  134. package/dist/cli/chunks/{chunk-4YT5YN5G.js → chunk-RQN4HWGV.js} +2 -2
  135. package/dist/cli/chunks/{chunk-5P7Q5YNC.js → chunk-RYUSZ43T.js} +1 -1
  136. package/dist/cli/chunks/{chunk-O5NEJIHB.js → chunk-RZDNCTOA.js} +2 -2
  137. package/dist/cli/chunks/chunk-SCMXIBI7.js +2 -0
  138. package/dist/cli/chunks/{chunk-6545AS2J.js → chunk-SPEUF7ZL.js} +2 -2
  139. package/dist/cli/chunks/{chunk-LW5DHT3Z.js → chunk-SSXAW3ER.js} +2 -2
  140. package/dist/cli/chunks/{chunk-Q7ORVHJB.js → chunk-TC2JE5OK.js} +3 -3
  141. package/dist/cli/chunks/{chunk-MALOUGSF.js → chunk-TED4KOSK.js} +2 -2
  142. package/dist/cli/chunks/{chunk-ICCTQ5LO.js → chunk-TJ6N4CCX.js} +2 -2
  143. package/dist/cli/chunks/{chunk-6GYGAW53.js → chunk-TJEJ4UVX.js} +2 -2
  144. package/dist/cli/chunks/{chunk-VO6YJGB4.js → chunk-TO5PQSDD.js} +2 -2
  145. package/dist/cli/chunks/{chunk-LKURMUBU.js → chunk-TR5GOGH3.js} +37 -12
  146. package/dist/cli/chunks/{chunk-JCTCM6IR.js → chunk-UGJQJSPB.js} +1 -1
  147. package/dist/cli/chunks/{chunk-4RHNPRAP.js → chunk-USB44IHJ.js} +2 -2
  148. package/dist/cli/chunks/{chunk-JDFPAJGB.js → chunk-UUOXV3NS.js} +92 -92
  149. package/dist/cli/chunks/chunk-UVVKFBF7.js +2 -0
  150. package/dist/cli/chunks/{chunk-VCUCD3B5.js → chunk-V2MD5EDD.js} +2 -2
  151. package/dist/cli/chunks/{chunk-RFQBDMAP.js → chunk-VA7TEOPM.js} +1 -1
  152. package/dist/cli/chunks/{chunk-IF3HPQNV.js → chunk-VMP4M5PB.js} +1 -1
  153. package/dist/cli/chunks/{chunk-KUZMVH6N.js → chunk-VS4GMNJK.js} +3 -3
  154. package/dist/cli/chunks/{chunk-ZYZT2CDX.js → chunk-VWJSWXHG.js} +1 -1
  155. package/dist/cli/chunks/{chunk-54B6P2WS.js → chunk-VZ67ZDB3.js} +3 -3
  156. package/dist/cli/chunks/{chunk-NSPCZPTB.js → chunk-W2OMW6UU.js} +2 -2
  157. package/dist/cli/chunks/{chunk-3SKIZDKL.js → chunk-W766S4SK.js} +1 -1
  158. package/dist/cli/chunks/{chunk-N2BJN6AO.js → chunk-WJYTLRA5.js} +3 -3
  159. package/dist/cli/chunks/{chunk-X64BEXUY.js → chunk-WNASEUBW.js} +117 -113
  160. package/dist/cli/chunks/{chunk-HT6WAYIR.js → chunk-WT4ZDDFM.js} +1 -1
  161. package/dist/cli/chunks/chunk-XEYW3V5I.js +2 -0
  162. package/dist/cli/chunks/{chunk-6W3QHS45.js → chunk-XIFPIVZI.js} +2 -2
  163. package/dist/cli/chunks/{chunk-3E7D3A35.js → chunk-Y2MCIIJD.js} +1 -1
  164. package/dist/cli/chunks/{chunk-YUHM72VQ.js → chunk-YKOTOCO6.js} +2 -2
  165. package/dist/cli/chunks/{chunk-YKSWC7I4.js → chunk-Z3W3R4CW.js} +8 -20
  166. package/dist/cli/chunks/chunk-ZT2WHCVM.js +2 -0
  167. package/dist/cli/chunks/{chunk-G3TFNY4T.js → chunk-ZVPAFX4I.js} +2 -2
  168. package/dist/cli/chunks/{chunk-NFJT7XXR.js → chunk-ZWC6CM4R.js} +1 -1
  169. package/dist/cli/chunks/{ci-HQCRSCC7.js → ci-RJH5LAL3.js} +2 -2
  170. package/dist/cli/chunks/{ci-output-YBVXLA6O.js → ci-output-62SGMGB2.js} +2 -2
  171. package/dist/cli/chunks/{circuit-breaker-ULGMF2QN.js → circuit-breaker-QXTS5ZAW.js} +2 -2
  172. package/dist/cli/chunks/{claude-flow-setup-MKZ2LJXK.js → claude-flow-setup-BBCCT5WV.js} +2 -2
  173. package/dist/cli/chunks/client-E2XUBCLK.js +2 -0
  174. package/dist/cli/chunks/{cline-installer-WZQ6XBWN.js → cline-installer-IZCUJJ3I.js} +2 -2
  175. package/dist/cli/chunks/{code-H3KGH45S.js → code-AWNVOZ7S.js} +2 -2
  176. package/dist/cli/chunks/{code-index-extractor-NUVEAJ7C.js → code-index-extractor-MX65BKMI.js} +2 -2
  177. package/dist/cli/chunks/{codex-installer-JQI6E6CV.js → codex-installer-EQT6JVLM.js} +2 -2
  178. package/dist/cli/chunks/{completions-NDF4PFE7.js → completions-WOJAM45W.js} +2 -2
  179. package/dist/cli/chunks/{complexity-analyzer-XCZH66HG.js → complexity-analyzer-3DJB7V3K.js} +2 -2
  180. package/dist/cli/chunks/{continuedev-installer-Z4AJGZ7S.js → continuedev-installer-P4KWUTCJ.js} +2 -2
  181. package/dist/cli/chunks/{copilot-installer-K4IPAL7C.js → copilot-installer-FFZWTMWQ.js} +2 -2
  182. package/dist/cli/chunks/core-handlers-46Z5VOO6.js +2 -0
  183. package/dist/cli/chunks/{cost-tracker-35KXAB23.js → cost-tracker-CYBOV3NI.js} +2 -2
  184. package/dist/cli/chunks/{coverage-QW5I4TYZ.js → coverage-GTZJBSC4.js} +3 -3
  185. package/dist/cli/chunks/cross-domain-router-SXQ3HFRY.js +2 -0
  186. package/dist/cli/chunks/{cursor-installer-P4Z7RMIZ.js → cursor-installer-WZIVXGGB.js} +2 -2
  187. package/dist/cli/chunks/daemon-JWMHEJEN.js +10 -0
  188. package/dist/cli/chunks/{daemon-WQWTCYBM.js → daemon-MSFN2LXY.js} +3 -3
  189. package/dist/cli/chunks/{dag-attention-scheduler-7XD2VGON.js → dag-attention-scheduler-4TWOTTQE.js} +2 -2
  190. package/dist/cli/chunks/{detect-GZ3P4DI7.js → detect-YZ6AGQPB.js} +2 -2
  191. package/dist/cli/chunks/{dist-node-6WWAW7OP.js → dist-node-3EM2XH54.js} +2 -2
  192. package/dist/cli/chunks/{domain-handler-3GTLWARQ.js → domain-handler-4XU5BINU.js} +2 -2
  193. package/dist/cli/chunks/domain-transfer-HUFC7I52.js +2 -0
  194. package/dist/cli/chunks/dream-R6MQQQ3N.js +2 -0
  195. package/dist/cli/chunks/{embed-and-insert-pattern-BGIMA77V.js → embed-and-insert-pattern-J5ZFM6YX.js} +2 -2
  196. package/dist/cli/chunks/{eval-SXV6DRDD.js → eval-XYOA3EH2.js} +2 -2
  197. package/dist/cli/chunks/{experience-capture-middleware-TT6WCT2S.js → experience-capture-middleware-E3RYQB6Z.js} +3 -3
  198. package/dist/cli/chunks/{fast-paths-HTAZHEQP.js → fast-paths-DKIYN2YS.js} +2 -2
  199. package/dist/cli/chunks/{feature-flags-DIE3Z2B4.js → feature-flags-S2RNZATS.js} +2 -2
  200. package/dist/cli/chunks/{feature-flags-WBUKU54W.js → feature-flags-ZB63Z7N5.js} +2 -2
  201. package/dist/cli/chunks/{file-discovery-SKDETFS3.js → file-discovery-USJJLYQU.js} +2 -2
  202. package/dist/cli/chunks/{fleet-WCWEPAVU.js → fleet-4MUPHSF5.js} +4 -4
  203. package/dist/cli/chunks/{gnn-wrapper-KWZOWBYS.js → gnn-wrapper-PYOQZKX6.js} +2 -2
  204. package/dist/cli/chunks/{heartbeat-handler-3AGYHVG2.js → heartbeat-handler-HLO5XCG7.js} +4 -4
  205. package/dist/cli/chunks/heartbeat-scheduler-OSDPJT6A.js +2 -0
  206. package/dist/cli/chunks/hnsw-adapter-KMGSHBIN.js +2 -0
  207. package/dist/cli/chunks/hnsw-index-IMFRAOPE.js +2 -0
  208. package/dist/cli/chunks/{hnsw-legacy-bridge-6OJJDZHL.js → hnsw-legacy-bridge-FZEH2KLM.js} +2 -2
  209. package/dist/cli/chunks/{better-sqlite3-URULPKRF.js → hnswlib-node-VS6L5VUG.js} +2 -2
  210. package/dist/cli/chunks/{hooks-OXEBTLXV.js → hooks-R2757K57.js} +48 -52
  211. package/dist/cli/chunks/hybrid-router-57QSWSWC.js +2 -0
  212. package/dist/cli/chunks/{hypergraph-engine-NL74PRHD.js → hypergraph-engine-EAV3GJ5D.js} +2 -2
  213. package/dist/cli/chunks/{hypergraph-handler-KZ54AEEL.js → hypergraph-handler-5ERXAVGH.js} +3 -3
  214. package/dist/cli/chunks/impact-analyzer-OC4MPBGA.js +2 -0
  215. package/dist/cli/chunks/{init-handler-XKZXRXPG.js → init-handler-RXUSEMG7.js} +6 -6
  216. package/dist/cli/chunks/init-wizard-CDBRL4PO.js +2 -0
  217. package/dist/cli/chunks/kernel-CQ7R3AAV.js +2 -0
  218. package/dist/cli/chunks/{kilocode-installer-WISQMJK7.js → kilocode-installer-ZUBVBHGT.js} +2 -2
  219. package/dist/cli/chunks/{kiro-installer-O7TBB3GM.js → kiro-installer-TRTRQDGL.js} +2 -2
  220. package/dist/cli/chunks/knowledge-graph-UXNH7RY4.js +2 -0
  221. package/dist/cli/chunks/{learning-6IZBGVRU.js → learning-UYXWAU5D.js} +3 -3
  222. package/dist/cli/chunks/{llm-router-QDMQPPQ7.js → llm-router-TB5OJPEV.js} +4 -4
  223. package/dist/cli/chunks/llm-router-service-UV34YXBE.js +2 -0
  224. package/dist/cli/chunks/{load-KLAJJGL5.js → load-ELPSUIPV.js} +2 -2
  225. package/dist/cli/chunks/load-test-2VEN3PQZ.js +2 -0
  226. package/dist/cli/chunks/{mcp-SZOPQZIZ.js → mcp-UX7TK3XV.js} +2 -2
  227. package/dist/cli/chunks/{memory-G3WY74C6.js → memory-W3LG6H6N.js} +5 -5
  228. package/dist/cli/chunks/memory-backend-TZL5U6F3.js +2 -0
  229. package/dist/cli/chunks/memory-handlers-BNXAYS2P.js +2 -0
  230. package/dist/cli/chunks/{multi-model-executor-TDNQGTOT.js → multi-model-executor-227LWZRY.js} +2 -2
  231. package/dist/cli/chunks/{opencode-installer-NGYGEDMV.js → opencode-installer-F4WKVWDL.js} +2 -2
  232. package/dist/cli/chunks/{orchestrator-KPI5DY2C.js → orchestrator-V4DBMGK6.js} +5 -5
  233. package/dist/cli/chunks/pattern-null-store-KLX2RNHM.js +2 -0
  234. package/dist/cli/chunks/pattern-usage-recorder-BY3HEWSU.js +2 -0
  235. package/dist/cli/chunks/{pipeline-CSDCC675.js → pipeline-3F5RIESX.js} +2 -2
  236. package/dist/cli/chunks/{platform-Q5XKEVKH.js → platform-KCGXTZO3.js} +2 -2
  237. package/dist/cli/chunks/{plugin-XKKR3GVL.js → plugin-2H552KOV.js} +2 -2
  238. package/dist/cli/chunks/{prime-radiant-advanced-wasm-22QVNKEN.js → prime-radiant-advanced-wasm-EFKVL7VN.js} +2 -2
  239. package/dist/cli/chunks/protocol-executor-5HJKW6MC.js +2 -0
  240. package/dist/cli/chunks/{protocol-handler-REQKTJGG.js → protocol-handler-ELGYV7D2.js} +2 -2
  241. package/dist/cli/chunks/{prove-NOFUFSQN.js → prove-AYJCQYNI.js} +2 -2
  242. package/dist/cli/chunks/provider-manager-TRZSBXD3.js +2 -0
  243. package/dist/cli/chunks/qe-reasoning-bank-RCEYSLVV.js +2 -0
  244. package/dist/cli/chunks/{quality-3DQ2H5TK.js → quality-HH7L5A7V.js} +2 -2
  245. package/dist/cli/chunks/quality-gate-NAQLXE4C.js +7 -0
  246. package/dist/cli/chunks/queen-coordinator-6JFZD54W.js +2 -0
  247. package/dist/cli/chunks/{real-embeddings-FCGNYWLL.js → real-embeddings-IO3F4ZFR.js} +2 -2
  248. package/dist/cli/chunks/{roocode-installer-HX3CNRIR.js → roocode-installer-X4TU5HO4.js} +2 -2
  249. package/dist/cli/chunks/router-KRLC46NS.js +2 -0
  250. package/dist/cli/chunks/routing-feedback-WW26H6SA.js +2 -0
  251. package/dist/cli/chunks/{routing-handler-YRZ2LDCR.js → routing-handler-ZJKGDDMT.js} +2 -2
  252. package/dist/cli/chunks/{ruvector-commands-GCQVBJ4E.js → ruvector-commands-NXCSUBN2.js} +2 -2
  253. package/dist/cli/chunks/{rvf-dual-writer-B562P3ZC.js → rvf-dual-writer-JMA74SKP.js} +2 -2
  254. package/dist/cli/chunks/{rvf-migration-adapter-NAGFKCMD.js → rvf-migration-adapter-BNTGH2KU.js} +2 -2
  255. package/dist/cli/chunks/{rvf-migration-coordinator-WWFBEJ5Q.js → rvf-migration-coordinator-7T2HHUOH.js} +2 -2
  256. package/dist/cli/chunks/rvf-native-adapter-OVQKPQUH.js +2 -0
  257. package/dist/cli/chunks/safe-db-UQOCQIH2.js +2 -0
  258. package/dist/cli/chunks/schedule-EUX7ZQUK.js +2 -0
  259. package/dist/cli/chunks/scheduler-MALHQKNR.js +2 -0
  260. package/dist/cli/chunks/{security-IFOYTD75.js → security-XSK2QHB3.js} +3 -3
  261. package/dist/cli/chunks/{shared-rvf-adapter-TYD5TQ35.js → shared-rvf-adapter-WLRKI7RY.js} +2 -2
  262. package/dist/cli/chunks/{shared-rvf-dual-writer-YGOOVDQZ.js → shared-rvf-dual-writer-SZW3J7ZK.js} +2 -2
  263. package/dist/cli/chunks/sqlite-persistence-OBCLRP4L.js +2 -0
  264. package/dist/cli/chunks/status-handler-HGCKYJX2.js +46 -0
  265. package/dist/cli/chunks/{structural-health-KZI6YMKV.js → structural-health-4SJCFX63.js} +2 -2
  266. package/dist/cli/chunks/{sync-Z5BDDBMK.js → sync-7WAVNZGL.js} +2 -2
  267. package/dist/cli/chunks/{sync-ABZNNYRC.js → sync-ATR4DUSA.js} +2 -2
  268. package/dist/cli/chunks/{task-handler-5ACZEPJ7.js → task-handler-O6REL34Y.js} +2 -2
  269. package/dist/cli/chunks/{task-handlers-UZWDPL6A.js → task-handlers-WFV2ZYWW.js} +3 -3
  270. package/dist/cli/chunks/{test-APO3MCVV.js → test-4LXUVHEU.js} +4 -4
  271. package/dist/cli/chunks/{test-scheduling-EFZA5G5C.js → test-scheduling-OTN3DMKY.js} +3 -3
  272. package/dist/cli/chunks/{token-bootstrap-J2OPLNUK.js → token-bootstrap-VA7T4P42.js} +2 -2
  273. package/dist/cli/chunks/{token-usage-VHWVNN4R.js → token-usage-TLT6OXXR.js} +2 -2
  274. package/dist/cli/chunks/{transformers-PX4HPO75.js → transformers-JI7LZRQ3.js} +2 -2
  275. package/dist/cli/chunks/{tree-sitter-wasm-parser-44HA2Z3F.js → tree-sitter-wasm-parser-QNIMHB4K.js} +2 -2
  276. package/dist/cli/chunks/{types-IMOP7F4R.js → types-DJNWOAC6.js} +2 -2
  277. package/dist/cli/chunks/unified-memory-A5BS3LGX.js +2 -0
  278. package/dist/cli/chunks/unified-memory-hnsw-WJLJO5MY.js +2 -0
  279. package/dist/cli/chunks/unified-persistence-CFC2BKI5.js +2 -0
  280. package/dist/cli/chunks/{upgrade-OZ3O6ZZI.js → upgrade-VEW4FL23.js} +2 -2
  281. package/dist/cli/chunks/{validate-DRY5BMWX.js → validate-O3P6PF7B.js} +2 -2
  282. package/dist/cli/chunks/{validate-swarm-QD3LYPUF.js → validate-swarm-M2HXHZVC.js} +2 -2
  283. package/dist/cli/chunks/{vibium-2J3H2ITD.js → vibium-GOU55LUO.js} +2 -2
  284. package/dist/cli/chunks/visual-security-VPB6KVYJ.js +2 -0
  285. package/dist/cli/chunks/{web-tree-sitter-KRNUOGKI.js → web-tree-sitter-MXOI4GH3.js} +2 -2
  286. package/dist/cli/chunks/{windsurf-installer-PQIPH3WP.js → windsurf-installer-6GKT53IH.js} +2 -2
  287. package/dist/cli/chunks/{witness-chain-HPLOYPS7.js → witness-chain-OXGQGL26.js} +2 -2
  288. package/dist/cli/chunks/witness-chain-ZZAUAXDY.js +2 -0
  289. package/dist/cli/chunks/witness-key-manager-PGFSQXUJ.js +2 -0
  290. package/dist/cli/chunks/{workflow-OAQ3FWCY.js → workflow-ENBWRMBA.js} +4 -4
  291. package/dist/cli/chunks/workflow-orchestrator-S4LBFTYD.js +2 -0
  292. package/dist/cli/chunks/{wrappers-UPIU6S5S.js → wrappers-MHLNYANQ.js} +2 -2
  293. package/dist/cli/commands/audit.d.ts +12 -0
  294. package/dist/cli/commands/audit.js +64 -4
  295. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +45 -19
  296. package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +13 -0
  297. package/dist/cli/commands/hooks-handlers/hooks-shared.js +38 -0
  298. package/dist/cli/commands/hooks-handlers/task-hooks.js +19 -1
  299. package/dist/cli/commands/quality-gate.d.ts +24 -0
  300. package/dist/cli/commands/quality-gate.js +135 -0
  301. package/dist/cli/handlers/status-handler.d.ts +18 -0
  302. package/dist/cli/handlers/status-handler.js +47 -0
  303. package/dist/cli/index.js +5 -0
  304. package/dist/coordination/mincut/dream-integration.d.ts +11 -0
  305. package/dist/coordination/mincut/dream-integration.js +39 -12
  306. package/dist/coordination/mincut/queen-integration.js +24 -7
  307. package/dist/coordination/protocol-executor.js +2 -1
  308. package/dist/coordination/queen-lifecycle.js +4 -1
  309. package/dist/domains/code-intelligence/coordinator.js +10 -6
  310. package/dist/domains/code-intelligence/services/product-factors-bridge.js +3 -1
  311. package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +6 -0
  312. package/dist/domains/defect-intelligence/services/defect-predictor.js +21 -0
  313. package/dist/domains/learning-optimization/interfaces.d.ts +7 -0
  314. package/dist/domains/learning-optimization/plugin.js +5 -0
  315. package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +10 -0
  316. package/dist/domains/learning-optimization/services/learning-coordinator.js +57 -0
  317. package/dist/domains/test-execution/plugin.js +2 -2
  318. package/dist/domains/test-execution/services/flaky-detector.js +1 -1
  319. package/dist/domains/test-generation/coordinator.js +22 -8
  320. package/dist/domains/test-generation/interfaces.d.ts +3 -0
  321. package/dist/domains/test-generation/services/test-generator.js +9 -1
  322. package/dist/integrations/ruvector/delta-tracker.js +10 -1
  323. package/dist/integrations/ruvector/feature-flags.js +7 -0
  324. package/dist/integrations/ruvector/sona-persistence.d.ts +24 -0
  325. package/dist/integrations/ruvector/sona-persistence.js +76 -0
  326. package/dist/integrations/ruvector/sona-three-loop.d.ts +15 -0
  327. package/dist/integrations/ruvector/sona-three-loop.js +17 -0
  328. package/dist/kernel/unified-memory-schemas.d.ts +2 -2
  329. package/dist/kernel/unified-memory-schemas.js +48 -2
  330. package/dist/kernel/unified-memory.d.ts +22 -0
  331. package/dist/kernel/unified-memory.js +43 -0
  332. package/dist/learning/aqe-learning-engine.js +3 -1
  333. package/dist/learning/dream/concept-graph.d.ts +31 -1
  334. package/dist/learning/dream/concept-graph.js +109 -3
  335. package/dist/learning/dream/dream-engine.d.ts +13 -1
  336. package/dist/learning/dream/dream-engine.js +146 -10
  337. package/dist/learning/dream/index.d.ts +1 -1
  338. package/dist/learning/dream/types.d.ts +23 -0
  339. package/dist/learning/pattern-lifecycle.d.ts +16 -0
  340. package/dist/learning/pattern-lifecycle.js +77 -1
  341. package/dist/learning/pattern-store.d.ts +2 -2
  342. package/dist/learning/pattern-store.js +14 -3
  343. package/dist/learning/provenance-tier.d.ts +52 -0
  344. package/dist/learning/provenance-tier.js +64 -0
  345. package/dist/learning/qe-flywheel/corpus-scorer.d.ts +55 -0
  346. package/dist/learning/qe-flywheel/corpus-scorer.js +293 -0
  347. package/dist/learning/qe-flywheel/coupled-anchor.d.ts +91 -0
  348. package/dist/learning/qe-flywheel/coupled-anchor.js +181 -0
  349. package/dist/learning/qe-flywheel/generation.d.ts +121 -0
  350. package/dist/learning/qe-flywheel/generation.js +167 -0
  351. package/dist/learning/qe-flywheel/policy.d.ts +37 -0
  352. package/dist/learning/qe-flywheel/policy.js +66 -0
  353. package/dist/learning/qe-flywheel/receipt-store.d.ts +31 -0
  354. package/dist/learning/qe-flywheel/receipt-store.js +89 -0
  355. package/dist/learning/qe-flywheel/receipt.d.ts +62 -0
  356. package/dist/learning/qe-flywheel/receipt.js +97 -0
  357. package/dist/learning/qe-reasoning-bank.js +34 -31
  358. package/dist/learning/routing-topology-gate.d.ts +12 -2
  359. package/dist/learning/routing-topology-gate.js +15 -3
  360. package/dist/learning/rvf-pattern-store.d.ts +1 -1
  361. package/dist/learning/rvf-pattern-store.js +21 -8
  362. package/dist/learning/sqlite-persistence.js +12 -9
  363. package/dist/mcp/bundle.js +540 -460
  364. package/dist/mcp/qe-tool-bridge.js +7 -2
  365. package/dist/mcp/tools/base.d.ts +29 -0
  366. package/dist/mcp/tools/base.js +25 -0
  367. package/dist/mcp/tools/coverage-analysis/index.js +6 -4
  368. package/dist/mcp/tools/learning-optimization/dream.d.ts +4 -13
  369. package/dist/mcp/tools/learning-optimization/dream.js +10 -96
  370. package/dist/mcp/tools/planning/goap-execute.d.ts +13 -1
  371. package/dist/mcp/tools/planning/goap-execute.js +33 -18
  372. package/dist/mcp/tools/quality-assessment/gate.d.ts +38 -0
  373. package/dist/mcp/tools/quality-assessment/gate.js +86 -0
  374. package/dist/mcp/tools/registry.d.ts +1 -0
  375. package/dist/mcp/tools/registry.js +10 -2
  376. package/dist/persistence/rvf-migration-coordinator.js +2 -1
  377. package/dist/planning/actions/qe-action-library.js +124 -1
  378. package/dist/planning/goap-planner.d.ts +14 -2
  379. package/dist/planning/goap-planner.js +51 -9
  380. package/dist/planning/index.d.ts +1 -1
  381. package/dist/planning/plan-executor.d.ts +84 -4
  382. package/dist/planning/plan-executor.js +221 -56
  383. package/dist/planning/types.d.ts +27 -0
  384. package/dist/shared/events/domain-events.d.ts +2 -0
  385. package/dist/shared/safe-db.js +23 -4
  386. package/dist/validation/anchor-set.d.ts +74 -0
  387. package/dist/validation/anchor-set.js +78 -0
  388. package/dist/validation/frontier-judge.d.ts +99 -0
  389. package/dist/validation/frontier-judge.js +234 -0
  390. package/dist/validation/gate-reexecute.d.ts +165 -0
  391. package/dist/validation/gate-reexecute.js +255 -0
  392. package/dist/validation/quality-gate-runner.d.ts +49 -0
  393. package/dist/validation/quality-gate-runner.js +62 -0
  394. package/dist/validation/quality-verdict.d.ts +94 -0
  395. package/dist/validation/quality-verdict.js +120 -0
  396. package/dist/workers/workers/learning-consolidation.js +21 -1
  397. package/package.json +1 -1
  398. package/dist/cli/chunks/adapter-2HMUXHWY.js +0 -2
  399. package/dist/cli/chunks/aqe-learning-engine-M2NKRVRE.js +0 -2
  400. package/dist/cli/chunks/audit-EPB7ETMT.js +0 -3
  401. package/dist/cli/chunks/base-CCHC2DAC.js +0 -2
  402. package/dist/cli/chunks/brain-handler-FBMYEERK.js +0 -89
  403. package/dist/cli/chunks/browser-workflow-4DGHFYY3.js +0 -2
  404. package/dist/cli/chunks/chunk-37ZDGJ3H.js +0 -2
  405. package/dist/cli/chunks/chunk-5AQ7FXYG.js +0 -27
  406. package/dist/cli/chunks/chunk-KYTFIP6R.js +0 -2
  407. package/dist/cli/chunks/chunk-MYMIEQSZ.js +0 -65
  408. package/dist/cli/chunks/chunk-RCPD6F4R.js +0 -2
  409. package/dist/cli/chunks/chunk-TCWR6TDN.js +0 -2
  410. package/dist/cli/chunks/chunk-UQ72K44T.js +0 -149
  411. package/dist/cli/chunks/chunk-XXRTWG7O.js +0 -2
  412. package/dist/cli/chunks/chunk-ZSA6V5FH.js +0 -2
  413. package/dist/cli/chunks/client-2OVEDWGU.js +0 -2
  414. package/dist/cli/chunks/core-handlers-UXRRYP52.js +0 -2
  415. package/dist/cli/chunks/cross-domain-router-PV3VQVLO.js +0 -2
  416. package/dist/cli/chunks/daemon-ESUEM6VB.js +0 -10
  417. package/dist/cli/chunks/domain-transfer-TQYO3SVG.js +0 -2
  418. package/dist/cli/chunks/dream-UFUXVJQC.js +0 -2
  419. package/dist/cli/chunks/heartbeat-scheduler-MBG3SARO.js +0 -2
  420. package/dist/cli/chunks/hnsw-adapter-5HXA3QB3.js +0 -2
  421. package/dist/cli/chunks/hnsw-index-PZRQWBRG.js +0 -2
  422. package/dist/cli/chunks/hybrid-router-NQRIE2GG.js +0 -2
  423. package/dist/cli/chunks/impact-analyzer-46347ZDV.js +0 -2
  424. package/dist/cli/chunks/init-wizard-CJYP4WKO.js +0 -2
  425. package/dist/cli/chunks/kernel-22KQZ56U.js +0 -2
  426. package/dist/cli/chunks/knowledge-graph-KM3JDBGR.js +0 -2
  427. package/dist/cli/chunks/llm-router-service-IFO6GRRO.js +0 -2
  428. package/dist/cli/chunks/load-test-TTKCYAPB.js +0 -2
  429. package/dist/cli/chunks/memory-backend-ELHCX2ZT.js +0 -2
  430. package/dist/cli/chunks/memory-handlers-3SKYQZTL.js +0 -2
  431. package/dist/cli/chunks/pattern-null-store-TMXAYD43.js +0 -2
  432. package/dist/cli/chunks/protocol-executor-BPLR5EJC.js +0 -2
  433. package/dist/cli/chunks/provider-manager-4MMD5QKL.js +0 -2
  434. package/dist/cli/chunks/qe-reasoning-bank-P7KNT3WZ.js +0 -2
  435. package/dist/cli/chunks/queen-coordinator-NBZZ4MGC.js +0 -2
  436. package/dist/cli/chunks/router-2RXR6J2Q.js +0 -2
  437. package/dist/cli/chunks/routing-feedback-AVAA76TK.js +0 -2
  438. package/dist/cli/chunks/rvf-native-adapter-X2YDJA55.js +0 -2
  439. package/dist/cli/chunks/safe-db-4PRU65BK.js +0 -2
  440. package/dist/cli/chunks/schedule-2AST5CHW.js +0 -2
  441. package/dist/cli/chunks/scheduler-SW6II7OU.js +0 -2
  442. package/dist/cli/chunks/sqlite-persistence-OB5NEGAK.js +0 -2
  443. package/dist/cli/chunks/status-handler-HFPWSCBY.js +0 -45
  444. package/dist/cli/chunks/unified-memory-X7OJYGSD.js +0 -2
  445. package/dist/cli/chunks/unified-memory-hnsw-O6HOD5YL.js +0 -2
  446. package/dist/cli/chunks/unified-persistence-C332CER2.js +0 -2
  447. package/dist/cli/chunks/visual-security-MPUG5HPI.js +0 -2
  448. package/dist/cli/chunks/witness-chain-Q4BZHPDF.js +0 -2
  449. package/dist/cli/chunks/workflow-orchestrator-4NDWECYK.js +0 -2
@@ -0,0 +1,135 @@
1
+ /**
2
+ * Agentic QE v3 - Quality Gate Command (ADR-119)
3
+ *
4
+ * `aqe quality-gate` runs the two-gate, three-valued quality verdict against a
5
+ * pinned ADR-117 checklist: the mechanical (oracle) gate plus a FRONTIER judge.
6
+ * It calls the SAME `runQualityGate` orchestrator as the `qe/quality/gate` MCP
7
+ * tool, so CLI and MCP stay in exact parity.
8
+ *
9
+ * The oracle (mechanical) result is supplied by the caller (`--oracle-passed` /
10
+ * `--baseline-passed`, or `--oracle-file`) because the ADR-113 mutation oracle
11
+ * runs upstream. A missing oracle result is treated as a non-executed test ⇒
12
+ * mechanical fail (never a silent pass).
13
+ */
14
+ import { Command } from 'commander';
15
+ import chalk from 'chalk';
16
+ import fs from 'node:fs';
17
+ import { writeOutput, toJSON } from '../utils/ci-output.js';
18
+ import { runQualityGate, listChecklistIds, } from '../../validation/quality-gate-runner.js';
19
+ import { createRouterFrontierJudge, createUnavailableJudge, } from '../../validation/frontier-judge.js';
20
+ export function createQualityGateCommand(_context, cleanupAndExit, _ensureInitialized) {
21
+ return new Command('quality-gate')
22
+ .description('Two-gate, three-valued quality verdict against a pinned ADR-117 checklist (ADR-119)')
23
+ .option('-c, --checklist <id>', 'Pinned anchor checklist id (e.g. A1-inRange)')
24
+ .option('-a, --artifact-file <path>', 'File containing the artifact under judgement')
25
+ .option('--artifact <text>', 'Inline artifact text (alternative to --artifact-file)')
26
+ .option('--oracle-passed', 'Mechanical oracle passed (mutation score met threshold)')
27
+ .option('--baseline-passed', 'Tests executed against the reference implementation')
28
+ .option('--oracle-file <path>', 'JSON file with { passed, baselinePassed } from the ADR-113 oracle')
29
+ .option('--anchor <path>', 'Override the frozen anchor path (ADR-117)')
30
+ .option('--model <id>', 'Frontier judge model id (ADR-111: always frontier-tier)')
31
+ .option('--list', 'List the available pinned checklist ids and exit')
32
+ .option('-F, --format <format>', 'Output format (text|json)', 'text')
33
+ .option('-o, --output <path>', 'Write output to file')
34
+ .action(async (options) => {
35
+ // No kernel/memory needed: this reads the frozen ADR-117 anchor and calls
36
+ // the LLM router — so it runs standalone in CI without a fleet init.
37
+ const format = options.format;
38
+ try {
39
+ if (options.list) {
40
+ const ids = listChecklistIds(options.anchor);
41
+ if (format === 'json')
42
+ writeOutput(toJSON({ checklists: ids }), options.output);
43
+ else
44
+ console.log(`Available checklists:\n ${ids.join('\n ')}`);
45
+ await cleanupAndExit(0);
46
+ return;
47
+ }
48
+ if (!options.checklist) {
49
+ console.error(chalk.red('Missing required option -c, --checklist <id> (use --list to see ids)'));
50
+ await cleanupAndExit(1);
51
+ return;
52
+ }
53
+ const artifact = resolveArtifact(options);
54
+ if (artifact == null) {
55
+ console.error(chalk.red('Provide --artifact-file <path> or --artifact <text>'));
56
+ await cleanupAndExit(1);
57
+ return;
58
+ }
59
+ const oracleResult = resolveOracle(options);
60
+ const judge = await buildJudge(options.model);
61
+ const request = {
62
+ oracleResult,
63
+ artifact,
64
+ checklistId: options.checklist,
65
+ judge,
66
+ anchorPath: options.anchor,
67
+ };
68
+ const result = await runQualityGate(request);
69
+ if (format === 'json') {
70
+ writeOutput(toJSON(result), options.output);
71
+ }
72
+ else {
73
+ printVerdict(result.verdict, result.mechanical, result.specCoverage, result.unmet, result.reason);
74
+ }
75
+ // Exit codes: 0 pass, 1 fail, 3 inconclusive (distinct so CI can branch).
76
+ const code = result.verdict === 'pass' ? 0 : result.verdict === 'fail' ? 1 : 3;
77
+ await cleanupAndExit(code);
78
+ }
79
+ catch (error) {
80
+ console.error(chalk.red('\nQuality gate failed:'), error instanceof Error ? error.message : error);
81
+ await cleanupAndExit(1);
82
+ }
83
+ });
84
+ }
85
+ function resolveArtifact(options) {
86
+ if (typeof options.artifact === 'string')
87
+ return options.artifact;
88
+ if (options.artifactFile)
89
+ return fs.readFileSync(options.artifactFile, 'utf8');
90
+ return null;
91
+ }
92
+ /**
93
+ * Resolve the mechanical-gate (oracle) result. `--oracle-file` wins; otherwise
94
+ * the boolean flags. Returns null (⇒ mechanical fail) when nothing is supplied,
95
+ * so an un-run oracle can never masquerade as a pass.
96
+ */
97
+ function resolveOracle(options) {
98
+ if (options.oracleFile) {
99
+ const raw = JSON.parse(fs.readFileSync(options.oracleFile, 'utf8'));
100
+ return { passed: !!raw.passed, baselinePassed: !!raw.baselinePassed };
101
+ }
102
+ if (options.oraclePassed === undefined && options.baselinePassed === undefined) {
103
+ return null;
104
+ }
105
+ return { passed: !!options.oraclePassed, baselinePassed: !!options.baselinePassed };
106
+ }
107
+ /**
108
+ * Build the frontier judge from the shared multi-provider router. When no
109
+ * provider/credentials are available the judge's preflight fails ⇒ the verdict
110
+ * is `inconclusive` (never a silent pass). Identical construction to the MCP tool.
111
+ */
112
+ export async function buildJudge(model) {
113
+ const { createLLMRouterService } = await import('../../shared/llm/llm-router-service.js');
114
+ const built = await createLLMRouterService().catch(() => null);
115
+ if (!built) {
116
+ return createUnavailableJudge('no LLM provider configured — set a frontier provider API key');
117
+ }
118
+ return createRouterFrontierJudge(built.router, model ? { model } : {});
119
+ }
120
+ function printVerdict(verdict, mechanical, specCoverage, unmet, reason) {
121
+ const icon = verdict === 'pass' ? chalk.green('✓ PASS')
122
+ : verdict === 'fail' ? chalk.red('✗ FAIL')
123
+ : chalk.yellow('? INCONCLUSIVE');
124
+ console.log(`\n Quality Gate: ${icon}`);
125
+ console.log(` Mechanical gate: ${mechanical === 'pass' ? chalk.green('pass') : chalk.red('fail')}`);
126
+ if (specCoverage != null)
127
+ console.log(` Spec coverage: ${chalk.cyan((specCoverage * 100).toFixed(0) + '%')}`);
128
+ if (unmet.length > 0) {
129
+ console.log(chalk.cyan(' Unmet requirements:'));
130
+ for (const u of unmet)
131
+ console.log(chalk.gray(` - ${u}`));
132
+ }
133
+ console.log(chalk.gray(` ${reason}\n`));
134
+ }
135
+ //# sourceMappingURL=quality-gate.js.map
@@ -5,6 +5,24 @@
5
5
  */
6
6
  import { Command } from 'commander';
7
7
  import { ICommandHandler, CLIContext } from './interfaces.js';
8
+ export interface DaemonLivenessStatus {
9
+ /** A daemon.pid file exists (`aqe`/`npx ruflo daemon start` was run at least once) */
10
+ configured: boolean;
11
+ /** The PID in daemon.pid corresponds to a live process right now */
12
+ running: boolean;
13
+ pid?: number;
14
+ }
15
+ /**
16
+ * Check whether the detached background-worker daemon (`.agentic-qe/workers/
17
+ * start-daemon.cjs`, PID recorded in `daemon.pid` — see `10-workers.ts`) is
18
+ * actually alive. Mirrors the exact liveness check `stop-daemon.cjs` uses
19
+ * (`process.kill(pid, 0)`) rather than inventing a new protocol.
20
+ *
21
+ * Distinct from `aqe daemon status` (in `cli/commands/daemon.ts`), which
22
+ * tracks a *different*, in-process `QualityDaemon` instance that can't see a
23
+ * truly detached process across separate CLI invocations anyway.
24
+ */
25
+ export declare function checkDaemonLiveness(): DaemonLivenessStatus;
8
26
  export declare class StatusHandler implements ICommandHandler {
9
27
  readonly name = "status";
10
28
  readonly description = "Show system status";
@@ -4,8 +4,41 @@
4
4
  * Handles the 'aqe status' and 'aqe health' commands.
5
5
  */
6
6
  import chalk from 'chalk';
7
+ import { existsSync, readFileSync } from 'node:fs';
8
+ import { join } from 'node:path';
7
9
  import { getStatusColor, formatUptime, } from './interfaces.js';
8
10
  import { writeOutput, toJSON } from '../utils/ci-output.js';
11
+ import { findProjectRoot } from '../../kernel/unified-memory.js';
12
+ /**
13
+ * Check whether the detached background-worker daemon (`.agentic-qe/workers/
14
+ * start-daemon.cjs`, PID recorded in `daemon.pid` — see `10-workers.ts`) is
15
+ * actually alive. Mirrors the exact liveness check `stop-daemon.cjs` uses
16
+ * (`process.kill(pid, 0)`) rather than inventing a new protocol.
17
+ *
18
+ * Distinct from `aqe daemon status` (in `cli/commands/daemon.ts`), which
19
+ * tracks a *different*, in-process `QualityDaemon` instance that can't see a
20
+ * truly detached process across separate CLI invocations anyway.
21
+ */
22
+ export function checkDaemonLiveness() {
23
+ try {
24
+ const pidFile = join(findProjectRoot(), '.agentic-qe', 'workers', 'daemon.pid');
25
+ if (!existsSync(pidFile))
26
+ return { configured: false, running: false };
27
+ const pid = parseInt(readFileSync(pidFile, 'utf-8').trim(), 10);
28
+ if (!Number.isFinite(pid))
29
+ return { configured: true, running: false };
30
+ try {
31
+ process.kill(pid, 0); // signal 0: existence check only, doesn't actually kill
32
+ return { configured: true, running: true, pid };
33
+ }
34
+ catch {
35
+ return { configured: true, running: false, pid };
36
+ }
37
+ }
38
+ catch {
39
+ return { configured: false, running: false };
40
+ }
41
+ }
9
42
  // ============================================================================
10
43
  // Status Handler
11
44
  // ============================================================================
@@ -193,6 +226,7 @@ export class HealthHandler {
193
226
  lastCheck: health.lastHealthCheck.toISOString(),
194
227
  domains: domainSummary,
195
228
  issues: health.issues,
229
+ daemon: checkDaemonLiveness(),
196
230
  }), options.output);
197
231
  }
198
232
  await this.cleanupAndExit(0);
@@ -244,6 +278,19 @@ export class HealthHandler {
244
278
  if (idle > 0 && healthy === 0 && degraded === 0 && unhealthy === 0) {
245
279
  console.log(chalk.gray('\n Tip: Domains are idle (ready). Run a task to spawn agents.'));
246
280
  }
281
+ // A18: background worker daemon liveness \u2014 was previously invisible,
282
+ // so a stopped daemon looked identical to "everything's fine".
283
+ const daemon = checkDaemonLiveness();
284
+ console.log(chalk.blue('\n Background Daemon:'));
285
+ if (!daemon.configured) {
286
+ console.log(` ${chalk.gray('\u25CB')} Not configured (never started \u2014 run "npx ruflo daemon start")`);
287
+ }
288
+ else if (daemon.running) {
289
+ console.log(` ${chalk.green('\u25CF')} Running (PID: ${daemon.pid})`);
290
+ }
291
+ else {
292
+ console.log(` ${chalk.red('\u25CF')} Not running (stale PID: ${daemon.pid ?? 'unknown'}) \u2014 learning/consolidation snapshots will not advance`);
293
+ }
247
294
  }
248
295
  console.log('');
249
296
  await this.cleanupAndExit(0);
package/dist/cli/index.js CHANGED
@@ -248,6 +248,11 @@ registerLazyCommand(program, {
248
248
  description: 'Quality assessment shortcut',
249
249
  factory: () => import('./commands/quality.js').then(m => m.createQualityCommand(context, cleanupAndExit, ensureInitialized)),
250
250
  });
251
+ registerLazyCommand(program, {
252
+ name: 'quality-gate',
253
+ description: 'Two-gate, three-valued quality verdict against a pinned checklist (ADR-119)',
254
+ factory: () => import('./commands/quality-gate.js').then(m => m.createQualityGateCommand(context, cleanupAndExit, ensureInitialized)),
255
+ });
251
256
  registerLazyCommand(program, {
252
257
  name: 'security',
253
258
  description: 'Security scanning and URL validation',
@@ -53,6 +53,11 @@ interface DreamInsight {
53
53
  applied: boolean;
54
54
  suggestedAction?: string;
55
55
  createdAt: Date;
56
+ /**
57
+ * ADR-121 evidence tier of the insight. Absent → the conservative default
58
+ * (`proxy:structural`), which the ADR-120 dream-apply gate will not apply.
59
+ */
60
+ provenanceTier?: string;
56
61
  }
57
62
  interface PatternImportData {
58
63
  id: string;
@@ -165,6 +170,12 @@ export interface DreamIntegrationConfig {
165
170
  maxAdaptationHistory: number;
166
171
  /** Whether to auto-apply high-confidence insights */
167
172
  autoApplyInsights: boolean;
173
+ /**
174
+ * ADR-121: whether `judge:llm`-tier insights may be applied. A single LLM
175
+ * judgment is noisy, so judge-tier apply is opt-in (default false). Oracle
176
+ * tier always applies; proxy tier never does.
177
+ */
178
+ allowJudgeTierApply?: boolean;
168
179
  }
169
180
  /**
170
181
  * Default dream integration configuration
@@ -21,6 +21,8 @@
21
21
  */
22
22
  import { v4 as uuidv4 } from 'uuid';
23
23
  import { StrangeLoopController } from './strange-loop';
24
+ import { DEFAULT_PROVENANCE_TIER } from '../../learning/provenance-tier.js';
25
+ import { reExecutePathGate, pathGateFingerprint, pathSealedHash, verifyPathPromotion, } from '../../validation/gate-reexecute.js';
24
26
  /**
25
27
  * Default dream integration configuration
26
28
  */
@@ -930,19 +932,44 @@ export class DreamMinCutController {
930
932
  continue;
931
933
  }
932
934
  const action = this.integration.convertInsightToAction(insight);
933
- if (action && action.type !== 'no_action') {
934
- // Record as adaptation
935
- this.integration.getMetaTracker().recordAdaptation({
936
- timestamp: new Date(),
937
- type: 'insight_applied',
938
- trigger: 'dream_insight',
939
- stateBefore: { minCutValue: 0, weakVertexCount: 0 },
940
- stateAfter: { minCutValue: 0, weakVertexCount: 0 },
941
- improvement: insight.noveltyScore * insight.confidenceScore,
942
- insightId: insight.id,
943
- });
944
- appliedCount++;
935
+ const actionable = !!action && action.type !== 'no_action';
936
+ // ADR-120: seal the apply decision's inputs and re-execute the frozen
937
+ // `dream-apply/v1` rule. This is the A8-EXT fake-`applied`-counter home:
938
+ // a logged apply the frozen rule would reject (proxy-tier evidence, or an
939
+ // insight that produced no real reorganization) is a forgery. Only a
940
+ // receipt that re-executes to `promote` on intact sealed inputs is
941
+ // counted as applied — the log no longer decides, the re-run does.
942
+ const sealed = {
943
+ provenanceTier: insight.provenanceTier ?? DEFAULT_PROVENANCE_TIER,
944
+ allowJudgeTier: this.config.allowJudgeTierApply,
945
+ insightConfidence: insight.confidenceScore,
946
+ insightConfidenceThreshold: this.config.insightConfidenceThreshold,
947
+ insightActionable: actionable,
948
+ };
949
+ const rerun = reExecutePathGate('dream-apply/v1', sealed);
950
+ const receipt = {
951
+ ruleVersion: 'dream-apply/v1',
952
+ ruleFingerprint: pathGateFingerprint('dream-apply/v1'),
953
+ sealedHash: pathSealedHash(sealed),
954
+ sealed,
955
+ recordedVerdict: rerun.promote ? 'promote' : 'reject',
956
+ };
957
+ const verdict = verifyPathPromotion(receipt);
958
+ if (!verdict.valid || !rerun.promote) {
959
+ continue; // not reproducibly applicable under the frozen rule — do not count
945
960
  }
961
+ // Record as adaptation
962
+ this.integration.getMetaTracker().recordAdaptation({
963
+ timestamp: new Date(),
964
+ type: 'insight_applied',
965
+ trigger: 'dream_insight',
966
+ stateBefore: { minCutValue: 0, weakVertexCount: 0 },
967
+ stateAfter: { minCutValue: 0, weakVertexCount: 0 },
968
+ improvement: insight.noveltyScore * insight.confidenceScore,
969
+ insightId: insight.id,
970
+ });
971
+ insight.applied = true;
972
+ appliedCount++;
946
973
  }
947
974
  return appliedCount;
948
975
  }
@@ -277,7 +277,7 @@ export class QueenMinCutBridge {
277
277
  };
278
278
  // Agent status changed
279
279
  const onAgentStatusChanged = async (event) => {
280
- const { agentId, status, domain } = event.payload;
280
+ const { agentId, status } = event.payload;
281
281
  const vertexId = `agent:${agentId}`;
282
282
  const vertex = this.graph.getVertex(vertexId);
283
283
  if (vertex) {
@@ -293,7 +293,7 @@ export class QueenMinCutBridge {
293
293
  };
294
294
  // Task coordination (agent-to-agent communication)
295
295
  const onTaskCoordination = async (event) => {
296
- const { fromAgent, toAgent, messageType } = event.payload;
296
+ const { fromAgent, toAgent } = event.payload;
297
297
  const sourceId = `agent:${fromAgent}`;
298
298
  const targetId = `agent:${toAgent}`;
299
299
  if (this.graph.hasVertex(sourceId) && this.graph.hasVertex(targetId)) {
@@ -321,11 +321,20 @@ export class QueenMinCutBridge {
321
321
  }
322
322
  }
323
323
  };
324
- // Subscribe to events (would use eventBus.subscribe in real implementation)
325
- // For now, we store the handlers for cleanup
326
- this.eventSubscriptions.push(() => {
327
- // Cleanup placeholder - actual unsubscribe would go here
328
- });
324
+ // A16: these handlers existed but were never actually subscribed — the
325
+ // topology graph only ever saw its static domain-coordinator scaffold,
326
+ // never a real agent, no matter how many agents Queen actually spawned.
327
+ // `QueenCoordinator.publishEvent()` prefixes every event with "Queen"
328
+ // (e.g. `AgentSpawned` -> `QueenAgentSpawned`); only that one has a real
329
+ // publisher today (`queen-coordinator.ts`). The other three are wired to
330
+ // the same convention so they activate automatically if/when a publisher
331
+ // for agent termination / status-change / cross-agent coordination is
332
+ // added — they are current no-ops otherwise, not fabricated coverage.
333
+ const spawnedSub = this.eventBus.subscribe('QueenAgentSpawned', onAgentSpawned);
334
+ const terminatedSub = this.eventBus.subscribe('QueenAgentTerminated', onAgentTerminated);
335
+ const statusSub = this.eventBus.subscribe('QueenAgentStatusChanged', onAgentStatusChanged);
336
+ const taskCoordSub = this.eventBus.subscribe('QueenTaskCoordination', onTaskCoordination);
337
+ this.eventSubscriptions.push(() => spawnedSub.unsubscribe(), () => terminatedSub.unsubscribe(), () => statusSub.unsubscribe(), () => taskCoordSub.unsubscribe());
329
338
  }
330
339
  // ==========================================================================
331
340
  // Health Integration
@@ -437,6 +446,14 @@ export class QueenMinCutBridge {
437
446
  */
438
447
  startSnapshotTimer() {
439
448
  this.snapshotTimer = setInterval(async () => {
449
+ // A16: skip the periodic write entirely when no real agents have
450
+ // spawned yet — the domain-coordinator scaffold is static, so an
451
+ // empty-of-agents graph produces the exact same degenerate reading
452
+ // (14 vertices, mincut 0.0) every tick forever, which is noise, not
453
+ // signal. The dispose()-time final snapshot still runs unconditionally
454
+ // since that's a single row, not a recurring accumulation.
455
+ if (this.isEmptyTopology())
456
+ return;
440
457
  await this.saveSnapshot();
441
458
  // Also record history
442
459
  await this.persistence.recordHistory({
@@ -486,7 +486,8 @@ export class DefaultProtocolExecutor {
486
486
  results: Object.fromEntries(execution.results),
487
487
  }, {
488
488
  namespace: 'coordination',
489
- ttl: 86400000, // 24 hours
489
+ // ttl is in SECONDS, not ms (unified-memory.ts:607) — was 1000x too long.
490
+ ttl: 86400, // 24 hours
490
491
  });
491
492
  }
492
493
  /**
@@ -67,7 +67,10 @@ export function startMetricsCollectionTimer(ctx) {
67
67
  const metrics = ctx.getMetrics();
68
68
  await ctx.publishEvent('MetricsCollected', { metrics });
69
69
  await ctx.memory.set(`queen:metrics:${Date.now()}`, metrics, {
70
- ttl: 86400000, // 24 hours
70
+ // MemoryBackend.set's ttl is in SECONDS, not ms (unified-memory.ts:607
71
+ // does Date.now() + ttl * 1000) — this was 86400000, making rows live
72
+ // 1000 days instead of 1, hence unbounded kv_store growth.
73
+ ttl: 86400, // 24 hours
71
74
  namespace: 'queen-coordinator',
72
75
  });
73
76
  // ADR-064 Phase 4C: Feed workload metrics to dynamic scaler
@@ -853,14 +853,16 @@ export class CodeIntelligenceCoordinator extends BaseDomainCoordinator {
853
853
  */
854
854
  async storeC4DiagramsInMemory(projectPath, result) {
855
855
  const key = `c4-diagrams:latest:${this.hashCode(projectPath)}`;
856
+ // ttl is in SECONDS, not ms (unified-memory.ts:607) — these were
857
+ // 3600000, making cache entries live ~41.6 days instead of 1 hour.
856
858
  await this.memory.set(key, result, {
857
859
  namespace: 'code-intelligence',
858
860
  persist: true,
859
- ttl: 3600000, // 1 hour
861
+ ttl: 3600, // 1 hour
860
862
  });
861
863
  // Also store components and external systems separately for quick access
862
- await this.memory.set(`c4-components:${this.hashCode(projectPath)}`, result.components, { namespace: 'code-intelligence', ttl: 3600000 });
863
- await this.memory.set(`c4-external-systems:${this.hashCode(projectPath)}`, result.externalSystems, { namespace: 'code-intelligence', ttl: 3600000 });
864
+ await this.memory.set(`c4-components:${this.hashCode(projectPath)}`, result.components, { namespace: 'code-intelligence', ttl: 3600 });
865
+ await this.memory.set(`c4-external-systems:${this.hashCode(projectPath)}`, result.externalSystems, { namespace: 'code-intelligence', ttl: 3600 });
864
866
  }
865
867
  // ============================================================================
866
868
  // V3 Integration: MetricCollector for Real Code Metrics (Phase 5)
@@ -921,14 +923,16 @@ export class CodeIntelligenceCoordinator extends BaseDomainCoordinator {
921
923
  */
922
924
  async storeProjectMetricsInMemory(projectPath, metrics) {
923
925
  const key = `project-metrics:latest:${this.hashCode(projectPath)}`;
926
+ // ttl is in SECONDS, not ms (unified-memory.ts:607) — these were
927
+ // 300000, making entries live ~3.47 days instead of 5 minutes.
924
928
  await this.memory.set(key, metrics, {
925
929
  namespace: 'code-intelligence',
926
930
  persist: true,
927
- ttl: 300000, // 5 minutes (metrics can change frequently)
931
+ ttl: 300, // 5 minutes (metrics can change frequently)
928
932
  });
929
933
  // Store LOC and test counts separately for quick access
930
- await this.memory.set(`loc-metrics:${this.hashCode(projectPath)}`, metrics.loc, { namespace: 'code-intelligence', ttl: 300000 });
931
- await this.memory.set(`test-metrics:${this.hashCode(projectPath)}`, metrics.tests, { namespace: 'code-intelligence', ttl: 300000 });
934
+ await this.memory.set(`loc-metrics:${this.hashCode(projectPath)}`, metrics.loc, { namespace: 'code-intelligence', ttl: 300 });
935
+ await this.memory.set(`test-metrics:${this.hashCode(projectPath)}`, metrics.tests, { namespace: 'code-intelligence', ttl: 300 });
932
936
  }
933
937
  /**
934
938
  * Get the MetricCollector service for direct access
@@ -624,7 +624,9 @@ export class ProductFactorsBridgeService {
624
624
  };
625
625
  await this.memory.set(cacheKey, cacheEntry, {
626
626
  namespace: 'code-intelligence',
627
- ttl: this.config.cacheTtlMs,
627
+ // MemoryBackend.set's ttl is in SECONDS (unified-memory.ts:607 does
628
+ // Date.now() + ttl * 1000) — cacheTtlMs is milliseconds, so convert.
629
+ ttl: this.config.cacheTtlMs / 1000,
628
630
  });
629
631
  }
630
632
  getCacheKey(projectPath) {
@@ -121,6 +121,12 @@ export declare class DefectPredictorService implements IDefectPredictorService {
121
121
  * ADR-051: Retrieve historical defect patterns for context
122
122
  */
123
123
  private getHistoricalDefectPatterns;
124
+ /**
125
+ * Write side of getHistoricalDefectPatterns — records a confirmed defect's
126
+ * type both per-file and in the general pool, capped and deduped to match
127
+ * what the reader expects.
128
+ */
129
+ private recordConfirmedDefectPattern;
124
130
  /**
125
131
  * Analyze regression risk for a changeset
126
132
  */
@@ -331,6 +331,21 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
331
331
  }
332
332
  return [...new Set(patterns)].slice(0, 10);
333
333
  }
334
+ /**
335
+ * Write side of getHistoricalDefectPatterns — records a confirmed defect's
336
+ * type both per-file and in the general pool, capped and deduped to match
337
+ * what the reader expects.
338
+ */
339
+ async recordConfirmedDefectPattern(file, defectType) {
340
+ const fileKey = `${this.config.modelNamespace}:defect-patterns:${file}`;
341
+ const existing = await this.memory.get(fileKey);
342
+ const patterns = [...new Set([...(existing?.patterns ?? []), defectType])].slice(-20);
343
+ await this.memory.set(fileKey, { patterns }, { namespace: 'defect-intelligence', persist: true });
344
+ const generalKey = `${this.config.modelNamespace}:common-defect-patterns`;
345
+ const existingGeneral = (await this.memory.get(generalKey)) ?? [];
346
+ const general = [...new Set([...existingGeneral, defectType])].slice(-50);
347
+ await this.memory.set(generalKey, general, { namespace: 'defect-intelligence', persist: true });
348
+ }
334
349
  /**
335
350
  * Analyze regression risk for a changeset
336
351
  */
@@ -385,6 +400,12 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
385
400
  });
386
401
  // Update model metrics based on feedback
387
402
  await this.recalculateMetrics(feedback);
403
+ // A confirmed defect with a known type is the write side of
404
+ // getHistoricalDefectPatterns' read — previously nothing populated
405
+ // these keys, so historical-pattern lookup always returned empty.
406
+ if (feedback.actualDefect && feedback.defectType) {
407
+ await this.recordConfirmedDefectPattern(feedback.file, feedback.defectType);
408
+ }
388
409
  return ok(undefined);
389
410
  }
390
411
  catch (error) {
@@ -56,6 +56,13 @@ export interface Experience {
56
56
  readonly result: ExperienceResult;
57
57
  readonly reward: number;
58
58
  readonly timestamp: Date;
59
+ /**
60
+ * ReasoningBank pattern IDs that were applied/matched to produce this
61
+ * experience (ADR-110 kept-nulls). Optional — most domains don't yet
62
+ * track which pattern influenced a given operation; only populate this
63
+ * when real matched-pattern data exists, never a placeholder.
64
+ */
65
+ readonly appliedPatternIds?: readonly string[];
59
66
  }
60
67
  export interface StateSnapshot {
61
68
  readonly context: Record<string, unknown>;
@@ -391,6 +391,11 @@ export class LearningOptimizationPlugin extends BaseDomainPlugin {
391
391
  duration: 0,
392
392
  },
393
393
  reward: 0.8,
394
+ // ADR-110: real matched-pattern IDs from test-generation/coordinator.ts's
395
+ // GeneratedTests.patternsUsed. This event always represents a successful
396
+ // generation, so nulls won't fire from here in practice — threaded for
397
+ // correctness/future use, not for immediate null-recording payoff.
398
+ appliedPatternIds: payload.patternsUsed,
394
399
  });
395
400
  }
396
401
  async handleTestRunCompleted(event) {
@@ -40,6 +40,8 @@ export declare class LearningCoordinatorService implements IPatternLearningServi
40
40
  * Provides 2.49x-7.47x speedup via @ruvector/attention SIMD implementation
41
41
  */
42
42
  private flashAttention;
43
+ /** ADR-110 null store, lazily wired. undefined = not yet attempted; null = attempted and unavailable. */
44
+ private _nullStore?;
43
45
  constructor(dependencies: LearningCoordinatorDependencies, config?: Partial<LearningCoordinatorConfig>);
44
46
  /**
45
47
  * Initialize FlashAttention for high-performance similarity computations.
@@ -143,6 +145,14 @@ export declare class LearningCoordinatorService implements IPatternLearningServi
143
145
  * Record a new experience
144
146
  */
145
147
  recordExperience(experience: Omit<Experience, 'id' | 'timestamp'>): Promise<Result<string>>;
148
+ /**
149
+ * Lazily wire the ADR-110 null store (fail-soft — mirrors the witness-chain
150
+ * wiring pattern in AQELearningEngine). Cached after first successful init;
151
+ * silently no-ops if the unified persistence layer isn't available (e.g.
152
+ * memory-only mode) so a learning-side failure never blocks the caller.
153
+ */
154
+ private getNullStore;
155
+ private recordPatternNulls;
146
156
  /**
147
157
  * Mine experiences for insights
148
158
  */
@@ -40,6 +40,8 @@ export class LearningCoordinatorService {
40
40
  * Provides 2.49x-7.47x speedup via @ruvector/attention SIMD implementation
41
41
  */
42
42
  flashAttention = null;
43
+ /** ADR-110 null store, lazily wired. undefined = not yet attempted; null = attempted and unavailable. */
44
+ _nullStore;
43
45
  constructor(dependencies, config = {}) {
44
46
  this.memory = dependencies.memory;
45
47
  this.llmRouter = dependencies.llmRouter;
@@ -462,12 +464,67 @@ Provide:
462
464
  });
463
465
  // Index by agent and domain for faster retrieval
464
466
  await this.indexExperience(fullExperience);
467
+ // ADR-110: a pattern-guided failure is a kept null, not a discarded
468
+ // run. Only fires when the caller supplied real matched-pattern IDs
469
+ // (appliedPatternIds) — most domains don't track this yet, so this is
470
+ // a no-op for them, which is correct (nothing to blame the failure on).
471
+ if (!experience.result.success && experience.appliedPatternIds?.length) {
472
+ await this.recordPatternNulls(fullExperience);
473
+ }
465
474
  return ok(id);
466
475
  }
467
476
  catch (error) {
468
477
  return err(toError(error));
469
478
  }
470
479
  }
480
+ /**
481
+ * Lazily wire the ADR-110 null store (fail-soft — mirrors the witness-chain
482
+ * wiring pattern in AQELearningEngine). Cached after first successful init;
483
+ * silently no-ops if the unified persistence layer isn't available (e.g.
484
+ * memory-only mode) so a learning-side failure never blocks the caller.
485
+ */
486
+ async getNullStore() {
487
+ if (this._nullStore !== undefined)
488
+ return this._nullStore || undefined;
489
+ try {
490
+ const { getUnifiedPersistence } = await import('../../../kernel/unified-persistence.js');
491
+ const persistence = getUnifiedPersistence();
492
+ if (!persistence.isInitialized()) {
493
+ this._nullStore = null;
494
+ return undefined;
495
+ }
496
+ const { PatternNullStore } = await import('../../../learning/pattern-null-store.js');
497
+ this._nullStore = new PatternNullStore(persistence.getDatabase());
498
+ return this._nullStore;
499
+ }
500
+ catch (e) {
501
+ this._nullStore = null;
502
+ logger.warn('Null store wiring skipped', { error: e instanceof Error ? e.message : String(e) });
503
+ return undefined;
504
+ }
505
+ }
506
+ async recordPatternNulls(experience) {
507
+ const nullStore = await this.getNullStore();
508
+ if (!nullStore)
509
+ return;
510
+ const contextFingerprint = `${experience.domain}:${experience.action}`;
511
+ for (const patternId of experience.appliedPatternIds ?? []) {
512
+ try {
513
+ nullStore.recordNull({
514
+ patternId,
515
+ contextFingerprint,
516
+ failureMode: String(experience.result.outcome?.error ?? experience.action),
517
+ evidenceClass: 'EXECUTED',
518
+ });
519
+ }
520
+ catch (e) {
521
+ logger.warn('Failed to record pattern null', {
522
+ patternId,
523
+ error: e instanceof Error ? e.message : String(e),
524
+ });
525
+ }
526
+ }
527
+ }
471
528
  /**
472
529
  * Mine experiences for insights
473
530
  */