@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
@@ -30,6 +30,21 @@ frozen Project commits, and assigned workspace. Inspect those exact commits.
30
30
  The current mutable Task-main checkout is context only and must never replace,
31
31
  widen, or silently update the assigned Review scope.
32
32
 
33
+ The Turn also identifies the execution shape. A direct Review Turn is the main
34
+ Reviewer and produces the authoritative Review result. In replicated Review,
35
+ a Producer Lane independently inspects the same frozen Assignment in its own
36
+ Lane workspace and returns one complete original result. A Producer result is
37
+ non-authoritative: do not create a Candidate, ChangeSet, integration, or
38
+ completion decision.
39
+
40
+ Only the main Reviewer synthesis Turn may interpret all stable successful
41
+ Producer results and complete the ReviewRound. Read every exact source Turn's
42
+ original result, inspect every supplied result,
43
+ resolve disagreement through judgment against the frozen sources, and return
44
+ one complete authoritative report. Do not select a winning Lane, mutate
45
+ Producer results, rerun successful Producers, or omit a successful result from
46
+ the synthesis.
47
+
33
48
  ## Separate infrastructure failure from review judgment
34
49
 
35
50
  Verify the exact Turn identity, Context Pack, frozen head, and ReviewRound-owned
@@ -38,20 +53,13 @@ binding fails before review begins:
38
53
 
39
54
  - do not inspect the candidate, run candidate checks, invent findings, accept
40
55
  risk, or claim the frozen result was reviewed;
41
- - return only the exact infrastructure diagnosis, with no semantic findings or
42
- checks, through the assigned Review Turn;
56
+ - return the exact infrastructure diagnosis through the assigned Review Turn;
43
57
  - do not recommend a Repair WorkItem—the Leader must recover the same frozen
44
- review boundary with `task review force-fresh` when Yui proves the outcome
45
- non-semantic;
58
+ review boundary with Yui's projected same-Round `task review retry` or exact
59
+ `task turn retry`;
46
60
  - if any candidate inspection or Reviewer output did occur, report it
47
- explicitly. Mixed infrastructure and semantic evidence is ambiguous and must
48
- fail closed, never be relabeled as a clean transport failure.
49
-
50
- Yui derives `semantic`, `non-semantic`, or `ambiguous` from the immutable
51
- Round, Turn receipt, completion Event, and finding evidence. Never write or
52
- simulate a classification field. A non-semantic attempt cannot satisfy
53
- acceptance; an ambiguous attempt requires
54
- Leader diagnosis before another review or repair decision.
61
+ explicitly so the Leader can judge what remains useful. Core records only
62
+ the execution boundary and never classifies the meaning of this prose.
55
63
 
56
64
  The Review scope remains the current Turn's frozen candidate even if the Leader
57
65
  handles new user input or advances Task main while this Review is running. Do
@@ -59,15 +67,10 @@ not switch to the newer head, cancel the current inspection, or claim the
59
67
  result covers anything beyond the frozen candidate.
60
68
 
61
69
  For a Delta Recheck, judge only the verified baseline plus the exact supplied
62
- diff. Return exactly one explicit disposition with reasoning:
63
-
64
- - `equivalent-and-accepted` when the new candidate preserves the accepted
65
- semantics and evidence;
66
- - `finding` for a reachable material defect;
67
- - `requires-full-review` when equivalence cannot be established.
68
-
69
- Never create or request a follow-up Round yourself: `requires-full-review`, a
70
- finding, and every uncertainty return to the Leader for routing.
70
+ diff. State clearly whether the new candidate remains equivalent, has a
71
+ material defect, or needs a full Review, and explain why. These are recommended
72
+ conclusions for the Leader, not machine-readable dispositions. Never create or
73
+ request a follow-up Round yourself.
71
74
 
72
75
  Keep the context layers distinct. Yui Core owns ReviewRound identity,
73
76
  lifecycle, access, workspace, and exact Turn-result correlation; this generic Skill owns
@@ -75,18 +78,17 @@ portable review behavior; Agent-native Project Skills and Project Policy and
75
78
  Knowledge own project-specific checks and review expectations; and the Task
76
79
  Contract owns the current outcome, scope, acceptance, and required evidence.
77
80
 
78
- Treat real models, paid APIs, shared infrastructure, production systems, real
79
- account quota, and every other non-disposable external resource as user-owned
80
- authority. A generic request to implement, test, validate, run E2E, or
81
- complete work does not grant that authority; neither do available credentials,
82
- an installed provider CLI, a Project Policy, or a test label. Unless the user
83
- proactively names the concrete real-resource validation, skip it without
84
- creating an InputRequest or blocking the ReviewRound. Prefer existing
85
- deterministic evidence, mocks, and isolated resources, then report the
86
- verification gap and an optional follow-up. An explicit request authorizes
87
- only its named resource, effect, and isolation boundary; never broaden it. A
88
- real Agent may develop or review code, but that does not authorize a real
89
- provider/model test.
81
+ Review design complexity against the current Task Contract and reachable
82
+ operating paths. Report abstractions, state, indirection, fallback, or module
83
+ boundaries whose complete lifecycle cost exceeds their demonstrated value.
84
+ Do not demand generic frameworks, exhaustive edge handling, or speculative
85
+ future-proofing merely because they are possible. A focused redesign is
86
+ appropriate when repeated patches expose a wrong responsibility or duplicated
87
+ authority.
88
+
89
+ Follow `yui-runtime`'s distinction between normal Agent execution and
90
+ real-resource validation. This Reviewer Turn is normal execution; additional
91
+ live-provider, paid, shared, or production validation is not implied.
90
92
 
91
93
  Complete the assigned frozen-scope review before ending the Provider Turn. Accumulate all
92
94
  reachable findings, verification gaps, checks actually run, and bounded next
@@ -96,6 +98,11 @@ judgment; it does not accept the WorkItem or complete the Task. Preserve the
96
98
  ReviewRound record and explicitly clean its workspace after the round is
97
99
  terminal.
98
100
 
101
+ A helpful default result layout is Conclusion, Material findings, Verification,
102
+ Uncertainty, and Recommended next action. Markdown or JSON are both acceptable.
103
+ Yui preserves the original text and does not parse, normalize, or reject it for
104
+ missing headings, field names, or formatting.
105
+
99
106
  For normal software delivery, follow the applicable Project Policy. The
100
107
  Leader decides whether risk warrants one independent Task-final Review of the
101
108
  frozen Task result instead of scheduling a complete ReviewRound for every WorkItem.
@@ -39,21 +39,42 @@ For every managed Task Turn:
39
39
  If no cursor is available, reload the exact pack; do not reconstruct state
40
40
  from transcript memory.
41
41
 
42
+ `liveTaskState.activeTurns` and `liveTaskState.activeTaskReviews` are
43
+ observational views of work currently in flight. They grant no authority and
44
+ create no Task-wide lock or gate; use each exact Turn or Review binding when a
45
+ decision depends on it.
46
+
42
47
  The pack's authority view and writable Project IDs are hard boundaries. A
43
48
  native subagent inherits the parent Turn's refs and authority; it does not gain a
44
49
  new Yui actor, Turn, Session, or cross-Task read permission.
45
50
 
46
- For a global Operator or custom GlobalRole Session, load the stable authorized view
47
- before routing or acting:
48
-
49
- ```sh
50
- "$YUI_SESSION_CLI" session context "$YUI_ROLE" --json
51
- ```
51
+ For a global Operator or custom GlobalRole Session, execute the exact
52
+ `contextProtocol.loadCommand` carried by the current Session Manifest before
53
+ routing or acting. That command is self-contained because a Global Codex Thread
54
+ may move between Yui's remote TUI and Desktop; never reconstruct it from
55
+ `YUI_SESSION_*` process variables.
52
56
 
53
57
  Global context grants no Task implementation workspace. Read a Task only after
54
58
  the Operator has routed to its public/task-authorized context command; never
55
59
  invent a Task Turn identity for a GlobalRole.
56
60
 
61
+ ## Separate execution from real-resource validation
62
+
63
+ The current Leader and configured Worker, Reviewer, Operator, custom Role, and
64
+ native child Agents are normal execution resources. They may develop, inspect,
65
+ and review within their existing Task authority without additional user
66
+ authorization merely because the Agent uses a real model.
67
+
68
+ Using a live provider or model as the subject of validation is different.
69
+ Paid APIs, shared infrastructure, production systems, real account quota, and
70
+ other non-disposable external effects require the user to proactively authorize
71
+ that exact resource and effect boundary. A generic request to implement, test,
72
+ validate, run E2E, or complete a Task does not grant that authority.
73
+
74
+ When such validation was not requested, use deterministic or isolated evidence,
75
+ state the material gap, and optionally recommend a separate follow-up. Do not
76
+ create an InputRequest merely to solicit permission for it.
77
+
57
78
  Provider acceptance, Context load, Turn completion, and Task completion are
58
79
  separate facts. For a managed Task Turn, end the Provider Turn with one truthful
59
80
  final report. Yui automatically correlates that native terminal with the exact
@@ -49,6 +49,13 @@ pack.
49
49
  exact Project, reason, impact, and Leader decision needed. Continue only
50
50
  after a new exact dispatch authorizes it.
51
51
 
52
+ Implement the smallest coherent design that satisfies the current WorkItem.
53
+ Reuse established responsibilities and patterns when they fit. Use a bounded
54
+ refactor when repeated patches expose the wrong boundary, but do not add
55
+ frameworks, configuration, fallbacks, compatibility paths, or abstractions for
56
+ hypothetical future variants. Keep coupled changes together and avoid turning
57
+ small helpers into independently managed architecture.
58
+
52
59
  For Project-backed delivery, commit the Develop workspace changes and leave it
53
60
  clean before handoff so Yui can freeze the exact Candidate head. ReviewRound
54
61
  workspaces are diagnostic evidence owners, never ChangeSet sources. Do not
@@ -63,10 +70,9 @@ changed behavior; do not repeat an unchanged successful check. Follow Project
63
70
  Policy for required validation and state passed, failed, and intentionally
64
71
  skipped checks honestly.
65
72
 
66
- Real models, paid APIs, shared infrastructure, production systems, and account
67
- quota remain user-owned authority. A generic request to implement or test does
68
- not authorize them. Prefer deterministic fakes and isolated resources, and
69
- report the remaining verification gap without blocking ordinary delivery.
73
+ Follow `yui-runtime`'s distinction between normal Agent execution and
74
+ real-resource validation. Ordinary Worker implementation is authorized by this
75
+ Turn; additional live-provider, paid, shared, or production validation is not.
70
76
 
71
77
  ## Return a useful result
72
78
 
@@ -75,8 +81,10 @@ returns through the parent Conversation, and if that Session is lost before
75
81
  the Leader consumes it, the child may need to rerun. Do not claim Yui
76
82
  durability for a native result you only emitted in the provider transcript.
77
83
  When the child brief requires a durable, independently recoverable result,
78
- the Leader must dispatch the work as a Yui WorkItem/ExecutionGroup instead
79
- native subagents never own a Yui Turn, receipt, or workspace.
84
+ the Leader must dispatch the work as a managed Yui WorkItem Turn instead. A
85
+ direct WorkItem Turn already owns its durable Turn, receipt, and workspace;
86
+ replicated Lanes are needed only for multiple independent attempts. Native
87
+ subagents never own a Yui Turn, receipt, or workspace.
80
88
 
81
89
  ## Task Role Turn
82
90
 
@@ -96,5 +104,10 @@ accept, capture, integrate, or complete the WorkItem; the Leader decides its
96
104
  disposition. If context or scope is stale or mismatched, report that blocker
97
105
  once and stop without wrappers, permission broadening, or another Turn target.
98
106
 
107
+ Use clear prose. A helpful default is Outcome, Changes, Verification, Risks or
108
+ blockers, and Recommended next action. This is a communication convention, not
109
+ a protocol: Yui preserves the original text and does not parse, normalize, or
110
+ reject it for missing headings or invalid JSON.
111
+
99
112
  Leave managed workspaces intact after handoff. Their owner lifecycle and
100
113
  cleanup belong to the Leader and Yui Core.