@zq-silk/yui 0.15.12 → 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 (236) hide show
  1. package/ARCHITECTURE.md +3 -2
  2. package/ARCHITECTURE.zh-CN.md +3 -2
  3. package/dist/artifacts/artifactCommitLock.js +16 -55
  4. package/dist/artifacts/taskArtifactRepository.js +3 -3
  5. package/dist/cli/agentConfigurationPicker.js +1 -1
  6. package/dist/cli/commandCatalog.js +57 -41
  7. package/dist/cli/completion.js +18 -18
  8. package/dist/cli/completionWizard.js +1 -1
  9. package/dist/cli/dynamicCompletion.js +1 -1
  10. package/dist/cli/interactionPolicy.js +7 -3
  11. package/dist/cli/invocationAuthority.js +64 -0
  12. package/dist/cli/managedDiagnostics.js +1 -1
  13. package/dist/cli/parseRepeatable.js +35 -0
  14. package/dist/cli/updatePorts.js +26 -5
  15. package/dist/cli.js +1280 -1243
  16. package/dist/commands/agentCommands.js +4 -4
  17. package/dist/commands/capabilityCommands.js +1 -1
  18. package/dist/commands/configCommands.js +6 -57
  19. package/dist/commands/configOverview.js +2 -2
  20. package/dist/commands/durableJobCommands.js +12 -6
  21. package/dist/commands/globalRoleCommands.js +53 -29
  22. package/dist/commands/grantCommands.js +0 -3
  23. package/dist/commands/jobCommands.js +1 -4
  24. package/dist/commands/operatorCommands.js +3 -3
  25. package/dist/commands/projectCommands.js +1 -10
  26. package/dist/commands/resourcesCommands.js +10 -40
  27. package/dist/commands/roleConfiguration.js +2 -6
  28. package/dist/commands/taskActivationCommands.js +4 -8
  29. package/dist/commands/taskAgentCapabilities.js +9 -0
  30. package/dist/commands/taskCommandSupport.js +155 -0
  31. package/dist/commands/taskCommandTypes.js +1 -0
  32. package/dist/commands/taskCommands.js +271 -710
  33. package/dist/commands/taskCompletionGate.js +1 -1
  34. package/dist/commands/taskExecutionCommands.js +1 -1
  35. package/dist/commands/taskFactCommands.js +325 -0
  36. package/dist/commands/taskInputCommands.js +12 -42
  37. package/dist/commands/taskIntegrationCommands.js +17 -57
  38. package/dist/commands/taskNextActionCommand.js +7 -6
  39. package/dist/commands/taskPublicationAdoptCommand.js +3 -3
  40. package/dist/commands/taskPublicationCommands.js +1 -1
  41. package/dist/commands/taskPublicationVerifyCommand.js +1 -1
  42. package/dist/commands/taskRemoteDeliveryCommand.js +2 -94
  43. package/dist/commands/taskUpstreamCommands.js +19 -8
  44. package/dist/commands/workflowCommands.js +6 -1
  45. package/dist/completion/completionInstaller.js +26 -26
  46. package/dist/completion/completionState.js +26 -26
  47. package/dist/completion/fileCompletionManager.js +6 -11
  48. package/dist/config/configCatalog.js +0 -2
  49. package/dist/config/timeZone.js +14 -0
  50. package/dist/config/yuiConfig.js +0 -29
  51. package/dist/context/runContextPack.js +2 -3
  52. package/dist/context/taskCatalog.js +3 -5
  53. package/dist/context/taskContext.js +139 -151
  54. package/dist/context/wakeRunReferences.js +11 -0
  55. package/dist/controller/agentCapabilities.js +58 -0
  56. package/dist/controller/agentRuntimeObserver.js +6 -11
  57. package/dist/controller/clientRuntime.js +22 -14
  58. package/dist/controller/controller.js +9 -22
  59. package/dist/controller/fileSchedulerStoreAdapter.js +117 -212
  60. package/dist/controller/jobClient.js +4 -4
  61. package/dist/controller/jobControl.js +60 -25
  62. package/dist/controller/jobSupervisor.js +4 -4
  63. package/dist/controller/providerRetryDelivery.js +7 -7
  64. package/dist/controller/runtime.js +51 -44
  65. package/dist/controller/runtimeEventProcessor.js +0 -5
  66. package/dist/controller/sessionOwnerReconciliation.js +5 -0
  67. package/dist/controller/taskAgentError.js +35 -0
  68. package/dist/coordination/workMailboxQueue.js +2 -24
  69. package/dist/core/controllerClient.js +2 -2
  70. package/dist/core/fileLockOwner.js +74 -0
  71. package/dist/decision/decision.js +17 -0
  72. package/dist/doctor/doctor.js +18 -9
  73. package/dist/event/taskEvent.js +12 -0
  74. package/dist/execution/workItemExecutionProjection.js +2 -2
  75. package/dist/executor/agentCapabilityConfig.js +43 -0
  76. package/dist/executor/agentConfigurationCatalog.js +49 -11
  77. package/dist/executor/agentExecutor.js +5 -8
  78. package/dist/executor/fileRoleLaunchPlanner.js +11 -53
  79. package/dist/executor/taskAgentCapabilities.js +64 -0
  80. package/dist/integration/deliveryObligation.js +1 -69
  81. package/dist/integration/gitIntegrationService.js +60 -84
  82. package/dist/integration/integrationAttempt.js +3 -14
  83. package/dist/integration/integrationSourceApplication.js +4 -12
  84. package/dist/integration/manifestTags.js +2 -2
  85. package/dist/job/durableJob.js +4 -25
  86. package/dist/job/jobAssignmentScope.js +22 -0
  87. package/dist/job/jobOperation.js +16 -0
  88. package/dist/job/jobRunner.js +2 -1
  89. package/dist/job/stepDirectory.js +15 -0
  90. package/dist/kernel/builtinCapabilities.js +15 -11
  91. package/dist/kernel/kernelPorts.js +1 -17
  92. package/dist/lifecycle/exactRunTerminalization.js +1 -9
  93. package/dist/message/inputControlResolution.js +3 -4
  94. package/dist/message/message.js +17 -20
  95. package/dist/message/messageContinuation.js +1 -1
  96. package/dist/milestone/milestone.js +11 -0
  97. package/dist/observability/orchestrationMetrics.js +24 -1
  98. package/dist/observability/runtimeIdentity.js +1 -17
  99. package/dist/output/agentConfigurationPresentation.js +2 -0
  100. package/dist/output/timePresentation.js +1 -14
  101. package/dist/plugins/pluginService.js +12 -4
  102. package/dist/release/releaseWorkflowPorts.js +45 -96
  103. package/dist/release/runtimeRelease.js +9 -15
  104. package/dist/repository/projectMaintenanceLock.js +23 -64
  105. package/dist/repository/taskBaseFreshness.js +1 -1
  106. package/dist/repository/taskWorkspaceCoordinator.js +13 -22
  107. package/dist/repository/taskWorkspacePreparer.js +29 -25
  108. package/dist/repository/workspaceCleanupInspection.js +5 -5
  109. package/dist/resources/autoResourceGc.js +4 -77
  110. package/dist/resources/liveReferences.js +7 -54
  111. package/dist/resources/resourceDiscovery.js +5 -118
  112. package/dist/resources/resourceGc.js +233 -181
  113. package/dist/resources/resourceRegistrar.js +5 -4
  114. package/dist/resources/resourceRegistry.js +3 -37
  115. package/dist/resources/resourceRegistryStore.js +13 -36
  116. package/dist/resources/sqliteResourceRegistry.js +43 -26
  117. package/dist/review/deltaRecheck.js +1 -1
  118. package/dist/review/reviewAcceptance.js +1 -1
  119. package/dist/review/reviewDecision.js +1 -1
  120. package/dist/review/reviewRound.js +8 -7
  121. package/dist/review/taskFinalReviewContractResolution.js +1 -1
  122. package/dist/runtime/acpProtocol.js +4 -51
  123. package/dist/runtime/acpSession.js +10 -75
  124. package/dist/runtime/acpSessionConfiguration.js +1 -8
  125. package/dist/runtime/agentEndpoint.js +3 -2
  126. package/dist/runtime/agentFailureContext.js +43 -0
  127. package/dist/runtime/agentHost.js +15 -15
  128. package/dist/runtime/codexInteractiveHost.js +2 -2
  129. package/dist/runtime/index.js +0 -1
  130. package/dist/runtime/managedCaller.js +21 -1
  131. package/dist/runtime/providerErrors.js +38 -0
  132. package/dist/runtime/runtimeObservation.js +0 -5
  133. package/dist/runtime/runtimeSessionCandidate.js +2 -3
  134. package/dist/runtime/sessionOwnerIdentity.js +1 -1
  135. package/dist/runtime/structuredProviderHost.js +4 -41
  136. package/dist/runtime/tmuxAdapters.js +6 -8
  137. package/dist/scheduler/activeRoleRunDelivery.js +7 -7
  138. package/dist/scheduler/leaderWakeupProcessor.js +19 -6
  139. package/dist/scheduler/operatorEvent.js +12 -20
  140. package/dist/scheduler/operatorInputNotificationProcessor.js +1 -1
  141. package/dist/scheduler/ports.js +5 -8
  142. package/dist/scheduler/roleRunLiveness.js +4 -4
  143. package/dist/scheduler/roleRunStall.js +16 -23
  144. package/dist/scheduler/taskExecutionProjection.js +25 -33
  145. package/dist/scheduler/taskObservabilityProjection.js +0 -1
  146. package/dist/scheduler/taskWake.js +5 -10
  147. package/dist/scheduler/wakeReason.js +2 -0
  148. package/dist/scheduler/wakeupQueue.js +2 -4
  149. package/dist/setup/setupCommand.js +1 -1
  150. package/dist/storage/contextRecords.js +106 -0
  151. package/dist/storage/currentTaskStore.js +1 -1
  152. package/dist/storage/homeLayout.js +13 -17
  153. package/dist/storage/migrations/agentFailureContext.js +22 -0
  154. package/dist/storage/migrations/currentInputContract.js +86 -0
  155. package/dist/storage/migrations/currentRuntimeContract.js +228 -0
  156. package/dist/storage/migrations/historicalVerificationPlan.js +35 -0
  157. package/dist/storage/migrations/integrationContinuation.js +5 -4
  158. package/dist/storage/migrations/narrowAgentFailureContext.js +65 -0
  159. package/dist/storage/migrations/notificationOnlyWakes.js +74 -0
  160. package/dist/storage/migrations/verificationPlanV1.js +162 -0
  161. package/dist/storage/migrations/verificationPolicy.js +74 -0
  162. package/dist/storage/migrations/workItemHistory.js +46 -0
  163. package/dist/storage/persistenceWorker.js +12 -4
  164. package/dist/storage/recordValidation.js +87 -0
  165. package/dist/storage/sqliteSchema.js +142 -1
  166. package/dist/storage/sqliteStore.js +156 -162
  167. package/dist/storage/storageSchema.js +2 -14
  168. package/dist/storage/storageVersions.js +1 -1
  169. package/dist/storage/storeRpc.js +15 -7
  170. package/dist/storage/taskStore.js +3 -7
  171. package/dist/storage/upgrade/upgradeOrchestrator.js +25 -37
  172. package/dist/task/completionReadiness.js +5 -24
  173. package/dist/task/draftPlan.js +0 -53
  174. package/dist/task/nextAction.js +7 -13
  175. package/dist/task/remoteDeliveryService.js +89 -0
  176. package/dist/task/taskActivation.js +2 -25
  177. package/dist/task/taskActivationService.js +0 -2
  178. package/dist/task/taskRecordReference.js +0 -1
  179. package/dist/task/taskSubmission.js +3 -14
  180. package/dist/telemetry/sqliteTelemetryBatch.js +29 -0
  181. package/dist/telemetry/sqliteTelemetryStore.js +49 -49
  182. package/dist/telemetry/telemetryWiring.js +4 -3
  183. package/dist/tmux/tmuxManager.js +29 -20
  184. package/dist/verification/gateArtifact.js +15 -24
  185. package/dist/verification/gateArtifactStore.js +14 -7
  186. package/dist/verification/verificationGateService.js +29 -88
  187. package/dist/verification/verificationPlan.js +27 -72
  188. package/dist/web/assets/client/app.js +1 -1
  189. package/dist/web/assets/client/taskSurface.js +4 -4
  190. package/dist/web/webServer.js +4 -6
  191. package/dist/web/webSnapshot.js +3 -83
  192. package/dist/web/webTaskSurface.js +17 -46
  193. package/dist/workItem/workItem.js +1 -12
  194. package/docs/architecture/capabilities-and-resources.md +14 -2
  195. package/docs/architecture/capabilities-and-resources.zh-CN.md +11 -1
  196. package/docs/managed-turn-and-session-runtime.md +83 -10
  197. package/docs/managed-turn-and-session-runtime.zh-CN.md +65 -11
  198. package/docs/plugin-sdk.md +4 -2
  199. package/docs/provider-runtime.md +3 -1
  200. package/docs/provider-runtime.zh-CN.md +4 -2
  201. package/docs/release-workflow.md +190 -7
  202. package/docs/release-workflow.zh-CN.md +139 -5
  203. package/docs/roles-and-configuration.md +29 -0
  204. package/docs/roles-and-configuration.zh-CN.md +21 -0
  205. package/docs/sqlite-control-plane-design.md +16 -3
  206. package/docs/sqlite-control-plane-design.zh-CN.md +13 -2
  207. package/docs/task-dag-semantics.md +3 -3
  208. package/docs/task-dag-semantics.zh-CN.md +2 -2
  209. package/docs/task-delivery.md +91 -5
  210. package/docs/task-delivery.zh-CN.md +72 -4
  211. package/docs/task-discovery.md +10 -11
  212. package/docs/task-discovery.zh-CN.md +8 -9
  213. package/docs/testing/verification-levels.md +145 -9
  214. package/docs/testing/verification-levels.zh-CN.md +103 -8
  215. package/package.json +1 -1
  216. package/skills/yui-leader/SKILL.md +5 -0
  217. package/skills/yui-leader/references/integration.md +9 -5
  218. package/skills/yui-leader/references/planning.md +9 -3
  219. package/skills/yui-operator/SKILL.md +15 -10
  220. package/skills/yui-runtime/SKILL.md +6 -6
  221. package/skills/yui-runtime/references/recovery.md +47 -0
  222. package/dist/agent/agentRegistry.js +0 -10
  223. package/dist/agentRun/runIdentity.js +0 -22
  224. package/dist/commands/deliveryGuardPreflight.js +0 -30
  225. package/dist/commands/taskIntegrationQueueCommands.js +0 -226
  226. package/dist/commands/taskOverviewCommand.js +0 -377
  227. package/dist/completion/completionWizard.js +0 -125
  228. package/dist/context/dispatchContext.js +0 -110
  229. package/dist/context/wakeNotification.js +0 -144
  230. package/dist/integration/integrationCheckEvidenceReuse.js +0 -53
  231. package/dist/integration/integrationQueueEntry.js +0 -191
  232. package/dist/integration/integrationQueueService.js +0 -810
  233. package/dist/release/fakeReleasePorts.js +0 -55
  234. package/dist/runtime/sessionOwnerRegistry.js +0 -137
  235. package/dist/task/deliveryGuard.js +0 -226
  236. /package/dist/{commands/taskActor.js → task/taskAuthority.js} +0 -0
@@ -2,22 +2,21 @@
2
2
 
3
3
  # 有界任务发现
4
4
 
5
- Agent 使用 `yui task list --view compact --json` 发现候选任务,再读取目标
5
+ Agent 使用 `yui task list --json` 发现候选任务,再读取目标
6
6
  Task Context 和原始 Message。目录是当前事实的只读视图,不是摘要数据库、
7
7
  Context 快照、消息确认、执行判断或验收结论。
8
8
 
9
- 显式 compact 视图不改变既有 `task list --json`、`--verbose` 详细输出。
10
- 内建 Operator 采用 compact;交互选择器保持完整的 `{id,title,status}` 数组,
11
- 只读取这些窄字段。Web 通过 `GET /api/dashboard?view=compact` 使用同一查询;
12
- 原 dashboard 和 Task 详情接口保留执行、观测、用量和远端交付字段。
13
- 本功能不改变持久 schema,无需迁移。
9
+ 目录是唯一列表契约,不再提供 `--view` 选择或 `--verbose` 全历史列表。
10
+ 交互选择器保持完整的 `{id,title,status}` 数组,只读取这些窄字段。
11
+ Web 通过 `GET /api/dashboard` 使用同一查询;单个 Task 的详情接口继续保留
12
+ 执行、观测、用量和远端交付字段。目录查询本身不改变持久记录。
14
13
 
15
14
  ## 查询和分页合同
16
15
 
17
16
  ```sh
18
- yui task list --view compact --project project-1 --status active --limit 20 --json
19
- yui task list --view compact --attention openInputs --json
20
- yui task list --view compact --search "候选标题" --json
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
21
20
  yui task context task-1 --json
22
21
  yui task context inspect task-1 --store task --ref task-1 --digest <digest> --json
23
22
  yui task message show task-1/message-1 --json
@@ -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
@@ -86,12 +111,100 @@ regressions, and fast regressions do not establish real-model behavior.
86
111
  cumulative baselines, Session replacement and native child overlap. A small
87
112
  event fixture checks direct Leader/parallel time semantics and the shared
88
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.
89
201
 
90
202
  Keep the test phase seconds-scale; measure TypeScript build separately. Record
91
203
  incremental runtime when adding a critical regression. The seven recovery boundary
92
204
  cases initially add about 0.4 seconds of test bodies (about 0.6 seconds standalone,
93
- including module startup) on the development host. Avoid sleep-based checks or
94
- 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.
95
208
  The Integration continuation regressions use disposable Git repositories,
96
209
  SQLite and fake Jobs, without a provider or shared Home. Their test bodies
97
210
  take about 3 seconds on the development host; validation settlement adds
@@ -115,10 +228,25 @@ do not add prose-matching tests or claim model validation from static checks.
115
228
 
116
229
  ## CI and release
117
230
 
118
- `ci.yml` runs the core smoke plus one package-assembly/start check. It does not
119
- run a second lint pass or a separate broad regression suite. `publish.yml` reuses that
120
- exact gated commit and adds only tag, artifact, install, and provenance checks
121
- 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.
122
250
 
123
251
  Configured Agents acting as developers or reviewers are ordinary execution
124
252
  resources. Using a live provider or model as the subject of validation is
@@ -126,3 +254,11 @@ different: paid APIs, shared Homes, production systems, real account quota, and
126
254
  other non-disposable external effects are never implied by a request to test or
127
255
  validate. They require an explicit user request for the exact resource and
128
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 身份,同时离线
@@ -64,13 +79,77 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
64
79
  19. Task 用量在精确请求、累计基线、Session 替换和原生子执行重叠下区分真实零、
65
80
  部分与未知。小型事件 fixture 覆盖直接 Leader/并行耗时,以及 CLI/Web/audit
66
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 健康检查,不自动修补数据。
67
120
 
68
121
  把测试阶段保持在秒级;单独度量 TypeScript 构建。新增一个关键回归时记录其增量运行
69
122
  时长。这七个恢复边界用例在开发主机上最初约增加 0.4 秒的测试体(独立运行约 0.6 秒,
70
- 含模块启动)。避免在永久套件中使用基于 sleep 的检查或强制的模型/daemon 启动。
123
+ 含模块启动)。真实模型调用不进入该套件;真实 tmux/CLI 生命周期由下面有界的
124
+ package smoke 覆盖,不在 core 中维护第二套 daemon 矩阵。
71
125
  归档预检新增三个可丢弃 Git/SQLite 场景,测试体约一秒;更广的 owner/诊断组合
72
126
  保留为临时验证证据,不形成第二套永久矩阵。
73
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
+ 验证结果淘汰、进行中查询合并、显式刷新以及真实的缓存来源标记。
152
+
74
153
  ## Skill 与指令变更
75
154
 
76
155
  一并审阅共享的 Runtime 合同和受影响的 Role/Project Skill。用几个相关场景检查指令
@@ -83,10 +162,26 @@ package-start 检查跟随已安装树中的本地 Skill 引用,包括跨 Role
83
162
 
84
163
  ## CI 与发布
85
164
 
86
- `ci.yml` 运行 core smoke 加一个包装配/启动检查。它不运行第二遍 lint,也不运行单独的
87
- 宽泛回归套件。`publish.yml` 复用那个确切的、已过门的提交,只增加发布独有的 tag、
88
- 产物、安装和 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
+ 不执行安装或发布效果。
89
179
 
90
180
  作为开发者或审查者的已配置 Agent 是普通执行资源。把一个真实 provider 或模型作为验证
91
181
  对象则不同:付费 API、共享 Home、生产系统、真实账号额度以及其他不可丢弃的外部效果,
92
182
  绝不由一个测试或验证请求隐含。它们需要用户就确切的资源和效果边界提出显式请求。
183
+
184
+ 获授权的真实模型检查应区分原生接受、精确 Turn 完成,以及独立核验的文件、测试、
185
+ 提交和 Task 事实。缺少固定回显标记不是功能失败。Session 替换后,核验新会话读取
186
+ 原输入,并关联它自己的终态,不要求每个历史 wake 都收到该终态。正常完成与归档
187
+ 应在停止执行之前检查,stop/cancel 清理是另一条路径。报告须保留这些证据区别。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.15.12",
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.
@@ -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.
@@ -38,12 +38,12 @@ Inspect current Projects, Tasks, and relevant Task context before routing:
38
38
 
39
39
  ```sh
40
40
  yui project list
41
- yui task list --view compact --json
41
+ yui task list --json
42
42
  yui task context <candidate-task-id>
43
43
  ```
44
44
 
45
- Use the bounded catalog for discovery, not the detailed legacy list or an
46
- unconditional traversal of every page. Filter by Project/status/search when
45
+ Task listing is a bounded catalog. Do not unconditionally traverse every page.
46
+ Filter by Project/status/search when
47
47
  useful; follow `nextCursor` with the same filters only when more candidates
48
48
  are needed. Attention counts cover the authorized catalog before ordinary
49
49
  filters and pagination. Follow a category's `--attention` query to enumerate
@@ -52,7 +52,6 @@ its affected Tasks, clearing ordinary filters and retaining its `all` flag.
52
52
  candidates (including live Runs and open work), not a computed failure or
53
53
  execution status. Inspect the selected Task's Context and original Messages
54
54
  before routing or deciding; a summary/ref is not the requirement or report.
55
- The existing detailed list remains available to explicit legacy consumers.
56
55
 
57
56
  Route new input to an existing Task when it advances, corrects, narrows, or
58
57
  extends the same bounded outcome and shares final acceptance, delivery, or
@@ -75,14 +74,18 @@ yui operator submit "<related request and delta>" --task <task-id> --intent disc
75
74
  yui task create "<independent outcome>" \
76
75
  --project <project> --base <project>=<ref>
77
76
  yui operator submit "<request and routing context>" --task <new-task-id> --intent develop
78
- yui task activate <new-task-id>
77
+ yui task activation request <new-task-id> --request-id <id> --environment <plan>
79
78
  ```
80
79
 
80
+ Inspect an existing request before creating another. `task activate <task-id>`
81
+ can adopt an eligible request in the foreground; it never activates a Draft
82
+ without a recorded request and environment plan.
83
+
81
84
  Choose the submission intent explicitly; it is never inferred from the message
82
- text. `discuss` (the default, and what an old client sends) routes the Draft to
85
+ text. `discuss` (the default) routes the Draft to
83
86
  planning; `record` saves the message without waking the Leader; `develop` asks an
84
87
  unplanned Draft to activate now, and reports the exact next step when it cannot
85
- (already planned → activate manually; execution stopped → start it first). Pass
88
+ (already planned → request activation explicitly; execution stopped → start it first). Pass
86
89
  `--request-id <key>` to make a submission idempotent: retrying the same key
87
90
  returns the original message and routing instead of creating a duplicate, and the
88
91
  same key with different text is refused as a conflict.
@@ -139,9 +142,11 @@ For Agent-dependent settings, also read:
139
142
  yui --json config agent capabilities <agent-id>
140
143
  ```
141
144
 
142
- Use the live or cached capability catalog as authority for model, effort,
143
- permission, settings source, search, and service-tier values. Do not invent a
144
- provider value from memory.
145
+ For a Task Role or a reported launch failure, use the scoped query from
146
+ [runtime recovery](../yui-runtime/references/recovery.md#configuration-and-model-name-failures)
147
+ instead of the global defaults above. The catalog reports native options and
148
+ whether custom values are allowed; it is not a complete service-side whitelist.
149
+ Distinguish current and cached metadata, and do not invent provider values from memory.
145
150
 
146
151
  A Profile combines portable behavior with either a dynamic Global Worker
147
152
  runtime source or an explicit Agent with optional model and effort. Applying it
@@ -93,12 +93,12 @@ invent a Task AgentRun identity for a GlobalRole.
93
93
 
94
94
  A GlobalRole's durable input uses the same three actions as a Task Role,
95
95
  addressed by the Role's own name instead of a Task. The local-user Web surface
96
- exposes this contract. The current public CLI catalog does not register the
97
- top-level `role` path, even though its handlers implement `yui role message
98
- queue|steer` and `yui role interrupt`; CLI routing rejects these commands as
99
- unknown. Report this availability gap when it prevents authorized work. Do not
100
- invent another command, fabricate Task/Run ownership or borrow the browser's
101
- user authority to bypass a managed Session boundary.
96
+ exposes this contract. Use `yui role message queue|steer <role> <text>` or
97
+ `yui role interrupt <role>` through the public CLI. Queue/steer require a stable
98
+ `--request-id`; steer/interrupt require the exact `--expected-target`.
99
+ Configuration remains under `config role` and lifecycle under `session`.
100
+ Do not fabricate Task/Run ownership or borrow the browser's user authority to
101
+ bypass a managed Session boundary.
102
102
 
103
103
  Queue and steer
104
104
  save an owned Message; bare interrupt records a control request, not a new
@@ -12,6 +12,53 @@ affected WorkItem, ReviewRound or Integration. Use `task next-action` and
12
12
  `execution audit` as decision support, not as an automatic plan.
13
13
  Active or quiet observations are not a Task-wide lock or proof of failure.
14
14
 
15
+ ### Configuration and model-name failures
16
+
17
+ The already-running caller handles a failed launch: Worker/Reviewer failures
18
+ go to their Leader, and an unavailable Leader's failure goes to the existing
19
+ Operator channel. A target that did not start cannot repair itself. Read the
20
+ referenced error once; do not create a recovery Agent, a polling loop or a new
21
+ Task merely to handle it.
22
+
23
+ Use the error's capability-query pointer to inspect native metadata with the
24
+ recorded failed configuration:
25
+
26
+ ```sh
27
+ yui task event show <task> <error-event>
28
+ yui task role capabilities <task> <role> --error <error-event> --refresh
29
+ ```
30
+
31
+ The query uses the Controller's Provider environment, not your own Agent's
32
+ possibly different account variables, and requires that Controller to be running.
33
+ It preserves the requested model, workspace, profile/settings selection and
34
+ configured Agent identity. Native settings files and credentials are still read
35
+ currently, not copied into error history. A historical error without a recorded
36
+ configuration, or a changed Agent command/bindings, returns a diagnosis instead
37
+ of borrowing today's Role configuration. To inspect the desired next launch
38
+ explicitly, omit `--error`. Distinguish live, cached and unavailable metadata.
39
+ Do not treat an alias list as a complete Provider whitelist.
40
+
41
+ Reconcile the original user requirement with exact native IDs and alias
42
+ mappings. Correcting the name of the same authorized model is routine recovery;
43
+ selecting another model, account, permission or cost boundary is not. If there
44
+ is no proven equivalent, preserve the failure and report the missing choice.
45
+ Do not guess names, select a similarly named variant, or silently fall back.
46
+
47
+ After correcting only the intended configuration, choose the existing operation
48
+ that matches current facts. A rejected notification retains its input:
49
+
50
+ ```sh
51
+ yui task wake show <task> <wake>
52
+ yui task wake retry <task> <wake> --reason "<correction and evidence>"
53
+ ```
54
+
55
+ Retry does not replace a Session or change its immutable effective configuration.
56
+ If an existing Session must adopt changed settings, use the deliberate Session
57
+ replacement operation below; an assigned Run uses its own legal retry operation.
58
+ Accepted or uncertain input cannot be replayed through notification retry.
59
+ Configuration failure is not transient infrastructure recovery, and unchanged
60
+ configuration does not justify another attempt.
61
+
15
62
  ### Bounded infrastructure retry
16
63
 
17
64
  The Controller, not the Agent, counts and schedules qualifying transient
@@ -1,10 +0,0 @@
1
- import { configuredAgentToDefinition } from "./agent.js";
2
- export function resolveAgent(id, agents = []) {
3
- return listAgentDefinitions(agents).find((agent) => agent.id === id) ?? null;
4
- }
5
- export function listAgentDefinitions(agents = []) {
6
- return agents.map(configuredAgentToDefinition);
7
- }
8
- export function supportedAgentIds(agents = []) {
9
- return listAgentDefinitions(agents).map((agent) => agent.id);
10
- }
@@ -1,22 +0,0 @@
1
- import { MAX_SESSION_TITLE_LENGTH } from "../runtime/sessionTitle.js";
2
- /**
3
- * Prefixes managed launch input with its session title. The bootstrap body
4
- * exposes the exact current AgentRun identity to the Agent, while structured
5
- * delivery metadata and control hooks retain the delivery fence.
6
- */
7
- export function prefixYuiTitleInput(input, title) {
8
- const text = input.replace(/\r/g, "").trim();
9
- if (text.length === 0)
10
- throw new Error("Managed input body is required.");
11
- return `${requireRunTitle(title)}\n\n${text}`;
12
- }
13
- function requireRunTitle(value) {
14
- const title = value.trim();
15
- if (title.length === 0
16
- || title.length > MAX_SESSION_TITLE_LENGTH
17
- || /[\r\n\0]/u.test(title)
18
- || !title.startsWith("Yui ")) {
19
- throw new Error("AgentRun title is invalid.");
20
- }
21
- return title;
22
- }