@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.
Files changed (179) hide show
  1. package/ARCHITECTURE.md +64 -35
  2. package/README.md +258 -125
  3. package/dist/agent/argumentPolicy.js +2 -1
  4. package/dist/agent/managedRuntimeEnvironment.js +5 -8
  5. package/dist/cli/commandCatalog.js +74 -109
  6. package/dist/cli/helpRenderer.js +1 -2
  7. package/dist/cli/interactionCandidates.js +10 -0
  8. package/dist/cli/interactionPolicy.js +76 -37
  9. package/dist/cli/roleWizard.js +5 -6
  10. package/dist/cli/updateOrchestrator.js +10 -8
  11. package/dist/cli/updatePorts.js +17 -13
  12. package/dist/cli/upgradeCommand.js +2 -5
  13. package/dist/cli.js +268 -231
  14. package/dist/commands/agentCommands.js +13 -0
  15. package/dist/commands/configCommands.js +7 -19
  16. package/dist/commands/configOverview.js +3 -2
  17. package/dist/commands/durableJobCommands.js +1 -1
  18. package/dist/commands/executionAuditCommands.js +4 -9
  19. package/dist/commands/globalRoleCommands.js +17 -0
  20. package/dist/commands/profileCommands.js +200 -30
  21. package/dist/commands/sessionCommands.js +1 -1
  22. package/dist/commands/taskActor.js +29 -127
  23. package/dist/commands/taskChangeSetCommands.js +1 -3
  24. package/dist/commands/taskCommands.js +1771 -2107
  25. package/dist/commands/taskCompletionGate.js +27 -103
  26. package/dist/commands/taskContextCommand.js +47 -80
  27. package/dist/commands/taskExecutionCommands.js +9 -27
  28. package/dist/commands/taskInputCommands.js +10 -10
  29. package/dist/commands/taskIntegrationCommands.js +69 -61
  30. package/dist/commands/taskIntegrationQueueCommands.js +1 -1
  31. package/dist/commands/taskNextActionCommand.js +8 -29
  32. package/dist/commands/taskOverviewCommand.js +25 -3
  33. package/dist/commands/taskPublicationCommands.js +151 -85
  34. package/dist/commands/taskPublicationVerifyCommand.js +181 -0
  35. package/dist/commands/taskRemoteDeliveryCommand.js +134 -0
  36. package/dist/commands/taskRoleRuntimeStatus.js +5 -6
  37. package/dist/commands/taskUpstreamCommands.js +79 -95
  38. package/dist/config/configCatalog.js +1 -1
  39. package/dist/context/contextSnapshot.js +17 -2
  40. package/dist/context/sessionBootstrapManifest.js +18 -1
  41. package/dist/context/sourceTurnContext.js +30 -0
  42. package/dist/context/turnContextPack.js +107 -48
  43. package/dist/context/turnInputContract.js +11 -4
  44. package/dist/context/wakeNotification.js +84 -22
  45. package/dist/controller/agentRuntimeObserver.js +9 -12
  46. package/dist/controller/clientRuntime.js +13 -13
  47. package/dist/controller/controller.js +11 -11
  48. package/dist/controller/fileSchedulerStoreAdapter.js +262 -219
  49. package/dist/controller/jobControl.js +11 -10
  50. package/dist/controller/resourceInventory.js +6 -6
  51. package/dist/controller/resourceInventoryLinux.js +2 -2
  52. package/dist/controller/runtime.js +18 -61
  53. package/dist/controller/runtimeEventInbox.js +57 -34
  54. package/dist/controller/runtimeEventProcessor.js +36 -96
  55. package/dist/controller/runtimeHookTurnFence.js +33 -57
  56. package/dist/controller/runtimeLaunchCoordinator.js +44 -40
  57. package/dist/controller/runtimeObservationHook.js +18 -12
  58. package/dist/controller/sessionNotify.js +43 -28
  59. package/dist/controller/sessionOwnerReconciliation.js +21 -21
  60. package/dist/controller/structuredProviderObservation.js +13 -16
  61. package/dist/coordination/workMailboxQueue.js +132 -0
  62. package/dist/core/controllerServer.js +1 -0
  63. package/dist/domain/agentResultTransport.js +60 -0
  64. package/dist/execution/executionHealth.js +111 -118
  65. package/dist/execution/reviewMainTurn.js +161 -0
  66. package/dist/execution/workItemExecution.js +454 -0
  67. package/dist/execution/workItemExecutionProjection.js +309 -0
  68. package/dist/execution/workItemMainTurn.js +164 -0
  69. package/dist/executor/agentExecutor.js +19 -19
  70. package/dist/executor/executorRegistry.js +7 -28
  71. package/dist/executor/fileRoleLaunchPlanner.js +51 -83
  72. package/dist/external/githubPublicationVerifier.js +114 -0
  73. package/dist/external/gitlabPublicationVerifier.js +158 -0
  74. package/dist/external/pinnedCommandRunner.js +73 -0
  75. package/dist/integration/changeSetManifest.js +0 -3
  76. package/dist/integration/deliveryObligation.js +43 -6
  77. package/dist/integration/gitIntegrationService.js +284 -101
  78. package/dist/integration/integrationAttempt.js +64 -14
  79. package/dist/integration/integrationQueueEntry.js +5 -35
  80. package/dist/integration/integrationQueueService.js +65 -194
  81. package/dist/lifecycle/canonicalLifecycleEvent.js +16 -15
  82. package/dist/lifecycle/exactTurnTerminalization.js +100 -97
  83. package/dist/message/message.js +16 -0
  84. package/dist/observability/executionAudit.js +4 -25
  85. package/dist/observability/faultClassification.js +58 -70
  86. package/dist/observability/orchestrationMetrics.js +8 -50
  87. package/dist/profile/agentProfile.js +60 -15
  88. package/dist/profile/agentProfileRuntime.js +100 -0
  89. package/dist/release/releaseWorkflowPorts.js +5 -68
  90. package/dist/repository/executionLaneGitSnapshot.js +80 -0
  91. package/dist/repository/gitWorkspace.js +9 -67
  92. package/dist/repository/taskBaseFreshness.js +3 -1
  93. package/dist/repository/taskWorkspaceCoordinator.js +32 -4
  94. package/dist/repository/taskWorkspacePreparer.js +252 -411
  95. package/dist/resources/liveReferences.js +6 -55
  96. package/dist/resources/resourceDiscovery.js +1 -30
  97. package/dist/resources/resourceRegistrar.js +0 -23
  98. package/dist/review/deltaRecheck.js +8 -65
  99. package/dist/review/reviewAcceptance.js +22 -19
  100. package/dist/review/reviewConfig.js +0 -10
  101. package/dist/review/reviewDecision.js +2 -2
  102. package/dist/review/reviewRound.js +147 -273
  103. package/dist/review/reviewerAvailability.js +13 -23
  104. package/dist/role/role.js +3 -0
  105. package/dist/runtime/agentDriverObservation.js +1 -1
  106. package/dist/runtime/agentHost.js +51 -51
  107. package/dist/runtime/builtinAgentDrivers.js +9 -2
  108. package/dist/runtime/codexAppServerRuntime.js +23 -5
  109. package/dist/runtime/exactControlPlane.js +2 -267
  110. package/dist/runtime/firstProgressAdvisory.js +1 -1
  111. package/dist/runtime/index.js +1 -1
  112. package/dist/runtime/launchBroker.js +11 -11
  113. package/dist/runtime/lifecycleReservation.js +2 -2
  114. package/dist/runtime/managedCaller.js +111 -0
  115. package/dist/runtime/ports.js +16 -3
  116. package/dist/runtime/preallocatedNativeSession.js +2 -2
  117. package/dist/runtime/processExitObservation.js +3 -2
  118. package/dist/runtime/providerContinuationReconciliationService.js +1 -1
  119. package/dist/runtime/runtimeBinding.js +1 -1
  120. package/dist/runtime/runtimeObservation.js +33 -16
  121. package/dist/runtime/runtimeSessionCandidate.js +2 -2
  122. package/dist/runtime/runtimeStopReceipt.js +11 -11
  123. package/dist/runtime/sessionLaunchRequest.js +2 -2
  124. package/dist/runtime/sessionOwnerIdentity.js +9 -9
  125. package/dist/runtime/sessionOwnerRegistry.js +13 -13
  126. package/dist/runtime/sessionReconciliation.js +4 -4
  127. package/dist/runtime/sessionTerminationGuard.js +9 -9
  128. package/dist/runtime/sessionTokenMetrics.js +5 -7
  129. package/dist/runtime/structuredProviderHost.js +5 -5
  130. package/dist/runtime/taskRuntimeIsolation.js +24 -24
  131. package/dist/runtime/tmuxAdapters.js +32 -30
  132. package/dist/scheduler/activeRoleTurnDelivery.js +37 -15
  133. package/dist/scheduler/leaderWakeupProcessor.js +78 -55
  134. package/dist/scheduler/roleTurnLiveness.js +6 -6
  135. package/dist/scheduler/roleTurnStall.js +8 -9
  136. package/dist/scheduler/taskExecutionProjection.js +19 -41
  137. package/dist/scheduler/taskObservabilityProjection.js +75 -122
  138. package/dist/storage/sqliteSchema.js +1 -21
  139. package/dist/storage/sqliteStore.js +62 -47
  140. package/dist/storage/storageSchema.js +1 -8
  141. package/dist/storage/storageVersions.js +7 -4
  142. package/dist/storage/taskStore.js +8 -8
  143. package/dist/storage/upgrade/upgradeOrchestrator.js +112 -83
  144. package/dist/task/completionReadiness.js +17 -98
  145. package/dist/task/deliveryGuard.js +9 -11
  146. package/dist/task/draftPlan.js +142 -0
  147. package/dist/task/nextAction.js +179 -477
  148. package/dist/task/publicationVerification.js +1 -0
  149. package/dist/task/remoteDelivery.js +233 -0
  150. package/dist/task/task.js +108 -4
  151. package/dist/task/taskRecordReference.js +0 -1
  152. package/dist/turn/turn.js +109 -16
  153. package/dist/verification/verificationGateService.js +0 -26
  154. package/dist/web/assets/client/components.js +99 -121
  155. package/dist/web/assets/client/i18n.js +136 -58
  156. package/dist/web/assets/client/view.js +44 -0
  157. package/dist/web/assets/styles/cards.js +3 -15
  158. package/dist/web/assets/styles/widgets.js +4 -0
  159. package/dist/web/webSnapshot.js +29 -14
  160. package/dist/workItem/dependencyGate.js +34 -0
  161. package/dist/workItem/workItem.js +99 -266
  162. package/dist/workspace/workItemChangeSetManager.js +15 -59
  163. package/docs/task-local-identity.md +1 -1
  164. package/i18n/README.zh-CN.md +165 -59
  165. package/package.json +1 -1
  166. package/skills/yui-leader/SKILL.md +272 -782
  167. package/skills/yui-operator/SKILL.md +190 -365
  168. package/skills/yui-reviewer/SKILL.md +40 -33
  169. package/skills/yui-runtime/SKILL.md +27 -6
  170. package/skills/yui-worker/SKILL.md +19 -6
  171. package/dist/execution/candidateConvergence.js +0 -623
  172. package/dist/execution/executionGroup.js +0 -854
  173. package/dist/execution/resourceBroker.js +0 -426
  174. package/dist/executor/launchPlan.js +0 -16
  175. package/dist/review/reviewFinding.js +0 -240
  176. package/dist/review/reviewFindingLedger.js +0 -550
  177. package/dist/review/reviewOutcomeClassifier.js +0 -255
  178. package/dist/scheduler/resourceQueueProjection.js +0 -71
  179. package/dist/task/repairWave.js +0 -150
@@ -59,7 +59,7 @@ function durableConfigDomainNode(domain) {
59
59
  const values = CONFIG_KEY_VALUES.filter(({ name }) => keys.includes(name));
60
60
  const options = domain === "workflow"
61
61
  ? [
62
- "--soft-tokens", "--hard-tokens", "--role", "--trigger", "--finding-ledger"
62
+ "--soft-tokens", "--hard-tokens", "--role", "--trigger"
63
63
  ]
64
64
  : domain === "runtime"
65
65
  ? ["--quiet-after-seconds", "--diagnostic-after-seconds", "--stall-after-seconds"]
@@ -85,7 +85,6 @@ function durableConfigDomainNode(domain) {
85
85
  optionValues: domain === "workflow"
86
86
  ? {
87
87
  "--trigger": ["always", "leader", "final"],
88
- "--finding-ledger": ["shadow", "enforce"]
89
88
  }
90
89
  : {}
91
90
  },
@@ -142,7 +141,8 @@ const roleAgentClearOptions = [
142
141
  "--clear-search", "--clear-agent-config"
143
142
  ];
144
143
  const agentProfileOptions = [
145
- "--description", "--instructions", "--skill", "--model", "--effort"
144
+ "--description", "--instructions", "--skill",
145
+ "--agent", "--model", "--effort", "--inherit-worker"
146
146
  ];
147
147
  const agentProfileClearOptions = [
148
148
  "--clear-description", "--clear-instructions", "--clear-skills",
@@ -213,8 +213,8 @@ const globalSessionChildren = [
213
213
  const profileChildren = [
214
214
  {
215
215
  name: "add",
216
- summary: "Add a reusable Agent Profile.",
217
- usage: "yui config profile add <id> [--access <read|write>] [Profile settings]",
216
+ summary: "Add a reusable Agent Profile that inherits Worker runtime or selects one explicit Agent.",
217
+ usage: "yui config profile add <id> [--access <read|write>] [--inherit-worker | --agent <id> [--model <model>] [--effort <effort>]] [Profile settings]",
218
218
  options: ["--access", ...agentProfileOptions],
219
219
  optionValues: { "--access": ["read", "write"] }
220
220
  },
@@ -222,8 +222,8 @@ const profileChildren = [
222
222
  { name: "show", summary: "Show one Agent Profile.", usage: "yui config profile show <id>" },
223
223
  {
224
224
  name: "update",
225
- summary: "Update an Agent Profile.",
226
- usage: "yui config profile update <id> [--access <read|write>] [Profile settings]",
225
+ summary: "Update an Agent Profile's behavior or runtime source.",
226
+ usage: "yui config profile update <id> [--access <read|write>] [--inherit-worker | [--agent <id>] [--model <model>|--clear-model] [--effort <effort>|--clear-effort]] [Profile settings]",
227
227
  options: ["--access", ...agentProfileOptions, ...agentProfileClearOptions],
228
228
  optionValues: { "--access": ["read", "write"] }
229
229
  },
@@ -346,11 +346,17 @@ const taskChildren = [
346
346
  usage: "yui task next-action <task> [--json]",
347
347
  options: ["--json"]
348
348
  },
349
+ {
350
+ name: "remote-delivery",
351
+ summary: "Project exact Task heads and current PR/MR evidence into merge coverage.",
352
+ usage: "yui task remote-delivery <task> [--json]",
353
+ options: ["--json"]
354
+ },
349
355
  {
350
356
  name: "archive",
351
357
  summary: "Archive a Task after confirming the main worktree outcome.",
352
- usage: "yui task archive <id> (--integrated|--abandon)",
353
- options: ["--integrated", "--abandon"]
358
+ usage: "yui task archive <id> (--integrated [--force]|--abandon)",
359
+ options: ["--integrated", "--abandon", "--force"]
354
360
  },
355
361
  { name: "reconcile", summary: "Run one immediate Controller reconciliation.", usage: "yui task reconcile <id>" },
356
362
  {
@@ -360,9 +366,9 @@ const taskChildren = [
360
366
  children: [
361
367
  {
362
368
  name: "integrate",
363
- summary: "Merge the remote development head into the Task workspace.",
364
- usage: "yui task upstream integrate <task> [--latest] [--project <project>]",
365
- options: ["--latest", "--project"]
369
+ summary: "Rebase Task changes onto the remote development head through Integration.",
370
+ usage: "yui task upstream integrate <task> (--latest|--project <project>) [--check <command> ...]",
371
+ options: ["--latest", "--project", "--check"]
366
372
  }
367
373
  ]
368
374
  },
@@ -375,7 +381,7 @@ const taskChildren = [
375
381
  {
376
382
  name: "message",
377
383
  summary: "Manage durable Task messages.",
378
- sections: [{ id: "manage", title: "Commands", entries: ["send", "list", "retire"] }],
384
+ sections: [{ id: "manage", title: "Commands", entries: ["send", "list", "update", "retire"] }],
379
385
  children: [
380
386
  {
381
387
  name: "send",
@@ -393,6 +399,16 @@ const taskChildren = [
393
399
  usage: "yui task message list <id> [--after <timestamp>] [--limit <n>]",
394
400
  options: ["--after", "--limit"]
395
401
  },
402
+ {
403
+ name: "update",
404
+ summary: "Replace the mutable body and wake policy of a Draft user/operator Message.",
405
+ usage: "yui task message update <task>/<message> (<body>|--body-file <path|->) [--wake-policy leader|none]",
406
+ options: ["--body-file", "--wake-policy"],
407
+ optionValues: {
408
+ "--wake-policy": ["leader", "none"]
409
+ },
410
+ fileOptions: ["--body-file"]
411
+ },
396
412
  {
397
413
  name: "retire",
398
414
  summary: "Retire an incorrect historical Task Message without deleting its audit record.",
@@ -509,14 +525,19 @@ const taskChildren = [
509
525
  },
510
526
  {
511
527
  name: "publication",
512
- summary: "Record external PR/MR publication evidence for a Task.",
513
- sections: [{ id: "manage", title: "Commands", entries: ["add", "list", "show"] }],
528
+ summary: "Create or update external PR/MR publication evidence for a Task.",
529
+ sections: [{ id: "manage", title: "Commands", entries: ["upsert", "verify", "list", "show"] }],
514
530
  children: [
515
531
  {
516
- name: "add",
517
- summary: "Record an external PR/MR and its publication state.",
518
- usage: "yui task publication add <task> --project <project> --provider <github|gitlab> --repository <owner/name> --kind <pull-request|merge-request> --id <external-id> [--url <url>] [--title <text>] [--source-branch <branch>] [--target-branch <branch>] [--local-commit <sha>] [--remote-commit <sha>] [--state <open|merged|closed>] [--reported|--verified] [--evidence <text>] [--supersede <publication-id>] [--merged-at <iso-timestamp>]",
519
- options: ["--project", "--provider", "--repository", "--kind", "--id", "--url", "--title", "--source-branch", "--target-branch", "--local-commit", "--remote-commit", "--state", "--reported", "--verified", "--evidence", "--supersede", "--merged-at"]
532
+ name: "upsert",
533
+ summary: "Create or immutably update an external PR/MR and its publication state.",
534
+ usage: "yui task publication upsert <task> --project <project> --provider <github|gitlab> --repository <owner/name> --kind <pull-request|merge-request> --id <external-id> [--url <url>] [--title <text>] [--source-branch <branch>] [--target-branch <branch>] [--local-commit <sha>] [--remote-commit <sha>] [--state <open|merged|closed>] [--reported|--verified] [--evidence <text>] [--merged-at <iso-timestamp>]",
535
+ options: ["--project", "--provider", "--repository", "--kind", "--id", "--url", "--title", "--source-branch", "--target-branch", "--local-commit", "--remote-commit", "--state", "--reported", "--verified", "--evidence", "--merged-at"]
536
+ },
537
+ {
538
+ name: "verify",
539
+ summary: "Verify one current GitHub PR against the exact Task delivery head through gh.",
540
+ usage: "yui task publication verify (<task>/<publication-id> | <task> <publication-id>)"
520
541
  },
521
542
  {
522
543
  name: "list",
@@ -540,8 +561,8 @@ const taskChildren = [
540
561
  children: [
541
562
  {
542
563
  name: "add",
543
- summary: "Add a Role to a Task.",
544
- usage: "yui task role add <task> <name> [--profile <id>] [--agent <id>] [Role and Agent settings]",
564
+ summary: "Add a Task Role from a frozen Profile/Worker runtime or one explicit Agent.",
565
+ usage: "yui task role add <task> <name> [--profile <id>] [--agent <id> [Agent settings]] [Role settings]",
545
566
  options: ["--profile", "--agent", ...roleProfileOptions, ...roleAgentOptions],
546
567
  optionValues: roleAgentOptionValues
547
568
  },
@@ -554,8 +575,8 @@ const taskChildren = [
554
575
  { name: "show", summary: "Show one Task Role.", usage: "yui task role show <task> <role>" },
555
576
  {
556
577
  name: "update",
557
- summary: "Update a Task Role.",
558
- usage: "yui task role update <task> <role> [Role and Agent settings]",
578
+ summary: "Update a Task Role; Agent settings target the named or active binding without switching it.",
579
+ usage: "yui task role update <task> <role> [--profile <id>] [--agent <id>] [Role and Agent settings]",
559
580
  options: ["--profile", "--agent", ...roleProfileOptions, ...roleAgentOptions,
560
581
  ...roleProfileClearOptions, ...roleAgentClearOptions],
561
582
  optionValues: roleAgentOptionValues
@@ -606,8 +627,8 @@ const taskChildren = [
606
627
  id: "manage",
607
628
  title: "Commands",
608
629
  entries: [
609
- "create", "list", "show", "update", "scope", "dispatch", "isolate", "capture", "cleanup",
610
- "review", "group", "accept", "reject", "retire"
630
+ "create", "list", "show", "edit", "update", "scope", "dispatch", "isolate", "capture", "cleanup",
631
+ "review", "accept", "reject", "retire"
611
632
  ]
612
633
  }],
613
634
  children: [
@@ -619,6 +640,16 @@ const taskChildren = [
619
640
  },
620
641
  { name: "list", summary: "List work items for a Task.", usage: "yui task work list <task>" },
621
642
  { name: "show", summary: "Show one Work Item.", usage: "yui task work show <work>" },
643
+ {
644
+ name: "edit",
645
+ summary: "Replace mutable definition fields on an execution-free Draft WorkItem.",
646
+ usage: "yui task work edit <task>/<work> [--title <text>] [--objective <text>] [--accept <criterion> ...|--clear-acceptance] [--after <work> ...|--clear-dependencies] [--project <project> ...|--clear-projects] [--base-ref <project>=<ref> ...|--clear-base-refs] [--role <name>|--clear-role]",
647
+ options: [
648
+ "--title", "--objective", "--accept", "--clear-acceptance",
649
+ "--after", "--clear-dependencies", "--project", "--clear-projects",
650
+ "--base-ref", "--clear-base-refs", "--role", "--clear-role"
651
+ ]
652
+ },
622
653
  {
623
654
  name: "update",
624
655
  summary: "Update a work item's state.",
@@ -637,24 +668,8 @@ const taskChildren = [
637
668
  {
638
669
  name: "dispatch",
639
670
  summary: "Dispatch a work item to its Role.",
640
- usage: "yui task work dispatch <task>/<work> [--input <text>] [--strategy fixed:<count>|adaptive:<max>] [--lane-role <role> ...] [--mode <single|parallel-diverse|ensemble-replicated|adversarial|adaptive-exploration>] [--max-rounds <count>] [--stage-max-attempts <count>] [--stage-max-tokens <count>] [--stage-max-tool-calls <count>] [--stage-max-seconds <count>] [--stage-quorum <count>] [--stage-straggler-seconds <count>] [--stage-min-marginal-value <0-100>]",
641
- options: ["--input", "--strategy", "--lane-role", "--mode", "--max-rounds", "--stage-max-attempts", "--stage-max-tokens", "--stage-max-tool-calls", "--stage-max-seconds", "--stage-quorum", "--stage-straggler-seconds", "--stage-min-marginal-value"],
642
- optionValues: {
643
- "--mode": ["single", "parallel-diverse", "ensemble-replicated", "adversarial", "adaptive-exploration"]
644
- }
645
- },
646
- {
647
- name: "group",
648
- summary: "Resolve a Worker ExecutionGroup after its Lanes finish.",
649
- executable: true,
650
- sections: [{ id: "manage", title: "Commands", entries: ["resolve"] }],
651
- children: [{
652
- name: "resolve",
653
- summary: "Select Lane outputs and resolve the Worker group.",
654
- usage: "yui task work group resolve <task>/<work> --decision <accept|reject|retry|blocked> --summary <text> [--lane <lane-id> ...] [--early-stop <marginal-value-percent>]",
655
- options: ["--decision", "--summary", "--lane", "--early-stop"],
656
- optionValues: { "--decision": ["accept", "reject", "retry", "blocked"] }
657
- }]
671
+ usage: "yui task work dispatch <task>/<work> [--input <text>] [--lane-role <role> ...]",
672
+ options: ["--input", "--lane-role"]
658
673
  },
659
674
  {
660
675
  name: "isolate",
@@ -674,8 +689,9 @@ const taskChildren = [
674
689
  },
675
690
  {
676
691
  name: "review",
677
- summary: "Ask the configured reviewer to inspect a WorkItem candidate.",
678
- usage: "yui task work review <task>/<work>",
692
+ summary: "Ask the configured reviewer to inspect a WorkItem candidate directly or with replicated Producers.",
693
+ usage: "yui task work review <task>/<work> [--lane-role <producer-role> --lane-role <producer-role> ...]",
694
+ options: ["--lane-role"],
679
695
  executable: true,
680
696
  sections: [
681
697
  { id: "retry", title: "Task-final recovery", entries: ["retry"] },
@@ -732,12 +748,12 @@ const taskChildren = [
732
748
  },
733
749
  {
734
750
  name: "retry",
735
- summary: "Retry a failed execution Turn or request a fresh Round for an exact failed final Review Turn.",
751
+ summary: "Retry an exact failed execution or review Turn while preserving its semantic unit.",
736
752
  usage: "yui task turn retry <task>/<turn>"
737
753
  },
738
754
  {
739
755
  name: "settle",
740
- summary: "Close an obsolete stranded final Review Turn without requesting a retry Round.",
756
+ summary: "Explicitly settle a failed WorkItem Lane or an obsolete stranded final Review Turn.",
741
757
  usage: "yui task turn settle <task>/<turn>"
742
758
  },
743
759
  {
@@ -781,83 +797,32 @@ const taskChildren = [
781
797
  {
782
798
  name: "review",
783
799
  summary: "Control Task-final ReviewRounds.",
784
- sections: [{ id: "manage", title: "Commands", entries: ["request", "force-fresh", "group", "retry", "finding"] }],
800
+ sections: [{ id: "manage", title: "Commands", entries: ["request", "retry"] }],
785
801
  children: [
786
802
  {
787
803
  name: "request",
788
- summary: "Request one Task-local final ReviewRound from a Global Role.",
789
- usage: "yui task review request <task> --role <global-role> [--strategy fixed:<count>|adaptive:<max>] [--lane-role <role> ...] [--delta-recheck]",
790
- options: ["--role", "--strategy", "--lane-role", "--delta-recheck"]
791
- },
792
- {
793
- name: "force-fresh",
794
- summary: "Replace one exact terminal non-semantic Task-final Review with a distinct full Round.",
795
- usage: "yui task review force-fresh <task>/<review-round>"
796
- },
797
- {
798
- name: "group",
799
- summary: "Resolve a Reviewer ExecutionGroup after its Lanes finish.",
800
- executable: true,
801
- sections: [{ id: "manage", title: "Commands", entries: ["resolve"] }],
802
- children: [{
803
- name: "resolve",
804
- summary: "Select Reviewer Lane evidence and resolve the group.",
805
- usage: "yui task review group resolve <task>/<review-round> --decision <accept|reject|blocked> --summary <text> [--lane <lane-id> ...]",
806
- options: ["--decision", "--summary", "--lane"],
807
- optionValues: { "--decision": ["accept", "reject", "blocked"] }
808
- }]
804
+ summary: "Request a direct or replicated Task-local final ReviewRound.",
805
+ usage: "yui task review request <task> --role <main-role> [--lane-role <producer-role> --lane-role <producer-role> ...] [--delta-recheck]",
806
+ options: ["--role", "--lane-role", "--delta-recheck"]
809
807
  },
810
808
  {
811
809
  name: "retry",
812
810
  summary: "Retry a failed Task-final ReviewRound without a Reviewer Turn.",
813
811
  usage: "yui task review retry <task>/<review-round>"
814
- },
815
- {
816
- name: "finding",
817
- summary: "Inspect and disposition the cross-Round Review finding ledger.",
818
- executable: true,
819
- sections: [{ id: "manage", title: "Commands", entries: ["list", "dispose", "repair-wave", "extract"] }],
820
- children: [
821
- {
822
- name: "list",
823
- summary: "List the Task's review findings with disposition and repair lineage.",
824
- usage: "yui task review finding list <task>"
825
- },
826
- {
827
- name: "dispose",
828
- summary: "Record one Leader disposition for a review finding.",
829
- usage: "yui task review finding dispose <task>/<finding> --disposition <fixed-pending-review|verified-fixed|accepted-risk|not-actionable|superseded> [--work-item <id>] [--commit <sha>] [--verification <text>] [--note <text>] [--superseded-by <stable-key>]",
830
- options: ["--disposition", "--work-item", "--commit", "--verification", "--note", "--superseded-by"],
831
- optionValues: {
832
- "--disposition": ["fixed-pending-review", "verified-fixed", "accepted-risk", "not-actionable", "superseded"]
833
- }
834
- },
835
- {
836
- name: "repair-wave",
837
- summary: "Consolidate open P1/P2 findings, or explicitly plan parallel repair groups.",
838
- usage: "yui task review finding repair-wave <task> [--strategy <consolidated|parallel>] [--create]",
839
- options: ["--strategy", "--create"],
840
- optionValues: { "--strategy": ["consolidated", "parallel"] }
841
- },
842
- {
843
- name: "extract",
844
- summary: "Reconcile findings from one completed ReviewRound into the ledger.",
845
- usage: "yui task review finding extract <task>/<review-round>"
846
- }
847
- ]
848
812
  }
849
813
  ]
850
814
  },
851
815
  {
852
816
  name: "integration",
853
- summary: "Safely integrate ChangeSets with Leader-owned conflict decisions.",
817
+ summary: "Integrate WorkItem results and upstream commits with Leader-owned decisions.",
854
818
  sections: [{ id: "manage", title: "Commands", entries: ["start", "continue", "resolve", "abort", "supersede", "list", "show", "cleanup", "queue"] }],
855
819
  children: [
856
820
  {
857
821
  name: "start",
858
822
  summary: "Build, validate, and CAS-commit an integration candidate.",
859
- usage: "yui task integration start <task> [--project <project>] --change-set <id> [--change-set <id> ...] [--target <ref>] [--check <command> ...]",
860
- options: ["--project", "--change-set", "--target", "--check"]
823
+ usage: "yui task integration start <task> --work-item <id> --strategy <ff|cherry-pick|merge|manual> [--project <project>] [--target <ref>] [--check <command> ...]",
824
+ options: ["--work-item", "--strategy", "--project", "--target", "--check"],
825
+ optionValues: { "--strategy": ["ff", "cherry-pick", "merge", "manual"] }
861
826
  },
862
827
  {
863
828
  name: "continue",
@@ -1030,7 +995,7 @@ export const ROOT_COMMAND = buildNode({
1030
995
  { name: "update", summary: "Install the latest published Yui package globally." },
1031
996
  {
1032
997
  name: "upgrade",
1033
- summary: "Inspect this Home and apply any supported storage upgrade.",
998
+ summary: "Validate this Home against the exact current storage contract.",
1034
999
  usage: "yui upgrade [--dry-run]",
1035
1000
  options: ["--dry-run"]
1036
1001
  },
@@ -1074,7 +1039,7 @@ export const ROOT_COMMAND = buildNode({
1074
1039
  },
1075
1040
  {
1076
1041
  name: "live-identity",
1077
- summary: "Read the authenticated live Controller launch identity.",
1042
+ summary: "Read the authenticated live Controller runtime generation identity.",
1078
1043
  hidden: true
1079
1044
  },
1080
1045
  { name: "stop", summary: "Stop the Controller." },
@@ -1415,7 +1380,7 @@ export const ROOT_COMMAND = buildNode({
1415
1380
  name: "task",
1416
1381
  summary: "Manage Tasks, WorkItems, Turns, and integration.",
1417
1382
  sections: [
1418
- { id: "lifecycle", title: "Lifecycle", entries: ["create", "project", "base", "update", "activate", "execution", "complete", "reopen", "retire", "list", "show", "context", "next-action", "archive", "replace", "reconcile", "upstream"] },
1383
+ { id: "lifecycle", title: "Lifecycle", entries: ["create", "project", "base", "update", "activate", "execution", "complete", "reopen", "retire", "list", "show", "context", "next-action", "remote-delivery", "archive", "replace", "reconcile", "upstream"] },
1419
1384
  { id: "collaboration", title: "Collaboration", entries: ["message", "input", "grant", "workflow", "publication", "work", "turn", "review", "integration", "role", "overlap", "change-set"] },
1420
1385
  { id: "knowledge", title: "Task Knowledge", entries: ["brief", "decision", "milestone", "event", "continuation", "wake"] }
1421
1386
  ],
@@ -32,8 +32,7 @@ function describeOption(option) {
32
32
  "--role": "Select a Task role.",
33
33
  "--summary": "Set summary text.",
34
34
  "--task": "Select a Task.",
35
- "--trigger": "Set the review trigger (always, leader, final).",
36
- "--finding-ledger": "Set the review finding ledger mode (shadow, enforce)."
35
+ "--trigger": "Set the review trigger (always, leader, final)."
37
36
  };
38
37
  return descriptions[option] ?? `Set ${option.slice(2).replaceAll("-", " ")}.`;
39
38
  }
@@ -60,6 +60,8 @@ export async function getSelectionCandidates(selector, ports, args) {
60
60
  return null;
61
61
  return entities("milestone", `Select Milestone: ${taskId}`, await list(ports, "task.milestone.list", { taskId }), ["id", "title", "createdAt"]);
62
62
  }
63
+ case "messages":
64
+ return entities("message", "Select Task message", qualifyTaskRecords(await listAllMessages(ports)), ["qualifiedId", "kind", "createdAt", "body"]);
63
65
  case "task-events": {
64
66
  const taskId = dependencyValue(selector, args);
65
67
  if (taskId === undefined)
@@ -109,6 +111,14 @@ async function listAllWorkItems(ports) {
109
111
  }));
110
112
  return groups.flat();
111
113
  }
114
+ async function listAllMessages(ports) {
115
+ const tasks = await list(ports, "task.list", {});
116
+ const groups = await Promise.all(tasks.flatMap((task) => {
117
+ const taskId = stringField(task, "id");
118
+ return taskId === undefined ? [] : [list(ports, "task.message.list", { taskId })];
119
+ }));
120
+ return groups.flat();
121
+ }
112
122
  async function listAllByTask(ports, method, resultKey) {
113
123
  const tasks = await list(ports, "task.list", {});
114
124
  const groups = await Promise.all(tasks.flatMap((task) => {
@@ -130,7 +130,8 @@ export const INTERACTION_POLICIES = Object.freeze([
130
130
  selectors: [],
131
131
  trailingOptions: {
132
132
  "--description": "value", "--instructions": "value",
133
- "--skill": "value", "--model": "value", "--effort": "value", "--access": "value"
133
+ "--skill": "value", "--agent": "value", "--model": "value",
134
+ "--effort": "value", "--access": "value", "--inherit-worker": "flag"
134
135
  }
135
136
  },
136
137
  ...["show", "update", "remove"].map((command) => ({
@@ -146,8 +147,11 @@ export const INTERACTION_POLICIES = Object.freeze([
146
147
  trailingOptions: {
147
148
  "--description": "option-like-value",
148
149
  "--instructions": "option-like-value", "--skill": "value",
150
+ "--agent": "value", "--inherit-worker": "flag",
149
151
  "--model": "option-like-value", "--effort": "option-like-value",
150
- "--access": "value"
152
+ "--access": "value", "--clear-description": "flag",
153
+ "--clear-instructions": "flag", "--clear-skills": "flag",
154
+ "--clear-model": "flag", "--clear-effort": "flag"
151
155
  }
152
156
  }
153
157
  : {}),
@@ -191,9 +195,13 @@ export const INTERACTION_POLICIES = Object.freeze([
191
195
  selectors: [],
192
196
  trailingOptions: { "--all": "flag", "--verbose": "flag" }
193
197
  },
198
+ {
199
+ ...taskTarget("remote-delivery"),
200
+ trailingOptions: { "--json": "flag" }
201
+ },
194
202
  {
195
203
  ...taskTarget("archive", 2, ["completed", "retired"]),
196
- trailingOptions: { "--integrated": "flag", "--abandon": "flag" },
204
+ trailingOptions: { "--integrated": "flag", "--abandon": "flag", "--force": "flag" },
197
205
  confirmation: { action: "Archive task", targetArgumentIndex: 2 }
198
206
  },
199
207
  taskTarget("reconcile"),
@@ -226,6 +234,27 @@ export const INTERACTION_POLICIES = Object.freeze([
226
234
  actionTarget: true
227
235
  }]
228
236
  })),
237
+ {
238
+ commandPath: ["task", "message", "update"],
239
+ selectors: [{
240
+ argumentIndex: 3,
241
+ entity: "message",
242
+ provider: "messages",
243
+ actionTarget: true
244
+ }],
245
+ trailingOptions: { "--body-file": "value", "--wake-policy": "value" }
246
+ },
247
+ {
248
+ commandPath: ["task", "message", "retire"],
249
+ selectors: [{
250
+ argumentIndex: 3,
251
+ entity: "message",
252
+ provider: "messages",
253
+ actionTarget: true
254
+ }],
255
+ trailingOptions: { "--reason": "value" },
256
+ confirmation: { action: "Retire Task Message", targetArgumentIndex: 3 }
257
+ },
229
258
  {
230
259
  commandPath: ["task", "input", "request"],
231
260
  selectors: [{
@@ -372,14 +401,15 @@ export const INTERACTION_POLICIES = Object.freeze([
372
401
  }
373
402
  ],
374
403
  trailingOptions: {
375
- "--objective": "value", "--accept": "value", "--after": "value", "--role": "value"
404
+ "--objective": "value", "--accept": "value", "--after": "value", "--role": "value",
405
+ "--project": "value", "--base-ref": "value"
376
406
  }
377
407
  },
378
408
  {
379
409
  commandPath: ["task", "work", "list"],
380
410
  selectors: [{ argumentIndex: 3, entity: "task", provider: "tasks", actionTarget: true }]
381
411
  },
382
- ...["show", "update", "dispatch", "isolate", "capture", "cleanup", "accept", "reject"]
412
+ ...["show", "edit", "update", "dispatch", "isolate", "capture", "cleanup", "accept", "reject"]
383
413
  .map((command) => ({
384
414
  commandPath: ["task", "work", command],
385
415
  selectors: [{
@@ -388,20 +418,37 @@ export const INTERACTION_POLICIES = Object.freeze([
388
418
  provider: "work-items",
389
419
  actionTarget: true
390
420
  }],
391
- ...(command === "update"
392
- ? { trailingOptions: { "--summary": "value" } }
393
- : command === "dispatch"
394
- ? { trailingOptions: { "--input": "value" } }
395
- : command === "cleanup"
396
- ? {
397
- trailingOptions: {
398
- "--integrated": "flag",
399
- "--abandon": "flag"
421
+ ...(command === "edit"
422
+ ? {
423
+ trailingOptions: {
424
+ "--title": "value",
425
+ "--objective": "value",
426
+ "--accept": "value",
427
+ "--clear-acceptance": "flag",
428
+ "--after": "value",
429
+ "--clear-dependencies": "flag",
430
+ "--project": "value",
431
+ "--clear-projects": "flag",
432
+ "--base-ref": "value",
433
+ "--clear-base-refs": "flag",
434
+ "--role": "value",
435
+ "--clear-role": "flag"
436
+ }
437
+ }
438
+ : command === "update"
439
+ ? { trailingOptions: { "--summary": "value" } }
440
+ : command === "dispatch"
441
+ ? { trailingOptions: { "--input": "value" } }
442
+ : command === "cleanup"
443
+ ? {
444
+ trailingOptions: {
445
+ "--integrated": "flag",
446
+ "--abandon": "flag"
447
+ }
400
448
  }
401
- }
402
- : ["accept", "reject"].includes(command)
403
- ? { trailingOptions: { "--summary": "value" } }
404
- : {})
449
+ : ["accept", "reject"].includes(command)
450
+ ? { trailingOptions: { "--summary": "value" } }
451
+ : {})
405
452
  })),
406
453
  {
407
454
  commandPath: ["task", "work", "retire"],
@@ -436,20 +483,6 @@ export const INTERACTION_POLICIES = Object.freeze([
436
483
  actionTarget: true
437
484
  }]
438
485
  },
439
- {
440
- commandPath: ["task", "work", "group", "resolve"],
441
- selectors: [{
442
- argumentIndex: 4,
443
- entity: "work-item",
444
- provider: "work-items",
445
- actionTarget: true
446
- }],
447
- trailingOptions: {
448
- "--decision": "value",
449
- "--summary": "value",
450
- "--lane": "value"
451
- }
452
- },
453
486
  {
454
487
  commandPath: ["task", "review", "request"],
455
488
  selectors: [
@@ -467,22 +500,28 @@ export const INTERACTION_POLICIES = Object.freeze([
467
500
  actionTarget: false
468
501
  }
469
502
  ],
470
- trailingOptions: { "--role": "value", "--strategy": "value", "--lane-role": "value" }
503
+ trailingOptions: { "--role": "value", "--lane-role": "value" }
471
504
  },
472
505
  {
473
506
  commandPath: ["task", "integration", "start"],
474
507
  selectors: [
475
508
  { argumentIndex: 3, entity: "task", provider: "tasks", actionTarget: true },
476
509
  {
477
- option: "--change-set",
510
+ option: "--work-item",
478
511
  requiredOption: true,
479
- entity: "change-set",
480
- provider: "change-sets",
512
+ entity: "work-item",
513
+ provider: "work-items",
481
514
  dependsOn: 3,
482
515
  actionTarget: false
483
516
  }
484
517
  ],
485
- trailingOptions: { "--change-set": "value", "--target": "value", "--check": "value" }
518
+ trailingOptions: {
519
+ "--work-item": "value",
520
+ "--strategy": "value",
521
+ "--project": "value",
522
+ "--target": "value",
523
+ "--check": "value"
524
+ }
486
525
  },
487
526
  {
488
527
  commandPath: ["task", "integration", "list"],
@@ -75,18 +75,17 @@ async function addTaskRole(args, ports, io) {
75
75
  return { kind: "cancelled", args: withTask };
76
76
  if (hasExplicitAddSettings(named, 5))
77
77
  return { kind: "resolved", args: named };
78
- const roleName = named[4] ?? "";
79
- const [globalRoleValue, agents] = await Promise.all([
80
- Promise.resolve(ports.call("role.show", { name: roleName })),
78
+ const [workerRoleValue, agents] = await Promise.all([
79
+ Promise.resolve(ports.call("role.show", { name: "worker" })),
81
80
  loadAgentSelection(ports)
82
81
  ]);
83
- const globalRole = asRole(globalRoleValue);
82
+ const workerRole = asRole(workerRoleValue);
84
83
  const explicitAgent = optionValue(named, "--agent");
85
- if (globalRole !== undefined && explicitAgent === undefined) {
84
+ if (workerRole !== undefined && explicitAgent === undefined) {
86
85
  const source = await choose("Create Task Role from", [
87
86
  {
88
87
  value: "copy",
89
- cells: ["Copy existing Global Role", `Active Agent: ${globalRole.activeAgentId}`]
88
+ cells: ["Copy Global Worker", `Active Agent: ${workerRole.activeAgentId}`]
90
89
  },
91
90
  {
92
91
  value: "agent",