agentic-qe 3.9.14 → 3.9.16

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 (313) hide show
  1. package/.claude/skills/accessibility-testing/SKILL.md +18 -0
  2. package/.claude/skills/enterprise-integration-testing/SKILL.md +1 -1
  3. package/.claude/skills/pentest-validation/SKILL.md +1 -1
  4. package/.claude/skills/qe-browser/evals/qe-browser.yaml +46 -63
  5. package/.claude/skills/qe-browser/scripts/smoke-test.sh +16 -4
  6. package/.claude/skills/skills-manifest.json +1 -1
  7. package/CHANGELOG.md +52 -0
  8. package/assets/skills/accessibility-testing/SKILL.md +18 -0
  9. package/assets/skills/qe-browser/evals/qe-browser.yaml +46 -63
  10. package/assets/skills/qe-browser/scripts/smoke-test.sh +16 -4
  11. package/assets/skills/skills-manifest.json +1 -1
  12. package/dist/cli/brain-commands.d.ts +14 -0
  13. package/dist/cli/brain-commands.js +24 -0
  14. package/dist/cli/bundle.js +7 -7
  15. package/dist/cli/chunks/adapter-XFJIW42U.js +2 -0
  16. package/dist/cli/chunks/{agent-booster-wasm-O6EXMPMF.js → agent-booster-wasm-IECTFMRK.js} +2 -2
  17. package/dist/cli/chunks/{agent-handler-4LPJVTJU.js → agent-handler-HLLTKZ5G.js} +2 -2
  18. package/dist/cli/chunks/{agent-memory-branch-PRR323JZ.js → agent-memory-branch-WJUD3DS4.js} +2 -2
  19. package/dist/cli/chunks/aqe-learning-engine-UD4SXENM.js +2 -0
  20. package/dist/cli/chunks/{audit-YCKXQOXD.js → audit-3DLZNWHO.js} +2 -2
  21. package/dist/cli/chunks/base-ETEN7L2V.js +2 -0
  22. package/dist/cli/chunks/{better-sqlite3-44RIH62G.js → better-sqlite3-Q356NEQ6.js} +2 -2
  23. package/dist/cli/chunks/brain-handler-MX2HP7LO.js +89 -0
  24. package/dist/cli/chunks/{branch-enumerator-RVVS2UYR.js → branch-enumerator-Z3TF3HVO.js} +2 -2
  25. package/dist/cli/chunks/{browser-L6IKC4PR.js → browser-Z6PQ7FTO.js} +2 -2
  26. package/dist/cli/chunks/browser-workflow-KVHPOIBA.js +2 -0
  27. package/dist/cli/chunks/{chunk-JOGKQTCU.js → chunk-2KCMS4UW.js} +3 -3
  28. package/dist/cli/chunks/{chunk-VUS4VRPQ.js → chunk-2MJEAEOW.js} +2 -2
  29. package/dist/cli/chunks/{chunk-FNKKENLS.js → chunk-3ADFXSO2.js} +2 -2
  30. package/dist/cli/chunks/{chunk-JN7MSUGK.js → chunk-3CAPNE2H.js} +2 -2
  31. package/dist/cli/chunks/{chunk-MFGYMNNY.js → chunk-3EUA73H6.js} +2 -2
  32. package/dist/cli/chunks/{chunk-ORHCO2I7.js → chunk-3H657FNU.js} +2 -2
  33. package/dist/cli/chunks/{chunk-OZBTC26R.js → chunk-3K4IX7L4.js} +2 -2
  34. package/dist/cli/chunks/{chunk-GIUAY4KY.js → chunk-3SLFWPRE.js} +3 -3
  35. package/dist/cli/chunks/{chunk-P5YSBYZV.js → chunk-3ZGYB23S.js} +1 -1
  36. package/dist/cli/chunks/{chunk-6BK2S2WE.js → chunk-46K7ALFU.js} +2 -2
  37. package/dist/cli/chunks/{chunk-I3P5RZX7.js → chunk-4CFQZHUC.js} +3 -3
  38. package/dist/cli/chunks/{chunk-DMZ2XOEW.js → chunk-4PFHQH4B.js} +2 -2
  39. package/dist/cli/chunks/{chunk-TOSFK4VG.js → chunk-4ZN4GM7W.js} +1 -1
  40. package/dist/cli/chunks/{chunk-MXIFVOYA.js → chunk-5A5XANSD.js} +2 -2
  41. package/dist/cli/chunks/{chunk-UG2J5MTY.js → chunk-5E7FVOOG.js} +1 -1
  42. package/dist/cli/chunks/chunk-5LDXAVDC.js +2 -0
  43. package/dist/cli/chunks/{chunk-KFAN5FZM.js → chunk-666L7MC2.js} +2 -2
  44. package/dist/cli/chunks/{chunk-ZCRLZINE.js → chunk-66BUIFFH.js} +2 -2
  45. package/dist/cli/chunks/{chunk-6EZY2QVM.js → chunk-6V5P2VMQ.js} +8 -8
  46. package/dist/cli/chunks/{chunk-YPMBD44A.js → chunk-6XKZ62O7.js} +2 -2
  47. package/dist/cli/chunks/{chunk-JNLKLC7G.js → chunk-77OVXVN2.js} +2 -2
  48. package/dist/cli/chunks/{chunk-I5U64MHU.js → chunk-7DP2IQ6F.js} +2 -2
  49. package/dist/cli/chunks/{chunk-FFACJODG.js → chunk-7IF4LRX2.js} +2 -2
  50. package/dist/cli/chunks/{chunk-36YZ2UF7.js → chunk-7JFSMXIA.js} +2 -2
  51. package/dist/cli/chunks/{chunk-VU4QET3C.js → chunk-7MF6LVLH.js} +2 -2
  52. package/dist/cli/chunks/{chunk-WELNFHDN.js → chunk-7NMLIJHL.js} +1 -1
  53. package/dist/cli/chunks/{chunk-IOHDE27P.js → chunk-7PHYOV2X.js} +2 -2
  54. package/dist/cli/chunks/{chunk-YZBY4ZRF.js → chunk-7V2Z3PUJ.js} +2 -2
  55. package/dist/cli/chunks/{chunk-GM5LIYLQ.js → chunk-AA6IUBCM.js} +2 -2
  56. package/dist/cli/chunks/{chunk-TJOZPPZR.js → chunk-AFLQFUXA.js} +2 -2
  57. package/dist/cli/chunks/{chunk-KJB6JJXT.js → chunk-BCT26J7X.js} +1 -1
  58. package/dist/cli/chunks/{chunk-D6APBW66.js → chunk-BEE5KXQT.js} +1 -1
  59. package/dist/cli/chunks/{chunk-A2TK52B2.js → chunk-BNDK7JRW.js} +2 -2
  60. package/dist/cli/chunks/{chunk-4EQWK6P6.js → chunk-CR7LLS26.js} +2 -2
  61. package/dist/cli/chunks/{chunk-S2KGZJHS.js → chunk-DBCN7R63.js} +1 -1
  62. package/dist/cli/chunks/{chunk-BNPJMPM3.js → chunk-DF3DZP7H.js} +2 -2
  63. package/dist/cli/chunks/{chunk-OGLS6HB4.js → chunk-DJPS7H2M.js} +1 -1
  64. package/dist/cli/chunks/{chunk-G7L5Y47C.js → chunk-ED5OUSYZ.js} +1 -1
  65. package/dist/cli/chunks/{chunk-PZF5ISGS.js → chunk-EFTK4ZVP.js} +1 -1
  66. package/dist/cli/chunks/chunk-FEQ5RDQL.js +18 -0
  67. package/dist/cli/chunks/{chunk-VDGWDDBC.js → chunk-FKQV52TC.js} +2 -2
  68. package/dist/cli/chunks/{chunk-DD4T7ZUM.js → chunk-FLWIEPAT.js} +1 -1
  69. package/dist/cli/chunks/{chunk-5DWTU2PN.js → chunk-FQTUUZVK.js} +1 -1
  70. package/dist/cli/chunks/{chunk-4JYLXYAH.js → chunk-G5DMEEQQ.js} +1 -1
  71. package/dist/cli/chunks/{chunk-JLBUS4PR.js → chunk-GB6D3SSY.js} +2 -2
  72. package/dist/cli/chunks/{chunk-HEQ23HBE.js → chunk-GP7IXB3E.js} +2 -2
  73. package/dist/cli/chunks/{chunk-3NUMJB3U.js → chunk-H3JEGAFC.js} +9 -9
  74. package/dist/cli/chunks/{chunk-ZFZX2NA3.js → chunk-H4BZJVKU.js} +2 -2
  75. package/dist/cli/chunks/{chunk-AOYN6XYJ.js → chunk-HFGCLV56.js} +1 -1
  76. package/dist/cli/chunks/{chunk-XNXOW7BQ.js → chunk-HJUC2DE6.js} +2 -2
  77. package/dist/cli/chunks/{chunk-NWZYULZE.js → chunk-HN6GVQ4Q.js} +4 -4
  78. package/dist/cli/chunks/{chunk-RQFC7Q33.js → chunk-HON4X4Z3.js} +2 -2
  79. package/dist/cli/chunks/{chunk-AEQMQVDJ.js → chunk-HVAW64YW.js} +2 -2
  80. package/dist/cli/chunks/{chunk-5MWNXDQW.js → chunk-HXF4FUPY.js} +2 -2
  81. package/dist/cli/chunks/{chunk-HJJTLOWZ.js → chunk-IUQ6HE2J.js} +2 -2
  82. package/dist/cli/chunks/{chunk-IH4OOAEP.js → chunk-J2ERTUDX.js} +1 -1
  83. package/dist/cli/chunks/{chunk-DNFDSDKE.js → chunk-JCQ5PXVM.js} +2 -2
  84. package/dist/cli/chunks/{chunk-XH774Q6Z.js → chunk-JNXIYHLI.js} +1 -1
  85. package/dist/cli/chunks/{chunk-ERMIIRYN.js → chunk-JUKCBZCZ.js} +1 -1
  86. package/dist/cli/chunks/{chunk-AHVUILGE.js → chunk-JZOMOYHZ.js} +1 -1
  87. package/dist/cli/chunks/{chunk-UAAJ3BSW.js → chunk-KLVS6FT2.js} +2 -2
  88. package/dist/cli/chunks/{chunk-GUEK5DOK.js → chunk-KR7S4IZZ.js} +2 -2
  89. package/dist/cli/chunks/{chunk-VQB5SLXZ.js → chunk-L2GANTQN.js} +2 -2
  90. package/dist/cli/chunks/{chunk-GALNZTYE.js → chunk-LJINNQNN.js} +2 -2
  91. package/dist/cli/chunks/{chunk-IL3ESNHA.js → chunk-LSA4XGSE.js} +3 -3
  92. package/dist/cli/chunks/{chunk-M2RO34V7.js → chunk-LVA53A5R.js} +4 -4
  93. package/dist/cli/chunks/{chunk-LJ3WQIBN.js → chunk-LVK2PDUW.js} +1 -1
  94. package/dist/cli/chunks/{chunk-3ZKTPPIC.js → chunk-LWG7LKOK.js} +1 -1
  95. package/dist/cli/chunks/{chunk-PFSSI3YR.js → chunk-MECDNFOJ.js} +2 -2
  96. package/dist/cli/chunks/{chunk-FWI7PK4X.js → chunk-MFRC267A.js} +1 -1
  97. package/dist/cli/chunks/{chunk-WE7KIXR6.js → chunk-MJKFU6A6.js} +2 -2
  98. package/dist/cli/chunks/{chunk-5U6M4XCP.js → chunk-MQHP65QB.js} +3 -3
  99. package/dist/cli/chunks/{chunk-7732TLNA.js → chunk-MTF6ABUH.js} +2 -2
  100. package/dist/cli/chunks/{chunk-ME4LVBTT.js → chunk-N5ZTPAX7.js} +2 -2
  101. package/dist/cli/chunks/{chunk-NWGIQCCO.js → chunk-NCXXXZGL.js} +1 -1
  102. package/dist/cli/chunks/{chunk-DJLRRCR6.js → chunk-NIXMFJJC.js} +2 -2
  103. package/dist/cli/chunks/{chunk-JWR3NNFA.js → chunk-NLU4XJBN.js} +1 -1
  104. package/dist/cli/chunks/{chunk-DGUAAG3T.js → chunk-NOJVROCD.js} +1 -1
  105. package/dist/cli/chunks/{chunk-Z3PSKGBO.js → chunk-OE7SGIX2.js} +2 -2
  106. package/dist/cli/chunks/{chunk-KHUFPJE4.js → chunk-OP7X434R.js} +2 -2
  107. package/dist/cli/chunks/{chunk-WUYJYRBY.js → chunk-P4IYRPCB.js} +1 -1
  108. package/dist/cli/chunks/{chunk-GOTVYSX5.js → chunk-PNZADZSI.js} +3 -3
  109. package/dist/cli/chunks/{chunk-3PZ2QLLR.js → chunk-PPUEXTH2.js} +3 -3
  110. package/dist/cli/chunks/{chunk-6J6GXRHX.js → chunk-PQLT3X6X.js} +3 -3
  111. package/dist/cli/chunks/{chunk-VVKENR4I.js → chunk-QEKZA2NJ.js} +1 -1
  112. package/dist/cli/chunks/{chunk-S6SM7LJK.js → chunk-QKQAQPXY.js} +2 -2
  113. package/dist/cli/chunks/{chunk-LWHM5BWD.js → chunk-RFLSJ7OL.js} +2 -2
  114. package/dist/cli/chunks/{chunk-WSZVSDD5.js → chunk-RVQXMMRO.js} +2 -2
  115. package/dist/cli/chunks/{chunk-Q4DAYLH4.js → chunk-RYCAVZSD.js} +2 -2
  116. package/dist/cli/chunks/{chunk-VEAVDXXT.js → chunk-SMNOZEM7.js} +2 -2
  117. package/dist/cli/chunks/{chunk-4RDTR2OF.js → chunk-T36IXY5W.js} +2 -2
  118. package/dist/cli/chunks/{chunk-J3XLOHWB.js → chunk-T7VIUEKI.js} +2 -2
  119. package/dist/cli/chunks/{chunk-J5YOXLBD.js → chunk-TFBEX7ED.js} +1 -1
  120. package/dist/cli/chunks/{chunk-Y3X5OS5F.js → chunk-TPRYLARW.js} +2 -2
  121. package/dist/cli/chunks/{chunk-SY74WSBN.js → chunk-TR4NPMRW.js} +2 -2
  122. package/dist/cli/chunks/{chunk-WVN4YJSF.js → chunk-TUPFBZKO.js} +1 -1
  123. package/dist/cli/chunks/{chunk-UUVTLYUK.js → chunk-TWEBJWJI.js} +2 -2
  124. package/dist/cli/chunks/{chunk-QUK34CSU.js → chunk-UH7TV6BY.js} +1 -1
  125. package/dist/cli/chunks/{chunk-QLWP7ZIT.js → chunk-UT4CXF6C.js} +2 -2
  126. package/dist/cli/chunks/{chunk-UIYK4Y7K.js → chunk-V2ELGHLG.js} +2 -2
  127. package/dist/cli/chunks/{chunk-ZU5VHW6P.js → chunk-VK2GKQYI.js} +2 -2
  128. package/dist/cli/chunks/{chunk-FYBTGEOV.js → chunk-VNAAXZGF.js} +1 -1
  129. package/dist/cli/chunks/{chunk-G2KQUEGY.js → chunk-VOAECU7B.js} +2 -2
  130. package/dist/cli/chunks/{chunk-3GIZRGX6.js → chunk-W4ZV6LAJ.js} +2 -2
  131. package/dist/cli/chunks/{chunk-5HUAD4UU.js → chunk-W6TMZY5R.js} +2 -2
  132. package/dist/cli/chunks/{chunk-KVN4FTPT.js → chunk-WKLSXJD4.js} +2 -2
  133. package/dist/cli/chunks/{chunk-BOMJHE4I.js → chunk-WSKASZYC.js} +2 -2
  134. package/dist/cli/chunks/{chunk-6GKXC6DE.js → chunk-WVFLNGOK.js} +2 -2
  135. package/dist/cli/chunks/{chunk-SUXUCW5I.js → chunk-WVHH3OQ4.js} +2 -2
  136. package/dist/cli/chunks/{chunk-CGC63MGF.js → chunk-XAULPLOC.js} +4 -4
  137. package/dist/cli/chunks/{chunk-L4IWZXSC.js → chunk-XKMMFQSJ.js} +1 -1
  138. package/dist/cli/chunks/{chunk-7IJBZGZY.js → chunk-XQ6WIPDC.js} +1 -1
  139. package/dist/cli/chunks/{chunk-LKGLKX2A.js → chunk-ZCE6JNRI.js} +2 -2
  140. package/dist/cli/chunks/{chunk-BFCMOMOF.js → chunk-ZCZJYM42.js} +1 -1
  141. package/dist/cli/chunks/{chunk-2L3BCZ2F.js → chunk-ZXLF3IKT.js} +1 -1
  142. package/dist/cli/chunks/{ci-QQ4F5TYO.js → ci-TTP5HJSW.js} +2 -2
  143. package/dist/cli/chunks/{ci-output-QC4WRENA.js → ci-output-TKESU45X.js} +2 -2
  144. package/dist/cli/chunks/{circuit-breaker-HFQUNYTK.js → circuit-breaker-GFRV5R7E.js} +2 -2
  145. package/dist/cli/chunks/{claude-flow-setup-XNSCWIUN.js → claude-flow-setup-LY6MADFA.js} +2 -2
  146. package/dist/cli/chunks/client-ZDVM5WFL.js +2 -0
  147. package/dist/cli/chunks/{cline-installer-S3CECBYL.js → cline-installer-OSAILLDH.js} +2 -2
  148. package/dist/cli/chunks/{code-QHUELDUH.js → code-ASRSOGYH.js} +2 -2
  149. package/dist/cli/chunks/{code-index-extractor-QLA5EQTE.js → code-index-extractor-AMLGVHB7.js} +2 -2
  150. package/dist/cli/chunks/{codex-installer-CQ7JNNOA.js → codex-installer-3CKH3WV4.js} +2 -2
  151. package/dist/cli/chunks/{completions-S33U3KIT.js → completions-MXNPWLOE.js} +91 -10
  152. package/dist/cli/chunks/{complexity-analyzer-J7IEW3EM.js → complexity-analyzer-2Z347PXF.js} +2 -2
  153. package/dist/cli/chunks/{continuedev-installer-DVU24D37.js → continuedev-installer-LE7K745N.js} +2 -2
  154. package/dist/cli/chunks/{copilot-installer-DYISOPBC.js → copilot-installer-CHJL3275.js} +2 -2
  155. package/dist/cli/chunks/{cost-tracker-URJADKKS.js → cost-tracker-C3ZWNNSV.js} +2 -2
  156. package/dist/cli/chunks/{coverage-NGMKJNW6.js → coverage-6JOXBVDL.js} +3 -3
  157. package/dist/cli/chunks/cross-domain-router-J5VK276J.js +2 -0
  158. package/dist/cli/chunks/{cursor-installer-DFBJRDSY.js → cursor-installer-RKCNWO42.js} +2 -2
  159. package/dist/cli/chunks/{daemon-JSKKVVCV.js → daemon-XXWOT6TM.js} +3 -3
  160. package/dist/cli/chunks/{dag-attention-scheduler-YITFS6MR.js → dag-attention-scheduler-37MG6XR4.js} +2 -2
  161. package/dist/cli/chunks/{detect-5APZP2D3.js → detect-QOTL36CE.js} +2 -2
  162. package/dist/cli/chunks/{domain-handler-WHH6XPSZ.js → domain-handler-TJNLNJ7Z.js} +2 -2
  163. package/dist/cli/chunks/{domain-transfer-SERX53SS.js → domain-transfer-FDHC2MGH.js} +2 -2
  164. package/dist/cli/chunks/dream-VCLN6RM4.js +2 -0
  165. package/dist/cli/chunks/esm-node-YZSRCH6T.js +2 -0
  166. package/dist/cli/chunks/eval-JP7CLUTD.js +15 -0
  167. package/dist/cli/chunks/{fast-paths-4MSOOJVK.js → fast-paths-CWTVLIIC.js} +2 -2
  168. package/dist/cli/chunks/{feature-flags-564YFR65.js → feature-flags-H2UU53L4.js} +2 -2
  169. package/dist/cli/chunks/{feature-flags-WJT57IEJ.js → feature-flags-SKFBAHR3.js} +2 -2
  170. package/dist/cli/chunks/{file-discovery-5QVG65WF.js → file-discovery-RWVGKIDB.js} +2 -2
  171. package/dist/cli/chunks/{fleet-CF5JRK5B.js → fleet-JOSUYRTZ.js} +3 -3
  172. package/dist/cli/chunks/{gnn-wrapper-NYQ77563.js → gnn-wrapper-WNOZFTDD.js} +2 -2
  173. package/dist/cli/chunks/{heartbeat-handler-42QJPKHE.js → heartbeat-handler-73YSR6K7.js} +4 -4
  174. package/dist/cli/chunks/{heartbeat-scheduler-7XEAV74Y.js → heartbeat-scheduler-EN52JZUX.js} +2 -2
  175. package/dist/cli/chunks/hnsw-adapter-Y5HVTNJW.js +2 -0
  176. package/dist/cli/chunks/hnsw-index-NZTCPZA5.js +2 -0
  177. package/dist/cli/chunks/{hnsw-legacy-bridge-ZRR6PGWN.js → hnsw-legacy-bridge-PWD6DXS4.js} +2 -2
  178. package/dist/cli/chunks/{hnswlib-node-DY7NOW76.js → hnswlib-node-VAZOCNY7.js} +2 -2
  179. package/dist/cli/chunks/{hooks-IRRHEJLR.js → hooks-K7XGDF2Y.js} +6 -6
  180. package/dist/cli/chunks/{hybrid-router-S4JXJLUY.js → hybrid-router-6W323WKW.js} +2 -2
  181. package/dist/cli/chunks/{hypergraph-engine-WFHZJMP2.js → hypergraph-engine-R2N4C24I.js} +2 -2
  182. package/dist/cli/chunks/{hypergraph-handler-LHUKR7PT.js → hypergraph-handler-AY4YZDOG.js} +3 -3
  183. package/dist/cli/chunks/impact-analyzer-ROWLIS6H.js +2 -0
  184. package/dist/cli/chunks/{init-handler-ZBIW7PSB.js → init-handler-UDBW4P3Z.js} +6 -6
  185. package/dist/cli/chunks/init-wizard-MI76CUL5.js +2 -0
  186. package/dist/cli/chunks/kernel-5WVAV5RX.js +2 -0
  187. package/dist/cli/chunks/{kilocode-installer-JYHA4NW7.js → kilocode-installer-J2NZUDEQ.js} +2 -2
  188. package/dist/cli/chunks/{kiro-installer-OBXTRK77.js → kiro-installer-AHOOKFQH.js} +2 -2
  189. package/dist/cli/chunks/knowledge-graph-QXL3AWPV.js +2 -0
  190. package/dist/cli/chunks/{learning-OAEJHEJD.js → learning-VC7X2HKA.js} +3 -3
  191. package/dist/cli/chunks/{llm-router-NNEOZAVB.js → llm-router-3PU7CH5P.js} +4 -4
  192. package/dist/cli/chunks/{load-WIKLBESW.js → load-WB4JD6X7.js} +2 -2
  193. package/dist/cli/chunks/load-test-2JOY7YH6.js +2 -0
  194. package/dist/cli/chunks/{mcp-KR43GFGP.js → mcp-QUU2DYYK.js} +2 -2
  195. package/dist/cli/chunks/{memory-KQIYKAYU.js → memory-UAEWPG34.js} +5 -5
  196. package/dist/cli/chunks/memory-backend-ZKGLAWQZ.js +2 -0
  197. package/dist/cli/chunks/{memory-handlers-LAI4AO4O.js → memory-handlers-3FBXIZG4.js} +2 -2
  198. package/dist/cli/chunks/{multi-model-executor-NPS3VOAR.js → multi-model-executor-CIUHXR43.js} +2 -2
  199. package/dist/cli/chunks/{opencode-installer-FE475WME.js → opencode-installer-VV6RIHNR.js} +2 -2
  200. package/dist/cli/chunks/{orchestrator-MW4MZ3RW.js → orchestrator-WV27PZZM.js} +20 -20
  201. package/dist/cli/chunks/{pipeline-R2TGZSUA.js → pipeline-JRBCX2U3.js} +2 -2
  202. package/dist/cli/chunks/{platform-N2GZBCBP.js → platform-TUPMH4ND.js} +2 -2
  203. package/dist/cli/chunks/{plugin-V2AQF23V.js → plugin-H757CYQK.js} +2 -2
  204. package/dist/cli/chunks/{prime-radiant-advanced-wasm-ZQSYRLRS.js → prime-radiant-advanced-wasm-5BWO25RA.js} +2 -2
  205. package/dist/cli/chunks/protocol-executor-3Q4QY7G6.js +2 -0
  206. package/dist/cli/chunks/{protocol-handler-V3U724F2.js → protocol-handler-Z6DCNTUU.js} +2 -2
  207. package/dist/cli/chunks/{prove-NCH56HZB.js → prove-4OGWFOUM.js} +2 -2
  208. package/dist/cli/chunks/{provider-manager-7NUHS3T5.js → provider-manager-K736L6LN.js} +2 -2
  209. package/dist/cli/chunks/qe-reasoning-bank-SAMJF3NF.js +2 -0
  210. package/dist/cli/chunks/{quality-J3IVPPPW.js → quality-YFLEATGZ.js} +2 -2
  211. package/dist/cli/chunks/queen-coordinator-OFRH67Y2.js +2 -0
  212. package/dist/cli/chunks/{real-embeddings-VURZXAEY.js → real-embeddings-5QUSL7J4.js} +2 -2
  213. package/dist/cli/chunks/{roocode-installer-STWFJGMR.js → roocode-installer-HDWE5XW3.js} +2 -2
  214. package/dist/cli/chunks/router-UDHEENEY.js +2 -0
  215. package/dist/cli/chunks/routing-feedback-PBZRVFVL.js +2 -0
  216. package/dist/cli/chunks/{routing-handler-6GZT7EXM.js → routing-handler-P6PP3FYW.js} +2 -2
  217. package/dist/cli/chunks/{ruvector-commands-LCPAH6WH.js → ruvector-commands-VNMTRQML.js} +2 -2
  218. package/dist/cli/chunks/{rvf-dual-writer-76LWFT5X.js → rvf-dual-writer-A7VW5CAT.js} +2 -2
  219. package/dist/cli/chunks/{rvf-migration-adapter-G7KFWJKY.js → rvf-migration-adapter-QIPSNASM.js} +2 -2
  220. package/dist/cli/chunks/{rvf-migration-coordinator-3DXOUPWF.js → rvf-migration-coordinator-XT4XDLRZ.js} +2 -2
  221. package/dist/cli/chunks/rvf-native-adapter-CJFEDG74.js +2 -0
  222. package/dist/cli/chunks/safe-db-YMSZFHWP.js +2 -0
  223. package/dist/cli/chunks/schedule-B43N6CVB.js +2 -0
  224. package/dist/cli/chunks/scheduler-ITZH5YQM.js +2 -0
  225. package/dist/cli/chunks/{security-XDBPYA5T.js → security-E2XCP5CG.js} +3 -3
  226. package/dist/cli/chunks/shared-rvf-adapter-PV5ZBJ25.js +2 -0
  227. package/dist/cli/chunks/{shared-rvf-dual-writer-UGXTS2XI.js → shared-rvf-dual-writer-NPWTXHUI.js} +2 -2
  228. package/dist/cli/chunks/sqlite-persistence-RK5CKPHB.js +2 -0
  229. package/dist/cli/chunks/{status-handler-ZLXES3QL.js → status-handler-MWVNDZSZ.js} +2 -2
  230. package/dist/cli/chunks/{structural-health-4PFCOQ7T.js → structural-health-2KZO43IF.js} +2 -2
  231. package/dist/cli/chunks/{sync-3DROIEZN.js → sync-C5BOK3WU.js} +2 -2
  232. package/dist/cli/chunks/{task-handler-4UGZ5VIE.js → task-handler-KRVSHJGJ.js} +2 -2
  233. package/dist/cli/chunks/{task-handlers-I5VVBTWI.js → task-handlers-CKOHD633.js} +2 -2
  234. package/dist/cli/chunks/{test-Z2MM7O5A.js → test-3B7FK6MJ.js} +4 -4
  235. package/dist/cli/chunks/{test-scheduling-AP76GKN5.js → test-scheduling-HZIMSTAX.js} +3 -3
  236. package/dist/cli/chunks/{token-bootstrap-P54N6PZV.js → token-bootstrap-JJCANIHJ.js} +2 -2
  237. package/dist/cli/chunks/{token-usage-AXAZTPA6.js → token-usage-5VCMBZU7.js} +2 -2
  238. package/dist/cli/chunks/{transformers-VOZ2Z7FS.js → transformers-ETUTMOTF.js} +2 -2
  239. package/dist/cli/chunks/{tree-sitter-wasm-parser-IYKLBTXB.js → tree-sitter-wasm-parser-TMR44BKP.js} +2 -2
  240. package/dist/cli/chunks/{types-TKDH5EBW.js → types-GYT6373C.js} +2 -2
  241. package/dist/cli/chunks/unified-memory-LIKELZVA.js +2 -0
  242. package/dist/cli/chunks/unified-memory-hnsw-VTN3MUB4.js +2 -0
  243. package/dist/cli/chunks/unified-persistence-MQVUY5WN.js +2 -0
  244. package/dist/cli/chunks/upgrade-534QLY7P.js +5 -0
  245. package/dist/cli/chunks/{validate-ZGF5FVZE.js → validate-UBVF3CSS.js} +2 -2
  246. package/dist/cli/chunks/{validate-swarm-OPWWUWYA.js → validate-swarm-2XD45EVM.js} +2 -2
  247. package/dist/cli/chunks/{vibium-HEQUGRKJ.js → vibium-NMT6AQ4S.js} +2 -2
  248. package/dist/cli/chunks/visual-security-HVJWGY7T.js +2 -0
  249. package/dist/cli/chunks/{web-tree-sitter-JZ7JCJJR.js → web-tree-sitter-RNG6NRDD.js} +2 -2
  250. package/dist/cli/chunks/{windsurf-installer-2SGRCS6C.js → windsurf-installer-RVCDSJT3.js} +2 -2
  251. package/dist/cli/chunks/witness-chain-5R322YYF.js +2 -0
  252. package/dist/cli/chunks/{witness-chain-LJUYOCB5.js → witness-chain-YDFB22MT.js} +2 -2
  253. package/dist/cli/chunks/{workflow-QORI3KO7.js → workflow-MHW4KHNK.js} +4 -4
  254. package/dist/cli/chunks/workflow-orchestrator-637BCZI4.js +2 -0
  255. package/dist/cli/chunks/{wrappers-3NR7LNB5.js → wrappers-SAZY3C2S.js} +2 -2
  256. package/dist/cli/commands/eval.js +86 -0
  257. package/dist/cli/commands/upgrade.d.ts +96 -0
  258. package/dist/cli/commands/upgrade.js +342 -0
  259. package/dist/cli/completions/index.d.ts +27 -0
  260. package/dist/cli/completions/index.js +112 -14
  261. package/dist/cli/handlers/brain-handler.d.ts +2 -0
  262. package/dist/cli/handlers/brain-handler.js +221 -1
  263. package/dist/cli/index.js +5 -1
  264. package/dist/init/browser-engine-installer.d.ts +60 -1
  265. package/dist/init/browser-engine-installer.js +73 -3
  266. package/dist/init/phases/09-assets.js +9 -2
  267. package/dist/integrations/ruvector/brain-diff.d.ts +93 -0
  268. package/dist/integrations/ruvector/brain-diff.js +281 -0
  269. package/dist/integrations/ruvector/brain-search.d.ts +78 -0
  270. package/dist/integrations/ruvector/brain-search.js +154 -0
  271. package/dist/mcp/bundle.js +1 -1
  272. package/dist/validation/command-eval-runner.d.ts +154 -0
  273. package/dist/validation/command-eval-runner.js +293 -0
  274. package/dist/validation/index.d.ts +2 -0
  275. package/dist/validation/index.js +4 -0
  276. package/package.json +1 -1
  277. package/dist/cli/chunks/adapter-W2EM7ZQ7.js +0 -2
  278. package/dist/cli/chunks/aqe-learning-engine-JQMPNHQU.js +0 -2
  279. package/dist/cli/chunks/base-EOPYE6JR.js +0 -2
  280. package/dist/cli/chunks/brain-handler-IAYJBAFL.js +0 -68
  281. package/dist/cli/chunks/browser-workflow-CSARLAJD.js +0 -2
  282. package/dist/cli/chunks/chunk-53KLVMAT.js +0 -18
  283. package/dist/cli/chunks/chunk-STYNOKOM.js +0 -2
  284. package/dist/cli/chunks/client-3GECKJWB.js +0 -2
  285. package/dist/cli/chunks/cross-domain-router-UYONX76U.js +0 -2
  286. package/dist/cli/chunks/dream-Z5QDQJSM.js +0 -2
  287. package/dist/cli/chunks/esm-node-FOI5Y3O2.js +0 -2
  288. package/dist/cli/chunks/eval-FM3BLVFO.js +0 -15
  289. package/dist/cli/chunks/hnsw-adapter-NOAQ76QF.js +0 -2
  290. package/dist/cli/chunks/hnsw-index-KDIZQRSB.js +0 -2
  291. package/dist/cli/chunks/impact-analyzer-VDXJBWFG.js +0 -2
  292. package/dist/cli/chunks/init-wizard-Q6DEACKX.js +0 -2
  293. package/dist/cli/chunks/kernel-YNQOGTM5.js +0 -2
  294. package/dist/cli/chunks/knowledge-graph-GOZG3YOM.js +0 -2
  295. package/dist/cli/chunks/load-test-UJLTMPXW.js +0 -2
  296. package/dist/cli/chunks/memory-backend-WJH6XER3.js +0 -2
  297. package/dist/cli/chunks/protocol-executor-LYYYHXAX.js +0 -2
  298. package/dist/cli/chunks/qe-reasoning-bank-JK4UKLYY.js +0 -2
  299. package/dist/cli/chunks/queen-coordinator-6OKLSCHV.js +0 -2
  300. package/dist/cli/chunks/router-DDZHCGUD.js +0 -2
  301. package/dist/cli/chunks/routing-feedback-BA66F37P.js +0 -2
  302. package/dist/cli/chunks/rvf-native-adapter-TXTRJNPW.js +0 -2
  303. package/dist/cli/chunks/safe-db-IFBVWIGF.js +0 -2
  304. package/dist/cli/chunks/schedule-WMZLOPCW.js +0 -2
  305. package/dist/cli/chunks/scheduler-WBORWJD5.js +0 -2
  306. package/dist/cli/chunks/shared-rvf-adapter-SQQ27EEI.js +0 -2
  307. package/dist/cli/chunks/sqlite-persistence-XH47B3BG.js +0 -2
  308. package/dist/cli/chunks/unified-memory-NHJHPLIC.js +0 -2
  309. package/dist/cli/chunks/unified-memory-hnsw-IMMCI2XK.js +0 -2
  310. package/dist/cli/chunks/unified-persistence-JS6CEV35.js +0 -2
  311. package/dist/cli/chunks/visual-security-XLO5JBVP.js +0 -2
  312. package/dist/cli/chunks/witness-chain-PPWPHYTY.js +0 -2
  313. package/dist/cli/chunks/workflow-orchestrator-H4DKRHVP.js +0 -2
@@ -13,7 +13,74 @@
13
13
  * - No new runtime deps: shells out to `npm install -g vibium` via child_process.
14
14
  */
15
15
  import { spawnSync as realSpawnSync } from 'node:child_process';
16
+ import * as os from 'node:os';
17
+ import * as fs from 'node:fs';
16
18
  import { toErrorMessage } from '../shared/error-utils.js';
19
+ /**
20
+ * Default Vibium npm spec. Major-line pin via caret (`^26.3.18`) — npm
21
+ * semver will accept any 26.x.y >= 26.3.18 but reject 27.0.0+. The intent
22
+ * is to auto-receive security patches and additive minor features while
23
+ * blocking breaking-change major bumps, which is where Vibium's CLI
24
+ * contract (`go`, `--headless`, `viewport`, exit codes) can change.
25
+ *
26
+ * This is NOT a minor-line pin. If a future Vibium 26.y release changes
27
+ * the primitives' expectations, the CI smoke gate (scripts/smoke-test.sh)
28
+ * is the belt-and-suspenders check.
29
+ *
30
+ * Bump procedure: update this constant (e.g. to ^27.0.0 at a major), run
31
+ * scripts/smoke-test.sh against the new version, then land the bump.
32
+ */
33
+ export const DEFAULT_VIBIUM_SPEC = 'vibium@^26.3.18';
34
+ const defaultPlatformProbe = {
35
+ platform: () => os.platform(),
36
+ arch: () => os.arch(),
37
+ existsSync: (p) => fs.existsSync(p),
38
+ };
39
+ /**
40
+ * Candidate paths for a system chromium binary on Linux distributions that
41
+ * package Chromium (Debian, Ubuntu, Fedora, Arch). Order matters: we return
42
+ * the first match, so list the most common locations first.
43
+ */
44
+ const LINUX_SYSTEM_CHROMIUM_PATHS = [
45
+ '/usr/bin/chromium',
46
+ '/usr/bin/chromium-browser',
47
+ '/usr/bin/google-chrome',
48
+ '/usr/bin/google-chrome-stable',
49
+ '/snap/bin/chromium',
50
+ ];
51
+ /**
52
+ * Build a platform hint for hosts where Vibium's first-run Chrome auto-
53
+ * download is known to fail. Today that's just Linux aarch64 at the
54
+ * pinned Vibium version (v26.3.x). Returns `undefined` when no hint
55
+ * applies, so callers can cheaply check for presence.
56
+ *
57
+ * Intentionally conservative: we don't mutate the user's env or create
58
+ * symlinks — we surface a diagnostic with an exact `VIBIUM_BROWSER_PATH`
59
+ * export the user can add. Silent modifications to system state are out
60
+ * of scope for an installer that runs during `aqe init`.
61
+ */
62
+ export function diagnosePlatform(probe = defaultPlatformProbe) {
63
+ if (probe.platform() !== 'linux')
64
+ return undefined;
65
+ if (probe.arch() !== 'arm64')
66
+ return undefined;
67
+ const browserPath = LINUX_SYSTEM_CHROMIUM_PATHS.find((p) => probe.existsSync(p));
68
+ if (browserPath) {
69
+ return {
70
+ code: 'linux-arm64-system-chromium-found',
71
+ browserPath,
72
+ message: `Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64. ` +
73
+ `Found system browser at ${browserPath}. Export VIBIUM_BROWSER_PATH=${browserPath} before running vibium.`,
74
+ };
75
+ }
76
+ return {
77
+ code: 'linux-arm64-no-system-chromium',
78
+ message: `Linux aarch64 detected. Vibium v26.3.x does not auto-download Chrome for Testing on ARM64, and no system ` +
79
+ `chromium was found on PATH (checked: ${LINUX_SYSTEM_CHROMIUM_PATHS.join(', ')}). ` +
80
+ `Install via \`apt-get install chromium\` (or your distro's equivalent), then export ` +
81
+ `VIBIUM_BROWSER_PATH=/usr/bin/chromium before running vibium.`,
82
+ };
83
+ }
17
84
  function tryRun(spawner, bin, args, timeoutMs) {
18
85
  return spawner(bin, args, {
19
86
  encoding: 'utf8',
@@ -51,17 +118,20 @@ export function detectVibium(spawner = defaultSpawner, timeoutMs = 5_000) {
51
118
  * assets phase can log/summarize — never throws for expected failures.
52
119
  */
53
120
  export function installBrowserEngine(options = {}) {
54
- const packageSpec = options.packageSpec || 'vibium';
121
+ const packageSpec = options.packageSpec || DEFAULT_VIBIUM_SPEC;
55
122
  if (options.skip) {
56
123
  return { status: 'skipped', packageSpec, message: 'install skipped by options' };
57
124
  }
58
125
  const spawner = options.spawner || defaultSpawner;
126
+ const platformProbe = options.platformProbe || defaultPlatformProbe;
127
+ const platformHint = diagnosePlatform(platformProbe);
59
128
  const alreadyInstalled = detectVibium(spawner);
60
129
  if (alreadyInstalled) {
61
130
  return {
62
131
  status: 'already-installed',
63
132
  version: alreadyInstalled,
64
133
  packageSpec,
134
+ platformHint,
65
135
  };
66
136
  }
67
137
  const npmBin = options.npmBin || 'npm';
@@ -71,7 +141,7 @@ export function installBrowserEngine(options = {}) {
71
141
  return {
72
142
  status: 'npm-unavailable',
73
143
  packageSpec,
74
- message: 'npm is not available on PATH. Install Node.js + npm, then run `npm install -g vibium`.',
144
+ message: `npm is not available on PATH. Install Node.js + npm, then run \`npm install -g ${packageSpec}\`.`,
75
145
  };
76
146
  }
77
147
  const timeoutMs = options.timeoutMs || 180_000;
@@ -87,6 +157,6 @@ export function installBrowserEngine(options = {}) {
87
157
  };
88
158
  }
89
159
  const version = detectVibium(spawner) || 'unknown';
90
- return { status: 'installed', version, packageSpec };
160
+ return { status: 'installed', version, packageSpec, platformHint };
91
161
  }
92
162
  //# sourceMappingURL=browser-engine-installer.js.map
@@ -8,7 +8,7 @@ import { BasePhase, } from './phase-interface.js';
8
8
  import { createSkillsInstaller } from '../skills-installer.js';
9
9
  import { createAgentsInstaller } from '../agents-installer.js';
10
10
  import { createN8nInstaller } from '../n8n-installer.js';
11
- import { installBrowserEngine } from '../browser-engine-installer.js';
11
+ import { installBrowserEngine, DEFAULT_VIBIUM_SPEC, } from '../browser-engine-installer.js';
12
12
  import { initializeOverlays } from '../../routing/qe-agent-registry.js';
13
13
  /**
14
14
  * Assets phase - installs skills and agents
@@ -123,6 +123,13 @@ export class AssetsPhase extends BasePhase {
123
123
  // 'already-installed' handled by the pre-flight branch above
124
124
  }
125
125
  }
126
+ // ADR-091 GAP-05: surface platform diagnostics when the host is one
127
+ // where Vibium's first-run Chrome auto-download is known to fail.
128
+ // Today that's just Linux aarch64 at v26.3.x; printed for both
129
+ // `installed` and `already-installed` results. Non-fatal.
130
+ if (browserEngine?.platformHint) {
131
+ context.services.warn(` Browser engine platform hint: ${browserEngine.platformHint.message}`);
132
+ }
126
133
  }
127
134
  catch (error) {
128
135
  // M9 (devil's-advocate finding): the previous catch re-emitted the
@@ -136,7 +143,7 @@ export class AssetsPhase extends BasePhase {
136
143
  }
137
144
  }
138
145
  else {
139
- browserEngine = { status: 'skipped', packageSpec: 'vibium', message: 'minimal mode' };
146
+ browserEngine = { status: 'skipped', packageSpec: DEFAULT_VIBIUM_SPEC, message: 'minimal mode' };
140
147
  }
141
148
  // Install n8n platform (optional)
142
149
  if (options.withN8n) {
@@ -0,0 +1,93 @@
1
+ /**
2
+ * Brain Export Diff
3
+ *
4
+ * Compares two brain exports (JSONL directory or RVF file) and returns a
5
+ * structured diff.
6
+ *
7
+ * Two levels of comparison:
8
+ * - Manifest-level (always available): version, checksum, per-table record
9
+ * counts, exported_at, domain list delta.
10
+ * - Record-level (JSONL exports only): for each table with a PK, the set of
11
+ * added / removed / changed record IDs. For append-only tables only counts
12
+ * are reported.
13
+ *
14
+ * For RVF exports, record-level diff is not supported by this module (the
15
+ * kernel is opaque without @ruvector/rvf-node). Export as JSONL for full diff.
16
+ */
17
+ import { type TableExportConfig } from './brain-shared.js';
18
+ export type ExportFormat = 'rvf' | 'jsonl';
19
+ export interface ManifestSummary {
20
+ readonly format: ExportFormat;
21
+ readonly version: string;
22
+ readonly exportedAt: string;
23
+ readonly sourceDb: string;
24
+ readonly checksum: string;
25
+ readonly totalRecords: number;
26
+ readonly domains: readonly string[];
27
+ readonly tableRecordCounts: Record<string, number>;
28
+ }
29
+ export interface TableDiff {
30
+ readonly tableName: string;
31
+ readonly countA: number;
32
+ readonly countB: number;
33
+ readonly delta: number;
34
+ /** Only populated for JSONL↔JSONL record-level diffs on PK tables. */
35
+ readonly added?: readonly string[];
36
+ readonly removed?: readonly string[];
37
+ readonly changed?: readonly string[];
38
+ }
39
+ export interface BrainDiffResult {
40
+ readonly pathA: string;
41
+ readonly pathB: string;
42
+ readonly formatA: ExportFormat;
43
+ readonly formatB: ExportFormat;
44
+ readonly manifestA: ManifestSummary;
45
+ readonly manifestB: ManifestSummary;
46
+ readonly checksumMatch: boolean;
47
+ readonly versionMatch: boolean;
48
+ readonly identical: boolean;
49
+ readonly recordLevel: boolean;
50
+ readonly tableDiffs: readonly TableDiff[];
51
+ readonly domainsOnlyInA: readonly string[];
52
+ readonly domainsOnlyInB: readonly string[];
53
+ }
54
+ export interface BrainDiffOptions {
55
+ /** Restrict comparison to a single table (by table name). */
56
+ readonly tableFilter?: string;
57
+ /** Cap on the number of IDs retained per added/removed/changed list. */
58
+ readonly maxIdsPerBucket?: number;
59
+ }
60
+ /**
61
+ * Compute the diff between two brain exports.
62
+ *
63
+ * Both paths may be JSONL directories or `.rvf` files. Record-level diff is
64
+ * only available when both sides are JSONL.
65
+ */
66
+ export declare function diffBrains(pathA: string, pathB: string, options?: BrainDiffOptions): BrainDiffResult;
67
+ declare function pkFor(config: TableExportConfig): string;
68
+ /**
69
+ * Read a JSONL file and build a Map<identity, contentHash>.
70
+ *
71
+ * For PK tables the identity is the PK column value. For append-only tables
72
+ * the identity is a concatenation of the dedup columns (collisions are
73
+ * treated as "same record").
74
+ */
75
+ declare function buildIdentityMap(filePath: string, config: TableExportConfig): Map<string, string>;
76
+ declare function identityOf(row: Record<string, unknown>, config: TableExportConfig): string | undefined;
77
+ declare function stableStringify(obj: Record<string, unknown>): string;
78
+ export interface DiffSummary {
79
+ readonly tablesChanged: number;
80
+ readonly totalAdded: number;
81
+ readonly totalRemoved: number;
82
+ readonly totalChanged: number;
83
+ readonly recordCountDelta: number;
84
+ }
85
+ export declare function summarizeDiff(result: BrainDiffResult): DiffSummary;
86
+ export declare const __test__: {
87
+ stableStringify: typeof stableStringify;
88
+ identityOf: typeof identityOf;
89
+ buildIdentityMap: typeof buildIdentityMap;
90
+ pkFor: typeof pkFor;
91
+ };
92
+ export {};
93
+ //# sourceMappingURL=brain-diff.d.ts.map
@@ -0,0 +1,281 @@
1
+ /**
2
+ * Brain Export Diff
3
+ *
4
+ * Compares two brain exports (JSONL directory or RVF file) and returns a
5
+ * structured diff.
6
+ *
7
+ * Two levels of comparison:
8
+ * - Manifest-level (always available): version, checksum, per-table record
9
+ * counts, exported_at, domain list delta.
10
+ * - Record-level (JSONL exports only): for each table with a PK, the set of
11
+ * added / removed / changed record IDs. For append-only tables only counts
12
+ * are reported.
13
+ *
14
+ * For RVF exports, record-level diff is not supported by this module (the
15
+ * kernel is opaque without @ruvector/rvf-node). Export as JSONL for full diff.
16
+ */
17
+ import { existsSync, readFileSync, statSync } from 'fs';
18
+ import { join, resolve } from 'path';
19
+ import { safeJsonParse } from '../../shared/safe-json.js';
20
+ import { brainInfoFromRvf } from './brain-rvf-exporter.js';
21
+ import { readJsonl, sha256, TABLE_CONFIGS, PK_COLUMNS, } from './brain-shared.js';
22
+ // ============================================================================
23
+ // Public API
24
+ // ============================================================================
25
+ /**
26
+ * Compute the diff between two brain exports.
27
+ *
28
+ * Both paths may be JSONL directories or `.rvf` files. Record-level diff is
29
+ * only available when both sides are JSONL.
30
+ */
31
+ export function diffBrains(pathA, pathB, options = {}) {
32
+ const resolvedA = resolve(pathA);
33
+ const resolvedB = resolve(pathB);
34
+ const formatA = detectFormat(resolvedA);
35
+ const formatB = detectFormat(resolvedB);
36
+ const manifestA = readManifestSummary(resolvedA, formatA);
37
+ const manifestB = readManifestSummary(resolvedB, formatB);
38
+ const recordLevel = formatA === 'jsonl' && formatB === 'jsonl';
39
+ const tableDiffs = computeTableDiffs({
40
+ pathA: resolvedA,
41
+ pathB: resolvedB,
42
+ manifestA,
43
+ manifestB,
44
+ recordLevel,
45
+ tableFilter: options.tableFilter,
46
+ maxIdsPerBucket: options.maxIdsPerBucket ?? 500,
47
+ });
48
+ const domainsA = new Set(manifestA.domains);
49
+ const domainsB = new Set(manifestB.domains);
50
+ const domainsOnlyInA = manifestA.domains.filter((d) => !domainsB.has(d));
51
+ const domainsOnlyInB = manifestB.domains.filter((d) => !domainsA.has(d));
52
+ const checksumMatch = manifestA.checksum === manifestB.checksum;
53
+ const versionMatch = manifestA.version === manifestB.version;
54
+ const identical = checksumMatch &&
55
+ versionMatch &&
56
+ tableDiffs.every((t) => t.delta === 0 &&
57
+ (t.added?.length ?? 0) === 0 &&
58
+ (t.removed?.length ?? 0) === 0 &&
59
+ (t.changed?.length ?? 0) === 0);
60
+ return {
61
+ pathA: resolvedA,
62
+ pathB: resolvedB,
63
+ formatA,
64
+ formatB,
65
+ manifestA,
66
+ manifestB,
67
+ checksumMatch,
68
+ versionMatch,
69
+ identical,
70
+ recordLevel,
71
+ tableDiffs,
72
+ domainsOnlyInA,
73
+ domainsOnlyInB,
74
+ };
75
+ }
76
+ // ============================================================================
77
+ // Format detection + manifest reading
78
+ // ============================================================================
79
+ function detectFormat(path) {
80
+ if (!existsSync(path)) {
81
+ throw new Error(`Path not found: ${path}`);
82
+ }
83
+ if (path.endsWith('.rvf'))
84
+ return 'rvf';
85
+ const s = statSync(path);
86
+ if (s.isFile()) {
87
+ // Any single file that isn't .rvf is treated as an error — JSONL exports
88
+ // are directories.
89
+ throw new Error(`Unsupported brain export: ${path} (expected a .rvf file or a JSONL directory)`);
90
+ }
91
+ // Directory: assume JSONL
92
+ return 'jsonl';
93
+ }
94
+ function readManifestSummary(path, format) {
95
+ if (format === 'rvf') {
96
+ return readRvfManifestSummary(path);
97
+ }
98
+ return readJsonlManifestSummary(path);
99
+ }
100
+ function readJsonlManifestSummary(dir) {
101
+ const manifestPath = join(dir, 'manifest.json');
102
+ if (!existsSync(manifestPath)) {
103
+ throw new Error(`Manifest not found at ${manifestPath}`);
104
+ }
105
+ const raw = safeJsonParse(readFileSync(manifestPath, 'utf-8'));
106
+ return toManifestSummary(raw, 'jsonl');
107
+ }
108
+ function readRvfManifestSummary(rvfPath) {
109
+ // Delegate to the RVF exporter's info path so we honour its format handling.
110
+ const raw = brainInfoFromRvf(rvfPath);
111
+ return toManifestSummary(raw, 'rvf');
112
+ }
113
+ function toManifestSummary(raw, format) {
114
+ return {
115
+ format,
116
+ version: raw.version ?? 'unknown',
117
+ exportedAt: raw.exportedAt ?? 'unknown',
118
+ sourceDb: raw.sourceDb ?? 'unknown',
119
+ checksum: raw.checksum ?? '',
120
+ totalRecords: raw.stats?.totalRecords ?? 0,
121
+ domains: raw.domains ?? [],
122
+ tableRecordCounts: raw.tableRecordCounts ?? {},
123
+ };
124
+ }
125
+ function computeTableDiffs(input) {
126
+ const configs = input.tableFilter
127
+ ? TABLE_CONFIGS.filter((c) => c.tableName === input.tableFilter)
128
+ : TABLE_CONFIGS;
129
+ if (input.tableFilter && configs.length === 0) {
130
+ throw new Error(`Unknown table: ${input.tableFilter}`);
131
+ }
132
+ const diffs = [];
133
+ for (const config of configs) {
134
+ const countA = input.manifestA.tableRecordCounts[config.tableName] ?? 0;
135
+ const countB = input.manifestB.tableRecordCounts[config.tableName] ?? 0;
136
+ const delta = countB - countA;
137
+ let added;
138
+ let removed;
139
+ let changed;
140
+ if (input.recordLevel && hasIdentity(config)) {
141
+ const recordDiff = recordLevelDiff(join(input.pathA, config.fileName), join(input.pathB, config.fileName), config, input.maxIdsPerBucket);
142
+ added = recordDiff.added;
143
+ removed = recordDiff.removed;
144
+ changed = recordDiff.changed;
145
+ }
146
+ diffs.push({
147
+ tableName: config.tableName,
148
+ countA,
149
+ countB,
150
+ delta,
151
+ ...(added !== undefined ? { added } : {}),
152
+ ...(removed !== undefined ? { removed } : {}),
153
+ ...(changed !== undefined ? { changed } : {}),
154
+ });
155
+ }
156
+ return diffs;
157
+ }
158
+ function hasIdentity(_config) {
159
+ // PK tables always have identity; append-only tables can be deduped via
160
+ // their dedup columns, which is good enough to compute added/removed.
161
+ return true;
162
+ }
163
+ function pkFor(config) {
164
+ if (config.dedupColumns && config.dedupColumns.length > 0) {
165
+ // Composite identity — joined with a separator unlikely to occur in values.
166
+ return config.dedupColumns.join('');
167
+ }
168
+ return PK_COLUMNS[config.tableName] ?? 'id';
169
+ }
170
+ function recordLevelDiff(fileA, fileB, config, maxIdsPerBucket) {
171
+ const mapA = buildIdentityMap(fileA, config);
172
+ const mapB = buildIdentityMap(fileB, config);
173
+ const added = [];
174
+ const removed = [];
175
+ const changed = [];
176
+ // In A but not in B → removed.
177
+ for (const [id, hashA] of mapA) {
178
+ const hashB = mapB.get(id);
179
+ if (hashB === undefined) {
180
+ if (removed.length < maxIdsPerBucket)
181
+ removed.push(id);
182
+ }
183
+ else if (hashB !== hashA) {
184
+ // Append-only tables use dedup columns as identity, so if the identity
185
+ // matches the record IS the same — guard via dedup flag.
186
+ if (config.dedupColumns && config.dedupColumns.length > 0)
187
+ continue;
188
+ if (changed.length < maxIdsPerBucket)
189
+ changed.push(id);
190
+ }
191
+ }
192
+ // In B but not in A → added.
193
+ for (const id of mapB.keys()) {
194
+ if (!mapA.has(id)) {
195
+ if (added.length < maxIdsPerBucket)
196
+ added.push(id);
197
+ }
198
+ }
199
+ added.sort();
200
+ removed.sort();
201
+ changed.sort();
202
+ return { added, removed, changed };
203
+ }
204
+ /**
205
+ * Read a JSONL file and build a Map<identity, contentHash>.
206
+ *
207
+ * For PK tables the identity is the PK column value. For append-only tables
208
+ * the identity is a concatenation of the dedup columns (collisions are
209
+ * treated as "same record").
210
+ */
211
+ function buildIdentityMap(filePath, config) {
212
+ const map = new Map();
213
+ if (!existsSync(filePath))
214
+ return map;
215
+ const rows = readJsonl(filePath, safeJsonParse);
216
+ for (const row of rows) {
217
+ const id = identityOf(row, config);
218
+ if (id === undefined)
219
+ continue;
220
+ // Stable content hash: JSON-stringify with sorted keys.
221
+ const content = stableStringify(row);
222
+ map.set(id, sha256Hex(content));
223
+ }
224
+ return map;
225
+ }
226
+ function identityOf(row, config) {
227
+ if (config.dedupColumns && config.dedupColumns.length > 0) {
228
+ const parts = [];
229
+ for (const col of config.dedupColumns) {
230
+ const v = row[col];
231
+ if (v === undefined || v === null)
232
+ return undefined;
233
+ parts.push(String(v));
234
+ }
235
+ return parts.join('');
236
+ }
237
+ const pk = PK_COLUMNS[config.tableName] ?? 'id';
238
+ const v = row[pk];
239
+ if (v === undefined || v === null)
240
+ return undefined;
241
+ return String(v);
242
+ }
243
+ function stableStringify(obj) {
244
+ const keys = Object.keys(obj).sort();
245
+ const ordered = {};
246
+ for (const k of keys)
247
+ ordered[k] = obj[k];
248
+ return JSON.stringify(ordered);
249
+ }
250
+ function sha256Hex(s) {
251
+ // sha256() from brain-shared operates on utf-8 strings; both paths yield the
252
+ // same hash for the same input. Kept as a thin wrapper for readability.
253
+ return sha256(s);
254
+ }
255
+ export function summarizeDiff(result) {
256
+ let tablesChanged = 0;
257
+ let totalAdded = 0;
258
+ let totalRemoved = 0;
259
+ let totalChanged = 0;
260
+ for (const t of result.tableDiffs) {
261
+ const hasChange = t.delta !== 0 ||
262
+ (t.added && t.added.length > 0) ||
263
+ (t.removed && t.removed.length > 0) ||
264
+ (t.changed && t.changed.length > 0);
265
+ if (hasChange)
266
+ tablesChanged++;
267
+ totalAdded += t.added?.length ?? 0;
268
+ totalRemoved += t.removed?.length ?? 0;
269
+ totalChanged += t.changed?.length ?? 0;
270
+ }
271
+ return {
272
+ tablesChanged,
273
+ totalAdded,
274
+ totalRemoved,
275
+ totalChanged,
276
+ recordCountDelta: result.manifestB.totalRecords - result.manifestA.totalRecords,
277
+ };
278
+ }
279
+ // Export internal helpers for test access without widening the public API.
280
+ export const __test__ = { stableStringify, identityOf, buildIdentityMap, pkFor };
281
+ //# sourceMappingURL=brain-diff.js.map
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Brain Export Search
3
+ *
4
+ * Offline, read-only filtered search over a JSONL brain export directory.
5
+ * Useful for exploring what a snapshot contains without importing it.
6
+ *
7
+ * Defaults to searching qe_patterns but can target any of the 25 exported
8
+ * tables via the `table` option. Supports filters by domain, pattern_type,
9
+ * date range, and a substring query that matches `name` + `description`.
10
+ *
11
+ * RVF exports are not supported directly by this module — callers should use
12
+ * `aqe brain export --format jsonl` for searchable snapshots.
13
+ */
14
+ export interface BrainSearchOptions {
15
+ /** Table to search. Defaults to 'qe_patterns'. */
16
+ readonly table?: string;
17
+ /** Restrict to these domains (matched against the table's domain column). */
18
+ readonly domains?: readonly string[];
19
+ /** Restrict to rows with this exact pattern_type (qe_patterns only). */
20
+ readonly patternType?: string;
21
+ /** ISO timestamp — only rows at or after this are included. */
22
+ readonly since?: string;
23
+ /** ISO timestamp — only rows at or before this are included. */
24
+ readonly until?: string;
25
+ /** Case-insensitive substring matched against name + description. */
26
+ readonly query?: string;
27
+ /** Max rows to return. Defaults to 20. */
28
+ readonly limit?: number;
29
+ }
30
+ export interface BrainSearchHit {
31
+ /** Primary-key identity string (best effort per table). */
32
+ readonly id: string;
33
+ /** Minimal surface shown in default CLI output. */
34
+ readonly display: {
35
+ readonly name?: string;
36
+ readonly description?: string;
37
+ readonly domain?: string;
38
+ readonly patternType?: string;
39
+ readonly confidence?: number;
40
+ readonly updatedAt?: string;
41
+ };
42
+ /** Full raw row for callers that want more (used by --json). */
43
+ readonly row: Record<string, unknown>;
44
+ }
45
+ export interface BrainSearchResult {
46
+ readonly table: string;
47
+ readonly inputPath: string;
48
+ readonly totalScanned: number;
49
+ readonly totalMatched: number;
50
+ readonly limit: number;
51
+ readonly hits: readonly BrainSearchHit[];
52
+ readonly truncated: boolean;
53
+ }
54
+ /**
55
+ * Search a brain export directory for rows matching the given filters.
56
+ *
57
+ * Throws if the path isn't a JSONL export directory, if the requested table
58
+ * isn't known, or if the JSONL file for that table is missing.
59
+ */
60
+ export declare function searchBrain(inputPath: string, options?: BrainSearchOptions): BrainSearchResult;
61
+ interface FilterContext {
62
+ readonly domainColumn?: string;
63
+ readonly domains?: Set<string>;
64
+ readonly patternType?: string;
65
+ readonly since?: string;
66
+ readonly until?: string;
67
+ readonly queryLower?: string;
68
+ }
69
+ declare function rowMatches(row: Record<string, unknown>, ctx: FilterContext): boolean;
70
+ declare function pickTimestamp(row: Record<string, unknown>): string | undefined;
71
+ declare function toHit(row: Record<string, unknown>, tableName: string, domainColumn: string | undefined): BrainSearchHit;
72
+ export declare const __test__: {
73
+ pickTimestamp: typeof pickTimestamp;
74
+ rowMatches: typeof rowMatches;
75
+ toHit: typeof toHit;
76
+ };
77
+ export {};
78
+ //# sourceMappingURL=brain-search.d.ts.map