@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
@@ -38,11 +38,21 @@ Inspect current Projects, Tasks, and relevant Task context before routing:
38
38
 
39
39
  ```sh
40
40
  yui project list
41
- yui task list
42
- yui task input list
41
+ yui task list --json
43
42
  yui task context <candidate-task-id>
44
43
  ```
45
44
 
45
+ Task listing is a bounded catalog. Do not unconditionally traverse every page.
46
+ Filter by Project/status/search when
47
+ useful; follow `nextCursor` with the same filters only when more candidates
48
+ are needed. Attention counts cover the authorized catalog before ordinary
49
+ filters and pagination. Follow a category's `--attention` query to enumerate
50
+ its affected Tasks, clearing ordinary filters and retaining its `all` flag.
51
+ `executionSignals` are conservative raw inspection
52
+ candidates (including live Runs and open work), not a computed failure or
53
+ execution status. Inspect the selected Task's Context and original Messages
54
+ before routing or deciding; a summary/ref is not the requirement or report.
55
+
46
56
  Route new input to an existing Task when it advances, corrects, narrows, or
47
57
  extends the same bounded outcome and shares final acceptance, delivery, or
48
58
  rollback. Create a new Task only when the new outcome can succeed, fail,
@@ -64,14 +74,18 @@ yui operator submit "<related request and delta>" --task <task-id> --intent disc
64
74
  yui task create "<independent outcome>" \
65
75
  --project <project> --base <project>=<ref>
66
76
  yui operator submit "<request and routing context>" --task <new-task-id> --intent develop
67
- yui task activate <new-task-id>
77
+ yui task activation request <new-task-id> --request-id <id> --environment <plan>
68
78
  ```
69
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
+
70
84
  Choose the submission intent explicitly; it is never inferred from the message
71
- text. `discuss` (the default, and what an old client sends) routes the Draft to
85
+ text. `discuss` (the default) routes the Draft to
72
86
  planning; `record` saves the message without waking the Leader; `develop` asks an
73
87
  unplanned Draft to activate now, and reports the exact next step when it cannot
74
- (already planned → activate manually; execution stopped → start it first). Pass
88
+ (already planned → request activation explicitly; execution stopped → start it first). Pass
75
89
  `--request-id <key>` to make a submission idempotent: retrying the same key
76
90
  returns the original message and routing instead of creating a duplicate, and the
77
91
  same key with different text is refused as a conflict.
@@ -128,9 +142,11 @@ For Agent-dependent settings, also read:
128
142
  yui --json config agent capabilities <agent-id>
129
143
  ```
130
144
 
131
- Use the live or cached capability catalog as authority for model, effort,
132
- permission, settings source, search, and service-tier values. Do not invent a
133
- 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.
134
150
 
135
151
  A Profile combines portable behavior with either a dynamic Global Worker
136
152
  runtime source or an explicit Agent with optional model and effort. Applying it
@@ -60,6 +60,10 @@ binding fails before review begins:
60
60
  explicitly so the Leader can judge what remains useful. Core records only
61
61
  the execution boundary and never classifies the meaning of this prose.
62
62
 
63
+ If the current retry projection says infrastructure recovery is already
64
+ waiting or in flight, report that fact without recommending another dispatch.
65
+ Do not manage the retry yourself or reinterpret its preserved candidate.
66
+
63
67
  The Review scope remains the current AgentRun's frozen candidate even if the Leader
64
68
  handles new user input or advances Task main while this Review is running. Do
65
69
  not switch to the newer head, cancel the current inspection, or claim the
@@ -92,8 +92,15 @@ the Operator has routed to its public/task-authorized context command; never
92
92
  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
- addressed by the Role's own name instead of a Task: `yui role message
96
- queue|steer <global-role>` and `yui role interrupt <global-role>`. Queue and steer
95
+ addressed by the Role's own name instead of a Task. The local-user Web surface
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
+
103
+ Queue and steer
97
104
  save an owned Message; bare interrupt records a control request, not a new
98
105
  Message. Each uses a stable request id and that Role's own Session; none fabricates a Task or
99
106
  runId to reuse Task-scoped delivery. `queue` delivers at the Role's next legal
@@ -174,6 +181,14 @@ runtime identity and workspace progress; never edit Run status or substitute
174
181
  a native Session behind Yui's back. A timeout is not proof of quiescence and
175
182
  does not authorize replay of unknown input.
176
183
 
184
+ Qualifying transient Provider failures have bounded Controller-owned recovery.
185
+ Read the current `providerRetry`/`retry` projection before dispatching a manual
186
+ successor. `waiting` and `in-flight` mean infrastructure recovery is already
187
+ owned; do not add a private retry loop or resend the input. Only a proven native
188
+ success resets that chain, and it never accepts a WorkItem or completes a Task.
189
+ After recovery, inspect existing work and external receipts before continuing;
190
+ the system's recovery instruction supplies no new user authority.
191
+
177
192
  After an authorized external PR/MR operation, use the shared
178
193
  [publication recording contract](references/publication.md). Recording delivery
179
194
  facts does not authorize the external operation, imply acceptance, or grant
@@ -13,6 +13,26 @@ deployment status. After merge, use `yui task publication verify` only when
13
13
  current authorization covers that external provider read. Otherwise retain
14
14
  reported evidence and state the verification gap.
15
15
 
16
+ Keep the completion head as the original acceptance evidence. If an authorized
17
+ post-completion integration produced a different publication candidate, record
18
+ its exact local commit, then read `task publication diff <task>/<publication>`.
19
+ Inspect the complete delta against the original acceptance, including removals,
20
+ conflict resolutions and additional changes. Only when that candidate still
21
+ satisfies the result and its relevant increments are accepted, record
22
+ `task publication adopt <task>/<publication> --reviewed-diff <sha256> --acceptance <text>`.
23
+ Explain the semantic judgment and verification/review evidence in the acceptance.
24
+ When an existing Task Integration produced that exact candidate, include
25
+ `--integration <id>` in diff and adopt to bind its committed evidence.
26
+ Ancestry or Integration success alone is not acceptance; do not reopen the Task,
27
+ rewrite completion, or mark a merge verified to bridge an evidence gap.
28
+
29
+ Adoption records a fixed decision, not remote verification or publication
30
+ authority. The verify operation observes the exact Publication candidate through
31
+ its provider and records contrary head/state facts as reported successors,
32
+ invalidating previous verification. Metadata and verification updates may retain
33
+ adoption while the candidate is unchanged; a changed candidate needs a new
34
+ decision. Archived history is read-only to these adopt/verify operations.
35
+
16
36
  Use `yui task remote-delivery <task>` to explain external delivery. Publication
17
37
  is not Candidate acceptance, Review, Integration or Task completion.
18
38
 
@@ -21,7 +41,7 @@ the exact Task, checks archive eligibility, then uses `--integrated` for verifie
21
41
  merged delivery or `--abandon` for deliberate non-delivery. General archive
22
42
  approval never implies `--force` authority. Preserve the Task record.
23
43
 
24
- With explicit force authorization for a completed or retired Task, use
44
+ With explicit force authorization for a completed or cancelled (retired) Task, use
25
45
  `yui task archive <task> (--integrated|--abandon) --force`. Force commits the
26
46
  archive and stops new Task scheduling before attempting safe foreground cleanup.
27
47
  Missing/stale delivery evidence, unresolved execution and cleanup errors become
@@ -34,9 +54,11 @@ Publication/completion evidence. Unverified local commits and resources that
34
54
  cannot be safely released stay owned and traceable. Late runtime events remain
35
55
  source evidence, not authority to resume or settle unknown input.
36
56
 
37
- Read `task show <task> --json` for `archive.warnings`, `retainedResources` and
38
- cleanup events; `task context` also retains the original records/events. A
39
- successful archive exit means `archived=true`, not that cleanup fully succeeded.
57
+ Read `task show <task> --json` for `data.archive.warnings`,
58
+ `data.archive.retainedResources` and `data.archive.cleanupEvents`;
59
+ `task context` also retains the original records/events. A successful archive
60
+ exit means `archived=true`, not that cleanup fully succeeded. `cleanupFinished`
61
+ means the foreground pass finished, not that every resource was removed.
40
62
  If cleanup was interrupted, the Task stays archived. Repeating archive only
41
63
  reports current facts; use explicit, exact-owner resource operations after
42
64
  inspection instead of re-running broad cleanup. No background retry is implied.
@@ -12,6 +12,77 @@ 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
+
62
+ ### Bounded infrastructure retry
63
+
64
+ The Controller, not the Agent, counts and schedules qualifying transient
65
+ Provider retries: at most five automatic executions after the initial failure,
66
+ within one ten-minute recovery window. Native acceptance, activity and partial
67
+ output do not reset that count. Unknown delivery remains fenced for exact
68
+ readback; it is never replayed.
69
+
70
+ Inspect the current projection in Context, or use
71
+ `task role session retry <task> <role> show`; Global Sessions use
72
+ `session retry <role> show`. While `waiting` or `in-flight`, do not dispatch a
73
+ duplicate. A readable failed Run remains immutable evidence while its recovery
74
+ successor handles the same responsibility and frozen Review boundary.
75
+
76
+ `cancel` withdraws pending automatic recovery; `disable` additionally disables
77
+ future automatic chains on that Provider binding. Neither stops an admitted
78
+ native Turn. `enable` permits future failures to qualify, without replaying
79
+ old failures. These controls require the existing user/supervisor authority.
80
+
81
+ `exhausted`, `cancelled` and `needs-attention` preserve the error, input and
82
+ work. Read their exact reason, then choose an authorized next action. Unsupported
83
+ Hosts/Adapters or unprovable Session/background state do not trigger automatic
84
+ replacement, cleanup, model switching or a new grant.
85
+
15
86
  A failed AgentRun is immutable; retry creates a new attempt. Reuse a recoverable
16
87
  Session when useful and load the new attempt's current context, not an old
17
88
  Assignment from memory. A new Host process need not mean a new native Session.
@@ -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
- }
@@ -1,30 +0,0 @@
1
- import { resolveLeaderNextActionMode, resolveLeaderSemanticBudgetRuns } from "../config/yuiConfig.js";
2
- import { usageError } from "../errors/cliError.js";
3
- import { detectDeliveryDuplicates, evaluateDeliveryGuard, evaluateSemanticBudget, formatDeliveryDuplicate } from "../task/deliveryGuard.js";
4
- export function runDeliveryGuardPreflight(store, taskId, intent, options = {}) {
5
- const mode = resolveLeaderNextActionMode(store.getConfig().leaderNextActionMode);
6
- if (mode === "display")
7
- return { warnings: [] };
8
- const facts = store.readNextActionFacts(taskId);
9
- if (facts === null)
10
- return { warnings: [] };
11
- const outcome = evaluateDeliveryGuard(detectDeliveryDuplicates(facts, intent), mode);
12
- const warnings = outcome.warnings.map(formatDeliveryDuplicate);
13
- if (outcome.blocked !== null) {
14
- throw usageError(`${formatDeliveryDuplicate(outcome.blocked)} `
15
- + "Reuse the existing proof, or set leader.nextActionMode=warn to proceed with a warning.");
16
- }
17
- if (options.budget === true) {
18
- const budget = evaluateSemanticBudget(facts, resolveLeaderSemanticBudgetRuns(store.getConfig().leaderSemanticBudgetRuns));
19
- if (budget.exhausted) {
20
- warnings.push(`Semantic progress budget: ${budget.reason}`);
21
- }
22
- }
23
- return { warnings };
24
- }
25
- /** Prepend guard warnings to a command's normal output. */
26
- export function withGuardWarnings(preflight, output) {
27
- if (preflight.warnings.length === 0)
28
- return output;
29
- return `${preflight.warnings.map((warning) => `Warning: ${warning}\n`).join("")}${output}`;
30
- }
@@ -1,226 +0,0 @@
1
- import { usageError } from "../errors/cliError.js";
2
- import { defaultTableWidth, renderTable } from "../output/table.js";
3
- import { resolveProject } from "../repository/project.js";
4
- import { NodeGitWorkspace } from "../repository/gitWorkspace.js";
5
- import { enqueueIntegrationQueueEntry, processIntegrationQueue, reconcileIntegrationQueueEntry, requeueIntegrationQueueEntry, supersedeIntegrationQueueEntry } from "../integration/integrationQueueService.js";
6
- import { assertTaskDeliveryAuthority as taskLocalActor } from "./taskActor.js";
7
- import { parseRepeatable } from "./taskIntegrationCommands.js";
8
- import { resolveTaskRecordReference } from "../task/taskRecordReference.js";
9
- /**
10
- * `yui task integration queue` — the serialized merge queue. Only terminal
11
- * Candidates explicitly enqueued enter the queue; the queue never blocks
12
- * parallel development, it orders exact-commit integration.
13
- */
14
- export async function runTaskIntegrationQueueCommand(args, store, home, options = {}) {
15
- const [command, ...rest] = args;
16
- if (command === "enqueue")
17
- return enqueue(rest, store, options, home);
18
- if (command === "list")
19
- return list(rest, store);
20
- if (command === "show")
21
- return show(rest, store, options.environment);
22
- if (command === "process")
23
- return process(rest, store, home, options);
24
- if (command === "supersede")
25
- return supersede(rest, store, options, home);
26
- if (command === "requeue")
27
- return requeue(rest, store, options, home);
28
- if (command === "reconcile")
29
- return reconcile(rest, store, options, home);
30
- throw usageError(command === undefined
31
- ? "Task Integration queue command is required."
32
- : `Unknown command: task integration queue ${command}`);
33
- }
34
- async function enqueue(args, store, options, home) {
35
- const usage = "Task Integration queue enqueue usage: yui task integration queue enqueue <task> --project <project> --change-set <id> [--target <ref>] [--check <command> ...].";
36
- const parsed = parseRepeatable(args, new Set(["--check"]), new Set(["--project", "--change-set", "--target"]), usage);
37
- if (parsed.positionals.length !== 1)
38
- throw usageError(usage);
39
- const task = requireActiveTask(store, parsed.positionals[0]);
40
- requireTaskControlActor(store, options.environment, task.id, home);
41
- const projectRef = parsed.one.get("--project");
42
- const changeSetId = parsed.one.get("--change-set");
43
- if (projectRef === undefined || changeSetId === undefined)
44
- throw usageError(usage);
45
- const projectId = resolveProjectId(store, projectRef);
46
- const result = await enqueueIntegrationQueueEntry({
47
- store,
48
- taskId: task.id,
49
- projectId,
50
- changeSetId,
51
- targetRef: parsed.one.get("--target"),
52
- checkCommands: parsed.many.get("--check") ?? [],
53
- now: options.now
54
- });
55
- const label = {
56
- queued: "Enqueued",
57
- "already-queued": "Already queued",
58
- "already-committed": "Already committed",
59
- converged: "Converged"
60
- }[result.outcome];
61
- return {
62
- output: `${label} ${result.entry.changeSetId} as ${result.entry.id} (${result.entry.status})\n`,
63
- data: result
64
- };
65
- }
66
- function list(args, store) {
67
- const usage = "Task Integration queue list usage: yui task integration queue list <task> [--project <project>].";
68
- const parsed = parseRepeatable(args, new Set(), new Set(["--project"]), usage);
69
- if (parsed.positionals.length !== 1)
70
- throw usageError(usage);
71
- const task = requireActiveTask(store, parsed.positionals[0]);
72
- const projectRef = parsed.one.get("--project");
73
- const projectId = projectRef === undefined ? undefined : resolveProjectId(store, projectRef);
74
- // The store already returns entries in numeric id order; trust it instead of
75
- // re-sorting with a lexicographic compare (which yields 1, 10, 2, ...).
76
- const entries = store.listIntegrationQueueEntries(task.id)
77
- .filter((entry) => projectId === undefined || entry.projectId === projectId);
78
- const output = entries.length === 0
79
- ? "Integration queue is empty.\n"
80
- : `${renderTable(`Integration queue: ${task.id}`, [
81
- { header: "Entry", minWidth: 12, maxWidth: 24 },
82
- { header: "Project", minWidth: 8, maxWidth: 20 },
83
- { header: "ChangeSet", minWidth: 10, maxWidth: 20 },
84
- { header: "Target", minWidth: 8, maxWidth: 30 },
85
- { header: "Status", minWidth: 8, maxWidth: 16 }
86
- ], entries.map((entry) => [
87
- entry.id,
88
- entry.projectId,
89
- entry.changeSetId,
90
- entry.targetRef,
91
- entry.status
92
- ]), defaultTableWidth())}\n`;
93
- return { output, data: { entries } };
94
- }
95
- function show(args, store, environment) {
96
- const usage = "Task Integration queue show usage: yui task integration queue show <task>/<entry>.";
97
- if (args.length !== 1)
98
- throw usageError(usage);
99
- const entry = requireQueueEntry(store, args[0], environment);
100
- const lines = [
101
- `Integration queue entry: ${entry.id}`,
102
- `Task: ${entry.taskId}`,
103
- `Project: ${entry.projectId}`,
104
- `ChangeSet: ${entry.changeSetId}`,
105
- `Target: ${entry.targetRef}`,
106
- `Status: ${entry.status}`,
107
- `Target before: ${entry.targetBefore ?? "-"}`,
108
- `Target after: ${entry.targetAfter ?? "-"}`,
109
- `Integration: ${entry.integrationAttemptId ?? "-"}`,
110
- `Affected paths: ${entry.affectedPaths === undefined ? "-" : entry.affectedPaths.join(", ")}`,
111
- `Evidence: ${entry.evidenceRefs.length === 0 ? "-" : entry.evidenceRefs.join(", ")}`,
112
- `Conflict: ${entry.conflictSummary ?? "-"}`,
113
- `Superseded: ${entry.supersedeReason ?? "-"}`
114
- ];
115
- return { output: `${lines.join("\n")}\n`, data: { entry } };
116
- }
117
- async function process(args, store, home, options) {
118
- const usage = "Task Integration queue process usage: yui task integration queue process <task> [--project <project>] [--limit <n>].";
119
- const parsed = parseRepeatable(args, new Set(), new Set(["--project", "--limit"]), usage);
120
- if (parsed.positionals.length !== 1)
121
- throw usageError(usage);
122
- const task = requireActiveTask(store, parsed.positionals[0]);
123
- requireTaskControlActor(store, options.environment, task.id, home);
124
- const limitValue = parsed.one.get("--limit");
125
- const limit = limitValue === undefined ? undefined : Number.parseInt(limitValue, 10);
126
- if (limitValue !== undefined && (!Number.isSafeInteger(limit) || limit < 1)) {
127
- throw usageError(`--limit must be a positive integer: ${limitValue}.`);
128
- }
129
- const projectRef = parsed.one.get("--project");
130
- const projectId = projectRef === undefined ? undefined : resolveProjectId(store, projectRef);
131
- const processed = await processIntegrationQueue(store, home, task.id, {
132
- projectId,
133
- limit,
134
- now: options.now,
135
- environment: options.environment
136
- });
137
- const lines = processed.map(({ entry, result }) => {
138
- if (result.status === "committed") {
139
- return `${entry.id} committed ${entry.changeSetId} -> ${entry.targetAfter ?? "-"}`;
140
- }
141
- if (result.status === "blocked" || result.status === "conflicted") {
142
- return `${entry.id} conflicted ${entry.changeSetId}: ${entry.conflictSummary ?? "blocked"}`;
143
- }
144
- return `${entry.id} conflicted ${entry.changeSetId}: ${entry.conflictSummary ?? "gate failure"}`;
145
- });
146
- const output = processed.length === 0
147
- ? "Integration queue: nothing to process.\n"
148
- : `${lines.join("\n")}\n`;
149
- return { output, data: { processed } };
150
- }
151
- function supersede(args, store, options, home) {
152
- const usage = "Task Integration queue supersede usage: yui task integration queue supersede <task>/<entry> --reason <text>.";
153
- const parsed = parseRepeatable(args, new Set(), new Set(["--reason"]), usage);
154
- if (parsed.positionals.length !== 1)
155
- throw usageError(usage);
156
- const entry = requireQueueEntry(store, parsed.positionals[0], options.environment);
157
- const actor = requireTaskControlActor(store, options.environment, entry.taskId, home);
158
- const reason = parsed.one.get("--reason");
159
- if (reason === undefined)
160
- throw usageError(usage);
161
- const superseded = supersedeIntegrationQueueEntry(store, entry.taskId, entry.id, reason, actor, options.now ?? (() => new Date()));
162
- return {
163
- output: `Superseded ${superseded.id}: ${reason}\n`,
164
- data: { entry: superseded }
165
- };
166
- }
167
- function requeue(args, store, options, home) {
168
- const usage = "Task Integration queue requeue usage: yui task integration queue requeue <task>/<entry>.";
169
- if (args.length !== 1)
170
- throw usageError(usage);
171
- const entry = requireQueueEntry(store, args[0], options.environment);
172
- const actor = requireTaskControlActor(store, options.environment, entry.taskId, home);
173
- const waiting = requeueIntegrationQueueEntry(store, entry.taskId, entry.id, actor, options.now ?? (() => new Date()));
174
- return {
175
- output: `Requeued ${waiting.id}; it will be processed again on the next queue run\n`,
176
- data: { entry: waiting }
177
- };
178
- }
179
- async function reconcile(args, store, options, home) {
180
- const usage = "Task Integration queue reconcile usage: yui task integration queue reconcile <task>/<entry>.";
181
- if (args.length !== 1)
182
- throw usageError(usage);
183
- const entry = requireQueueEntry(store, args[0], options.environment);
184
- requireTaskControlActor(store, options.environment, entry.taskId, home);
185
- const committed = await reconcileIntegrationQueueEntry(store, entry.taskId, entry.id, new NodeGitWorkspace(), options.now ?? (() => new Date()));
186
- return {
187
- output: `Reconciled ${committed.id} as committed -> ${committed.targetAfter ?? "-"}\n`,
188
- data: { entry: committed }
189
- };
190
- }
191
- function requireActiveTask(store, taskId) {
192
- const task = store.getTask(taskId);
193
- if (task === null)
194
- throw usageError(`Task not found: ${taskId}.`);
195
- if (task.status !== "active") {
196
- throw usageError(`Task is not active: ${task.id}/${task.status}.`);
197
- }
198
- return task;
199
- }
200
- function resolveProjectId(store, reference) {
201
- const project = resolveProject(store.listProjects(), reference);
202
- if (project === null)
203
- throw usageError(`Project not found: ${reference}.`);
204
- return project.id;
205
- }
206
- function requireQueueEntry(store, value, environment) {
207
- let reference;
208
- try {
209
- reference = resolveTaskRecordReference(value, {
210
- kind: "integrationQueue",
211
- contextTaskId: environment?.YUI_TASK_ID,
212
- label: "Integration queue entry"
213
- });
214
- }
215
- catch (error) {
216
- throw usageError(error instanceof Error ? error.message : String(error));
217
- }
218
- const entry = store.getIntegrationQueueEntry(reference.taskId, reference.localId);
219
- if (entry === null) {
220
- throw usageError(`Integration queue entry not found: ${reference.taskId}/${reference.localId}.`);
221
- }
222
- return entry;
223
- }
224
- function requireTaskControlActor(store, environment, taskId, home) {
225
- return taskLocalActor(store, environment, taskId);
226
- }