@ebrindley/build 2026.11.29-rc.1 → 2026.11.30

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 (999) hide show
  1. package/.build-project/providers/pricing.json +120 -120
  2. package/README.md +5 -3
  3. package/dist/ai-judge-7QRPODW5.js +189 -0
  4. package/dist/allowlist-utils-UTV2BVC6.js +29 -0
  5. package/dist/apply-completion-mode-AX3JO47P.js +111 -0
  6. package/dist/artifact-migrator-COSKRONX.js +251 -0
  7. package/dist/ask-Y6J7ZG7U.js +177 -0
  8. package/dist/auth-4S3TCG3U.js +164 -0
  9. package/dist/auth-7JFLAPPG.js +97 -0
  10. package/dist/auth-F3L4WM4X.js +100 -0
  11. package/dist/auth-LKWU6MY3.js +96 -0
  12. package/dist/auth-LWR4K5WJ.js +184 -0
  13. package/dist/auth-TCWFPNKH.js +44 -0
  14. package/dist/auth-XDO5N5W7.js +92 -0
  15. package/dist/auth-XMI6YGL5.js +98 -0
  16. package/dist/auth-liveness-JQRZYOPF.js +53 -0
  17. package/dist/autoloop-cleanup-4BWHK726.js +106 -0
  18. package/dist/autoloop-gate-policy-RU5QCRRW.js +94 -0
  19. package/dist/autoloop-helpers-MPQV3CR3.js +52 -0
  20. package/dist/autoloop-run-defaults-HLLYKMQ5.js +27 -0
  21. package/dist/autoloop-success-HIWNPIKP.js +94 -0
  22. package/dist/autoloop-trajectory-NAZJ4FDN.js +71 -0
  23. package/dist/automatic-branch-cleanup-LITC4HBH.js +49 -0
  24. package/dist/autonomous-loop-controller-25SLNJRM.js +4419 -0
  25. package/dist/backend-DQV2E5NO.js +24 -0
  26. package/dist/backend-order-FA3472YN.js +112 -0
  27. package/dist/background-executor-M6X23KQK.js +263 -0
  28. package/dist/backlog-CV5WX5NW.js +390 -0
  29. package/dist/backlog-execution-intent-55LQ2QLQ.js +80 -0
  30. package/dist/backup-active-store-J6WW5B6W.js +16 -0
  31. package/dist/backup-machine-stores-XUJIV63O.js +251 -0
  32. package/dist/backup-telemetry-db-QQCLTM6R.js +26 -0
  33. package/dist/branch-cleanup-manager-IHJLSFHO.js +35 -0
  34. package/dist/build-gate-NHIOCA4K.js +69 -0
  35. package/dist/build-root-XQ2LDGA6.js +18 -0
  36. package/dist/change-summary-2P35V4IB.js +50 -0
  37. package/dist/chunk-2ABQORVF.js +96 -0
  38. package/dist/chunk-2D6ORBMW.js +204 -0
  39. package/dist/chunk-2KEKB74O.js +430 -0
  40. package/dist/chunk-2LY6SWFQ.js +106 -0
  41. package/dist/chunk-2UYVX52G.js +572 -0
  42. package/dist/chunk-322VCETO.js +338 -0
  43. package/dist/chunk-3AM7RQFY.js +568 -0
  44. package/dist/chunk-3BOQUDNJ.js +225 -0
  45. package/dist/chunk-3FLVW5SN.js +2018 -0
  46. package/dist/chunk-3HN5RJ6B.js +220 -0
  47. package/dist/chunk-3IU5PZID.js +24661 -0
  48. package/dist/chunk-3UOKKE4L.js +47 -0
  49. package/dist/chunk-3ZTMXGTM.js +181 -0
  50. package/dist/chunk-43OVHXJP.js +230 -0
  51. package/dist/chunk-43SLX7SB.js +3881 -0
  52. package/dist/chunk-446W2N7G.js +121 -0
  53. package/dist/chunk-44KC2BDD.js +257 -0
  54. package/dist/chunk-46CV2AXU.js +485 -0
  55. package/dist/chunk-4BWTBBOZ.js +173 -0
  56. package/dist/chunk-4CI7DAXV.js +2369 -0
  57. package/dist/chunk-4DZUJPGZ.js +6549 -0
  58. package/dist/chunk-4GMK2FOY.js +4083 -0
  59. package/dist/chunk-4ICHPKL7.js +50 -0
  60. package/dist/chunk-4IRFY5CP.js +328 -0
  61. package/dist/chunk-4NTO4FZY.js +26 -0
  62. package/dist/chunk-4RENZK5G.js +187 -0
  63. package/dist/chunk-4UX7WAEA.js +97 -0
  64. package/dist/chunk-4VAEBC43.js +872 -0
  65. package/dist/chunk-52EERG2K.js +197 -0
  66. package/dist/chunk-53I5ZWN4.js +315 -0
  67. package/dist/chunk-546BJRSJ.js +31 -0
  68. package/dist/chunk-56RQ7H2T.js +242 -0
  69. package/dist/chunk-5AKJ35KU.js +643 -0
  70. package/dist/chunk-5CBUNWJ3.js +237 -0
  71. package/dist/chunk-5FT5DZJU.js +306 -0
  72. package/dist/chunk-5I5PD4FV.js +33 -0
  73. package/dist/chunk-5JEEUMVC.js +576 -0
  74. package/dist/chunk-5KM4IFF5.js +523 -0
  75. package/dist/chunk-5M37KC2C.js +2478 -0
  76. package/dist/chunk-5NGRZQ37.js +1242 -0
  77. package/dist/chunk-5NYMJQEN.js +825 -0
  78. package/dist/chunk-5OFOXMEP.js +1052 -0
  79. package/dist/chunk-5PHWFWO5.js +887 -0
  80. package/dist/chunk-5QGN4OMZ.js +455 -0
  81. package/dist/chunk-5WAEIS6W.js +73 -0
  82. package/dist/chunk-5YTEPJJ6.js +753 -0
  83. package/dist/chunk-63ZTC7YM.js +180 -0
  84. package/dist/chunk-64HUBOJA.js +1754 -0
  85. package/dist/chunk-6K3QYLDK.js +677 -0
  86. package/dist/chunk-6O335CQ4.js +353 -0
  87. package/dist/chunk-6OLYI6DQ.js +17786 -0
  88. package/dist/chunk-6SYGYHJD.js +1027 -0
  89. package/dist/chunk-6TEFCQNZ.js +1133 -0
  90. package/dist/chunk-6XDEYPQ6.js +598 -0
  91. package/dist/chunk-73LLE7JJ.js +241 -0
  92. package/dist/chunk-76A7N43R.js +73 -0
  93. package/dist/chunk-77O6UPDY.js +2950 -0
  94. package/dist/chunk-77SOS44N.js +41 -0
  95. package/dist/chunk-7GQACZFQ.js +25 -0
  96. package/dist/chunk-7GS74VLQ.js +14 -0
  97. package/dist/chunk-7HVAKVRI.js +31 -0
  98. package/dist/chunk-7IJL2VY6.js +410 -0
  99. package/dist/chunk-7JLXSLA3.js +1063 -0
  100. package/dist/chunk-7MAE7V3O.js +546 -0
  101. package/dist/chunk-7O7H26VW.js +715 -0
  102. package/dist/chunk-7QAVWRJT.js +19419 -0
  103. package/dist/chunk-7Z22NOW4.js +8254 -0
  104. package/dist/chunk-7ZS6SHKA.js +1041 -0
  105. package/dist/chunk-A3GHJ4KS.js +142 -0
  106. package/dist/chunk-A5K5ZMOO.js +1487 -0
  107. package/dist/chunk-A6CFXX4X.js +737 -0
  108. package/dist/chunk-A7FDC4RZ.js +267 -0
  109. package/dist/chunk-A7ZYF66E.js +107 -0
  110. package/dist/chunk-AAPCXLSU.js +307 -0
  111. package/dist/chunk-ADJVO6UZ.js +977 -0
  112. package/dist/chunk-ALAFMV3C.js +342 -0
  113. package/dist/chunk-ALXV5QAB.js +398 -0
  114. package/dist/chunk-AWFRGPCT.js +4524 -0
  115. package/dist/chunk-AYLDFRVR.js +90 -0
  116. package/dist/chunk-B6FHVOH4.js +245 -0
  117. package/dist/chunk-BIHFSEOF.js +258 -0
  118. package/dist/chunk-BNMT5HDH.js +490 -0
  119. package/dist/chunk-BOCPPUPD.js +141 -0
  120. package/dist/chunk-BUMTGCTJ.js +1751 -0
  121. package/dist/chunk-BX7BZSCH.js +109 -0
  122. package/dist/chunk-BXZ7M2IZ.js +19 -0
  123. package/dist/chunk-CCDLD3YQ.js +204 -0
  124. package/dist/chunk-CGEQOKBM.js +650 -0
  125. package/dist/chunk-CHWTDO62.js +116 -0
  126. package/dist/chunk-CIOL6AGZ.js +655 -0
  127. package/dist/chunk-CJLYVCXU.js +85 -0
  128. package/dist/chunk-CP7SZ7WD.js +198 -0
  129. package/dist/chunk-CQ5UFSDL.js +1437 -0
  130. package/dist/chunk-CT76GAC6.js +152 -0
  131. package/dist/chunk-DAY7PLKR.js +1224 -0
  132. package/dist/chunk-DFRASQCY.js +264 -0
  133. package/dist/chunk-DKKS7O3V.js +68 -0
  134. package/dist/chunk-DLRQF4ZI.js +123 -0
  135. package/dist/chunk-DOS76IXZ.js +66 -0
  136. package/dist/chunk-DPPKV4VM.js +80 -0
  137. package/dist/chunk-DRUCSKQA.js +9 -0
  138. package/dist/chunk-EARCDRPV.js +510 -0
  139. package/dist/chunk-EAYRH4PM.js +1841 -0
  140. package/dist/chunk-EDCLABBZ.js +539 -0
  141. package/dist/chunk-EDI2ZDDG.js +489 -0
  142. package/dist/chunk-EG7PVC23.js +737 -0
  143. package/dist/chunk-EGJE7WI7.js +916 -0
  144. package/dist/chunk-EHLYZFQ3.js +976 -0
  145. package/dist/chunk-EI6F6KXZ.js +152 -0
  146. package/dist/chunk-EN3BRJ4M.js +62 -0
  147. package/dist/chunk-ENEZ2UZK.js +4046 -0
  148. package/dist/chunk-EOHXAE4I.js +445 -0
  149. package/dist/chunk-EQ6CFKVC.js +5113 -0
  150. package/dist/chunk-ERKNN26C.js +73 -0
  151. package/dist/chunk-ET3645ZR.js +4946 -0
  152. package/dist/chunk-EVBWWBLK.js +176 -0
  153. package/dist/chunk-EXPOGJKU.js +34 -0
  154. package/dist/chunk-EYGGX5VV.js +1358 -0
  155. package/dist/chunk-FDJD6ZW4.js +293 -0
  156. package/dist/chunk-FJEJOBYT.js +453 -0
  157. package/dist/chunk-FPSMXHVW.js +112 -0
  158. package/dist/chunk-FVLPKRDI.js +1267 -0
  159. package/dist/chunk-FWGHSP45.js +103 -0
  160. package/dist/chunk-G3Y74P2M.js +145 -0
  161. package/dist/chunk-GKYTKOZD.js +323 -0
  162. package/dist/chunk-GONP4H4J.js +482 -0
  163. package/dist/chunk-GSAUTEI5.js +15732 -0
  164. package/dist/chunk-GSSF7WE7.js +5552 -0
  165. package/dist/chunk-H3F7SQPH.js +1318 -0
  166. package/dist/chunk-HCPHBNNF.js +123 -0
  167. package/dist/chunk-HDBKA6HA.js +78 -0
  168. package/dist/chunk-HEKSYGYR.js +213 -0
  169. package/dist/chunk-HHLWTZDL.js +152 -0
  170. package/dist/chunk-HK4D2JQ3.js +365 -0
  171. package/dist/chunk-HKVI2JEM.js +53 -0
  172. package/dist/chunk-HLAFY5VQ.js +81 -0
  173. package/dist/chunk-HLVBWT2S.js +490 -0
  174. package/dist/chunk-HOJJHGDE.js +151 -0
  175. package/dist/chunk-HRA3GRZP.js +860 -0
  176. package/dist/chunk-HTZKX37C.js +6283 -0
  177. package/dist/chunk-II4QJWBI.js +389 -0
  178. package/dist/chunk-IKU5ETT5.js +852 -0
  179. package/dist/chunk-ILEI77YT.js +126 -0
  180. package/dist/chunk-ILJ35CUI.js +953 -0
  181. package/dist/chunk-IPCFFUSO.js +371 -0
  182. package/dist/chunk-IRJ65U55.js +20 -0
  183. package/dist/chunk-IRNCZ7GA.js +2287 -0
  184. package/dist/chunk-IT5RHXAL.js +392 -0
  185. package/dist/chunk-ITAQSLO7.js +302 -0
  186. package/dist/chunk-J4P3PSF7.js +305 -0
  187. package/dist/chunk-JCHU42E2.js +178 -0
  188. package/dist/chunk-JCUYUAJ6.js +2188 -0
  189. package/dist/chunk-JJWFK773.js +119 -0
  190. package/dist/chunk-JLQNE3DW.js +115 -0
  191. package/dist/chunk-JPZ3RFB2.js +224 -0
  192. package/dist/chunk-JRBDRVLG.js +1611 -0
  193. package/dist/chunk-JVBFCASW.js +206 -0
  194. package/dist/chunk-JVLPITFE.js +629 -0
  195. package/dist/chunk-JVRB7H46.js +154 -0
  196. package/dist/chunk-K4FEITLB.js +535 -0
  197. package/dist/chunk-K7IHVLMC.js +699 -0
  198. package/dist/chunk-K7LDQWAZ.js +226 -0
  199. package/dist/chunk-KAU7EXOS.js +544 -0
  200. package/dist/chunk-KCWTI6L6.js +855 -0
  201. package/dist/chunk-KCXBZT6N.js +1102 -0
  202. package/dist/chunk-KD3JHVH7.js +866 -0
  203. package/dist/chunk-KHH6FLUM.js +1672 -0
  204. package/dist/chunk-KUSBLYIZ.js +48 -0
  205. package/dist/chunk-L2E25UHK.js +318 -0
  206. package/dist/chunk-L45TR7YE.js +112 -0
  207. package/dist/chunk-L65DR3DA.js +128 -0
  208. package/dist/chunk-LE3HMEYD.js +263 -0
  209. package/dist/chunk-LIKJR4OZ.js +1429 -0
  210. package/dist/chunk-LJ4DBWU4.js +891 -0
  211. package/dist/chunk-LQTESWAU.js +18 -0
  212. package/dist/chunk-LVHMHEVN.js +3588 -0
  213. package/dist/chunk-LX5IU5TX.js +205 -0
  214. package/dist/chunk-LZJGCSW2.js +47 -0
  215. package/dist/chunk-MFXDLKZ4.js +334 -0
  216. package/dist/chunk-MHZ6LG6D.js +4692 -0
  217. package/dist/chunk-MQ62MQY5.js +535 -0
  218. package/dist/chunk-MTBJJEW6.js +1533 -0
  219. package/dist/chunk-MWX6GF64.js +1232 -0
  220. package/dist/chunk-MZWATAJ5.js +396 -0
  221. package/dist/chunk-MZY2X4BY.js +293 -0
  222. package/dist/chunk-N2GVQVMZ.js +360 -0
  223. package/dist/chunk-N2QFPC23.js +43 -0
  224. package/dist/chunk-N42JP72A.js +469 -0
  225. package/dist/chunk-N4JIL2JH.js +513 -0
  226. package/dist/chunk-N6GZBJC6.js +165 -0
  227. package/dist/chunk-N7DN2XQ2.js +188 -0
  228. package/dist/chunk-NEQ5COJM.js +487 -0
  229. package/dist/chunk-NOE2AC4Y.js +698 -0
  230. package/dist/chunk-NOK2P254.js +244 -0
  231. package/dist/chunk-NPE2EY5X.js +8991 -0
  232. package/dist/chunk-NPYXYTD3.js +320 -0
  233. package/dist/chunk-NSMHZKXN.js +13 -0
  234. package/dist/chunk-NTOOED63.js +319 -0
  235. package/dist/chunk-NV25VR5N.js +49 -0
  236. package/dist/chunk-NZORX7C6.js +43 -0
  237. package/dist/chunk-O4LG7DC4.js +1104 -0
  238. package/dist/chunk-OCLFRHVC.js +7024 -0
  239. package/dist/chunk-OEPYF23A.js +4301 -0
  240. package/dist/chunk-OFYHGYW2.js +236 -0
  241. package/dist/chunk-OH534UCC.js +129 -0
  242. package/dist/chunk-OLLOF3DM.js +1087 -0
  243. package/dist/chunk-ONSRQNXK.js +3667 -0
  244. package/dist/chunk-OQQJYRL4.js +884 -0
  245. package/dist/chunk-PAU2WCB5.js +83 -0
  246. package/dist/chunk-PCLYURZM.js +205 -0
  247. package/dist/chunk-PDZFFRVP.js +1461 -0
  248. package/dist/chunk-PFFMTB4W.js +288 -0
  249. package/dist/chunk-PMC2WE7L.js +292 -0
  250. package/dist/chunk-PNQOAORK.js +104 -0
  251. package/dist/chunk-PVYPEK3I.js +53 -0
  252. package/dist/chunk-PY3LR36X.js +637 -0
  253. package/dist/chunk-QCSYILNZ.js +27 -0
  254. package/dist/chunk-QD4QLWIP.js +229 -0
  255. package/dist/chunk-QFNYI6GT.js +946 -0
  256. package/dist/chunk-QGV6VOJI.js +2170 -0
  257. package/dist/chunk-QISV2HFY.js +525 -0
  258. package/dist/chunk-QK3F2EC5.js +555 -0
  259. package/dist/chunk-QKWQWBH3.js +159 -0
  260. package/dist/chunk-QN7IPD7E.js +204 -0
  261. package/dist/chunk-QOP72VG4.js +160 -0
  262. package/dist/chunk-R4BWGIY3.js +1681 -0
  263. package/dist/chunk-R5D7OHVL.js +99 -0
  264. package/dist/chunk-R7N4LHZY.js +63 -0
  265. package/dist/chunk-RBVSIFDW.js +373 -0
  266. package/dist/chunk-REKAPAX3.js +568 -0
  267. package/dist/chunk-RGMATJ5Z.js +79 -0
  268. package/dist/chunk-RIDXBLL6.js +92 -0
  269. package/dist/chunk-RIG7HTU7.js +167 -0
  270. package/dist/chunk-RPSVTHDC.js +14351 -0
  271. package/dist/chunk-RSIZC6TO.js +192 -0
  272. package/dist/chunk-RXMMCJSL.js +459 -0
  273. package/dist/chunk-RY4NKXBB.js +61 -0
  274. package/dist/chunk-S3I7E3GU.js +1139 -0
  275. package/dist/chunk-S3ZPX3AY.js +248 -0
  276. package/dist/chunk-S5FAB637.js +1853 -0
  277. package/dist/chunk-SDP4FSKS.js +124 -0
  278. package/dist/chunk-SIIUXZN3.js +39 -0
  279. package/dist/chunk-SJUNPB4C.js +189 -0
  280. package/dist/chunk-SN6UVHBX.js +88 -0
  281. package/dist/chunk-STETQZPA.js +616 -0
  282. package/dist/chunk-SWPL2VQ5.js +3674 -0
  283. package/dist/chunk-SXKQ6S4K.js +53 -0
  284. package/dist/chunk-SZXNW33V.js +126 -0
  285. package/dist/chunk-T4D67MDH.js +452 -0
  286. package/dist/chunk-TBBMN6WY.js +5405 -0
  287. package/dist/chunk-TD4VUICM.js +128 -0
  288. package/dist/chunk-TEWWMUL3.js +120 -0
  289. package/dist/chunk-TGHMBI3P.js +936 -0
  290. package/dist/chunk-TIZDT7WN.js +342 -0
  291. package/dist/chunk-TKOQHBWL.js +2227 -0
  292. package/dist/chunk-TKUHQCSM.js +970 -0
  293. package/dist/chunk-TPMLM7RS.js +169 -0
  294. package/dist/chunk-TQZJK2GF.js +763 -0
  295. package/dist/chunk-TXSR2GAM.js +1231 -0
  296. package/dist/chunk-TYGFXH6J.js +521 -0
  297. package/dist/chunk-U7PECEL6.js +1402 -0
  298. package/dist/chunk-UENRYSCZ.js +403 -0
  299. package/dist/chunk-UFRGGXQG.js +9622 -0
  300. package/dist/chunk-UHGOKHLR.js +912 -0
  301. package/dist/chunk-UON4D7CJ.js +833 -0
  302. package/dist/chunk-V5ZK46ZN.js +69 -0
  303. package/dist/chunk-V6KIOYYV.js +380 -0
  304. package/dist/chunk-V73CTZKO.js +122 -0
  305. package/dist/chunk-VAY2U3KK.js +29 -0
  306. package/dist/chunk-VOEIZFZK.js +527 -0
  307. package/dist/chunk-VXBODKFY.js +272 -0
  308. package/dist/chunk-VXGEQLZ2.js +465 -0
  309. package/dist/chunk-VZH5DGNK.js +160 -0
  310. package/dist/chunk-WX3G2PN6.js +146 -0
  311. package/dist/chunk-WZWXLKEX.js +48 -0
  312. package/dist/chunk-X4CWMMHJ.js +2155 -0
  313. package/dist/chunk-X6R6CVUC.js +294 -0
  314. package/dist/chunk-XD63TH2A.js +3639 -0
  315. package/dist/chunk-XFT3EHMS.js +304 -0
  316. package/dist/chunk-XHHTSY2C.js +193 -0
  317. package/dist/chunk-XLERMMC6.js +1414 -0
  318. package/dist/chunk-XPLKNO54.js +272 -0
  319. package/dist/chunk-XQK54PEG.js +491 -0
  320. package/dist/chunk-XR4B4ON2.js +339 -0
  321. package/dist/chunk-XS5DH42P.js +911 -0
  322. package/dist/chunk-Y26HWPYX.js +4967 -0
  323. package/dist/chunk-Y2OSBLHL.js +260 -0
  324. package/dist/chunk-Y2TFKFAN.js +396 -0
  325. package/dist/chunk-Y3ATTWF2.js +263 -0
  326. package/dist/chunk-Y63TWT4U.js +179 -0
  327. package/dist/chunk-YA5IQXZX.js +344 -0
  328. package/dist/chunk-YBK3OAFA.js +209 -0
  329. package/dist/chunk-YIXHBDCQ.js +115 -0
  330. package/dist/chunk-YKJD7XGX.js +828 -0
  331. package/dist/chunk-YLQMRUDV.js +147 -0
  332. package/dist/chunk-YM5C6JQQ.js +460 -0
  333. package/dist/chunk-YPAVWDXQ.js +60 -0
  334. package/dist/chunk-YPCF7ZWS.js +110 -0
  335. package/dist/chunk-YUP4U7F3.js +247 -0
  336. package/dist/chunk-YY5RNFD7.js +538 -0
  337. package/dist/chunk-YZRRPMO5.js +15190 -0
  338. package/dist/chunk-Z3JFB2PG.js +498 -0
  339. package/dist/chunk-Z6USLNUD.js +1214 -0
  340. package/dist/chunk-ZEM2MURX.js +514 -0
  341. package/dist/chunk-ZFHW4JVC.js +127 -0
  342. package/dist/chunk-ZJRSXT2L.js +951 -0
  343. package/dist/chunk-ZL35PLQE.js +2898 -0
  344. package/dist/chunk-ZLBNMVDZ.js +426 -0
  345. package/dist/chunk-ZMATRK4I.js +624 -0
  346. package/dist/chunk-ZQEJEV7L.js +557 -0
  347. package/dist/chunk-ZYXZNKBR.js +540 -0
  348. package/dist/cli-utils-CR6QZ6QE.js +31 -0
  349. package/dist/cli-validation-VPKISCKF.js +124 -0
  350. package/dist/commit-utils-Q3UHGMUB.js +49 -0
  351. package/dist/compete-config-resolver-ZYXFXJES.js +125 -0
  352. package/dist/compete-results-6YCPPGUX.js +315 -0
  353. package/dist/competition-outcome-tracker-JOXGYAME.js +62 -0
  354. package/dist/config-3PHBXBUC.js +237 -0
  355. package/dist/config-BVAYS6UF.js +46 -0
  356. package/dist/config-audit-LL2QG3PL.js +371 -0
  357. package/dist/config-explain-CSX6Y66G.js +71 -0
  358. package/dist/config-loader-UQEQJQNQ.js +52 -0
  359. package/dist/config-manager-MUHTJLH7.js +114 -0
  360. package/dist/config-merger-2WV7YWJS.js +14 -0
  361. package/dist/config-validator-OXIIFA7L.js +122 -0
  362. package/dist/cost-K7VYMBQ5.js +82 -0
  363. package/dist/data-migration-state-STPHHM6A.js +35 -0
  364. package/dist/db-migrator-5QZ2C7CL.js +34 -0
  365. package/dist/default-paths-QO4RD5CH.js +49 -0
  366. package/dist/discovery-K5RNSXXI.js +53 -0
  367. package/dist/doctor-E4Q4CKHD.js +268 -0
  368. package/dist/doctor-context-blocks-ZIYP276L.js +252 -0
  369. package/dist/doctor-instructions-import-26ZYVWL2.js +70 -0
  370. package/dist/doctor-purpose-KCLMZX54.js +30 -0
  371. package/dist/domain-analyzer-EZFIDBH7.js +47 -0
  372. package/dist/ensure-initialized-ODHQ5IXB.js +75 -0
  373. package/dist/entry.js +38 -38
  374. package/dist/error-parser-core-VAX2C2BE.js +70 -0
  375. package/dist/evaluation-context-PMDGLBBW.js +61 -0
  376. package/dist/evidence-plan-resolver-5NGSVNXT.js +111 -0
  377. package/dist/execution-data-writer-C3TN7WLA.js +77 -0
  378. package/dist/execution-policy-applier-KQ36LBBN.js +63 -0
  379. package/dist/execution-preflight-W7JMM5XT.js +224 -0
  380. package/dist/execution-roles-N7KXTA5I.js +112 -0
  381. package/dist/factory-VSWXYDPJ.js +207 -0
  382. package/dist/failure-taxonomy-FCEJXQX4.js +26 -0
  383. package/dist/flywheel-allowlist-revert-BCWV5L5T.js +1 -1
  384. package/dist/flywheel-autoloop-executor-OKVYXX6O.js +307 -0
  385. package/dist/flywheel-autoloop-unverified-ZO6OGV63.js +60 -0
  386. package/dist/flywheel-competition-executor-C6M5FI2A.js +324 -0
  387. package/dist/flywheel-executor-OPFNQ5DO.js +428 -0
  388. package/dist/flywheel-git-isolation-KBUQXVRL.js +50 -0
  389. package/dist/flywheel-manifest-6JVCFVNP.js +114 -0
  390. package/dist/flywheel-model-defaults-5OXQDJCG.js +115 -0
  391. package/dist/flywheel-preflight-5N2UWTYS.js +172 -0
  392. package/dist/flywheel-resume-ALKWQU3E.js +95 -0
  393. package/dist/flywheel-resume-execution-lease-SSEDP276.js +59 -0
  394. package/dist/flywheel-safety-FZYEDI7G.js +19 -0
  395. package/dist/flywheel-scope-decision-KO6UWGHG.js +14 -0
  396. package/dist/get-telemetry-logger-LWU4WCI5.js +153 -0
  397. package/dist/git-message-style-OBFYLGHX.js +105 -0
  398. package/dist/identity-6OB7NIFV.js +25 -0
  399. package/dist/index-query-ZXNSG63P.js +37 -0
  400. package/dist/index.js +1199 -1005
  401. package/dist/indexer-GMCTRQUJ.js +44 -0
  402. package/dist/init-K777TJZ5.js +244 -0
  403. package/dist/instructions-PS3QTCXV.js +188 -0
  404. package/dist/instructions-import-offer-NIYYZFCT.js +366 -0
  405. package/dist/instructions-run-NUX7OEJA.js +116 -0
  406. package/dist/interrupted-work-JJDX5BE2.js +43 -0
  407. package/dist/invocation-telemetry-ANFI74DI.js +78 -0
  408. package/dist/invoke-provider-auth-L23ZQG6Y.js +38 -0
  409. package/dist/lab-mode-3CV2FVEJ.js +44 -0
  410. package/dist/linux-host-class-YDZGPQ77.js +31 -0
  411. package/dist/llm-judge-executor-3TR2UI4M.js +180 -0
  412. package/dist/local-ci-config-QPMPQ3CN.js +50 -0
  413. package/dist/local-executor-Y4U6GGDZ.js +282 -0
  414. package/dist/logger-KHRXKL4E.js +152 -0
  415. package/dist/matrix-prompt-builder-CNCNXQAQ.js +536 -0
  416. package/dist/merge-batch-DU5EHGBP.js +322 -0
  417. package/dist/merge-queue-GB36JHMJ.js +126 -0
  418. package/dist/merge-queue-trust-6D2NH3SI.js +21 -0
  419. package/dist/metadata-45WCCBVK.js +29 -0
  420. package/dist/model-catalog-readiness-YRGBS7Q5.js +203 -0
  421. package/dist/model-invocations-db-HLIF6QDW.js +70 -0
  422. package/dist/model-resolver-OSKB64KV.js +215 -0
  423. package/dist/model-resolver-STIKZHLT.js +43 -0
  424. package/dist/monitor-SSW7KL4T.js +96 -0
  425. package/dist/next-7MVYLB45.js +97 -0
  426. package/dist/next-BZ2PHISP.js +150 -0
  427. package/dist/opportunistic-CKPHHTW7.js +86 -0
  428. package/dist/optimization-config-resolver-2QP2UWZN.js +148 -0
  429. package/dist/path-security-I5CLJDOY.js +39 -0
  430. package/dist/paths-37XBCAKZ.js +37 -0
  431. package/dist/plan-backlog-list-fast-S2WGMPWQ.js +88 -0
  432. package/dist/plan-backlog-show-fast-JFTAZCRN.js +111 -0
  433. package/dist/plan-sprint-list-fast-ZEAXVWGM.js +108 -0
  434. package/dist/plan-sprint-status-fast-UGUK6RXM.js +114 -0
  435. package/dist/plan-task-status-fast-VBMZHPQV.js +112 -0
  436. package/dist/process-registry-7OH7WULX.js +28 -0
  437. package/dist/process-scanner-X73A5I56.js +23 -0
  438. package/dist/processes-Q5S47K3W.js +29 -0
  439. package/dist/processes-json-fast-D4MGBC7J.js +72 -0
  440. package/dist/profile-TJUHSSII.js +207 -0
  441. package/dist/project-runtime-paths-Z4PJDEKQ.js +41 -0
  442. package/dist/provider-aware-resource-manager-HBRZTPIW.js +39 -0
  443. package/dist/provider-matrix-3YJKJDVU.js +212 -0
  444. package/dist/provider-output-forwarding-FRLPKRCE.js +26 -0
  445. package/dist/provider-registry-C64B4WNA.js +136 -0
  446. package/dist/publication-turn-PKP4MLTX.js +44 -0
  447. package/dist/quality-gate-ZFFFJ2FF.js +73 -0
  448. package/dist/quickstart-WO4JWPQW.js +107 -0
  449. package/dist/readiness-KB7T7ASY.js +214 -0
  450. package/dist/readiness-NJPGSWWZ.js +141 -0
  451. package/dist/registry-DKCEDGZB.js +215 -0
  452. package/dist/repo-root-V6U62IJP.js +28 -0
  453. package/dist/resolution-engine-LJ7LFNPS.js +190 -0
  454. package/dist/resolve-provider-cli-IID7EUQK.js +44 -0
  455. package/dist/restore-telemetry-db-2JXSMSTP.js +459 -0
  456. package/dist/routing-events-P7SHI273.js +13 -0
  457. package/dist/routing-history-store-6K6K7QPY.js +47 -0
  458. package/dist/routing-planner-5WP627QU.js +218 -0
  459. package/dist/runner-2GISBYE7.js +1815 -0
  460. package/dist/runner-VY4R2ZDQ.js +1202 -0
  461. package/dist/safety-VORB2OER.js +65 -0
  462. package/dist/safety-stanza-4N4EKGJW.js +49 -0
  463. package/dist/sandbox-SHNVGNYF.js +72 -0
  464. package/dist/sandbox-Z4UKFSX5.js +80 -0
  465. package/dist/setup-temp-cleanup-CCPUVRP4.js +29 -0
  466. package/dist/shared-utils-VQZQW5WD.js +42 -0
  467. package/dist/sprint-bridge-TDGT22W4.js +116 -0
  468. package/dist/sprint-completion-dependents-7PBL523O.js +43 -0
  469. package/dist/sprint-execution-service-4A76YEJK.js +373 -0
  470. package/dist/sprint-manager-X34JLIJU.js +132 -0
  471. package/dist/sqlite-timeout-config-HEXOFTMM.js +13 -0
  472. package/dist/sqlite-wrapper-4J37RTNE.js +19 -0
  473. package/dist/stale-cleanup-orchestrator-YICA3YEU.js +71 -0
  474. package/dist/storage-access-B3CPV4FH.js +31 -0
  475. package/dist/store-XPHC4MLJ.js +25 -0
  476. package/dist/task-classifier-C3E353M3.js +521 -0
  477. package/dist/task-list-fast-7LWCFIFE.js +108 -0
  478. package/dist/task-manager-2WSEVZ3E.js +130 -0
  479. package/dist/task-report-66CTVCDC.js +64 -0
  480. package/dist/telemetry-WBGBBPCQ.js +196 -0
  481. package/dist/telemetry-lab-scope-JG6HJRES.js +31 -0
  482. package/dist/telemetry-path-resolver-BDZFUGVT.js +34 -0
  483. package/dist/telemetry-reliability-V4BYE5NU.js +77 -0
  484. package/dist/unified-state-cleanup-XJND3PQ3.js +292 -0
  485. package/dist/universal-cost-calculator-QUD75SBH.js +70 -0
  486. package/dist/user-agents-ROOKUA2R.js +30 -0
  487. package/dist/variant-execution-EFILJOXO.js +317 -0
  488. package/dist/variant-opt-parser-65YRHC2B.js +248 -0
  489. package/dist/variant-state-cleanup-LAGQ6JZM.js +287 -0
  490. package/dist/variant-worker-WEYWKED2.js +4573 -0
  491. package/dist/variant-worker.js +4 -4
  492. package/dist/variants-XLUSJZ6F.js +262 -0
  493. package/dist/verification-command-IEVDCOET.js +67 -0
  494. package/dist/verify-commands-TTX4FMHU.js +67 -0
  495. package/dist/work-edge-GG7WSEBW.js +50 -0
  496. package/dist/worker-KOF2B33T.js +1528 -0
  497. package/dist/worker.js +4 -4
  498. package/dist/workspace-tree-identity-XGYRHWQE.js +52 -0
  499. package/dist/worktree-environment-NRWIGOUP.js +60 -0
  500. package/dist/worktree-metrics-AM45GE5L.js +66 -0
  501. package/dist/writeback-573M6DNN.js +51 -0
  502. package/docs/CLI_REFERENCE.md +8 -8
  503. package/docs/reference/AGENT_CONTEXT.md +53 -5
  504. package/npm-shrinkwrap.json +2 -2
  505. package/package.json +1 -1
  506. package/templates/AGENTS.template.md +10 -27
  507. package/templates/builtin-workflows/skills/execution-contract-code/SKILL.md +4 -2
  508. package/dist/ai-judge-DHVNPGD6.js +0 -190
  509. package/dist/allowlist-utils-C3O2QUMN.js +0 -29
  510. package/dist/apply-completion-mode-UHZ5CKEK.js +0 -112
  511. package/dist/artifact-migrator-FKXM2ZHW.js +0 -251
  512. package/dist/ask-MEVFZPUC.js +0 -178
  513. package/dist/auth-3H57UDCK.js +0 -165
  514. package/dist/auth-4IRDL27A.js +0 -97
  515. package/dist/auth-AG2MHA2W.js +0 -98
  516. package/dist/auth-MRSKG3B4.js +0 -44
  517. package/dist/auth-QK3AKGIO.js +0 -101
  518. package/dist/auth-SFJ3OE2R.js +0 -185
  519. package/dist/auth-SJVDTKGV.js +0 -99
  520. package/dist/auth-ZGPTUIVB.js +0 -93
  521. package/dist/auth-liveness-3DG6JMOQ.js +0 -53
  522. package/dist/autoloop-cleanup-M2S4SLL5.js +0 -106
  523. package/dist/autoloop-gate-policy-WSIDFFLA.js +0 -95
  524. package/dist/autoloop-helpers-YL7UAPVU.js +0 -53
  525. package/dist/autoloop-run-defaults-B5MWBDMU.js +0 -27
  526. package/dist/autoloop-success-YJ4VKQJS.js +0 -95
  527. package/dist/autoloop-trajectory-F2XRLEVN.js +0 -72
  528. package/dist/automatic-branch-cleanup-YI3NBVWP.js +0 -49
  529. package/dist/autonomous-loop-controller-NMXPBYG3.js +0 -4415
  530. package/dist/backend-CAFCYODQ.js +0 -24
  531. package/dist/backend-order-JS4KDP4I.js +0 -113
  532. package/dist/background-executor-MMH3OMGR.js +0 -263
  533. package/dist/backlog-WNDSXTB2.js +0 -390
  534. package/dist/backlog-execution-intent-2PBE2EEX.js +0 -81
  535. package/dist/backup-active-store-ZCGFMD2P.js +0 -16
  536. package/dist/backup-machine-stores-UTJXNZAF.js +0 -251
  537. package/dist/backup-telemetry-db-IEP7MX6U.js +0 -26
  538. package/dist/branch-cleanup-manager-742HVESE.js +0 -35
  539. package/dist/build-gate-NFMITBO4.js +0 -70
  540. package/dist/build-root-7KNOWDTS.js +0 -18
  541. package/dist/change-summary-NT2LQ5WF.js +0 -50
  542. package/dist/chunk-276XSIJL.js +0 -491
  543. package/dist/chunk-27ARK74R.js +0 -5405
  544. package/dist/chunk-2FE3E3AI.js +0 -25
  545. package/dist/chunk-2GK4YBEG.js +0 -248
  546. package/dist/chunk-2Q7POOGY.js +0 -852
  547. package/dist/chunk-2ZBV6557.js +0 -241
  548. package/dist/chunk-3AEKBPBM.js +0 -264
  549. package/dist/chunk-3FP7EZKJ.js +0 -884
  550. package/dist/chunk-3HK7W227.js +0 -160
  551. package/dist/chunk-3I7R646L.js +0 -753
  552. package/dist/chunk-3L5C37LL.js +0 -953
  553. package/dist/chunk-3O7A5WDE.js +0 -198
  554. package/dist/chunk-3OBVSKRE.js +0 -19
  555. package/dist/chunk-3P5IN5E7.js +0 -9
  556. package/dist/chunk-3PKZPQSS.js +0 -490
  557. package/dist/chunk-3RRDBY4I.js +0 -1437
  558. package/dist/chunk-3SRQN5HS.js +0 -1029
  559. package/dist/chunk-3VRJJOGI.js +0 -258
  560. package/dist/chunk-3W6RM44N.js +0 -307
  561. package/dist/chunk-3ZY37IGM.js +0 -263
  562. package/dist/chunk-436ME67N.js +0 -373
  563. package/dist/chunk-445GJ7SE.js +0 -83
  564. package/dist/chunk-4CKSGA2M.js +0 -50
  565. package/dist/chunk-4FRHN52E.js +0 -338
  566. package/dist/chunk-4G72QZO4.js +0 -204
  567. package/dist/chunk-4QBUZIZU.js +0 -1611
  568. package/dist/chunk-4TFD62AV.js +0 -179
  569. package/dist/chunk-5574ECX7.js +0 -53
  570. package/dist/chunk-56M4KK5M.js +0 -47
  571. package/dist/chunk-57K6DGM3.js +0 -34
  572. package/dist/chunk-5AXOWRWV.js +0 -951
  573. package/dist/chunk-5GBTIYB3.js +0 -2478
  574. package/dist/chunk-5IYSVNHJ.js +0 -568
  575. package/dist/chunk-5NAEIRF7.js +0 -178
  576. package/dist/chunk-5OMO5DOQ.js +0 -629
  577. package/dist/chunk-5QKU35YH.js +0 -26
  578. package/dist/chunk-5SLVJBMF.js +0 -43
  579. package/dist/chunk-5UAEDMLD.js +0 -152
  580. package/dist/chunk-5XHIYI3C.js +0 -699
  581. package/dist/chunk-63RRVYDB.js +0 -396
  582. package/dist/chunk-6AYIB2B3.js +0 -244
  583. package/dist/chunk-6EFUFGJ7.js +0 -912
  584. package/dist/chunk-6GETJDOF.js +0 -1853
  585. package/dist/chunk-6HNWT2WY.js +0 -189
  586. package/dist/chunk-6M5ZF2WE.js +0 -288
  587. package/dist/chunk-6RSSRBQO.js +0 -514
  588. package/dist/chunk-6UYJ473L.js +0 -109
  589. package/dist/chunk-6ZVBKSOF.js +0 -173
  590. package/dist/chunk-75ECMNFC.js +0 -410
  591. package/dist/chunk-776Q6UZ5.js +0 -326
  592. package/dist/chunk-7ABZ24VQ.js +0 -398
  593. package/dist/chunk-7AQTBZRG.js +0 -698
  594. package/dist/chunk-7B4XPQ3A.js +0 -300
  595. package/dist/chunk-7FD7YASE.js +0 -272
  596. package/dist/chunk-7HZMBYW6.js +0 -169
  597. package/dist/chunk-7KVDEYUR.js +0 -260
  598. package/dist/chunk-7O4GRYXK.js +0 -616
  599. package/dist/chunk-7PKBK54N.js +0 -128
  600. package/dist/chunk-A6TYJOSB.js +0 -43
  601. package/dist/chunk-AAP4LU4F.js +0 -426
  602. package/dist/chunk-ACMYGDEC.js +0 -523
  603. package/dist/chunk-ADCBA32I.js +0 -123
  604. package/dist/chunk-ADHCK4HP.js +0 -62
  605. package/dist/chunk-AESBIXW6.js +0 -225
  606. package/dist/chunk-AKAWLZRN.js +0 -1224
  607. package/dist/chunk-AL5XVEIF.js +0 -1402
  608. package/dist/chunk-ANZTCH7G.js +0 -88
  609. package/dist/chunk-AXPHA4LS.js +0 -598
  610. package/dist/chunk-AZDXVXJE.js +0 -224
  611. package/dist/chunk-B4TCZUIA.js +0 -116
  612. package/dist/chunk-BADCEBE3.js +0 -2950
  613. package/dist/chunk-BAT7354O.js +0 -181
  614. package/dist/chunk-BCGXEZRY.js +0 -487
  615. package/dist/chunk-BQRH2P5T.js +0 -293
  616. package/dist/chunk-C74D53T7.js +0 -459
  617. package/dist/chunk-CAT22O7B.js +0 -936
  618. package/dist/chunk-CFHVPNBS.js +0 -165
  619. package/dist/chunk-CJKUM5Q2.js +0 -60
  620. package/dist/chunk-CL7QXURF.js +0 -657
  621. package/dist/chunk-CNBPLPNN.js +0 -204
  622. package/dist/chunk-CNRT6QG2.js +0 -122
  623. package/dist/chunk-CPMXKU6U.js +0 -237
  624. package/dist/chunk-CWPSXIJJ.js +0 -142
  625. package/dist/chunk-DDQPETWE.js +0 -263
  626. package/dist/chunk-DEYAKXMN.js +0 -866
  627. package/dist/chunk-DI3DC4GT.js +0 -126
  628. package/dist/chunk-DJERA5KD.js +0 -334
  629. package/dist/chunk-DLYHD7JI.js +0 -115
  630. package/dist/chunk-DOMVDY3Y.js +0 -48
  631. package/dist/chunk-DR2JTVW3.js +0 -128
  632. package/dist/chunk-DY4LST2V.js +0 -159
  633. package/dist/chunk-DZZ2ETVO.js +0 -31
  634. package/dist/chunk-EBBMNMPE.js +0 -6283
  635. package/dist/chunk-EFFA3WG2.js +0 -737
  636. package/dist/chunk-EIKUSY4Y.js +0 -106
  637. package/dist/chunk-ELZHXS2U.js +0 -3639
  638. package/dist/chunk-ENTWET7B.js +0 -389
  639. package/dist/chunk-EONWEADC.js +0 -469
  640. package/dist/chunk-ESP4GKLS.js +0 -103
  641. package/dist/chunk-ETKKYQ6H.js +0 -568
  642. package/dist/chunk-EUVNDMSQ.js +0 -4048
  643. package/dist/chunk-EUXY3GSN.js +0 -1672
  644. package/dist/chunk-EYMZGPZ3.js +0 -272
  645. package/dist/chunk-F3O7SYOU.js +0 -1681
  646. package/dist/chunk-F76UFIGF.js +0 -73
  647. package/dist/chunk-FBZ3GP4S.js +0 -220
  648. package/dist/chunk-FGHL5MTF.js +0 -204
  649. package/dist/chunk-FJA75X7L.js +0 -3881
  650. package/dist/chunk-FM75V5EE.js +0 -120
  651. package/dist/chunk-FPJBEB7H.js +0 -209
  652. package/dist/chunk-FXUYKWHO.js +0 -535
  653. package/dist/chunk-GBPDPVDM.js +0 -1461
  654. package/dist/chunk-GDTQ66FN.js +0 -344
  655. package/dist/chunk-GGIM7NWW.js +0 -1414
  656. package/dist/chunk-GH4N25AZ.js +0 -205
  657. package/dist/chunk-GJFTLFHH.js +0 -637
  658. package/dist/chunk-GJRN3UFJ.js +0 -145
  659. package/dist/chunk-GL4DTEVY.js +0 -152
  660. package/dist/chunk-GQIMUVSC.js +0 -763
  661. package/dist/chunk-GR4OO7AT.js +0 -29
  662. package/dist/chunk-GRKSOYS4.js +0 -538
  663. package/dist/chunk-GTMMUVJG.js +0 -976
  664. package/dist/chunk-GUCSW7KT.js +0 -294
  665. package/dist/chunk-GW4SN5PD.js +0 -230
  666. package/dist/chunk-GWHGTG37.js +0 -36
  667. package/dist/chunk-GXIZDTSJ.js +0 -513
  668. package/dist/chunk-H4PFYO6G.js +0 -99
  669. package/dist/chunk-H7KLGNJF.js +0 -79
  670. package/dist/chunk-H7XNJSIW.js +0 -576
  671. package/dist/chunk-HCWGNUBL.js +0 -247
  672. package/dist/chunk-HEG24XUV.js +0 -160
  673. package/dist/chunk-HIJIYOZE.js +0 -318
  674. package/dist/chunk-HIOZZVWO.js +0 -1139
  675. package/dist/chunk-HMOOMDSM.js +0 -4692
  676. package/dist/chunk-HQYED5GO.js +0 -342
  677. package/dist/chunk-I3HFHBRJ.js +0 -371
  678. package/dist/chunk-I77BAOY4.js +0 -1052
  679. package/dist/chunk-I7U34C6J.js +0 -833
  680. package/dist/chunk-IIWNMEMI.js +0 -213
  681. package/dist/chunk-ILFIYNW6.js +0 -4301
  682. package/dist/chunk-ILYUN2LB.js +0 -206
  683. package/dist/chunk-IMURUMUU.js +0 -872
  684. package/dist/chunk-IOSKAEBC.js +0 -112
  685. package/dist/chunk-IQWXTKR2.js +0 -80
  686. package/dist/chunk-IWX5SVZ7.js +0 -1533
  687. package/dist/chunk-IYQLR4KG.js +0 -887
  688. package/dist/chunk-IZU2NMRQ.js +0 -3674
  689. package/dist/chunk-J75CV2J2.js +0 -48
  690. package/dist/chunk-JGKQYDI2.js +0 -1214
  691. package/dist/chunk-JVJVEQSC.js +0 -27
  692. package/dist/chunk-JY6DF4VH.js +0 -187
  693. package/dist/chunk-JZDU34B3.js +0 -360
  694. package/dist/chunk-JZHUN5I5.js +0 -305
  695. package/dist/chunk-K3WH2Y3Z.js +0 -2188
  696. package/dist/chunk-K7ZOJSTB.js +0 -891
  697. package/dist/chunk-KBGQOREQ.js +0 -188
  698. package/dist/chunk-KBWC7J6T.js +0 -167
  699. package/dist/chunk-KPJIEMFZ.js +0 -365
  700. package/dist/chunk-KQ3CTB3O.js +0 -977
  701. package/dist/chunk-KQSXPX76.js +0 -124
  702. package/dist/chunk-KV2JP3CE.js +0 -523
  703. package/dist/chunk-KXFJCM5O.js +0 -315
  704. package/dist/chunk-KXHYE63U.js +0 -112
  705. package/dist/chunk-L3XE627V.js +0 -39
  706. package/dist/chunk-L6SOMVXU.js +0 -107
  707. package/dist/chunk-LBGCV3MK.js +0 -242
  708. package/dist/chunk-LJ74VTCM.js +0 -339
  709. package/dist/chunk-LKESNV6N.js +0 -535
  710. package/dist/chunk-LKFANUFA.js +0 -380
  711. package/dist/chunk-LLZSXNS5.js +0 -758
  712. package/dist/chunk-LQFBZZB2.js +0 -525
  713. package/dist/chunk-LUVCS2BE.js +0 -68
  714. package/dist/chunk-LZ2PEIBR.js +0 -677
  715. package/dist/chunk-M3YQTSSL.js +0 -15192
  716. package/dist/chunk-M6UHOC4I.js +0 -553
  717. package/dist/chunk-MB274FPE.js +0 -2854
  718. package/dist/chunk-MJBEWU4E.js +0 -14
  719. package/dist/chunk-MLADI4OU.js +0 -304
  720. package/dist/chunk-MNI3JNZ2.js +0 -226
  721. package/dist/chunk-MQPLYUZG.js +0 -85
  722. package/dist/chunk-MQWAKQGT.js +0 -396
  723. package/dist/chunk-MSMYATWG.js +0 -63
  724. package/dist/chunk-MTPGRJBS.js +0 -4526
  725. package/dist/chunk-MVHPKG3F.js +0 -180
  726. package/dist/chunk-MVU3TQ3I.js +0 -31
  727. package/dist/chunk-N4OUM6GV.js +0 -489
  728. package/dist/chunk-N7KJHHOZ.js +0 -2369
  729. package/dist/chunk-NDT7Y6T5.js +0 -11995
  730. package/dist/chunk-NMJR5OPH.js +0 -6549
  731. package/dist/chunk-NSIK2M5L.js +0 -510
  732. package/dist/chunk-NVZFR6OW.js +0 -69
  733. package/dist/chunk-NYMUQVN6.js +0 -546
  734. package/dist/chunk-O4ZE44FO.js +0 -855
  735. package/dist/chunk-O6KSTAYD.js +0 -624
  736. package/dist/chunk-O6SA3YFV.js +0 -1242
  737. package/dist/chunk-O7GXZRHU.js +0 -465
  738. package/dist/chunk-OAODGJ32.js +0 -1104
  739. package/dist/chunk-OFJUORWH.js +0 -7024
  740. package/dist/chunk-OKDVN7LE.js +0 -4083
  741. package/dist/chunk-OLZ2LOYC.js +0 -962
  742. package/dist/chunk-OQ5KI3EO.js +0 -17592
  743. package/dist/chunk-OSPY52VO.js +0 -1232
  744. package/dist/chunk-OXHHHXJB.js +0 -1318
  745. package/dist/chunk-OZGCHIZG.js +0 -447
  746. package/dist/chunk-P4PXB27C.js +0 -485
  747. package/dist/chunk-P5574V6F.js +0 -229
  748. package/dist/chunk-PDUW42NU.js +0 -5113
  749. package/dist/chunk-PHLTLB4A.js +0 -572
  750. package/dist/chunk-PHV66KBQ.js +0 -152
  751. package/dist/chunk-PHWAE54T.js +0 -257
  752. package/dist/chunk-PJWKI4PY.js +0 -490
  753. package/dist/chunk-PL6SM4VU.js +0 -73
  754. package/dist/chunk-PMAYERFO.js +0 -392
  755. package/dist/chunk-PMKHR7AD.js +0 -860
  756. package/dist/chunk-PSISA5D4.js +0 -445
  757. package/dist/chunk-Q4J5PBIM.js +0 -1231
  758. package/dist/chunk-Q4L4UTE2.js +0 -73
  759. package/dist/chunk-Q6ENJZP6.js +0 -104
  760. package/dist/chunk-QCBUWOYE.js +0 -1754
  761. package/dist/chunk-QKUUOEZE.js +0 -49
  762. package/dist/chunk-QMHKEQKX.js +0 -24659
  763. package/dist/chunk-QMMGT6LX.js +0 -1489
  764. package/dist/chunk-QOZEEMKE.js +0 -78
  765. package/dist/chunk-QQOBYSG4.js +0 -81
  766. package/dist/chunk-QUL3GGBH.js +0 -4967
  767. package/dist/chunk-R6RSJ3HK.js +0 -121
  768. package/dist/chunk-RABQ54O3.js +0 -430
  769. package/dist/chunk-RBF3OAJ7.js +0 -353
  770. package/dist/chunk-RCD3YW3M.js +0 -1750
  771. package/dist/chunk-RD54F2FM.js +0 -2128
  772. package/dist/chunk-RJ2Y4VD2.js +0 -555
  773. package/dist/chunk-RKGYRRJN.js +0 -3588
  774. package/dist/chunk-RRLGIW4Q.js +0 -911
  775. package/dist/chunk-RTJFWZ5G.js +0 -529
  776. package/dist/chunk-RZE5ZGVD.js +0 -244
  777. package/dist/chunk-S4WWRIIW.js +0 -1358
  778. package/dist/chunk-S5SRUYAA.js +0 -126
  779. package/dist/chunk-SA66T3C6.js +0 -197
  780. package/dist/chunk-SAMACWNI.js +0 -236
  781. package/dist/chunk-SCYAJOMO.js +0 -302
  782. package/dist/chunk-SD5YZBX2.js +0 -147
  783. package/dist/chunk-SGKRG6A6.js +0 -1841
  784. package/dist/chunk-SINZRL5A.js +0 -293
  785. package/dist/chunk-SJ7EBFIV.js +0 -825
  786. package/dist/chunk-SLAKWX36.js +0 -450
  787. package/dist/chunk-STW24UBZ.js +0 -15697
  788. package/dist/chunk-SZMBOICG.js +0 -9623
  789. package/dist/chunk-T2LMBLZZ.js +0 -141
  790. package/dist/chunk-T2OTD6Q4.js +0 -916
  791. package/dist/chunk-T47G77BS.js +0 -66
  792. package/dist/chunk-T6LVKXOA.js +0 -129
  793. package/dist/chunk-TA77GVDI.js +0 -8991
  794. package/dist/chunk-TAP56GMB.js +0 -205
  795. package/dist/chunk-TAVRUR7B.js +0 -33
  796. package/dist/chunk-TM5ZDLBK.js +0 -650
  797. package/dist/chunk-TONJC7IG.js +0 -119
  798. package/dist/chunk-TQDDSAUB.js +0 -2155
  799. package/dist/chunk-TVBWFM3J.js +0 -3667
  800. package/dist/chunk-TVTSB2CC.js +0 -154
  801. package/dist/chunk-TYWPQ2PZ.js +0 -192
  802. package/dist/chunk-TZAMJD4S.js +0 -643
  803. package/dist/chunk-U7H3FT26.js +0 -193
  804. package/dist/chunk-UAYSX7EQ.js +0 -498
  805. package/dist/chunk-UJCLBPFX.js +0 -127
  806. package/dist/chunk-UQI5FSFT.js +0 -13
  807. package/dist/chunk-UQRJOE3L.js +0 -20
  808. package/dist/chunk-UVVDU6LY.js +0 -123
  809. package/dist/chunk-UWUYNFF4.js +0 -8254
  810. package/dist/chunk-VCKGW62M.js +0 -539
  811. package/dist/chunk-VG6VUZDZ.js +0 -1087
  812. package/dist/chunk-VTTNF3EM.js +0 -482
  813. package/dist/chunk-VYYMQGGU.js +0 -110
  814. package/dist/chunk-W6PMHAG6.js +0 -97
  815. package/dist/chunk-WAGVFGD4.js +0 -1108
  816. package/dist/chunk-WE7KTHMY.js +0 -267
  817. package/dist/chunk-WIWXIET7.js +0 -403
  818. package/dist/chunk-WJ2GWDJQ.js +0 -1063
  819. package/dist/chunk-WZ7ZP3OJ.js +0 -53
  820. package/dist/chunk-X5KHWQUT.js +0 -92
  821. package/dist/chunk-XEUWCZOJ.js +0 -115
  822. package/dist/chunk-XF4AI443.js +0 -19419
  823. package/dist/chunk-XFX757OH.js +0 -4933
  824. package/dist/chunk-XFXG23QS.js +0 -1133
  825. package/dist/chunk-XFZF2PJD.js +0 -61
  826. package/dist/chunk-XQJBZMHD.js +0 -2018
  827. package/dist/chunk-XXH7EUZD.js +0 -53
  828. package/dist/chunk-Y3VCYEME.js +0 -948
  829. package/dist/chunk-Y4ZWDBV2.js +0 -1041
  830. package/dist/chunk-Y57IJDBD.js +0 -2350
  831. package/dist/chunk-Y7NKKXMX.js +0 -527
  832. package/dist/chunk-YE3RJ4UF.js +0 -320
  833. package/dist/chunk-YFSW2X2Q.js +0 -5585
  834. package/dist/chunk-YH3KASXS.js +0 -96
  835. package/dist/chunk-YJAI74UZ.js +0 -2227
  836. package/dist/chunk-YJVL2BRM.js +0 -292
  837. package/dist/chunk-YK2EU5KA.js +0 -2170
  838. package/dist/chunk-YK7R6SM7.js +0 -1267
  839. package/dist/chunk-YSA3GBD6.js +0 -737
  840. package/dist/chunk-Z4Y56344.js +0 -342
  841. package/dist/chunk-ZA6RQ365.js +0 -47
  842. package/dist/chunk-ZABV5JUW.js +0 -521
  843. package/dist/chunk-ZAS2H4UN.js +0 -1429
  844. package/dist/chunk-ZBRAQYHO.js +0 -1102
  845. package/dist/chunk-ZDAZNRRJ.js +0 -151
  846. package/dist/chunk-ZKDOWP5F.js +0 -18
  847. package/dist/chunk-ZQXNQRKW.js +0 -306
  848. package/dist/chunk-ZU3BABSQ.js +0 -146
  849. package/dist/chunk-ZUMW6TFZ.js +0 -455
  850. package/dist/chunk-ZXN6QEGQ.js +0 -176
  851. package/dist/chunk-ZZFFR5QT.js +0 -90
  852. package/dist/chunk-ZZQM2AXO.js +0 -453
  853. package/dist/cli-utils-IUUYUL23.js +0 -31
  854. package/dist/cli-validation-3Y5CBVXR.js +0 -125
  855. package/dist/commit-utils-ZTUES23W.js +0 -50
  856. package/dist/compete-config-resolver-K5ZFIA7R.js +0 -126
  857. package/dist/compete-results-MRI2RBXO.js +0 -315
  858. package/dist/competition-outcome-tracker-EWNBAYGE.js +0 -63
  859. package/dist/config-5GEJLIHS.js +0 -237
  860. package/dist/config-VWMTFJA5.js +0 -46
  861. package/dist/config-audit-3ANEFCMF.js +0 -371
  862. package/dist/config-explain-PUQGDDQW.js +0 -71
  863. package/dist/config-loader-VGGXKEAR.js +0 -52
  864. package/dist/config-manager-5ZVIIEAM.js +0 -115
  865. package/dist/config-merger-GTK2LAMB.js +0 -14
  866. package/dist/config-validator-LWNDS4FZ.js +0 -123
  867. package/dist/cost-H4LZHVEG.js +0 -83
  868. package/dist/data-migration-state-IWTL2S75.js +0 -35
  869. package/dist/db-migrator-OGN6Z2AG.js +0 -34
  870. package/dist/default-paths-MKNRMMVV.js +0 -49
  871. package/dist/discovery-OIV7N6ZM.js +0 -53
  872. package/dist/doctor-2YLBWAOX.js +0 -268
  873. package/dist/doctor-context-blocks-UO7SG3NU.js +0 -233
  874. package/dist/doctor-instructions-import-FY5RLABK.js +0 -70
  875. package/dist/doctor-purpose-UY3UANLP.js +0 -30
  876. package/dist/domain-analyzer-QKIWVWWS.js +0 -48
  877. package/dist/ensure-initialized-IUDKZTD2.js +0 -76
  878. package/dist/error-parser-core-MZFMFANN.js +0 -70
  879. package/dist/evaluation-context-YPA6QNRG.js +0 -62
  880. package/dist/evidence-plan-resolver-C6G44Y35.js +0 -112
  881. package/dist/execution-data-writer-3OPHRWXQ.js +0 -78
  882. package/dist/execution-policy-applier-SFSYHJ64.js +0 -63
  883. package/dist/execution-preflight-WBMAWGLC.js +0 -224
  884. package/dist/execution-roles-WEOTECB5.js +0 -113
  885. package/dist/factory-TVHI7LIV.js +0 -207
  886. package/dist/flywheel-autoloop-executor-OOOKI63E.js +0 -307
  887. package/dist/flywheel-autoloop-unverified-PKNBV5DF.js +0 -37
  888. package/dist/flywheel-competition-executor-J6GVZDKT.js +0 -324
  889. package/dist/flywheel-executor-HUHV522T.js +0 -428
  890. package/dist/flywheel-git-isolation-HNYVZHAX.js +0 -50
  891. package/dist/flywheel-manifest-IMDPTLWY.js +0 -114
  892. package/dist/flywheel-model-defaults-JLQZOQE7.js +0 -116
  893. package/dist/flywheel-preflight-2NDK23MK.js +0 -173
  894. package/dist/flywheel-resume-OYOYKXOF.js +0 -96
  895. package/dist/flywheel-resume-execution-lease-WALKY6GR.js +0 -59
  896. package/dist/flywheel-safety-LQZE7Z6J.js +0 -19
  897. package/dist/flywheel-scope-decision-5XZ26YNX.js +0 -14
  898. package/dist/get-telemetry-logger-V2MGHWDR.js +0 -154
  899. package/dist/git-message-style-7F3U6S2E.js +0 -106
  900. package/dist/identity-HSTKXB4R.js +0 -25
  901. package/dist/index-query-6SECY5IF.js +0 -37
  902. package/dist/indexer-Q7NPA3F6.js +0 -44
  903. package/dist/init-DFMWM27C.js +0 -244
  904. package/dist/instructions-H5XNRNIH.js +0 -189
  905. package/dist/instructions-import-offer-CYIUSJPJ.js +0 -367
  906. package/dist/instructions-run-W2NQPO37.js +0 -116
  907. package/dist/interrupted-work-I3DUCAQC.js +0 -43
  908. package/dist/invoke-provider-auth-7ABM6LER.js +0 -38
  909. package/dist/lab-mode-QAKDCPGV.js +0 -44
  910. package/dist/linux-host-class-TBQ2S5CA.js +0 -31
  911. package/dist/llm-judge-executor-46KOVUAQ.js +0 -181
  912. package/dist/local-ci-config-QGMLX6MI.js +0 -51
  913. package/dist/local-executor-EWZJ3AIM.js +0 -282
  914. package/dist/logger-FWQ5DJ5J.js +0 -153
  915. package/dist/matrix-prompt-builder-BHLYTCPD.js +0 -537
  916. package/dist/merge-batch-F7LQY5HT.js +0 -323
  917. package/dist/merge-queue-LJ56HTT3.js +0 -127
  918. package/dist/merge-queue-trust-EF77O3F6.js +0 -21
  919. package/dist/metadata-5PME4NKN.js +0 -29
  920. package/dist/model-catalog-readiness-ZIASAOXQ.js +0 -204
  921. package/dist/model-invocations-db-JG452YT3.js +0 -70
  922. package/dist/model-resolver-TJQNYDKT.js +0 -215
  923. package/dist/model-resolver-ZPNOVV2T.js +0 -43
  924. package/dist/monitor-DZNOT4YL.js +0 -97
  925. package/dist/next-JQSH6MDJ.js +0 -98
  926. package/dist/next-TSFHAJX6.js +0 -151
  927. package/dist/opportunistic-CUH6SNNQ.js +0 -86
  928. package/dist/optimization-config-resolver-2XYSWZL5.js +0 -149
  929. package/dist/path-security-MXGK2DP5.js +0 -39
  930. package/dist/paths-VPYRA5OA.js +0 -37
  931. package/dist/plan-backlog-list-fast-MQXJPID4.js +0 -89
  932. package/dist/plan-backlog-show-fast-Y6TZYLIG.js +0 -112
  933. package/dist/plan-sprint-list-fast-2WRXKK3D.js +0 -109
  934. package/dist/plan-sprint-status-fast-U4YNAECG.js +0 -115
  935. package/dist/plan-task-status-fast-DKJWYRSW.js +0 -113
  936. package/dist/process-registry-IXGR4H5W.js +0 -28
  937. package/dist/process-scanner-T3GBV73O.js +0 -23
  938. package/dist/processes-RH6V3S3G.js +0 -29
  939. package/dist/processes-json-fast-AT7F4EZ6.js +0 -72
  940. package/dist/profile-GZGJF2ZT.js +0 -207
  941. package/dist/project-runtime-paths-QWSR4WA3.js +0 -41
  942. package/dist/provider-aware-resource-manager-X6ZKM37N.js +0 -39
  943. package/dist/provider-matrix-7FMEWDLS.js +0 -212
  944. package/dist/provider-output-forwarding-4EMU26RM.js +0 -26
  945. package/dist/provider-registry-N26MRRBF.js +0 -136
  946. package/dist/publication-turn-DH3G3PFO.js +0 -45
  947. package/dist/quality-gate-BO2TJQJY.js +0 -74
  948. package/dist/quickstart-BRJADHZS.js +0 -108
  949. package/dist/readiness-UO64EUJH.js +0 -215
  950. package/dist/readiness-VENBXEAE.js +0 -142
  951. package/dist/registry-SGSBDGXX.js +0 -215
  952. package/dist/repo-root-2X7E3ZDI.js +0 -28
  953. package/dist/resolution-engine-R6PSL7VO.js +0 -191
  954. package/dist/resolve-provider-cli-DIFMYCN6.js +0 -44
  955. package/dist/restore-telemetry-db-NQSD2TNE.js +0 -459
  956. package/dist/routing-events-KSNMBELI.js +0 -13
  957. package/dist/routing-history-store-AJSWAMNY.js +0 -47
  958. package/dist/routing-planner-7W2EA2FY.js +0 -218
  959. package/dist/runner-LZVKVDXG.js +0 -1201
  960. package/dist/runner-MNDHQ44A.js +0 -1809
  961. package/dist/safety-MN75ODFJ.js +0 -65
  962. package/dist/safety-stanza-CWYF7XKO.js +0 -49
  963. package/dist/sandbox-DLUK2MG4.js +0 -72
  964. package/dist/sandbox-ELRY4M2J.js +0 -80
  965. package/dist/setup-temp-cleanup-IBL5H7RE.js +0 -29
  966. package/dist/shared-utils-QT7VJ6SJ.js +0 -42
  967. package/dist/sprint-bridge-FNBAVD3Z.js +0 -117
  968. package/dist/sprint-completion-dependents-CRFEVAO7.js +0 -43
  969. package/dist/sprint-execution-service-XN27PXWK.js +0 -373
  970. package/dist/sprint-manager-NZ4FBS6Z.js +0 -133
  971. package/dist/sqlite-timeout-config-D2A7MCIQ.js +0 -13
  972. package/dist/sqlite-wrapper-CDFTT4FW.js +0 -19
  973. package/dist/stale-cleanup-orchestrator-6TDX3SJH.js +0 -71
  974. package/dist/storage-access-4PBODLIC.js +0 -31
  975. package/dist/store-JER6IA6W.js +0 -25
  976. package/dist/task-classifier-RVIQXTR7.js +0 -521
  977. package/dist/task-list-fast-32IFMIUP.js +0 -109
  978. package/dist/task-manager-SIUGB22A.js +0 -131
  979. package/dist/task-report-INARR6CG.js +0 -64
  980. package/dist/telemetry-XKOVBIU2.js +0 -197
  981. package/dist/telemetry-lab-scope-KTRP6ZIS.js +0 -31
  982. package/dist/telemetry-path-resolver-THWRQKSF.js +0 -34
  983. package/dist/telemetry-reliability-7KUQU727.js +0 -78
  984. package/dist/unified-state-cleanup-FRARWPCV.js +0 -292
  985. package/dist/universal-cost-calculator-KN2KHWOX.js +0 -70
  986. package/dist/user-agents-LVES6I5N.js +0 -30
  987. package/dist/variant-execution-L2O255ML.js +0 -317
  988. package/dist/variant-opt-parser-XHIIJOEQ.js +0 -248
  989. package/dist/variant-state-cleanup-QJIIRPS3.js +0 -287
  990. package/dist/variant-worker-GYKUY3TE.js +0 -4573
  991. package/dist/variants-FD3MZVQN.js +0 -262
  992. package/dist/verification-command-6HO365PA.js +0 -68
  993. package/dist/verify-commands-SYYVWMSJ.js +0 -68
  994. package/dist/work-edge-6LJRL65N.js +0 -50
  995. package/dist/worker-YNMJC4GB.js +0 -1528
  996. package/dist/workspace-tree-identity-EGQNGZC3.js +0 -53
  997. package/dist/worktree-environment-KYA25PEL.js +0 -65
  998. package/dist/worktree-metrics-33YN7IFM.js +0 -67
  999. package/dist/writeback-Q7T7I4S6.js +0 -51
@@ -1,1533 +0,0 @@
1
- import {
2
- getTelemetryLogger
3
- } from "./chunk-UQI5FSFT.js";
4
- import {
5
- SCHEMA_INVARIANTS,
6
- VARIANT_EXECUTION_COLUMNS,
7
- globalScope,
8
- projectScope
9
- } from "./chunk-OFJUORWH.js";
10
- import {
11
- TelemetryPathResolver
12
- } from "./chunk-GQIMUVSC.js";
13
- import {
14
- applySqlitePragmas
15
- } from "./chunk-57K6DGM3.js";
16
- import {
17
- emitTelemetryFallbackWarning
18
- } from "./chunk-YWBI5JWD.js";
19
- import {
20
- getGlobalTelemetryDir
21
- } from "./chunk-O6KSTAYD.js";
22
- import {
23
- emitWarning
24
- } from "./chunk-NMJR5OPH.js";
25
-
26
- // src/telemetry/dashboard.ts
27
- import fs from "fs";
28
- import path from "path";
29
- import Database from "better-sqlite3";
30
-
31
- // src/telemetry/trend-direction.ts
32
- var MIN_TASKS_FOR_TREND = 4;
33
- function classifyTrend(taskCount, change, withinStableBand) {
34
- if (taskCount < MIN_TASKS_FOR_TREND) return "insufficient_data";
35
- if (withinStableBand) return "stable";
36
- return change > 0 ? "improving" : "declining";
37
- }
38
-
39
- // src/telemetry/dashboard.ts
40
- var TelemetryDashboard = class _TelemetryDashboard {
41
- /**
42
- * Exclude synthetic test rows from dashboard queries.
43
- * Tests that leak into the real DB typically have NULL verdict and/or task IDs
44
- * prefixed with common test IDs (test-* and task-*).
45
- * Without this filter, synthetic rows appear as failures and distort success-rate metrics.
46
- */
47
- static REAL_DATA_FILTER = "verdict IS NOT NULL AND verdict != '' AND task_id NOT LIKE 'test-%' AND task_id NOT LIKE 'task-%'";
48
- /** SQLite database connection for variant execution telemetry */
49
- variantsDb;
50
- /** SQLite database connection for validation telemetry */
51
- validationsDb;
52
- enabled = true;
53
- projectScopeWhere;
54
- projectScopeParams;
55
- /**
56
- * Creates a new TelemetryDashboard instance
57
- *
58
- * Establishes connections to SQLite telemetry databases in .build-project/telemetry/db/
59
- *
60
- * @param options - Configuration options
61
- * @throws {Error} If database files cannot be accessed
62
- */
63
- constructor(options = {}) {
64
- const buildDir = options.buildDir || path.join(process.cwd(), ".build-project");
65
- const resolver = TelemetryPathResolver.getInstance();
66
- const dbDir = resolver.resolveDbDir(buildDir);
67
- const projectId = options.projectId?.trim() || resolver.getProjectId(buildDir, { register: false });
68
- const isGlobalDb = path.resolve(dbDir) === path.resolve(path.join(getGlobalTelemetryDir(), "db"));
69
- const tenancyScope = projectScope(projectId, {
70
- includeLabs: true,
71
- includeLegacyProjectRows: !isGlobalDb,
72
- legacyProjectIds: [""]
73
- });
74
- this.projectScopeWhere = tenancyScope.where;
75
- this.projectScopeParams = tenancyScope.params;
76
- try {
77
- if (!fs.existsSync(dbDir)) {
78
- fs.mkdirSync(dbDir, { recursive: true });
79
- }
80
- this.variantsDb = new Database(path.join(dbDir, "variants.db"));
81
- this.validationsDb = new Database(path.join(dbDir, "validations.db"));
82
- try {
83
- applySqlitePragmas(this.variantsDb);
84
- } catch {
85
- }
86
- try {
87
- applySqlitePragmas(this.validationsDb);
88
- } catch {
89
- }
90
- this.enabled = true;
91
- } catch (err) {
92
- console.warn(
93
- "Telemetry dashboard: directory creation failed, attempting to open DB files directly",
94
- err
95
- );
96
- try {
97
- this.variantsDb = new Database(path.join(dbDir, "variants.db"));
98
- this.validationsDb = new Database(path.join(dbDir, "validations.db"));
99
- try {
100
- applySqlitePragmas(this.variantsDb);
101
- } catch {
102
- }
103
- try {
104
- applySqlitePragmas(this.validationsDb);
105
- } catch {
106
- }
107
- this.enabled = true;
108
- } catch (err2) {
109
- emitWarning(
110
- "CFG-002",
111
- {
112
- taskId: "system",
113
- subsystem: "telemetry",
114
- executionPhase: "setup"
115
- },
116
- {
117
- severity: "ERROR" /* ERROR */,
118
- metadata: {
119
- operation: "dashboard_initialization",
120
- error: err2 instanceof Error ? err2.message : String(err2),
121
- dbDir
122
- }
123
- }
124
- );
125
- this.variantsDb = new Database(":memory:");
126
- this.validationsDb = new Database(":memory:");
127
- this.enabled = false;
128
- }
129
- }
130
- }
131
- /** Returns true if the dashboard has persistent DB backing (not in-memory fallback) */
132
- isEnabled() {
133
- return this.enabled;
134
- }
135
- /**
136
- * Retrieve leaderboard data with optional advanced metrics and CI bounds.
137
- * Returns structured rows for programmatic consumption (CLI export, UI).
138
- */
139
- getLeaderboardData(options = {}) {
140
- const filters = [
141
- this.projectScopeWhere,
142
- "completed_at IS NOT NULL",
143
- _TelemetryDashboard.REAL_DATA_FILTER
144
- ];
145
- const params = [...this.projectScopeParams];
146
- if (options.taskId && options.taskId.trim() !== "") {
147
- filters.push("task_id = ?");
148
- params.push(options.taskId.trim());
149
- }
150
- let baseQuery = `
151
- SELECT
152
- variant,
153
- COUNT(*) as total_tasks,
154
- SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) as successes,
155
- CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) as success_rate,
156
- AVG(completeness) as avg_completeness,
157
- AVG(total_duration_sec) as avg_duration_sec,
158
- MIN(started_at) as first_execution,
159
- MAX(started_at) as last_execution
160
- FROM variant_executions
161
- WHERE ${filters.join(" AND ")}
162
- GROUP BY variant
163
- ORDER BY COALESCE(success_rate * 0.5 + AVG(completeness) / 200.0, success_rate) DESC, total_tasks DESC, variant
164
- `;
165
- const limit = typeof options.limit === "number" && Number.isFinite(options.limit) && options.limit > 0 ? Math.floor(options.limit) : void 0;
166
- if (limit !== void 0) {
167
- baseQuery += " LIMIT ?";
168
- params.push(limit);
169
- }
170
- const stmt = this.variantsDb.prepare(baseQuery);
171
- const rows = params.length ? stmt.all(...params) : stmt.all();
172
- if (!rows) {
173
- return [];
174
- }
175
- const result = rows.map((row) => {
176
- const enriched = { ...row };
177
- if (options.includeCI) {
178
- const { lower, upper, width } = this.wilsonCI(row.success_rate, row.total_tasks);
179
- enriched.ci_lower = lower;
180
- enriched.ci_upper = upper;
181
- enriched.ci_width = width;
182
- }
183
- return enriched;
184
- });
185
- if (options.includeFScore) {
186
- const perVariantConf = this.computeConfusionByVariant();
187
- result.forEach((row) => {
188
- const conf = perVariantConf.get(row.variant);
189
- const fScores = this.calculateFScores(conf);
190
- if (!conf) {
191
- Object.assign(row, {
192
- ...fScores,
193
- mcc: null,
194
- balanced_accuracy: null
195
- });
196
- return;
197
- }
198
- const { tp, fp, tn, fn } = conf;
199
- const tpr = tp + fn > 0 ? tp / (tp + fn) : null;
200
- const tnr = tn + fp > 0 ? tn / (tn + fp) : null;
201
- const balancedAccuracy = tpr !== null && tnr !== null ? (tpr + tnr) / 2 : null;
202
- const mccDen = Math.sqrt((tp + fp) * (tp + fn) * (tn + fp) * (tn + fn));
203
- const mcc = mccDen > 0 ? (tp * tn - fp * fn) / mccDen : null;
204
- Object.assign(row, {
205
- ...fScores,
206
- mcc,
207
- balanced_accuracy: balancedAccuracy
208
- });
209
- });
210
- }
211
- return result;
212
- }
213
- /**
214
- * Retrieve prompt performance data with optional CI and F-scores.
215
- * Grouped by prompt_version with per-variant breakdowns.
216
- */
217
- getPromptPerformanceData(options = {}) {
218
- const query = `
219
- SELECT
220
- variant,
221
- prompt_version,
222
- COUNT(*) as sample_size,
223
- CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) as success_rate
224
- FROM variant_executions
225
- WHERE ${this.projectScopeWhere}
226
- AND completed_at IS NOT NULL AND prompt_version IS NOT NULL
227
- AND ${_TelemetryDashboard.REAL_DATA_FILTER}
228
- GROUP BY variant, prompt_version
229
- ORDER BY variant, prompt_version
230
- `;
231
- const rows = this.variantsDb.prepare(query).all(...this.projectScopeParams);
232
- if (rows.length === 0) return [];
233
- const confByVariantPrompt = options.includeFScore ? this.computeConfusionByVariantPrompt() : /* @__PURE__ */ new Map();
234
- const byPrompt = /* @__PURE__ */ new Map();
235
- rows.forEach((r) => {
236
- const arr = byPrompt.get(r.prompt_version) || [];
237
- const enriched = {
238
- variant: r.variant,
239
- prompt_version: r.prompt_version,
240
- total_tasks: r.sample_size,
241
- successes: Math.round(r.success_rate * r.sample_size),
242
- success_rate: r.success_rate,
243
- avg_completeness: null,
244
- // Not available in this query
245
- sample_size: r.sample_size
246
- };
247
- if (options.includeCI) {
248
- const { lower, upper } = this.wilsonCI(r.success_rate, r.sample_size);
249
- enriched.ci_lower = lower;
250
- enriched.ci_upper = upper;
251
- }
252
- if (options.includeFScore) {
253
- const key = `${r.variant}@@${r.prompt_version}`;
254
- const conf = confByVariantPrompt.get(key);
255
- Object.assign(enriched, this.calculateFScores(conf));
256
- }
257
- arr.push(enriched);
258
- byPrompt.set(r.prompt_version, arr);
259
- });
260
- const result = [];
261
- for (const [prompt, arr] of byPrompt.entries()) {
262
- const avgSuccessRate = arr.reduce((s, v) => s + v.success_rate, 0) / arr.length;
263
- const totalSamples = arr.reduce((s, v) => s + v.sample_size, 0);
264
- const mean = avgSuccessRate;
265
- const variance = arr.reduce((s, v) => s + (v.success_rate - mean) ** 2, 0) / arr.length;
266
- const consistencyScore = Math.max(0, 1 - Math.sqrt(variance));
267
- const shouldPrune = avgSuccessRate < 0.5 || totalSamples < 3 || consistencyScore < 0.3;
268
- result.push({
269
- prompt_version: prompt,
270
- total_samples: totalSamples,
271
- avg_success_rate: avgSuccessRate,
272
- consistency_score: consistencyScore,
273
- should_prune: shouldPrune,
274
- variants: arr.map((v) => ({
275
- variant: String(v.variant),
276
- sample_size: v.sample_size,
277
- success_rate: v.success_rate,
278
- ci_lower: v.ci_lower,
279
- ci_upper: v.ci_upper,
280
- precision: v.precision,
281
- recall: v.recall,
282
- f1: v.f1,
283
- f05: v.f05,
284
- f2: v.f2
285
- }))
286
- });
287
- }
288
- return result.sort(
289
- (a, b) => b.avg_success_rate * 0.7 + b.consistency_score * 0.3 - (a.avg_success_rate * 0.7 + a.consistency_score * 0.3)
290
- );
291
- }
292
- getTrendTaskGroups(limit) {
293
- const query = `
294
- SELECT task_id, variant, verdict, completeness, started_at, total_duration_sec
295
- FROM variant_executions
296
- WHERE ${this.projectScopeWhere}
297
- AND completed_at IS NOT NULL
298
- AND ${_TelemetryDashboard.REAL_DATA_FILTER}
299
- ORDER BY started_at DESC
300
- LIMIT ?
301
- `;
302
- const rows = this.variantsDb.prepare(query).all(...this.projectScopeParams, limit * 3);
303
- if (rows.length === 0) return [];
304
- const byVariant = {};
305
- rows.forEach((row) => {
306
- if (!byVariant[row.variant]) {
307
- byVariant[row.variant] = [];
308
- }
309
- const variantArray = byVariant[row.variant];
310
- if (variantArray) {
311
- variantArray.push(row);
312
- }
313
- });
314
- const groups = [];
315
- for (const variant of Object.keys(byVariant)) {
316
- const variantData = byVariant[variant];
317
- if (!variantData) continue;
318
- groups.push({ variant, tasks: variantData.slice(0, limit) });
319
- }
320
- return groups;
321
- }
322
- calculateTrendWindow(tasks) {
323
- const successes = tasks.filter((task) => task.verdict === "success").length;
324
- const successRate = tasks.length > 0 ? successes / tasks.length : 0;
325
- const avgCompleteness = tasks.reduce((sum, task) => sum + (task.completeness || 0), 0) / (tasks.length || 1);
326
- const recentWindow = Math.min(5, Math.floor(tasks.length / 2));
327
- const olderWindow = Math.min(5, tasks.length - recentWindow);
328
- const recentTasks = tasks.slice(0, recentWindow);
329
- const olderTasks = tasks.slice(recentWindow, recentWindow + olderWindow);
330
- const recentSuccessRate = recentTasks.length ? recentTasks.filter((task) => task.verdict === "success").length / recentTasks.length : 0;
331
- const olderSuccessRate = olderTasks.length ? olderTasks.filter((task) => task.verdict === "success").length / olderTasks.length : recentSuccessRate;
332
- return {
333
- successes,
334
- successRate,
335
- avgCompleteness,
336
- recentWindow,
337
- olderWindow,
338
- recentSuccessRate,
339
- olderSuccessRate,
340
- successTrend: recentSuccessRate - olderSuccessRate
341
- };
342
- }
343
- /**
344
- * Retrieve trend data with optional CI and validation fusion (warnings/errors).
345
- */
346
- getTrendsData(limit = 10, options = {}) {
347
- const out = [];
348
- for (const { variant, tasks } of this.getTrendTaskGroups(limit)) {
349
- const { successRate, avgCompleteness, recentSuccessRate, olderSuccessRate, successTrend } = this.calculateTrendWindow(tasks);
350
- const delta = successTrend * 100;
351
- const entry = {
352
- variant,
353
- tasks: tasks.length,
354
- success_rate: successRate,
355
- avg_completeness: avgCompleteness,
356
- recent_success_rate: recentSuccessRate,
357
- older_success_rate: olderSuccessRate,
358
- delta_pp: delta,
359
- trend: classifyTrend(tasks.length, delta, delta >= -5 && delta <= 5)
360
- };
361
- if (options.includeCI) {
362
- const { lower, upper } = this.wilsonCI(successRate, tasks.length);
363
- entry.ci_lower = lower;
364
- entry.ci_upper = upper;
365
- }
366
- if (options.includeValidationFusion) {
367
- const taskIds = tasks.map((t) => t.task_id);
368
- if (taskIds.length) {
369
- const placeholders = taskIds.map(() => "?").join(",");
370
- const validations = this.validationsDb.prepare(
371
- `SELECT task_id, AVG(warnings_count) as avg_warn, AVG(errors_count) as avg_err
372
- FROM validations WHERE ${this.projectScopeWhere}
373
- AND task_id IN (${placeholders}) GROUP BY task_id`
374
- ).all(...this.projectScopeParams, ...taskIds);
375
- const avgWarn = validations.reduce((s, v) => s + (v.avg_warn || 0), 0) / (validations.length || 1);
376
- const avgErr = validations.reduce((s, v) => s + (v.avg_err || 0), 0) / (validations.length || 1);
377
- entry.avg_validation_warnings = avgWarn;
378
- entry.avg_validation_errors = avgErr;
379
- entry.brittle_success = successRate >= 0.8 && (avgErr > 0 || avgWarn >= 2);
380
- }
381
- }
382
- out.push(entry);
383
- }
384
- return out;
385
- }
386
- /**
387
- * Generate variant performance leaderboard
388
- *
389
- * Queries the variant_executions table to rank all variants by a weighted score
390
- * combining success rate and completeness. Displays comprehensive performance
391
- * metrics in a formatted table with insights.
392
- *
393
- * **SQL Query Details:**
394
- * - **Table:** variant_executions
395
- * - **Filters:** completed_at IS NOT NULL (excludes in-flight executions)
396
- * - **Groups by:** variant
397
- * - **Orders by:** Weighted score DESC
398
- *
399
- * **Scoring Formula:**
400
- * ```
401
- * score = (success_rate × 0.5) + (avg_completeness / 100 × 0.5)
402
- * ```
403
- *
404
- * **Metrics Calculated:**
405
- * - Total tasks executed
406
- * - Success count and rate
407
- * - Average completeness percentage
408
- * - Average execution duration
409
- * - First and last execution timestamps
410
- *
411
- * **Output Format:**
412
- * - Table header with scoring explanation
413
- * - Ranked rows: Rank | Variant | Score | Success Rate | Completeness | Duration | Tasks
414
- * - Performance insights: Best performer and improvement opportunity
415
- *
416
- * @example
417
- * ```typescript
418
- * dashboard.leaderboard();
419
- * // Output:
420
- * //
421
- * // Ranked by weighted score: (success_rate × 0.5) + (completeness × 0.5)
422
- * //
423
- * // Rank | Variant | Score | Success Rate | Completeness | Duration | Tasks
424
- * //
425
- * // 1 | CLAUDE | 87.3 | 85.0% | 89.5% | 45s | 20
426
- * // 2 | CURSOR | 82.1 | 80.0% | 84.2% | 38s | 15
427
- * // ...
428
- * ```
429
- *
430
- * @returns {void} Prints formatted leaderboard to console
431
- */
432
- leaderboard(options = {}) {
433
- try {
434
- const results = this.getLeaderboardData({
435
- includeCI: true,
436
- includeFScore: true,
437
- taskId: options.taskId,
438
- limit: options.limit
439
- });
440
- if (results.length === 0) {
441
- console.log("No variant execution data available.");
442
- console.log(" Run some tasks to generate telemetry data.");
443
- return;
444
- }
445
- console.log("\nVariant Performance Leaderboard");
446
- console.log("Ranked by weighted score: (success_rate \xD7 0.5) + (completeness \xD7 0.5)");
447
- console.log("Rank | Variant | Score | Success Rate | Completeness | Duration | Tasks");
448
- const computeScore = (r) => r.avg_completeness != null ? r.success_rate * 0.5 + r.avg_completeness / 100 * 0.5 : r.success_rate;
449
- results.slice().sort((a, b) => computeScore(a) < computeScore(b) ? 1 : -1).forEach((row, i) => {
450
- const score = computeScore(row) * 100;
451
- const successRate = (row.success_rate * 100).toFixed(1);
452
- const completeness = row.avg_completeness != null ? row.avg_completeness.toFixed(1) : "N/A";
453
- const duration = row.avg_duration_sec ? `${Math.round(row.avg_duration_sec)}s` : "N/A";
454
- const variantPadded = row.variant.toUpperCase().padEnd(12);
455
- const scorePadded = `${score.toFixed(1)}`.padStart(5);
456
- const successPadded = `${successRate}%`.padStart(12);
457
- const completenessPadded = `${completeness}%`.padStart(12);
458
- const durationPadded = duration.padStart(8);
459
- const tasksPadded = row.total_tasks.toString().padStart(5);
460
- console.log(
461
- `${(i + 1).toString().padStart(4)} | ${variantPadded} | ${scorePadded} | ${successPadded} | ${completenessPadded} | ${durationPadded} | ${tasksPadded}`
462
- );
463
- const ciLower = row.ci_lower !== void 0 ? (row.ci_lower * 100).toFixed(1) : null;
464
- const ciUpper = row.ci_upper !== void 0 ? (row.ci_upper * 100).toFixed(1) : null;
465
- if (ciLower !== null && ciUpper !== null) {
466
- console.log(
467
- ` CI95: [${ciLower}%, ${ciUpper}%] ` + (row.f1 != null ? `F1: ${(row.f1 * 100).toFixed(1)} F0.5: ${row.f05 != null ? (row.f05 * 100).toFixed(1) : "\u2014"} F2: ${row.f2 != null ? (row.f2 * 100).toFixed(1) : "\u2014"}` : "")
468
- );
469
- }
470
- });
471
- const sorted = results.slice().sort((a, b) => computeScore(a) < computeScore(b) ? 1 : -1);
472
- const best = sorted[0];
473
- const worst = sorted[sorted.length - 1];
474
- if (best && worst) {
475
- console.log(
476
- `
477
- Best Performer: ${best.variant.toUpperCase()} (${(computeScore(best) * 100).toFixed(1)}/100)`
478
- );
479
- if (computeScore(worst) < computeScore(best)) {
480
- console.log(
481
- `Improvement Opportunity: ${worst.variant.toUpperCase()} (${(computeScore(worst) * 100).toFixed(1)}/100)`
482
- );
483
- }
484
- }
485
- if (sorted.length >= 2) {
486
- const a = sorted[0];
487
- const b = sorted[1];
488
- if (!a || !b) return;
489
- const { lower: aL, upper: aU } = this.wilsonCI(a.success_rate, a.total_tasks);
490
- const { lower: bL, upper: bU } = this.wilsonCI(b.success_rate, b.total_tasks);
491
- const overlap = !(aL > bU || bL > aU);
492
- const p = this.twoProportionPValue(
493
- a.successes,
494
- a.total_tasks - a.successes,
495
- b.successes,
496
- b.total_tasks - b.successes
497
- );
498
- if (!overlap && p < 0.05) {
499
- console.log(
500
- "Significance: Statistically higher than runner-up (p<0.05). Likely truly better."
501
- );
502
- } else {
503
- console.log("Significance: Likely indistinguishable at 95% CI. Collect more data.");
504
- }
505
- }
506
- } catch (error) {
507
- console.error("Error generating leaderboard:", error.message);
508
- console.log(" Ensure telemetry database exists and contains data.");
509
- }
510
- }
511
- /**
512
- * Analyze prompt performance across variants
513
- *
514
- * Queries variant_executions grouped by prompt_version to identify:
515
- * - Reliable prompts (high success rate, low variance)
516
- * - Unreliable prompts (low success rate, high variance)
517
- * - Prompts that should be pruned
518
- *
519
- * **SQL Query Details:**
520
- * - **Table:** variant_executions
521
- * - **Filters:** completed_at IS NOT NULL AND prompt_version IS NOT NULL
522
- * - **Groups by:** variant, prompt_version
523
- * - **Orders by:** variant, prompt_version
524
- *
525
- * **Analysis Methodology:**
526
- * 1. **Success Rate:** Average success across all variants for this prompt
527
- * 2. **Consistency Score:** 1 - sqrt(variance) where variance measures success rate spread
528
- * 3. **Overall Score:** success_rate × 0.7 + consistency_score × 0.3
529
- * 4. **Prune Recommendations:** Flags prompts with:
530
- * - Success rate < 50%
531
- * - Sample size < 3
532
- * - Consistency score < 0.3
533
- *
534
- * **Metrics Per Prompt:**
535
- * - Overall success rate across all variants
536
- * - Consistency score (0-100, higher = more consistent)
537
- * - Total sample size (sum across variants)
538
- * - Per-variant breakdown with success rates
539
- * - Pruning recommendation if applicable
540
- *
541
- * **Status Indicators:**
542
- * - EXCELLENT: ≥80% success rate
543
- * - GOOD: ≥60% success rate
544
- * - Fair: FAIR: ≥50% success rate
545
- * - PRUNE: <50% success rate or poor consistency
546
- *
547
- * @example
548
- * ```typescript
549
- * dashboard.promptPerformance();
550
- * // Output:
551
- * // Prompt: v2.1.0 EXCELLENT
552
- * //
553
- * // Overall Success Rate: 85.0%
554
- * // Consistency Score: 92.3%
555
- * // Total Sample Size: 45
556
- * // Variant Breakdown:
557
- * // claude : 87.5% success (n=16)
558
- * // cursor : 82.4% success (n=17)
559
- * // codex : 75.0% success (n=12)
560
- * // ...
561
- * ```
562
- *
563
- * @returns {void} Prints formatted prompt analysis to console
564
- */
565
- promptPerformance() {
566
- try {
567
- const promptAnalysis = this.getPromptPerformanceData();
568
- if (promptAnalysis.length === 0) {
569
- console.log("No prompt performance data available.");
570
- console.log(" Run tasks with different prompt versions to generate data.");
571
- return;
572
- }
573
- console.log("\nPrompt Performance Analysis");
574
- promptAnalysis.forEach((analysis) => {
575
- const {
576
- prompt_version: promptVersion,
577
- variants,
578
- avg_success_rate: avgSuccessRate,
579
- total_samples: totalSamples,
580
- consistency_score: consistencyScore,
581
- should_prune: shouldPrune
582
- } = analysis;
583
- const status = shouldPrune ? "PRUNE" : avgSuccessRate >= 0.8 ? "EXCELLENT" : avgSuccessRate >= 0.6 ? "GOOD" : "FAIR";
584
- console.log(`
585
- Prompt: ${promptVersion} ${status}`);
586
- console.log(`Overall Success Rate: ${(avgSuccessRate * 100).toFixed(1)}%`);
587
- console.log(`Consistency Score: ${(consistencyScore * 100).toFixed(1)}%`);
588
- console.log(`Total Sample Size: ${totalSamples}`);
589
- console.log("Variant Breakdown:");
590
- if (variants) {
591
- variants.forEach((v) => {
592
- const performance = v.success_rate >= 0.8 ? "EXCELLENT" : v.success_rate >= 0.6 ? "GOOD" : "PRUNE";
593
- console.log(
594
- ` ${performance} ${String(v.variant).padEnd(12)}: ${(v.success_rate * 100).toFixed(1)}% success (n=${v.sample_size})`
595
- );
596
- });
597
- }
598
- if (shouldPrune) {
599
- console.log("\nRECOMMENDATION: Consider pruning this prompt version");
600
- }
601
- });
602
- } catch (error) {
603
- console.error("Error analyzing prompt performance:", error.message);
604
- console.log(" Ensure telemetry database exists and contains data.");
605
- }
606
- }
607
- /**
608
- * Show historical performance trends over time
609
- *
610
- * Queries recent variant executions to analyze performance trends by comparing
611
- * recent vs. older task outcomes. Useful for identifying improving or declining
612
- * variant performance over time.
613
- *
614
- * **SQL Query Details:**
615
- * - **Table:** variant_executions
616
- * - **Filters:** completed_at IS NOT NULL
617
- * - **Orders by:** started_at DESC (most recent first)
618
- * - **Limit:** limit × 3 (allows showing limit tasks per variant)
619
- *
620
- * **Trend Analysis Methodology:**
621
- * 1. Splits tasks into two windows per variant:
622
- * - **Recent window:** Last N/2 tasks (up to 5 tasks)
623
- * - **Older window:** Previous N/2 tasks (up to 5 tasks)
624
- * 2. Compares success rates between windows
625
- * 3. Classifies trend as:
626
- * - **Improving:** Recent success rate >10% higher
627
- * - **Stable:** Within ±10% change
628
- * - **Declining:** Recent success rate >10% lower
629
- *
630
- * **Metrics Per Variant:**
631
- * - Overall success rate (all tasks in window)
632
- * - Average completeness percentage
633
- * - Recent window success rate
634
- * - Older window success rate
635
- * - Percentage point change with trend indicator
636
- *
637
- * @param limit - Maximum number of tasks to show per variant (default: 10)
638
- *
639
- * @example
640
- * ```typescript
641
- * dashboard.trends(15);
642
- * // Output:
643
- * // CLAUDE
644
- * //
645
- * // Overall Performance (15 tasks):
646
- * // Success Rate: 86.7% (13/15)
647
- * // Avg Completeness: 88.3%
648
- * //
649
- * // Trend Analysis (improving):
650
- * // Recent Success: 90.0% (last 5 tasks)
651
- * // Previous Success: 75.0% (previous 5 tasks)
652
- * // Change: +15.0 percentage points
653
- * // ...
654
- * ```
655
- *
656
- * @returns {void} Prints formatted trend analysis to console
657
- */
658
- trends(limit = 10) {
659
- try {
660
- const groups = this.getTrendTaskGroups(limit);
661
- if (groups.length === 0) {
662
- console.log("No historical trend data available.");
663
- console.log(" Run some tasks to generate trend data.");
664
- return;
665
- }
666
- console.log(`
667
- Historical Trends (last ${limit} tasks per variant)`);
668
- groups.forEach(({ variant, tasks }) => {
669
- if (tasks.length === 0) {
670
- return;
671
- }
672
- const {
673
- successes,
674
- successRate,
675
- avgCompleteness,
676
- recentWindow,
677
- olderWindow,
678
- recentSuccessRate,
679
- olderSuccessRate,
680
- successTrend
681
- } = this.calculateTrendWindow(tasks);
682
- const trendText = classifyTrend(
683
- tasks.length,
684
- successTrend,
685
- Math.abs(successTrend) < 0.1
686
- ).replace("_", " ");
687
- console.log(`
688
- ${variant.toUpperCase()} ${trendText}`);
689
- console.log(`Overall Performance (${tasks.length} tasks):`);
690
- console.log(
691
- ` Success Rate: ${(successRate * 100).toFixed(1)}% (${successes}/${tasks.length})`
692
- );
693
- console.log(` Avg Completeness: ${avgCompleteness.toFixed(1)}%`);
694
- console.log(`
695
- Trend Analysis (${trendText}):`);
696
- console.log(
697
- ` Recent Success: ${(recentSuccessRate * 100).toFixed(1)}% (last ${recentWindow} tasks)`
698
- );
699
- console.log(
700
- ` Previous Success: ${(olderSuccessRate * 100).toFixed(1)}% (previous ${olderWindow} tasks)`
701
- );
702
- console.log(
703
- ` Change: ${successTrend > 0 ? "+" : ""}${(successTrend * 100).toFixed(1)} percentage points`
704
- );
705
- });
706
- } catch (error) {
707
- console.error("Error analyzing trends:", error.message);
708
- console.log(" Ensure telemetry database exists and contains data.");
709
- }
710
- }
711
- /** Compute Wilson 95% CI for success rate */
712
- wilsonCI(p, n) {
713
- if (!n || n <= 0) return { lower: 0, upper: 1, width: 1 };
714
- const z = 1.96;
715
- const denom = 1 + z * z / n;
716
- const center = (p + z * z / (2 * n)) / denom;
717
- const margin = z / denom * Math.sqrt(p * (1 - p) / n + z * z / (4 * n * n));
718
- const lower = Math.max(0, center - margin);
719
- const upper = Math.min(1, center + margin);
720
- return { lower, upper, width: upper - lower };
721
- }
722
- /** Two-proportion z-test p-value (two-tailed). Inputs: successes/failures for A and B */
723
- twoProportionPValue(aSucc, aFail, bSucc, bFail) {
724
- const n1 = aSucc + aFail;
725
- const n2 = bSucc + bFail;
726
- if (n1 === 0 || n2 === 0) return 1;
727
- const p1 = aSucc / n1;
728
- const p2 = bSucc / n2;
729
- const pPool = (aSucc + bSucc) / (n1 + n2);
730
- const se = Math.sqrt(pPool * (1 - pPool) * (1 / n1 + 1 / n2));
731
- if (se === 0) return 1;
732
- const z = Math.abs((p1 - p2) / se);
733
- const p = 2 * (1 - this.normalCdf(z));
734
- return Math.max(0, Math.min(1, p));
735
- }
736
- /** Standard normal CDF approximation */
737
- normalCdf(z) {
738
- const t = 1 / (1 + 0.2316419 * z);
739
- const d = Math.exp(-0.5 * z * z) / Math.sqrt(2 * Math.PI);
740
- const poly = (((1.330274429 * t - 1.821255978) * t + 1.781477937) * t - 0.356563782) * t + 0.31938153;
741
- const approx = 1 - d * poly;
742
- return z >= 0 ? approx : 1 - approx;
743
- }
744
- calculateFScores(conf) {
745
- if (!conf) return { precision: null, recall: null, f1: null, f05: null, f2: null };
746
- const { tp, fp, fn } = conf;
747
- const precision = tp + fp > 0 ? tp / (tp + fp) : null;
748
- const recall = tp + fn > 0 ? tp / (tp + fn) : null;
749
- const f1 = precision && recall && precision + recall > 0 ? 2 * precision * recall / (precision + recall) : null;
750
- const beta05 = 0.5;
751
- const f05 = precision && recall && beta05 * beta05 * precision + recall > 0 ? (1 + beta05 * beta05) * precision * recall / (beta05 * beta05 * precision + recall) : null;
752
- const beta2 = 2;
753
- const f2 = precision && recall && beta2 * beta2 * precision + recall > 0 ? (1 + beta2 * beta2) * precision * recall / (beta2 * beta2 * precision + recall) : null;
754
- return { precision, recall, f1, f05, f2 };
755
- }
756
- /**
757
- * Compute confusion-matrix aggregates by variant, using validations as predictor
758
- * (predicted success = all validations for a task passed; conservative heuristic).
759
- */
760
- computeConfusionByVariant() {
761
- return this.computeConfusion("variant");
762
- }
763
- /** Confusion by variant+prompt_version for prompt analytics */
764
- computeConfusionByVariantPrompt() {
765
- return this.computeConfusion("variantPrompt");
766
- }
767
- computeConfusion(grouping) {
768
- const validations = this.validationsDb.prepare(
769
- `SELECT task_id, MIN(passed) as all_passed, COUNT(*) as cnt
770
- FROM validations WHERE ${this.projectScopeWhere} GROUP BY task_id`
771
- ).all(...this.projectScopeParams);
772
- const predMap = /* @__PURE__ */ new Map();
773
- validations.forEach((v) => {
774
- if (v.cnt > 0) predMap.set(v.task_id, v.all_passed);
775
- });
776
- const outcomeQuery = grouping === "variant" ? `SELECT task_id, variant, CASE WHEN verdict = 'success' THEN 1 ELSE 0 END as actual_success
777
- FROM variant_executions WHERE ${this.projectScopeWhere}
778
- AND completed_at IS NOT NULL AND ${_TelemetryDashboard.REAL_DATA_FILTER}` : `SELECT task_id, variant, prompt_version, CASE WHEN verdict = 'success' THEN 1 ELSE 0 END as actual_success
779
- FROM variant_executions WHERE ${this.projectScopeWhere}
780
- AND completed_at IS NOT NULL AND prompt_version IS NOT NULL
781
- AND ${_TelemetryDashboard.REAL_DATA_FILTER}`;
782
- const execRows = this.variantsDb.prepare(outcomeQuery).all(...this.projectScopeParams);
783
- const confByGroup = /* @__PURE__ */ new Map();
784
- for (const r of execRows) {
785
- const pred = grouping === "variantPrompt" ? predMap.has(r.task_id) ? predMap.get(r.task_id) : null : predMap.get(r.task_id);
786
- if (grouping === "variantPrompt" ? pred === null : pred === void 0) continue;
787
- const key = grouping === "variantPrompt" ? `${r.variant}@@${r.prompt_version}` : r.variant;
788
- let agg = confByGroup.get(key);
789
- if (!agg) {
790
- agg = { tp: 0, fp: 0, tn: 0, fn: 0 };
791
- confByGroup.set(key, agg);
792
- }
793
- if (pred === 1 && r.actual_success === 1) agg.tp++;
794
- else if (pred === 1 && r.actual_success === 0) agg.fp++;
795
- else if (pred === 0 && r.actual_success === 0) agg.tn++;
796
- else if (pred === 0 && r.actual_success === 1) agg.fn++;
797
- }
798
- return confByGroup;
799
- }
800
- /**
801
- * Close all database connections
802
- *
803
- * Cleanly closes the SQLite database connections for both variants and validations
804
- * databases. Should be called when the dashboard is no longer needed to free resources.
805
- *
806
- * @returns {void}
807
- *
808
- * @example
809
- * ```typescript
810
- * const dashboard = new TelemetryDashboard();
811
- * try {
812
- * dashboard.leaderboard();
813
- * dashboard.trends();
814
- * } finally {
815
- * // Always close connections
816
- * dashboard.close();
817
- * }
818
- * ```
819
- *
820
- * @remarks
821
- * This method is idempotent - calling it multiple times is safe and will not
822
- * throw errors. However, attempting to use dashboard methods after closing will
823
- * result in database errors.
824
- */
825
- close() {
826
- this.variantsDb.close();
827
- this.validationsDb.close();
828
- }
829
- };
830
-
831
- // src/telemetry/insights.ts
832
- import fs2 from "fs";
833
- import path2 from "path";
834
- import Database2 from "better-sqlite3";
835
- var TelemetryInsightEngine = class _TelemetryInsightEngine {
836
- static REAL_DATA_FILTER = "verdict IS NOT NULL AND verdict != '' AND task_id NOT LIKE 'test-%' AND task_id NOT LIKE 'task-%'";
837
- buildDir;
838
- variantsDb;
839
- enabled = true;
840
- enableRealTime;
841
- calculationInterval;
842
- intervalId;
843
- projectId;
844
- includeAllProjects;
845
- tenancy;
846
- projectScopeWhere;
847
- projectScopeParams;
848
- hasTerminationReasonColumn;
849
- /**
850
- * Initialize the TelemetryInsightEngine with configuration options.
851
- *
852
- * @param options - Configuration options for the insight engine
853
- */
854
- constructor(options = {}) {
855
- this.buildDir = options.buildDir || path2.join(process.cwd(), ".build-project");
856
- const resolver = TelemetryPathResolver.getInstance();
857
- const dbDir = resolver.resolveDbDir(this.buildDir);
858
- this.includeAllProjects = options.includeAllProjects === true;
859
- this.tenancy = this.includeAllProjects ? "all-projects" : "project";
860
- this.projectId = options.projectId?.trim() || resolver.getProjectId(this.buildDir, { register: false });
861
- const isGlobalDb = path2.resolve(dbDir) === path2.resolve(path2.join(getGlobalTelemetryDir(), "db"));
862
- const tenancyScope = this.includeAllProjects ? globalScope({ includeLabs: true }) : projectScope(this.projectId, {
863
- includeLabs: true,
864
- includeLegacyProjectRows: !isGlobalDb,
865
- legacyProjectIds: [""]
866
- });
867
- this.projectScopeWhere = tenancyScope.where;
868
- this.projectScopeParams = tenancyScope.params;
869
- this.enableRealTime = options.enableRealTime ?? false;
870
- this.calculationInterval = options.calculationInterval ?? 3e5;
871
- try {
872
- let parentDir = path2.dirname(dbDir);
873
- while (!fs2.existsSync(parentDir) && parentDir !== path2.dirname(parentDir)) {
874
- parentDir = path2.dirname(parentDir);
875
- }
876
- if (!fs2.existsSync(parentDir) || parentDir === path2.sep) {
877
- throw new Error(`Telemetry base directory cannot be created at: ${dbDir}`);
878
- }
879
- const parentStats = fs2.statSync(parentDir);
880
- if ((parentStats.mode & 146) === 0) {
881
- throw new Error(`Telemetry parent directory is not writable: ${parentDir}`);
882
- }
883
- if (!fs2.existsSync(dbDir)) {
884
- fs2.mkdirSync(dbDir, { recursive: true });
885
- }
886
- const stats = fs2.statSync(dbDir);
887
- const writable = (stats.mode & 146) !== 0;
888
- if (!writable) {
889
- throw new Error(`Telemetry DB directory is not writable: ${dbDir}`);
890
- }
891
- this.variantsDb = new Database2(path2.join(dbDir, "variants.db"));
892
- applySqlitePragmas(this.variantsDb);
893
- this.bootstrapSchema();
894
- this.enabled = true;
895
- } catch (err) {
896
- import("./warning-6Y44YYIR.js").then(({ emitTelemetryFallbackWarning: emitTelemetryFallbackWarning2 }) => {
897
- emitTelemetryFallbackWarning2(
898
- "could not initialize DB directory, using in-memory fallback",
899
- err
900
- );
901
- }).catch(() => {
902
- });
903
- this.enabled = false;
904
- this.variantsDb = new Database2(":memory:");
905
- this.bootstrapSchema();
906
- }
907
- if (this.enableRealTime) {
908
- this.startRealTimeMonitoring();
909
- }
910
- }
911
- bootstrapSchema() {
912
- const statements = [
913
- `CREATE TABLE IF NOT EXISTS variant_executions (
914
- id INTEGER PRIMARY KEY AUTOINCREMENT,
915
- project_id TEXT NOT NULL DEFAULT '',
916
- task_id TEXT,
917
- variant TEXT,
918
- prompt_version TEXT,
919
- completeness REAL,
920
- verdict TEXT,
921
- total_duration_sec REAL,
922
- started_at TEXT,
923
- completed_at TEXT,
924
- project_language TEXT,
925
- project_framework TEXT,
926
- provider TEXT,
927
- model TEXT,
928
- task_complexity TEXT,
929
- success_reason TEXT,
930
- failure_reason TEXT,
931
- code_quality_score REAL,
932
- testing_score REAL,
933
- documentation_score REAL,
934
- architecture_score REAL,
935
- anomaly_score REAL
936
- )`,
937
- "CREATE INDEX IF NOT EXISTS idx_variant_executions_variant ON variant_executions(variant)",
938
- "CREATE INDEX IF NOT EXISTS idx_variant_executions_prompt_version ON variant_executions(prompt_version)",
939
- "CREATE INDEX IF NOT EXISTS idx_variant_executions_completed_at ON variant_executions(completed_at)",
940
- "CREATE INDEX IF NOT EXISTS idx_variant_executions_project_language ON variant_executions(project_language)",
941
- "CREATE INDEX IF NOT EXISTS idx_variant_executions_task_id ON variant_executions(task_id)"
942
- ];
943
- for (const stmt of statements) {
944
- try {
945
- this.variantsDb.prepare(stmt).run();
946
- } catch (error) {
947
- emitTelemetryFallbackWarning("Schema bootstrap statement failed", error);
948
- }
949
- }
950
- try {
951
- this.variantsDb.prepare("ALTER TABLE variant_executions ADD COLUMN project_id TEXT NOT NULL DEFAULT ''").run();
952
- } catch {
953
- }
954
- }
955
- /**
956
- * Read-only check, cached per engine, for the termination_reason column. The
957
- * engine never alters the shared store schema to add it.
958
- */
959
- variantsHaveTerminationReason() {
960
- if (this.hasTerminationReasonColumn === void 0) {
961
- const columns = this.variantsDb.prepare("PRAGMA table_info(variant_executions)").all();
962
- this.hasTerminationReasonColumn = columns.some(
963
- (column) => column.name === "termination_reason"
964
- );
965
- }
966
- return this.hasTerminationReasonColumn;
967
- }
968
- insight(partial) {
969
- return {
970
- ...partial,
971
- tenancy: this.tenancy,
972
- timestamp: partial.timestamp ?? (/* @__PURE__ */ new Date()).toISOString(),
973
- data: {
974
- ...partial.data,
975
- tenancy: this.tenancy,
976
- ...this.includeAllProjects ? {} : { projectId: this.projectId }
977
- }
978
- };
979
- }
980
- scopeDisclosure() {
981
- return this.insight({
982
- type: "scope",
983
- severity: "info",
984
- title: "Cross-project telemetry scope",
985
- description: "These insights mix variant_executions rows from every project in the shared telemetry store. Predictive routing never uses this scope.",
986
- data: { includeAllProjects: true },
987
- recommendations: ["Omit --all-projects to restrict insights to the current repository"],
988
- confidence: 1
989
- });
990
- }
991
- /**
992
- * Distinct variants visible under the current tenancy filter.
993
- * Used by tests and as a cheap scoping check for the CLI.
994
- */
995
- listVisibleVariants() {
996
- const rows = this.variantsDb.prepare(
997
- `SELECT DISTINCT variant FROM variant_executions WHERE ${this.projectScopeWhere} ORDER BY variant`
998
- ).all(...this.projectScopeParams);
999
- return rows.map((row) => row.variant);
1000
- }
1001
- /** Returns true if the insight engine successfully initialized on-disk storage */
1002
- isEnabled() {
1003
- return this.enabled;
1004
- }
1005
- /**
1006
- * Generate comprehensive insights from telemetry data.
1007
- *
1008
- * Analyzes all available telemetry data to produce actionable insights
1009
- * across multiple dimensions: performance, optimization, prediction, and anomaly detection.
1010
- *
1011
- * @returns Array of insight results with recommendations
1012
- */
1013
- async generateInsights() {
1014
- const insights = [];
1015
- try {
1016
- if (this.includeAllProjects) {
1017
- insights.push(this.scopeDisclosure());
1018
- }
1019
- insights.push(...this.analyzePerformanceTrends());
1020
- insights.push(...this.generateOptimizationRecommendations());
1021
- insights.push(...this.generatePredictiveInsights());
1022
- insights.push(...this.detectAnomalies());
1023
- insights.sort((a, b) => {
1024
- const severityWeight = { critical: 3, warning: 2, info: 1 };
1025
- const aSeverity = severityWeight[a.severity];
1026
- const bSeverity = severityWeight[b.severity];
1027
- if (aSeverity !== bSeverity) {
1028
- return bSeverity - aSeverity;
1029
- }
1030
- return b.confidence - a.confidence;
1031
- });
1032
- return insights;
1033
- } catch (error) {
1034
- emitTelemetryFallbackWarning("Failed to generate insights", error);
1035
- return [];
1036
- }
1037
- }
1038
- /**
1039
- * Analyze performance trends across variants and providers.
1040
- *
1041
- * Success rate excludes canceled rows from the denominator, matching
1042
- * getVariantStats, so orchestrator cancellations are not counted as failures.
1043
- * A table without termination_reason cannot tell cancellations apart, so it
1044
- * keeps the all-rows denominator.
1045
- */
1046
- analyzePerformanceTrends() {
1047
- const insights = [];
1048
- const successRateExpr = this.variantsHaveTerminationReason() ? `CASE
1049
- WHEN SUM(CASE WHEN termination_reason NOT IN ('canceled_early_exit', 'canceled_budget', 'canceled_user') OR termination_reason IS NULL THEN 1 ELSE 0 END) = 0 THEN NULL
1050
- ELSE
1051
- CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) /
1052
- SUM(CASE WHEN termination_reason NOT IN ('canceled_early_exit', 'canceled_budget', 'canceled_user') OR termination_reason IS NULL THEN 1 ELSE 0 END)
1053
- END` : "CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) / COUNT(*)";
1054
- const query = `
1055
- SELECT
1056
- variant,
1057
- prompt_version,
1058
- COUNT(*) as total_tasks,
1059
- AVG(completeness) as avg_completeness,
1060
- ${successRateExpr} as success_rate,
1061
- AVG(total_duration_sec) as avg_duration,
1062
- MIN(started_at) as first_execution,
1063
- MAX(started_at) as last_execution
1064
- FROM variant_executions
1065
- WHERE ${this.projectScopeWhere}
1066
- AND completed_at IS NOT NULL
1067
- AND ${_TelemetryInsightEngine.REAL_DATA_FILTER}
1068
- AND datetime(started_at) > datetime('now', '-30 days')
1069
- GROUP BY variant, prompt_version
1070
- HAVING total_tasks >= 3 AND success_rate IS NOT NULL
1071
- ORDER BY success_rate DESC, avg_completeness DESC
1072
- `;
1073
- const results = this.variantsDb.prepare(query).all(...this.projectScopeParams);
1074
- if (results.length >= 2) {
1075
- const topPerformer = results[0];
1076
- const worstPerformer = results[results.length - 1];
1077
- const performanceGap = topPerformer.success_rate - worstPerformer.success_rate;
1078
- if (performanceGap > 0.3) {
1079
- insights.push(
1080
- this.insight({
1081
- type: "performance",
1082
- severity: "warning",
1083
- title: "Significant Performance Gap Detected",
1084
- description: `Variant ${topPerformer.variant} (v${topPerformer.prompt_version || "unknown"}) significantly outperforms ${worstPerformer.variant} (v${worstPerformer.prompt_version || "unknown"})`,
1085
- data: {
1086
- topPerformer: {
1087
- variant: topPerformer.variant,
1088
- version: topPerformer.prompt_version || "unknown",
1089
- successRate: topPerformer.success_rate,
1090
- completeness: topPerformer.avg_completeness
1091
- },
1092
- worstPerformer: {
1093
- variant: worstPerformer.variant,
1094
- version: worstPerformer.prompt_version || "unknown",
1095
- successRate: worstPerformer.success_rate,
1096
- completeness: worstPerformer.avg_completeness
1097
- },
1098
- gap: performanceGap
1099
- },
1100
- recommendations: [
1101
- `Consider using ${topPerformer.variant} variant for similar tasks`,
1102
- `Review and optimize ${worstPerformer.variant} prompt strategy`,
1103
- "Analyze successful patterns from top performer"
1104
- ],
1105
- confidence: 0.85
1106
- })
1107
- );
1108
- }
1109
- }
1110
- return insights;
1111
- }
1112
- /**
1113
- * Generate optimization recommendations based on performance data.
1114
- */
1115
- generateOptimizationRecommendations() {
1116
- const insights = [];
1117
- const promptQuery = `
1118
- SELECT
1119
- variant,
1120
- prompt_version,
1121
- COUNT(*) as sample_size,
1122
- AVG(completeness) as avg_completeness,
1123
- CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) as success_rate
1124
- FROM variant_executions
1125
- WHERE ${this.projectScopeWhere}
1126
- AND completed_at IS NOT NULL
1127
- AND prompt_version IS NOT NULL
1128
- AND ${_TelemetryInsightEngine.REAL_DATA_FILTER}
1129
- GROUP BY variant, prompt_version
1130
- HAVING sample_size >= 5
1131
- ORDER BY success_rate DESC
1132
- `;
1133
- const promptResults = this.variantsDb.prepare(promptQuery).all(...this.projectScopeParams);
1134
- const byVariant = /* @__PURE__ */ new Map();
1135
- promptResults.forEach((row) => {
1136
- const entries = byVariant.get(row.variant) || [];
1137
- entries.push(row);
1138
- byVariant.set(row.variant, entries);
1139
- });
1140
- for (const [variant, versions] of Array.from(byVariant.entries())) {
1141
- if (versions.length >= 2) {
1142
- const best = versions[0];
1143
- const current = versions.find(
1144
- (v) => v.prompt_version.includes("latest") || v.prompt_version.includes("current")
1145
- ) || versions[versions.length - 1];
1146
- if (best.success_rate - current.success_rate > 0.15) {
1147
- insights.push(
1148
- this.insight({
1149
- type: "optimization",
1150
- severity: "warning",
1151
- title: `Prompt Optimization Opportunity for ${variant}`,
1152
- description: `Version ${best.prompt_version} significantly outperforms current version ${current.prompt_version}`,
1153
- data: {
1154
- variant,
1155
- bestVersion: best.prompt_version,
1156
- currentVersion: current.prompt_version,
1157
- improvement: best.success_rate - current.success_rate,
1158
- bestSuccessRate: best.success_rate,
1159
- currentSuccessRate: current.success_rate
1160
- },
1161
- recommendations: [
1162
- `Consider promoting version ${best.prompt_version} to current`,
1163
- `Analyze differences between ${best.prompt_version} and ${current.prompt_version}`,
1164
- `Apply successful patterns from ${best.prompt_version} to future prompts`
1165
- ],
1166
- confidence: 0.78
1167
- })
1168
- );
1169
- }
1170
- }
1171
- }
1172
- return insights;
1173
- }
1174
- /**
1175
- * Generate predictive insights based on historical patterns.
1176
- */
1177
- generatePredictiveInsights() {
1178
- const insights = [];
1179
- const predictionQuery = `
1180
- SELECT
1181
- project_language,
1182
- project_framework,
1183
- COUNT(*) as total_tasks,
1184
- CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) as success_rate,
1185
- AVG(completeness) as avg_completeness,
1186
- AVG(total_duration_sec) as avg_duration
1187
- FROM variant_executions
1188
- WHERE ${this.projectScopeWhere}
1189
- AND completed_at IS NOT NULL
1190
- AND project_language IS NOT NULL
1191
- AND ${_TelemetryInsightEngine.REAL_DATA_FILTER}
1192
- GROUP BY project_language, project_framework
1193
- HAVING total_tasks >= 10
1194
- ORDER BY success_rate DESC
1195
- `;
1196
- const predictions = this.variantsDb.prepare(predictionQuery).all(...this.projectScopeParams);
1197
- const successfulScenarios = predictions.filter((p) => p.success_rate > 0.8);
1198
- const challengingScenarios = predictions.filter((p) => p.success_rate < 0.5);
1199
- if (successfulScenarios.length > 0 && challengingScenarios.length > 0) {
1200
- insights.push(
1201
- this.insight({
1202
- type: "prediction",
1203
- severity: "info",
1204
- title: "Project Type Success Patterns Identified",
1205
- description: `Analysis of ${predictions.length} project scenarios reveals distinct success patterns`,
1206
- data: {
1207
- successfulPatterns: successfulScenarios.slice(0, 3),
1208
- challengingPatterns: challengingScenarios.slice(0, 3),
1209
- totalAnalyzed: predictions.length
1210
- },
1211
- recommendations: [
1212
- "Leverage successful patterns for similar project types",
1213
- "Consider additional support for challenging scenarios",
1214
- "Adjust prompt strategies based on project characteristics"
1215
- ],
1216
- confidence: 0.72
1217
- })
1218
- );
1219
- }
1220
- return insights;
1221
- }
1222
- /**
1223
- * Detect anomalies in performance data.
1224
- */
1225
- detectAnomalies() {
1226
- const insights = [];
1227
- const durationQuery = `
1228
- SELECT
1229
- variant,
1230
- task_id,
1231
- total_duration_sec,
1232
- verdict,
1233
- completeness,
1234
- started_at
1235
- FROM variant_executions
1236
- WHERE ${this.projectScopeWhere}
1237
- AND completed_at IS NOT NULL
1238
- AND total_duration_sec IS NOT NULL
1239
- AND ${_TelemetryInsightEngine.REAL_DATA_FILTER}
1240
- AND started_at > datetime('now', '-7 days')
1241
- ORDER BY total_duration_sec DESC
1242
- LIMIT 20
1243
- `;
1244
- const durationResults = this.variantsDb.prepare(durationQuery).all(...this.projectScopeParams);
1245
- if (durationResults.length >= 5) {
1246
- const durations = durationResults.map((r) => r.total_duration_sec);
1247
- const mean = durations.reduce((a, b) => a + b, 0) / durations.length;
1248
- const stdDev = Math.sqrt(
1249
- durations.reduce((sq, n) => sq + (n - mean) ** 2, 0) / durations.length
1250
- );
1251
- const anomalies = durationResults.filter(
1252
- (r) => Math.abs(r.total_duration_sec - mean) > 2 * stdDev
1253
- );
1254
- if (anomalies.length > 0) {
1255
- insights.push(
1256
- this.insight({
1257
- type: "anomaly",
1258
- severity: "warning",
1259
- title: "Unusual Execution Duration Patterns Detected",
1260
- description: `Found ${anomalies.length} executions with unusual duration patterns`,
1261
- data: {
1262
- anomalies: anomalies.map((a) => ({
1263
- taskId: a.task_id,
1264
- variant: a.variant,
1265
- duration: a.total_duration_sec,
1266
- verdict: a.verdict,
1267
- deviation: Math.abs(a.total_duration_sec - mean) / stdDev
1268
- })),
1269
- averageDuration: mean,
1270
- standardDeviation: stdDev
1271
- },
1272
- recommendations: [
1273
- "Investigate unusually long or short executions",
1274
- "Check for timeout issues or incomplete work",
1275
- "Review task complexity estimates"
1276
- ],
1277
- confidence: 0.68
1278
- })
1279
- );
1280
- }
1281
- }
1282
- return insights;
1283
- }
1284
- /**
1285
- * Start real-time monitoring for continuous insight generation.
1286
- */
1287
- startRealTimeMonitoring() {
1288
- this.intervalId = setInterval(async () => {
1289
- try {
1290
- await this.generateInsights();
1291
- } catch (error) {
1292
- emitTelemetryFallbackWarning("Real-time insight generation failed", error);
1293
- }
1294
- }, this.calculationInterval);
1295
- }
1296
- /**
1297
- * Stop real-time monitoring.
1298
- */
1299
- stopRealTimeMonitoring() {
1300
- if (this.intervalId) {
1301
- clearInterval(this.intervalId);
1302
- this.intervalId = void 0;
1303
- }
1304
- }
1305
- /**
1306
- * Get provider performance DNA analysis.
1307
- *
1308
- * @internal Preview / not fully implemented. Only `provider`, a coarse
1309
- * `codeGeneration` capability, and `consistencyScore` are derived from real
1310
- * data; `model` is reported as `'unknown'` and `optimalUseCases`,
1311
- * `limitations`, and most adaptation fields are placeholders (empty/`null`).
1312
- * Public CLI surfaces must label this output as a preview and must not present
1313
- * the placeholder fields as real analytics.
1314
- */
1315
- async getProviderPerformanceDNA() {
1316
- const query = `
1317
- SELECT
1318
- CASE WHEN INSTR(variant, ':') > 0
1319
- THEN SUBSTR(variant, 1, INSTR(variant, ':') - 1)
1320
- ELSE variant
1321
- END as provider,
1322
- COUNT(*) as total_tasks,
1323
- CAST(SUM(CASE WHEN verdict = 'success' THEN 1 ELSE 0 END) AS REAL) / COUNT(*) as success_rate,
1324
- AVG(completeness) as avg_completeness,
1325
- AVG(total_duration_sec) as avg_duration
1326
- FROM variant_executions
1327
- WHERE ${this.projectScopeWhere}
1328
- AND completed_at IS NOT NULL
1329
- GROUP BY CASE WHEN INSTR(variant, ':') > 0
1330
- THEN SUBSTR(variant, 1, INSTR(variant, ':') - 1)
1331
- ELSE variant
1332
- END
1333
- HAVING total_tasks >= 5
1334
- `;
1335
- const results = this.variantsDb.prepare(query).all(...this.projectScopeParams);
1336
- return results.map((row) => ({
1337
- provider: row.provider,
1338
- model: "unknown",
1339
- // Would need more detailed tracking
1340
- capabilities: {
1341
- codeGeneration: row.success_rate,
1342
- debugging: null,
1343
- refactoring: null,
1344
- testing: null,
1345
- documentation: null,
1346
- architecture: null
1347
- },
1348
- optimalUseCases: [],
1349
- // Would need more detailed analysis
1350
- limitations: [],
1351
- // Would need failure pattern analysis
1352
- adaptationPatterns: {
1353
- learningRate: null,
1354
- consistencyScore: Math.min(row.success_rate / 0.8, 1),
1355
- contextRetention: null
1356
- }
1357
- }));
1358
- }
1359
- /**
1360
- * Analyze behavioral patterns from execution data.
1361
- *
1362
- * @internal Not yet implemented. Always returns an empty array; behavioral
1363
- * telemetry collection is not wired up. Do not present as real analytics.
1364
- */
1365
- async analyzeBehavioralPatterns() {
1366
- return [];
1367
- }
1368
- /**
1369
- * Generate semantic task profiles.
1370
- *
1371
- * @internal Not yet implemented. Always returns an empty array; semantic
1372
- * analysis is not wired up. Do not present as real analytics.
1373
- */
1374
- async generateSemanticProfiles() {
1375
- return [];
1376
- }
1377
- /**
1378
- * Start the telemetry insight engine
1379
- *
1380
- * Initializes the insight engine and prepares it for generating insights
1381
- * from telemetry data. This method must be called before using other
1382
- * insight engine functionality.
1383
- *
1384
- * @returns {void}
1385
- *
1386
- * @example
1387
- * ```typescript
1388
- * const engine = new TelemetryInsightEngine();
1389
- * engine.start();
1390
- * // Now the engine is ready to generate insights
1391
- * ```
1392
- */
1393
- start() {
1394
- if (!this.enabled) {
1395
- emitTelemetryFallbackWarning("TelemetryInsightEngine is disabled - using in-memory fallback");
1396
- return;
1397
- }
1398
- try {
1399
- this.variantsDb.prepare("SELECT 1").get();
1400
- if (this.enableRealTime) {
1401
- this.startRealTimeMonitoring();
1402
- }
1403
- } catch (error) {
1404
- emitTelemetryFallbackWarning("Failed to start TelemetryInsightEngine", error);
1405
- throw new Error("TelemetryInsightEngine database connection is not available");
1406
- }
1407
- }
1408
- /**
1409
- * Clean up resources and stop monitoring.
1410
- */
1411
- close() {
1412
- this.stopRealTimeMonitoring();
1413
- this.variantsDb.close();
1414
- }
1415
- };
1416
-
1417
- // src/telemetry/integrity-check.ts
1418
- function getSchemaColumns(db) {
1419
- return getTableColumns(db, "variant_executions");
1420
- }
1421
- function getTableColumns(db, table) {
1422
- try {
1423
- const rows = db.prepare(`PRAGMA table_info(${table})`).all();
1424
- return new Set(rows.map((r) => r.name));
1425
- } catch {
1426
- return /* @__PURE__ */ new Set();
1427
- }
1428
- }
1429
- function getWhitelistColumns() {
1430
- return new Set(VARIANT_EXECUTION_COLUMNS);
1431
- }
1432
- function validateTelemetryIntegrity(db) {
1433
- const schemaColumns = getSchemaColumns(db);
1434
- const whitelistColumns = getWhitelistColumns();
1435
- const excludedColumns = /* @__PURE__ */ new Set([
1436
- "id",
1437
- // Auto-increment primary key
1438
- "project_id",
1439
- // Scope dimension, always set by context-aware writers
1440
- "lab_id",
1441
- // Optional lab scoping dimension
1442
- "lab_run_id",
1443
- // Optional lab run scoping dimension
1444
- "task_id",
1445
- // Part of UNIQUE constraint, not dynamically updated
1446
- "variant",
1447
- // Part of UNIQUE constraint, not dynamically updated
1448
- "created_at",
1449
- // Auto-managed by DEFAULT CURRENT_TIMESTAMP
1450
- "updated_at",
1451
- // Auto-managed by DEFAULT CURRENT_TIMESTAMP
1452
- "commit_sha_before",
1453
- // Managed separately via git integration
1454
- "commit_sha_after",
1455
- // Managed separately via git integration
1456
- "workspace_edit_success_rate",
1457
- // Derived metric
1458
- "score_breakdown_json",
1459
- // Managed by judge evaluation system
1460
- "strategy",
1461
- // History only: variant strategy axis retired in schema v50, never written
1462
- "strategy_state"
1463
- // History only: retired with `strategy` in schema v50
1464
- ]);
1465
- const schemaNotInWhitelist = [];
1466
- const whitelistNotInSchema = [];
1467
- for (const col of schemaColumns) {
1468
- if (!whitelistColumns.has(col) && !excludedColumns.has(col)) {
1469
- schemaNotInWhitelist.push(col);
1470
- }
1471
- }
1472
- for (const col of whitelistColumns) {
1473
- if (!schemaColumns.has(col)) {
1474
- whitelistNotInSchema.push(col);
1475
- }
1476
- }
1477
- const tableColumnCache = /* @__PURE__ */ new Map();
1478
- for (const inv of SCHEMA_INVARIANTS) {
1479
- let cols = tableColumnCache.get(inv.table);
1480
- if (!cols) {
1481
- cols = getTableColumns(db, inv.table);
1482
- tableColumnCache.set(inv.table, cols);
1483
- }
1484
- if (cols.size === 0) continue;
1485
- if (!cols.has(inv.column)) {
1486
- schemaNotInWhitelist.push(`${inv.table}.${inv.column}`);
1487
- }
1488
- }
1489
- return {
1490
- schemaNotInWhitelist,
1491
- whitelistNotInSchema
1492
- };
1493
- }
1494
- function formatIntegrityReport(issues) {
1495
- const lines = [];
1496
- if (issues.schemaNotInWhitelist.length > 0) {
1497
- lines.push(
1498
- `Warning: Schema columns not in whitelist: ${issues.schemaNotInWhitelist.join(", ")}`
1499
- );
1500
- lines.push(" These columns exist but cannot be queried safely.");
1501
- lines.push(" Action: Add to VARIANT_EXECUTION_COLUMNS in variant-execution-columns.ts");
1502
- }
1503
- if (issues.whitelistNotInSchema.length > 0) {
1504
- lines.push(
1505
- `Warning: Whitelist columns not in schema: ${issues.whitelistNotInSchema.join(", ")}`
1506
- );
1507
- lines.push(" These whitelisted columns do not exist in the schema.");
1508
- lines.push(" Action: Remove from VARIANT_EXECUTION_COLUMNS or add to schema");
1509
- }
1510
- if (lines.length === 0) {
1511
- lines.push("OK: Telemetry integrity check passed");
1512
- }
1513
- return lines.join("\n");
1514
- }
1515
-
1516
- // src/telemetry/observability-metrics.ts
1517
- function recordMetric(name, value, tags) {
1518
- try {
1519
- getTelemetryLogger().logEvent(`metric:${name}`, { value, ...tags ?? {} });
1520
- } catch {
1521
- }
1522
- }
1523
-
1524
- export {
1525
- TelemetryDashboard,
1526
- TelemetryInsightEngine,
1527
- getSchemaColumns,
1528
- getWhitelistColumns,
1529
- validateTelemetryIntegrity,
1530
- formatIntegrityReport,
1531
- recordMetric
1532
- };
1533
- //# sourceMappingURL=chunk-IWX5SVZ7.js.map