@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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
<p align="right"><a href="./managed-turn-and-session-runtime.md">English</a> | <strong>简体中文</strong></p>
|
|
2
|
+
|
|
3
|
+
# Session、AgentRun 与通知
|
|
4
|
+
|
|
5
|
+
## 权威
|
|
6
|
+
|
|
7
|
+
Task、WorkItem、Message、Decision、Artifact 和 Project Knowledge 保存持久工作。
|
|
8
|
+
Session 标识一段原生对话及其捕获的权限。AgentRun 记录一次明确请求的执行和原始
|
|
9
|
+
结果。AgentHost 是一次性 attachment,不是 Task 真相的 owner。
|
|
10
|
+
|
|
11
|
+
一个当前、未撤销的 Leader Session 可以在没有活动 Run 的情况下读取 Context 并保存
|
|
12
|
+
范围受限的 Task 事实,包括一个正式的 InputRequest。它确切的 Session 是该请求的
|
|
13
|
+
来源;有实际 Run 时会一并包含。这个问题在该执行结束后仍然存在,直到被回答或取消
|
|
14
|
+
才关闭。Worker 与 Reviewer 命令保留精确的 Assignment 检查。Session 替换、Role
|
|
15
|
+
绑定、Task 范围和资源 grant 各在其边界检查。一个活动 Run 指针并不证明同一 Session
|
|
16
|
+
中一条无关命令来自那个 Run。
|
|
17
|
+
|
|
18
|
+
原生对话、Goal 延续和普通 Leader 通知不会自动创建 Run。显式派发加载一个确切的
|
|
19
|
+
Run Context Pack。
|
|
20
|
+
|
|
21
|
+
## Context
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
yui task context <task> --json
|
|
25
|
+
yui task context delta <task> --after <coreCursor>
|
|
26
|
+
yui task context inspect <task> --store <store> --ref <id>
|
|
27
|
+
yui task run context <task/run> --json
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Task Context 是一个有界的、获授权的工作集,带有当前 core 游标。delta 在一个固定
|
|
31
|
+
上界内分页不可变事件;inspect 展开一条当前记录,并可要求确切摘要。运行时观察声明
|
|
32
|
+
自己的覆盖范围,不会成为另一份持久快照。
|
|
33
|
+
|
|
34
|
+
Run Context 冻结 Assignment、来源引用、生效配置和工作区边界。一次 Role 编辑不改写
|
|
35
|
+
既有 Assignment。读取任一 Context 都不确认输入或创建执行权限。每一条受管输入都指向
|
|
36
|
+
确切的 Session Manifest 和 CLI 入口。Run Pack 是一个参考目录:动手前先读相关的需求
|
|
37
|
+
和消息正文,而不是把加载成功当成交付物。规划 Pack 不暴露 Project 写范围或 Task 完成
|
|
38
|
+
权限。
|
|
39
|
+
|
|
40
|
+
当前 Task 读取也会把无定向目标的 user/Operator 消息暴露给该 Task 当前的 Worker 和
|
|
41
|
+
Reviewer Session,包括在它们 Run 快照冻结之后新增的需求。用 `task message list/show`
|
|
42
|
+
或 Task Context inspect 来读取那些原始记录。这不改写冻结的 Assignment,也不授予投递
|
|
43
|
+
权限。定向消息、其他 Role 的结果以及其他 Task 仍在调用者范围之外,除非其 Assignment
|
|
44
|
+
授权访问它们。
|
|
45
|
+
|
|
46
|
+
## 派发与通知
|
|
47
|
+
|
|
48
|
+
一次显式派发在原生提交之前持久化执行意图。普通 Leader 唤醒则认领一个固定的
|
|
49
|
+
TaskWake/mailbox 批次,并通过同一个 Host/Endpoint 提交一条通知。已确认的接受只消费
|
|
50
|
+
那个批次;之后的输入仍待处理。通知不需要最终执行报告,也不会强行 steer 进入一段忙碌
|
|
51
|
+
的原生对话。
|
|
52
|
+
|
|
53
|
+
Leader 本地编辑保留持久事件,但不创建自唤醒。当 Leader 忙碌或不可用时,其他来源的
|
|
54
|
+
输入仍然持久。Operator 通知同样携带 TaskEvent/InputRequest 读取指针,而不是重复的
|
|
55
|
+
Task 叙述。人工输入、显式执行进入和激活失败通过既有唤醒机制及时投递。Worker 结果
|
|
56
|
+
保留其聚合窗口。忙碌的原生输入仍保留待处理的消息。
|
|
57
|
+
|
|
58
|
+
| 证据 | 处置 |
|
|
59
|
+
| --- | --- |
|
|
60
|
+
| 忙碌且已证明未接受 | 保留输入;新的传输尝试可以使用同一 Session |
|
|
61
|
+
| 原生接受 | 绝不重发;若这是一次执行,等待确切终态 |
|
|
62
|
+
| 仅有传输写入 | 保留传输证据;不宣称原生已接受 |
|
|
63
|
+
| 显式拒绝 | 保留原始原因并结算相应的准入 |
|
|
64
|
+
| 未知接受/效果 | 保留该尝试和冲突资源围栏;不重放也不切换 Session |
|
|
65
|
+
|
|
66
|
+
崩溃后缺少回执不证明未接受。结构化的 `SESSION_BUSY` 是证据;含有 “busy” 字样的文本
|
|
67
|
+
不是重试合同。
|
|
68
|
+
|
|
69
|
+
## 延续既有工作
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
yui task message send <task> "Continue with the clarified requirement" \
|
|
73
|
+
--to <role> --work-item <work-item>
|
|
74
|
+
yui task message handoff <task/message> --to <successor-role>
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Review 澄清使用 `--review-round` 代替 `--work-item`。Message 保留收件人、工作关联和
|
|
78
|
+
owner Run。当 Role 忙碌时,保存会返回而不打断它。一旦它可用,一个有界有序批次可以
|
|
79
|
+
创建一个 continuation Run,与那些消息原子地关联。既有 Assignment、生效权限、工作区
|
|
80
|
+
和未完成文件都保留;快照再加上获授权的消息和前一次原始结果。重复的终态不能把消息
|
|
81
|
+
指派两次。
|
|
82
|
+
|
|
83
|
+
所有权变更、不兼容的 Session、终态工作和过时的 Review 候选都保留可见的未投递原因。
|
|
84
|
+
显式 handoff 只针对同一工作已派发的后继。复制的 Producer/综合血缘不会被一条消息
|
|
85
|
+
静默改写。
|
|
86
|
+
|
|
87
|
+
未知的 Leader 通知保留其唤醒和输入窗口:
|
|
88
|
+
|
|
89
|
+
```sh
|
|
90
|
+
yui task wake show <task> <wake>
|
|
91
|
+
yui task wake resolve <task> <wake> --reason <quiescence-evidence>
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
resolve 在原生效果围栏清除后释放该认领。它既不重放通知,也不编造接受或完成。独立的
|
|
95
|
+
Role 工作和合法的本地事实不是一把 Task 范围的恢复锁。
|
|
96
|
+
|
|
97
|
+
## 精确结果
|
|
98
|
+
|
|
99
|
+
原生终态只结算相匹配的那次执行。已知的原生 Turn ID 必须匹配;串行流可以使用已证明的
|
|
100
|
+
本地尝试关联。message UUID 不是原生 Turn ID。同一 Session 中无关的原生对话不能完成
|
|
101
|
+
待处理的 Yui 请求。
|
|
102
|
+
|
|
103
|
+
终态事务保存一个 AgentRunResult 和一条引用 Message。
|
|
104
|
+
`resultRef: { type: "agent-run-result", runId: "run-12" }` 展开原始报告而不是复制它。
|
|
105
|
+
Candidate 和 ReviewRound 保留来源;Core 不从散文中推导语义接受。
|
|
106
|
+
|
|
107
|
+
取消请求不证明物理静止。确切的终态证据保留部分输出,并只结算原始执行。Host 退出
|
|
108
|
+
并不意味着共享 Provider 或后代进程已停止。
|
|
109
|
+
|
|
110
|
+
## Draft 规划与激活
|
|
111
|
+
|
|
112
|
+
`EffectiveLaunchSnapshot.executionAuthority` 捕获 `planning | delivery`。它不从 Task
|
|
113
|
+
当前生命周期重新计算。planning 允许本地规划事实,不允许交付派发、候选采用、集成或
|
|
114
|
+
交付工作区 Job。
|
|
115
|
+
|
|
116
|
+
初始 Draft 规划派发创建一个 planning Run,并只绑定其初始消息批次。接受或一个确切终态
|
|
117
|
+
消费该批次;失败不会反复重建同一个规划执行。既有 planning Session 中后续的普通消息
|
|
118
|
+
仍是通知。Operator 提交和直接的 Task 消息都能到达那个 Session。Draft 计划/WorkItem
|
|
119
|
+
编辑保留执行历史;外部编辑通知 Leader,而它自己的规划编辑不创建自唤醒。
|
|
120
|
+
|
|
121
|
+
新的 Draft Role 使用位于 `<YUI_HOME>.task-runtimes/planning` 下、专属于该 Task 的规划
|
|
122
|
+
目录,在控制 Home 和交付树之外。一个 planning Run 可以用 `task activation request`
|
|
123
|
+
持久化意图并立即返回一个 `afterPlanningRun` 引用。它的终态把该请求释放给 Controller
|
|
124
|
+
准入;被取消的意图不会复活。Leader 也可以在普通讨论中请求激活而无需 AgentRun:一旦
|
|
125
|
+
原生输入结算,Controller 就采用其持久意图。不需要合成 Run 或额外的用户“continue”。
|
|
126
|
+
|
|
127
|
+
对于已绑定的 Git Project,`--environment empty` 表示没有额外环境:这些 Project 仍会
|
|
128
|
+
获得受管 worktree。`scratch` 选择一个 Task 拥有的目录。`local` 需要一个已登记的 local
|
|
129
|
+
Resource 及其 grant;Project ID 不是 local Resource ID。
|
|
130
|
+
|
|
131
|
+
资源准备先于对 Task 状态和工作区所有权的原子采用。一次失败的采用记录一个失败请求,
|
|
132
|
+
并用持久事实通知 Leader;在失败未变时它不反复准备资源。Leader 选择显式重试或修正后的
|
|
133
|
+
请求。成功激活同样为 Leader 留下一条交付通知。激活绝不把活动 Session 变更为交付权限。
|
|
134
|
+
一次改变的启动必须通过既有的 Session 替换/环境边界。planning 权限是一项 CLI 保证,
|
|
135
|
+
不是针对恶意代码的文件系统沙箱。
|
|
136
|
+
|
|
137
|
+
## 检查与生命周期
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
yui task run list <task>
|
|
141
|
+
yui task run show <task/run> --json
|
|
142
|
+
yui task message show <task/message>
|
|
143
|
+
yui task role session inspect <task> <role>
|
|
144
|
+
yui task execution start <task>
|
|
145
|
+
yui task execution stop <task> --force --reason <reason>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Task execution start/stop 控制 Task 准入,而不是 Task 验收。stop 先围住新的 Yui 工作,
|
|
149
|
+
然后中断每一条被拥有的确切原生输入,并在移除 attachment 之前确认其终态。这也覆盖没有
|
|
150
|
+
Run 的普通 Leader 通知。未知的原生状态阻塞清理;仅停止一个代理绝不证明一个共享 Turn
|
|
151
|
+
已结束。start 保留持久进展,并在旧占用结算后接纳新输入。Draft 规划可以暂停/恢复,
|
|
152
|
+
失败的 planning Run 以 planning 权限重试。获授权的 user/Operator 可以通过
|
|
153
|
+
`task role session stop` 停止一个空闲的 Draft Session;它不必仅为恢复就激活 Task。
|
|
154
|
+
`task role session new <task> <role> --reason <reason>` 持久化一个显式替换请求。复用是
|
|
155
|
+
一种偏好,而不是要求证明旧对话不可恢复。该请求在 AgentRun 活动、Session 已结束或
|
|
156
|
+
上一次清理待处理时都是合法的。Leader 也可以请求替换自己并结束当前轮次。
|
|
157
|
+
|
|
158
|
+
`task role session stop` 也可以在不先更改 Run 状态的情况下停止一个运行中的 Role。它
|
|
159
|
+
保留原生对话以备复用。待处理的 Message 仍是意图,可以在停止后启动一次 continuation;
|
|
160
|
+
当整个 Task 都必须保持暂停时,使用 Task execution stop。对于自我替换,使用异步的
|
|
161
|
+
`session new` 请求,而不是同步的自我停止。
|
|
162
|
+
|
|
163
|
+
既有的运行时清理路径停止确切的原生执行,把该 Role 剩余的工程尝试关闭为 cancelled,
|
|
164
|
+
保留 Session/Run 历史和工作区,并选择一段新对话。其他 Role 和 Task 验收保持不变。
|
|
165
|
+
Leader 收到一条新的上下文通知;它决定重试哪些 Worker/Reviewer 尝试。待处理的输入
|
|
166
|
+
引用在替换后仍然存在,包括比新通知时间窗更早的记录。
|
|
167
|
+
|
|
168
|
+
一个缺席的 Host 不移除恢复入口。Codex 可以通过一个一次性的原生控制连接被检查和中断,
|
|
169
|
+
而不启动模型。专用 Claude 进程托管独立于 Host 持久化。真实的未确认执行仍阻止冲突资源
|
|
170
|
+
复用;清理失败是一条路由给 supervisor 的持久诊断,而不是编造接受或删除 Task 的理由。
|
|
171
|
+
仅有一个预分配的 ID 不证明一段对话存在。Codex 在一次失败的原生 Turn 之后可能保留
|
|
172
|
+
`systemError`。仅凭那个标签既不证明活动也不授权清理:Yui 在替换 Session 之前会检查
|
|
173
|
+
最新原生 Turn 的终态元数据并排空后台执行。未知或仍在运行的原生工作仍受保护。
|
|
174
|
+
|
|
175
|
+
已释放的 Leader 保留对自己 Task 和上下文的范围受限诊断读取,但不能修改它或读取另一个
|
|
176
|
+
Task。Operator 诊断和 Controller 重启不先要求一个健康的 Controller;当 RPC 不可用时,
|
|
177
|
+
显式重启只能用 PID/start 身份停止同一 Home 的那个确切进程。Operator 的存储诊断/升级
|
|
178
|
+
也能到达专用的迁移入口,而不先要求 Home 已经处于目标存储版本。完成、取消和归档具有
|
|
179
|
+
彼此不同的权限和资源边界。存储变更使用唯一的
|
|
180
|
+
[升级合同](sqlite-control-plane-design.zh-CN.md)。
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<p align="right"><strong>English</strong> | <a href="./README.zh-CN.md">简体中文</a></p>
|
|
2
|
+
|
|
3
|
+
# Runtime observations and diagnostics
|
|
4
|
+
|
|
5
|
+
Read-only projections help an Agent distinguish durable intent, actual runtime
|
|
6
|
+
activity and unknown effects. They do not add a second scheduling or acceptance
|
|
7
|
+
authority.
|
|
8
|
+
|
|
9
|
+
## Inspection
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
yui controller status
|
|
13
|
+
yui execution audit --task <task-id> --json
|
|
14
|
+
yui task next-action <task-id>
|
|
15
|
+
yui task role session inspect <task-id> <role>
|
|
16
|
+
yui task run show <task-id>/<run-id> --json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Controller status exposes the current process and Home identity. Session inspect
|
|
20
|
+
separates desired binding, effective launch, actual connection and Agent-reported
|
|
21
|
+
configuration. Run inspection exposes original input, disposition, exact result
|
|
22
|
+
and diagnostics. A status read does not start another Agent or acknowledge work.
|
|
23
|
+
|
|
24
|
+
## Meaning of evidence
|
|
25
|
+
|
|
26
|
+
- Task and WorkItem lifecycle describe intent and acceptance.
|
|
27
|
+
- AgentRun lifecycle describes explicitly requested execution.
|
|
28
|
+
- Provider acceptance and native activity describe the actual input/connection.
|
|
29
|
+
- Host PID, tmux and resource inventory describe process observations.
|
|
30
|
+
- Runtime configuration distinguishes requested values from reported values.
|
|
31
|
+
- Tokens, durations and orchestration costs are advisory observations.
|
|
32
|
+
|
|
33
|
+
For a dedicated Claude stream, a main assistant response confirms processing
|
|
34
|
+
of the one current local input before its terminal result. Controller and Role
|
|
35
|
+
reads therefore show accepted/running once that response arrives. Startup,
|
|
36
|
+
echoed user input, child output and repeated old messages do not establish new
|
|
37
|
+
acceptance; message UUIDs are never used as native Turn IDs.
|
|
38
|
+
|
|
39
|
+
Ordinary Leader notifications are TaskWake/mailbox delivery, not Leader Runs.
|
|
40
|
+
Role status includes their native admission/activity even when no AgentRun is
|
|
41
|
+
open, and shows a retained Session's actual workspace rather than substituting
|
|
42
|
+
Task main when its WorkItem is terminal.
|
|
43
|
+
Unknown evidence remains unknown; process exit does not prove a shared Provider
|
|
44
|
+
stopped, and successful transport does not prove native acceptance.
|
|
45
|
+
|
|
46
|
+
Engineering control evidence can outlive the attached Session cache. Such a
|
|
47
|
+
Role reports retained native input as needing attention, not idle merely because
|
|
48
|
+
the cache is empty. Scoped Task/Session inspection remains available for diagnosis.
|
|
49
|
+
Replacement and native cleanup failures are durable events routed to the
|
|
50
|
+
supervisor, and pending input references remain readable after replacement.
|
|
51
|
+
|
|
52
|
+
Exact tool start/result events project `tool-active`, while model activity
|
|
53
|
+
projects `model-active`; quiet intervals do not imply a hung or finished Agent.
|
|
54
|
+
Tool failures are operation outcomes, not automatic Run failures. An owned
|
|
55
|
+
Claude execution process dying closes its exact input and marks its Session
|
|
56
|
+
failed, even while the supervising Host remains alive. A deliberately stopped
|
|
57
|
+
Session with settled native input is idle rather than a false runtime failure.
|
|
58
|
+
|
|
59
|
+
## Execution audit
|
|
60
|
+
|
|
61
|
+
`execution audit` aggregates existing Task, Run, wake, Session, Review,
|
|
62
|
+
Integration, Publication, event, WorkItem, storage and orchestration evidence.
|
|
63
|
+
`--since` and `--until` bound the time window. Sections report their own read
|
|
64
|
+
errors without inventing values for missing data.
|
|
65
|
+
|
|
66
|
+
Fault classification uses Core-owned failure reasons or explicitly identified
|
|
67
|
+
Core diagnostic evidence. Agent-authored report prose is not parsed into
|
|
68
|
+
verdicts or severity. Native Agent errors retain their original payload and
|
|
69
|
+
standard category for the Agent to interpret with current Task context.
|
|
70
|
+
|
|
71
|
+
Cost and repeated-work advisories do not prevent a legal action, set a Review
|
|
72
|
+
budget or choose a recovery topology. `task next-action` is decision support,
|
|
73
|
+
not an automatically executed plan.
|
|
74
|
+
|
|
75
|
+
## Privacy and resource boundary
|
|
76
|
+
|
|
77
|
+
Telemetry and caches are diagnostic material, not Task truth or a transcript
|
|
78
|
+
backup. Do not collect or publish credentials, private environment values or
|
|
79
|
+
raw Provider history merely to explain a status.
|
|
80
|
+
|
|
81
|
+
Start with exact read-only records. Process changes, cancellation, grant updates
|
|
82
|
+
and resource cleanup require the relevant explicit action and scope. A generic
|
|
83
|
+
diagnostic request does not authorize live-model, shared or production tests.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
<p align="right"><a href="./README.md">English</a> | <strong>简体中文</strong></p>
|
|
2
|
+
|
|
3
|
+
# 运行时观察与诊断
|
|
4
|
+
|
|
5
|
+
只读投影帮助 Agent 区分持久意图、实际运行时活动和未知效果。它们不引入第二套
|
|
6
|
+
调度或验收权威。
|
|
7
|
+
|
|
8
|
+
## 检查
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
yui controller status
|
|
12
|
+
yui execution audit --task <task-id> --json
|
|
13
|
+
yui task next-action <task-id>
|
|
14
|
+
yui task role session inspect <task-id> <role>
|
|
15
|
+
yui task run show <task-id>/<run-id> --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Controller status 暴露当前进程与 Home 身份。Session inspect 区分期望绑定、
|
|
19
|
+
生效启动、实际连接以及 Agent 自报配置。Run 检查暴露原始输入、处置、精确结果
|
|
20
|
+
和诊断。读取状态不会启动另一个 Agent,也不确认工作。
|
|
21
|
+
|
|
22
|
+
## 证据的含义
|
|
23
|
+
|
|
24
|
+
- Task 与 WorkItem 生命周期描述意图和验收。
|
|
25
|
+
- AgentRun 生命周期描述明确请求的一次执行。
|
|
26
|
+
- Provider 接受与原生活动描述实际的输入/连接。
|
|
27
|
+
- Host PID、tmux 与资源清单描述进程观察。
|
|
28
|
+
- 运行时配置区分请求值与自报值。
|
|
29
|
+
- token、时长与编排成本是仅供参考的观察。
|
|
30
|
+
|
|
31
|
+
对于专用 Claude 流,一次主 assistant 响应会在终态结果之前确认当前这一条本地
|
|
32
|
+
输入已被处理。因此该响应到达后,Controller 与 Role 读取才显示 accepted/running。
|
|
33
|
+
启动、回显的用户输入、子响应以及重复的旧消息都不建立新的接受;message UUID
|
|
34
|
+
永远不作为原生 Turn ID。
|
|
35
|
+
|
|
36
|
+
普通 Leader 通知是 TaskWake/mailbox 投递,不是 Leader Run。即使没有打开
|
|
37
|
+
AgentRun,Role 状态也包含其原生准入/活动;当某个 WorkItem 处于终态时,它显示
|
|
38
|
+
保留 Session 的实际工作区,而不是用 Task main 顶替。未知证据仍为未知;进程退出
|
|
39
|
+
不证明共享 Provider 已停止,传输成功也不证明原生已接受。
|
|
40
|
+
|
|
41
|
+
工程控制证据可以比附着的 Session 缓存活得更久。这样的 Role 会把保留的原生输入
|
|
42
|
+
报告为需要关注,而不因缓存为空就当作空闲。范围受限的 Task/Session 检查仍可用于
|
|
43
|
+
诊断。替换与原生清理失败是持久事件,路由给 supervisor;替换后待处理的输入引用
|
|
44
|
+
仍然可读。
|
|
45
|
+
|
|
46
|
+
精确的工具 start/result 事件投影为 `tool-active`,模型活动投影为 `model-active`;
|
|
47
|
+
安静间隔并不意味着 Agent 卡住或已完成。工具失败是操作结果,不是自动的 Run 失败。
|
|
48
|
+
被拥有的 Claude 执行进程若死亡,会关闭其精确输入并把 Session 标记为 failed,即使
|
|
49
|
+
监督它的 Host 仍存活。一个已被有意停止、且原生输入已结算的 Session 是空闲状态,
|
|
50
|
+
而不是虚假的运行时失败。
|
|
51
|
+
|
|
52
|
+
## 执行审计
|
|
53
|
+
|
|
54
|
+
`execution audit` 汇总既有的 Task、Run、wake、Session、Review、Integration、
|
|
55
|
+
Publication、事件、WorkItem、存储和编排证据。`--since` 与 `--until` 界定时间窗。
|
|
56
|
+
各部分各自报告自己的读取错误,不为缺失数据编造值。
|
|
57
|
+
|
|
58
|
+
故障分类使用 Core 拥有的失败原因或明确标识的 Core 诊断证据。Agent 撰写的报告
|
|
59
|
+
散文不会被解析为判定或严重级别。原生 Agent 错误保留其原始负载和标准类别,供
|
|
60
|
+
Agent 结合当前 Task 上下文解读。
|
|
61
|
+
|
|
62
|
+
成本与重复劳动提示不会阻止一个合法动作、设定 Review 预算或选择恢复拓扑。
|
|
63
|
+
`task next-action` 是决策支持,不是自动执行的计划。
|
|
64
|
+
|
|
65
|
+
## 隐私与资源边界
|
|
66
|
+
|
|
67
|
+
Telemetry 和缓存是诊断材料,不是 Task 真相,也不是 transcript 备份。不要仅为
|
|
68
|
+
解释某个状态就采集或发布凭据、私有环境值或原始 Provider 历史。
|
|
69
|
+
|
|
70
|
+
从精确的只读记录开始。进程变更、取消、grant 更新和资源清理都需要相应的显式动作
|
|
71
|
+
与范围。一个笼统的诊断请求不授权真实模型、共享或生产环境的测试。
|