agentic-qe 3.14.0 → 3.14.2

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 (430) hide show
  1. package/.claude/helpers/brain-checkpoint.cjs +2 -1
  2. package/.claude/helpers/validate-v3-config.sh +6 -5
  3. package/.claude/hooks/aqe-hook.cjs +14 -14
  4. package/.claude/skills/qe-browser/evals/qe-browser.yaml +30 -41
  5. package/.claude/skills/qe-browser/fixtures/serve-skills.js +37 -0
  6. package/.claude/skills/qe-browser/scripts/lib/vibium.js +1 -1
  7. package/.claude/skills/qe-browser/scripts/smoke-test.sh +56 -25
  8. package/.claude/skills/qe-browser/scripts/visual-diff.js +24 -15
  9. package/.claude/skills/skills-manifest.json +1 -1
  10. package/CHANGELOG.md +114 -0
  11. package/assets/skills/qe-browser/evals/qe-browser.yaml +30 -41
  12. package/assets/skills/qe-browser/fixtures/serve-skills.js +37 -0
  13. package/assets/skills/qe-browser/scripts/lib/vibium.js +1 -1
  14. package/assets/skills/qe-browser/scripts/smoke-test.sh +56 -25
  15. package/assets/skills/qe-browser/scripts/visual-diff.js +24 -15
  16. package/assets/skills/skills-manifest.json +1 -1
  17. package/dist/cli/bundle.js +7 -7
  18. package/dist/cli/chunks/adapter-OJF6LAJV.js +2 -0
  19. package/dist/cli/chunks/{agent-booster-wasm-JZO6VUW4.js → agent-booster-wasm-SD5N32MX.js} +2 -2
  20. package/dist/cli/chunks/{agent-handler-534KFGEJ.js → agent-handler-OZRSJM7F.js} +2 -2
  21. package/dist/cli/chunks/{agent-memory-branch-B7KWLWY4.js → agent-memory-branch-NYTRANRN.js} +2 -2
  22. package/dist/cli/chunks/aqe-learning-engine-FGT474XB.js +2 -0
  23. package/dist/cli/chunks/{arena-OW5MELJX.js → arena-EX3SC2DP.js} +4 -4
  24. package/dist/cli/chunks/{arena-7CCD3S3I.js → arena-FOTVSRK4.js} +2 -2
  25. package/dist/cli/chunks/{audit-BHVKN4E2.js → audit-Q5GHSUQY.js} +3 -3
  26. package/dist/cli/chunks/base-HH765JFV.js +2 -0
  27. package/dist/cli/chunks/{better-sqlite3-P5FA6WFK.js → better-sqlite3-S7M5R2HS.js} +2 -2
  28. package/dist/cli/chunks/{brain-handler-WNW5LOV7.js → brain-handler-5FSA46R5.js} +3 -3
  29. package/dist/cli/chunks/{branch-enumerator-TVZ2ODKH.js → branch-enumerator-RWAXTGEU.js} +2 -2
  30. package/dist/cli/chunks/{browser-TCEB2W2F.js → browser-IGDESJGF.js} +2 -2
  31. package/dist/cli/chunks/browser-workflow-NPM4FUPI.js +2 -0
  32. package/dist/cli/chunks/{chunk-Q73RRTLE.js → chunk-2EHFEMRU.js} +2 -2
  33. package/dist/cli/chunks/{chunk-ZBOWR4XT.js → chunk-2H5YJ5ZK.js} +2 -2
  34. package/dist/cli/chunks/chunk-2LKAMMMI.js +2 -0
  35. package/dist/cli/chunks/{chunk-A2WZEMWT.js → chunk-2TG24LYQ.js} +1 -1
  36. package/dist/cli/chunks/{chunk-3QT6S3A3.js → chunk-3C2K4YMS.js} +3 -3
  37. package/dist/cli/chunks/{chunk-VESOYP6A.js → chunk-3DFFFXXO.js} +2 -2
  38. package/dist/cli/chunks/{chunk-K6CGQR5R.js → chunk-3WV4H33V.js} +1 -1
  39. package/dist/cli/chunks/{chunk-IL4AEB3J.js → chunk-42WUDDUU.js} +2 -2
  40. package/dist/cli/chunks/chunk-4AKGBUYD.js +4 -0
  41. package/dist/cli/chunks/{chunk-4FEJEVG7.js → chunk-4K27ESCA.js} +1 -1
  42. package/dist/cli/chunks/{chunk-TGOGCA74.js → chunk-4M6A3PVJ.js} +2 -2
  43. package/dist/cli/chunks/{chunk-RGVD6ZUX.js → chunk-4MH22236.js} +1 -1
  44. package/dist/cli/chunks/{chunk-6DPAMYLU.js → chunk-4N44UJGI.js} +2 -2
  45. package/dist/cli/chunks/{chunk-DJITEQYS.js → chunk-4PH7O5ZH.js} +2 -2
  46. package/dist/cli/chunks/{chunk-M3HUZD2I.js → chunk-4RT7I7PI.js} +1 -1
  47. package/dist/cli/chunks/chunk-4UCMTYFQ.js +65 -0
  48. package/dist/cli/chunks/{chunk-ZI3UO7QR.js → chunk-4ZUZDFAA.js} +2 -2
  49. package/dist/cli/chunks/{chunk-QSPRQPEL.js → chunk-57TNBR2P.js} +2 -2
  50. package/dist/cli/chunks/{chunk-ZCVJCCQQ.js → chunk-5EHLGOWW.js} +2 -2
  51. package/dist/cli/chunks/{chunk-ZAAYOENS.js → chunk-5WJUNRTY.js} +2 -2
  52. package/dist/cli/chunks/{chunk-QZPFUFZG.js → chunk-67A6PEZM.js} +2 -2
  53. package/dist/cli/chunks/{chunk-7BOPFN3Y.js → chunk-6EHN7Q2Q.js} +2 -2
  54. package/dist/cli/chunks/{chunk-2HYVOX6N.js → chunk-6F4WHN7D.js} +1 -1
  55. package/dist/cli/chunks/{chunk-GVEJP5T7.js → chunk-6LMLN5R2.js} +2 -2
  56. package/dist/cli/chunks/{chunk-QKQZ4IJF.js → chunk-6SZKLWZT.js} +5 -5
  57. package/dist/cli/chunks/{chunk-PEW6FZ47.js → chunk-6VKJAMZY.js} +1 -1
  58. package/dist/cli/chunks/{chunk-VYENTZ45.js → chunk-7AFBNU6K.js} +2 -2
  59. package/dist/cli/chunks/{chunk-6IJMD2ZL.js → chunk-7FWP7CZY.js} +3 -3
  60. package/dist/cli/chunks/{chunk-IE5LC7MB.js → chunk-7SK6IMGZ.js} +2 -2
  61. package/dist/cli/chunks/{chunk-3EM2MK3Z.js → chunk-A7N3YUDJ.js} +2 -2
  62. package/dist/cli/chunks/{chunk-J3XSHJGK.js → chunk-ADK7DF3G.js} +2 -2
  63. package/dist/cli/chunks/{chunk-EJ6IP7DE.js → chunk-ARMZYHYL.js} +2 -2
  64. package/dist/cli/chunks/{chunk-BZ4QVFP2.js → chunk-BWRHOIYC.js} +2 -2
  65. package/dist/cli/chunks/{chunk-A7SKM6JL.js → chunk-C7AXRI7E.js} +1 -1
  66. package/dist/cli/chunks/{chunk-4XTHRAUV.js → chunk-CG2MUD7U.js} +1 -1
  67. package/dist/cli/chunks/{chunk-HLNQDRHA.js → chunk-CH2TQCV5.js} +1 -1
  68. package/dist/cli/chunks/{chunk-JGROLJ33.js → chunk-CIESXO73.js} +1 -1
  69. package/dist/cli/chunks/{chunk-AR6SATU3.js → chunk-CJCT452S.js} +2 -2
  70. package/dist/cli/chunks/{chunk-UUJ5VQJM.js → chunk-CJHVOBJY.js} +1 -1
  71. package/dist/cli/chunks/{chunk-VOSISOFD.js → chunk-CTCQOYBS.js} +1 -1
  72. package/dist/cli/chunks/{chunk-XITTURP2.js → chunk-D4RCV4LY.js} +2 -2
  73. package/dist/cli/chunks/{chunk-5XGVSQS2.js → chunk-DRO5NJZA.js} +2 -2
  74. package/dist/cli/chunks/{chunk-QMMDN4WX.js → chunk-DVHWLAEO.js} +3 -3
  75. package/dist/cli/chunks/{chunk-5LEAGKX5.js → chunk-DW6ZMNMR.js} +2 -2
  76. package/dist/cli/chunks/{chunk-ZBKGX72B.js → chunk-E3Q7WNJD.js} +3 -3
  77. package/dist/cli/chunks/{chunk-5MZF4N4Q.js → chunk-EAJK25IS.js} +1 -1
  78. package/dist/cli/chunks/{chunk-3RYTAYR6.js → chunk-EH5OCHAJ.js} +1 -1
  79. package/dist/cli/chunks/{chunk-UI6WSPEK.js → chunk-F2KRT2II.js} +3 -3
  80. package/dist/cli/chunks/{chunk-NDPQ2WPU.js → chunk-FPHPP5TQ.js} +1 -1
  81. package/dist/cli/chunks/{chunk-WWWX76QB.js → chunk-FREF6Y4L.js} +2 -2
  82. package/dist/cli/chunks/{chunk-SROZXIMT.js → chunk-FVGTINVR.js} +54 -54
  83. package/dist/cli/chunks/{chunk-H3YDDKBW.js → chunk-G2CLZVYI.js} +3 -3
  84. package/dist/cli/chunks/{chunk-2O4DDPEA.js → chunk-G6AV2HGY.js} +3 -3
  85. package/dist/cli/chunks/{chunk-ENGKLFLY.js → chunk-GHQ5PUOV.js} +2 -2
  86. package/dist/cli/chunks/{chunk-NKWO2X3T.js → chunk-GHUPID5E.js} +1 -1
  87. package/dist/cli/chunks/{chunk-S5YVLPXU.js → chunk-GJAWEUIN.js} +2 -2
  88. package/dist/cli/chunks/{chunk-6IZQSLYZ.js → chunk-HBTC4L53.js} +2 -2
  89. package/dist/cli/chunks/{chunk-DDPJUAXQ.js → chunk-HSJ5FQCF.js} +2 -2
  90. package/dist/cli/chunks/{chunk-OONCRNFA.js → chunk-HZ6NEJMO.js} +2 -2
  91. package/dist/cli/chunks/{chunk-LCSVROU7.js → chunk-HZMLNM2T.js} +10 -10
  92. package/dist/cli/chunks/{chunk-JY4VZ6BN.js → chunk-ICKLBATY.js} +2 -2
  93. package/dist/cli/chunks/{chunk-JMKMDSXG.js → chunk-IUNMW454.js} +2 -2
  94. package/dist/cli/chunks/{chunk-XXFKN7LB.js → chunk-IVGVOGIZ.js} +1 -1
  95. package/dist/cli/chunks/{chunk-3GUO4ERR.js → chunk-IWFL6EFI.js} +2 -2
  96. package/dist/cli/chunks/{chunk-FRL3X2QA.js → chunk-JDXLCNKV.js} +2 -2
  97. package/dist/cli/chunks/{chunk-YW4RNZWT.js → chunk-JIUF6NV6.js} +2 -2
  98. package/dist/cli/chunks/{chunk-JAK5UUWH.js → chunk-JQ2ZD3WO.js} +2 -2
  99. package/dist/cli/chunks/{chunk-YEAC3DC6.js → chunk-K574FLVB.js} +2 -2
  100. package/dist/cli/chunks/{chunk-LZHTCUCO.js → chunk-KEEBUVGV.js} +2 -2
  101. package/dist/cli/chunks/{chunk-LKR7T3OZ.js → chunk-KFXZDQ5J.js} +1 -1
  102. package/dist/cli/chunks/{chunk-7OUMJCJT.js → chunk-KPFG4OIM.js} +1 -1
  103. package/dist/cli/chunks/{chunk-HQ7243G3.js → chunk-KZOBLLXW.js} +2 -2
  104. package/dist/cli/chunks/{chunk-R6WJF4D5.js → chunk-L2F7FVIU.js} +2 -2
  105. package/dist/cli/chunks/{chunk-VRRG66XB.js → chunk-LML5VTFK.js} +1 -1
  106. package/dist/cli/chunks/{chunk-JTWJR2KY.js → chunk-LWUJQGCS.js} +2 -2
  107. package/dist/cli/chunks/{chunk-BQCTO7UB.js → chunk-MH73D5TN.js} +2 -2
  108. package/dist/cli/chunks/{chunk-U4GZWPKM.js → chunk-MWQTACNA.js} +2 -2
  109. package/dist/cli/chunks/{chunk-CIZ6LSNV.js → chunk-N3RN4QTC.js} +2 -2
  110. package/dist/cli/chunks/{chunk-ZQSXG7FA.js → chunk-N5ZRUOMR.js} +2 -2
  111. package/dist/cli/chunks/{chunk-AFGT26NR.js → chunk-NAZVPZJS.js} +2 -2
  112. package/dist/cli/chunks/{chunk-FOHYBR3O.js → chunk-NG2UVPTW.js} +1 -1
  113. package/dist/cli/chunks/{chunk-2D7UBX5S.js → chunk-NHHWLJQF.js} +1 -1
  114. package/dist/cli/chunks/{chunk-JRKEBESE.js → chunk-NNOMDM4N.js} +2 -2
  115. package/dist/cli/chunks/{chunk-YKWMKRYB.js → chunk-NRR23SJV.js} +1 -1
  116. package/dist/cli/chunks/{chunk-WKNWRDA5.js → chunk-NWFIJNEB.js} +1 -1
  117. package/dist/cli/chunks/{chunk-4MK2G6TK.js → chunk-OBCKP3G4.js} +2 -2
  118. package/dist/cli/chunks/{chunk-YKZV7O65.js → chunk-OC2CKU7I.js} +2 -2
  119. package/dist/cli/chunks/{chunk-7RVAHJQZ.js → chunk-OX6T26CD.js} +3 -3
  120. package/dist/cli/chunks/chunk-P64DMQ2C.js +2 -0
  121. package/dist/cli/chunks/{chunk-RKUYVVGJ.js → chunk-PFXX5Q32.js} +2 -2
  122. package/dist/cli/chunks/chunk-PHHXHG2W.js +2 -0
  123. package/dist/cli/chunks/{chunk-N2YAUDAV.js → chunk-PMUBG2RU.js} +2 -2
  124. package/dist/cli/chunks/{chunk-WTHAVFIC.js → chunk-PVHO6KLB.js} +1 -1
  125. package/dist/cli/chunks/{chunk-MO7EITJK.js → chunk-PWEIDHT7.js} +2 -2
  126. package/dist/cli/chunks/{chunk-52DFCV57.js → chunk-PZKZY6PB.js} +2 -2
  127. package/dist/cli/chunks/{chunk-I3VHXA2W.js → chunk-Q335R4MR.js} +2 -2
  128. package/dist/cli/chunks/{chunk-ECTPFCON.js → chunk-Q3JHS3UD.js} +2 -2
  129. package/dist/cli/chunks/{chunk-HJIAVR6P.js → chunk-QFUX7ELG.js} +2 -2
  130. package/dist/cli/chunks/{chunk-L4C42WYI.js → chunk-QW4LN5NK.js} +2 -2
  131. package/dist/cli/chunks/{chunk-HQHLHSJO.js → chunk-QXTW7XCS.js} +2 -2
  132. package/dist/cli/chunks/{chunk-SSV6KSFT.js → chunk-R5RNOLHI.js} +1 -1
  133. package/dist/cli/chunks/{chunk-AVLA5PBJ.js → chunk-RCI64RIJ.js} +2 -2
  134. package/dist/cli/chunks/{chunk-T3BZAFLP.js → chunk-RFNEHNJV.js} +1 -1
  135. package/dist/cli/chunks/{chunk-IL6QRXRP.js → chunk-RGH3WGWD.js} +10 -10
  136. package/dist/cli/chunks/{chunk-E4NU4BJA.js → chunk-RHJVDCLV.js} +2 -2
  137. package/dist/cli/chunks/{chunk-KTSCZ7AW.js → chunk-RVCWSAXI.js} +2 -2
  138. package/dist/cli/chunks/{chunk-TQJE7DNL.js → chunk-RYJHREYS.js} +2 -2
  139. package/dist/cli/chunks/{chunk-HNKPLVYS.js → chunk-S4MR6RTE.js} +1 -1
  140. package/dist/cli/chunks/{chunk-6AYO3IR2.js → chunk-S7N4BKI3.js} +2 -2
  141. package/dist/cli/chunks/{chunk-2NO4H35K.js → chunk-SEHCX4NH.js} +1 -1
  142. package/dist/cli/chunks/{chunk-GKNDP5VK.js → chunk-T46LOLW3.js} +2 -2
  143. package/dist/cli/chunks/{chunk-VXU53F7Z.js → chunk-T4C56HBW.js} +2 -2
  144. package/dist/cli/chunks/{chunk-43GPSYAL.js → chunk-TENYL5TI.js} +2 -2
  145. package/dist/cli/chunks/{chunk-6AOZU3UN.js → chunk-TLPL3EQY.js} +2 -2
  146. package/dist/cli/chunks/{chunk-4ZVGSVHV.js → chunk-TYVQNYXX.js} +4 -4
  147. package/dist/cli/chunks/{chunk-NOPVFBQM.js → chunk-U2AY57XZ.js} +2 -2
  148. package/dist/cli/chunks/{chunk-IQLRA4FV.js → chunk-U54OOA24.js} +1 -1
  149. package/dist/cli/chunks/{chunk-IQ3JFHZN.js → chunk-UHTAI4ZB.js} +1 -1
  150. package/dist/cli/chunks/{chunk-KDIZQHG5.js → chunk-UIGEUEBT.js} +2 -2
  151. package/dist/cli/chunks/{chunk-5VDVYTO5.js → chunk-UYTWDS2R.js} +2 -2
  152. package/dist/cli/chunks/{chunk-ZNSMVQCG.js → chunk-VNAKBHJI.js} +2 -2
  153. package/dist/cli/chunks/{chunk-SUSMHSXT.js → chunk-VOYJJ3KA.js} +2 -2
  154. package/dist/cli/chunks/{chunk-QQCENKCX.js → chunk-VSYBMNIR.js} +1 -1
  155. package/dist/cli/chunks/{chunk-7RAB2BZY.js → chunk-W2FLULF4.js} +2 -2
  156. package/dist/cli/chunks/{chunk-NYARYONH.js → chunk-W4OQYLYO.js} +1 -1
  157. package/dist/cli/chunks/{chunk-DOWCOZDO.js → chunk-WBH4C4BG.js} +2 -2
  158. package/dist/cli/chunks/{chunk-OIYUSWHX.js → chunk-WBMRADQP.js} +1 -1
  159. package/dist/cli/chunks/{chunk-B3H4K7CY.js → chunk-WMW47QMR.js} +2 -2
  160. package/dist/cli/chunks/{chunk-VPVZHJSU.js → chunk-WVY22NHZ.js} +2 -2
  161. package/dist/cli/chunks/{chunk-6W42XWLL.js → chunk-WXMSRBQF.js} +2 -2
  162. package/dist/cli/chunks/{chunk-CIUOC5F3.js → chunk-XPLSLHRB.js} +1 -1
  163. package/dist/cli/chunks/{chunk-E722WNWC.js → chunk-YF5OP6CR.js} +2 -2
  164. package/dist/cli/chunks/{chunk-H76TV4UU.js → chunk-YN6W2XIT.js} +3 -3
  165. package/dist/cli/chunks/{chunk-FF43SRP6.js → chunk-ZCDXJ27H.js} +1 -1
  166. package/dist/cli/chunks/{chunk-TKYEP7OR.js → chunk-ZFGND4QK.js} +1 -1
  167. package/dist/cli/chunks/{chunk-O2MZZL54.js → chunk-ZWRQ5VAU.js} +2 -2
  168. package/dist/cli/chunks/{chunk-H6NFDOMK.js → chunk-ZYLSOBOR.js} +1 -1
  169. package/dist/cli/chunks/{ci-B432UH6N.js → ci-NTRH7PAW.js} +2 -2
  170. package/dist/cli/chunks/{ci-output-GTHH7WYG.js → ci-output-F57RSD35.js} +2 -2
  171. package/dist/cli/chunks/{circuit-breaker-VW75DLME.js → circuit-breaker-4WST3QSA.js} +2 -2
  172. package/dist/cli/chunks/{claude-flow-setup-RE3IVT7U.js → claude-flow-setup-KB4TKMYI.js} +2 -2
  173. package/dist/cli/chunks/client-GPZEC54E.js +2 -0
  174. package/dist/cli/chunks/{cline-installer-NUBZZ55N.js → cline-installer-W2ZHQ6WM.js} +2 -2
  175. package/dist/cli/chunks/{code-K6JCWKNW.js → code-TF2AVR5D.js} +2 -2
  176. package/dist/cli/chunks/{code-index-extractor-I4ILB5JN.js → code-index-extractor-RMDRUVQJ.js} +2 -2
  177. package/dist/cli/chunks/codex-installer-VSTRHJHV.js +14 -0
  178. package/dist/cli/chunks/{completions-V3KJVJF4.js → completions-3Q37QVFR.js} +2 -2
  179. package/dist/cli/chunks/{complexity-analyzer-HRG7OOY3.js → complexity-analyzer-3FNFLACD.js} +2 -2
  180. package/dist/cli/chunks/{continuedev-installer-CNTDONWG.js → continuedev-installer-VTEXM455.js} +2 -2
  181. package/dist/cli/chunks/{copilot-installer-XPWWIWYA.js → copilot-installer-AGY7DQUS.js} +2 -2
  182. package/dist/cli/chunks/core-handlers-YMGHYIBR.js +2 -0
  183. package/dist/cli/chunks/{cost-tracker-MFNLQ56K.js → cost-tracker-LTZAQBX7.js} +2 -2
  184. package/dist/cli/chunks/{coverage-KOIK654V.js → coverage-TT64IOS4.js} +3 -3
  185. package/dist/cli/chunks/cross-domain-router-ECBNTGYJ.js +2 -0
  186. package/dist/cli/chunks/{cursor-installer-S5MKLRQQ.js → cursor-installer-OVOJIOHN.js} +2 -2
  187. package/dist/cli/chunks/{daemon-DUS6JYW6.js → daemon-DMFZMXKA.js} +8 -8
  188. package/dist/cli/chunks/{daemon-Z7VPGWHY.js → daemon-XCULEHWY.js} +4 -4
  189. package/dist/cli/chunks/{dag-attention-scheduler-7CQ3ARNI.js → dag-attention-scheduler-WW2RX4B5.js} +2 -2
  190. package/dist/cli/chunks/{detect-WORBCAYF.js → detect-QNWIM232.js} +2 -2
  191. package/dist/cli/chunks/{dist-node-KRNI6OYW.js → dist-node-6GQIY3CG.js} +2 -2
  192. package/dist/cli/chunks/{domain-handler-KRUR2VQG.js → domain-handler-6RJPDELX.js} +2 -2
  193. package/dist/cli/chunks/{domain-transfer-VEOVLV54.js → domain-transfer-WK524LBS.js} +2 -2
  194. package/dist/cli/chunks/dream-EHGKCFWH.js +2 -0
  195. package/dist/cli/chunks/{embed-and-insert-pattern-QU3NQVA5.js → embed-and-insert-pattern-SO6GWJW7.js} +2 -2
  196. package/dist/cli/chunks/{eval-AYQ7BSUP.js → eval-GL544IPO.js} +2 -2
  197. package/dist/cli/chunks/{experience-capture-middleware-AWQBL6LT.js → experience-capture-middleware-BCCJ35OX.js} +3 -3
  198. package/dist/cli/chunks/{fast-paths-V5EL4BYJ.js → fast-paths-CATDDBEU.js} +2 -2
  199. package/dist/cli/chunks/{feature-flags-P34BPRWU.js → feature-flags-BUXNAORY.js} +2 -2
  200. package/dist/cli/chunks/{feature-flags-BXX7BP22.js → feature-flags-KNNWWP5G.js} +2 -2
  201. package/dist/cli/chunks/{file-discovery-MS6BKQ2U.js → file-discovery-S4HF3O7D.js} +2 -2
  202. package/dist/cli/chunks/{fleet-7WVVPA4W.js → fleet-DQVQQONW.js} +3 -3
  203. package/dist/cli/chunks/{gnn-wrapper-7WQ3LEPG.js → gnn-wrapper-G7ABZUG7.js} +2 -2
  204. package/dist/cli/chunks/{heartbeat-handler-P7QD3BZH.js → heartbeat-handler-UFMELIWT.js} +4 -4
  205. package/dist/cli/chunks/heartbeat-scheduler-UFEL2CBW.js +2 -0
  206. package/dist/cli/chunks/hnsw-adapter-BLSD45CX.js +2 -0
  207. package/dist/cli/chunks/hnsw-index-A3RZODEN.js +2 -0
  208. package/dist/cli/chunks/{hnsw-legacy-bridge-Y3GAR3UP.js → hnsw-legacy-bridge-YIILSRXI.js} +2 -2
  209. package/dist/cli/chunks/{hnswlib-node-5QUXZQWQ.js → hnswlib-node-TSVRMXDH.js} +2 -2
  210. package/dist/cli/chunks/{hooks-2D64KPRY.js → hooks-OHQPNK74.js} +10 -10
  211. package/dist/cli/chunks/{hypergraph-engine-5INXEZDP.js → hypergraph-engine-LY7PJDSL.js} +2 -2
  212. package/dist/cli/chunks/{hypergraph-handler-YJJJ3ESZ.js → hypergraph-handler-YGDYZO6H.js} +3 -3
  213. package/dist/cli/chunks/impact-analyzer-OXHD3FOH.js +2 -0
  214. package/dist/cli/chunks/{init-handler-QSFYJN5Q.js → init-handler-MTK65LI3.js} +9 -8
  215. package/dist/cli/chunks/init-wizard-PKZL7QBU.js +2 -0
  216. package/dist/cli/chunks/kernel-XWPM72UJ.js +2 -0
  217. package/dist/cli/chunks/{kilocode-installer-3N3QGTJU.js → kilocode-installer-3IICU4RS.js} +2 -2
  218. package/dist/cli/chunks/{kiro-installer-GIWVTFZQ.js → kiro-installer-MXOVQYQA.js} +2 -2
  219. package/dist/cli/chunks/knowledge-graph-FRKR5XWI.js +2 -0
  220. package/dist/cli/chunks/{learning-SGO2DQ5Q.js → learning-EV5LSOOM.js} +3 -3
  221. package/dist/cli/chunks/{llm-router-HBBULO65.js → llm-router-7LYDJUOT.js} +4 -4
  222. package/dist/cli/chunks/llm-router-service-R7A5HHDM.js +2 -0
  223. package/dist/cli/chunks/{load-B5OFYB4H.js → load-F4PVAMXQ.js} +2 -2
  224. package/dist/cli/chunks/load-test-5IKDWSYL.js +2 -0
  225. package/dist/cli/chunks/{mcp-FG3LNQR4.js → mcp-DUYJUEME.js} +2 -2
  226. package/dist/cli/chunks/{memory-SPS7ZWLC.js → memory-XTTYORAS.js} +5 -5
  227. package/dist/cli/chunks/memory-backend-7VW5QCMO.js +2 -0
  228. package/dist/cli/chunks/{memory-handlers-P7FTPWP3.js → memory-handlers-VZH3R2TQ.js} +2 -2
  229. package/dist/cli/chunks/{multi-model-executor-PUB7E6KH.js → multi-model-executor-R6XCTMCF.js} +2 -2
  230. package/dist/cli/chunks/{opencode-installer-TGCSGVG2.js → opencode-installer-33ULBU2F.js} +2 -2
  231. package/dist/cli/chunks/{orchestrator-S5FTJFGB.js → orchestrator-34ZJEKTJ.js} +22 -21
  232. package/dist/cli/chunks/pattern-null-store-BU6LCB2W.js +2 -0
  233. package/dist/cli/chunks/{pattern-usage-recorder-LCXXGRAB.js → pattern-usage-recorder-GZ2M3F2E.js} +2 -2
  234. package/dist/cli/chunks/{pipeline-ENOSRHKW.js → pipeline-SR5OTY45.js} +2 -2
  235. package/dist/cli/chunks/platform-VKJFJIAW.js +2 -0
  236. package/dist/cli/chunks/{plugin-JZ5ODJSU.js → plugin-5C5UBQUQ.js} +2 -2
  237. package/dist/cli/chunks/{prime-radiant-advanced-wasm-DPJUPNCG.js → prime-radiant-advanced-wasm-KO2PQI3D.js} +2 -2
  238. package/dist/cli/chunks/protocol-executor-BSP5LWJN.js +2 -0
  239. package/dist/cli/chunks/{protocol-handler-IP4NLVY3.js → protocol-handler-ZF74NIKA.js} +2 -2
  240. package/dist/cli/chunks/{prove-P6FM4RU7.js → prove-MO5TQQU4.js} +2 -2
  241. package/dist/cli/chunks/qe-reasoning-bank-J2RC7P25.js +2 -0
  242. package/dist/cli/chunks/{quality-UHP4XO26.js → quality-EYIN6AER.js} +2 -2
  243. package/dist/cli/chunks/quality-gate-V6OQM57O.js +7 -0
  244. package/dist/cli/chunks/queen-coordinator-XI5AJV2V.js +2 -0
  245. package/dist/cli/chunks/{real-embeddings-6SO5MFRQ.js → real-embeddings-AR7TZX7U.js} +2 -2
  246. package/dist/cli/chunks/{roocode-installer-WTWUOFCH.js → roocode-installer-46E626VZ.js} +2 -2
  247. package/dist/cli/chunks/router-VXQYYA3D.js +2 -0
  248. package/dist/cli/chunks/routing-feedback-HZQTASFF.js +2 -0
  249. package/dist/cli/chunks/{routing-handler-IK7HYERQ.js → routing-handler-ZNRVW6QW.js} +2 -2
  250. package/dist/cli/chunks/{ruvector-commands-THLB4NIM.js → ruvector-commands-4L2CQMWS.js} +2 -2
  251. package/dist/cli/chunks/rvf-dual-writer-BDTLLJER.js +2 -0
  252. package/dist/cli/chunks/rvf-migration-adapter-IB343MDN.js +2 -0
  253. package/dist/cli/chunks/{rvf-migration-coordinator-BUKCSHBD.js → rvf-migration-coordinator-H4RVGBIA.js} +2 -2
  254. package/dist/cli/chunks/rvf-native-adapter-Y7SN7LHU.js +2 -0
  255. package/dist/cli/chunks/{rvf-store-integrity-ECTADZIN.js → rvf-store-integrity-OJGWWPLL.js} +2 -2
  256. package/dist/cli/chunks/safe-db-2VTKKBJU.js +2 -0
  257. package/dist/cli/chunks/schedule-QJ4CFGJY.js +2 -0
  258. package/dist/cli/chunks/scheduler-2NHDQPC3.js +2 -0
  259. package/dist/cli/chunks/{security-HN4UXFXX.js → security-JF3BVNRO.js} +3 -3
  260. package/dist/cli/chunks/{shared-rvf-adapter-XJCPX5SN.js → shared-rvf-adapter-M6NNIZ5W.js} +2 -2
  261. package/dist/cli/chunks/{shared-rvf-dual-writer-23X5PNY5.js → shared-rvf-dual-writer-LHMFCYVE.js} +2 -2
  262. package/dist/cli/chunks/sqlite-persistence-NVVAPZN3.js +2 -0
  263. package/dist/cli/chunks/{status-handler-ZXANTHKT.js → status-handler-GMIOXQIE.js} +2 -2
  264. package/dist/cli/chunks/{structural-health-LR6WI3AH.js → structural-health-YZXHVHM6.js} +2 -2
  265. package/dist/cli/chunks/{sync-I5IUJF33.js → sync-GMPCPV5L.js} +2 -2
  266. package/dist/cli/chunks/{sync-4OEI3BC2.js → sync-N56UQGCS.js} +2 -2
  267. package/dist/cli/chunks/{task-handler-R3ATJKU5.js → task-handler-VTNRGAXP.js} +2 -2
  268. package/dist/cli/chunks/{task-handlers-4X357AEW.js → task-handlers-FYSDH55N.js} +3 -3
  269. package/dist/cli/chunks/{test-PR2B5H2F.js → test-GQNCKRSP.js} +4 -4
  270. package/dist/cli/chunks/{test-scheduling-ZNOSQVLD.js → test-scheduling-GPRXSIRP.js} +3 -3
  271. package/dist/cli/chunks/{token-bootstrap-LYXOI72S.js → token-bootstrap-76SRNXGG.js} +2 -2
  272. package/dist/cli/chunks/{token-usage-R6EQZBX2.js → token-usage-O7CZDP5Q.js} +2 -2
  273. package/dist/cli/chunks/{transformers-COQWK27J.js → transformers-LTU4LSSC.js} +2 -2
  274. package/dist/cli/chunks/{tree-sitter-wasm-parser-LLIW2X3M.js → tree-sitter-wasm-parser-NQSQCMBM.js} +2 -2
  275. package/dist/cli/chunks/{types-MEYTZITK.js → types-OP6IWE6N.js} +2 -2
  276. package/dist/cli/chunks/unified-memory-DSTIEDSH.js +2 -0
  277. package/dist/cli/chunks/unified-memory-hnsw-KBV3P4OS.js +2 -0
  278. package/dist/cli/chunks/unified-persistence-XKCOUBKY.js +2 -0
  279. package/dist/cli/chunks/{upgrade-DVIJ456A.js → upgrade-OQWRBZ3R.js} +2 -2
  280. package/dist/cli/chunks/{validate-UYTSMJ5X.js → validate-TH5SRP3E.js} +2 -2
  281. package/dist/cli/chunks/{validate-swarm-P32WCJR6.js → validate-swarm-UITL2JUS.js} +2 -2
  282. package/dist/cli/chunks/{vibium-JGVOLM6X.js → vibium-O6PRAG4J.js} +2 -2
  283. package/dist/cli/chunks/visual-security-TTWSPZTZ.js +2 -0
  284. package/dist/cli/chunks/{web-tree-sitter-5ZGNCTPN.js → web-tree-sitter-XBFBY4OF.js} +2 -2
  285. package/dist/cli/chunks/{windsurf-installer-IILSSQAE.js → windsurf-installer-DVT5NRNY.js} +2 -2
  286. package/dist/cli/chunks/witness-chain-2KY73HPN.js +2 -0
  287. package/dist/cli/chunks/{witness-chain-JZMXCG3B.js → witness-chain-VRSH2F36.js} +2 -2
  288. package/dist/cli/chunks/{witness-key-manager-UUTLNUIH.js → witness-key-manager-GFHRDKQ4.js} +2 -2
  289. package/dist/cli/chunks/{workflow-NS7HXVHZ.js → workflow-HAZ6YKOG.js} +4 -4
  290. package/dist/cli/chunks/workflow-orchestrator-UK56AVOT.js +2 -0
  291. package/dist/cli/chunks/{wrappers-XKEDSV5W.js → wrappers-5LLLT7GM.js} +2 -2
  292. package/dist/cli/commands/daemon.js +3 -0
  293. package/dist/cli/commands/platform.d.ts +1 -0
  294. package/dist/cli/commands/platform.js +28 -6
  295. package/dist/cli/commands/quality-gate.js +25 -3
  296. package/dist/cli/foreground-command.d.ts +3 -0
  297. package/dist/cli/foreground-command.js +22 -0
  298. package/dist/cli/handlers/init-handler.d.ts +5 -0
  299. package/dist/cli/handlers/init-handler.js +6 -0
  300. package/dist/cli/index.js +8 -1
  301. package/dist/contracts/verdicts.d.ts +625 -0
  302. package/dist/contracts/verdicts.js +202 -14
  303. package/dist/coordination/handlers/coverage-handlers.js +8 -1
  304. package/dist/domains/chaos-resilience/diagnosis/corpus.d.ts +5 -0
  305. package/dist/domains/chaos-resilience/diagnosis/corpus.js +141 -0
  306. package/dist/domains/chaos-resilience/diagnosis/detectors.d.ts +11 -0
  307. package/dist/domains/chaos-resilience/diagnosis/detectors.js +109 -0
  308. package/dist/domains/chaos-resilience/diagnosis/index.d.ts +5 -0
  309. package/dist/domains/chaos-resilience/diagnosis/index.js +5 -0
  310. package/dist/domains/chaos-resilience/diagnosis/scorer.d.ts +8 -0
  311. package/dist/domains/chaos-resilience/diagnosis/scorer.js +128 -0
  312. package/dist/domains/chaos-resilience/diagnosis/types.d.ts +171 -0
  313. package/dist/domains/chaos-resilience/diagnosis/types.js +3 -0
  314. package/dist/domains/chaos-resilience/index.d.ts +1 -0
  315. package/dist/domains/chaos-resilience/index.js +1 -0
  316. package/dist/domains/index.d.ts +1 -0
  317. package/dist/domains/index.js +1 -0
  318. package/dist/early-exit/early-exit-controller.d.ts +4 -2
  319. package/dist/early-exit/early-exit-controller.js +95 -7
  320. package/dist/early-exit/index.d.ts +1 -1
  321. package/dist/early-exit/speculative-executor.js +3 -0
  322. package/dist/early-exit/types.d.ts +51 -0
  323. package/dist/early-exit/types.js +3 -0
  324. package/dist/index.d.ts +4 -2
  325. package/dist/index.js +2 -1
  326. package/dist/init/browser-engine-installer.d.ts +11 -0
  327. package/dist/init/browser-engine-installer.js +35 -5
  328. package/dist/init/codex-installer.d.ts +11 -1
  329. package/dist/init/codex-installer.js +90 -24
  330. package/dist/init/init-wizard-hooks.js +11 -11
  331. package/dist/init/orchestrator.js +2 -0
  332. package/dist/init/phases/07-hooks.d.ts +3 -3
  333. package/dist/init/phases/07-hooks.js +19 -18
  334. package/dist/init/phases/09-assets.d.ts +4 -0
  335. package/dist/init/phases/09-assets.js +13 -10
  336. package/dist/init/phases/phase-interface.d.ts +2 -0
  337. package/dist/init/types.d.ts +4 -0
  338. package/dist/learning/index.d.ts +3 -0
  339. package/dist/learning/index.js +2 -0
  340. package/dist/learning/pattern-mutation-error.d.ts +9 -0
  341. package/dist/learning/pattern-mutation-error.js +14 -0
  342. package/dist/learning/pattern-store.js +24 -2
  343. package/dist/learning/qe-reasoning-bank.js +24 -5
  344. package/dist/learning/rvf-pattern-store.js +23 -5
  345. package/dist/learning/structural-retrieval/corpus.d.ts +5 -0
  346. package/dist/learning/structural-retrieval/corpus.js +97 -0
  347. package/dist/learning/structural-retrieval/evaluate.d.ts +7 -0
  348. package/dist/learning/structural-retrieval/evaluate.js +124 -0
  349. package/dist/learning/structural-retrieval/index.d.ts +6 -0
  350. package/dist/learning/structural-retrieval/index.js +4 -0
  351. package/dist/learning/structural-retrieval/receipt.d.ts +14 -0
  352. package/dist/learning/structural-retrieval/receipt.js +36 -0
  353. package/dist/learning/structural-retrieval/types.d.ts +83 -0
  354. package/dist/learning/structural-retrieval/types.js +2 -0
  355. package/dist/mcp/bundle.js +423 -423
  356. package/dist/mcp/index.d.ts +1 -0
  357. package/dist/mcp/index.js +1 -0
  358. package/dist/mcp/protocol-server.js +11 -2
  359. package/dist/mcp/qe-tool-bridge.js +1 -0
  360. package/dist/mcp/services/session-resume.d.ts +15 -19
  361. package/dist/mcp/services/session-resume.js +204 -194
  362. package/dist/mcp/tool-annotations.d.ts +25 -0
  363. package/dist/mcp/tool-annotations.js +75 -0
  364. package/dist/mcp/tool-registry.js +17 -12
  365. package/dist/mcp/tools/base.d.ts +7 -1
  366. package/dist/mcp/tools/base.js +8 -0
  367. package/dist/mcp/tools/quality-assessment/gate.d.ts +8 -5
  368. package/dist/mcp/tools/quality-assessment/gate.js +9 -4
  369. package/dist/mcp/tools/registry.d.ts +3 -0
  370. package/dist/mcp/tools/registry.js +1 -0
  371. package/dist/mcp/types.d.ts +15 -0
  372. package/dist/skills/qe-court/cli.js +0 -0
  373. package/dist/validation/quality-gate-runner.d.ts +27 -4
  374. package/dist/validation/quality-gate-runner.js +33 -4
  375. package/dist/validation/verification-reach.d.ts +90 -0
  376. package/dist/validation/verification-reach.js +187 -0
  377. package/dist/verification/adversarial-verify/index.d.ts +1 -1
  378. package/dist/verification/adversarial-verify/measurement-receipt.d.ts +13 -0
  379. package/dist/verification/adversarial-verify/measurement-receipt.js +136 -0
  380. package/dist/verification/adversarial-verify/synthesize.js +7 -10
  381. package/dist/verification/adversarial-verify/types.d.ts +35 -0
  382. package/dist/verification/adversarial-verify/verify.js +6 -1
  383. package/package.json +9 -5
  384. package/schemas/coverage-gap.schema.json +41 -0
  385. package/schemas/finding-verdict.schema.json +470 -0
  386. package/schemas/risk-decision.schema.json +41 -0
  387. package/dist/cli/chunks/adapter-3VBXL7DO.js +0 -2
  388. package/dist/cli/chunks/aqe-learning-engine-NXRNKJNA.js +0 -2
  389. package/dist/cli/chunks/base-F6GMOKU2.js +0 -2
  390. package/dist/cli/chunks/browser-workflow-QRDC46LR.js +0 -2
  391. package/dist/cli/chunks/chunk-3JIJBR4V.js +0 -2
  392. package/dist/cli/chunks/chunk-R2B6EE45.js +0 -2
  393. package/dist/cli/chunks/chunk-TRDEULS7.js +0 -4
  394. package/dist/cli/chunks/chunk-WJXHE52V.js +0 -65
  395. package/dist/cli/chunks/client-HNBZUEVV.js +0 -2
  396. package/dist/cli/chunks/codex-installer-AKQ5BCHU.js +0 -15
  397. package/dist/cli/chunks/core-handlers-TB7NLYXL.js +0 -2
  398. package/dist/cli/chunks/cross-domain-router-MDSI553U.js +0 -2
  399. package/dist/cli/chunks/dream-X7ISHFEE.js +0 -2
  400. package/dist/cli/chunks/heartbeat-scheduler-2C5XGFQT.js +0 -2
  401. package/dist/cli/chunks/hnsw-adapter-KCVMXLUL.js +0 -2
  402. package/dist/cli/chunks/hnsw-index-OGWZS6MP.js +0 -2
  403. package/dist/cli/chunks/impact-analyzer-IBJ43GQL.js +0 -2
  404. package/dist/cli/chunks/init-wizard-6XMFD5LP.js +0 -2
  405. package/dist/cli/chunks/kernel-UDUMUPB3.js +0 -2
  406. package/dist/cli/chunks/knowledge-graph-JRYTUG3W.js +0 -2
  407. package/dist/cli/chunks/llm-router-service-KF5ZALUQ.js +0 -2
  408. package/dist/cli/chunks/load-test-LHMBCNCH.js +0 -2
  409. package/dist/cli/chunks/memory-backend-WZHKHBZK.js +0 -2
  410. package/dist/cli/chunks/pattern-null-store-UZSHCRL2.js +0 -2
  411. package/dist/cli/chunks/platform-WCRBO3Z7.js +0 -2
  412. package/dist/cli/chunks/protocol-executor-42NLVDTC.js +0 -2
  413. package/dist/cli/chunks/qe-reasoning-bank-W74RSMMU.js +0 -2
  414. package/dist/cli/chunks/quality-gate-63DDBSGM.js +0 -7
  415. package/dist/cli/chunks/queen-coordinator-XELKSRMS.js +0 -2
  416. package/dist/cli/chunks/router-GTW2EQZV.js +0 -2
  417. package/dist/cli/chunks/routing-feedback-NVOBWEMK.js +0 -2
  418. package/dist/cli/chunks/rvf-dual-writer-5OPVMXNL.js +0 -2
  419. package/dist/cli/chunks/rvf-migration-adapter-5S4YFTX4.js +0 -2
  420. package/dist/cli/chunks/rvf-native-adapter-LYSJHEVX.js +0 -2
  421. package/dist/cli/chunks/safe-db-AEB3JMLD.js +0 -2
  422. package/dist/cli/chunks/schedule-4QNPCQNT.js +0 -2
  423. package/dist/cli/chunks/scheduler-S3DFHX6A.js +0 -2
  424. package/dist/cli/chunks/sqlite-persistence-L2KISU2H.js +0 -2
  425. package/dist/cli/chunks/unified-memory-5KQMA7FV.js +0 -2
  426. package/dist/cli/chunks/unified-memory-hnsw-PQRPTYOD.js +0 -2
  427. package/dist/cli/chunks/unified-persistence-YDONVPJB.js +0 -2
  428. package/dist/cli/chunks/visual-security-RJ7RTNGJ.js +0 -2
  429. package/dist/cli/chunks/witness-chain-YXXXNGAM.js +0 -2
  430. package/dist/cli/chunks/workflow-orchestrator-5KUAVSTH.js +0 -2
@@ -1,17 +1,4 @@
1
- /**
2
- * Agentic QE v3 - Structured Verdict Contracts (ADR-103)
3
- *
4
- * Typed, versioned verdict envelopes for agent-to-agent and MCP-boundary
5
- * handoffs: RiskDecision (quality gates), FindingVerdict (review findings
6
- * with adversarial refutations), CoverageGap (risk-weighted gap reports).
7
- *
8
- * Validators are dependency-free and are the source of truth; the exported
9
- * JSON Schemas (published to schemas/*.schema.json by
10
- * scripts/generate-verdict-schemas.mjs) mirror them for external tooling
11
- * (ajv, workflow agent() schema option). Envelopes are versioned and
12
- * additive-only within a major version: consumers must tolerate unknown
13
- * fields, so schemas keep `additionalProperties: true`.
14
- */
1
+ import { isSanitizedReceiptIdentifier, isSanitizedReceiptTimestamp, RECEIPT_IDENTIFIER_PATTERN, RECEIPT_JWT_PATTERN, RECEIPT_KNOWN_TIMESTAMP_PATTERN, RECEIPT_OPAQUE_CORRELATION_PATTERN, RECEIPT_OPAQUE_DESCRIPTOR_PATTERN, RECEIPT_SENSITIVE_IDENTIFIER_PATTERN, } from '../verification/adversarial-verify/measurement-receipt.js';
15
2
  export const VERDICT_CONTRACT_VERSION = '1.0';
16
3
  // ============================================================================
17
4
  // Validators (dependency-free, boundary-grade)
@@ -25,6 +12,88 @@ function isStringArray(v) {
25
12
  function inUnitRange(v) {
26
13
  return typeof v === 'number' && Number.isFinite(v) && v >= 0 && v <= 1;
27
14
  }
15
+ const RECEIPT_KEYS = new Set([
16
+ 'contract', 'provider', 'requestedModel', 'resolvedModel', 'endpointClass', 'snapshotIdentity',
17
+ 'semantics', 'fingerprint', 'requestHash', 'promptHash', 'configHash', 'parserSchemaHash',
18
+ 'outputHash', 'parsedVoteHash', 'temperature', 'topP', 'seed', 'deterministic', 'cacheStatus',
19
+ 'retryCount', 'timestamp', 'windowId', 'latencyMs', 'requestId',
20
+ ]);
21
+ const RECEIPT_HASH = /^(?:UNKNOWN|sha256:[a-f\d]{64})$/;
22
+ function validateMeasurementReceipt(value, path) {
23
+ if (!isRecord(value))
24
+ return [`${path} must be an object`];
25
+ const errors = [];
26
+ for (const key of Object.keys(value)) {
27
+ if (!RECEIPT_KEYS.has(key))
28
+ errors.push(`${path}.${key} is not allowed`);
29
+ }
30
+ if (value.contract !== 'judge-measurement@1')
31
+ errors.push(`${path}.contract must be "judge-measurement@1"`);
32
+ for (const key of ['provider', 'requestedModel', 'resolvedModel', 'fingerprint', 'windowId', 'requestId']) {
33
+ if (!isSanitizedReceiptIdentifier(value[key], key)) {
34
+ errors.push(`${path}.${key} must be a sanitized identifier`);
35
+ }
36
+ }
37
+ for (const key of ['requestHash', 'promptHash', 'configHash', 'parserSchemaHash', 'outputHash', 'parsedVoteHash']) {
38
+ if (typeof value[key] !== 'string' || !RECEIPT_HASH.test(value[key])) {
39
+ errors.push(`${path}.${key} must be UNKNOWN or a SHA-256 digest`);
40
+ }
41
+ }
42
+ if (!['shared', 'dedicated', 'local', 'UNKNOWN'].includes(value.endpointClass)) {
43
+ errors.push(`${path}.endpointClass is invalid`);
44
+ }
45
+ if (!['L0_UNKNOWN', 'L1_NAMED', 'L2_CONTENT_BOUND'].includes(value.snapshotIdentity)) {
46
+ errors.push(`${path}.snapshotIdentity is invalid`);
47
+ }
48
+ if (!['verified', 'provider-asserted', 'UNKNOWN'].includes(value.semantics)) {
49
+ errors.push(`${path}.semantics is invalid`);
50
+ }
51
+ if (!['hit', 'miss', 'bypass', 'UNKNOWN'].includes(value.cacheStatus)) {
52
+ errors.push(`${path}.cacheStatus is invalid`);
53
+ }
54
+ if (value.temperature !== null && (typeof value.temperature !== 'number'
55
+ || !Number.isFinite(value.temperature) || value.temperature < 0)) {
56
+ errors.push(`${path}.temperature must be a non-negative finite number or null`);
57
+ }
58
+ if (value.topP !== null && (typeof value.topP !== 'number'
59
+ || !Number.isFinite(value.topP) || value.topP < 0 || value.topP > 1)) {
60
+ errors.push(`${path}.topP must be a finite number in [0,1] or null`);
61
+ }
62
+ if (value.seed !== null && (typeof value.seed !== 'number' || !Number.isSafeInteger(value.seed))) {
63
+ errors.push(`${path}.seed must be a safe integer or null`);
64
+ }
65
+ if (value.deterministic !== null && typeof value.deterministic !== 'boolean') {
66
+ errors.push(`${path}.deterministic must be a boolean or null`);
67
+ }
68
+ if (!Number.isSafeInteger(value.retryCount) || value.retryCount < 0) {
69
+ errors.push(`${path}.retryCount must be a non-negative safe integer`);
70
+ }
71
+ if (!isSanitizedReceiptTimestamp(value.timestamp)) {
72
+ errors.push(`${path}.timestamp must be UNKNOWN or an ISO-8601 UTC timestamp`);
73
+ }
74
+ if (value.latencyMs !== null && (typeof value.latencyMs !== 'number'
75
+ || !Number.isFinite(value.latencyMs) || value.latencyMs < 0)) {
76
+ errors.push(`${path}.latencyMs must be a non-negative finite number or null`);
77
+ }
78
+ const contentBound = value.fingerprint !== 'UNKNOWN'
79
+ && ['requestHash', 'promptHash', 'configHash', 'parserSchemaHash', 'outputHash', 'parsedVoteHash']
80
+ .every((field) => value[field] !== 'UNKNOWN');
81
+ if (value.snapshotIdentity === 'L2_CONTENT_BOUND' && !contentBound) {
82
+ errors.push(`${path}.snapshotIdentity L2_CONTENT_BOUND requires non-UNKNOWN fingerprint and hashes`);
83
+ }
84
+ if (value.snapshotIdentity === 'L1_NAMED' && value.resolvedModel === 'UNKNOWN') {
85
+ errors.push(`${path}.snapshotIdentity L1_NAMED requires a resolved model`);
86
+ }
87
+ if (value.semantics === 'verified'
88
+ && (value.snapshotIdentity !== 'L2_CONTENT_BOUND' || !contentBound)) {
89
+ errors.push(`${path}.semantics verified requires L2 content-bound identity`);
90
+ }
91
+ if (value.semantics !== 'UNKNOWN'
92
+ && (value.snapshotIdentity === 'L0_UNKNOWN' || value.fingerprint === 'UNKNOWN')) {
93
+ errors.push(`${path}.semantics requires identified snapshot and fingerprint`);
94
+ }
95
+ return errors;
96
+ }
28
97
  export function validateRiskDecision(value) {
29
98
  const errors = [];
30
99
  if (!isRecord(value))
@@ -67,6 +136,16 @@ export function validateFindingVerdict(value) {
67
136
  }
68
137
  if (!isStringArray(value.refutations))
69
138
  errors.push('refutations must be string[]');
139
+ if (value.measurementReceipts !== undefined) {
140
+ if (!Array.isArray(value.measurementReceipts)) {
141
+ errors.push('measurementReceipts must be an array when present');
142
+ }
143
+ else {
144
+ value.measurementReceipts.forEach((receipt, index) => {
145
+ errors.push(...validateMeasurementReceipt(receipt, `measurementReceipts[${index}]`));
146
+ });
147
+ }
148
+ }
70
149
  return { valid: errors.length === 0, errors };
71
150
  }
72
151
  export function validateCoverageGap(value) {
@@ -120,6 +199,22 @@ export function buildRiskDecisionFromQualityGate(input) {
120
199
  // ============================================================================
121
200
  const unit = { type: 'number', minimum: 0, maximum: 1 };
122
201
  const stringArray = { type: 'array', items: { type: 'string' } };
202
+ function receiptIdentifier(field) {
203
+ const opaquePattern = field === 'provider' || field === 'requestedModel' || field === 'resolvedModel'
204
+ ? RECEIPT_OPAQUE_DESCRIPTOR_PATTERN
205
+ : RECEIPT_OPAQUE_CORRELATION_PATTERN;
206
+ return {
207
+ type: 'string',
208
+ pattern: RECEIPT_IDENTIFIER_PATTERN,
209
+ allOf: [
210
+ { not: { pattern: RECEIPT_SENSITIVE_IDENTIFIER_PATTERN } },
211
+ { not: { pattern: RECEIPT_JWT_PATTERN } },
212
+ { not: { pattern: opaquePattern } },
213
+ ],
214
+ };
215
+ }
216
+ const receiptHash = { type: 'string', pattern: '^(?:UNKNOWN|sha256:[a-f0-9]{64})$' };
217
+ const knownReceiptHash = { type: 'string', pattern: '^sha256:[a-f0-9]{64}$' };
123
218
  export const RISK_DECISION_SCHEMA = {
124
219
  $schema: 'http://json-schema.org/draft-07/schema#',
125
220
  $id: 'https://agentic-qe.dev/schemas/risk-decision.schema.json',
@@ -152,6 +247,99 @@ export const FINDING_VERDICT_SCHEMA = {
152
247
  evidence: stringArray,
153
248
  verdict: { enum: ['upheld', 'refuted', 'uncertain'] },
154
249
  refutations: stringArray,
250
+ measurementReceipts: {
251
+ type: 'array',
252
+ items: {
253
+ type: 'object',
254
+ required: [
255
+ 'contract', 'provider', 'requestedModel', 'resolvedModel', 'endpointClass',
256
+ 'snapshotIdentity', 'semantics', 'fingerprint', 'requestHash', 'promptHash',
257
+ 'configHash', 'parserSchemaHash', 'outputHash', 'parsedVoteHash', 'temperature',
258
+ 'topP', 'seed', 'deterministic', 'cacheStatus', 'retryCount', 'timestamp',
259
+ 'windowId', 'latencyMs', 'requestId',
260
+ ],
261
+ additionalProperties: false,
262
+ properties: {
263
+ contract: { const: 'judge-measurement@1' },
264
+ provider: receiptIdentifier('provider'),
265
+ requestedModel: receiptIdentifier('requestedModel'),
266
+ resolvedModel: receiptIdentifier('resolvedModel'),
267
+ endpointClass: { enum: ['shared', 'dedicated', 'local', 'UNKNOWN'] },
268
+ snapshotIdentity: { enum: ['L0_UNKNOWN', 'L1_NAMED', 'L2_CONTENT_BOUND'] },
269
+ semantics: { enum: ['verified', 'provider-asserted', 'UNKNOWN'] },
270
+ fingerprint: receiptIdentifier('fingerprint'),
271
+ requestHash: receiptHash,
272
+ promptHash: receiptHash,
273
+ configHash: receiptHash,
274
+ parserSchemaHash: receiptHash,
275
+ outputHash: receiptHash,
276
+ parsedVoteHash: receiptHash,
277
+ temperature: { type: ['number', 'null'], minimum: 0 },
278
+ topP: { type: ['number', 'null'], minimum: 0, maximum: 1 },
279
+ seed: {
280
+ type: ['integer', 'null'],
281
+ minimum: Number.MIN_SAFE_INTEGER,
282
+ maximum: Number.MAX_SAFE_INTEGER,
283
+ },
284
+ deterministic: { type: ['boolean', 'null'] },
285
+ cacheStatus: { enum: ['hit', 'miss', 'bypass', 'UNKNOWN'] },
286
+ retryCount: { type: 'integer', minimum: 0, maximum: Number.MAX_SAFE_INTEGER },
287
+ timestamp: {
288
+ anyOf: [
289
+ { const: 'UNKNOWN' },
290
+ { type: 'string', pattern: RECEIPT_KNOWN_TIMESTAMP_PATTERN, format: 'date-time' },
291
+ ],
292
+ },
293
+ windowId: receiptIdentifier('windowId'),
294
+ latencyMs: { type: ['number', 'null'], minimum: 0 },
295
+ requestId: receiptIdentifier('requestId'),
296
+ },
297
+ allOf: [
298
+ {
299
+ if: { properties: { snapshotIdentity: { const: 'L2_CONTENT_BOUND' } } },
300
+ then: {
301
+ properties: {
302
+ fingerprint: { not: { const: 'UNKNOWN' } },
303
+ requestHash: knownReceiptHash,
304
+ promptHash: knownReceiptHash,
305
+ configHash: knownReceiptHash,
306
+ parserSchemaHash: knownReceiptHash,
307
+ outputHash: knownReceiptHash,
308
+ parsedVoteHash: knownReceiptHash,
309
+ },
310
+ },
311
+ },
312
+ {
313
+ if: { properties: { snapshotIdentity: { const: 'L1_NAMED' } } },
314
+ then: { properties: { resolvedModel: { not: { const: 'UNKNOWN' } } } },
315
+ },
316
+ {
317
+ if: { properties: { semantics: { const: 'verified' } } },
318
+ then: {
319
+ properties: {
320
+ snapshotIdentity: { const: 'L2_CONTENT_BOUND' },
321
+ fingerprint: { not: { const: 'UNKNOWN' } },
322
+ requestHash: knownReceiptHash,
323
+ promptHash: knownReceiptHash,
324
+ configHash: knownReceiptHash,
325
+ parserSchemaHash: knownReceiptHash,
326
+ outputHash: knownReceiptHash,
327
+ parsedVoteHash: knownReceiptHash,
328
+ },
329
+ },
330
+ },
331
+ {
332
+ if: { properties: { semantics: { enum: ['verified', 'provider-asserted'] } } },
333
+ then: {
334
+ properties: {
335
+ snapshotIdentity: { not: { const: 'L0_UNKNOWN' } },
336
+ fingerprint: { not: { const: 'UNKNOWN' } },
337
+ },
338
+ },
339
+ },
340
+ ],
341
+ },
342
+ },
155
343
  },
156
344
  };
157
345
  export const COVERAGE_GAP_SCHEMA = {
@@ -120,10 +120,17 @@ async function collectCoverage(targetPath) {
120
120
  return { collected: fromReport, ranTests: false };
121
121
  }
122
122
  // #569 work item 1: delegate to real instrumentation where available.
123
- if (isRustProject(targetPath)) {
123
+ const rustProject = isRustProject(targetPath);
124
+ if (rustProject) {
124
125
  const rust = await collectRustCoverage(targetPath);
125
126
  if (rust)
126
127
  return { collected: rust, ranTests: true };
128
+ // This target is a Rust crate. Do not continue into the JS/TS runner:
129
+ // `npx vitest --coverage` can still be available through the parent
130
+ // process PATH and will write an empty report even though the crate has no
131
+ // JavaScript tests. Treating that artifact as coverage hides the intended
132
+ // Rust static-estimation fallback and mislabels the result.
133
+ return { collected: buildEstimatedCoverage(targetPath), ranTests: false };
127
134
  }
128
135
  const ranTests = await tryRunJsCoverage(targetPath);
129
136
  const afterRun = await loadCoverageData(targetPath);
@@ -0,0 +1,5 @@
1
+ import { type AgentFaultCorpus, type AgentFaultCorpusCase } from './types.js';
2
+ /** Frozen, synthetic corpus. Ground truth is never embedded in detectorInput. */
3
+ export declare function createAgentFaultDiagnosisCorpus(): AgentFaultCorpus;
4
+ export declare function serializeDetectorInput(input: AgentFaultCorpusCase['detectorInput']): string;
5
+ //# sourceMappingURL=corpus.d.ts.map
@@ -0,0 +1,141 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { AGENT_FAULT_CORPUS_SCHEMA_VERSION, AGENT_FAULT_TRACE_SCHEMA_VERSION, } from './types.js';
3
+ const SOURCE_REVISION = 'fixture-source-v1';
4
+ const HARNESS_REVISION = 'agent-runtime-diagnosis-v1';
5
+ const ENVIRONMENT_DIGEST = sha256('synthetic-node-runtime-v1');
6
+ function sha256(value) {
7
+ return createHash('sha256').update(value).digest('hex');
8
+ }
9
+ function stable(value) {
10
+ if (Array.isArray(value))
11
+ return `[${value.map(stable).join(',')}]`;
12
+ if (value && typeof value === 'object') {
13
+ return `{${Object.entries(value)
14
+ .sort(([a], [b]) => a.localeCompare(b))
15
+ .map(([key, item]) => `${JSON.stringify(key)}:${stable(item)}`).join(',')}}`;
16
+ }
17
+ return JSON.stringify(value);
18
+ }
19
+ function span(spanId, componentId, kind, parentSpanId) {
20
+ const input = `input:${componentId}`;
21
+ const output = `output:${componentId}`;
22
+ return {
23
+ spanId,
24
+ ...(parentSpanId ? { parentSpanId } : {}),
25
+ componentId,
26
+ kind,
27
+ startOffsetMs: kind === 'run' ? 0 : 10,
28
+ durationMs: kind === 'run' ? 100 : 20,
29
+ status: 'ok',
30
+ inputBytes: Buffer.byteLength(input),
31
+ outputBytes: Buffer.byteLength(output),
32
+ inputHash: sha256(input),
33
+ outputHash: sha256(output),
34
+ recovered: false,
35
+ };
36
+ }
37
+ function baseSpans() {
38
+ return [
39
+ span('run', 'workflow', 'run'),
40
+ span('agent-primary', 'planner', 'agent', 'run'),
41
+ { ...span('tool-weather', 'weather-tool', 'tool', 'agent-primary'), intendedDestination: 'weather-tool', actualDestination: 'weather-tool' },
42
+ span('model-answer', 'reasoning-model', 'model', 'agent-primary'),
43
+ { ...span('policy-check', 'safety-policy', 'guardrail', 'agent-primary'), policyRef: 'policy://safety/v1', expectedDecision: 'deny', actualDecision: 'deny' },
44
+ { ...span('delegate-review', 'reviewer-agent', 'delegation', 'agent-primary'), intendedDestination: 'reviewer-agent', actualDestination: 'reviewer-agent' },
45
+ ];
46
+ }
47
+ const FIXTURES = [
48
+ { faultType: 'tool-unavailable', boundary: 'tool', componentId: 'weather-tool', spanId: 'tool-weather', signal: 'tool unavailable', mutate: (s) => ({ ...s, status: 'error', signalCode: 'TOOL_UNAVAILABLE', outputBytes: 0, outputHash: sha256('') }) },
49
+ { faultType: 'tool-timeout', boundary: 'tool', componentId: 'weather-tool', spanId: 'tool-weather', signal: 'tool deadline exceeded', mutate: (s) => ({ ...s, status: 'timeout', signalCode: 'DEADLINE_EXCEEDED', durationMs: 5_000 }) },
50
+ { faultType: 'corrupted-tool-output', boundary: 'tool', componentId: 'weather-tool', spanId: 'tool-weather', signal: 'output differs from aligned clean reference', mutate: (s) => ({ ...s, outputHash: sha256('plausible-but-wrong'), outputBytes: 19 }) },
51
+ { faultType: 'context-truncation', boundary: 'model-context', componentId: 'reasoning-model', spanId: 'model-answer', signal: 'context truncated', mutate: (s) => ({ ...s, status: 'error', signalCode: 'CONTEXT_TRUNCATED', inputBytes: 131_072 }) },
52
+ { faultType: 'delegation-timeout', boundary: 'inter-agent', componentId: 'reviewer-agent', spanId: 'delegate-review', signal: 'delegation deadline exceeded', mutate: (s) => ({ ...s, status: 'timeout', signalCode: 'DELEGATION_TIMEOUT', durationMs: 5_000 }) },
53
+ { faultType: 'agent-misroute', boundary: 'inter-agent', componentId: 'reviewer-agent', spanId: 'delegate-review', signal: 'actual agent differs from intended agent', mutate: (s) => ({ ...s, actualDestination: 'billing-agent' }) },
54
+ { faultType: 'delegation-loop', boundary: 'inter-agent', componentId: 'reviewer-agent', spanId: 'delegate-review', signal: 'delegation edge repeats', mutate: (s) => ({ ...s, retry: 4, signalCode: 'DELEGATION_REPEATED' }) },
55
+ { faultType: 'guardrail-bypass', boundary: 'guardrail', componentId: 'safety-policy', spanId: 'policy-check', signal: 'policy oracle denies but runtime allows', mutate: (s) => ({ ...s, actualDecision: 'allow' }) },
56
+ ];
57
+ function trace(runId, taskId, spans) {
58
+ return {
59
+ schemaVersion: AGENT_FAULT_TRACE_SCHEMA_VERSION,
60
+ runId,
61
+ taskId,
62
+ harnessRevision: HARNESS_REVISION,
63
+ terminalOutcome: 'completed',
64
+ spans,
65
+ };
66
+ }
67
+ function structured(raw) {
68
+ return {
69
+ schemaVersion: raw.schemaVersion,
70
+ runId: raw.runId,
71
+ taskId: raw.taskId,
72
+ terminalOutcome: raw.terminalOutcome,
73
+ spans: [...raw.spans].sort((a, b) => a.startOffsetMs - b.startOffsetMs || a.spanId.localeCompare(b.spanId)),
74
+ };
75
+ }
76
+ function makeCase(caseId, runId, taskId, truth, spans, cleanReference, cleanReferenceId, expectedObservableSignal = 'no fault signal') {
77
+ const raw = trace(runId, taskId, spans);
78
+ return {
79
+ caseId,
80
+ ...(cleanReferenceId ? { cleanReferenceId } : {}),
81
+ detectorInput: { trace: raw, structured: structured(raw), ...(cleanReference ? { cleanReference } : {}) },
82
+ heldOut: {
83
+ truth,
84
+ manifest: {
85
+ schemaVersion: AGENT_FAULT_CORPUS_SCHEMA_VERSION,
86
+ caseId,
87
+ runId,
88
+ taskId,
89
+ sourceRevision: SOURCE_REVISION,
90
+ environmentDigest: ENVIRONMENT_DIGEST,
91
+ seed: 649,
92
+ target: { boundary: truth.boundary, componentId: truth.componentId, spanId: truth.spanId },
93
+ parameters: { synthetic: true },
94
+ expectedObservableSignal,
95
+ cleanup: { required: false, state: 'not-required', witness: 'synthetic fixture; no side effects' },
96
+ },
97
+ },
98
+ };
99
+ }
100
+ /** Frozen, synthetic corpus. Ground truth is never embedded in detectorInput. */
101
+ export function createAgentFaultDiagnosisCorpus() {
102
+ const cases = [];
103
+ FIXTURES.forEach((fixture, index) => {
104
+ const ordinal = String(index + 1).padStart(3, '0');
105
+ const taskId = `task-${ordinal}`;
106
+ const cleanCaseId = `case-${ordinal}-a`;
107
+ const cleanSpans = baseSpans();
108
+ const cleanRaw = trace(`run-${ordinal}-a`, taskId, cleanSpans);
109
+ const cleanView = structured(cleanRaw);
110
+ const cleanTruth = { faultType: 'none', boundary: 'control', componentId: 'workflow', spanId: 'run' };
111
+ cases.push(makeCase(cleanCaseId, `run-${ordinal}-a`, taskId, cleanTruth, cleanSpans));
112
+ const faultySpans = cleanSpans.map((item) => item.spanId === fixture.spanId ? fixture.mutate(item) : item);
113
+ const truth = {
114
+ faultType: fixture.faultType,
115
+ boundary: fixture.boundary,
116
+ componentId: fixture.componentId,
117
+ spanId: fixture.spanId,
118
+ };
119
+ cases.push(makeCase(`case-${ordinal}-b`, `run-${ordinal}-b`, taskId, truth, faultySpans, cleanView, cleanCaseId, fixture.signal));
120
+ });
121
+ const casesDigest = sha256(stable(cases.map(({ caseId, cleanReferenceId, detectorInput, heldOut }) => ({
122
+ caseId, cleanReferenceId, detectorInput, heldOut,
123
+ }))));
124
+ return {
125
+ manifest: {
126
+ schemaVersion: AGENT_FAULT_CORPUS_SCHEMA_VERSION,
127
+ corpusId: `aqe-agent-faults-${casesDigest.slice(0, 16)}`,
128
+ sourceRevision: SOURCE_REVISION,
129
+ harnessRevision: HARNESS_REVISION,
130
+ caseCount: cases.length,
131
+ casesDigest,
132
+ mixedFaults: 'out-of-scope',
133
+ detectorInputExcludes: ['injection manifest', 'ground-truth fault type', 'ground-truth location', 'fixture path'],
134
+ },
135
+ cases,
136
+ };
137
+ }
138
+ export function serializeDetectorInput(input) {
139
+ return stable(input);
140
+ }
141
+ //# sourceMappingURL=corpus.js.map
@@ -0,0 +1,11 @@
1
+ import type { AgentFaultDetector } from './types.js';
2
+ /** A transparent baseline limited to explicit runtime signals. */
3
+ export declare const directSignalBaseline: AgentFaultDetector;
4
+ /**
5
+ * AQE reference-aware diagnosis. It adds paired-output comparison and a policy
6
+ * oracle to the direct-signal baseline; neither source is a hidden fault label.
7
+ */
8
+ export declare const referenceAwareAqeDetector: AgentFaultDetector;
9
+ /** Negative-control detector used to prove majority-class guessing cannot pass. */
10
+ export declare const majorityFaultDetector: AgentFaultDetector;
11
+ //# sourceMappingURL=detectors.d.ts.map
@@ -0,0 +1,109 @@
1
+ function directSignal(span) {
2
+ if (span.signalCode === 'TOOL_UNAVAILABLE')
3
+ return { faultType: 'tool-unavailable', boundary: 'tool', confidence: 1 };
4
+ if (span.kind === 'tool' && span.status === 'timeout')
5
+ return { faultType: 'tool-timeout', boundary: 'tool', confidence: 1 };
6
+ if (span.signalCode === 'CONTEXT_TRUNCATED')
7
+ return { faultType: 'context-truncation', boundary: 'model-context', confidence: 1 };
8
+ if (span.kind === 'delegation' && span.status === 'timeout')
9
+ return { faultType: 'delegation-timeout', boundary: 'inter-agent', confidence: 1 };
10
+ if (span.kind === 'delegation' && span.intendedDestination !== span.actualDestination) {
11
+ return { faultType: 'agent-misroute', boundary: 'inter-agent', confidence: 1 };
12
+ }
13
+ if (span.kind === 'delegation' && (span.retry ?? 0) >= 3) {
14
+ return { faultType: 'delegation-loop', boundary: 'inter-agent', confidence: 0.95 };
15
+ }
16
+ return undefined;
17
+ }
18
+ function candidate(span, match) {
19
+ return {
20
+ ...match,
21
+ componentId: span.componentId,
22
+ spanId: span.spanId,
23
+ };
24
+ }
25
+ /** A transparent baseline limited to explicit runtime signals. */
26
+ export const directSignalBaseline = {
27
+ id: 'direct-signal-v1',
28
+ diagnose(caseId, input) {
29
+ const candidates = input.structured.spans.flatMap((span) => {
30
+ const match = directSignal(span);
31
+ return match ? [candidate(span, match)] : [];
32
+ });
33
+ if (candidates.length > 0)
34
+ return diagnosed(caseId, candidates);
35
+ if (input.cleanReference && input.structured.spans.some((span) => {
36
+ const clean = input.cleanReference?.spans.find((item) => item.spanId === span.spanId);
37
+ return clean?.outputHash !== span.outputHash;
38
+ }))
39
+ return abstained(caseId, 'Output differs from reference but has no direct failure signal');
40
+ if (input.structured.spans.every(isHealthy))
41
+ return healthy(caseId);
42
+ return abstained(caseId, 'No qualified direct signal');
43
+ },
44
+ };
45
+ /**
46
+ * AQE reference-aware diagnosis. It adds paired-output comparison and a policy
47
+ * oracle to the direct-signal baseline; neither source is a hidden fault label.
48
+ */
49
+ export const referenceAwareAqeDetector = {
50
+ id: 'aqe-reference-aware-v1',
51
+ diagnose(caseId, input) {
52
+ const direct = directSignalBaseline.diagnose(caseId, input);
53
+ if (direct.status === 'diagnosed')
54
+ return direct;
55
+ for (const span of input.structured.spans) {
56
+ if (span.kind === 'guardrail' && span.policyRef && span.expectedDecision && span.actualDecision
57
+ && span.expectedDecision !== span.actualDecision) {
58
+ return diagnosed(caseId, [candidate(span, {
59
+ faultType: 'guardrail-bypass', boundary: 'guardrail', confidence: 1,
60
+ })]);
61
+ }
62
+ if (span.kind === 'tool' && input.cleanReference) {
63
+ const clean = input.cleanReference.spans.find((item) => item.spanId === span.spanId);
64
+ if (clean && clean.outputHash !== span.outputHash) {
65
+ return diagnosed(caseId, [candidate(span, {
66
+ faultType: 'corrupted-tool-output', boundary: 'tool', confidence: 0.9,
67
+ })]);
68
+ }
69
+ }
70
+ }
71
+ return direct;
72
+ },
73
+ };
74
+ /** Negative-control detector used to prove majority-class guessing cannot pass. */
75
+ export const majorityFaultDetector = {
76
+ id: 'always-tool-unavailable',
77
+ diagnose(caseId, input) {
78
+ const span = input.structured.spans.find((item) => item.kind === 'tool') ?? input.structured.spans[0];
79
+ if (!span)
80
+ return { ...abstained(caseId, 'Empty trace'), status: 'parse-error' };
81
+ return diagnosed(caseId, [candidate(span, {
82
+ faultType: 'tool-unavailable', boundary: 'tool', confidence: 1,
83
+ })]);
84
+ },
85
+ };
86
+ function isHealthy(span) {
87
+ return span.status === 'ok'
88
+ && span.intendedDestination === span.actualDestination
89
+ && (!(span.expectedDecision && span.actualDecision) || span.expectedDecision === span.actualDecision)
90
+ && (span.retry ?? 0) < 3;
91
+ }
92
+ function diagnosed(caseId, candidates) {
93
+ return { caseId, status: 'diagnosed', candidates, signalObserved: true, latencyMs: 0 };
94
+ }
95
+ function healthy(caseId) {
96
+ return {
97
+ caseId,
98
+ status: 'diagnosed',
99
+ candidates: [{
100
+ faultType: 'none', boundary: 'control', componentId: 'workflow', spanId: 'run', confidence: 1,
101
+ }],
102
+ signalObserved: false,
103
+ latencyMs: 0,
104
+ };
105
+ }
106
+ function abstained(caseId, reason) {
107
+ return { caseId, status: 'abstained', candidates: [], signalObserved: false, latencyMs: 0, reason };
108
+ }
109
+ //# sourceMappingURL=detectors.js.map
@@ -0,0 +1,5 @@
1
+ export * from './types.js';
2
+ export * from './corpus.js';
3
+ export * from './detectors.js';
4
+ export * from './scorer.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,5 @@
1
+ export * from './types.js';
2
+ export * from './corpus.js';
3
+ export * from './detectors.js';
4
+ export * from './scorer.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,8 @@
1
+ import type { AgentFaultCorpus, AgentFaultDetector, AgentFaultScoreReport } from './types.js';
2
+ export declare function scoreAgentFaultDetector(corpus: AgentFaultCorpus, detector: AgentFaultDetector, topK?: number): AgentFaultScoreReport;
3
+ export interface AgentFaultQualification {
4
+ readonly passed: boolean;
5
+ readonly failures: readonly string[];
6
+ }
7
+ export declare function qualifyAgentFaultDetector(report: AgentFaultScoreReport): AgentFaultQualification;
8
+ //# sourceMappingURL=scorer.d.ts.map