@zq-silk/yui 2.20.0 → 2.22.0

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 (142) hide show
  1. package/README.md +5 -0
  2. package/dist/cli/commandCatalog.js +88 -28
  3. package/dist/cli/dynamicCompletion.js +4 -1
  4. package/dist/cli/helpRenderer.js +12 -1
  5. package/dist/cli/interactionPolicy.js +2 -0
  6. package/dist/cli/invocationAuthority.js +2 -6
  7. package/dist/cli/invocationRouter.js +5 -5
  8. package/dist/cli/managedDiagnostics.js +24 -16
  9. package/dist/cli/roleWizard.js +5 -1
  10. package/dist/commands/durableJobCommands.js +2 -3
  11. package/dist/commands/globalRoleCommands.js +33 -8
  12. package/dist/commands/inboxCommands.js +39 -12
  13. package/dist/commands/operatorCommands.js +2 -5
  14. package/dist/commands/releaseCommands.js +16 -2
  15. package/dist/commands/roleConfiguration.js +25 -2
  16. package/dist/commands/sessionCommands.js +5 -2
  17. package/dist/commands/taskCommands.js +225 -99
  18. package/dist/commands/taskContextCommand.js +26 -4
  19. package/dist/commands/taskFactCommands.js +20 -7
  20. package/dist/commands/taskIntegrationCommands.js +3 -3
  21. package/dist/commands/taskRoleRuntimeStatus.js +15 -5
  22. package/dist/commands/taskUsageCommand.js +2 -6
  23. package/dist/commands/textInput.js +2 -2
  24. package/dist/context/contextFamilies.js +10 -0
  25. package/dist/context/currentSkills.js +6 -4
  26. package/dist/context/runContextPack.js +44 -5
  27. package/dist/context/runInputContract.js +1 -1
  28. package/dist/context/sessionBootstrapManifest.js +7 -5
  29. package/dist/context/sessionSkillNotice.js +53 -0
  30. package/dist/context/taskCatalog.js +4 -13
  31. package/dist/context/taskContext.js +135 -103
  32. package/dist/context/taskSearch.js +3 -7
  33. package/dist/controlPlaneCli.js +23 -25
  34. package/dist/controller/agentRuntimeObserver.js +57 -12
  35. package/dist/controller/clientRuntime.js +37 -8
  36. package/dist/controller/controller.js +3 -1
  37. package/dist/controller/diagnosticJournal.js +10 -2
  38. package/dist/controller/fileSchedulerStoreAdapter.js +72 -24
  39. package/dist/controller/jobClient.js +2 -2
  40. package/dist/controller/jobControl.js +2 -2
  41. package/dist/controller/jobDefinitionControl.js +5 -1
  42. package/dist/controller/messageHealth.js +4 -3
  43. package/dist/controller/providerRetryAdmission.js +15 -1
  44. package/dist/controller/providerRetryDelivery.js +18 -2
  45. package/dist/controller/runtime.js +15 -5
  46. package/dist/controller/runtimeEventInbox.js +107 -13
  47. package/dist/controller/runtimeEventProcessor.js +3 -3
  48. package/dist/controller/taskRunRecovery.js +153 -0
  49. package/dist/core/controllerClient.js +16 -2
  50. package/dist/core/controllerServer.js +14 -5
  51. package/dist/core/controllerTelemetry.js +51 -5
  52. package/dist/errors/cliFailure.js +14 -5
  53. package/dist/executor/agentAdapter.js +32 -4
  54. package/dist/executor/agentConfigurationFields.js +2 -0
  55. package/dist/executor/taskAgentCapabilities.js +2 -2
  56. package/dist/integration/gitIntegrationService.js +3 -2
  57. package/dist/integration/integrationSourceApplication.js +12 -1
  58. package/dist/interaction/notificationPresentation.js +11 -16
  59. package/dist/interaction/operatorPresentation.js +1 -1
  60. package/dist/message/messageContinuation.js +3 -1
  61. package/dist/output/boundedRead.js +36 -7
  62. package/dist/output/rolePresentation.js +3 -1
  63. package/dist/runtime/agentHost.js +12 -3
  64. package/dist/runtime/codexAppServerRuntime.js +110 -24
  65. package/dist/runtime/codexInteractiveHost.js +46 -0
  66. package/dist/runtime/providerRetry.js +5 -2
  67. package/dist/runtime/providerRuntimeIdentity.js +1 -1
  68. package/dist/runtime/structuredProviderHost.js +32 -34
  69. package/dist/scheduler/wakeupQueue.js +10 -4
  70. package/dist/storage/sqliteSchema.js +9 -0
  71. package/dist/storage/storageVersions.js +1 -1
  72. package/dist/task/taskAuthority.js +7 -3
  73. package/dist/tmux/tmuxManager.js +4 -2
  74. package/dist/web/webSettings.js +2 -0
  75. package/docs/authorization.md +18 -3
  76. package/docs/cli-information-contract.md +245 -6
  77. package/docs/cli-information-contract.zh-CN.md +107 -5
  78. package/docs/managed-turn-and-session-runtime.md +82 -21
  79. package/docs/managed-turn-and-session-runtime.zh-CN.md +56 -13
  80. package/docs/provider-retry.md +11 -0
  81. package/docs/release-workflow.md +62 -0
  82. package/docs/release-workflow.zh-CN.md +46 -0
  83. package/docs/roles-and-configuration.md +28 -0
  84. package/docs/roles-and-configuration.zh-CN.md +21 -0
  85. package/docs/storage-baseline.md +4 -1
  86. package/docs/storage-baseline.zh-CN.md +1 -1
  87. package/docs/task-delivery.md +7 -0
  88. package/docs/task-delivery.zh-CN.md +5 -0
  89. package/docs/task-discovery.md +5 -5
  90. package/docs/task-discovery.zh-CN.md +4 -4
  91. package/docs/testing/review-evaluation.md +7 -7
  92. package/docs/testing/review-evaluation.zh-CN.md +7 -7
  93. package/docs/testing/verification-levels.md +45 -2
  94. package/docs/testing/verification-levels.zh-CN.md +21 -2
  95. package/i18n/README.zh-CN.md +6 -0
  96. package/package.json +1 -1
  97. package/skills/yui-leader/SKILL.md +98 -189
  98. package/skills/yui-leader/VERSION +1 -1
  99. package/skills/yui-leader/references/artifacts.md +41 -0
  100. package/skills/yui-leader/references/assignment-execution.md +140 -0
  101. package/skills/yui-leader/references/completion.md +79 -0
  102. package/skills/yui-leader/references/delivery-scope.md +26 -0
  103. package/skills/yui-leader/references/execution.md +16 -487
  104. package/skills/yui-leader/references/implementation.md +81 -0
  105. package/skills/yui-leader/references/planning.md +7 -45
  106. package/skills/yui-leader/references/review.md +90 -0
  107. package/skills/yui-leader/references/task-progress.md +23 -0
  108. package/skills/yui-leader/references/work-allocation.md +118 -0
  109. package/skills/yui-operator/SKILL.md +77 -331
  110. package/skills/yui-operator/VERSION +1 -1
  111. package/skills/yui-operator/references/body-transport.md +62 -0
  112. package/skills/yui-operator/references/configuration.md +47 -0
  113. package/skills/yui-operator/references/lifecycle.md +41 -0
  114. package/skills/yui-operator/references/progress.md +39 -0
  115. package/skills/yui-operator/references/routing.md +57 -0
  116. package/skills/yui-operator/references/submission.md +56 -0
  117. package/skills/yui-operator/references/task-delivery.md +5 -2
  118. package/skills/yui-operator/references/web-lifecycle.md +19 -0
  119. package/skills/yui-operator/scripts/verify-submission.mjs +37 -0
  120. package/skills/yui-reviewer/SKILL.md +4 -2
  121. package/skills/yui-reviewer/VERSION +1 -1
  122. package/skills/yui-runtime/SKILL.md +177 -505
  123. package/skills/yui-runtime/VERSION +1 -1
  124. package/skills/yui-runtime/references/archive.md +51 -0
  125. package/skills/yui-runtime/references/command-discovery.md +41 -0
  126. package/skills/yui-runtime/references/completed-followup.md +65 -0
  127. package/skills/yui-runtime/references/context-ordering.md +3 -34
  128. package/skills/yui-runtime/references/context-reads.md +61 -0
  129. package/skills/yui-runtime/references/dispatched-run.md +61 -0
  130. package/skills/yui-runtime/references/execution-failure.md +105 -0
  131. package/skills/yui-runtime/references/global-context.md +18 -0
  132. package/skills/yui-runtime/references/global-input-controls.md +44 -0
  133. package/skills/yui-runtime/references/host-custody.md +30 -0
  134. package/skills/yui-runtime/references/inbox-recovery.md +77 -0
  135. package/skills/yui-runtime/references/incremental-context.md +40 -0
  136. package/skills/yui-runtime/references/publication.md +4 -104
  137. package/skills/yui-runtime/references/recovery.md +32 -192
  138. package/skills/yui-runtime/references/session-identity.md +18 -0
  139. package/skills/yui-runtime/references/session-replacement.md +45 -0
  140. package/skills/yui-runtime/references/uncertain-execution.md +29 -0
  141. package/skills/yui-worker/SKILL.md +7 -4
  142. package/skills/yui-worker/VERSION +1 -1
@@ -0,0 +1,90 @@
1
+ # Review and result disposition
2
+
3
+ Read before requesting independent Review or disposing of a Worker/Reviewer
4
+ result. Read the exact full original result before the disposition; a notification
5
+ or summary is not acceptance. This is not an implementation-stage prerequisite.
6
+
7
+ ## Validate and make the review judgment
8
+
9
+ Prepare useful evidence, not a documentation gate. From effective requirements,
10
+ non-goals and decisions, distill the few observable behavioral constraints that
11
+ matter to this change, with independently grounded expectations. Do not infer
12
+ correctness from the candidate or its mocks.
13
+
14
+ For material cross-layer or asynchronous risks, trace a short real path in the
15
+ exact candidate: entry -> actual consumers -> relevant waits/atomic commit
16
+ boundaries -> observable result and failure/recovery consequences. Point to
17
+ candidate code or existing documents, not just module names or a coverage claim.
18
+ Use it to expose where the same constraint must hold across boundaries; do not
19
+ enumerate every entry or generate a combination matrix. Keep three things
20
+ distinct: constraints/scenarios and expectations, executable test references,
21
+ and actual results with candidate/environment/command. Name material unverified
22
+ boundaries; a test reference alone is not a passing result.
23
+
24
+ Small tasks can reference existing materials directly. For complex tasks, put a
25
+ short review index in Task artifacts and its commit-pinned reference in Brief.
26
+ Keep Brief an up-to-date summary, not a copy of documents or accumulated history.
27
+ Review Context carries the frozen Brief and active decisions; inspect the
28
+ actual pointer inventory when a material's delivery is uncertain. Read referenced
29
+ same-Task artifacts at their fixed commits, not HEAD. Do not assume a path in
30
+ `--input`, a WorkItem-only `--context-ref` option, or a summary grants Review
31
+ access. Recover a missing authorized reference through existing mechanisms;
32
+ do not ask the Reviewer to bypass scope. Materials guide independent inspection,
33
+ not its upper bound.
34
+
35
+ Use the smallest evidence that establishes the accepted behavior and material
36
+ boundaries. Reuse a successful check only while its candidate, command, inputs
37
+ and relevant environment remain valid; retain its exact result reference.
38
+ A different candidate is not covered by an old success: check the changed
39
+ behavior and required integration boundaries. Unknown, failed and not-run
40
+ checks remain visible. Run the Project's complete local delivery validation
41
+ on the final candidate when required; do not repeat unchanged valid success.
42
+
43
+ As part of accepting a WorkItem or completing a Task, decide whether additional
44
+ review would add useful evidence:
45
+
46
+ - inspect directly when the change is clear and existing evidence is enough;
47
+ - use one independent Worker, native child, or Reviewer when independent
48
+ inspection materially reduces a reachable risk; or
49
+ - rely on an already completed applicable Review.
50
+
51
+ This is Leader judgment inside the acceptance decision, not a separate record,
52
+ checklist, or workflow phase. A managed Reviewer is optional unless the user,
53
+ Project or Task Contract requires it. Do not create a
54
+ Reviewer Role or ReviewRound for ceremony. Honor an existing Candidate's
55
+ snapshotted `always` policy and any immutable Task-final Review contract.
56
+ Otherwise choose whether another review adds enough evidence to justify its
57
+ cost.
58
+
59
+ Use one direct main Reviewer by default. If independent replicas materially
60
+ improve evidence, read [replicated execution](replicated-execution.md)
61
+ before dispatch or synthesis. Honor required review contracts even when a
62
+ cheaper execution path is otherwise available.
63
+ One Reviewer should use the applicable complementary perspectives in one round.
64
+ Consider independent replication for genuinely complementary cross-system risks,
65
+ not a fixed headcount or file/frontend/backend partition. Keep the same candidate
66
+ and common requirements; risk emphasis must not hide cross-layer contracts.
67
+
68
+ When several WorkItems contribute to one outcome, prefer one independent
69
+ Task-final Review after their accepted results are integrated over repeating a
70
+ complete Review for every WorkItem. Request an earlier WorkItem Review only
71
+ when that frozen Candidate has a specific risk that should be resolved before
72
+ Integration.
73
+
74
+ When a Worker or Reviewer result arrives, resolve its exact AgentRun and read the
75
+ complete original `AgentRunResult.output` before starting new work or waiting
76
+ again. Treat headings or JSON fields only as communication aids; never infer
77
+ that Core parsed or accepted them. Decide whether to accept, repair, review
78
+ again, retry execution, or ask for a genuinely user-owned decision. Route
79
+ reachable issues to the original execution owner. Fix a small Task-main issue
80
+ directly; create a Repair WorkItem only when the repair is itself a substantial
81
+ independently owned requirement.
82
+
83
+ A failed ReviewRound is an execution failure, not a repair wave. First read
84
+ its Provider retry projection: bounded infrastructure recovery may already own
85
+ the successor. Otherwise inspect its exact Round, AgentRun, candidate, Core failure, and
86
+ `task next-action` facts, then choose the smallest recovery that preserves the
87
+ frozen boundary. Do not invent a retry loop or silently replace the Reviewer
88
+ Session. For replicated execution, choose whether to retry a failed Producer,
89
+ settle that Lane, or synthesize selected available results. Retry a failed
90
+ main synthesis through its exact AgentRun, preserving its selected source snapshot.
@@ -0,0 +1,23 @@
1
+ # Durable working context
2
+
3
+ Read when materially updating Brief, Milestones or cross-Task
4
+ Knowledge. Routine unchanged continuation needs no update or manual reload.
5
+ Runtime’s read-only intent boundary applies.
6
+
7
+ The DB Brief holds current focus, next action, unresolved commitments/unknown
8
+ effects and fixed plan/report/activation/input references, not full documents
9
+ or chronological history. At meaningful progress, requirement changes and phase
10
+ handoffs, read `task brief show`, then update only intended fields using
11
+ `task brief update --if-current <writeGuard>`. Replace superseded text; retain
12
+ history in original records/artifacts. Read `task event list` before deliberately
13
+ restoring an older value. On stale guard, read and reconcile new input rather
14
+ than replaying old text; Core's lifecycle diagnostics do not rewrite history.
15
+
16
+ Before `task complete`, reread Brief and correct resolved blockers or obsolete
17
+ waiting/plans. Unchanged routine steps need no update; do not duplicate the
18
+ terminal completion summary or create a new completion gate.
19
+
20
+ Add a Milestone only for an independently meaningful outcome, a Message only
21
+ for a new conclusion another reader needs, and Project Knowledge only for a
22
+ stable cross-Task lesson. Do not create records for every exchange, dispatch,
23
+ heartbeat or unchanged wait. Ordinary fact edits need no self-wake.
@@ -0,0 +1,118 @@
1
+ # Work allocation and dispatch
2
+
3
+ Read before choosing or changing a separate work/acceptance boundary, executor,
4
+ or concurrency topology. Direct work on an existing coherent result needs no
5
+ allocation ceremony. Preserve existing ownership until a justified change.
6
+
7
+ ## Separate the work unit, executor, and concurrency
8
+
9
+ Honor the user's explicit choice of direct work or delegation. Otherwise make
10
+ three independent judgments; additional Review is a separate acceptance judgment,
11
+ not a reason by itself to delegate implementation.
12
+
13
+ **Does this result need its own management and acceptance boundary?** A WorkItem
14
+ is a substantial result worth managing and accepting separately inside the Task.
15
+ It need not have a different person, an independent release, or parallel execution.
16
+ Use zero WorkItems when the Task already holds one coherent outcome. One WorkItem
17
+ can be Leader-owned or hold a justified whole-result managed Assignment and
18
+ Candidate. Copying the Task unchanged or displaying progress is not a reason
19
+ to create it. Do not split analysis, editing, testing, Review, and ordinary
20
+ repairs into phase-shaped WorkItems.
21
+
22
+ **Who should execute?** Direct Leader execution is the default viable path for
23
+ one coupled result when current context, delivery authority, and tools suffice.
24
+ A native child can supply bounded specialist attention or parallel investigation
25
+ inside this Session when a best-effort result suffices; it creates no Yui identity,
26
+ authority, or WorkItem by itself.
27
+
28
+ Choose a managed Worker only for a concrete benefit that repays requirement
29
+ restatement, context reload, startup, waiting, inspection/rework, Integration,
30
+ and lifecycle management. Benefits include safely parallel independent results,
31
+ a needed capability or execution environment, a genuinely necessary separately
32
+ recoverable lifecycle, freeing the Leader for another actual responsibility,
33
+ or explicit user delegation. An available Worker, cheaper/different model,
34
+ many files, high risk, long duration, or generic maintainability alone is not
35
+ enough. Risk can justify independent Review without delegating implementation.
36
+ When delegation involves a material tradeoff, leave one sentence of concrete
37
+ benefit in the existing Brief; no form, approval, or separate decision record
38
+ is needed.
39
+
40
+ **Should separate units run concurrently?** Multiple WorkItems may run serially
41
+ because of a real dependency, or concurrently when their results can advance
42
+ independently and the net benefit exceeds coordination and Integration cost.
43
+ Neither a single WorkItem nor multiple executors proves parallelism. Keep
44
+ coupled changes together.
45
+
46
+ For example, fix one coupled behavior directly in Task main, even when it touches
47
+ many files. Delegate an independent import tool while the Leader implements its
48
+ consumer when the two have a stable boundary and useful parallel progress.
49
+ Keep two separately accepted stages serial when the second genuinely needs the
50
+ first result. Do not wrap a whole Task in an `implementer` WorkItem merely because
51
+ that Role exists.
52
+
53
+ Apply these choices to new work. Do not automatically cancel an existing Worker,
54
+ reassign/retire WorkItems, or move workspaces to conform to a new default; preserve
55
+ their current ownership and evidence until a justified explicit change.
56
+
57
+ An ordinary managed dispatch uses the WorkItem assignee; omit `--lane-role`.
58
+ Use [replicated execution](replicated-execution.md) only when
59
+ independent attempts over the same frozen Assignment repay their coordination
60
+ cost. Direct managed execution already provides durable ownership.
61
+
62
+ ## Give Agents outcomes, not premature implementations
63
+
64
+ Make delegated work decision-complete:
65
+
66
+ - objective and observable acceptance criteria;
67
+ - relevant Task and Project context;
68
+ - hard scope, authority, and workspace boundaries;
69
+ - known constraints, risks, dependencies, and existing decisions; and
70
+ - expected checks and evidence.
71
+
72
+ Let the receiving Agent choose its implementation plan, internal structure, and
73
+ tools unless a particular ordering or mechanism is itself part of the accepted
74
+ contract. Do not encode the Leader's speculative design as mandatory Worker
75
+ steps.
76
+
77
+ For Project-backed work, use the Project Skills, Policy, and Knowledge exposed
78
+ through current context. Keep repository-specific build, migration, release,
79
+ and test rules in that Project-owned layer.
80
+
81
+ Before WorkItem dispatch, put the complete bounded requirements in the WorkItem
82
+ or explicitly select up to 16 relevant readable materials with repeated
83
+ `--context-ref <store/refId@digest>` on `task work dispatch`. Obtain exact IDs and
84
+ digests from current Task context list/inspect. Core freezes these selected
85
+ values after the existing caller-scope checks; mentioning a record in `--input`
86
+ does not select it or grant access. Missing, forbidden or changed references
87
+ refuse dispatch before Provider startup: correct the selection or make the
88
+ WorkItem self-contained, never ask the recipient to bypass expansion rejection.
89
+
90
+ Before creating or acting on an Assignment, read
91
+ [Assignment execution](assignment-execution.md). Before dispatch inspect current
92
+ exact active Run/Review bindings; activity is not a Task-wide lock.
93
+
94
+ ## Inspect execution facts
95
+
96
+ Use `yui task context <task-id>` and `yui task next-action <task-id>` as
97
+ decision support. They expose current facts, exact refs, and legal
98
+ alternatives; they do not replace Leader judgment.
99
+ An empty WorkItem list does not mean the user requested direct execution.
100
+ Honor explicit delegation and independent Review requirements in the user's
101
+ messages and Task Brief. Neither `next-action` nor a disabled default review
102
+ policy authorizes dropping them to make completion easier.
103
+
104
+ Missing or cyclic dependencies identify conflicting records, not the correct
105
+ business repair. Read the related requirements, preserve valid edges, then
106
+ explicitly revise the intended dependency set or retire genuinely obsolete work.
107
+ Do not clear all dependencies merely to make a mechanical gate pass.
108
+
109
+ An Integration Job's success is not the final target update. For that
110
+ notification, read [Integration](integration.md) and continue from its exact
111
+ evidence; do not start a duplicate operation. Read that guidance also for an
112
+ ordinary Git conflict or an attempt that cannot be reliably resumed.
113
+
114
+ Before dispatch, Review, Integration, or completion, inspect
115
+ `liveTaskState.activeRuns` and `liveTaskState.activeTaskReviews` in the current
116
+ Context Pack. They report work in flight but gate nothing by themselves; reason
117
+ from each exact binding and frozen candidate instead of treating activity as a
118
+ global Task lock.