@zq-silk/yui 2.5.0 → 2.7.1

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 (104) hide show
  1. package/README.md +23 -0
  2. package/dist/cli/commandCatalog.js +31 -4
  3. package/dist/commands/globalRoleCommands.js +22 -2
  4. package/dist/commands/inboxCommands.js +352 -0
  5. package/dist/commands/roleSkillValidation.js +2 -0
  6. package/dist/commands/taskCommands.js +40 -7
  7. package/dist/commands/taskContextCommand.js +3 -2
  8. package/dist/context/currentSkills.js +48 -0
  9. package/dist/context/roleSessionContext.js +13 -16
  10. package/dist/context/runContextPack.js +2 -0
  11. package/dist/context/runInputContract.js +1 -1
  12. package/dist/context/sessionBootstrapManifest.js +27 -4
  13. package/dist/context/skillCatalog.js +2 -3
  14. package/dist/context/taskContext.js +9 -4
  15. package/dist/controlPlaneCli.js +18 -1
  16. package/dist/controller/controller.js +3 -2
  17. package/dist/controller/fileSchedulerStoreAdapter.js +19 -4
  18. package/dist/controller/globalInputDelivery.js +73 -15
  19. package/dist/controller/globalRuntimeAttention.js +1 -1
  20. package/dist/controller/operatorNotification.js +6 -1
  21. package/dist/controller/providerRetryDelivery.js +3 -5
  22. package/dist/controller/runtime.js +2 -2
  23. package/dist/doctor/doctor.js +25 -2
  24. package/dist/executor/effectiveLaunch.js +2 -2
  25. package/dist/executor/fileRoleLaunchPlanner.js +4 -6
  26. package/dist/interaction/notificationPresentation.js +2 -2
  27. package/dist/interaction/operatorPresentation.js +1 -1
  28. package/dist/kernel/builtinCapabilities.js +2 -1
  29. package/dist/message/globalInputBacklog.js +69 -0
  30. package/dist/message/globalMessageQuery.js +1 -0
  31. package/dist/message/inboxReceipt.js +32 -0
  32. package/dist/message/message.js +6 -1
  33. package/dist/message/messageContinuation.js +34 -13
  34. package/dist/message/taskInboxOwnership.js +21 -0
  35. package/dist/nativeAgent/session/backends.js +1 -1
  36. package/dist/observability/runtimeIdentity.js +1 -1
  37. package/dist/resources/sqliteResourceRegistry.js +1 -1
  38. package/dist/runtime/agentHost.js +105 -16
  39. package/dist/runtime/builtinAgentErrorMappers.js +9 -5
  40. package/dist/runtime/providerRetry.js +38 -0
  41. package/dist/runtime/taskSessions.js +240 -0
  42. package/dist/scheduler/operatorEvent.js +49 -0
  43. package/dist/scheduler/operatorInputNotificationProcessor.js +5 -4
  44. package/dist/scheduler/taskExecutionProjection.js +78 -6
  45. package/dist/scheduler/taskWake.js +5 -0
  46. package/dist/sqlite/driver.js +108 -0
  47. package/dist/storage/sqliteSchema.js +11 -1
  48. package/dist/storage/sqliteStore.js +60 -1
  49. package/dist/storage/storageSchema.js +1 -1
  50. package/dist/storage/storageVersions.js +1 -1
  51. package/dist/storage/storeRpc.js +1 -0
  52. package/dist/storage/upgrade/upgradeOrchestrator.js +1 -1
  53. package/dist/task/completionReadiness.js +11 -4
  54. package/dist/telemetry/sqliteTelemetryStore.js +1 -1
  55. package/dist/web/assets/assetManifest.js +2 -0
  56. package/dist/web/assets/client/app/taskView.js +1 -0
  57. package/dist/web/assets/client/domain/records.js +70 -2
  58. package/dist/web/assets/client/domain/runs.js +3 -2
  59. package/dist/web/assets/client/domain/vocab.js +1 -1
  60. package/dist/web/assets/client/i18n/en.js +17 -1
  61. package/dist/web/assets/client/i18n/zh-CN.js +17 -1
  62. package/dist/web/assets/client/lib/api.js +4 -1
  63. package/dist/web/assets/client/lib/theme.js +31 -10
  64. package/dist/web/assets/client/views/task/actions.js +38 -21
  65. package/dist/web/assets/client/views/task/observation.js +12 -3
  66. package/dist/web/assets/client/views/task/overview.js +7 -40
  67. package/dist/web/assets/client/views/task/runtime.js +71 -34
  68. package/dist/web/assets/shared/icons.js +2 -0
  69. package/dist/web/assets/shell/index.js +1 -0
  70. package/dist/web/assets/shell/settings.js +1 -0
  71. package/dist/web/assets/styles/views/task.js +14 -0
  72. package/dist/web/webServer.js +12 -0
  73. package/dist/web/webSessions.js +2 -165
  74. package/dist/web/webSnapshot.js +9 -5
  75. package/dist/web/webTaskActivity.js +54 -0
  76. package/dist/web/webTaskSurface.js +1 -0
  77. package/docs/managed-turn-and-session-runtime.md +81 -5
  78. package/docs/managed-turn-and-session-runtime.zh-CN.md +51 -3
  79. package/docs/observability/README.md +25 -1
  80. package/docs/observability/README.zh-CN.md +18 -1
  81. package/docs/provider-retry.md +11 -0
  82. package/docs/release-workflow.md +74 -2
  83. package/docs/release-workflow.zh-CN.md +56 -1
  84. package/docs/storage-baseline.md +17 -7
  85. package/docs/storage-baseline.zh-CN.md +11 -5
  86. package/docs/task-delivery.md +17 -8
  87. package/docs/task-delivery.zh-CN.md +11 -5
  88. package/docs/testing/verification-levels.md +22 -4
  89. package/docs/testing/verification-levels.zh-CN.md +8 -1
  90. package/i18n/README.zh-CN.md +19 -0
  91. package/package.json +5 -2
  92. package/skills/yui-leader/SKILL.md +28 -11
  93. package/skills/yui-leader/VERSION +1 -0
  94. package/skills/yui-operator/SKILL.md +10 -2
  95. package/skills/yui-operator/VERSION +1 -0
  96. package/skills/yui-operator/references/task-delivery.md +2 -0
  97. package/skills/yui-reviewer/SKILL.md +8 -1
  98. package/skills/yui-reviewer/VERSION +1 -0
  99. package/skills/yui-runtime/SKILL.md +94 -11
  100. package/skills/yui-runtime/VERSION +1 -0
  101. package/skills/yui-runtime/references/publication.md +16 -5
  102. package/skills/yui-runtime/references/recovery.md +9 -0
  103. package/skills/yui-worker/SKILL.md +8 -1
  104. package/skills/yui-worker/VERSION +1 -0
@@ -16,16 +16,34 @@ workspace layout, native transcript, or an earlier AgentRun.
16
16
 
17
17
  ## Enter through the current context
18
18
 
19
- Stable instructions and dynamic facts have different lifetimes. On first entry,
20
- new Session, Manifest/version change, or missing instructions (including after
21
- compaction/recovery), read the exact Session Manifest and fully load its profile
22
- and named Skills: `yui-runtime` plus the referenced `yui-leader`, `yui-worker`,
23
- `yui-reviewer`, `yui-operator`, or custom Role Skills. Resolve IDs to paths and
24
- versions through that Manifest, never another installed namesake. If those exact
25
- same-version instructions are already fully available in current context, apply
26
- them without mechanically rereading. Same Session, prior delivery, and prior
27
- reads do not prove availability. The short Manifest pointer remains a recovery
28
- entry, not a cache or authority receipt.
19
+ Stable instructions and dynamic facts have different lifetimes. At the start of
20
+ **every turn**, run the Manifest's `contextProtocol.skillCheckCommand`.
21
+ For an older Manifest, use `yui session skills --json` through the Session's
22
+ CLI/Home; a Global Manifest's self-contained `loadCommand` also checks current
23
+ Skills and works without the launching shell's environment (for example Desktop).
24
+ This lightweight read checks the applicable Skills' current stable paths,
25
+ internal `VERSION` files and readability without loading their bodies. Its
26
+ current paths supersede frozen-package paths in an older Session Manifest.
27
+ Skill versions are independent of npm versions, Session revisions and Task
28
+ Snapshots. A version observation is never evidence that instructions were read.
29
+
30
+ On first entry, version change, new/restored Session, Host recovery, or missing,
31
+ compacted or uncertain instructions, read the exact Session Manifest's profile
32
+ and fully load the current `yui-runtime` plus the applicable Role/custom Skills
33
+ from the check result, including necessary references. If their versions are
34
+ unchanged **and** their full instructions are still available in current context,
35
+ reuse them without rereading all bodies. Do not infer availability from the same
36
+ Session, an earlier read, successful delivery or an unchanged version. Native
37
+ children without their own managed identity use their parent's checked paths
38
+ and inherited scope, never impersonate its Session.
39
+
40
+ Historical frozen packages remain audit evidence only. Missing or damaged
41
+ historical Skill evidence alone does not revoke a valid Session or block its
42
+ messages, and current source cannot prove a historical load. A missing/unreadable
43
+ current entry or version is a concrete installation/configuration error: report
44
+ the path and legal recovery action, preserve input and authority, and check again
45
+ after repair. Never clear identity, change Session or replay unknown input as a
46
+ Skill-loading workaround. CLI/Home protocol and storage checks still apply.
29
47
 
30
48
  Refresh dynamic Task/Session facts before the relevant decision regardless of
31
49
  instruction reuse. Leader notifications use the Manifest's `currentCommand`;
@@ -41,7 +59,12 @@ or reuse an old completed AgentRun snapshot merely to obtain authority. Pending
41
59
  delivery, unknown execution evidence and missing reports do not themselves
42
60
  revoke Session authority. Task lifecycle, scope, Assignment, workspace and
43
61
  resource boundaries still apply; a planning Session does not gain delivery
44
- authority merely because the Task becomes active.
62
+ authority merely because the Task becomes active. An explicit, legal same-result
63
+ implementation or delivery follow-up may instead authorize the current Leader
64
+ to reopen its own completed, unarchived Task; follow the
65
+ [post-completion routing boundary](references/publication.md#post-completion-routing-boundary).
66
+ Queries, discussion, ordinary notifications and Session recovery grant no such
67
+ authority, and reopening never lifts an independent execution stop.
45
68
  Use the runtime-provided `TMPDIR` for temporary context or diagnostic files,
46
69
  not fixed shared `/tmp` names or the logical multi-Project workspace container.
47
70
  Save durable reports in Task artifacts/results before releasing their temporary
@@ -165,6 +188,66 @@ then handoff. An accepted or unconfirmed steer must not be submitted again by
165
188
  changing its request id or composing then. A conclusive rejection permits an
166
189
  explicit new control attempt; uncertainty does not.
167
190
 
191
+ ## Handle your own inbox in the current turn
192
+
193
+ After loading authorized context, at useful work boundaries and before handing
194
+ off, use `yui inbox list --json` to discover pending input addressed to your
195
+ current managed identity. This applies to Operator, custom GlobalRole, Leader,
196
+ Worker and Reviewer. Do not poll an empty inbox or create another model turn.
197
+ No target Role, Task or native Session is supplied: Yui resolves your current
198
+ identity. A native child gains no separate actor or inbox.
199
+
200
+ 1. Read the selected `yui inbox show <entry> --json`. Reads never consume input.
201
+ Follow `nextCursor` and all `contentPage` pages using the rules below.
202
+ 2. Before processing, reserve exact entries with
203
+ `yui inbox claim <entry> [<entry> ...] --request-id <stable-id> --json`.
204
+ At most 16 entries are allowed, with independent per-entry results. Retain
205
+ each successful returned ID and request ID; do not replay successful items
206
+ when another item fails. A changed pending window requires a fresh list.
207
+ 3. Read complete originals and referenced results, then handle the request
208
+ within its existing authority. Leader notification-window claims move one exact pending window
209
+ into a durable wake: use the returned `originals` command, follow every
210
+ relevant original Message/Run reference, and use its returned wake ID for
211
+ acknowledgement. Later arrivals remain in the next pending window.
212
+ Assignment inbox reads (including a managed Leader Assignment) expose only
213
+ messages for the current Assignment;
214
+ they supplement the frozen pack without expanding it or changing candidates.
215
+ 4. Only after handling, explicitly acknowledge each successful item:
216
+ `yui inbox ack <returned-entry> --request-id <stable-id> --reason "<disposition>" --json`.
217
+ Record an obsolete notification as requiring no further action only after
218
+ checking its originals and current facts, never based solely on age.
219
+
220
+ Claiming prevents ordinary automatic delivery; it is not processing completion.
221
+ Acknowledgement records Agent handling, not Host acceptance, result acceptance,
222
+ Task completion, publication or archive. Never acknowledge merely to empty the
223
+ list. On failure or interruption, leave the claim unacknowledged; it remains
224
+ discoverable and does not expire or replay automatically. A current rightful
225
+ successor must inspect original input and prior effects before finishing and
226
+ acknowledging a retained claim. Never replay uncertain external actions.
227
+ For an exact-Session input already claimed by its selected Session, a rightful
228
+ successor may explicitly settle that handling after inspecting the original
229
+ and prior effects. This preserves the original target and claim; it grants no
230
+ permission to submit or execute the input in a different Session.
231
+ An Assignment change does not inherit handling authority. If the original Run
232
+ stopped before acknowledgement, ask the Leader to inspect its exact native
233
+ terminal and use the existing `task message handoff` to the current authorized
234
+ Assignment. The original claim remains; handoff never resubmits it automatically.
235
+ If that Assignment is obsolete, the Leader may inspect the original and prior
236
+ effects, then explicitly use `task message retire <task/message> --reason "<disposition>"`.
237
+ Retirement preserves the original claim and records the management decision;
238
+ it neither fabricates an acknowledgement nor proves native execution stopped.
239
+ An unfinished claim fences its Assignment, not unrelated work of the same Role.
240
+
241
+ In-flight, unknown, previously delivered, explicit interrupt-then and
242
+ unsettled steer inputs retain their existing owner/receipt and report a bounded
243
+ reason instead of being taken over. Use existing exact-receipt recovery when
244
+ needed; do not change request IDs, clear identity, or copy input to bypass it.
245
+ A steer with no control receipt was not submitted; it may be explicitly handled
246
+ and acknowledged in its authorized inbox, without converting it into a queue.
247
+ An accepted notification still follows its normal handling path, not another
248
+ inbox delivery. Original Messages, wake windows and handling receipts remain
249
+ readable after acknowledgement.
250
+
168
251
  ## Read bounded information completely when required
169
252
 
170
253
  Structured CLI results live in the top-level `data`, not a JSON-encoded
@@ -0,0 +1 @@
1
+ 3
@@ -8,9 +8,19 @@ to push, publish, merge, query an external provider or archive.
8
8
 
9
9
  An explicit user request to continue implementation or delivery of the same
10
10
  completed, unarchived result authorizes its necessary reopening within that
11
- request's scope. The Operator need not ask the user to additionally say “reopen.”
12
- Read the original completion, fixed heads/reports, Publication and current
13
- authority first, then use the existing two operations:
11
+ request's scope. The current matching Leader may call `task reopen <task>` for
12
+ its own Task and continue that request; an Operator handoff is not mandatory,
13
+ and neither Role needs the user to additionally say “reopen.” Read the original
14
+ completion, fixed heads/reports, Publication, new request and current authority
15
+ first. Inspect the reopen result and current Context before executing; delivery
16
+ still requires the current Session's delivery authority, legal workspace and an
17
+ enabled execution gate.
18
+
19
+ If the Leader already received the request, use its original durable input and
20
+ continue after reopening; do not resend it or create a self-wake. Preserve a
21
+ direct-conversation request and its boundaries in Task records when needed,
22
+ without impersonating user/Operator input. When the Operator or user is routing
23
+ new input, use the existing two operations:
14
24
 
15
25
  ```sh
16
26
  yui task reopen <task>
@@ -30,8 +40,9 @@ intact. The Leader must assess the new request and separately accept any new
30
40
  result, not pretend old validation proves changed work. Reopen does not replay
31
41
  historical Messages/Runs, change the Role's Agent/model/permissions, or lift an
32
42
  independent execution stop. Queries, ordinary record/discussion input and Session
33
- recovery do not authorize resumption. Cancelled intent needs its own explicit
34
- restoration authority; archived Tasks cannot reopen. A stopped gate still needs
43
+ recovery do not authorize resumption. Cancelled intent needs explicit
44
+ user/Operator restoration authority and cannot be restored by the Leader;
45
+ archived Tasks cannot reopen. A stopped gate still needs
35
46
  the separately authorized start/cleanup path.
36
47
 
37
48
  These are two atomic operations, not one transaction. Read the reopen result and
@@ -93,6 +93,15 @@ Assignment from memory. A new Host process need not mean a new native Session.
93
93
  Preserve frozen Review candidates and selected synthesis sources on retry.
94
94
  An infrastructure failure is not a defect in the business result.
95
95
 
96
+ Native internal retries are not failed terminals: observe without submitting
97
+ another input. A missing automatic retry record is not evidence of exhausted
98
+ budget or a damaged Session. An explicit `task run retry <task>/<run>` can
99
+ continue from the current exact failed Turn even without an earlier automatic
100
+ chain. Codex `systemError` alone does not require replacement; the normal
101
+ submission path checks that the latest Turn is that failed Turn and background
102
+ execution is empty. Missing or changed proof is a refusal, not permission to
103
+ replay, change models or silently replace the Session.
104
+
96
105
  ## Replace a Session deliberately
97
106
 
98
107
  An authorized Leader or Operator may request:
@@ -5,7 +5,8 @@ description: Complete a bounded Yui WorkItem AgentRun or native child assignment
5
5
 
6
6
  # Yui Worker
7
7
 
8
- Follow [yui-runtime](../yui-runtime/SKILL.md) first. For a managed AgentRun,
8
+ Follow [yui-runtime](../yui-runtime/SKILL.md) first, including its per-turn
9
+ version/availability check and conditional full reload. For a managed AgentRun,
9
10
  load its exact Context Pack and
10
11
  use only the returned WorkItem, refs, workspace, writable Project IDs, and
11
12
  completion actions. The launch Envelope is a pointer, not an execution brief.
@@ -23,6 +24,12 @@ Resolve Skill links relative to this Skill's directory.
23
24
 
24
25
  ## Execute within the exact boundary
25
26
 
27
+ Use **yui-runtime**'s own-inbox flow at useful work boundaries and before the
28
+ final report. Current-Assignment `inbox show` is an authorized way to read new
29
+ directed clarification during this turn without redispatch. Claim before
30
+ handling and ack only after disposition; never use it to read another
31
+ Assignment, expand Project permissions, or accept your own result.
32
+
26
33
  Leader clarification and continuation arrive as Messages in the exact bounded
27
34
  Context Pack. Read those authorized refs; do not request pack-external Leader
28
35
  messages or require redispatch/status changes merely to answer a question.
@@ -0,0 +1 @@
1
+ 2