@zq-silk/yui 0.15.7 → 0.15.8
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 +192 -399
- package/README.md +127 -1149
- 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/brief/taskBrief.js +12 -0
- package/dist/cli/agentConfigurationPicker.js +13 -0
- package/dist/cli/commandCatalog.js +157 -70
- 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 +178 -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 +1 -7
- 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 +259 -0
- package/dist/commands/taskActor.js +28 -49
- package/dist/commands/taskCommands.js +1188 -710
- 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} +146 -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 +458 -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 +114 -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 +247 -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 +62 -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 +380 -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 +123 -0
- package/dist/resources/projectResourceService.js +421 -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 +1 -0
- package/dist/storage/migrations/agentRunContract.js +159 -0
- package/dist/storage/migrations/removeRuntimeGeneration.js +207 -0
- package/dist/storage/sqliteSchema.js +431 -5
- package/dist/storage/sqliteStore.js +375 -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 +301 -0
- package/dist/task/taskActivationService.js +392 -0
- package/dist/task/taskRecordReference.js +5 -4
- package/dist/task/taskRecordRetirement.js +1 -1
- 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 +120 -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 +353 -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 +118 -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 +80 -48
- package/dist/workspace/workItemChangeSetManager.js +16 -9
- package/docs/agent-result-consumption.md +94 -0
- package/docs/agent-runtime-drivers.md +91 -0
- package/docs/architecture/README.md +38 -0
- package/docs/architecture/capabilities-and-resources.md +79 -0
- package/docs/managed-turn-and-session-runtime.md +222 -0
- package/docs/observability/README.md +81 -0
- package/docs/plugin-sdk.md +290 -0
- package/docs/provider-runtime.md +163 -0
- package/docs/release-workflow.md +303 -0
- package/docs/roles-and-configuration.md +113 -0
- package/docs/sqlite-control-plane-design.md +76 -0
- package/docs/task-dag-semantics.md +57 -0
- package/docs/task-delivery.md +103 -0
- package/docs/task-local-identity.md +6 -6
- package/docs/testing/verification-levels.md +86 -0
- package/i18n/README.zh-CN.md +98 -739
- package/package.json +2 -2
- package/skills/yui-leader/SKILL.md +130 -103
- package/skills/yui-leader/references/integration.md +39 -0
- package/skills/yui-leader/references/replicated-execution.md +42 -0
- package/skills/yui-leader/references/task-plugins.md +33 -0
- package/skills/yui-operator/SKILL.md +30 -59
- 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
|
@@ -813,10 +813,9 @@ function safeDispatcherError(error) {
|
|
|
813
813
|
}
|
|
814
814
|
return { code: "SERVICE_ERROR", message };
|
|
815
815
|
}
|
|
816
|
-
case "
|
|
817
|
-
//
|
|
818
|
-
//
|
|
819
|
-
// actionable diagnosis instead of collapsing it to INTERNAL_ERROR.
|
|
816
|
+
case "RuntimeLaunchFailure":
|
|
817
|
+
// Launch errors already carry bounded diagnostics (including redacted
|
|
818
|
+
// provider output). Preserve them instead of collapsing to INTERNAL_ERROR.
|
|
820
819
|
return { code: "SERVICE_ERROR", message };
|
|
821
820
|
default:
|
|
822
821
|
return undefined;
|
|
@@ -832,6 +831,7 @@ function safeApplicationErrorCode(code) {
|
|
|
832
831
|
case "METHOD_NOT_FOUND":
|
|
833
832
|
case "NOT_FOUND":
|
|
834
833
|
case "UNAUTHORIZED":
|
|
834
|
+
case "SESSION_BUSY":
|
|
835
835
|
case "CONTROLLER_DRAINING":
|
|
836
836
|
return code;
|
|
837
837
|
default:
|
package/dist/doctor/doctor.js
CHANGED
|
@@ -424,7 +424,7 @@ function inspectReview(source, agentChecks, environment) {
|
|
|
424
424
|
checks.push({
|
|
425
425
|
name: "reviewer binding",
|
|
426
426
|
status: "ok",
|
|
427
|
-
detail: `agent=${binding.agentId} adapter=${binding.adapterId}`
|
|
427
|
+
detail: `agent=${binding.agentId} component=${binding.component} adapter=${binding.adapterId}`
|
|
428
428
|
});
|
|
429
429
|
const agent = source.agent ?? null;
|
|
430
430
|
if (agent === null) {
|
|
@@ -438,8 +438,19 @@ function inspectReview(source, agentChecks, environment) {
|
|
|
438
438
|
checks.push({
|
|
439
439
|
name: "reviewer agent",
|
|
440
440
|
status: "ok",
|
|
441
|
-
detail: `id=${agent.id} adapter=${agent.adapterId} command=${agent.command}`
|
|
441
|
+
detail: `id=${agent.id} component=${agent.component} adapter=${agent.adapterId} command=${agent.command}`
|
|
442
442
|
});
|
|
443
|
+
// Two products can share one connection plan, so a matching adapter is not
|
|
444
|
+
// enough: a binding naming the SDK against an Agent recorded as the CLI is a
|
|
445
|
+
// real mismatch, and launching either one would contradict the other record.
|
|
446
|
+
if (agent.component !== binding.component) {
|
|
447
|
+
checks.push({
|
|
448
|
+
name: "reviewer component",
|
|
449
|
+
status: "invalid",
|
|
450
|
+
detail: `binding component=${binding.component} does not match Agent component=${agent.component}.`
|
|
451
|
+
});
|
|
452
|
+
return reviewMisconfigured(policy, checks, "Reviewer execution component does not match its Agent binding.", role, agent.id, agent.adapterId, agent.command);
|
|
453
|
+
}
|
|
443
454
|
if (agent.adapterId !== binding.adapterId) {
|
|
444
455
|
checks.push({
|
|
445
456
|
name: "reviewer adapter",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export const
|
|
2
|
-
export const
|
|
1
|
+
export const MAX_RUN_RESULT_OUTPUT_BYTES = 512 * 1024;
|
|
2
|
+
export const MAX_RUN_FAILURE_DIAGNOSTIC_BYTES = 16 * 1024;
|
|
3
3
|
/**
|
|
4
4
|
* Validate only the transport envelope of an Agent result. The accepted text
|
|
5
5
|
* remains byte-for-byte unchanged; missing or untransportable text becomes a
|
|
6
|
-
* Core-owned failed outcome so the exact
|
|
6
|
+
* Core-owned failed outcome so the exact AgentRun can still terminalize.
|
|
7
7
|
*/
|
|
8
8
|
export function transportAgentResult(value) {
|
|
9
9
|
if (typeof value !== "string") {
|
|
@@ -28,10 +28,10 @@ export function transportAgentResult(value) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
const bytes = Buffer.byteLength(value, "utf8");
|
|
31
|
-
if (bytes >
|
|
31
|
+
if (bytes > MAX_RUN_RESULT_OUTPUT_BYTES) {
|
|
32
32
|
return {
|
|
33
33
|
status: "failed",
|
|
34
|
-
diagnostic: `Provider Agent result is ${bytes} bytes and exceeds the ${
|
|
34
|
+
diagnostic: `Provider Agent result is ${bytes} bytes and exceeds the ${MAX_RUN_RESULT_OUTPUT_BYTES}-byte durable result limit; the result was not stored.`,
|
|
35
35
|
failureReason: "runtime-failed"
|
|
36
36
|
};
|
|
37
37
|
}
|
|
@@ -42,19 +42,19 @@ export function transportAgentResult(value) {
|
|
|
42
42
|
* This is intentionally separate from Agent result transport: successful
|
|
43
43
|
* Agent text is either retained exactly or rejected as a whole, never
|
|
44
44
|
* truncated. Provider/Core diagnostics may be clipped because they are only
|
|
45
|
-
* operational context for a failed
|
|
45
|
+
* operational context for a failed AgentRun.
|
|
46
46
|
*/
|
|
47
|
-
export function
|
|
47
|
+
export function boundedRunFailureDiagnostic(value, fallback = "Provider reported a failed Agent AgentRun.") {
|
|
48
48
|
const candidate = typeof value === "string" && value.trim().length > 0
|
|
49
49
|
? value
|
|
50
50
|
: fallback;
|
|
51
51
|
const safe = candidate.replaceAll("\0", "\uFFFD");
|
|
52
|
-
if (Buffer.byteLength(safe, "utf8") <=
|
|
52
|
+
if (Buffer.byteLength(safe, "utf8") <= MAX_RUN_FAILURE_DIAGNOSTIC_BYTES) {
|
|
53
53
|
return safe;
|
|
54
54
|
}
|
|
55
55
|
const prefix = Buffer
|
|
56
56
|
.from(safe, "utf8")
|
|
57
|
-
.subarray(0,
|
|
57
|
+
.subarray(0, MAX_RUN_FAILURE_DIAGNOSTIC_BYTES)
|
|
58
58
|
.toString("utf8");
|
|
59
59
|
return prefix.endsWith("\uFFFD") ? prefix.slice(0, -1) : prefix;
|
|
60
60
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { spawn } from "node:child_process";
|
|
2
2
|
import { createInterface } from "node:readline";
|
|
3
|
-
import {
|
|
3
|
+
import { codexClientInitialization } from "../runtime/codexAppServerRuntime.js";
|
|
4
4
|
const DEFAULT_TIMEOUT_MS = 1_000;
|
|
5
5
|
export async function setCodexThreadName(request) {
|
|
6
6
|
const timeoutMs = threadNameTimeout(request.timeoutMs);
|
|
@@ -42,13 +42,7 @@ class CodexNamingClient {
|
|
|
42
42
|
static async start(command, environment, baseArgs, timeoutMs) {
|
|
43
43
|
const client = new CodexNamingClient(spawn(command, [...baseArgs, "app-server", "--stdio"], { env: environment, stdio: ["pipe", "pipe", "pipe"] }));
|
|
44
44
|
try {
|
|
45
|
-
await withTimeout(client.request("initialize",
|
|
46
|
-
clientInfo: { name: "yui", title: "Yui", version: YUI_VERSION },
|
|
47
|
-
capabilities: {
|
|
48
|
-
experimentalApi: true,
|
|
49
|
-
requestAttestation: false
|
|
50
|
-
}
|
|
51
|
-
}), timeoutMs, "Timed out initializing Codex App Server for thread naming.");
|
|
45
|
+
await withTimeout(client.request("initialize", codexClientInitialization()), timeoutMs, "Timed out initializing Codex App Server for thread naming.");
|
|
52
46
|
client.notify("initialized", {});
|
|
53
47
|
return client;
|
|
54
48
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isRoleRunStalled, latestStallProgressAt } from "../scheduler/roleRunStall.js";
|
|
2
2
|
import { validateRuntimeProcessExitObservation } from "../runtime/processExitObservation.js";
|
|
3
3
|
import { runtimeObservationFromTaskEvent } from "../runtime/runtimeObservation.js";
|
|
4
4
|
import { projectRuntimeTaskEvents } from "../runtime/runtimeProjection.js";
|
|
@@ -23,15 +23,15 @@ export function summarizeExecutionGroupHealth(input) {
|
|
|
23
23
|
const healthByLane = new Map(health.lanes.map((lane) => [lane.laneId, lane]));
|
|
24
24
|
const laneSummaries = input.group.lanes.map((lane) => {
|
|
25
25
|
const projected = healthByLane.get(lane.id);
|
|
26
|
-
const
|
|
26
|
+
const run = exactLaneRun(input, lane);
|
|
27
27
|
return Object.freeze({
|
|
28
28
|
roleName: lane.roleName,
|
|
29
29
|
ordinal: lane.ordinal,
|
|
30
|
-
...(lane.
|
|
31
|
-
...(lane.
|
|
30
|
+
...(lane.currentRunId === undefined ? {} : { runId: lane.currentRunId }),
|
|
31
|
+
...(lane.successfulRunId === undefined
|
|
32
32
|
? {}
|
|
33
|
-
: {
|
|
34
|
-
status: projectedStatus(lane,
|
|
33
|
+
: { successfulRunId: lane.successfulRunId }),
|
|
34
|
+
status: projectedStatus(lane, run),
|
|
35
35
|
...(lane.effective === undefined ? {} : { effective: lane.effective }),
|
|
36
36
|
...projected
|
|
37
37
|
});
|
|
@@ -62,28 +62,28 @@ export function actionableExecutionLaneRecoveries(groups) {
|
|
|
62
62
|
: [{
|
|
63
63
|
groupId: group.groupId,
|
|
64
64
|
laneId: lane.laneId,
|
|
65
|
-
...(lane.
|
|
65
|
+
...(lane.runId === undefined ? {} : { runId: lane.runId }),
|
|
66
66
|
...(lane.runtimeHealth === undefined ? {} : { runtimeHealth: lane.runtimeHealth }),
|
|
67
67
|
recovery: "retry-new-turn"
|
|
68
68
|
}]));
|
|
69
69
|
}
|
|
70
70
|
function projectExecutionLaneHealth(lane, input, policy) {
|
|
71
|
-
const
|
|
72
|
-
const continuationAgentId =
|
|
71
|
+
const run = exactLaneRun(input, lane);
|
|
72
|
+
const continuationAgentId = run?.effective.agentId ?? lane.effective?.agentId;
|
|
73
73
|
if (lane.disposition === "open"
|
|
74
|
-
&& lane.
|
|
74
|
+
&& lane.currentRunId !== undefined
|
|
75
75
|
&& continuationAgentId !== undefined
|
|
76
76
|
&& runOwnsBlockingProviderContinuation(input.events, {
|
|
77
77
|
taskId: input.group.taskId,
|
|
78
78
|
roleName: lane.roleName,
|
|
79
|
-
|
|
79
|
+
runId: lane.currentRunId,
|
|
80
80
|
agentId: continuationAgentId
|
|
81
81
|
})) {
|
|
82
82
|
return projection(lane, {
|
|
83
83
|
runtimeHealth: "active",
|
|
84
84
|
recovery: "none",
|
|
85
85
|
resultReusable: false,
|
|
86
|
-
reason: "the exact
|
|
86
|
+
reason: "the exact AgentRun still owns an unsettled Provider continuation writer",
|
|
87
87
|
evidence: ["runtime-continuation-writer-owned"]
|
|
88
88
|
});
|
|
89
89
|
}
|
|
@@ -104,7 +104,7 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
104
104
|
evidence: ["execution-lane-settled-failure"]
|
|
105
105
|
});
|
|
106
106
|
}
|
|
107
|
-
if (lane.
|
|
107
|
+
if (lane.currentRunId === undefined) {
|
|
108
108
|
return projection(lane, {
|
|
109
109
|
recovery: "none",
|
|
110
110
|
resultReusable: false,
|
|
@@ -112,38 +112,38 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
112
112
|
evidence: []
|
|
113
113
|
});
|
|
114
114
|
}
|
|
115
|
-
if (
|
|
115
|
+
if (run === undefined) {
|
|
116
116
|
return projection(lane, {
|
|
117
117
|
runtimeHealth: "suspected-stalled",
|
|
118
118
|
recovery: "inspect",
|
|
119
119
|
resultReusable: false,
|
|
120
|
-
reason: "the open Lane has no exact current
|
|
120
|
+
reason: "the open Lane has no exact current AgentRun",
|
|
121
121
|
evidence: ["execution-lineage-missing"]
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
|
-
if (
|
|
124
|
+
if (run.status === "failed") {
|
|
125
125
|
return projection(lane, {
|
|
126
126
|
runtimeHealth: "confirmed-dead",
|
|
127
127
|
recovery: "retry-new-turn",
|
|
128
128
|
resultReusable: false,
|
|
129
|
-
reason: "the exact current
|
|
129
|
+
reason: "the exact current AgentRun is durably failed",
|
|
130
130
|
evidence: ["turn-terminal-failure"]
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
if (
|
|
133
|
+
if (run.status === "completed") {
|
|
134
134
|
return projection(lane, {
|
|
135
135
|
runtimeHealth: "suspected-stalled",
|
|
136
136
|
recovery: "inspect",
|
|
137
137
|
resultReusable: false,
|
|
138
|
-
reason: "the current
|
|
138
|
+
reason: "the current AgentRun completed without settling its logical Lane",
|
|
139
139
|
evidence: ["execution-lineage-inconsistent"]
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
const session = input.sessions.find((candidate) => (candidate.roleName ===
|
|
143
|
-
&& candidate.agentId ===
|
|
144
|
-
&& candidate.adapterId ===
|
|
145
|
-
const observations =
|
|
146
|
-
const runtime = runtimeProjection(observations, input.events,
|
|
142
|
+
const session = input.sessions.find((candidate) => (candidate.roleName === run.roleName
|
|
143
|
+
&& candidate.agentId === run.effective.agentId
|
|
144
|
+
&& candidate.adapterId === run.effective.adapterId));
|
|
145
|
+
const observations = exactRunObservations(input.events, run, session);
|
|
146
|
+
const runtime = runtimeProjection(observations, input.events, run);
|
|
147
147
|
const unsettledContinuation = runtime !== null
|
|
148
148
|
&& Object.values(runtime.continuations).some((continuation) => (continuation.execution === "active"
|
|
149
149
|
|| continuation.execution === "unknown"
|
|
@@ -152,12 +152,12 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
152
152
|
&& (Object.values(runtime.operations).some(({ kind }) => kind === "subagent")
|
|
153
153
|
|| unsettledContinuation);
|
|
154
154
|
if (observations.some((observation) => (observation.kind === "turn.failed"
|
|
155
|
-
&& observation.payload.failure?.
|
|
155
|
+
&& observation.payload.failure?.runTerminal === true)) && !unsettledChildWork) {
|
|
156
156
|
return projection(lane, {
|
|
157
157
|
runtimeHealth: "confirmed-dead",
|
|
158
158
|
recovery: "inspect",
|
|
159
159
|
resultReusable: false,
|
|
160
|
-
reason: "the Provider reported an exact
|
|
160
|
+
reason: "the Provider reported an exact AgentRun-terminal failure",
|
|
161
161
|
evidence: ["provider-turn-terminal"]
|
|
162
162
|
});
|
|
163
163
|
}
|
|
@@ -178,7 +178,7 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
178
178
|
evidence: runtimeTerminalEvidence
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
|
-
const exit = latestExactProcessExit(input.events,
|
|
181
|
+
const exit = latestExactProcessExit(input.events, run, session);
|
|
182
182
|
if (session?.status === "ended"
|
|
183
183
|
&& exit !== null
|
|
184
184
|
&& isAbnormalExit(exit.classification)
|
|
@@ -191,20 +191,20 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
191
191
|
evidence: ["native-session-terminal", `process-exit:${exit.classification}`]
|
|
192
192
|
});
|
|
193
193
|
}
|
|
194
|
-
if (
|
|
194
|
+
if (isRoleRunStalled(input.events, run.id)) {
|
|
195
195
|
return projection(lane, {
|
|
196
196
|
runtimeHealth: "suspected-stalled",
|
|
197
197
|
recovery: "inspect",
|
|
198
198
|
resultReusable: false,
|
|
199
|
-
reason: `the durable progress clock has not advanced since ${latestStallProgressAt(input.events,
|
|
199
|
+
reason: `the durable progress clock has not advanced since ${latestStallProgressAt(input.events, run.id) ?? run.updatedAt}; no death proof exists`,
|
|
200
200
|
evidence: ["turn-stalled"]
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
const activeOperation = runtime !== null
|
|
204
204
|
&& (Object.keys(runtime.operations).length > 0 || unsettledContinuation);
|
|
205
205
|
const lastActivityAt = runtime?.lastRuntimeActivityAt
|
|
206
|
-
??
|
|
207
|
-
??
|
|
206
|
+
?? run.updatedAt
|
|
207
|
+
?? run.createdAt;
|
|
208
208
|
const recentActivity = input.now.getTime() - Date.parse(lastActivityAt) < policy.quietAfterMs;
|
|
209
209
|
if (activeOperation || recentActivity) {
|
|
210
210
|
return projection(lane, {
|
|
@@ -215,7 +215,7 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
215
215
|
? "the exact runtime reports unsettled continuation work"
|
|
216
216
|
: activeOperation
|
|
217
217
|
? "the exact runtime reports an active operation"
|
|
218
|
-
: "the exact
|
|
218
|
+
: "the exact AgentRun has recent structured runtime activity",
|
|
219
219
|
evidence: unsettledContinuation
|
|
220
220
|
? ["runtime-continuation-unsettled"]
|
|
221
221
|
: activeOperation
|
|
@@ -227,48 +227,36 @@ function projectExecutionLaneHealth(lane, input, policy) {
|
|
|
227
227
|
runtimeHealth: "silent",
|
|
228
228
|
recovery: "none",
|
|
229
229
|
resultReusable: false,
|
|
230
|
-
reason: "the exact
|
|
230
|
+
reason: "the exact AgentRun remains active without recent structured activity; silence alone is not death",
|
|
231
231
|
evidence: ["turn-active"]
|
|
232
232
|
});
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return lane.
|
|
234
|
+
function exactLaneRun(input, lane) {
|
|
235
|
+
return lane.currentRunId === undefined
|
|
236
236
|
? undefined
|
|
237
|
-
: input.
|
|
238
|
-
&&
|
|
239
|
-
&&
|
|
240
|
-
&&
|
|
241
|
-
&&
|
|
237
|
+
: input.runs.find((run) => (run.taskId === input.group.taskId
|
|
238
|
+
&& run.id === lane.currentRunId
|
|
239
|
+
&& run.executionGroupId === input.group.id
|
|
240
|
+
&& run.executionLaneId === lane.id
|
|
241
|
+
&& run.roleName === lane.roleName));
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function exactRunObservations(events, run, session) {
|
|
244
244
|
return events.map(runtimeObservationFromTaskEvent)
|
|
245
|
-
.filter((observation) => (observation !== null
|
|
246
|
-
&& observation.fence.taskId === turn.taskId
|
|
247
|
-
&& observation.fence.turnId === turn.id
|
|
248
|
-
&& observation.fence.roleName === turn.roleName
|
|
249
|
-
&& observation.fence.agentId === turn.effective.agentId
|
|
250
|
-
&& (session?.runtimeGenerationId === undefined || observation.fence.runtimeGenerationId === session.runtimeGenerationId)
|
|
251
|
-
&& (session?.nativeSessionId === undefined
|
|
252
|
-
|| observation.fence.nativeSessionId === session.nativeSessionId)));
|
|
245
|
+
.filter((observation) => (observation !== null && observation.fence.taskId === run.taskId && observation.fence.runId === run.id && observation.fence.roleName === run.roleName && observation.fence.agentId === run.effective.agentId && (session?.nativeSessionId === undefined || observation.fence.nativeSessionId === session.nativeSessionId)));
|
|
253
246
|
}
|
|
254
|
-
function runtimeProjection(observations, events,
|
|
247
|
+
function runtimeProjection(observations, events, run) {
|
|
255
248
|
const first = observations[0];
|
|
256
249
|
return first === undefined
|
|
257
250
|
? null
|
|
258
|
-
: projectRuntimeTaskEvents(first.fence,
|
|
251
|
+
: projectRuntimeTaskEvents(first.fence, run.createdAt, events);
|
|
259
252
|
}
|
|
260
|
-
function latestExactProcessExit(events,
|
|
253
|
+
function latestExactProcessExit(events, run, session) {
|
|
261
254
|
const matching = events.flatMap((event) => {
|
|
262
255
|
if (event.type !== "runtime.process-exit-observed")
|
|
263
256
|
return [];
|
|
264
257
|
try {
|
|
265
258
|
const observation = validateRuntimeProcessExitObservation(JSON.parse(event.payload.observation ?? ""));
|
|
266
|
-
if (observation.taskId !==
|
|
267
|
-
|| observation.turnId !== turn.id
|
|
268
|
-
|| observation.roleName !== turn.roleName
|
|
269
|
-
|| (session?.runtimeGenerationId !== undefined && observation.runtimeGenerationId !== session.runtimeGenerationId)
|
|
270
|
-
|| (session?.nativeSessionId !== undefined
|
|
271
|
-
&& observation.nativeSessionId !== session.nativeSessionId))
|
|
259
|
+
if (observation.taskId !== run.taskId || observation.runId !== run.id || observation.roleName !== run.roleName || (session?.nativeSessionId !== undefined && observation.nativeSessionId !== session.nativeSessionId))
|
|
272
260
|
return [];
|
|
273
261
|
return [{
|
|
274
262
|
observation,
|
|
@@ -284,18 +272,18 @@ function latestExactProcessExit(events, turn, session) {
|
|
|
284
272
|
function isAbnormalExit(classification) {
|
|
285
273
|
return classification === "host-abnormal" || classification === "provider-turn-failed";
|
|
286
274
|
}
|
|
287
|
-
function projectedStatus(lane,
|
|
275
|
+
function projectedStatus(lane, run) {
|
|
288
276
|
if (lane.disposition === "succeeded")
|
|
289
277
|
return "succeeded";
|
|
290
278
|
if (lane.disposition === "failed")
|
|
291
279
|
return "failed";
|
|
292
|
-
if (lane.
|
|
280
|
+
if (lane.currentRunId === undefined)
|
|
293
281
|
return "pending";
|
|
294
|
-
if (
|
|
282
|
+
if (run === undefined)
|
|
295
283
|
return "unknown";
|
|
296
|
-
if (
|
|
284
|
+
if (run.status === "active")
|
|
297
285
|
return "running";
|
|
298
|
-
if (
|
|
286
|
+
if (run.status === "failed")
|
|
299
287
|
return "needs-attention";
|
|
300
288
|
return "unknown";
|
|
301
289
|
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { enqueueRoleRunDispatch } from "../coordination/workMailboxQueue.js";
|
|
2
|
+
import { createRunInput } from "../context/runInputContract.js";
|
|
3
|
+
import { contextSnapshotDeltaRefIds, freezeRunContextSnapshot } from "../context/runContextPack.js";
|
|
4
|
+
import { contextSnapshotRef } from "../context/contextSnapshot.js";
|
|
5
|
+
import { roleAgentSessionResumeMode } from "../executor/agentExecutor.js";
|
|
6
|
+
import { resolveEffectiveLaunch } from "../executor/effectiveLaunch.js";
|
|
7
|
+
import { createTaskEvent } from "../event/taskEvent.js";
|
|
8
|
+
import { startReviewRound } from "../review/reviewRound.js";
|
|
9
|
+
import { createRun } from "../agentRun/agentRun.js";
|
|
10
|
+
export function selectedReviewSynthesisProducers(store, round, group, sourceRunIds) {
|
|
11
|
+
if (sourceRunIds.length === 0 || new Set(sourceRunIds).size !== sourceRunIds.length) {
|
|
12
|
+
throw new Error("Synthesis requires explicit, distinct source AgentRun references.");
|
|
13
|
+
}
|
|
14
|
+
return sourceRunIds.map((runId) => {
|
|
15
|
+
const run = store.getRun(round.taskId, runId);
|
|
16
|
+
const lane = group.lanes.find(({ id }) => id === run?.executionLaneId);
|
|
17
|
+
if (run === null
|
|
18
|
+
|| lane === undefined
|
|
19
|
+
|| !["completed", "failed"].includes(run.status)
|
|
20
|
+
|| run.purpose !== "review"
|
|
21
|
+
|| run.reviewRoundId !== round.id
|
|
22
|
+
|| run.executionGroupId !== group.id
|
|
23
|
+
|| run.executionLaneId !== lane.id
|
|
24
|
+
|| run.roleName !== lane.roleName
|
|
25
|
+
|| run.result === undefined) {
|
|
26
|
+
throw new Error(`Synthesis source is not an exact terminal Review Producer result: `
|
|
27
|
+
+ `${group.id}/${runId}.`);
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
laneId: lane.id,
|
|
31
|
+
roleName: lane.roleName,
|
|
32
|
+
runId: run.id
|
|
33
|
+
};
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
/** Called within the caller's transaction after Task authority is checked. */
|
|
37
|
+
export function dispatchReviewSynthesis(store, taskId, reviewRoundId, sourceRunIds, now) {
|
|
38
|
+
const task = store.getTask(taskId);
|
|
39
|
+
if (task === null || task.status !== "active" || task.executionGate.state !== "enabled") {
|
|
40
|
+
throw new Error(`Task execution is not enabled: ${taskId}.`);
|
|
41
|
+
}
|
|
42
|
+
const round = store.getReviewRound(taskId, reviewRoundId);
|
|
43
|
+
if (round === null || round.status !== "running") {
|
|
44
|
+
throw new Error(`ReviewRound is not running: ${taskId}/${reviewRoundId}.`);
|
|
45
|
+
}
|
|
46
|
+
const group = round.executionGroup;
|
|
47
|
+
if (group === undefined)
|
|
48
|
+
throw new Error(`ReviewRound has no ExecutionGroup: ${round.id}.`);
|
|
49
|
+
const producers = selectedReviewSynthesisProducers(store, round, group, sourceRunIds);
|
|
50
|
+
const existing = store.listRuns(taskId).filter((run) => (run.purpose === "review"
|
|
51
|
+
&& run.reviewRoundId === round.id
|
|
52
|
+
&& run.sourceExecutionGroupId === group.id));
|
|
53
|
+
if (existing.length > 0 || round.reviewerRunId !== undefined) {
|
|
54
|
+
throw new Error(`Synthesis already exists for ${group.id}; retry its AgentRun explicitly.`);
|
|
55
|
+
}
|
|
56
|
+
const role = store.getRole(taskId, round.reviewerRoleName);
|
|
57
|
+
if (role === null) {
|
|
58
|
+
throw new Error(`Review main Role is missing: ${taskId}/${round.reviewerRoleName}.`);
|
|
59
|
+
}
|
|
60
|
+
if (store.getActiveRun(taskId, role.name) !== null) {
|
|
61
|
+
throw new Error(`Review main Role already has an active AgentRun: ${role.name}.`);
|
|
62
|
+
}
|
|
63
|
+
const workspace = store.getReviewRoundWorkspace(taskId, round.id);
|
|
64
|
+
if (workspace === null) {
|
|
65
|
+
throw new Error(`Review main workspace is missing: ${taskId}/${round.id}.`);
|
|
66
|
+
}
|
|
67
|
+
const effective = resolveEffectiveLaunch({
|
|
68
|
+
role,
|
|
69
|
+
purpose: "review",
|
|
70
|
+
workspace,
|
|
71
|
+
reviewRoundId: round.id,
|
|
72
|
+
reviewBaseCommit: round.reviewBaseCommit
|
|
73
|
+
});
|
|
74
|
+
const snapshot = freezeRunContextSnapshot(store, {
|
|
75
|
+
taskId,
|
|
76
|
+
roleName: role.name,
|
|
77
|
+
purpose: "review",
|
|
78
|
+
...(round.workItemId === undefined ? {} : { workItemId: round.workItemId }),
|
|
79
|
+
reviewRoundId: round.id,
|
|
80
|
+
sourceExecutionGroupId: group.id,
|
|
81
|
+
workspace
|
|
82
|
+
}, now, "leader", group.assignment.contextSnapshotRef, sourceRunIds);
|
|
83
|
+
const run = createRun(store.nextRunId(taskId), taskId, role.name, roleAgentSessionResumeMode(store.getTaskRoleSessionSet(taskId, role.name), effective.agentId, effective), createRunInput({
|
|
84
|
+
source: {
|
|
85
|
+
type: "yui",
|
|
86
|
+
channel: round.workItemId === undefined ? "task-dispatch" : "workitem-dispatch"
|
|
87
|
+
},
|
|
88
|
+
directive: synthesisDirective(group, producers),
|
|
89
|
+
contextSnapshotRef: contextSnapshotRef(snapshot),
|
|
90
|
+
deltaRefIds: contextSnapshotDeltaRefIds(store, snapshot)
|
|
91
|
+
}), now, {
|
|
92
|
+
...(round.workItemId === undefined ? {} : { workItemId: round.workItemId }),
|
|
93
|
+
purpose: "review",
|
|
94
|
+
reviewRoundId: round.id,
|
|
95
|
+
sourceExecutionGroupId: group.id,
|
|
96
|
+
workspace,
|
|
97
|
+
effective
|
|
98
|
+
});
|
|
99
|
+
store.saveRun(run);
|
|
100
|
+
store.saveReviewRound(taskId, startReviewRound(round, run.id));
|
|
101
|
+
store.saveActiveRun(run);
|
|
102
|
+
enqueueRoleRunDispatch(store, {
|
|
103
|
+
taskId,
|
|
104
|
+
roleName: role.name,
|
|
105
|
+
runId: run.id,
|
|
106
|
+
reason: "review-synthesis-ready",
|
|
107
|
+
occurredAt: now
|
|
108
|
+
});
|
|
109
|
+
store.saveEvent(taskId, createTaskEvent(store.nextEventId(taskId), taskId, "run.review-dispatched", {
|
|
110
|
+
runId: run.id,
|
|
111
|
+
role: run.roleName,
|
|
112
|
+
purpose: run.purpose,
|
|
113
|
+
mode: run.mode,
|
|
114
|
+
agent: `${run.effective.agentId}/${run.effective.adapterId}`,
|
|
115
|
+
component: run.effective.component,
|
|
116
|
+
effectiveRevision: String(run.effective.sourceDesiredRevision),
|
|
117
|
+
profileAccess: run.effective.profileAccess,
|
|
118
|
+
effectivePermission: run.effective.permission.strategy,
|
|
119
|
+
writeProjectIds: run.effective.writeProjectIds.join(",") || "none",
|
|
120
|
+
reviewRoundId: round.id,
|
|
121
|
+
sourceExecutionGroupId: group.id
|
|
122
|
+
}, now));
|
|
123
|
+
return run;
|
|
124
|
+
}
|
|
125
|
+
function synthesisDirective(group, producers) {
|
|
126
|
+
return [
|
|
127
|
+
"Act as the main Reviewer over the explicitly selected Producer results in the supplied order.",
|
|
128
|
+
"Expand each exact source AgentRun from the frozen Context Snapshot and consume its original result text plus Core-authored system evidence.",
|
|
129
|
+
"Resolve disagreements through review judgment against the frozen candidate. Do not rerun, retry, append, select, or abandon Lanes.",
|
|
130
|
+
"Return one complete original review result for the Leader; Yui Core does not parse or validate its semantic structure.",
|
|
131
|
+
JSON.stringify({
|
|
132
|
+
schemaVersion: 1,
|
|
133
|
+
sourceExecutionGroupId: group.id,
|
|
134
|
+
producers
|
|
135
|
+
}, null, 2)
|
|
136
|
+
].join("\n\n");
|
|
137
|
+
}
|