@resolveio/server-lib 22.3.149 → 22.3.150

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 +23524 -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 +684 -0
  177. package/src/util/ai-run-evidence-dashboard.ts +313 -0
  178. package/src/util/ai-run-evidence-eval.ts +885 -0
  179. package/src/util/ai-run-evidence.ts +1058 -0
  180. package/src/util/ai-runner-artifacts.ts +586 -0
  181. package/src/util/ai-runner-manager-autopilot.ts +434 -0
  182. package/src/util/ai-runner-manager-policy.ts +2733 -0
  183. package/src/util/ai-runner-qa-auth.ts +821 -0
  184. package/src/util/ai-runner-qa-tools.ts +3045 -0
  185. package/src/util/aicoder-runner-v6.ts +875 -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 +2167 -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 +560 -0
  208. package/tests/ai-assistant-snf-live-eval.ts +975 -0
  209. package/tests/ai-assistant-utils.test.ts +2968 -0
  210. package/tests/ai-manager-autopilot-snapshot.test.ts +177 -0
  211. package/tests/ai-manager-recovery-checkpoint.test.ts +595 -0
  212. package/tests/ai-run-eval.test.ts +88 -0
  213. package/tests/ai-run-evidence.test.ts +348 -0
  214. package/tests/ai-runner-contract.test.ts +488 -0
  215. package/tests/aicoder-runner-v6.test.ts +298 -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 +488 -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 -337
  425. package/methods/ai-terminal.js +0 -23193
  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 -33
  672. package/util/ai-run-evidence-adapters.js +0 -838
  673. package/util/ai-run-evidence-adapters.js.map +0 -1
  674. package/util/ai-run-evidence-dashboard.d.ts +0 -84
  675. package/util/ai-run-evidence-dashboard.js +0 -336
  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 -854
  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 -731
  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 -112
  687. package/util/ai-runner-manager-autopilot.js +0 -313
  688. package/util/ai-runner-manager-autopilot.js.map +0 -1
  689. package/util/ai-runner-manager-policy.d.ts +0 -403
  690. package/util/ai-runner-manager-policy.js +0 -1763
  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 -822
  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 -3029
  697. package/util/ai-runner-qa-tools.js.map +0 -1
  698. package/util/aicoder-runner-v6.d.ts +0 -214
  699. package/util/aicoder-runner-v6.js +0 -507
  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 -415
  732. package/util/support-runner-v5.js +0 -1445
  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
@@ -1,1763 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- var __values = (this && this.__values) || function(o) {
14
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
15
- if (m) return m.call(o);
16
- if (o && typeof o.length === "number") return {
17
- next: function () {
18
- if (o && i >= o.length) o = void 0;
19
- return { value: o && o[i++], done: !o };
20
- }
21
- };
22
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
23
- };
24
- var __read = (this && this.__read) || function (o, n) {
25
- var m = typeof Symbol === "function" && o[Symbol.iterator];
26
- if (!m) return o;
27
- var i = m.call(o), r, ar = [], e;
28
- try {
29
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
30
- }
31
- catch (error) { e = { error: error }; }
32
- finally {
33
- try {
34
- if (r && !r.done && (m = i["return"])) m.call(i);
35
- }
36
- finally { if (e) throw e.error; }
37
- }
38
- return ar;
39
- };
40
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
41
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
42
- if (ar || !(i in from)) {
43
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
44
- ar[i] = from[i];
45
- }
46
- }
47
- return to.concat(ar || Array.prototype.slice.call(from));
48
- };
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.buildResolveIOAIManagerHotfixFirstReleasePolicy = buildResolveIOAIManagerHotfixFirstReleasePolicy;
51
- exports.isResolveIOAIManagerSafeAutoDispatch = isResolveIOAIManagerSafeAutoDispatch;
52
- exports.normalizeResolveIOAIManagerFailureClass = normalizeResolveIOAIManagerFailureClass;
53
- exports.fingerprintResolveIOAIManagerBlocker = fingerprintResolveIOAIManagerBlocker;
54
- exports.hashResolveIOAIManagerEvidence = hashResolveIOAIManagerEvidence;
55
- exports.buildResolveIOAIManagerRecoveryCheckpoint = buildResolveIOAIManagerRecoveryCheckpoint;
56
- exports.buildResolveIOAIManagerRecoveryEvidenceProbe = buildResolveIOAIManagerRecoveryEvidenceProbe;
57
- exports.buildResolveIOAIManagerRecoveryActionPacket = buildResolveIOAIManagerRecoveryActionPacket;
58
- exports.decideResolveIOAIManagerRecoveryActionDispatch = decideResolveIOAIManagerRecoveryActionDispatch;
59
- exports.appendResolveIOAIManagerRecoveryActionDispatch = appendResolveIOAIManagerRecoveryActionDispatch;
60
- exports.buildResolveIOAIManagerRecoveryExecutionDirective = buildResolveIOAIManagerRecoveryExecutionDirective;
61
- exports.assessResolveIOAIManagerEvidenceChange = assessResolveIOAIManagerEvidenceChange;
62
- exports.decideResolveIOAIManagerRecoveryGate = decideResolveIOAIManagerRecoveryGate;
63
- exports.buildResolveIOAIManagerRecoveryPlan = buildResolveIOAIManagerRecoveryPlan;
64
- exports.decideResolveIOAIManagerPolicy = decideResolveIOAIManagerPolicy;
65
- exports.buildResolveIOAIManagerRecoveryReplayMatrix = buildResolveIOAIManagerRecoveryReplayMatrix;
66
- function cleanText(value, max) {
67
- if (max === void 0) { max = 2000; }
68
- return String(value || '').replace(/\s+/g, ' ').trim().slice(0, max);
69
- }
70
- function cleanList(values, limit, max) {
71
- var e_1, _a;
72
- if (limit === void 0) { limit = 40; }
73
- if (max === void 0) { max = 500; }
74
- if (!Array.isArray(values)) {
75
- return [];
76
- }
77
- var result = [];
78
- try {
79
- for (var values_1 = __values(values), values_1_1 = values_1.next(); !values_1_1.done; values_1_1 = values_1.next()) {
80
- var value = values_1_1.value;
81
- var normalized = cleanText(value, max);
82
- if (normalized && !result.includes(normalized)) {
83
- result.push(normalized);
84
- }
85
- if (result.length >= limit) {
86
- break;
87
- }
88
- }
89
- }
90
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
91
- finally {
92
- try {
93
- if (values_1_1 && !values_1_1.done && (_a = values_1.return)) _a.call(values_1);
94
- }
95
- finally { if (e_1) throw e_1.error; }
96
- }
97
- return result;
98
- }
99
- function releaseStatusIsBlocked(value) {
100
- return /fail|error|blocked|missing|empty|not ready|not_ready|denied|invalid|timeout|stale/i.test(value);
101
- }
102
- function releaseStatusIsTerminalDeploy(value) {
103
- return /requested|queued|in.?progress|completed|complete|success|succeeded|pass|passed|published|deployed|failed|error|blocked/i.test(value);
104
- }
105
- function buildReleaseAllowedActions(action) {
106
- if (action === 'wait_for_active_deploy') {
107
- return ['wait_for_current_deploy_result', 'collect_current_deploy_log', 'refresh_release_snapshot'];
108
- }
109
- if (action === 'block_duplicate_deploy') {
110
- return ['collect_existing_deploy_evidence', 'hotfix_release_artifact', 'request_force_deploy_with_reason'];
111
- }
112
- if (action === 'block_duplicate_publish') {
113
- return ['collect_existing_publish_evidence', 'hotfix_release_artifact', 'request_force_publish_with_reason'];
114
- }
115
- if (action === 'review_force_deploy') {
116
- return ['verify_force_deploy_reason', 'rerun_failed_release_gate_once', 'record_force_deploy_evidence'];
117
- }
118
- if (action === 'deploy_new_artifact_after_release_gate') {
119
- return ['verify_new_artifact_fingerprint', 'run_release_gate_once', 'record_publish_deploy_evidence'];
120
- }
121
- if (action === 'build_artifact_first') {
122
- return ['build_missing_release_artifact', 'record_artifact_fingerprint', 'run_release_gate_once'];
123
- }
124
- return ['hotfix_live_runner_or_release_artifact', 'rerun_failed_release_gate_only', 'record_release_evidence'];
125
- }
126
- function hotfixStep(id, label, channel, options) {
127
- if (options === void 0) { options = {}; }
128
- return {
129
- id: id,
130
- label: label,
131
- channel: channel,
132
- safeToAutoRun: options.safeToAutoRun === true,
133
- requiresFullDeploy: options.requiresFullDeploy === true,
134
- requiredEvidence: options.requiredEvidence || [],
135
- successEvidence: options.successEvidence || [],
136
- blockedBy: options.blockedBy || []
137
- };
138
- }
139
- function buildHotfixFirstReleasePlan(input) {
140
- var surface = cleanText(input.surface || 'runner', 80)
141
- .toLowerCase()
142
- .replace(/[^a-z0-9]+/g, '_')
143
- .replace(/^_+|_+$/g, '') || 'runner';
144
- var commonAcceptance = [
145
- 'failed release gate is rerun once and passes',
146
- 'artifact fingerprint or hotfix evidence is recorded',
147
- 'operator console shows no active duplicate deploy blocker'
148
- ];
149
- if (input.action === 'wait_for_active_deploy') {
150
- return {
151
- planId: "".concat(surface, ":wait_for_active_deploy"),
152
- label: 'Wait For Active Deploy',
153
- recommendedChannel: 'release_artifact',
154
- reason: input.reason,
155
- fullDeployAvoided: true,
156
- steps: [
157
- hotfixStep('collect_active_deploy_log', 'Collect active deploy log', 'release_artifact', {
158
- safeToAutoRun: true,
159
- requiredEvidence: ['active deploy id or release operation id'],
160
- successEvidence: ['terminal deploy status and release log captured']
161
- })
162
- ],
163
- acceptanceEvidence: commonAcceptance,
164
- escalationTriggers: ['active deploy exceeds timeout', 'active deploy fails without a release log']
165
- };
166
- }
167
- if (input.action === 'deploy_new_artifact_after_release_gate') {
168
- return {
169
- planId: "".concat(surface, ":deploy_new_artifact_after_release_gate"),
170
- label: 'Deploy New Artifact After Release Gate',
171
- recommendedChannel: 'new_artifact_deploy',
172
- reason: input.reason,
173
- fullDeployAvoided: false,
174
- steps: [
175
- hotfixStep('verify_new_artifact_fingerprint', 'Verify new artifact fingerprint', 'new_artifact_deploy', {
176
- safeToAutoRun: true,
177
- requiresFullDeploy: true,
178
- requiredEvidence: ['current artifact fingerprint differs from last deployed fingerprint'],
179
- successEvidence: ['release gate permits one full deploy']
180
- })
181
- ],
182
- acceptanceEvidence: [
183
- 'new artifact fingerprint recorded',
184
- 'release gate passed before full deploy',
185
- 'deploy/publish result recorded'
186
- ],
187
- escalationTriggers: ['artifact fingerprint matches last deploy', 'release gate fails']
188
- };
189
- }
190
- if (input.action === 'build_artifact_first') {
191
- return {
192
- planId: "".concat(surface, ":build_artifact_first"),
193
- label: 'Build Artifact First',
194
- recommendedChannel: 'artifact_build',
195
- reason: input.reason,
196
- fullDeployAvoided: true,
197
- steps: [
198
- hotfixStep('build_once_record_fingerprint', 'Build once and record fingerprint', 'artifact_build', {
199
- safeToAutoRun: false,
200
- requiredEvidence: ['missing artifact fingerprint', 'release gate reason for building'],
201
- successEvidence: ['artifact fingerprint recorded before any deploy']
202
- })
203
- ],
204
- acceptanceEvidence: ['artifact fingerprint exists', 'no deploy queued before release gate'],
205
- escalationTriggers: ['build repeats without a new fingerprint', 'build failure lacks compile log']
206
- };
207
- }
208
- if (input.action === 'review_force_deploy') {
209
- return {
210
- planId: "".concat(surface, ":review_force_deploy"),
211
- label: 'Review Force Deploy',
212
- recommendedChannel: 'force_deploy_review',
213
- reason: input.reason,
214
- fullDeployAvoided: false,
215
- steps: [
216
- hotfixStep('verify_force_deploy_reason', 'Verify force deploy reason', 'force_deploy_review', {
217
- requiredEvidence: ['explicit force_deploy reason', 'why hotfix cannot resolve the release blocker'],
218
- successEvidence: ['one allowed deploy attempt is recorded with reason']
219
- })
220
- ],
221
- acceptanceEvidence: ['force deploy evidence recorded', 'duplicate fingerprint exception is auditable'],
222
- escalationTriggers: ['force deploy reason is empty', 'same force deploy fails twice']
223
- };
224
- }
225
- return {
226
- planId: "".concat(surface, ":").concat(input.action),
227
- label: input.action === 'block_duplicate_deploy'
228
- ? 'Hotfix Or Force Deploy'
229
- : input.action === 'block_duplicate_publish'
230
- ? 'Hotfix Or Force Publish'
231
- : 'Hotfix Release Artifact',
232
- recommendedChannel: input.action === 'block_duplicate_publish'
233
- ? 'release_artifact'
234
- : input.releaseBlocked ? 'release_artifact' : 'static_ui',
235
- reason: input.reason,
236
- fullDeployAvoided: true,
237
- steps: [
238
- hotfixStep('static_ui_hotfix', 'Static UI hotfix', 'static_ui', {
239
- safeToAutoRun: true,
240
- requiredEvidence: ['built dist path', 'target S3 bucket and CloudFront distribution', 'changed frontend bundle or asset list'],
241
- successEvidence: ['S3 upload result', 'CloudFront invalidation id', 'public bundle contains expected hotfix marker']
242
- }),
243
- hotfixStep('backend_js_hotfix', 'Backend JS hotfix', 'backend_js', {
244
- requiredEvidence: ['compiled JS artifact path', 'target backend host', 'diff limited to runner/operator code'],
245
- successEvidence: ['remote file checksum', 'service restart or process reload evidence', 'self-test passes']
246
- }),
247
- hotfixStep('config_seed_cache_restart', 'Config, seed, cache, or restart repair', 'config', {
248
- safeToAutoRun: true,
249
- requiredEvidence: ['exact config/seed/cache key or process name', 'why no product artifact changed'],
250
- successEvidence: ['release gate rerun result', 'operator console release snapshot refreshed']
251
- })
252
- ],
253
- acceptanceEvidence: commonAcceptance,
254
- escalationTriggers: [
255
- 'hotfix changes customer-facing product code outside the release artifact',
256
- 'same release gate fails twice after hotfix evidence',
257
- 'same publish fingerprint is retried without force_publish evidence',
258
- 'force deploy is requested without a reason'
259
- ]
260
- };
261
- }
262
- function buildResolveIOAIManagerHotfixFirstReleasePolicy(input) {
263
- if (input === void 0) { input = {}; }
264
- var surface = cleanText(input.surface || 'runner', 120);
265
- var deployStatus = cleanText(input.deployStatus, 160);
266
- var publishStatus = cleanText(input.publishStatus, 160);
267
- var sampleDataStatus = cleanText(input.sampleDataStatus, 160);
268
- var deployFingerprint = cleanText(input.deployFingerprint, 240);
269
- var lastDeployFingerprint = cleanText(input.lastDeployFingerprint, 240);
270
- var publishFingerprint = cleanText(input.publishFingerprint, 240);
271
- var lastPublishFingerprint = cleanText(input.lastPublishFingerprint, 240);
272
- var fingerprintMatchesLast = !!deployFingerprint && !!lastDeployFingerprint && deployFingerprint === lastDeployFingerprint;
273
- var publishFingerprintMatchesLast = !!publishFingerprint && !!lastPublishFingerprint && publishFingerprint === lastPublishFingerprint;
274
- var releaseBlocked = [deployStatus, publishStatus, sampleDataStatus].some(releaseStatusIsBlocked);
275
- var duplicateDeployBlocked = fingerprintMatchesLast
276
- && input.forceDeploy !== true
277
- && releaseStatusIsTerminalDeploy([deployStatus, publishStatus].filter(Boolean).join(' '));
278
- var duplicatePublishBlocked = publishFingerprintMatchesLast
279
- && input.forcePublish !== true
280
- && releaseStatusIsBlocked(publishStatus)
281
- && releaseStatusIsTerminalDeploy(publishStatus);
282
- var recommendedAction = 'hotfix_release_artifact';
283
- var label = 'Hotfix Release Artifact';
284
- var reason = 'Repair the live runner/operator code, release config, domain, seed-data, or release artifact and rerun only the failed release gate.';
285
- var fullDeployAllowed = false;
286
- if (input.activeDeploy === true) {
287
- recommendedAction = 'wait_for_active_deploy';
288
- label = 'Wait For Active Deploy';
289
- reason = 'A deploy is already queued or running; collect that result before spending another deploy cycle.';
290
- }
291
- else if (duplicateDeployBlocked) {
292
- recommendedAction = 'block_duplicate_deploy';
293
- label = 'Block Duplicate Deploy';
294
- reason = 'The same artifact fingerprint already has release status; hotfix or provide explicit force_deploy evidence before rerunning it.';
295
- }
296
- else if (duplicatePublishBlocked) {
297
- recommendedAction = 'block_duplicate_publish';
298
- label = 'Block Duplicate Publish';
299
- reason = 'The same publish fingerprint already has release status; hotfix the release artifact or provide explicit force_publish evidence before rerunning publish.';
300
- }
301
- else if ((fingerprintMatchesLast && input.forceDeploy === true) || (publishFingerprintMatchesLast && input.forcePublish === true)) {
302
- recommendedAction = 'review_force_deploy';
303
- label = 'Review Force Deploy';
304
- reason = input.forcePublish === true
305
- ? 'force_publish was explicitly requested for a repeated publish artifact; require a reason and rerun only the failed release gate.'
306
- : 'force_deploy was explicitly requested for a repeated artifact; require a reason and rerun only the failed release gate.';
307
- fullDeployAllowed = true;
308
- }
309
- else if (input.hasNewArtifact === false && !releaseBlocked) {
310
- recommendedAction = 'build_artifact_first';
311
- label = 'Build Artifact First';
312
- reason = 'No release artifact fingerprint is available yet; build once, record the fingerprint, and avoid repeated deploys.';
313
- }
314
- else if (input.hasNewArtifact === true && !releaseBlocked) {
315
- recommendedAction = 'deploy_new_artifact_after_release_gate';
316
- label = 'Deploy New Artifact After Release Gate';
317
- reason = 'A new artifact can be deployed after the release gate proves the artifact is new and ready.';
318
- fullDeployAllowed = true;
319
- }
320
- var allowedActions = buildReleaseAllowedActions(recommendedAction);
321
- var hotfixPlan = buildHotfixFirstReleasePlan({
322
- action: recommendedAction,
323
- surface: surface,
324
- reason: reason,
325
- releaseBlocked: releaseBlocked
326
- });
327
- return {
328
- policy: 'hotfix_first',
329
- surface: surface,
330
- recommendedAction: recommendedAction,
331
- label: label,
332
- reason: reason,
333
- hotfixPreferred: recommendedAction !== 'deploy_new_artifact_after_release_gate' && recommendedAction !== 'review_force_deploy',
334
- fullDeployAllowed: fullDeployAllowed,
335
- duplicateDeployBlocked: duplicateDeployBlocked,
336
- duplicatePublishBlocked: duplicatePublishBlocked,
337
- forceDeployRequiredToRepeat: true,
338
- forcePublishRequiredToRepeat: true,
339
- statuses: {
340
- deploy: deployStatus,
341
- publish: publishStatus,
342
- sampleData: sampleDataStatus
343
- },
344
- fingerprints: {
345
- current: deployFingerprint,
346
- last: lastDeployFingerprint,
347
- matchesLast: fingerprintMatchesLast,
348
- publishCurrent: publishFingerprint,
349
- publishLast: lastPublishFingerprint,
350
- publishMatchesLast: publishFingerprintMatchesLast
351
- },
352
- hotfixPlan: hotfixPlan,
353
- allowedActions: allowedActions,
354
- forbiddenActions: [
355
- 'rerun full builder loop for a release-only blocker',
356
- 'queue duplicate deploy without force_deploy evidence',
357
- 'queue duplicate publish without force_publish evidence',
358
- 'publish/deploy again before reading the failed release log',
359
- 'change core workflow after business proof passed unless release evidence proves it is required'
360
- ],
361
- requiredEvidence: [
362
- 'failed release gate log or active deploy result',
363
- 'deploy artifact fingerprint comparison',
364
- 'publish artifact fingerprint comparison when publish is the failed gate',
365
- 'hotfix/config/seed/domain change evidence when no new product artifact is needed',
366
- 'force_deploy or force_publish reason when repeating the same fingerprint'
367
- ]
368
- };
369
- }
370
- function isResolveIOAIManagerSafeAutoDispatch(input) {
371
- var _a, _b, _c, _d, _e, _f, _g, _h, _j;
372
- var normalizedInput = typeof input === 'string'
373
- ? { dispatchAction: input }
374
- : (input || {});
375
- var dispatchAction = cleanText(normalizedInput.dispatchAction || ((_a = normalizedInput.directive) === null || _a === void 0 ? void 0 : _a.dispatchAction), 120);
376
- var directiveAllowed = (_b = normalizedInput.directive) === null || _b === void 0 ? void 0 : _b.allowed;
377
- var actionAutoRunnable = (_c = normalizedInput.action) === null || _c === void 0 ? void 0 : _c.autoRunnable;
378
- var productRepairAllowed = ((_d = normalizedInput.directive) === null || _d === void 0 ? void 0 : _d.canRunProductRepair) === true
379
- || ((_e = normalizedInput.directive) === null || _e === void 0 ? void 0 : _e.productRepairAllowed) === true
380
- || ((_f = normalizedInput.action) === null || _f === void 0 ? void 0 : _f.productRepairAllowed) === true;
381
- var expensiveModelAllowed = ((_g = normalizedInput.directive) === null || _g === void 0 ? void 0 : _g.canRunExpensiveModel) === true
382
- || ((_h = normalizedInput.directive) === null || _h === void 0 ? void 0 : _h.expensiveModelAllowed) === true
383
- || ((_j = normalizedInput.action) === null || _j === void 0 ? void 0 : _j.expensiveModelAllowed) === true;
384
- if (!dispatchAction || dispatchAction === 'park_manual') {
385
- return false;
386
- }
387
- if (directiveAllowed === false || actionAutoRunnable === false) {
388
- return false;
389
- }
390
- if ([
391
- 'run_evidence_probe',
392
- 'run_read_only_diagnosis',
393
- 'run_infra_repair',
394
- 'run_compile_repair'
395
- ].includes(dispatchAction)) {
396
- return true;
397
- }
398
- if (dispatchAction === 'run_release_repair') {
399
- return normalizedInput.includeReleaseRepair !== false;
400
- }
401
- if (dispatchAction === 'run_journey_contract_repair') {
402
- return normalizedInput.includeJourneyContractRepair !== false && productRepairAllowed !== true;
403
- }
404
- if (dispatchAction === 'run_business_assertion_repair') {
405
- return normalizedInput.includeBusinessProofRepair === true
406
- && productRepairAllowed !== true
407
- && expensiveModelAllowed !== true;
408
- }
409
- if (dispatchAction === 'run_targeted_product_repair') {
410
- return normalizedInput.includeProductRepair === true
411
- && productRepairAllowed === true
412
- && expensiveModelAllowed !== true;
413
- }
414
- return dispatchAction === 'advance' || dispatchAction === 'continue_gate';
415
- }
416
- function isoNow(value) {
417
- if (value instanceof Date) {
418
- return value.toISOString();
419
- }
420
- var parsed = value ? new Date(value) : new Date();
421
- if (Number.isFinite(parsed.getTime())) {
422
- return parsed.toISOString();
423
- }
424
- return new Date().toISOString();
425
- }
426
- function stableHash(prefix, value) {
427
- var normalized = typeof value === 'string'
428
- ? cleanText(value, 12000)
429
- : JSON.stringify(value || {});
430
- var hash = 0;
431
- for (var index = 0; index < normalized.length; index += 1) {
432
- hash = ((hash << 5) - hash + normalized.charCodeAt(index)) | 0;
433
- }
434
- return "".concat(prefix, "-").concat(Math.abs(hash).toString(36) || '0');
435
- }
436
- function normalizeResolveIOAIManagerFailureClass(value) {
437
- var normalized = cleanText(value, 80)
438
- .toLowerCase()
439
- .replace(/[\s-]+/g, '_');
440
- if (!normalized) {
441
- return 'unknown';
442
- }
443
- if (/^(qa_infra|infrastructure|harness|puppeteer|chrome|mongo|port|startup)$/.test(normalized)) {
444
- return 'infra';
445
- }
446
- if (/^(build|compile|typescript|tsc|angular_build|ng_build)$/.test(normalized)) {
447
- return 'compile';
448
- }
449
- if (/^(false_pass|route_only|missing_business_proof)$/.test(normalized)) {
450
- return 'business';
451
- }
452
- return normalized.slice(0, 80);
453
- }
454
- function fingerprintResolveIOAIManagerBlocker(value) {
455
- var normalized = cleanText(value, 4000)
456
- .toLowerCase()
457
- .replace(/[a-f0-9]{16,}/g, '<id>')
458
- .replace(/\b\d{2,}\b/g, '<n>')
459
- .replace(/\bline\s+<n>\b/g, 'line <n>')
460
- .replace(/https?:\/\/\S+/g, '<url>')
461
- .replace(/\s+/g, ' ')
462
- .trim();
463
- return stableHash('mgr-blocker', normalized);
464
- }
465
- function resolveResolveIOAIManagerBlockerFingerprint(record, fallback) {
466
- var blockerText = cleanText((record === null || record === void 0 ? void 0 : record.blocker) || (record === null || record === void 0 ? void 0 : record.summary), 4000);
467
- if (blockerText) {
468
- return fingerprintResolveIOAIManagerBlocker(blockerText);
469
- }
470
- var explicit = cleanText(record === null || record === void 0 ? void 0 : record.blockerFingerprint, 120);
471
- if (explicit) {
472
- return explicit;
473
- }
474
- return fingerprintResolveIOAIManagerBlocker(fallback || '');
475
- }
476
- function hashResolveIOAIManagerEvidence(record) {
477
- if (!record) {
478
- return stableHash('mgr-evidence', '');
479
- }
480
- var explicit = cleanText(record.evidenceHash, 120);
481
- if (explicit) {
482
- return explicit;
483
- }
484
- return stableHash('mgr-evidence', {
485
- failureClass: normalizeResolveIOAIManagerFailureClass(record.failureClass),
486
- blocker: cleanText(record.blocker || record.summary, 2000),
487
- changedFiles: cleanList(record.changedFiles, 80, 500).sort(),
488
- artifactPaths: cleanList(record.artifactPaths, 80, 500).sort()
489
- });
490
- }
491
- function buildResolveIOAIManagerRecoveryCheckpoint(input) {
492
- var plan = input.plan;
493
- var current = input.current || {};
494
- var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, plan.objective);
495
- var evidenceHash = hashResolveIOAIManagerEvidence(current);
496
- var changedFiles = cleanList(current.changedFiles, 80, 500);
497
- var artifactPaths = cleanList(current.artifactPaths, 80, 500);
498
- var previous = input.previousCheckpoint;
499
- var sameCheckpointBase = previous
500
- && previous.recoveryClass === plan.recoveryClass
501
- && previous.lane === plan.lane
502
- && previous.stepType === plan.stepType
503
- && previous.blockerFingerprint === blockerFingerprint
504
- && previous.evidenceHash === evidenceHash;
505
- var attempts = sameCheckpointBase ? Math.max(0, Number(previous.attempts || 0)) + 1 : 1;
506
- var status = plan.recoveryClass === 'manual_handoff'
507
- ? 'manual_handoff'
508
- : plan.recoveryClass === 'blocked_until_new_evidence'
509
- ? 'parked'
510
- : plan.recoveryClass === 'advance_after_proof'
511
- ? 'complete'
512
- : 'active';
513
- var now = isoNow(input.now);
514
- var checkpointId = stableHash('mgr-recovery', {
515
- recoveryClass: plan.recoveryClass,
516
- lane: plan.lane,
517
- stepType: plan.stepType,
518
- allowedAction: plan.allowedAction,
519
- blockerFingerprint: blockerFingerprint,
520
- evidenceHash: evidenceHash
521
- });
522
- return {
523
- checkpointId: checkpointId,
524
- recoveryClass: plan.recoveryClass,
525
- status: status,
526
- lane: plan.lane,
527
- stepType: plan.stepType,
528
- allowedAction: plan.allowedAction,
529
- productRepairAllowed: plan.productRepairAllowed,
530
- expensiveModelAllowed: plan.expensiveModelAllowed,
531
- attempts: attempts,
532
- maxAttemptsBeforePark: plan.maxAttemptsBeforePark,
533
- blockerFingerprint: blockerFingerprint,
534
- evidenceHash: evidenceHash,
535
- changedFiles: changedFiles,
536
- artifactPaths: artifactPaths,
537
- requiredEvidence: cleanList(plan.requiredEvidence, 40, 500),
538
- loopResetEvidence: cleanList(plan.loopResetEvidence, 40, 500),
539
- forbiddenActions: cleanList(plan.forbiddenActions, 40, 500),
540
- objective: cleanText(plan.objective, 1000),
541
- nextActionLabel: cleanText(plan.nextActionLabel, 160),
542
- createdAt: sameCheckpointBase && (previous === null || previous === void 0 ? void 0 : previous.createdAt) ? previous.createdAt : now,
543
- updatedAt: now
544
- };
545
- }
546
- function makeRecoveryEvidenceProbeStep(id, kind, label, objective, artifactExpectation, successSignal, options) {
547
- if (options === void 0) { options = {}; }
548
- return __assign(__assign({ id: id, kind: kind, label: label, objective: cleanText(objective, 1000), required: options.required !== false }, (options.commandHint ? { commandHint: cleanText(options.commandHint, 500) } : {})), { artifactExpectation: cleanText(artifactExpectation, 500), successSignal: cleanText(successSignal, 500) });
549
- }
550
- function recoveryEvidenceProbeStepsFor(checkpoint) {
551
- var base = [
552
- makeRecoveryEvidenceProbeStep('snapshot_current_blocker', 'rerun_same_gate', 'Snapshot Current Blocker', 'Capture the current blocker, failure class, evidence hash, changed files, and artifact paths before any new repair.', 'runner-evidence/current-blocker.json', 'Snapshot includes the same checkpointId, blockerFingerprint, and evidenceHashBefore.')
553
- ];
554
- if (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {
555
- return __spreadArray(__spreadArray([], __read(base), false), [
556
- makeRecoveryEvidenceProbeStep('collect_read_only_root_cause_evidence', 'read_only_diagnosis', 'Collect Read-Only Root-Cause Evidence', checkpoint.recoveryClass === 'diagnosis_revision'
557
- ? 'Collect new evidence that proves the current owner_files or failing_path is wrong before broadening scope.'
558
- : 'Reproduce or classify the issue and record the exact customer complaint, expected result, observed result, route/module, and account context.', 'runner-evidence/diagnosis-readonly.md', 'Evidence supports one falsifiable accepted hypothesis and at least one rejected alternative.'),
559
- makeRecoveryEvidenceProbeStep('validate_diagnosis_gate', 'read_only_diagnosis', 'Validate Diagnosis Gate', 'Validate issue_case, accepted_hypothesis, rejected_alternatives, failing_path, owner_files, and before/action/after proof_plan.', 'runner-evidence/diagnosis-gate.json', 'Diagnosis gate validates before product-code repair is allowed.')
560
- ], false);
561
- }
562
- if (checkpoint.recoveryClass === 'infra_repair') {
563
- return __spreadArray(__spreadArray([], __read(base), false), [
564
- makeRecoveryEvidenceProbeStep('run_infra_preflight', 'infra_preflight', 'Run Infra Preflight', 'Check Puppeteer/Chrome, ports, Mongo/settings, cache state, startup commands, and server/client process health.', 'runner-evidence/infra-preflight.log', 'The same infra gate either passes or returns a new infra blocker hash.', { commandHint: 'runner preflight: puppeteer/chrome/mongo/ports/startup' })
565
- ], false);
566
- }
567
- if (checkpoint.recoveryClass === 'compile_repair') {
568
- return __spreadArray(__spreadArray([], __read(base), false), [
569
- makeRecoveryEvidenceProbeStep('rerun_compile_gate', 'compile_check', 'Rerun Compile Gate', 'Rerun the same deterministic compile/build command and capture the first actionable error.', 'runner-evidence/compile.log', 'Compile passes or the first failing error changes.', { commandHint: 'same finite build/compile command from the failed gate' })
570
- ], false);
571
- }
572
- if (checkpoint.recoveryClass === 'journey_contract_repair') {
573
- return __spreadArray(__spreadArray([], __read(base), false), [
574
- makeRecoveryEvidenceProbeStep('validate_journey_contract', 'journey_validation', 'Validate Journey Contract', 'Validate docs/APP_JOURNEY_CONTRACT.md has first/next/last workflow, route/action/method mapping, seeded data story, completion states, and QA assertions.', 'runner-evidence/journey-contract-validation.json', 'Journey contract validates before build tasks continue.'),
575
- makeRecoveryEvidenceProbeStep('verify_hub_workflow_mapping', 'journey_validation', 'Verify Hub Workflow Mapping', 'Confirm the hub CTA and screen sequence implement the journey contract instead of link-only navigation.', 'runner-evidence/hub-workflow-map.json', 'Primary hub action maps to a real route/action/method/calculation and next state.')
576
- ], false);
577
- }
578
- if (checkpoint.recoveryClass === 'business_proof_repair' || checkpoint.recoveryClass === 'product_code_repair') {
579
- return __spreadArray(__spreadArray([], __read(base), false), [
580
- makeRecoveryEvidenceProbeStep('rerun_business_assertion', 'business_assertion', 'Rerun Business Assertion', 'Run the exact issue/app promise proof and capture before/action/after DOM/data evidence.', 'runner-evidence/business-assertion.json', 'Business assertion passes, or the observed failure changes with a new artifact path.'),
581
- makeRecoveryEvidenceProbeStep('check_diff_scope', 'diff_scope_check', 'Check Diff Scope', 'Compare changed files against the current diagnosis/journey owner scope before another code repair.', 'runner-evidence/diff-scope.json', 'Changed files are in scope, or diagnosis/journey scope is revised with evidence.')
582
- ], false);
583
- }
584
- if (checkpoint.recoveryClass === 'release_repair') {
585
- return __spreadArray(__spreadArray([], __read(base), false), [
586
- makeRecoveryEvidenceProbeStep('collect_release_status', 'release_status', 'Collect Release Status', 'Collect publish/deploy/build-instance/domain/CloudFront status and the last actionable deploy error.', 'runner-evidence/release-status.json', 'Release gate passes or returns a new release blocker hash without product-code repair.')
587
- ], false);
588
- }
589
- if (checkpoint.recoveryClass === 'manual_handoff') {
590
- return __spreadArray(__spreadArray([], __read(base), false), [
591
- makeRecoveryEvidenceProbeStep('operator_review_checkpoint', 'operator_review', 'Operator Review Checkpoint', 'Expose budget, blocker, evidence hash, and the minimum policy/scope change needed before another expensive loop.', 'runner-evidence/operator-review.json', 'Operator approves a new scope/policy or provides new external evidence.')
592
- ], false);
593
- }
594
- return __spreadArray(__spreadArray([], __read(base), false), [
595
- makeRecoveryEvidenceProbeStep('rerun_same_deterministic_gate', 'rerun_same_gate', 'Rerun Same Deterministic Gate', 'Rerun the exact failed check and capture new logs/artifacts without changing product code first.', 'runner-evidence/retry-gate.log', 'Gate passes, or evidenceHash/blockerFingerprint/artifactPaths change.')
596
- ], false);
597
- }
598
- function buildResolveIOAIManagerRecoveryEvidenceProbe(input) {
599
- var checkpoint = input.checkpoint;
600
- var now = isoNow(input.now);
601
- var steps = recoveryEvidenceProbeStepsFor(checkpoint);
602
- var requiredArtifacts = Array.from(new Set(steps
603
- .filter(function (step) { return step.required; })
604
- .map(function (step) { return step.artifactExpectation; })
605
- .filter(Boolean)));
606
- return {
607
- probeId: stableHash('mgr-probe', {
608
- checkpointId: checkpoint.checkpointId,
609
- recoveryClass: checkpoint.recoveryClass,
610
- evidenceHash: checkpoint.evidenceHash,
611
- blockerFingerprint: checkpoint.blockerFingerprint
612
- }),
613
- checkpointId: checkpoint.checkpointId,
614
- recoveryClass: checkpoint.recoveryClass,
615
- lane: checkpoint.lane,
616
- stepType: checkpoint.stepType,
617
- objective: checkpoint.status === 'parked'
618
- ? 'Collect new evidence before any additional expensive model/code repair.'
619
- : cleanText(checkpoint.objective, 1000),
620
- evidenceOnly: checkpoint.status === 'parked'
621
- || checkpoint.recoveryClass === 'diagnosis_only'
622
- || checkpoint.recoveryClass === 'diagnosis_revision'
623
- || checkpoint.recoveryClass === 'infra_repair'
624
- || checkpoint.recoveryClass === 'compile_repair'
625
- || checkpoint.recoveryClass === 'release_repair',
626
- productRepairAllowed: checkpoint.productRepairAllowed && checkpoint.status !== 'parked',
627
- expensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked',
628
- evidenceHashBefore: checkpoint.evidenceHash,
629
- blockerFingerprint: checkpoint.blockerFingerprint,
630
- steps: steps,
631
- requiredArtifacts: requiredArtifacts,
632
- acceptanceEvidence: Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(checkpoint.requiredEvidence), false), __read(checkpoint.loopResetEvidence), false), __read(steps.map(function (step) { return step.successSignal; })), false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30),
633
- stopConditions: Array.from(new Set(__spreadArray(__spreadArray([], __read(checkpoint.forbiddenActions), false), [
634
- 'no new evidence hash',
635
- 'no new artifact path',
636
- 'product-code repair requested while evidenceOnly is true'
637
- ], false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30),
638
- loopResetEvidence: checkpoint.loopResetEvidence,
639
- createdAt: now
640
- };
641
- }
642
- function recoveryAutomationModeFor(checkpoint) {
643
- if (checkpoint.status === 'manual_handoff' || checkpoint.recoveryClass === 'manual_handoff') {
644
- return 'manual_review';
645
- }
646
- if (checkpoint.status === 'complete' || checkpoint.recoveryClass === 'advance_after_proof') {
647
- return 'advance';
648
- }
649
- if (checkpoint.status === 'parked' || checkpoint.recoveryClass === 'blocked_until_new_evidence') {
650
- return 'collect_evidence';
651
- }
652
- if (checkpoint.recoveryClass === 'diagnosis_only' || checkpoint.recoveryClass === 'diagnosis_revision') {
653
- return 'read_only_diagnosis';
654
- }
655
- if (checkpoint.recoveryClass === 'infra_repair') {
656
- return 'repair_infra';
657
- }
658
- if (checkpoint.recoveryClass === 'compile_repair') {
659
- return 'repair_compile';
660
- }
661
- if (checkpoint.recoveryClass === 'journey_contract_repair') {
662
- return 'repair_journey_contract';
663
- }
664
- if (checkpoint.recoveryClass === 'business_proof_repair') {
665
- return 'repair_business_assertion';
666
- }
667
- if (checkpoint.recoveryClass === 'release_repair') {
668
- return 'repair_release';
669
- }
670
- if (checkpoint.recoveryClass === 'product_code_repair') {
671
- return 'targeted_product_repair';
672
- }
673
- return 'continue_gate';
674
- }
675
- function recoveryActionLabelFor(mode, checkpoint) {
676
- var explicit = cleanText(checkpoint.nextActionLabel, 120);
677
- if (explicit && mode !== 'collect_evidence') {
678
- return explicit;
679
- }
680
- var labels = {
681
- advance: 'Advance To Next Gate',
682
- collect_evidence: 'Collect New Evidence',
683
- read_only_diagnosis: 'Run Diagnosis Evidence Pass',
684
- repair_infra: 'Repair Infra Gate',
685
- repair_compile: 'Repair Compile Gate',
686
- repair_journey_contract: 'Repair Journey Contract',
687
- repair_business_assertion: 'Repair Business Proof',
688
- repair_release: 'Repair Release Gate',
689
- targeted_product_repair: 'Run Targeted Repair',
690
- manual_review: 'Manual Review',
691
- continue_gate: 'Continue Current Gate'
692
- };
693
- return labels[mode];
694
- }
695
- function recoveryActionAutoRunnable(mode, probe) {
696
- if (mode === 'manual_review') {
697
- return false;
698
- }
699
- if (mode === 'advance' || mode === 'continue_gate') {
700
- return true;
701
- }
702
- if (mode === 'targeted_product_repair' || mode === 'read_only_diagnosis' || mode === 'repair_journey_contract' || mode === 'repair_business_assertion') {
703
- return true;
704
- }
705
- return probe.steps.some(function (step) { return step.commandHint || step.kind === 'rerun_same_gate' || step.kind === 'release_status' || step.kind === 'diff_scope_check'; });
706
- }
707
- function buildResolveIOAIManagerRecoveryActionPacket(input) {
708
- var checkpoint = input.checkpoint;
709
- var probe = input.probe || buildResolveIOAIManagerRecoveryEvidenceProbe({
710
- checkpoint: checkpoint,
711
- current: input.current,
712
- now: input.now
713
- });
714
- var mode = recoveryAutomationModeFor(checkpoint);
715
- var primaryStep = probe.steps.find(function (step) { return step.required && step.id !== 'snapshot_current_blocker'; })
716
- || probe.steps.find(function (step) { return step.required; })
717
- || probe.steps[0];
718
- var evidenceOnly = probe.evidenceOnly || mode === 'collect_evidence' || mode === 'repair_infra' || mode === 'repair_compile' || mode === 'repair_release';
719
- var requireNewEvidence = mode === 'collect_evidence'
720
- || checkpoint.status === 'parked'
721
- || checkpoint.attempts >= checkpoint.maxAttemptsBeforePark;
722
- var stopWhen = Array.from(new Set(__spreadArray(__spreadArray([], __read(probe.stopConditions), false), __read((requireNewEvidence ? ['same blocker fingerprint and same evidence hash after probe'] : [])), false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30);
723
- var resetLoopWhen = Array.from(new Set(__spreadArray(__spreadArray(__spreadArray([], __read(checkpoint.loopResetEvidence), false), __read(probe.loopResetEvidence), false), __read((requireNewEvidence ? [
724
- 'new material evidence: changed blocker, validated diagnosis/journey, business proof, compile/infra/release proof, or new actionable trace',
725
- 'weak hash-only evidence does not reset the loop'
726
- ] : [])), false).map(function (entry) { return cleanText(entry, 500); }).filter(Boolean))).slice(0, 30);
727
- var nextCommands = probe.steps
728
- .map(function (step) { return cleanText(step.commandHint || "".concat(step.kind, ":").concat(step.id), 500); })
729
- .filter(Boolean)
730
- .slice(0, 12);
731
- var releasePolicy = mode === 'repair_release'
732
- ? buildResolveIOAIManagerHotfixFirstReleasePolicy({
733
- surface: 'manager_recovery',
734
- deployStatus: checkpoint.stepType,
735
- publishStatus: checkpoint.lane
736
- })
737
- : undefined;
738
- var now = isoNow(input.now);
739
- return __assign(__assign(__assign({ actionId: stableHash('mgr-action', {
740
- checkpointId: checkpoint.checkpointId,
741
- probeId: probe.probeId,
742
- mode: mode,
743
- evidenceHash: checkpoint.evidenceHash,
744
- blockerFingerprint: checkpoint.blockerFingerprint
745
- }), checkpointId: checkpoint.checkpointId, probeId: probe.probeId, recoveryClass: checkpoint.recoveryClass, mode: mode, label: recoveryActionLabelFor(mode, checkpoint), lane: checkpoint.lane, stepType: checkpoint.stepType, primaryStepKind: (primaryStep === null || primaryStep === void 0 ? void 0 : primaryStep.kind) || 'none', objective: mode === 'collect_evidence'
746
- ? probe.objective
747
- : cleanText(checkpoint.objective || probe.objective, 1000), evidenceOnly: evidenceOnly, autoRunnable: recoveryActionAutoRunnable(mode, probe), productRepairAllowed: checkpoint.productRepairAllowed && !evidenceOnly && checkpoint.status !== 'parked', expensiveModelAllowed: checkpoint.expensiveModelAllowed && checkpoint.status !== 'parked', canResetLoopAfterEvidence: resetLoopWhen.length > 0, maxAttemptsBeforePark: checkpoint.maxAttemptsBeforePark, requiredArtifacts: probe.requiredArtifacts.slice(0, 20), nextCommands: releasePolicy
748
- ? Array.from(new Set(__spreadArray(__spreadArray([], __read(nextCommands), false), __read(releasePolicy.allowedActions), false))).slice(0, 12)
749
- : nextCommands, successCriteria: releasePolicy
750
- ? Array.from(new Set(__spreadArray(__spreadArray([], __read(probe.acceptanceEvidence), false), __read(releasePolicy.requiredEvidence), false))).slice(0, 20)
751
- : probe.acceptanceEvidence.slice(0, 20), retryPolicy: {
752
- allowImmediateRetry: checkpoint.status !== 'parked' && mode !== 'manual_review',
753
- requireNewEvidence: requireNewEvidence,
754
- resetLoopWhen: resetLoopWhen,
755
- stopWhen: stopWhen
756
- } }, (releasePolicy ? { releasePolicy: releasePolicy } : {})), (mode === 'collect_evidence' ? { blockedReason: 'Manager parked this loop until the recovery action records new evidence.' } : {})), { createdAt: now });
757
- }
758
- function dispatchActionForMode(mode) {
759
- var map = {
760
- advance: 'advance',
761
- collect_evidence: 'run_evidence_probe',
762
- read_only_diagnosis: 'run_read_only_diagnosis',
763
- repair_infra: 'run_infra_repair',
764
- repair_compile: 'run_compile_repair',
765
- repair_journey_contract: 'run_journey_contract_repair',
766
- repair_business_assertion: 'run_business_assertion_repair',
767
- repair_release: 'run_release_repair',
768
- targeted_product_repair: 'run_targeted_product_repair',
769
- manual_review: 'park_manual',
770
- continue_gate: 'continue_gate'
771
- };
772
- return map[mode] || 'park_manual';
773
- }
774
- function buildRecoveryDispatchRecord(action, dispatchAction, status, reason, current, now) {
775
- var evidenceHash = (current === null || current === void 0 ? void 0 : current.evidenceHash) || action.checkpointId || action.actionId;
776
- var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);
777
- var artifactPaths = cleanList(current === null || current === void 0 ? void 0 : current.artifactPaths, 20, 500);
778
- var createdAt = isoNow(now);
779
- return __assign(__assign(__assign({ dispatchId: stableHash('mgr-dispatch', {
780
- actionId: action.actionId,
781
- dispatchAction: dispatchAction,
782
- evidenceHash: evidenceHash,
783
- blockerFingerprint: blockerFingerprint,
784
- status: status
785
- }), actionId: action.actionId, checkpointId: action.checkpointId, probeId: action.probeId, mode: action.mode, dispatchAction: dispatchAction, status: status, evidenceHash: evidenceHash, blockerFingerprint: blockerFingerprint, productRepairAllowed: action.productRepairAllowed && dispatchAction === 'run_targeted_product_repair', expensiveModelAllowed: action.expensiveModelAllowed && dispatchAction !== 'run_evidence_probe', reason: reason, artifactPaths: artifactPaths }, (status === 'started' ? { startedAt: createdAt } : {})), (status === 'completed' ? { completedAt: createdAt } : {})), { createdAt: createdAt });
786
- }
787
- function decideResolveIOAIManagerRecoveryActionDispatch(input) {
788
- var action = input.action;
789
- var history = Array.isArray(input.history) ? input.history.filter(Boolean).slice(-50) : [];
790
- var current = input.current || {};
791
- if (!action) {
792
- return {
793
- dispatchAction: 'park_manual',
794
- allowed: false,
795
- reason: 'recovery_dispatch_missing_action',
796
- status: 'parked',
797
- canRunProductRepair: false,
798
- canRunExpensiveModel: false,
799
- shouldRecordDispatch: false,
800
- requiresNewEvidence: true,
801
- newEvidence: false
802
- };
803
- }
804
- var dispatchAction = dispatchActionForMode(action.mode);
805
- var evidenceHash = current.evidenceHash || action.checkpointId || action.actionId;
806
- var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current, action.objective);
807
- var sameActionHistory = history.filter(function (entry) { return entry.actionId === action.actionId; });
808
- var sameEvidenceHistory = sameActionHistory.filter(function (entry) { return entry.evidenceHash === evidenceHash
809
- && entry.blockerFingerprint === blockerFingerprint; });
810
- var activeDispatch = sameEvidenceHistory.find(function (entry) { return entry.status === 'queued' || entry.status === 'started'; });
811
- var completedDispatch = sameEvidenceHistory.find(function (entry) { return entry.status === 'completed' || entry.status === 'failed'; });
812
- var newEvidence = sameActionHistory.length > 0 && sameEvidenceHistory.length === 0;
813
- var requiresNewEvidence = action.retryPolicy.requireNewEvidence === true;
814
- var manualOnly = action.mode === 'manual_review' || !action.autoRunnable;
815
- var productDispatch = dispatchAction === 'run_targeted_product_repair';
816
- var expensiveDispatch = !['run_evidence_probe', 'advance', 'continue_gate', 'park_manual'].includes(dispatchAction);
817
- if (manualOnly && input.operatorApproved !== true) {
818
- var record_1 = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_requires_manual_review', current, input.now);
819
- return {
820
- dispatchAction: 'park_manual',
821
- allowed: false,
822
- reason: record_1.reason,
823
- status: 'parked',
824
- canRunProductRepair: false,
825
- canRunExpensiveModel: false,
826
- shouldRecordDispatch: true,
827
- requiresNewEvidence: requiresNewEvidence,
828
- newEvidence: newEvidence,
829
- dispatchRecord: record_1
830
- };
831
- }
832
- if (productDispatch && action.productRepairAllowed !== true) {
833
- var record_2 = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_product_repair_not_allowed', current, input.now);
834
- return {
835
- dispatchAction: 'park_manual',
836
- allowed: false,
837
- reason: record_2.reason,
838
- status: 'parked',
839
- canRunProductRepair: false,
840
- canRunExpensiveModel: false,
841
- shouldRecordDispatch: true,
842
- requiresNewEvidence: true,
843
- newEvidence: newEvidence,
844
- dispatchRecord: record_2
845
- };
846
- }
847
- if (activeDispatch) {
848
- return {
849
- dispatchAction: 'park_manual',
850
- allowed: false,
851
- reason: 'recovery_dispatch_already_running_for_same_evidence',
852
- status: 'parked',
853
- canRunProductRepair: false,
854
- canRunExpensiveModel: false,
855
- shouldRecordDispatch: false,
856
- requiresNewEvidence: true,
857
- newEvidence: false
858
- };
859
- }
860
- if (completedDispatch && requiresNewEvidence && !newEvidence) {
861
- var record_3 = buildRecoveryDispatchRecord(action, 'park_manual', 'parked', 'recovery_dispatch_same_evidence_already_attempted', current, input.now);
862
- return {
863
- dispatchAction: 'park_manual',
864
- allowed: false,
865
- reason: record_3.reason,
866
- status: 'parked',
867
- canRunProductRepair: false,
868
- canRunExpensiveModel: false,
869
- shouldRecordDispatch: true,
870
- requiresNewEvidence: true,
871
- newEvidence: false,
872
- dispatchRecord: record_3
873
- };
874
- }
875
- var status = dispatchAction === 'advance' || dispatchAction === 'continue_gate'
876
- ? 'completed'
877
- : 'started';
878
- var record = buildRecoveryDispatchRecord(action, dispatchAction, status, 'recovery_dispatch_allowed', current, input.now);
879
- return {
880
- dispatchAction: dispatchAction,
881
- allowed: true,
882
- reason: 'recovery_dispatch_allowed',
883
- status: status,
884
- canRunProductRepair: productDispatch && action.productRepairAllowed === true,
885
- canRunExpensiveModel: expensiveDispatch && action.expensiveModelAllowed === true,
886
- shouldRecordDispatch: true,
887
- requiresNewEvidence: requiresNewEvidence,
888
- newEvidence: newEvidence,
889
- dispatchRecord: record
890
- };
891
- }
892
- function appendResolveIOAIManagerRecoveryActionDispatch(history, record, limit) {
893
- if (limit === void 0) { limit = 50; }
894
- var existing = Array.isArray(history) ? history.filter(Boolean) : [];
895
- if (!record) {
896
- return existing.slice(-limit);
897
- }
898
- var deduped = existing.filter(function (entry) { return entry.dispatchId !== record.dispatchId; });
899
- return __spreadArray(__spreadArray([], __read(deduped), false), [record], false).slice(-limit);
900
- }
901
- function recoveryExecutionPhaseForDispatch(dispatchAction) {
902
- var map = {
903
- run_evidence_probe: 'evidence',
904
- run_read_only_diagnosis: 'diagnosis',
905
- run_infra_repair: 'infra',
906
- run_compile_repair: 'compile',
907
- run_journey_contract_repair: 'journey',
908
- run_business_assertion_repair: 'business_proof',
909
- run_release_repair: 'release',
910
- run_targeted_product_repair: 'product_repair',
911
- advance: 'advance',
912
- continue_gate: 'advance',
913
- park_manual: 'manual'
914
- };
915
- return map[dispatchAction] || 'manual';
916
- }
917
- function recoveryDirectiveReason(action, decision, current) {
918
- var blocker = cleanText((current === null || current === void 0 ? void 0 : current.blocker) || (current === null || current === void 0 ? void 0 : current.summary) || '', 260);
919
- var label = cleanText(action === null || action === void 0 ? void 0 : action.label, 120) || decision.dispatchAction;
920
- var objective = cleanText(action === null || action === void 0 ? void 0 : action.objective, 260);
921
- return [
922
- "MANAGER_RECOVERY:".concat(decision.dispatchAction),
923
- "label=".concat(label),
924
- decision.reason ? "reason=".concat(decision.reason) : '',
925
- blocker ? "blocker=".concat(blocker) : '',
926
- objective ? "objective=".concat(objective) : ''
927
- ].filter(Boolean).join(' | ');
928
- }
929
- function buildResolveIOAIManagerRecoveryExecutionDirective(input) {
930
- var _a, _b, _c, _d, _e;
931
- var action = input.action;
932
- var dispatchDecision = input.dispatchDecision || decideResolveIOAIManagerRecoveryActionDispatch({
933
- action: action,
934
- current: input.current,
935
- now: input.now
936
- });
937
- var dispatchAction = dispatchDecision.dispatchAction;
938
- var now = isoNow(input.now);
939
- var phase = recoveryExecutionPhaseForDispatch(dispatchAction);
940
- var lane = cleanText((action === null || action === void 0 ? void 0 : action.lane) || ((_a = input.current) === null || _a === void 0 ? void 0 : _a.lane) || '', 120);
941
- var stepType = cleanText((action === null || action === void 0 ? void 0 : action.stepType) || ((_b = input.current) === null || _b === void 0 ? void 0 : _b.stepType) || '', 120);
942
- var rerunReason = recoveryDirectiveReason(action, dispatchDecision, input.current);
943
- var surface = cleanText(input.surface || 'runner', 120);
944
- return __assign(__assign(__assign({ directiveId: stableHash('mgr-directive', {
945
- surface: surface,
946
- actionId: (action === null || action === void 0 ? void 0 : action.actionId) || '',
947
- dispatchAction: dispatchAction,
948
- reason: dispatchDecision.reason,
949
- evidenceHash: ((_c = dispatchDecision.dispatchRecord) === null || _c === void 0 ? void 0 : _c.evidenceHash) || ((_d = input.current) === null || _d === void 0 ? void 0 : _d.evidenceHash) || ''
950
- }), surface: surface, dispatchAction: dispatchAction, phase: phase, allowed: dispatchDecision.allowed, status: dispatchDecision.status, reason: dispatchDecision.reason, lane: lane, stepType: stepType, nextActionLabel: cleanText(action === null || action === void 0 ? void 0 : action.label, 160) || dispatchAction, rerunReason: rerunReason, evidenceOnly: (action === null || action === void 0 ? void 0 : action.evidenceOnly) !== false || dispatchAction === 'run_evidence_probe', autoRunnable: (action === null || action === void 0 ? void 0 : action.autoRunnable) === true, productRepairAllowed: (action === null || action === void 0 ? void 0 : action.productRepairAllowed) === true, expensiveModelAllowed: (action === null || action === void 0 ? void 0 : action.expensiveModelAllowed) === true, canRunProductRepair: dispatchDecision.canRunProductRepair, canRunExpensiveModel: dispatchDecision.canRunExpensiveModel, canResetLoopAfterEvidence: (action === null || action === void 0 ? void 0 : action.canResetLoopAfterEvidence) === true, requiresNewEvidence: dispatchDecision.requiresNewEvidence, newEvidence: dispatchDecision.newEvidence, maxAttemptsBeforePark: Math.max(1, Number((action === null || action === void 0 ? void 0 : action.maxAttemptsBeforePark) || 1) || 1), requiredArtifacts: cleanList(action === null || action === void 0 ? void 0 : action.requiredArtifacts, 20, 500), nextCommands: cleanList(action === null || action === void 0 ? void 0 : action.nextCommands, 20, 500), successCriteria: cleanList(action === null || action === void 0 ? void 0 : action.successCriteria, 20, 500), forbiddenActions: (action === null || action === void 0 ? void 0 : action.productRepairAllowed) === true
951
- ? []
952
- : Array.from(new Set(__spreadArray([
953
- 'Do not run product-code repair from this directive unless canRunProductRepair is true.'
954
- ], __read((((_e = action === null || action === void 0 ? void 0 : action.releasePolicy) === null || _e === void 0 ? void 0 : _e.forbiddenActions) || [])), false))).slice(0, 20) }, (dispatchDecision.dispatchRecord ? { dispatchRecord: dispatchDecision.dispatchRecord } : {})), ((action === null || action === void 0 ? void 0 : action.releasePolicy) ? { releasePolicy: action.releasePolicy } : {})), { createdAt: now });
955
- }
956
- function newListEntries(current, previous) {
957
- var existing = new Set(previous.map(function (entry) { return cleanText(entry, 500); }).filter(Boolean));
958
- return current
959
- .map(function (entry) { return cleanText(entry, 500); })
960
- .filter(function (entry) { return entry && !existing.has(entry); });
961
- }
962
- function recordLane(value) {
963
- return cleanText(value === null || value === void 0 ? void 0 : value.lane, 80);
964
- }
965
- function recordStepType(value) {
966
- return cleanText(value === null || value === void 0 ? void 0 : value.stepType, 80);
967
- }
968
- function recordFailureClass(value) {
969
- var valueText = cleanText(value === null || value === void 0 ? void 0 : value.failureClass, 80);
970
- return valueText ? normalizeResolveIOAIManagerFailureClass(valueText) : '';
971
- }
972
- function materialEvidenceText(record, paths) {
973
- if (paths === void 0) { paths = []; }
974
- return __spreadArray([
975
- cleanText(record === null || record === void 0 ? void 0 : record.blocker, 1200),
976
- cleanText(record === null || record === void 0 ? void 0 : record.summary, 1200)
977
- ], __read(paths.map(function (path) { return cleanText(path, 500); })), false).filter(Boolean).join(' ').toLowerCase();
978
- }
979
- function hasMaterialEvidenceLanguage(text) {
980
- return /(business|assertion|proof|before|after|dom|trace|stack|network|mongo|query|diff|scope|diagnosis|journey|contract|workflow|compile|build|preflight|infra|chrome|puppeteer|release|publish|deploy|sample|seed|route|auth|hydration|performance|slow|owner|root.?cause|repro|pdf|export|upload|import|filter|invoice|saved|calculated|comparison|report)/i.test(text);
981
- }
982
- function assessResolveIOAIManagerEvidenceChange(previous, current, fallbackObjective) {
983
- var currentRecord = current || {};
984
- var previousRecord = previous;
985
- var previousEvidenceHash = previousRecord ? cleanText(previousRecord.evidenceHash, 160) || hashResolveIOAIManagerEvidence(previousRecord) : '';
986
- var currentEvidenceHash = hashResolveIOAIManagerEvidence(currentRecord);
987
- var previousBlockerFingerprint = previousRecord
988
- ? cleanText(previousRecord.blockerFingerprint, 160) || resolveResolveIOAIManagerBlockerFingerprint(previousRecord, fallbackObjective)
989
- : '';
990
- var currentBlockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(currentRecord, fallbackObjective);
991
- var previousChangedFiles = cleanList(previousRecord === null || previousRecord === void 0 ? void 0 : previousRecord.changedFiles, 80, 500);
992
- var currentChangedFiles = cleanList(currentRecord.changedFiles, 80, 500);
993
- var previousArtifactPaths = cleanList(previousRecord === null || previousRecord === void 0 ? void 0 : previousRecord.artifactPaths, 80, 500);
994
- var currentArtifactPaths = cleanList(currentRecord.artifactPaths, 80, 500);
995
- var addedChangedFiles = newListEntries(currentChangedFiles, previousChangedFiles);
996
- var addedArtifactPaths = newListEntries(currentArtifactPaths, previousArtifactPaths);
997
- var signals = [];
998
- if (previousEvidenceHash && currentEvidenceHash !== previousEvidenceHash) {
999
- signals.push('evidence_hash_changed');
1000
- }
1001
- if (previousBlockerFingerprint && currentBlockerFingerprint !== previousBlockerFingerprint) {
1002
- signals.push('blocker_fingerprint_changed');
1003
- }
1004
- if (recordLane(previousRecord) && recordLane(previousRecord) !== recordLane(currentRecord)) {
1005
- signals.push('lane_changed');
1006
- }
1007
- if (recordStepType(previousRecord) && recordStepType(previousRecord) !== recordStepType(currentRecord)) {
1008
- signals.push('step_type_changed');
1009
- }
1010
- if (recordFailureClass(previousRecord) && recordFailureClass(previousRecord) !== recordFailureClass(currentRecord)) {
1011
- signals.push('failure_class_changed');
1012
- }
1013
- if (addedChangedFiles.length) {
1014
- signals.push('changed_files_added');
1015
- }
1016
- if (addedArtifactPaths.length) {
1017
- signals.push('artifact_paths_added');
1018
- }
1019
- if (isPassingOutcome(currentRecord)) {
1020
- signals.push('passing_outcome');
1021
- }
1022
- var changed = signals.length > 0;
1023
- var evidenceText = materialEvidenceText(currentRecord, addedArtifactPaths);
1024
- var pathOrSummaryHasMaterialSignal = hasMaterialEvidenceLanguage(evidenceText);
1025
- var proof = signals.includes('passing_outcome');
1026
- var structuralChange = signals.some(function (signal) { return /blocker_fingerprint_changed|lane_changed|step_type_changed|failure_class_changed/.test(signal); });
1027
- var materialArtifact = addedArtifactPaths.length > 0 && pathOrSummaryHasMaterialSignal;
1028
- var materialChangedFiles = addedChangedFiles.length > 0
1029
- && /diagnosis|owner|scope|diff|root.?cause|failing path|stack|trace|business|proof|compile|release|deploy|workflow|journey/i.test(evidenceText);
1030
- var material = proof || structuralChange || materialArtifact || materialChangedFiles;
1031
- var strength = proof
1032
- ? 'proof'
1033
- : material
1034
- ? 'material'
1035
- : changed
1036
- ? 'weak'
1037
- : 'none';
1038
- return {
1039
- changed: changed,
1040
- material: material,
1041
- strength: strength,
1042
- signals: signals,
1043
- evidenceHash: currentEvidenceHash,
1044
- blockerFingerprint: currentBlockerFingerprint
1045
- };
1046
- }
1047
- function proposedActionIsProductRepair(value) {
1048
- var normalized = cleanText(value, 120);
1049
- return /product|code|repair|build|business|journey|workflow/i.test(normalized)
1050
- && !/infra|compile|diagnosis|manual|evidence|release|publish/i.test(normalized);
1051
- }
1052
- function decideResolveIOAIManagerRecoveryGate(input) {
1053
- var checkpoint = input.checkpoint;
1054
- var hasCurrent = !!input.current;
1055
- var current = input.current || {};
1056
- var assessment = hasCurrent
1057
- ? assessResolveIOAIManagerEvidenceChange(checkpoint, current, checkpoint.objective)
1058
- : {
1059
- changed: false,
1060
- material: false,
1061
- strength: 'none',
1062
- signals: [],
1063
- evidenceHash: checkpoint.evidenceHash,
1064
- blockerFingerprint: checkpoint.blockerFingerprint
1065
- };
1066
- var blockerFingerprint = assessment.blockerFingerprint;
1067
- var evidenceHash = assessment.evidenceHash;
1068
- var changedFiles = hasCurrent ? cleanList(current.changedFiles, 80, 500) : checkpoint.changedFiles;
1069
- var artifactPaths = hasCurrent ? cleanList(current.artifactPaths, 80, 500) : checkpoint.artifactPaths;
1070
- var evidenceChanged = assessment.changed;
1071
- var proposedAction = cleanText(input.proposedAction || checkpoint.allowedAction, 120);
1072
- var productRepairRequested = proposedActionIsProductRepair(proposedAction);
1073
- var missingEvidence = checkpoint.requiredEvidence.filter(function (required) {
1074
- var normalized = cleanText(required, 120).toLowerCase();
1075
- if (!normalized) {
1076
- return false;
1077
- }
1078
- if (/artifact|log|proof|gate|evidence/.test(normalized)) {
1079
- return !artifactPaths.length && !current.evidenceHash;
1080
- }
1081
- if (/diff|changed files|owner|scope|file/.test(normalized)) {
1082
- return !changedFiles.length;
1083
- }
1084
- return false;
1085
- });
1086
- var makeDecision = function (action, reason, overrides) {
1087
- if (overrides === void 0) { overrides = {}; }
1088
- return (__assign({ action: action, reason: reason, canRunProductRepair: checkpoint.productRepairAllowed, canRunExpensiveModel: checkpoint.expensiveModelAllowed, shouldResetLoopBudget: false, shouldIncrementAttempt: action === 'allow', newEvidence: evidenceChanged, materialEvidence: assessment.material, evidenceStrength: assessment.strength, evidenceSignals: assessment.signals, blockerFingerprint: blockerFingerprint, evidenceHash: evidenceHash, missingEvidence: missingEvidence, checkpoint: __assign(__assign({}, checkpoint), { updatedAt: isoNow(input.now) }) }, overrides));
1089
- };
1090
- if (checkpoint.status === 'complete') {
1091
- return makeDecision('complete', 'recovery_gate_checkpoint_already_complete', {
1092
- canRunProductRepair: false,
1093
- canRunExpensiveModel: false,
1094
- shouldIncrementAttempt: false
1095
- });
1096
- }
1097
- if (checkpoint.status === 'manual_handoff' && input.operatorApproved !== true) {
1098
- return makeDecision('manual_handoff', 'recovery_gate_manual_handoff_requires_operator_approval', {
1099
- canRunProductRepair: false,
1100
- canRunExpensiveModel: false,
1101
- shouldIncrementAttempt: false
1102
- });
1103
- }
1104
- if (productRepairRequested && !checkpoint.productRepairAllowed) {
1105
- return makeDecision('reject_action', 'recovery_gate_product_repair_not_allowed_for_checkpoint', {
1106
- canRunProductRepair: false,
1107
- canRunExpensiveModel: false,
1108
- shouldIncrementAttempt: false
1109
- });
1110
- }
1111
- if (checkpoint.status === 'parked' && !evidenceChanged) {
1112
- return makeDecision('collect_new_evidence', 'recovery_gate_parked_until_new_evidence', {
1113
- canRunProductRepair: false,
1114
- canRunExpensiveModel: false,
1115
- shouldIncrementAttempt: false
1116
- });
1117
- }
1118
- if (checkpoint.status === 'parked' && evidenceChanged && !assessment.material) {
1119
- return makeDecision('collect_new_evidence', 'recovery_gate_weak_evidence_requires_material_signal', {
1120
- canRunProductRepair: false,
1121
- canRunExpensiveModel: false,
1122
- shouldIncrementAttempt: false
1123
- });
1124
- }
1125
- if (checkpoint.attempts >= checkpoint.maxAttemptsBeforePark && !evidenceChanged) {
1126
- return makeDecision('collect_new_evidence', 'recovery_gate_attempt_limit_requires_new_evidence', {
1127
- canRunProductRepair: false,
1128
- canRunExpensiveModel: false,
1129
- shouldIncrementAttempt: false
1130
- });
1131
- }
1132
- if (checkpoint.attempts >= checkpoint.maxAttemptsBeforePark && evidenceChanged && !assessment.material) {
1133
- return makeDecision('collect_new_evidence', 'recovery_gate_attempt_limit_requires_material_evidence', {
1134
- canRunProductRepair: false,
1135
- canRunExpensiveModel: false,
1136
- shouldIncrementAttempt: false
1137
- });
1138
- }
1139
- if (evidenceChanged) {
1140
- var currentFailureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);
1141
- var currentCanRunProductRepair = checkpoint.productRepairAllowed
1142
- || !/^(infra|compile|diagnosis|release)$/i.test(currentFailureClass);
1143
- return makeDecision('allow', 'recovery_gate_new_material_evidence_unblocks_retry', {
1144
- canRunProductRepair: currentCanRunProductRepair,
1145
- canRunExpensiveModel: checkpoint.expensiveModelAllowed || currentCanRunProductRepair,
1146
- shouldResetLoopBudget: true
1147
- });
1148
- }
1149
- return makeDecision('allow', 'recovery_gate_action_allowed');
1150
- }
1151
- function failureKey(record) {
1152
- if (!record) {
1153
- return '';
1154
- }
1155
- var failureClass = normalizeResolveIOAIManagerFailureClass(record.failureClass);
1156
- var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(record);
1157
- return "".concat(cleanText(record.lane, 80), ":").concat(cleanText(record.stepType, 80), ":").concat(failureClass, ":").concat(blockerFingerprint);
1158
- }
1159
- function failureEvidenceKey(record) {
1160
- return "".concat(failureKey(record), ":").concat(hashResolveIOAIManagerEvidence(record));
1161
- }
1162
- function isPassingOutcome(record) {
1163
- return /^(pass|accepted|ready_to_publish|published|ready_for_merge|complete|completed)$/i.test(cleanText(record === null || record === void 0 ? void 0 : record.outcome, 80));
1164
- }
1165
- function isManualOutcome(record) {
1166
- return /^(manual_handoff|park_manual|stopped)$/i.test(cleanText(record === null || record === void 0 ? void 0 : record.outcome, 80));
1167
- }
1168
- function buildResolveIOAIManagerRecoveryPlan(input) {
1169
- if (input === void 0) { input = {}; }
1170
- var action = cleanText(input.action, 80) || 'continue';
1171
- var reason = cleanText(input.reason, 240);
1172
- var failureClass = normalizeResolveIOAIManagerFailureClass(input.failureClass);
1173
- var lane = cleanText(input.lane, 80) || 'supervisor';
1174
- var stepType = cleanText(input.stepType, 80) || 'unknown';
1175
- var blocker = cleanText(input.blocker, 700);
1176
- var changedFiles = cleanList(input.changedFiles, 12, 240);
1177
- var artifactPaths = cleanList(input.artifactPaths, 12, 240);
1178
- var maxAttemptsBeforePark = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);
1179
- var commonNotes = [
1180
- reason ? "policy_reason=".concat(reason) : '',
1181
- blocker ? "blocker=".concat(blocker) : '',
1182
- changedFiles.length ? "changed_files=".concat(changedFiles.join(', ')) : '',
1183
- artifactPaths.length ? "artifacts=".concat(artifactPaths.join(', ')) : ''
1184
- ].filter(Boolean);
1185
- var base = {
1186
- lane: lane,
1187
- stepType: stepType,
1188
- maxAttemptsBeforePark: maxAttemptsBeforePark,
1189
- notes: commonNotes
1190
- };
1191
- var makePlan = function (recoveryClass, nextActionLabel, objective, allowedAction, productRepairAllowed, expensiveModelAllowed, finiteSteps, requiredEvidence, loopResetEvidence, forbiddenActions) { return (__assign(__assign({}, base), { recoveryClass: recoveryClass, nextActionLabel: nextActionLabel, objective: objective, allowedAction: allowedAction, productRepairAllowed: productRepairAllowed, expensiveModelAllowed: expensiveModelAllowed, finiteSteps: finiteSteps, requiredEvidence: requiredEvidence, loopResetEvidence: loopResetEvidence, forbiddenActions: forbiddenActions })); };
1192
- if (action === 'reset_loop_budget') {
1193
- return makePlan('advance_after_proof', 'Advance After Proof', 'Checkpoint the passing evidence and move to the next required gate.', 'advance_to_next_gate', false, false, [
1194
- 'Record the passing artifact, changed files, and gate result.',
1195
- 'Reset the loop counter because a real gate passed.',
1196
- 'Select the next unmet deterministic gate instead of repeating the previous repair.'
1197
- ], ['passing gate record', 'artifact or log proving the passed check'], ['new passing gate result', 'new business proof artifact'], ['rerun the same repair after a pass', 'mark accepted without the required downstream gate']);
1198
- }
1199
- if (action === 'manual_handoff') {
1200
- return makePlan('manual_handoff', 'Manual Review', 'Stop autonomous repair and expose the blocker, evidence, and last safe state.', 'manual_review_only', false, false, [
1201
- 'Freeze further product-code edits.',
1202
- 'Show the blocker fingerprint, evidence hash, and prior attempts.',
1203
- 'Require a human edit to classification, scope, or retry policy before another model/code loop.'
1204
- ], ['blocker fingerprint', 'evidence hash', 'attempt history'], ['manual policy change', 'new external evidence'], ['start another automatic model repair', 'hide the failed evidence']);
1205
- }
1206
- if (action === 'budget_stop') {
1207
- return makePlan('manual_handoff', 'Budget Stop Review', 'Stop autonomous model/code loops until a cheaper scoped next action is selected.', 'budget_review_only', false, false, [
1208
- 'Freeze further model repair loops.',
1209
- 'Show the prompt/token/runtime budget that tripped the guard.',
1210
- 'Select a cheaper deterministic gate, infra repair, diagnosis revision, or manual scope edit before resuming.'
1211
- ], ['budget guard reason', 'latest prompt estimate', 'last blocker/evidence hash'], ['manual scope reduction', 'new deterministic evidence', 'approved budget policy change'], ['start another broad model prompt', 'reset budget without new evidence', 'hide cost context']);
1212
- }
1213
- if (failureClass === 'diagnosis' || stepType === 'diagnosis_gate') {
1214
- return makePlan('diagnosis_only', 'Run Diagnosis Gate', 'Produce a falsifiable root-cause diagnosis before any repair.', 'read_only_diagnosis', false, true, [
1215
- 'Reproduce or explicitly classify the customer issue.',
1216
- 'Accept one falsifiable hypothesis and record rejected alternatives.',
1217
- 'Identify the frontend/backend/shared failing path.',
1218
- 'Select a small owner_files set.',
1219
- 'Define exact before/action/after business proof.'
1220
- ], ['issue_case', 'accepted_hypothesis', 'rejected_alternatives', 'failing_path', 'owner_files', 'proof_plan'], ['new reproduction artifact', 'new query/log/code evidence', 'validated diagnosis gate'], ['edit product code', 'run broad repo repair', 'accept route-load evidence as success']);
1221
- }
1222
- if (failureClass === 'owner_scope' || failureClass === 'out_of_scope' || /out.?of.?scope|owner_files/i.test(reason)) {
1223
- return makePlan('diagnosis_revision', 'Revise Diagnosis Scope', 'Revise owner_files only when new evidence proves the current scope is wrong.', 'diagnosis_revision_only', false, true, [
1224
- 'Compare changed files against the diagnosis owner_files.',
1225
- 'Collect evidence proving why the new file is in the failing path.',
1226
- 'Update accepted_hypothesis, failing_path, owner_files, and proof_plan together.',
1227
- 'Resume repair only after the revised gate validates.'
1228
- ], ['out-of-scope file list', 'new failing-path evidence', 'revalidated diagnosis gate'], ['revised owner_files with evidence', 'new business proof requirement'], ['keep broad edits without diagnosis', 'add convenience refactors', 'continue repair outside owner_files']);
1229
- }
1230
- if (action === 'retry_infra') {
1231
- var isCompile = failureClass === 'compile';
1232
- return makePlan(isCompile ? 'compile_repair' : 'infra_repair', isCompile ? 'Repair Compile Gate' : 'Repair Infra Gate', isCompile
1233
- ? 'Fix the deterministic compile/build blocker before spending another product repair loop.'
1234
- : 'Fix the deterministic harness/browser/server/Mongo blocker before product repair.', isCompile ? 'compile_repair_only' : 'infra_repair_only', false, false, isCompile
1235
- ? [
1236
- 'Read the exact compile/build log and identify the first actionable error.',
1237
- 'Fix missing dependency, stale artifact, command, cache, or type wiring required by the compile gate.',
1238
- 'Rerun the same finite compile command.',
1239
- 'Return the compile log artifact and status.'
1240
- ]
1241
- : [
1242
- 'Run preflight for Puppeteer, Chrome executable, ports, Mongo/settings, and startup command.',
1243
- 'Repair only the failing harness/environment item.',
1244
- 'Rerun the same infra check.',
1245
- 'Return the infra log and pass/fail status.'
1246
- ], isCompile
1247
- ? ['compile command', 'compile log artifact', 'first failing error fixed or still failing']
1248
- : ['preflight command', 'infra log artifact', 'specific repaired environment item'], ['same check now passes', 'new infra/compile blocker hash'], ['run product-code model repair', 'count this as product failure', 'accept route/business success without the compile/infra gate']);
1249
- }
1250
- if (action === 'park_repeated_failure' || action === 'park_ping_pong') {
1251
- return makePlan('blocked_until_new_evidence', action === 'park_ping_pong' ? 'Park Ping-Pong Loop' : 'Park Repeated Failure', 'Stop the current loop until new evidence changes the diagnosis, route, or repair target.', 'collect_new_evidence_only', false, false, [
1252
- 'Do not rerun the same prompt or same repair.',
1253
- 'Show the repeated blocker and evidence hash.',
1254
- 'Collect a new artifact: failing DOM state, stack trace, network response, Mongo delta, compile log, or revised diagnosis.',
1255
- 'Reset the loop only after material evidence changes the blocker, proof, diagnosis, journey, or actionable trace.'
1256
- ], ['same failure count', 'blocker fingerprint', 'evidence hash'], ['changed blocker fingerprint', 'business/compile/infra/release proof artifact', 'revised diagnosis or journey contract', 'new actionable trace or data delta'], ['alternate between two failed patches', 'increase loop budget without evidence', 'hide the park reason']);
1257
- }
1258
- if (failureClass === 'journey') {
1259
- return makePlan('journey_contract_repair', 'Repair Journey Contract', 'Fix the first/next/last workflow contract before app code work continues.', 'journey_contract_repair', false, true, [
1260
- 'Open docs/APP_JOURNEY_CONTRACT.md.',
1261
- 'Define first_screen, north_star_workflow, screen_sequence, data_story, completion_states, and qa_assertions.',
1262
- 'Ensure each CTA maps to an action, route, method, calculation, or state transition.',
1263
- 'Validate that sample data can drive the promised workflow.'
1264
- ], ['validated journey_contract JSON', 'CTA-to-action mapping', 'workflow QA assertions'], ['journey validation passes', 'new workflow QA rows generated'], ['build empty routes', 'add link-only dashboard actions', 'defer workflow design to wow pass']);
1265
- }
1266
- if (failureClass === 'release') {
1267
- return makePlan('release_repair', 'Repair Release Gate', 'Repair deploy/publish/sample-data release evidence with a hotfix-first path before any repeated full deploy.', 'release_repair_only', false, false, [
1268
- 'Read the deploy/publish/sample-data log.',
1269
- 'Identify whether the blocker is domain, asset, seed data, route, permission, or CDN.',
1270
- 'Prefer backend hotfix, release config, domain, cache, or seed-data repair when the product artifact already has business proof.',
1271
- 'Rerun only the failed release gate.'
1272
- ], ['deploy or publish log', 'sample-data status', 'failed release gate rerun'], ['release gate passes', 'new release blocker hash'], ['change core workflow after business QA passed', 'mark accepted from scorecard only', 'rerun full builder loop', 'repeat deploy of same artifact without force_deploy evidence']);
1273
- }
1274
- if (failureClass === 'business' || failureClass === 'qa_evidence' || failureClass === 'route') {
1275
- return makePlan('business_proof_repair', 'Repair Business Proof', 'Fix the exact failing workflow assertion and prove before/action/after behavior.', 'business_repair', true, true, [
1276
- 'Open the failing QA row or proof_plan.',
1277
- 'Trace the UI action to method/publication/query/calculation.',
1278
- 'Patch the smallest owner or workflow files.',
1279
- 'Rerun only the failed business assertion.',
1280
- 'Record DOM/data/Mongo/artifact proof.'
1281
- ], ['failing assertion', 'action trace', 'business proof artifact'], ['business assertion passes', 'new failed assertion with new evidence'], ['treat route load as success', 'rerun unrelated QA rows first', 'accept scorecard-only evidence']);
1282
- }
1283
- if (input.productRepairFailure !== false || failureClass === 'product_code') {
1284
- return makePlan('product_code_repair', 'Run Targeted Product Repair', 'Repair the current product-code blocker with the smallest scoped edit and immediate proof.', 'targeted_product_repair', true, true, [
1285
- 'Inspect the current blocker, artifacts, changed files, and owner/workflow scope.',
1286
- 'Form one small repair hypothesis.',
1287
- 'Patch only files justified by the active diagnosis or journey contract.',
1288
- 'Rerun the smallest failed gate.',
1289
- 'Record new evidence before any additional loop.'
1290
- ], ['owner/workflow scope', 'repair diff', 'failed gate rerun artifact'], ['new evidence hash', 'same gate passes'], ['broad repo search-and-edit', 'rerun the same prompt without inspecting artifacts', 'change unrelated UI polish']);
1291
- }
1292
- return makePlan('continue', 'Continue Current Gate', 'Continue the current lane because no blocking loop or infra condition was detected.', 'continue', false, false, [
1293
- 'Use the active lane memory.',
1294
- 'Run the next finite gate.',
1295
- 'Record artifacts and evidence hash.'
1296
- ], ['active lane memory', 'finite gate artifact'], ['new gate result', 'new artifact path'], ['spawn duplicate runners', 'advance without evidence']);
1297
- }
1298
- function collectOpenTail(records) {
1299
- var tail = [];
1300
- for (var index = records.length - 1; index >= 0; index -= 1) {
1301
- var record = records[index];
1302
- if (isPassingOutcome(record)) {
1303
- break;
1304
- }
1305
- tail.unshift(record);
1306
- }
1307
- return tail;
1308
- }
1309
- function countSameFailure(records, current) {
1310
- var currentKey = failureKey(current);
1311
- var count = 0;
1312
- for (var index = records.length - 1; index >= 0; index -= 1) {
1313
- var record = records[index];
1314
- if (isPassingOutcome(record)) {
1315
- break;
1316
- }
1317
- if (failureKey(record) !== currentKey) {
1318
- break;
1319
- }
1320
- count += 1;
1321
- }
1322
- return count;
1323
- }
1324
- function previousRecordForPolicy(history, current, currentWasExplicit) {
1325
- if (!history.length) {
1326
- return undefined;
1327
- }
1328
- if (!currentWasExplicit) {
1329
- return history.length > 1 ? history[history.length - 2] : undefined;
1330
- }
1331
- var last = history[history.length - 1];
1332
- if (failureEvidenceKey(last) === failureEvidenceKey(current)) {
1333
- return history.length > 1 ? history[history.length - 2] : undefined;
1334
- }
1335
- return last;
1336
- }
1337
- function countPingPong(records, current) {
1338
- var tail = collectOpenTail(records).filter(function (record) {
1339
- return cleanText(record.lane, 80) === cleanText(current.lane, 80)
1340
- && cleanText(record.stepType, 80) === cleanText(current.stepType, 80);
1341
- });
1342
- if (tail.length < 4) {
1343
- return 0;
1344
- }
1345
- var keys = tail.map(failureKey).filter(Boolean);
1346
- var last = keys.slice(-6);
1347
- if (last.length < 4) {
1348
- return 0;
1349
- }
1350
- var distinct = Array.from(new Set(last));
1351
- if (distinct.length !== 2) {
1352
- return 0;
1353
- }
1354
- for (var index = 2; index < last.length; index += 1) {
1355
- if (last[index] !== last[index - 2]) {
1356
- return 0;
1357
- }
1358
- }
1359
- return last.length - 1;
1360
- }
1361
- function decideResolveIOAIManagerPolicy(input) {
1362
- var history = Array.isArray(input.history) ? input.history : [];
1363
- var currentWasExplicit = !!input.current;
1364
- var current = input.current || history[history.length - 1] || {};
1365
- var failureClass = normalizeResolveIOAIManagerFailureClass(current.failureClass);
1366
- var blockerFingerprint = resolveResolveIOAIManagerBlockerFingerprint(current);
1367
- var evidenceHash = hashResolveIOAIManagerEvidence(current);
1368
- var previous = previousRecordForPolicy(history, current, currentWasExplicit);
1369
- var previousSameFailure = previous && failureKey(previous) === failureKey(current);
1370
- var evidenceAssessment = previousSameFailure
1371
- ? assessResolveIOAIManagerEvidenceChange(previous, current)
1372
- : {
1373
- changed: false,
1374
- material: false,
1375
- strength: 'none',
1376
- signals: [],
1377
- evidenceHash: evidenceHash,
1378
- blockerFingerprint: blockerFingerprint
1379
- };
1380
- var newEvidence = !!previousSameFailure && evidenceAssessment.changed;
1381
- var sameFailureCount = countSameFailure(history, current);
1382
- var pingPongCount = countPingPong(history, current);
1383
- var maxSameFailureRepeats = Math.max(1, Number(input.maxSameFailureRepeats || 3) || 3);
1384
- var maxPingPongTransitions = Math.max(3, Number(input.maxPingPongTransitions || 3) || 3);
1385
- var infraClasses = new Set((input.infraFailureClasses || ['infra', 'compile']).map(normalizeResolveIOAIManagerFailureClass));
1386
- var ignoredClasses = new Set((input.ignoredFailureClasses || []).map(normalizeResolveIOAIManagerFailureClass));
1387
- var base = {
1388
- failureClass: failureClass,
1389
- blockerFingerprint: blockerFingerprint,
1390
- evidenceHash: evidenceHash,
1391
- sameFailureCount: sameFailureCount,
1392
- pingPongCount: pingPongCount,
1393
- newEvidence: newEvidence,
1394
- materialEvidence: evidenceAssessment.material,
1395
- evidenceStrength: evidenceAssessment.strength,
1396
- evidenceSignals: evidenceAssessment.signals,
1397
- loopBudgetShouldReset: false,
1398
- productRepairFailure: !infraClasses.has(failureClass) && !ignoredClasses.has(failureClass)
1399
- };
1400
- var withPlan = function (action, reason, overrides) {
1401
- if (overrides === void 0) { overrides = {}; }
1402
- var merged = __assign(__assign({}, base), overrides);
1403
- var recoveryPlan = buildResolveIOAIManagerRecoveryPlan({
1404
- action: action,
1405
- reason: reason,
1406
- failureClass: merged.failureClass,
1407
- lane: current.lane,
1408
- stepType: current.stepType,
1409
- blocker: current.blocker || current.summary,
1410
- sameFailureCount: merged.sameFailureCount,
1411
- pingPongCount: merged.pingPongCount,
1412
- newEvidence: merged.newEvidence,
1413
- productRepairFailure: merged.productRepairFailure,
1414
- changedFiles: current.changedFiles,
1415
- artifactPaths: current.artifactPaths,
1416
- maxSameFailureRepeats: maxSameFailureRepeats
1417
- });
1418
- var recoveryCheckpoint = buildResolveIOAIManagerRecoveryCheckpoint({
1419
- plan: recoveryPlan,
1420
- current: current
1421
- });
1422
- var recoveryEvidenceProbe = buildResolveIOAIManagerRecoveryEvidenceProbe({
1423
- checkpoint: recoveryCheckpoint,
1424
- current: current
1425
- });
1426
- return __assign(__assign({}, merged), { action: action, reason: reason, recoveryPlan: recoveryPlan, recoveryCheckpoint: recoveryCheckpoint, recoveryEvidenceProbe: recoveryEvidenceProbe, recoveryAction: buildResolveIOAIManagerRecoveryActionPacket({
1427
- plan: recoveryPlan,
1428
- checkpoint: recoveryCheckpoint,
1429
- probe: recoveryEvidenceProbe,
1430
- current: current
1431
- }) });
1432
- };
1433
- if (isPassingOutcome(current)) {
1434
- return withPlan('reset_loop_budget', 'manager_policy_progress_passed', {
1435
- loopBudgetShouldReset: true,
1436
- productRepairFailure: false
1437
- });
1438
- }
1439
- if (isManualOutcome(current)) {
1440
- return withPlan('manual_handoff', 'manager_policy_manual_or_stopped');
1441
- }
1442
- if (pingPongCount >= maxPingPongTransitions) {
1443
- return withPlan('park_ping_pong', 'manager_policy_ping_pong_failure_loop');
1444
- }
1445
- if (sameFailureCount >= maxSameFailureRepeats && !evidenceAssessment.material) {
1446
- return withPlan('park_repeated_failure', newEvidence
1447
- ? 'manager_policy_same_failure_with_weak_evidence'
1448
- : 'manager_policy_same_failure_without_new_evidence');
1449
- }
1450
- if (infraClasses.has(failureClass)) {
1451
- return withPlan('retry_infra', 'manager_policy_infra_failure_routes_to_infra_repair', {
1452
- productRepairFailure: false
1453
- });
1454
- }
1455
- if (newEvidence || !previousSameFailure) {
1456
- if (newEvidence && !evidenceAssessment.material) {
1457
- return withPlan('continue', 'manager_policy_weak_evidence_does_not_reset_loop_budget');
1458
- }
1459
- return withPlan('continue', newEvidence
1460
- ? 'manager_policy_new_material_evidence_resets_loop_budget'
1461
- : 'manager_policy_new_failure_or_lane', {
1462
- loopBudgetShouldReset: true,
1463
- materialEvidence: newEvidence ? true : base.materialEvidence,
1464
- evidenceStrength: newEvidence ? evidenceAssessment.strength : base.evidenceStrength
1465
- });
1466
- }
1467
- return withPlan('continue', 'manager_policy_retry_below_repeat_limit');
1468
- }
1469
- function buildReplayDirectiveFromPlan(input) {
1470
- var checkpoint = buildResolveIOAIManagerRecoveryCheckpoint({
1471
- plan: input.plan,
1472
- current: input.current,
1473
- now: input.now
1474
- });
1475
- var probe = buildResolveIOAIManagerRecoveryEvidenceProbe({
1476
- checkpoint: checkpoint,
1477
- current: input.current,
1478
- now: input.now
1479
- });
1480
- var action = buildResolveIOAIManagerRecoveryActionPacket({
1481
- plan: input.plan,
1482
- checkpoint: checkpoint,
1483
- probe: probe,
1484
- current: input.current,
1485
- now: input.now
1486
- });
1487
- var dispatch = decideResolveIOAIManagerRecoveryActionDispatch({
1488
- action: action,
1489
- current: input.current,
1490
- now: input.now
1491
- });
1492
- return buildResolveIOAIManagerRecoveryExecutionDirective({
1493
- action: action,
1494
- dispatchDecision: dispatch,
1495
- current: input.current,
1496
- surface: input.surface,
1497
- now: input.now
1498
- });
1499
- }
1500
- function replayCaseFromDirective(input) {
1501
- var _a;
1502
- var directive = input.directive;
1503
- var safeAutoDispatch = isResolveIOAIManagerSafeAutoDispatch({
1504
- dispatchAction: directive.dispatchAction,
1505
- directive: directive,
1506
- includeJourneyContractRepair: input.expectedSafeAutoDispatch && directive.dispatchAction === 'run_journey_contract_repair',
1507
- includeReleaseRepair: input.expectedSafeAutoDispatch && directive.dispatchAction === 'run_release_repair',
1508
- includeProductRepair: false
1509
- });
1510
- return __assign(__assign({ caseId: input.caseId, surface: input.surface, pass: input.pass && safeAutoDispatch === input.expectedSafeAutoDispatch, action: input.action, reason: input.reason, recoveryClass: cleanText(((_a = directive.dispatchRecord) === null || _a === void 0 ? void 0 : _a.mode) || directive.phase, 120), dispatchAction: directive.dispatchAction, safeAutoDispatch: safeAutoDispatch, expectedSafeAutoDispatch: input.expectedSafeAutoDispatch, productRepairAllowed: directive.canRunProductRepair === true, loopBudgetShouldReset: input.loopBudgetShouldReset === true, materialEvidence: input.materialEvidence === true, evidenceStrength: input.evidenceStrength || 'none' }, (directive.releasePolicy ? {
1511
- hotfixFirst: directive.releasePolicy.policy === 'hotfix_first',
1512
- fullDeployAllowed: directive.releasePolicy.fullDeployAllowed
1513
- } : {})), { details: __assign({ phase: directive.phase, allowed: directive.allowed, reason: directive.reason, releasePolicy: directive.releasePolicy }, (input.details || {})) });
1514
- }
1515
- function buildResolveIOAIManagerRecoveryReplayMatrix(input) {
1516
- var _a, _b;
1517
- if (input === void 0) { input = {}; }
1518
- var surface = cleanText(input.surface || 'runner', 120);
1519
- var maxSameFailureRepeats = Math.max(1, Number(input.maxSameFailureRepeats || 2) || 2);
1520
- var includeReleaseRepair = input.includeReleaseRepair !== false;
1521
- var includeJourneyContractRepair = input.includeJourneyContractRepair !== false;
1522
- var cases = [];
1523
- var infraPolicy = decideResolveIOAIManagerPolicy({
1524
- history: [
1525
- { lane: 'qa', stepType: 'workflow_qa', outcome: 'needs_repair', failureClass: 'infra', blocker: 'Chrome executable missing.', evidenceHash: 'chrome-missing' }
1526
- ],
1527
- current: { lane: 'qa', stepType: 'workflow_qa', outcome: 'needs_repair', failureClass: 'infra', blocker: 'Chrome executable missing.', evidenceHash: 'chrome-missing' },
1528
- maxSameFailureRepeats: maxSameFailureRepeats
1529
- });
1530
- var infraDirective = buildResolveIOAIManagerRecoveryExecutionDirective({
1531
- action: infraPolicy.recoveryAction,
1532
- current: { lane: 'qa', stepType: 'workflow_qa', outcome: 'needs_repair', failureClass: 'infra', blocker: 'Chrome executable missing.', evidenceHash: 'chrome-missing' },
1533
- surface: surface
1534
- });
1535
- cases.push(replayCaseFromDirective({
1536
- caseId: 'infra_routes_to_infra_repair',
1537
- surface: surface,
1538
- action: infraPolicy.action,
1539
- reason: infraPolicy.reason,
1540
- directive: infraDirective,
1541
- expectedSafeAutoDispatch: true,
1542
- pass: infraPolicy.action === 'retry_infra'
1543
- && infraPolicy.recoveryPlan.recoveryClass === 'infra_repair'
1544
- && infraDirective.dispatchAction === 'run_infra_repair'
1545
- && infraDirective.canRunProductRepair === false,
1546
- details: { recoveryClass: infraPolicy.recoveryPlan.recoveryClass }
1547
- }));
1548
- var releasePlan = buildResolveIOAIManagerRecoveryPlan({
1549
- action: 'continue',
1550
- reason: 'publish failed after business proof',
1551
- failureClass: 'release',
1552
- lane: 'publish',
1553
- stepType: 'test_deploy',
1554
- blocker: 'Domain publish failed for the current artifact.'
1555
- });
1556
- var releaseCurrent = {
1557
- lane: 'publish',
1558
- stepType: 'test_deploy',
1559
- outcome: 'needs_repair',
1560
- failureClass: 'release',
1561
- blocker: 'Domain publish failed for the current artifact.',
1562
- evidenceHash: 'release-domain-publish-failed',
1563
- artifactPaths: ['runner-evidence/release-status.json']
1564
- };
1565
- var releaseDirective = buildReplayDirectiveFromPlan({
1566
- surface: surface,
1567
- plan: releasePlan,
1568
- current: releaseCurrent
1569
- });
1570
- cases.push(replayCaseFromDirective({
1571
- caseId: 'release_uses_hotfix_first_repair',
1572
- surface: surface,
1573
- action: 'continue',
1574
- reason: 'publish failed after business proof',
1575
- directive: releaseDirective,
1576
- expectedSafeAutoDispatch: includeReleaseRepair,
1577
- pass: releasePlan.recoveryClass === 'release_repair'
1578
- && releaseDirective.dispatchAction === 'run_release_repair'
1579
- && ((_a = releaseDirective.releasePolicy) === null || _a === void 0 ? void 0 : _a.policy) === 'hotfix_first'
1580
- && ((_b = releaseDirective.releasePolicy) === null || _b === void 0 ? void 0 : _b.fullDeployAllowed) === false
1581
- && releaseDirective.canRunProductRepair === false,
1582
- details: { recoveryClass: releasePlan.recoveryClass }
1583
- }));
1584
- var journeyPlan = buildResolveIOAIManagerRecoveryPlan({
1585
- action: 'continue',
1586
- reason: 'journey contract missing first next last',
1587
- failureClass: 'journey',
1588
- lane: 'plan',
1589
- stepType: 'journey_contract',
1590
- blocker: 'Journey contract does not map the hub CTA to an action.'
1591
- });
1592
- var journeyDirective = buildReplayDirectiveFromPlan({
1593
- surface: surface,
1594
- plan: journeyPlan,
1595
- current: {
1596
- lane: 'plan',
1597
- stepType: 'journey_contract',
1598
- outcome: 'needs_repair',
1599
- failureClass: 'journey',
1600
- blocker: 'Journey contract does not map the hub CTA to an action.',
1601
- evidenceHash: 'journey-contract-invalid'
1602
- }
1603
- });
1604
- cases.push(replayCaseFromDirective({
1605
- caseId: 'journey_repair_is_safe_only_for_aicoder_surfaces',
1606
- surface: surface,
1607
- action: 'continue',
1608
- reason: 'journey contract missing first next last',
1609
- directive: journeyDirective,
1610
- expectedSafeAutoDispatch: includeJourneyContractRepair,
1611
- pass: journeyPlan.recoveryClass === 'journey_contract_repair'
1612
- && journeyDirective.dispatchAction === 'run_journey_contract_repair'
1613
- && journeyDirective.canRunProductRepair === false,
1614
- details: { recoveryClass: journeyPlan.recoveryClass }
1615
- }));
1616
- var weakPolicy = decideResolveIOAIManagerPolicy({
1617
- history: [
1618
- { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'save-before' },
1619
- { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'renamed-hash-only' }
1620
- ],
1621
- current: { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'renamed-hash-only' },
1622
- maxSameFailureRepeats: maxSameFailureRepeats
1623
- });
1624
- var weakDirective = buildResolveIOAIManagerRecoveryExecutionDirective({
1625
- action: weakPolicy.recoveryAction,
1626
- current: { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'renamed-hash-only' },
1627
- surface: surface
1628
- });
1629
- cases.push(replayCaseFromDirective({
1630
- caseId: 'weak_hash_only_evidence_stays_parked',
1631
- surface: surface,
1632
- action: weakPolicy.action,
1633
- reason: weakPolicy.reason,
1634
- directive: weakDirective,
1635
- expectedSafeAutoDispatch: true,
1636
- pass: weakPolicy.action === 'park_repeated_failure'
1637
- && weakPolicy.materialEvidence === false
1638
- && weakPolicy.loopBudgetShouldReset === false
1639
- && weakDirective.dispatchAction === 'run_evidence_probe',
1640
- loopBudgetShouldReset: weakPolicy.loopBudgetShouldReset,
1641
- materialEvidence: weakPolicy.materialEvidence,
1642
- evidenceStrength: weakPolicy.evidenceStrength,
1643
- details: { evidenceSignals: weakPolicy.evidenceSignals }
1644
- }));
1645
- var materialPolicy = decideResolveIOAIManagerPolicy({
1646
- history: [
1647
- { lane: 'repair', stepType: 'repair', outcome: 'needs_repair', failureClass: 'product_code', blocker: 'Save action still throws TypeError.', evidenceHash: 'save-before', artifactPaths: ['qa/save-before.log'] },
1648
- {
1649
- lane: 'repair',
1650
- stepType: 'repair',
1651
- outcome: 'needs_repair',
1652
- failureClass: 'product_code',
1653
- blocker: 'Save action still throws TypeError.',
1654
- summary: 'New DOM trace proves the click reaches the method with an undefined id.',
1655
- evidenceHash: 'save-dom-trace',
1656
- artifactPaths: ['qa/save-before.log', 'qa/save-dom-trace.json']
1657
- }
1658
- ],
1659
- current: {
1660
- lane: 'repair',
1661
- stepType: 'repair',
1662
- outcome: 'needs_repair',
1663
- failureClass: 'product_code',
1664
- blocker: 'Save action still throws TypeError.',
1665
- summary: 'New DOM trace proves the click reaches the method with an undefined id.',
1666
- evidenceHash: 'save-dom-trace',
1667
- artifactPaths: ['qa/save-before.log', 'qa/save-dom-trace.json']
1668
- },
1669
- maxSameFailureRepeats: maxSameFailureRepeats
1670
- });
1671
- cases.push({
1672
- caseId: 'material_evidence_resets_loop_budget',
1673
- surface: surface,
1674
- pass: materialPolicy.action === 'continue'
1675
- && materialPolicy.materialEvidence === true
1676
- && materialPolicy.loopBudgetShouldReset === true,
1677
- action: materialPolicy.action,
1678
- reason: materialPolicy.reason,
1679
- recoveryClass: materialPolicy.recoveryPlan.recoveryClass,
1680
- dispatchAction: materialPolicy.recoveryAction.mode,
1681
- safeAutoDispatch: false,
1682
- expectedSafeAutoDispatch: false,
1683
- productRepairAllowed: materialPolicy.recoveryAction.productRepairAllowed,
1684
- loopBudgetShouldReset: materialPolicy.loopBudgetShouldReset,
1685
- materialEvidence: materialPolicy.materialEvidence,
1686
- evidenceStrength: materialPolicy.evidenceStrength,
1687
- details: { evidenceSignals: materialPolicy.evidenceSignals }
1688
- });
1689
- var productPlan = buildResolveIOAIManagerRecoveryPlan({
1690
- action: 'continue',
1691
- reason: 'business proof still failing',
1692
- failureClass: 'product_code',
1693
- lane: 'repair',
1694
- stepType: 'repair',
1695
- blocker: 'Save action still throws TypeError.',
1696
- productRepairFailure: true
1697
- });
1698
- var productDirective = buildReplayDirectiveFromPlan({
1699
- surface: surface,
1700
- plan: productPlan,
1701
- current: {
1702
- lane: 'repair',
1703
- stepType: 'repair',
1704
- outcome: 'needs_repair',
1705
- failureClass: 'product_code',
1706
- blocker: 'Save action still throws TypeError.',
1707
- evidenceHash: 'save-product-repair'
1708
- }
1709
- });
1710
- var productSafe = isResolveIOAIManagerSafeAutoDispatch({
1711
- dispatchAction: productDirective.dispatchAction,
1712
- directive: productDirective,
1713
- includeProductRepair: input.includeProductRepair === true
1714
- });
1715
- cases.push({
1716
- caseId: 'product_repair_requires_explicit_operator_policy',
1717
- surface: surface,
1718
- pass: productPlan.recoveryClass === 'product_code_repair'
1719
- && productDirective.dispatchAction === 'run_targeted_product_repair'
1720
- && productSafe === false,
1721
- action: 'continue',
1722
- reason: 'business proof still failing',
1723
- recoveryClass: productPlan.recoveryClass,
1724
- dispatchAction: productDirective.dispatchAction,
1725
- safeAutoDispatch: productSafe,
1726
- expectedSafeAutoDispatch: false,
1727
- productRepairAllowed: productDirective.canRunProductRepair,
1728
- loopBudgetShouldReset: false,
1729
- materialEvidence: false,
1730
- evidenceStrength: 'none',
1731
- details: { phase: productDirective.phase, allowed: productDirective.allowed }
1732
- });
1733
- var duplicateReleasePolicy = buildResolveIOAIManagerHotfixFirstReleasePolicy({
1734
- surface: surface,
1735
- deployFingerprint: "".concat(surface, "-artifact-sha"),
1736
- lastDeployFingerprint: "".concat(surface, "-artifact-sha"),
1737
- deployStatus: 'completed',
1738
- publishStatus: 'published'
1739
- });
1740
- cases.push({
1741
- caseId: 'duplicate_release_fingerprint_blocks_full_deploy',
1742
- surface: surface,
1743
- pass: duplicateReleasePolicy.recommendedAction === 'block_duplicate_deploy'
1744
- && duplicateReleasePolicy.duplicateDeployBlocked === true
1745
- && duplicateReleasePolicy.fullDeployAllowed === false,
1746
- action: duplicateReleasePolicy.recommendedAction,
1747
- reason: duplicateReleasePolicy.reason,
1748
- recoveryClass: 'release_repair',
1749
- dispatchAction: 'run_release_repair',
1750
- safeAutoDispatch: includeReleaseRepair,
1751
- expectedSafeAutoDispatch: includeReleaseRepair,
1752
- productRepairAllowed: false,
1753
- loopBudgetShouldReset: false,
1754
- materialEvidence: false,
1755
- evidenceStrength: 'none',
1756
- hotfixFirst: true,
1757
- fullDeployAllowed: duplicateReleasePolicy.fullDeployAllowed,
1758
- details: { releasePolicy: duplicateReleasePolicy }
1759
- });
1760
- return cases;
1761
- }
1762
-
1763
- //# sourceMappingURL=ai-runner-manager-policy.js.map