@resolveio/server-lib 22.3.220 → 22.3.221

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/.nodemon.json +5 -0
  2. package/.vscode/settings.json +21 -0
  3. package/AGENTS.md +195 -0
  4. package/README.md +22 -0
  5. package/build_package.sh +5 -0
  6. package/compileDTS.pl +64 -0
  7. package/docs/ai-assistant-nightly-eval.md +65 -0
  8. package/docs/ai-assistant-preflight-checklist.md +23 -0
  9. package/docs/ai-assistant-report-builder-bridge-playbook.md +115 -0
  10. package/eslint-plugin-custom/index.js +7 -0
  11. package/eslint-plugin-custom/rules/no-filter-zero-index.js +44 -0
  12. package/eslint.config.js +103 -0
  13. package/gulpfile.js +216 -0
  14. package/methodAndPublicationListGenerator.py +375 -0
  15. package/mongodbensurers.js +2 -0
  16. package/mongostop.js +3 -0
  17. package/package.json +1 -1
  18. package/scripts/cleanup-bypassed-callmethod-logs.js +616 -0
  19. package/settings.development.json +25 -0
  20. package/settings.development.redacted.json +25 -0
  21. package/src/.env +12 -0
  22. package/src/ai/assistant-core-heuristics.ts +379 -0
  23. package/src/ai/resolveio-platform-intelligence-memory-corpus.ts +185 -0
  24. package/src/ai/resolveio-platform-intelligence-memory.ts +325 -0
  25. package/{ai/resolveio-platform-intelligence-types.d.ts → src/ai/resolveio-platform-intelligence-types.ts} +20 -15
  26. package/src/ai/resolveio-platform-intelligence.ts +462 -0
  27. package/src/client-server-app.ts +12 -0
  28. package/src/collections/ai-run.collection.ts +117 -0
  29. package/src/collections/ai-terminal-conversation.collection.ts +91 -0
  30. package/src/collections/ai-terminal-issue-report.collection.ts +99 -0
  31. package/src/collections/ai-terminal-message.collection.ts +77 -0
  32. package/src/collections/app-setting.collection.ts +104 -0
  33. package/src/collections/app-status.collection.ts +58 -0
  34. package/src/collections/communication-metric.collection.ts +84 -0
  35. package/src/collections/counter.collection.ts +56 -0
  36. package/src/collections/cron-job-history.collection.ts +94 -0
  37. package/src/collections/cron-job.collection.ts +92 -0
  38. package/src/collections/customer-notification.collection.ts +131 -0
  39. package/src/collections/customer-portal-password.collection.ts +76 -0
  40. package/src/collections/email-history.collection.ts +134 -0
  41. package/src/collections/email-verified.collection.ts +62 -0
  42. package/src/collections/file.collection.ts +74 -0
  43. package/src/collections/flag-update.collection.ts +57 -0
  44. package/src/collections/flag.collection.ts +57 -0
  45. package/src/collections/log-method-latency.collection.ts +77 -0
  46. package/src/collections/log-subscription.collection.ts +80 -0
  47. package/src/collections/log.collection.ts +93 -0
  48. package/src/collections/logged-in-users.collection.ts +67 -0
  49. package/src/collections/monitor-cpu.collection.ts +65 -0
  50. package/src/collections/monitor-function.collection.ts +74 -0
  51. package/src/collections/monitor-memory.collection.ts +77 -0
  52. package/src/collections/monitor-mongo.collection.ts +71 -0
  53. package/src/collections/notification.collection.ts +57 -0
  54. package/src/collections/openai-usage-ledger.collection.ts +131 -0
  55. package/src/collections/report-builder-dashboard-builder.collection.ts +109 -0
  56. package/src/collections/report-builder-library.collection.ts +89 -0
  57. package/src/collections/report-builder-report.collection.ts +184 -0
  58. package/src/collections/user-group.collection.ts +89 -0
  59. package/src/collections/user-guide.collection.ts +57 -0
  60. package/src/collections/user.collection.ts +181 -0
  61. package/src/cron/cron.ts +117 -0
  62. package/src/fixtures/cron-jobs.ts +95 -0
  63. package/src/fixtures/init.ts +35 -0
  64. package/src/http/auth.ts +818 -0
  65. package/src/http/health.ts +7 -0
  66. package/src/http/home.ts +90 -0
  67. package/src/http/slow-query-publication.ts +49 -0
  68. package/src/index.ts +1 -0
  69. package/src/managers/ai-assistant-codex-manager.manager.ts +1131 -0
  70. package/src/managers/ai-run-evidence.manager.ts +264 -0
  71. package/src/managers/communication-metric.manager.ts +82 -0
  72. package/src/managers/cron.manager.ts +333 -0
  73. package/src/managers/customer-notification-content.manager.ts +236 -0
  74. package/src/managers/diagnostic-manager-bootstrap.ts +165 -0
  75. package/src/managers/error-auto-fix.manager.ts +2767 -0
  76. package/src/managers/local-log.manager.ts +113 -0
  77. package/src/managers/method.manager.ts +1857 -0
  78. package/src/managers/mongo.manager.ts +4575 -0
  79. package/src/managers/monitor.manager.ts +507 -0
  80. package/src/managers/openai-usage-ledger.manager.ts +112 -0
  81. package/src/managers/slow-query-verifier.manager.ts +3590 -0
  82. package/src/managers/slow-query.manager.ts +519 -0
  83. package/src/managers/subscription.manager.ts +3128 -0
  84. package/src/managers/websocket.manager.ts +746 -0
  85. package/src/managers/worker-dispatcher.manager.ts +1360 -0
  86. package/src/managers/worker-server.manager.ts +536 -0
  87. package/src/methods/accounts.ts +532 -0
  88. package/src/methods/ai-terminal.ts +29070 -0
  89. package/src/methods/app-settings.ts +114 -0
  90. package/src/methods/aws.ts +649 -0
  91. package/src/methods/collections.ts +641 -0
  92. package/src/methods/counters.ts +69 -0
  93. package/src/methods/cron-jobs.ts +2614 -0
  94. package/src/methods/customer-notifications.ts +458 -0
  95. package/src/methods/diagnostics.ts +616 -0
  96. package/src/methods/flag-updates.ts +7 -0
  97. package/src/methods/flags.ts +7 -0
  98. package/src/methods/logs.ts +657 -0
  99. package/src/methods/mongo-explorer.ts +1880 -0
  100. package/src/methods/monitor.ts +540 -0
  101. package/src/methods/pdf.ts +1236 -0
  102. package/src/methods/publications.ts +129 -0
  103. package/src/methods/report-builder.ts +3300 -0
  104. package/src/methods/support.ts +335 -0
  105. package/src/models/ai-run.model.ts +27 -0
  106. package/src/models/ai-terminal-conversation.model.ts +19 -0
  107. package/src/models/ai-terminal-issue-report.model.ts +21 -0
  108. package/src/models/ai-terminal-message.model.ts +24 -0
  109. package/src/models/app-setting.model.ts +17 -0
  110. package/{models/app-status.model.d.ts → src/models/app-status.model.ts} +3 -2
  111. package/{models/billing-logged-in-users.model.d.ts → src/models/billing-logged-in-users.model.ts} +5 -4
  112. package/src/models/collection-document.model.ts +24 -0
  113. package/src/models/communication-metric.model.ts +23 -0
  114. package/{models/counter.model.d.ts → src/models/counter.model.ts} +4 -3
  115. package/src/models/cron-job-history.model.ts +16 -0
  116. package/src/models/cron-job.model.ts +15 -0
  117. package/src/models/customer-notification.model.ts +28 -0
  118. package/src/models/customer-portal-password.model.ts +12 -0
  119. package/src/models/dialog.model.ts +25 -0
  120. package/{models/email-history.model.js → src/models/email-history.model.ts} +36 -4
  121. package/{models/email-verified.model.d.ts → src/models/email-verified.model.ts} +6 -5
  122. package/{models/file.model.d.ts → src/models/file.model.ts} +8 -7
  123. package/{models/flag-update.model.d.ts → src/models/flag-update.model.ts} +4 -3
  124. package/{models/flag.model.d.ts → src/models/flag.model.ts} +4 -3
  125. package/src/models/log-method-latency.model.ts +11 -0
  126. package/{models/log-subscription.model.d.ts → src/models/log-subscription.model.ts} +11 -9
  127. package/src/models/log.model.ts +19 -0
  128. package/{models/logged-in-users.model.d.ts → src/models/logged-in-users.model.ts} +6 -5
  129. package/{models/method-response.model.d.ts → src/models/method-response.model.ts} +7 -6
  130. package/src/models/method.model.ts +25 -0
  131. package/{models/monitor-cpu.model.d.ts → src/models/monitor-cpu.model.ts} +9 -7
  132. package/src/models/monitor-function.model.ts +16 -0
  133. package/src/models/monitor-memory.model.ts +17 -0
  134. package/src/models/monitor-mongo.model.ts +15 -0
  135. package/{models/notification.model.d.ts → src/models/notification.model.ts} +6 -4
  136. package/src/models/openai-usage-ledger.model.ts +56 -0
  137. package/src/models/pagination.model.ts +35 -0
  138. package/src/models/permission.model.ts +14 -0
  139. package/src/models/report-builder-dashboard-builder.model.ts +29 -0
  140. package/src/models/report-builder-library.model.ts +20 -0
  141. package/src/models/report-builder-report.model.ts +136 -0
  142. package/src/models/report-builder.model.ts +68 -0
  143. package/src/models/select-data-label.model.ts +9 -0
  144. package/src/models/server-message.model.ts +31 -0
  145. package/src/models/slow-query-report.model.ts +23 -0
  146. package/src/models/subscription.model.ts +73 -0
  147. package/src/models/support-ticket.model.ts +104 -0
  148. package/src/models/user-group.model.ts +24 -0
  149. package/{models/user-guide.model.d.ts → src/models/user-guide.model.ts} +5 -4
  150. package/src/models/user.model.ts +96 -0
  151. package/src/private/images/ResolveIO.png +0 -0
  152. package/src/publications/ai-terminal.ts +73 -0
  153. package/src/publications/app-settings.ts +25 -0
  154. package/src/publications/app-status.ts +13 -0
  155. package/src/publications/cron-jobs.ts +40 -0
  156. package/src/publications/customer-notifications.ts +101 -0
  157. package/src/publications/files.ts +33 -0
  158. package/src/publications/flags-update.ts +19 -0
  159. package/src/publications/flags.ts +19 -0
  160. package/src/publications/logs.ts +163 -0
  161. package/src/publications/notifications.ts +13 -0
  162. package/src/publications/report-builder-dashboard-builders.ts +39 -0
  163. package/src/publications/report-builder-libraries.ts +41 -0
  164. package/src/publications/report-builder-reports.ts +47 -0
  165. package/src/publications/super-admin.ts +13 -0
  166. package/src/publications/user-groups.ts +12 -0
  167. package/src/publications/user-guides.ts +12 -0
  168. package/src/resolveio-server-app.ts +617 -0
  169. package/src/server-app.ts +3354 -0
  170. package/src/services/codex-client.ts +1231 -0
  171. package/src/services/openai-client.ts +265 -0
  172. package/src/types/error-report.ts +26 -0
  173. package/src/types/js-tiktoken.d.ts +11 -0
  174. package/src/types/slow-query-report.ts +28 -0
  175. package/src/util/ai-qa-policy.ts +925 -0
  176. package/src/util/ai-run-evidence-adapters.ts +8347 -0
  177. package/src/util/ai-run-evidence-dashboard.ts +323 -0
  178. package/src/util/ai-run-evidence-eval.ts +1057 -0
  179. package/src/util/ai-run-evidence.ts +1430 -0
  180. package/src/util/ai-runner-artifacts.ts +586 -0
  181. package/src/util/ai-runner-manager-autopilot.ts +961 -0
  182. package/src/util/ai-runner-manager-policy.ts +5011 -0
  183. package/src/util/ai-runner-qa-auth.ts +838 -0
  184. package/src/util/ai-runner-qa-tools.ts +3536 -0
  185. package/src/util/aicoder-runner-v6.ts +3121 -0
  186. package/src/util/common.ts +649 -0
  187. package/src/util/customer-portal-password.ts +183 -0
  188. package/src/util/error-reporter.ts +332 -0
  189. package/src/util/error-tracking.ts +79 -0
  190. package/src/util/openai-usage-cost.ts +114 -0
  191. package/src/util/report-builder-unwinds.ts +180 -0
  192. package/src/util/runner-process-janitor.ts +219 -0
  193. package/src/util/schema-report-builder.ts +448 -0
  194. package/src/util/slow-query-reporter.ts +216 -0
  195. package/src/util/subscription-dependency-context.ts +1096 -0
  196. package/src/util/support-runner-v5.ts +10040 -0
  197. package/src/util/tokenizer.ts +38 -0
  198. package/src/workers/codex-runner.worker.ts +142 -0
  199. package/start_server.sh +5 -0
  200. package/tests/ai-assistant-corpus-build.ts +484 -0
  201. package/tests/ai-assistant-corpus-replay-e2e.ts +774 -0
  202. package/tests/ai-assistant-data-parity-e2e.ts +1989 -0
  203. package/tests/ai-assistant-eval-triage.ts +831 -0
  204. package/tests/ai-assistant-openai-e2e.ts +1061 -0
  205. package/tests/ai-assistant-openai-git-e2e.ts +155 -0
  206. package/tests/ai-assistant-preflight-matrix.ts +215 -0
  207. package/tests/ai-assistant-routing-eval.test.ts +585 -0
  208. package/tests/ai-assistant-snf-live-eval.ts +975 -0
  209. package/tests/ai-assistant-utils.test.ts +4834 -0
  210. package/tests/ai-manager-autopilot-snapshot.test.ts +193 -0
  211. package/tests/ai-manager-recovery-checkpoint.test.ts +1383 -0
  212. package/tests/ai-run-eval.test.ts +132 -0
  213. package/tests/ai-run-evidence.test.ts +3773 -0
  214. package/tests/ai-runner-contract.test.ts +515 -0
  215. package/tests/aicoder-runner-v6.test.ts +822 -0
  216. package/tests/error-reporter.test.ts +145 -0
  217. package/tests/method-publication-generator.test.ts +46 -0
  218. package/tests/report-builder-linking.test.ts +79 -0
  219. package/tests/resolveio-platform-intelligence.test.ts +352 -0
  220. package/tests/server-app-cron-owner.test.ts +127 -0
  221. package/tests/subscription-connect-race.test.ts +158 -0
  222. package/tests/subscription-dependency-context.test.ts +324 -0
  223. package/tests/subscription-manager-collection-tracking.test.ts +86 -0
  224. package/tests/subscription-manager-invalidation.test.ts +86 -0
  225. package/tests/support-runner-v5.test.ts +3201 -0
  226. package/tsconfig.json +34 -0
  227. package/ai/assistant-core-heuristics.d.ts +0 -11
  228. package/ai/assistant-core-heuristics.js +0 -356
  229. package/ai/assistant-core-heuristics.js.map +0 -1
  230. package/ai/resolveio-platform-intelligence-memory-corpus.d.ts +0 -3
  231. package/ai/resolveio-platform-intelligence-memory-corpus.js +0 -214
  232. package/ai/resolveio-platform-intelligence-memory-corpus.js.map +0 -1
  233. package/ai/resolveio-platform-intelligence-memory.d.ts +0 -20
  234. package/ai/resolveio-platform-intelligence-memory.js +0 -341
  235. package/ai/resolveio-platform-intelligence-memory.js.map +0 -1
  236. package/ai/resolveio-platform-intelligence-types.js +0 -4
  237. package/ai/resolveio-platform-intelligence-types.js.map +0 -1
  238. package/ai/resolveio-platform-intelligence.d.ts +0 -6
  239. package/ai/resolveio-platform-intelligence.js +0 -463
  240. package/ai/resolveio-platform-intelligence.js.map +0 -1
  241. package/client-server-app.d.ts +0 -1
  242. package/client-server-app.js +0 -68
  243. package/client-server-app.js.map +0 -1
  244. package/collections/ai-run.collection.d.ts +0 -3
  245. package/collections/ai-run.collection.js +0 -170
  246. package/collections/ai-run.collection.js.map +0 -1
  247. package/collections/ai-terminal-conversation.collection.d.ts +0 -2
  248. package/collections/ai-terminal-conversation.collection.js +0 -140
  249. package/collections/ai-terminal-conversation.collection.js.map +0 -1
  250. package/collections/ai-terminal-issue-report.collection.d.ts +0 -2
  251. package/collections/ai-terminal-issue-report.collection.js +0 -148
  252. package/collections/ai-terminal-issue-report.collection.js.map +0 -1
  253. package/collections/ai-terminal-message.collection.d.ts +0 -2
  254. package/collections/ai-terminal-message.collection.js +0 -121
  255. package/collections/ai-terminal-message.collection.js.map +0 -1
  256. package/collections/app-setting.collection.d.ts +0 -3
  257. package/collections/app-setting.collection.js +0 -103
  258. package/collections/app-setting.collection.js.map +0 -1
  259. package/collections/app-status.collection.d.ts +0 -3
  260. package/collections/app-status.collection.js +0 -57
  261. package/collections/app-status.collection.js.map +0 -1
  262. package/collections/communication-metric.collection.d.ts +0 -2
  263. package/collections/communication-metric.collection.js +0 -133
  264. package/collections/communication-metric.collection.js.map +0 -1
  265. package/collections/counter.collection.d.ts +0 -3
  266. package/collections/counter.collection.js +0 -56
  267. package/collections/counter.collection.js.map +0 -1
  268. package/collections/cron-job-history.collection.d.ts +0 -3
  269. package/collections/cron-job-history.collection.js +0 -137
  270. package/collections/cron-job-history.collection.js.map +0 -1
  271. package/collections/cron-job.collection.d.ts +0 -3
  272. package/collections/cron-job.collection.js +0 -92
  273. package/collections/cron-job.collection.js.map +0 -1
  274. package/collections/customer-notification.collection.d.ts +0 -3
  275. package/collections/customer-notification.collection.js +0 -130
  276. package/collections/customer-notification.collection.js.map +0 -1
  277. package/collections/customer-portal-password.collection.d.ts +0 -3
  278. package/collections/customer-portal-password.collection.js +0 -75
  279. package/collections/customer-portal-password.collection.js.map +0 -1
  280. package/collections/email-history.collection.d.ts +0 -3
  281. package/collections/email-history.collection.js +0 -134
  282. package/collections/email-history.collection.js.map +0 -1
  283. package/collections/email-verified.collection.d.ts +0 -3
  284. package/collections/email-verified.collection.js +0 -62
  285. package/collections/email-verified.collection.js.map +0 -1
  286. package/collections/file.collection.d.ts +0 -3
  287. package/collections/file.collection.js +0 -74
  288. package/collections/file.collection.js.map +0 -1
  289. package/collections/flag-update.collection.d.ts +0 -3
  290. package/collections/flag-update.collection.js +0 -57
  291. package/collections/flag-update.collection.js.map +0 -1
  292. package/collections/flag.collection.d.ts +0 -3
  293. package/collections/flag.collection.js +0 -57
  294. package/collections/flag.collection.js.map +0 -1
  295. package/collections/log-method-latency.collection.d.ts +0 -3
  296. package/collections/log-method-latency.collection.js +0 -77
  297. package/collections/log-method-latency.collection.js.map +0 -1
  298. package/collections/log-subscription.collection.d.ts +0 -3
  299. package/collections/log-subscription.collection.js +0 -80
  300. package/collections/log-subscription.collection.js.map +0 -1
  301. package/collections/log.collection.d.ts +0 -3
  302. package/collections/log.collection.js +0 -93
  303. package/collections/log.collection.js.map +0 -1
  304. package/collections/logged-in-users.collection.d.ts +0 -3
  305. package/collections/logged-in-users.collection.js +0 -67
  306. package/collections/logged-in-users.collection.js.map +0 -1
  307. package/collections/monitor-cpu.collection.d.ts +0 -3
  308. package/collections/monitor-cpu.collection.js +0 -65
  309. package/collections/monitor-cpu.collection.js.map +0 -1
  310. package/collections/monitor-function.collection.d.ts +0 -3
  311. package/collections/monitor-function.collection.js +0 -74
  312. package/collections/monitor-function.collection.js.map +0 -1
  313. package/collections/monitor-memory.collection.d.ts +0 -3
  314. package/collections/monitor-memory.collection.js +0 -77
  315. package/collections/monitor-memory.collection.js.map +0 -1
  316. package/collections/monitor-mongo.collection.d.ts +0 -3
  317. package/collections/monitor-mongo.collection.js +0 -71
  318. package/collections/monitor-mongo.collection.js.map +0 -1
  319. package/collections/notification.collection.d.ts +0 -3
  320. package/collections/notification.collection.js +0 -57
  321. package/collections/notification.collection.js.map +0 -1
  322. package/collections/openai-usage-ledger.collection.d.ts +0 -2
  323. package/collections/openai-usage-ledger.collection.js +0 -188
  324. package/collections/openai-usage-ledger.collection.js.map +0 -1
  325. package/collections/report-builder-dashboard-builder.collection.d.ts +0 -3
  326. package/collections/report-builder-dashboard-builder.collection.js +0 -109
  327. package/collections/report-builder-dashboard-builder.collection.js.map +0 -1
  328. package/collections/report-builder-library.collection.d.ts +0 -3
  329. package/collections/report-builder-library.collection.js +0 -87
  330. package/collections/report-builder-library.collection.js.map +0 -1
  331. package/collections/report-builder-report.collection.d.ts +0 -4
  332. package/collections/report-builder-report.collection.js +0 -184
  333. package/collections/report-builder-report.collection.js.map +0 -1
  334. package/collections/user-group.collection.d.ts +0 -4
  335. package/collections/user-group.collection.js +0 -89
  336. package/collections/user-group.collection.js.map +0 -1
  337. package/collections/user-guide.collection.d.ts +0 -3
  338. package/collections/user-guide.collection.js +0 -57
  339. package/collections/user-guide.collection.js.map +0 -1
  340. package/collections/user.collection.d.ts +0 -4
  341. package/collections/user.collection.js +0 -180
  342. package/collections/user.collection.js.map +0 -1
  343. package/cron/cron.d.ts +0 -14
  344. package/cron/cron.js +0 -216
  345. package/cron/cron.js.map +0 -1
  346. package/fixtures/cron-jobs.d.ts +0 -1
  347. package/fixtures/cron-jobs.js +0 -150
  348. package/fixtures/cron-jobs.js.map +0 -1
  349. package/fixtures/init.d.ts +0 -1
  350. package/fixtures/init.js +0 -91
  351. package/fixtures/init.js.map +0 -1
  352. package/http/auth.d.ts +0 -2
  353. package/http/auth.js +0 -951
  354. package/http/auth.js.map +0 -1
  355. package/http/health.d.ts +0 -1
  356. package/http/health.js +0 -11
  357. package/http/health.js.map +0 -1
  358. package/http/home.d.ts +0 -1
  359. package/http/home.js +0 -134
  360. package/http/home.js.map +0 -1
  361. package/http/slow-query-publication.d.ts +0 -2
  362. package/http/slow-query-publication.js +0 -99
  363. package/http/slow-query-publication.js.map +0 -1
  364. package/index.d.ts +0 -1
  365. package/index.js +0 -19
  366. package/index.js.map +0 -1
  367. package/managers/ai-assistant-codex-manager.manager.d.ts +0 -67
  368. package/managers/ai-assistant-codex-manager.manager.js +0 -1113
  369. package/managers/ai-assistant-codex-manager.manager.js.map +0 -1
  370. package/managers/ai-run-evidence.manager.d.ts +0 -36
  371. package/managers/ai-run-evidence.manager.js +0 -377
  372. package/managers/ai-run-evidence.manager.js.map +0 -1
  373. package/managers/communication-metric.manager.d.ts +0 -16
  374. package/managers/communication-metric.manager.js +0 -134
  375. package/managers/communication-metric.manager.js.map +0 -1
  376. package/managers/cron.manager.d.ts +0 -20
  377. package/managers/cron.manager.js +0 -534
  378. package/managers/cron.manager.js.map +0 -1
  379. package/managers/customer-notification-content.manager.d.ts +0 -55
  380. package/managers/customer-notification-content.manager.js +0 -158
  381. package/managers/customer-notification-content.manager.js.map +0 -1
  382. package/managers/diagnostic-manager-bootstrap.d.ts +0 -9
  383. package/managers/diagnostic-manager-bootstrap.js +0 -260
  384. package/managers/diagnostic-manager-bootstrap.js.map +0 -1
  385. package/managers/error-auto-fix.manager.d.ts +0 -149
  386. package/managers/error-auto-fix.manager.js +0 -3064
  387. package/managers/error-auto-fix.manager.js.map +0 -1
  388. package/managers/local-log.manager.d.ts +0 -18
  389. package/managers/local-log.manager.js +0 -88
  390. package/managers/local-log.manager.js.map +0 -1
  391. package/managers/method.manager.d.ts +0 -84
  392. package/managers/method.manager.js +0 -1964
  393. package/managers/method.manager.js.map +0 -1
  394. package/managers/mongo.manager.d.ts +0 -224
  395. package/managers/mongo.manager.js +0 -5000
  396. package/managers/mongo.manager.js.map +0 -1
  397. package/managers/monitor.manager.d.ts +0 -70
  398. package/managers/monitor.manager.js +0 -550
  399. package/managers/monitor.manager.js.map +0 -1
  400. package/managers/openai-usage-ledger.manager.d.ts +0 -30
  401. package/managers/openai-usage-ledger.manager.js +0 -142
  402. package/managers/openai-usage-ledger.manager.js.map +0 -1
  403. package/managers/slow-query-verifier.manager.d.ts +0 -144
  404. package/managers/slow-query-verifier.manager.js +0 -3857
  405. package/managers/slow-query-verifier.manager.js.map +0 -1
  406. package/managers/slow-query.manager.d.ts +0 -28
  407. package/managers/slow-query.manager.js +0 -468
  408. package/managers/slow-query.manager.js.map +0 -1
  409. package/managers/subscription.manager.d.ts +0 -169
  410. package/managers/subscription.manager.js +0 -3434
  411. package/managers/subscription.manager.js.map +0 -1
  412. package/managers/websocket.manager.d.ts +0 -73
  413. package/managers/websocket.manager.js +0 -673
  414. package/managers/websocket.manager.js.map +0 -1
  415. package/managers/worker-dispatcher.manager.d.ts +0 -120
  416. package/managers/worker-dispatcher.manager.js +0 -1266
  417. package/managers/worker-dispatcher.manager.js.map +0 -1
  418. package/managers/worker-server.manager.d.ts +0 -35
  419. package/managers/worker-server.manager.js +0 -582
  420. package/managers/worker-server.manager.js.map +0 -1
  421. package/methods/accounts.d.ts +0 -2
  422. package/methods/accounts.js +0 -624
  423. package/methods/accounts.js.map +0 -1
  424. package/methods/ai-terminal.d.ts +0 -458
  425. package/methods/ai-terminal.js +0 -27991
  426. package/methods/ai-terminal.js.map +0 -1
  427. package/methods/app-settings.d.ts +0 -2
  428. package/methods/app-settings.js +0 -169
  429. package/methods/app-settings.js.map +0 -1
  430. package/methods/aws.d.ts +0 -2
  431. package/methods/aws.js +0 -877
  432. package/methods/aws.js.map +0 -1
  433. package/methods/collections.d.ts +0 -2
  434. package/methods/collections.js +0 -719
  435. package/methods/collections.js.map +0 -1
  436. package/methods/counters.d.ts +0 -2
  437. package/methods/counters.js +0 -113
  438. package/methods/counters.js.map +0 -1
  439. package/methods/cron-jobs.d.ts +0 -2
  440. package/methods/cron-jobs.js +0 -2475
  441. package/methods/cron-jobs.js.map +0 -1
  442. package/methods/customer-notifications.d.ts +0 -2
  443. package/methods/customer-notifications.js +0 -528
  444. package/methods/customer-notifications.js.map +0 -1
  445. package/methods/diagnostics.d.ts +0 -2
  446. package/methods/diagnostics.js +0 -703
  447. package/methods/diagnostics.js.map +0 -1
  448. package/methods/flag-updates.d.ts +0 -2
  449. package/methods/flag-updates.js +0 -8
  450. package/methods/flag-updates.js.map +0 -1
  451. package/methods/flags.d.ts +0 -2
  452. package/methods/flags.js +0 -8
  453. package/methods/flags.js.map +0 -1
  454. package/methods/logs.d.ts +0 -2
  455. package/methods/logs.js +0 -751
  456. package/methods/logs.js.map +0 -1
  457. package/methods/mongo-explorer.d.ts +0 -2
  458. package/methods/mongo-explorer.js +0 -1808
  459. package/methods/mongo-explorer.js.map +0 -1
  460. package/methods/monitor.d.ts +0 -2
  461. package/methods/monitor.js +0 -543
  462. package/methods/monitor.js.map +0 -1
  463. package/methods/pdf.d.ts +0 -2
  464. package/methods/pdf.js +0 -1216
  465. package/methods/pdf.js.map +0 -1
  466. package/methods/publications.d.ts +0 -1
  467. package/methods/publications.js +0 -183
  468. package/methods/publications.js.map +0 -1
  469. package/methods/report-builder.d.ts +0 -2
  470. package/methods/report-builder.js +0 -3094
  471. package/methods/report-builder.js.map +0 -1
  472. package/methods/support.d.ts +0 -2
  473. package/methods/support.js +0 -430
  474. package/methods/support.js.map +0 -1
  475. package/models/ai-run.model.d.ts +0 -19
  476. package/models/ai-run.model.js +0 -4
  477. package/models/ai-run.model.js.map +0 -1
  478. package/models/ai-terminal-conversation.model.d.ts +0 -17
  479. package/models/ai-terminal-conversation.model.js +0 -4
  480. package/models/ai-terminal-conversation.model.js.map +0 -1
  481. package/models/ai-terminal-issue-report.model.d.ts +0 -19
  482. package/models/ai-terminal-issue-report.model.js +0 -4
  483. package/models/ai-terminal-issue-report.model.js.map +0 -1
  484. package/models/ai-terminal-message.model.d.ts +0 -22
  485. package/models/ai-terminal-message.model.js +0 -4
  486. package/models/ai-terminal-message.model.js.map +0 -1
  487. package/models/app-setting.model.d.ts +0 -16
  488. package/models/app-setting.model.js +0 -4
  489. package/models/app-setting.model.js.map +0 -1
  490. package/models/app-status.model.js +0 -4
  491. package/models/app-status.model.js.map +0 -1
  492. package/models/billing-logged-in-users.model.js +0 -4
  493. package/models/billing-logged-in-users.model.js.map +0 -1
  494. package/models/collection-document.model.d.ts +0 -21
  495. package/models/collection-document.model.js +0 -4
  496. package/models/collection-document.model.js.map +0 -1
  497. package/models/communication-metric.model.d.ts +0 -20
  498. package/models/communication-metric.model.js +0 -4
  499. package/models/communication-metric.model.js.map +0 -1
  500. package/models/counter.model.js +0 -4
  501. package/models/counter.model.js.map +0 -1
  502. package/models/cron-job-history.model.d.ts +0 -15
  503. package/models/cron-job-history.model.js +0 -4
  504. package/models/cron-job-history.model.js.map +0 -1
  505. package/models/cron-job.model.d.ts +0 -14
  506. package/models/cron-job.model.js +0 -4
  507. package/models/cron-job.model.js.map +0 -1
  508. package/models/customer-notification.model.d.ts +0 -26
  509. package/models/customer-notification.model.js +0 -4
  510. package/models/customer-notification.model.js.map +0 -1
  511. package/models/customer-portal-password.model.d.ts +0 -11
  512. package/models/customer-portal-password.model.js +0 -4
  513. package/models/customer-portal-password.model.js.map +0 -1
  514. package/models/dialog.model.d.ts +0 -23
  515. package/models/dialog.model.js +0 -4
  516. package/models/dialog.model.js.map +0 -1
  517. package/models/email-history.model.d.ts +0 -32
  518. package/models/email-history.model.js.map +0 -1
  519. package/models/email-verified.model.js +0 -4
  520. package/models/email-verified.model.js.map +0 -1
  521. package/models/file.model.js +0 -4
  522. package/models/file.model.js.map +0 -1
  523. package/models/flag-update.model.js +0 -4
  524. package/models/flag-update.model.js.map +0 -1
  525. package/models/flag.model.js +0 -4
  526. package/models/flag.model.js.map +0 -1
  527. package/models/log-method-latency.model.d.ts +0 -10
  528. package/models/log-method-latency.model.js +0 -4
  529. package/models/log-method-latency.model.js.map +0 -1
  530. package/models/log-subscription.model.js +0 -4
  531. package/models/log-subscription.model.js.map +0 -1
  532. package/models/log.model.d.ts +0 -17
  533. package/models/log.model.js +0 -4
  534. package/models/log.model.js.map +0 -1
  535. package/models/logged-in-users.model.js +0 -4
  536. package/models/logged-in-users.model.js.map +0 -1
  537. package/models/method-response.model.js +0 -4
  538. package/models/method-response.model.js.map +0 -1
  539. package/models/method.model.d.ts +0 -26
  540. package/models/method.model.js +0 -4
  541. package/models/method.model.js.map +0 -1
  542. package/models/monitor-cpu.model.js +0 -4
  543. package/models/monitor-cpu.model.js.map +0 -1
  544. package/models/monitor-function.model.d.ts +0 -14
  545. package/models/monitor-function.model.js +0 -4
  546. package/models/monitor-function.model.js.map +0 -1
  547. package/models/monitor-memory.model.d.ts +0 -15
  548. package/models/monitor-memory.model.js +0 -4
  549. package/models/monitor-memory.model.js.map +0 -1
  550. package/models/monitor-mongo.model.d.ts +0 -13
  551. package/models/monitor-mongo.model.js +0 -4
  552. package/models/monitor-mongo.model.js.map +0 -1
  553. package/models/notification.model.js +0 -4
  554. package/models/notification.model.js.map +0 -1
  555. package/models/openai-usage-ledger.model.d.ts +0 -30
  556. package/models/openai-usage-ledger.model.js +0 -4
  557. package/models/openai-usage-ledger.model.js.map +0 -1
  558. package/models/pagination.model.d.ts +0 -11
  559. package/models/pagination.model.js +0 -28
  560. package/models/pagination.model.js.map +0 -1
  561. package/models/permission.model.d.ts +0 -12
  562. package/models/permission.model.js +0 -4
  563. package/models/permission.model.js.map +0 -1
  564. package/models/report-builder-dashboard-builder.model.d.ts +0 -25
  565. package/models/report-builder-dashboard-builder.model.js +0 -4
  566. package/models/report-builder-dashboard-builder.model.js.map +0 -1
  567. package/models/report-builder-library.model.d.ts +0 -17
  568. package/models/report-builder-library.model.js +0 -4
  569. package/models/report-builder-library.model.js.map +0 -1
  570. package/models/report-builder-report.model.d.ts +0 -121
  571. package/models/report-builder-report.model.js +0 -4
  572. package/models/report-builder-report.model.js.map +0 -1
  573. package/models/report-builder.model.d.ts +0 -61
  574. package/models/report-builder.model.js +0 -4
  575. package/models/report-builder.model.js.map +0 -1
  576. package/models/select-data-label.model.d.ts +0 -9
  577. package/models/select-data-label.model.js +0 -4
  578. package/models/select-data-label.model.js.map +0 -1
  579. package/models/server-message.model.d.ts +0 -32
  580. package/models/server-message.model.js +0 -4
  581. package/models/server-message.model.js.map +0 -1
  582. package/models/slow-query-report.model.d.ts +0 -23
  583. package/models/slow-query-report.model.js +0 -4
  584. package/models/slow-query-report.model.js.map +0 -1
  585. package/models/subscription.model.d.ts +0 -31
  586. package/models/subscription.model.js +0 -4
  587. package/models/subscription.model.js.map +0 -1
  588. package/models/support-ticket.model.d.ts +0 -87
  589. package/models/support-ticket.model.js +0 -4
  590. package/models/support-ticket.model.js.map +0 -1
  591. package/models/user-group.model.d.ts +0 -20
  592. package/models/user-group.model.js +0 -4
  593. package/models/user-group.model.js.map +0 -1
  594. package/models/user-guide.model.js +0 -4
  595. package/models/user-guide.model.js.map +0 -1
  596. package/models/user.model.d.ts +0 -84
  597. package/models/user.model.js +0 -4
  598. package/models/user.model.js.map +0 -1
  599. package/private/images/ResolveIO.png +0 -0
  600. package/public_api.js +0 -127
  601. package/public_api.js.map +0 -1
  602. package/publications/ai-terminal.d.ts +0 -1
  603. package/publications/ai-terminal.js +0 -122
  604. package/publications/ai-terminal.js.map +0 -1
  605. package/publications/app-settings.d.ts +0 -2
  606. package/publications/app-settings.js +0 -28
  607. package/publications/app-settings.js.map +0 -1
  608. package/publications/app-status.d.ts +0 -2
  609. package/publications/app-status.js +0 -16
  610. package/publications/app-status.js.map +0 -1
  611. package/publications/cron-jobs.d.ts +0 -2
  612. package/publications/cron-jobs.js +0 -88
  613. package/publications/cron-jobs.js.map +0 -1
  614. package/publications/customer-notifications.d.ts +0 -2
  615. package/publications/customer-notifications.js +0 -161
  616. package/publications/customer-notifications.js.map +0 -1
  617. package/publications/files.d.ts +0 -2
  618. package/publications/files.js +0 -36
  619. package/publications/files.js.map +0 -1
  620. package/publications/flags-update.d.ts +0 -2
  621. package/publications/flags-update.js +0 -22
  622. package/publications/flags-update.js.map +0 -1
  623. package/publications/flags.d.ts +0 -2
  624. package/publications/flags.js +0 -22
  625. package/publications/flags.js.map +0 -1
  626. package/publications/logs.d.ts +0 -2
  627. package/publications/logs.js +0 -164
  628. package/publications/logs.js.map +0 -1
  629. package/publications/notifications.d.ts +0 -2
  630. package/publications/notifications.js +0 -16
  631. package/publications/notifications.js.map +0 -1
  632. package/publications/report-builder-dashboard-builders.d.ts +0 -2
  633. package/publications/report-builder-dashboard-builders.js +0 -42
  634. package/publications/report-builder-dashboard-builders.js.map +0 -1
  635. package/publications/report-builder-libraries.d.ts +0 -2
  636. package/publications/report-builder-libraries.js +0 -90
  637. package/publications/report-builder-libraries.js.map +0 -1
  638. package/publications/report-builder-reports.d.ts +0 -2
  639. package/publications/report-builder-reports.js +0 -50
  640. package/publications/report-builder-reports.js.map +0 -1
  641. package/publications/super-admin.d.ts +0 -2
  642. package/publications/super-admin.js +0 -16
  643. package/publications/super-admin.js.map +0 -1
  644. package/publications/user-groups.d.ts +0 -1
  645. package/publications/user-groups.js +0 -16
  646. package/publications/user-groups.js.map +0 -1
  647. package/publications/user-guides.d.ts +0 -1
  648. package/publications/user-guides.js +0 -16
  649. package/publications/user-guides.js.map +0 -1
  650. package/resolveio-server-app.d.ts +0 -70
  651. package/resolveio-server-app.js +0 -801
  652. package/resolveio-server-app.js.map +0 -1
  653. package/server-app.d.ts +0 -228
  654. package/server-app.js +0 -3566
  655. package/server-app.js.map +0 -1
  656. package/services/codex-client.d.ts +0 -128
  657. package/services/codex-client.js +0 -1629
  658. package/services/codex-client.js.map +0 -1
  659. package/services/openai-client.d.ts +0 -46
  660. package/services/openai-client.js +0 -318
  661. package/services/openai-client.js.map +0 -1
  662. package/types/error-report.d.ts +0 -25
  663. package/types/error-report.js +0 -4
  664. package/types/error-report.js.map +0 -1
  665. package/types/slow-query-report.d.ts +0 -27
  666. package/types/slow-query-report.js +0 -6
  667. package/types/slow-query-report.js.map +0 -1
  668. package/util/ai-qa-policy.d.ts +0 -124
  669. package/util/ai-qa-policy.js +0 -736
  670. package/util/ai-qa-policy.js.map +0 -1
  671. package/util/ai-run-evidence-adapters.d.ts +0 -109
  672. package/util/ai-run-evidence-adapters.js +0 -7234
  673. package/util/ai-run-evidence-adapters.js.map +0 -1
  674. package/util/ai-run-evidence-dashboard.d.ts +0 -88
  675. package/util/ai-run-evidence-dashboard.js +0 -343
  676. package/util/ai-run-evidence-dashboard.js.map +0 -1
  677. package/util/ai-run-evidence-eval.d.ts +0 -86
  678. package/util/ai-run-evidence-eval.js +0 -1018
  679. package/util/ai-run-evidence-eval.js.map +0 -1
  680. package/util/ai-run-evidence.d.ts +0 -244
  681. package/util/ai-run-evidence.js +0 -1096
  682. package/util/ai-run-evidence.js.map +0 -1
  683. package/util/ai-runner-artifacts.d.ts +0 -82
  684. package/util/ai-runner-artifacts.js +0 -713
  685. package/util/ai-runner-artifacts.js.map +0 -1
  686. package/util/ai-runner-manager-autopilot.d.ts +0 -210
  687. package/util/ai-runner-manager-autopilot.js +0 -642
  688. package/util/ai-runner-manager-autopilot.js.map +0 -1
  689. package/util/ai-runner-manager-policy.d.ts +0 -807
  690. package/util/ai-runner-manager-policy.js +0 -3501
  691. package/util/ai-runner-manager-policy.js.map +0 -1
  692. package/util/ai-runner-qa-auth.d.ts +0 -5
  693. package/util/ai-runner-qa-auth.js +0 -839
  694. package/util/ai-runner-qa-auth.js.map +0 -1
  695. package/util/ai-runner-qa-tools.d.ts +0 -26
  696. package/util/ai-runner-qa-tools.js +0 -3520
  697. package/util/ai-runner-qa-tools.js.map +0 -1
  698. package/util/aicoder-runner-v6.d.ts +0 -426
  699. package/util/aicoder-runner-v6.js +0 -2464
  700. package/util/aicoder-runner-v6.js.map +0 -1
  701. package/util/common.d.ts +0 -31
  702. package/util/common.js +0 -683
  703. package/util/common.js.map +0 -1
  704. package/util/customer-portal-password.d.ts +0 -13
  705. package/util/customer-portal-password.js +0 -209
  706. package/util/customer-portal-password.js.map +0 -1
  707. package/util/error-reporter.d.ts +0 -52
  708. package/util/error-reporter.js +0 -326
  709. package/util/error-reporter.js.map +0 -1
  710. package/util/error-tracking.d.ts +0 -13
  711. package/util/error-tracking.js +0 -120
  712. package/util/error-tracking.js.map +0 -1
  713. package/util/openai-usage-cost.d.ts +0 -6
  714. package/util/openai-usage-cost.js +0 -103
  715. package/util/openai-usage-cost.js.map +0 -1
  716. package/util/report-builder-unwinds.d.ts +0 -15
  717. package/util/report-builder-unwinds.js +0 -156
  718. package/util/report-builder-unwinds.js.map +0 -1
  719. package/util/runner-process-janitor.d.ts +0 -27
  720. package/util/runner-process-janitor.js +0 -208
  721. package/util/runner-process-janitor.js.map +0 -1
  722. package/util/schema-report-builder.d.ts +0 -6
  723. package/util/schema-report-builder.js +0 -481
  724. package/util/schema-report-builder.js.map +0 -1
  725. package/util/slow-query-reporter.d.ts +0 -28
  726. package/util/slow-query-reporter.js +0 -226
  727. package/util/slow-query-reporter.js.map +0 -1
  728. package/util/subscription-dependency-context.d.ts +0 -34
  729. package/util/subscription-dependency-context.js +0 -1283
  730. package/util/subscription-dependency-context.js.map +0 -1
  731. package/util/support-runner-v5.d.ts +0 -1426
  732. package/util/support-runner-v5.js +0 -7631
  733. package/util/support-runner-v5.js.map +0 -1
  734. package/util/tokenizer.d.ts +0 -5
  735. package/util/tokenizer.js +0 -41
  736. package/util/tokenizer.js.map +0 -1
  737. package/workers/codex-runner.worker.d.ts +0 -1
  738. package/workers/codex-runner.worker.js +0 -192
  739. package/workers/codex-runner.worker.js.map +0 -1
  740. /package/{private → src/private}/email-templates/enrollment.html +0 -0
  741. /package/{private → src/private}/email-templates/forgot-password.html +0 -0
  742. /package/{private → src/private}/email-templates/support-ticket-deleted.html +0 -0
  743. /package/{private → src/private}/email-templates/support-ticket-modified.html +0 -0
  744. /package/{private → src/private}/email-templates/support-ticket.html +0 -0
  745. /package/{public_api.d.ts → src/public_api.ts} +0 -0
@@ -0,0 +1,515 @@
1
+ import * as assert from 'node:assert/strict';
2
+ import * as fs from 'fs';
3
+ import * as os from 'os';
4
+ import * as path from 'path';
5
+ import {
6
+ collectResolveIORunnerEvidenceArtifactFilesFromRoots,
7
+ collectResolveIORunnerEvidenceArtifactPaths,
8
+ persistResolveIORunnerEvidenceArtifacts
9
+ } from '../src/util/ai-runner-artifacts';
10
+ import {
11
+ buildResolveIORunnerQaAuthBootstrapScript
12
+ } from '../src/util/ai-runner-qa-auth';
13
+ import {
14
+ buildResolveIORunnerBugfixComparisonQaScript,
15
+ buildResolveIORunnerQaEnvScript,
16
+ buildResolveIORunnerQaLiveDataSeederScript,
17
+ buildResolveIORunnerQaPreflightScript,
18
+ buildResolveIORunnerQaToolsReadme,
19
+ buildResolveIORunnerLocalQaScript,
20
+ buildResolveIORunnerLocalQaStopperScript,
21
+ buildResolveIORunnerQaWorkflowProbeScript
22
+ } from '../src/util/ai-runner-qa-tools';
23
+ import {
24
+ RunnerProcessJanitor
25
+ } from '../src/util/runner-process-janitor';
26
+ import {
27
+ buildResolveIORunnerContract,
28
+ buildResolveIORunnerPromptBundle,
29
+ buildResolveIOQaPolicyRules,
30
+ buildResolveIORunnerQaCoverageChecklist,
31
+ buildResolveIORunnerRepairPlans,
32
+ classifyResolveIORunnerBlocker,
33
+ decideResolveIORunnerRepairContinuation,
34
+ findRepeatedResolveIORunnerBlockers,
35
+ normalizeResolveIORunnerBlocker
36
+ } from '../src/util/ai-qa-policy';
37
+
38
+ const contract = buildResolveIORunnerContract({
39
+ context: 'support_ticket',
40
+ includeDevServerRules: true,
41
+ maxContextBullets: 6
42
+ });
43
+
44
+ assert.equal(contract.context, 'support_ticket');
45
+ assert.ok(contract.sections.tokenDiscipline.some((line) => /at most 6 bullets/i.test(line)));
46
+ assert.ok(contract.sections.dependencyBootstrap.some((line) => /npm install --force/i.test(line)));
47
+ assert.ok(contract.sections.qaPolicy.some((line) => /screenshot or trace/i.test(line)));
48
+ assert.ok(contract.sections.qaPolicy.some((line) => /qa-auth-bootstrap\.js/i.test(line)));
49
+ assert.ok(contract.sections.qaPolicy.some((line) => /\.resolveio-ai-runner-tools/i.test(line)));
50
+ assert.ok(contract.sections.qaPolicy.some((line) => /networkidle0.*networkidle2/i.test(line)));
51
+ assert.ok(contract.sections.qaPolicy.some((line) => /QA Coverage Matrix/i.test(line)));
52
+ assert.ok(contract.sections.qaPolicy.some((line) => /invoices, billing, taxes, inventory/i.test(line)));
53
+ assert.ok(contract.sections.qaPolicy.some((line) => /Do not scan broad roots/i.test(line)));
54
+ assert.ok(contract.sections.qaPolicy.some((line) => /route_hint_matched/i.test(line)));
55
+ assert.ok(contract.sections.qaPolicy.some((line) => /Leaving in_progress rows without workflow artifacts/i.test(line)));
56
+ assert.ok(contract.rules.some((line) => /same normalized blocker repeats/i.test(line)));
57
+
58
+ const authBootstrapScript = buildResolveIORunnerQaAuthBootstrapScript({
59
+ defaultUsername: 'admin',
60
+ defaultPassword: 'local-secret'
61
+ });
62
+
63
+ assert.ok(authBootstrapScript.includes('POST') || authBootstrapScript.includes('method: "POST"'));
64
+ assert.ok(authBootstrapScript.includes('/login'));
65
+ assert.ok(authBootstrapScript.includes('/accessToken'));
66
+ assert.ok(authBootstrapScript.includes('RESOLVEIO_RUNNER_QA_CLIENT_URL'));
67
+ assert.ok(authBootstrapScript.includes('RESOLVEIO_SUPPORT_QA_CLIENT_URL'));
68
+ assert.ok(authBootstrapScript.includes('normalizeTargetRouteInput(routeArg)'));
69
+ assert.ok(authBootstrapScript.includes('extractRoutePathFromText'));
70
+ assert.ok(authBootstrapScript.includes('split(/\\s*->\\s*/'));
71
+ assert.ok(authBootstrapScript.includes('logoutExistingBrowserSession(page)'));
72
+ assert.ok(authBootstrapScript.includes('navigator.serviceWorker.getRegistrations'));
73
+ assert.ok(authBootstrapScript.includes('window.caches.keys'));
74
+ assert.ok(authBootstrapScript.includes('window.indexedDB.databases'));
75
+ assert.ok(authBootstrapScript.includes('await resetBrowserState(page);\n\t\tconst auth = await login();'));
76
+ assert.ok(authBootstrapScript.includes('localStorage.setItem("refreshToken"'));
77
+ assert.ok(authBootstrapScript.includes('localStorage.setItem("accessToken"'));
78
+ assert.ok(authBootstrapScript.includes('localStorage.setItem("user"'));
79
+ assert.ok(authBootstrapScript.includes('auth-bootstrap-result.json'));
80
+ assert.ok(authBootstrapScript.includes('auth-bootstrap-ready.jpg'));
81
+ assert.ok(authBootstrapScript.indexOf('await waitForHttpReady(clientUrl, "QA client");') < authBootstrapScript.indexOf('const puppeteer = requirePuppeteer();'));
82
+ assert.ok(authBootstrapScript.includes('type: "jpeg", quality: 82, fullPage: false'));
83
+ assert.ok(authBootstrapScript.includes('await ensureLocalQaUser();'));
84
+ assert.ok(authBootstrapScript.includes('dismissNavigationOverlays(page)'));
85
+ assert.ok(authBootstrapScript.includes('page.mouse.move'));
86
+ assert.ok(authBootstrapScript.includes('opening_route: targetRoute'));
87
+ assert.ok(authBootstrapScript.includes('core_tour_completed: true'));
88
+ assert.ok(authBootstrapScript.includes('normalizeQaUserForBrowser'));
89
+ assert.ok(authBootstrapScript.includes('repairPostLoginSetupOrTourGate'));
90
+ assert.ok(authBootstrapScript.includes('/user-settings/settings'));
91
+ assert.ok(authBootstrapScript.includes('Top Navigation Step'));
92
+ assert.ok(authBootstrapScript.includes('resolveio.runnerQaPostLoginGateRepairedAt'));
93
+ assert.ok(authBootstrapScript.includes('updateMany(qaUserFilter'));
94
+ assert.ok(authBootstrapScript.includes('{ email: "dev@resolveio.com" }'));
95
+ assert.ok(authBootstrapScript.includes('refreshAuthAndSeed(page)'));
96
+ assert.ok(authBootstrapScript.indexOf('await ensureLocalQaUser().catch(() => false);') < authBootstrapScript.indexOf('await refreshAuthAndSeed(page).catch(() => undefined);'));
97
+ assert.ok(authBootstrapScript.indexOf('if (isLocalhostUrl(serverUrl))') < authBootstrapScript.indexOf('return process.env.MONGO_URL || localQaMongoUrl;'));
98
+
99
+ const localQaScript = buildResolveIORunnerLocalQaScript();
100
+ const localQaStopperScript = buildResolveIORunnerLocalQaStopperScript();
101
+ const bugfixComparisonScript = buildResolveIORunnerBugfixComparisonQaScript();
102
+ const liveDataSeederScript = buildResolveIORunnerQaLiveDataSeederScript();
103
+ const qaPreflightScript = buildResolveIORunnerQaPreflightScript();
104
+ const workflowProbeScript = buildResolveIORunnerQaWorkflowProbeScript();
105
+ const qaToolsReadme = buildResolveIORunnerQaToolsReadme({ mode: 'support' });
106
+ const qaEnvScript = buildResolveIORunnerQaEnvScript({
107
+ mode: 'support',
108
+ mongoRuntimePath: '/workspace/mongo-context/.mongo-runtime.json',
109
+ qaLiveDataRequired: true
110
+ });
111
+
112
+ assert.ok(qaEnvScript.includes('export IS_WORKERS_ENABLED=false'));
113
+ assert.ok(qaEnvScript.includes('export IS_WORKER_INSTANCE=false'));
114
+ assert.ok(qaEnvScript.includes('export SUPPORT_CODEX_MANAGER_PROCESS_ONLY=false'));
115
+ assert.ok(qaEnvScript.includes('export SUPPORT_AUTO_MANAGER_PROCESS_ONLY=false'));
116
+ assert.ok(qaEnvScript.includes('export AI_ASSISTANT_CODEX_MANAGER_PROCESS_ONLY=false'));
117
+ assert.ok(qaEnvScript.includes('export PLAYWRIGHT_BROWSERS_PATH='));
118
+ assert.ok(qaEnvScript.includes('export RESOLVEIO_SUPPORT_QA_MONGO_URL='));
119
+ assert.ok(qaEnvScript.includes('mongodb://127.0.0.1:${RESOLVEIO_SUPPORT_QA_MONGO_PORT}/resolveio?directConnection=true'));
120
+ assert.ok(qaEnvScript.includes('export RESOLVEIO_QA_INHERITED_MONGO_URL="${RESOLVEIO_QA_INHERITED_MONGO_URL:-${MONGO_URL:-}}"'));
121
+ assert.ok(qaEnvScript.includes('export MONGO_URL="${RESOLVEIO_SUPPORT_QA_MONGO_URL}"'));
122
+ assert.ok(qaEnvScript.includes('RESOLVEIO_SUPPORT_QA_MONGO_RUNTIME_PATH'));
123
+ assert.ok(qaEnvScript.includes('/workspace/mongo-context/.mongo-runtime.json'));
124
+ assert.ok(qaEnvScript.includes('RESOLVEIO_QA_MONGO_RUNTIME_PATH'));
125
+ assert.ok(qaEnvScript.includes('RESOLVEIO_QA_COMMAND_GUARD_BIN'));
126
+ assert.ok(qaEnvScript.includes('angular-build.lock'));
127
+ assert.ok(qaEnvScript.includes('refusing duplicate npm run'));
128
+ assert.ok(qaEnvScript.includes('while local QA harness is active'));
129
+ assert.ok(qaEnvScript.includes('RUNNER_RUN_ID'));
130
+ assert.ok(qaEnvScript.includes('RUNNER_GENERATION'));
131
+ assert.ok(qaEnvScript.includes('RESOLVEIO_SUPPORT_QA_LIVE_DATA_REQUIRED'));
132
+ assert.ok(qaEnvScript.includes('RESOLVEIO_QA_LIVE_DATA_REQUIRED'));
133
+ assert.ok(qaEnvScript.includes('chrome-headless-shell/linux-*/chrome-headless-shell-linux64/chrome-headless-shell'));
134
+ assert.ok(workflowProbeScript.includes('let routeText = value;'));
135
+ assert.ok(workflowProbeScript.includes('routeText.match'));
136
+ assert.ok(workflowProbeScript.includes('split(/\\s*->\\s*/'));
137
+ assert.ok(qaEnvScript.includes('chrome/linux-*/chrome-linux64/chrome'));
138
+ assert.ok(qaEnvScript.includes('/usr/bin/google-chrome-stable'));
139
+ assert.ok(qaPreflightScript.includes('qa-preflight-result.json'));
140
+ assert.ok(qaPreflightScript.includes('puppeteer_require'));
141
+ assert.ok(qaPreflightScript.includes('chrome_executable'));
142
+ assert.ok(qaPreflightScript.includes('chrome_launch'));
143
+ assert.ok(qaPreflightScript.includes('infra_failed'));
144
+ assert.ok(qaToolsReadme.includes('qa-preflight.js'));
145
+ assert.ok(qaToolsReadme.includes('infra_passed'));
146
+ assert.ok(workflowProbeScript.includes('route_probe_pass'));
147
+ assert.ok(workflowProbeScript.includes('route_only_pass'));
148
+ assert.ok(workflowProbeScript.includes('acceptance_blocked'));
149
+ assert.equal(workflowProbeScript.includes('updateMatrix("pass", passScreenshotPath, caption, "Authenticated customer workflow route loaded; deeper row-specific UI/data proof still required.");'), false);
150
+ assert.ok(workflowProbeScript.includes('function runPricingImportProof(page, routeSummary)'));
151
+ assert.ok(workflowProbeScript.includes('qa-pricing-import-proof.json'));
152
+ assert.ok(workflowProbeScript.includes('aiqa-business-assertion.json'));
153
+ assert.ok(workflowProbeScript.includes('support-business-proof-before-after.png'));
154
+ assert.ok(workflowProbeScript.includes('Pricing import proof refuses to write to non-local Mongo URL'));
155
+ assert.ok(workflowProbeScript.includes('let specializedProof = await runPricingImportProof(page, summary);'));
156
+ assert.ok(workflowProbeScript.includes('insertPricesFromImportPayloadSize'));
157
+ assert.ok(workflowProbeScript.includes('business_assertion_passed'));
158
+ assert.ok(qaToolsReadme.includes('page.$x'));
159
+ assert.ok(qaToolsReadme.includes('page.waitForTimeout'));
160
+ assert.ok(contract.rules.join('\n').includes('page.$x'));
161
+ assert.ok(contract.rules.join('\n').includes('page.waitForTimeout'));
162
+ assert.ok(localQaScript.includes('kill_port_listeners "$port"'));
163
+ assert.ok(localQaStopperScript.includes('kill_port_listeners "$port"'));
164
+ assert.ok(localQaScript.includes('janitor_bounded 3 lsof'));
165
+ assert.ok(localQaStopperScript.includes('janitor_bounded 3 lsof'));
166
+ assert.ok(localQaStopperScript.includes('.qa.stop.lock'));
167
+ assert.ok(localQaStopperScript.includes('refusing duplicate stopper'));
168
+ assert.ok(localQaScript.includes('runner-process-manifest.json'));
169
+ assert.ok(localQaScript.includes('janitor_write_manifest'));
170
+ assert.ok(localQaScript.includes('janitor_start_heartbeat'));
171
+ assert.ok(localQaScript.includes('janitor_update_lock_heartbeat'));
172
+ assert.ok(localQaScript.includes('janitor_lock_is_live'));
173
+ assert.ok(localQaScript.includes('runner_run_id'));
174
+ assert.ok(localQaScript.includes('runner_generation'));
175
+ assert.equal(localQaScript.includes('export RESOLVEIO_QA_PROJECT_ROOT="$PROJECT_ROOT"'), false);
176
+ assert.equal(localQaStopperScript.includes('export RESOLVEIO_QA_PROJECT_ROOT="$PROJECT_ROOT"'), false);
177
+ assert.ok(localQaScript.includes('refusing duplicate startup'));
178
+ assert.ok(localQaScript.includes('janitor_check_resources || exit $?'));
179
+ assert.ok(localQaScript.includes('pre-start live data seed/cleanup starting before app server startup'));
180
+ assert.ok(localQaScript.includes('start_local_mongo_for_prestart_seed'));
181
+ assert.ok(localQaScript.includes('mongo_tcp_ready'));
182
+ assert.ok(localQaScript.includes('timeout 8s mongosh'));
183
+ assert.ok(localQaScript.includes('materialize_live_mongo_runtime'));
184
+ assert.ok(localQaScript.includes('node - "$runtime_file" "$PROJECT_ROOT" "$REPO_ROOT"'));
185
+ assert.ok(localQaScript.includes('RESOLVEIO_QA_PRESTART_MONGO_READY=1'));
186
+ assert.ok(localQaScript.includes('using pre-seeded local Mongo; starting server without mongo-start'));
187
+ assert.ok(localQaScript.includes('Running HTTP/WS server on port'));
188
+ assert.ok(localQaScript.includes('prepare_tmp_server_settings()'));
189
+ assert.ok(localQaScript.includes('preseeded_tmp_server_ready()'));
190
+ assert.ok(localQaScript.includes('run_preseeded_tmp_server'));
191
+ assert.ok(localQaScript.includes('using existing compiled server/tmp/index.js'));
192
+ assert.ok(localQaScript.includes('compiling server tmp output for pre-seeded local Mongo'));
193
+ assert.ok(localQaScript.includes('node_modules/gulp/bin/gulp.js compile dotenv methodAndPublicationListGenerator'));
194
+ assert.ok(localQaScript.includes('RESOLVEIO_QA_MONGO_RUNTIME_PATH="$runtime_file"'));
195
+ assert.ok(localQaScript.includes('"/var/app/current"'));
196
+ assert.ok(localQaScript.includes('path.join(projectRootArg, "server")'));
197
+ assert.ok(localQaScript.includes('parseEnv(path.join(root, ".env.codex"))'));
198
+ assert.ok(localQaScript.includes('const fallbackUri = pick(process.env, ["RESOLVEIO_QA_LIVE_MONGO_URL", "RESOLVEIO_SUPPORT_QA_LIVE_MONGO_URL", "RESOLVEIO_RUNNER_QA_LIVE_MONGO_URL"]);'));
199
+ assert.ok(localQaScript.includes('if (uri && !isLocalMongo(uri))'));
200
+ assert.ok(localQaScript.indexOf('const uri = pick(env, ["MONGO_URL"])') < localQaScript.indexOf('const fallbackUri = pick(process.env'));
201
+ assert.ok(localQaScript.includes('node "$TOOLS_DIR/qa-live-data-seed.js" "$PROJECT_ROOT" >> "$ARTIFACT_DIR/runner.log"'));
202
+ assert.ok(localQaScript.indexOf('prestart_seed_live_data || exit $?') < localQaScript.indexOf('if [ -d "$PROJECT_ROOT/server" ]; then'));
203
+ assert.ok(localQaScript.includes('exec >> "$ARTIFACT_DIR/runner.log" 2>&1'));
204
+ assert.ok(localQaStopperScript.includes('runner-process-cleanup.json'));
205
+ assert.ok(localQaStopperScript.includes('janitor_update_manifest_status stopped'));
206
+ assert.ok(localQaScript.includes('kill_env_marked_processes'));
207
+ assert.ok(localQaStopperScript.includes('kill_env_marked_processes'));
208
+ assert.ok(localQaScript.includes('RESOLVEIO_RUNNER_QA_JOB_ID|RESOLVEIO_SUPPORT_QA_JOB_ID'));
209
+ assert.ok(localQaStopperScript.includes('RESOLVEIO_RUNNER_QA_JOB_ID|RESOLVEIO_SUPPORT_QA_JOB_ID'));
210
+ assert.ok(localQaScript.includes('[ -r "$env_file" ] || continue'));
211
+ assert.ok(localQaStopperScript.includes('[ -r "$env_file" ] || continue'));
212
+ assert.ok(localQaScript.includes('rm -rf "$LOCK_DIR"'));
213
+ assert.ok(localQaStopperScript.includes('rm -rf "$ARTIFACT_DIR/.qa.lock"'));
214
+ assert.ok(qaEnvScript.includes('RESOLVEIO_SUPPORT_QA_JOB_ID'));
215
+ assert.equal(RunnerProcessJanitor.buildManifest({ jobId: 'job-1', clientPort: 4321 })['job_id'], 'job-1');
216
+ assert.ok(localQaScript.includes('kill_artifact_log_writers'));
217
+ assert.ok(localQaStopperScript.includes('kill_artifact_log_writers'));
218
+ assert.ok(localQaScript.includes('(^|[ /])(tee|tail)( |$)'));
219
+ assert.ok(localQaStopperScript.includes('(^|[ /])(tee|tail)( |$)'));
220
+ assert.ok(localQaScript.includes('kill_local_mongo_processes'));
221
+ assert.ok(localQaStopperScript.includes('kill_local_mongo_processes'));
222
+ assert.ok(localQaScript.includes('--dbpath .*mongo\\/data\\/db'));
223
+ assert.ok(localQaStopperScript.includes('--dbpath .*mongo\\/data\\/db'));
224
+ assert.ok(localQaScript.includes('index($0, artifact) && $0 !~ /awk -v artifact=/'));
225
+ assert.ok(localQaStopperScript.includes('index($0, artifact) && $0 !~ /awk -v artifact=/'));
226
+ assert.ok(localQaScript.includes('for pid in $port_pids; do skip_cleanup_pid "$pid" && continue; found=1; kill_tree "$pid"; done'));
227
+ assert.ok(localQaStopperScript.includes('for pid in $port_pids; do skip_cleanup_pid "$pid" && continue; found=1; kill_tree "$pid"; done'));
228
+ assert.ok(localQaScript.includes('local wait_until=$((SECONDS + 60))'));
229
+ assert.ok(localQaStopperScript.includes('wait_until=$((SECONDS + 60))'));
230
+ assert.ok(!localQaScript.includes('! kill -0 "$SERVER_PID"'));
231
+ assert.ok(localQaScript.includes('if probe_url "$SERVER_URL"; then'));
232
+ assert.ok(localQaScript.includes(': > "$ARTIFACT_DIR/server.log"'));
233
+ assert.ok(localQaScript.includes(': > "$ARTIFACT_DIR/client.log"'));
234
+ assert.ok(!localQaScript.includes('npm run server || ./start_server.sh'));
235
+ assert.ok(localQaScript.includes('process.exit(p.scripts&&p.scripts.server?0:1)'));
236
+ assert.ok(localQaScript.includes('$0 !~ /awk -v root=/'));
237
+ assert.ok(localQaStopperScript.includes('$0 !~ /awk -v root=/'));
238
+ assert.ok(localQaScript.includes('$0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/'));
239
+ assert.ok(localQaStopperScript.includes('$0 !~ /run-local-qa\\.sh|stop-local-qa\\.sh|bugfix-comparison-qa\\.sh/'));
240
+ assert.ok(bugfixComparisonScript.includes('find "$ARTIFACT_DIR/$phase" -maxdepth 1 -type f'));
241
+ assert.ok(bugfixComparisonScript.includes('tee "$ARTIFACT_DIR/$phase/qa-command.log"'));
242
+ assert.ok(bugfixComparisonScript.includes('RESOLVEIO_RUNNER_QA_PROJECT_ROOT="$PROJECT_ROOT"'));
243
+ assert.ok(bugfixComparisonScript.includes('RESOLVEIO_RUNNER_QA_TOOLS_DIR="$TOOLS_DIR"'));
244
+ assert.ok(bugfixComparisonScript.includes('RESOLVEIO_SUPPORT_QA_KEEPALIVE=true RESOLVEIO_RUNNER_QA_KEEPALIVE=true "$TOOLS_DIR/run-local-qa.sh" "$PROJECT_ROOT"'));
245
+ assert.ok(bugfixComparisonScript.includes('node "$TOOLS_DIR/qa-live-data-seed.js" "$PROJECT_ROOT"'));
246
+ assert.ok(bugfixComparisonScript.includes('(cd "$PROJECT_ROOT" && "${QA_COMMAND[@]}")'));
247
+ assert.ok(!bugfixComparisonScript.includes('(cd "$REPO_ROOT" && "${QA_COMMAND[@]}")'));
248
+ assert.ok(liveDataSeederScript.includes('qa-live-data-seed-result.json'));
249
+ assert.ok(liveDataSeederScript.includes('RESOLVEIO_QA_LIVE_MONGO_URL'));
250
+ assert.ok(liveDataSeederScript.includes('RESOLVEIO_QA_MONGO_RUNTIME_PATH'));
251
+ assert.ok(liveDataSeederScript.includes('path.join(repoRoot, "mongo-context", ".mongo-runtime.json")'));
252
+ assert.ok(liveDataSeederScript.indexOf('const explicitRuntimePaths = [') < liveDataSeederScript.indexOf('const envUri = process.env.RESOLVEIO_QA_LIVE_MONGO_URL'));
253
+ assert.ok(liveDataSeederScript.includes('function preserveExistingSeedResult(reason)'));
254
+ assert.ok(liveDataSeederScript.includes('reused_existing'));
255
+ assert.ok(liveDataSeederScript.includes('function extractBolIdentifiers()'));
256
+ assert.ok(liveDataSeederScript.includes('function copyTruckTreatingBolContext(sourceDb, targetDb, summary)'));
257
+ assert.ok(liveDataSeederScript.includes('selected.truck_treating_bol_context'));
258
+ assert.ok(liveDataSeederScript.includes('"production-routes", { id_bol: { $in: bolIds } }'));
259
+ assert.ok(liveDataSeederScript.includes('"treatment-plans", { $or: ['));
260
+ assert.ok(liveDataSeederScript.includes('Ticket route hint(s)'));
261
+ assert.ok(liveDataSeederScript.includes('screen|tab|are|which|and|render|context'));
262
+ assert.ok(liveDataSeederScript.includes('extractBolIdentifiers().length && !(existing.selected && existing.selected.truck_treating_bol_context)'));
263
+ assert.ok(liveDataSeederScript.includes('preserveExistingSeedResult("missing_live_mongo_uri")'));
264
+ assert.ok(
265
+ liveDataSeederScript.indexOf('preserveExistingSeedResult("missing_live_mongo_uri")') <
266
+ liveDataSeederScript.indexOf('writeResult({ status: isLiveDataRequired() ? "failed" : "skipped", reason: "missing_live_mongo_uri"')
267
+ );
268
+ assert.ok(liveDataSeederScript.includes('isLiveDataRequired() ? "failed" : "skipped"'));
269
+ assert.ok(liveDataSeederScript.includes('isLiveDataRequired() ? 5 : 0'));
270
+ assert.ok(liveDataSeederScript.includes('target_mongo_must_be_localhost'));
271
+ assert.ok(liveDataSeederScript.includes('source_and_target_mongo_match'));
272
+ assert.ok(liveDataSeederScript.includes('function delay(ms)'));
273
+ assert.ok(liveDataSeederScript.includes('async function waitForTargetMongo(MongoClient, targetUri)'));
274
+ assert.ok(liveDataSeederScript.includes('RESOLVEIO_QA_LOCAL_MONGO_WAIT_MS'));
275
+ assert.ok(liveDataSeederScript.includes('target_local_mongo_unavailable'));
276
+ assert.ok(
277
+ liveDataSeederScript.indexOf('await waitForTargetMongo(MongoClient, targetUri);') <
278
+ liveDataSeederScript.indexOf('const sourceClient = new MongoClient(source.uri')
279
+ );
280
+ assert.ok(liveDataSeederScript.includes('extractSeedIdentifiers'));
281
+ assert.ok(liveDataSeederScript.includes('identifierQuery'));
282
+ assert.ok(liveDataSeederScript.includes('production-deliveries'));
283
+ assert.ok(liveDataSeederScript.includes('selectDashboardReadyProductionDeliveryIds'));
284
+ assert.ok(liveDataSeederScript.includes('selectTruckTreatDashboardReadyProductionDeliveryIds'));
285
+ assert.ok(liveDataSeederScript.includes('selectLocalhostDeliveryFixtureIds'));
286
+ assert.ok(liveDataSeederScript.includes('localhost-only delivery invoice fixture'));
287
+ assert.ok(liveDataSeederScript.includes('function shouldSeedBillingDashboardFixtures()'));
288
+ assert.ok(liveDataSeederScript.includes('function shouldSeedPricingImportFixtures()'));
289
+ assert.ok(liveDataSeederScript.includes('function copyPricingImportWorkbookContext(sourceDb, targetDb, summary)'));
290
+ assert.ok(liveDataSeederScript.includes('Seeded pricing-import workbook context'));
291
+ assert.ok(liveDataSeederScript.includes('function desiredSeedProfile()'));
292
+ assert.ok(liveDataSeederScript.includes('RESOLVEIO_QA_INCLUDE_BILLING_FIXTURES'));
293
+ assert.ok(liveDataSeederScript.includes('RESOLVEIO_QA_INCLUDE_PRICING_IMPORT_FIXTURES'));
294
+ assert.ok(liveDataSeederScript.includes('RESOLVEIO_QA_FORCE_BILLING_FIXTURES'));
295
+ assert.ok(liveDataSeederScript.includes('profile: desiredSeedProfile()'));
296
+ assert.ok(liveDataSeederScript.includes('if (shouldSeedPricingImportFixtures()) return "pricing_import";'));
297
+ assert.ok(liveDataSeederScript.includes('if (shouldSeedPricingImportFixtures()) return false;'));
298
+ assert.ok(
299
+ liveDataSeederScript.indexOf('if (shouldSeedPricingImportFixtures()) return false;') <
300
+ liveDataSeederScript.indexOf('const explicit = process.env.RESOLVEIO_QA_INCLUDE_BILLING_FIXTURES')
301
+ );
302
+ assert.ok(liveDataSeederScript.includes('pricing records are copied without synthetic billing dashboard invoice fixtures'));
303
+ assert.ok(liveDataSeederScript.includes('Billing dashboard fixtures are disabled because ticket context does not require billing'));
304
+ assert.equal(liveDataSeederScript.includes('pick\\s*ticket|report|reports'), false);
305
+ assert.ok(liveDataSeederScript.includes('cleanupSyntheticBillingDashboardQaFixtures'));
306
+ assert.ok(liveDataSeederScript.includes('Removed ${removed} stale synthetic billing dashboard QA fixture'));
307
+ assert.ok(liveDataSeederScript.includes('production-sales-orders'));
308
+ assert.ok(liveDataSeederScript.includes('production-location-tanks'));
309
+ assert.ok(liveDataSeederScript.includes('truck-treating-deliveries'));
310
+ assert.ok(liveDataSeederScript.includes('status: "Delivered"'));
311
+ assert.ok(liveDataSeederScript.includes('ensureBillingSurchargePricingFixtures'));
312
+ assert.ok(liveDataSeederScript.includes('QA Misc Surcharge'));
313
+ assert.ok(liveDataSeederScript.includes('QA Service Surcharge'));
314
+ assert.ok(liveDataSeederScript.includes('sub_type: { $in: ["misc", "service"] }'));
315
+ assert.ok(liveDataSeederScript.includes('qa_surcharge_pricing_items'));
316
+ assert.ok(liveDataSeederScript.includes('inventory-transactions'));
317
+ assert.ok(liveDataSeederScript.includes('No live billable delivery or truck-treatment records matched'));
318
+
319
+ const bundle = buildResolveIORunnerPromptBundle({
320
+ context: 'ai_terminal',
321
+ objective: 'Fix the inventory list filter.',
322
+ blockers: [
323
+ 'Browser QA failed on /inventory after clicking Filter.',
324
+ 'Browser QA failed on /inventory after clicking Filter.'
325
+ ],
326
+ relevantFiles: ['angular/app/inventory/inventory.component.ts'],
327
+ evidence: ['.build-output/inventory-filter.png'],
328
+ maxBlockers: 4
329
+ });
330
+
331
+ assert.equal(bundle.objective, 'Fix the inventory list filter.');
332
+ assert.equal(bundle.contextLines.filter((line) => /Browser QA failed/i.test(line)).length, 1);
333
+ assert.ok(bundle.fullPromptLines.some((line) => /Mandatory repair contract/i.test(line)));
334
+ assert.ok(bundle.fullPromptLines.some((line) => /ResolveIO shared runner contract/i.test(line)));
335
+
336
+ assert.equal(
337
+ normalizeResolveIORunnerBlocker('Attempt 2 failed at server/src/methods/demo.ts:123 line 123'),
338
+ 'attempt # failed at server/src/methods/demo.ts:# line #'
339
+ );
340
+ assert.equal(classifyResolveIORunnerBlocker('Reviewer found a database call inside loop'), 'db_call_inside_loop');
341
+ assert.equal(
342
+ classifyResolveIORunnerBlocker('QA compile preflight failed: geochem/angular/app/schedule.ts:42 error TS2554: Expected 0 arguments, but got 1. yardsForUser(this.id_driver) from angular/app/publications.ts'),
343
+ 'user_specific_publication_argument_mismatch'
344
+ );
345
+ assert.equal(
346
+ classifyResolveIORunnerBlocker('QA compile preflight failed before browser testing: Fix the Angular publication signature mismatch causing the `yardsForUser(...)` compile errors, then rerun QA.'),
347
+ 'user_specific_publication_argument_mismatch'
348
+ );
349
+ assert.equal(
350
+ classifyResolveIORunnerBlocker('QA coverage matrix is incomplete: limited smoke only proves headers; missing tax and inventory persisted result checks.'),
351
+ 'qa_coverage_incomplete'
352
+ );
353
+
354
+ const qaCoverageChecklist = buildResolveIORunnerQaCoverageChecklist({
355
+ ticketText: 'Invoice line item surcharge must update sales tax and inventory transactions.',
356
+ changedFiles: ['geochem/angular/app/invoice/new/invoice-new.component.ts', 'geochem/server/src/methods/invoices.ts']
357
+ });
358
+ assert.ok(qaCoverageChecklist.some((line) => /Invoice\/billing\/tax coverage/i.test(line)));
359
+ assert.ok(qaCoverageChecklist.some((line) => /Inventory coverage/i.test(line)));
360
+ assert.ok(qaCoverageChecklist.some((line) => /seed a minimal localhost-only customer/i.test(line)));
361
+ assert.ok(qaCoverageChecklist.some((line) => /seed the smallest localhost-only item\/location\/quantity\/value fixture/i.test(line)));
362
+ assert.ok(qaCoverageChecklist.some((line) => /row\/value assertion/i.test(line)));
363
+ assert.ok(buildResolveIOQaPolicyRules({ qaLiveDataRequired: true }).some((line) => /Do not return blocked only because local QA data is empty/i.test(line)));
364
+
365
+ const repairPlans = buildResolveIORunnerRepairPlans({
366
+ context: 'support_ticket',
367
+ includeDevServerRules: true,
368
+ blockers: [
369
+ 'Reviewer found a database call inside loop in server/src/methods/invoices.ts:44 loop starts near line 40'
370
+ ],
371
+ changedFiles: ['server/src/methods/invoices.ts'],
372
+ gateSource: 'pr_quality_review'
373
+ });
374
+
375
+ assert.equal(repairPlans.length, 1);
376
+ assert.equal(repairPlans[0].blockerClass, 'db_call_inside_loop');
377
+ assert.deepEqual(repairPlans[0].targetFiles, ['server/src/methods/invoices.ts']);
378
+ assert.ok(repairPlans[0].lineHints.includes('line 44'));
379
+ assert.ok(repairPlans[0].repairRecipe.some((line) => /batched/i.test(line)));
380
+ assert.ok(repairPlans[0].passingCondition.includes('No loop'));
381
+
382
+ const userSpecificRepairPlans = buildResolveIORunnerRepairPlans({
383
+ context: 'support_ticket',
384
+ includeDevServerRules: true,
385
+ blockers: [
386
+ 'QA compile preflight failed: geochem/angular/app/schedule.ts:42 error TS2554: Expected 0 arguments, but got 1. yardsForUser(this.id_driver) from angular/app/publications.ts'
387
+ ],
388
+ changedFiles: ['geochem/angular/app/publications.ts', 'geochem/angular/app/schedule.ts'],
389
+ gateSource: 'qa_compile_preflight'
390
+ });
391
+
392
+ assert.equal(userSpecificRepairPlans[0].blockerClass, 'user_specific_publication_argument_mismatch');
393
+ assert.ok(userSpecificRepairPlans[0].repairRecipe.some((line) => /inject.*logged-in socket user.*first server parameter/i.test(line)));
394
+ assert.ok(userSpecificRepairPlans[0].repairRecipe.some((line) => /id_current_user: string, id_user\?: string/i.test(line)));
395
+
396
+ const coverageRepairPlans = buildResolveIORunnerRepairPlans({
397
+ context: 'support_ticket',
398
+ includeDevServerRules: true,
399
+ blockers: [
400
+ 'QA coverage matrix incomplete: only showed surcharge buttons; missing invoice create/edit/reopen, tax totals, inventory transaction side effects, and persisted result assertions.'
401
+ ],
402
+ changedFiles: [
403
+ 'geochem/angular/app/invoice/new/invoice-new.component.ts',
404
+ 'geochem/server/src/methods/invoices.ts',
405
+ 'geochem/server/src/collections/customer.collection.ts'
406
+ ],
407
+ gateSource: 'qa_browser_validation'
408
+ });
409
+
410
+ assert.equal(coverageRepairPlans[0].blockerClass, 'qa_coverage_incomplete');
411
+ assert.ok(coverageRepairPlans[0].repairRecipe.some((line) => /QA Coverage Matrix/i));
412
+ assert.ok(coverageRepairPlans[0].repairRecipe.some((line) => /Invoice\/billing\/tax coverage/i));
413
+ assert.ok(coverageRepairPlans[0].repairRecipe.some((line) => /seed a minimal faithful fixture in the local QA database/i));
414
+ assert.ok(coverageRepairPlans[0].requiredProof.some((line) => /persisted row\/value assertions/i));
415
+
416
+ assert.deepEqual(
417
+ findRepeatedResolveIORunnerBlockers(
418
+ ['Attempt 1 failed at server/src/methods/demo.ts:123 line 123'],
419
+ ['Attempt 2 failed at server/src/methods/demo.ts:456 line 456']
420
+ ),
421
+ ['Attempt 2 failed at server/src/methods/demo.ts:456 line 456']
422
+ );
423
+
424
+ assert.equal(decideResolveIORunnerRepairContinuation({
425
+ currentBlockers: ['Generated file mismatch in angular/app/publications.ts'],
426
+ activeContractBlockers: ['yardsForUser publication signature mismatch'],
427
+ currentAttempt: 3,
428
+ maxAttempts: 3,
429
+ currentRepairWaveCount: 1,
430
+ maxRepairWaves: 4
431
+ }).action, 'start_repair_wave');
432
+
433
+ assert.equal(decideResolveIORunnerRepairContinuation({
434
+ currentBlockers: ['yardsForUser publication signature mismatch at line 80'],
435
+ activeContractBlockers: ['yardsForUser publication signature mismatch at line 40'],
436
+ currentAttempt: 2,
437
+ maxAttempts: 3,
438
+ currentRepairWaveCount: 0,
439
+ maxRepairWaves: 4
440
+ }).action, 'park_repeated_blocker');
441
+
442
+ assert.equal(decideResolveIORunnerRepairContinuation({
443
+ currentBlockers: ['Browser QA still fails on /manage'],
444
+ activeContractBlockers: ['Browser QA still fails on /manage'],
445
+ diffHash: 'same',
446
+ evidenceHash: 'same',
447
+ previousDiffHash: 'same',
448
+ previousEvidenceHash: 'same'
449
+ }).action, 'park_no_progress');
450
+
451
+ const artifactRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'resolveio-runner-artifacts-'));
452
+ const projectRoot = path.join(artifactRoot, 'resolveio-all', 'geochem');
453
+ const qaRoot = path.join(projectRoot, 'qa-artifacts');
454
+ fs.mkdirSync(qaRoot, { recursive: true });
455
+ const screenshotPath = path.join(qaRoot, 'billing-dashboard-surcharge.png');
456
+ fs.writeFileSync(screenshotPath, 'fake png bytes');
457
+
458
+ const artifactPaths = collectResolveIORunnerEvidenceArtifactPaths({
459
+ job: {
460
+ workspacePath: artifactRoot,
461
+ projectRoot: 'resolveio-all/geochem',
462
+ tasks: [{
463
+ notes: 'QA passed. Screenshot: qa-artifacts/billing-dashboard-surcharge.png'
464
+ }]
465
+ }
466
+ });
467
+
468
+ assert.deepEqual(artifactPaths, [screenshotPath]);
469
+
470
+ const authScreenshotPath = path.join(qaRoot, 'auth-bootstrap-ready.jpg');
471
+ const deliveryScreenshotPath = path.join(qaRoot, 'delivery-invoice-modal.png');
472
+ const coverageMatrixPath = path.join(qaRoot, 'qa-coverage-matrix.json');
473
+ fs.writeFileSync(authScreenshotPath, 'auth png bytes');
474
+ fs.writeFileSync(deliveryScreenshotPath, 'delivery png bytes');
475
+ fs.writeFileSync(coverageMatrixPath, '{"rows":[]}');
476
+ const scannedArtifacts = collectResolveIORunnerEvidenceArtifactFilesFromRoots({
477
+ roots: [projectRoot],
478
+ maxFiles: 3,
479
+ includeJson: true
480
+ });
481
+ assert.deepEqual(scannedArtifacts, [
482
+ screenshotPath,
483
+ deliveryScreenshotPath,
484
+ coverageMatrixPath
485
+ ]);
486
+
487
+ let uploadedCount = 0;
488
+ persistResolveIORunnerEvidenceArtifacts({
489
+ job: {
490
+ workspacePath: artifactRoot,
491
+ projectRoot: 'resolveio-all/geochem',
492
+ tasks: [{
493
+ notes: 'QA passed. Screenshot: qa-artifacts/billing-dashboard-surcharge.png'
494
+ }]
495
+ },
496
+ ticketUrl: 'https://resolveio.test/support/004333',
497
+ uploadFile: async (input) => {
498
+ uploadedCount += 1;
499
+ assert.equal(input.filename, 'billing-dashboard-surcharge.png');
500
+ assert.equal(input.contentType, 'image/png');
501
+ assert.equal(input.size, Buffer.from('fake png bytes').length);
502
+ return {
503
+ _id: 'file-qa-1',
504
+ key: 'uploads/qa/billing-dashboard-surcharge.png',
505
+ name: input.filename
506
+ };
507
+ }
508
+ }).then((result) => {
509
+ assert.equal(uploadedCount, 1);
510
+ assert.deepEqual(result.fileIds, ['file-qa-1']);
511
+ assert.equal(result.files[0].key, 'uploads/qa/billing-dashboard-surcharge.png');
512
+ assert.equal(result.attachments[0].uploaded_to_support_ticket, true);
513
+ }).catch((error) => {
514
+ throw error;
515
+ });