@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
@@ -1,512 +1,184 @@
1
1
  ---
2
2
  name: yui-runtime
3
- description: Use authorized context, durable results, and recovery boundaries in a Yui-managed Session, including global conversation, direct Leader work, and dispatched AgentRuns.
3
+ description: Apply the shared authority, current-context and input-handling contract in a Yui-managed Session; consult operation manuals only for the action being taken.
4
4
  ---
5
5
 
6
6
  # Yui Runtime
7
7
 
8
- Use this Skill for the shared Yui execution contract. The Role Skill owns
9
- coordination or delivery judgment; Project Skills, Policy and Knowledge own
10
- project-specific methods. These instructions grant no additional authority.
11
- Resolve links relative to this Skill's directory, not the execution workspace.
12
-
13
- Treat the Session Manifest and AgentRun Bootstrap Envelope as pointers, never as the
14
- Task brief. Do not infer Task facts from the launch command, process list,
15
- workspace layout, native transcript, or an earlier AgentRun.
16
-
17
- ## Enter through the current context
18
-
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.
47
-
48
- Refresh dynamic Task/Session facts before the relevant decision regardless of
49
- instruction reuse. Leader notifications use the Manifest's `currentCommand`;
50
- explicit AgentRuns use `loadCommand`/`expandCommand` with the actual newest
51
- dispatched Run identity. Never execute `<run-id>` placeholders or substitute a
52
- notification's wake ID for a Run. CLI/Controller identity, scope, Snapshot and
53
- permission checks remain authoritative on every operation.
54
-
55
- There are two normal Task entry points. A user may continue directly with the
56
- current, unrevoked Leader Session: read current context using
57
- `yui task context <task-id> --json`. Do not request a self-wake, reopen a Task,
58
- or reuse an old completed AgentRun snapshot merely to obtain authority. Pending
59
- delivery, unknown execution evidence and missing reports do not themselves
60
- revoke Session authority. Task lifecycle, scope, Assignment, workspace and
61
- resource boundaries still apply; a planning Session does not gain delivery
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.
68
- Use the runtime-provided `TMPDIR` for temporary context or diagnostic files,
69
- not fixed shared `/tmp` names or the logical multi-Project workspace container.
70
- Save durable reports in Task artifacts/results before releasing their temporary
71
- workspace. Integration history and check evidence outlive its worktree; a
72
- terminal attempt is not an unresolved business input merely because resources
73
- remain. Cleanup inspects exact ownership and preserves unknown or dirty data.
74
-
75
- Ordinary commands use `yui` from the intended launch environment's PATH and
76
- `YUI_HOME`. Session/native identity, Task/Assignment/workspace authority and
77
- Controller protocol/storage checks still apply; they do not distinguish every
78
- installation with the same protocol and storage versions. If the entry or Home
79
- is wrong or unavailable, report that fact and use the explicitly authorized
80
- entry/environment; do not guess another installation or clear Session identity.
81
-
82
- Desktop commands may carry only `CODEX_THREAD_ID`. The CLI resolves that native
83
- identity against the selected Home's current and historical Session records before
84
- routing operations. An unknown provider thread with no Yui-specific identity hints
85
- is an ordinary public caller, like a user terminal; it needs no managed Manifest
86
- to read public information or create a Draft Task. This does not start discussion
87
- or development or grant internal managed capabilities. Public command availability
88
- is not user authorization for a new effect.
89
- Environment and Manifest values are location hints, not continuing grants.
90
- Conflicting, partially specified, unregistered Yui identities and known historical
91
- or revoked Sessions do not become public callers. An ID known only in another
92
- Home cannot be recognized from the selected Home alone: keep the intended
93
- Home/Manifest context rather than switching Homes or dropping hints.
94
- `inbox list` reports the resolved managed identity. Do not add or clear
95
- environment fields to repair a mismatch. Without a Manifest environment pointer,
96
- `session skills` returns current Skill paths and the Session's captured profile.
97
-
98
- For every explicitly dispatched managed Task AgentRun:
99
-
100
- 1. Read the exact AgentRun identity from the newest Bootstrap Envelope.
101
- 2. Before acting, load its authorized pack using the current Session Manifest's
102
- Context command and the exact Task/Run identity:
103
-
104
- ```sh
105
- yui task run context "<task-id>/<run-id>" --json
106
- ```
107
-
108
- 3. Verify that the returned Task, AgentRun, Role, purpose, Snapshot digest, workspace,
109
- and Adapter match the Envelope and Session Manifest. Stop and report a
110
- context-load failure if the pack is missing, stale, unauthorized, malformed,
111
- or mismatched. Never request an inline/full-prompt fallback.
112
- 4. Use the entry's `pointers` (including each pointer's summary) first. They are
113
- a bounded window into the frozen readable-ref inventory. `pointerPage`
114
- reports total/complete/nextCursor; discover further relevant refs with
115
- `task run context <task>/<run> --view refs [--cursor <cursor>]`.
116
- `deltaRefs` samples changed identities, with `deltaRefsTotal` reporting coverage.
117
- `--view full` explicitly reads the complete pack when needed; do not load or
118
- traverse every historical reference merely to make an entry window complete.
119
- If `input.directiveOmitted` is true, read the complete assigned input with
120
- `--view input` before acting; its entry summary is not the instruction body.
121
- Expand only an authorized ref when
122
- its full value is needed, selecting it by the pointer's exact `store` and
123
- `refId`:
124
-
125
- ```sh
126
- yui task run context expand "<task-id>/<run-id>" <ref-id> --store <store> --mode full --json
127
- ```
128
-
129
- `--store` is required, even when the ref id is unique. Select both fields
130
- from the exact authorized pointer; never infer a store from the id.
131
- Dispatched Runs require an explicit frozen Snapshot. A historical Run
132
- without one is audit-only: current Task facts cannot reconstruct its
133
- execution Context.
134
-
135
- A pointer or summary is not the request's body. Before planning or executing,
136
- read the relevant WorkItem/Task requirements and referenced user/Operator
137
- messages; use the expansion command above or the Leader's current Task Context.
138
- Reports remain evidence, not authority to enlarge the assignment.
139
-
140
- 5. On a later wake, refresh current Task facts separately from frozen Run refs.
141
- Use a Run delta only against its exact declared Snapshot lineage; `deltaRefs`
142
- is a hint, not a complete patch. If no baseline is available, reload the
143
- exact pack; do not reconstruct state from transcript memory.
144
-
145
- Loading and verifying Context is the start of the work, not its result. Continue
146
- with the authorized assignment. In Draft, persist the discussed plan and wait
147
- when the user asks for alignment; do not end with only a context-loaded receipt.
148
-
149
- `liveTaskState.activeRuns` and `liveTaskState.activeTaskReviews` are
150
- observational views of work currently in flight. They grant no authority and
151
- create no Task-wide lock or gate; use each exact AgentRun or Review binding when a
152
- decision depends on it.
153
-
154
- The pack's authority view and writable Project IDs are hard boundaries. A
155
- native subagent inherits only its parent's current refs and authority, including
156
- any Assignment restrictions. It gains no new Yui actor, AgentRun, Session or
157
- cross-Task read permission.
158
-
159
- For a global Operator or custom GlobalRole Session, execute the exact
160
- `contextProtocol.loadCommand` carried by the current Session Manifest before
161
- routing or acting. That command is self-contained because a Global Codex Thread
162
- may move between Yui's remote TUI and Desktop; never reconstruct it from
163
- `YUI_SESSION_*` process variables.
164
-
165
- If that read fails because the Controller is unavailable, use only authorized
166
- offline diagnostics and [Controller recovery](references/recovery.md) to restore
167
- access, then reload context. Failure does not grant Task execution authority,
168
- but a successful preliminary RPC is not a prerequisite for that recovery.
169
-
170
- Global context grants no Task implementation workspace. Read a Task only after
171
- the Operator has routed to its public/task-authorized context command; never
172
- invent a Task AgentRun identity for a GlobalRole.
173
-
174
- A GlobalRole's durable input uses the same three actions as a Task Role,
175
- addressed by the Role's own name instead of a Task. The local-user Web surface
176
- exposes this contract. Use `yui role message queue|steer <role> <text>` or
177
- `yui role interrupt <role>` through the public CLI. Queue/steer require a stable
178
- `--request-id`; steer/interrupt require the exact `--expected-target`.
179
- Configuration remains under `config role` and lifecycle under `session`.
180
- Do not fabricate Task/Run ownership or borrow the browser's user authority to
181
- bypass a managed Session boundary.
182
-
183
- Queue and steer
184
- save an owned Message; bare interrupt records a control request, not a new
185
- Message. Each uses a stable request id and that Role's own Session; none fabricates a Task or
186
- runId to reuse Task-scoped delivery. `queue` delivers at the Role's next legal
187
- opportunity and is idempotent by request id. `steer` and `interrupt` affect only
188
- the exact current native Turn — a stale `--expected-target`, an incapable plan,
189
- or an unproven delivery leaves the Message saved and reports the reason, and
190
- `interrupt` stops only through the Provider's native cancel with an optional
191
- `--then-message` naming one already-saved GlobalRole Message. When the Role holds
192
- no live managed Turn, a steer or interrupt is `NO_ACTIVE_TURN` and never falls
193
- back to another action.
194
-
195
- New controlled Global Sessions use the existing Host console, not the native
196
- TUI, with the configured Agent, permissions and workspace unchanged. A live
197
- unmanaged Session is not silently replaced or adopted; use an explicit Session
198
- lifecycle action before enabling controlled delivery.
199
-
200
- Context reads never consume queue entries. Global Context returns a bounded
201
- `pending` discovery page of current-turn and available input, not Message bodies,
202
- Profile bodies, historical receipt debt or accumulated retry details. Its
203
- `historyCount` is a separate absence-of-handling-evidence count, not new work.
204
- The Manifest retains the exact Role profile.
205
- Read a referenced
206
- original with `role message show <role> <message-id> --json`. Follow a pending
207
- page's `nextCursor` using `role message list <role> --current --cursor <cursor>`
208
- when it is incomplete; accepted delivery does not erase the Message from the
209
- separate all-message list. Native/transport acceptance is not implementation, and
210
- `interrupt-requested` is not a stopped Turn or stopped background resources.
211
- `role message list <role> --diagnostics` projects repeated classified failures
212
- from original evidence with first/latest occurrence, count and recovery evidence.
213
- `--diagnostic <key>` pages the original affected observations. Counts cover
214
- distinct observations, not repeated polling of one identity. A recovery notice
215
- is neither an input acknowledgement nor proof that prior effects were undone.
216
- Saving a Task Message or Brief is not notification delivery to Operator. A
217
- Task Role uses the existing Task InputRequest path for a genuinely missing
218
- user decision, not global Role input controls or fabricated progress questions.
219
- Only an exact terminal and the original Session/writer boundary can release a
220
- then handoff. An accepted or unconfirmed steer must not be submitted again by
221
- changing its request id or composing then. A conclusive rejection permits an
222
- explicit new control attempt; uncertainty does not.
223
-
224
- ## Handle your own inbox in the current turn
225
-
226
- For an automatic delivery naming an exact Message or wake, use that entry
227
- directly: read its original, claim it, and record its semantic disposition
228
- before ending this turn. Do not first enumerate history to rediscover it.
229
- After loading authorized context, at useful work boundaries and before handing
230
- off, use `yui inbox list --view current --json` to discover current-turn and
231
- available input addressed to your current managed identity. This applies to Operator, custom GlobalRole, Leader,
232
- Worker and Reviewer. Do not poll an empty inbox or create another model turn.
233
- No target Role, Task or native Session is supplied: Yui resolves your current
234
- identity. A native child gains no separate actor or inbox.
235
-
236
- `--view history` discovers old missing receipts explicitly; default `--view all`
237
- prioritizes current inputs and labels each entry's category. Never treat an
238
- absent historical ACK as proof that its work was not done. Read history when a
239
- specific reminder, recovery or user request calls for it, not every turn.
240
- Current correlation reuses exact delivery/continuation/control identities;
241
- active claims retain their observed native attempt when available. Missing
242
- historical correlation is not reconstructed from timestamps or final text.
243
-
244
- 1. Read the selected `yui inbox show <entry> --json`. Reads never consume input.
245
- Follow `nextCursor` and all `contentPage` pages using the rules below.
246
- 2. Before processing, reserve exact entries with
247
- `yui inbox claim <entry> [<entry> ...] --request-id <stable-id> --json`.
248
- At most 16 entries are allowed, with independent per-entry results. Retain
249
- each successful returned ID and request ID; do not replay successful items
250
- when another item fails. A changed pending window requires a fresh list.
251
- 3. Read complete originals and referenced results, then handle the request
252
- within its existing authority. Leader notification-window claims move one exact pending window
253
- into a durable wake: use the returned `originals` command, follow every
254
- relevant original Message/Run reference, and use its returned wake ID for
255
- acknowledgement. Later arrivals remain in the next pending window.
256
- Assignment inbox reads (including a managed Leader Assignment) expose only
257
- messages for the current Assignment;
258
- they supplement the frozen pack without expanding it or changing candidates.
259
- 4. Only after handling, explicitly acknowledge each successful item:
8
+ This entry is the shared core, not a requirement to keep every operation manual
9
+ in context. Role Skills own coordination/delivery judgment; Project Skills,
10
+ Policy and Knowledge own project methods. None grants additional authority.
11
+ Resolve links relative to their containing file.
12
+
13
+ ## Keep the current working set
14
+
15
+ The managed Host mechanically checks current Skill VERSION/readability for each
16
+ input. Use its short check result/current pointers; do not duplicate that check.
17
+ Without a Host check, run the Manifest's `contextProtocol.skillCheckCommand`
18
+ (older Manifests: `yui session skills --json`) through the intended CLI/Home.
19
+ Global `loadCommand` includes the check. Recheck after repair/relevant change.
20
+
21
+ A check is metadata, not bodies, remembered instructions, a loading receipt or
22
+ authority. Current stable paths supersede historical audit packages. Reuse
23
+ unchanged full instructions only while actually available in current context.
24
+
25
+ On first entry, new/restored Session or Host attachment, or missing/compacted/
26
+ uncertain context, read the exact Manifest profile and every current Skill entry
27
+ listed for this Session, including this full core, Role and custom Skills.
28
+ For a localized version change, reload that owner's entry/relevant references;
29
+ retain other available full entries.
30
+ Then select references for the **current action**, not all previous topics or
31
+ every action in the Task's stage. After compaction, reconstruct that minimum
32
+ working set from current intent and facts; do not restore an accumulated manual
33
+ history. A genuine Host reconnect may provide an entry pointer, but neither its
34
+ presence nor absence proves provider memory or compaction. Recover missing
35
+ instructions even without a Host notice.
36
+
37
+ Read every selected required file through EOF, including references triggered
38
+ inside it. A link alone is not a mandatory read. Keep output within tool budgets;
39
+ recover truncated ranges before acting. A summary or successful read exit is
40
+ not the full body. A localized gap needs that full file, not unrelated manuals.
41
+ References use their owner's VERSION; check a cross-Skill owner's current stable
42
+ version when absent from the check result. No stored memory/read receipts are needed.
43
+ Missing current entries/VERSIONs are concrete installation errors: report exact
44
+ paths, preserve input/authority, repair legally and recheck. Damaged historical
45
+ packages do not revoke a valid Session and current source cannot prove past loads.
46
+
47
+ Prefer grouping already-known, independent, necessary read-only requests in one
48
+ tool call when their combined output fits its budget. Inspect each result and recover
49
+ missing or truncated bodies. Stop at dependencies on earlier results; do not
50
+ guess targets or mix writes into a read group. Grouping does not bypass required
51
+ instruction loading, authority checks or input-handling order.
52
+ Choose the working set for one action, not one file at a time: combine its known
53
+ applicable manuals before acting, then follow newly discovered prerequisites.
54
+ Use directories, timestamps and excerpts to select sources, never to replace
55
+ required originals or infer authority from recency. Prefer complete relevant
56
+ documents/sections over serial field probes; a citation location is not a read
57
+ plan. After compaction select again from current intent, not the old reading list.
58
+
59
+ ## Use the exact authority and originals
60
+
61
+ Manifest/Bootstrap are pointers, not requirements. Tasks, WorkItems, Messages,
62
+ Decisions, results and managed workspaces hold durable intent/progress; native
63
+ transcripts, processes, directories and prior Runs do not supply Task authority.
64
+ Refresh relevant dynamic facts even when reusing instructions:
65
+
66
+ - Direct Leader conversation/notification: use the Manifest `currentCommand`
67
+ or `yui task context <task-id> --json`. No self-wake or old completed Run is
68
+ needed. Pending delivery/missing reports do not revoke the current Leader.
69
+ - Explicit managed Task Run: read [Dispatched context](references/dispatched-run.md)
70
+ and, when expanding its input/refs/pages, [Context reads](references/context-reads.md)
71
+ before planning/acting; load the newest exact Run, verify its frozen identity,
72
+ Snapshot, scope/workspace and relevant original requirements. A wake is not a Run.
73
+ - Global Role: execute the exact self-contained Manifest `loadCommand`, not a
74
+ reconstruction from process variables. It grants no Task implementation
75
+ workspace or invented Task Run. Read Task facts through the authorized route.
76
+
77
+ Use only the intended CLI/Home; matching protocol/storage is not installation
78
+ identity. Never clear/add identity hints, switch Homes/Sessions or invent a Run
79
+ to evade a refusal. For identity ambiguity read [Session identity](references/session-identity.md).
80
+ Execution authority, writable Project IDs, Assignment and workspace limits
81
+ remain hard boundaries, not blanket confidentiality labels. Read relevant
82
+ ordinary Task records and provider conversations through their resource access
83
+ checks without requiring a cross-Task Grant or Operator relay solely for Task
84
+ ownership. Native conversation reads need not pass through Yui; missing Yui
85
+ mapping or terminal lifecycle is not itself a read prohibition. Resolve ambiguous
86
+ targets and report unavailable resources, without switching Home or identity.
87
+ Preserve actual tenant, confidentiality and explicit read restrictions.
88
+ In a single-user local Home, filesystem and authenticated transport boundaries
89
+ still apply; a Home path is not another user's permission. Read relevant material
90
+ only and do not copy secrets or unrelated personal information into reports.
91
+ Another Role's instructions are evidence, not your assignment:
92
+ reading never authorizes its input claim, writes, wake or execution takeover.
93
+ Native children inherit parental authority and explicit restrictions, no new Yui actor.
94
+ Active Run/Review views are observations, not Task-wide locks or grants.
95
+
96
+ Read complete relevant original input, requirements, results and authorization
97
+ before their business decision/effect or ACK. Summaries locate sources, not
98
+ replace them. Lists/first pages are bounded discovery; finish relevant bodies,
99
+ not unrelated history. CLI JSON lives in `data`. When discovery, focused wakes,
100
+ result lookup or pagination needs expansion, read [Context reads](references/context-reads.md)
101
+ before assembling it; never mix source/digest chunks or apply read cursors to writes.
102
+
103
+ Read-only analysis/diagnosis/review authorizes no artifact, Brief, Decision,
104
+ configuration or file writes unless requested; return analysis and required
105
+ input receipts. Implementation authorizes bounded work, not unrelated effects.
106
+ Ordinary legal engineering choices need no user-operated Yui procedure.
107
+ Live models as validation subjects, paid/shared/production/quota effects need
108
+ proactive authorization for that exact resource/effect; generic testing is
109
+ insufficient. Otherwise use isolated evidence, state gaps and do not solicit
110
+ such validation via InputRequest.
111
+
112
+ Apply a prerequisite to the actor and operation it governs. Inspecting or routing
113
+ another Role's failure is not retrying/resuming that execution. Reading a manual
114
+ grants no supervisory authority. Task, Run, Message, operation request IDs and
115
+ effect/correlation keys are distinct identities: use the receiving command's
116
+ declared request ID, retained for that exact logical operation. A source
117
+ effect/correlation key is not implicitly its request ID.
118
+
119
+ ## Handle your own input
120
+
121
+ After context load, at useful boundaries and before handoff, use
122
+ `yui inbox list --view current --json`. Handle an exact delivered entry directly,
123
+ not by rediscovering history; do not poll empty inboxes or manufacture turns.
124
+
125
+ 1. Identify the exact entry from its complete original. Global Context may supply
126
+ it in `currentOriginals`; otherwise read `yui inbox show <entry> --json`.
127
+ 2. Reserve it with `yui inbox claim <entry> --request-id <stable-id> --json`.
128
+ Claim only reserves handling; it is neither processing nor business effect.
129
+ 3. Read/reuse complete relevant originals/results, then handle within scope.
130
+ A Leader wake's `inbox show` may include the focused `originalContext`;
131
+ reuse its complete originals, following exact reads only for missing content.
132
+ A pending-window claim still returns its durable wake ID and `originals` read.
133
+ Assignment input does not expand its frozen permissions.
134
+ 4. After your disposition, use
260
135
  `yui inbox ack <returned-entry> --request-id <stable-id> --reason "<disposition>" --json`.
261
- Record an obsolete notification as requiring no further action only after
262
- checking its originals and current facts, never based solely on age.
263
-
264
- An input can be settled as executed, legally routed/delegated, a necessary user
265
- question raised, or superseded/no action after inspecting authoritative
266
- originals. Put that concrete disposition and useful Task/InputRequest/result/
267
- Publication references in `--reason`. Routing may be complete while the Task
268
- is still running; do not hold the input until all downstream work finishes.
269
- For supersession, identify the later source, not merely its age.
270
-
271
- At an exact native terminal, engineering checks for unacknowledged inputs
272
- correlated to that turn and emits at most one existing notification. This is
273
- missing-evidence detection, never semantic ACK or proof of absent effects.
274
- Reminder-only turns do not generate another reminder. The retained originals
275
- remain inspectable if the bounded reminder is also missed; do not start a
276
- private polling/retry loop or copy the business input to obtain another turn.
277
- Task Assignment checks go to Leader for inspection and existing handoff or
278
- retirement, not automatic Worker/Reviewer replay. Exact terminal can end an
279
- active-consumption notification reservation without acknowledging its input;
280
- it does not infer or release an uncertain native writer.
281
-
282
- For obsolete Global input that was conclusively not submitted, use
283
- `yui inbox retire <entry> --request-id <stable-id> --reason "<disposition>"`
284
- after inspecting the original and current facts. Retirement preserves the
285
- original target, claim and explicit management evidence; it is not ACK.
286
- Accepted input uses normal claim/ack reconciliation. Unknown/pending control,
287
- transport acceptance and interrupt-then ownership cannot be retired through
288
- this operation. Task Messages retain the existing Leader `task message retire`
289
- and exact-Assignment handoff paths.
290
-
291
- Claiming prevents ordinary automatic delivery; it is not processing completion.
292
- Acknowledgement records Agent handling, not Host acceptance, result acceptance,
293
- Task completion, publication or archive. Never acknowledge merely to empty the
294
- list. On failure or interruption, leave the claim unacknowledged; it remains
295
- discoverable and does not expire or replay automatically. A current rightful
296
- successor must inspect original input and prior effects before finishing and
297
- acknowledging a retained claim. Never replay uncertain external actions.
298
- After legal Session replacement, initialization can arrive before old handling
299
- is settled. This recovery notification is not the original business input or
300
- an acknowledgement. Read the current inbox and prior effects first. For
301
- `claimed-by-previous-session`, retain the original claim: do not claim again.
302
- Finish only the still-authorized handling and use a new stable ack request ID
303
- with a concrete disposition; the receipt retains both the old claimant and
304
- the current acknowledging actor. New queued input remains separate.
305
- For an exact-Session input already claimed by its selected Session, a rightful
306
- successor may explicitly settle that handling after inspecting the original
307
- and prior effects. This preserves the original target and claim; it grants no
308
- permission to submit or execute the input in a different Session.
309
- An Assignment change does not inherit handling authority. If the original Run
310
- stopped before acknowledgement, ask the Leader to inspect its exact native
311
- terminal and use the existing `task message handoff` to the current authorized
312
- Assignment. The original claim remains; handoff never resubmits it automatically.
313
- If that Assignment is obsolete, the Leader may inspect the original and prior
314
- effects, then explicitly use `task message retire <task/message> --reason "<disposition>"`.
315
- Retirement preserves the original claim and records the management decision;
316
- it neither fabricates an acknowledgement nor proves native execution stopped.
317
- An unfinished claim fences its Assignment, not unrelated work of the same Role.
318
-
319
- In-flight, unknown, not-yet-delivered explicit interrupt-then and
320
- unsettled steer inputs retain their existing owner/receipt and report a bounded
321
- reason instead of being taken over. Use existing exact-receipt recovery when
322
- needed; do not change request IDs, clear identity, or copy input to bypass it.
323
- A steer with no control receipt was not submitted; it may be explicitly handled
324
- and acknowledged in its authorized inbox, without converting it into a queue.
325
- An accepted notification still follows its normal handling path, not another
326
- native delivery. Accepted Global inputs, delivered Leader windows and current
327
- Assignment continuations remain in the inbox until explicitly handled. Claim the
328
- received entry, inspect its originals and existing effects, then ack with a
329
- concrete disposition (including result or effect receipt references when useful).
330
- This claim never sends the input again. A current rightful successor may settle
331
- an accepted Global input or Leader window while retaining the original delivery
332
- target; it must inspect prior effects first. Pending/unknown acceptance stays
333
- blocked and cannot use claim as a replay path.
334
- An explicitly released Leader notification (`notification.resolved` with
335
- `released-without-replay`) can be claimed for evidence inspection and settlement
336
- after verified native stop. Its original delivery status stays unknown or
337
- unaccepted; handling it cannot retarget Session-specific instructions or
338
- authorize re-executing unknown effects. If a required fact or user decision is
339
- unavailable, preserve the claim and report that exact boundary.
340
-
341
- An ack belongs to the exact original and revision: fixed windows pin
342
- `message.updated` event identities, including same-timestamp edits. A later
343
- revision still needs its own handling. Before Task completion, settle handled
344
- user-input windows; native acceptance or a terminal does not settle them.
345
- Original Messages, wake windows and handling receipts remain readable after
346
- acknowledgement. Lost context, Session continuation and installation upgrades
347
- do not reset receipts. If ack fails after an external effect, read back the
348
- original claim and the external receipt before retrying the same ack; do not
349
- repeat the effect. This is durable handling evidence, not arbitrary external
350
- exactly-once execution.
351
-
352
- ## Read bounded information completely when required
353
-
354
- For apparent conflicts, stage handoffs or incremental maintenance, read
355
- [current intent and temporal reads](references/context-ordering.md).
356
- It distinguishes stage progression from independent constraints and explains
357
- source attribution, Brief guards, fixed delta windows and bounded recovery.
358
-
359
- Structured CLI results live in the top-level `data`, not a JSON-encoded
360
- `output` string. Task current Context includes bounded current facts and
361
- message references; it does not include event or terminal Run history.
362
- `collections` and `attention` identify incomplete discovery. Use
363
- `task context list <task> --store <store> [--cursor <cursor>]` to discover one
364
- family, then `task context inspect <task> --store <store> --ref <refId>
365
- --digest <digest>` to read its exact current value. Common Task lists use the
366
- same `items`, `total`, `complete`, and `nextCursor` contract. Do not treat the
367
- first page or a summary as complete requirements.
368
- The 32 KiB compact-JSON read budget includes nested data, cursors and structure;
369
- summaries are at most 512 UTF-8 bytes. Current Task Message discovery excludes
370
- explicit acknowledgements and retirements, not uncertain delivery. Use
371
- `--view current` for its continuation and the default all view for history.
372
- Skill checks remain metadata-only; unusually large checks use the same explicit
373
- document pagination. A small default window is not a request to fetch all history.
374
-
375
- Long detail reads return `contentPage` instead of the ordinary value (under
376
- `data.context` for Run context/expand, `data.contextDelta` for Run Context delta). Repeat the same read with
377
- `--cursor <contentPage.nextCursor>` until `complete: true`. Concatenate `text`
378
- in offset order and parse the combined JSON once, retaining the same source
379
- and digest. A source-change error requires a fresh read, not mixing old and
380
- new chunks. Never use a read cursor to repeat a mutation.
381
-
382
- Read all pages of a relevant original requirement, result, or authorization
383
- before acting on it. For a wake, read its complete focused input/result view and
384
- relevant original Messages. `task wake show <task> <wake>` preserves the fixed
385
- window and explicit older refs, deduplicates inputs, and provides exact original
386
- reads. Use `--history` when window history or diagnostics is needed; unrelated
387
- events and merely started Runs are not required for ordinary result disposition.
388
- Follow any `contentPage` continuation for either view. The wake contains pointers
389
- and attributed summaries, not complete reports.
390
- For unrelated discovery, stop once the necessary evidence is found. Task
391
- event deltas retain their fixed upper bound and are history, not replacement
392
- current state. No read acknowledges implementation or consumes a queue.
393
-
394
- ## Discover operations for the current caller
395
-
396
- Use `yui help` or `yui --json help [command ...]` through the authorized CLI
397
- entry for the current caller's command view. Help, examples and shell completion
398
- share the catalog projection; public terminals and unmanaged Agents share one
399
- public view. This offline view is only guidance, not an authenticated permission
400
- or a way to switch Roles. An incomplete or stale managed identity must not be
401
- cleared to obtain public execution authority.
402
-
403
- For Codex, the native `CODEX_THREAD_ID` takes precedence over the transport's
404
- `YUI_NATIVE_SESSION_ID`; a newly created thread can legitimately lack the latter.
405
- Other adapters do not borrow Codex identity for offline discovery. A missing
406
- transport variable or hidden help entry alone does not prove Session failure.
407
- Discovery does not establish that a Session is current: actual execution still
408
- revalidates Session, Task/Assignment, workspace, resource and Grant boundaries.
409
-
410
- When capability discovery appears in that view, use `capability search` for
411
- templates and `capability describe <name> --task
412
- <task-id> --input '<json>'` for supported exact authorization assessments.
413
- No `access` field means no exact authorization conclusion was made: supply the
414
- required parameters and follow the domain's existing execution checks. Hidden
415
- operations are omitted; `requestable` includes the exact missing Grant bounds
416
- and existing request route; `authorized` remains subject to execution-time
417
- revalidation. Provider outages do not change this authorization observation.
418
-
419
- Discovery never sends requests, consumes Grants, starts plugins or approves
420
- effects. If the Task actually needs a requestable operation, use the existing
421
- Assignment Message to Leader, Leader InputRequest, or Operator path. Preserve
422
- the exact action, resource/plugin, digest, environment and phase. A response is
423
- not a Grant. Existing source-authorized Leader Grant operations and Operator
424
- Grant authority remain unchanged; never expand an authorization source or
425
- solicit real-resource validation merely because an operation is requestable.
426
-
427
- ## Preserve intent and authority
428
-
429
- An analysis, diagnosis, or review request is read-only unless the user also
430
- requests changes. A request to fix or implement authorizes the bounded work,
431
- not unrelated configuration, new external effects, or broader cleanup.
432
- Choose routine legal implementation and recovery actions without asking the
433
- user to operate Yui mechanically.
434
-
435
- Tasks, WorkItems, Messages, Decisions, results and managed workspaces hold
436
- durable intent and progress. Sessions, AgentRuns and runtime observations
437
- describe execution; their failure is not failed acceptance or permission to
438
- discard the assignment. Save context that a successor needs in durable records,
439
- not only in the native conversation.
440
-
441
- The Leader normally owns Task coordination and acceptance. An authorized
442
- Operator may perform the same legal Task-management actions; responsibility
443
- is not an extra permission gate. Worker and Reviewer results remain evidence
444
- until an authorized acceptance decision.
445
-
446
- ## Separate execution from real-resource validation
447
-
448
- The current Leader and configured Worker, Reviewer, Operator, custom Role, and
449
- native child Agents are normal execution resources. They may develop, inspect,
450
- and review within their existing Task authority without additional user
451
- authorization merely because the Agent uses a real model.
452
-
453
- Using a live provider or model as the subject of validation is different.
454
- Paid APIs, shared infrastructure, production systems, real account quota, and
455
- other non-disposable external effects require the user to proactively authorize
456
- that exact resource and effect boundary. A generic request to implement, test,
457
- validate, run E2E, or complete a Task does not grant that authority.
458
-
459
- When such validation was not requested, use deterministic or isolated evidence,
460
- state the material gap, and optionally recommend a separate follow-up. Do not
461
- create an InputRequest merely to solicit permission for it.
462
-
463
- ## Return evidence and recover within scope
464
-
465
- When authoring a durable Message or managed final report, put a concise
466
- `Yui-Summary: <one line>` first when useful for notification readers. Keep the
467
- summary itself at most 512 UTF-8 bytes, and preserve material failure,
468
- unverified-result, pending-decision and authority qualifications. Do this as
469
- part of producing the original, not a separate model call. The optional line
470
- remains part of the original text; missing or oversized summaries use factual
471
- templates without blocking delivery. Core may reuse that line as explicitly
472
- attributed presentation, never parse it into acceptance, review verdict or
473
- Task state. A returned execution result is not completed requirements; a
474
- returned review is not approval. Summaries do not replace reading full
475
- requirements, results or authorizations before decisions.
476
-
477
- Ordinary Task/Global notifications grant no new Assignment or authority and
478
- require no separate execution report. Read the referenced originals and advance
479
- outstanding work within existing authority under the relevant Role Skill.
480
- Reading context or accepting notification delivery does not implement input.
481
- Unknown delivery must not be replayed; use the recovery contract below.
482
-
483
- Provider acceptance, Context load, AgentRun completion, and Task completion are
484
- separate facts. For an explicitly dispatched managed Task AgentRun, end with one truthful
485
- final report. Yui automatically correlates that native terminal with the exact
486
- current AgentRun and persists the report; no completion command is required. The
487
- report itself does not accept the WorkItem or complete the Task.
488
-
489
- Ordinary native conversation is not an implicit managed assignment and does
490
- not require a separate execution report. Result Messages reference the
491
- execution's original report; read them with `task message show <task/message>`
492
- instead of asking the producer to copy or resend the report.
493
-
494
- Session reuse is a preference, not a prerequisite for progress. Before retry,
495
- replacement, or intervention in uncertain execution, read
496
- [runtime recovery](references/recovery.md). Preserve pending intent, exact
497
- runtime identity and workspace progress; never edit Run status or substitute
498
- a native Session behind Yui's back. A timeout is not proof of quiescence and
499
- does not authorize replay of unknown input.
500
-
501
- Qualifying transient Provider failures have bounded Controller-owned recovery.
502
- Read the current `providerRetry`/`retry` projection before dispatching a manual
503
- successor. `waiting` and `in-flight` mean infrastructure recovery is already
504
- owned; do not add a private retry loop or resend the input. Only a proven native
505
- success resets that chain, and it never accepts a WorkItem or completes a Task.
506
- After recovery, inspect existing work and external receipts before continuing;
507
- the system's recovery instruction supplies no new user authority.
508
-
509
- After an authorized external PR/MR operation, use the shared
510
- [publication recording contract](references/publication.md). Recording delivery
511
- facts does not authorize the external operation, imply acceptance, or grant
512
- permission to archive.
136
+ Record executed, legally routed, necessary question, or inspected supersession/
137
+ no action with exact references. Operator routing may settle before delivery.
138
+
139
+ ACK covers that exact original/revision and your responsibility, not transport
140
+ acceptance, WorkItem acceptance, Task completion or archive. Never ACK merely to
141
+ empty a list. Later arrivals/edits remain separate. Retain successful IDs in
142
+ batches (maximum 16); inspect each outcome and do not replay successes.
143
+ Failed/interrupted claims remain discoverable and do not expire/replay.
144
+ Before retained claims, handoff, reminders, retirement, unknown/control-owned
145
+ delivery or failed ACK, read [Inbox recovery](references/inbox-recovery.md).
146
+ Preserve original targets/claims; Assignment change does not inherit handling.
147
+ Missing historical ACK is missing evidence, not proof that work was undone.
148
+ Settle handled user-input windows before Task completion.
149
+
150
+ Unknown delivery/effects must not be replayed. A timeout proves neither stop
151
+ nor failure. Preserve original request/receipt and inspect prior effects before
152
+ recovery; never change request identity to bypass uncertainty.
153
+
154
+ ## Action index
155
+
156
+ Read only the material needed for the action, in full before taking it:
157
+
158
+ - Conflicting intent/stage handoff: [Current intent](references/context-ordering.md).
159
+ Task/Run delta maintenance: [Incremental context](references/incremental-context.md).
160
+ - Global pending-page expansion/diagnostics: [Global context](references/global-context.md).
161
+ Sending/steering/interrupting Global input: [Controls](references/global-input-controls.md).
162
+ A Task Role uses Task InputRequest for genuine user decisions, not Global controls;
163
+ Message/Brief saves are not Operator notifications.
164
+ - Help/capability or hidden-command investigation: [Discovery](references/command-discovery.md);
165
+ requestability is not a Grant.
166
+ - Actual retry, replacement, unavailable Controller or unknown-execution intervention:
167
+ [Recovery](references/recovery.md), then its applicable topic only. Inspect
168
+ Controller-owned retry before manual successors; never create competing retries.
169
+ Ordinary continuation after compaction is instruction recovery, not Session recovery.
170
+ - Authorized same-result completed-Task follow-up: [Reopen boundary](references/completed-followup.md).
171
+ - Authorized external PR/MR facts: [Publication](references/publication.md).
172
+ Authorized archive/retained-resource cleanup: [Archive](references/archive.md).
173
+
174
+ Use runtime `TMPDIR` for temporary material. Cleanup checks exact ownership and
175
+ preserves unknown/dirty data; save durable evidence before workspace release.
176
+ Retained resources do not turn terminal execution into unresolved business.
177
+
178
+ Each explicit managed Task Run returns one truthful final report, automatically
179
+ persisted at its exact native terminal; no completion command is needed.
180
+ Ordinary chat/notifications are not implicit assignments. Native acceptance,
181
+ Run terminal, result acceptance, Task completion, remote delivery and archive
182
+ are separate facts. Durable reports may begin with a qualified `Yui-Summary:`
183
+ line (at most 512 UTF-8 bytes), attributed presentation only, never semantic
184
+ approval or a substitute for originals.