@shivaedev/work-fleet 0.2.1 → 0.3.0

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 (502) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/README.md +60 -18
  3. package/dist/DispatchRequest.d.ts +13 -0
  4. package/dist/DispatchRequest.d.ts.map +1 -0
  5. package/dist/DispatchRequest.js +12 -0
  6. package/dist/DispatchRequest.js.map +1 -0
  7. package/dist/admit.d.ts +11 -0
  8. package/dist/admit.d.ts.map +1 -1
  9. package/dist/attention.d.ts +1 -0
  10. package/dist/attention.d.ts.map +1 -1
  11. package/dist/attention.js +4 -0
  12. package/dist/attention.js.map +1 -1
  13. package/dist/board/fleetField.d.ts +1 -0
  14. package/dist/board/fleetField.d.ts.map +1 -1
  15. package/dist/board/fleetField.js +4 -0
  16. package/dist/board/fleetField.js.map +1 -1
  17. package/dist/board/markdown.d.ts.map +1 -1
  18. package/dist/board/markdown.js +7 -2
  19. package/dist/board/markdown.js.map +1 -1
  20. package/dist/board/publish.d.ts +2 -0
  21. package/dist/board/publish.d.ts.map +1 -1
  22. package/dist/board/publishReport.d.ts +1 -0
  23. package/dist/board/publishReport.d.ts.map +1 -1
  24. package/dist/board/readPass.d.ts +1 -0
  25. package/dist/board/readPass.d.ts.map +1 -1
  26. package/dist/cli.js +13 -6
  27. package/dist/cli.js.map +1 -1
  28. package/dist/engine/abandonStalled.d.ts +1171 -1004
  29. package/dist/engine/abandonStalled.d.ts.map +1 -1
  30. package/dist/engine/admissionOrder.d.ts +1091 -0
  31. package/dist/engine/admissionOrder.d.ts.map +1 -0
  32. package/dist/engine/admissionOrder.js +15 -0
  33. package/dist/engine/admissionOrder.js.map +1 -0
  34. package/dist/engine/applyResolution.d.ts +20 -0
  35. package/dist/engine/applyResolution.d.ts.map +1 -1
  36. package/dist/engine/approveBrief.d.ts +31 -0
  37. package/dist/engine/approveBrief.d.ts.map +1 -1
  38. package/dist/engine/authorizeResolution.d.ts +1160 -1003
  39. package/dist/engine/authorizeResolution.d.ts.map +1 -1
  40. package/dist/engine/boardBrief.d.ts +32 -0
  41. package/dist/engine/boardBrief.d.ts.map +1 -1
  42. package/dist/engine/capacityRetry.d.ts +3488 -3007
  43. package/dist/engine/capacityRetry.d.ts.map +1 -1
  44. package/dist/engine/closeDecisions.d.ts +20 -0
  45. package/dist/engine/closeDecisions.d.ts.map +1 -1
  46. package/dist/engine/completeBoardWork.d.ts +20 -0
  47. package/dist/engine/completeBoardWork.d.ts.map +1 -1
  48. package/dist/engine/completeReport.d.ts +21 -0
  49. package/dist/engine/completeReport.d.ts.map +1 -1
  50. package/dist/engine/continueCommand.d.ts +10 -0
  51. package/dist/engine/continueCommand.d.ts.map +1 -1
  52. package/dist/engine/continueWorker.d.ts +20 -0
  53. package/dist/engine/continueWorker.d.ts.map +1 -1
  54. package/dist/engine/deliverPendingAnswers.d.ts +1085 -898
  55. package/dist/engine/deliverPendingAnswers.d.ts.map +1 -1
  56. package/dist/engine/dispatchCommand.d.ts +14 -1
  57. package/dist/engine/dispatchCommand.d.ts.map +1 -1
  58. package/dist/engine/dispatchCommand.js +25 -5
  59. package/dist/engine/dispatchCommand.js.map +1 -1
  60. package/dist/engine/ensureDecisionOwner.d.ts +20 -0
  61. package/dist/engine/ensureDecisionOwner.d.ts.map +1 -1
  62. package/dist/engine/ensurePublication.d.ts +20 -0
  63. package/dist/engine/ensurePublication.d.ts.map +1 -1
  64. package/dist/engine/failureContext.d.ts +1 -0
  65. package/dist/engine/failureContext.d.ts.map +1 -1
  66. package/dist/engine/failureContext.js.map +1 -1
  67. package/dist/engine/failureMessage.js +11 -1
  68. package/dist/engine/failureMessage.js.map +1 -1
  69. package/dist/engine/health.d.ts +10 -0
  70. package/dist/engine/health.d.ts.map +1 -1
  71. package/dist/engine/inspectRenewal.d.ts +21 -0
  72. package/dist/engine/inspectRenewal.d.ts.map +1 -1
  73. package/dist/engine/launchInput.d.ts +10 -0
  74. package/dist/engine/launchInput.d.ts.map +1 -1
  75. package/dist/engine/launchReceipt.d.ts +10 -0
  76. package/dist/engine/launchReceipt.d.ts.map +1 -1
  77. package/dist/engine/localOnlyCriteria.d.ts +1 -0
  78. package/dist/engine/localOnlyCriteria.d.ts.map +1 -1
  79. package/dist/engine/localOnlyCriteria.js +5 -1
  80. package/dist/engine/localOnlyCriteria.js.map +1 -1
  81. package/dist/engine/makeAdopt.d.ts +21 -0
  82. package/dist/engine/makeAdopt.d.ts.map +1 -1
  83. package/dist/engine/makeAdvance.d.ts +10 -0
  84. package/dist/engine/makeAdvance.d.ts.map +1 -1
  85. package/dist/engine/makeDeliver.d.ts +20 -0
  86. package/dist/engine/makeDeliver.d.ts.map +1 -1
  87. package/dist/engine/makeHuman.d.ts +20 -0
  88. package/dist/engine/makeHuman.d.ts.map +1 -1
  89. package/dist/engine/makeLaunch.d.ts +20 -0
  90. package/dist/engine/makeLaunch.d.ts.map +1 -1
  91. package/dist/engine/makeLaunch.js +4 -13
  92. package/dist/engine/makeLaunch.js.map +1 -1
  93. package/dist/engine/makeObserve.d.ts +20 -0
  94. package/dist/engine/makeObserve.d.ts.map +1 -1
  95. package/dist/engine/makeReview.d.ts +21 -0
  96. package/dist/engine/makeReview.d.ts.map +1 -1
  97. package/dist/engine/makeState.d.ts +1164 -1010
  98. package/dist/engine/makeState.d.ts.map +1 -1
  99. package/dist/engine/makeState.js +19 -11
  100. package/dist/engine/makeState.js.map +1 -1
  101. package/dist/engine/makeValidate.d.ts +21 -0
  102. package/dist/engine/makeValidate.d.ts.map +1 -1
  103. package/dist/engine/mergeReadiness.d.ts +1425 -1764
  104. package/dist/engine/mergeReadiness.d.ts.map +1 -1
  105. package/dist/engine/mergeReadiness.js +3 -4
  106. package/dist/engine/mergeReadiness.js.map +1 -1
  107. package/dist/engine/observeDeliveryFailure.d.ts +1170 -1003
  108. package/dist/engine/observeDeliveryFailure.d.ts.map +1 -1
  109. package/dist/engine/observeRenewal.d.ts +33 -0
  110. package/dist/engine/observeRenewal.d.ts.map +1 -1
  111. package/dist/engine/obtainReview.d.ts +11 -0
  112. package/dist/engine/obtainReview.d.ts.map +1 -1
  113. package/dist/engine/obtainReview.js +2 -1
  114. package/dist/engine/obtainReview.js.map +1 -1
  115. package/dist/engine/operationRecord.d.ts +1898 -1779
  116. package/dist/engine/operationRecord.d.ts.map +1 -1
  117. package/dist/engine/persistTerminalReceipts.d.ts +20 -0
  118. package/dist/engine/persistTerminalReceipts.d.ts.map +1 -1
  119. package/dist/engine/prepareCommand.d.ts +10 -0
  120. package/dist/engine/prepareCommand.d.ts.map +1 -1
  121. package/dist/engine/prepareCommand.js +1 -1
  122. package/dist/engine/prepareCommand.js.map +1 -1
  123. package/dist/engine/queueAnswerCommand.d.ts +10 -0
  124. package/dist/engine/queueAnswerCommand.d.ts.map +1 -1
  125. package/dist/engine/readOrContinueReview.d.ts +11 -0
  126. package/dist/engine/readOrContinueReview.d.ts.map +1 -1
  127. package/dist/engine/readOrContinueReview.js +2 -1
  128. package/dist/engine/readOrContinueReview.js.map +1 -1
  129. package/dist/engine/readResolution.d.ts +1 -0
  130. package/dist/engine/readResolution.d.ts.map +1 -1
  131. package/dist/engine/readRetry.d.ts +2344 -2010
  132. package/dist/engine/readRetry.d.ts.map +1 -1
  133. package/dist/engine/readRetry.js +20 -1
  134. package/dist/engine/readRetry.js.map +1 -1
  135. package/dist/engine/reassignCommand.d.ts +10 -0
  136. package/dist/engine/reassignCommand.d.ts.map +1 -1
  137. package/dist/engine/reconcileAttempt.d.ts +12 -1
  138. package/dist/engine/reconcileAttempt.d.ts.map +1 -1
  139. package/dist/engine/reconcileAttempt.js +2 -1
  140. package/dist/engine/reconcileAttempt.js.map +1 -1
  141. package/dist/engine/reconcileCommand.d.ts +10 -0
  142. package/dist/engine/reconcileCommand.d.ts.map +1 -1
  143. package/dist/engine/recordResponseCommand.d.ts +551 -0
  144. package/dist/engine/recordResponseCommand.d.ts.map +1 -0
  145. package/dist/engine/recordResponseCommand.js +30 -0
  146. package/dist/engine/recordResponseCommand.js.map +1 -0
  147. package/dist/engine/recoverStall.d.ts +1172 -1004
  148. package/dist/engine/recoverStall.d.ts.map +1 -1
  149. package/dist/engine/recoverStall.js +1 -1
  150. package/dist/engine/recoverStall.js.map +1 -1
  151. package/dist/engine/recoverUnobservable.d.ts +1172 -1004
  152. package/dist/engine/recoverUnobservable.d.ts.map +1 -1
  153. package/dist/engine/refreshBrief.d.ts +2344 -2009
  154. package/dist/engine/refreshBrief.d.ts.map +1 -1
  155. package/dist/engine/refreshReviewResult.d.ts +21 -0
  156. package/dist/engine/refreshReviewResult.d.ts.map +1 -1
  157. package/dist/engine/releaseClosedPreparation.d.ts +1171 -1003
  158. package/dist/engine/releaseClosedPreparation.d.ts.map +1 -1
  159. package/dist/engine/releaseExecution.d.ts +1170 -1003
  160. package/dist/engine/releaseExecution.d.ts.map +1 -1
  161. package/dist/engine/releaseFinishedWork.d.ts +10 -0
  162. package/dist/engine/releaseFinishedWork.d.ts.map +1 -1
  163. package/dist/engine/repository.d.ts +1115 -1003
  164. package/dist/engine/repository.d.ts.map +1 -1
  165. package/dist/engine/repository.js +12 -12
  166. package/dist/engine/repository.js.map +1 -1
  167. package/dist/engine/requestConflictRepair.d.ts +1170 -1003
  168. package/dist/engine/requestConflictRepair.d.ts.map +1 -1
  169. package/dist/engine/requestRework.d.ts +20 -0
  170. package/dist/engine/requestRework.d.ts.map +1 -1
  171. package/dist/engine/resolveCommand.d.ts +10 -0
  172. package/dist/engine/resolveCommand.d.ts.map +1 -1
  173. package/dist/engine/resolveExecution.d.ts +1170 -1003
  174. package/dist/engine/resolveExecution.d.ts.map +1 -1
  175. package/dist/engine/resumeAttempt.d.ts +1171 -1003
  176. package/dist/engine/resumeAttempt.d.ts.map +1 -1
  177. package/dist/engine/retireUnacknowledged.d.ts +20 -0
  178. package/dist/engine/retireUnacknowledged.d.ts.map +1 -1
  179. package/dist/engine/retryTerminal.d.ts +1160 -1003
  180. package/dist/engine/retryTerminal.d.ts.map +1 -1
  181. package/dist/engine/saveLaunch.d.ts +10598 -0
  182. package/dist/engine/saveLaunch.d.ts.map +1 -0
  183. package/dist/engine/saveLaunch.js +30 -0
  184. package/dist/engine/saveLaunch.js.map +1 -0
  185. package/dist/engine/scheduler.d.ts +21 -1
  186. package/dist/engine/scheduler.d.ts.map +1 -1
  187. package/dist/engine/scheduler.js +3 -5
  188. package/dist/engine/scheduler.js.map +1 -1
  189. package/dist/engine/sessionCleanup.d.ts +20 -0
  190. package/dist/engine/sessionCleanup.d.ts.map +1 -1
  191. package/dist/engine/settleMergedDelivery.d.ts +1170 -1003
  192. package/dist/engine/settleMergedDelivery.d.ts.map +1 -1
  193. package/dist/engine/steerBrief.d.ts +1075 -898
  194. package/dist/engine/steerBrief.d.ts.map +1 -1
  195. package/dist/engine/submissionFailure.d.ts +1150 -1003
  196. package/dist/engine/submissionFailure.d.ts.map +1 -1
  197. package/dist/engine/submitLaunch.d.ts +1160 -1003
  198. package/dist/engine/submitLaunch.d.ts.map +1 -1
  199. package/dist/engine/views.d.ts.map +1 -1
  200. package/dist/engine/views.js +4 -0
  201. package/dist/engine/views.js.map +1 -1
  202. package/dist/engine/workerReport.d.ts +30 -0
  203. package/dist/engine/workerReport.d.ts.map +1 -1
  204. package/dist/fleet.d.ts +2716 -983
  205. package/dist/fleet.d.ts.map +1 -1
  206. package/dist/fleet.js +4 -0
  207. package/dist/fleet.js.map +1 -1
  208. package/dist/host/actionCommands.d.ts.map +1 -1
  209. package/dist/host/actionCommands.js +7 -6
  210. package/dist/host/actionCommands.js.map +1 -1
  211. package/dist/host/admission.d.ts +24 -1
  212. package/dist/host/admission.d.ts.map +1 -1
  213. package/dist/host/admission.js +2 -2
  214. package/dist/host/admission.js.map +1 -1
  215. package/dist/host/answerWork.d.ts +12 -2
  216. package/dist/host/answerWork.d.ts.map +1 -1
  217. package/dist/host/answerWork.js +19 -23
  218. package/dist/host/answerWork.js.map +1 -1
  219. package/dist/host/commands.d.ts +28 -4
  220. package/dist/host/commands.d.ts.map +1 -1
  221. package/dist/host/commands.js +19 -5
  222. package/dist/host/commands.js.map +1 -1
  223. package/dist/host/config.d.ts +77 -1
  224. package/dist/host/config.d.ts.map +1 -1
  225. package/dist/host/config.js +37 -9
  226. package/dist/host/config.js.map +1 -1
  227. package/dist/host/configSettings.d.ts +486 -0
  228. package/dist/host/configSettings.d.ts.map +1 -0
  229. package/dist/host/configSettings.js +113 -0
  230. package/dist/host/configSettings.js.map +1 -0
  231. package/dist/host/daemon.d.ts +880 -1185
  232. package/dist/host/daemon.d.ts.map +1 -1
  233. package/dist/host/daemon.js +2 -1
  234. package/dist/host/daemon.js.map +1 -1
  235. package/dist/host/daemonClient.d.ts +300 -605
  236. package/dist/host/daemonClient.d.ts.map +1 -1
  237. package/dist/host/daemonClient.js +28 -7
  238. package/dist/host/daemonClient.js.map +1 -1
  239. package/dist/host/daemonContract.d.ts +1974 -3079
  240. package/dist/host/daemonContract.d.ts.map +1 -1
  241. package/dist/host/daemonContract.js +12 -4
  242. package/dist/host/daemonContract.js.map +1 -1
  243. package/dist/host/daemonDiagnostics.d.ts.map +1 -1
  244. package/dist/host/daemonDiagnostics.js +9 -3
  245. package/dist/host/daemonDiagnostics.js.map +1 -1
  246. package/dist/host/daemonHandlers.d.ts +2 -1
  247. package/dist/host/daemonHandlers.d.ts.map +1 -1
  248. package/dist/host/daemonHandlers.js +20 -7
  249. package/dist/host/daemonHandlers.js.map +1 -1
  250. package/dist/host/daemonSnapshots.d.ts.map +1 -1
  251. package/dist/host/daemonSnapshots.js +21 -1
  252. package/dist/host/daemonSnapshots.js.map +1 -1
  253. package/dist/host/dispatchRequests.d.ts +30 -0
  254. package/dist/host/dispatchRequests.d.ts.map +1 -0
  255. package/dist/host/dispatchRequests.js +40 -0
  256. package/dist/host/dispatchRequests.js.map +1 -0
  257. package/dist/host/follow.js +1 -1
  258. package/dist/host/follow.js.map +1 -1
  259. package/dist/host/followState.d.ts.map +1 -1
  260. package/dist/host/followState.js +5 -4
  261. package/dist/host/followState.js.map +1 -1
  262. package/dist/host/github.d.ts +5 -6
  263. package/dist/host/github.d.ts.map +1 -1
  264. package/dist/host/github.js +3 -4
  265. package/dist/host/github.js.map +1 -1
  266. package/dist/host/githubApi.d.ts +15 -0
  267. package/dist/host/githubApi.d.ts.map +1 -0
  268. package/dist/host/githubApi.js +117 -0
  269. package/dist/host/githubApi.js.map +1 -0
  270. package/dist/host/githubChecks.d.ts +13 -3
  271. package/dist/host/githubChecks.d.ts.map +1 -1
  272. package/dist/host/githubChecks.js +5 -5
  273. package/dist/host/githubChecks.js.map +1 -1
  274. package/dist/host/githubDelivery.d.ts +13 -1
  275. package/dist/host/githubDelivery.d.ts.map +1 -1
  276. package/dist/host/githubDelivery.js +39 -6
  277. package/dist/host/githubDelivery.js.map +1 -1
  278. package/dist/host/githubRateLimit.d.ts +23 -0
  279. package/dist/host/githubRateLimit.d.ts.map +1 -0
  280. package/dist/host/githubRateLimit.js +70 -0
  281. package/dist/host/githubRateLimit.js.map +1 -0
  282. package/dist/host/githubRequiredChecks.d.ts +1 -2
  283. package/dist/host/githubRequiredChecks.d.ts.map +1 -1
  284. package/dist/host/githubRequiredChecks.js +2 -2
  285. package/dist/host/githubRequiredChecks.js.map +1 -1
  286. package/dist/host/githubResponse.d.ts +10 -0
  287. package/dist/host/githubResponse.d.ts.map +1 -0
  288. package/dist/host/githubResponse.js +29 -0
  289. package/dist/host/githubResponse.js.map +1 -0
  290. package/dist/host/githubResult.d.ts +3 -2
  291. package/dist/host/githubResult.d.ts.map +1 -1
  292. package/dist/host/githubResult.js +9 -12
  293. package/dist/host/githubResult.js.map +1 -1
  294. package/dist/host/githubTransport.d.ts +13 -0
  295. package/dist/host/githubTransport.d.ts.map +1 -0
  296. package/dist/host/{githubRead.js → githubTransport.js} +9 -10
  297. package/dist/host/githubTransport.js.map +1 -0
  298. package/dist/host/integrations.d.ts +6 -0
  299. package/dist/host/integrations.d.ts.map +1 -0
  300. package/dist/host/integrations.js +34 -0
  301. package/dist/host/integrations.js.map +1 -0
  302. package/dist/host/liveConfig.d.ts +21 -0
  303. package/dist/host/liveConfig.d.ts.map +1 -0
  304. package/dist/host/liveConfig.js +74 -0
  305. package/dist/host/liveConfig.js.map +1 -0
  306. package/dist/host/providers.d.ts.map +1 -1
  307. package/dist/host/providers.js +2 -2
  308. package/dist/host/providers.js.map +1 -1
  309. package/dist/host/readWaitStates.d.ts.map +1 -1
  310. package/dist/host/readWaitStates.js +8 -18
  311. package/dist/host/readWaitStates.js.map +1 -1
  312. package/dist/host/reassignWork.d.ts +10 -0
  313. package/dist/host/reassignWork.d.ts.map +1 -1
  314. package/dist/host/recordDecisionResponse.d.ts +1 -0
  315. package/dist/host/recordDecisionResponse.d.ts.map +1 -1
  316. package/dist/host/releaseWork.d.ts +24 -3
  317. package/dist/host/releaseWork.d.ts.map +1 -1
  318. package/dist/host/releaseWork.js +11 -7
  319. package/dist/host/releaseWork.js.map +1 -1
  320. package/dist/host/renderStatus.d.ts +2 -2
  321. package/dist/host/renderStatus.d.ts.map +1 -1
  322. package/dist/host/renderStatus.js +8 -2
  323. package/dist/host/renderStatus.js.map +1 -1
  324. package/dist/host/reportBoard.d.ts +1 -1
  325. package/dist/host/reportBoard.d.ts.map +1 -1
  326. package/dist/host/reportBoard.js +6 -3
  327. package/dist/host/reportBoard.js.map +1 -1
  328. package/dist/host/reportPublication.d.ts +2 -1
  329. package/dist/host/reportPublication.d.ts.map +1 -1
  330. package/dist/host/reportPublication.js +5 -2
  331. package/dist/host/reportPublication.js.map +1 -1
  332. package/dist/host/runtime.d.ts +8 -6
  333. package/dist/host/runtime.d.ts.map +1 -1
  334. package/dist/host/runtime.js +37 -46
  335. package/dist/host/runtime.js.map +1 -1
  336. package/dist/host/snapshotStream.d.ts.map +1 -1
  337. package/dist/host/snapshotStream.js +4 -1
  338. package/dist/host/snapshotStream.js.map +1 -1
  339. package/dist/host/status.d.ts +22 -2
  340. package/dist/host/status.d.ts.map +1 -1
  341. package/dist/host/status.js +19 -5
  342. package/dist/host/status.js.map +1 -1
  343. package/dist/host/statusLayer.d.ts +3 -3
  344. package/dist/host/statusLayer.d.ts.map +1 -1
  345. package/dist/host/statusLayer.js +13 -3
  346. package/dist/host/statusLayer.js.map +1 -1
  347. package/dist/host/waitOutcome.d.ts.map +1 -1
  348. package/dist/host/waitOutcome.js +5 -2
  349. package/dist/host/waitOutcome.js.map +1 -1
  350. package/dist/model.d.ts +39 -0
  351. package/dist/model.d.ts.map +1 -1
  352. package/dist/model.js +5 -0
  353. package/dist/model.js.map +1 -1
  354. package/dist/operations.d.ts +270 -0
  355. package/dist/operations.d.ts.map +1 -1
  356. package/dist/packageInfo.d.ts +1 -1
  357. package/dist/packageInfo.js +1 -1
  358. package/dist/policy.d.ts +7 -0
  359. package/dist/policy.d.ts.map +1 -1
  360. package/dist/policy.js +2 -0
  361. package/dist/policy.js.map +1 -1
  362. package/dist/providers/codexCloud.d.ts +2 -0
  363. package/dist/providers/codexCloud.d.ts.map +1 -1
  364. package/dist/providers/codexCloud.js +2 -1
  365. package/dist/providers/codexCloud.js.map +1 -1
  366. package/dist/qualifyDependencies.d.ts +10 -0
  367. package/dist/qualifyDependencies.d.ts.map +1 -1
  368. package/dist/scheduling/admission.d.ts +1635 -0
  369. package/dist/scheduling/admission.d.ts.map +1 -0
  370. package/dist/scheduling/admission.js +11 -0
  371. package/dist/scheduling/admission.js.map +1 -0
  372. package/dist/scheduling/areas.d.ts +30 -0
  373. package/dist/scheduling/areas.d.ts.map +1 -1
  374. package/dist/scheduling/backPressure.d.ts +1637 -0
  375. package/dist/scheduling/backPressure.d.ts.map +1 -0
  376. package/dist/scheduling/backPressure.js +44 -0
  377. package/dist/scheduling/backPressure.js.map +1 -0
  378. package/dist/storage/FleetStoreOptions.d.ts +2 -2
  379. package/dist/storage/FleetStoreOptions.d.ts.map +1 -1
  380. package/dist/storage/addShapeColumns.d.ts +5 -0
  381. package/dist/storage/addShapeColumns.d.ts.map +1 -0
  382. package/dist/storage/addShapeColumns.js +24 -0
  383. package/dist/storage/addShapeColumns.js.map +1 -0
  384. package/dist/storage/dispatchStore.d.ts +47 -0
  385. package/dist/storage/dispatchStore.d.ts.map +1 -0
  386. package/dist/storage/dispatchStore.js +89 -0
  387. package/dist/storage/dispatchStore.js.map +1 -0
  388. package/dist/storage/errors.d.ts +2 -1
  389. package/dist/storage/errors.d.ts.map +1 -1
  390. package/dist/storage/errors.js +2 -1
  391. package/dist/storage/errors.js.map +1 -1
  392. package/dist/storage/fleetMigrations.d.ts +1 -1
  393. package/dist/storage/fleetMigrations.d.ts.map +1 -1
  394. package/dist/storage/fleetMigrations.js +24 -17
  395. package/dist/storage/fleetMigrations.js.map +1 -1
  396. package/dist/storage/listedRecords.d.ts +9 -0
  397. package/dist/storage/listedRecords.d.ts.map +1 -0
  398. package/dist/storage/listedRecords.js +40 -0
  399. package/dist/storage/listedRecords.js.map +1 -0
  400. package/dist/storage/makePostgresFleetStore.d.ts +2 -6
  401. package/dist/storage/makePostgresFleetStore.d.ts.map +1 -1
  402. package/dist/storage/makePostgresFleetStore.js +4 -10
  403. package/dist/storage/makePostgresFleetStore.js.map +1 -1
  404. package/dist/storage/model.d.ts +9 -0
  405. package/dist/storage/model.d.ts.map +1 -1
  406. package/dist/storage/model.js.map +1 -1
  407. package/dist/storage/shapeV14.d.ts +808 -0
  408. package/dist/storage/shapeV14.d.ts.map +1 -0
  409. package/dist/storage/shapeV14.js +18 -0
  410. package/dist/storage/shapeV14.js.map +1 -0
  411. package/package.json +6 -6
  412. package/src/DispatchRequest.ts +13 -0
  413. package/src/attention.ts +5 -0
  414. package/src/board/fleetField.ts +5 -0
  415. package/src/board/markdown.ts +7 -2
  416. package/src/cli.ts +24 -10
  417. package/src/engine/admissionOrder.ts +25 -0
  418. package/src/engine/dispatchCommand.ts +29 -5
  419. package/src/engine/failureContext.ts +1 -0
  420. package/src/engine/failureMessage.ts +12 -1
  421. package/src/engine/localOnlyCriteria.ts +6 -1
  422. package/src/engine/makeLaunch.ts +4 -17
  423. package/src/engine/makeState.ts +30 -26
  424. package/src/engine/mergeReadiness.ts +6 -5
  425. package/src/engine/obtainReview.ts +2 -1
  426. package/src/engine/prepareCommand.ts +1 -1
  427. package/src/engine/readOrContinueReview.ts +2 -1
  428. package/src/engine/readRetry.ts +23 -1
  429. package/src/engine/reconcileAttempt.ts +2 -1
  430. package/src/engine/recordResponseCommand.ts +38 -0
  431. package/src/engine/recoverStall.ts +1 -1
  432. package/src/engine/repository.ts +17 -16
  433. package/src/engine/saveLaunch.ts +45 -0
  434. package/src/engine/scheduler.ts +4 -6
  435. package/src/engine/views.ts +5 -0
  436. package/src/fleet.ts +4 -0
  437. package/src/host/actionCommands.ts +22 -7
  438. package/src/host/admission.ts +3 -3
  439. package/src/host/answerWork.ts +28 -27
  440. package/src/host/commands.ts +29 -8
  441. package/src/host/config.ts +46 -9
  442. package/src/host/configSettings.ts +124 -0
  443. package/src/host/daemon.ts +2 -1
  444. package/src/host/daemonClient.ts +42 -7
  445. package/src/host/daemonContract.ts +12 -4
  446. package/src/host/daemonDiagnostics.ts +11 -3
  447. package/src/host/daemonHandlers.ts +24 -7
  448. package/src/host/daemonSnapshots.ts +24 -1
  449. package/src/host/dispatchRequests.ts +53 -0
  450. package/src/host/follow.ts +1 -1
  451. package/src/host/followState.ts +6 -6
  452. package/src/host/github.ts +8 -6
  453. package/src/host/githubApi.ts +142 -0
  454. package/src/host/githubChecks.ts +6 -5
  455. package/src/host/githubDelivery.ts +47 -10
  456. package/src/host/githubRateLimit.ts +91 -0
  457. package/src/host/githubRequiredChecks.ts +2 -2
  458. package/src/host/githubResponse.ts +37 -0
  459. package/src/host/githubResult.ts +15 -17
  460. package/src/host/githubTransport.ts +31 -0
  461. package/src/host/integrations.ts +40 -0
  462. package/src/host/liveConfig.ts +134 -0
  463. package/src/host/providers.ts +4 -2
  464. package/src/host/readWaitStates.ts +8 -20
  465. package/src/host/releaseWork.ts +12 -9
  466. package/src/host/renderStatus.ts +10 -3
  467. package/src/host/reportBoard.ts +6 -3
  468. package/src/host/reportPublication.ts +6 -4
  469. package/src/host/runtime.ts +48 -56
  470. package/src/host/snapshotStream.ts +6 -1
  471. package/src/host/status.ts +24 -7
  472. package/src/host/statusLayer.ts +21 -5
  473. package/src/host/waitOutcome.ts +5 -2
  474. package/src/model.ts +6 -0
  475. package/src/packageInfo.ts +1 -1
  476. package/src/policy.ts +7 -0
  477. package/src/providers/codexCloud.ts +2 -1
  478. package/src/scheduling/admission.ts +19 -0
  479. package/src/scheduling/backPressure.ts +55 -0
  480. package/src/storage/FleetStoreOptions.ts +7 -2
  481. package/src/storage/addShapeColumns.ts +24 -0
  482. package/src/storage/dispatchStore.ts +104 -0
  483. package/src/storage/errors.ts +2 -1
  484. package/src/storage/fleetMigrations.ts +24 -17
  485. package/src/storage/listedRecords.ts +53 -0
  486. package/src/storage/makePostgresFleetStore.ts +4 -10
  487. package/src/storage/model.ts +7 -0
  488. package/src/storage/shapeV14.ts +19 -0
  489. package/dist/host/githubRead.d.ts +0 -5
  490. package/dist/host/githubRead.d.ts.map +0 -1
  491. package/dist/host/githubRead.js.map +0 -1
  492. package/dist/host/recordPayloads.d.ts +0 -4
  493. package/dist/host/recordPayloads.d.ts.map +0 -1
  494. package/dist/host/recordPayloads.js +0 -21
  495. package/dist/host/recordPayloads.js.map +0 -1
  496. package/dist/storage/migrateFleet.d.ts +0 -3
  497. package/dist/storage/migrateFleet.d.ts.map +0 -1
  498. package/dist/storage/migrateFleet.js +0 -11
  499. package/dist/storage/migrateFleet.js.map +0 -1
  500. package/src/host/githubRead.ts +0 -20
  501. package/src/host/recordPayloads.ts +0 -24
  502. package/src/storage/migrateFleet.ts +0 -11
@@ -0,0 +1,104 @@
1
+ import { Clock, Effect, Schema } from "effect";
2
+ import { Model } from "effect/schema";
3
+ import { SqlClient } from "effect/sql";
4
+ import { makeRepository } from "@shivaedev/effect-sql/repository.ts";
5
+ import type { DispatchRequest } from "#DispatchRequest.ts";
6
+ import { fleetRecords } from "#fleetRecords.ts";
7
+ import type { DispatchNow } from "#model.ts";
8
+ import { makeFleetTransaction } from "#storage/makeFleetTransaction.ts";
9
+
10
+ class DispatchRow extends Model.Class<DispatchRow>("FleetDispatch")({
11
+ "accepted_at": Schema.Number,
12
+ "completed_at": Schema.NullOr(Schema.Number),
13
+ error: Schema.NullOr(Schema.String),
14
+ "ignore_areas": Schema.NullOr(Schema.Boolean),
15
+ now: Schema.NullOr(Schema.Boolean),
16
+ "request_id": Schema.String,
17
+ status: Schema.Literals(["pending", "completed", "failed"]),
18
+ "work_id": Schema.String,
19
+ }) {}
20
+
21
+ function receipt(row: DispatchRow): DispatchRequest {
22
+ return {
23
+ acceptedAt: row.accepted_at,
24
+ ...(row.completed_at === null ? {} : { completedAt: row.completed_at }),
25
+ ...(row.error === null ? {} : { error: row.error }),
26
+ id: row.request_id,
27
+ ...(row.ignore_areas === true ? { ignoreAreas: true } : {}),
28
+ ...(row.now === true ? { now: true } : {}),
29
+ status: row.status,
30
+ workId: row.work_id,
31
+ };
32
+ }
33
+
34
+ export const dispatchStore = Effect.fn("FleetDispatch.dispatchStore")(function* (namespace: string) {
35
+ const sql = yield* SqlClient.SqlClient;
36
+ const commit = yield* makeFleetTransaction;
37
+ const repository = yield* makeRepository(DispatchRow, {
38
+ conflictColumns: ["work_id"],
39
+ idColumn: "work_id",
40
+ spanPrefix: "FleetDispatch",
41
+ tableName: `${namespace}_dispatches`,
42
+ });
43
+ function list(workId?: string) {
44
+ return repository
45
+ .findMany({ orderBy: { direction: "asc", field: "work_id" }, where: { "work_id": workId } })
46
+ .pipe(Effect.map((rows) => rows.map(receipt)));
47
+ }
48
+ function get(workId: string) {
49
+ return list(workId).pipe(Effect.map((requests) => requests[0] ?? null));
50
+ }
51
+ function locked<A, E, R>(workId: string, body: Effect.Effect<A, E, R>) {
52
+ return commit(
53
+ [fleetRecords.list, fleetRecords.item(workId)],
54
+ sql`select pg_advisory_xact_lock(hashtextextended(${`${namespace}:dispatch:${workId}`}, 0))`.pipe(Effect.andThen(body)),
55
+ );
56
+ }
57
+ const accept = Effect.fn("FleetDispatch.accept")(function* (workId: string, now?: DispatchNow) {
58
+ return yield* locked(
59
+ workId,
60
+ Effect.gen(function* () {
61
+ const current = yield* get(workId);
62
+ if (current?.status === "pending") {
63
+ return current;
64
+ }
65
+ const row = yield* repository.upsert(
66
+ {
67
+ "accepted_at": yield* Clock.currentTimeMillis,
68
+ "completed_at": null,
69
+ error: null,
70
+ "ignore_areas": now?.ignoreAreas ?? null,
71
+ now: now === undefined ? null : true,
72
+ "request_id": crypto.randomUUID(),
73
+ status: "pending",
74
+ "work_id": workId,
75
+ },
76
+ { updateColumns: ["accepted_at", "completed_at", "error", "ignore_areas", "now", "request_id", "status"] },
77
+ );
78
+ return receipt(row);
79
+ }),
80
+ );
81
+ });
82
+ const finish = Effect.fn("FleetDispatch.finish")(function* (request: DispatchRequest, error?: string) {
83
+ yield* locked(
84
+ request.workId,
85
+ Effect.gen(function* () {
86
+ const current = yield* get(request.workId);
87
+ if (current?.id !== request.id || current.status !== "pending") {
88
+ return;
89
+ }
90
+ yield* repository.updateVoid({
91
+ "accepted_at": current.acceptedAt,
92
+ "completed_at": yield* Clock.currentTimeMillis,
93
+ error: error ?? null,
94
+ "ignore_areas": current.ignoreAreas ?? null,
95
+ now: current.now ?? null,
96
+ "request_id": request.id,
97
+ status: error === undefined ? "completed" : "failed",
98
+ "work_id": request.workId,
99
+ });
100
+ }),
101
+ );
102
+ });
103
+ return { accept, finish, get, list };
104
+ });
@@ -7,8 +7,9 @@ export class StorageConflict extends Schema.TaggedError<StorageConflict>()("Stor
7
7
  }) {}
8
8
 
9
9
  export class StorageCapacity extends Schema.TaggedError<StorageCapacity>()("StorageCapacity", {
10
- kind: Schema.Literals(["execution", "backlog"]),
10
+ kind: Schema.Literals(["execution", "backlog", "open-pull-requests", "merge-work"]),
11
11
  limit: Schema.Number,
12
+ occupied: Schema.optional(Schema.Number),
12
13
  }) {}
13
14
 
14
15
  export class StorageQuota extends Schema.TaggedError<StorageQuota>()("StorageQuota", {
@@ -1,14 +1,17 @@
1
1
  import { Effect } from "effect";
2
2
  import { Migrator, SqlClient } from "effect/sql";
3
+ import { addShapeColumns } from "#storage/addShapeColumns.ts";
3
4
  import { backfillDecisionCodes } from "#storage/backfillDecisionCodes.ts";
4
5
  import { modelTables } from "#storage/modelTables.ts";
5
6
  import { pruneEmptyCycles } from "#storage/pruneEmptyCycles.ts";
6
7
  import { recordTimeColumns } from "#storage/recordTimes.ts";
8
+ import { shapeV12 } from "#storage/shapeV12.ts";
9
+ import { shapeV14 } from "#storage/shapeV14.ts";
7
10
  import { typedTables } from "#storage/typedTables.ts";
8
11
 
9
12
  const releaseReasonColumn = { kind: "string", name: "releaseReason" } as const;
10
13
 
11
- export const fleetMigrations = Effect.fn("FleetStore.fleetMigrations")(function* (namespace: string, legacyOnly = false) {
14
+ export const fleetMigrations = Effect.fn("FleetStore.fleetMigrations")(function* (namespace: string) {
12
15
  const sql = yield* SqlClient.SqlClient;
13
16
  return yield* Migrator.fromRecord({
14
17
  "1_fleet_records": Effect.gen(function* () {
@@ -33,21 +36,25 @@ export const fleetMigrations = Effect.fn("FleetStore.fleetMigrations")(function*
33
36
  where payload->>'attentionOwner' is null and
34
37
  (payload->>'stage' = 'needs-human' or payload->>'blocker' is not null or payload->'launchRetry' is not null or
35
38
  (payload->>'stage' = 'validating' and payload->'checks'->>'pending' = 'true'))`,
36
- ...(legacyOnly
37
- ? {}
38
- : {
39
- "5_model_tables": modelTables(namespace),
40
- "6_decision_codes": backfillDecisionCodes(namespace),
41
- "7_release_reason": sql`alter table ${sql(`${namespace}_records`)} add column if not exists ${sql(releaseReasonColumn.name)} text`,
42
- "8_record_times": Effect.gen(function* () {
43
- for (const name of Object.keys(recordTimeColumns)) {
44
- yield* sql`alter table ${sql(`${namespace}_records`)} add column ${sql(name)} double precision`;
45
- }
46
- }),
47
- "9_integration_retry": sql`alter table ${sql(`${namespace}_records`)} add column ${sql("integrationRetry")} text`,
48
- "10_prune_empty_cycles": pruneEmptyCycles(namespace),
49
- "11_pending_answers": sql`alter table ${sql(`${namespace}_records`)} add column ${sql("pendingAnswers")} text`,
50
- "12_typed_tables": typedTables(namespace),
51
- }),
39
+ "5_model_tables": modelTables(namespace),
40
+ "6_decision_codes": backfillDecisionCodes(namespace),
41
+ "7_release_reason": sql`alter table ${sql(`${namespace}_records`)} add column if not exists ${sql(releaseReasonColumn.name)} text`,
42
+ "8_record_times": Effect.gen(function* () {
43
+ for (const name of Object.keys(recordTimeColumns)) {
44
+ yield* sql`alter table ${sql(`${namespace}_records`)} add column ${sql(name)} double precision`;
45
+ }
46
+ }),
47
+ "9_integration_retry": sql`alter table ${sql(`${namespace}_records`)} add column ${sql("integrationRetry")} text`,
48
+ "10_prune_empty_cycles": pruneEmptyCycles(namespace),
49
+ "11_pending_answers": sql`alter table ${sql(`${namespace}_records`)} add column ${sql("pendingAnswers")} text`,
50
+ "12_typed_tables": typedTables(namespace),
51
+ "13_dispatch_requests": sql`create table ${sql(`${namespace}_dispatches`)} (
52
+ work_id text primary key, request_id text not null, accepted_at double precision not null,
53
+ completed_at double precision, status text not null, error text
54
+ )`,
55
+ "14_dispatch_now": Effect.gen(function* () {
56
+ yield* addShapeColumns(namespace, shapeV12, shapeV14);
57
+ yield* sql`alter table ${sql(`${namespace}_dispatches`)} add column now boolean, add column ignore_areas boolean`;
58
+ }),
52
59
  });
53
60
  });
@@ -0,0 +1,53 @@
1
+ import { Effect, Schema } from "effect";
2
+ import { SqlClient } from "effect/sql";
3
+ import type { recordModel, Versioned } from "#storage/model.ts";
4
+ import type { Shape } from "#storage/recordShape.ts";
5
+ import { recordValues } from "#storage/recordValue.ts";
6
+
7
+ // Admission reads the whole list once per waiting item, so unchanged rows reuse their decoded value; xmin tells a committed row apart from a rolled-back write of the same version.
8
+ export function listedRecords<TSchema extends Schema.Top & { readonly DecodingServices: never; readonly EncodingServices: never }>(
9
+ sql: SqlClient.SqlClient,
10
+ schema: TSchema,
11
+ model: ReturnType<typeof recordModel>,
12
+ shape: Shape,
13
+ namespace: string,
14
+ ) {
15
+ const table = `${namespace}_records`;
16
+ const decodeRows = Schema.decodeUnknownEffect(Schema.Array(Schema.Struct(model.fields)));
17
+ const decodeRecords = Schema.decodeUnknownEffect(Schema.Array(schema));
18
+ const listed = new Map<string, { readonly revision: string; readonly stored: Versioned<TSchema["Type"]> }>();
19
+ const refreshListed = Effect.fn("FleetStore.refreshListed")(function* (workIds: readonly string[]) {
20
+ const raw = yield* sql<{
21
+ readonly revision: string;
22
+ }>`select *, "version"::text || ':' || xmin::text as revision from ${sql(table)} where ${sql.in("work_id", workIds)}`;
23
+ const found = yield* decodeRows(raw);
24
+ const values = yield* decodeRecords(yield* recordValues(found, shape, namespace).pipe(Effect.provideService(SqlClient.SqlClient, sql)));
25
+ for (const [index, row] of found.entries()) {
26
+ const value = values[index];
27
+ const revision = raw[index]?.revision;
28
+ if (value !== undefined && revision !== undefined) {
29
+ listed.set(row.work_id, { revision, stored: { value, version: row.version + 1 } });
30
+ }
31
+ }
32
+ });
33
+ return Effect.fn("FleetStore.readList")(function* () {
34
+ const heads = yield* sql<{
35
+ readonly "work_id": string;
36
+ readonly revision: string;
37
+ }>`select "work_id", "version"::text || ':' || xmin::text as revision from ${sql(table)} order by "admission_order" asc`;
38
+ const changed = heads.filter((head) => listed.get(head.work_id)?.revision !== head.revision).map((head) => head.work_id);
39
+ if (changed.length > 0) {
40
+ yield* refreshListed(changed);
41
+ }
42
+ const present = new Set(heads.map((head) => head.work_id));
43
+ for (const workId of listed.keys()) {
44
+ if (!present.has(workId)) {
45
+ listed.delete(workId);
46
+ }
47
+ }
48
+ return heads.flatMap((head) => {
49
+ const entry = listed.get(head.work_id);
50
+ return entry === undefined ? [] : [entry.stored];
51
+ });
52
+ });
53
+ }
@@ -1,4 +1,4 @@
1
- import { Effect, Array as EffectArray, Schema } from "effect";
1
+ import { Effect, Schema } from "effect";
2
2
  import { SqlClient } from "effect/sql";
3
3
  import { makeRepository, OptimisticConcurrencyError } from "@shivaedev/effect-sql/repository.ts";
4
4
  import { fleetRecords } from "#fleetRecords.ts";
@@ -6,9 +6,9 @@ import { checkRecordAdmission } from "#storage/admission.ts";
6
6
  import { admissionReads } from "#storage/admissionReads.ts";
7
7
  import { StorageConflict } from "#storage/errors.ts";
8
8
  import type { FleetStoreOptions } from "#storage/FleetStoreOptions.ts";
9
+ import { listedRecords } from "#storage/listedRecords.ts";
9
10
  import { makeFleetTransaction } from "#storage/makeFleetTransaction.ts";
10
11
  import { makeForeignReservations } from "#storage/makeForeignReservations.ts";
11
- import { migrateFleet } from "#storage/migrateFleet.ts";
12
12
  import { type AdmissionLimits, recordModel, type Versioned } from "#storage/model.ts";
13
13
  import { nextAdmissionOrder } from "#storage/nextAdmissionOrder.ts";
14
14
  import { operationEntries } from "#storage/operationEntries.ts";
@@ -16,7 +16,7 @@ import { readRecords } from "#storage/readRecords.ts";
16
16
  import { inputColumns, makeRecordChildren } from "#storage/recordChildren.ts";
17
17
  import { recordShape } from "#storage/recordShape.ts";
18
18
  import { withRecordTimes } from "#storage/recordTimes.ts";
19
- import { recordValue, recordValues } from "#storage/recordValue.ts";
19
+ import { recordValue } from "#storage/recordValue.ts";
20
20
 
21
21
  export const makePostgresFleetStore = Effect.fn("FleetStore.makePostgresFleetStore")(function* <
22
22
  TSchema extends Schema.Top & {
@@ -38,7 +38,6 @@ export const makePostgresFleetStore = Effect.fn("FleetStore.makePostgresFleetSto
38
38
  const decodeObject = Schema.decodeUnknownEffect(Schema.Record(Schema.String, Schema.Unknown));
39
39
  const decodeInsert = Schema.decodeUnknownEffect(model.insert);
40
40
  const decodeRecord = Schema.decodeUnknownEffect(schema);
41
- const decodeRecords = Schema.decodeUnknownEffect(Schema.Array(schema));
42
41
  function decode(row: { readonly "work_id": string; readonly version: number }) {
43
42
  return recordValue(row, shape, namespace).pipe(
44
43
  Effect.flatMap(decodeRecord),
@@ -56,11 +55,7 @@ export const makePostgresFleetStore = Effect.fn("FleetStore.makePostgresFleetSto
56
55
  function load(workId: string) {
57
56
  return loadEntry(workId).pipe(Effect.map((entry) => entry?.stored));
58
57
  }
59
- const readList = Effect.fn("FleetStore.readList")(function* () {
60
- const found = yield* rows.findMany({ orderBy: { direction: "asc", field: "admission_order" } });
61
- const values = yield* decodeRecords(yield* recordValues(found, shape, namespace).pipe(Effect.provideService(SqlClient.SqlClient, sql)));
62
- return EffectArray.zipWith(values, found, (value, row) => ({ value, version: row.version + 1 }));
63
- });
58
+ const readList = listedRecords(sql, schema, model, shape, namespace);
64
59
  function list() {
65
60
  return readRecords(namespace, readList()).pipe(Effect.provideService(SqlClient.SqlClient, sql));
66
61
  }
@@ -125,7 +120,6 @@ export const makePostgresFleetStore = Effect.fn("FleetStore.makePostgresFleetSto
125
120
  write(workId, expectedVersion, record, limits),
126
121
  ...foreign,
127
122
  hasLaunchRetry: () => rows.findMany({ select: ["launchRetry"] }).pipe(Effect.map((entries) => entries.some((row) => row.launchRetry !== null))),
128
- initialize: () => commit([fleetRecords.list], migrateFleet(namespace)),
129
123
  insert: (record: TSchema["Type"], limits?: AdmissionLimits) => write(record.workId, null, record, limits),
130
124
  list,
131
125
  load,
@@ -9,7 +9,14 @@ export interface Versioned<A> {
9
9
  readonly version: number;
10
10
  }
11
11
 
12
+ export interface OpenPullRequestCurve {
13
+ readonly ease: number;
14
+ readonly floor: number;
15
+ readonly max: number;
16
+ }
17
+
12
18
  export interface AdmissionLimits {
19
+ readonly implementers?: { readonly concurrency: number; readonly openPullRequests?: OpenPullRequestCurve };
13
20
  readonly maxBacklog?: number;
14
21
  readonly maxExecuting?: number;
15
22
  readonly quota?: { readonly observedAt: number; readonly available: number };
@@ -0,0 +1,19 @@
1
+ import { attemptV12 } from "#storage/attemptV12.ts";
2
+ import { cycleV12 } from "#storage/cycleV12.ts";
3
+ import type { Shape } from "#storage/recordShape.ts";
4
+ import { decisionV12 } from "#storage/typedDecisionsV12.ts";
5
+
6
+ const attempt = { fields: { ...attemptV12.fields, overLimit: "boolean" } } as const;
7
+ const publicationWork = { fields: { ...decisionV12.fields.publicationWork.fields, priority: "string" } } as const;
8
+ const cycle = {
9
+ ...cycleV12.fields,
10
+ attempts: { array: attempt },
11
+ decision: { fields: { ...decisionV12.fields, publicationWork } },
12
+ dispatchNow: { fields: { ignoreAreas: "boolean" } },
13
+ } as const;
14
+ export const shapeV14 = {
15
+ fields: {
16
+ ...cycle,
17
+ history: { array: { fields: { ...cycle, archivedAt: "number" } } },
18
+ },
19
+ } as const satisfies Shape;
@@ -1,5 +0,0 @@
1
- import { Effect } from "effect";
2
- import { ChildProcessSpawner } from "effect/process";
3
- import { ServiceUnavailable } from "@shivaedev/platform/errors/taxonomy.ts";
4
- export declare const githubRead: (args: readonly string[], cwd?: string | undefined) => Effect.Effect<string, ServiceUnavailable, ChildProcessSpawner.ChildProcessSpawner>;
5
- //# sourceMappingURL=githubRead.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"githubRead.d.ts","sourceRoot":"","sources":["../../src/host/githubRead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAgB,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,eAAO,MAAM,UAAU,2IAerB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"githubRead.js","sourceRoot":"","sources":["../../src/host/githubRead.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAE5E,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC,QAAQ,CAAC,EAAE,IAAuB,EAAE,GAAY;IACvG,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,mBAAmB,CAAC,mBAAmB,CAAC;IAC/D,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAC1B,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,OAAO,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;QACtG,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC9E,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;YACrC,OAAO,KAAK,CAAC,CAAC,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC,CAAC;QAC5E,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC,CAAC,CACF,CAAC,IAAI,CACL,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAC5B,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,CAAC,IAAI,kBAAkB,CAAC,EAAE,OAAO,EAAE,kFAAkF,EAAE,CAAC,CAAC,CAC9I,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- import { Effect } from "effect";
2
- import { SqlClient } from "effect/sql";
3
- export declare const recordPayloads: (namespace: string, workId?: string | undefined) => Effect.Effect<string[], import("effect/Schema").SchemaError | import("effect/sql/SqlError").SqlError, SqlClient.SqlClient>;
4
- //# sourceMappingURL=recordPayloads.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordPayloads.d.ts","sourceRoot":"","sources":["../../src/host/recordPayloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAOvC,eAAO,MAAM,cAAc,gLAezB,CAAC"}
@@ -1,21 +0,0 @@
1
- import { Effect } from "effect";
2
- import { SqlClient } from "effect/sql";
3
- import { makeRepository } from "@shivaedev/effect-sql/repository.ts";
4
- import { recordModel } from "#storage/model.ts";
5
- import { readRecords } from "#storage/readRecords.ts";
6
- import { recordShape } from "#storage/recordShape.ts";
7
- import { recordValues } from "#storage/recordValue.ts";
8
- export const recordPayloads = Effect.fn("FleetHost.recordPayloads")(function* (namespace, workId) {
9
- const sql = yield* SqlClient.SqlClient;
10
- const table = `${namespace}_records`;
11
- const [present] = yield* sql `select to_regclass(${table}) is not null as present`;
12
- if (present?.present !== true) {
13
- return [];
14
- }
15
- const repository = yield* makeRepository(recordModel(), { idColumn: "work_id", spanPrefix: "FleetReader", tableName: table });
16
- return yield* readRecords(namespace, Effect.gen(function* () {
17
- const rows = yield* repository.findMany({ orderBy: { direction: "asc", field: "work_id" }, where: { "work_id": workId } });
18
- return (yield* recordValues(rows, recordShape(), namespace)).map((value) => JSON.stringify(value));
19
- }));
20
- });
21
- //# sourceMappingURL=recordPayloads.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordPayloads.js","sourceRoot":"","sources":["../../src/host/recordPayloads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAEvD,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAiB,EAAE,MAAe;IAChH,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;IACvC,MAAM,KAAK,GAAG,GAAG,SAAS,UAAU,CAAC;IACrC,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,CAA+B,sBAAsB,KAAK,0BAA0B,CAAC;IACjH,IAAI,OAAO,EAAE,OAAO,KAAK,IAAI,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,cAAc,CAAC,WAAW,EAAE,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC;IAC9H,OAAO,KAAK,CAAC,CAAC,WAAW,CACxB,SAAS,EACT,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;QACnB,MAAM,IAAI,GAAG,KAAK,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;QAC3H,OAAO,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IACpG,CAAC,CAAC,CACF,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- import { Effect } from "effect";
2
- export declare const migrateFleet: (namespace: string, legacyOnly?: any) => Effect.Effect<readonly (readonly [id: number, name: string])[], import("effect/sql/Migrator").MigrationError | import("effect/sql/SqlError").SqlError, import("effect/sql/SqlClient").SqlClient>;
3
- //# sourceMappingURL=migrateFleet.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrateFleet.d.ts","sourceRoot":"","sources":["../../src/storage/migrateFleet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAIhC,eAAO,MAAM,YAAY,2OAMvB,CAAC"}
@@ -1,11 +0,0 @@
1
- import { Effect } from "effect";
2
- import { migratePostgres } from "@shivaedev/effect-sql/migrations.ts";
3
- import { fleetMigrations } from "#storage/fleetMigrations.ts";
4
- export const migrateFleet = Effect.fn("FleetStore.migrateFleet")(function* (namespace, legacyOnly = false) {
5
- return yield* migratePostgres({
6
- loader: fleetMigrations(namespace, legacyOnly),
7
- lockTimeout: "5 seconds",
8
- table: `${namespace}_migrations`,
9
- });
10
- });
11
- //# sourceMappingURL=migrateFleet.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrateFleet.js","sourceRoot":"","sources":["../../src/storage/migrateFleet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,EAAE,SAAiB,EAAE,UAAU,GAAG,KAAK;IAChH,OAAO,KAAK,CAAC,CAAC,eAAe,CAAC;QAC7B,MAAM,EAAE,eAAe,CAAC,SAAS,EAAE,UAAU,CAAC;QAC9C,WAAW,EAAE,WAAW;QACxB,KAAK,EAAE,GAAG,SAAS,aAAa;KAChC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -1,20 +0,0 @@
1
- import { Effect, Stream } from "effect";
2
- import { ChildProcess, ChildProcessSpawner } from "effect/process";
3
- import { ServiceUnavailable } from "@shivaedev/platform/errors/taxonomy.ts";
4
-
5
- export const githubRead = Effect.fn("Fleet.githubRead")(function* (args: readonly string[], cwd?: string) {
6
- const spawner = yield* ChildProcessSpawner.ChildProcessSpawner;
7
- return yield* Effect.scoped(
8
- Effect.gen(function* () {
9
- const process = yield* spawner.spawn(ChildProcess.make("gh", args, cwd === undefined ? {} : { cwd }));
10
- const output = yield* process.stdout.pipe(Stream.decodeText, Stream.mkString);
11
- if ((yield* process.exitCode) !== 0) {
12
- return yield* new ServiceUnavailable({ message: "GitHub request failed" });
13
- }
14
- return output;
15
- }),
16
- ).pipe(
17
- Effect.timeout("60 seconds"),
18
- Effect.mapError(() => new ServiceUnavailable({ message: "GitHub evidence could not be read; check gh authentication and repository access" })),
19
- );
20
- });
@@ -1,24 +0,0 @@
1
- import { Effect } from "effect";
2
- import { SqlClient } from "effect/sql";
3
- import { makeRepository } from "@shivaedev/effect-sql/repository.ts";
4
- import { recordModel } from "#storage/model.ts";
5
- import { readRecords } from "#storage/readRecords.ts";
6
- import { recordShape } from "#storage/recordShape.ts";
7
- import { recordValues } from "#storage/recordValue.ts";
8
-
9
- export const recordPayloads = Effect.fn("FleetHost.recordPayloads")(function* (namespace: string, workId?: string) {
10
- const sql = yield* SqlClient.SqlClient;
11
- const table = `${namespace}_records`;
12
- const [present] = yield* sql<{ readonly present: boolean }>`select to_regclass(${table}) is not null as present`;
13
- if (present?.present !== true) {
14
- return [];
15
- }
16
- const repository = yield* makeRepository(recordModel(), { idColumn: "work_id", spanPrefix: "FleetReader", tableName: table });
17
- return yield* readRecords(
18
- namespace,
19
- Effect.gen(function* () {
20
- const rows = yield* repository.findMany({ orderBy: { direction: "asc", field: "work_id" }, where: { "work_id": workId } });
21
- return (yield* recordValues(rows, recordShape(), namespace)).map((value) => JSON.stringify(value));
22
- }),
23
- );
24
- });
@@ -1,11 +0,0 @@
1
- import { Effect } from "effect";
2
- import { migratePostgres } from "@shivaedev/effect-sql/migrations.ts";
3
- import { fleetMigrations } from "#storage/fleetMigrations.ts";
4
-
5
- export const migrateFleet = Effect.fn("FleetStore.migrateFleet")(function* (namespace: string, legacyOnly = false) {
6
- return yield* migratePostgres({
7
- loader: fleetMigrations(namespace, legacyOnly),
8
- lockTimeout: "5 seconds",
9
- table: `${namespace}_migrations`,
10
- });
11
- });