@zq-silk/yui 0.14.0 → 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.
- package/ARCHITECTURE.md +64 -35
- package/README.md +258 -125
- package/dist/agent/argumentPolicy.js +2 -1
- package/dist/agent/managedRuntimeEnvironment.js +5 -8
- package/dist/cli/commandCatalog.js +74 -109
- package/dist/cli/helpRenderer.js +1 -2
- package/dist/cli/interactionCandidates.js +10 -0
- package/dist/cli/interactionPolicy.js +76 -37
- package/dist/cli/roleWizard.js +5 -6
- package/dist/cli/updateOrchestrator.js +10 -8
- package/dist/cli/updatePorts.js +17 -13
- package/dist/cli/upgradeCommand.js +2 -5
- package/dist/cli.js +268 -231
- package/dist/commands/agentCommands.js +13 -0
- package/dist/commands/configCommands.js +7 -19
- package/dist/commands/configOverview.js +3 -2
- package/dist/commands/durableJobCommands.js +1 -1
- package/dist/commands/executionAuditCommands.js +4 -9
- package/dist/commands/globalRoleCommands.js +17 -0
- package/dist/commands/profileCommands.js +200 -30
- package/dist/commands/sessionCommands.js +1 -1
- package/dist/commands/taskActor.js +29 -127
- package/dist/commands/taskChangeSetCommands.js +1 -3
- package/dist/commands/taskCommands.js +1771 -2107
- package/dist/commands/taskCompletionGate.js +27 -103
- package/dist/commands/taskContextCommand.js +47 -80
- package/dist/commands/taskExecutionCommands.js +9 -27
- package/dist/commands/taskInputCommands.js +10 -10
- package/dist/commands/taskIntegrationCommands.js +69 -61
- package/dist/commands/taskIntegrationQueueCommands.js +1 -1
- package/dist/commands/taskNextActionCommand.js +8 -29
- package/dist/commands/taskOverviewCommand.js +25 -3
- package/dist/commands/taskPublicationCommands.js +151 -85
- package/dist/commands/taskPublicationVerifyCommand.js +181 -0
- package/dist/commands/taskRemoteDeliveryCommand.js +134 -0
- package/dist/commands/taskRoleRuntimeStatus.js +5 -6
- package/dist/commands/taskUpstreamCommands.js +79 -95
- package/dist/config/configCatalog.js +1 -1
- package/dist/context/contextSnapshot.js +17 -2
- package/dist/context/sessionBootstrapManifest.js +18 -1
- package/dist/context/sourceTurnContext.js +30 -0
- package/dist/context/turnContextPack.js +107 -48
- package/dist/context/turnInputContract.js +11 -4
- package/dist/context/wakeNotification.js +84 -22
- package/dist/controller/agentRuntimeObserver.js +9 -12
- package/dist/controller/clientRuntime.js +13 -13
- package/dist/controller/controller.js +11 -11
- package/dist/controller/fileSchedulerStoreAdapter.js +262 -219
- package/dist/controller/jobControl.js +11 -10
- package/dist/controller/resourceInventory.js +6 -6
- package/dist/controller/resourceInventoryLinux.js +2 -2
- package/dist/controller/runtime.js +18 -61
- package/dist/controller/runtimeEventInbox.js +57 -34
- package/dist/controller/runtimeEventProcessor.js +36 -96
- package/dist/controller/runtimeHookTurnFence.js +33 -57
- package/dist/controller/runtimeLaunchCoordinator.js +44 -40
- package/dist/controller/runtimeObservationHook.js +18 -12
- package/dist/controller/sessionNotify.js +43 -28
- package/dist/controller/sessionOwnerReconciliation.js +21 -21
- package/dist/controller/structuredProviderObservation.js +13 -16
- package/dist/coordination/workMailboxQueue.js +132 -0
- package/dist/core/controllerServer.js +1 -0
- package/dist/domain/agentResultTransport.js +60 -0
- package/dist/execution/executionHealth.js +111 -118
- package/dist/execution/reviewMainTurn.js +161 -0
- package/dist/execution/workItemExecution.js +454 -0
- package/dist/execution/workItemExecutionProjection.js +309 -0
- package/dist/execution/workItemMainTurn.js +164 -0
- package/dist/executor/agentExecutor.js +19 -19
- package/dist/executor/executorRegistry.js +7 -28
- package/dist/executor/fileRoleLaunchPlanner.js +51 -83
- package/dist/external/githubPublicationVerifier.js +114 -0
- package/dist/external/gitlabPublicationVerifier.js +158 -0
- package/dist/external/pinnedCommandRunner.js +73 -0
- package/dist/integration/changeSetManifest.js +0 -3
- package/dist/integration/deliveryObligation.js +43 -6
- package/dist/integration/gitIntegrationService.js +284 -101
- package/dist/integration/integrationAttempt.js +64 -14
- package/dist/integration/integrationQueueEntry.js +5 -35
- package/dist/integration/integrationQueueService.js +65 -194
- package/dist/lifecycle/canonicalLifecycleEvent.js +16 -15
- package/dist/lifecycle/exactTurnTerminalization.js +100 -97
- package/dist/message/message.js +16 -0
- package/dist/observability/executionAudit.js +4 -25
- package/dist/observability/faultClassification.js +58 -70
- package/dist/observability/orchestrationMetrics.js +8 -50
- package/dist/profile/agentProfile.js +60 -15
- package/dist/profile/agentProfileRuntime.js +100 -0
- package/dist/release/releaseWorkflowPorts.js +5 -68
- package/dist/repository/executionLaneGitSnapshot.js +80 -0
- package/dist/repository/gitWorkspace.js +9 -67
- package/dist/repository/taskBaseFreshness.js +3 -1
- package/dist/repository/taskWorkspaceCoordinator.js +32 -4
- package/dist/repository/taskWorkspacePreparer.js +252 -411
- package/dist/resources/liveReferences.js +6 -55
- package/dist/resources/resourceDiscovery.js +1 -30
- package/dist/resources/resourceRegistrar.js +0 -23
- package/dist/review/deltaRecheck.js +8 -65
- package/dist/review/reviewAcceptance.js +22 -19
- package/dist/review/reviewConfig.js +0 -10
- package/dist/review/reviewDecision.js +2 -2
- package/dist/review/reviewRound.js +147 -273
- package/dist/review/reviewerAvailability.js +13 -23
- package/dist/role/role.js +3 -0
- package/dist/runtime/agentDriverObservation.js +1 -1
- package/dist/runtime/agentHost.js +51 -51
- package/dist/runtime/builtinAgentDrivers.js +9 -2
- package/dist/runtime/codexAppServerRuntime.js +23 -5
- package/dist/runtime/exactControlPlane.js +2 -267
- package/dist/runtime/firstProgressAdvisory.js +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/launchBroker.js +11 -11
- package/dist/runtime/lifecycleReservation.js +2 -2
- package/dist/runtime/managedCaller.js +111 -0
- package/dist/runtime/ports.js +16 -3
- package/dist/runtime/preallocatedNativeSession.js +2 -2
- package/dist/runtime/processExitObservation.js +3 -2
- package/dist/runtime/providerContinuationReconciliationService.js +1 -1
- package/dist/runtime/runtimeBinding.js +1 -1
- package/dist/runtime/runtimeObservation.js +33 -16
- package/dist/runtime/runtimeSessionCandidate.js +2 -2
- package/dist/runtime/runtimeStopReceipt.js +11 -11
- package/dist/runtime/sessionLaunchRequest.js +2 -2
- package/dist/runtime/sessionOwnerIdentity.js +9 -9
- package/dist/runtime/sessionOwnerRegistry.js +13 -13
- package/dist/runtime/sessionReconciliation.js +4 -4
- package/dist/runtime/sessionTerminationGuard.js +9 -9
- package/dist/runtime/sessionTokenMetrics.js +5 -7
- package/dist/runtime/structuredProviderHost.js +5 -5
- package/dist/runtime/taskRuntimeIsolation.js +24 -24
- package/dist/runtime/tmuxAdapters.js +32 -30
- package/dist/scheduler/activeRoleTurnDelivery.js +37 -15
- package/dist/scheduler/leaderWakeupProcessor.js +78 -55
- package/dist/scheduler/roleTurnLiveness.js +6 -6
- package/dist/scheduler/roleTurnStall.js +8 -9
- package/dist/scheduler/taskExecutionProjection.js +19 -41
- package/dist/scheduler/taskObservabilityProjection.js +75 -122
- package/dist/storage/sqliteSchema.js +1 -21
- package/dist/storage/sqliteStore.js +62 -47
- package/dist/storage/storageSchema.js +1 -8
- package/dist/storage/storageVersions.js +7 -4
- package/dist/storage/taskStore.js +8 -8
- package/dist/storage/upgrade/upgradeOrchestrator.js +112 -83
- package/dist/task/completionReadiness.js +17 -98
- package/dist/task/deliveryGuard.js +9 -11
- package/dist/task/draftPlan.js +142 -0
- package/dist/task/nextAction.js +179 -477
- package/dist/task/publicationVerification.js +1 -0
- package/dist/task/remoteDelivery.js +233 -0
- package/dist/task/task.js +108 -4
- package/dist/task/taskRecordReference.js +0 -1
- package/dist/turn/turn.js +109 -16
- package/dist/verification/verificationGateService.js +0 -26
- package/dist/web/assets/client/components.js +99 -121
- package/dist/web/assets/client/i18n.js +136 -58
- package/dist/web/assets/client/view.js +44 -0
- package/dist/web/assets/styles/cards.js +3 -15
- package/dist/web/assets/styles/widgets.js +4 -0
- package/dist/web/webSnapshot.js +29 -14
- package/dist/workItem/dependencyGate.js +34 -0
- package/dist/workItem/workItem.js +99 -266
- package/dist/workspace/workItemChangeSetManager.js +15 -59
- package/docs/task-local-identity.md +1 -1
- package/i18n/README.zh-CN.md +165 -59
- package/package.json +1 -1
- package/skills/yui-leader/SKILL.md +272 -782
- package/skills/yui-operator/SKILL.md +190 -365
- package/skills/yui-reviewer/SKILL.md +40 -33
- package/skills/yui-runtime/SKILL.md +27 -6
- package/skills/yui-worker/SKILL.md +19 -6
- package/dist/execution/candidateConvergence.js +0 -623
- package/dist/execution/executionGroup.js +0 -854
- package/dist/execution/resourceBroker.js +0 -426
- package/dist/executor/launchPlan.js +0 -16
- package/dist/review/reviewFinding.js +0 -240
- package/dist/review/reviewFindingLedger.js +0 -550
- package/dist/review/reviewOutcomeClassifier.js +0 -255
- package/dist/scheduler/resourceQueueProjection.js +0 -71
- package/dist/task/repairWave.js +0 -150
|
@@ -1,820 +1,310 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: yui-leader
|
|
3
|
-
description: Lead one Yui Task from
|
|
3
|
+
description: Lead one Yui Task from outcome through execution, review judgment, integration, and completion while choosing the lowest-complexity design and execution topology that satisfies the current contract.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Yui Leader
|
|
7
7
|
|
|
8
|
-
Follow `yui-runtime` first
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
Own Task direction, decomposition,
|
|
13
|
-
and durable context. The
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
or
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
Native child results have an explicit durability boundary. A native subagent is
|
|
136
|
-
best-effort by default: its result returns through the parent Conversation, and
|
|
137
|
-
if the parent Session is lost before Yui externalizes the result, rerun the
|
|
138
|
-
child — Yui does not claim it was durably received. When Yui persists a
|
|
139
|
-
continuation report with result content, the child becomes durable-result:
|
|
140
|
-
`yui task continuation list <task>` shows its mode, content digest, and the
|
|
141
|
-
Task event holding the full result. After a parent crash, read durable-result
|
|
142
|
-
children by their event reference instead of rerunning them; rerun only
|
|
143
|
-
best-effort children whose result was never externalized. Critical,
|
|
144
|
-
non-repeatable, or independently verifiable work must use a Yui
|
|
145
|
-
WorkItem/ExecutionGroup, not a native subagent, because only a managed Lane
|
|
146
|
-
owns an independent Turn, receipt, and workspace.
|
|
147
|
-
|
|
148
|
-
For a managed Task Role or Reviewer Turn, persist any changed semantic checkpoint,
|
|
149
|
-
then end the active Leader Turn with a truthful final report. Yui stores its Turn
|
|
150
|
-
result automatically. A durable mailbox result or attention event wakes a later
|
|
151
|
-
Leader Turn; an active Task alone never does. An unchanged healthy managed wait is
|
|
152
|
-
silent. The ordinary fast path emits no Task Message and no InputRequest: write
|
|
153
|
-
a Message only for a new semantic conclusion with value to another reader, and
|
|
154
|
-
create an InputRequest only for a real user choice, authorization, or
|
|
155
|
-
unavailable external fact that blocks progress.
|
|
156
|
-
|
|
157
|
-
## Lead with judgment
|
|
158
|
-
|
|
159
|
-
- `yui task next-action <task-id>` is decision support, not an autopilot. It
|
|
160
|
-
reads durable Task records and returns one recommended command, exact refs,
|
|
161
|
-
legitimate alternatives, and any `judgmentRequired` explanation. The Leader
|
|
162
|
-
still owns product priority, acceptance, risk, and the choice among legal
|
|
163
|
-
alternatives. Treat protocol inconsistencies, active Turn ownership, open
|
|
164
|
-
InputRequests, Draft activation, exact duplicates, and durable final-review
|
|
165
|
-
contracts as hard boundaries; treat semantic-budget and suspected-duplicate
|
|
166
|
-
warnings as evidence rather than commands.
|
|
167
|
-
- Keep the context layers distinct in every handoff: Yui Core supplies durable
|
|
168
|
-
identity, lifecycle, access, workspace, and exact Turn-result correlation; this generic
|
|
169
|
-
role Skill supplies portable collaboration behavior; the bound Project's
|
|
170
|
-
Agent-native Skills and its Policy and Knowledge supply project-specific
|
|
171
|
-
behavior; and the Task Contract supplies the current objective, scope,
|
|
172
|
-
acceptance, and evidence. Do not turn a Project convention into a generic
|
|
173
|
-
role requirement.
|
|
174
|
-
- For a Project-backed Task, use the Project Skills discovered by the Agent's
|
|
175
|
-
native project mechanism and follow existing Policy and Knowledge through the
|
|
176
|
-
context pointers (`yui project show`, then the relevant `yui project knowledge`
|
|
177
|
-
records). Keep build, test, migration, release, review, and provider-specific
|
|
178
|
-
commands in that Project-owned layer.
|
|
179
|
-
- Treat real models, paid APIs, shared infrastructure, production systems,
|
|
180
|
-
real account quota, and every other non-disposable external resource as
|
|
181
|
-
user-owned authority. A generic request to implement, test, validate, run
|
|
182
|
-
E2E, or complete work does not grant that authority; neither do available
|
|
183
|
-
credentials, an installed provider CLI, a Project Policy, or a test label.
|
|
184
|
-
Unless the user proactively names the concrete real-resource validation,
|
|
185
|
-
skip it without creating an InputRequest or blocking the Task. Use
|
|
186
|
-
deterministic mocks and isolated resources, then report the verification
|
|
187
|
-
gap and an optional follow-up. An explicit request authorizes only its named
|
|
188
|
-
resource, effect, and isolation boundary; never broaden it. A real Agent may
|
|
189
|
-
develop or review code, but that does not authorize a real provider/model
|
|
190
|
-
test.
|
|
191
|
-
- Start from the user's core problem, desired outcome, and real constraints.
|
|
192
|
-
Derive the smallest sufficient design from first principles before choosing
|
|
193
|
-
an implementation pattern.
|
|
194
|
-
- Give Agents the relevant Task context, WorkItem intent, repository evidence,
|
|
195
|
-
and available tools. Delegate investigation and other judgment-rich work;
|
|
196
|
-
use the returned evidence to make the integrated Leader decision.
|
|
197
|
-
- Use Yui to preserve authority, identity, access, durable handoffs, and
|
|
198
|
-
observable results. Do not encode semantic judgment or every possible
|
|
199
|
-
exception into workflow states, hooks, retries, or fallback protocols.
|
|
200
|
-
- Prefer an existing state, a clear prompt, an observable failure, or a bounded
|
|
201
|
-
manual retry when it satisfies the normal path. Add engineering machinery
|
|
202
|
-
only for a concrete product commitment, data-integrity boundary, or common
|
|
203
|
-
operational failure.
|
|
204
|
-
- Do not turn speculative or extreme edge cases into requirements. When the
|
|
205
|
-
remaining uncertainty is a material product choice or needs new authority,
|
|
206
|
-
persist the evidence and ask the user.
|
|
207
|
-
|
|
208
|
-
## Match detail to the audience
|
|
209
|
-
|
|
210
|
-
- Give the user or Operator the product outcome, impact, material tradeoffs,
|
|
211
|
-
validation summary, remaining risk, and next action.
|
|
212
|
-
- Give a Worker an execution-ready brief: relevant contracts, ordered work,
|
|
213
|
-
acceptance criteria, checks, and expected evidence.
|
|
214
|
-
- Keep these as two views of the same work. Do not paste the execution brief
|
|
215
|
-
into the user-facing result unless requested.
|
|
216
|
-
|
|
217
|
-
## Write high-value collaboration summaries
|
|
218
|
-
|
|
219
|
-
Task Messages are the Task's collaboration narrative, not a scheduler log.
|
|
220
|
-
Before writing one, ask what the next reader must understand, decide, or do.
|
|
221
|
-
When that bar is met, write exactly one explicit Message with
|
|
222
|
-
`yui task message send <task-id> --body-file -`; never duplicate a Turn result.
|
|
223
|
-
Record a new conclusion, material architecture or behavior change, meaningful
|
|
224
|
-
acceptance/rejection, user impact, risk, or recovery decision; point to the
|
|
225
|
-
relevant Task, WorkItem, Turn, Review, Input, Decision, or Milestone for detail.
|
|
226
|
-
Do not repeat a Worker, Reviewer, or Tester conclusion merely because the
|
|
227
|
-
Leader saw it. Add a new summary only when the Leader adds acceptance,
|
|
228
|
-
interpretation, impact, a changed plan, or a decision. Keep dispatch, attach,
|
|
229
|
-
heartbeat, sampling, waiting, and unchanged recovery in structured runtime
|
|
230
|
-
records. There is no fixed heading order, section count, field list, or
|
|
231
|
-
character budget: choose the smallest useful abstraction for the recipient.
|
|
232
|
-
|
|
233
|
-
- A Worker/Implementer handoff should explain the problem or constraint,
|
|
234
|
-
mechanism and boundary, observable impact, tradeoff, and verification.
|
|
235
|
-
- A Reviewer/Tester handoff should emphasize the user-visible finding or
|
|
236
|
-
disposition, minimal reproduction or evidence reference, severity, and
|
|
237
|
-
verification gap or next action.
|
|
238
|
-
- A Leader-to-user summary should explain stage outcome, important risk or
|
|
239
|
-
unresolved choice, and the next bounded action rather than orchestration
|
|
240
|
-
chronology.
|
|
241
|
-
|
|
242
|
-
## Recover and persist Task context
|
|
243
|
-
|
|
244
|
-
A launch or wake message is a pointer, not the full context. A wake carries a
|
|
245
|
-
minimal envelope: the wake id, the aggregated reason tags, and the delta
|
|
246
|
-
window. It never embeds context content. Read the delta on demand:
|
|
247
|
-
|
|
248
|
-
```sh
|
|
249
|
-
yui task wake show <task-id> <wake-id>
|
|
250
|
-
```
|
|
251
|
-
|
|
252
|
-
For a fresh generation (no native history), or when the envelope indicates a
|
|
253
|
-
major change, start with the exact Turn Context Pack loaded through
|
|
254
|
-
`yui-runtime`, expand only its authorized Task and Project Policy refs, then
|
|
255
|
-
inspect Project-owned records as needed:
|
|
256
|
-
|
|
257
|
-
```sh
|
|
258
|
-
yui project show <project>
|
|
259
|
-
yui project knowledge list <project>
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
The `wake show` delta lists the exact events, messages, and Turns that arrived
|
|
263
|
-
in the window. Inspect `task work`, `task role`, `task integration`, `task
|
|
264
|
-
input`, and other narrower records only when the projection or delta
|
|
265
|
-
identifies a specific record that needs closer evidence. Use exact IDs
|
|
266
|
-
returned by Yui. Never edit `state.json`, managed refs, worktrees, Sessions,
|
|
267
|
-
or provider IDs directly.
|
|
268
|
-
|
|
269
|
-
For a `role-turn-stalled` or runtime-health wake, diagnose from the exact
|
|
270
|
-
Turn/Event/Session and related WorkItem/Review/Integration records. Preserve
|
|
271
|
-
the current fence and write a Task Message only for a new root cause, impact,
|
|
272
|
-
recovery action, acceptance decision, or user-relevant conclusion; an
|
|
273
|
-
unchanged healthy wait is zero Message.
|
|
274
|
-
|
|
275
|
-
Maintain durable context throughout a long-running Task:
|
|
276
|
-
|
|
277
|
-
- At first activation, ensure the Brief records the objective, boundaries,
|
|
278
|
-
Task-level technical approach, current focus, and a useful Leader summary.
|
|
279
|
-
- Keep the technical approach stable enough to explain the coordinated change
|
|
280
|
-
across Projects. Put executable per-Project changes and checks in WorkItems,
|
|
281
|
-
not in Project Knowledge.
|
|
282
|
-
- Before ending a Leader Turn after material progress, update `focus` and
|
|
283
|
-
`leader-summary` so the next wake can resume without relying on the native
|
|
284
|
-
conversation transcript. An unchanged healthy wait needs no duplicate
|
|
285
|
-
checkpoint write.
|
|
286
|
-
- Record a Decision when a material technical or product choice changes future
|
|
287
|
-
work. Supersede it explicitly when the choice changes.
|
|
288
|
-
- Add a Milestone for a phase result that can be independently reported or
|
|
289
|
-
resumed.
|
|
290
|
-
- Propose Project Knowledge promotion for stable conclusions useful across
|
|
291
|
-
Tasks. Project Knowledge is an Operator authority: a Leader proposes a
|
|
292
|
-
candidate (with its source Task/Decision/Milestone evidence) and an Operator
|
|
293
|
-
reviews and accepts it; the Leader cannot write the authoritative Knowledge
|
|
294
|
-
list directly. Do not use Knowledge as a Task log, transcript, or scratchpad.
|
|
295
|
-
- Before requesting user input, persist the current focus, known evidence, and
|
|
296
|
-
exact blocker.
|
|
297
|
-
|
|
298
|
-
```sh
|
|
299
|
-
yui task brief update <task-id> \
|
|
300
|
-
--objective "<mission>" \
|
|
301
|
-
--boundary "<scope or constraint>" \
|
|
302
|
-
--approach "<overall technical approach across Projects>" \
|
|
303
|
-
--focus "<current work and next action>" \
|
|
304
|
-
--leader-summary "<progress, evidence, blockers, and risk>"
|
|
305
|
-
yui task decision record <task-id> \
|
|
306
|
-
--title "<material choice>" --rationale "<reason and consequences>"
|
|
307
|
-
yui task milestone add <task-id> \
|
|
308
|
-
--title "<phase>" --summary "<delivered result and evidence>"
|
|
309
|
-
yui project knowledge propose <project> \
|
|
310
|
-
--title "<stable conclusion>" --body "<self-contained project-level knowledge>" \
|
|
311
|
-
--task <task-id> [--decision <id>] [--milestone <id>]
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
Resubmitting the same candidate is deduplicated to the existing proposal. A
|
|
315
|
-
proposal that conflicts with an existing Knowledge entry is never silently
|
|
316
|
-
overwritten: the Operator chooses an explicit update, supersede, or reject.
|
|
317
|
-
Pending proposals appear in `yui task next-action <task-id>` as a non-blocking
|
|
318
|
-
advisory; they do not block Task completion.
|
|
319
|
-
|
|
320
|
-
## Choose the execution path
|
|
321
|
-
|
|
322
|
-
Choose before creating the WorkItem:
|
|
323
|
-
|
|
324
|
-
- **Direct**: small work that benefits from the Leader's current context and
|
|
325
|
-
does not need a separately managed lifecycle.
|
|
326
|
-
- **Native subagent**: bounded parallel or specialist work that can inherit the
|
|
327
|
-
Leader's current Agent, credentials, context, and native child mechanism.
|
|
328
|
-
- **Task Role Turn**: work requiring a different Agent/provider,
|
|
329
|
-
credentials, user-owned independent Session, durable lifecycle, or repeated
|
|
330
|
-
dispatches to a Task-bound Worker instance.
|
|
331
|
-
|
|
332
|
-
Keep review execution separate from implementation. No global Reviewer is
|
|
333
|
-
required: when review is disabled, inspect and decide directly or delegate a
|
|
334
|
-
bounded review to a native subagent or ordinary Worker. When a managed
|
|
335
|
-
ReviewRound is explicitly requested, its reviewer uses the single built-in
|
|
336
|
-
write-capable `reviewer` Profile. Each Task Reviewer Role keeps one stable,
|
|
337
|
-
isolated Session and physical workspace slot; every ReviewRound updates that
|
|
338
|
-
slot to its exact frozen scope and records a new immutable ownership snapshot:
|
|
339
|
-
the assigned WorkItem Candidate or the committed Integration heads of a
|
|
340
|
-
Task-final Review. Never reuse the Candidate/Worker workspace or its
|
|
341
|
-
implementation Role Session. Multiple Reviewer Roles use independent slots
|
|
342
|
-
and may run in parallel. Codex and Claude may use their normal configured
|
|
343
|
-
full capability in that isolated worktree; the behavioral boundary forbids
|
|
344
|
-
push, Integration, Task mutation, other workspaces, stable checkouts, and the
|
|
345
|
-
real Yui control-plane home. When
|
|
346
|
-
creating an explicit Task Role binding, also set and read back the required
|
|
347
|
-
model and effort instead of relying on CLI defaults.
|
|
348
|
-
Every managed reviewer must end its Provider Turn with one complete report;
|
|
349
|
-
Yui stores that final response as the current Turn result. Read the completed
|
|
350
|
-
result as one review batch and route all reported
|
|
351
|
-
findings together; do not manufacture another ReviewRound merely because one
|
|
352
|
-
finding was handled before the rest of the batch.
|
|
353
|
-
|
|
354
|
-
A direct or native-subagent WorkItem is roleless. A Task Role WorkItem must be
|
|
355
|
-
created with `--role <role>`; do not retrofit the Role later. Reuse a compatible
|
|
356
|
-
Role instead of creating duplicates.
|
|
357
|
-
|
|
358
|
-
Before the first delegated WorkItem, or after the Profile catalog changes,
|
|
359
|
-
inspect the available Profiles:
|
|
360
|
-
|
|
361
|
-
```sh
|
|
362
|
-
yui config profile list
|
|
363
|
-
```
|
|
364
|
-
|
|
365
|
-
Choose the Profile by the work's meaning. `worker`, `implementer`, and
|
|
366
|
-
`reviewer` are write-capable by default; use `explorer` for explicit read-only
|
|
367
|
-
inspection and `reviewer` only for ReviewRound isolation. Do not use the
|
|
368
|
-
reviewer Profile as a general implementation Role. If one WorkItem may write at
|
|
369
|
-
any stage, use a write-capable implementation Profile; split out a read-only
|
|
370
|
-
investigation only when it is independently useful.
|
|
371
|
-
|
|
372
|
-
## Decompose
|
|
373
|
-
|
|
374
|
-
Create finite WorkItems that describe intent:
|
|
8
|
+
Follow `yui-runtime` first. Load the exact current Turn Context Pack and recover
|
|
9
|
+
authority from its Snapshot and deltas, never from launch text, workspace
|
|
10
|
+
layout, or transcript memory.
|
|
11
|
+
|
|
12
|
+
Own Task direction, decomposition, architecture and product decisions,
|
|
13
|
+
acceptance, integration, and durable context. The global Operator may perform
|
|
14
|
+
the same legal Task actions when useful; responsibility is not a second
|
|
15
|
+
permission system. Read current durable state and let Yui's transactional
|
|
16
|
+
boundaries resolve races.
|
|
17
|
+
|
|
18
|
+
## Choose the simplest coherent result
|
|
19
|
+
|
|
20
|
+
Optimize for the lowest total lifecycle complexity that satisfies the current
|
|
21
|
+
Task Contract. Include implementation, verification, coordination, operation,
|
|
22
|
+
maintenance, and likely revision cost. “Long-term” does not mean designing for
|
|
23
|
+
every imaginable future requirement or failure.
|
|
24
|
+
|
|
25
|
+
- Start from the user's outcome, current commitments, observed behavior, and
|
|
26
|
+
hard authority or data-integrity boundaries.
|
|
27
|
+
- Separate established requirements from hypothetical extensions. Preserve a
|
|
28
|
+
future option only when current evidence makes it reasonably foreseeable and
|
|
29
|
+
the present cost is proportionate.
|
|
30
|
+
- Reuse an existing concept or responsibility when it expresses the result
|
|
31
|
+
cleanly. Prefer a bounded redesign when repeated patches expose a misplaced
|
|
32
|
+
responsibility or an incoherent boundary.
|
|
33
|
+
- Do not add a framework, policy layer, state, acknowledgement, retry loop,
|
|
34
|
+
fallback, compatibility path, configuration switch, or abstraction merely
|
|
35
|
+
because a future edge case can be imagined.
|
|
36
|
+
- Split modules or execution units only when they have meaningfully different
|
|
37
|
+
responsibilities, authority, lifecycles, or independently useful outcomes.
|
|
38
|
+
Small helpers and files do not need their own architecture.
|
|
39
|
+
- Prefer one clear authority for each decision. Derived views may explain
|
|
40
|
+
state, but must not become competing workflow truth.
|
|
41
|
+
|
|
42
|
+
Make routine legal choices yourself. Do not ask the user to choose among
|
|
43
|
+
implementation patterns, scheduling options, review routing, or recoverable
|
|
44
|
+
runtime actions. Create an InputRequest only for a real product choice, new
|
|
45
|
+
authority, irreversible external effect, or unavailable external fact.
|
|
46
|
+
|
|
47
|
+
## Choose execution topology from ownership
|
|
48
|
+
|
|
49
|
+
A WorkItem is one substantial requirement with an independent owner and useful
|
|
50
|
+
acceptance boundary. It is not a container for every phase, file, test,
|
|
51
|
+
finding, repair, or progress update. Task type, risk labels, file count, and
|
|
52
|
+
subsystem names do not determine topology.
|
|
53
|
+
|
|
54
|
+
Choose the smallest useful executor:
|
|
55
|
+
|
|
56
|
+
1. **Leader directly** when current context, authority, and tools are enough.
|
|
57
|
+
2. **Native subagent** for bounded specialist attention or parallel
|
|
58
|
+
investigation inside the current Agent Session when a best-effort child
|
|
59
|
+
result is sufficient.
|
|
60
|
+
3. **Task Role Turn** when work needs independent durable ownership, a distinct
|
|
61
|
+
Agent/provider or credential set, a managed workspace, or a separately
|
|
62
|
+
recoverable Session and Turn lifecycle.
|
|
63
|
+
|
|
64
|
+
Create multiple WorkItems only when their requirements can make useful
|
|
65
|
+
independent progress, normally in parallel, and the coordination and
|
|
66
|
+
Integration cost is lower than keeping one coherent owner. Keep coupled
|
|
67
|
+
changes together.
|
|
68
|
+
|
|
69
|
+
An ordinary assigned WorkItem uses its existing owner or assignee directly.
|
|
70
|
+
Dispatch it without `--lane-role`. Request replicated execution only when
|
|
71
|
+
multiple independent attempts at the same frozen Assignment have concrete
|
|
72
|
+
value that exceeds their comparison and Integration cost. Review lanes are a
|
|
73
|
+
separate decision and default to one Reviewer.
|
|
74
|
+
|
|
75
|
+
Configured Leader, Worker, Reviewer, and native child Agents are normal
|
|
76
|
+
execution resources. Their ordinary development and review work does not
|
|
77
|
+
become a real-resource validation merely because they use a real model. Follow
|
|
78
|
+
the separate validation boundary in `yui-runtime`; do not create an
|
|
79
|
+
InputRequest for routine Agent allocation.
|
|
80
|
+
|
|
81
|
+
## Give Agents outcomes, not premature implementations
|
|
82
|
+
|
|
83
|
+
Make delegated work decision-complete:
|
|
84
|
+
|
|
85
|
+
- objective and observable acceptance criteria;
|
|
86
|
+
- relevant Task and Project context;
|
|
87
|
+
- hard scope, authority, and workspace boundaries;
|
|
88
|
+
- known constraints, risks, dependencies, and existing decisions; and
|
|
89
|
+
- expected checks and evidence.
|
|
90
|
+
|
|
91
|
+
Let the receiving Agent choose its implementation plan, internal structure, and
|
|
92
|
+
tools unless a particular ordering or mechanism is itself part of the accepted
|
|
93
|
+
contract. Do not encode the Leader's speculative design as mandatory Worker
|
|
94
|
+
steps.
|
|
95
|
+
|
|
96
|
+
For Project-backed work, use the Project Skills, Policy, and Knowledge exposed
|
|
97
|
+
through current context. Keep repository-specific build, migration, release,
|
|
98
|
+
and test rules in that Project-owned layer.
|
|
99
|
+
|
|
100
|
+
## Keep durable context useful
|
|
101
|
+
|
|
102
|
+
Use `yui task context <task-id>` and `yui task next-action <task-id>` as
|
|
103
|
+
decision support. They expose current facts, exact refs, and legal
|
|
104
|
+
alternatives; they do not replace Leader judgment.
|
|
105
|
+
|
|
106
|
+
Before dispatch, Review, Integration, or completion, inspect
|
|
107
|
+
`liveTaskState.activeTurns` and `liveTaskState.activeTaskReviews` in the current
|
|
108
|
+
Context Pack. They report work in flight but gate nothing by themselves; reason
|
|
109
|
+
from each exact binding and frozen candidate instead of treating activity as a
|
|
110
|
+
global Task lock.
|
|
111
|
+
|
|
112
|
+
Maintain only context that changes future decisions:
|
|
113
|
+
|
|
114
|
+
- Keep the Brief's objective, boundaries, approach, current focus, and Leader
|
|
115
|
+
summary current after material semantic progress.
|
|
116
|
+
- Record a Decision when a material product or technical choice changes future
|
|
117
|
+
work.
|
|
118
|
+
- Add a Milestone for an independently meaningful phase result.
|
|
119
|
+
- Send one Task Message only when another reader needs a new conclusion,
|
|
120
|
+
impact, risk, acceptance decision, or changed plan.
|
|
121
|
+
- Propose Project Knowledge only for a stable conclusion useful across Tasks.
|
|
122
|
+
|
|
123
|
+
Do not turn Messages, WorkItems, Decisions, or Milestones into a scheduler log
|
|
124
|
+
or transcript. Unchanged waits, dispatches, heartbeats, and routine tool use do
|
|
125
|
+
not need narrative records.
|
|
126
|
+
|
|
127
|
+
## Execute the chosen path
|
|
128
|
+
|
|
129
|
+
For direct work, change only Task main, keep it on its managed branch, commit
|
|
130
|
+
the result, and leave it clean. Run the smallest check that can catch the
|
|
131
|
+
changed behavior while implementing.
|
|
132
|
+
|
|
133
|
+
For a substantial delegated requirement:
|
|
375
134
|
|
|
376
135
|
```sh
|
|
377
136
|
yui task work create <task-id> "<title>" \
|
|
378
137
|
--project <project-to-modify> \
|
|
379
138
|
--objective "<bounded outcome>" \
|
|
380
|
-
--accept "<observable criterion>"
|
|
381
|
-
--after <dependency-work-id>
|
|
139
|
+
--accept "<observable criterion>"
|
|
382
140
|
```
|
|
383
141
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
Task main contains every bound Project. A WorkItem may read that complete
|
|
388
|
-
context but may modify only its declared `--project` scope.
|
|
389
|
-
|
|
390
|
-
For analysis-only work, require source evidence and prohibit changes. For
|
|
391
|
-
implementation, include enough detail to execute and validate without
|
|
392
|
-
reconstructing the user conversation.
|
|
142
|
+
Add `--after` only for a real dependency. Likely file overlap is not by itself
|
|
143
|
+
a dependency. A Worker may read the complete authorized Task context but may
|
|
144
|
+
write only its WorkItem Projects and workspace.
|
|
393
145
|
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
Mark a roleless WorkItem running, perform the work, review the result, and
|
|
397
|
-
record the evidence:
|
|
146
|
+
For a Leader-owned WorkItem, mark it running, complete it directly, then record
|
|
147
|
+
its actual result:
|
|
398
148
|
|
|
399
149
|
```sh
|
|
400
150
|
yui task work update <work-id> running
|
|
401
|
-
yui task work update <work-id> done
|
|
402
|
-
--summary "executor=leader; result=<outcome>; checks=<evidence>"
|
|
403
|
-
```
|
|
404
|
-
|
|
405
|
-
Use `failed` with recovery context when it cannot be completed. Do not mark
|
|
406
|
-
work done before checking its acceptance criteria. When global review is
|
|
407
|
-
enabled, `done` submits a Candidate instead of completing the WorkItem. Read
|
|
408
|
-
the exact Turn Context Pack and follow that Candidate's snapshotted policy.
|
|
409
|
-
|
|
410
|
-
## Create a native subagent
|
|
411
|
-
|
|
412
|
-
Mark the roleless WorkItem running. Before creating the child, select one
|
|
413
|
-
explicit Worker Profile. Use the closest specialist Profile; if none fits,
|
|
414
|
-
use `worker`. A Profile is required for this path:
|
|
415
|
-
|
|
416
|
-
```sh
|
|
417
|
-
yui task work update <work-id> running
|
|
418
|
-
yui config profile show <worker|explorer|implementer|reviewer|profile-id>
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
Read the selected Profile and incorporate all applicable portable constraints
|
|
422
|
-
into the child brief:
|
|
423
|
-
|
|
424
|
-
- WorkItem objective, acceptance criteria, dependencies, and context reads;
|
|
425
|
-
- Profile revision, description, instructions, and required Skills;
|
|
426
|
-
- Profile read/write behavior intent and exact allowed workspace;
|
|
427
|
-
- requested validation and evidence;
|
|
428
|
-
- optional model and effort hints.
|
|
429
|
-
|
|
430
|
-
The child inherits this Leader's Agent, account, credentials, and conversation
|
|
431
|
-
context. Ignore all Task Role Agent bindings. Apply a Profile model or effort
|
|
432
|
-
hint only if this Agent's native child API supports that override; otherwise
|
|
433
|
-
inherit the actual runtime setting. Never claim a model that cannot be
|
|
434
|
-
confirmed.
|
|
435
|
-
|
|
436
|
-
Create and communicate with children through the native Agent tools. Yui does
|
|
437
|
-
not create, address, resume, or terminate those children; it observes their
|
|
438
|
-
structured lifecycle so the parent Turn can span the provider Turns needed
|
|
439
|
-
to receive their results, including a later provider Activation. Children must
|
|
440
|
-
not mutate Yui lifecycle state. If the provider cannot automatically return a
|
|
441
|
-
detached result to the parent, the adapter records a bounded Provider result
|
|
442
|
-
reference and the inbox wakes the Leader. Synthesize that fact before deciding
|
|
443
|
-
the next Yui workflow outcome.
|
|
444
|
-
|
|
445
|
-
Review the returned work and run proportionate checks. Record each round in the
|
|
446
|
-
WorkItem summary; preserve earlier round facts when updating it:
|
|
447
|
-
|
|
448
|
-
```text
|
|
449
|
-
executor=subagent; profile=implementer@1; model=inherited; effort=inherited;
|
|
450
|
-
round=2; result=bounded correction delivered; checks=Project checks passed
|
|
451
|
-
```
|
|
452
|
-
|
|
453
|
-
Use `model=unknown` or `effort=unknown` when the runtime does not expose the
|
|
454
|
-
actual value. Do not treat the WorkItem as accepted merely because the child
|
|
455
|
-
returned or `done` submitted its Candidate.
|
|
456
|
-
|
|
457
|
-
```sh
|
|
458
|
-
yui task work update <work-id> done --summary "<reviewed round history>"
|
|
459
|
-
yui task work update <work-id> failed --summary "<round history and recovery context>"
|
|
151
|
+
yui task work update <work-id> done --summary "<result and evidence>"
|
|
460
152
|
```
|
|
461
153
|
|
|
462
|
-
|
|
463
|
-
|
|
154
|
+
For a native child, keep the WorkItem roleless, mark it running, select the
|
|
155
|
+
closest applicable Profile, pass its constraints in the brief, and use the
|
|
156
|
+
provider's native child tools. Native children inherit the current Turn's
|
|
157
|
+
authority and gain no Yui Role, Turn, Session, or broader workspace. Their
|
|
158
|
+
results are best-effort until Yui externalizes them; use a managed Task Role
|
|
159
|
+
when independent durability matters. Inspect the returned result before
|
|
160
|
+
recording `done` or `failed`. A Profile's runtime source applies when
|
|
161
|
+
materializing a Task Role, not when launching a native child. The child
|
|
162
|
+
inherits the Leader Agent; apply a Profile model or effort only when the native
|
|
163
|
+
tool actually supports and confirms that override.
|
|
464
164
|
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
A Task Role is a mutable Task-bound Worker instance. Apply a provider-neutral
|
|
468
|
-
Profile snapshot, then bind one or more Agents with independent runtime
|
|
469
|
-
settings:
|
|
165
|
+
For a managed Task Role:
|
|
470
166
|
|
|
471
167
|
```sh
|
|
472
|
-
yui task role add <task-id> <role>
|
|
473
|
-
--profile <worker-profile>
|
|
168
|
+
yui task role add <task-id> <role> --profile <profile>
|
|
474
169
|
yui task role show <task-id> <role>
|
|
475
170
|
yui task work create <task-id> "<outcome>" --role <role>
|
|
476
|
-
yui task work dispatch <work-id> --input "<
|
|
477
|
-
```
|
|
478
|
-
|
|
479
|
-
The Profile is not linked to an Agent. Applying it copies portable behavior
|
|
480
|
-
into the Role; later Profile edits do not overwrite Role customization. Each
|
|
481
|
-
Agent binding retains its own adapter, model, permission, environment, and
|
|
482
|
-
native Session configuration.
|
|
483
|
-
|
|
484
|
-
Add a non-Leader Task Role without `--agent` so Yui copies the configured global
|
|
485
|
-
Worker Role's complete bindings, regardless of the Task Role name. The Profile
|
|
486
|
-
still defines portable behavior; Worker defines runtime Agent configuration.
|
|
487
|
-
Before dispatch, inspect `task role show`; if Agent, model, effort, Profile, or
|
|
488
|
-
workspace scope is missing or inconsistent, do not dispatch or guess it.
|
|
489
|
-
|
|
490
|
-
Do not reconstruct Agent/model/effort or provider permission during execution.
|
|
491
|
-
If no compatible global template exists, ask the Operator or user to configure
|
|
492
|
-
one while it is dormant, then read it back before continuing. Every managed
|
|
493
|
-
binding defaults to `permission.strategy=bypass`; a binding may instead choose
|
|
494
|
-
provider `default` or any supported subset of native `configured` options.
|
|
495
|
-
Project write authority remains a separate exact WorkItem or ReviewRound scope. Profile and Skill
|
|
496
|
-
constrain behavior, and provider bypass never changes that boundary, including
|
|
497
|
-
for an `explorer` Role whose Profile intent remains read-only.
|
|
498
|
-
|
|
499
|
-
For meaningful concurrent-write risk, isolate the WorkItem before dispatch:
|
|
500
|
-
|
|
501
|
-
```sh
|
|
502
|
-
yui task work isolate <work-id>
|
|
503
|
-
```
|
|
504
|
-
|
|
505
|
-
WorkItem write scope is monotonic: it may expand but never shrink. If a Worker
|
|
506
|
-
reports that another Project must be modified, decide whether it belongs to the
|
|
507
|
-
same bounded result. The Worker ends its Turn without touching that Project. If
|
|
508
|
-
approved, add an unbound Project to the Task when necessary, update the
|
|
509
|
-
awaiting WorkItem scope with the complete old-plus-new Project set, isolate it
|
|
510
|
-
again, reject the completed round with the scope-expansion reason, then
|
|
511
|
-
redispatch:
|
|
512
|
-
|
|
513
|
-
```sh
|
|
514
|
-
yui task project add <task-id> <project> --base <ref>
|
|
515
|
-
yui task work scope <work-id> \
|
|
516
|
-
--project <existing-project> --project <new-project>
|
|
517
|
-
yui task work isolate <work-id>
|
|
518
|
-
yui task work reject <work-id> \
|
|
519
|
-
--summary "Write scope expanded; continue in the refreshed workspace."
|
|
520
|
-
yui task work dispatch <work-id> --input "<continue with the expanded scope>"
|
|
171
|
+
yui task work dispatch <work-id> --input "<decision-complete brief>"
|
|
521
172
|
```
|
|
522
173
|
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
checks, evidence, finding, or ambiguous output—even when a pre-review
|
|
602
|
-
context/workspace failure historically terminalized it without a semantic result—
|
|
603
|
-
the Leader may run
|
|
604
|
-
`yui task review force-fresh <task>/<review-round>` to create one distinct
|
|
605
|
-
full Round over the identical frozen heads. It fails closed for every
|
|
606
|
-
semantic or ambiguous prior result; target the new failed Round explicitly
|
|
607
|
-
if another non-semantic failure occurs.
|
|
608
|
-
- For `review.failed-to-start`, open the referenced ReviewRound and inspect its
|
|
609
|
-
exact reason, frozen candidate, and workspace when present. Decide whether to
|
|
610
|
-
retry, explicitly clean a conflicting workspace, select another Reviewer, or
|
|
611
|
-
continue other work. Preserve the failed Round as request history and do not
|
|
612
|
-
turn these choices into an automatic retry or cleanup loop.
|
|
613
|
-
- Use `task next-action`'s derived Review outcome literally: non-semantic means
|
|
614
|
-
recover the same frozen head with `force-fresh`; ambiguous means diagnose the
|
|
615
|
-
inconsistent evidence without creating a Repair WorkItem; only semantic
|
|
616
|
-
negative evidence may create a repair wave. There is no semantic Review
|
|
617
|
-
budget; exact candidate/Reviewer/intent retries reuse existing evidence.
|
|
618
|
-
- If the same non-resource user choice or unavailable external fact repeats,
|
|
619
|
-
persist context and create an InputRequest instead of looping. Never use an
|
|
620
|
-
InputRequest to solicit authorization for an unrequested real-resource test;
|
|
621
|
-
the resource boundary above requires skipping it.
|
|
622
|
-
- A Reviewer may leave an optional diagnostic commit. Route its SHA and
|
|
623
|
-
findings explicitly to the original Worker; never capture, integrate, accept,
|
|
624
|
-
or auto-merge the review workspace. After routing, use
|
|
625
|
-
`yui task work review cleanup <task>/<review-round>` or preserve it explicitly
|
|
626
|
-
for further diagnosis. Cleanup removes only the ReviewRound workspace.
|
|
627
|
-
|
|
628
|
-
- If semantics or evidence are insufficient, reject with precise feedback and
|
|
629
|
-
redispatch the same WorkItem. Keep the isolated workspace so the Worker can
|
|
630
|
-
repair the existing result. This creates another Turn and Candidate but
|
|
631
|
-
must resume the original execution Role's native Session; do not create a
|
|
632
|
-
replacement Session silently.
|
|
633
|
-
- If the result is acceptable and has no isolated code changes, accept it.
|
|
634
|
-
- If it has an isolated workspace, review semantics first, then capture the
|
|
635
|
-
current HEAD, integrate and validate that ChangeSet, and accept only after the
|
|
636
|
-
latest captured result is integrated.
|
|
174
|
+
Profiles carry portable behavior plus either a dynamic Global Worker runtime
|
|
175
|
+
source or an explicit Agent with optional model and effort. Applying a Profile
|
|
176
|
+
to a Task Role resolves and freezes the complete binding; later Profile or
|
|
177
|
+
Global Worker changes do not rewrite that Role. Before dispatch, use
|
|
178
|
+
`profile show` and `task role show` to read the exact behavior, Agent, model,
|
|
179
|
+
effort, Profile, and workspace. Do not reconstruct or guess launch
|
|
180
|
+
configuration. Use the WorkItem assignee directly unless replicated execution
|
|
181
|
+
was deliberately selected.
|
|
182
|
+
|
|
183
|
+
Managed Task main, WorkItem, ReviewRound, and Integration workspaces have
|
|
184
|
+
different owners. Never edit stable Project checkouts, managed refs, Yui state
|
|
185
|
+
files, or another owner's workspace. A Task's recorded base is durable; do not
|
|
186
|
+
silently replace it merely because its remote branch later moves.
|
|
187
|
+
|
|
188
|
+
## Validate and make the review judgment
|
|
189
|
+
|
|
190
|
+
Use the smallest evidence that establishes the accepted behavior and material
|
|
191
|
+
boundaries. Do not repeat a successful unchanged check. Run the Project's
|
|
192
|
+
complete local delivery validation once on the final candidate when its Policy
|
|
193
|
+
requires it.
|
|
194
|
+
|
|
195
|
+
As part of accepting a WorkItem or completing a Task, decide whether additional
|
|
196
|
+
review would add useful evidence:
|
|
197
|
+
|
|
198
|
+
- inspect directly when the change is clear and existing evidence is enough;
|
|
199
|
+
- use one independent Worker, native child, or Reviewer when independent
|
|
200
|
+
inspection materially reduces a reachable risk; or
|
|
201
|
+
- rely on an already completed applicable Review.
|
|
202
|
+
|
|
203
|
+
This is Leader judgment inside the acceptance decision, not a separate record,
|
|
204
|
+
checklist, or workflow phase. A managed Reviewer is optional. Do not create a
|
|
205
|
+
Reviewer Role or ReviewRound for ceremony. Honor an existing Candidate's
|
|
206
|
+
snapshotted `always` policy and any immutable Task-final Review contract.
|
|
207
|
+
Otherwise choose whether another review adds enough evidence to justify its
|
|
208
|
+
cost.
|
|
209
|
+
|
|
210
|
+
Use direct Review by default: one main Reviewer Turn owns the authoritative
|
|
211
|
+
result without an ExecutionGroup or Lane. Choose replicated Review only when
|
|
212
|
+
independent inspection of the same frozen Assignment materially improves the
|
|
213
|
+
evidence enough to repay its coordination cost. It requires at least two
|
|
214
|
+
distinct Producer Lane Roles plus a separate main Reviewer. Wait for every
|
|
215
|
+
Producer to settle and at least two to succeed; their results are durable
|
|
216
|
+
evidence only. The main Reviewer receives all successful results, resolves
|
|
217
|
+
disagreement against the frozen sources, and submits one original result.
|
|
218
|
+
Automatic policy-triggered Candidate Review remains direct.
|
|
219
|
+
|
|
220
|
+
When several WorkItems contribute to one outcome, prefer one independent
|
|
221
|
+
Task-final Review after their accepted results are integrated over repeating a
|
|
222
|
+
complete Review for every WorkItem. Request an earlier WorkItem Review only
|
|
223
|
+
when that frozen Candidate has a specific risk that should be resolved before
|
|
224
|
+
Integration.
|
|
225
|
+
|
|
226
|
+
When a Worker or Reviewer result arrives, resolve its exact Turn and read the
|
|
227
|
+
complete original `TurnResult.output` before starting new work or waiting
|
|
228
|
+
again. Treat headings or JSON fields only as communication aids; never infer
|
|
229
|
+
that Core parsed or accepted them. Decide whether to accept, repair, review
|
|
230
|
+
again, retry execution, or ask for a genuinely user-owned decision. Route
|
|
231
|
+
reachable issues to the original execution owner. Fix a small Task-main issue
|
|
232
|
+
directly; create a Repair WorkItem only when the repair is itself a substantial
|
|
233
|
+
independently owned requirement.
|
|
234
|
+
|
|
235
|
+
A failed ReviewRound is an execution failure, not an automatic retry or repair
|
|
236
|
+
wave. Inspect its exact Round, Turn, candidate, Core failure, and
|
|
237
|
+
`task next-action` facts, then choose the smallest recovery that preserves the
|
|
238
|
+
frozen boundary. Do not invent a retry loop or silently replace the Reviewer
|
|
239
|
+
Session. For a replicated Task-final Round below quorum before main synthesis,
|
|
240
|
+
retry the Round so only unsettled or failed Producers rerun. Retry a failed
|
|
241
|
+
main synthesis through its exact Turn.
|
|
242
|
+
|
|
243
|
+
## Accept, integrate, and complete
|
|
244
|
+
|
|
245
|
+
A Worker or Reviewer Turn result is evidence, not acceptance. Inspect the
|
|
246
|
+
result, diff, checks, and current Candidate before deciding.
|
|
247
|
+
|
|
248
|
+
If a WorkItem result is insufficient, reject it with bounded feedback and
|
|
249
|
+
redispatch the same WorkItem and Role while its scope remains valid. If it is
|
|
250
|
+
acceptable and contains isolated Git changes, capture and integrate its latest
|
|
251
|
+
Candidate before acceptance:
|
|
637
252
|
|
|
638
253
|
```sh
|
|
639
|
-
yui task work reject <work-id> --summary "<missing evidence or required fix>"
|
|
640
|
-
yui task work dispatch <work-id> --input "<prior result plus bounded feedback>"
|
|
641
|
-
|
|
642
254
|
yui task work capture <work-id>
|
|
643
255
|
yui task integration start <task-id> --project <project> \
|
|
644
|
-
--change-set <
|
|
645
|
-
--check "<
|
|
646
|
-
yui task work accept <work-id> --summary "<
|
|
256
|
+
--change-set <change-set-id> \
|
|
257
|
+
--check "<Project Policy command>"
|
|
258
|
+
yui task work accept <work-id> --summary "<decision and evidence>"
|
|
647
259
|
```
|
|
648
260
|
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
Candidate and ReviewRound history is retained under the same WorkItem. Every
|
|
654
|
-
retry round must also retain its result and checks in the WorkItem summary.
|
|
655
|
-
Capture is immutable per Project HEAD: repeating capture at the same HEAD
|
|
656
|
-
reuses the record; a repaired HEAD produces a new candidate. Integrate each
|
|
657
|
-
modified Project independently and only its latest reviewed candidate. Never
|
|
658
|
-
accept an isolated result while any writable Project's latest ChangeSet is
|
|
659
|
-
unintegrated.
|
|
660
|
-
|
|
661
|
-
Workspace ownership is not Role ownership. The WorkItem owns its Develop
|
|
662
|
-
workspace even when a Task Role executes there; a Task Reviewer Role keeps one
|
|
663
|
-
stable physical workspace while each ReviewRound owns the exact frozen
|
|
664
|
-
workspace evidence for its Turn, and each IntegrationAttempt owns its candidate
|
|
665
|
-
worktree. Dispatch attaches snapshots only. Review workspace cleanup is
|
|
666
|
-
explicit, and review edits can never feed WorkItem ChangeSet capture.
|
|
667
|
-
|
|
668
|
-
Yui validates a candidate and advances the target with compare-and-swap. A
|
|
669
|
-
failed candidate does not advance the target. Inspect and resolve semantic
|
|
670
|
-
conflicts as this Task's Leader:
|
|
261
|
+
Resolve a failed Integration from its exact conflict or check evidence. Do not
|
|
262
|
+
bypass compare-and-swap, update managed refs manually, or create a replacement
|
|
263
|
+
WorkItem for an ordinary Integration correction.
|
|
671
264
|
|
|
672
|
-
|
|
673
|
-
yui task
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
Git conflict before continuing. Failed checks, rejected candidates, and target
|
|
682
|
-
movement must remain explicit; do not bypass them with manual ref updates.
|
|
683
|
-
|
|
684
|
-
Choose cleanup from the WorkItem's expected next use, not merely from a Turn
|
|
685
|
-
ending. If another iteration is imminent, retain the native process and
|
|
686
|
-
worktree. For a longer pause with no active Turn or pending delivery, release
|
|
687
|
-
only the runtime; Yui preserves the native Session id and WorkItem worktree so
|
|
688
|
-
the next dispatch can resume them:
|
|
689
|
-
|
|
690
|
-
```sh
|
|
691
|
-
yui task work cleanup <task>/<work> --runtime-only
|
|
692
|
-
```
|
|
693
|
-
|
|
694
|
-
After final acceptance and integration, clean terminal resources deliberately:
|
|
695
|
-
|
|
696
|
-
```sh
|
|
697
|
-
yui task integration cleanup <integration-id>
|
|
698
|
-
yui task work cleanup <task>/<work> --integrated
|
|
699
|
-
```
|
|
700
|
-
|
|
701
|
-
Terminal child worktrees are completion advisories, not semantic blockers.
|
|
702
|
-
Clean them before archive; do not create a new WorkItem, ReviewRound, or Turn
|
|
703
|
-
only to make cleanup happen before Task completion.
|
|
704
|
-
|
|
705
|
-
Use `--abandon` only for deliberate discard. Dirty worktrees remain available
|
|
706
|
-
for capture or resolution. Cleanup must never stop a Role already serving a
|
|
707
|
-
newer WorkItem. If the original execution Session cannot be resumed, surface
|
|
708
|
-
the recovery decision to the user; do not silently discard its context by
|
|
709
|
-
creating a replacement.
|
|
710
|
-
|
|
711
|
-
For a Role runtime failure, inspect the exact error and runtime identities first:
|
|
712
|
-
|
|
713
|
-
```sh
|
|
714
|
-
yui task event show <task> <agent-error-event>
|
|
715
|
-
yui task role session inspect <task> <role>
|
|
716
|
-
```
|
|
717
|
-
|
|
718
|
-
When a Provider-accepted Turn fails with availability, `429`, capacity, or a
|
|
719
|
-
recoverable transport error and the Session remains usable, retain the Turn and
|
|
720
|
-
Session; a recovery action adds a new Turn on that same native Session. A
|
|
721
|
-
Session preparation failure or Driver rejection before input acceptance fails
|
|
722
|
-
the exact Turn once; inspect its error and explicitly retry that failed Turn when
|
|
723
|
-
another attempt is useful. Core will not redispatch it on a scheduler tick.
|
|
724
|
-
|
|
725
|
-
If the Driver proves that the Session cannot continue, settle or retire the
|
|
726
|
-
exact active Turn, stop only that Role Session, then retry the failed Turn so the
|
|
727
|
-
next dispatch starts a new Session:
|
|
728
|
-
|
|
729
|
-
```sh
|
|
730
|
-
yui task role session stop <task> <role> --reason "<error decision>"
|
|
731
|
-
yui task turn retry <task>/<failed-turn>
|
|
732
|
-
```
|
|
733
|
-
|
|
734
|
-
The new Turn context contains the prior Agent, adapter, Turn, Host activation,
|
|
735
|
-
native Session/Turn identities, and complete raw error through the referenced
|
|
736
|
-
Task event. Inspect recent `runtime.agent-error` events before another fresh
|
|
737
|
-
Session; after repeated fresh-Session failures, report the evidence and bounded
|
|
738
|
-
options to the user instead of inventing another automatic loop.
|
|
739
|
-
|
|
740
|
-
## Request a decision
|
|
741
|
-
|
|
742
|
-
When a real user choice, new authority, or unavailable external fact is
|
|
743
|
-
required, first persist the Task checkpoint, then create one durable
|
|
744
|
-
InputRequest. Do not use InputRequests for scheduling, routine implementation
|
|
745
|
-
choices inside the accepted Task Contract, review-fix routing, or confirmation
|
|
746
|
-
to continue:
|
|
747
|
-
|
|
748
|
-
```sh
|
|
749
|
-
yui task input request <task-id> --question "<specific question>" \
|
|
750
|
-
--choice <key>=<label> --blocks work-item:<work-id>
|
|
751
|
-
```
|
|
265
|
+
Immediately after creating, updating, closing, reopening, or merging a PR/MR,
|
|
266
|
+
record the confirmed fact with `yui task publication upsert`; do not wait for
|
|
267
|
+
another Role to infer it. Supply only information already known from the
|
|
268
|
+
operation itself. When the current authorization covers an external provider
|
|
269
|
+
read, use `yui task publication verify` after the merge; otherwise preserve
|
|
270
|
+
reported evidence and state the gap. Track PR/MR identity, state, commits, URL,
|
|
271
|
+
merge time, and evidence—not CI or deployment state. Publication describes
|
|
272
|
+
external delivery and never replaces Candidate, Review, Integration,
|
|
273
|
+
acceptance, or completion.
|
|
752
274
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
a truthful blocked checkpoint; Yui stores that response as the current Turn
|
|
757
|
-
result and later wakes the same fixed Leader Session when an answer arrives.
|
|
758
|
-
|
|
759
|
-
## Finish every Leader turn
|
|
760
|
-
|
|
761
|
-
Every wake is an active control Turn. Before ending:
|
|
762
|
-
|
|
763
|
-
- Inspect the current WorkItems. If this Turn acted on a Leader-assigned
|
|
764
|
-
WorkItem, persist its actual lifecycle and result before the final response:
|
|
765
|
-
move `pending` to `running`, then record `done` or `failed` with the evidence
|
|
766
|
-
you actually established. Saying that the WorkItem is complete in the Turn
|
|
767
|
-
result does not update the WorkItem.
|
|
768
|
-
- If you cannot finally determine success, failure, completeness, or the
|
|
769
|
-
correct disposition, do not guess, silently stop, or hide uncertainty behind
|
|
770
|
-
a success summary. Clearly label the checkpoint uncertain, incomplete,
|
|
771
|
-
blocked, or requiring Leader judgment.
|
|
772
|
-
- Preserve the same complete checkpoint before ending the Turn or creating an InputRequest.
|
|
773
|
-
When applicable, record exact Turn, WorkItem, and native Session identity;
|
|
774
|
-
actions actually performed; changed paths and commit/worktree state; checks
|
|
775
|
-
actually run and their outcomes; provider, runtime, or permission errors;
|
|
776
|
-
the last confirmed lifecycle boundary; work not performed; unresolved
|
|
777
|
-
assumptions or decisions; residual risks; confidence; and bounded next
|
|
778
|
-
options.
|
|
779
|
-
- Review Turns report findings, verification gaps, and limits. Use that evidence
|
|
780
|
-
to decide disposition as Leader; do not treat the review as acceptance.
|
|
781
|
-
|
|
782
|
-
1. update the Brief checkpoint if semantic state changed;
|
|
783
|
-
2. record any material Decision, completed Milestone, or stable Project
|
|
784
|
-
Knowledge;
|
|
785
|
-
3. decide whether to complete the Task, create an InputRequest, or leave it
|
|
786
|
-
active for later facts;
|
|
787
|
-
4. end the Provider Turn with one complete, truthful final report.
|
|
788
|
-
|
|
789
|
-
Yui automatically stores the final Provider response as the current Turn result.
|
|
790
|
-
That result never implies Leader acceptance, WorkItem completion, ChangeSet
|
|
791
|
-
capture, Integration, or Task completion. Do not wait inside a Provider Turn
|
|
792
|
-
for managed Task Role or Reviewer results whose durable mailbox can wake the
|
|
793
|
-
Task; their result creates a later Leader Turn in the same Session. Native child
|
|
794
|
-
work remains part of the current Provider Turn and should drain before it ends.
|
|
795
|
-
When the Turn ends with the Task still active, Yui remains quiet until a real
|
|
796
|
-
durable event arrives; do not rely on periodic re-wakes to revisit unchanged
|
|
797
|
-
state.
|
|
798
|
-
|
|
799
|
-
Complete only after the topology-derived evidence is satisfied, Role work is
|
|
800
|
-
terminal, latest isolated results are integrated or deliberately abandoned,
|
|
801
|
-
and user inputs are resolved. A Leader-owned Task has no WorkItem gate; a Task
|
|
802
|
-
with WorkItems must settle and integrate them. Task completion is a semantic boundary: it
|
|
803
|
-
records exact Project heads, reports terminal-workspace cleanup advisories, and
|
|
804
|
-
notifies the global Operator. It does not stop this Leader. Do not kill tmux
|
|
805
|
-
panes, edit Session records, or add a provider-specific cleanup step. After
|
|
806
|
-
completion succeeds, end the current Turn immediately so the Operator can
|
|
807
|
-
settle advisories and perform the explicit archive boundary; do not stop or
|
|
808
|
-
mutate the native Session yourself.
|
|
275
|
+
Complete only when the Task outcome is satisfied, required checks and review
|
|
276
|
+
contracts are settled, WorkItems are accepted or deliberately retired, latest
|
|
277
|
+
isolated results are integrated, and user inputs are resolved:
|
|
809
278
|
|
|
810
279
|
```sh
|
|
811
|
-
yui task complete <task-id>
|
|
280
|
+
yui task complete <task-id> \
|
|
281
|
+
--summary "<outcome, validation, and remaining risk>"
|
|
812
282
|
```
|
|
813
283
|
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
284
|
+
Completion records the exact Project heads. Archive is a separate,
|
|
285
|
+
user-authorized Operator action.
|
|
286
|
+
|
|
287
|
+
## Finish every Leader Turn
|
|
288
|
+
|
|
289
|
+
Before ending the Turn:
|
|
290
|
+
|
|
291
|
+
1. Inspect the wake delta, resolve every referenced Worker or Reviewer Turn
|
|
292
|
+
with `yui task turn show`, read each original result in full, and make the
|
|
293
|
+
next decision.
|
|
294
|
+
2. Persist actual WorkItem lifecycle and material Brief, Decision, Milestone,
|
|
295
|
+
Message, or Knowledge changes.
|
|
296
|
+
3. Choose one truthful outcome: continue through an owned native child, complete
|
|
297
|
+
the Task, create a justified InputRequest, or leave the active Task waiting
|
|
298
|
+
for a real durable event.
|
|
299
|
+
4. Return one concise final report with outcome, checks, remaining risk, and
|
|
300
|
+
bounded next action.
|
|
301
|
+
|
|
302
|
+
Do not claim completion only in prose when durable Task or WorkItem state still
|
|
303
|
+
needs updating. Do not poll managed Roles or emit waiting Messages. Managed
|
|
304
|
+
results wake a later Leader Turn; an unchanged active Task remains quiet.
|
|
305
|
+
|
|
306
|
+
For a runtime failure, inspect the exact `runtime.agent-error`, Turn, and
|
|
307
|
+
Session facts. Retry the failed Turn on the same recoverable Session when useful.
|
|
308
|
+
Replace a Session only when the Driver proves it cannot continue. After
|
|
309
|
+
repeated replacement failures, report the evidence and bounded options instead
|
|
310
|
+
of adding another recovery mechanism.
|