@zq-silk/yui 2.6.0 → 2.8.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 (126) hide show
  1. package/README.md +23 -0
  2. package/dist/cli/commandCatalog.js +34 -7
  3. package/dist/cli/updateCommand.js +3 -0
  4. package/dist/commands/configCommands.js +1 -0
  5. package/dist/commands/globalRoleCommands.js +62 -35
  6. package/dist/commands/inboxCommands.js +372 -0
  7. package/dist/commands/roleSkillValidation.js +2 -0
  8. package/dist/commands/taskCommands.js +39 -7
  9. package/dist/commands/taskRoleRuntimeStatus.js +2 -0
  10. package/dist/context/currentSkills.js +48 -0
  11. package/dist/context/roleSessionContext.js +13 -16
  12. package/dist/context/runContextPack.js +50 -3
  13. package/dist/context/runInputContract.js +1 -1
  14. package/dist/context/sessionBootstrapManifest.js +27 -4
  15. package/dist/context/skillCatalog.js +2 -3
  16. package/dist/context/taskContext.js +38 -12
  17. package/dist/controlPlaneCli.js +58 -7
  18. package/dist/controller/controller.js +8 -2
  19. package/dist/controller/fileSchedulerStoreAdapter.js +26 -6
  20. package/dist/controller/globalInputDelivery.js +86 -16
  21. package/dist/controller/globalRuntimeAttention.js +136 -6
  22. package/dist/controller/operatorNotification.js +6 -1
  23. package/dist/controller/providerRetryDelivery.js +3 -5
  24. package/dist/controller/runtime.js +6 -2
  25. package/dist/controller/structuredProviderObservation.js +51 -15
  26. package/dist/controller/taskHostTerminalRecovery.js +33 -0
  27. package/dist/doctor/doctor.js +25 -2
  28. package/dist/executor/effectiveLaunch.js +2 -2
  29. package/dist/executor/fileRoleLaunchPlanner.js +8 -15
  30. package/dist/interaction/notificationPresentation.js +2 -2
  31. package/dist/interaction/operatorPresentation.js +1 -1
  32. package/dist/message/globalInputBacklog.js +69 -0
  33. package/dist/message/globalMessageQuery.js +1 -0
  34. package/dist/message/inboxReceipt.js +62 -0
  35. package/dist/message/message.js +6 -1
  36. package/dist/message/messageContinuation.js +34 -13
  37. package/dist/message/taskInboxOwnership.js +43 -0
  38. package/dist/models/modelManagement.js +469 -0
  39. package/dist/models/modelManagementConfig.js +46 -0
  40. package/dist/models/modelManagementFiles.js +90 -0
  41. package/dist/models/modelManagementHttp.js +90 -0
  42. package/dist/models/modelManagementTypes.js +1 -0
  43. package/dist/nativeAgent/session/backends.js +1 -1
  44. package/dist/observability/runtimeIdentity.js +1 -1
  45. package/dist/output/boundedRead.js +43 -14
  46. package/dist/resources/sqliteResourceRegistry.js +1 -1
  47. package/dist/runtime/agentEndpointIdentity.js +8 -4
  48. package/dist/runtime/agentEndpointOwnership.js +5 -6
  49. package/dist/runtime/agentHost.js +165 -24
  50. package/dist/runtime/agentHostImplementation.js +18 -0
  51. package/dist/runtime/managedCaller.js +25 -1
  52. package/dist/runtime/managedIdentity.js +1 -1
  53. package/dist/runtime/providerRetry.js +19 -1
  54. package/dist/runtime/sessionCaller.js +53 -0
  55. package/dist/scheduler/operatorEvent.js +49 -0
  56. package/dist/scheduler/operatorInputNotificationProcessor.js +5 -4
  57. package/dist/scheduler/taskWake.js +5 -0
  58. package/dist/sqlite/driver.js +108 -0
  59. package/dist/storage/contextRecords.js +28 -0
  60. package/dist/storage/sqliteSchema.js +21 -1
  61. package/dist/storage/sqliteStore.js +64 -1
  62. package/dist/storage/storageSchema.js +1 -1
  63. package/dist/storage/storageVersions.js +1 -1
  64. package/dist/storage/storeRpc.js +1 -0
  65. package/dist/storage/taskStore.js +4 -0
  66. package/dist/storage/upgrade/upgradeOrchestrator.js +1 -1
  67. package/dist/task/completionReadiness.js +13 -6
  68. package/dist/telemetry/sqliteTelemetryStore.js +1 -1
  69. package/dist/web/assets/assetManifest.js +28 -2
  70. package/dist/web/assets/client/app/manage.js +6 -0
  71. package/dist/web/assets/client/app/models.js +20 -0
  72. package/dist/web/assets/client/app/settings.js +41 -9
  73. package/dist/web/assets/client/i18n/en.js +180 -2
  74. package/dist/web/assets/client/i18n/zh-CN.js +178 -2
  75. package/dist/web/assets/client/index.js +8 -0
  76. package/dist/web/assets/client/layout/manageShell.js +94 -0
  77. package/dist/web/assets/client/lib/api.js +13 -1
  78. package/dist/web/assets/client/lib/i18n.js +5 -3
  79. package/dist/web/assets/client/views/dock/conversation.js +231 -80
  80. package/dist/web/assets/client/views/models.js +777 -0
  81. package/dist/web/assets/client/views/skills.js +22 -15
  82. package/dist/web/assets/shared/icons.js +2 -0
  83. package/dist/web/assets/shared/manageNav.js +13 -0
  84. package/dist/web/assets/shell/manage.js +54 -0
  85. package/dist/web/assets/shell/models.js +7 -0
  86. package/dist/web/assets/shell/settings.js +1 -35
  87. package/dist/web/assets/shell/settingsContent.js +30 -0
  88. package/dist/web/assets/shell/sidebar.js +1 -0
  89. package/dist/web/assets/styles/index.js +6 -0
  90. package/dist/web/assets/styles/views/conversation.js +133 -0
  91. package/dist/web/assets/styles/views/manage.js +71 -0
  92. package/dist/web/assets/styles/views/models.js +129 -0
  93. package/dist/web/assets/styles/views/settings.js +28 -14
  94. package/dist/web/assets/styles/views/sidebar.js +1 -0
  95. package/dist/web/webServer.js +59 -9
  96. package/docs/cli-information-contract.md +42 -11
  97. package/docs/cli-information-contract.zh-CN.md +28 -7
  98. package/docs/managed-turn-and-session-runtime.md +127 -5
  99. package/docs/managed-turn-and-session-runtime.zh-CN.md +83 -3
  100. package/docs/release-workflow.md +105 -9
  101. package/docs/release-workflow.zh-CN.md +73 -5
  102. package/docs/storage-baseline.md +22 -7
  103. package/docs/storage-baseline.zh-CN.md +14 -5
  104. package/docs/task-delivery.md +17 -8
  105. package/docs/task-delivery.zh-CN.md +11 -5
  106. package/docs/testing/review-evaluation.md +148 -0
  107. package/docs/testing/review-evaluation.zh-CN.md +117 -0
  108. package/docs/testing/verification-levels.md +26 -4
  109. package/docs/testing/verification-levels.zh-CN.md +11 -1
  110. package/i18n/README.zh-CN.md +19 -0
  111. package/package.json +5 -2
  112. package/skills/yui-leader/SKILL.md +28 -11
  113. package/skills/yui-leader/VERSION +1 -0
  114. package/skills/yui-leader/references/execution.md +29 -0
  115. package/skills/yui-leader/references/replicated-execution.md +7 -0
  116. package/skills/yui-operator/SKILL.md +15 -3
  117. package/skills/yui-operator/VERSION +1 -0
  118. package/skills/yui-operator/references/task-delivery.md +2 -0
  119. package/skills/yui-reviewer/SKILL.md +43 -1
  120. package/skills/yui-reviewer/VERSION +1 -0
  121. package/skills/yui-runtime/SKILL.md +144 -15
  122. package/skills/yui-runtime/VERSION +1 -0
  123. package/skills/yui-runtime/references/publication.md +16 -5
  124. package/skills/yui-runtime/references/recovery.md +24 -5
  125. package/skills/yui-worker/SKILL.md +8 -1
  126. package/skills/yui-worker/VERSION +1 -0
@@ -5,7 +5,8 @@ description: Review the exact frozen WorkItem Candidate or unified Task-final sc
5
5
 
6
6
  # Yui Reviewer
7
7
 
8
- Follow [yui-runtime](../yui-runtime/SKILL.md) first and load the exact current
8
+ Follow [yui-runtime](../yui-runtime/SKILL.md) first, including its per-turn
9
+ version/availability check and conditional full reload, and load the exact current
9
10
  AgentRun Context Pack. The
10
11
  ReviewRound, Candidate, workspace, and Snapshot digest returned there are the
11
12
  only review scope; fail closed on any mismatch.
@@ -51,6 +52,12 @@ execution a scoped question may be sent with `task message send <task> "<questio
51
52
 
52
53
  ## Separate infrastructure failure from review judgment
53
54
 
55
+ At useful review boundaries and before reporting, apply **yui-runtime**'s
56
+ own-inbox flow for current-ReviewRound clarification. Read complete originals,
57
+ claim before handling, and ack after disposition. These messages supplement
58
+ the frozen pack; they cannot replace its Candidate, expand review scope, or
59
+ turn acknowledgement into a review verdict.
60
+
54
61
  Verify the exact AgentRun identity, Context Pack, frozen head, and ReviewRound-owned
55
62
  workspace before inspecting candidate sources. If context loading or workspace
56
63
  binding fails before review begins:
@@ -83,6 +90,35 @@ request a follow-up Round yourself.
83
90
  Use Project Skills, Policy and Knowledge for project-specific checks. The
84
91
  Task Contract and frozen scope determine acceptance and required evidence.
85
92
 
93
+ ## Derive scenarios, then inspect the complete candidate
94
+
95
+ Read the frozen Task/WorkItem requirements, non-goals and applicable decisions
96
+ before using the author's explanation. The frozen Brief is a summary and material
97
+ index, not the contract body. Follow its relevant same-Task commit-pinned artifact
98
+ references with `task artifact read <task> <path> <commit>`; expand Context pointers
99
+ and their content pages as required. A path in prose grants no additional access.
100
+ Report missing or conflicting evidence instead of replacing it with a newer head.
101
+
102
+ Derive observable expectations from requirements and independent contracts, not
103
+ from the current implementation or its mocks. Trace the complete authorized
104
+ change and necessary callers, consumers, state and side effects. Select
105
+ complementary perspectives according to risk: user paths, producer/consumer
106
+ contracts, state/data invariants, failure and partial recovery, authorization,
107
+ and whether verification tests the actual contract. Multiple perspectives do
108
+ not require multiple Agents or every perspective on every task.
109
+
110
+ Turn applicable perspectives into concrete scenarios, expected behavior and
111
+ evidence. Challenge important assumptions with the smallest reachable
112
+ counterexample; check normal controls and non-goals too. A shared assumption
113
+ between a mock and implementation is not independent confirmation. Reuse valid
114
+ checks; do not run external-resource validation without its exact authorization.
115
+ Stop neither at the changed lines nor after finding a few defects.
116
+
117
+ For an ordinary full re-review, inspect the current complete frozen candidate
118
+ and requirements, using the repair delta, prior finding dispositions and still
119
+ applicable evidence as guidance, not a scope ceiling. An explicitly assigned
120
+ Delta Recheck retains its narrower equivalence contract above.
121
+
86
122
  Review design complexity against the current Task Contract and reachable
87
123
  operating paths. Report abstractions, state, indirection, fallback, or module
88
124
  boundaries whose complete lifecycle cost exceeds their demonstrated value.
@@ -110,6 +146,12 @@ frozen Review or its original report.
110
146
 
111
147
  A helpful default result layout is Conclusion, Material findings, Verification,
112
148
  Uncertainty, and Recommended next action. Markdown or JSON are both acceptable.
149
+ Include a short account of the perspectives/scenarios actually inspected and
150
+ material unexamined risks, not a copied checklist. Each confirmed finding should
151
+ identify its trigger, violated expectation, impact and supporting evidence;
152
+ merge one root cause without losing its affected entry points. Distinguish
153
+ uncertain reachability or missing verification from a confirmed defect. There
154
+ is no finding quota, mandatory perspective count or claim of exhaustive coverage.
113
155
  Yui preserves the original text and does not parse a verdict or reject it for
114
156
  missing headings, field names, or formatting. Follow `yui-runtime`'s optional
115
157
  `Yui-Summary:` first-line convention for attributed notification text; retain
@@ -0,0 +1 @@
1
+ 3
@@ -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
@@ -56,6 +79,15 @@ installation with the same protocol and storage versions. If the entry or Home
56
79
  is wrong or unavailable, report that fact and use the explicitly authorized
57
80
  entry/environment; do not guess another installation or clear Session identity.
58
81
 
82
+ Desktop commands may carry only `CODEX_THREAD_ID`. The CLI resolves that native
83
+ identity in the selected Home's current Session registry before routing Task or
84
+ Global operations. Environment and Manifest values are location hints, not
85
+ continuing grants. Conflicting, unregistered, replaced or revoked identities
86
+ do not become public-user callers; a plain user terminal has no managed/native
87
+ identity. `inbox list` reports the resolved current identity. Do not add or clear
88
+ environment fields to repair a mismatch. Without a Manifest environment pointer,
89
+ `session skills` returns current Skill paths and the Session's captured profile.
90
+
59
91
  For every explicitly dispatched managed Task AgentRun:
60
92
 
61
93
  1. Read the exact AgentRun identity from the newest Bootstrap Envelope.
@@ -70,8 +102,15 @@ For every explicitly dispatched managed Task AgentRun:
70
102
  and Adapter match the Envelope and Session Manifest. Stop and report a
71
103
  context-load failure if the pack is missing, stale, unauthorized, malformed,
72
104
  or mismatched. Never request an inline/full-prompt fallback.
73
- 4. Use the pack's `pointers` (including each pointer's summary) first. They are
74
- the single readable-ref inventory; `deltaRefs` contains only changed identities.
105
+ 4. Use the entry's `pointers` (including each pointer's summary) first. They are
106
+ a bounded window into the frozen readable-ref inventory. `pointerPage`
107
+ reports total/complete/nextCursor; discover further relevant refs with
108
+ `task run context <task>/<run> --view refs [--cursor <cursor>]`.
109
+ `deltaRefs` samples changed identities, with `deltaRefsTotal` reporting coverage.
110
+ `--view full` explicitly reads the complete pack when needed; do not load or
111
+ traverse every historical reference merely to make an entry window complete.
112
+ If `input.directiveOmitted` is true, read the complete assigned input with
113
+ `--view input` before acting; its entry summary is not the instruction body.
75
114
  Expand only an authorized ref when
76
115
  its full value is needed, selecting it by the pointer's exact `store` and
77
116
  `refId`:
@@ -150,13 +189,20 @@ TUI, with the configured Agent, permissions and workspace unchanged. A live
150
189
  unmanaged Session is not silently replaced or adopted; use an explicit Session
151
190
  lifecycle action before enabling controlled delivery.
152
191
 
153
- Context reads never consume queue entries. Global Context returns bounded
154
- `pending` and `recent` discovery pages, not Message bodies. Read a referenced
192
+ Context reads never consume queue entries. Global Context returns a bounded
193
+ `pending` discovery page, not Message bodies, Profile bodies, recent history or
194
+ accumulated retry details. The Manifest retains the exact Role profile.
195
+ Read a referenced
155
196
  original with `role message show <role> <message-id> --json`. Follow a pending
156
197
  page's `nextCursor` using `role message list <role> --pending --cursor <cursor>`
157
198
  when it is incomplete; accepted delivery does not erase the Message from the
158
199
  separate all-message list. Native/transport acceptance is not implementation, and
159
200
  `interrupt-requested` is not a stopped Turn or stopped background resources.
201
+ `role message list <role> --diagnostics` projects repeated classified failures
202
+ from original evidence with first/latest occurrence, count and recovery evidence.
203
+ `--diagnostic <key>` pages the original affected observations. Counts cover
204
+ distinct observations, not repeated polling of one identity. A recovery notice
205
+ is neither an input acknowledgement nor proof that prior effects were undone.
160
206
  Saving a Task Message or Brief is not notification delivery to Operator. A
161
207
  Task Role uses the existing Task InputRequest path for a genuinely missing
162
208
  user decision, not global Role input controls or fabricated progress questions.
@@ -165,6 +211,83 @@ then handoff. An accepted or unconfirmed steer must not be submitted again by
165
211
  changing its request id or composing then. A conclusive rejection permits an
166
212
  explicit new control attempt; uncertainty does not.
167
213
 
214
+ ## Handle your own inbox in the current turn
215
+
216
+ After loading authorized context, at useful work boundaries and before handing
217
+ off, use `yui inbox list --json` to discover pending input addressed to your
218
+ current managed identity. This applies to Operator, custom GlobalRole, Leader,
219
+ Worker and Reviewer. Do not poll an empty inbox or create another model turn.
220
+ No target Role, Task or native Session is supplied: Yui resolves your current
221
+ identity. A native child gains no separate actor or inbox.
222
+
223
+ 1. Read the selected `yui inbox show <entry> --json`. Reads never consume input.
224
+ Follow `nextCursor` and all `contentPage` pages using the rules below.
225
+ 2. Before processing, reserve exact entries with
226
+ `yui inbox claim <entry> [<entry> ...] --request-id <stable-id> --json`.
227
+ At most 16 entries are allowed, with independent per-entry results. Retain
228
+ each successful returned ID and request ID; do not replay successful items
229
+ when another item fails. A changed pending window requires a fresh list.
230
+ 3. Read complete originals and referenced results, then handle the request
231
+ within its existing authority. Leader notification-window claims move one exact pending window
232
+ into a durable wake: use the returned `originals` command, follow every
233
+ relevant original Message/Run reference, and use its returned wake ID for
234
+ acknowledgement. Later arrivals remain in the next pending window.
235
+ Assignment inbox reads (including a managed Leader Assignment) expose only
236
+ messages for the current Assignment;
237
+ they supplement the frozen pack without expanding it or changing candidates.
238
+ 4. Only after handling, explicitly acknowledge each successful item:
239
+ `yui inbox ack <returned-entry> --request-id <stable-id> --reason "<disposition>" --json`.
240
+ Record an obsolete notification as requiring no further action only after
241
+ checking its originals and current facts, never based solely on age.
242
+
243
+ Claiming prevents ordinary automatic delivery; it is not processing completion.
244
+ Acknowledgement records Agent handling, not Host acceptance, result acceptance,
245
+ Task completion, publication or archive. Never acknowledge merely to empty the
246
+ list. On failure or interruption, leave the claim unacknowledged; it remains
247
+ discoverable and does not expire or replay automatically. A current rightful
248
+ successor must inspect original input and prior effects before finishing and
249
+ acknowledging a retained claim. Never replay uncertain external actions.
250
+ For an exact-Session input already claimed by its selected Session, a rightful
251
+ successor may explicitly settle that handling after inspecting the original
252
+ and prior effects. This preserves the original target and claim; it grants no
253
+ permission to submit or execute the input in a different Session.
254
+ An Assignment change does not inherit handling authority. If the original Run
255
+ stopped before acknowledgement, ask the Leader to inspect its exact native
256
+ terminal and use the existing `task message handoff` to the current authorized
257
+ Assignment. The original claim remains; handoff never resubmits it automatically.
258
+ If that Assignment is obsolete, the Leader may inspect the original and prior
259
+ effects, then explicitly use `task message retire <task/message> --reason "<disposition>"`.
260
+ Retirement preserves the original claim and records the management decision;
261
+ it neither fabricates an acknowledgement nor proves native execution stopped.
262
+ An unfinished claim fences its Assignment, not unrelated work of the same Role.
263
+
264
+ In-flight, unknown, not-yet-delivered explicit interrupt-then and
265
+ unsettled steer inputs retain their existing owner/receipt and report a bounded
266
+ reason instead of being taken over. Use existing exact-receipt recovery when
267
+ needed; do not change request IDs, clear identity, or copy input to bypass it.
268
+ A steer with no control receipt was not submitted; it may be explicitly handled
269
+ and acknowledged in its authorized inbox, without converting it into a queue.
270
+ An accepted notification still follows its normal handling path, not another
271
+ native delivery. Accepted Global inputs, delivered Leader windows and current
272
+ Assignment continuations remain in the inbox until explicitly handled. Claim the
273
+ received entry, inspect its originals and existing effects, then ack with a
274
+ concrete disposition (including result or effect receipt references when useful).
275
+ This claim never sends the input again. A current rightful successor may settle
276
+ an accepted Global input or Leader window while retaining the original delivery
277
+ target; it must inspect prior effects first. Pending/unknown acceptance stays
278
+ blocked and cannot use claim as a replay path.
279
+
280
+ An ack belongs to the exact original and revision: fixed windows pin
281
+ `message.updated` event identities, including same-timestamp edits. A later
282
+ revision still needs its own handling. Before Task completion, settle handled
283
+ user-input windows; native acceptance or a terminal does not settle them.
284
+ Original Messages, wake windows and handling receipts remain readable after
285
+ acknowledgement. Lost context, Session continuation and installation upgrades
286
+ do not reset receipts. If ack fails after an external effect, read back the
287
+ original claim and the external receipt before retrying the same ack; do not
288
+ repeat the effect. This is durable handling evidence, not arbitrary external
289
+ exactly-once execution.
290
+
168
291
  ## Read bounded information completely when required
169
292
 
170
293
  Structured CLI results live in the top-level `data`, not a JSON-encoded
@@ -176,6 +299,12 @@ family, then `task context inspect <task> --store <store> --ref <refId>
176
299
  --digest <digest>` to read its exact current value. Common Task lists use the
177
300
  same `items`, `total`, `complete`, and `nextCursor` contract. Do not treat the
178
301
  first page or a summary as complete requirements.
302
+ The 32 KiB compact-JSON read budget includes nested data, cursors and structure;
303
+ summaries are at most 512 UTF-8 bytes. Current Task Message discovery excludes
304
+ explicit acknowledgements and retirements, not uncertain delivery. Use
305
+ `--view current` for its continuation and the default all view for history.
306
+ Skill checks remain metadata-only; unusually large checks use the same explicit
307
+ document pagination. A small default window is not a request to fetch all history.
179
308
 
180
309
  Long detail reads return `contentPage` instead of the ordinary value (under
181
310
  `data.context` for Run context/expand, `data.contextDelta` for Run Context delta). Repeat the same read with
@@ -0,0 +1 @@
1
+ 6
@@ -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
@@ -143,11 +143,30 @@ If exact native stop or inspection fails, read the persisted diagnostic and
143
143
  resolve that resource boundary; do not kill arbitrary processes, clear unknown
144
144
  execution records, or modify managed refs, tmux Sessions or state files.
145
145
 
146
- Breaking upgrades require a clean runtime environment; Yui does not discover,
147
- convert or inherit historical Hosts and processes. Storage migration is a
148
- separate explicit operation, not proof of runtime continuity. Do not interpret
149
- missing compatibility diagnostics as permission to reuse an old process,
150
- discard pending intent or bypass exact ownership and stop confirmation.
146
+ Compatible upgrades preserve logical Sessions. Build generations and historical
147
+ Skill packages are provenance, not continuation gates. Load current stable
148
+ Skills and current authority; never change a user's model, account, native
149
+ permissions or workspace to make an upgrade work.
150
+
151
+ Within Host control/event v1, status advertises `controlCapabilities` and the
152
+ loaded `hostImplementation`, independently of `endpointImplementation`. Missing
153
+ capabilities or `eventDelivery` are unreported, not healthy. A Controller must
154
+ not repeatedly send an unsupported `reconcile-turn`; the existing raw Inbox
155
+ still permits exact event consumption without executing the input again.
156
+ Current Hosts retain unpersisted original facts during a filesystem failure;
157
+ keep that process alive until persistence recovers. Those volatile bytes cannot
158
+ be recovered after process loss merely by restarting the Controller.
159
+
160
+ Program/storage upgrade success does not mean Host replacement succeeded.
161
+ Compatible live Hosts may continue, including busy ones. A new Host may resume
162
+ the same native Session only through the existing authorized lifecycle after
163
+ exact execution, background resources and writer release are proven. An idle
164
+ status, a stopped proxy or a missing control field is insufficient. Unknown
165
+ effects preserve the original Session, input and resources; do not force-kill,
166
+ replay, hot-replace loaded modules or silently create a new Session. Existing
167
+ explicit stop/replacement authority is separate from an ordinary upgrade.
168
+ Unsupported protocols require an explicit bounded recovery plan, not arbitrary
169
+ historical Host adoption. Storage migration remains independently fenced.
151
170
 
152
171
  After repeated failure of the same bounded recovery, report the observed
153
172
  cause, impact and smallest remaining options. Do not broaden cleanup or add
@@ -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