@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
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# 独立插件 SDK
|
|
2
|
+
|
|
3
|
+
独立目录可以通过现有 `capability` 入口贡献 Task-local 能力,无需修改 Yui
|
|
4
|
+
安装目录。当前受认证的 Leader 可以管理自己 Task 的插件,global Operator
|
|
5
|
+
仍可管理指定 Task 的插件;Worker/Reviewer 保持调用和读取权限,不获得管理
|
|
6
|
+
或自行授信权限。本 SDK 不实现 Endpoint 注册或自动升级。
|
|
7
|
+
|
|
8
|
+
Store 持久保存用户希望启用/停用的选择,以及对应的确切验证产物引用;
|
|
9
|
+
Host 是实际实例和引用生命周期的唯一权威。Controller 重启后仍能读取选择及
|
|
10
|
+
报告,但必须显式重新激活。不存在独立的可写 `active=true` 账本、自动执行
|
|
11
|
+
作者代码、市场、签名平台或恢复 worker。
|
|
12
|
+
|
|
13
|
+
## 入口与环境
|
|
14
|
+
|
|
15
|
+
所有管理操作复用原 Controller、CapabilityRegistry、InstanceHost 和身份入口。
|
|
16
|
+
在已认证 managed Leader/Operator Session 中使用以下能力;普通终端不能靠声明
|
|
17
|
+
`scope:user` 获权。开发 checkout 必须使用其绝对 `output/dev/bin/yui`,
|
|
18
|
+
并明确选择自己的隔离 Home,不能用全局安装验证。
|
|
19
|
+
|
|
20
|
+
| 能力 | 输入(Task 由 `--task` 绑定) | 可观察结果 |
|
|
21
|
+
| --- | --- | --- |
|
|
22
|
+
| `plugin.create` | `preparationId, id, kind` | 新目录、manifest、示例;不执行作者代码 |
|
|
23
|
+
| `plugin.scan` | `preparationId, directory` | 数据型扫描的 manifest、文件名、SHA-256 |
|
|
24
|
+
| `plugin.validate` | `preparationId, directory` | 不可变 validation ID、源码/产物摘要、环境和已执行检查 |
|
|
25
|
+
| `plugin.validation` | `validationId` | 报告摘要,不启动代码;本 Task 的 `task:read` 调用者可读 |
|
|
26
|
+
| `plugin.inspect` | `id` | 本 Task 的期望选择、实际选择、Host 引用及最近管理失败;不加载代码 |
|
|
27
|
+
| `plugin.list` | `{}` | 本 Task 全部显式选择的当前视图,含已停用选择 |
|
|
28
|
+
| `plugin.activate` | `validationId` | 通过准入后保存启用选择,准备并发布实例,返回当前视图 |
|
|
29
|
+
| `plugin.disable` | `id` | 保存停用选择,停止新调用,等待实际引用排空和 dispose |
|
|
30
|
+
|
|
31
|
+
`directory` 可以是环境内的相对路径或绝对规范路径,但不能是环境根、外部
|
|
32
|
+
路径或经 symlink 到达的目录。先通过 `environment.prepare/adopt`
|
|
33
|
+
明确采用一个 writable 环境。scratch 是独立目录所有权,**不是 OS 沙箱**;
|
|
34
|
+
用户目录还需要具体 Resource grant。每次新动作复核采用记录、Task
|
|
35
|
+
当前状态、目录 identity、资源意图及现行 Resource grant。
|
|
36
|
+
环境复核与主线原生执行使用同一 `resolveExecutionEnvironment`,要求现行 grant
|
|
37
|
+
包含该 preparation 的采用记录。撤权后仅签发一个新 grant 不会隐式重新采用旧环境。
|
|
38
|
+
|
|
39
|
+
SDK 的实际构建、候选和活实例引用会阻止公开 `environment.release`。
|
|
40
|
+
先停用并排空;环境释放不会删除用户目录,也不会强删非空 scratch。
|
|
41
|
+
插件停用不删除源码或验证证据,不提供自动卸载/GC。
|
|
42
|
+
|
|
43
|
+
示例(`T`、`P`、`V` 分别替换为实际 Task、adopted preparation、validation ID):
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
<checkout>/output/dev/bin/yui capability call plugin.create --task T --request-id create-1 --input '{"preparationId":"P","id":"demo","kind":"declarative"}'
|
|
47
|
+
<checkout>/output/dev/bin/yui capability call plugin.validate --task T --request-id validate-1 --input '{"preparationId":"P","directory":"demo"}'
|
|
48
|
+
<checkout>/output/dev/bin/yui capability call plugin.activate --task T --request-id activate-1 --input '{"validationId":"V"}'
|
|
49
|
+
<checkout>/output/dev/bin/yui capability call demo.echo --task T --input '{"hello":"world"}'
|
|
50
|
+
<checkout>/output/dev/bin/yui capability call plugin.inspect --task T --input '{"id":"demo"}'
|
|
51
|
+
<checkout>/output/dev/bin/yui capability call plugin.disable --task T --request-id disable-1 --input '{"id":"demo"}'
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`requestId` 对有副作用的能力必填,但 SDK 不另建通用幂等账本。验证重做生成新
|
|
55
|
+
报告,激活重做采用新 generation;发生通信错误后先查当前事实再决定是否重试。
|
|
56
|
+
|
|
57
|
+
## 原 Task 中的自扩展
|
|
58
|
+
|
|
59
|
+
Leader 先通过稳定 `capability search/describe` 读取当前目录和契约,判断复用、
|
|
60
|
+
组合或临时脚本是否足够;不强制另建插件开发 Task,也不要求注册所有脚本。
|
|
61
|
+
选择插件时,沿上述入口创建、验证、修复、激活。下一次桥调用即可发现并调用
|
|
62
|
+
新增能力,不需要热改原生工具 schema、替换自身 Endpoint 或重启 Controller。
|
|
63
|
+
|
|
64
|
+
Task-local 管理权限不等于执行信任:可执行包仍逐阶段核对下面定义的精确
|
|
65
|
+
`plugin.execute` grant,源码改变后不会继承旧摘要授权。资源、网络、全局
|
|
66
|
+
配置及核心 namespace 的边界不变;已有授权充分时不重复批准,缺少新权限则
|
|
67
|
+
报告具体缺口,不冒充 Operator 或自己签发 grant。
|
|
68
|
+
|
|
69
|
+
验证失败由 Agent 保存原错误并判断修复;不可把 unknown/部分效果自动重跑。
|
|
70
|
+
使用新增能力取得实际业务结果后,通过 `artifact.save` 保存独立内容,并在
|
|
71
|
+
Task 结果中保留引用。`artifact.read` 不依赖插件仍活跃。加载成功或保留插件
|
|
72
|
+
源码不是业务闭环完成证据。协议夹具能验证工程边界,但不能证明真实 Agent
|
|
73
|
+
自主选择、编写和修复成功;真实场景验证遵循项目的资源授权边界。
|
|
74
|
+
|
|
75
|
+
## 期望选择与实际实例
|
|
76
|
+
|
|
77
|
+
`plugin.inspect/list` 属于 `task:read`,不 acquire、初始化或恢复插件,也不消费
|
|
78
|
+
grant 或写入 Store。当前视图中:
|
|
79
|
+
|
|
80
|
+
- `desired` 是持久选择,包含 enabled、固定 validationId、内部 revision、
|
|
81
|
+
选择时间及可选 lastFailure。version/digest 从不可变验证报告派生,不重复保存。
|
|
82
|
+
- `actual` 是当前 Controller 为新调用选中的 Host 实现及其验证引用;没有选择
|
|
83
|
+
或不能 acquire 时为 null。它不是子进程健康检查,也不证明当前 grant 仍有效。
|
|
84
|
+
- `instances` 来自 Host 的未完成释放实例观察:确切 implementation、实际引用数、
|
|
85
|
+
是否接受新 acquire。停用后 actual 可以为 null,但这里仍有排空中的旧引用。
|
|
86
|
+
- `needsActivation` 只比较期望启用选择与实际选择,不是独立工作状态或自动任务。
|
|
87
|
+
|
|
88
|
+
首次查询一个未配置插件得到 `desired: null`。停用未知插件也保存明确的 disabled
|
|
89
|
+
选择,但没有 validationId;停用已配置插件保留原验证引用。所有 scope 均为 Task,
|
|
90
|
+
查询其他 Task 不泄漏本 Task 的选择。
|
|
91
|
+
|
|
92
|
+
激活先检查输入、验证记录归属、当前源码/环境、契约/依赖和权限;未通过准入的
|
|
93
|
+
请求不创建或更改意图。可执行 grant 的消费和启用选择在同一事务提交;事务失败
|
|
94
|
+
不执行作者代码、不发布实例,grant 消费也回滚。之后初始化或发布失败,则保留
|
|
95
|
+
已合法接受的期望 B、失败原因以及原实际 A,让 Agent 决定重试、更换或停用。
|
|
96
|
+
|
|
97
|
+
失败的 activate/disable 仍返回 `kind: failed`,不是伪装成功;在能够读取状态时,
|
|
98
|
+
其 `value` 附带上述当前视图。最近的管理失败按原意图 revision 记录,迟到结果
|
|
99
|
+
不能覆盖新的选择。revision 由内部事务递增,调用者不需要携带 expected token。
|
|
100
|
+
每次新的明确选择清除上次管理失败;已有 AgentRun/报告与业务 receipt 不受影响。
|
|
101
|
+
|
|
102
|
+
停用先提交 disabled,再同步移除新调用入口,等待原引用排空;清理失败不反转
|
|
103
|
+
disabled。若持久提交失败,原实例仍保持可用,不能宣称已停用。发布成功后的
|
|
104
|
+
诊断读取失败也不能卸载已经发布的新实例。错误后应查询当前事实,而不是自动重试。
|
|
105
|
+
同一插件有并发管理动作时,操作结果中的精确 provider 指该次操作的实例,
|
|
106
|
+
附带的当前视图则可能已经反映更晚的显式选择。
|
|
107
|
+
|
|
108
|
+
重启只保留选择和已有失败诊断,不从旧报告猜测过去是否启用,不自动重放操作,
|
|
109
|
+
也不伪称历史实际实例仍运行。原来期望 B 但运行 A 的情形重启后表现为
|
|
110
|
+
desired=B、actual=null;再次显式激活 B 必须重新通过现行授权和环境检查。
|
|
111
|
+
|
|
112
|
+
## 包合同
|
|
113
|
+
|
|
114
|
+
目录扫描仅解析数据,不 import 作者代码。当前包最多 256 个 UTF-8 文件、
|
|
115
|
+
合计 4 MiB;拒绝 symlink、特殊文件和二进制依赖。所有文件都进入摘要及
|
|
116
|
+
验证产物,包括依赖,因此应提供小型、自包含、非秘密的目录,而不是包含
|
|
117
|
+
凭据、用户资料或整个开发环境的树。
|
|
118
|
+
|
|
119
|
+
```json
|
|
120
|
+
{
|
|
121
|
+
"id": "demo",
|
|
122
|
+
"version": "1.0.0",
|
|
123
|
+
"apiVersion": "1",
|
|
124
|
+
"kind": "declarative",
|
|
125
|
+
"entry": "entry.json",
|
|
126
|
+
"capabilities": [{
|
|
127
|
+
"name": "demo.echo",
|
|
128
|
+
"contractVersion": "1",
|
|
129
|
+
"summary": "Return JSON input.",
|
|
130
|
+
"inputSchema": {},
|
|
131
|
+
"outputSchema": {},
|
|
132
|
+
"effect": "query",
|
|
133
|
+
"requiredPermissions": []
|
|
134
|
+
}],
|
|
135
|
+
"required": [],
|
|
136
|
+
"permissions": [],
|
|
137
|
+
"reloadMode": "manual"
|
|
138
|
+
}
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
`id` 为小写字母开头、仅小写字母/数字/连字符的单段名字。能力名使用 Registry
|
|
142
|
+
的点分名字;核心 namespace(包括 `context`)和 Provider 身份不能覆盖。
|
|
143
|
+
Provider ID 由可信根按 Task + plugin ID 产生。不同 Provider 的同名能力保留
|
|
144
|
+
原 Registry 歧义规则,不按加载顺序覆盖;调用时可明确 `--provider/--version`。
|
|
145
|
+
|
|
146
|
+
`required` 是准确的 `{name, contractVersion}` 依赖,不是版本求解器。依赖缺失、
|
|
147
|
+
不可用、歧义或成环时拒绝激活。schema 使用 Registry 现有有界方言,未知关键词
|
|
148
|
+
拒绝。每项 `requiredPermissions` 必须属于 manifest `permissions`;scope 只是
|
|
149
|
+
可见性,权限仍来自当前调用者。Task-local 插件不能声明 `plugin:manage`。
|
|
150
|
+
|
|
151
|
+
声明式 `entry.json` 必须完整且仅包含 manifest 声明的能力:
|
|
152
|
+
|
|
153
|
+
```json
|
|
154
|
+
{ "demo.echo": { "type": "echo" } }
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
支持 `echo`、`constant + value`,以及
|
|
158
|
+
`call + name + contractVersion + 可选 providerId`。`call` 将原输入与 requestId
|
|
159
|
+
交给一个明确依赖,返回其 value,保留原 operations/effect;它不是多步流程引擎。
|
|
160
|
+
声明式包不能声明 build,也不会执行任意 JavaScript。
|
|
161
|
+
|
|
162
|
+
## 可执行合同与授信
|
|
163
|
+
|
|
164
|
+
`kind: trusted-local`、`entry: entry.mjs` 的包在独立 Node 子进程中执行,不进入
|
|
165
|
+
Controller。子进程使用明确采用的环境目录为 cwd,重新构造最小环境变量,
|
|
166
|
+
不继承 Yui Session、凭据、`NODE_OPTIONS` 或 `NODE_PATH`。
|
|
167
|
+
|
|
168
|
+
运行模块通过 `SourceTextModule` 从已捕获的字节加载,只支持包内相对模块依赖,
|
|
169
|
+
不支持裸包名、`node:` 或动态 import;需要的纯 JS 依赖应先打包。此加载器
|
|
170
|
+
限定代码来源,**不是恶意代码安全沙箱**。不能据此承诺宿主文件、网络、进程或
|
|
171
|
+
秘密绝不可访问。未经具体授信的自动生成代码应使用声明式路径或另选真正受限
|
|
172
|
+
环境;当前 SDK 不提供那种环境。
|
|
173
|
+
|
|
174
|
+
作者 entry 导出:
|
|
175
|
+
|
|
176
|
+
```javascript
|
|
177
|
+
const echo = input => input;
|
|
178
|
+
export function initialize() {
|
|
179
|
+
return {
|
|
180
|
+
handlers: { "demo.echo": async (input, api) => echo(input) },
|
|
181
|
+
dispose() {}
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
export function selfTest() {
|
|
185
|
+
return echo("probe") === "probe";
|
|
186
|
+
}
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### 作者模块的运行环境
|
|
190
|
+
|
|
191
|
+
Node 子进程是宿主,不代表作者模块运行在完整的 Node 全局环境中。
|
|
192
|
+
当前模块使用独立 vm context,仅依赖 ECMAScript 内建值和下述 SDK 端口:
|
|
193
|
+
|
|
194
|
+
| 类别 | 当前可用性 |
|
|
195
|
+
| --- | --- |
|
|
196
|
+
| ECMAScript 内建值,例如 `Promise`、`JSON`、`Math`、`Date` | 可用;支持 `async/await`、`Promise.resolve()` |
|
|
197
|
+
| `console` | 可见,但不是 SDK 日志或回执端口;子进程 stdout/stderr 不向调用者转发 |
|
|
198
|
+
| `setTimeout`、`setInterval`、`queueMicrotask` | 不提供;不要使用普通 Node 定时器写异步流程 |
|
|
199
|
+
| `structuredClone`、`process`、`Buffer` | 不提供 |
|
|
200
|
+
| `fetch`、`URL`、`TextEncoder`、`AbortController`、`crypto` | 不提供 |
|
|
201
|
+
| 业务 I/O 与下游工具 | 使用 handler 的 `api.call`,服从原调用者的权限与效果上限 |
|
|
202
|
+
|
|
203
|
+
因此 `await Promise.resolve()` 可用,`await new Promise(r => setTimeout(r, 50))`
|
|
204
|
+
不可用。一个永不 settle 的 handler 会触发下面的 30 秒子进程请求超时。
|
|
205
|
+
表格描述正常作者 API,不是安全隔离声明;不能根据某个全局变量不存在推导
|
|
206
|
+
恶意 trusted-local 代码无法触碰宿主。build 脚本是另一条已授信 Node 执行路径,
|
|
207
|
+
不受这张作者模块全局表的约束。
|
|
208
|
+
|
|
209
|
+
初始化只能准备完整注册,不得发送、发布、修改业务资料或启动后台服务。
|
|
210
|
+
它得不到任何业务调用端口;初始化失败仅关闭候选子进程。trusted-local 作者
|
|
211
|
+
仍必须遵守这个合同,缺少端口不是对任意恶意代码直接宿主访问的隔离保证。
|
|
212
|
+
`selfTest()` 在验证时实际执行且必须返回 `true`,报告不把作者测试等同于安全认证。
|
|
213
|
+
|
|
214
|
+
handler 的 `api` 只包含原 `context` 的无凭据身份、`requestId` 与
|
|
215
|
+
`call({name,input,contractVersion?,providerId?,requestId?})`。没有 Store、Host、
|
|
216
|
+
Registry、鉴权器、可选 actor 或 `observe` 端口。每个嵌套调用重新检查原调用者
|
|
217
|
+
和当前执行 grant,权限不得超过父 descriptor 声明,效果不得超过父 effect。
|
|
218
|
+
对已完成的子动作,即使父输出 schema 错误、抛错或无法 JSON 序列化,也保留
|
|
219
|
+
原 operations、effect 和 receipt locator;真正的证据仍属于原 Job 等业务 owner。
|
|
220
|
+
|
|
221
|
+
可信代码应只使用这些受控端口产生业务效果。直接绕过端口的 trusted-local
|
|
222
|
+
宿主操作无法由 SDK 推导真实回执或效果范围,不在上述证据保证内。
|
|
223
|
+
默认单次子进程请求上限 30 秒;超时或异常结束返回失败并关闭自有子进程,不重试。
|
|
224
|
+
dispose 必须只释放自己的资源,不管理共享 daemon。任意作者派生进程或崩溃后的
|
|
225
|
+
宿主残留不被伪称为已回收,当前 SDK 不提供跨 Controller 进程恢复/清扫协议。
|
|
226
|
+
|
|
227
|
+
### 执行授权
|
|
228
|
+
|
|
229
|
+
Adopted 目录不授予执行作者代码。每次实际 `build`、`validate`、`activate`
|
|
230
|
+
或 `call` 尝试还需要现行 `plugin.execute` grant,同时明确限定全部五个参数:
|
|
231
|
+
|
|
232
|
+
| 参数 | 值 |
|
|
233
|
+
| --- | --- |
|
|
234
|
+
| `pluginId` | manifest id |
|
|
235
|
+
| `digest` | build/validate 使用 `plugin.scan` 的源码摘要;activate/call 使用报告的产物摘要 |
|
|
236
|
+
| `environmentRef` | `Task/preparation` |
|
|
237
|
+
| `trust` | `trusted-local` |
|
|
238
|
+
| `phase` | 明确选择的 `build,validate,activate,call` 子集 |
|
|
239
|
+
|
|
240
|
+
使用 Task scope;可附加精确环境路径的 home scope,不接受 Project/repository/
|
|
241
|
+
package scope 替代资源授信。因 trusted-local 不约束直接宿主效果,此 grant
|
|
242
|
+
必须允许 `irreversibilityCeiling: irreversible`:这是能力上限,不表示每次调用
|
|
243
|
+
实际产生不可逆效果。`none/reversible` 不得解释为无限本机执行权。
|
|
244
|
+
|
|
245
|
+
由获用户明确授权的 Operator 使用原 grant 入口,例如只允许一次验证:
|
|
246
|
+
|
|
247
|
+
```text
|
|
248
|
+
<checkout>/output/dev/bin/yui task grant issue T --action plugin.execute --param pluginId=demo --param digest=SOURCE_SHA256 --param environmentRef=T/P --param trust=trusted-local --param phase=validate --max-uses 1 --irreversibility-ceiling irreversible
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
grant 不由 SDK 自签发。次数按真实执行尝试消费,失败也不回退;一次 validate
|
|
252
|
+
包含 initialize/selfTest/dispose。build 是另一次执行。
|
|
253
|
+
`call` 是不可从持久步骤恢复的短调用,只增加 usesUsed,不追加永久 reservation;
|
|
254
|
+
其准入由当前调用的绑定闭包持有,不能导出、伪造或用于进程重启后的继续执行。
|
|
255
|
+
build/validate/activate 使用持久 reservation;已有 key 不截断或清理。
|
|
256
|
+
已消费额度的当前调用可以继续复核,但撤销/到期仍阻止后续受控动作,
|
|
257
|
+
额度耗尽则不允许新调用。长期使用不会因每次 call 再新增一条永久 key。
|
|
258
|
+
尚未提交的启用意图事务失败不算已执行尝试,其消费随事务回滚。
|
|
259
|
+
普通 disable 不撤销已在执行的原调用,撤权也不抹除意图或已发生效果。
|
|
260
|
+
|
|
261
|
+
### 构建与产物
|
|
262
|
+
|
|
263
|
+
可执行 manifest 可增加 `"build": ["build.mjs", "arg"]`。这是明确的 Node 脚本
|
|
264
|
+
及参数,不是 shell 字符串。build 脚本必须在捕获的源码包内;它在采用环境内
|
|
265
|
+
新建的自有临时副本中执行,可使用 Node API,因而同样需要 trusted-local 授信。
|
|
266
|
+
构建器不得依赖未声明的用户秘密或残留后台进程。
|
|
267
|
+
|
|
268
|
+
验证保存实际构建产物全部字节及摘要,记录源码摘要、Node 版本、环境 identity、
|
|
269
|
+
实际构建 cwd/argv 与执行检查。构建不能改变 manifest/权限;无 build 时直接
|
|
270
|
+
执行首次捕获的字节,不二次读取后再执行。构建不覆盖作者源码。验证结束复核
|
|
271
|
+
源目录,已变化则拒绝保存成功报告。
|
|
272
|
+
|
|
273
|
+
激活重新核对源目录摘要、环境及当前授权,然后只从报告中的产物字节初始化,
|
|
274
|
+
不会重建或改用同版本的另一个目录。构建后的验证授权针对已明确授信源码所产生
|
|
275
|
+
的产物,正式激活/调用则另用该实际产物摘要授权。
|
|
276
|
+
|
|
277
|
+
发布前再次检查完整贡献、依赖和权限。失败不改变现有目录;竞争 activate/disable
|
|
278
|
+
会使迟到候选拒绝发布。成功发布后旧 generation 只服务已有引用,排空才 dispose;
|
|
279
|
+
清理失败保留诊断 Artifact,不回滚新 Provider 或伪称当前实例仍未发布。
|
|
280
|
+
|
|
281
|
+
## 存储与其他入口
|
|
282
|
+
|
|
283
|
+
验证产物和启用意图属于唯一 Home 存储合同,持久结构变更走显式
|
|
284
|
+
upgrade/update 与备份机制。读取报告不会推测或恢复实例,采用新源码不等于
|
|
285
|
+
授权升级共享 Home、重启 Controller 或执行插件。
|
|
286
|
+
|
|
287
|
+
同一个 Registry 将能力投影为命令和受控查询面板,不复制 SDK Host;
|
|
288
|
+
Web 查询身份不获得 `plugin:manage`。原生 Session 与插件共享环境 owner,
|
|
289
|
+
释放前同时检查原生执行引用与插件引用。插件不提供 Project/global scope
|
|
290
|
+
提升或原生 Endpoint 注册。
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Provider runtime
|
|
2
|
+
|
|
3
|
+
Native conversations belong to the user and Provider. Yui adds its Role Skill
|
|
4
|
+
and Session Manifest pointers, delivers scoped input through structured native
|
|
5
|
+
protocols, and records exact execution evidence. It does not mirror the complete
|
|
6
|
+
transcript or require every user interaction to pass through Yui.
|
|
7
|
+
|
|
8
|
+
## Component and connection
|
|
9
|
+
|
|
10
|
+
| Execution component | Connection plan | Managed transport |
|
|
11
|
+
| --- | --- | --- |
|
|
12
|
+
| `codex-cli` | `codex` | App Server WebSocket through a byte-forwarding proxy |
|
|
13
|
+
| `claude-code-cli` | `claude` | Persistent stream-json process |
|
|
14
|
+
| `claude-agent-sdk` | `acp` | ACP bridge over stdio |
|
|
15
|
+
| `unknown-acp-agent` | `acp` | ACP over stdio, with product identity unconfirmed |
|
|
16
|
+
|
|
17
|
+
An executable name does not prove its product identity. The component selects
|
|
18
|
+
one connection plan; the protocol does not infer which product is running.
|
|
19
|
+
|
|
20
|
+
## Host and Endpoint
|
|
21
|
+
|
|
22
|
+
Controller owns durable input selection and observation processing. AgentHost
|
|
23
|
+
owns its disposable connection and serializes requests. AgentEndpoint exposes
|
|
24
|
+
open/resume, submit/steer, inspect, events, cancel, detach and exit observation.
|
|
25
|
+
Driver maps protocol evidence into the common observation/error vocabulary.
|
|
26
|
+
|
|
27
|
+
Endpoint submission distinguishes accepted, pending, not-submitted and unknown.
|
|
28
|
+
Acceptance requires Provider evidence correlated to the exact owned input:
|
|
29
|
+
a native receipt, or a response on an exclusively owned serialized stream.
|
|
30
|
+
Neither bytes written, a PID nor a tmux pane proves acceptance.
|
|
31
|
+
|
|
32
|
+
Session, attachment and AgentRun identities are distinct. A Session can span
|
|
33
|
+
multiple explicit Runs and ordinary native chat. Goal is Session-level Provider
|
|
34
|
+
evidence, not a Yui Task completion state.
|
|
35
|
+
|
|
36
|
+
## Codex and Claude Code
|
|
37
|
+
|
|
38
|
+
Managed Codex connects to the shared native daemon. Host owns its proxy and
|
|
39
|
+
WebSocket, not that daemon or the native thread. Direct native clients may use
|
|
40
|
+
the same conversation; Yui waits for native availability and correlates its own
|
|
41
|
+
input rather than treating another client's terminal as its result.
|
|
42
|
+
|
|
43
|
+
Global Codex Roles retain the native TUI. The thin interactive Host observes
|
|
44
|
+
the TUI's exact thread start/resume identity and applies the reserved workspace,
|
|
45
|
+
Role settings, Manifest pointer and scoped CLI environment to that same native
|
|
46
|
+
startup request. Remote TUI flags alone are not authority for the server's
|
|
47
|
+
working directory; no second Thread or daemon-wide configuration is created.
|
|
48
|
+
A live pane alone does not establish
|
|
49
|
+
an authenticated Session; a dead pane is retained evidence until explicit action.
|
|
50
|
+
|
|
51
|
+
Managed Claude Code uses a persistent stream-json process, exact user-message
|
|
52
|
+
correlation and one local input in flight. Its first main assistant response
|
|
53
|
+
confirms acceptance before the final result; init, user echo and child responses
|
|
54
|
+
do not. Message UUIDs suppress duplicate observations, not identify native
|
|
55
|
+
Turns. Yui-owned generic Role context uses private files; Project Skills remain
|
|
56
|
+
native Project material discovered by the Agent.
|
|
57
|
+
|
|
58
|
+
Global Claude Code keeps its interactive interface and native authentication
|
|
59
|
+
selection. Yui forwards the configured environment and settings paths without
|
|
60
|
+
injecting an authentication helper or writing onboarding/key-approval records.
|
|
61
|
+
Native confirmation and policy remain enforced. See
|
|
62
|
+
[native authentication](roles-and-configuration.md#native-authentication).
|
|
63
|
+
|
|
64
|
+
Main-session tool start/result and model activity feed the same exact-input
|
|
65
|
+
observations for Runs and runless notifications. Tool failure ends that operation,
|
|
66
|
+
not the whole Agent execution. Missing activity evidence remains unobserved.
|
|
67
|
+
An owned Claude process exit without a result fails its current input; deliberate
|
|
68
|
+
cancellation records cancelled instead. Neither invents a native Turn ID.
|
|
69
|
+
|
|
70
|
+
Native observations are durably queued before asking the Controller to apply
|
|
71
|
+
them. Controller absence, timeout or transport loss leaves those exact facts
|
|
72
|
+
for normal inbox replay; it does not turn a healthy native result into a failed
|
|
73
|
+
Host. The eager Controller application hint has a short deadline, so an outage
|
|
74
|
+
does not accumulate a long synchronous wait for every native event.
|
|
75
|
+
Persistence or actual application-validation failures still surface as
|
|
76
|
+
errors. Terminal input evidence remains terminal as time passes, independently
|
|
77
|
+
of Task completion and later Runs.
|
|
78
|
+
|
|
79
|
+
Managed input uses structured protocols, not terminal keystrokes or prompt
|
|
80
|
+
glyph parsing. Terminal attachment is a presentation channel.
|
|
81
|
+
|
|
82
|
+
## ACP
|
|
83
|
+
|
|
84
|
+
ACP negotiates initialization and Session capabilities, opens or loads an exact
|
|
85
|
+
Session, sends prompts, observes updates and maps terminal/error responses.
|
|
86
|
+
Authentication requirements and unsupported operations remain explicit.
|
|
87
|
+
The codec must not implement another Task/Run Store or invent native Turn IDs.
|
|
88
|
+
|
|
89
|
+
Model, effort and permission requests are compiled against the peer's offered
|
|
90
|
+
configuration axes and checked after application. Setters can change other axes;
|
|
91
|
+
final observed values must still satisfy the requested launch before prompt.
|
|
92
|
+
An acknowledgement without a reported value is weaker than an observed match.
|
|
93
|
+
Unknown ACP products do not inherit a guessed bypass mode from another product.
|
|
94
|
+
|
|
95
|
+
Yui distinguishes three configuration layers:
|
|
96
|
+
|
|
97
|
+
1. desired Role/Agent binding;
|
|
98
|
+
2. frozen effective launch request;
|
|
99
|
+
3. live Agent-reported configuration, or `unknown` / `unsupported`.
|
|
100
|
+
|
|
101
|
+
Within observed configuration, an axis can remain `unobserved`. Inspection reads
|
|
102
|
+
current reports without configuring or prompting the Agent. Reported model names
|
|
103
|
+
are Provider evidence, not independent proof of backend model identity.
|
|
104
|
+
|
|
105
|
+
## Environments and replacement
|
|
106
|
+
|
|
107
|
+
Adopted execution environments retain their directory identity, access,
|
|
108
|
+
preparation and grants. Launch, resume and Yui-controlled submission recheck the
|
|
109
|
+
same boundary. Desired environment changes do not move a running Session or
|
|
110
|
+
silently fall back to managed cwd.
|
|
111
|
+
|
|
112
|
+
Read-only adoption requires actual adapter enforcement. Empty environments
|
|
113
|
+
cannot supply a native CLI cwd; scratch or an explicitly adopted directory can.
|
|
114
|
+
Trusted-local environments are not a general OS sandbox.
|
|
115
|
+
|
|
116
|
+
A Session pins the Endpoint implementation actually loaded by its Host.
|
|
117
|
+
New Sessions may select another implementation; existing references drain on
|
|
118
|
+
their own boundary. A drain deadline bounds waiting, not a guarantee that all
|
|
119
|
+
native descendants exit. Cleanup reports unresolved ownership honestly.
|
|
120
|
+
|
|
121
|
+
Stopping Yui's attachment does not cancel the Task, erase the native thread or
|
|
122
|
+
prove shared execution stopped. Unknown native effects must be resolved before
|
|
123
|
+
conflicting resource release. See [Session/Run](managed-turn-and-session-runtime.md)
|
|
124
|
+
and [Drivers](agent-runtime-drivers.md).
|
|
125
|
+
|
|
126
|
+
Task Session termination first cancels its exact unsettled input and requires
|
|
127
|
+
matching terminal evidence before signalling the Host or releasing occupancy.
|
|
128
|
+
Codex uses native interruption; Claude stops the owned execution process.
|
|
129
|
+
An interrupt acknowledgement alone is insufficient. If terminal evidence is
|
|
130
|
+
unavailable, cleanup is visibly blocked and retains the native input identity;
|
|
131
|
+
it does not kill the shared daemon or label unknown execution as stopped.
|
|
132
|
+
|
|
133
|
+
Dedicated Claude execution uses a small Linux child subreaper. If the CLI dies,
|
|
134
|
+
the kernel reparents its orphaned tools to that owner, including tools that
|
|
135
|
+
created another process session. The owner signals only its actual children,
|
|
136
|
+
reaps them, and exits only after none remain. Thus a killed CLI cannot leave a
|
|
137
|
+
foreground Bash tool writing while Yui reports its owned process ended.
|
|
138
|
+
Failure to drain remains a live ownership dependency, not false quiescence.
|
|
139
|
+
This is OS process custody, not a Task workflow or a claim about unrelated
|
|
140
|
+
external services.
|
|
141
|
+
|
|
142
|
+
The dedicated process's PID/start identity is retained as engineering control
|
|
143
|
+
data independently of AgentHost. Recovery never needs the old Host's in-memory
|
|
144
|
+
connection. For Codex, a separate metadata/control client can inspect and stop
|
|
145
|
+
the recorded native execution without submitting another prompt; unknown
|
|
146
|
+
acceptance can be abandoned after actual native quiescence without inventing a
|
|
147
|
+
native Turn ID or successful Run result.
|
|
148
|
+
Codex connection location and the account Home reported by its native handshake
|
|
149
|
+
are also retained without credentials. Recovery can use current executable code,
|
|
150
|
+
but verifies the actual native account before treating a missing Thread as
|
|
151
|
+
absence. An unproven connection must not turn “not found” into a stop receipt.
|
|
152
|
+
Control uses native runtime metadata and, when a receipt was lost, one
|
|
153
|
+
metadata-only Turn page rather than loading the entire conversation. Explicit
|
|
154
|
+
Session stop checks native Goals and background terminals even when Yui's cached
|
|
155
|
+
input is already terminal. It never starts another model Turn to recover.
|
|
156
|
+
|
|
157
|
+
## Verification boundary
|
|
158
|
+
|
|
159
|
+
Protocol fixtures can establish framing, configuration, correlation and scoped
|
|
160
|
+
persistence without calling a model. They do not prove a real peer's tool
|
|
161
|
+
permissions, cancellation, concurrency or long-running behavior. Real-peer
|
|
162
|
+
validation must name the component, connection, configuration and effects tested;
|
|
163
|
+
it does not imply all components support equivalent behavior.
|