@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/ARCHITECTURE.md CHANGED
@@ -33,8 +33,9 @@ decomposition, execution choice, review, integration, and completion.
33
33
 
34
34
  `Task` is the bounded user outcome. Its optional `type` describes intent, not
35
35
  execution topology; software Projects normally use `feature` or `bugfix`, while
36
- other Projects may define their own types. Yui does not store a direct versus
37
- integrated delivery mode.
36
+ other Projects may define their own types. Yui does not store a Task-level
37
+ direct versus integrated delivery mode. The `direct` and `replicated` labels
38
+ below describe only the execution shape of one WorkItem.
38
39
 
39
40
  A software bugfix is Leader-owned: the Leader implements and verifies it in the
40
41
  managed Task main without manufacturing a WorkItem. If the scope proves to need
@@ -60,11 +61,29 @@ implementation steps, test runs, review findings, and local fixes remain Turn,
60
61
  Event, report, or commit evidence under the existing Task or WorkItem; they are
61
62
  not new WorkItems.
62
63
 
63
- Each WorkItem may use a native subagent inside the Leader conversation or a
64
- Task Role Turn backed by a durable Worker Session. There is no Yui
65
- subagent launcher or child-session record. Turn is an execution attempt,
66
- not a requirement, and repeated Turns may continue the same compatible Role
67
- Session.
64
+ Native subagents may help an Agent investigate or critique inside its current
65
+ conversation, but they are not a second Yui WorkItem execution model and do
66
+ not create child-session records. A Yui-managed WorkItem dispatch has one
67
+ logical main executor: the current Session for `WorkItem.assignee`. A Turn is
68
+ an execution attempt, not a requirement, and repeated Turns may continue the
69
+ same compatible Role Session.
70
+
71
+ Without `--lane-role`, dispatch is `direct`: Yui creates only the main Turn and
72
+ does not persist an ExecutionGroup or Lane. With at least two distinct
73
+ non-assignee roles, dispatch is `replicated`: one ExecutionGroup freezes a
74
+ canonical Assignment and every Lane independently executes that exact same
75
+ Assignment. One Lane role is invalid, and Lane roles cannot introduce their
76
+ own objective, directive, acceptance criteria, context, or write scope.
77
+
78
+ A Lane is a recoverable logical slot whose durable disposition is `open`,
79
+ `succeeded`, or `failed`. Failed Turns leave the Lane open for an exact
80
+ `task turn retry`; `task turn settle` records the Leader's decision to stop
81
+ recovering that Lane. Yui waits until every Lane is settled. At least two
82
+ successful Lanes make synthesis eligible and create or wake one idempotent
83
+ main Turn with every successful Producer result in stable Lane order. Fewer
84
+ than two successes fail that Group attempt without degrading to a single
85
+ result. Retrying the main Turn keeps the same Group and does not rerun a
86
+ successful Lane.
68
87
 
69
88
  ## Profiles, Roles, and Agents
70
89
 
@@ -83,11 +102,17 @@ Session.
83
102
  context, and source desired revision. A native Role Session stores the same snapshot; running processes
84
103
  are never hot-mutated by later Role edits.
85
104
  - A `WorkItemCandidate` is the explicit result currently awaiting Leader
86
- acceptance. It snapshots the WorkItem revision, summary, and either a
87
- completed execution Turn or a Leader-managed direct source.
105
+ acceptance. A dispatched WorkItem Candidate can reference only a successful
106
+ main Turn; the complete replicated provenance is derived through Main Turn
107
+ -> ExecutionGroup -> Lane -> successful Producer Turn. A roleless delivery
108
+ unit managed directly by the Leader may instead use the existing direct
109
+ source. Lanes never become Candidates or enter Review or Integration.
88
110
  - `ReviewRound` records one semantic judgment. A WorkItem Review references
89
111
  that WorkItem's immutable Candidate. A Task-final Review references the
90
112
  frozen Task heads directly and has no synthetic WorkItem/Candidate anchor.
113
+ Either scope executes directly through one main Reviewer Turn or, when the
114
+ Leader explicitly supplies at least two Producer Roles, through one frozen
115
+ replicated Assignment followed by one authoritative main synthesis Turn.
91
116
  It is never another WorkItem.
92
117
 
93
118
  Adding another Agent requires an explicit adapter implementation. Profiles do
@@ -97,27 +122,28 @@ For a native subagent, the Leader must choose and read an explicit
97
122
  WorkerProfile, using `worker` when no specialist fits. The Leader includes the
98
123
  Profile instructions, Skills, behavior intent, workspace boundary, validation expectations, and
99
124
  supported model/effort hints in the child brief. Task Role Agent bindings are
100
- ignored because the child inherits the Leader Agent. The reviewed WorkItem
101
- summary records the actual Profile revision, inherited or confirmed model and
102
- effort, round, result, and checks.
125
+ ignored because the child inherits the Leader Agent. Its output remains
126
+ session-local collaboration evidence: it does not create a Yui Lane, Candidate,
127
+ ReviewRound, or Integration source. When that evidence affects delivery, the
128
+ main executor incorporates it into the WorkItem's authoritative result.
103
129
 
104
130
  ## Lifecycle and acceptance
105
131
 
106
- Native-subagent WorkItem execution follows:
132
+ WorkItem delivery has one Leader-owned acceptance path regardless of execution
133
+ shape:
107
134
 
108
135
  ```text
109
- todo -> running -> done | failed
110
- -> awaiting Leader decision (when review is configured)
111
- ```
112
-
113
- Task Role work follows:
114
-
115
- ```text
116
- todo -> running -> awaiting Leader review
117
- | accept -> done
136
+ todo -> running -> awaiting_acceptance
137
+ | accept -> completed
118
138
  | reject -> failed -> redispatch -> running
119
139
  ```
120
140
 
141
+ For `direct`, the assignee's successful main Turn supplies the result. For
142
+ `replicated`, Lane Turns supply immutable Producer results and only the
143
+ successful synthesis main Turn supplies the Candidate. Roleless WorkItems are
144
+ advanced directly by the Leader but enter the same Candidate, ChangeSet,
145
+ Integration, and acceptance boundary.
146
+
121
147
  The Provider's native Turn terminal ends its associated Turn and stores the
122
148
  final response as immutable Turn evidence. It never accepts the WorkItem. The
123
149
  Leader checks semantics, evidence, and Git state, then resolves the execution
@@ -127,8 +153,9 @@ WorkItem keeps its workspace so the next Turn can repair the same result.
127
153
  An optional global review rule names one existing Global Role and chooses
128
154
  `always`, `leader`, or `final`. Candidate rules remain live defaults; each
129
155
  WorkItem Candidate snapshots the effective review rule when submitted.
130
- Every result is stored first on its exact Turn/Lane. A Candidate is created only
131
- when the Leader resolves the execution output for acceptance.
156
+ Every managed execution result is stored first on its exact Turn. A Candidate
157
+ is created only from the main result when the Leader resolves the execution
158
+ output for acceptance.
132
159
  `always` dispatches a review Turn for every candidate, whether it comes
133
160
  from a completed execution Turn or a Leader-managed direct result; `leader`
134
161
  leaves every candidate for the Leader to accept directly or review explicitly.
@@ -142,10 +169,12 @@ Task, so normal delivery does not pay for a complete review of every WorkItem.
142
169
  Review Turns complete only their exact ReviewRound, leave the WorkItem awaiting
143
170
  acceptance, and never trigger another review or append a Candidate. Successful
144
171
  and failed review attempts both wake the Leader and remain evidence for
145
- judgment, not a machine verdict. The ReviewRound stores its frozen Candidate
146
- base, isolated workspace provenance, complete free-form report, optional
147
- structured checks, and optional diagnostic commit. The Leader may route that evidence to the original Worker, but Yui
148
- never merges it automatically.
172
+ judgment, not a machine verdict. The ReviewRound stores only Core-owned
173
+ identity, frozen Candidate, workspace provenance, execution topology, main
174
+ Reviewer Turn reference, lifecycle, and failure diagnostics. The complete
175
+ free-form Reviewer result lives only on that exact Turn. The Leader may route
176
+ that result to the original Worker, but Yui never parses or merges it
177
+ automatically.
149
178
 
150
179
  Roles describe Agent capability, but they do not own repository workspaces. A
151
180
  `ManagedWorkspace` is keyed by its durable owner (`Task`, `WorkItem`,
@@ -211,7 +240,7 @@ An isolated result is handled in this order:
211
240
  1. the Worker Provider Turn ends and its Turn result is recorded;
212
241
  2. the Leader reviews semantics and evidence;
213
242
  3. Yui captures each writable Project HEAD as an immutable Project ChangeSet;
214
- 4. each Project integration applies its latest reviewed ChangeSet in a candidate worktree;
243
+ 4. each Project integration applies the governing Candidate's ChangeSet in a candidate worktree;
215
244
  5. configured checks run;
216
245
  6. compare-and-swap advances the target only if its HEAD is unchanged;
217
246
  7. the Leader accepts the WorkItem;
@@ -225,14 +254,14 @@ project-specific engineering rules; and the Task Contract owns the requested
225
254
  outcome. Yui injects only its own generic Role Skills. It never scans or copies
226
255
  Project Skills into managed context; the selected Agent discovers them through
227
256
  its native project mechanism. Execution and review select their generic Skill
228
- by durable Turn purpose. A Reviewer finding routes to the original Worker while
229
- open, one consolidated Repair WorkItem when closed, Leader/Integration for
230
- merge or local fixes, and an architecture WorkItem only for a genuinely
231
- cross-cutting design change. Parallel repair is explicit and requires
232
- independently acceptable ownership.
257
+ by durable Turn purpose. A Reviewer result returns as the exact source Turn
258
+ text. The Leader decides whether to send feedback to the existing Worker,
259
+ accept, review again, handle a local or Integration issue, or create genuinely
260
+ independent follow-up work. Core neither parses findings nor creates repair
261
+ topology from Reviewer prose.
233
262
 
234
263
  Capture at the same HEAD reuses the existing ChangeSet. A repaired HEAD creates
235
- a new candidate; only the latest reviewed candidate may satisfy acceptance.
264
+ a new candidate; only the latest governing candidate may satisfy acceptance.
236
265
  An isolated WorkItem cannot be accepted, or a Task with WorkItems completed,
237
266
  while any writable Project's latest result is uncaptured or unintegrated.
238
267
  Leader-owned completion instead requires a clean committed exact Task-main snapshot.