@zq-silk/yui 0.14.1 → 0.14.2

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 (177) hide show
  1. package/ARCHITECTURE.md +64 -35
  2. package/README.md +254 -124
  3. package/dist/agent/managedRuntimeEnvironment.js +5 -8
  4. package/dist/cli/commandCatalog.js +74 -109
  5. package/dist/cli/helpRenderer.js +1 -2
  6. package/dist/cli/interactionCandidates.js +10 -0
  7. package/dist/cli/interactionPolicy.js +76 -37
  8. package/dist/cli/roleWizard.js +5 -6
  9. package/dist/cli/updateOrchestrator.js +10 -8
  10. package/dist/cli/updatePorts.js +17 -13
  11. package/dist/cli/upgradeCommand.js +2 -5
  12. package/dist/cli.js +268 -231
  13. package/dist/commands/agentCommands.js +13 -0
  14. package/dist/commands/configCommands.js +7 -19
  15. package/dist/commands/configOverview.js +3 -2
  16. package/dist/commands/durableJobCommands.js +1 -1
  17. package/dist/commands/executionAuditCommands.js +4 -9
  18. package/dist/commands/globalRoleCommands.js +17 -0
  19. package/dist/commands/profileCommands.js +200 -30
  20. package/dist/commands/sessionCommands.js +1 -1
  21. package/dist/commands/taskActor.js +29 -127
  22. package/dist/commands/taskChangeSetCommands.js +1 -3
  23. package/dist/commands/taskCommands.js +1771 -2107
  24. package/dist/commands/taskCompletionGate.js +27 -103
  25. package/dist/commands/taskContextCommand.js +47 -80
  26. package/dist/commands/taskExecutionCommands.js +9 -27
  27. package/dist/commands/taskInputCommands.js +10 -10
  28. package/dist/commands/taskIntegrationCommands.js +69 -61
  29. package/dist/commands/taskIntegrationQueueCommands.js +1 -1
  30. package/dist/commands/taskNextActionCommand.js +8 -29
  31. package/dist/commands/taskOverviewCommand.js +25 -3
  32. package/dist/commands/taskPublicationCommands.js +151 -85
  33. package/dist/commands/taskPublicationVerifyCommand.js +181 -0
  34. package/dist/commands/taskRemoteDeliveryCommand.js +134 -0
  35. package/dist/commands/taskRoleRuntimeStatus.js +5 -6
  36. package/dist/commands/taskUpstreamCommands.js +79 -95
  37. package/dist/config/configCatalog.js +1 -1
  38. package/dist/context/contextSnapshot.js +17 -2
  39. package/dist/context/sourceTurnContext.js +30 -0
  40. package/dist/context/turnContextPack.js +107 -48
  41. package/dist/context/turnInputContract.js +11 -4
  42. package/dist/context/wakeNotification.js +84 -22
  43. package/dist/controller/agentRuntimeObserver.js +9 -12
  44. package/dist/controller/clientRuntime.js +13 -13
  45. package/dist/controller/controller.js +11 -11
  46. package/dist/controller/fileSchedulerStoreAdapter.js +262 -219
  47. package/dist/controller/jobControl.js +11 -10
  48. package/dist/controller/resourceInventory.js +6 -6
  49. package/dist/controller/resourceInventoryLinux.js +2 -2
  50. package/dist/controller/runtime.js +18 -61
  51. package/dist/controller/runtimeEventInbox.js +57 -34
  52. package/dist/controller/runtimeEventProcessor.js +36 -96
  53. package/dist/controller/runtimeHookTurnFence.js +33 -57
  54. package/dist/controller/runtimeLaunchCoordinator.js +44 -40
  55. package/dist/controller/runtimeObservationHook.js +18 -12
  56. package/dist/controller/sessionNotify.js +43 -28
  57. package/dist/controller/sessionOwnerReconciliation.js +21 -21
  58. package/dist/controller/structuredProviderObservation.js +13 -16
  59. package/dist/coordination/workMailboxQueue.js +132 -0
  60. package/dist/core/controllerServer.js +1 -0
  61. package/dist/domain/agentResultTransport.js +60 -0
  62. package/dist/execution/executionHealth.js +111 -118
  63. package/dist/execution/reviewMainTurn.js +161 -0
  64. package/dist/execution/workItemExecution.js +454 -0
  65. package/dist/execution/workItemExecutionProjection.js +309 -0
  66. package/dist/execution/workItemMainTurn.js +164 -0
  67. package/dist/executor/agentExecutor.js +19 -19
  68. package/dist/executor/executorRegistry.js +7 -28
  69. package/dist/executor/fileRoleLaunchPlanner.js +16 -82
  70. package/dist/external/githubPublicationVerifier.js +114 -0
  71. package/dist/external/gitlabPublicationVerifier.js +158 -0
  72. package/dist/external/pinnedCommandRunner.js +73 -0
  73. package/dist/integration/changeSetManifest.js +0 -3
  74. package/dist/integration/deliveryObligation.js +43 -6
  75. package/dist/integration/gitIntegrationService.js +284 -101
  76. package/dist/integration/integrationAttempt.js +64 -14
  77. package/dist/integration/integrationQueueEntry.js +5 -35
  78. package/dist/integration/integrationQueueService.js +65 -194
  79. package/dist/lifecycle/canonicalLifecycleEvent.js +16 -15
  80. package/dist/lifecycle/exactTurnTerminalization.js +100 -97
  81. package/dist/message/message.js +16 -0
  82. package/dist/observability/executionAudit.js +4 -25
  83. package/dist/observability/faultClassification.js +58 -70
  84. package/dist/observability/orchestrationMetrics.js +8 -50
  85. package/dist/profile/agentProfile.js +60 -15
  86. package/dist/profile/agentProfileRuntime.js +100 -0
  87. package/dist/release/releaseWorkflowPorts.js +5 -68
  88. package/dist/repository/executionLaneGitSnapshot.js +80 -0
  89. package/dist/repository/gitWorkspace.js +9 -67
  90. package/dist/repository/taskBaseFreshness.js +3 -1
  91. package/dist/repository/taskWorkspaceCoordinator.js +32 -4
  92. package/dist/repository/taskWorkspacePreparer.js +252 -411
  93. package/dist/resources/liveReferences.js +6 -55
  94. package/dist/resources/resourceDiscovery.js +1 -30
  95. package/dist/resources/resourceRegistrar.js +0 -23
  96. package/dist/review/deltaRecheck.js +8 -65
  97. package/dist/review/reviewAcceptance.js +22 -19
  98. package/dist/review/reviewConfig.js +0 -10
  99. package/dist/review/reviewDecision.js +2 -2
  100. package/dist/review/reviewRound.js +147 -273
  101. package/dist/review/reviewerAvailability.js +13 -23
  102. package/dist/role/role.js +3 -0
  103. package/dist/runtime/agentDriverObservation.js +1 -1
  104. package/dist/runtime/agentHost.js +51 -51
  105. package/dist/runtime/builtinAgentDrivers.js +9 -2
  106. package/dist/runtime/codexAppServerRuntime.js +23 -5
  107. package/dist/runtime/exactControlPlane.js +2 -267
  108. package/dist/runtime/firstProgressAdvisory.js +1 -1
  109. package/dist/runtime/index.js +1 -1
  110. package/dist/runtime/launchBroker.js +11 -11
  111. package/dist/runtime/lifecycleReservation.js +2 -2
  112. package/dist/runtime/managedCaller.js +111 -0
  113. package/dist/runtime/ports.js +16 -3
  114. package/dist/runtime/preallocatedNativeSession.js +2 -2
  115. package/dist/runtime/processExitObservation.js +3 -2
  116. package/dist/runtime/providerContinuationReconciliationService.js +1 -1
  117. package/dist/runtime/runtimeBinding.js +1 -1
  118. package/dist/runtime/runtimeObservation.js +33 -16
  119. package/dist/runtime/runtimeSessionCandidate.js +2 -2
  120. package/dist/runtime/runtimeStopReceipt.js +11 -11
  121. package/dist/runtime/sessionLaunchRequest.js +2 -2
  122. package/dist/runtime/sessionOwnerIdentity.js +9 -9
  123. package/dist/runtime/sessionOwnerRegistry.js +13 -13
  124. package/dist/runtime/sessionReconciliation.js +4 -4
  125. package/dist/runtime/sessionTerminationGuard.js +9 -9
  126. package/dist/runtime/sessionTokenMetrics.js +5 -7
  127. package/dist/runtime/structuredProviderHost.js +5 -5
  128. package/dist/runtime/taskRuntimeIsolation.js +24 -24
  129. package/dist/runtime/tmuxAdapters.js +32 -30
  130. package/dist/scheduler/activeRoleTurnDelivery.js +37 -15
  131. package/dist/scheduler/leaderWakeupProcessor.js +78 -55
  132. package/dist/scheduler/roleTurnLiveness.js +6 -6
  133. package/dist/scheduler/roleTurnStall.js +8 -9
  134. package/dist/scheduler/taskExecutionProjection.js +19 -41
  135. package/dist/scheduler/taskObservabilityProjection.js +75 -122
  136. package/dist/storage/sqliteSchema.js +1 -21
  137. package/dist/storage/sqliteStore.js +62 -47
  138. package/dist/storage/storageSchema.js +1 -8
  139. package/dist/storage/storageVersions.js +7 -4
  140. package/dist/storage/taskStore.js +8 -8
  141. package/dist/storage/upgrade/upgradeOrchestrator.js +112 -83
  142. package/dist/task/completionReadiness.js +17 -98
  143. package/dist/task/deliveryGuard.js +9 -11
  144. package/dist/task/draftPlan.js +142 -0
  145. package/dist/task/nextAction.js +179 -477
  146. package/dist/task/publicationVerification.js +1 -0
  147. package/dist/task/remoteDelivery.js +233 -0
  148. package/dist/task/task.js +108 -4
  149. package/dist/task/taskRecordReference.js +0 -1
  150. package/dist/turn/turn.js +109 -16
  151. package/dist/verification/verificationGateService.js +0 -26
  152. package/dist/web/assets/client/components.js +99 -121
  153. package/dist/web/assets/client/i18n.js +136 -58
  154. package/dist/web/assets/client/view.js +44 -0
  155. package/dist/web/assets/styles/cards.js +3 -15
  156. package/dist/web/assets/styles/widgets.js +4 -0
  157. package/dist/web/webSnapshot.js +29 -14
  158. package/dist/workItem/dependencyGate.js +34 -0
  159. package/dist/workItem/workItem.js +99 -266
  160. package/dist/workspace/workItemChangeSetManager.js +15 -59
  161. package/docs/task-local-identity.md +1 -1
  162. package/i18n/README.zh-CN.md +164 -58
  163. package/package.json +1 -1
  164. package/skills/yui-leader/SKILL.md +272 -782
  165. package/skills/yui-operator/SKILL.md +190 -365
  166. package/skills/yui-reviewer/SKILL.md +40 -33
  167. package/skills/yui-runtime/SKILL.md +22 -0
  168. package/skills/yui-worker/SKILL.md +19 -6
  169. package/dist/execution/candidateConvergence.js +0 -623
  170. package/dist/execution/executionGroup.js +0 -854
  171. package/dist/execution/resourceBroker.js +0 -426
  172. package/dist/executor/launchPlan.js +0 -16
  173. package/dist/review/reviewFinding.js +0 -240
  174. package/dist/review/reviewFindingLedger.js +0 -550
  175. package/dist/review/reviewOutcomeClassifier.js +0 -255
  176. package/dist/scheduler/resourceQueueProjection.js +0 -71
  177. package/dist/task/repairWave.js +0 -150
package/README.md CHANGED
@@ -89,25 +89,26 @@ and `task integration start`, keep their subordinate IDs local to that Task.
89
89
  Candidate IDs are local to their WorkItem and carry both Task and WorkItem
90
90
  provenance.
91
91
 
92
- Yui records layout, aggregate, and per-record-family versions in `schema.json`,
93
- but runtime admission has only two outcomes: exact current, or rejected. A
94
- missing, older, newer, or malformed contract is never converted by the running
95
- release. `yui doctor` and `yui upgrade [--dry-run]` are read-only diagnostics;
96
- `yui upgrade` does not stage, repair, back up, or switch a Home.
92
+ Yui records layout, aggregate, and per-record-family versions in `schema.json`.
93
+ Runtime admission has only two outcomes: exact current, or rejected; a
94
+ Controller never migrates storage while serving work. `yui upgrade --dry-run`
95
+ is read-only, while `yui upgrade` validates only the release's exact current
96
+ contract. Older, newer, incomplete, and malformed Homes fail closed.
97
97
 
98
98
  `yui update` stages and pins one exact package, runs that staged binary's
99
- current-contract preflight, stops the exact old Controller, activates the same
100
- artifact, verifies the installed binary and current Home, and starts the
101
- replacement Controller. Storage is not copied or migrated. If the staged
102
- release cannot open the Home exactly, the update stops before activation and
103
- leaves both the Home and current installation unchanged.
99
+ storage preflight, stops the exact old Controller, activates the same artifact,
100
+ verifies the installed binary and current Home, and starts the replacement
101
+ Controller. If the staged binary does not support the current Home exactly,
102
+ the update stops before activation and leaves both the Home and current
103
+ installation unchanged.
104
104
 
105
105
  To retain an old Home, keep it byte-for-byte and open it only with its original
106
106
  Yui version for read-only inspection. For unfinished work, initialize a new
107
107
  Home and let the Operator create a new Task from the old Task's objective,
108
- relevant WorkItems, current repository state, and available result summaries.
109
- The Operator creates new identities; it does not import old runtime/session
110
- state or pretend that the old Task continued.
108
+ relevant WorkItems, current repository state, and available exact Turn results.
109
+ The Operator creates new identities and may consult available exact Turn
110
+ results; it does not import old runtime/session state or pretend that the old
111
+ Task continued.
111
112
 
112
113
  See [Task-local identity](docs/task-local-identity.md) for the current reference
113
114
  contract.
@@ -122,18 +123,52 @@ re-running the isolated E2E and docs. This is a deliberate scheduling trade-off
122
123
  that avoids cross-Task blocking, not an accident to repair ad hoc. The
123
124
  current manifest descriptor map is re-derived against the newest head, while the
124
125
  post-baseline descriptor snapshot remains frozen. If another Task later lands a
125
- record-schema change, the integrating branch must supply the complete adjacent
126
- path (including an explicit `0->1` introduction for a new family) and re-test to
127
- convergence.
126
+ record-schema change, the integrating branch must rebase, allocate the next
127
+ current contract without collision, and re-test to convergence. It does not
128
+ preserve an upgrade path for the displaced intermediate contract.
128
129
 
129
130
  Yui provides four reusable Worker Profile definitions through
130
- `yui config profile reset`; minimum setup leaves them unconfigured:
131
+ `yui config profile reset`; minimum setup makes each one inherit the current
132
+ Global Worker runtime:
131
133
 
132
134
  ```text
133
135
  worker explorer implementer reviewer
134
136
  ```
135
137
 
136
- Profiles are versioned, provider-neutral Worker behavior templates. They hold portable prompt instructions, Skills, access expectations, and optional model and effort selections, but do not bind an Agent or own a Session or workspace. A Task Role is the Task-bound Worker instance: applying a Yui Agent Profile copies the behavior plus model/effort into that Role's active Agent binding; explicit Role options may override the copied values. This is separate from a Codex native config profile selected with `--profile`.
138
+ Profiles are versioned Worker templates with two independent parts: portable
139
+ behavior (prompt instructions, Skills, and access intent) and runtime intent.
140
+ Runtime either follows the current Global Worker binding dynamically, or names
141
+ one explicit Agent with optional model and effort. `profile list` and `profile
142
+ show` resolve the effective Agent from current configuration and display the
143
+ Global Worker launch revision when inherited; that read does not rewrite or
144
+ revise the Profile. Profiles do not own Sessions or workspaces.
145
+ When an explicit Profile's Agent has a Global Worker binding, active or
146
+ dormant, its other binding settings come from that binding; an unbound Agent
147
+ uses provider defaults. A Worker binding referenced this way cannot be unbound
148
+ until the Profile is updated, changed to inheritance, or removed. The Profile
149
+ still owns model and effort, and omitting either means the provider default
150
+ rather than the Worker's value.
151
+
152
+ Creating a Task Role from a Profile freezes the Profile behavior and its fully
153
+ resolved runtime binding into the Role. Later Profile or Global Worker changes
154
+ do not rewrite existing Task Roles. On `task role add`, model, effort, and
155
+ other Agent settings require `--agent` so Yui can validate and persist one
156
+ complete explicit binding atomically. When `--profile` and `--agent` are both
157
+ present during creation, the Agent must match the Profile's resolved Agent;
158
+ the Profile runtime remains the base binding and explicit Agent settings
159
+ override corresponding fields. On `task role update`, omitted `--agent`
160
+ updates the active binding, while a provided `--agent` updates that binding
161
+ without activating it; only `task role bind` switches the active Agent. An
162
+ explicit Profile must resolve to that update target, where its runtime is the
163
+ base binding and explicit Agent settings override corresponding fields. An
164
+ inherited Worker Profile used by itself may update portable Role behavior
165
+ without retargeting a differently bound Agent; if `--agent` or Agent settings
166
+ are also present, its currently resolved Worker Agent must match the target.
167
+ Applying a Profile replaces the portable fields owned by AgentProfile
168
+ (`defaultAccess`, description, instructions, skills, and access-derived
169
+ constraints); explicit Role options in the same command apply afterward.
170
+ This Yui Agent Profile is separate from a Codex native config profile also
171
+ named `--profile`.
137
172
 
138
173
  ## Quick start
139
174
 
@@ -150,6 +185,10 @@ yui task create "Fix CSV escaping" --project app --type bugfix
150
185
  yui task create "Ship CSV export" --project app --type feature
151
186
  yui task update <task-id> --priority high --tags release,csv --due-at 2026-08-01T00:00:00Z
152
187
  yui task update <task-id> --clear-priority --clear-tags --clear-due-at
188
+ yui task message update <task-id>/<message-id> --body-file updated-message.md --wake-policy none
189
+ yui task work edit <task-id>/<work-item-id> --objective "Revised outcome" \
190
+ --accept "New observable criterion"
191
+ yui task work retire <task-id>/<work-item-id> --summary "Removed from the current Draft"
153
192
  yui task show <task-id>
154
193
  yui task context <task-id>
155
194
  yui task activate <task-id>
@@ -160,6 +199,15 @@ writable managed Workspace. `task activate` prepares every bound Project first,
160
199
  then commits the Task's `active` status and Task-owned Workspace together. A
161
200
  preparation or consistency failure leaves the Task Draft and reports the
162
201
  workspace diagnosis instead of exposing a partially adopted execution root.
202
+ Draft Message and WorkItem edits replace only the named mutable fields while
203
+ preserving record identity and audit history. Repeated options replace the
204
+ whole collection; matching `--clear-*` flags make an empty collection explicit.
205
+ Retired records remain visible in history but leave the current Draft. A
206
+ retired WorkItem never satisfies a dependency and does not redirect downstream
207
+ dependencies through its optional replacement; fix the remaining Draft before
208
+ activation. These Draft-only mutations do not create, stop, or clean runtime
209
+ resources, and activation validates the current dependency graph, Roles, and
210
+ Project scope before any Workspace is adopted.
163
211
 
164
212
  Task type describes intent rather than selecting an execution protocol.
165
213
  Software Projects use `bugfix` or `feature`: a bugfix is Leader-owned; if it
@@ -169,10 +217,10 @@ small enough to deliver on Task main or large enough for independently owned Wor
169
217
  one substantial requirement for one Worker, not a development step, test run,
170
218
  review finding, or local fix. Multiple WorkItems are useful only when distinct
171
219
  Workers can advance meaningful requirements independently. A WorkItem's
172
- governing Candidate defines its delivery obligation: its current ChangeSets
173
- must reach committed Integration or an explicit superseded queue disposition
174
- before Task-final Review or completion. Older Candidate and ChangeSet records
175
- remain audit evidence without keeping the Task open.
220
+ governing Candidate defines its delivery obligation: each writable Project's
221
+ exact start and result commits must be represented by a committed Integration
222
+ before Task-final Review or completion. Older Candidate, ChangeSet, and queue
223
+ records remain audit evidence without keeping the Task open.
176
224
 
177
225
  `project refresh` is the explicit network operation for a stable Project checkout. It fetches the
178
226
  configured stable branch directly from the Project remote URL and advances only through a clean,
@@ -294,9 +342,34 @@ to route evidence to the original Worker, accept, reject and redispatch that
294
342
  Worker in its existing Session, review again, or request user input.
295
343
  A failed review remains visible evidence and wakes the Leader, but does not
296
344
  take that decision away from the Leader.
297
- Task context and next-action expose direct Review facts: every frozen Project
298
- commit, its relation to the current candidate, the active Turn, and the Reviewer
299
- workspace. A request that fails after Round creation retains the ReviewRound
345
+
346
+ An explicit WorkItem Candidate or Task-final Review is direct unless the
347
+ Leader names Producer Roles. Policy-triggered WorkItem Review remains direct
348
+ by default:
349
+
350
+ ```sh
351
+ yui task work review <task-id>/<work-item-id>
352
+ yui task work review <task-id>/<work-item-id> \
353
+ --lane-role security-reviewer --lane-role correctness-reviewer
354
+
355
+ yui task review request <task-id> --role reviewer
356
+ yui task review request <task-id> --role reviewer \
357
+ --lane-role security-reviewer --lane-role correctness-reviewer
358
+ ```
359
+
360
+ Direct Review creates one main Reviewer Turn with no ExecutionGroup or Lane.
361
+ Replicated Review requires at least two distinct Producer Roles, all inspecting
362
+ the identical frozen Assignment in isolated Lane workspaces. Yui waits for
363
+ every Lane to settle and requires at least two successful Producer results
364
+ before creating one idempotent main Reviewer synthesis Turn. Successful
365
+ Producers are never rerun during Lane or main retry. Producer output is durable
366
+ non-authoritative evidence; only the exact completed main Reviewer Turn
367
+ completes the Round. The Leader reads that Turn's original result and decides
368
+ what it means.
369
+
370
+ Task context and next-action expose the Review shape, every frozen Project
371
+ commit, its relation to the current candidate, Producer and main Turns, and
372
+ their owned workspaces. A request that fails after Round creation retains the ReviewRound
300
373
  and reports its exact reason; the Leader opens that Round and decides whether
301
374
  to retry, inspect or clean the workspace, use another Reviewer, or continue
302
375
  other work.
@@ -399,19 +472,18 @@ yui task work isolate <task-id>/<work-item-id>
399
472
  yui task work reject <task-id>/<work-item-id> \
400
473
  --summary "Write scope expanded; continue in the refreshed workspace."
401
474
  yui task work dispatch <task-id>/<work-item-id>
402
- yui task work capture <task-id>/<work-item-id>
403
- yui task integration start <task-id> --project backend \
404
- --change-set <backend-change-set-id> --check "<validation command>"
475
+ yui task integration start <task-id> --work-item <work-item-id> \
476
+ --project backend --strategy cherry-pick --check "<validation command>"
405
477
  yui task integration cleanup <task-id>/<integration-id>
406
478
  yui task work cleanup <task-id>/<work-item-id> --integrated
407
479
  ```
408
480
 
409
- `capture` records one immutable ChangeSet per modified Project. Repeat capture
410
- at the same HEAD reuses the record; a repaired HEAD produces a new candidate.
411
- Integration remains a single-Project Git transaction, so the Leader integrates
412
- each Project independently. Acceptance succeeds only after every modified
413
- Project's latest candidate is integrated. Yui refuses integrated cleanup while
414
- any result remains unintegrated. Use `--abandon` only for deliberate discard.
481
+ The WorkItem Candidate records its exact start and result commits. Integration
482
+ remains a single-Project Git transaction, so the Leader integrates each Project
483
+ independently and chooses fast-forward, cherry-pick, merge, or manual
484
+ application. Acceptance succeeds only after every writable Project result has
485
+ a committed Integration, including an explicit successful no-op when the
486
+ result is already represented. Use `--abandon` only for deliberate discard.
415
487
  Dirty worktrees are retained. Native Agent Sessions may be scoped to their
416
488
  launch directory, so Yui retires a stopped Role Session whenever the Role moves
417
489
  between Task main and an isolated WorkItem worktree. The next dispatch starts a
@@ -460,11 +532,12 @@ resumes the newest entry directly. Starting a conversation is never a resume
460
532
  choice: the explicit `operator new` command starts a clean conversation and
461
533
  preserves the previous one in history.
462
534
 
463
- Create a Task-bound Worker instance from the configured global Worker, apply a
464
- Profile, and dispatch a WorkItem:
535
+ Create a Task-bound Worker instance from a Profile's resolved runtime and
536
+ dispatch a WorkItem:
465
537
 
466
538
  ```sh
467
539
  yui config role show worker
540
+ yui config profile show implementer
468
541
  yui task role add <task-id> implementer --profile implementer
469
542
  yui task role show <task-id> implementer
470
543
 
@@ -474,62 +547,35 @@ yui task work isolate <task-id>/<work-item-id>
474
547
  yui task work dispatch <task-id>/<work-item-id> --input "Implement and run focused tests"
475
548
  ```
476
549
 
477
- Dispatch remains `single` by default. A Leader can explicitly enable bounded
478
- multi-route exploration on a fresh WorkItem; each accepted stage advances
479
- `Plan Generate Compare Synthesize Verify Resolve`, and only the
480
- accepted Resolve stage materializes the existing single Candidate:
550
+ Without `--lane-role`, the assignee performs the WorkItem directly in its main
551
+ workspace. To request independent production attempts over exactly the same
552
+ frozen Assignment, provide at least two distinct Task Roles; one role is
553
+ rejected, roles cannot repeat, and the assignee cannot be a Lane:
481
554
 
482
555
  ```sh
483
556
  yui task work dispatch <task-id>/<work-item-id> \
484
- --mode parallel-diverse --max-rounds 2 --stage-max-attempts 2 \
485
- --strategy fixed:2 --lane-role critic \
486
- --stage-max-tokens 240000 --stage-max-tool-calls 200 \
487
- --stage-max-seconds 1800 --stage-quorum 2
488
- yui task work group resolve <task-id>/<work-item-id> \
489
- --decision accept --summary "Plan evidence is sufficient"
557
+ --input "Implement and run focused tests" \
558
+ --lane-role producer-a --lane-role producer-b
490
559
  ```
491
560
 
492
- Every stage is a new immutable ExecutionGroup. Its ContextSnapshot and selected
493
- parent Lane results are durable references; `retry` repeats a stage within its
494
- attempt budget, while `retry` at Resolve begins the next bounded round.
495
-
496
- Each new stage also freezes one Resource Broker contract: behavioral tool-call
497
- and wall-clock budgets; a display-only token threshold; quorum and deadline; a
498
- straggler window; and the minimum marginal value for more Lane spend. Omitted
499
- values reuse the existing context budget and runtime-health windows; stage
500
- retries share the original cumulative observations and absolute deadline.
501
- Observed token totals and the configured token threshold are cost context only:
502
- they never close spend, block admission, suppress scheduling, or stop a Lane.
503
- Execution, Lane retry, and Reviewer-panel
504
- admission all count active Lanes at Home, Task, WorkItem, Group, Provider,
505
- Agent, and model scopes. Capacity pressure keeps the excess Lane durably
506
- pending instead of failing the Group. Capacity release or deadline arrival
507
- wakes the Leader through the existing actionability path; rerunning the same
508
- dispatch resumes the frozen input. Released capacity is reserved for the
509
- oldest currently admissible waiter, while a Provider- or Agent-blocked queue
510
- head does not prevent independent scopes from making progress. Provider rate
511
- limits still use the existing in-place retry window and therefore never fan
512
- out into sibling failures.
513
-
514
- The Leader may add `--early-stop <0-100>` to an accepting Group resolution.
515
- Yui permits it only after quorum and T5's passed Verify/Resolve evidence prove
516
- sufficiency. It may skip Lanes that never started; active stragglers are
517
- reported and retained, never killed automatically for cost. If evidence is
518
- insufficient, behavioral tool-call/wall-clock budget or deadline exhaustion
519
- blocks the stage for Leader judgment instead of turning thin evidence into
520
- success.
521
-
522
- New exploration histories also freeze the structured candidate-convergence
523
- contract. Yui appends the exact stage-local JSON shape to every Lane assignment
524
- and validates selected reports before the Leader can advance: Compare must
525
- partition duplicate clusters and justify each selected route with a direct
526
- source, executable check, or frozen artifact; Synthesize uses a claim/evidence
527
- table for research, a decision matrix for architecture, and one frozen Git
528
- snapshot for code. Verify must use a Role independent from the selected
529
- Synthesize author. Only complete criterion evidence can produce `passed` and
530
- an accepted Resolve Candidate; explicit gaps produce `next-round` and can only
531
- continue through bounded Resolve `retry`. Votes and derived analysis remain
532
- reportable context, but never substitute for direct evidence.
561
+ Each Lane is a recoverable logical slot. A successful Lane points to its
562
+ immutable Producer Turn result; a failed Turn leaves the Lane open and visible
563
+ as `needs-attention`. The Leader retries or explicitly settles that exact Turn:
564
+
565
+ ```sh
566
+ yui task turn retry <task-id>/<failed-turn-id>
567
+ yui task turn settle <task-id>/<failed-turn-id>
568
+ ```
569
+
570
+ Yui waits until every Lane is settled. At least two successful Producer results
571
+ create one idempotent main Turn for the WorkItem assignee; fewer results fail
572
+ the WorkItem attempt without falling back to a single result. A main Turn retry
573
+ keeps the same source Group and never reruns successful Lanes. Only a successful
574
+ main Turn can become the Candidate used by Review and Integration. `task work
575
+ show`, `task work list`, Task context, and the Web control room derive execution
576
+ shape, recovery targets, synthesis eligibility, main Turn, Candidate provenance,
577
+ next action, and owner from the same persisted facts. Missing facts stay
578
+ `unknown` or `unobserved`; token, duration, and tool-call totals are display-only.
533
579
 
534
580
  Permission is one adapter-specific enum configuration on each Agent binding:
535
581
  `default` follows the provider, `bypass` compiles the provider's supported
@@ -539,16 +585,16 @@ set. Codex options are `sandbox` and `approval`; Claude options are `mode`,
539
585
  Profile behavior and Project write authority: only an exact WorkItem scope and
540
586
  matching managed workspace grant normal Project writes. A ReviewRound is the only non-WorkItem write
541
587
  purpose and must match its Turn, reviewRoundId, frozen base, and
542
- ReviewRound-owned workspace; every mismatch fails closed. Its diagnostic commit
588
+ ReviewRound-owned main workspace or exact isolated Producer Lane workspace;
589
+ every mismatch fails closed. Its diagnostic commit
543
590
  is visible history but is
544
591
  explicitly rejected by capture, ChangeSet, Integration, and acceptance paths.
545
592
  The Reviewer's final Provider response is its complete free-form Markdown or
546
- JSON report. If a JSON report
547
- includes known `checks` or `evidenceCommit` fields, Yui records them as
548
- structured evidence and verifies the reported commit against the managed
549
- Review branch HEAD; unknown fields remain part of the report. Dirty uncommitted
550
- diagnosis may end without a commit; the worktree is retained and cleanup
551
- refuses it until it is clean.
593
+ JSON result. Yui stores that text unchanged and does not parse headings, field
594
+ names, checks, severities, findings, or verdicts. Core-owned workspace and Git
595
+ evidence remains separate from Agent prose. Dirty uncommitted diagnosis may end
596
+ without a commit; the worktree is retained and cleanup refuses it until it is
597
+ clean.
552
598
 
553
599
  Every Role desired launch change increments its revision and applies only to a
554
600
  future launch. Each Turn and native Role Session stores the complete actual
@@ -614,7 +660,8 @@ still matches:
614
660
 
615
661
  ```sh
616
662
  yui task integration start <task-id> \
617
- --change-set <change-set-id> \
663
+ --work-item <work-item-id> \
664
+ --strategy cherry-pick \
618
665
  --check "npm test"
619
666
  ```
620
667
 
@@ -694,6 +741,78 @@ yui task context <task-id>
694
741
 
695
742
  Use the narrower `task work`, `task message`, `task turn`, and Task Knowledge commands when you need one collection or record.
696
743
 
744
+ Record a Task's confirmed PR/MR delivery state with one idempotent command:
745
+
746
+ ```sh
747
+ yui task publication upsert <task-id> --project <project> \
748
+ --provider github --repository <owner/name> --kind pull-request --id <number> \
749
+ --url <url> --state open --reported
750
+ ```
751
+
752
+ The required provider/repository/external ID selects the current Publication.
753
+ The first upsert creates it. Later upserts inherit omitted metadata and omitted
754
+ merge evidence only while the full evidence context remains unchanged. That
755
+ context is the local commit, PR/MR state, remote commit, evidence text, and
756
+ merge time. If any explicitly supplied context value differs, omitted
757
+ verification resets to `reported` and omitted merge-evidence fields are
758
+ cleared; changing the local commit without an explicit state also resets the
759
+ Publication to `open`. Resupplying identical values remains idempotent. Each
760
+ semantic change appends a new immutable record linked to the previous version,
761
+ while identical input creates no event. `list`, `show`, and `task context`
762
+ retain the complete history. This records facts already known to the caller;
763
+ it does not query a provider or replace Review, Integration, or Task completion
764
+ gates.
765
+
766
+ Verify one current GitHub or GitLab Publication against the real PR/MR state:
767
+
768
+ ```sh
769
+ yui task publication verify <task-id>/<publication-id>
770
+ ```
771
+
772
+ Verification is an explicit external read. GitHub uses a trusted, PATH-pinned
773
+ local `gh` executable; GitLab uses a trusted, PATH-pinned local `glab`
774
+ executable. Both reuse the CLI's existing authentication, and Yui stores no
775
+ provider token. The command requires the current unsuperseded Publication to
776
+ record the exact Task delivery head, then requires the provider to report the
777
+ same PR/MR head as merged and expose the integrated remote commit. It rechecks
778
+ the Task head and Publication after the remote call before appending a new
779
+ immutable `verified` record. Missing provider CLIs, unavailable
780
+ authentication, ambiguous provider output, open/closed PRs or MRs, moved
781
+ heads, and concurrent local changes fail without recording verification.
782
+ GitLab repositories may use nested namespaces; a recorded self-hosted MR URL
783
+ selects that GitLab host.
784
+
785
+ Query whether every delivered Project head is represented by a current merged
786
+ Publication:
787
+
788
+ ```sh
789
+ yui task remote-delivery <task-id>
790
+ yui task remote-delivery <task-id> --json
791
+ ```
792
+
793
+ This is a read-only derived projection, not a Task status or writable `merged`
794
+ flag. Active and reopened Tasks use the current clean Task-main heads and mark
795
+ them provisional; completed and archived Tasks use the latest frozen
796
+ `task.completed` heads. For each Project, Yui reports the expected local
797
+ commit, the matching current unsuperseded Publication, PR/MR state,
798
+ verification, and remote commit. Aggregate coverage is `none`, `unavailable`,
799
+ `pending`, `partial`, or `merged`, with independent `allMerged` and
800
+ `allVerified` values.
801
+ Only a current Publication whose `localCommit` exactly matches the expected
802
+ head and whose state is `merged` contributes merged coverage. Missing commits,
803
+ open/closed records, stale heads, and superseded Publications never imply
804
+ remote delivery. Projects whose Task head equals their managed base need no
805
+ Publication. `task show`, `task context`, `task next-action`, and the Web detail
806
+ projection use this same selector.
807
+ `Archive --integrated coverage` requires both `allMerged=true` and
808
+ `allVerified=true`.
809
+
810
+ When a valid older completed Task has no frozen completion heads, Yui reports
811
+ `unavailable` and keeps integrated archive fail-closed. Reopen and complete the
812
+ Task again to record exact heads, then retry archive. Yui does not guess the
813
+ missing head from a Publication or worktree, and `--force` never overrides
814
+ missing head evidence.
815
+
697
816
  When the requested outcome is finished, complete the Task to stop automatic Leader wakes without deleting its sessions or Task main worktree:
698
817
 
699
818
  ```sh
@@ -733,9 +852,17 @@ worktrees are non-blocking completion advisories, but they must be settled
733
852
  before archive. Every isolated WorkItem worktree is explicitly cleaned as
734
853
  integrated or abandoned; that cleanup also removes its managed branch. Archive
735
854
  requires `--integrated` or `--abandon` to state the Task main outcome and is
736
- allowed only after Task main is clean. It removes managed worktrees but retains
737
- Task and WorkItem records. The Task main branch is retained as a recovery
738
- artifact instead of being silently deleted.
855
+ allowed only after Task main is clean. `--integrated` additionally requires
856
+ remote-delivery `allMerged=true` and `allVerified=true`; Task completion or a
857
+ reported merge alone is never treated as verified remote delivery. When every
858
+ exact Task head is merged but one or more Publications remain `reported`, the
859
+ command identifies those Publications and refuses archive. An explicitly
860
+ authorized `task archive <task-id> --integrated --force` may override only that
861
+ verification gap and records the override in the archive event; it never
862
+ bypasses missing, stale, open, or closed merge evidence. An intentional
863
+ non-merge uses the existing explicit `--abandon` path. Archive removes managed
864
+ worktrees but retains Task and WorkItem records. The Task main branch is
865
+ retained as a recovery artifact instead of being silently deleted.
739
866
  Task lifecycle completion/selection only suggests valid source states: Draft for activate, active for complete, and completed for reopen.
740
867
 
741
868
  ## Sessions and tmux
@@ -790,10 +917,10 @@ Global Context entry:
790
917
  yui session enter <global-role>
791
918
  ```
792
919
 
793
- `yui update` accepts only the current Home contract and never migrates storage.
794
- For an older Home, keep its Sessions stopped, inspect it with the original Yui
795
- version, and let the current Operator recreate unfinished intent as new Tasks in
796
- a newly initialized Home. Runtime ids and mailbox state are not copied.
920
+ `yui update` accepts only the current Home contract. Unsupported older Homes
921
+ remain untouched; inspect those with a compatible Yui version and let the
922
+ current Operator recreate unfinished intent as new Tasks in a newly initialized
923
+ Home.
797
924
 
798
925
  tmux fixes a pane's history capacity when that pane is created. Existing panes
799
926
  retain their configured capacity; managed runtime output remains observable in
@@ -875,38 +1002,40 @@ hiding the resources that remain. Use `--all` to include discovered Yui homes.
875
1002
 
876
1003
  `controller restart` replaces the Controller process and its scheduler/socket services with the currently installed Yui version. It can recover a lost discovery record only when the old process still matches the current UID, Controller entrypoint, physical Home, PID, and process-start identity. It does not stop or restart managed tmux/Agent sessions.
877
1004
 
878
- Successful `setup`, `upgrade`, and `update` commands ensure that the current
879
- Home has a running Controller, starting one when the Home was previously idle.
880
- Read-only commands and `upgrade --dry-run` do not start a Controller. `update`
881
- also replaces an already-running Controller only after the new binary passes its
882
- health checks.
1005
+ Successful `setup` and `update` commands ensure that the current Home has a
1006
+ running Controller, starting one when the Home was previously idle. `upgrade`
1007
+ is read-only and does not start a Controller. `update` replaces an
1008
+ already-running Controller only after the new binary passes its health checks.
883
1009
 
884
1010
  Its recovery reconciliation runs every 120 seconds by default. Normal durable state changes enqueue a Task, Role, or Operator key and return immediately; keys received in the same fixed 100 ms window trigger one non-overlapping targeted pass. Operator presentation has an independent lane, so a blocked Task workspace operation cannot delay a user question. Periodic Git/worktree work is limited to Tasks with durable Task-mailbox work, while active Role liveness uses one tmux inventory. Structured Agent Driver observations, whether received from native provider events or supported Hooks, are exact-fenced before they reach the durable runtime inbox. A terminal Turn observation atomically records the exact Turn result. Durable mailboxes freeze the current batch while new signals merge into the next batch. Task-orchestration failures retain the exact Controller-owned processing batch for two bounded fast retries and later periodic recovery; a successful retry completes that batch before newer pending work is claimed. Recommended InputRequest and pending Turn deadlines share one nearest-deadline selector and therefore do not wait for the recovery interval. Explicit `task reconcile` still requests an immediate recovery pass. The retained loop is:
885
1011
 
886
1012
  1. dispatch pending Leader wakes whose Task workspaces are already ready;
887
1013
  2. prepare active Project Task main worktrees with durable orchestration work;
888
- 3. deliver queued Worker Turns;
1014
+ 3. deliver active Role Turns from durable active-Turn state, using ordinary
1015
+ Role mailboxes only as optional delivery hints;
889
1016
  4. resolve due Turn completions and reconcile Role liveness;
890
1017
  5. dispatch Leader work created or unblocked by the later recovery phases.
891
1018
 
892
1019
  Automated input is sent only through tmux. Each pass performs one non-blocking process-state readiness check; a busy startup is retried through a small bounded mailbox timer, while later busy sessions are woken by canonical Agent Driver terminal observations. A pane-local receipt prevents the same Turn input from being typed twice after a Controller retry.
893
1020
 
894
- If a Role process exits without a terminal Provider result, the Controller fails that Turn and running WorkItem and queues the Leader. Recovery failures are exposed through the small Jobs view:
1021
+ If a Role process exits without a terminal Provider result, the Controller fails that Turn and queues the Leader. A replicated WorkItem or Review Producer Lane remains open for exact retry or explicit settlement; completed sibling results remain reusable. Recovery failures are exposed through the small Jobs view:
895
1022
 
896
1023
  ```sh
897
1024
  yui jobs list
898
1025
  yui jobs retry leader-recovery:<task-id>
899
1026
  yui task reconcile <task-id>
900
1027
  yui task turn retry <failed-turn-id>
901
- yui task turn settle <obsolete-failed-review-turn-id>
1028
+ yui task turn settle <failed-turn-id>
902
1029
  ```
903
1030
 
904
1031
  `jobs` is not a restored generic queue: it presents durable pending Leader wakes and Leader recovery failures only.
905
1032
 
906
- `task turn settle` is a Leader-only repair for one exact failed Reviewer Turn whose
907
- matching Task-final ReviewRound was stranded running by an older lifecycle. It
908
- closes only an obsolete frozen candidate, preserves the Turn, Round, workspace,
909
- and evidence, and never creates a retry Round.
1033
+ `task turn settle` records that the Leader will no longer recover the exact
1034
+ current failed Producer Lane Turn. Only then does the Lane become failed and the
1035
+ settled Group become eligible for WorkItem or Review synthesis when at least
1036
+ two Producer results succeeded. The same command retains its narrow repair for an obsolete failed
1037
+ Reviewer Turn whose Task-final ReviewRound is stranded on an old frozen
1038
+ candidate; that repair never creates a retry Round.
910
1039
 
911
1040
  Completion is the reversible execution fence. Archiving is terminal and is accepted only after active work is settled: it stops the Task's tmux session and removes clean managed worktrees. Dirty worktrees keep the Task completed and are preserved for deliberate resolution.
912
1041
 
@@ -945,7 +1074,8 @@ with an execution band that consolidates the Task's owner, current action,
945
1074
  attention list, blockers, and fail-closed indicators; Work items surface
946
1075
  their current ExecutionGroup with per-lane status, Candidates, and
947
1076
  retirement disposition; Turns show purpose, execution lineage, final result,
948
- and Leader disposition.
1077
+ and Leader disposition; Reviews show direct or replicated shape, frozen
1078
+ Assignment, Producer Lane state, main synthesis Turn, and authoritative result.
949
1079
 
950
1080
  The control room supports English and Simplified Chinese, selecting an initial locale from the browser and remembering manual changes. The theme selector switches between the dark Control Room, the light Paper Ledger, and the dark-blue Atlas themes. Both choices are stored only in browser `localStorage`; they do not modify `YUI_HOME`.
951
1081
 
@@ -967,15 +1097,15 @@ yui project reset|replace|retire|delete
967
1097
  ```
968
1098
 
969
1099
  `yui update` stages the newly published package side by side and asks that exact
970
- binary to verify that the Home already matches its current storage contract.
971
- Only then does it stop the exact old Controller, activate the same concrete
972
- package version, validate the actually installed binary and Home, and start the
973
- replacement Controller. It never migrates or switches storage. An older or
974
- otherwise unsupported Home blocks preflight and remains untouched.
1100
+ binary to verify the current Home. Only then does it stop the exact old
1101
+ Controller, activate the same concrete package version, validate the actually
1102
+ installed binary and Home, and start the replacement Controller. Unsupported
1103
+ Homes block preflight and remain untouched.
975
1104
 
976
- `yui upgrade [--dry-run]` is retained as a read-only storage admission
977
- diagnostic. It reports current, uninitialized, invalid, or unsupported state and
978
- the Operator action; it never performs an upgrade.
1105
+ `yui upgrade --dry-run` validates an exact current Home without writing.
1106
+ `yui upgrade` performs the same validation. This release provides no migration
1107
+ from older aggregate contracts; use their matching Yui version or initialize a
1108
+ new Home.
979
1109
 
980
1110
  Agent environment bindings store process-environment variable names, never secret values. Adapter-owned lifecycle arguments cannot be overridden through raw arguments.
981
1111
 
@@ -996,7 +1126,7 @@ npm test
996
1126
  ```
997
1127
 
998
1128
  The permanent suite is intentionally one seconds-scale core smoke. It checks
999
- CLI startup, a normal SQLite Task path, the supported migration graph, and the
1129
+ CLI startup, a normal SQLite Task path, exact-current storage admission, and the
1000
1130
  built-in Agent Drivers. Change-specific TDD fixtures and abnormal-data repros
1001
1131
  are temporary development evidence and are removed when the change is complete;
1002
1132
  they do not accumulate as permanent regression tests. See
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Environment values owned by Yui's managed runtime.
3
3
  *
4
- * These values carry control-plane, Task, workspace, launch, or exact-action
5
- * identity. They are never user Agent environment bindings, and an ordinary
6
- * repository test must not inherit them from the managed Session that launched
7
- * the test command.
4
+ * These values carry control-plane, Task, workspace, or runtime generation identity. They
5
+ * are never user Agent environment bindings, and an ordinary repository test
6
+ * must not inherit them from the managed Session that launched the test
7
+ * command.
8
8
  */
9
9
  export const YUI_MANAGED_RUNTIME_ENVIRONMENT_NAMES = Object.freeze([
10
10
  "YUI_CLI_NAME",
@@ -17,11 +17,10 @@ export const YUI_MANAGED_RUNTIME_ENVIRONMENT_NAMES = Object.freeze([
17
17
  "YUI_DRIVER_ID",
18
18
  "YUI_WORKSPACE",
19
19
  "YUI_TURN_ID",
20
- "YUI_LAUNCH_ID",
20
+ "YUI_RUNTIME_GENERATION_ID",
21
21
  "YUI_NATIVE_SESSION_ROOT",
22
22
  "YUI_NATIVE_SESSION_ID",
23
23
  "YUI_CONTROL_PLANE_DESCRIPTOR",
24
- "YUI_TASK_RUNTIME_DESCRIPTOR",
25
24
  "YUI_TASK_RUNTIME_ISOLATION_DESCRIPTOR",
26
25
  "YUI_TASK_RUNTIME_SERVICE_NAMESPACE",
27
26
  "YUI_SESSION_TITLE",
@@ -30,7 +29,5 @@ export const YUI_MANAGED_RUNTIME_ENVIRONMENT_NAMES = Object.freeze([
30
29
  "YUI_WRITABLE_PROJECT_IDS",
31
30
  "YUI_CONTEXT_PROJECT_IDS",
32
31
  "YUI_WORKSPACE_PROJECTS",
33
- "YUI_LEADER_ACTION_TURN_ID",
34
- "YUI_LEADER_ACTION_RECEIPT_ID",
35
32
  "YUI_JOB_CALLER_KEY"
36
33
  ]);