@zq-silk/yui 0.15.7 → 0.15.9
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/ARCHITECTURE.md +194 -399
- package/ARCHITECTURE.zh-CN.md +151 -0
- package/README.md +306 -1131
- package/dist/agent/adapterCatalog.js +15 -2
- package/dist/agent/agent.js +23 -3
- package/dist/agent/argumentPolicy.js +7 -1
- package/dist/agent/connectionPlan.js +62 -0
- package/dist/agent/executionComponents.js +158 -0
- package/dist/agent/launchEnvironment.js +31 -3
- package/dist/agent/managedRuntimeEnvironment.js +3 -5
- package/dist/{turn/turn.js → agentRun/agentRun.js} +166 -109
- package/dist/{turn/turnIdentity.js → agentRun/runIdentity.js} +4 -4
- package/dist/artifacts/artifactCapability.js +74 -0
- package/dist/artifacts/artifactCommitLock.js +249 -0
- package/dist/artifacts/artifactPaths.js +151 -0
- package/dist/artifacts/gitArtifactRef.js +146 -0
- package/dist/artifacts/managedGit.js +332 -0
- package/dist/artifacts/taskArtifactRepository.js +277 -0
- package/dist/brief/taskBrief.js +12 -0
- package/dist/cli/agentConfigurationPicker.js +13 -0
- package/dist/cli/commandCatalog.js +165 -74
- package/dist/cli/interactionCandidates.js +5 -5
- package/dist/cli/interactionPolicy.js +38 -8
- package/dist/cli/invocationRouter.js +1 -1
- package/dist/cli/managedDiagnostics.js +28 -0
- package/dist/cli/operatorWizard.js +1 -7
- package/dist/cli/roleOptionOrder.js +27 -0
- package/dist/cli/roleWizard.js +50 -14
- package/dist/cli/updateOrchestrator.js +1 -1
- package/dist/cli/updatePorts.js +3 -4
- package/dist/cli.js +245 -95
- package/dist/commands/agentCommands.js +72 -14
- package/dist/commands/capabilityCommands.js +9 -6
- package/dist/commands/configCommands.js +20 -20
- package/dist/commands/deliveryGuardPreflight.js +2 -2
- package/dist/commands/executionAuditCommands.js +24 -24
- package/dist/commands/globalRoleCommands.js +1 -1
- package/dist/commands/grantCommands.js +4 -4
- package/dist/commands/operatorCommands.js +34 -9
- package/dist/commands/projectCommands.js +4 -4
- package/dist/commands/resourcesCommands.js +2 -2
- package/dist/commands/roleConfiguration.js +25 -5
- package/dist/commands/roleRuntimeGuard.js +4 -5
- package/dist/commands/sessionCommands.js +3 -7
- package/dist/commands/taskActivationCommands.js +281 -0
- package/dist/commands/taskActor.js +28 -49
- package/dist/commands/taskCommands.js +1461 -720
- package/dist/commands/taskContextCommand.js +39 -583
- package/dist/commands/taskExecutionCommands.js +32 -32
- package/dist/commands/taskInputCommands.js +40 -104
- package/dist/commands/taskIntegrationCommands.js +3 -2
- package/dist/commands/taskIntegrationQueueCommands.js +1 -1
- package/dist/commands/taskNextActionCommand.js +8 -8
- package/dist/commands/taskOverviewCommand.js +33 -45
- package/dist/commands/taskRemoteDeliveryCommand.js +2 -2
- package/dist/commands/taskRoleRuntimeStatus.js +133 -102
- package/dist/commands/telemetryCommands.js +36 -38
- package/dist/config/configCatalog.js +4 -4
- package/dist/config/yuiConfig.js +8 -8
- package/dist/context/contextSnapshot.js +10 -10
- package/dist/context/dispatchContext.js +11 -11
- package/dist/context/roleSessionContext.js +6 -3
- package/dist/context/{turnContextPack.js → runContextPack.js} +158 -81
- package/dist/context/{turnInputContract.js → runInputContract.js} +73 -60
- package/dist/context/sessionBootstrapManifest.js +21 -2
- package/dist/context/sourceRunContext.js +30 -0
- package/dist/context/taskContext.js +481 -0
- package/dist/context/wakeNotification.js +27 -27
- package/dist/controller/agentRuntimeObserver.js +21 -24
- package/dist/controller/capabilityBridge.js +17 -6
- package/dist/controller/clientRuntime.js +65 -92
- package/dist/controller/controller.js +120 -188
- package/dist/controller/fileSchedulerStoreAdapter.js +787 -887
- package/dist/controller/jobControl.js +54 -85
- package/dist/controller/resourceInventory.js +8 -27
- package/dist/controller/resourceInventoryLinux.js +12 -13
- package/dist/controller/runtime.js +529 -479
- package/dist/controller/runtimeEventInbox.js +55 -25
- package/dist/controller/runtimeEventProcessor.js +22 -31
- package/dist/controller/{runtimeHookTurnFence.js → runtimeHookRunFence.js} +91 -115
- package/dist/controller/runtimeLaunchCoordinator.js +80 -426
- package/dist/controller/runtimeObservationHook.js +14 -18
- package/dist/controller/sessionNotify.js +16 -24
- package/dist/controller/sessionOwnerReconciliation.js +168 -50
- package/dist/controller/structuredProviderObservation.js +138 -99
- package/dist/coordination/workMailbox.js +3 -3
- package/dist/coordination/workMailboxQueue.js +36 -33
- package/dist/core/boundedRpc.js +8 -1
- package/dist/core/controllerClient.js +20 -1
- package/dist/core/controllerServer.js +4 -4
- package/dist/doctor/doctor.js +13 -2
- package/dist/domain/agentResultTransport.js +9 -9
- package/dist/execution/codexThreadNaming.js +2 -8
- package/dist/execution/executionHealth.js +51 -63
- package/dist/execution/reviewMainRun.js +137 -0
- package/dist/execution/workItemExecution.js +28 -29
- package/dist/execution/workItemExecutionProjection.js +99 -107
- package/dist/execution/workItemMainRun.js +141 -0
- package/dist/executor/agentAdapter.js +227 -20
- package/dist/executor/agentConfigurationCatalog.js +126 -4
- package/dist/executor/agentConfigurationProbe.js +162 -4
- package/dist/executor/agentExecutor.js +79 -78
- package/dist/executor/effectiveLaunch.js +105 -18
- package/dist/executor/executorRegistry.js +29 -44
- package/dist/executor/fileRoleLaunchPlanner.js +229 -154
- package/dist/executor/workspacePreflightClassification.js +16 -16
- package/dist/grant/capabilityGrant.js +6 -3
- package/dist/input/inputRequest.js +12 -10
- package/dist/integration/gitIntegrationService.js +4 -11
- package/dist/integration/integrationQueueService.js +4 -4
- package/dist/interaction/operatorPresentation.js +1 -1
- package/dist/kernel/builtinCapabilities.js +255 -12
- package/dist/kernel/capabilityRegistry.js +64 -18
- package/dist/kernel/instanceHost.js +12 -1
- package/dist/kernel/kernelPorts.js +2 -2
- package/dist/lifecycle/canonicalLifecycleEvent.js +44 -49
- package/dist/lifecycle/exactRunTerminalization.js +449 -0
- package/dist/message/message.js +118 -6
- package/dist/message/messageContinuation.js +204 -0
- package/dist/observability/executionAudit.js +70 -72
- package/dist/observability/faultClassification.js +2 -2
- package/dist/observability/orchestrationMetrics.js +8 -8
- package/dist/operator/operatorSessionHistory.js +1 -7
- package/dist/output/agentConfigurationPresentation.js +8 -3
- package/dist/output/agentRunConfigurationPresentation.js +128 -0
- package/dist/output/rolePresentation.js +54 -3
- package/dist/plugins/pluginChild.js +104 -0
- package/dist/plugins/pluginIntent.js +26 -0
- package/dist/plugins/pluginInterpreter.js +43 -0
- package/dist/plugins/pluginPackage.js +101 -0
- package/dist/plugins/pluginProcess.js +112 -0
- package/dist/plugins/pluginService.js +388 -0
- package/dist/profile/agentProfile.js +1 -1
- package/dist/repository/gitWorkspace.js +26 -4
- package/dist/repository/project.js +19 -4
- package/dist/repository/taskBaseFreshness.js +13 -13
- package/dist/repository/taskWorkspaceCoordinator.js +20 -27
- package/dist/repository/taskWorkspacePreparer.js +344 -83
- package/dist/resources/autoResourceGc.js +3 -3
- package/dist/resources/liveReferences.js +3 -3
- package/dist/resources/projectResource.js +75 -0
- package/dist/resources/projectResourceService.js +343 -0
- package/dist/resources/resourceDiscovery.js +6 -6
- package/dist/resources/resourceGc.js +1 -1
- package/dist/resources/resourceRegistrar.js +1 -1
- package/dist/resources/resourceTypes.js +1 -1
- package/dist/review/deltaRecheck.js +3 -3
- package/dist/review/reviewAcceptance.js +16 -16
- package/dist/review/reviewDecision.js +7 -7
- package/dist/review/reviewRound.js +21 -20
- package/dist/review/reviewerAvailability.js +2 -2
- package/dist/role/role.js +51 -7
- package/dist/role/taskRoleUpdate.js +30 -0
- package/dist/runtime/acpProtocol.js +425 -0
- package/dist/runtime/acpSession.js +731 -0
- package/dist/runtime/acpSessionConfiguration.js +260 -0
- package/dist/runtime/agentDriver.js +30 -11
- package/dist/runtime/agentEndpoint.js +278 -0
- package/dist/runtime/agentEndpointIdentity.js +86 -0
- package/dist/runtime/agentEndpointOwnership.js +239 -0
- package/dist/runtime/agentError.js +2 -10
- package/dist/runtime/agentHost.js +565 -314
- package/dist/runtime/agentRunConfiguration.js +258 -0
- package/dist/runtime/builtinAgentDrivers.js +134 -18
- package/dist/runtime/builtinAgentErrorMappers.js +55 -3
- package/dist/runtime/builtinTranscriptUsage.js +1 -1
- package/dist/runtime/claude-process-owner +0 -0
- package/dist/runtime/codexAppServerRuntime.js +38 -30
- package/dist/runtime/codexInteractiveHost.js +41 -6
- package/dist/runtime/continuationManager.js +2 -6
- package/dist/runtime/executionEnvironment.js +30 -0
- package/dist/runtime/firstProgressAdvisory.js +11 -11
- package/dist/runtime/index.js +4 -3
- package/dist/runtime/jsonLineChannel.js +109 -0
- package/dist/runtime/launchBroker.js +91 -16
- package/dist/runtime/launchDiagnostics.js +2 -2
- package/dist/runtime/lifecycleReservation.js +10 -18
- package/dist/runtime/managedCaller.js +61 -17
- package/dist/runtime/nativeSessionControl.js +102 -0
- package/dist/runtime/ports.js +6 -21
- package/dist/runtime/processExitObservation.js +8 -7
- package/dist/runtime/promptEnvelope.js +17 -6
- package/dist/runtime/providerContinuation.js +3 -9
- package/dist/runtime/providerContinuationReconciliationService.js +4 -13
- package/dist/runtime/providerControl.js +2 -7
- package/dist/runtime/providerRuntimeIdentity.js +110 -222
- package/dist/runtime/providerRuntimeReconciler.js +5 -9
- package/dist/runtime/runtimeBinding.js +0 -1
- package/dist/runtime/runtimeContinuationProjection.js +4 -7
- package/dist/runtime/runtimeDeadlines.js +9 -0
- package/dist/runtime/runtimeHealthPolicy.js +1 -1
- package/dist/runtime/runtimeObservation.js +29 -65
- package/dist/runtime/runtimeProjection.js +43 -51
- package/dist/runtime/runtimeSessionCandidate.js +1 -3
- package/dist/runtime/sessionLaunchRequest.js +3 -7
- package/dist/runtime/sessionOwnerIdentity.js +7 -54
- package/dist/runtime/sessionOwnerRegistry.js +22 -17
- package/dist/runtime/sessionReconciliation.js +4 -8
- package/dist/runtime/sessionTerminationGuard.js +70 -259
- package/dist/runtime/sessionTokenMetrics.js +5 -16
- package/dist/runtime/structuredProviderHost.js +237 -117
- package/dist/runtime/taskRuntimeIsolation.js +39 -122
- package/dist/runtime/tmuxAdapters.js +39 -86
- package/dist/scheduler/activeRoleRunDelivery.js +354 -0
- package/dist/scheduler/leaderWakeupProcessor.js +75 -266
- package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
- package/dist/scheduler/ports.js +80 -9
- package/dist/scheduler/{roleTurnLiveness.js → roleRunLiveness.js} +26 -30
- package/dist/scheduler/{roleTurnStall.js → roleRunStall.js} +128 -139
- package/dist/scheduler/taskExecutionProjection.js +120 -124
- package/dist/scheduler/taskObservabilityProjection.js +29 -29
- package/dist/scheduler/taskWake.js +11 -4
- package/dist/scheduler/wakeReason.js +9 -1
- package/dist/setup/setupCommand.js +3 -7
- package/dist/storage/migrations/agentRunContract.js +159 -0
- package/dist/storage/migrations/artifactsToGit.js +338 -0
- package/dist/storage/migrations/removeRuntimeGeneration.js +207 -0
- package/dist/storage/migrations/submitIntent.js +126 -0
- package/dist/storage/sqliteSchema.js +467 -7
- package/dist/storage/sqliteStore.js +355 -220
- package/dist/storage/storageVersions.js +1 -1
- package/dist/storage/storeRpc.js +10 -5
- package/dist/storage/taskStore.js +13 -11
- package/dist/storage/upgrade/upgradeOrchestrator.js +5 -7
- package/dist/surface/surfaceContributions.js +102 -0
- package/dist/task/completionReadiness.js +32 -6
- package/dist/task/deliveryGuard.js +16 -16
- package/dist/task/draftPlan.js +72 -12
- package/dist/task/nextAction.js +144 -128
- package/dist/task/remoteDelivery.js +6 -6
- package/dist/task/task.js +184 -18
- package/dist/task/taskActivation.js +327 -0
- package/dist/task/taskActivationService.js +408 -0
- package/dist/task/taskRecordReference.js +5 -4
- package/dist/task/taskRecordRetirement.js +1 -1
- package/dist/task/taskSubmission.js +236 -0
- package/dist/telemetry/sqliteTelemetryStore.js +55 -68
- package/dist/telemetry/telemetryConfig.js +14 -14
- package/dist/telemetry/telemetryWiring.js +2 -2
- package/dist/web/assets/assetManifest.js +2 -0
- package/dist/web/assets/client/app.js +121 -20
- package/dist/web/assets/client/components.js +87 -54
- package/dist/web/assets/client/i18n.js +83 -41
- package/dist/web/assets/client/markdown.js +1 -1
- package/dist/web/assets/client/taskSurface.js +442 -0
- package/dist/web/assets/client/view.js +49 -44
- package/dist/web/assets/shell.js +1 -1
- package/dist/web/assets/styles/cards.js +22 -4
- package/dist/web/controllerWeb.js +60 -0
- package/dist/web/webMutation.js +28 -0
- package/dist/web/webServer.js +133 -8
- package/dist/web/webSnapshot.js +81 -74
- package/dist/web/webTaskSurface.js +64 -0
- package/dist/workItem/dependencyGate.js +1 -1
- package/dist/workItem/workItem.js +84 -48
- package/dist/workspace/workItemChangeSetManager.js +16 -9
- package/docs/agent-result-consumption.md +96 -0
- package/docs/agent-result-consumption.zh-CN.md +81 -0
- package/docs/agent-runtime-drivers.md +93 -0
- package/docs/agent-runtime-drivers.zh-CN.md +77 -0
- package/docs/architecture/README.md +50 -0
- package/docs/architecture/README.zh-CN.md +43 -0
- package/docs/architecture/capabilities-and-resources.md +118 -0
- package/docs/architecture/capabilities-and-resources.zh-CN.md +83 -0
- package/docs/managed-turn-and-session-runtime.md +224 -0
- package/docs/managed-turn-and-session-runtime.zh-CN.md +180 -0
- package/docs/observability/README.md +83 -0
- package/docs/observability/README.zh-CN.md +71 -0
- package/docs/plugin-sdk.md +393 -0
- package/docs/plugin-sdk.zh-CN.md +293 -0
- package/docs/provider-runtime.md +165 -0
- package/docs/provider-runtime.zh-CN.md +132 -0
- package/docs/release-workflow.md +305 -0
- package/docs/release-workflow.zh-CN.md +237 -0
- package/docs/roles-and-configuration.md +115 -0
- package/docs/roles-and-configuration.zh-CN.md +96 -0
- package/docs/sqlite-control-plane-design.md +78 -0
- package/docs/sqlite-control-plane-design.zh-CN.md +62 -0
- package/docs/task-dag-semantics.md +80 -0
- package/docs/task-dag-semantics.zh-CN.md +59 -0
- package/docs/task-delivery.md +105 -0
- package/docs/task-delivery.zh-CN.md +82 -0
- package/docs/task-local-identity.md +8 -6
- package/docs/task-local-identity.zh-CN.md +58 -0
- package/docs/testing/verification-levels.md +88 -0
- package/docs/testing/verification-levels.zh-CN.md +69 -0
- package/i18n/README.zh-CN.md +270 -722
- package/package.json +3 -2
- package/skills/yui-leader/SKILL.md +88 -304
- package/skills/yui-leader/references/execution.md +303 -0
- package/skills/yui-leader/references/integration.md +39 -0
- package/skills/yui-leader/references/planning.md +109 -0
- package/skills/yui-leader/references/replicated-execution.md +42 -0
- package/skills/yui-leader/references/task-plugins.md +37 -0
- package/skills/yui-operator/SKILL.md +46 -62
- package/skills/yui-reviewer/SKILL.md +35 -36
- package/skills/yui-runtime/SKILL.md +88 -24
- package/skills/yui-runtime/references/publication.md +22 -0
- package/skills/yui-runtime/references/recovery.md +64 -0
- package/skills/yui-worker/SKILL.md +37 -39
- package/dist/cli/roleOptionCatalog.js +0 -68
- package/dist/context/sourceTurnContext.js +0 -30
- package/dist/execution/reviewMainTurn.js +0 -161
- package/dist/execution/workItemMainTurn.js +0 -164
- package/dist/lifecycle/exactTurnTerminalization.js +0 -407
- package/dist/runtime/preallocatedNativeSession.js +0 -13
- package/dist/runtime/runtimeStopReceipt.js +0 -42
- package/dist/scheduler/activeRoleTurnDelivery.js +0 -315
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { operationalTaskRecords } from "../task/taskRecordRetirement.js";
|
|
2
|
+
import { runtimeObservationFromTaskEvent } from "../runtime/runtimeObservation.js";
|
|
3
|
+
import { taskOwnsManagedWorkspace } from "../task/task.js";
|
|
2
4
|
import { currentWorkItemExecutionGroup } from "../workItem/workItem.js";
|
|
3
5
|
import { mailboxBatches } from "../coordination/workMailbox.js";
|
|
4
6
|
import { actionableExecutionLaneRecoveries, summarizeExecutionGroupHealth } from "../execution/executionHealth.js";
|
|
5
7
|
import { buildTaskObservabilityProjection } from "./taskObservabilityProjection.js";
|
|
6
|
-
import {
|
|
8
|
+
import { isRoleRunStalled, latestStallProgressAt } from "./roleRunStall.js";
|
|
7
9
|
import { resolveRuntimeHealth } from "../config/yuiConfig.js";
|
|
8
10
|
import { projectSessionTokenMetrics, resolveSessionTokenIdentity } from "../runtime/sessionTokenMetrics.js";
|
|
9
11
|
/**
|
|
@@ -17,7 +19,7 @@ export function buildTaskExecutionProjection(store, taskId, taskOverride, now =
|
|
|
17
19
|
return null;
|
|
18
20
|
const roles = store.listRoles?.(taskId) ?? [];
|
|
19
21
|
const events = store.listEvents?.(taskId) ?? [];
|
|
20
|
-
const
|
|
22
|
+
const runs = operationalTaskRecords(store.listRuns?.(taskId) ?? [], events, "run");
|
|
21
23
|
const leaderMailbox = store.getWorkMailbox?.({
|
|
22
24
|
kind: "role",
|
|
23
25
|
taskId,
|
|
@@ -32,10 +34,14 @@ export function buildTaskExecutionProjection(store, taskId, taskOverride, now =
|
|
|
32
34
|
return projectTaskExecution({
|
|
33
35
|
task,
|
|
34
36
|
roles,
|
|
35
|
-
|
|
37
|
+
runs,
|
|
38
|
+
runDelivery: Object.fromEntries(runs.map((run) => {
|
|
39
|
+
const observed = store.getTaskRoleSessionSet?.(taskId, run.roleName)?.providerBinding?.run;
|
|
40
|
+
return [run.id, observed?.runId === run.id ? observed.status : "unobserved"];
|
|
41
|
+
})),
|
|
36
42
|
executionGroups: store.listWorkItems === undefined && store.listReviewRounds === undefined
|
|
37
43
|
? []
|
|
38
|
-
: collectExecutionGroups(store.listWorkItems?.(taskId) ?? [], store.listReviewRounds?.(taskId) ?? [],
|
|
44
|
+
: collectExecutionGroups(store.listWorkItems?.(taskId) ?? [], store.listReviewRounds?.(taskId) ?? [], runs),
|
|
39
45
|
workItems: store.listWorkItems?.(taskId) ?? [],
|
|
40
46
|
...(store.listContextSnapshots === undefined
|
|
41
47
|
? {}
|
|
@@ -67,22 +73,22 @@ export function buildTaskExecutionProjection(store, taskId, taskOverride, now =
|
|
|
67
73
|
* unchanged revision.
|
|
68
74
|
*/
|
|
69
75
|
export function projectTaskExecutionFromFacts(facts) {
|
|
70
|
-
const
|
|
76
|
+
const runs = operationalTaskRecords(facts.runs, facts.events ?? [], "run");
|
|
71
77
|
const executionGroups = facts.executionGroups
|
|
72
|
-
?? collectExecutionGroups(facts.workItems ?? [], facts.reviewRounds ?? [],
|
|
78
|
+
?? collectExecutionGroups(facts.workItems ?? [], facts.reviewRounds ?? [], runs);
|
|
73
79
|
return projectTaskExecution({
|
|
74
80
|
...facts,
|
|
75
|
-
|
|
81
|
+
runs,
|
|
76
82
|
executionGroups
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
85
|
export function projectTaskExecution(facts) {
|
|
80
|
-
const { task, roles,
|
|
86
|
+
const { task, roles, runs, workItems = [], inputRequests = [], reviewRounds = [], integrations = [], events = [], pendingWakeup = null, leaderMailbox = null, leaderFailure = null, roleSessions = [], executionGroups = [] } = facts;
|
|
81
87
|
const now = facts.now ?? new Date();
|
|
82
88
|
const groupSummaries = executionGroups.map((group) => {
|
|
83
89
|
return summarizeExecutionGroupHealth({
|
|
84
90
|
group,
|
|
85
|
-
|
|
91
|
+
runs,
|
|
86
92
|
sessions: roleSessions,
|
|
87
93
|
events,
|
|
88
94
|
now,
|
|
@@ -103,7 +109,7 @@ export function projectTaskExecution(facts) {
|
|
|
103
109
|
const observability = buildTaskObservabilityProjection({
|
|
104
110
|
workItems,
|
|
105
111
|
executionGroups: observabilityGroups,
|
|
106
|
-
|
|
112
|
+
runs,
|
|
107
113
|
events,
|
|
108
114
|
contextSnapshots: facts.contextSnapshots,
|
|
109
115
|
sessionTokens,
|
|
@@ -115,24 +121,34 @@ export function projectTaskExecution(facts) {
|
|
|
115
121
|
executionGroups: groupSummaries,
|
|
116
122
|
observability
|
|
117
123
|
});
|
|
118
|
-
const
|
|
119
|
-
const
|
|
120
|
-
|
|
124
|
+
const activeRuns = runs.filter((run) => run.status === "active");
|
|
125
|
+
const deliveryOf = (run) => {
|
|
126
|
+
const known = facts.runDelivery?.[run.id];
|
|
127
|
+
if (known !== undefined && known !== "unobserved")
|
|
128
|
+
return known;
|
|
129
|
+
const observed = events.map(runtimeObservationFromTaskEvent).filter((event) => event?.fence.runId === run.id && event.authority !== "transport"
|
|
130
|
+
&& ["turn.accepted", "turn.completed", "turn.failed", "turn.cancelled"].includes(event.kind)).at(-1);
|
|
131
|
+
return observed === undefined || observed === null ? "unobserved"
|
|
132
|
+
: observed.kind.slice("run.".length);
|
|
133
|
+
};
|
|
134
|
+
const runHasSession = (run) => roleSessions.some((session) => (session.roleName === run.roleName
|
|
135
|
+
&& session.agentId === run.effective.agentId
|
|
121
136
|
&& session.status !== "ended"));
|
|
122
|
-
const
|
|
123
|
-
id:
|
|
124
|
-
roleName:
|
|
125
|
-
purpose:
|
|
126
|
-
providerSession:
|
|
127
|
-
status:
|
|
128
|
-
|
|
129
|
-
...(
|
|
130
|
-
...(
|
|
131
|
-
...(
|
|
137
|
+
const activeRunViews = activeRuns.map((run) => ({
|
|
138
|
+
id: run.id,
|
|
139
|
+
roleName: run.roleName,
|
|
140
|
+
purpose: run.purpose,
|
|
141
|
+
providerSession: runHasSession(run) ? "active" : "starting",
|
|
142
|
+
status: run.status,
|
|
143
|
+
delivery: deliveryOf(run),
|
|
144
|
+
...(run.workItemId === undefined ? {} : { workItemId: run.workItemId }),
|
|
145
|
+
...(run.reviewRoundId === undefined ? {} : { reviewRoundId: run.reviewRoundId }),
|
|
146
|
+
...(run.executionGroupId === undefined ? {} : { executionGroupId: run.executionGroupId }),
|
|
147
|
+
...(run.executionLaneId === undefined ? {} : { executionLaneId: run.executionLaneId })
|
|
132
148
|
}));
|
|
133
149
|
const monitoring = task.executionGate.state === "stopped"
|
|
134
150
|
|| task.status === "completed"
|
|
135
|
-
|| task.status === "
|
|
151
|
+
|| task.status === "cancelled"
|
|
136
152
|
|| task.status === "archived"
|
|
137
153
|
? "stopped"
|
|
138
154
|
: "active";
|
|
@@ -147,7 +163,7 @@ export function projectTaskExecution(facts) {
|
|
|
147
163
|
reason: "execution-stopped",
|
|
148
164
|
monitoring,
|
|
149
165
|
failClosed: false,
|
|
150
|
-
|
|
166
|
+
activeRuns: activeRunViews,
|
|
151
167
|
attention: [],
|
|
152
168
|
blockers: [],
|
|
153
169
|
pendingWakeup
|
|
@@ -163,7 +179,7 @@ export function projectTaskExecution(facts) {
|
|
|
163
179
|
reason: "task-terminal",
|
|
164
180
|
monitoring,
|
|
165
181
|
failClosed: false,
|
|
166
|
-
|
|
182
|
+
activeRuns: activeRunViews,
|
|
167
183
|
attention: [],
|
|
168
184
|
blockers: [],
|
|
169
185
|
pendingWakeup
|
|
@@ -172,7 +188,7 @@ export function projectTaskExecution(facts) {
|
|
|
172
188
|
const attention = collectAttention({
|
|
173
189
|
task,
|
|
174
190
|
roles,
|
|
175
|
-
|
|
191
|
+
activeRuns,
|
|
176
192
|
events,
|
|
177
193
|
leaderFailure,
|
|
178
194
|
roleSessions,
|
|
@@ -180,18 +196,19 @@ export function projectTaskExecution(facts) {
|
|
|
180
196
|
});
|
|
181
197
|
const openInputs = inputRequests.filter((request) => request.status === "open");
|
|
182
198
|
const blockers = collectBlockers(workItems, reviewRounds, integrations, openInputs, task);
|
|
183
|
-
const
|
|
184
|
-
const
|
|
185
|
-
const activeDelegatedExecutions =
|
|
186
|
-
const
|
|
187
|
-
&& !attention.some((item) => item.
|
|
188
|
-
const activeLeader =
|
|
189
|
-
const
|
|
199
|
+
const activeExecutionRuns = activeRuns.filter((run) => run.purpose === "execution");
|
|
200
|
+
const activeReviewRuns = activeRuns.filter((run) => run.purpose === "review");
|
|
201
|
+
const activeDelegatedExecutions = activeExecutionRuns.filter((run) => (run.roleName !== "leader"));
|
|
202
|
+
const healthyActiveRuns = activeRuns.filter((run) => (deliveryOf(run) === "accepted"
|
|
203
|
+
&& !attention.some((item) => item.runId === run.id)));
|
|
204
|
+
const activeLeader = activeRuns.find((run) => run.roleName === "leader");
|
|
205
|
+
const pendingDeliveryRuns = activeRuns.filter((run) => deliveryOf(run) !== "accepted");
|
|
190
206
|
const hasPendingLeaderWork = pendingWakeup !== null
|
|
191
207
|
|| leaderMailbox?.pending !== null;
|
|
192
208
|
const recoveryPending = isRecoveryPending(pendingWakeup, leaderMailbox, leaderFailure);
|
|
193
|
-
const failedWork = workItems.some((item) => item.status === "
|
|
194
|
-
|
|
209
|
+
const failedWork = workItems.some((item) => item.status === "open"
|
|
210
|
+
&& runs.filter((run) => run.workItemId === item.id).at(-1)?.status === "failed");
|
|
211
|
+
const candidateReady = workItems.some((item) => (item.status === "open" && item.currentCandidateId !== undefined));
|
|
195
212
|
const blockedIntegration = integrations.some((attempt) => attempt.status === "blocked");
|
|
196
213
|
const unresolvedIntegration = integrations.some((attempt) => (attempt.status === "running"
|
|
197
214
|
|| attempt.status === "validating"
|
|
@@ -202,19 +219,19 @@ export function projectTaskExecution(facts) {
|
|
|
202
219
|
if (first === undefined)
|
|
203
220
|
throw new Error("Task execution attention disappeared.");
|
|
204
221
|
const progressingWithAttention = first.kind === "checkpoint-overdue"
|
|
205
|
-
&&
|
|
222
|
+
&& healthyActiveRuns.length > 0;
|
|
206
223
|
return render({
|
|
207
224
|
task,
|
|
208
225
|
status: progressingWithAttention ? "progressing-with-attention" : "attention",
|
|
209
226
|
owner: first.owner,
|
|
210
227
|
action: "inspect-attention",
|
|
211
228
|
summary: progressingWithAttention
|
|
212
|
-
? `${
|
|
229
|
+
? `${healthyActiveRuns.length} healthy active AgentRun(s) remain while ${first.summary}`
|
|
213
230
|
: first.summary,
|
|
214
231
|
reason: progressingWithAttention ? "progressing-with-attention" : first.kind,
|
|
215
232
|
monitoring,
|
|
216
233
|
failClosed: hasLeaderMismatch || attention.some((item) => item.failClosed === true),
|
|
217
|
-
|
|
234
|
+
activeRuns: activeRunViews,
|
|
218
235
|
attention,
|
|
219
236
|
blockers,
|
|
220
237
|
pendingWakeup
|
|
@@ -233,7 +250,7 @@ export function projectTaskExecution(facts) {
|
|
|
233
250
|
reason: "open-input-request",
|
|
234
251
|
monitoring,
|
|
235
252
|
failClosed: false,
|
|
236
|
-
|
|
253
|
+
activeRuns: activeRunViews,
|
|
237
254
|
attention,
|
|
238
255
|
blockers,
|
|
239
256
|
pendingWakeup
|
|
@@ -249,11 +266,11 @@ export function projectTaskExecution(facts) {
|
|
|
249
266
|
action: "recover-execution",
|
|
250
267
|
summary: `Execution Lane ${laneRecovery.laneId} in ${laneRecovery.groupId}`
|
|
251
268
|
+ ` requires ${laneRecovery.recovery}`
|
|
252
|
-
+ (laneRecovery.
|
|
269
|
+
+ (laneRecovery.runId === undefined ? "." : ` for exact AgentRun ${laneRecovery.runId}.`),
|
|
253
270
|
reason: `execution-lane-${laneRecovery.recovery}`,
|
|
254
271
|
monitoring,
|
|
255
272
|
failClosed: false,
|
|
256
|
-
|
|
273
|
+
activeRuns: activeRunViews,
|
|
257
274
|
attention,
|
|
258
275
|
blockers,
|
|
259
276
|
pendingWakeup
|
|
@@ -272,7 +289,7 @@ export function projectTaskExecution(facts) {
|
|
|
272
289
|
reason: blockedIntegration ? "integration-blocked" : failedWork ? "work-failed" : "identity-mismatch",
|
|
273
290
|
monitoring,
|
|
274
291
|
failClosed: hasLeaderMismatch,
|
|
275
|
-
|
|
292
|
+
activeRuns: activeRunViews,
|
|
276
293
|
attention,
|
|
277
294
|
blockers,
|
|
278
295
|
pendingWakeup
|
|
@@ -289,24 +306,24 @@ export function projectTaskExecution(facts) {
|
|
|
289
306
|
reason: leaderFailure === null ? "recovery-pending" : "leader-recovery-failed",
|
|
290
307
|
monitoring,
|
|
291
308
|
failClosed: leaderFailure !== null,
|
|
292
|
-
|
|
309
|
+
activeRuns: activeRunViews,
|
|
293
310
|
attention,
|
|
294
311
|
blockers,
|
|
295
312
|
pendingWakeup
|
|
296
313
|
});
|
|
297
314
|
}
|
|
298
|
-
const leaderDeliveryPending =
|
|
315
|
+
const leaderDeliveryPending = pendingDeliveryRuns.some((run) => run.roleName === "leader");
|
|
299
316
|
if (leaderDeliveryPending) {
|
|
300
317
|
return render({
|
|
301
318
|
task,
|
|
302
|
-
status: "
|
|
319
|
+
status: "waiting-on-agents",
|
|
303
320
|
owner: "leader",
|
|
304
321
|
action: "recover-leader",
|
|
305
|
-
summary:
|
|
322
|
+
summary: `Leader execution record is open; admission is ${activeLeader === undefined ? "unobserved" : deliveryOf(activeLeader)}. This is not proof of Agent progress.`,
|
|
306
323
|
reason: "delivery-pending",
|
|
307
324
|
monitoring,
|
|
308
325
|
failClosed: false,
|
|
309
|
-
|
|
326
|
+
activeRuns: activeRunViews,
|
|
310
327
|
attention,
|
|
311
328
|
blockers,
|
|
312
329
|
pendingWakeup
|
|
@@ -314,14 +331,14 @@ export function projectTaskExecution(facts) {
|
|
|
314
331
|
}
|
|
315
332
|
if (activeLeader !== undefined) {
|
|
316
333
|
const concurrentExecutionCount = activeDelegatedExecutions.length;
|
|
317
|
-
const concurrentReviewCount =
|
|
334
|
+
const concurrentReviewCount = activeReviewRuns.length;
|
|
318
335
|
const concurrentSummary = [
|
|
319
336
|
concurrentExecutionCount === 0
|
|
320
337
|
? null
|
|
321
|
-
: `${concurrentExecutionCount} delegated execution
|
|
338
|
+
: `${concurrentExecutionCount} delegated execution AgentRun(s)`,
|
|
322
339
|
concurrentReviewCount === 0
|
|
323
340
|
? null
|
|
324
|
-
: `${concurrentReviewCount} Review
|
|
341
|
+
: `${concurrentReviewCount} Review AgentRun(s)`
|
|
325
342
|
].filter((value) => value !== null).join(" and ");
|
|
326
343
|
return render({
|
|
327
344
|
task,
|
|
@@ -329,12 +346,12 @@ export function projectTaskExecution(facts) {
|
|
|
329
346
|
owner: "leader",
|
|
330
347
|
action: "advance-task",
|
|
331
348
|
summary: concurrentSummary.length === 0
|
|
332
|
-
? "Leader
|
|
333
|
-
: `Leader
|
|
349
|
+
? "Leader execution was accepted; its result and Task progress remain separate facts."
|
|
350
|
+
: `Leader execution was accepted alongside ${concurrentSummary}; Task progress remains a separate fact.`,
|
|
334
351
|
reason: concurrentSummary.length === 0 ? "leader-turn-active" : "leader-and-agents-active",
|
|
335
352
|
monitoring,
|
|
336
353
|
failClosed: false,
|
|
337
|
-
|
|
354
|
+
activeRuns: activeRunViews,
|
|
338
355
|
attention,
|
|
339
356
|
blockers,
|
|
340
357
|
pendingWakeup
|
|
@@ -346,62 +363,62 @@ export function projectTaskExecution(facts) {
|
|
|
346
363
|
status: "needs-leader-action",
|
|
347
364
|
owner: "leader",
|
|
348
365
|
action: "advance-task",
|
|
349
|
-
summary: "A durable Leader wake is pending; concurrent
|
|
366
|
+
summary: "A durable Leader wake is pending; concurrent AgentRuns remain visible but do not suppress it.",
|
|
350
367
|
reason: "leader-wake-pending",
|
|
351
368
|
monitoring,
|
|
352
369
|
failClosed: false,
|
|
353
|
-
|
|
370
|
+
activeRuns: activeRunViews,
|
|
354
371
|
attention,
|
|
355
372
|
blockers,
|
|
356
373
|
pendingWakeup
|
|
357
374
|
});
|
|
358
375
|
}
|
|
359
|
-
if (
|
|
376
|
+
if (pendingDeliveryRuns.length > 0) {
|
|
360
377
|
return render({
|
|
361
378
|
task,
|
|
362
379
|
status: "recovering",
|
|
363
380
|
owner: "leader",
|
|
364
381
|
action: "recover-execution",
|
|
365
|
-
summary: `${
|
|
382
|
+
summary: `${pendingDeliveryRuns.length} active delegated AgentRun(s) are awaiting provider acceptance; delivery remains fail-closed.`,
|
|
366
383
|
reason: "delivery-pending",
|
|
367
384
|
monitoring,
|
|
368
385
|
failClosed: false,
|
|
369
|
-
|
|
386
|
+
activeRuns: activeRunViews,
|
|
370
387
|
attention,
|
|
371
388
|
blockers,
|
|
372
389
|
pendingWakeup
|
|
373
390
|
});
|
|
374
391
|
}
|
|
375
392
|
if (activeDelegatedExecutions.length > 0) {
|
|
376
|
-
const reviewSuffix =
|
|
393
|
+
const reviewSuffix = activeReviewRuns.length === 0
|
|
377
394
|
? ""
|
|
378
|
-
: `; ${
|
|
395
|
+
: `; ${activeReviewRuns.length} Review AgentRun(s) are also active`;
|
|
379
396
|
return render({
|
|
380
397
|
task,
|
|
381
398
|
status: "waiting-on-agents",
|
|
382
399
|
owner: roleOwner(activeDelegatedExecutions[0].roleName),
|
|
383
400
|
action: "wait-for-agents",
|
|
384
|
-
summary: `${activeDelegatedExecutions.length} delegated execution
|
|
401
|
+
summary: `${activeDelegatedExecutions.length} delegated execution AgentRun(s) are active${reviewSuffix}.`,
|
|
385
402
|
reason: "delegated-work-active",
|
|
386
403
|
monitoring,
|
|
387
404
|
failClosed: false,
|
|
388
|
-
|
|
405
|
+
activeRuns: activeRunViews,
|
|
389
406
|
attention,
|
|
390
407
|
blockers,
|
|
391
408
|
pendingWakeup
|
|
392
409
|
});
|
|
393
410
|
}
|
|
394
|
-
if (
|
|
411
|
+
if (activeReviewRuns.length > 0) {
|
|
395
412
|
return render({
|
|
396
413
|
task,
|
|
397
414
|
status: "waiting-on-agents",
|
|
398
415
|
owner: "reviewer",
|
|
399
416
|
action: "wait-for-agents",
|
|
400
|
-
summary: `${
|
|
417
|
+
summary: `${activeReviewRuns.length} Review AgentRun(s) are evaluating frozen candidates; newer facts can still wake the Leader.`,
|
|
401
418
|
reason: "review-active",
|
|
402
419
|
monitoring,
|
|
403
420
|
failClosed: false,
|
|
404
|
-
|
|
421
|
+
activeRuns: activeRunViews,
|
|
405
422
|
attention,
|
|
406
423
|
blockers,
|
|
407
424
|
pendingWakeup
|
|
@@ -421,7 +438,7 @@ export function projectTaskExecution(facts) {
|
|
|
421
438
|
: "integration-pending",
|
|
422
439
|
monitoring,
|
|
423
440
|
failClosed: false,
|
|
424
|
-
|
|
441
|
+
activeRuns: activeRunViews,
|
|
425
442
|
attention,
|
|
426
443
|
blockers,
|
|
427
444
|
pendingWakeup
|
|
@@ -436,7 +453,7 @@ export function projectTaskExecution(facts) {
|
|
|
436
453
|
reason: "no-executor",
|
|
437
454
|
monitoring,
|
|
438
455
|
failClosed: false,
|
|
439
|
-
|
|
456
|
+
activeRuns: activeRunViews,
|
|
440
457
|
attention,
|
|
441
458
|
blockers,
|
|
442
459
|
pendingWakeup
|
|
@@ -453,7 +470,7 @@ function projection(input) {
|
|
|
453
470
|
reason: input.reason,
|
|
454
471
|
monitoring: input.monitoring,
|
|
455
472
|
failClosed: input.failClosed,
|
|
456
|
-
|
|
473
|
+
activeRuns: input.activeRuns,
|
|
457
474
|
executionGroups: input.executionGroups ?? [],
|
|
458
475
|
observability: input.observability,
|
|
459
476
|
attention: input.attention,
|
|
@@ -494,7 +511,7 @@ function collectExecutionGroups(workItems, reviewRounds, _turns) {
|
|
|
494
511
|
}
|
|
495
512
|
function collectAttention(input) {
|
|
496
513
|
const result = [];
|
|
497
|
-
const { task,
|
|
514
|
+
const { task, activeRuns, events, leaderFailure } = input;
|
|
498
515
|
if (leaderFailure !== null) {
|
|
499
516
|
result.push({
|
|
500
517
|
kind: "leader-recovery",
|
|
@@ -504,82 +521,57 @@ function collectAttention(input) {
|
|
|
504
521
|
failClosed: true
|
|
505
522
|
});
|
|
506
523
|
}
|
|
507
|
-
for (const
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
&& ((role.activeAgentId !== undefined && role.activeAgentId !== turn.effective?.agentId)
|
|
512
|
-
|| (role.adapterId !== undefined && role.adapterId !== turn.effective?.adapterId))) {
|
|
513
|
-
result.push({
|
|
514
|
-
kind: "identity-mismatch",
|
|
515
|
-
id: `identity:${turn.id}`,
|
|
516
|
-
owner: "leader",
|
|
517
|
-
summary: `Turn ${turn.id} does not match the current ${turn.roleName} Agent/adapter fence.`,
|
|
518
|
-
turnId: turn.id,
|
|
519
|
-
roleName: turn.roleName,
|
|
520
|
-
failClosed: true
|
|
521
|
-
});
|
|
522
|
-
}
|
|
524
|
+
for (const run of activeRuns) {
|
|
525
|
+
const session = input.roleSessions.find((candidate) => candidate.roleName === run.roleName);
|
|
526
|
+
// Current Role selection is desired configuration, not the identity fence
|
|
527
|
+
// of a AgentRun already assigned. Only actual execution evidence can mismatch.
|
|
523
528
|
if (session !== undefined
|
|
524
|
-
&& (session.agentId !==
|
|
529
|
+
&& (session.agentId !== run.effective?.agentId || session.adapterId !== run.effective?.adapterId)) {
|
|
525
530
|
result.push({
|
|
526
531
|
kind: "identity-mismatch",
|
|
527
|
-
id: `session:${
|
|
532
|
+
id: `session:${run.id}`,
|
|
528
533
|
owner: "leader",
|
|
529
|
-
summary: `
|
|
530
|
-
|
|
531
|
-
roleName:
|
|
534
|
+
summary: `AgentRun ${run.id} has a provider/session identity mismatch; monitoring fails closed.`,
|
|
535
|
+
runId: run.id,
|
|
536
|
+
roleName: run.roleName,
|
|
532
537
|
failClosed: true
|
|
533
538
|
});
|
|
534
539
|
}
|
|
535
|
-
if (
|
|
536
|
-
if (
|
|
537
|
-
const progressAt = latestStallProgressAt(events,
|
|
540
|
+
if (isRoleRunStalled(events, run.id)) {
|
|
541
|
+
if (run.roleName === "leader") {
|
|
542
|
+
const progressAt = latestStallProgressAt(events, run.id) ?? "unknown";
|
|
538
543
|
result.push({
|
|
539
544
|
kind: "leader-stalled",
|
|
540
|
-
id: `leader-stall:${
|
|
545
|
+
id: `leader-stall:${run.id}:${progressAt}`,
|
|
541
546
|
owner: "operator",
|
|
542
|
-
summary: `Leader
|
|
543
|
-
|
|
544
|
-
roleName:
|
|
547
|
+
summary: `Leader AgentRun ${run.id} has an unresolved no-progress attention.`,
|
|
548
|
+
runId: run.id,
|
|
549
|
+
roleName: run.roleName
|
|
545
550
|
});
|
|
546
551
|
}
|
|
547
552
|
else {
|
|
548
553
|
result.push({
|
|
549
554
|
kind: "checkpoint-overdue",
|
|
550
|
-
id: `checkpoint-overdue:${
|
|
555
|
+
id: `checkpoint-overdue:${run.id}`,
|
|
551
556
|
owner: "leader",
|
|
552
|
-
summary: `Delegated
|
|
553
|
-
|
|
554
|
-
roleName:
|
|
557
|
+
summary: `Delegated AgentRun ${run.id} has an unresolved checkpoint-overdue signal.`,
|
|
558
|
+
runId: run.id,
|
|
559
|
+
roleName: run.roleName
|
|
555
560
|
});
|
|
556
561
|
}
|
|
557
562
|
}
|
|
558
563
|
}
|
|
559
564
|
for (const request of input.inputRequests.filter(({ status }) => status === "open")) {
|
|
560
565
|
const requester = request.requester;
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
const role = requester === undefined
|
|
565
|
-
? undefined
|
|
566
|
-
: input.roles.find(({ name }) => name === requester.roleName);
|
|
567
|
-
const session = requester === undefined
|
|
568
|
-
? undefined
|
|
569
|
-
: input.roleSessions.find(({ roleName }) => roleName === requester.roleName);
|
|
570
|
-
if (turn === undefined
|
|
571
|
-
|| turn.roleName !== "leader"
|
|
572
|
-
|| requester === undefined
|
|
573
|
-
|| turn.effective?.agentId !== requester.agentId
|
|
574
|
-
|| (role?.adapterId !== undefined && role.adapterId !== turn.effective?.adapterId)
|
|
575
|
-
|| (requester.nativeSessionId !== undefined
|
|
576
|
-
&& session?.nativeSessionId !== requester.nativeSessionId)) {
|
|
566
|
+
// Origin is durable provenance, not a live execution lease. Questions
|
|
567
|
+
// remain answerable after their originating Run ends or Session changes.
|
|
568
|
+
if (requester === undefined || requester.taskId !== task.id || requester.roleName !== "leader") {
|
|
577
569
|
result.push({
|
|
578
570
|
kind: "identity-mismatch",
|
|
579
571
|
id: `input:${request.id}`,
|
|
580
572
|
owner: "leader",
|
|
581
|
-
summary: `InputRequest ${request.id}
|
|
582
|
-
...(requester?.
|
|
573
|
+
summary: `InputRequest ${request.id} has an invalid Task/Leader origin; it is held fail-closed.`,
|
|
574
|
+
...(requester?.runId === undefined ? {} : { runId: requester.runId }),
|
|
583
575
|
roleName: "leader",
|
|
584
576
|
failClosed: true
|
|
585
577
|
});
|
|
@@ -591,7 +583,7 @@ function collectBlockers(workItems, reviewRounds, integrations, openInputs, task
|
|
|
591
583
|
const blockers = [];
|
|
592
584
|
const byId = new Map(workItems.map((item) => [item.id, item]));
|
|
593
585
|
for (const item of workItems) {
|
|
594
|
-
if (item.status === "
|
|
586
|
+
if (item.status === "open" && item.currentCandidateId !== undefined) {
|
|
595
587
|
blockers.push({
|
|
596
588
|
kind: "work",
|
|
597
589
|
id: item.id,
|
|
@@ -599,9 +591,9 @@ function collectBlockers(workItems, reviewRounds, integrations, openInputs, task
|
|
|
599
591
|
summary: item.outcome ?? `WorkItem ${item.id} is ${item.status}.`
|
|
600
592
|
});
|
|
601
593
|
}
|
|
602
|
-
if (item.status === "
|
|
594
|
+
if (item.status === "open" && (item.dependsOn ?? []).some((id) => {
|
|
603
595
|
const status = byId.get(id)?.status;
|
|
604
|
-
return status !== "
|
|
596
|
+
return status !== "accepted";
|
|
605
597
|
})) {
|
|
606
598
|
blockers.push({
|
|
607
599
|
kind: "work",
|
|
@@ -635,7 +627,11 @@ function collectBlockers(workItems, reviewRounds, integrations, openInputs, task
|
|
|
635
627
|
summary: request.question
|
|
636
628
|
});
|
|
637
629
|
}
|
|
638
|
-
|
|
630
|
+
// A Task activated with an empty environment plan owns no workspace and no
|
|
631
|
+
// cwd by design; only a Task that should own one is blocked by its absence.
|
|
632
|
+
if (task.status === "active"
|
|
633
|
+
&& taskOwnsManagedWorkspace(task)
|
|
634
|
+
&& task.cwd === undefined) {
|
|
639
635
|
blockers.push({
|
|
640
636
|
kind: "identity",
|
|
641
637
|
id: `workspace:${task.id}`,
|