@resolveio/server-lib 22.3.221 → 22.3.222

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 (745) hide show
  1. package/ai/assistant-core-heuristics.d.ts +11 -0
  2. package/ai/assistant-core-heuristics.js +356 -0
  3. package/ai/assistant-core-heuristics.js.map +1 -0
  4. package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +3 -0
  5. package/ai/resolveio-platform-intelligence-memory-corpus.js +214 -0
  6. package/ai/resolveio-platform-intelligence-memory-corpus.js.map +1 -0
  7. package/ai/resolveio-platform-intelligence-memory.d.ts +20 -0
  8. package/ai/resolveio-platform-intelligence-memory.js +341 -0
  9. package/ai/resolveio-platform-intelligence-memory.js.map +1 -0
  10. package/{src/ai/resolveio-platform-intelligence-types.ts → ai/resolveio-platform-intelligence-types.d.ts} +15 -20
  11. package/ai/resolveio-platform-intelligence-types.js +4 -0
  12. package/ai/resolveio-platform-intelligence-types.js.map +1 -0
  13. package/ai/resolveio-platform-intelligence.d.ts +6 -0
  14. package/ai/resolveio-platform-intelligence.js +463 -0
  15. package/ai/resolveio-platform-intelligence.js.map +1 -0
  16. package/client-server-app.d.ts +1 -0
  17. package/client-server-app.js +68 -0
  18. package/client-server-app.js.map +1 -0
  19. package/collections/ai-run.collection.d.ts +3 -0
  20. package/collections/ai-run.collection.js +170 -0
  21. package/collections/ai-run.collection.js.map +1 -0
  22. package/collections/ai-terminal-conversation.collection.d.ts +2 -0
  23. package/collections/ai-terminal-conversation.collection.js +140 -0
  24. package/collections/ai-terminal-conversation.collection.js.map +1 -0
  25. package/collections/ai-terminal-issue-report.collection.d.ts +2 -0
  26. package/collections/ai-terminal-issue-report.collection.js +148 -0
  27. package/collections/ai-terminal-issue-report.collection.js.map +1 -0
  28. package/collections/ai-terminal-message.collection.d.ts +2 -0
  29. package/collections/ai-terminal-message.collection.js +121 -0
  30. package/collections/ai-terminal-message.collection.js.map +1 -0
  31. package/collections/app-setting.collection.d.ts +3 -0
  32. package/collections/app-setting.collection.js +103 -0
  33. package/collections/app-setting.collection.js.map +1 -0
  34. package/collections/app-status.collection.d.ts +3 -0
  35. package/collections/app-status.collection.js +57 -0
  36. package/collections/app-status.collection.js.map +1 -0
  37. package/collections/communication-metric.collection.d.ts +2 -0
  38. package/collections/communication-metric.collection.js +133 -0
  39. package/collections/communication-metric.collection.js.map +1 -0
  40. package/collections/counter.collection.d.ts +3 -0
  41. package/collections/counter.collection.js +56 -0
  42. package/collections/counter.collection.js.map +1 -0
  43. package/collections/cron-job-history.collection.d.ts +3 -0
  44. package/collections/cron-job-history.collection.js +137 -0
  45. package/collections/cron-job-history.collection.js.map +1 -0
  46. package/collections/cron-job.collection.d.ts +3 -0
  47. package/collections/cron-job.collection.js +92 -0
  48. package/collections/cron-job.collection.js.map +1 -0
  49. package/collections/customer-notification.collection.d.ts +3 -0
  50. package/collections/customer-notification.collection.js +130 -0
  51. package/collections/customer-notification.collection.js.map +1 -0
  52. package/collections/customer-portal-password.collection.d.ts +3 -0
  53. package/collections/customer-portal-password.collection.js +75 -0
  54. package/collections/customer-portal-password.collection.js.map +1 -0
  55. package/collections/email-history.collection.d.ts +3 -0
  56. package/collections/email-history.collection.js +134 -0
  57. package/collections/email-history.collection.js.map +1 -0
  58. package/collections/email-verified.collection.d.ts +3 -0
  59. package/collections/email-verified.collection.js +62 -0
  60. package/collections/email-verified.collection.js.map +1 -0
  61. package/collections/file.collection.d.ts +3 -0
  62. package/collections/file.collection.js +74 -0
  63. package/collections/file.collection.js.map +1 -0
  64. package/collections/flag-update.collection.d.ts +3 -0
  65. package/collections/flag-update.collection.js +57 -0
  66. package/collections/flag-update.collection.js.map +1 -0
  67. package/collections/flag.collection.d.ts +3 -0
  68. package/collections/flag.collection.js +57 -0
  69. package/collections/flag.collection.js.map +1 -0
  70. package/collections/log-method-latency.collection.d.ts +3 -0
  71. package/collections/log-method-latency.collection.js +77 -0
  72. package/collections/log-method-latency.collection.js.map +1 -0
  73. package/collections/log-subscription.collection.d.ts +3 -0
  74. package/collections/log-subscription.collection.js +80 -0
  75. package/collections/log-subscription.collection.js.map +1 -0
  76. package/collections/log.collection.d.ts +3 -0
  77. package/collections/log.collection.js +93 -0
  78. package/collections/log.collection.js.map +1 -0
  79. package/collections/logged-in-users.collection.d.ts +3 -0
  80. package/collections/logged-in-users.collection.js +67 -0
  81. package/collections/logged-in-users.collection.js.map +1 -0
  82. package/collections/monitor-cpu.collection.d.ts +3 -0
  83. package/collections/monitor-cpu.collection.js +65 -0
  84. package/collections/monitor-cpu.collection.js.map +1 -0
  85. package/collections/monitor-function.collection.d.ts +3 -0
  86. package/collections/monitor-function.collection.js +74 -0
  87. package/collections/monitor-function.collection.js.map +1 -0
  88. package/collections/monitor-memory.collection.d.ts +3 -0
  89. package/collections/monitor-memory.collection.js +77 -0
  90. package/collections/monitor-memory.collection.js.map +1 -0
  91. package/collections/monitor-mongo.collection.d.ts +3 -0
  92. package/collections/monitor-mongo.collection.js +71 -0
  93. package/collections/monitor-mongo.collection.js.map +1 -0
  94. package/collections/notification.collection.d.ts +3 -0
  95. package/collections/notification.collection.js +57 -0
  96. package/collections/notification.collection.js.map +1 -0
  97. package/collections/openai-usage-ledger.collection.d.ts +2 -0
  98. package/collections/openai-usage-ledger.collection.js +188 -0
  99. package/collections/openai-usage-ledger.collection.js.map +1 -0
  100. package/collections/report-builder-dashboard-builder.collection.d.ts +3 -0
  101. package/collections/report-builder-dashboard-builder.collection.js +109 -0
  102. package/collections/report-builder-dashboard-builder.collection.js.map +1 -0
  103. package/collections/report-builder-library.collection.d.ts +3 -0
  104. package/collections/report-builder-library.collection.js +87 -0
  105. package/collections/report-builder-library.collection.js.map +1 -0
  106. package/collections/report-builder-report.collection.d.ts +4 -0
  107. package/collections/report-builder-report.collection.js +184 -0
  108. package/collections/report-builder-report.collection.js.map +1 -0
  109. package/collections/user-group.collection.d.ts +4 -0
  110. package/collections/user-group.collection.js +89 -0
  111. package/collections/user-group.collection.js.map +1 -0
  112. package/collections/user-guide.collection.d.ts +3 -0
  113. package/collections/user-guide.collection.js +57 -0
  114. package/collections/user-guide.collection.js.map +1 -0
  115. package/collections/user.collection.d.ts +4 -0
  116. package/collections/user.collection.js +180 -0
  117. package/collections/user.collection.js.map +1 -0
  118. package/cron/cron.d.ts +14 -0
  119. package/cron/cron.js +216 -0
  120. package/cron/cron.js.map +1 -0
  121. package/fixtures/cron-jobs.d.ts +1 -0
  122. package/fixtures/cron-jobs.js +150 -0
  123. package/fixtures/cron-jobs.js.map +1 -0
  124. package/fixtures/init.d.ts +1 -0
  125. package/fixtures/init.js +91 -0
  126. package/fixtures/init.js.map +1 -0
  127. package/http/auth.d.ts +2 -0
  128. package/http/auth.js +951 -0
  129. package/http/auth.js.map +1 -0
  130. package/http/health.d.ts +1 -0
  131. package/http/health.js +11 -0
  132. package/http/health.js.map +1 -0
  133. package/http/home.d.ts +1 -0
  134. package/http/home.js +134 -0
  135. package/http/home.js.map +1 -0
  136. package/http/slow-query-publication.d.ts +2 -0
  137. package/http/slow-query-publication.js +99 -0
  138. package/http/slow-query-publication.js.map +1 -0
  139. package/index.d.ts +1 -0
  140. package/index.js +19 -0
  141. package/index.js.map +1 -0
  142. package/managers/ai-assistant-codex-manager.manager.d.ts +67 -0
  143. package/managers/ai-assistant-codex-manager.manager.js +1113 -0
  144. package/managers/ai-assistant-codex-manager.manager.js.map +1 -0
  145. package/managers/ai-run-evidence.manager.d.ts +36 -0
  146. package/managers/ai-run-evidence.manager.js +377 -0
  147. package/managers/ai-run-evidence.manager.js.map +1 -0
  148. package/managers/communication-metric.manager.d.ts +16 -0
  149. package/managers/communication-metric.manager.js +134 -0
  150. package/managers/communication-metric.manager.js.map +1 -0
  151. package/managers/cron.manager.d.ts +20 -0
  152. package/managers/cron.manager.js +534 -0
  153. package/managers/cron.manager.js.map +1 -0
  154. package/managers/customer-notification-content.manager.d.ts +55 -0
  155. package/managers/customer-notification-content.manager.js +158 -0
  156. package/managers/customer-notification-content.manager.js.map +1 -0
  157. package/managers/diagnostic-manager-bootstrap.d.ts +9 -0
  158. package/managers/diagnostic-manager-bootstrap.js +260 -0
  159. package/managers/diagnostic-manager-bootstrap.js.map +1 -0
  160. package/managers/error-auto-fix.manager.d.ts +149 -0
  161. package/managers/error-auto-fix.manager.js +3064 -0
  162. package/managers/error-auto-fix.manager.js.map +1 -0
  163. package/managers/local-log.manager.d.ts +18 -0
  164. package/managers/local-log.manager.js +88 -0
  165. package/managers/local-log.manager.js.map +1 -0
  166. package/managers/method.manager.d.ts +84 -0
  167. package/managers/method.manager.js +1964 -0
  168. package/managers/method.manager.js.map +1 -0
  169. package/managers/mongo.manager.d.ts +224 -0
  170. package/managers/mongo.manager.js +5000 -0
  171. package/managers/mongo.manager.js.map +1 -0
  172. package/managers/monitor.manager.d.ts +70 -0
  173. package/managers/monitor.manager.js +550 -0
  174. package/managers/monitor.manager.js.map +1 -0
  175. package/managers/openai-usage-ledger.manager.d.ts +30 -0
  176. package/managers/openai-usage-ledger.manager.js +142 -0
  177. package/managers/openai-usage-ledger.manager.js.map +1 -0
  178. package/managers/slow-query-verifier.manager.d.ts +144 -0
  179. package/managers/slow-query-verifier.manager.js +3857 -0
  180. package/managers/slow-query-verifier.manager.js.map +1 -0
  181. package/managers/slow-query.manager.d.ts +28 -0
  182. package/managers/slow-query.manager.js +468 -0
  183. package/managers/slow-query.manager.js.map +1 -0
  184. package/managers/subscription.manager.d.ts +169 -0
  185. package/managers/subscription.manager.js +3434 -0
  186. package/managers/subscription.manager.js.map +1 -0
  187. package/managers/websocket.manager.d.ts +73 -0
  188. package/managers/websocket.manager.js +673 -0
  189. package/managers/websocket.manager.js.map +1 -0
  190. package/managers/worker-dispatcher.manager.d.ts +120 -0
  191. package/managers/worker-dispatcher.manager.js +1266 -0
  192. package/managers/worker-dispatcher.manager.js.map +1 -0
  193. package/managers/worker-server.manager.d.ts +35 -0
  194. package/managers/worker-server.manager.js +582 -0
  195. package/managers/worker-server.manager.js.map +1 -0
  196. package/methods/accounts.d.ts +2 -0
  197. package/methods/accounts.js +624 -0
  198. package/methods/accounts.js.map +1 -0
  199. package/methods/ai-terminal.d.ts +458 -0
  200. package/methods/ai-terminal.js +27991 -0
  201. package/methods/ai-terminal.js.map +1 -0
  202. package/methods/app-settings.d.ts +2 -0
  203. package/methods/app-settings.js +169 -0
  204. package/methods/app-settings.js.map +1 -0
  205. package/methods/aws.d.ts +2 -0
  206. package/methods/aws.js +877 -0
  207. package/methods/aws.js.map +1 -0
  208. package/methods/collections.d.ts +2 -0
  209. package/methods/collections.js +719 -0
  210. package/methods/collections.js.map +1 -0
  211. package/methods/counters.d.ts +2 -0
  212. package/methods/counters.js +113 -0
  213. package/methods/counters.js.map +1 -0
  214. package/methods/cron-jobs.d.ts +2 -0
  215. package/methods/cron-jobs.js +2475 -0
  216. package/methods/cron-jobs.js.map +1 -0
  217. package/methods/customer-notifications.d.ts +2 -0
  218. package/methods/customer-notifications.js +528 -0
  219. package/methods/customer-notifications.js.map +1 -0
  220. package/methods/diagnostics.d.ts +2 -0
  221. package/methods/diagnostics.js +703 -0
  222. package/methods/diagnostics.js.map +1 -0
  223. package/methods/flag-updates.d.ts +2 -0
  224. package/methods/flag-updates.js +8 -0
  225. package/methods/flag-updates.js.map +1 -0
  226. package/methods/flags.d.ts +2 -0
  227. package/methods/flags.js +8 -0
  228. package/methods/flags.js.map +1 -0
  229. package/methods/logs.d.ts +2 -0
  230. package/methods/logs.js +751 -0
  231. package/methods/logs.js.map +1 -0
  232. package/methods/mongo-explorer.d.ts +2 -0
  233. package/methods/mongo-explorer.js +1808 -0
  234. package/methods/mongo-explorer.js.map +1 -0
  235. package/methods/monitor.d.ts +2 -0
  236. package/methods/monitor.js +543 -0
  237. package/methods/monitor.js.map +1 -0
  238. package/methods/pdf.d.ts +2 -0
  239. package/methods/pdf.js +1216 -0
  240. package/methods/pdf.js.map +1 -0
  241. package/methods/publications.d.ts +1 -0
  242. package/methods/publications.js +183 -0
  243. package/methods/publications.js.map +1 -0
  244. package/methods/report-builder.d.ts +2 -0
  245. package/methods/report-builder.js +3094 -0
  246. package/methods/report-builder.js.map +1 -0
  247. package/methods/support.d.ts +2 -0
  248. package/methods/support.js +430 -0
  249. package/methods/support.js.map +1 -0
  250. package/models/ai-run.model.d.ts +19 -0
  251. package/models/ai-run.model.js +4 -0
  252. package/models/ai-run.model.js.map +1 -0
  253. package/models/ai-terminal-conversation.model.d.ts +17 -0
  254. package/models/ai-terminal-conversation.model.js +4 -0
  255. package/models/ai-terminal-conversation.model.js.map +1 -0
  256. package/models/ai-terminal-issue-report.model.d.ts +19 -0
  257. package/models/ai-terminal-issue-report.model.js +4 -0
  258. package/models/ai-terminal-issue-report.model.js.map +1 -0
  259. package/models/ai-terminal-message.model.d.ts +22 -0
  260. package/models/ai-terminal-message.model.js +4 -0
  261. package/models/ai-terminal-message.model.js.map +1 -0
  262. package/models/app-setting.model.d.ts +16 -0
  263. package/models/app-setting.model.js +4 -0
  264. package/models/app-setting.model.js.map +1 -0
  265. package/{src/models/app-status.model.ts → models/app-status.model.d.ts} +2 -3
  266. package/models/app-status.model.js +4 -0
  267. package/models/app-status.model.js.map +1 -0
  268. package/{src/models/billing-logged-in-users.model.ts → models/billing-logged-in-users.model.d.ts} +4 -5
  269. package/models/billing-logged-in-users.model.js +4 -0
  270. package/models/billing-logged-in-users.model.js.map +1 -0
  271. package/models/collection-document.model.d.ts +21 -0
  272. package/models/collection-document.model.js +4 -0
  273. package/models/collection-document.model.js.map +1 -0
  274. package/models/communication-metric.model.d.ts +20 -0
  275. package/models/communication-metric.model.js +4 -0
  276. package/models/communication-metric.model.js.map +1 -0
  277. package/{src/models/counter.model.ts → models/counter.model.d.ts} +3 -4
  278. package/models/counter.model.js +4 -0
  279. package/models/counter.model.js.map +1 -0
  280. package/models/cron-job-history.model.d.ts +15 -0
  281. package/models/cron-job-history.model.js +4 -0
  282. package/models/cron-job-history.model.js.map +1 -0
  283. package/models/cron-job.model.d.ts +14 -0
  284. package/models/cron-job.model.js +4 -0
  285. package/models/cron-job.model.js.map +1 -0
  286. package/models/customer-notification.model.d.ts +26 -0
  287. package/models/customer-notification.model.js +4 -0
  288. package/models/customer-notification.model.js.map +1 -0
  289. package/models/customer-portal-password.model.d.ts +11 -0
  290. package/models/customer-portal-password.model.js +4 -0
  291. package/models/customer-portal-password.model.js.map +1 -0
  292. package/models/dialog.model.d.ts +23 -0
  293. package/models/dialog.model.js +4 -0
  294. package/models/dialog.model.js.map +1 -0
  295. package/models/email-history.model.d.ts +32 -0
  296. package/{src/models/email-history.model.ts → models/email-history.model.js} +4 -36
  297. package/models/email-history.model.js.map +1 -0
  298. package/{src/models/email-verified.model.ts → models/email-verified.model.d.ts} +5 -6
  299. package/models/email-verified.model.js +4 -0
  300. package/models/email-verified.model.js.map +1 -0
  301. package/{src/models/file.model.ts → models/file.model.d.ts} +7 -8
  302. package/models/file.model.js +4 -0
  303. package/models/file.model.js.map +1 -0
  304. package/{src/models/flag-update.model.ts → models/flag-update.model.d.ts} +3 -4
  305. package/models/flag-update.model.js +4 -0
  306. package/models/flag-update.model.js.map +1 -0
  307. package/{src/models/flag.model.ts → models/flag.model.d.ts} +3 -4
  308. package/models/flag.model.js +4 -0
  309. package/models/flag.model.js.map +1 -0
  310. package/models/log-method-latency.model.d.ts +10 -0
  311. package/models/log-method-latency.model.js +4 -0
  312. package/models/log-method-latency.model.js.map +1 -0
  313. package/{src/models/log-subscription.model.ts → models/log-subscription.model.d.ts} +9 -11
  314. package/models/log-subscription.model.js +4 -0
  315. package/models/log-subscription.model.js.map +1 -0
  316. package/models/log.model.d.ts +17 -0
  317. package/models/log.model.js +4 -0
  318. package/models/log.model.js.map +1 -0
  319. package/{src/models/logged-in-users.model.ts → models/logged-in-users.model.d.ts} +5 -6
  320. package/models/logged-in-users.model.js +4 -0
  321. package/models/logged-in-users.model.js.map +1 -0
  322. package/{src/models/method-response.model.ts → models/method-response.model.d.ts} +6 -7
  323. package/models/method-response.model.js +4 -0
  324. package/models/method-response.model.js.map +1 -0
  325. package/models/method.model.d.ts +26 -0
  326. package/models/method.model.js +4 -0
  327. package/models/method.model.js.map +1 -0
  328. package/{src/models/monitor-cpu.model.ts → models/monitor-cpu.model.d.ts} +7 -9
  329. package/models/monitor-cpu.model.js +4 -0
  330. package/models/monitor-cpu.model.js.map +1 -0
  331. package/models/monitor-function.model.d.ts +14 -0
  332. package/models/monitor-function.model.js +4 -0
  333. package/models/monitor-function.model.js.map +1 -0
  334. package/models/monitor-memory.model.d.ts +15 -0
  335. package/models/monitor-memory.model.js +4 -0
  336. package/models/monitor-memory.model.js.map +1 -0
  337. package/models/monitor-mongo.model.d.ts +13 -0
  338. package/models/monitor-mongo.model.js +4 -0
  339. package/models/monitor-mongo.model.js.map +1 -0
  340. package/{src/models/notification.model.ts → models/notification.model.d.ts} +4 -6
  341. package/models/notification.model.js +4 -0
  342. package/models/notification.model.js.map +1 -0
  343. package/models/openai-usage-ledger.model.d.ts +30 -0
  344. package/models/openai-usage-ledger.model.js +4 -0
  345. package/models/openai-usage-ledger.model.js.map +1 -0
  346. package/models/pagination.model.d.ts +11 -0
  347. package/models/pagination.model.js +28 -0
  348. package/models/pagination.model.js.map +1 -0
  349. package/models/permission.model.d.ts +12 -0
  350. package/models/permission.model.js +4 -0
  351. package/models/permission.model.js.map +1 -0
  352. package/models/report-builder-dashboard-builder.model.d.ts +25 -0
  353. package/models/report-builder-dashboard-builder.model.js +4 -0
  354. package/models/report-builder-dashboard-builder.model.js.map +1 -0
  355. package/models/report-builder-library.model.d.ts +17 -0
  356. package/models/report-builder-library.model.js +4 -0
  357. package/models/report-builder-library.model.js.map +1 -0
  358. package/models/report-builder-report.model.d.ts +121 -0
  359. package/models/report-builder-report.model.js +4 -0
  360. package/models/report-builder-report.model.js.map +1 -0
  361. package/models/report-builder.model.d.ts +61 -0
  362. package/models/report-builder.model.js +4 -0
  363. package/models/report-builder.model.js.map +1 -0
  364. package/models/select-data-label.model.d.ts +9 -0
  365. package/models/select-data-label.model.js +4 -0
  366. package/models/select-data-label.model.js.map +1 -0
  367. package/models/server-message.model.d.ts +32 -0
  368. package/models/server-message.model.js +4 -0
  369. package/models/server-message.model.js.map +1 -0
  370. package/models/slow-query-report.model.d.ts +23 -0
  371. package/models/slow-query-report.model.js +4 -0
  372. package/models/slow-query-report.model.js.map +1 -0
  373. package/models/subscription.model.d.ts +31 -0
  374. package/models/subscription.model.js +4 -0
  375. package/models/subscription.model.js.map +1 -0
  376. package/models/support-ticket.model.d.ts +87 -0
  377. package/models/support-ticket.model.js +4 -0
  378. package/models/support-ticket.model.js.map +1 -0
  379. package/models/user-group.model.d.ts +20 -0
  380. package/models/user-group.model.js +4 -0
  381. package/models/user-group.model.js.map +1 -0
  382. package/{src/models/user-guide.model.ts → models/user-guide.model.d.ts} +4 -5
  383. package/models/user-guide.model.js +4 -0
  384. package/models/user-guide.model.js.map +1 -0
  385. package/models/user.model.d.ts +84 -0
  386. package/models/user.model.js +4 -0
  387. package/models/user.model.js.map +1 -0
  388. package/package.json +1 -1
  389. package/private/images/ResolveIO.png +0 -0
  390. package/public_api.js +127 -0
  391. package/public_api.js.map +1 -0
  392. package/publications/ai-terminal.d.ts +1 -0
  393. package/publications/ai-terminal.js +122 -0
  394. package/publications/ai-terminal.js.map +1 -0
  395. package/publications/app-settings.d.ts +2 -0
  396. package/publications/app-settings.js +28 -0
  397. package/publications/app-settings.js.map +1 -0
  398. package/publications/app-status.d.ts +2 -0
  399. package/publications/app-status.js +16 -0
  400. package/publications/app-status.js.map +1 -0
  401. package/publications/cron-jobs.d.ts +2 -0
  402. package/publications/cron-jobs.js +88 -0
  403. package/publications/cron-jobs.js.map +1 -0
  404. package/publications/customer-notifications.d.ts +2 -0
  405. package/publications/customer-notifications.js +161 -0
  406. package/publications/customer-notifications.js.map +1 -0
  407. package/publications/files.d.ts +2 -0
  408. package/publications/files.js +36 -0
  409. package/publications/files.js.map +1 -0
  410. package/publications/flags-update.d.ts +2 -0
  411. package/publications/flags-update.js +22 -0
  412. package/publications/flags-update.js.map +1 -0
  413. package/publications/flags.d.ts +2 -0
  414. package/publications/flags.js +22 -0
  415. package/publications/flags.js.map +1 -0
  416. package/publications/logs.d.ts +2 -0
  417. package/publications/logs.js +164 -0
  418. package/publications/logs.js.map +1 -0
  419. package/publications/notifications.d.ts +2 -0
  420. package/publications/notifications.js +16 -0
  421. package/publications/notifications.js.map +1 -0
  422. package/publications/report-builder-dashboard-builders.d.ts +2 -0
  423. package/publications/report-builder-dashboard-builders.js +42 -0
  424. package/publications/report-builder-dashboard-builders.js.map +1 -0
  425. package/publications/report-builder-libraries.d.ts +2 -0
  426. package/publications/report-builder-libraries.js +90 -0
  427. package/publications/report-builder-libraries.js.map +1 -0
  428. package/publications/report-builder-reports.d.ts +2 -0
  429. package/publications/report-builder-reports.js +50 -0
  430. package/publications/report-builder-reports.js.map +1 -0
  431. package/publications/super-admin.d.ts +2 -0
  432. package/publications/super-admin.js +16 -0
  433. package/publications/super-admin.js.map +1 -0
  434. package/publications/user-groups.d.ts +1 -0
  435. package/publications/user-groups.js +16 -0
  436. package/publications/user-groups.js.map +1 -0
  437. package/publications/user-guides.d.ts +1 -0
  438. package/publications/user-guides.js +16 -0
  439. package/publications/user-guides.js.map +1 -0
  440. package/resolveio-server-app.d.ts +70 -0
  441. package/resolveio-server-app.js +801 -0
  442. package/resolveio-server-app.js.map +1 -0
  443. package/server-app.d.ts +228 -0
  444. package/server-app.js +3566 -0
  445. package/server-app.js.map +1 -0
  446. package/services/codex-client.d.ts +128 -0
  447. package/services/codex-client.js +1629 -0
  448. package/services/codex-client.js.map +1 -0
  449. package/services/openai-client.d.ts +46 -0
  450. package/services/openai-client.js +318 -0
  451. package/services/openai-client.js.map +1 -0
  452. package/types/error-report.d.ts +25 -0
  453. package/types/error-report.js +4 -0
  454. package/types/error-report.js.map +1 -0
  455. package/types/slow-query-report.d.ts +27 -0
  456. package/types/slow-query-report.js +6 -0
  457. package/types/slow-query-report.js.map +1 -0
  458. package/util/ai-qa-policy.d.ts +124 -0
  459. package/util/ai-qa-policy.js +736 -0
  460. package/util/ai-qa-policy.js.map +1 -0
  461. package/util/ai-run-evidence-adapters.d.ts +109 -0
  462. package/util/ai-run-evidence-adapters.js +7234 -0
  463. package/util/ai-run-evidence-adapters.js.map +1 -0
  464. package/util/ai-run-evidence-dashboard.d.ts +88 -0
  465. package/util/ai-run-evidence-dashboard.js +343 -0
  466. package/util/ai-run-evidence-dashboard.js.map +1 -0
  467. package/util/ai-run-evidence-eval.d.ts +86 -0
  468. package/util/ai-run-evidence-eval.js +1018 -0
  469. package/util/ai-run-evidence-eval.js.map +1 -0
  470. package/util/ai-run-evidence.d.ts +244 -0
  471. package/util/ai-run-evidence.js +1096 -0
  472. package/util/ai-run-evidence.js.map +1 -0
  473. package/util/ai-runner-artifacts.d.ts +82 -0
  474. package/util/ai-runner-artifacts.js +713 -0
  475. package/util/ai-runner-artifacts.js.map +1 -0
  476. package/util/ai-runner-manager-autopilot.d.ts +210 -0
  477. package/util/ai-runner-manager-autopilot.js +642 -0
  478. package/util/ai-runner-manager-autopilot.js.map +1 -0
  479. package/util/ai-runner-manager-policy.d.ts +807 -0
  480. package/util/ai-runner-manager-policy.js +3501 -0
  481. package/util/ai-runner-manager-policy.js.map +1 -0
  482. package/util/ai-runner-qa-auth.d.ts +5 -0
  483. package/util/ai-runner-qa-auth.js +839 -0
  484. package/util/ai-runner-qa-auth.js.map +1 -0
  485. package/util/ai-runner-qa-tools.d.ts +26 -0
  486. package/util/ai-runner-qa-tools.js +3520 -0
  487. package/util/ai-runner-qa-tools.js.map +1 -0
  488. package/util/aicoder-runner-v6.d.ts +426 -0
  489. package/util/aicoder-runner-v6.js +2464 -0
  490. package/util/aicoder-runner-v6.js.map +1 -0
  491. package/util/common.d.ts +31 -0
  492. package/util/common.js +683 -0
  493. package/util/common.js.map +1 -0
  494. package/util/customer-portal-password.d.ts +13 -0
  495. package/util/customer-portal-password.js +209 -0
  496. package/util/customer-portal-password.js.map +1 -0
  497. package/util/error-reporter.d.ts +52 -0
  498. package/util/error-reporter.js +326 -0
  499. package/util/error-reporter.js.map +1 -0
  500. package/util/error-tracking.d.ts +13 -0
  501. package/util/error-tracking.js +120 -0
  502. package/util/error-tracking.js.map +1 -0
  503. package/util/openai-usage-cost.d.ts +6 -0
  504. package/util/openai-usage-cost.js +103 -0
  505. package/util/openai-usage-cost.js.map +1 -0
  506. package/util/report-builder-unwinds.d.ts +15 -0
  507. package/util/report-builder-unwinds.js +156 -0
  508. package/util/report-builder-unwinds.js.map +1 -0
  509. package/util/runner-process-janitor.d.ts +27 -0
  510. package/util/runner-process-janitor.js +208 -0
  511. package/util/runner-process-janitor.js.map +1 -0
  512. package/util/schema-report-builder.d.ts +6 -0
  513. package/util/schema-report-builder.js +481 -0
  514. package/util/schema-report-builder.js.map +1 -0
  515. package/util/slow-query-reporter.d.ts +28 -0
  516. package/util/slow-query-reporter.js +226 -0
  517. package/util/slow-query-reporter.js.map +1 -0
  518. package/util/subscription-dependency-context.d.ts +34 -0
  519. package/util/subscription-dependency-context.js +1283 -0
  520. package/util/subscription-dependency-context.js.map +1 -0
  521. package/util/support-runner-v5.d.ts +1426 -0
  522. package/util/support-runner-v5.js +7643 -0
  523. package/util/support-runner-v5.js.map +1 -0
  524. package/util/tokenizer.d.ts +5 -0
  525. package/util/tokenizer.js +41 -0
  526. package/util/tokenizer.js.map +1 -0
  527. package/workers/codex-runner.worker.d.ts +1 -0
  528. package/workers/codex-runner.worker.js +192 -0
  529. package/workers/codex-runner.worker.js.map +1 -0
  530. package/.nodemon.json +0 -5
  531. package/.vscode/settings.json +0 -21
  532. package/AGENTS.md +0 -195
  533. package/README.md +0 -22
  534. package/build_package.sh +0 -5
  535. package/compileDTS.pl +0 -64
  536. package/docs/ai-assistant-nightly-eval.md +0 -65
  537. package/docs/ai-assistant-preflight-checklist.md +0 -23
  538. package/docs/ai-assistant-report-builder-bridge-playbook.md +0 -115
  539. package/eslint-plugin-custom/index.js +0 -7
  540. package/eslint-plugin-custom/rules/no-filter-zero-index.js +0 -44
  541. package/eslint.config.js +0 -103
  542. package/gulpfile.js +0 -216
  543. package/methodAndPublicationListGenerator.py +0 -375
  544. package/mongodbensurers.js +0 -2
  545. package/mongostop.js +0 -3
  546. package/scripts/cleanup-bypassed-callmethod-logs.js +0 -616
  547. package/settings.development.json +0 -25
  548. package/settings.development.redacted.json +0 -25
  549. package/src/.env +0 -12
  550. package/src/ai/assistant-core-heuristics.ts +0 -379
  551. package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +0 -185
  552. package/src/ai/resolveio-platform-intelligence-memory.ts +0 -325
  553. package/src/ai/resolveio-platform-intelligence.ts +0 -462
  554. package/src/client-server-app.ts +0 -12
  555. package/src/collections/ai-run.collection.ts +0 -117
  556. package/src/collections/ai-terminal-conversation.collection.ts +0 -91
  557. package/src/collections/ai-terminal-issue-report.collection.ts +0 -99
  558. package/src/collections/ai-terminal-message.collection.ts +0 -77
  559. package/src/collections/app-setting.collection.ts +0 -104
  560. package/src/collections/app-status.collection.ts +0 -58
  561. package/src/collections/communication-metric.collection.ts +0 -84
  562. package/src/collections/counter.collection.ts +0 -56
  563. package/src/collections/cron-job-history.collection.ts +0 -94
  564. package/src/collections/cron-job.collection.ts +0 -92
  565. package/src/collections/customer-notification.collection.ts +0 -131
  566. package/src/collections/customer-portal-password.collection.ts +0 -76
  567. package/src/collections/email-history.collection.ts +0 -134
  568. package/src/collections/email-verified.collection.ts +0 -62
  569. package/src/collections/file.collection.ts +0 -74
  570. package/src/collections/flag-update.collection.ts +0 -57
  571. package/src/collections/flag.collection.ts +0 -57
  572. package/src/collections/log-method-latency.collection.ts +0 -77
  573. package/src/collections/log-subscription.collection.ts +0 -80
  574. package/src/collections/log.collection.ts +0 -93
  575. package/src/collections/logged-in-users.collection.ts +0 -67
  576. package/src/collections/monitor-cpu.collection.ts +0 -65
  577. package/src/collections/monitor-function.collection.ts +0 -74
  578. package/src/collections/monitor-memory.collection.ts +0 -77
  579. package/src/collections/monitor-mongo.collection.ts +0 -71
  580. package/src/collections/notification.collection.ts +0 -57
  581. package/src/collections/openai-usage-ledger.collection.ts +0 -131
  582. package/src/collections/report-builder-dashboard-builder.collection.ts +0 -109
  583. package/src/collections/report-builder-library.collection.ts +0 -89
  584. package/src/collections/report-builder-report.collection.ts +0 -184
  585. package/src/collections/user-group.collection.ts +0 -89
  586. package/src/collections/user-guide.collection.ts +0 -57
  587. package/src/collections/user.collection.ts +0 -181
  588. package/src/cron/cron.ts +0 -117
  589. package/src/fixtures/cron-jobs.ts +0 -95
  590. package/src/fixtures/init.ts +0 -35
  591. package/src/http/auth.ts +0 -818
  592. package/src/http/health.ts +0 -7
  593. package/src/http/home.ts +0 -90
  594. package/src/http/slow-query-publication.ts +0 -49
  595. package/src/index.ts +0 -1
  596. package/src/managers/ai-assistant-codex-manager.manager.ts +0 -1131
  597. package/src/managers/ai-run-evidence.manager.ts +0 -264
  598. package/src/managers/communication-metric.manager.ts +0 -82
  599. package/src/managers/cron.manager.ts +0 -333
  600. package/src/managers/customer-notification-content.manager.ts +0 -236
  601. package/src/managers/diagnostic-manager-bootstrap.ts +0 -165
  602. package/src/managers/error-auto-fix.manager.ts +0 -2767
  603. package/src/managers/local-log.manager.ts +0 -113
  604. package/src/managers/method.manager.ts +0 -1857
  605. package/src/managers/mongo.manager.ts +0 -4575
  606. package/src/managers/monitor.manager.ts +0 -507
  607. package/src/managers/openai-usage-ledger.manager.ts +0 -112
  608. package/src/managers/slow-query-verifier.manager.ts +0 -3590
  609. package/src/managers/slow-query.manager.ts +0 -519
  610. package/src/managers/subscription.manager.ts +0 -3128
  611. package/src/managers/websocket.manager.ts +0 -746
  612. package/src/managers/worker-dispatcher.manager.ts +0 -1360
  613. package/src/managers/worker-server.manager.ts +0 -536
  614. package/src/methods/accounts.ts +0 -532
  615. package/src/methods/ai-terminal.ts +0 -29070
  616. package/src/methods/app-settings.ts +0 -114
  617. package/src/methods/aws.ts +0 -649
  618. package/src/methods/collections.ts +0 -641
  619. package/src/methods/counters.ts +0 -69
  620. package/src/methods/cron-jobs.ts +0 -2614
  621. package/src/methods/customer-notifications.ts +0 -458
  622. package/src/methods/diagnostics.ts +0 -616
  623. package/src/methods/flag-updates.ts +0 -7
  624. package/src/methods/flags.ts +0 -7
  625. package/src/methods/logs.ts +0 -657
  626. package/src/methods/mongo-explorer.ts +0 -1880
  627. package/src/methods/monitor.ts +0 -540
  628. package/src/methods/pdf.ts +0 -1236
  629. package/src/methods/publications.ts +0 -129
  630. package/src/methods/report-builder.ts +0 -3300
  631. package/src/methods/support.ts +0 -335
  632. package/src/models/ai-run.model.ts +0 -27
  633. package/src/models/ai-terminal-conversation.model.ts +0 -19
  634. package/src/models/ai-terminal-issue-report.model.ts +0 -21
  635. package/src/models/ai-terminal-message.model.ts +0 -24
  636. package/src/models/app-setting.model.ts +0 -17
  637. package/src/models/collection-document.model.ts +0 -24
  638. package/src/models/communication-metric.model.ts +0 -23
  639. package/src/models/cron-job-history.model.ts +0 -16
  640. package/src/models/cron-job.model.ts +0 -15
  641. package/src/models/customer-notification.model.ts +0 -28
  642. package/src/models/customer-portal-password.model.ts +0 -12
  643. package/src/models/dialog.model.ts +0 -25
  644. package/src/models/log-method-latency.model.ts +0 -11
  645. package/src/models/log.model.ts +0 -19
  646. package/src/models/method.model.ts +0 -25
  647. package/src/models/monitor-function.model.ts +0 -16
  648. package/src/models/monitor-memory.model.ts +0 -17
  649. package/src/models/monitor-mongo.model.ts +0 -15
  650. package/src/models/openai-usage-ledger.model.ts +0 -56
  651. package/src/models/pagination.model.ts +0 -35
  652. package/src/models/permission.model.ts +0 -14
  653. package/src/models/report-builder-dashboard-builder.model.ts +0 -29
  654. package/src/models/report-builder-library.model.ts +0 -20
  655. package/src/models/report-builder-report.model.ts +0 -136
  656. package/src/models/report-builder.model.ts +0 -68
  657. package/src/models/select-data-label.model.ts +0 -9
  658. package/src/models/server-message.model.ts +0 -31
  659. package/src/models/slow-query-report.model.ts +0 -23
  660. package/src/models/subscription.model.ts +0 -73
  661. package/src/models/support-ticket.model.ts +0 -104
  662. package/src/models/user-group.model.ts +0 -24
  663. package/src/models/user.model.ts +0 -96
  664. package/src/private/images/ResolveIO.png +0 -0
  665. package/src/publications/ai-terminal.ts +0 -73
  666. package/src/publications/app-settings.ts +0 -25
  667. package/src/publications/app-status.ts +0 -13
  668. package/src/publications/cron-jobs.ts +0 -40
  669. package/src/publications/customer-notifications.ts +0 -101
  670. package/src/publications/files.ts +0 -33
  671. package/src/publications/flags-update.ts +0 -19
  672. package/src/publications/flags.ts +0 -19
  673. package/src/publications/logs.ts +0 -163
  674. package/src/publications/notifications.ts +0 -13
  675. package/src/publications/report-builder-dashboard-builders.ts +0 -39
  676. package/src/publications/report-builder-libraries.ts +0 -41
  677. package/src/publications/report-builder-reports.ts +0 -47
  678. package/src/publications/super-admin.ts +0 -13
  679. package/src/publications/user-groups.ts +0 -12
  680. package/src/publications/user-guides.ts +0 -12
  681. package/src/resolveio-server-app.ts +0 -617
  682. package/src/server-app.ts +0 -3354
  683. package/src/services/codex-client.ts +0 -1231
  684. package/src/services/openai-client.ts +0 -265
  685. package/src/types/error-report.ts +0 -26
  686. package/src/types/js-tiktoken.d.ts +0 -11
  687. package/src/types/slow-query-report.ts +0 -28
  688. package/src/util/ai-qa-policy.ts +0 -925
  689. package/src/util/ai-run-evidence-adapters.ts +0 -8347
  690. package/src/util/ai-run-evidence-dashboard.ts +0 -323
  691. package/src/util/ai-run-evidence-eval.ts +0 -1057
  692. package/src/util/ai-run-evidence.ts +0 -1430
  693. package/src/util/ai-runner-artifacts.ts +0 -586
  694. package/src/util/ai-runner-manager-autopilot.ts +0 -961
  695. package/src/util/ai-runner-manager-policy.ts +0 -5011
  696. package/src/util/ai-runner-qa-auth.ts +0 -838
  697. package/src/util/ai-runner-qa-tools.ts +0 -3536
  698. package/src/util/aicoder-runner-v6.ts +0 -3121
  699. package/src/util/common.ts +0 -649
  700. package/src/util/customer-portal-password.ts +0 -183
  701. package/src/util/error-reporter.ts +0 -332
  702. package/src/util/error-tracking.ts +0 -79
  703. package/src/util/openai-usage-cost.ts +0 -114
  704. package/src/util/report-builder-unwinds.ts +0 -180
  705. package/src/util/runner-process-janitor.ts +0 -219
  706. package/src/util/schema-report-builder.ts +0 -448
  707. package/src/util/slow-query-reporter.ts +0 -216
  708. package/src/util/subscription-dependency-context.ts +0 -1096
  709. package/src/util/support-runner-v5.ts +0 -10040
  710. package/src/util/tokenizer.ts +0 -38
  711. package/src/workers/codex-runner.worker.ts +0 -142
  712. package/start_server.sh +0 -5
  713. package/tests/ai-assistant-corpus-build.ts +0 -484
  714. package/tests/ai-assistant-corpus-replay-e2e.ts +0 -774
  715. package/tests/ai-assistant-data-parity-e2e.ts +0 -1989
  716. package/tests/ai-assistant-eval-triage.ts +0 -831
  717. package/tests/ai-assistant-openai-e2e.ts +0 -1061
  718. package/tests/ai-assistant-openai-git-e2e.ts +0 -155
  719. package/tests/ai-assistant-preflight-matrix.ts +0 -215
  720. package/tests/ai-assistant-routing-eval.test.ts +0 -585
  721. package/tests/ai-assistant-snf-live-eval.ts +0 -975
  722. package/tests/ai-assistant-utils.test.ts +0 -4834
  723. package/tests/ai-manager-autopilot-snapshot.test.ts +0 -193
  724. package/tests/ai-manager-recovery-checkpoint.test.ts +0 -1383
  725. package/tests/ai-run-eval.test.ts +0 -132
  726. package/tests/ai-run-evidence.test.ts +0 -3773
  727. package/tests/ai-runner-contract.test.ts +0 -515
  728. package/tests/aicoder-runner-v6.test.ts +0 -822
  729. package/tests/error-reporter.test.ts +0 -145
  730. package/tests/method-publication-generator.test.ts +0 -46
  731. package/tests/report-builder-linking.test.ts +0 -79
  732. package/tests/resolveio-platform-intelligence.test.ts +0 -352
  733. package/tests/server-app-cron-owner.test.ts +0 -127
  734. package/tests/subscription-connect-race.test.ts +0 -158
  735. package/tests/subscription-dependency-context.test.ts +0 -324
  736. package/tests/subscription-manager-collection-tracking.test.ts +0 -86
  737. package/tests/subscription-manager-invalidation.test.ts +0 -86
  738. package/tests/support-runner-v5.test.ts +0 -3201
  739. package/tsconfig.json +0 -34
  740. /package/{src/private → private}/email-templates/enrollment.html +0 -0
  741. /package/{src/private → private}/email-templates/forgot-password.html +0 -0
  742. /package/{src/private → private}/email-templates/support-ticket-deleted.html +0 -0
  743. /package/{src/private → private}/email-templates/support-ticket-modified.html +0 -0
  744. /package/{src/private → private}/email-templates/support-ticket.html +0 -0
  745. /package/{src/public_api.ts → public_api.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/util/ai-qa-policy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+JA,8EAoBC;AAED,kEAiFC;AAED,0FA2BC;AAED,0EAEC;AAED,oEAiFC;AAED,0EAEC;AAED,4EAyCC;AAED,sFAEC;AAED,0EASC;AAaD,kFAUC;AAED,0FAqFC;AAED,wEA+CC;AAED,sFAWC;AAED,0FAeC;AAED,wFAmBC;AAED,gFAcC;AAmCD,0EA+NC;AA/xBD,SAAS,uBAAuB,CAAC,KAAU;IAC1C,OAAO,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AACxD,CAAC;AAED,SAAS,wBAAwB,CAAC,KAAU,EAAE,QAAgB,EAAE,GAAW,EAAE,GAAW;IACvF,IAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,OAAO,QAAQ,CAAC;IACjB,CAAC;IACD,IAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC;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4D;oBAC5D,4EAA4E;oBAC5E,iEAAiE;iBACjE,EACD,gBAAgB,EAAE,sLAAsL,KACtM,KAAK,EAAE,YAAY,CAAC,CAAC;QACzB,CAAC;QACD,IAAI,YAAY,KAAK,yBAAyB,EAAE,CAAC;YAChD,OAAO,wCAAwC,uBAC3C,IAAI,KACP,aAAa,EAAE,CAAC,yEAAyE,CAAC,EAC1F,YAAY,EAAE,CAAC,8EAA8E,CAAC,EAC9F,gBAAgB,EAAE,CAAC,gEAAgE,CAAC,EACpF,gBAAgB,EAAE,0GAA0G,KAC1H,KAAK,EAAE,YAAY,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,wCAAwC,uBAC3C,IAAI,KACP,aAAa,EAAE,CAAC,kGAAkG,CAAC,EACnH,YAAY,EAAE,CAAC,mGAAmG,CAAC,EACnH,gBAAgB,EAAE,CAAC,sBAAsB,EAAE,wDAAwD,CAAC,EACpG,gBAAgB,EAAE,4EAA4E,KAC5F,KAAK,EAAE,YAAY,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACJ,CAAC","file":"ai-qa-policy.js","sourcesContent":["export type ResolveIOQaPolicyContext =\n\t| 'support_ticket'\n\t| 'aicoder_dashboard'\n\t| 'ai_terminal'\n\t| 'general';\n\nexport interface ResolveIOQaPolicyOptions {\n\tcontext?: ResolveIOQaPolicyContext;\n\tincludeDevServerRules?: boolean;\n\tqaRepairEnabled?: boolean;\n\tqaEvidenceRequired?: boolean;\n\tqaDistinctScreenshotRequired?: boolean;\n\tqaFailFastCompile?: boolean;\n\tqaLiveDataRequired?: boolean;\n\tqaSelfRepairMaxWaves?: number;\n\tcurrentRoute?: string;\n\tcurrentContextMode?: string;\n\tcustomInstructions?: string[];\n}\n\nexport interface ResolveIORunnerBasicsOptions extends ResolveIOQaPolicyOptions {\n\tincludeQaPolicy?: boolean;\n\tincludeTokenDiscipline?: boolean;\n\tincludeDependencyBootstrap?: boolean;\n\tincludeRepairLoop?: boolean;\n\tincludeEvidenceContract?: boolean;\n\tmaxContextBullets?: number;\n\tmaxRepairWaves?: number;\n}\n\nexport interface ResolveIORunnerPromptInput extends ResolveIORunnerBasicsOptions {\n\tobjective?: string;\n\tblockers?: string[];\n\trelevantFiles?: string[];\n\tevidence?: string[];\n\tpriorSummary?: string;\n\tlatestFailure?: string;\n\tmaxBlockers?: number;\n\tmaxFiles?: number;\n\tmaxEvidence?: number;\n\tmaxTextChars?: number;\n}\n\nexport interface ResolveIORunnerContract {\n\tcontext: ResolveIOQaPolicyContext;\n\tsections: {\n\t\trunnerBasics: string[];\n\t\ttokenDiscipline: string[];\n\t\tdependencyBootstrap: string[];\n\t\trepairLoop: string[];\n\t\tqaPolicy: string[];\n\t\tevidenceContract: string[];\n\t\tfinalNotes: string[];\n\t};\n\trules: string[];\n\tpromptLines: string[];\n}\n\nexport interface ResolveIORunnerPromptBundle extends ResolveIORunnerContract {\n\tobjective: string;\n\tcontextLines: string[];\n\trepairLines: string[];\n\tfullPromptLines: string[];\n}\n\nexport interface ResolveIORunnerRepairPlan {\n\tblockerClass: string;\n\tsourceGate: string;\n\ttargetFiles: string[];\n\tlineHints: string[];\n\tfailureEvidence: string[];\n\trequiredProof: string[];\n\trepairRecipe: string[];\n\tselfGateCommands: string[];\n\tpassingCondition: string;\n}\n\nexport interface ResolveIORunnerRepairTargetOverride {\n\tpreferredSuffixes?: string[];\n\tfallbackFiles?: string[];\n}\n\nexport interface ResolveIORunnerRepairPlanInput extends ResolveIORunnerBasicsOptions {\n\tblockers?: string[];\n\tchangedFiles?: string[];\n\tgateSource?: string;\n\ttargetFileOverrides?: Record<string, ResolveIORunnerRepairTargetOverride>;\n}\n\nexport interface ResolveIORunnerRepairContinuationInput {\n\tcurrentBlockers?: string[];\n\tpreviousBlockers?: string[];\n\tactiveContractBlockers?: string[];\n\tcurrentAttempt?: number;\n\tmaxAttempts?: number;\n\tcurrentRepairWaveCount?: number;\n\tmaxRepairWaves?: number;\n\tdiffHash?: string;\n\tevidenceHash?: string;\n\tpreviousDiffHash?: string;\n\tpreviousEvidenceHash?: string;\n}\n\nexport type ResolveIORunnerRepairContinuationAction =\n\t| 'continue_attempt'\n\t| 'start_repair_wave'\n\t| 'park_repeated_blocker'\n\t| 'park_no_progress'\n\t| 'park_repair_wave_budget';\n\nexport interface ResolveIORunnerRepairContinuationDecision {\n\taction: ResolveIORunnerRepairContinuationAction;\n\trepeatedBlockers: string[];\n\tnewBlockers: string[];\n\tnormalizedCurrentBlockers: string[];\n\tnextAttempt: number;\n\tnextRepairWaveCount: number;\n\treason: string;\n}\n\nexport interface ResolveIORunnerQaCoverageInput {\n\tticketText?: string;\n\tchangedFiles?: string[];\n}\n\nfunction normalizeOptionalString(value: any): string {\n\treturn String(value || '').replace(/\\s+/g, ' ').trim();\n}\n\nfunction normalizePositiveInteger(value: any, fallback: number, min: number, max: number): number {\n\tconst numeric = Number(value);\n\tif (!Number.isFinite(numeric)) {\n\t\treturn fallback;\n\t}\n\tconst rounded = Number(numeric.toFixed(0));\n\treturn Math.max(min, Math.min(max, rounded));\n}\n\nfunction normalizeTextLine(value: any, maxChars: number): string {\n\treturn normalizeOptionalString(value).slice(0, maxChars).trim();\n}\n\nfunction normalizeTextList(values: any, limit: number, maxChars: number): string[] {\n\tif (!Array.isArray(values)) {\n\t\treturn [];\n\t}\n\tconst result: string[] = [];\n\tfor (const value of values) {\n\t\tconst normalized = normalizeTextLine(value, maxChars);\n\t\tif (normalized && !result.includes(normalized)) {\n\t\t\tresult.push(normalized);\n\t\t}\n\t\tif (result.length >= limit) {\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn result;\n}\n\nexport function normalizeResolveIOQaPolicyOptions(options: ResolveIOQaPolicyOptions = {}): Required<Omit<ResolveIOQaPolicyOptions, 'currentRoute' | 'currentContextMode' | 'customInstructions'>> & {\n\tcurrentRoute: string;\n\tcurrentContextMode: string;\n\tcustomInstructions: string[];\n} {\n\treturn {\n\t\tcontext: options.context || 'general',\n\t\tincludeDevServerRules: options.includeDevServerRules === true,\n\t\tqaRepairEnabled: options.qaRepairEnabled !== false,\n\t\tqaEvidenceRequired: options.qaEvidenceRequired !== false,\n\t\tqaDistinctScreenshotRequired: options.qaDistinctScreenshotRequired !== false,\n\t\tqaFailFastCompile: options.qaFailFastCompile !== false,\n\t\tqaLiveDataRequired: options.qaLiveDataRequired !== false,\n\t\tqaSelfRepairMaxWaves: normalizePositiveInteger(options.qaSelfRepairMaxWaves, 3, 1, 6),\n\t\tcurrentRoute: normalizeOptionalString(options.currentRoute),\n\t\tcurrentContextMode: normalizeOptionalString(options.currentContextMode),\n\t\tcustomInstructions: Array.isArray(options.customInstructions)\n\t\t\t? options.customInstructions.map(normalizeOptionalString).filter(Boolean).slice(0, 12)\n\t\t\t: []\n\t};\n}\n\nexport function buildResolveIOQaPolicyRules(options: ResolveIOQaPolicyOptions = {}): string[] {\n\tconst policy = normalizeResolveIOQaPolicyOptions(options);\n\tconst rules: string[] = [];\n\tif (policy.includeDevServerRules) {\n\t\trules.push(\n\t\t\t'When browser/localhost QA needs long-running commands like `npm run server`, `npm run client`, `npm run dev`, `ng serve`, `vite`, or `nodemon`, start them as managed background processes with log files and PIDs; do not leave foreground dev-server commands as the active shell tool.',\n\t\t\t'Before localhost/browser QA, source `.resolveio-support-tools/env.sh` or `.resolveio-ai-runner-tools/env.sh` when present. It supplies shared EC2 browser cache settings, `PUPPETEER_EXECUTABLE_PATH`/`CHROME_BIN`, Mongo wrappers, and non-conflicting localhost QA ports/URLs.',\n\t\t\t\t'For ResolveIO app login during browser QA, use the shared AI-runner auth bootstrap when staged: `node ./.resolveio-support-tools/qa-auth-bootstrap.js <project-root> /target-route`, `node ./.resolveio-ai-runner-tools/qa-auth-bootstrap.js <project-root> /target-route`, or the same command from an app root with `../`. It must use the exact localhost client origin, log out/clear stale browser credentials first, call `/login` then `/accessToken`, seed auth storage, repair the local QA user settings/tour flags if the app forces the post-login settings/tour gate, verify the browser reached the requested target route, and emit `qa-artifacts/auth-bootstrap-result.json`, `qa-artifacts/auth-bootstrap-storage-state.json`, plus a screenshot. For support-ticket QA, use Puppeteer first when `PUPPETEER_EXECUTABLE_PATH` or `CHROME_BIN` is set; `PLAYWRIGHT_MISSING` is not a blocker while that Puppeteer env exists. For every fresh Puppeteer/Playwright page, open the localhost origin, set localStorage from `auth-bootstrap-storage-state.json`, then navigate to the target route. The storage artifact may expose top-level object `localStorage`, array `localStorageEntries`, or Playwright-style `origins[].localStorage`; normalize all three shapes before setting storage (`Object.entries` for objects, `{key,value}` or `{name,value}` for arrays). Never run `for...of` directly on top-level `localStorage` unless it is already an array. A login-shell screenshot after bootstrap means the QA script failed to seed auth and must rerun the same row with storage seeded before returning needs-fix.',\n\t\t\t\t'For support-ticket QA, run the browser as the ticket reporter whenever possible; if the ticket or latest customer response names another affected user, run as that affected user instead. Use `qa-live-data-seed-result.json.selected.qa_user_context` and `auth-bootstrap-result.json.user` to record the chosen user. Generic admin/dev QA is acceptable only when no reporter/affected user can be identified or copied into localhost QA; in that case the matrix must say why.',\n\t\t\t'For ResolveIO browser checks, do not use Puppeteer/Playwright `networkidle0` or `networkidle2` as the page-ready condition; ResolveIO pages can keep background API/socket/polling activity open. Navigate with `domcontentloaded`, then wait for concrete route/workflow DOM text, buttons, table rows, dialogs, saved records, or persisted data assertions before screenshots.',\n\t\t\t'Use browser API compatibility helpers instead of version-fragile calls: every row-level Puppeteer script must declare `const delay = ms => new Promise(resolve => setTimeout(resolve, ms));` before navigation and use `await delay(...)` for fixed waits. Do not use `page.$x`, `page.waitForTimeout`, `networkidle0`, or `networkidle2`. Use `page.evaluateHandle`/DOM traversal or Playwright `locator` when definitely using Playwright. If a browser helper call throws because the current runtime lacks that API, fix the QA script and rerun the same matrix row before marking it failed.',\n\t\t\t'Browser click targeting must prefer exact interactive controls: `button`, `a[href]`, `[role=\"button\"]`, `input[type=\"button\"]`, `input[type=\"submit\"]`, `select`, option/combobox controls, and app-specific clickable elements with a small visible bounding box. Do not include broad `div`, `span`, `body`, or `*` elements in click-by-text helpers; they often match whole-page containers and produce false progress. If a text match has a huge bounding box or contains unrelated page/navigation text, skip it and find a smaller descendant/control.',\n\t\t\t'For QA row probes, use broad DOM text scans only for read-only diagnostics. Do not drive workflow clicks from broad `document.querySelectorAll(\"*\")` or generic container matches. After at most two focused selector attempts on the seeded route/data, either capture the blocker screenshot and return `needs-fix`, or switch to persisted data assertions if the row can be proven without another UI click.',\n\t\t\t'When launching Puppeteer on workers, pass `executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || process.env.CHROME_BIN` if either env var is set. If either env var points to an executable, do not run `npx puppeteer browsers install`, `puppeteer browsers install`, Playwright install, or any browser download. Do not connect to `localhost:9223`, `/json/version`, or any Chrome remote-debug endpoint unless `RESOLVEIO_SUPPORT_QA_BROWSER_URL` or `RESOLVEIO_RUNNER_QA_BROWSER_URL` is explicitly set after sourcing the staged env and the endpoint responds; otherwise launch a scoped Puppeteer browser from the staged executable. If Playwright is missing but Puppeteer env exists, continue with Puppeteer instead of returning `PLAYWRIGHT_MISSING`. If the staged browser is missing or not executable, return one precise dependency blocker instead of downloading inside the QA owner turn.',\n\t\t\t'Do not scan broad roots such as `/var/app/resolveio-ai-workspace`, `/tmp/resolveio-support-qa`, or `/var/lib/resolveio` to rediscover Puppeteer, Playwright, or Chromium. Source the staged env file and use its `PUPPETEER_EXECUTABLE_PATH`/`CHROME_BIN`; if the staged browser/runtime is missing, return a precise dependency blocker.',\n\t\t\t'When the current directory is an app/project root, shared QA tools may be staged one directory up. Prefer `../.resolveio-support-tools/env.sh` or `../.resolveio-ai-runner-tools/env.sh` before writing custom browser code. Do not use bare `require(\"puppeteer\")` from an app root until checking the project/server node_modules or the staged helper pattern.',\n\t\t\t'Secret handling: never print, cat, paste, or summarize `.env`, `.env.runtime`, `.env.codex`, `settings.json`, `.mongo-runtime.json`, Mongo URLs, API keys, tokens, or passwords in command output, QA artifacts, screenshots, captions, or final notes. Source staged env files or read only the named QA artifacts; redact connection strings if a tool emits one.',\n\t\t\t'For targeted QA row repair, read `qa-artifacts/qa-live-data-seed-result.json`, `qa-artifacts/auth-bootstrap-result.json`, `qa-artifacts/auth-bootstrap-storage-state.json`, and `qa-artifacts/qa-workflow-probe-result.json` before writing browser probes. Use seeded `selected` ids/names directly; do not guess customer filters, invoice numbers, or dropdown options when the seed artifact already provides the exact QA fixture. After route navigation, wait for concrete route/workflow DOM text or controls for up to the row timeout before calling a page shell-only; a 1-2 second fixed delay is not enough evidence that a ResolveIO route failed to hydrate.',\n\t\t\t'When the live seed artifact contains `selected.truck_treating_bol_context`, use the seeded ids/statuses directly instead of guessing customer data. If `primary_bol_status` or `bol_statuses[]` says Delivered, the direct `browser_routes.delivery` URL is an action route that may correctly redirect with `BOL has already been delivered`; do not treat that alone as an application defect. For delivered BOLs, test the delivered Open File/detail/Deliveries evidence path, or create the smallest localhost-only deliverable fixture from the fetched live BOL/route/delivery/treatment-plan context and record the fixture ids in the matrix. If `route_hint_matched === false`, the source database disproved the ticket route-name hint; use the seeded BOL-linked `bol_ids`, `route_ids`, `truck_treating_route_ids`, `linked_truck_treating_routes`, and usable browser route/fixture as the QA target, record the route-name mismatch in the row caption/assertion, and do not block only because the original route label is not visible.',\n\t\t\t'QA owner source-code boundary: browser QA may write only QA artifacts, screenshots, traces, captions, coverage matrices, temporary row probe scripts, and localhost-only fixture data. Do not edit application source files, generated wrappers, package files, migrations, or tests from the QA lane. If QA proves a code/data/publication defect, return `needs-fix` with the exact matrix row, screenshot/log/data evidence, suspected files, and smallest repair hint so the build lane can fix it.',\n\t\t\t'For Billing Dashboard QA rows, use seeded `qa_billing_fixture.customerId`, `psoId`, `deliveryId`, `invoiceId`, and `itemId` to choose/filter/open the exact row. If the page hides seeded rows behind filters, the QA row script should select by the seeded customer/id or return a data-seed/filter blocker with a screenshot instead of cycling through generic dropdown options.',\n\t\t\t'For invoice edit, saved invoice, and inventory side-effect QA rows, prefer direct navigation to `/invoice/edit/${qa_billing_fixture.invoiceId}` or open invoice detail and click the explicit Edit control. Do not use Billing Dashboard or invoice-list `Open Invoice` as proof of the edit workflow; in ResolveIO that action can open/generated-preview invoice output instead of the edit component. If direct edit route redirects to a list/shell, return one precise route/data blocker with screenshot instead of retrying the same Open Invoice path.',\n\t\t\t'When updating `qa-artifacts/qa-coverage-matrix.json`, verify the target row index still matches the active workflow before writing. If the row at that index has a different workflow, locate the row by exact workflow text; if multiple rows share a workflow, update only the row whose route/assertion matches the active row. Never overwrite an unrelated passing row or create duplicate workflow rows to work around a cursor mismatch.',\n\t\t\t'Use the managed-server pattern for localhost QA: `command > .build-output/<name>.log 2>&1 & PID=$!; trap \"kill $PID 2>/dev/null || true\" EXIT; wait for the port with curl; run browser checks; then kill/wait the PID`. Prefer `npm run client` or `./start_client.sh`; those scripts honor `RESOLVEIO_SUPPORT_QA_CLIENT_PORT` and `PORT`. Never run `ng serve ... | tee ...` or another dev server as a foreground command.'\n\t\t);\n\t\tif (policy.context === 'support_ticket') {\n\t\t\trules.push(\n\t\t\t\t'For support-ticket QA validation, the manager normally runs compile/startup preflight and keeps the local harness alive before the QA owner starts. In that mode, the QA owner must not run `run-local-qa.sh`, `npm run server`, `npm run client`, `ng serve`, `mongod`, `gulp`, or compile/build commands again; probe the existing localhost URLs and proceed to auth/browser proof.',\n\t\t\t\t'If the preflighted support-ticket harness is not reachable, return a precise blocked/needs-fix result with the probed URL, HTTP/socket error, and qa-artifacts log paths. Do not start a duplicate server, duplicate client, duplicate Mongo, or duplicate compile from inside the browser QA owner.'\n\t\t\t);\n\t\t}\n\t}\n\tif (policy.qaFailFastCompile) {\n\t\trules.push('Before browser QA, run the fastest compile/type/startup checks that can prove the app can load. Fix compile/startup failures before launching browser QA.');\n\t}\n\tif (policy.qaRepairEnabled) {\n\t\trules.push(`If compile, startup, browser, or live-data QA fails, run a targeted repair wave for the exact failing route/action/data state, then rerun that same failed step before continuing. Limit self-repair to ${policy.qaSelfRepairMaxWaves} focused waves before returning the precise blocker.`);\n\t\trules.push('QA findings are implementation blockers, not manual TODOs: when QA proves missing fields, wrong publication payloads, failed persistence, bad calculations, missing side effects, or incomplete workflow coverage, return a typed needs-fix blocker so the runner starts a focused repair wave and reruns the same QA coverage.');\n\t}\n\tif (policy.qaLiveDataRequired) {\n\t\trules.push('For bug fixes and data/publication changes, test against available live app data or a faithful seeded record; do not rely only on static inspection when the user reported a runtime workflow problem.');\n\t\trules.push('Local QA may create, update, or delete representative seed records only in the localhost QA Mongo/database started for the run. Production/live customer databases are read-only for QA unless explicit human approval is provided.');\n\t\trules.push('If the localhost QA database has no records for the workflow under test, seed the smallest faithful record set needed to exercise the customer action and identify the seeded fixture IDs/names in the QA Coverage Matrix. Do not return blocked only because local QA data is empty.');\n\t\trules.push('When a ticket or customer response names concrete entities such as users, units, assets, BOLs, invoices, chemicals, yards, customers, routes, or order numbers, live-data seeding must fetch those exact production records into localhost QA where possible. QA must prove every named entity or return a seed/query blocker; representative substitute records are not pass evidence for named-record bug reports.');\n\t\trules.push('For import/export/form-submit/data workflows, QA must drive the actual customer action with representative data: capture the relevant starting state, the dialog/form/file selection or action state, and the submitted/resulting state with a row/count/value assertion that proves the bug or feature works.');\n\t\trules.push('For file upload/import QA, write a checkpoint artifact before launch, after route load, after file selection/upload, after parsing, after clicking the import/submit action, and after the final result. If the browser page/frame/process dies during file selection or parse, mark the row failed with that exact upload-stage blocker; do not silently retry as a pass or count route-load screenshots as proof.');\n\t\trules.push('A navigation-only screenshot of an empty page, shell, table header, or unchanged screen is not sufficient evidence for data workflow fixes. If the page has no records, seed or choose a faithful test record and identify the record or fixture used.');\n\t\trules.push('For pricing import/upload tickets, validator scripts are not enough. Browser QA must use the Manage Pricing import UI with both blank and pre-populated templates when the ticket mentions both, click the import action, and prove persisted pricing row/count/value changes in localhost QA Mongo.');\n\t\trules.push('For pricing import/upload tickets, expand the exact visible Ready accordion/control, then click the small enabled `Import Production Prices` button or equivalent submit control. Do not click broad page containers, nav/sidebar text, or generic div/span text matches. Do not treat static headings like `Production Prices With Errors`, `Ready For Import`, or unchanged table text as success or blocker evidence; wait for a real result dialog/message, button disabled/enabled state change, page error, or persisted Mongo row/count/value change.');\n\t\trules.push('For asset location/current-yard rename tickets, browser QA must prove the exact asset/unit on list, detail, and edit/save screens, and must include a joined/canonical yard record assertion showing the new yard name is used and the stale old yard name is absent.');\n\t\trules.push('For asset location/current-yard rename tickets that name multiple assets or units, QA must prove every named asset/unit, not one representative row. Captions/data assertions must name each requested unit number, its canonical joined yard, and the absence of each stale yard name before the row can pass.');\n\t\trules.push('For Update Interchangeables or Mass Update chemical tickets, browser QA must select the real source and target chemicals, run the update action, and assert before/after treatment-plan/tank document counts or ids in localhost QA Mongo. Route load, visible controls, or selected dropdowns alone are not pass evidence.');\n\t}\n\trules.push('Before passing QA, create a QA Coverage Matrix from the approved scope, changed files, generated/publication changes, and touched collections/models. Each matrix row must name the workflow, route/screen, data used, assertion, screenshot/trace artifact, and pass/fail result.');\n\trules.push('When updating `qa-artifacts/qa-coverage-matrix.json`, support both matrix schemas: the file may be an array or an object with a `rows` array. Use `const rows = Array.isArray(matrix) ? matrix : matrix.rows` for row updates and preserve the original schema when writing it back. Never skip row updates because only `Array.isArray(matrix)` is false.');\n\trules.push('When a QA Coverage Matrix row is marked `pass`, remove stale negative fields from that row before writing it: `blocker`, `failure`, `error`, `notes`, `next_actions`, `failed_reason`, and `blocked_reason`. Passed rows must not retain old blocker text from earlier retries.');\n\trules.push('QA must cover the full suite of changed customer-facing and data behavior, not only one smoke path. If implementation touches create/edit/delete/reopen flows, each touched flow needs proof or an explicit ticket-backed not-applicable note.');\n\trules.push('If the change touches invoices, billing, taxes, inventory, pricing, surcharges, imports/exports, reports, or publications, QA must include persisted data assertions and calculation/side-effect checks for every touched domain before returning pass.');\n\trules.push('For invoice/billing/tax/inventory/surcharge work, the minimum QA Coverage Matrix must include service/misc item surcharge configuration, customer override/default surcharge precedence, invoice create/new with added line items, surcharge add/remove/default/override selection, taxable and non-taxable subtotal/tax/total assertions, saved invoice detail/list state, chemical inventory item handling, and persisted inventory transaction/location/quantity/value side effects. Missing any row is needs-fix, not pass.');\n\trules.push('After localhost startup/auth succeeds, immediately drive the target customer workflow in the browser. Do not spend an open-ended reasoning pass after auth; create fresh feature screenshots/captions plus persisted row/count/value assertions, or return needs-fix with the exact blocker.');\n\trules.push('After startup/auth succeeds, missing selectors, dropdowns, options, saved values, rows, disabled/enabled states, or customer workflow controls are product/data QA failures. Mark the matrix row failed and return `needs-fix` with the exact row blocker and artifact paths; reserve `blocked` for true external/manual blockers such as auth, startup, infrastructure, credentials, or unavailable third-party systems.');\n\trules.push('Once any QA Coverage Matrix row is marked in_progress, finish that row promptly by marking it pass, failed, or blocked with screenshot/caption/assertion evidence. Leaving in_progress rows without workflow artifacts is a QA failure and should trigger a targeted repair wave.');\n\trules.push('Use desktop screenshots at a wide/full-screen viewport by default: 1920x1080 or wider. Do not use narrow/tablet/mobile screenshots unless the approved ticket is specifically mobile/responsive.');\n\trules.push('For desktop QA, verify the top navigation is in its normal desktop state and not wrapped, collapsed, open, or covering the workflow. For mobile-specific QA, explicitly use a mobile viewport and close the mobile menu unless the menu behavior itself is being proven.');\n\trules.push('Before every screenshot, settle the ResolveIO shell: press Escape, blur active controls, move the mouse away from the top/side nav, wait at least 750ms, and verify the target row/control/value has a visible bounding box inside the viewport. If the target text exists in DOM but is covered by the menu, sidebar, header, or a dark overlay, close the overlay or adjust the QA user/menu setting and recapture; do not count the covered screenshot as proof.');\n\trules.push('For table/list evidence, a pass screenshot must show the actual target row cells and the changed value in the same frame. Header-only, pagination-only, covered-row, or DOM-only proof can diagnose a failure, but cannot be used as customer-facing pass evidence.');\n\trules.push('For select/dropdown/filter workflows, a pass screenshot must show the relevant control with a real non-placeholder selected value, an open dropdown with the specific live option used, or a resulting data row/action state caused by that selection. Screenshots where required controls still show only placeholders such as Select Chemical, Select Customer, Select Yard, or Select Treatment Plan Type are empty-state evidence and must be failed or recaptured before pass.');\n\trules.push('A matrix shortcut may only pass after all row-specific evidence gates pass. If any row was rejected for shallow proof, missing selected values, missing persisted data, or stale/contradictory matrix data, keep the row failed and trigger a targeted repair/retest instead of marking the matrix complete.');\n\trules.push('Route/screen screenshots are valid only when they show the specific workflow being tested. If a route redirects to a generic shell, default manage page, menu-only view, auth screen, or a different feature screen, mark that matrix row failed/blocked with the mismatch; never count that screenshot as pass evidence.');\n\tif (policy.qaDistinctScreenshotRequired) {\n\t\trules.push('Capture one screenshot or trace for each distinct changed customer-facing feature, screen, workflow state, or data result. Do not repeat equivalent screenshots for multiple records unless record-specific behavior changed.');\n\t}\n\trules.push('Every screenshot artifact must include a short customer-facing caption explaining what the screenshot proves. Captions should describe the workflow state, such as Before, Ready to import, Submitted result, or Mobile menu closed.');\n\tif (policy.qaEvidenceRequired) {\n\t\trules.push('Final notes must list the exact QA command, route, account/data used, screenshot/trace/log paths, and result for each changed behavior; if browser QA is not applicable, say why and provide the compile/data proof used instead.');\n\t}\n\tif (policy.currentRoute) {\n\t\trules.push(`Current app context route from the AI terminal is ${policy.currentRoute}${policy.currentContextMode ? ` (${policy.currentContextMode})` : ''}; start QA there when the request refers to this page or current screen.`);\n\t}\n\trules.push(...policy.customInstructions);\n\treturn rules;\n}\n\nexport function buildResolveIORunnerQaCoverageChecklist(input: ResolveIORunnerQaCoverageInput = {}): string[] {\n\tconst text = `${input.ticketText || ''}\\n${(input.changedFiles || []).join('\\n')}`;\n\tconst rules: string[] = [\n\t\t'Build and include a QA Coverage Matrix: changed workflow, route/screen, data fixture/live record, before/action/after assertion, screenshot/trace artifact, caption, and result.',\n\t\t'Fail QA as needs-fix when coverage only proves navigation, headers, empty tables, or UI controls without exercising the changed behavior and persisted result.'\n\t];\n\tif (/\\b(invoice|billing|line item|surcharge|price|pricing|tax|sales tax)\\b|(?:^|\\/)(?:invoice|pricing|sales-tax|customer|item)(?:\\/|-)/i.test(text)) {\n\t\trules.push('Invoice/billing/tax coverage: test create/new and edit/reopen where touched; verify line-item persistence, surcharge add/remove/default/override selection, subtotal/tax/total calculations, taxable vs non-taxable behavior, and the saved invoice detail/list state.');\n\t\trules.push('When invoice/billing/tax QA has no usable local records, seed a minimal localhost-only customer, job/order/delivery or treatment, taxable item, non-taxable/surcharge item, and inventory/location data needed to create and save the invoice workflow; record the fixture IDs/names and do not touch production data.');\n\t\trules.push('For Billing Dashboard invoice QA, do not hardcode one accordion bucket such as Processing. Read the live bucket labels and counts from the page/probe, choose the relevant non-empty invoice bucket for the row (for example PSO Type Invoice Awaiting Invoices, Prepared, Processing, or Open Invoices), expand it, then use the visible workflow control or invoice row. A selector is blocked only when no relevant non-empty billing bucket or invoice control exists after waiting for async data.');\n\t\trules.push('For invoice edit/reopen/inventory side-effect QA, use the seeded `qa_billing_fixture.invoiceId` on `/invoice/edit/<invoiceId>` or the invoice detail Edit control. Do not click `Open Invoice` to prove editing because that control can open invoice output/preview instead of the edit workflow.');\n\t\trules.push('Invoice/billing/tax coverage must include at least one concrete row/value assertion from the saved document or UI after submit, not only pre-submit form screenshots.');\n\t}\n\tif (/\\b(inventory|warehouse|stock|fifo|pick ticket|checkout|check out|transaction)\\b|(?:^|\\/)(?:inventory|part|chemical|production-location|yard)(?:\\/|-)/i.test(text)) {\n\t\trules.push('Inventory coverage: test the relevant source/destination location, transaction creation/reversal, FIFO or location selection when applicable, report/pick-ticket output when touched, and persisted inventory quantities/values after save/edit/delete.');\n\t\trules.push('When inventory QA has no usable local records, seed the smallest localhost-only item/location/quantity/value fixture needed to prove quantity/value movement and identify that fixture in the evidence.');\n\t}\n\tif (/\\b(report|export|csv|excel|xlsx|download|filter|total|grouping)\\b|(?:^|\\/)report(?:\\/|-)/i.test(text)) {\n\t\trules.push('Report/export coverage: verify rows, filters/date ranges, totals/grouping, download/export output, and at least one row/count/value assertion.');\n\t}\n\tif (/\\b(publication|methods?\\.ts|publications?\\.ts|subscription|publish|payload|field projection)\\b|(?:^|\\/)server\\/src\\/publications\\//i.test(text)) {\n\t\trules.push('Publication/API coverage: verify the changed fields are returned to the UI or method caller that needs them, including list/detail projections and any generated wrapper/call-site behavior.');\n\t}\n\tif (/\\b(import|upload|file|spreadsheet|template)\\b/i.test(text)) {\n\t\trules.push('Import/upload coverage: use a representative file/template, capture ready-to-upload and submitted states, and assert inserted/updated/skipped row counts plus visible result rows.');\n\t}\n\treturn Array.from(new Set(rules));\n}\n\nexport function buildResolveIORunnerBasicsRules(options: ResolveIORunnerBasicsOptions = {}): string[] {\n\treturn buildResolveIORunnerContract(options).rules;\n}\n\nexport function buildResolveIORunnerContract(options: ResolveIORunnerBasicsOptions = {}): ResolveIORunnerContract {\n\tconst maxContextBullets = normalizePositiveInteger(options.maxContextBullets, 8, 3, 20);\n\tconst maxRepairWaves = normalizePositiveInteger(\n\t\toptions.maxRepairWaves ?? options.qaSelfRepairMaxWaves,\n\t\t3,\n\t\t1,\n\t\t6\n\t);\n\tconst context = options.context || 'general';\n\tconst runnerBasics = [\n\t\t'Use repo-local patterns first: read the closest existing implementation, matching tests, model/schema, method/publication, and UI route before editing.',\n\t\t'Make the smallest complete change that satisfies the request; avoid broad refactors, config churn, dependency changes, and generated-file edits unless the workflow explicitly requires regeneration.',\n\t\t'Before returning, state what changed, how it was verified, remaining blockers, and exact artifact paths in final notes.'\n\t];\n\tconst tokenDiscipline = options.includeTokenDiscipline !== false\n\t\t? [\n\t\t\t`Keep context lean: summarize prior history into at most ${maxContextBullets} bullets, retrieve specific files on demand, and do not paste full logs, lockfiles, generated files, or stale ticket/email chains unless they are the current blocker evidence.`,\n\t\t\t'Prefer targeted search/read commands over loading broad directories. If a command returns noisy output, summarize the useful lines and continue with narrower reads.',\n\t\t\t'On retries, carry only the active blocker contract, changed-file list, relevant diff/evidence summary, and latest failing command output. Do not restart with a clean-slate mega prompt.',\n\t\t\t'Stop autonomous retries when the same normalized blocker repeats without meaningful diff or evidence improvement; park with a precise blocker instead of burning tokens.'\n\t\t]\n\t\t: [];\n\tconst dependencyBootstrap = options.includeDependencyBootstrap !== false\n\t\t? [\n\t\t\t'Reuse existing dependency caches and hydrated node_modules when available. Prefer npm install --force with the configured npm cache; do not use npm ci unless the workflow explicitly requires it.',\n\t\t\t'Before reinstalling or downloading browsers, check the existing workspace cache, shared node_modules, PUPPETEER_EXECUTABLE_PATH, CHROME_BIN, PUPPETEER_CACHE_DIR, and project-provided bootstrap scripts.'\n\t\t]\n\t\t: [];\n\tconst repairLoop = options.includeRepairLoop !== false\n\t\t? [\n\t\t\t`Use targeted repair waves: compile/startup blocker, browser route/action blocker, data/publication blocker, and review blocker each get a focused repair, then rerun the exact failed step. Limit this to ${maxRepairWaves} focused waves before returning a precise blocker.`,\n\t\t\t'Repair all instances of a detected blocker class in the touched scope, not only the first occurrence.'\n\t\t]\n\t\t: [];\n\tconst qaPolicy = options.includeQaPolicy !== false\n\t\t? buildResolveIOQaPolicyRules({\n\t\t\t...options,\n\t\t\tqaSelfRepairMaxWaves: maxRepairWaves\n\t\t})\n\t\t: [];\n\tconst evidenceContract = options.includeEvidenceContract !== false\n\t\t? [\n\t\t\t'Evidence must be customer/workflow oriented: routes, buttons, pages, data states, screenshots/traces, command results, and assertions. Do not expose internal file names, backend paths, stack traces, or implementation chatter in customer-facing text.',\n\t\t\t'For UI-facing changes, capture one screenshot or trace per distinct changed feature/workflow; for data-only changes, provide live-data or seeded-data assertion proof.',\n\t\t\t'For import, upload, export, form submit, calculation, publication, or persistence fixes, proof must show the before/action/after workflow state and a concrete row/count/value assertion. Empty shell screenshots do not count as proof.',\n\t\t\t'Desktop proof screenshots must use a wide/full-screen viewport, normally 1920x1080 or wider, with navigation closed/unwrapped unless the ticket is specifically about mobile or menu behavior.',\n\t\t\t'Each screenshot must have a customer-facing caption that says what the image proves; these captions are used in validation emails.'\n\t\t]\n\t\t: [];\n\tconst finalNotes = [\n\t\t'Final notes must include: changed behavior, touched functional areas, exact commands run, exact QA route/data state, screenshot/trace/log paths, and remaining blockers if any.',\n\t\t'If work is parked, final notes must name the blocker class, last failing command/artifact, why another autonomous attempt would repeat, and the smallest manual action needed.'\n\t];\n\tconst sections = {\n\t\trunnerBasics,\n\t\ttokenDiscipline,\n\t\tdependencyBootstrap,\n\t\trepairLoop,\n\t\tqaPolicy,\n\t\tevidenceContract,\n\t\tfinalNotes\n\t};\n\tconst rules = [\n\t\t...runnerBasics,\n\t\t...tokenDiscipline,\n\t\t...dependencyBootstrap,\n\t\t...repairLoop,\n\t\t...qaPolicy,\n\t\t...evidenceContract,\n\t\t...finalNotes\n\t];\n\tconst promptLines = [\n\t\t`ResolveIO shared runner contract (${context}):`,\n\t\t...rules.map((rule) => `- ${rule}`)\n\t];\n\treturn {\n\t\tcontext,\n\t\tsections,\n\t\trules,\n\t\tpromptLines\n\t};\n}\n\nexport function buildResolveIORunnerPromptLines(options: ResolveIORunnerBasicsOptions = {}): string[] {\n\treturn buildResolveIORunnerContract(options).promptLines;\n}\n\nexport function buildResolveIORunnerPromptBundle(input: ResolveIORunnerPromptInput = {}): ResolveIORunnerPromptBundle {\n\tconst contract = buildResolveIORunnerContract(input);\n\tconst maxTextChars = normalizePositiveInteger(input.maxTextChars, 900, 160, 2400);\n\tconst objective = normalizeTextLine(input.objective, maxTextChars)\n\t\t|| 'Complete the requested ResolveIO runner task with minimal, verified changes.';\n\tconst priorSummary = normalizeTextLine(input.priorSummary, maxTextChars);\n\tconst latestFailure = normalizeTextLine(input.latestFailure, maxTextChars);\n\tconst blockers = normalizeTextList(input.blockers, normalizePositiveInteger(input.maxBlockers, 5, 1, 12), maxTextChars);\n\tconst relevantFiles = normalizeTextList(input.relevantFiles, normalizePositiveInteger(input.maxFiles, 12, 1, 30), 260);\n\tconst evidence = normalizeTextList(input.evidence, normalizePositiveInteger(input.maxEvidence, 8, 1, 20), maxTextChars);\n\tconst contextLines = [\n\t\t`Objective: ${objective}`,\n\t\t...(priorSummary ? [`Prior summary: ${priorSummary}`] : []),\n\t\t...(latestFailure ? [`Latest failure: ${latestFailure}`] : []),\n\t\t...(blockers.length ? ['Active blockers:', ...blockers.map((line) => `- ${line}`)] : []),\n\t\t...(relevantFiles.length ? ['Relevant files:', ...relevantFiles.map((line) => `- ${line}`)] : []),\n\t\t...(evidence.length ? ['Known evidence:', ...evidence.map((line) => `- ${line}`)] : [])\n\t];\n\tconst repairLines = blockers.length\n\t\t? [\n\t\t\t'Mandatory repair contract:',\n\t\t\t'- Address each active blocker before unrelated work.',\n\t\t\t'- For each blocker, mark resolved, proven false, or blocked.',\n\t\t\t'- Attach code, data, command, browser, screenshot, or trace proof for each blocker.',\n\t\t\t'- If a blocker repeats with no meaningful diff/evidence change, park instead of starting another broad attempt.'\n\t\t]\n\t\t: [];\n\tconst fullPromptLines = [\n\t\t...contract.promptLines,\n\t\t'',\n\t\t'Runner task context:',\n\t\t...contextLines,\n\t\t...(repairLines.length ? ['', ...repairLines] : [])\n\t];\n\treturn {\n\t\t...contract,\n\t\tobjective,\n\t\tcontextLines,\n\t\trepairLines,\n\t\tfullPromptLines\n\t};\n}\n\nexport function buildResolveIORunnerRepairPromptLines(input: ResolveIORunnerPromptInput = {}): string[] {\n\treturn buildResolveIORunnerPromptBundle(input).repairLines;\n}\n\nexport function normalizeResolveIORunnerBlocker(entry: string): string {\n\treturn String(entry || '')\n\t\t.toLowerCase()\n\t\t.replace(/:[0-9]+(?=\\b|[);,.\\s])/g, ':#')\n\t\t.replace(/\\bline\\s+[0-9]+\\b/g, 'line #')\n\t\t.replace(/\\blines?\\s+[0-9]+\\s*[-–]\\s*[0-9]+\\b/g, 'lines #')\n\t\t.replace(/\\battempt\\s+[0-9]+\\b/g, 'attempt #')\n\t\t.replace(/\\s+/g, ' ')\n\t\t.trim();\n}\n\nfunction uniqueNormalizedResolveIORunnerBlockers(values: any): string[] {\n\tif (!Array.isArray(values)) {\n\t\treturn [];\n\t}\n\treturn Array.from(new Set(\n\t\tvalues\n\t\t\t.map((entry) => normalizeResolveIORunnerBlocker(String(entry || '')))\n\t\t\t.filter(Boolean)\n\t));\n}\n\nexport function findRepeatedResolveIORunnerBlockers(previousBlockers: string[] = [], currentBlockers: string[] = []): string[] {\n\tconst previous = new Set(uniqueNormalizedResolveIORunnerBlockers(previousBlockers));\n\tif (!previous.size) {\n\t\treturn [];\n\t}\n\treturn Array.from(new Set(\n\t\t(currentBlockers || [])\n\t\t\t.map((entry) => String(entry || '').trim())\n\t\t\t.filter((entry) => previous.has(normalizeResolveIORunnerBlocker(entry)))\n\t));\n}\n\nexport function decideResolveIORunnerRepairContinuation(\n\tinput: ResolveIORunnerRepairContinuationInput = {}\n): ResolveIORunnerRepairContinuationDecision {\n\tconst currentBlockers = (input.currentBlockers || [])\n\t\t.map((entry) => String(entry || '').trim())\n\t\t.filter(Boolean);\n\tconst normalizedCurrentBlockers = uniqueNormalizedResolveIORunnerBlockers(currentBlockers);\n\tconst previousBlockers = uniqueNormalizedResolveIORunnerBlockers(input.previousBlockers || []);\n\tconst activeContractBlockers = uniqueNormalizedResolveIORunnerBlockers(input.activeContractBlockers || []);\n\tconst priorBlockers = new Set([...previousBlockers, ...activeContractBlockers]);\n\tconst repeatedBlockers = findRepeatedResolveIORunnerBlockers(Array.from(priorBlockers), currentBlockers);\n\tconst repeated = new Set(repeatedBlockers.map((entry) => normalizeResolveIORunnerBlocker(entry)));\n\tconst newBlockers = currentBlockers.filter((entry) => !repeated.has(normalizeResolveIORunnerBlocker(entry)));\n\tconst currentAttempt = normalizePositiveInteger(input.currentAttempt, 1, 1, 100);\n\tconst maxAttempts = normalizePositiveInteger(input.maxAttempts, 3, 1, 100);\n\tconst currentRepairWaveCount = normalizePositiveInteger(input.currentRepairWaveCount, 0, 0, 100);\n\tconst maxRepairWaves = normalizePositiveInteger(input.maxRepairWaves, 3, 0, 100);\n\tconst diffHash = normalizeOptionalString(input.diffHash);\n\tconst evidenceHash = normalizeOptionalString(input.evidenceHash);\n\tconst previousDiffHash = normalizeOptionalString(input.previousDiffHash);\n\tconst previousEvidenceHash = normalizeOptionalString(input.previousEvidenceHash);\n\tconst noProgress = !!previousDiffHash\n\t\t&& !!previousEvidenceHash\n\t\t&& previousDiffHash === diffHash\n\t\t&& previousEvidenceHash === evidenceHash;\n\tconst nextAttempt = currentAttempt + 1;\n\tconst nextRepairWaveCount = currentRepairWaveCount + 1;\n\tif (noProgress) {\n\t\treturn {\n\t\t\taction: 'park_no_progress',\n\t\t\trepeatedBlockers,\n\t\t\tnewBlockers,\n\t\t\tnormalizedCurrentBlockers,\n\t\t\tnextAttempt,\n\t\t\tnextRepairWaveCount,\n\t\t\treason: 'Targeted repair made no meaningful diff or evidence progress.'\n\t\t};\n\t}\n\tif (repeatedBlockers.length) {\n\t\treturn {\n\t\t\taction: 'park_repeated_blocker',\n\t\t\trepeatedBlockers,\n\t\t\tnewBlockers,\n\t\t\tnormalizedCurrentBlockers,\n\t\t\tnextAttempt,\n\t\t\tnextRepairWaveCount,\n\t\t\treason: 'The same normalized blocker repeated after a targeted repair.'\n\t\t};\n\t}\n\tconst shouldStartNewWave = currentBlockers.length > 0\n\t\t&& (\n\t\t\tactiveContractBlockers.length > 0\n\t\t\t|| currentAttempt >= maxAttempts\n\t\t);\n\tif (shouldStartNewWave) {\n\t\tif (currentRepairWaveCount >= maxRepairWaves) {\n\t\t\treturn {\n\t\t\t\taction: 'park_repair_wave_budget',\n\t\t\t\trepeatedBlockers,\n\t\t\t\tnewBlockers,\n\t\t\t\tnormalizedCurrentBlockers,\n\t\t\t\tnextAttempt,\n\t\t\t\tnextRepairWaveCount,\n\t\t\t\treason: `Repair wave budget exhausted (${currentRepairWaveCount}/${maxRepairWaves}).`\n\t\t\t};\n\t\t}\n\t\treturn {\n\t\t\taction: 'start_repair_wave',\n\t\t\trepeatedBlockers,\n\t\t\tnewBlockers,\n\t\t\tnormalizedCurrentBlockers,\n\t\t\tnextAttempt: 2,\n\t\t\tnextRepairWaveCount,\n\t\t\treason: 'A prior blocker was cleared and a new blocker appeared; start a focused repair wave instead of consuming the final attempt.'\n\t\t};\n\t}\n\treturn {\n\t\taction: 'continue_attempt',\n\t\trepeatedBlockers,\n\t\tnewBlockers,\n\t\tnormalizedCurrentBlockers,\n\t\tnextAttempt,\n\t\tnextRepairWaveCount: currentRepairWaveCount,\n\t\treason: 'Continue with the next targeted attempt.'\n\t};\n}\n\nexport function classifyResolveIORunnerBlocker(blocker: string): string {\n\tconst text = String(blocker || '');\n\tif (/database call inside loop|findOne.*inside loop|query inside loop/i.test(text)) {\n\t\treturn 'db_call_inside_loop';\n\t}\n\tif (/inventory transaction parity|inventory transactions? are correct|inventory transaction creation\\/reversal|inventory drift|reverse(?:s| old).*inventory|custom chemical lines?/i.test(text)) {\n\t\treturn 'inventory_transaction_parity';\n\t}\n\tif (/company\\/global default line-item surcharge|customer surcharge override|surcharge override.*default|global\\/company surcharge|fallback\\/override|first active surcharge/i.test(text)) {\n\t\treturn 'surcharge_default_precedence';\n\t}\n\tif (/\\bTS\\d{4}\\b[\\s\\S]{0,220}\\bExpected\\s+0\\s+arguments?\\b[\\s\\S]{0,160}\\bgot\\s+1\\b/i.test(text)\n\t\t&& /\\b(publication|publications\\.ts|subscribe|user_specific|ForUser|yardsForUser|customerNotifications|notificationCenter)\\b/i.test(text)) {\n\t\treturn 'user_specific_publication_argument_mismatch';\n\t}\n\tif (/\\b(publication signature mismatch|generated publication signature|publication wrapper)\\b[\\s\\S]{0,220}\\b(?:yardsForUser|[A-Za-z0-9_]*ForUser)\\b[\\s\\S]{0,160}\\bcompile errors?\\b/i.test(text)\n\t\t|| /\\b(?:yardsForUser|[A-Za-z0-9_]*ForUser)\\b[\\s\\S]{0,180}\\bcompile errors?\\b[\\s\\S]{0,180}\\b(publication|publications\\.ts|signature|wrapper)\\b/i.test(text)) {\n\t\treturn 'user_specific_publication_argument_mismatch';\n\t}\n\tif (/\\b(user_specific|user-specific)\\b[\\s\\S]{0,220}\\b(Expected\\s+0\\s+arguments?|got\\s+1|passes?\\s+1\\s+argument|publication wrapper)\\b/i.test(text)) {\n\t\treturn 'user_specific_publication_argument_mismatch';\n\t}\n\tif (/focused verification evidence|Behavior-level test\\/QA evidence|browser QA|screenshot|trace artifacts?|Billing Dashboard.*create\\/edit|server-side evidence|Validation evidence/i.test(text)) {\n\t\treturn 'support_qa_evidence';\n\t}\n\tif (/Approved scope requirement is not covered|approved .* scope lacks/i.test(text)) {\n\t\treturn 'approved_scope_missing';\n\t}\n\tif (/UI-facing ticket needs|browser\\/localhost QA|local\\/browser QA/i.test(text)) {\n\t\treturn 'ui_qa_missing';\n\t}\n\tif (/Report\\/export ticket needs|report rows|export behavior/i.test(text)) {\n\t\treturn 'report_export_missing';\n\t}\n\tif (/QA coverage matrix|full suite|limited smoke|too limited|only proves navigation|empty table|header screenshot|pre-submit only|missing persisted result|missing tax|missing inventory|missing invoice edit|missing reopen/i.test(text)) {\n\t\treturn 'qa_coverage_incomplete';\n\t}\n\tif (/Generated .* changed without a matching/i.test(text)) {\n\t\treturn 'generated_file_mismatch';\n\t}\n\tif (/No repository files changed|no verifiable PR fix/i.test(text)) {\n\t\treturn 'no_repo_diff';\n\t}\n\tif (/QA compile preflight|ng serve failed|Angular ng serve failed|Completion build verification failed|build failed|TypeScript check failed|TypeScript compile|lint failed|TS\\d{4}|Cannot find module/i.test(text)) {\n\t\treturn 'completion_build_failed';\n\t}\n\treturn 'reviewer_blocker';\n}\n\nexport function extractResolveIORunnerRepairLineHints(blocker: string): string[] {\n\tconst hints: string[] = [];\n\tconst lineMatch = String(blocker || '').match(/(?:line\\s+|:)([0-9]+)\\b/i);\n\tif (lineMatch) {\n\t\thints.push(`line ${lineMatch[1]}`);\n\t}\n\tconst loopMatch = String(blocker || '').match(/loop starts near line\\s+([0-9]+)/i);\n\tif (loopMatch) {\n\t\thints.push(`loop starts near line ${loopMatch[1]}`);\n\t}\n\treturn Array.from(new Set(hints));\n}\n\nexport function extractResolveIORunnerRepairTargetFiles(blocker: string, changedFiles: string[] = []): string[] {\n\tconst files = new Set<string>();\n\tconst text = String(blocker || '');\n\tconst pathPattern = /(?:^|\\s)([A-Za-z0-9_.-]+(?:\\/[A-Za-z0-9_.-]+)+\\.(?:ts|tsx|js|jsx|html|scss|css|json|md))/g;\n\tlet match: RegExpExecArray | null;\n\twhile ((match = pathPattern.exec(text))) {\n\t\tfiles.add(match[1].replace(/\\\\/g, '/'));\n\t}\n\tfor (const filePath of changedFiles || []) {\n\t\tconst normalized = String(filePath || '').trim().replace(/\\\\/g, '/');\n\t\tif (normalized && (text.includes(normalized) || text.includes(normalized.replace(/^[^/]+\\//, '')))) {\n\t\t\tfiles.add(normalized);\n\t\t}\n\t}\n\treturn Array.from(files).slice(0, 8);\n}\n\nexport function selectResolveIORunnerRepairTargetFiles(\n\tchangedFiles: string[] = [],\n\tpreferredSuffixes: string[] = [],\n\tfallbackFiles: string[] = []\n): string[] {\n\tconst suffixes = (preferredSuffixes || [])\n\t\t.map((entry) => String(entry || '').trim().replace(/\\\\/g, '/').replace(/^\\/+/, ''))\n\t\t.filter(Boolean);\n\tconst matched = new Set<string>();\n\tfor (const filePath of changedFiles || []) {\n\t\tconst normalized = String(filePath || '').trim().replace(/\\\\/g, '/');\n\t\tif (normalized && suffixes.some((suffix) => normalized === suffix || normalized.endsWith(`/${suffix}`))) {\n\t\t\tmatched.add(normalized);\n\t\t}\n\t}\n\treturn (matched.size\n\t\t? Array.from(matched)\n\t\t: fallbackFiles.map((entry) => String(entry || '').trim().replace(/\\\\/g, '/')).filter(Boolean)\n\t).slice(0, 12);\n}\n\nexport function sanitizeResolveIORunnerRepairPlans(value: any): ResolveIORunnerRepairPlan[] {\n\treturn Array.isArray(value)\n\t\t? value.map((entry: any) => ({\n\t\t\tblockerClass: String(entry?.blockerClass || '').trim(),\n\t\t\tsourceGate: String(entry?.sourceGate || '').trim(),\n\t\t\ttargetFiles: Array.isArray(entry?.targetFiles) ? entry.targetFiles.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],\n\t\t\tlineHints: Array.isArray(entry?.lineHints) ? entry.lineHints.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],\n\t\t\tfailureEvidence: Array.isArray(entry?.failureEvidence) ? entry.failureEvidence.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],\n\t\t\trequiredProof: Array.isArray(entry?.requiredProof) ? entry.requiredProof.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],\n\t\t\trepairRecipe: Array.isArray(entry?.repairRecipe) ? entry.repairRecipe.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],\n\t\t\tselfGateCommands: Array.isArray(entry?.selfGateCommands) ? entry.selfGateCommands.map((item: any) => String(item || '').trim()).filter(Boolean).slice(0, 20) : [],\n\t\t\tpassingCondition: String(entry?.passingCondition || '').trim()\n\t\t})).filter((entry: ResolveIORunnerRepairPlan) => entry.blockerClass || entry.failureEvidence.length)\n\t\t: [];\n}\n\nfunction getResolveIORunnerRepairTargetOverride(\n\toptions: ResolveIORunnerRepairPlanInput,\n\tblockerClass: string\n): ResolveIORunnerRepairTargetOverride | null {\n\tconst override = options.targetFileOverrides?.[blockerClass];\n\tif (!override) {\n\t\treturn null;\n\t}\n\treturn {\n\t\tpreferredSuffixes: Array.isArray(override.preferredSuffixes) ? override.preferredSuffixes : [],\n\t\tfallbackFiles: Array.isArray(override.fallbackFiles) ? override.fallbackFiles : []\n\t};\n}\n\nfunction applyResolveIORunnerRepairTargetOverride(\n\tplan: ResolveIORunnerRepairPlan,\n\toptions: ResolveIORunnerRepairPlanInput,\n\tblockerClass: string\n): ResolveIORunnerRepairPlan {\n\tconst override = getResolveIORunnerRepairTargetOverride(options, blockerClass);\n\tif (!override || plan.targetFiles.length) {\n\t\treturn plan;\n\t}\n\treturn {\n\t\t...plan,\n\t\ttargetFiles: selectResolveIORunnerRepairTargetFiles(\n\t\t\toptions.changedFiles || [],\n\t\t\toverride.preferredSuffixes || [],\n\t\t\toverride.fallbackFiles || []\n\t\t)\n\t};\n}\n\nexport function buildResolveIORunnerRepairPlans(input: ResolveIORunnerRepairPlanInput = {}): ResolveIORunnerRepairPlan[] {\n\tconst changedFiles = Array.isArray(input.changedFiles) ? input.changedFiles : [];\n\tconst sourceGate = String(input.gateSource || 'pre_review_or_reviewer').trim() || 'pre_review_or_reviewer';\n\tconst qaRules = buildResolveIORunnerBasicsRules({\n\t\t...input,\n\t\tcontext: input.context || 'general',\n\t\tincludeDevServerRules: input.includeDevServerRules === true,\n\t\tmaxContextBullets: input.maxContextBullets || 8\n\t});\n\treturn Array.from(new Set((input.blockers || []).map((entry) => String(entry || '').trim()).filter(Boolean))).map((blocker) => {\n\t\tconst blockerClass = classifyResolveIORunnerBlocker(blocker);\n\t\tconst base: ResolveIORunnerRepairPlan = {\n\t\t\tblockerClass,\n\t\t\tsourceGate,\n\t\t\ttargetFiles: extractResolveIORunnerRepairTargetFiles(blocker, changedFiles),\n\t\t\tlineHints: extractResolveIORunnerRepairLineHints(blocker),\n\t\t\tfailureEvidence: [blocker].filter(Boolean).slice(0, 8),\n\t\t\trequiredProof: [],\n\t\t\trepairRecipe: [],\n\t\t\tselfGateCommands: [],\n\t\t\tpassingCondition: ''\n\t\t};\n\t\tif (blockerClass === 'db_call_inside_loop') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: [\n\t\t\t\t\t'Show the database lookup is batched before the loop, or prove the flagged call is not a database collection call.',\n\t\t\t\t\t'Cite the exact file/function and before-vs-after loop/query shape in Repair Execution Notes.',\n\t\t\t\t\t'Confirm the changed diff no longer has any per-item database collection call in any loop body in the touched/target server files.'\n\t\t\t\t],\n\t\t\t\trepairRecipe: [\n\t\t\t\t\t'Inspect every loop in the touched/target server files and identify all database collection calls inside those loops.',\n\t\t\t\t\t'Move collection reads before loops using batched `$in` queries, map results by id/key, then use the map inside loops.',\n\t\t\t\t\t'Move writes out of loops using batched `bulkWrite`/multi-update operations prepared inside the loop and executed after the loop.',\n\t\t\t\t\t'If the call is a local array/helper and not a database call, prove that with the declaration/import path and leave the code unchanged.',\n\t\t\t\t\t'Keep the behavior identical except for eliminating every per-item database call.'\n\t\t\t\t],\n\t\t\t\tselfGateCommands: [\n\t\t\t\t\t'git diff HEAD -- <target file>',\n\t\t\t\t\t'rg -n \"for .*\\\\{|\\\\.forEach|for \\\\(\" <target file>',\n\t\t\t\t\t'rg -n \"\\\\.(find|findOne|findOneAsync|count|countDocuments|update|updateOne|updateMany|insert|insertOne|bulkWrite|remove|deleteOne|deleteMany)\\\\(\" <target file>'\n\t\t\t\t],\n\t\t\t\tpassingCondition: 'No loop in the touched/target server files has a database collection call in its body, or final notes prove each flagged call is not a database call.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'report_export_missing') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: ['Prove report rows, filters, totals/grouping, and export behavior, or cite ticket evidence that export is out of scope.'],\n\t\t\t\trepairRecipe: ['Exercise the report/export path and record evidence for each report dimension requested by the ticket.'],\n\t\t\t\tselfGateCommands: ['Run the report/export verification command or browser flow for the ticket.'],\n\t\t\t\tpassingCondition: 'Final notes prove rows, filters, totals/grouping, and export behavior or a ticket-backed out-of-scope decision.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'inventory_transaction_parity') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: [\n\t\t\t\t\t'Prove non-Manual Delivery and Truck Treat custom chemical lines create inventory relief transactions on invoice create.',\n\t\t\t\t\t'Prove invoice edit reverses old custom chemical effects and applies the new custom chemical effects.',\n\t\t\t\t\t'Prove invoice remove/delete reverses the same non-Manual custom chemical inventory effects.'\n\t\t\t\t],\n\t\t\t\trepairRecipe: [\n\t\t\t\t\t'Start in server/src/methods/invoices.ts and trace Manual inventory behavior before changing the non-Manual path.',\n\t\t\t\t\t'Reuse the existing inventory transaction helper shape instead of creating a parallel inventory writer.',\n\t\t\t\t\t'Handle all custom chemical lines in one sweep: create, edit, and remove for Delivery and Truck Treat invoices.',\n\t\t\t\t\t'Do not stop after fixing only create; the reviewer blocker includes edit and remove reversal.'\n\t\t\t\t],\n\t\t\t\tselfGateCommands: [\n\t\t\t\t\t'git diff HEAD -- server/src/methods/invoices.ts server/src/methods/inventory-transactions.ts',\n\t\t\t\t\t'rg -n \"is_custom_line_item|addInventoryTransaction|removeInvoice|editInvoice|custom chemical\" server/src/methods/invoices.ts',\n\t\t\t\t\t'Run or add a focused server/data assertion covering create, edit, and remove inventory transactions for non-Manual custom chemical lines.'\n\t\t\t\t],\n\t\t\t\tpassingCondition: 'Create, edit, and remove paths for non-Manual custom chemical invoice lines all have inventory transaction proof.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'surcharge_default_precedence') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: [\n\t\t\t\t\t'Show the persisted company/global default surcharge owner, not just the first active surcharge item.',\n\t\t\t\t\t'Show precedence is customer override when active, then company/global default when active, then empty/none when inactive or unset.',\n\t\t\t\t\t'Show at least one override customer and one default customer path in verification evidence.'\n\t\t\t\t],\n\t\t\t\trepairRecipe: [\n\t\t\t\t\t'Find the surcharge default selector and replace any first-active-item fallback with an explicit persisted default setting.',\n\t\t\t\t\t'Keep customer override storage separate from the company/global default setting.',\n\t\t\t\t\t'Reject inactive surcharge items during both override and default fallback.',\n\t\t\t\t\t'Cover unset and inactive settings with safe empty/none behavior.'\n\t\t\t\t],\n\t\t\t\tselfGateCommands: [\n\t\t\t\t\t'git diff HEAD -- angular/app/manage/item angular/app/widgets/dialog/dialog.adjust-customer.content.ts server/src/collections server/src/models',\n\t\t\t\t\t'rg -n \"line_item_surcharge|surcharge|id_line_item_surcharge_override|default\" angular/app server/src',\n\t\t\t\t\t'Run or add a focused fallback/override assertion for active override, active company default, inactive override/default, and unset default.'\n\t\t\t\t],\n\t\t\t\tpassingCondition: 'Customer override -> company/global default -> none precedence is persisted and verified.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'support_qa_evidence') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: [\n\t\t\t\t\t'Include browser route and screenshot/trace artifact paths for each distinct changed customer-facing feature or workflow state.',\n\t\t\t\t\t'Do not duplicate screenshots across multiple customers unless the customer-specific override/fallback behavior is the feature being proven.',\n\t\t\t\t\t'Include data/assertion evidence for requested persistence, calculations, and side effects.',\n\t\t\t\t\t'Include a QA Coverage Matrix row for every approved scope item and every touched workflow/domain.',\n\t\t\t\t\t'For import/export/form-submit/data workflow fixes, include before/action/after screenshots or trace steps plus the exact row/count/value assertion proving the submitted data changed as expected.',\n\t\t\t\t\t'Reject empty page/table/header screenshots as insufficient unless the approved requirement is explicitly an empty-state UI.',\n\t\t\t\t\t'Use a 1920x1080-or-wider desktop viewport for screenshots unless the ticket explicitly requests mobile/responsive behavior; desktop nav must be closed and not wrapped over the workflow.',\n\t\t\t\t\t'Before pass, prove each cited screenshot visibly contains the target row/control/value and is not covered by the ResolveIO menu/sidebar/header overlay. If DOM text passes but screenshot is covered, recapture after closing/settling the shell.',\n\t\t\t\t\t'Provide a customer-facing caption for each screenshot that explains the workflow state and proof shown.',\n\t\t\t\t\t'If browser QA cannot start, include the exact startup blocker and the compile/preflight command output.'\n\t\t\t\t],\n\t\t\t\trepairRecipe: [\n\t\t\t\t\t...qaRules,\n\t\t\t\t\t...buildResolveIORunnerQaCoverageChecklist({\n\t\t\t\t\t\tticketText: input.blockers?.join('\\n') || '',\n\t\t\t\t\t\tchangedFiles\n\t\t\t\t\t}),\n\t\t\t\t\t'Upload or preserve screenshots/trace paths so the PR and support ticket can reference them.'\n\t\t\t\t],\n\t\t\t\tselfGateCommands: [\n\t\t\t\t\t'Run the support QA compile/startup preflight.',\n\t\t\t\t\t'Run the ticket-specific browser QA click-through and capture screenshots/trace artifacts.',\n\t\t\t\t\t'Record artifact paths and data assertions in final notes.'\n\t\t\t\t],\n\t\t\t\tpassingCondition: 'Final notes include one QA screenshot/trace path per distinct changed feature plus data assertions for the approved scope.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'qa_coverage_incomplete') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: [\n\t\t\t\t\t'Provide a QA Coverage Matrix that covers every changed workflow/domain from the approved scope and diff.',\n\t\t\t\t\t'For invoice/billing/tax/inventory changes, include create/edit/reopen/delete or not-applicable coverage plus persisted row/value assertions.',\n\t\t\t\t\t'Show fresh screenshots/traces with customer-facing captions for each distinct changed workflow state.'\n\t\t\t\t],\n\t\t\t\trepairRecipe: [\n\t\t\t\t\t'Read the approved scope, BUILD_PLAN, changed files, and prior QA evidence; identify every workflow/domain touched by the implementation.',\n\t\t\t\t\t...buildResolveIORunnerQaCoverageChecklist({\n\t\t\t\t\t\tticketText: blocker,\n\t\t\t\t\t\tchangedFiles\n\t\t\t\t\t}),\n\t\t\t\t\t'If localhost QA has no usable records for a required workflow, seed a minimal faithful fixture in the local QA database and cite the fixture IDs/names in the matrix; production data stays read-only.',\n\t\t\t\t\t'If QA finds a product defect while covering the matrix, fix that defect in a targeted repair wave, rerun compile/startup preflight, then rerun the failed matrix row before continuing.',\n\t\t\t\t\t'Return pass only after the matrix is complete; otherwise return needs-fix with the exact missing matrix row.'\n\t\t\t\t],\n\t\t\t\tselfGateCommands: [\n\t\t\t\t\t'Run compile/startup preflight before browser QA.',\n\t\t\t\t\t'Run the ticket-specific browser/data QA flow for every QA Coverage Matrix row.',\n\t\t\t\t\t'Record artifact paths, captions, and persisted row/count/value assertions in final notes.'\n\t\t\t\t],\n\t\t\t\tpassingCondition: 'Every QA Coverage Matrix row has a pass result with screenshot/trace/data proof, or the job returns a precise needs-fix blocker that seeds the next repair wave.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'approved_scope_missing') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: ['Add one Self-Review Checklist bullet for the exact missing approved requirement with code/data/browser proof.'],\n\t\t\t\trepairRecipe: ['Verify the missing approved requirement, then implement or document done/not applicable/blocked with proof.'],\n\t\t\t\tselfGateCommands: ['Review final notes for exact approved requirement text and proof artifact.'],\n\t\t\t\tpassingCondition: 'Every missing approved requirement is explicitly mapped to done/not applicable/blocked with proof.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'ui_qa_missing') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: ['Provide browser route plus screenshot/trace/video path, or a precise LOCALHOST_QA_PLAYBOOK startup/access blocker.'],\n\t\t\t\trepairRecipe: ['Run local/browser QA for the failing UI route after the fix, or document the exact startup/access blocker.'],\n\t\t\t\tselfGateCommands: ['source .resolveio-support-tools/env.sh if present', 'Run the ticket-specific localhost/browser QA command or capture blocker.'],\n\t\t\t\tpassingCondition: 'Final notes contain browser QA artifact evidence or a concrete local startup/access blocker.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'generated_file_mismatch') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: ['Show generated client file changes correspond to matching server method/publication source changes.'],\n\t\t\t\trepairRecipe: ['Either update the server owner and regenerate the companion file, or revert the orphan generated file change.'],\n\t\t\t\tselfGateCommands: ['git diff HEAD -- angular/app/methods.ts angular/app/publications.ts server/src/methods server/src/publications'],\n\t\t\t\tpassingCondition: 'No generated client file is changed without its source server owner change.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'user_specific_publication_argument_mismatch') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: [\n\t\t\t\t\t'List every failing call site and show each one was fixed, not just the first TypeScript error.',\n\t\t\t\t\t'Show whether each call needs the current logged-in user or an explicit other user/driver id.',\n\t\t\t\t\t'Show generated angular/app/publications.ts came from server/src/publications source and was not hand-edited as the behavioral fix.'\n\t\t\t\t],\n\t\t\t\trepairRecipe: [\n\t\t\t\t\t'user_specific publications inject the logged-in socket user as the first server parameter; generated client wrappers should remove only that injected parameter.',\n\t\t\t\t\t'Before changing call sites, inspect the source publication signature. If a client can pass a target user/driver, make the source explicit as function(id_current_user: string, id_user?: string) and regenerate.',\n\t\t\t\t\t'Only remove a client argument when the publication truly uses the injected current user only; otherwise preserve explicit target-user/driver calls such as yardsForUser(id_driver).',\n\t\t\t\t\t'Do not hand-edit generated angular/app/publications.ts to accept the injected id_user again; fix source publications/call sites, then regenerate.',\n\t\t\t\t\t'Search the whole app for the failing wrapper name and repair all argument-passing calls in the same pass.'\n\t\t\t\t],\n\t\t\t\tselfGateCommands: [\n\t\t\t\t\t'rg -n \"\\\\b[A-Za-z0-9_]*ForUser\\\\s*\\\\([^)]+\" angular/app server/src',\n\t\t\t\t\t'rg -n \"\\\\byardsForUser\\\\s*\\\\([^)]+\" angular/app server/src',\n\t\t\t\t\t'Run the method/publication generator if server publication source changed.',\n\t\t\t\t\t'Rerun the exact TypeScript/Angular compile command that failed.'\n\t\t\t\t],\n\t\t\t\tpassingCondition: 'Generated user_specific wrappers strip only the injected current-user parameter, explicit target-user arguments still compile where required, and the exact compile command exits 0.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\tif (blockerClass === 'completion_build_failed') {\n\t\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t\t...base,\n\t\t\t\trequiredProof: ['Include the failing command, root cause, fix, and passing rerun output.'],\n\t\t\t\trepairRecipe: ['Fix the compile/test failure directly, then rerun the exact failing command.'],\n\t\t\t\tselfGateCommands: ['Rerun the exact completion/build command shown in the blocker.'],\n\t\t\t\tpassingCondition: 'The exact previously failing build/test command passes or is blocked with concrete environment evidence.'\n\t\t\t}, input, blockerClass);\n\t\t}\n\t\treturn applyResolveIORunnerRepairTargetOverride({\n\t\t\t...base,\n\t\t\trequiredProof: ['Resolve, prove false, or block this reviewer/gate blocker with concrete code/data/browser proof.'],\n\t\t\trepairRecipe: ['Inspect the cited file/evidence, make the smallest supported fix, and cite before-vs-after proof.'],\n\t\t\tselfGateCommands: ['git diff HEAD --stat', 'Run the ticket-specific verification for this blocker.'],\n\t\t\tpassingCondition: 'The blocker text no longer applies and final notes include concrete proof.'\n\t\t}, input, blockerClass);\n\t});\n}\n"]}
@@ -0,0 +1,109 @@
1
+ import { AIRun } from './ai-run-evidence';
2
+ export interface SupportAIRunAdapterInput {
3
+ ticket?: Record<string, any>;
4
+ job?: Record<string, any>;
5
+ versions?: Array<Record<string, any>>;
6
+ buildPlans?: Array<Record<string, any>>;
7
+ aiJobs?: Array<Record<string, any>>;
8
+ taskEvents?: Array<Record<string, any>>;
9
+ usageLedger?: Array<Record<string, any>>;
10
+ commits?: Array<Record<string, any>>;
11
+ qaEvidence?: Record<string, any>;
12
+ now?: Date | string;
13
+ }
14
+ export interface AICoderAIRunAdapterInput {
15
+ app?: Record<string, any>;
16
+ job?: Record<string, any>;
17
+ logs?: Array<Record<string, any>>;
18
+ usageLedger?: Array<Record<string, any>>;
19
+ commits?: Array<Record<string, any>>;
20
+ qaEvidence?: Record<string, any>;
21
+ now?: Date | string;
22
+ }
23
+ export interface AssistantAIRunAdapterInput {
24
+ runId?: string;
25
+ requestId?: string;
26
+ messageId?: string;
27
+ conversation?: Record<string, any>;
28
+ messages?: Array<Record<string, any>>;
29
+ issueReports?: Array<Record<string, any>>;
30
+ usageLedger?: Array<Record<string, any>>;
31
+ correctnessChecks?: Array<Record<string, any>>;
32
+ answerQuality?: Record<string, any>;
33
+ now?: Date | string;
34
+ }
35
+ export type AssistantAnswerQualityStatus = 'ready' | 'missing_data_source' | 'date_incorrect' | 'missing_date_window' | 'illegal_query_shape' | 'missing_query_proof' | 'query_error' | 'permission_error' | 'no_data_unverified' | 'missing_citations' | 'low_confidence' | 'missing_next_action' | 'incorrect' | 'blocked';
36
+ export interface AssistantAnswerQualityInput {
37
+ answerQuality?: Record<string, any>;
38
+ correctnessChecks?: Array<Record<string, any>>;
39
+ now?: Date | string;
40
+ }
41
+ export interface AssistantAnswerQualityDecision {
42
+ ready: boolean;
43
+ status: AssistantAnswerQualityStatus;
44
+ reason: string;
45
+ blockers: string[];
46
+ queryStatus: 'ok' | 'no_data' | 'query_error' | 'permission_error' | 'unknown';
47
+ confidenceLevel: 'high' | 'medium' | 'low' | 'unknown';
48
+ dateBasis?: string;
49
+ expectedCurrentDate?: string;
50
+ dateWindowRequired: boolean;
51
+ dateWindowPresent: boolean;
52
+ dateWindow?: {
53
+ startDate?: string;
54
+ endDate?: string;
55
+ mode?: string;
56
+ months?: number;
57
+ };
58
+ noDataConfirmed: boolean;
59
+ legalQueryShape: boolean;
60
+ citationRefs: string[];
61
+ queryEvidenceRequired: boolean;
62
+ queryEvidencePresent: boolean;
63
+ queryEvidenceRefs: string[];
64
+ queryExecutionCount: number;
65
+ nextActions: string[];
66
+ evidenceRefs: string[];
67
+ failedChecks: string[];
68
+ recordedAt: string;
69
+ }
70
+ export type AssistantAnswerActionabilityStatus = 'ready_to_answer' | 'needs_query_repair' | 'needs_permission' | 'needs_no_data_verification' | 'needs_date_window_repair' | 'needs_query_shape_repair' | 'needs_evidence' | 'needs_confidence_review' | 'needs_next_action' | 'incorrect' | 'blocked';
71
+ export interface AssistantAnswerActionabilityContract {
72
+ contractId: string;
73
+ status: AssistantAnswerActionabilityStatus;
74
+ primaryCommand: string;
75
+ label: string;
76
+ canAnswerCustomer: boolean;
77
+ canDraftSupportReply: boolean;
78
+ canSendCustomerReply: boolean;
79
+ requiresHumanReview: boolean;
80
+ canRunWithoutCodexMonitor: boolean;
81
+ codexFallbackRequired: boolean;
82
+ costRisk: 'free_or_deterministic' | 'small_model_or_qa' | 'expensive_model' | 'release_or_customer_send' | 'manual_blocked';
83
+ queryResultClass: AssistantAnswerQualityDecision['queryStatus'];
84
+ confidenceLevel: AssistantAnswerQualityDecision['confidenceLevel'];
85
+ decisionBasis: {
86
+ answerQualityStatus: AssistantAnswerQualityStatus;
87
+ queryStatus: AssistantAnswerQualityDecision['queryStatus'];
88
+ queryEvidencePresent: boolean;
89
+ noDataConfirmed: boolean;
90
+ legalQueryShape: boolean;
91
+ dateWindowRequired: boolean;
92
+ dateWindowPresent: boolean;
93
+ citationCount: number;
94
+ nextActionCount: number;
95
+ };
96
+ requiredEvidence: string[];
97
+ successEvidence: string[];
98
+ blockers: string[];
99
+ nextActions: string[];
100
+ nextCommands: string[];
101
+ forbiddenActions: string[];
102
+ evidenceRefs: string[];
103
+ recordedAt: string;
104
+ }
105
+ export declare function evaluateAssistantAnswerQuality(input?: AssistantAnswerQualityInput): AssistantAnswerQualityDecision;
106
+ export declare function buildAssistantAnswerActionabilityContract(decision: AssistantAnswerQualityDecision, now?: Date | string): AssistantAnswerActionabilityContract;
107
+ export declare function buildSupportAIRunFromEvidence(input: SupportAIRunAdapterInput): AIRun;
108
+ export declare function buildAICoderAIRunFromEvidence(input: AICoderAIRunAdapterInput): AIRun;
109
+ export declare function buildAssistantAIRunFromEvidence(input: AssistantAIRunAdapterInput): AIRun;