@shivaedev/work-fleet 0.2.1 → 0.4.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.
- package/CHANGELOG.md +55 -0
- package/README.md +61 -19
- package/dist/DispatchRequest.d.ts +13 -0
- package/dist/DispatchRequest.d.ts.map +1 -0
- package/dist/DispatchRequest.js +12 -0
- package/dist/DispatchRequest.js.map +1 -0
- package/dist/admit.d.ts +11 -0
- package/dist/admit.d.ts.map +1 -1
- package/dist/attention.d.ts +1 -0
- package/dist/attention.d.ts.map +1 -1
- package/dist/attention.js +4 -0
- package/dist/attention.js.map +1 -1
- package/dist/board/fleetField.d.ts +1 -0
- package/dist/board/fleetField.d.ts.map +1 -1
- package/dist/board/fleetField.js +4 -0
- package/dist/board/fleetField.js.map +1 -1
- package/dist/board/markdown.d.ts.map +1 -1
- package/dist/board/markdown.js +7 -2
- package/dist/board/markdown.js.map +1 -1
- package/dist/board/publish.d.ts +2 -0
- package/dist/board/publish.d.ts.map +1 -1
- package/dist/board/publishReport.d.ts +1 -0
- package/dist/board/publishReport.d.ts.map +1 -1
- package/dist/board/readPass.d.ts +1 -0
- package/dist/board/readPass.d.ts.map +1 -1
- package/dist/cli.js +13 -6
- package/dist/cli.js.map +1 -1
- package/dist/engine/abandonStalled.d.ts +1171 -1004
- package/dist/engine/abandonStalled.d.ts.map +1 -1
- package/dist/engine/admissionOrder.d.ts +1091 -0
- package/dist/engine/admissionOrder.d.ts.map +1 -0
- package/dist/engine/admissionOrder.js +15 -0
- package/dist/engine/admissionOrder.js.map +1 -0
- package/dist/engine/applyResolution.d.ts +20 -0
- package/dist/engine/applyResolution.d.ts.map +1 -1
- package/dist/engine/approveBrief.d.ts +31 -0
- package/dist/engine/approveBrief.d.ts.map +1 -1
- package/dist/engine/authorizeResolution.d.ts +1160 -1003
- package/dist/engine/authorizeResolution.d.ts.map +1 -1
- package/dist/engine/boardBrief.d.ts +32 -0
- package/dist/engine/boardBrief.d.ts.map +1 -1
- package/dist/engine/capacityRetry.d.ts +3488 -3007
- package/dist/engine/capacityRetry.d.ts.map +1 -1
- package/dist/engine/closeDecisions.d.ts +20 -0
- package/dist/engine/closeDecisions.d.ts.map +1 -1
- package/dist/engine/completeBoardWork.d.ts +20 -0
- package/dist/engine/completeBoardWork.d.ts.map +1 -1
- package/dist/engine/completeReport.d.ts +21 -0
- package/dist/engine/completeReport.d.ts.map +1 -1
- package/dist/engine/continueCommand.d.ts +10 -0
- package/dist/engine/continueCommand.d.ts.map +1 -1
- package/dist/engine/continueWorker.d.ts +20 -0
- package/dist/engine/continueWorker.d.ts.map +1 -1
- package/dist/engine/deliverPendingAnswers.d.ts +1085 -898
- package/dist/engine/deliverPendingAnswers.d.ts.map +1 -1
- package/dist/engine/dispatchCommand.d.ts +14 -1
- package/dist/engine/dispatchCommand.d.ts.map +1 -1
- package/dist/engine/dispatchCommand.js +25 -5
- package/dist/engine/dispatchCommand.js.map +1 -1
- package/dist/engine/ensureDecisionOwner.d.ts +20 -0
- package/dist/engine/ensureDecisionOwner.d.ts.map +1 -1
- package/dist/engine/ensurePublication.d.ts +20 -0
- package/dist/engine/ensurePublication.d.ts.map +1 -1
- package/dist/engine/failureContext.d.ts +1 -0
- package/dist/engine/failureContext.d.ts.map +1 -1
- package/dist/engine/failureContext.js.map +1 -1
- package/dist/engine/failureMessage.js +11 -1
- package/dist/engine/failureMessage.js.map +1 -1
- package/dist/engine/health.d.ts +10 -0
- package/dist/engine/health.d.ts.map +1 -1
- package/dist/engine/inspectRenewal.d.ts +21 -0
- package/dist/engine/inspectRenewal.d.ts.map +1 -1
- package/dist/engine/launchInput.d.ts +10 -0
- package/dist/engine/launchInput.d.ts.map +1 -1
- package/dist/engine/launchReceipt.d.ts +10 -0
- package/dist/engine/launchReceipt.d.ts.map +1 -1
- package/dist/engine/localOnlyCriteria.d.ts +1 -0
- package/dist/engine/localOnlyCriteria.d.ts.map +1 -1
- package/dist/engine/localOnlyCriteria.js +5 -1
- package/dist/engine/localOnlyCriteria.js.map +1 -1
- package/dist/engine/makeAdopt.d.ts +21 -0
- package/dist/engine/makeAdopt.d.ts.map +1 -1
- package/dist/engine/makeAdvance.d.ts +10 -0
- package/dist/engine/makeAdvance.d.ts.map +1 -1
- package/dist/engine/makeDeliver.d.ts +20 -0
- package/dist/engine/makeDeliver.d.ts.map +1 -1
- package/dist/engine/makeHuman.d.ts +20 -0
- package/dist/engine/makeHuman.d.ts.map +1 -1
- package/dist/engine/makeLaunch.d.ts +20 -0
- package/dist/engine/makeLaunch.d.ts.map +1 -1
- package/dist/engine/makeLaunch.js +4 -13
- package/dist/engine/makeLaunch.js.map +1 -1
- package/dist/engine/makeObserve.d.ts +20 -0
- package/dist/engine/makeObserve.d.ts.map +1 -1
- package/dist/engine/makeReview.d.ts +21 -0
- package/dist/engine/makeReview.d.ts.map +1 -1
- package/dist/engine/makeState.d.ts +1164 -1010
- package/dist/engine/makeState.d.ts.map +1 -1
- package/dist/engine/makeState.js +19 -11
- package/dist/engine/makeState.js.map +1 -1
- package/dist/engine/makeValidate.d.ts +21 -0
- package/dist/engine/makeValidate.d.ts.map +1 -1
- package/dist/engine/mergeReadiness.d.ts +1425 -1764
- package/dist/engine/mergeReadiness.d.ts.map +1 -1
- package/dist/engine/mergeReadiness.js +3 -4
- package/dist/engine/mergeReadiness.js.map +1 -1
- package/dist/engine/observeDeliveryFailure.d.ts +1170 -1003
- package/dist/engine/observeDeliveryFailure.d.ts.map +1 -1
- package/dist/engine/observeRenewal.d.ts +33 -0
- package/dist/engine/observeRenewal.d.ts.map +1 -1
- package/dist/engine/obtainReview.d.ts +11 -0
- package/dist/engine/obtainReview.d.ts.map +1 -1
- package/dist/engine/obtainReview.js +2 -1
- package/dist/engine/obtainReview.js.map +1 -1
- package/dist/engine/operationRecord.d.ts +1898 -1779
- package/dist/engine/operationRecord.d.ts.map +1 -1
- package/dist/engine/persistTerminalReceipts.d.ts +20 -0
- package/dist/engine/persistTerminalReceipts.d.ts.map +1 -1
- package/dist/engine/prepareCommand.d.ts +10 -0
- package/dist/engine/prepareCommand.d.ts.map +1 -1
- package/dist/engine/prepareCommand.js +1 -1
- package/dist/engine/prepareCommand.js.map +1 -1
- package/dist/engine/queueAnswerCommand.d.ts +10 -0
- package/dist/engine/queueAnswerCommand.d.ts.map +1 -1
- package/dist/engine/readOrContinueReview.d.ts +11 -0
- package/dist/engine/readOrContinueReview.d.ts.map +1 -1
- package/dist/engine/readOrContinueReview.js +2 -1
- package/dist/engine/readOrContinueReview.js.map +1 -1
- package/dist/engine/readResolution.d.ts +1 -0
- package/dist/engine/readResolution.d.ts.map +1 -1
- package/dist/engine/readRetry.d.ts +2345 -2010
- package/dist/engine/readRetry.d.ts.map +1 -1
- package/dist/engine/readRetry.js +22 -2
- package/dist/engine/readRetry.js.map +1 -1
- package/dist/engine/reassignCommand.d.ts +10 -0
- package/dist/engine/reassignCommand.d.ts.map +1 -1
- package/dist/engine/reconcileAttempt.d.ts +12 -1
- package/dist/engine/reconcileAttempt.d.ts.map +1 -1
- package/dist/engine/reconcileAttempt.js +2 -1
- package/dist/engine/reconcileAttempt.js.map +1 -1
- package/dist/engine/reconcileCommand.d.ts +10 -0
- package/dist/engine/reconcileCommand.d.ts.map +1 -1
- package/dist/engine/recordResponseCommand.d.ts +551 -0
- package/dist/engine/recordResponseCommand.d.ts.map +1 -0
- package/dist/engine/recordResponseCommand.js +30 -0
- package/dist/engine/recordResponseCommand.js.map +1 -0
- package/dist/engine/recoverStall.d.ts +1172 -1004
- package/dist/engine/recoverStall.d.ts.map +1 -1
- package/dist/engine/recoverStall.js +1 -1
- package/dist/engine/recoverStall.js.map +1 -1
- package/dist/engine/recoverUnobservable.d.ts +1172 -1004
- package/dist/engine/recoverUnobservable.d.ts.map +1 -1
- package/dist/engine/refreshBrief.d.ts +2344 -2009
- package/dist/engine/refreshBrief.d.ts.map +1 -1
- package/dist/engine/refreshReviewResult.d.ts +21 -0
- package/dist/engine/refreshReviewResult.d.ts.map +1 -1
- package/dist/engine/releaseClosedPreparation.d.ts +1171 -1003
- package/dist/engine/releaseClosedPreparation.d.ts.map +1 -1
- package/dist/engine/releaseExecution.d.ts +1170 -1003
- package/dist/engine/releaseExecution.d.ts.map +1 -1
- package/dist/engine/releaseFinishedWork.d.ts +10 -0
- package/dist/engine/releaseFinishedWork.d.ts.map +1 -1
- package/dist/engine/repository.d.ts +1115 -1003
- package/dist/engine/repository.d.ts.map +1 -1
- package/dist/engine/repository.js +12 -12
- package/dist/engine/repository.js.map +1 -1
- package/dist/engine/requestConflictRepair.d.ts +1170 -1003
- package/dist/engine/requestConflictRepair.d.ts.map +1 -1
- package/dist/engine/requestRework.d.ts +20 -0
- package/dist/engine/requestRework.d.ts.map +1 -1
- package/dist/engine/resolveCommand.d.ts +10 -0
- package/dist/engine/resolveCommand.d.ts.map +1 -1
- package/dist/engine/resolveExecution.d.ts +1170 -1003
- package/dist/engine/resolveExecution.d.ts.map +1 -1
- package/dist/engine/resumeAttempt.d.ts +1171 -1003
- package/dist/engine/resumeAttempt.d.ts.map +1 -1
- package/dist/engine/retireUnacknowledged.d.ts +20 -0
- package/dist/engine/retireUnacknowledged.d.ts.map +1 -1
- package/dist/engine/retryTerminal.d.ts +1160 -1003
- package/dist/engine/retryTerminal.d.ts.map +1 -1
- package/dist/engine/saveLaunch.d.ts +10598 -0
- package/dist/engine/saveLaunch.d.ts.map +1 -0
- package/dist/engine/saveLaunch.js +30 -0
- package/dist/engine/saveLaunch.js.map +1 -0
- package/dist/engine/scheduler.d.ts +21 -1
- package/dist/engine/scheduler.d.ts.map +1 -1
- package/dist/engine/scheduler.js +3 -5
- package/dist/engine/scheduler.js.map +1 -1
- package/dist/engine/sessionCleanup.d.ts +20 -0
- package/dist/engine/sessionCleanup.d.ts.map +1 -1
- package/dist/engine/settleMergedDelivery.d.ts +1170 -1003
- package/dist/engine/settleMergedDelivery.d.ts.map +1 -1
- package/dist/engine/steerBrief.d.ts +1075 -898
- package/dist/engine/steerBrief.d.ts.map +1 -1
- package/dist/engine/submissionFailure.d.ts +1150 -1003
- package/dist/engine/submissionFailure.d.ts.map +1 -1
- package/dist/engine/submitLaunch.d.ts +1160 -1003
- package/dist/engine/submitLaunch.d.ts.map +1 -1
- package/dist/engine/views.d.ts.map +1 -1
- package/dist/engine/views.js +4 -0
- package/dist/engine/views.js.map +1 -1
- package/dist/engine/workerReport.d.ts +30 -0
- package/dist/engine/workerReport.d.ts.map +1 -1
- package/dist/fleet.d.ts +2716 -983
- package/dist/fleet.d.ts.map +1 -1
- package/dist/fleet.js +4 -0
- package/dist/fleet.js.map +1 -1
- package/dist/host/actionCommands.d.ts.map +1 -1
- package/dist/host/actionCommands.js +7 -6
- package/dist/host/actionCommands.js.map +1 -1
- package/dist/host/admission.d.ts +24 -1
- package/dist/host/admission.d.ts.map +1 -1
- package/dist/host/admission.js +2 -2
- package/dist/host/admission.js.map +1 -1
- package/dist/host/answerWork.d.ts +12 -2
- package/dist/host/answerWork.d.ts.map +1 -1
- package/dist/host/answerWork.js +19 -23
- package/dist/host/answerWork.js.map +1 -1
- package/dist/host/cliOptions.d.ts +1 -1
- package/dist/host/cliOptions.d.ts.map +1 -1
- package/dist/host/cliOptions.js +1 -1
- package/dist/host/cliOptions.js.map +1 -1
- package/dist/host/commands.d.ts +28 -4
- package/dist/host/commands.d.ts.map +1 -1
- package/dist/host/commands.js +19 -5
- package/dist/host/commands.js.map +1 -1
- package/dist/host/config.d.ts +20 -5
- package/dist/host/config.d.ts.map +1 -1
- package/dist/host/config.js +17 -19
- package/dist/host/config.js.map +1 -1
- package/dist/host/configFile.d.ts +66 -0
- package/dist/host/configFile.d.ts.map +1 -0
- package/dist/host/configFile.js +37 -0
- package/dist/host/configFile.js.map +1 -0
- package/dist/host/configSettings.d.ts +488 -0
- package/dist/host/configSettings.d.ts.map +1 -0
- package/dist/host/configSettings.js +115 -0
- package/dist/host/configSettings.js.map +1 -0
- package/dist/host/daemon.d.ts +881 -1185
- package/dist/host/daemon.d.ts.map +1 -1
- package/dist/host/daemon.js +2 -1
- package/dist/host/daemon.js.map +1 -1
- package/dist/host/daemonClient.d.ts +301 -605
- package/dist/host/daemonClient.d.ts.map +1 -1
- package/dist/host/daemonClient.js +28 -7
- package/dist/host/daemonClient.js.map +1 -1
- package/dist/host/daemonContract.d.ts +1973 -3075
- package/dist/host/daemonContract.d.ts.map +1 -1
- package/dist/host/daemonContract.js +12 -4
- package/dist/host/daemonContract.js.map +1 -1
- package/dist/host/daemonDiagnostics.d.ts.map +1 -1
- package/dist/host/daemonDiagnostics.js +9 -3
- package/dist/host/daemonDiagnostics.js.map +1 -1
- package/dist/host/daemonHandlers.d.ts +2 -1
- package/dist/host/daemonHandlers.d.ts.map +1 -1
- package/dist/host/daemonHandlers.js +20 -7
- package/dist/host/daemonHandlers.js.map +1 -1
- package/dist/host/daemonSnapshots.d.ts.map +1 -1
- package/dist/host/daemonSnapshots.js +21 -1
- package/dist/host/daemonSnapshots.js.map +1 -1
- package/dist/host/dispatchRequests.d.ts +30 -0
- package/dist/host/dispatchRequests.d.ts.map +1 -0
- package/dist/host/dispatchRequests.js +40 -0
- package/dist/host/dispatchRequests.js.map +1 -0
- package/dist/host/follow.js +1 -1
- package/dist/host/follow.js.map +1 -1
- package/dist/host/followState.d.ts.map +1 -1
- package/dist/host/followState.js +5 -4
- package/dist/host/followState.js.map +1 -1
- package/dist/host/github.d.ts +5 -6
- package/dist/host/github.d.ts.map +1 -1
- package/dist/host/github.js +3 -4
- package/dist/host/github.js.map +1 -1
- package/dist/host/githubApi.d.ts +15 -0
- package/dist/host/githubApi.d.ts.map +1 -0
- package/dist/host/githubApi.js +117 -0
- package/dist/host/githubApi.js.map +1 -0
- package/dist/host/githubChecks.d.ts +13 -3
- package/dist/host/githubChecks.d.ts.map +1 -1
- package/dist/host/githubChecks.js +5 -5
- package/dist/host/githubChecks.js.map +1 -1
- package/dist/host/githubDelivery.d.ts +13 -1
- package/dist/host/githubDelivery.d.ts.map +1 -1
- package/dist/host/githubDelivery.js +39 -6
- package/dist/host/githubDelivery.js.map +1 -1
- package/dist/host/githubRateLimit.d.ts +23 -0
- package/dist/host/githubRateLimit.d.ts.map +1 -0
- package/dist/host/githubRateLimit.js +70 -0
- package/dist/host/githubRateLimit.js.map +1 -0
- package/dist/host/githubRequiredChecks.d.ts +1 -2
- package/dist/host/githubRequiredChecks.d.ts.map +1 -1
- package/dist/host/githubRequiredChecks.js +2 -2
- package/dist/host/githubRequiredChecks.js.map +1 -1
- package/dist/host/githubResponse.d.ts +10 -0
- package/dist/host/githubResponse.d.ts.map +1 -0
- package/dist/host/githubResponse.js +29 -0
- package/dist/host/githubResponse.js.map +1 -0
- package/dist/host/githubResult.d.ts +3 -2
- package/dist/host/githubResult.d.ts.map +1 -1
- package/dist/host/githubResult.js +9 -12
- package/dist/host/githubResult.js.map +1 -1
- package/dist/host/githubTransport.d.ts +13 -0
- package/dist/host/githubTransport.d.ts.map +1 -0
- package/dist/host/{githubRead.js → githubTransport.js} +9 -10
- package/dist/host/githubTransport.js.map +1 -0
- package/dist/host/integrations.d.ts +6 -0
- package/dist/host/integrations.d.ts.map +1 -0
- package/dist/host/integrations.js +34 -0
- package/dist/host/integrations.js.map +1 -0
- package/dist/host/liveConfig.d.ts +21 -0
- package/dist/host/liveConfig.d.ts.map +1 -0
- package/dist/host/liveConfig.js +75 -0
- package/dist/host/liveConfig.js.map +1 -0
- package/dist/host/providers.d.ts.map +1 -1
- package/dist/host/providers.js +2 -2
- package/dist/host/providers.js.map +1 -1
- package/dist/host/readWaitStates.d.ts.map +1 -1
- package/dist/host/readWaitStates.js +8 -18
- package/dist/host/readWaitStates.js.map +1 -1
- package/dist/host/reassignWork.d.ts +10 -0
- package/dist/host/reassignWork.d.ts.map +1 -1
- package/dist/host/recordDecisionResponse.d.ts +1 -0
- package/dist/host/recordDecisionResponse.d.ts.map +1 -1
- package/dist/host/releaseWork.d.ts +24 -3
- package/dist/host/releaseWork.d.ts.map +1 -1
- package/dist/host/releaseWork.js +11 -7
- package/dist/host/releaseWork.js.map +1 -1
- package/dist/host/renderStatus.d.ts +2 -2
- package/dist/host/renderStatus.d.ts.map +1 -1
- package/dist/host/renderStatus.js +8 -2
- package/dist/host/renderStatus.js.map +1 -1
- package/dist/host/reportBoard.d.ts +1 -1
- package/dist/host/reportBoard.d.ts.map +1 -1
- package/dist/host/reportBoard.js +6 -3
- package/dist/host/reportBoard.js.map +1 -1
- package/dist/host/reportPublication.d.ts +2 -1
- package/dist/host/reportPublication.d.ts.map +1 -1
- package/dist/host/reportPublication.js +5 -2
- package/dist/host/reportPublication.js.map +1 -1
- package/dist/host/runtime.d.ts +8 -6
- package/dist/host/runtime.d.ts.map +1 -1
- package/dist/host/runtime.js +38 -46
- package/dist/host/runtime.js.map +1 -1
- package/dist/host/snapshotStream.d.ts.map +1 -1
- package/dist/host/snapshotStream.js +4 -1
- package/dist/host/snapshotStream.js.map +1 -1
- package/dist/host/status.d.ts +22 -2
- package/dist/host/status.d.ts.map +1 -1
- package/dist/host/status.js +19 -5
- package/dist/host/status.js.map +1 -1
- package/dist/host/statusLayer.d.ts +3 -3
- package/dist/host/statusLayer.d.ts.map +1 -1
- package/dist/host/statusLayer.js +13 -3
- package/dist/host/statusLayer.js.map +1 -1
- package/dist/host/waitOutcome.d.ts.map +1 -1
- package/dist/host/waitOutcome.js +5 -2
- package/dist/host/waitOutcome.js.map +1 -1
- package/dist/model.d.ts +39 -0
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +5 -0
- package/dist/model.js.map +1 -1
- package/dist/operations.d.ts +270 -0
- package/dist/operations.d.ts.map +1 -1
- package/dist/packageInfo.d.ts +1 -1
- package/dist/packageInfo.js +1 -1
- package/dist/policy.d.ts +8 -0
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +2 -0
- package/dist/policy.js.map +1 -1
- package/dist/providers/codexCloud.d.ts +2 -0
- package/dist/providers/codexCloud.d.ts.map +1 -1
- package/dist/providers/codexCloud.js +2 -1
- package/dist/providers/codexCloud.js.map +1 -1
- package/dist/qualifyDependencies.d.ts +10 -0
- package/dist/qualifyDependencies.d.ts.map +1 -1
- package/dist/scheduling/admission.d.ts +1635 -0
- package/dist/scheduling/admission.d.ts.map +1 -0
- package/dist/scheduling/admission.js +11 -0
- package/dist/scheduling/admission.js.map +1 -0
- package/dist/scheduling/areas.d.ts +30 -0
- package/dist/scheduling/areas.d.ts.map +1 -1
- package/dist/scheduling/areas.js +1 -0
- package/dist/scheduling/areas.js.map +1 -1
- package/dist/scheduling/backPressure.d.ts +1637 -0
- package/dist/scheduling/backPressure.d.ts.map +1 -0
- package/dist/scheduling/backPressure.js +44 -0
- package/dist/scheduling/backPressure.js.map +1 -0
- package/dist/storage/FleetStoreOptions.d.ts +2 -2
- package/dist/storage/FleetStoreOptions.d.ts.map +1 -1
- package/dist/storage/addShapeColumns.d.ts +5 -0
- package/dist/storage/addShapeColumns.d.ts.map +1 -0
- package/dist/storage/addShapeColumns.js +24 -0
- package/dist/storage/addShapeColumns.js.map +1 -0
- package/dist/storage/dispatchStore.d.ts +47 -0
- package/dist/storage/dispatchStore.d.ts.map +1 -0
- package/dist/storage/dispatchStore.js +89 -0
- package/dist/storage/dispatchStore.js.map +1 -0
- package/dist/storage/errors.d.ts +2 -1
- package/dist/storage/errors.d.ts.map +1 -1
- package/dist/storage/errors.js +2 -1
- package/dist/storage/errors.js.map +1 -1
- package/dist/storage/fleetMigrations.d.ts +1 -1
- package/dist/storage/fleetMigrations.d.ts.map +1 -1
- package/dist/storage/fleetMigrations.js +24 -17
- package/dist/storage/fleetMigrations.js.map +1 -1
- package/dist/storage/listedRecords.d.ts +9 -0
- package/dist/storage/listedRecords.d.ts.map +1 -0
- package/dist/storage/listedRecords.js +40 -0
- package/dist/storage/listedRecords.js.map +1 -0
- package/dist/storage/makePostgresFleetStore.d.ts +2 -6
- package/dist/storage/makePostgresFleetStore.d.ts.map +1 -1
- package/dist/storage/makePostgresFleetStore.js +4 -10
- package/dist/storage/makePostgresFleetStore.js.map +1 -1
- package/dist/storage/model.d.ts +9 -0
- package/dist/storage/model.d.ts.map +1 -1
- package/dist/storage/model.js.map +1 -1
- package/dist/storage/shapeV14.d.ts +808 -0
- package/dist/storage/shapeV14.d.ts.map +1 -0
- package/dist/storage/shapeV14.js +18 -0
- package/dist/storage/shapeV14.js.map +1 -0
- package/package.json +6 -6
- package/src/DispatchRequest.ts +13 -0
- package/src/attention.ts +5 -0
- package/src/board/fleetField.ts +5 -0
- package/src/board/markdown.ts +7 -2
- package/src/cli.ts +24 -10
- package/src/engine/admissionOrder.ts +25 -0
- package/src/engine/dispatchCommand.ts +29 -5
- package/src/engine/failureContext.ts +1 -0
- package/src/engine/failureMessage.ts +12 -1
- package/src/engine/localOnlyCriteria.ts +6 -1
- package/src/engine/makeLaunch.ts +4 -17
- package/src/engine/makeState.ts +30 -26
- package/src/engine/mergeReadiness.ts +6 -5
- package/src/engine/obtainReview.ts +2 -1
- package/src/engine/prepareCommand.ts +1 -1
- package/src/engine/readOrContinueReview.ts +2 -1
- package/src/engine/readRetry.ts +26 -2
- package/src/engine/reconcileAttempt.ts +2 -1
- package/src/engine/recordResponseCommand.ts +38 -0
- package/src/engine/recoverStall.ts +1 -1
- package/src/engine/repository.ts +17 -16
- package/src/engine/saveLaunch.ts +45 -0
- package/src/engine/scheduler.ts +4 -6
- package/src/engine/views.ts +5 -0
- package/src/fleet.ts +4 -0
- package/src/host/actionCommands.ts +22 -7
- package/src/host/admission.ts +3 -3
- package/src/host/answerWork.ts +28 -27
- package/src/host/cliOptions.ts +1 -1
- package/src/host/commands.ts +29 -8
- package/src/host/config.ts +26 -22
- package/src/host/configFile.ts +40 -0
- package/src/host/configSettings.ts +126 -0
- package/src/host/daemon.ts +2 -1
- package/src/host/daemonClient.ts +42 -7
- package/src/host/daemonContract.ts +12 -4
- package/src/host/daemonDiagnostics.ts +11 -3
- package/src/host/daemonHandlers.ts +24 -7
- package/src/host/daemonSnapshots.ts +24 -1
- package/src/host/dispatchRequests.ts +53 -0
- package/src/host/follow.ts +1 -1
- package/src/host/followState.ts +6 -6
- package/src/host/github.ts +8 -6
- package/src/host/githubApi.ts +142 -0
- package/src/host/githubChecks.ts +6 -5
- package/src/host/githubDelivery.ts +47 -10
- package/src/host/githubRateLimit.ts +91 -0
- package/src/host/githubRequiredChecks.ts +2 -2
- package/src/host/githubResponse.ts +37 -0
- package/src/host/githubResult.ts +15 -17
- package/src/host/githubTransport.ts +31 -0
- package/src/host/integrations.ts +40 -0
- package/src/host/liveConfig.ts +135 -0
- package/src/host/providers.ts +4 -2
- package/src/host/readWaitStates.ts +8 -20
- package/src/host/releaseWork.ts +12 -9
- package/src/host/renderStatus.ts +10 -3
- package/src/host/reportBoard.ts +6 -3
- package/src/host/reportPublication.ts +6 -4
- package/src/host/runtime.ts +49 -56
- package/src/host/snapshotStream.ts +6 -1
- package/src/host/status.ts +24 -7
- package/src/host/statusLayer.ts +21 -5
- package/src/host/waitOutcome.ts +5 -2
- package/src/model.ts +6 -0
- package/src/packageInfo.ts +1 -1
- package/src/policy.ts +8 -0
- package/src/providers/codexCloud.ts +2 -1
- package/src/scheduling/admission.ts +19 -0
- package/src/scheduling/areas.ts +1 -0
- package/src/scheduling/backPressure.ts +55 -0
- package/src/storage/FleetStoreOptions.ts +7 -2
- package/src/storage/addShapeColumns.ts +24 -0
- package/src/storage/dispatchStore.ts +104 -0
- package/src/storage/errors.ts +2 -1
- package/src/storage/fleetMigrations.ts +24 -17
- package/src/storage/listedRecords.ts +53 -0
- package/src/storage/makePostgresFleetStore.ts +4 -10
- package/src/storage/model.ts +7 -0
- package/src/storage/shapeV14.ts +19 -0
- package/dist/host/githubRead.d.ts +0 -5
- package/dist/host/githubRead.d.ts.map +0 -1
- package/dist/host/githubRead.js.map +0 -1
- package/dist/host/recordPayloads.d.ts +0 -4
- package/dist/host/recordPayloads.d.ts.map +0 -1
- package/dist/host/recordPayloads.js +0 -21
- package/dist/host/recordPayloads.js.map +0 -1
- package/dist/storage/migrateFleet.d.ts +0 -3
- package/dist/storage/migrateFleet.d.ts.map +0 -1
- package/dist/storage/migrateFleet.js +0 -11
- package/dist/storage/migrateFleet.js.map +0 -1
- package/src/host/githubRead.ts +0 -20
- package/src/host/recordPayloads.ts +0 -24
- package/src/storage/migrateFleet.ts +0 -11
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { SqlClient } from "effect/sql";
|
|
3
|
+
import { childTable } from "#storage/recordChildren.ts";
|
|
4
|
+
import { collections, type Shape, shapeColumns, sqlTypes } from "#storage/recordShape.ts";
|
|
5
|
+
|
|
6
|
+
export const addShapeColumns = Effect.fn("FleetStore.addShapeColumns")(function* (namespace: string, before: Shape, after: Shape) {
|
|
7
|
+
const sql = yield* SqlClient.SqlClient;
|
|
8
|
+
const existing = new Map(collections(before).map((collection) => [collection.path.join("."), shapeColumns(collection.shape)]));
|
|
9
|
+
const tables = [
|
|
10
|
+
{ columns: shapeColumns(after), existing: shapeColumns(before), table: `${namespace}_records` },
|
|
11
|
+
...collections(after).map((collection) => ({
|
|
12
|
+
columns: shapeColumns(collection.shape),
|
|
13
|
+
existing: existing.get(collection.path.join(".")) ?? {},
|
|
14
|
+
table: childTable(namespace, collection.path),
|
|
15
|
+
})),
|
|
16
|
+
];
|
|
17
|
+
for (const { columns, existing: present, table } of tables) {
|
|
18
|
+
for (const [name, kind] of Object.entries(columns)) {
|
|
19
|
+
if (!(name in present)) {
|
|
20
|
+
yield* sql`alter table ${sql(table)} add column ${sql(name)} ${sql.literal(sqlTypes[kind])}`;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
@@ -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
|
+
});
|
package/src/storage/errors.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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,
|
|
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
|
|
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 =
|
|
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,
|
package/src/storage/model.ts
CHANGED
|
@@ -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"}
|
package/src/host/githubRead.ts
DELETED
|
@@ -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
|
-
});
|