@zq-silk/yui 0.15.11 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/ARCHITECTURE.md +11 -6
  2. package/ARCHITECTURE.zh-CN.md +8 -4
  3. package/README.md +13 -5
  4. package/dist/agentRun/agentRun.js +3 -0
  5. package/dist/artifacts/artifactCommitLock.js +16 -55
  6. package/dist/artifacts/taskArtifactRepository.js +3 -3
  7. package/dist/cli/agentConfigurationPicker.js +1 -1
  8. package/dist/cli/commandCatalog.js +92 -48
  9. package/dist/cli/completion.js +18 -18
  10. package/dist/cli/completionWizard.js +1 -1
  11. package/dist/cli/dynamicCompletion.js +1 -1
  12. package/dist/cli/interactionPolicy.js +11 -3
  13. package/dist/cli/invocationAuthority.js +64 -0
  14. package/dist/cli/managedDiagnostics.js +2 -2
  15. package/dist/cli/parseRepeatable.js +35 -0
  16. package/dist/cli/updatePorts.js +26 -5
  17. package/dist/cli.js +1303 -1235
  18. package/dist/commands/agentCommands.js +4 -4
  19. package/dist/commands/capabilityCommands.js +1 -1
  20. package/dist/commands/configCommands.js +6 -57
  21. package/dist/commands/configOverview.js +2 -2
  22. package/dist/commands/durableJobCommands.js +12 -6
  23. package/dist/commands/executionAuditCommands.js +10 -0
  24. package/dist/commands/globalRoleCommands.js +78 -29
  25. package/dist/commands/grantCommands.js +0 -3
  26. package/dist/commands/jobCommands.js +1 -4
  27. package/dist/commands/operatorCommands.js +3 -3
  28. package/dist/commands/projectCommands.js +45 -25
  29. package/dist/commands/resourcesCommands.js +10 -40
  30. package/dist/commands/roleConfiguration.js +2 -6
  31. package/dist/commands/taskActivationCommands.js +4 -8
  32. package/dist/commands/taskAgentCapabilities.js +9 -0
  33. package/dist/commands/taskCommandSupport.js +155 -0
  34. package/dist/commands/taskCommandTypes.js +1 -0
  35. package/dist/commands/taskCommands.js +355 -732
  36. package/dist/commands/taskCompletionGate.js +1 -1
  37. package/dist/commands/taskExecutionCommands.js +1 -1
  38. package/dist/commands/taskFactCommands.js +325 -0
  39. package/dist/commands/taskInputCommands.js +12 -42
  40. package/dist/commands/taskIntegrationCommands.js +20 -58
  41. package/dist/commands/taskNextActionCommand.js +7 -6
  42. package/dist/commands/taskPublicationAdoptCommand.js +127 -0
  43. package/dist/commands/taskPublicationCommands.js +12 -3
  44. package/dist/commands/taskPublicationVerifyCommand.js +24 -40
  45. package/dist/commands/taskRemoteDeliveryCommand.js +5 -86
  46. package/dist/commands/taskUpstreamCommands.js +19 -8
  47. package/dist/commands/workflowCommands.js +6 -1
  48. package/dist/completion/completionInstaller.js +26 -26
  49. package/dist/completion/completionState.js +26 -26
  50. package/dist/completion/fileCompletionManager.js +6 -11
  51. package/dist/config/configCatalog.js +0 -2
  52. package/dist/config/timeZone.js +14 -0
  53. package/dist/config/yuiConfig.js +0 -29
  54. package/dist/context/runContextPack.js +5 -3
  55. package/dist/context/taskCatalog.js +185 -0
  56. package/dist/context/taskContext.js +152 -151
  57. package/dist/context/wakeRunReferences.js +11 -0
  58. package/dist/controller/agentCapabilities.js +58 -0
  59. package/dist/controller/agentRuntimeObserver.js +6 -11
  60. package/dist/controller/clientRuntime.js +22 -14
  61. package/dist/controller/controller.js +20 -24
  62. package/dist/controller/fileSchedulerStoreAdapter.js +191 -225
  63. package/dist/controller/globalInputDelivery.js +13 -0
  64. package/dist/controller/jobClient.js +4 -4
  65. package/dist/controller/jobControl.js +60 -25
  66. package/dist/controller/jobSupervisor.js +4 -4
  67. package/dist/controller/providerRetryAdmission.js +100 -0
  68. package/dist/controller/providerRetryDelivery.js +218 -0
  69. package/dist/controller/runtime.js +85 -43
  70. package/dist/controller/runtimeEventProcessor.js +0 -5
  71. package/dist/controller/sessionOwnerReconciliation.js +5 -0
  72. package/dist/controller/taskAgentError.js +35 -0
  73. package/dist/coordination/workMailboxQueue.js +2 -24
  74. package/dist/core/controllerClient.js +2 -2
  75. package/dist/core/fileLockOwner.js +74 -0
  76. package/dist/decision/decision.js +17 -0
  77. package/dist/doctor/doctor.js +18 -9
  78. package/dist/event/taskEvent.js +12 -0
  79. package/dist/execution/workItemExecutionProjection.js +2 -2
  80. package/dist/executor/agentCapabilityConfig.js +43 -0
  81. package/dist/executor/agentConfigurationCatalog.js +49 -11
  82. package/dist/executor/agentExecutor.js +5 -8
  83. package/dist/executor/fileRoleLaunchPlanner.js +11 -53
  84. package/dist/executor/taskAgentCapabilities.js +64 -0
  85. package/dist/integration/deliveryObligation.js +1 -69
  86. package/dist/integration/gitIntegrationService.js +79 -90
  87. package/dist/integration/integrationAttempt.js +3 -14
  88. package/dist/integration/integrationSourceApplication.js +4 -12
  89. package/dist/integration/manifestTags.js +2 -2
  90. package/dist/job/durableJob.js +4 -25
  91. package/dist/job/jobAssignmentScope.js +22 -0
  92. package/dist/job/jobOperation.js +16 -0
  93. package/dist/job/jobRunner.js +2 -1
  94. package/dist/job/stepDirectory.js +15 -0
  95. package/dist/kernel/builtinCapabilities.js +15 -11
  96. package/dist/kernel/kernelPorts.js +1 -17
  97. package/dist/lifecycle/exactRunTerminalization.js +5 -10
  98. package/dist/message/globalProviderRetry.js +15 -0
  99. package/dist/message/inputControlResolution.js +3 -4
  100. package/dist/message/message.js +17 -20
  101. package/dist/message/messageContinuation.js +1 -1
  102. package/dist/milestone/milestone.js +11 -0
  103. package/dist/observability/executionAudit.js +19 -0
  104. package/dist/observability/orchestrationMetrics.js +24 -1
  105. package/dist/observability/runtimeIdentity.js +1 -17
  106. package/dist/output/agentConfigurationPresentation.js +2 -0
  107. package/dist/output/timePresentation.js +1 -14
  108. package/dist/plugins/pluginService.js +12 -4
  109. package/dist/release/releaseWorkflowPorts.js +45 -96
  110. package/dist/release/runtimeRelease.js +9 -15
  111. package/dist/repository/gitWorkspace.js +371 -105
  112. package/dist/repository/projectMaintenanceLock.js +98 -82
  113. package/dist/repository/taskBaseFreshness.js +1 -1
  114. package/dist/repository/taskWorkspaceCoordinator.js +82 -144
  115. package/dist/repository/taskWorkspacePreparer.js +113 -47
  116. package/dist/repository/workspaceCleanupInspection.js +187 -0
  117. package/dist/resources/autoResourceGc.js +4 -77
  118. package/dist/resources/liveReferences.js +7 -54
  119. package/dist/resources/resourceDiscovery.js +5 -118
  120. package/dist/resources/resourceGc.js +233 -181
  121. package/dist/resources/resourceRegistrar.js +5 -4
  122. package/dist/resources/resourceRegistry.js +3 -37
  123. package/dist/resources/resourceRegistryStore.js +13 -36
  124. package/dist/resources/sqliteResourceRegistry.js +43 -26
  125. package/dist/review/deltaRecheck.js +1 -1
  126. package/dist/review/reviewAcceptance.js +1 -1
  127. package/dist/review/reviewDecision.js +1 -1
  128. package/dist/review/reviewRound.js +8 -7
  129. package/dist/review/taskFinalReviewContractResolution.js +1 -1
  130. package/dist/runtime/acpProtocol.js +4 -51
  131. package/dist/runtime/acpSession.js +10 -75
  132. package/dist/runtime/acpSessionConfiguration.js +1 -8
  133. package/dist/runtime/agentEndpoint.js +3 -2
  134. package/dist/runtime/agentError.js +5 -3
  135. package/dist/runtime/agentFailureContext.js +43 -0
  136. package/dist/runtime/agentHost.js +42 -25
  137. package/dist/runtime/builtinAgentErrorMappers.js +91 -0
  138. package/dist/runtime/codexAppServerRuntime.js +34 -3
  139. package/dist/runtime/codexInteractiveHost.js +2 -2
  140. package/dist/runtime/index.js +0 -1
  141. package/dist/runtime/managedCaller.js +21 -1
  142. package/dist/runtime/providerControl.js +5 -1
  143. package/dist/runtime/providerErrors.js +38 -0
  144. package/dist/runtime/providerRetry.js +198 -0
  145. package/dist/runtime/providerRuntimeIdentity.js +28 -2
  146. package/dist/runtime/runtimeObservation.js +0 -5
  147. package/dist/runtime/runtimeSessionCandidate.js +2 -3
  148. package/dist/runtime/sessionOwnerIdentity.js +1 -1
  149. package/dist/runtime/sessionTokenMetrics.js +15 -5
  150. package/dist/runtime/structuredProviderHost.js +10 -43
  151. package/dist/runtime/taskUsageMetrics.js +275 -0
  152. package/dist/runtime/tmuxAdapters.js +6 -8
  153. package/dist/scheduler/activeRoleRunDelivery.js +19 -7
  154. package/dist/scheduler/leaderWakeupProcessor.js +24 -6
  155. package/dist/scheduler/operatorEvent.js +12 -20
  156. package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
  157. package/dist/scheduler/ports.js +5 -8
  158. package/dist/scheduler/roleRunLiveness.js +4 -4
  159. package/dist/scheduler/roleRunStall.js +16 -23
  160. package/dist/scheduler/taskExecutionProjection.js +49 -36
  161. package/dist/scheduler/taskObservabilityProjection.js +6 -45
  162. package/dist/scheduler/taskWake.js +5 -10
  163. package/dist/scheduler/wakeReason.js +2 -0
  164. package/dist/scheduler/wakeupQueue.js +2 -4
  165. package/dist/setup/setupCommand.js +1 -1
  166. package/dist/storage/contextRecords.js +106 -0
  167. package/dist/storage/currentTaskStore.js +1 -1
  168. package/dist/storage/homeLayout.js +13 -17
  169. package/dist/storage/migrations/agentFailureContext.js +22 -0
  170. package/dist/storage/migrations/currentInputContract.js +86 -0
  171. package/dist/storage/migrations/currentRuntimeContract.js +228 -0
  172. package/dist/storage/migrations/historicalVerificationPlan.js +35 -0
  173. package/dist/storage/migrations/integrationContinuation.js +5 -4
  174. package/dist/storage/migrations/narrowAgentFailureContext.js +65 -0
  175. package/dist/storage/migrations/notificationOnlyWakes.js +74 -0
  176. package/dist/storage/migrations/verificationPlanV1.js +162 -0
  177. package/dist/storage/migrations/verificationPolicy.js +74 -0
  178. package/dist/storage/migrations/workItemHistory.js +46 -0
  179. package/dist/storage/persistenceWorker.js +12 -4
  180. package/dist/storage/recordValidation.js +87 -0
  181. package/dist/storage/sqliteSchema.js +173 -1
  182. package/dist/storage/sqliteStore.js +172 -161
  183. package/dist/storage/storageSchema.js +2 -14
  184. package/dist/storage/storageVersions.js +1 -1
  185. package/dist/storage/storeRpc.js +16 -7
  186. package/dist/storage/taskCatalog.js +123 -0
  187. package/dist/storage/taskStore.js +5 -7
  188. package/dist/storage/upgrade/upgradeOrchestrator.js +25 -37
  189. package/dist/task/archiveDiagnostics.js +1 -0
  190. package/dist/task/archivePreflight.js +124 -0
  191. package/dist/task/completionReadiness.js +5 -24
  192. package/dist/task/draftPlan.js +0 -53
  193. package/dist/task/nextAction.js +7 -13
  194. package/dist/task/publicationAdoption.js +56 -0
  195. package/dist/task/publicationReference.js +10 -0
  196. package/dist/task/remoteDelivery.js +31 -16
  197. package/dist/task/remoteDeliveryService.js +89 -0
  198. package/dist/task/taskActivation.js +2 -25
  199. package/dist/task/taskActivationService.js +0 -2
  200. package/dist/task/taskRecordReference.js +0 -1
  201. package/dist/task/taskSubmission.js +3 -14
  202. package/dist/telemetry/sqliteTelemetryBatch.js +29 -0
  203. package/dist/telemetry/sqliteTelemetryStore.js +49 -49
  204. package/dist/telemetry/telemetryWiring.js +4 -3
  205. package/dist/tmux/tmuxManager.js +29 -20
  206. package/dist/verification/gateArtifact.js +15 -24
  207. package/dist/verification/gateArtifactStore.js +14 -7
  208. package/dist/verification/verificationGateService.js +29 -88
  209. package/dist/verification/verificationPlan.js +27 -72
  210. package/dist/web/assets/client/app.js +92 -17
  211. package/dist/web/assets/client/components.js +55 -13
  212. package/dist/web/assets/client/i18n.js +72 -4
  213. package/dist/web/assets/client/taskSurface.js +6 -5
  214. package/dist/web/assets/client/view.js +35 -7
  215. package/dist/web/assets/shell.js +6 -0
  216. package/dist/web/assets/styles/layout.js +7 -0
  217. package/dist/web/webServer.js +12 -3
  218. package/dist/web/webSnapshot.js +14 -85
  219. package/dist/web/webTaskSurface.js +17 -46
  220. package/dist/workItem/workItem.js +1 -12
  221. package/dist/workspace/cleanupInspection.js +63 -0
  222. package/dist/workspace/workItemChangeSetManager.js +110 -50
  223. package/docs/agent-result-consumption.md +4 -0
  224. package/docs/agent-result-consumption.zh-CN.md +3 -0
  225. package/docs/agent-runtime-drivers.md +7 -0
  226. package/docs/agent-runtime-drivers.zh-CN.md +5 -0
  227. package/docs/architecture/README.md +2 -0
  228. package/docs/architecture/README.zh-CN.md +3 -1
  229. package/docs/architecture/capabilities-and-resources.md +42 -5
  230. package/docs/architecture/capabilities-and-resources.zh-CN.md +33 -3
  231. package/docs/managed-turn-and-session-runtime.md +121 -1
  232. package/docs/managed-turn-and-session-runtime.zh-CN.md +96 -2
  233. package/docs/observability/README.md +62 -0
  234. package/docs/observability/README.zh-CN.md +47 -0
  235. package/docs/plugin-sdk.md +4 -2
  236. package/docs/project-refresh.md +77 -0
  237. package/docs/project-refresh.zh-CN.md +59 -0
  238. package/docs/provider-retry.md +70 -0
  239. package/docs/provider-runtime.md +3 -1
  240. package/docs/provider-runtime.zh-CN.md +4 -2
  241. package/docs/release-workflow.md +190 -7
  242. package/docs/release-workflow.zh-CN.md +139 -5
  243. package/docs/roles-and-configuration.md +29 -0
  244. package/docs/roles-and-configuration.zh-CN.md +21 -0
  245. package/docs/sqlite-control-plane-design.md +16 -3
  246. package/docs/sqlite-control-plane-design.zh-CN.md +13 -2
  247. package/docs/task-dag-semantics.md +3 -3
  248. package/docs/task-dag-semantics.zh-CN.md +2 -2
  249. package/docs/task-delivery.md +223 -17
  250. package/docs/task-delivery.zh-CN.md +171 -14
  251. package/docs/task-discovery.md +101 -0
  252. package/docs/task-discovery.zh-CN.md +85 -0
  253. package/docs/testing/verification-levels.md +161 -9
  254. package/docs/testing/verification-levels.zh-CN.md +116 -9
  255. package/i18n/README.zh-CN.md +13 -7
  256. package/package.json +1 -1
  257. package/skills/yui-leader/SKILL.md +5 -0
  258. package/skills/yui-leader/references/execution.md +3 -2
  259. package/skills/yui-leader/references/integration.md +9 -5
  260. package/skills/yui-leader/references/planning.md +9 -3
  261. package/skills/yui-operator/SKILL.md +24 -8
  262. package/skills/yui-reviewer/SKILL.md +4 -0
  263. package/skills/yui-runtime/SKILL.md +17 -2
  264. package/skills/yui-runtime/references/publication.md +26 -4
  265. package/skills/yui-runtime/references/recovery.md +71 -0
  266. package/dist/agent/agentRegistry.js +0 -10
  267. package/dist/agentRun/runIdentity.js +0 -22
  268. package/dist/commands/deliveryGuardPreflight.js +0 -30
  269. package/dist/commands/taskIntegrationQueueCommands.js +0 -226
  270. package/dist/commands/taskOverviewCommand.js +0 -376
  271. package/dist/completion/completionWizard.js +0 -125
  272. package/dist/context/dispatchContext.js +0 -110
  273. package/dist/context/wakeNotification.js +0 -144
  274. package/dist/integration/integrationCheckEvidenceReuse.js +0 -53
  275. package/dist/integration/integrationQueueEntry.js +0 -191
  276. package/dist/integration/integrationQueueService.js +0 -810
  277. package/dist/release/fakeReleasePorts.js +0 -55
  278. package/dist/runtime/sessionOwnerRegistry.js +0 -137
  279. package/dist/task/deliveryGuard.js +0 -226
  280. /package/dist/{commands/taskActor.js → task/taskAuthority.js} +0 -0
@@ -0,0 +1,85 @@
1
+ <p align="right"><a href="./task-discovery.md">English</a> | <strong>简体中文</strong></p>
2
+
3
+ # 有界任务发现
4
+
5
+ Agent 使用 `yui task list --json` 发现候选任务,再读取目标
6
+ Task Context 和原始 Message。目录是当前事实的只读视图,不是摘要数据库、
7
+ Context 快照、消息确认、执行判断或验收结论。
8
+
9
+ 目录是唯一列表契约,不再提供 `--view` 选择或 `--verbose` 全历史列表。
10
+ 交互选择器保持完整的 `{id,title,status}` 数组,只读取这些窄字段。
11
+ Web 通过 `GET /api/dashboard` 使用同一查询;单个 Task 的详情接口继续保留
12
+ 执行、观测、用量和远端交付字段。目录查询本身不改变持久记录。
13
+
14
+ ## 查询和分页合同
15
+
16
+ ```sh
17
+ yui task list --project project-1 --status active --limit 20 --json
18
+ yui task list --attention openInputs --json
19
+ yui task list --search "候选标题" --json
20
+ yui task context task-1 --json
21
+ yui task context inspect task-1 --store task --ref task-1 --digest <digest> --json
22
+ yui task message show task-1/message-1 --json
23
+ ```
24
+
25
+ `--project` 接受精确 Project ID。搜索按 SQLite 子串匹配 ID、标题、标签和
26
+ Project 名称:ASCII 不区分大小写,非 ASCII 字符按字面比较。缺省范围排除
27
+ 归档 Task;`--all` 或 `--status archived` 纳入归档。计数明确属于该范围,
28
+ 不泄漏不可见的全局总数。状态、搜索、Project 和关注分类只筛选 `total`
29
+ 及任务行,不缩小范围内的关注汇总。
30
+
31
+ 缺省每页 20 项,最多 100 项。成功 JSON 响应连同 CLI envelope 不超过
32
+ 32 KiB;摘要最多 512 UTF-8 字节,标题最多 256 字节,裁剪明确标记。
33
+ ID、digest 和 cursor 不裁剪。必要元数据过长时返回有界错误,不成功返回
34
+ 无法前进的空页。Brief 缺失会明确显示。
35
+
36
+ 顺序是 `(createdAt,id)` 升序,ID 按 SQLite binary 排序。后续请求带
37
+ `--cursor <nextCursor>`,并保留全部筛选参数和 limit。null cursor 表示结束;
38
+ 字节预算可能使实际条数少于 limit。首页固定最大匹配创建键,较新创建键
39
+ 留到刷新后读取。各页仍读取当前状态:生命周期和筛选成员变化可能影响枚举;
40
+ 这不是冻结快照,不会因为无关运行时事件而作废游标。
41
+
42
+ 每个任务和关注样本携带真实 Task Context ref:
43
+ `taskId,store,refId,revision,digest`。digest 覆盖原 Task,不是裁剪预览或
44
+ Brief。当前 Brief 通过 Task Context 读取;Context inspect 可校验 digest
45
+ 后展开原文。digest 变化会拒绝旧引用;引用不赋予权限,也不表示需求已读。
46
+
47
+ ## 不扫描全历史也不遗漏关注入口
48
+
49
+ 每页(包括筛选后无匹配的空页)都返回同一授权目录范围的当前关注事实。
50
+ 每类包括记录/信号数量、涉及 Task 数量、最多四个精确 Task ref、
51
+ 省略的 Task ref 数量,以及枚举全部相关 Task 的筛选入口:
52
+
53
+ 启动该关注查询时清除先前的状态、搜索、Project 筛选,并保留其 `all` 标记,
54
+ 从而保持声明的目录范围,包括此前明确纳入的归档任务。
55
+
56
+ | 分类 | 当前存储事实 |
57
+ | --- | --- |
58
+ | `openInputs` | 未解决 InputRequest |
59
+ | `pendingOperations` | queued/running durable Job |
60
+ | `unknownOperations` | unknown-needs-attention Job |
61
+ | `executionSignals` | active/draft Task 中的活跃 Run、open WorkItem 或仍含当前复制执行组的 accepted WorkItem、未解决或失败 Integration、pending/running/failed Review、Leader failure、pending/processing Leader mailbox |
62
+
63
+ `executionSignals` 是保守的发现入口,**不是**详情的执行状态分类器。
64
+ 健康的活跃工作也会被包括,从而不会因为分页而藏住运行身份、停滞、
65
+ 工作失败或恢复相关的关注入口,也不必先扫描所有 Task 历史 Event。
66
+ 这些计数不是失败计数;请打开任务读取精确执行状态和来源记录。
67
+ 不解析报告正文推导状态。Web 明确标示这些事实并提供分类导航。
68
+ 已选详情不因分页、筛选或刷新而丢失;只有详情读取可以确认目标不存在。
69
+
70
+ Task Leader Session 只能发现自己的 Task。Assignment-scoped Worker 和
71
+ Reviewer 使用既有授权 Run Context,目录会在计数前拒绝其全 Task 发现请求。
72
+ 非 Operator 的 Global Session 和不完整的受管身份也会被拒绝。
73
+ 历史 Leader 的诊断读取保持原 Task 范围。游标绑定范围及参数,不是凭证。
74
+ 读取不会消费 Message、确认 Job、唤醒 Role 或查询外部 provider。
75
+
76
+ ## 成本边界
77
+
78
+ SQLite 在现有目录及状态索引上聚合窄事实,再选取当前页。
79
+ 不会在 JavaScript 中解码全部 Task 正文、Run、Message、Event,不会先
80
+ 构造所有重型 Overview 再删字段,也不逐 Task 构造 Context。
81
+ 仅当前页和有界关注样本会解码原 Task,并计算精确 ref。
82
+
83
+ 输出和物化行有界;数据库工作量仍随授权 Task 和相关索引行增加,
84
+ 搜索可能在 SQLite 内检查 Task/Project JSON。精确引用仍需承担选中
85
+ Task 原正文大小的成本。这些是本机成本边界,不是恒定时间或模型效果承诺。
@@ -25,20 +25,45 @@ and incident-specific scripts temporary. Remove their harnesses after the
25
25
  change, preserving useful reports. Real-resource results do not replace fast
26
26
  regressions, and fast regressions do not establish real-model behavior.
27
27
 
28
+ ## Coverage, not test count
29
+
30
+ Keep three complementary kinds of evidence: a few normal paths through real
31
+ entry points and component wiring; critical regressions for durable intent,
32
+ idempotency, authority, isolation and historical storage; and cheap pure-logic
33
+ checks for meaningful branching. A passing suite proves its assertions, not
34
+ the absence of every bug.
35
+
36
+ Pin constants that are persisted or public contracts (event names, protocol
37
+ identifiers, historical encodings), with an independent literal expectation.
38
+ Where possible, also prove the current reader understands migrated data.
39
+ Do not derive expected and actual values from the same constant, or lock an
40
+ internal default merely because it is a constant.
41
+
42
+ Merge tests only when each assertion has an identified surviving scenario.
43
+ Identical constant checks and repeated setup can be consolidated; similar
44
+ names do not make Task and Global authority boundaries interchangeable.
45
+ Do not target a particular test count or delete safety checks to hit a time
46
+ budget. A temporary deliberate fault can confirm that a critical check detects
47
+ its intended regression; no permanent mutation service or broad fault matrix
48
+ is required.
49
+
28
50
  ## Permanent core smoke
29
51
 
30
52
  `npm test` and `npm run test:core` build the checkout and run one permanent suite:
31
53
 
32
- 1. the packaged CLI starts and exposes setup/update/upgrade/Task commands;
54
+ 1. the built CLI starts and its catalog exposes setup/update/upgrade/Task commands;
33
55
  2. one normal SQLite Task and Message survive a reopen;
34
56
  3. a supported historical Home migrates through the linear storage chain to current;
35
57
  4. the built-in Codex and Claude Drivers are registered;
36
58
  5. one independent declarative plugin is created, validated, called and disabled
37
59
  through authenticated ingress, with its selection and validation preserved.
38
60
  6. a Task starts from durable Operator input, exposes planning Context and enters
39
- delivery with its original intent and captured planning authority preserved.
61
+ delivery with its original intent and captured planning authority preserved;
62
+ scratch workspace release does not require a fabricated Git identity.
40
63
  7. Session replacement preserves pending original Messages and independent work;
41
- old Sessions keep scoped reads but cannot regain write authority;
64
+ cleanup blocks new notification claims, and successor acceptance cannot
65
+ settle an old wake or later queued input. Old Sessions keep scoped reads
66
+ but cannot regain write authority;
42
67
  8. InputRequests survive Session replacement without a synthetic AgentRun;
43
68
  9. late native terminals cannot settle successor input or invent acceptance;
44
69
  10. remote Operator startup carries its reserved workspace, Role instructions
@@ -61,6 +86,9 @@ regressions, and fast regressions do not establish real-model behavior.
61
86
  16. explicit force archive commits before cleanup and preserves uncertain
62
87
  delivery/runtime evidence; partial cleanup and late results remain traceable,
63
88
  while archived runtime resources never become automatically safe to delete.
89
+ Archive preflight preserves durable records and the Git index, distinguishes
90
+ frozen-result differences, and cleanup rechecks moved heads, owner branches
91
+ and new dirt. Read-only Git status never executes configured clean filters.
64
92
  17. Host facts reach the existing Inbox even when its compiled store cannot
65
93
  read the Home; Controller-side fencing, ACK-loss replay, and legacy-Host
66
94
  upgrade refusal preserve the original execution. A frozen independent v1
@@ -73,16 +101,117 @@ regressions, and fast regressions do not establish real-model behavior.
73
101
  pre-fix released Hosts can be hot-patched.
74
102
  Archive racing Host ingress retains the complete source envelope without
75
103
  reopening the Task or settling original uncertain input.
104
+ 18. Project maintenance waiters yield to the holder, use a shared 60-second
105
+ monotonic budget with independent 200–500ms jitter, and cancel on Controller
106
+ stop without losing activation intent. Disposable lock/SQLite/Git fixtures
107
+ cover exclusion, partial release and under-lock revalidation; injected time
108
+ checks the minute-long deadline without sleeping for a minute. Competing
109
+ activations each adopt their own workspace without replaying Git work.
110
+ 19. Task usage distinguishes zero, partial and unknown across exact requests,
111
+ cumulative baselines, Session replacement and native child overlap. A small
112
+ event fixture checks direct Leader/parallel time semantics and the shared
113
+ CLI/Web/audit lifetime projection without collecting Provider data.
114
+ 20. explicit cleanup releases retained terminals without affecting other Tasks
115
+ or claiming that live resources are gone; Controller replacement waits for
116
+ the old process to exit.
117
+ 21. structured verification preserves argv, explicit shell failure, environment
118
+ and workspace-relative cwd through the actual RPC parser and both local
119
+ executors. Corrected execution semantics invalidate old gate reuse without
120
+ rewriting historical artifacts or migrations.
121
+ 22. concurrent resource registration preserves unrelated rows and rejects
122
+ stale same-record writes; GC closes owned connections on success/failure.
123
+ 23. Context counts, exact inspection and bounded event deltas work without
124
+ materializing complete history or acquiring a writer lock. Telemetry
125
+ ingestion yields to the event loop and drains its worker on close.
126
+ 24. Release resume re-queries uncertain effects, retains confirmed work and
127
+ refuses exhausted grants, using disposable SQLite and fake external ports.
128
+ These checks do not claim validation of real release services.
129
+ 25. The pre-1.0 contract cleanup normalizes old singleton dispatches only through
130
+ explicit storage migration. Unsupported CLI/ACP input, unregistered development
131
+ links, unpinned release identities and unsupported quarantine receipts are
132
+ refused without inventing acceptance or discarding evidence. Current link,
133
+ configuration and quarantine operations remain usable.
134
+ 26. Activation refuses absent intent before resource adoption and still honors
135
+ planning deferral and cancellation. Retiring the integration queue preserves
136
+ exact records and active attempts in one rollback-safe migration, without
137
+ inventing delivery. Conflicted Integrations remain completion blockers.
138
+ 27. Unknown lock ownership stays fenced, including unavailable OS evidence.
139
+ PR lookup distinguishes absence, malformed/ambiguous results and transport
140
+ failure through injected ports. Receipt-free Git operations remain unchanged,
141
+ while normal receipt-backed continuation still works. Notification-only
142
+ migration preserves current delivery and audit history and refuses live links.
143
+ 28. SQLite admission ignores unrelated side files but refuses a non-empty Home
144
+ without its database. Default CLI/HTTP discovery stays bounded and retains
145
+ off-page Task detail; unknown writer leases diagnose without mutation.
146
+ Review migration preserves candidate evidence while making scope explicit.
147
+ 29. Missing authoritative readers fail before Provider preparation or queue
148
+ admission instead of becoming empty evidence. WorkItem history retirement
149
+ preserves the original payload and current work, advances event IDs safely,
150
+ and refuses unknown old shapes without advancing the migration ledger.
151
+ 30. WorkItem overlap is a read-only advisory; exact permission/dependency guards
152
+ remain. Real local verification proves default reuse, explicit rerun failure,
153
+ incomplete evidence and stale-consumer rejection through the current proof path.
154
+ An Integration rerun cannot bypass an equivalent unfinished gate. Policy
155
+ migration preserves historical execution and blocks an admitted old gate.
156
+ 31. Message edits preserve submission intent and immutable request identity;
157
+ no-op edits do not enqueue work, and an edited develop request cannot create
158
+ a planning Run. Unkeyed discussions still plan after activation is resolved.
159
+ Queue identity remains frozen through an interrupt-then handoff; completion sees explicitly
160
+ queued input. Input migration preserves raw audit evidence, refuses to
161
+ auto-authorize old pending immediate activations and keeps the prior ledger.
162
+ The actual Controller continues admitted requests but not cancellations.
163
+ Required Store reads fail before config mutation or full-scan fallback.
164
+ Explicit Job requests replay one operation and reject changed or missing keys.
165
+ 32. Worker Job admission/management and the pre-spawn gate reject a different
166
+ owner/workspace; legitimate Worker and Leader Jobs remain usable. Candidate
167
+ mutation blocks publication of reusable success, including after explicit
168
+ abort/retry. Upstream wiring returns its admitted Job and continuation IDs.
169
+ Plugin replacement retains delayed old-generation cleanup errors without
170
+ undoing a newer selection. A shared validator rejects bad record writes,
171
+ ordinary/Context reads and full-Home health checks without repairing data.
172
+ 33. Built CLI calls refuse replaced Operator writes, Task-owned Home mutations
173
+ and foreign-Task queries while retaining legitimate reads and current
174
+ Operator actions. Job reads enforce Context scope at the Controller port.
175
+ Real local runtime directories move once through quarantine/restore/purge;
176
+ current durable ownership overrides a stale cleanup plan and prevents
177
+ purging a reopened Task.
178
+ 34. Current CLI rejects `task turn`; completion has one identity and preserves
179
+ unrelated shell content through install/uninstall. GC protects exact live
180
+ SQLite Session custody without consulting old JSON. The 34→35 cutover
181
+ preserves raw retired payloads/log bytes and identity counters, blocks
182
+ unsettled gates/custody, and rolls back malformed conversions.
183
+ 35. Native model aliases/resolved IDs and open custom-model fields retain their
184
+ distinct contracts; configuration errors display the observed choices.
185
+ Rejected Leader startup stays quiet across Store reopen and repeated passes,
186
+ preserves original/later input and blocks premature completion. Explicit
187
+ retry requeues the exact rejected claim once without rewriting its history;
188
+ typed contention remains retryable and unknown acceptance cannot be replayed.
189
+ 36. Failure-scoped capability reads preserve the recorded model/workspace/settings
190
+ selection after Role edits, reject changed Agent bindings, honor explicit
191
+ metadata refresh and identify cached fallback. The Controller supplies native
192
+ account context without accepting caller credentials. Task/Role/record reads
193
+ stay fenced. Runless startup and native rejection reuse one error/notification.
194
+ Migration 35→36 preserves historical error bytes and the earlier ledger while
195
+ marking absent historical configuration unavailable, never reconstructing it.
196
+ 37. Narrow failure context survives independently of execution/Review/Session
197
+ protocols; 36→37 preserves the original snapshot in audit. Repeated native
198
+ submission rejection creates one error and one supervisor notice through
199
+ the shared writer. A small injected cache proves completed-result eviction,
200
+ pending-request coalescing, explicit refresh and truthful cache provenance.
76
201
 
77
202
  Keep the test phase seconds-scale; measure TypeScript build separately. Record
78
203
  incremental runtime when adding a critical regression. The seven recovery boundary
79
204
  cases initially add about 0.4 seconds of test bodies (about 0.6 seconds standalone,
80
- including module startup) on the development host. Avoid sleep-based checks or
81
- mandatory model/daemon launches in the permanent suite.
205
+ including module startup) on the development host. Keep real-model launches out
206
+ of this suite. Real tmux/CLI lifecycle checks belong to the bounded package smoke
207
+ below, not a second core daemon matrix.
82
208
  The Integration continuation regressions use disposable Git repositories,
83
209
  SQLite and fake Jobs, without a provider or shared Home. Their test bodies
84
210
  take about 3 seconds on the development host; validation settlement adds
85
211
  about 1.4 seconds to the initial 1.5-second coverage.
212
+ Archive preflight adds three small disposable Git/SQLite scenarios (about
213
+ one second of test bodies); broader owner/diagnostic combinations remain
214
+ temporary validation evidence, not a second permanent matrix.
86
215
 
87
216
  ## Skill and instruction changes
88
217
 
@@ -99,10 +228,25 @@ do not add prose-matching tests or claim model validation from static checks.
99
228
 
100
229
  ## CI and release
101
230
 
102
- `ci.yml` runs the core smoke plus one package-assembly/start check. It does not
103
- run a second lint pass or a separate broad regression suite. `publish.yml` reuses that
104
- exact gated commit and adds only tag, artifact, install, and provenance checks
105
- that are unique to publishing.
231
+ `ci.yml` builds once and runs core plus one assembled-package normal-path smoke
232
+ on every PR, without another lint or broad regression suite.
233
+ `node scripts/smoke-runtime-package.mjs --assembled .release-stage` exercises
234
+ the actual CLI/Controller/Host/SQLite and isolated tmux, replacing only the
235
+ external Provider with a deterministic fixture. It covers setup, durable input
236
+ and idempotency across restart, scratch activation, native result ingestion,
237
+ completion preserving the conversation, and archive releasing live/dead panes
238
+ and grouped viewers without affecting a similarly named neighboring session.
239
+ The fixture owns a fresh Home and its PATH, installs cleanup before setup,
240
+ and never calls an installed model Agent.
241
+
242
+ `publish.yml` runs the same smoke against the freshly installed package through
243
+ `YUI_INSTALLED_ROOT`, adding actual npm-bin, dependency, supported Node version,
244
+ artifact and provenance boundaries. This validates runtime integration, not
245
+ real-model behavior. Pure contract and safety tests remain in `test/core`;
246
+ production wiring is exercised here rather than only through mocked ports.
247
+ The package smoke also checks unconditional status identity and update-owned
248
+ resource/identity capture through the assembled package, without an installation
249
+ or publication effect.
106
250
 
107
251
  Configured Agents acting as developers or reviewers are ordinary execution
108
252
  resources. Using a live provider or model as the subject of validation is
@@ -110,3 +254,11 @@ different: paid APIs, shared Homes, production systems, real account quota, and
110
254
  other non-disposable external effects are never implied by a request to test or
111
255
  validate. They require an explicit user request for the exact resource and
112
256
  effect boundary.
257
+
258
+ For authorized real-model probes, distinguish native acceptance, exact Turn
259
+ completion and independently checked work (files, tests, commits and Task
260
+ facts). A missing echo marker is not a functional failure. After Session
261
+ replacement, verify the successor read the original input and correlate its
262
+ own terminal; do not require every historical wake to receive that terminal.
263
+ Check normal completion/archive before stopping execution, since stop/cancel
264
+ cleanup is a different path. Preserve these evidence distinctions in the report.
@@ -18,19 +18,34 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
18
18
  完成后移除它们的 harness,并保留有用的报告。真实资源结果不替代快速回归,快速回归也
19
19
  不确立真实模型行为。
20
20
 
21
+ ## 关注覆盖,而不是测试数量
22
+
23
+ 保留三类互补证据:经过真实入口和组件组装的少量正常链路;保护持久意图、幂等、权限、
24
+ 隔离和历史存储的关键回归;覆盖有意义分支的低成本纯逻辑检查。全绿证明断言成立,
25
+ 不证明不存在任何缺陷。
26
+
27
+ 持久化或公开契约中的常量值得固定,例如事件名、协议标识和历史编码;保留独立字面值
28
+ 期望,并尽量证明当前读取逻辑能理解迁移后的数据。不要让预期值和实际值都来自同一个
29
+ 常量,也不因内部默认值是常量就锁死它。
30
+
31
+ 合并测试前,明确每项断言由哪个保留场景继续保护。相同常量检查和重复初始化可以合并,
32
+ 但名称相似不代表 Task 与 Global 权限边界可互相替代。不以数量为目标,也不为耗时
33
+ 预算删除安全检查。可临时引入明确错误来确认关键检查能拦截对应回归,无需永久变异
34
+ 测试服务或宽泛故障矩阵。
35
+
21
36
  ## 永久 core smoke
22
37
 
23
38
  `npm test` 和 `npm run test:core` 构建 checkout 并运行一个永久套件:
24
39
 
25
- 1. 打包后的 CLI 能启动,并暴露 setup/update/upgrade/Task 命令;
40
+ 1. 构建后的 CLI 能启动,命令目录暴露 setup/update/upgrade/Task 命令;
26
41
  2. 一个普通的 SQLite Task 和 Message 能在重开后存活;
27
42
  3. 一个受支持的历史 Home 沿线性存储链迁移到当前版本;
28
43
  4. 内置的 Codex 与 Claude Driver 已注册;
29
44
  5. 一个独立的声明式插件通过认证入口被创建、验证、调用和停用,其选择和验证被保留。
30
45
  6. 一个 Task 从持久的 Operator 输入启动,暴露规划 Context,并在原始意图和捕获的
31
- planning 权限被保留的情况下进入交付。
32
- 7. Session 替换保留待处理的原始 Message 和独立工作;旧 Session 保留范围受限的读取,
33
- 但不能重获写权限;
46
+ planning 权限被保留的情况下进入交付;scratch 工作区释放不要求虚构 Git 身份。
47
+ 7. Session 替换保留待处理的原始 Message 和独立工作;清理期间不领取新通知,后继接受
48
+ 不会结算旧 wake 或后到输入。旧 Session 保留范围受限的读取,但不能重获写权限;
34
49
  8. InputRequest 在没有合成 AgentRun 的情况下经受 Session 替换;
35
50
  9. 迟到的原生终态不能结算后继输入或编造接受;
36
51
  10. 远程 Operator 启动携带其保留工作区、Role 指令和范围受限的 CLI 身份,同时离线
@@ -46,7 +61,9 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
46
61
  15. 普通 Integration 冲突可直接继续;准确 Git 与 Job 证据恢复中断交付,
47
62
  不重放已执行的步骤,也不把已发生的 CAS 与新的验证条件混为一谈。
48
63
  16. 明确授权的 force archive 先提交归档,再独立记录清理;不确定输入与晚到
49
- 结果仍可追溯,归档不使保留资源自动变得可删除。
64
+ 结果仍可追溯,归档不使保留资源自动变得可删除。归档预检不改变持久记录或
65
+ Git index,区分冻结结果差异;清理重查 HEAD、owner 分支和新增脏状态。
66
+ 只读 Git 状态检查不执行配置的 clean filter。
50
67
  17. 即使 Host 编译版本的存储代码无法读取 Home,事实仍先进入现有 Inbox;
51
68
  Controller 侧归属校验、ACK 丢失重放和 legacy Host 升级拒绝保护原始执行。
52
69
  独立冻结的 v1 协议生产者在真实 19→22 迁移前后保持同一进程,通过新 discovery
@@ -54,10 +71,84 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
54
71
  在不向 Session 环境导出 Run ID 的前提下保留 scoped 启动证据。该 fixture 代表最低
55
72
  支持的新线协议,不声称已发布的修复前 Host 可以原地热更新。
56
73
  归档与 Host 消费交错时保留完整来源 envelope,不重新打开 Task 或结算原不确定输入。
74
+ 18. Project 维护锁等待不阻塞持锁者,使用共享的 60 秒单调时钟预算与每次独立的
75
+ 200–500ms 随机间隔;Controller 停止时取消等待,不丢失激活意图。
76
+ 可丢弃锁、SQLite 和 Git fixture 覆盖排他、部分锁释放及取锁后重校验,
77
+ 注入时钟验证一分钟截止逻辑,不实际等待一分钟;竞争激活各自采用工作区,
78
+ 不重放 Git 操作。
79
+ 19. Task 用量在精确请求、累计基线、Session 替换和原生子执行重叠下区分真实零、
80
+ 部分与未知。小型事件 fixture 覆盖直接 Leader/并行耗时,以及 CLI/Web/audit
81
+ 共享的全生命周期投影,不采集 Provider 数据。
82
+ 20. 明确清理释放保留终端、不影响其他 Task、不把存活资源报告为已释放;
83
+ Controller 替换确认旧进程退出。
84
+ 21. 结构化验证经过实际 RPC 解析器和两种本地执行器,保持 argv、显式 Shell 失败、
85
+ 环境和工作区相对 cwd 的语义。修正执行契约后不再复用旧结果,不重写历史证据或迁移。
86
+ 22. 并发资源登记保留无关记录、拒绝覆盖已变化的同一记录;GC 在成功和失败时关闭自有连接。
87
+ 23. Context 计数、原文查阅和事件分页不全量加载历史、不获取写锁;遥测写入让出事件循环,
88
+ 关闭时排空自有 Worker。
89
+ 24. Release 使用临时 SQLite 和 fake 外部端口检查不确定效果查询、已确认步骤复用、
90
+ grant 次数耗尽;不宣称真实发布服务已验证。
91
+ 25. 1.0 前的契约清理只通过显式迁移规范化旧单条调度批次;拒绝旧 CLI/ACP 输入、
92
+ 未登记开发链接、未固定 release 身份与不受支持的 quarantine 回执,不编造接受或
93
+ 丢弃证据。当前链接、配置和隔离资源恢复仍可用。
94
+ 26. 激活在资源采用前拒绝缺失请求,仍保留规划延后与取消边界。集成队列退役通过可回滚的
95
+ 单次迁移保留完整记录及活动尝试,不编造交付;冲突中的 Integration 仍阻止完成。
96
+ 27. owner 或 OS 身份不明时锁仍保持围栏;PR 查询通过注入端口区分不存在、格式错误、
97
+ 歧义及传输失败。无回执的 Git 操作保持原样,正常回执续作仍可用。通知格式迁移保留
98
+ 当前投递和审计历史,并拒绝活动执行引用。
99
+ 28. SQLite 准入不受无关旁路文件覆盖,缺少数据库的非空 Home 仍拒绝初始化。
100
+ CLI/HTTP 默认目录有界,页外详情继续可读;未知 writer lease 只诊断不修改。
101
+ Review 迁移保留候选证据并显式写入 scope。
102
+ 29. 核心读取缺失时,在 Provider 准备及消息入队前失败,不将缺失接口当作空证据。
103
+ WorkItem 历史状态退役保留完整原文和当前工作,安全递增 Event ID,
104
+ 未知旧形态不推进迁移账本。
105
+ 30. WorkItem 重叠仅作只读建议,权限和依赖保护不变。实际本地检查验证默认复用、
106
+ 显式重跑失败、未完成证据与过期消费者拒绝,覆盖现行证明路径;
107
+ Integration 重跑不能绕过等价未完成验证。模式迁移保留历史执行,并阻止切换
108
+ 已接纳的旧验证。
109
+ 31. Message 编辑保留提交意图和不可变请求身份;相同正文更新不排队,develop 编辑
110
+ 不创建 planning Run。激活解除后,未绑定请求身份的讨论仍可进入规划;queue 请求
111
+ 身份在 interrupt-then 交接后仍冻结。完成检查仍能看到显式排队的输入。输入迁移保留
112
+ 原始审计证据和旧账本,不擅自授权旧 pending immediate 激活。实际 Controller
113
+ 接纳当前已授权请求,但不恢复已取消请求。缺失 Store 读取在配置写入或全量扫描
114
+ 前失败。显式 Job 请求复用同一操作,拒绝不同输入和缺失请求键。
115
+ 32. Worker Job 的准入、管理和启动前检查拒绝其他 owner/工作区,同时保留合法
116
+ Worker 与 Leader 操作。候选被改写时不能发布可复用成功,显式放弃后重试也不
117
+ 借用旧绿灯。Upstream 返回已接纳 Job 和精确续作 ID。插件多次替换后仍记录迟到的
118
+ 旧实例清理失败,不回滚新选择。共享校验拒绝无效写入、普通/Context 读取和全
119
+ Home 健康检查,不自动修补数据。
57
120
 
58
121
  把测试阶段保持在秒级;单独度量 TypeScript 构建。新增一个关键回归时记录其增量运行
59
122
  时长。这七个恢复边界用例在开发主机上最初约增加 0.4 秒的测试体(独立运行约 0.6 秒,
60
- 含模块启动)。避免在永久套件中使用基于 sleep 的检查或强制的模型/daemon 启动。
123
+ 含模块启动)。真实模型调用不进入该套件;真实 tmux/CLI 生命周期由下面有界的
124
+ package smoke 覆盖,不在 core 中维护第二套 daemon 矩阵。
125
+ 归档预检新增三个可丢弃 Git/SQLite 场景,测试体约一秒;更广的 owner/诊断组合
126
+ 保留为临时验证证据,不形成第二套永久矩阵。
127
+
128
+ 新增的入口与 GC 回归还验证:实际 CLI 拒绝旧 Operator 写入、Task 角色修改
129
+ Home 设置和跨 Task 查询,同时保留正常读取与当前 Operator 操作;
130
+ Job 读取在 Controller 入口执行 Context 范围检查。真实本地 runtime 目录
131
+ 只移动一次,隔离、恢复与清除可闭环;最新持久所有权优先于旧清理计划,
132
+ Task 重新打开后不能被 purge。
133
+
134
+ 当前合同回归还覆盖:拒绝 `task turn`,单一补全身份在安装/卸载后保留无关
135
+ shell 内容;GC 读取精确的 SQLite Session 归属而不读取旧 JSON;`34→35` 保留
136
+ 退休 payload、日志字节和身份计数,阻止未结算 gate/旧归属,并完整回滚无效转换。
137
+
138
+ 启动回归验证原生模型别名、实际 ID 与开放自定义模型字段各自的合同,并在模型配置
139
+ 拒绝时显示观测到的选项。Leader 启动被拒绝后,多次调度与重开 Store 不再产生尝试,
140
+ 原始及后续输入保留并阻止提前完成;显式重试仅将精确拒绝批次重新排队,不改写历史。
141
+ 明确的资源争用仍可重试;已接受或接受状态未知的通知不能重放。
142
+
143
+ 失败配置查询在 Role 修改后仍保留原模型、工作区与 settings 选择,拒绝已改变的
144
+ Agent 绑定,支持显式刷新并标明缓存。Controller 提供原生账户环境,不接收调用方
145
+ 凭据;Task、Role 与具体错误记录的读权限仍受约束。无 Run 启动失败与原生拒绝
146
+ 复用一份错误和通知。`35→36` 保留历史错误字节和旧账本,把未记录配置标为不可用,
147
+ 不猜测补齐。
148
+
149
+ 精简失败上下文不再依赖执行、Review 或 Session 协议;`36→37` 把原快照留在审计中。
150
+ 重复原生提交拒绝通过共同写入入口只产生一个错误和一条上级通知。小容量注入测试
151
+ 验证结果淘汰、进行中查询合并、显式刷新以及真实的缓存来源标记。
61
152
 
62
153
  ## Skill 与指令变更
63
154
 
@@ -71,10 +162,26 @@ package-start 检查跟随已安装树中的本地 Skill 引用,包括跨 Role
71
162
 
72
163
  ## CI 与发布
73
164
 
74
- `ci.yml` 运行 core smoke 加一个包装配/启动检查。它不运行第二遍 lint,也不运行单独的
75
- 宽泛回归套件。`publish.yml` 复用那个确切的、已过门的提交,只增加发布独有的 tag、
76
- 产物、安装和 provenance 检查。
165
+ `ci.yml` 在每个 PR 上构建一次,运行 core 及一个组装包正常链路检查,不重复 lint,
166
+ 也不增加宽泛回归套件。
167
+ `node scripts/smoke-runtime-package.mjs --assembled .release-stage` 经过真实
168
+ CLI/Controller/Host/SQLite 与隔离 tmux,仅用确定性夹具替换外部 Provider。它验证
169
+ setup、输入跨重启持久化及幂等、scratch 激活、原生结果入库、完成后保留会话,以及
170
+ 归档释放活/死 pane 和附属查看 session,且不影响相似名称的相邻 session。
171
+ 夹具拥有新建 Home 和独立 PATH,在 setup 前建立清理责任,不调用安装的真实模型 Agent。
172
+
173
+ `publish.yml` 通过 `YUI_INSTALLED_ROOT` 对刚安装的包执行同一个 smoke,增加真实
174
+ npm bin、依赖、受支持 Node 版本、产物和 provenance 边界。这证明运行时集成,不证明
175
+ 真实模型行为。纯契约与安全检查保留在 `test/core`,生产组件组装在这里验证,
176
+ 不只依赖模拟端口。
177
+ 组装包检查还验证固定身份输出,以及升级侧通过组装包采集资源和精确 Controller 身份,
178
+ 不执行安装或发布效果。
77
179
 
78
180
  作为开发者或审查者的已配置 Agent 是普通执行资源。把一个真实 provider 或模型作为验证
79
181
  对象则不同:付费 API、共享 Home、生产系统、真实账号额度以及其他不可丢弃的外部效果,
80
182
  绝不由一个测试或验证请求隐含。它们需要用户就确切的资源和效果边界提出显式请求。
183
+
184
+ 获授权的真实模型检查应区分原生接受、精确 Turn 完成,以及独立核验的文件、测试、
185
+ 提交和 Task 事实。缺少固定回显标记不是功能失败。Session 替换后,核验新会话读取
186
+ 原输入,并关联它自己的终态,不要求每个历史 wake 都收到该终态。正常完成与归档
187
+ 应在停止执行之前检查,stop/cancel 清理是另一条路径。报告须保留这些证据区别。
@@ -27,7 +27,7 @@ Yui 是面向编程 Agent 的本地控制面。你只需用自然语言把目标
27
27
  - **自带 Agent** —— Codex CLI、Claude Code CLI 和 ACP 通过统一边界接入,
28
28
  可替换而不丢失 Task。
29
29
  - **本地优先、私有** —— 一切运行在你自己的机器上,面向单个受信任用户;
30
- Web 视图仅本地回环、只读。
30
+ Web 仅本地回环,包含只读视图和经认证的用户控制。
31
31
  - **默认隔离** —— 仓库改动发生在受管 Git worktree 中,稳定 checkout 保持只读。
32
32
 
33
33
  > **状态:** 尚未发布 1.0(0.15.x)。CLI 与配置在版本之间仍可能变化;每次升级
@@ -122,7 +122,10 @@ Agent 可以重新读取任务上下文,继续兼容的 Session,或在必要
122
122
  进程失败不会抹掉任务,结果不确定的投递也不会被静默重复。
123
123
 
124
124
  想直观看进展,可以在另一个终端运行 `yui web`。本地 Web 展示同一份任务与
125
- 待回答问题,不是另一套需要同步的任务系统。
125
+ 待回答问题,也允许发送消息、回答问题,以及显式 queue、steer 或 interrupt Task 输入。
126
+ 这些经认证的 Task 控制复用 CLI 的相同操作,不是另一套需要同步的任务系统。
127
+ 详见 [Web 权限](../docs/architecture/capabilities-and-resources.zh-CN.md#cli-与-web)
128
+ 和[输入时机](../docs/managed-turn-and-session-runtime.zh-CN.md#输入时机queuesteer-与-interrupt)。
126
129
 
127
130
  ## 架构
128
131
 
@@ -225,7 +228,7 @@ Yui 为你组织的东西 —— 是持久对象,而不是进程:
225
228
  它负责搬运工作、记录事实——但从不判断回答好坏
226
229
 
227
230
  Agent 在 Project 中工作:只读 checkout + 隔离 worktree。
228
- Web 视图(yui web):对存储的本地回环、只读投影。
231
+ Web(yui web):本地回环视图 + 经认证的用户控制。
229
232
  ```
230
233
 
231
234
  ### 分层设计
@@ -234,7 +237,7 @@ Yui 为你组织的东西 —— 是持久对象,而不是进程:
234
237
 
235
238
  ```text
236
239
  体验层 Experience — 你如何交互
237
- CLI(Operator)· Web(本地回环、只读)· 原生 Agent 会话
240
+ CLI(Operator)· Web(本地回环、经认证)· 原生 Agent 会话
238
241
  采集输入 · 展示事实 · 确认操作 · 调用能力
239
242
  ▼
240
243
  决策层 Intelligence — 谁来决定
@@ -270,9 +273,12 @@ Yui 为你组织的东西 —— 是持久对象,而不是进程:
270
273
  WorkItem open ─▶ accepted ─▶ retired
271
274
 
272
275
  Draft 只保存规划;激活后才采用交付工作区。
273
- 归档需要工作已了结、worktree 干净,且不可重新打开。
276
+ 普通归档需要工作已了结、worktree 干净,且不可重新打开。
274
277
  ```
275
278
 
279
+ 明确授权的 force 归档可以保留未解决证据与不安全资源;它不证明交付,也不授权删除
280
+ 这些资源。详见[归档合同](../docs/task-delivery.zh-CN.md#归档)。
281
+
276
282
  ## 设计原则
277
283
 
278
284
  ### Agent 做判断,Yui 保存工作事实
@@ -321,8 +327,8 @@ Yui 面向一个受信任本地用户,不是 OS 沙箱,也不是远程多用
321
327
 
322
328
  ## 深入了解
323
329
 
324
- [总体架构](../ARCHITECTURE.md)介绍端到端设计,
325
- [文档导航](../docs/architecture/README.md)提供配置、执行、交付、存储和插件的
330
+ [总体架构](../ARCHITECTURE.zh-CN.md)介绍端到端设计,
331
+ [文档导航](../docs/architecture/README.zh-CN.md)提供配置、执行、交付、存储和插件的
326
332
  当前合同。想直接操作 CLI 时,使用 `yui --help` 查看命令。
327
333
 
328
334
  Yui 默认将控制面数据保存在 `~/.yui`,通过 `YUI_HOME` 选择另一个实例。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.15.11",
3
+ "version": "0.16.0",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -47,6 +47,11 @@ These are instruction routes, not new lifecycle states or a scheduling
47
47
  protocol. Where facts disagree or authority is missing, preserve intent and
48
48
  report the exact boundary rather than choosing a more permissive route.
49
49
 
50
+ Handle a failed Worker/Reviewer launch through the shared
51
+ [configuration recovery guidance](../yui-runtime/references/recovery.md#configuration-and-model-name-failures).
52
+ Read its original failure and scoped metadata before choosing a correction;
53
+ the failed target need not be running for you to act.
54
+
50
55
  ## Maintain useful durable context
51
56
 
52
57
  The DB Brief is the current summary, not a full plan or a history of messages.
@@ -327,8 +327,9 @@ reachable issues to the original execution owner. Fix a small Task-main issue
327
327
  directly; create a Repair WorkItem only when the repair is itself a substantial
328
328
  independently owned requirement.
329
329
 
330
- A failed ReviewRound is an execution failure, not an automatic retry or repair
331
- wave. Inspect its exact Round, AgentRun, candidate, Core failure, and
330
+ A failed ReviewRound is an execution failure, not a repair wave. First read
331
+ its Provider retry projection: bounded infrastructure recovery may already own
332
+ the successor. Otherwise inspect its exact Round, AgentRun, candidate, Core failure, and
332
333
  `task next-action` facts, then choose the smallest recovery that preserves the
333
334
  frozen boundary. Do not invent a retry loop or silently replace the Reviewer
334
335
  Session. For replicated execution, choose whether to retry a failed Producer,
@@ -5,11 +5,10 @@ notification. Inspect the original result, diff, checks and exact Candidate.
5
5
  If insufficient, return bounded feedback to the owning WorkItem/Role while
6
6
  its scope remains valid.
7
7
 
8
- For acceptable isolated Git changes, capture and integrate the latest Candidate
9
- before acceptance:
8
+ For acceptable isolated Git changes, inspect the latest Candidate's committed
9
+ Git snapshot and integrate it before acceptance:
10
10
 
11
11
  ```sh
12
- yui task work capture <work-id>
13
12
  yui task integration start <task> --project <project> \
14
13
  --work-item <work-id> --strategy <ff|cherry-pick|merge|manual> \
15
14
  --check "<Project Policy command>"
@@ -17,6 +16,11 @@ yui task work accept <work-id> --summary "<decision and evidence>"
17
16
  ```
18
17
 
19
18
  These are distinct decisions; confirm Integration succeeded before acceptance.
19
+ ChangeSet capture is optional diff evidence, not a prerequisite for this operation.
20
+ Choose the order and strategy for each result from current Task facts, then call
21
+ one Integration at a time for the same target. There is no ChangeSet merge queue
22
+ or queue processor. Core checks the exact source, checks and target update;
23
+ the Agent owns sequencing and recovery decisions.
20
24
  Preserve each managed workspace's owner and the Task's recorded base. Do not
21
25
  silently advance that base because a remote branch moved.
22
26
 
@@ -45,8 +49,8 @@ the final target update. Read the terminal result, then use:
45
49
  yui task integration continue <task>/<integration>
46
50
  ```
47
51
 
48
- This also applies when no manual conflict resolution was needed. Do not start
49
- a duplicate Integration or wait for an empty queue to finalize it.
52
+ This also applies when no manual conflict resolution was needed. Continue the
53
+ same attempt; do not start a duplicate Integration to consume its Job result.
50
54
 
51
55
  Resume interrupted Git/Job work on this attempt when its source/candidate and
52
56
  Job identities can be proved. A clean HEAD, leftover REBASE_HEAD or successful
@@ -51,9 +51,15 @@ and historical Runs/Sessions count even when no Session is currently busy.
51
51
  “Manual activation” means an explicit user action, not that the user must type
52
52
  CLI commands: an authorized Operator can perform the mechanical operation.
53
53
 
54
- With that authorization, use the formal supported activation operation
55
- (`task activate <task-id>`) within the caller's authority, or have the Operator
56
- perform it. Inspect the observable result. Preserve a busy or unknown
54
+ With that authorization, inspect any existing activation request before creating
55
+ one with `task activation request <task-id> --request-id <id> --environment <plan>`.
56
+ Choose the plan from the authorized resources; retain the request id for retries.
57
+ The Controller adopts an eligible request. `task activate <task-id>` is the
58
+ foreground adoption operation for an existing request, not a request-free shortcut.
59
+ A planning Session requests activation and finishes its turn; it must not
60
+ synchronously wait for its own native turn to become quiescent.
61
+
62
+ Inspect the observable result. Preserve a busy or unknown
57
63
  operation's exact request and follow
58
64
  [Runtime recovery](../../yui-runtime/references/recovery.md); do not
59
65
  self-dispatch, interrupt, kill or replace a Session to bypass the handoff.