@shivaedev/work-fleet 0.5.0 → 0.7.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 +33 -0
- package/README.md +7 -5
- package/dist/DecisionCode.d.ts +1 -1
- package/dist/DecisionCode.d.ts.map +1 -1
- package/dist/DecisionCode.js +1 -0
- package/dist/DecisionCode.js.map +1 -1
- package/dist/admit.d.ts +2 -4
- package/dist/admit.d.ts.map +1 -1
- package/dist/board/acknowledgeDecision.d.ts.map +1 -1
- package/dist/board/acknowledgeDecision.js +11 -5
- package/dist/board/acknowledgeDecision.js.map +1 -1
- package/dist/board/briefRevision.d.ts +1 -1
- package/dist/board/briefRevision.d.ts.map +1 -1
- package/dist/board/briefRevision.js +1 -1
- package/dist/board/briefRevision.js.map +1 -1
- package/dist/board/closePublishedDecision.d.ts +22 -0
- package/dist/board/closePublishedDecision.d.ts.map +1 -0
- package/dist/board/closePublishedDecision.js +41 -0
- package/dist/board/closePublishedDecision.js.map +1 -0
- package/dist/board/decisionAnswer.d.ts +2 -2
- package/dist/board/decisionAnswer.d.ts.map +1 -1
- package/dist/board/decisionAnswer.js +8 -8
- package/dist/board/decisionAnswer.js.map +1 -1
- package/dist/board/decisionReading.js +2 -2
- package/dist/board/decisionReading.js.map +1 -1
- package/dist/board/documents.d.ts +1 -2
- package/dist/board/documents.d.ts.map +1 -1
- package/dist/board/documents.js +4 -4
- package/dist/board/documents.js.map +1 -1
- package/dist/board/fleetField.d.ts +1 -1
- package/dist/board/fleetField.d.ts.map +1 -1
- package/dist/board/markdown.d.ts.map +1 -1
- package/dist/board/markdown.js +6 -5
- package/dist/board/markdown.js.map +1 -1
- package/dist/board/publish.d.ts +1 -1
- package/dist/board/publish.d.ts.map +1 -1
- package/dist/board/publish.js +10 -8
- package/dist/board/publish.js.map +1 -1
- package/dist/board/publishReport.js +2 -2
- package/dist/board/publishReport.js.map +1 -1
- package/dist/board/readDocument.js +1 -1
- package/dist/board/readDocument.js.map +1 -1
- package/dist/board/readPass.d.ts +1 -1
- package/dist/board/readPass.d.ts.map +1 -1
- package/dist/board/readPass.js +1 -1
- package/dist/board/readPass.js.map +1 -1
- package/dist/board/reportIdentity.js +1 -1
- package/dist/board/reportIdentity.js.map +1 -1
- package/dist/board/reportLinks.js +1 -1
- package/dist/board/reportLinks.js.map +1 -1
- package/dist/board/schema.d.ts +13 -13
- package/dist/board/schema.js +2 -2
- package/dist/board/schema.js.map +1 -1
- package/dist/board/upgradeDecisionClosure.d.ts +5 -0
- package/dist/board/upgradeDecisionClosure.d.ts.map +1 -0
- package/dist/board/upgradeDecisionClosure.js +46 -0
- package/dist/board/upgradeDecisionClosure.js.map +1 -0
- package/dist/board/workRevision.js +2 -2
- package/dist/board/workRevision.js.map +1 -1
- package/dist/board/writeHealth.d.ts +1 -1
- package/dist/board/writeHealth.d.ts.map +1 -1
- package/dist/board/writeHealth.js +1 -1
- package/dist/board/writeHealth.js.map +1 -1
- package/dist/board/writePublished.d.ts +1 -1
- package/dist/board/writePublished.d.ts.map +1 -1
- package/dist/board/writePublished.js +5 -1
- package/dist/board/writePublished.js.map +1 -1
- package/dist/cli.js +11 -5
- package/dist/cli.js.map +1 -1
- package/dist/engine/abandonStalled.d.ts +530 -569
- package/dist/engine/abandonStalled.d.ts.map +1 -1
- package/dist/engine/admissionOrder.d.ts +4 -8
- package/dist/engine/admissionOrder.d.ts.map +1 -1
- package/dist/engine/applyResolution.d.ts +4 -8
- package/dist/engine/applyResolution.d.ts.map +1 -1
- package/dist/engine/approveBrief.d.ts +6 -12
- package/dist/engine/approveBrief.d.ts.map +1 -1
- package/dist/engine/authorizeResolution.d.ts +528 -565
- package/dist/engine/authorizeResolution.d.ts.map +1 -1
- package/dist/engine/authorizeResolution.js +1 -1
- package/dist/engine/authorizeResolution.js.map +1 -1
- package/dist/engine/boardBrief.d.ts +7 -12
- package/dist/engine/boardBrief.d.ts.map +1 -1
- package/dist/engine/boardBrief.js +3 -10
- package/dist/engine/boardBrief.js.map +1 -1
- package/dist/engine/capacityRetry.d.ts +1715 -1828
- package/dist/engine/capacityRetry.d.ts.map +1 -1
- package/dist/engine/closeDecisions.d.ts +4 -8
- package/dist/engine/closeDecisions.d.ts.map +1 -1
- package/dist/engine/completeBoardWork.d.ts +4 -8
- package/dist/engine/completeBoardWork.d.ts.map +1 -1
- package/dist/engine/completeReport.d.ts +277 -284
- package/dist/engine/completeReport.d.ts.map +1 -1
- package/dist/engine/continueCommand.d.ts +2 -4
- package/dist/engine/continueCommand.d.ts.map +1 -1
- package/dist/engine/continueWorker.d.ts +4 -8
- package/dist/engine/continueWorker.d.ts.map +1 -1
- package/dist/engine/decisionCopy.d.ts +15 -0
- package/dist/engine/decisionCopy.d.ts.map +1 -0
- package/dist/engine/decisionCopy.js +44 -0
- package/dist/engine/decisionCopy.js.map +1 -0
- package/dist/engine/deliverPendingAnswers.d.ts +534 -577
- package/dist/engine/deliverPendingAnswers.d.ts.map +1 -1
- package/dist/engine/dispatchCommand.d.ts +3 -6
- package/dist/engine/dispatchCommand.d.ts.map +1 -1
- package/dist/engine/dispatchCommand.js +4 -29
- package/dist/engine/dispatchCommand.js.map +1 -1
- package/dist/engine/dispatchFailure.d.ts +9391 -0
- package/dist/engine/dispatchFailure.d.ts.map +1 -0
- package/dist/engine/dispatchFailure.js +24 -0
- package/dist/engine/dispatchFailure.js.map +1 -0
- package/dist/engine/ensureDecisionOwner.d.ts +4 -8
- package/dist/engine/ensureDecisionOwner.d.ts.map +1 -1
- package/dist/engine/ensurePublication.d.ts +4 -8
- package/dist/engine/ensurePublication.d.ts.map +1 -1
- package/dist/engine/failureCode.js +1 -1
- package/dist/engine/failureCode.js.map +1 -1
- package/dist/engine/health.d.ts +1 -1
- package/dist/engine/health.d.ts.map +1 -1
- package/dist/engine/inspectRenewal.d.ts +4 -8
- package/dist/engine/inspectRenewal.d.ts.map +1 -1
- package/dist/engine/launchInput.d.ts +2 -4
- package/dist/engine/launchInput.d.ts.map +1 -1
- package/dist/engine/launchReceipt.d.ts +2 -4
- package/dist/engine/launchReceipt.d.ts.map +1 -1
- package/dist/engine/makeAdopt.d.ts +4 -8
- package/dist/engine/makeAdopt.d.ts.map +1 -1
- package/dist/engine/makeAdvance.d.ts +2 -4
- package/dist/engine/makeAdvance.d.ts.map +1 -1
- package/dist/engine/makeDeliver.d.ts +4 -8
- package/dist/engine/makeDeliver.d.ts.map +1 -1
- package/dist/engine/makeDeliver.js +5 -1
- package/dist/engine/makeDeliver.js.map +1 -1
- package/dist/engine/makeHuman.d.ts +4 -8
- package/dist/engine/makeHuman.d.ts.map +1 -1
- package/dist/engine/makeLaunch.d.ts +4 -8
- package/dist/engine/makeLaunch.d.ts.map +1 -1
- package/dist/engine/makeObserve.d.ts +4 -8
- package/dist/engine/makeObserve.d.ts.map +1 -1
- package/dist/engine/makeReview.d.ts +4 -8
- package/dist/engine/makeReview.d.ts.map +1 -1
- package/dist/engine/makeState.d.ts +534 -568
- package/dist/engine/makeState.d.ts.map +1 -1
- package/dist/engine/makeState.js +18 -3
- package/dist/engine/makeState.js.map +1 -1
- package/dist/engine/makeValidate.d.ts +4 -8
- package/dist/engine/makeValidate.d.ts.map +1 -1
- package/dist/engine/mergeReadiness.d.ts +536 -581
- package/dist/engine/mergeReadiness.d.ts.map +1 -1
- package/dist/engine/mergeReadiness.js +1 -1
- package/dist/engine/mergeReadiness.js.map +1 -1
- package/dist/engine/missingBoardWork.d.ts +9936 -0
- package/dist/engine/missingBoardWork.d.ts.map +1 -0
- package/dist/engine/missingBoardWork.js +17 -0
- package/dist/engine/missingBoardWork.js.map +1 -0
- package/dist/engine/observeDeliveryFailure.d.ts +530 -569
- package/dist/engine/observeDeliveryFailure.d.ts.map +1 -1
- package/dist/engine/observeRenewal.d.ts +6 -12
- package/dist/engine/observeRenewal.d.ts.map +1 -1
- package/dist/engine/obtainReview.d.ts +2 -4
- package/dist/engine/obtainReview.d.ts.map +1 -1
- package/dist/engine/obtainReview.js +1 -1
- package/dist/engine/obtainReview.js.map +1 -1
- package/dist/engine/operationRecord.d.ts +26 -52
- package/dist/engine/operationRecord.d.ts.map +1 -1
- package/dist/engine/pendingAcknowledgements.d.ts.map +1 -1
- package/dist/engine/pendingAcknowledgements.js +3 -1
- package/dist/engine/pendingAcknowledgements.js.map +1 -1
- package/dist/engine/persistTerminalReceipts.d.ts +4 -8
- package/dist/engine/persistTerminalReceipts.d.ts.map +1 -1
- package/dist/engine/prepareCommand.d.ts +2 -4
- package/dist/engine/prepareCommand.d.ts.map +1 -1
- package/dist/engine/queueAnswerCommand.d.ts +2 -4
- package/dist/engine/queueAnswerCommand.d.ts.map +1 -1
- package/dist/engine/readOrContinueReview.d.ts +2 -4
- package/dist/engine/readOrContinueReview.d.ts.map +1 -1
- package/dist/engine/readOrContinueReview.js +1 -1
- package/dist/engine/readOrContinueReview.js.map +1 -1
- package/dist/engine/readResolution.d.ts +1 -1
- package/dist/engine/readResolution.js +1 -1
- package/dist/engine/readResolution.js.map +1 -1
- package/dist/engine/readRetry.d.ts +1177 -1255
- package/dist/engine/readRetry.d.ts.map +1 -1
- package/dist/engine/reassignCommand.d.ts +2 -4
- package/dist/engine/reassignCommand.d.ts.map +1 -1
- package/dist/engine/reconcileAttempt.d.ts +2 -4
- package/dist/engine/reconcileAttempt.d.ts.map +1 -1
- package/dist/engine/reconcileCommand.d.ts +2 -4
- package/dist/engine/reconcileCommand.d.ts.map +1 -1
- package/dist/engine/reconcileCommand.js +2 -1
- package/dist/engine/reconcileCommand.js.map +1 -1
- package/dist/engine/recordResponseCommand.d.ts +2 -4
- package/dist/engine/recordResponseCommand.d.ts.map +1 -1
- package/dist/engine/recoverStall.d.ts +530 -569
- package/dist/engine/recoverStall.d.ts.map +1 -1
- package/dist/engine/recoverUnobservable.d.ts +530 -569
- package/dist/engine/recoverUnobservable.d.ts.map +1 -1
- package/dist/engine/refreshBrief.d.ts +1177 -1255
- package/dist/engine/refreshBrief.d.ts.map +1 -1
- package/dist/engine/refreshReviewResult.d.ts +4 -8
- package/dist/engine/refreshReviewResult.d.ts.map +1 -1
- package/dist/engine/releaseClosedPreparation.d.ts +530 -569
- package/dist/engine/releaseClosedPreparation.d.ts.map +1 -1
- package/dist/engine/releaseExecution.d.ts +530 -569
- package/dist/engine/releaseExecution.d.ts.map +1 -1
- package/dist/engine/releaseFinishedWork.d.ts +2 -4
- package/dist/engine/releaseFinishedWork.d.ts.map +1 -1
- package/dist/engine/releaseFinishedWork.js +0 -1
- package/dist/engine/releaseFinishedWork.js.map +1 -1
- package/dist/engine/repository.d.ts +24 -48
- package/dist/engine/repository.d.ts.map +1 -1
- package/dist/engine/repository.js +1 -1
- package/dist/engine/repository.js.map +1 -1
- package/dist/engine/requestConflictRepair.d.ts +530 -569
- package/dist/engine/requestConflictRepair.d.ts.map +1 -1
- package/dist/engine/requestRework.d.ts +4 -8
- package/dist/engine/requestRework.d.ts.map +1 -1
- package/dist/engine/resolveCommand.d.ts +2 -4
- package/dist/engine/resolveCommand.d.ts.map +1 -1
- package/dist/engine/resolveExecution.d.ts +530 -569
- package/dist/engine/resolveExecution.d.ts.map +1 -1
- package/dist/engine/resumeAttempt.d.ts +530 -569
- package/dist/engine/resumeAttempt.d.ts.map +1 -1
- package/dist/engine/retireUnacknowledged.d.ts +4 -8
- package/dist/engine/retireUnacknowledged.d.ts.map +1 -1
- package/dist/engine/retryTerminal.d.ts +528 -565
- package/dist/engine/retryTerminal.d.ts.map +1 -1
- package/dist/engine/saveLaunch.d.ts +533 -574
- package/dist/engine/saveLaunch.d.ts.map +1 -1
- package/dist/engine/saveLaunch.js +16 -2
- package/dist/engine/saveLaunch.js.map +1 -1
- package/dist/engine/scheduler.d.ts +4 -8
- package/dist/engine/scheduler.d.ts.map +1 -1
- package/dist/engine/scheduler.js +4 -1
- package/dist/engine/scheduler.js.map +1 -1
- package/dist/engine/sessionCleanup.d.ts +4 -8
- package/dist/engine/sessionCleanup.d.ts.map +1 -1
- package/dist/engine/settleMergedDelivery.d.ts +530 -569
- package/dist/engine/settleMergedDelivery.d.ts.map +1 -1
- package/dist/engine/situations/choices.d.ts +20 -0
- package/dist/engine/situations/choices.d.ts.map +1 -0
- package/dist/engine/situations/choices.js +21 -0
- package/dist/engine/situations/choices.js.map +1 -0
- package/dist/engine/situations/service.d.ts +60 -0
- package/dist/engine/situations/service.d.ts.map +1 -0
- package/dist/engine/situations/service.js +51 -0
- package/dist/engine/situations/service.js.map +1 -0
- package/dist/engine/situations/stop.d.ts +25 -0
- package/dist/engine/situations/stop.d.ts.map +1 -0
- package/dist/engine/situations/stop.js +25 -0
- package/dist/engine/situations/stop.js.map +1 -0
- package/dist/engine/situations/work.d.ts +114 -0
- package/dist/engine/situations/work.d.ts.map +1 -0
- package/dist/engine/situations/work.js +91 -0
- package/dist/engine/situations/work.js.map +1 -0
- package/dist/engine/steerBrief.d.ts +532 -573
- package/dist/engine/steerBrief.d.ts.map +1 -1
- package/dist/engine/submissionFailure.d.ts +526 -561
- package/dist/engine/submissionFailure.d.ts.map +1 -1
- package/dist/engine/submitLaunch.d.ts +528 -565
- package/dist/engine/submitLaunch.d.ts.map +1 -1
- package/dist/engine/threadNames.js +1 -1
- package/dist/engine/threadNames.js.map +1 -1
- package/dist/engine/workerReport.d.ts +7 -13
- package/dist/engine/workerReport.d.ts.map +1 -1
- package/dist/exposeFailure.js +1 -1
- package/dist/exposeFailure.js.map +1 -1
- package/dist/fleet.d.ts +26 -52
- package/dist/fleet.d.ts.map +1 -1
- package/dist/fleet.js +1 -1
- package/dist/fleet.js.map +1 -1
- package/dist/host/actionCommands.d.ts +10 -10
- package/dist/host/actionCommands.d.ts.map +1 -1
- package/dist/host/actionCommands.js +6 -6
- package/dist/host/actionCommands.js.map +1 -1
- package/dist/host/admission.d.ts +4 -8
- package/dist/host/admission.d.ts.map +1 -1
- package/dist/host/answerWork.d.ts +4 -5
- package/dist/host/answerWork.d.ts.map +1 -1
- package/dist/host/cliOptions.d.ts +5 -1
- package/dist/host/cliOptions.d.ts.map +1 -1
- package/dist/host/cliOptions.js +6 -4
- package/dist/host/cliOptions.js.map +1 -1
- package/dist/host/commands.d.ts +1 -1
- package/dist/host/commands.d.ts.map +1 -1
- package/dist/host/configSettings.d.ts +5 -5
- package/dist/host/daemon.d.ts +133 -150
- package/dist/host/daemon.d.ts.map +1 -1
- package/dist/host/daemon.js +7 -3
- package/dist/host/daemon.js.map +1 -1
- package/dist/host/daemonClient.d.ts +1054 -1072
- package/dist/host/daemonClient.d.ts.map +1 -1
- package/dist/host/daemonClient.js +1 -1
- package/dist/host/daemonClient.js.map +1 -1
- package/dist/host/daemonContract.d.ts +146 -172
- package/dist/host/daemonContract.d.ts.map +1 -1
- package/dist/host/daemonContract.js +1 -1
- package/dist/host/daemonContract.js.map +1 -1
- package/dist/host/daemonDiagnostics.js +1 -1
- package/dist/host/daemonDiagnostics.js.map +1 -1
- package/dist/host/daemonHandlers.d.ts +1 -1
- package/dist/host/daemonHandlers.d.ts.map +1 -1
- package/dist/host/daemonPort.d.ts +6 -0
- package/dist/host/daemonPort.d.ts.map +1 -0
- package/dist/host/daemonPort.js +40 -0
- package/dist/host/daemonPort.js.map +1 -0
- package/dist/host/daemonSnapshots.d.ts +1 -1
- package/dist/host/daemonSnapshots.d.ts.map +1 -1
- package/dist/host/daemonSnapshots.js +1 -1
- package/dist/host/daemonSnapshots.js.map +1 -1
- package/dist/host/fleetStatus.d.ts +5 -5
- package/dist/host/follow.d.ts +1 -0
- package/dist/host/follow.d.ts.map +1 -1
- package/dist/host/follow.js +10 -4
- package/dist/host/follow.js.map +1 -1
- package/dist/host/followCommands.d.ts +2 -2
- package/dist/host/followCommands.d.ts.map +1 -1
- package/dist/host/followCommands.js +4 -2
- package/dist/host/followCommands.js.map +1 -1
- package/dist/host/githubApi.js +1 -1
- package/dist/host/githubApi.js.map +1 -1
- package/dist/host/githubDelivery.js +3 -1
- package/dist/host/githubDelivery.js.map +1 -1
- package/dist/host/healthLayer.js +1 -1
- package/dist/host/healthLayer.js.map +1 -1
- package/dist/host/integrations.js +1 -1
- package/dist/host/integrations.js.map +1 -1
- package/dist/host/mainSource.js +1 -1
- package/dist/host/mainSource.js.map +1 -1
- package/dist/host/providerHealth.js +1 -1
- package/dist/host/providerHealth.js.map +1 -1
- package/dist/host/quota.js +1 -1
- package/dist/host/quota.js.map +1 -1
- package/dist/host/recordDecisionResponse.d.ts +3 -2
- package/dist/host/recordDecisionResponse.d.ts.map +1 -1
- package/dist/host/recordDecisionResponse.js +1 -1
- package/dist/host/recordDecisionResponse.js.map +1 -1
- package/dist/host/releaseWork.d.ts +6 -9
- package/dist/host/releaseWork.d.ts.map +1 -1
- package/dist/host/releaseWork.js +2 -2
- package/dist/host/releaseWork.js.map +1 -1
- package/dist/host/renderStatus.d.ts +4 -1
- package/dist/host/renderStatus.d.ts.map +1 -1
- package/dist/host/renderStatus.js +6 -6
- package/dist/host/renderStatus.js.map +1 -1
- package/dist/host/reportBoard.js +1 -1
- package/dist/host/reportBoard.js.map +1 -1
- package/dist/host/runtime.d.ts +2 -2
- package/dist/host/runtime.d.ts.map +1 -1
- package/dist/host/runtime.js +1 -1
- package/dist/host/runtime.js.map +1 -1
- package/dist/host/statusLayer.js +2 -2
- package/dist/host/statusLayer.js.map +1 -1
- package/dist/host/watch.d.ts.map +1 -1
- package/dist/host/watch.js +1 -1
- package/dist/host/watch.js.map +1 -1
- package/dist/model.d.ts +9 -12
- package/dist/model.d.ts.map +1 -1
- package/dist/model.js +1 -2
- package/dist/model.js.map +1 -1
- package/dist/operations.d.ts +57 -99
- 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 +3 -2
- package/dist/policy.d.ts.map +1 -1
- package/dist/policy.js +2 -1
- package/dist/policy.js.map +1 -1
- package/dist/prompt/briefEdit.js +1 -1
- package/dist/prompt/briefEdit.js.map +1 -1
- package/dist/providers/codexCloud.js +1 -1
- package/dist/providers/codexCloud.js.map +1 -1
- package/dist/providers/codexLocal.js +1 -1
- package/dist/providers/codexLocal.js.map +1 -1
- package/dist/qualifyDependencies.d.ts +2 -4
- package/dist/qualifyDependencies.d.ts.map +1 -1
- package/dist/reportFileDirectory.js +1 -1
- package/dist/reportFileDirectory.js.map +1 -1
- package/dist/scheduling/admission.d.ts +6 -12
- package/dist/scheduling/admission.d.ts.map +1 -1
- package/dist/scheduling/areas.d.ts +7 -12
- package/dist/scheduling/areas.d.ts.map +1 -1
- package/dist/scheduling/areas.js +2 -2
- package/dist/scheduling/areas.js.map +1 -1
- package/dist/scheduling/backPressure.d.ts +6 -12
- package/dist/scheduling/backPressure.d.ts.map +1 -1
- package/dist/session/schema.d.ts +1 -1
- package/dist/session/service.js +1 -1
- package/dist/session/service.js.map +1 -1
- package/dist/storage/fleetMigrations.d.ts.map +1 -1
- package/dist/storage/fleetMigrations.js +10 -0
- package/dist/storage/fleetMigrations.js.map +1 -1
- package/dist/storage/makeFleetTransaction.d.ts +1 -1
- package/dist/storage/makeFleetTransaction.d.ts.map +1 -1
- package/dist/storage/makeFleetTransaction.js +1 -1
- package/dist/storage/makeFleetTransaction.js.map +1 -1
- package/dist/storage/makeForeignReservations.d.ts.map +1 -1
- package/dist/storage/makeForeignReservations.js +16 -4
- package/dist/storage/makeForeignReservations.js.map +1 -1
- package/dist/storage/model.d.ts +1 -0
- package/dist/storage/model.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/DecisionCode.ts +1 -0
- package/src/board/acknowledgeDecision.ts +11 -5
- package/src/board/briefRevision.ts +2 -2
- package/src/board/closePublishedDecision.ts +51 -0
- package/src/board/decisionAnswer.ts +11 -9
- package/src/board/decisionReading.ts +3 -3
- package/src/board/documents.ts +5 -6
- package/src/board/fleetField.ts +1 -1
- package/src/board/markdown.ts +6 -5
- package/src/board/publish.ts +10 -8
- package/src/board/publishReport.ts +2 -2
- package/src/board/readDocument.ts +1 -1
- package/src/board/readPass.ts +2 -2
- package/src/board/reportIdentity.ts +1 -1
- package/src/board/reportLinks.ts +1 -1
- package/src/board/schema.ts +2 -2
- package/src/board/upgradeDecisionClosure.ts +61 -0
- package/src/board/workRevision.ts +2 -2
- package/src/board/writeHealth.ts +2 -2
- package/src/board/writePublished.ts +13 -4
- package/src/cli.ts +13 -5
- package/src/engine/authorizeResolution.ts +1 -1
- package/src/engine/boardBrief.ts +11 -19
- package/src/engine/decisionCopy.ts +63 -0
- package/src/engine/dispatchCommand.ts +4 -36
- package/src/engine/dispatchFailure.ts +25 -0
- package/src/engine/failureCode.ts +1 -1
- package/src/engine/health.ts +1 -1
- package/src/engine/makeDeliver.ts +5 -1
- package/src/engine/makeState.ts +24 -5
- package/src/engine/mergeReadiness.ts +0 -2
- package/src/engine/missingBoardWork.ts +24 -0
- package/src/engine/obtainReview.ts +1 -1
- package/src/engine/pendingAcknowledgements.ts +9 -1
- package/src/engine/readOrContinueReview.ts +1 -1
- package/src/engine/readResolution.ts +2 -2
- package/src/engine/reconcileCommand.ts +7 -1
- package/src/engine/releaseFinishedWork.ts +0 -1
- package/src/engine/repository.ts +1 -1
- package/src/engine/saveLaunch.ts +27 -2
- package/src/engine/scheduler.ts +4 -1
- package/src/engine/situations/choices.ts +36 -0
- package/src/engine/situations/service.ts +82 -0
- package/src/engine/situations/stop.ts +60 -0
- package/src/engine/situations/work.ts +94 -0
- package/src/engine/threadNames.ts +1 -1
- package/src/exposeFailure.ts +1 -1
- package/src/fleet.ts +1 -1
- package/src/host/actionCommands.ts +6 -6
- package/src/host/cliOptions.ts +10 -5
- package/src/host/daemon.ts +7 -3
- package/src/host/daemonClient.ts +1 -1
- package/src/host/daemonContract.ts +1 -1
- package/src/host/daemonDiagnostics.ts +1 -1
- package/src/host/daemonPort.ts +50 -0
- package/src/host/daemonSnapshots.ts +1 -1
- package/src/host/follow.ts +16 -5
- package/src/host/followCommands.ts +4 -2
- package/src/host/githubApi.ts +1 -1
- package/src/host/githubDelivery.ts +3 -1
- package/src/host/healthLayer.ts +1 -1
- package/src/host/integrations.ts +1 -1
- package/src/host/mainSource.ts +1 -1
- package/src/host/providerHealth.ts +1 -1
- package/src/host/quota.ts +1 -1
- package/src/host/recordDecisionResponse.ts +1 -1
- package/src/host/releaseWork.ts +2 -2
- package/src/host/renderStatus.ts +6 -7
- package/src/host/reportBoard.ts +1 -1
- package/src/host/runtime.ts +1 -1
- package/src/host/statusLayer.ts +3 -3
- package/src/host/watch.ts +4 -1
- package/src/model.ts +1 -2
- package/src/packageInfo.ts +1 -1
- package/src/policy.ts +2 -1
- package/src/prompt/briefEdit.ts +1 -1
- package/src/providers/codexCloud.ts +1 -1
- package/src/providers/codexLocal.ts +1 -1
- package/src/reportFileDirectory.ts +1 -1
- package/src/scheduling/areas.ts +2 -2
- package/src/session/service.ts +1 -1
- package/src/storage/fleetMigrations.ts +10 -0
- package/src/storage/makeFleetTransaction.ts +2 -2
- package/src/storage/makeForeignReservations.ts +15 -4
- package/src/storage/model.ts +1 -1
- package/dist/engine/releaseOnly.d.ts +0 -3
- package/dist/engine/releaseOnly.d.ts.map +0 -1
- package/dist/engine/releaseOnly.js +0 -19
- package/dist/engine/releaseOnly.js.map +0 -1
- package/src/engine/releaseOnly.ts +0 -24
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { attention } from "@shivaedev/work-board/integration/attention.ts";
|
|
3
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
4
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
2
|
+
import { attention } from "@shivaedev/work-board/server/integration/attention.ts";
|
|
3
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
5
|
+
import { closePublishedDecision } from "#board/closePublishedDecision.ts";
|
|
5
6
|
import { type BoardSnapshot, recordBoardSource } from "#board/readPass.ts";
|
|
6
7
|
import { BoardAcknowledgementStale, type BoardDecisionAcknowledgement } from "#board/schema.ts";
|
|
7
8
|
import { BoardFailure } from "#policy.ts";
|
|
@@ -37,8 +38,10 @@ export function acknowledgeDecision(root: string, realRoot: string, snapshot: Ef
|
|
|
37
38
|
const content = `---\n${JSON.stringify({ id, kind: "result", "request_receipt": requestReceipt })}\n---\n# Managed request acknowledgement\n\nThis immutable receipt acknowledges request handling; it grants no execution, acceptance or delivery authority.\n`;
|
|
38
39
|
const file = `responses/${id}.md`;
|
|
39
40
|
const receiptDocument = { file, parsed: boardApi.metadataParse(content) };
|
|
40
|
-
const
|
|
41
|
-
|
|
41
|
+
const others = all.filter((document) => document.file !== file);
|
|
42
|
+
const acknowledged = others.some((document) => document.parsed.fields.requestReceipt?.question === decision.questionId);
|
|
43
|
+
const model = metadataModel([...others, receiptDocument]);
|
|
44
|
+
if (!request || acknowledged || managedRequestReceipt(source, request, model) === undefined) {
|
|
42
45
|
return yield* Effect.fail(
|
|
43
46
|
new BoardAcknowledgementStale({ message: "The exact managed question and applicable response cannot be qualified for acknowledgement." }),
|
|
44
47
|
);
|
|
@@ -47,5 +50,8 @@ export function acknowledgeDecision(root: string, realRoot: string, snapshot: Ef
|
|
|
47
50
|
Effect.mapError(() => new BoardFailure({ message: "The managed request acknowledgement could not be recorded on Board." })),
|
|
48
51
|
);
|
|
49
52
|
yield* recordBoardSource(realRoot, file, content, receiptDocument.parsed);
|
|
53
|
+
if (input.disposition === "superseded") {
|
|
54
|
+
yield* closePublishedDecision(root, realRoot, source);
|
|
55
|
+
}
|
|
50
56
|
});
|
|
51
57
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ParsedMetadata } from "@shivaedev/work-board/integration/board.ts";
|
|
2
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
1
|
+
import type { ParsedMetadata } from "@shivaedev/work-board/server/integration/board.ts";
|
|
2
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
3
3
|
import { fleetDeliverable } from "#board/fleetField.ts";
|
|
4
4
|
|
|
5
5
|
const { revisionOf } = responses;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { parseDocument } from "yaml";
|
|
3
|
+
import { board } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
|
+
import type { BoardDocument } from "#board/documents.ts";
|
|
5
|
+
import { recordBoardSource } from "#board/readPass.ts";
|
|
6
|
+
import { writeCompletion } from "#board/writeCompletion.ts";
|
|
7
|
+
import { BoardFailure } from "#policy.ts";
|
|
8
|
+
|
|
9
|
+
export function publishedDecision(document: BoardDocument) {
|
|
10
|
+
const { fields, body, diagnostics } = document.parsed;
|
|
11
|
+
const workId = fields.relationships?.find((relation) => relation.kind === "relates_to")?.target;
|
|
12
|
+
const request = fields.attention?.[0];
|
|
13
|
+
if (
|
|
14
|
+
diagnostics.length > 0
|
|
15
|
+
|| fields.kind !== "decision"
|
|
16
|
+
|| !fields.id?.startsWith("decision.")
|
|
17
|
+
|| workId === undefined
|
|
18
|
+
|| !body.startsWith(`# Fleet decision for ${workId}\n`)
|
|
19
|
+
|| fields.attention?.length !== 1
|
|
20
|
+
|| request?.managed !== true
|
|
21
|
+
|| !request.id.startsWith(`${workId}.`)
|
|
22
|
+
) {
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
const sequence = Number(request.id.slice(workId.length + 1));
|
|
26
|
+
return Number.isSafeInteger(sequence) ? { request, sequence, workId } : undefined;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export const closePublishedDecision = Effect.fn("FleetBoard.closePublishedDecision")(function* (
|
|
30
|
+
root: string,
|
|
31
|
+
realRoot: string,
|
|
32
|
+
document: BoardDocument,
|
|
33
|
+
) {
|
|
34
|
+
const decision = publishedDecision(document);
|
|
35
|
+
if (decision === undefined || decision.request.state !== "open") {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const header = document.parsed.raw;
|
|
39
|
+
if (header === undefined) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const metadata = parseDocument(header.replace(/^---\r?\n/u, "").replace(/---\r?\n?$/u, ""));
|
|
43
|
+
metadata.setIn(["attention", 0, "state"], "closed");
|
|
44
|
+
const content = `---\n${metadata.toString()}---\n${document.parsed.body}`;
|
|
45
|
+
yield* writeCompletion(root, realRoot, document.file, document.source, content).pipe(
|
|
46
|
+
Effect.mapError((error) => new BoardFailure({ message: error.message })),
|
|
47
|
+
);
|
|
48
|
+
const parsed = board.metadataParse(content);
|
|
49
|
+
yield* recordBoardSource(realRoot, document.file, content, parsed);
|
|
50
|
+
return { file: document.file, parsed, source: content };
|
|
51
|
+
});
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
1
|
+
import type { DecisionCopy } from "#engine/decisionCopy.ts";
|
|
2
|
+
import type { Choice } from "#engine/situations/choices.ts";
|
|
3
3
|
|
|
4
|
-
export function decisionAnswer(
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
4
|
+
export function decisionAnswer({ question }: DecisionCopy) {
|
|
5
|
+
if (question === undefined) {
|
|
6
|
+
return undefined;
|
|
7
7
|
}
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const retry = question.retry === undefined ? "" : `${option("retry", question.retry)}\n`;
|
|
9
|
+
return `::::question{id="fleet-action" select="one"}\n### ${question.title}\n\n${retry}${option("release", question.release)}::::`;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function option(id: string, choice: Choice) {
|
|
13
|
+
return `:::option{id="${id}"}\n### ${choice.label}\n${choice.outcome}\n:::\n`;
|
|
12
14
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
|
-
import { board } from "@shivaedev/work-board/integration/board.ts";
|
|
3
|
-
import type { Reading } from "@shivaedev/work-board/integration/responses.ts";
|
|
4
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
2
|
+
import { board } from "@shivaedev/work-board/server/integration/board.ts";
|
|
3
|
+
import type { Reading } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
4
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
5
5
|
import type { BoardDocument } from "#board/documents.ts";
|
|
6
6
|
import type { BoardDecision, BoardDecisionReading } from "#board/schema.ts";
|
|
7
7
|
import { BoardFailure } from "#policy.ts";
|
package/src/board/documents.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, FileSystem, Path } from "effect";
|
|
2
|
-
import type { MetadataDocument } from "@shivaedev/work-board/integration/board.ts";
|
|
3
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
2
|
+
import type { MetadataDocument } from "@shivaedev/work-board/server/integration/board.ts";
|
|
3
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
4
|
import { readDocument } from "#board/readDocument.ts";
|
|
5
5
|
import { BoardSnapshot, readSnapshot } from "#board/readPass.ts";
|
|
6
6
|
import { BoardFailure } from "#policy.ts";
|
|
@@ -13,6 +13,9 @@ export const snapshotDocument = Effect.fn("FleetBoard.snapshotDocument")(functio
|
|
|
13
13
|
const matches = snapshot.model.ids.get(workId);
|
|
14
14
|
const found = matches?.length === 1 ? snapshot.files.get(matches[0]?.file ?? "") : undefined;
|
|
15
15
|
if (found === undefined) {
|
|
16
|
+
if (matches === undefined && snapshot.problems.size === 0) {
|
|
17
|
+
return yield* Effect.fail(new BoardFailure({ code: "board-item-missing", message: `Board item no longer exists: ${workId}`, workId }));
|
|
18
|
+
}
|
|
16
19
|
const message = [
|
|
17
20
|
`Board identity is missing or ambiguous: ${workId}`,
|
|
18
21
|
...Array.from(snapshot.problems.values(), (failure) => failure.message),
|
|
@@ -83,7 +86,3 @@ export function boardDocuments(root: string, realRoot: string) {
|
|
|
83
86
|
export function boundSnapshot(root: string, realRoot: string, fs: FileSystem.FileSystem, path: Path.Path) {
|
|
84
87
|
return boardSnapshot(root, realRoot).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path));
|
|
85
88
|
}
|
|
86
|
-
|
|
87
|
-
export function boundDocuments(root: string, realRoot: string, fs: FileSystem.FileSystem, path: Path.Path) {
|
|
88
|
-
return boardDocuments(root, realRoot).pipe(Effect.provideService(FileSystem.FileSystem, fs), Effect.provideService(Path.Path, path));
|
|
89
|
-
}
|
package/src/board/fleetField.ts
CHANGED
package/src/board/markdown.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Context, Effect, FileSystem, Layer, Path, Schema } from "effect";
|
|
2
|
-
import { defineService } from "@shivaedev/effect-service/
|
|
3
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
2
|
+
import { defineService } from "@shivaedev/effect-service/defineService.ts";
|
|
3
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
4
|
import { acknowledgeDecision } from "#board/acknowledgeDecision.ts";
|
|
5
5
|
import { briefRevision } from "#board/briefRevision.ts";
|
|
6
6
|
import { completionMarkdown } from "#board/completionMarkdown.ts";
|
|
7
7
|
import { decisionReading } from "#board/decisionReading.ts";
|
|
8
|
-
import {
|
|
8
|
+
import { boundSnapshot, refreshSnapshotDocument, snapshotDocument } from "#board/documents.ts";
|
|
9
9
|
import { fleetApproved, fleetDeliverable, fleetPriority } from "#board/fleetField.ts";
|
|
10
10
|
import { publishBoard } from "#board/publish.ts";
|
|
11
11
|
import { publishReport } from "#board/publishReport.ts";
|
|
12
12
|
import { workMetadata } from "#board/readPass.ts";
|
|
13
|
+
import { upgradeDecisionClosure } from "#board/upgradeDecisionClosure.ts";
|
|
13
14
|
import { workRevision } from "#board/workRevision.ts";
|
|
14
15
|
import { writeCompletion } from "#board/writeCompletion.ts";
|
|
15
16
|
import { BoardFailure, BoardGateway, Priority } from "#policy.ts";
|
|
@@ -24,8 +25,8 @@ const MarkdownBoard = defineService({
|
|
|
24
25
|
const fs = yield* FileSystem.FileSystem;
|
|
25
26
|
const path = yield* Path.Path;
|
|
26
27
|
const realRoot = yield* fs.realPath(root);
|
|
27
|
-
const
|
|
28
|
-
const
|
|
28
|
+
const snapshot = boundSnapshot(root, realRoot, fs, path).pipe(Effect.tap((current) => upgradeDecisionClosure(root, realRoot, current, fs)));
|
|
29
|
+
const documents = snapshot.pipe(Effect.map((current) => current.documents.filter((document) => !current.problems.has(document.file))));
|
|
29
30
|
const get = Effect.fn("FleetBoard.get")(function* (workId: string, options?: { readonly fresh?: boolean }) {
|
|
30
31
|
const current = yield* snapshot;
|
|
31
32
|
const found = yield* options?.fresh
|
package/src/board/publish.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { relative } from "node:path";
|
|
2
2
|
import { Clock, Effect } from "effect";
|
|
3
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
4
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
3
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
5
5
|
import { decisionAnswer } from "#board/decisionAnswer.ts";
|
|
6
6
|
import type { BoardDocument } from "#board/documents.ts";
|
|
7
7
|
import { recordBoardSource } from "#board/readPass.ts";
|
|
8
8
|
import type { BoardDecision } from "#board/schema.ts";
|
|
9
|
+
import { type DecisionCopy, decisionCopy } from "#engine/decisionCopy.ts";
|
|
9
10
|
import { BoardFailure, type BoardWork, type Decision } from "#policy.ts";
|
|
10
11
|
|
|
11
12
|
const { publish, questionFrom, questionId, questionMarkdown, revisionOf } = responses;
|
|
@@ -23,14 +24,14 @@ function linked(text: string): string {
|
|
|
23
24
|
return url.protocol === "https:" || url.protocol === "http:" ? `<${url.href.replaceAll("<", "%3C").replaceAll(">", "%3E")}>` : quoted(text);
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
function decisionSource(itemId: string, work: BoardWork, input: Decision): string {
|
|
27
|
+
function decisionSource(itemId: string, work: BoardWork, input: Decision, copy: DecisionCopy): string {
|
|
27
28
|
const metadata = {
|
|
28
29
|
attention: [
|
|
29
30
|
{
|
|
30
31
|
id: input.id,
|
|
31
32
|
kind: "decision",
|
|
32
33
|
managed: true,
|
|
33
|
-
reason:
|
|
34
|
+
reason: copy.reason,
|
|
34
35
|
"response_from": [input.attentionOwner ?? "orchestrator"],
|
|
35
36
|
state: "open",
|
|
36
37
|
unblocks: [work.workId],
|
|
@@ -40,8 +41,8 @@ function decisionSource(itemId: string, work: BoardWork, input: Decision): strin
|
|
|
40
41
|
kind: "decision",
|
|
41
42
|
relationships: [{ kind: "relates_to", target: work.workId }],
|
|
42
43
|
};
|
|
43
|
-
const answer = decisionAnswer(
|
|
44
|
-
return `---\n${JSON.stringify(metadata)}\n---\n# Fleet decision for ${work.workId}\n\n## Decision\n\n${quoted(
|
|
44
|
+
const answer = decisionAnswer(copy);
|
|
45
|
+
return `---\n${JSON.stringify(metadata)}\n---\n# Fleet decision for ${work.workId}\n\n## Decision\n\n${quoted(copy.reason)}\n\n## Recommendation\n\n${quoted(copy.recommendation)}\n\n## Relevant links\n\n${input.links.map(linked).join("\n\n")}\n\n${answer === undefined ? "" : `${answer}\n\n`}## Reviewed Board work\n\n${quoted(work.context)}\n`;
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export function publishBoard(root: string, realRoot: string, documents: Effect.Effect<readonly BoardDocument[], BoardFailure>) {
|
|
@@ -49,7 +50,8 @@ export function publishBoard(root: string, realRoot: string, documents: Effect.E
|
|
|
49
50
|
const workSourcePath = relative(realRoot, work.sourcePath);
|
|
50
51
|
const itemId = `decision.${revisionOf(JSON.stringify([work.workId, work.revision, workSourcePath, input.id, input.reason, input.recommendation, input.links, ...(input.worker === undefined ? [] : [input.worker])]))}`;
|
|
51
52
|
const existing = input.published === undefined ? undefined : (yield* documents).find((document) => document.file === input.published?.sourcePath);
|
|
52
|
-
const
|
|
53
|
+
const copy = decisionCopy(input);
|
|
54
|
+
const context = existing?.parsed.fields.id === itemId ? existing.source : decisionSource(itemId, work, input, copy);
|
|
53
55
|
const parsed = boardApi.metadataParse(context);
|
|
54
56
|
if (new TextEncoder().encode(context).length > 256 * 1024 || parsed.diagnostics.length > 0) {
|
|
55
57
|
return yield* Effect.fail(new BoardFailure({ message: "Fleet decision context exceeds Board limits or contains invalid attention metadata." }));
|
|
@@ -82,7 +84,7 @@ export function publishBoard(root: string, realRoot: string, documents: Effect.E
|
|
|
82
84
|
question: {
|
|
83
85
|
deadline: registeredAt + 48 * 60 * 60 * 1000,
|
|
84
86
|
item: itemId,
|
|
85
|
-
reason:
|
|
87
|
+
reason: copy.reason,
|
|
86
88
|
registeredAt,
|
|
87
89
|
request: input.id,
|
|
88
90
|
reviewedRevision: revision,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { relative } from "node:path";
|
|
2
2
|
import { Effect } from "effect";
|
|
3
|
-
import { board } from "@shivaedev/work-board/integration/board.ts";
|
|
4
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
3
|
+
import { board } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
5
5
|
import { briefRevision } from "#board/briefRevision.ts";
|
|
6
6
|
import type { BoardDocument } from "#board/documents.ts";
|
|
7
7
|
import { recordBoardSource, workMetadata } from "#board/readPass.ts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, FileSystem } from "effect";
|
|
2
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
2
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
3
3
|
import { STATUS_MARKER } from "#board/statusMarkdown.ts";
|
|
4
4
|
import { BoardFailure } from "#policy.ts";
|
|
5
5
|
|
package/src/board/readPass.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { Context, Effect, type FileSystem, type Path } from "effect";
|
|
3
|
-
import type { MetadataModel, ParsedMetadata } from "@shivaedev/work-board/integration/board.ts";
|
|
4
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
3
|
+
import type { MetadataModel, ParsedMetadata } from "@shivaedev/work-board/server/integration/board.ts";
|
|
4
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
5
5
|
import type { BoardDocument } from "#board/documents.ts";
|
|
6
6
|
import type { BoardFailure, BoardWork } from "#policy.ts";
|
|
7
7
|
|
package/src/board/reportLinks.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
2
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
3
3
|
import type { ReportFile, UnavailableAttachment } from "#reportAttachments.ts";
|
|
4
4
|
|
|
5
5
|
const { revisionOf } = responses;
|
package/src/board/schema.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
|
-
import { attention } from "@shivaedev/work-board/integration/attention.ts";
|
|
3
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
2
|
+
import { attention } from "@shivaedev/work-board/server/integration/attention.ts";
|
|
3
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
4
4
|
import { SessionReceipt } from "#session/schema.ts";
|
|
5
5
|
|
|
6
6
|
const { RequestReceipt } = attention;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { Effect, type FileSystem } from "effect";
|
|
2
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
3
|
+
import { closePublishedDecision, publishedDecision } from "#board/closePublishedDecision.ts";
|
|
4
|
+
import type { BoardDocument } from "#board/documents.ts";
|
|
5
|
+
import type { BoardSnapshot } from "#board/readPass.ts";
|
|
6
|
+
import { writePublished } from "#board/writePublished.ts";
|
|
7
|
+
import { BoardFailure } from "#policy.ts";
|
|
8
|
+
|
|
9
|
+
const MARKER = ".fleet-decision-closure-v1.json";
|
|
10
|
+
|
|
11
|
+
export const upgradeDecisionClosure = Effect.fn("FleetBoard.upgradeDecisionClosure")(function* (
|
|
12
|
+
root: string,
|
|
13
|
+
realRoot: string,
|
|
14
|
+
snapshot: BoardSnapshot,
|
|
15
|
+
fs: FileSystem.FileSystem,
|
|
16
|
+
) {
|
|
17
|
+
if (yield* fs.exists(`${realRoot}/${MARKER}`).pipe(Effect.mapError((error) => new BoardFailure({ message: error.message })))) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (snapshot.problems.size > 0) {
|
|
21
|
+
yield* Effect.logWarning("Fleet decision closure upgrade deferred because the Board has problems", { problems: snapshot.problems.size });
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const documents = snapshot.documents;
|
|
25
|
+
const latest = latestSequences(documents);
|
|
26
|
+
const superseded = new Set(
|
|
27
|
+
documents.flatMap((document) => {
|
|
28
|
+
const receipt = document.parsed.fields.requestReceipt;
|
|
29
|
+
return receipt?.disposition === "superseded" ? [receipt.question] : [];
|
|
30
|
+
}),
|
|
31
|
+
);
|
|
32
|
+
const questions = new Map(
|
|
33
|
+
documents.flatMap((document) => {
|
|
34
|
+
const question = responses.questionFrom(document);
|
|
35
|
+
return question === undefined ? [] : [[question.question.source, question.id] as const];
|
|
36
|
+
}),
|
|
37
|
+
);
|
|
38
|
+
for (const document of documents) {
|
|
39
|
+
const decision = publishedDecision(document);
|
|
40
|
+
if (decision !== undefined && (decision.sequence < (latest.get(decision.workId) ?? -1) || superseded.has(questions.get(document.file) ?? ""))) {
|
|
41
|
+
const closed = yield* closePublishedDecision(root, realRoot, document);
|
|
42
|
+
if (closed !== undefined) {
|
|
43
|
+
snapshot.record(closed);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
yield* writePublished(root, realRoot, MARKER, '{"version":1}\n', (source) => source === '{"version":1}\n').pipe(
|
|
48
|
+
Effect.mapError((error) => new BoardFailure({ message: error.message })),
|
|
49
|
+
);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
function latestSequences(documents: readonly BoardDocument[]) {
|
|
53
|
+
const latest = new Map<string, number>();
|
|
54
|
+
for (const document of documents) {
|
|
55
|
+
const decision = publishedDecision(document);
|
|
56
|
+
if (decision !== undefined) {
|
|
57
|
+
latest.set(decision.workId, Math.max(latest.get(decision.workId) ?? -1, decision.sequence));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return latest;
|
|
61
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { board as boardApi } from "@shivaedev/work-board/integration/board.ts";
|
|
2
|
-
import { responses } from "@shivaedev/work-board/integration/responses.ts";
|
|
1
|
+
import { board as boardApi } from "@shivaedev/work-board/server/integration/board.ts";
|
|
2
|
+
import { responses } from "@shivaedev/work-board/server/integration/responses.ts";
|
|
3
3
|
import { briefRevision } from "#board/briefRevision.ts";
|
|
4
4
|
|
|
5
5
|
const { revisionOf } = responses;
|
package/src/board/writeHealth.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect, Schema } from "effect";
|
|
2
|
-
import type { FleetHealth as BoardFleetHealth } from "@shivaedev/work-board/integration/diagnostics.ts";
|
|
3
|
-
import { diagnostics as diagnosticsApi } from "@shivaedev/work-board/integration/diagnostics.ts";
|
|
2
|
+
import type { FleetHealth as BoardFleetHealth } from "@shivaedev/work-board/server/integration/diagnostics.ts";
|
|
3
|
+
import { diagnostics as diagnosticsApi } from "@shivaedev/work-board/server/integration/diagnostics.ts";
|
|
4
4
|
import { writePublished } from "#board/writePublished.ts";
|
|
5
5
|
import { BoardFailure } from "#policy.ts";
|
|
6
6
|
|
|
@@ -4,7 +4,12 @@ import { Effect } from "effect";
|
|
|
4
4
|
import { type ReportDirectory, validateReportDirectory, withReportDirectory } from "#reportFileDirectory.ts";
|
|
5
5
|
import { hasFileCode, ReportFileFailure, reportFileIo, withReportFile } from "#reportFileFailure.ts";
|
|
6
6
|
|
|
7
|
-
function unchanged(
|
|
7
|
+
function unchanged(
|
|
8
|
+
folder: string,
|
|
9
|
+
name: "status.md" | "health.json" | ".fleet-decision-closure-v1.json",
|
|
10
|
+
content: string,
|
|
11
|
+
owns: (source: string) => boolean,
|
|
12
|
+
) {
|
|
8
13
|
const label = `fleet/${name}`;
|
|
9
14
|
return withReportFile(
|
|
10
15
|
label,
|
|
@@ -27,7 +32,7 @@ function unchanged(folder: string, name: "status.md" | "health.json", content: s
|
|
|
27
32
|
const publish = Effect.fnUntraced(function* (
|
|
28
33
|
directory: ReportDirectory,
|
|
29
34
|
target: ReportDirectory,
|
|
30
|
-
name: "status.md" | "health.json",
|
|
35
|
+
name: "status.md" | "health.json" | ".fleet-decision-closure-v1.json",
|
|
31
36
|
content: string,
|
|
32
37
|
owns: (source: string) => boolean,
|
|
33
38
|
) {
|
|
@@ -54,13 +59,17 @@ const publish = Effect.fnUntraced(function* (
|
|
|
54
59
|
export const writePublished = Effect.fn("Fleet.writePublished")(function* (
|
|
55
60
|
root: string,
|
|
56
61
|
realRoot: string,
|
|
57
|
-
name: "status.md" | "health.json",
|
|
62
|
+
name: "status.md" | "health.json" | ".fleet-decision-closure-v1.json",
|
|
58
63
|
content: string,
|
|
59
64
|
owns: (source: string) => boolean,
|
|
60
65
|
) {
|
|
61
|
-
const
|
|
66
|
+
const upgrade = name === ".fleet-decision-closure-v1.json";
|
|
67
|
+
const label = upgrade ? name : `fleet/${name}`;
|
|
62
68
|
return yield* withReportDirectory(label, root, realRoot, (directory) =>
|
|
63
69
|
Effect.gen(function* () {
|
|
70
|
+
if (upgrade) {
|
|
71
|
+
return yield* publish(directory, directory, name, content, owns);
|
|
72
|
+
}
|
|
64
73
|
yield* reportFileIo(label, () => mkdir(`${directory.folder}/fleet`)).pipe(
|
|
65
74
|
Effect.catchTag("ReportFileFailure", (error) => (hasFileCode(error.cause, "EEXIST") ? Effect.void : Effect.fail(error))),
|
|
66
75
|
);
|
package/src/cli.ts
CHANGED
|
@@ -11,7 +11,7 @@ import * as Flag from "effect/cli/Flag";
|
|
|
11
11
|
import * as Effect from "effect/Effect";
|
|
12
12
|
import * as Option from "effect/Option";
|
|
13
13
|
import { answerCommand, continueCommand, nameThreadsCommand, reassignCommand, releaseCommand } from "#host/actionCommands.ts";
|
|
14
|
-
import { board, config, host, port } from "#host/cliOptions.ts";
|
|
14
|
+
import { board, clientPort, config, host, port } from "#host/cliOptions.ts";
|
|
15
15
|
import { waitCommand, watchCommand } from "#host/followCommands.ts";
|
|
16
16
|
import { VERSION } from "#packageInfo.ts";
|
|
17
17
|
|
|
@@ -20,7 +20,7 @@ const serveCommand = Command.make(
|
|
|
20
20
|
{ board: Argument.Directory("board-dir"), config, port },
|
|
21
21
|
Effect.fn("WorkFleetCli.serve")(function* (input) {
|
|
22
22
|
const { serveFleet } = yield* Effect.promise(() => import("#host/daemon.ts"));
|
|
23
|
-
yield* serveFleet(yield* host(input.board, input.config), undefined, input.port);
|
|
23
|
+
yield* serveFleet(yield* host(input.board, input.config), undefined, Option.getOrUndefined(input.port));
|
|
24
24
|
}),
|
|
25
25
|
).pipe(Command.withDescription("Serve the local Fleet HTTP RPC daemon and schedule approved Board work"));
|
|
26
26
|
|
|
@@ -40,7 +40,7 @@ const dispatchCommand = Command.make(
|
|
|
40
40
|
Effect.fn("WorkFleetCli.dispatch")(function* (input) {
|
|
41
41
|
const { daemonRequest } = yield* Effect.promise(() => import("#host/daemonClient.ts"));
|
|
42
42
|
const value = yield* daemonRequest(
|
|
43
|
-
input
|
|
43
|
+
yield* clientPort(input),
|
|
44
44
|
(client) => client("daemon.dispatch", { ignoreAreas: input.ignoreAreas, now: input.now, workId: input.workId }),
|
|
45
45
|
`dispatch ${input.workId}`,
|
|
46
46
|
);
|
|
@@ -62,12 +62,20 @@ const statusCommand = Command.make(
|
|
|
62
62
|
Promise.all([import("#host/daemonClient.ts"), import("#host/renderStatus.ts")]),
|
|
63
63
|
);
|
|
64
64
|
const workId = Option.getOrUndefined(input.workId);
|
|
65
|
+
const daemonPort = yield* clientPort(input);
|
|
65
66
|
const current = yield* daemonRequest(
|
|
66
|
-
|
|
67
|
+
daemonPort,
|
|
67
68
|
(client) => client("daemon.status", workId === undefined ? {} : { workId }),
|
|
68
69
|
workId === undefined ? "status" : `status ${workId}`,
|
|
69
70
|
);
|
|
70
|
-
yield* Console.log(
|
|
71
|
+
yield* Console.log(
|
|
72
|
+
input.json
|
|
73
|
+
? JSON.stringify(current)
|
|
74
|
+
: renderStatus(current, {
|
|
75
|
+
board: input.board,
|
|
76
|
+
...Option.match(input.port, { onNone: () => ({}), onSome: (value) => ({ port: value }) }),
|
|
77
|
+
}),
|
|
78
|
+
);
|
|
71
79
|
}),
|
|
72
80
|
).pipe(Command.withDescription("Show active and completed Fleet work, and waiting work grouped by owner"));
|
|
73
81
|
|
|
@@ -17,7 +17,7 @@ export const authorizeResolution = Effect.fn("Fleet.authorizeResolution")(functi
|
|
|
17
17
|
if (executing(record)) {
|
|
18
18
|
return yield* Effect.fail(new Forbidden({ message: "Confirm terminal execution before releasing ownership" }));
|
|
19
19
|
}
|
|
20
|
-
if (record.result?.kind === "change") {
|
|
20
|
+
if (record.result?.kind === "change" && record.decision?.code !== "pr-closed") {
|
|
21
21
|
yield* state.store.reserveForeign(record.result.pr, { backlog: true, executing: false });
|
|
22
22
|
}
|
|
23
23
|
});
|
package/src/engine/boardBrief.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Effect } from "effect";
|
|
2
2
|
import { Conflict, Forbidden } from "@shivaedev/platform/errors/taxonomy.ts";
|
|
3
3
|
import { workRevision } from "#board/workRevision.ts";
|
|
4
|
-
import { closeDecisions } from "#engine/closeDecisions.ts";
|
|
5
4
|
import { withFailureContext } from "#engine/failureContext.ts";
|
|
6
5
|
import type { EngineState } from "#engine/makeState.ts";
|
|
7
6
|
import type { FleetRecord } from "#model.ts";
|
|
8
7
|
import type { BoardWork } from "#policy.ts";
|
|
9
8
|
import type { Versioned } from "#storage/model.ts";
|
|
10
9
|
|
|
11
|
-
const CHANGED_BRIEF_REASON = "Board context changed";
|
|
10
|
+
export const CHANGED_BRIEF_REASON = "Board context changed";
|
|
12
11
|
|
|
13
12
|
export function briefChanged(record: Pick<FleetRecord, "boardRevision" | "boardContext">, work: BoardWork): boolean {
|
|
14
13
|
return workRevision(record.boardRevision, record.boardContext) !== workRevision(work.revision, work.context);
|
|
@@ -33,7 +32,7 @@ export const authorizeBriefContext = Effect.fn("Fleet.authorizeBriefContext")(fu
|
|
|
33
32
|
) {
|
|
34
33
|
yield* authorizeBrief(work);
|
|
35
34
|
if (briefChanged(record, work)) {
|
|
36
|
-
return yield* withFailureContext(new Conflict({ message: CHANGED_BRIEF_REASON }), {
|
|
35
|
+
return yield* withFailureContext(new Conflict({ message: CHANGED_BRIEF_REASON }), { code: "fleet-stale" });
|
|
37
36
|
}
|
|
38
37
|
});
|
|
39
38
|
|
|
@@ -53,29 +52,22 @@ export function stopChangedBrief(state: EngineState) {
|
|
|
53
52
|
) {
|
|
54
53
|
return stored;
|
|
55
54
|
}
|
|
56
|
-
const published = stored.value.decision?.published;
|
|
57
55
|
const stopped = yield* state.save(stored, {
|
|
58
56
|
...stored.value,
|
|
59
57
|
checks: undefined,
|
|
60
58
|
mergeReadyAt: undefined,
|
|
61
59
|
mergeReadyHead: undefined,
|
|
62
60
|
review: undefined,
|
|
63
|
-
supersededDecisions:
|
|
64
|
-
published === undefined
|
|
65
|
-
? stored.value.supersededDecisions
|
|
66
|
-
: [...(stored.value.supersededDecisions ?? []), { published, supersededAt: state.policy.now() }],
|
|
67
61
|
});
|
|
68
|
-
return yield* state
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
)
|
|
78
|
-
.pipe(Effect.flatMap(closeDecisions(state)));
|
|
62
|
+
return yield* state.decision(
|
|
63
|
+
stopped,
|
|
64
|
+
"fleet-stale",
|
|
65
|
+
CHANGED_BRIEF_REASON,
|
|
66
|
+
"Dispatch to approve the current brief in place, retry this decision, or safely release this work",
|
|
67
|
+
undefined,
|
|
68
|
+
undefined,
|
|
69
|
+
work,
|
|
70
|
+
);
|
|
79
71
|
});
|
|
80
72
|
}
|
|
81
73
|
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import type { DecisionCode } from "#DecisionCode.ts";
|
|
2
|
+
import { CHANGED_BRIEF_REASON } from "#engine/boardBrief.ts";
|
|
3
|
+
import { blocked, type Choice, RELEASE, type Situation } from "#engine/situations/choices.ts";
|
|
4
|
+
import { serviceSituations } from "#engine/situations/service.ts";
|
|
5
|
+
import { stopSituations } from "#engine/situations/stop.ts";
|
|
6
|
+
import { workSituations } from "#engine/situations/work.ts";
|
|
7
|
+
import type { Decision } from "#policy.ts";
|
|
8
|
+
|
|
9
|
+
export interface DecisionCopy {
|
|
10
|
+
readonly question?: {
|
|
11
|
+
readonly title: string;
|
|
12
|
+
readonly retry?: Choice;
|
|
13
|
+
readonly release: Choice;
|
|
14
|
+
};
|
|
15
|
+
readonly reason: string;
|
|
16
|
+
readonly recommendation: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const situations: Readonly<Record<DecisionCode, Situation>> = { ...serviceSituations, ...stopSituations, ...workSituations };
|
|
20
|
+
|
|
21
|
+
const changedBrief: Situation = {
|
|
22
|
+
happened: "The task was edited on the Board while this work was waiting.",
|
|
23
|
+
question: "Continue with the edited task?",
|
|
24
|
+
recommendation: "Fleet needs to know whether the edited task still fits the work done so far. If it does, continue. Otherwise stop here.",
|
|
25
|
+
retry: {
|
|
26
|
+
label: "Continue on the updated task",
|
|
27
|
+
outcome: "Fleet accepts the edited task and continues the same work with it, on the same branch and PR.",
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const uncoded = blocked("Fleet stopped and needs your decision.", "Check the details, then let Fleet try again, or stop here.");
|
|
32
|
+
|
|
33
|
+
const WORKER =
|
|
34
|
+
"The worker needs your answer to keep going. Write it on this card. Fleet passes it to the same worker, which continues where it stopped.";
|
|
35
|
+
|
|
36
|
+
export function decisionCopy(decision: Pick<Decision, "code" | "publicationWork" | "reason" | "worker">): DecisionCopy {
|
|
37
|
+
if (decision.worker !== undefined) {
|
|
38
|
+
return { reason: decision.reason, recommendation: WORKER };
|
|
39
|
+
}
|
|
40
|
+
const situation = situationOf(decision);
|
|
41
|
+
const detailed = situation.details === true && decision.reason.trim() !== "" && decision.reason !== decision.code;
|
|
42
|
+
return {
|
|
43
|
+
question: {
|
|
44
|
+
release: situation.release ?? RELEASE,
|
|
45
|
+
title: situation.question ?? "What should Fleet do next?",
|
|
46
|
+
...(situation.retry === undefined ? {} : { retry: situation.retry }),
|
|
47
|
+
},
|
|
48
|
+
reason: detailed ? `${situation.happened}\n\nDetails: ${decision.reason}` : situation.happened,
|
|
49
|
+
recommendation: situation.recommendation,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function releaseOnly(code: DecisionCode | undefined) {
|
|
54
|
+
const situation = code === undefined ? undefined : situations[code];
|
|
55
|
+
return situation?.retry === undefined ? situation?.recommendation : undefined;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function situationOf(decision: Pick<Decision, "code" | "publicationWork" | "reason">) {
|
|
59
|
+
if (decision.code === "fleet-stale" && decision.reason === CHANGED_BRIEF_REASON && decision.publicationWork !== undefined) {
|
|
60
|
+
return changedBrief;
|
|
61
|
+
}
|
|
62
|
+
return decision.code === undefined ? uncoded : situations[decision.code];
|
|
63
|
+
}
|