@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
@@ -21,7 +21,7 @@ declared storage 1.10 → 1.11 transition; historical sources are never invented
21
21
  | What changed? | `task context delta <task> --after <cursor>` | Immutable events with a fixed upper bound, not a snapshot of current mutable state |
22
22
  | Which Global input? | `session context <role>` | Identity, Profile read pointer, authority, current native Turn/retry facts and a bounded pending Message page; history is opt-in |
23
23
  | Read Global input | `role message list <role> [--pending]`, `role message show <role> <id>` | Scoped discovery, then exact original; queue acceptance never erases history |
24
- | What arrived in this wake? | `task wake show <task> <wake>` | Fixed-window inputs/results, attributed optional summaries and exact original reads; `--history` expands diagnostics |
24
+ | What arrived in this wake? | `task wake show <task> <wake>` | Fixed-window inputs/results, bounded complete ordinary inputs and exact original reads; `--history` expands diagnostics |
25
25
  | What was assigned? | `task run context <task>/<run>` | Frozen authority, up to 16 `pointers`, sampled changed identities and live observations with totals; `--view refs` pages references, `--view full` reads the full pack |
26
26
  | Which repeated failure? | `role message list <role> --diagnostics` | Derived classified groups with count, first/latest and recovery evidence; `--diagnostic <key>` pages original occurrences |
27
27
  | Which configuration is real? | `task role session inspect <task> <role>` | Task/Role identity, desired binding, frozen Session, current Provider binding, retry and explicit Host observation; no full Task/Role copies or Provider conversation history |
@@ -32,11 +32,35 @@ Task Role-status and wake-history lists also page, with explicit detail commands
32
32
  Role discovery reports `recordedHealth` and `hostObservation: "not-requested"`,
33
33
  not live Host health. Even a normal recorded status cannot rule out a failed Host
34
34
  or unacknowledged terminal; follow the row's `task role status` read to inspect it.
35
+ `task role status <task> <role>` defaults to `--view current`: the same computed
36
+ health, Host, delivery/retry, cleanup and drift observations, with Run/WorkItem
37
+ identities and exact detail commands instead of their input/report/history bodies.
38
+ Retry diagnostics remain available through the current retry read. Desired and
39
+ effective configuration remain visible; unknown evidence is not upgraded to success.
40
+ This changes the default nested JSON contract. Consumers needing the previous
41
+ complete records use `--view full` and retain that option on pagination.
42
+ The underlying runtime status projection and Web payload are unchanged.
35
43
  Context lists additionally expose candidates, reviews, jobs, Project Knowledge,
36
44
  workspaces and other authorized record families. `--status`, `--after` and
37
45
  `--work-item` narrow Context discovery; every continuation must retain filters.
38
46
  Run listing accepts a Task or `task/work` target.
39
47
 
48
+ `task run show <task>/<run> --view status` reads identity, record status,
49
+ delivery/retry observations, retirement and result availability without copying
50
+ input, launch or report bodies. It uses the same authorization as the default
51
+ `--view full`, which retains complete audit evidence and document pagination.
52
+ Its retry observation is the same current summary used in Task Context, with
53
+ an exact Session retry command for raw diagnostics and history, not their bodies.
54
+ `--view result` returns the complete original result (including failure/provider
55
+ fields), Run identity/status, retirement and execution observation without the
56
+ submitted input or launch configuration. An absent result is `null`, not success.
57
+ Long reports retain document pagination; continue with the same view. The full
58
+ audit command remains available in `reads.full`, and the default is still full.
59
+ Read the original result through its Message, result or full Run view before disposition;
60
+ status is neither a report nor acceptance. Once that exact original is available
61
+ in current context, use status for additional execution facts instead of loading
62
+ the report twice. No read receipt or model-memory cache is introduced.
63
+
40
64
  Current Context's `attention.messages` excludes explicit acknowledgements and
41
65
  retirements; delivery alone is not handling. The exact wake receipt and latest
42
66
  Message revision determine coverage. `--view current` continues that view;
@@ -45,6 +69,28 @@ explicitly describe incomplete discovery. Samples are not proof that no older pe
45
69
  relevant input exists. Read the relevant fixed wake and original Messages;
46
70
  use family discovery when a broader requirement/history audit is needed.
47
71
 
72
+ Current Context is a working index, not a repeated configuration or requirements
73
+ dump. Task/Brief, Role, Project policy, workspace, delivery and decision records
74
+ return summaries and exact references even when their bodies are small. Lifecycle,
75
+ execution authority, attention counts and active execution/retry observations
76
+ remain inline. Read a relevant original through `context inspect` before acting
77
+ on its requirements or authority; `omitted: true` is not an empty original.
78
+ Fresh reads still compute current identities and enforce scope. There is no
79
+ model-memory cache, inferred handling receipt or automatic reuse of stale state.
80
+ Within the current workspace sample, the exact Run workspace overlay (when
81
+ authorized) precedes Task main, then other workspaces. Historical integration
82
+ directories cannot crowd Task main out of that sample. Full family discovery
83
+ retains its existing ordering, counts and original records; this priority neither
84
+ changes workspace authority nor grants access to another Assignment.
85
+
86
+ Message discovery can reuse an existing producer-authored `Yui-Summary:` from
87
+ the Message body or its matching terminal Run result. It labels the source as
88
+ an **author summary**, not a verified outcome or handling decision. The source
89
+ label counts toward the 512-byte summary budget; an otherwise valid summary
90
+ that no longer fits is omitted whole with an original-read hint, not clipped.
91
+ Missing, oversized or mismatched result summaries do not hide the Message or
92
+ change its exact original, digest, authorization or handling state.
93
+
48
94
  ## Budgets and continuations
49
95
 
50
96
  - Discovery pages default to 20 items, accept 1–100, and enforce a 32 KiB
@@ -58,6 +104,11 @@ use family discovery when a broader requirement/history audit is needed.
58
104
  uncertain ones. Historical missing receipts are a separate count and explicit
59
105
  `inbox list --view history` read; absence of ACK is not proof of unexecuted work.
60
106
  Continue its pending page with `role message list <role> --current --cursor`.
107
+ A managed self-read additionally includes `currentOriginals`: complete records
108
+ correlated to this exact Turn and present in that pending page, at most 4 KiB
109
+ each and 8 KiB combined. Available future inputs, history and oversized records
110
+ remain discovery-only; their exact reads are unchanged. Inspection callers get
111
+ no inline originals. This does not claim, deliver or acknowledge input.
61
112
  It does not repeat recent history, Profile bodies, frozen Skill
62
113
  packages or accumulated retry details. The Manifest is the Profile pointer;
63
114
  explicit Message and Session retry reads retain history and original evidence.
@@ -75,25 +126,140 @@ use family discovery when a broader requirement/history audit is needed.
75
126
  document continuation uses `--view full`. Neither changes the frozen authority.
76
127
  Read `--view input` before acting when `input.directiveOmitted` is true: the
77
128
  entry's bounded directive summary is not the assigned instruction body.
129
+ New frozen Task-message pointers include a literal `Excerpt:` preview in their
130
+ existing summary (at most 160 UTF-8 bytes), alongside the original revision
131
+ and digest. Use it to select relevant originals, not as their complete body or
132
+ authority. Later message edits cannot change that Run's frozen preview.
133
+ Existing snapshots are not regenerated.
134
+ When pointers are present, `reads.expand` exposes the existing selected-original
135
+ batch syntax directly. Replace the placeholders with relevant frozen pointers;
136
+ this is not a preselected read-all command. The existing 1–8 selection limit,
137
+ exact snapshot checks, complete original bodies and page budget are unchanged.
78
138
  - `session skills [--cursor ...]` checks only current metadata/readability. It
79
139
  does not read Skill bodies or historical packages, and uses document pagination
80
140
  only when the configured metadata exceeds the inline budget.
81
141
  - Detail documents up to 16 KiB remain ordinary JSON. Larger documents return
82
142
  `contentPage`: exact source, SHA-256 digest, JSON-character offset, total bytes
83
- and characters, text, completeness and a next cursor. Chunks contain at most
84
- 4096 UTF-16 code units without splitting surrogate pairs, keeping escaped
85
- wire output below 32 KiB. There is no 4 MiB cutoff that makes a legal original
143
+ and characters, text, completeness and a next cursor. Chunk lengths adapt to
144
+ the complete encoded 32 KiB response budget, including identity and cursors,
145
+ with 256 bytes reserved for small command wrappers. Chunks never split
146
+ surrogate pairs; offsets remain UTF-16 units and previously issued cursors
147
+ remain readable. There is no 4 MiB cutoff that makes a legal original
86
148
  permanently unreadable.
87
149
  - Task metadata/next-action/remote-delivery, Brief, WorkItem, Message, Run,
88
150
  decision/milestone/event, Role show/status/Session inspection, wake detail,
89
151
  InputRequest, Run context and frozen expansion use bounded detail reads.
90
152
 
153
+ Ordinary Task reads authenticate the original caller but do not restrict data
154
+ by its Task or Assignment ID. This single-user local product relies on local
155
+ filesystem permissions and authenticated service transports, not Task ownership
156
+ as a tenant boundary. Foreign current context identifies the caller's own Task
157
+ and labels its authority `reference-only`. Search, records, artifacts and native
158
+ conversation evidence do not switch identity, adopt another Run's instructions,
159
+ or grant writes, inbox handling, dispatch or external effects. Explicit resource
160
+ and Job-owned Role restrictions still apply. Native conversation tools need no
161
+ Yui gateway or Task mapping; actual resource access and relevant scope suffice.
162
+
163
+ Completed results remain readable. Simple questions need no reopen; the current
164
+ Leader may reopen its own unarchived result when a same-result request or explicit
165
+ unfulfilled commitment needs tracked diagnosis, evidence handoff, authority
166
+ coordination or authorized delivery. Diagnosis stays read-only; reopening retains
167
+ historical completion evidence and never lifts a stop, restores cancelled intent,
168
+ promotes a planning Session or grants external effects.
169
+
91
170
  Use `--json` and read the top-level `data`. Run context and expansion use
92
171
  `data.context`; Run Context delta uses `data.contextDelta`. For a long detail, repeat that same read with
93
172
  `--cursor <contentPage.nextCursor>`. Concatenate `text` in offset order, checking
94
173
  the same source and digest, and parse the combined JSON once. Do not parse
95
174
  chunks individually or treat a first chunk as the complete report.
96
175
 
176
+ ### Copyable detail-reading example
177
+
178
+ For 1–8 already-known independent originals in the same Task, use
179
+ `task context inspect <task> --refs '<JSON array of discovery ref objects>'`.
180
+ For hand-written commands, repeated `--context-ref <store/refId@digest>` flags
181
+ avoid JSON quoting; they use the same exact-reference spelling as dispatch.
182
+ Do not combine the two selection formats or single-inspect selector flags.
183
+ Each object requires `store`, `refId`, and `digest`; optional `revision` is
184
+ discovery metadata, not a second freshness guard. The response contains
185
+ `{taskId, items}`, with each item identical to a single inspect result.
186
+ The entire batch shares the existing 32 KiB budget, not one budget per item.
187
+ Follow `contentPage` using the same ordered references and `--cursor`.
188
+ A stale, duplicate, unavailable or forbidden reference rejects the whole read.
189
+ Each original is independently digest-pinned; this does not create an atomic
190
+ cross-record snapshot, select sources, claim inputs, or grant broader access.
191
+ Use single inspect unchanged when only one original is needed.
192
+
193
+ For `task context inspect`, the following Node.js example consumes the outer
194
+ `data` envelope. Supply the authorized CLI path and exact discovery arguments;
195
+ keep the current Session environment. It only reads that record, does not claim
196
+ or acknowledge input, and does not prove that an Agent has read its contents.
197
+ Save as a local `.mjs` file and invoke
198
+ `node reader.mjs /absolute/path/to/yui task-1 task-message message-1 <digest>`.
199
+ The final stdout is the reconstructed record; capture it in your owned scratch
200
+ directory and read it in bounded portions if it exceeds the tool output limit.
201
+ Do not re-fetch earlier pages just to inspect metadata.
202
+
203
+ ```js
204
+ import { spawnSync } from "node:child_process";
205
+
206
+ function readDocument(read) {
207
+ let cursor, source, digest, total, offset = 0;
208
+ const chunks = [];
209
+ for (;;) {
210
+ const data = read(cursor);
211
+ const page = data.contentPage;
212
+ if (!page) {
213
+ if (chunks.length) throw Error("Detail changed shape during pagination");
214
+ return data;
215
+ }
216
+ if (!chunks.length) {
217
+ ({ source, digest, totalCharacters: total } = page);
218
+ }
219
+ if (page.source !== source || page.digest !== digest ||
220
+ page.totalCharacters !== total || page.offset !== offset ||
221
+ typeof page.text !== "string" || !page.text.length) {
222
+ throw Error(`Detail identity/offset mismatch at ${offset}`);
223
+ }
224
+ chunks.push(page.text);
225
+ offset += page.text.length; // UTF-16 units, not UTF-8 bytes.
226
+ if (page.complete === true && page.nextCursor === null && offset === total) {
227
+ try { return JSON.parse(chunks.join("")); }
228
+ catch { throw Error(`Invalid completed detail at ${offset}`); }
229
+ }
230
+ if (page.complete !== false || offset >= total ||
231
+ typeof page.nextCursor !== "string" || !page.nextCursor.length) {
232
+ throw Error(`Invalid continuation at ${offset}`);
233
+ }
234
+ cursor = page.nextCursor;
235
+ }
236
+ }
237
+
238
+ const [cli, task, store, ref, digest] = process.argv.slice(2);
239
+ if (![cli, task, store, ref, digest].every(Boolean)) throw Error("Five arguments required");
240
+ const args = ["task", "context", "inspect", task, "--store", store,
241
+ "--ref", ref, "--digest", digest, "--json"];
242
+ const record = readDocument(cursor => {
243
+ const result = spawnSync(cli, [...args, ...(cursor ? ["--cursor", cursor] : [])],
244
+ { encoding: "utf8", maxBuffer: 1024 * 1024 });
245
+ if (result.error || result.status !== 0) throw Error("Detail command failed; stop without replay");
246
+ let reply;
247
+ try { reply = JSON.parse(result.stdout); }
248
+ catch { throw Error("Invalid CLI envelope"); }
249
+ if (reply.ok !== true || !reply.data) throw Error("Detail read refused");
250
+ return reply.data;
251
+ });
252
+ console.log(JSON.stringify(record));
253
+ ```
254
+
255
+ This is a detail consumer, not a list paginator or a mutation retry helper.
256
+ On a changed source or refusal, stop and reassess the original read; do not
257
+ silently restart or mix versions. Errors deliberately exclude document text:
258
+ passing a partial `contentPage.text` to `jq fromjson` can echo the entire
259
+ fragment on failure. To inspect one already-fetched page without parsing it,
260
+ use `.data.contentPage | {offset,len:(.text|length),complete,nextCursor}`.
261
+ Two pages are not a completion condition; only the returned metadata is.
262
+
97
263
  List responses carry `items`, `total`, `complete`, and `nextCursor`. Counts,
98
264
  items and cursor validation occur inside the same authorized scope. Cursors
99
265
  are opaque positions, not access tokens: every page reauthorizes. A changed
@@ -146,6 +312,16 @@ timestamps overlap; `--history` retains timestamp-window discovery.
146
312
 
147
313
  ## Runtime diagnostics
148
314
 
315
+ CLI JSON failures keep `ok`, `code`, `message` and `details`. `message` contains
316
+ the primary error, effect uncertainty, safe recovery guidance and focused help;
317
+ `details.diagnostic` retains the complete sanitized cause chain, operation,
318
+ Home, CLI entry, targets and any Controller request/delivery/timing facts.
319
+ Those identity lines and nested causes are not repeated as prose in `message`.
320
+ Consumers needing them must read `details.diagnostic`, not parse the human
321
+ message. Text-mode diagnostics remain unchanged. This is presentation only:
322
+ exit codes, redaction, partial receipts and no-replay/recovery boundaries do
323
+ not change; no probe, retry or repair is performed.
324
+
149
325
  Global failure evidence remains ordinary record-only Messages; no aggregate
150
326
  table, Message envelope change, memory store or recovery state machine is added.
151
327
  Grouping is a derived view of new evidence documents. Older documents remain
@@ -166,6 +342,42 @@ Discovery and every evidence page retain the existing Role read boundary.
166
342
 
167
343
  Message send/queue/steer receipts preserve identity, digest, body byte count and
168
344
  the original submission/delivery/control states without echoing the body.
345
+ `bodySha256` is the lowercase SHA-256 of the saved body's raw UTF-8 bytes;
346
+ `bodyBytes` counts those same bytes. Callers may compare them with the exact
347
+ submitted file to verify transport without fetching the body again. Do not trim
348
+ or JSON-encode the body before hashing. The separate `digest` covers the entire
349
+ record and is not a body checksum. These fields are derived from the saved
350
+ Message, including idempotent replay; they neither add persistent state nor
351
+ replace required original reads, authorization, ACK or downstream acceptance.
352
+ `operator submit --json` uses that same structured shape:
353
+ `data.taskId`, `data.message` (the bounded Message receipt), and `data.submission`
354
+ (the recorded save, phase, planning, activation, delivery and next-step facts).
355
+ It no longer returns only an `output` string for JSON consumers; ordinary text
356
+ output is unchanged. A same-key retry reproduces the saved submission feedback,
357
+ not a fresh interpretation of the Task's later state. The receipt is not the
358
+ original body or proof that the Leader finished.
359
+ Message `--body-file <path|->` inputs preserve their UTF-8 text, including leading
360
+ and trailing whitespace, through Operator submission and Task/Global message
361
+ send, update, queue and steer paths. Blank-only or NUL-containing input remains
362
+ invalid. Inline text and summary/note file normalization are unchanged. This fixes
363
+ the earlier file-input trim; an old request saved after trimming must be inspected,
364
+ not replayed with newly different bytes under the same request ID.
365
+ Operator's optional `scripts/verify-submission.mjs` compares a local receipt with
366
+ the payload and expected Task/intent/request ID. It performs no Yui operation,
367
+ write, cleanup or ACK; a missing checksum is a failed local check, never success.
368
+ `task decision record|supersede --json` also returns a bounded save receipt:
369
+ `data.taskId`, `effect: "saved"`, `data.decision` (identity, state, timestamps,
370
+ complete-record digest and rationale byte count). When the complete
371
+ saved record is at most 2048 UTF-8 bytes in JSON, `decision` also contains all
372
+ its fields and `contentOmitted` is false: callers can inspect the actual short
373
+ saved value directly, without a `read` follow-up pointer. Larger records set
374
+ `contentOmitted: true`, include an exact `read` command, and omit title,
375
+ rationale and supersede-reason bodies rather than truncate them. The digest
376
+ always covers the complete original record, excluding receipt-added fields;
377
+ `decision show` remains the complete read when needed. Human text is unchanged.
378
+ JSON callers must consume `data`
379
+ instead of parsing the previous `output` string. This confirms the saved state,
380
+ not semantic acceptance; a missing response never authorizes repeating a record.
169
381
  Brief updates return a saved reference. No new wait, retry, acknowledgement or
170
382
  approval phase is added. Repeating a read cursor must never repeat a mutation.
171
383
 
@@ -184,8 +396,35 @@ document does not claim a universal 32 KiB cap for them. Full-detail Web
184
396
  projections are separate consumers, not silently replaced with CLI summaries.
185
397
  Use targeted Context discovery for large Project Knowledge and Task evidence.
186
398
 
187
- For a typical notification, read current Context once, read the fixed wake once,
188
- then read each relevant original once (or its complete document pages).
399
+ For a typical notification, read current Context and the fixed wake, then obtain
400
+ only relevant originals not already returned in full (including their complete pages).
401
+ The focused wake JSON includes complete ordinary Message values up to 4 KiB
402
+ each and 8 KiB combined, marked `contentOmitted: false` with their current
403
+ versioned `ref`. Use those bodies directly. Larger messages and result reports
404
+ retain explicit reads; a completion notice never substitutes for its report.
405
+ For an inline complete value, `refreshRead` is an optional current-source refresh,
406
+ not a required next read; `read` is present only when the original is omitted.
407
+ Consumers that previously followed every `messages[].read` must first inspect
408
+ `contentOmitted` and use `value` for complete originals. Text output still links
409
+ to the original because it presents only a summary, not the inline JSON value.
410
+ The fixed window selects identities, not a historical snapshot of mutable
411
+ message bodies. Later revisions remain distinguishable by their exact reference.
412
+ History mode does not inline bodies. This changes no claim or ACK semantics.
413
+ The current Leader's `inbox show <wake>` also returns that focused view as
414
+ `originalContext`, with the existing wake metadata at the top level. It uses
415
+ the same identity selection, inline limits and exact original pointers as
416
+ `task wake show`; reuse the included complete bodies instead of making a second
417
+ read. Own-inbox authorization still applies, and the outer read retains
418
+ `contentPage` pagination. An unclaimed `pending-*` window has no fixed wake yet;
419
+ its claim receipt still supplies the durable wake and original-read command.
420
+ Claim/ACK mutations themselves are unchanged and do not perform extra reads.
421
+ For mutations addressed to an existing `wake-*`, the receipt now calls that
422
+ navigation `refreshOriginals`, not `originals`: use it when the focused originals
423
+ are missing, incomplete or need refreshing, not merely because a claim occurred.
424
+ Mutations addressed to `pending-*` retain `originals`, including idempotent claim
425
+ retries, because their initial inspection did not provide fixed originals.
426
+ This is a JSON navigation-field change; consumers must handle both entry types.
427
+ It records no read history and does not waive complete relevant-original reads.
189
428
  Do not reread an aggregate to obtain a detail it intentionally omits.
190
429
  Full-original reading costs additional calls only when the original exceeds
191
430
  the inline budget; it is never replaced by a summary.
@@ -19,7 +19,7 @@ CLI 调用成功,不代表 Task、原生 Turn 或远端投递完成。
19
19
  | 发生了什么变化? | `task context delta <task> --after <cursor>` | 固定上界内的不可变事件,不是可变当前状态的快照 |
20
20
  | Global 收到了什么? | `session context <role>` | 身份、Profile 读取指针、权限、当前 Turn/retry 事实与小窗口 pending 页;历史按需读取 |
21
21
  | 读取 Global 输入 | `role message list <role> [--pending]`、`role message show <role> <id>` | 在自身范围内发现,再读完整原文;队列接受不删除历史 |
22
- | 本次唤醒带来什么? | `task wake show <task> <wake>` | 固定窗口的输入/结果、标明来源的可选摘要和确切原文入口;`--history` 展开诊断历史 |
22
+ | 本次唤醒带来什么? | `task wake show <task> <wake>` | 固定窗口的输入/结果、有界完整普通输入和确切原文入口;`--history` 展开诊断历史 |
23
23
  | 分配了什么? | `task run context <task>/<run>` | 冻结授权与有限 `pointers` 窗口,变化身份和活跃观察附总数;`--view refs/full` 按需扩展 |
24
24
  | 实际配置是什么? | `task role session inspect <task> <role>` | Task/Role 身份、期望绑定、冻结 Session、当前 Provider 绑定、retry 与显式 Host 观察;不复制整个 Task/Role 或 Provider 会话历史 |
25
25
 
@@ -28,15 +28,42 @@ Task Message、事件、WorkItem、Run、决策、里程碑、publication 和 In
28
28
  Role 发现返回 `recordedHealth` 与 `hostObservation: "not-requested"`,不是实时 Host
29
29
  健康度。记录状态正常也不能排除 Host 失败或终态未确认;需沿条目的 `task role status`
30
30
  读取指针检查。
31
+ `task role status <task> <role>` 默认 `--view current`:保留同一计算结果的
32
+ 健康度、Host、投递/重试、清理与配置漂移观察,以 Run/WorkItem 身份和准确详情命令
33
+ 替代输入、报告及历史正文。重试诊断仍通过当前 retry 详情读取;期望配置与实际配置
34
+ 仍可见,未知证据不升级为成功。这是默认嵌套 JSON 契约变化;需要原有完整记录的
35
+ 调用者使用 `--view full`,分页续读保留该选项。底层状态投影及 Web 数据不变。
31
36
  Context 列表还暴露候选、Review、Job、Project Knowledge、工作区等获授权的记录。
32
37
  `--status`、`--after`、`--work-item` 缩小发现范围;续读必须保留过滤条件。
33
38
  Run 列表接受 Task 或 `task/work` 目标。
34
39
 
40
+ `task run show <task>/<run> --view status` 返回身份、记录状态、delivery/retry
41
+ 观察、退役与结果可用性,不复制输入、启动配置或报告正文。重试观察使用与 Task Context
42
+ 相同的当前摘要,并提供准确 Session retry 命令取回原始诊断与历史,不直接携带其正文。
43
+ 它与默认 `--view full`
44
+ 共用授权检查;完整视图仍保留全部审计证据和文档分页。
45
+ `--view result` 返回完整原始结果(包含失败与 Provider 字段)、Run 身份/状态、
46
+ 退役与执行观察,不携带提交输入和启动配置。没有结果时为 `null`,不代表成功。
47
+ 长报告仍需按同一视图续页;`reads.full` 提供完整审计入口,默认仍为 full。
48
+ 处置前须通过 Message、result 或
49
+ 完整 Run 视图读取原始结果;status 不是报告或验收。精确原文仍在当前上下文时,
50
+ 用 status 补充执行事实,避免再读一份报告;不引入读取回执或模型记忆缓存。
51
+
35
52
  当前 Context 的 `attention.messages` 排除明确 ack 或退役的 Message;投递成功不代表
36
53
  处理完成。精确 wake 回执必须覆盖最新原文版本。用 `--view current` 续读当前视图,
37
54
  默认分类列表仍保留完整历史。`collections` 计数与 `omitted` 明确表达发现不完整。抽样不能证明没有更早的待处理
38
55
  或相关输入。读取相关固定 wake 与原始 Message;更广的需求/历史审计使用分类发现。
39
56
 
57
+ 当前 Context 是工作索引,不是每轮重复的配置或需求全文。Task/Brief、Role、
58
+ Project policy、工作区、交付和决策记录即使很小,也只返回摘要与确切引用;
59
+ 生命周期、执行权限、待处理数量和活跃执行/重试观察仍直接显示。
60
+ 在依据需求或权限行动前,用 `context inspect` 读取相关原件;
61
+ `omitted: true` 不代表原件为空。每次读取仍重新计算当前身份并校验范围,
62
+ 没有增加模型记忆缓存、推断 ACK 或陈旧状态自动复用。
63
+ 当前工作区样本优先显示获授权的准确 Run 工作区投影,再显示 Task 主工作区,
64
+ 然后才是其他工作区,避免历史集成目录挤掉主工作区。显式完整家族查询保留原有
65
+ 排序、数量和记录;显示优先级不改变工作区权限,也不授予其他 Assignment 的访问权。
66
+
40
67
  ## 预算与续读
41
68
 
42
69
  - 发现页默认 20 条,可选 1–100,紧凑 JSON 预算 32 KiB,计入成功 envelope、
@@ -46,7 +73,10 @@ Run 列表接受 Task 或 `task/work` 目标。
46
73
  入口每个集合最多抽样八条。
47
74
  - Global 入口最多八条本轮/可用输入,保留效果未知项;历史缺回执单独计数,
48
75
  通过 `inbox list --view history` 显式发现,不把缺 ACK 当作未执行。
49
- pending 页用 `role message list <role> --current --cursor` 续读;不重复 recent、
76
+ pending 页用 `role message list <role> --current --cursor` 续读。
77
+ 托管自身读取另含 `currentOriginals`:本页中与精确当前 Turn 关联的完整记录,
78
+ 每项至多 4 KiB、合计 8 KiB。未来队列、历史和超限记录仍只提供发现信息与
79
+ 原有精确读取入口;检查调用不内联原文。读取不 claim、投递或 ACK。不重复 recent、
50
80
  Profile 正文、历史 Skill 包和累计 retry 详情。Profile 由 Manifest 精确指向。
51
81
  - `inbox list --view current|history|all` 优先展示精确本轮输入,与自动投递共用原始记录。
52
82
  `claim`、`ack` 接受 1–16 个精确 ID,分别返回结果。ACK 表示语义处置,
@@ -58,21 +88,62 @@ Run 列表接受 Task 或 `task/work` 目标。
58
88
  `pointerPage.nextCursor` 发现更多引用;`--view full` 显式读取完整冻结包。
59
89
  若 `input.directiveOmitted` 为 true,行动前用 `--view input` 全文读取分配指令;
60
90
  默认入口的指令摘要不是指令正文。
91
+ 新冻结的 Task 消息指针在原有 summary 中提供 `Excerpt:` 原文摘录,
92
+ 最多160 UTF-8字节,保留原 revision 和 digest。摘录只辅助选择相关原文,
93
+ 不代表完整正文或授权;后续消息修改不会改变该 Run 已冻结的摘录,
94
+ 也不重新生成既有 Snapshot。
95
+ 有指针时,`reads.expand` 直接展示已有的批量原文展开语法。用相关冻结
96
+ 指针替换占位符,并非默认读全量;既有1–8项选择上限、准确Snapshot
97
+ 校验、完整原文及分页预算不变。
61
98
  - `session skills [--cursor ...]` 只检查当前元信息和可读性,不读技能正文;
62
99
  配置元信息过大时使用相同文档分页。
63
100
  - 不超过 16 KiB 的详情保持普通 JSON。更大详情返回 `contentPage`:确切来源、
64
101
  SHA-256 digest、JSON 字符偏移、总字节数/字符数、文本、完整性与下一游标。
65
- 每块最多 4096 个 UTF-16 单元,不拆代理对,转义后的输出低于 32 KiB。
102
+ 每块长度按完整编码后的 32 KiB 响应预算调整,计入身份与游标,并为小型命令包装
103
+ 预留 256 字节。不拆代理对,偏移仍以 UTF-16 单元计,已发出的旧游标仍可续读。
66
104
  不再因 4 MiB 上限而永久无法读取合法原文。
67
105
  - Task 元信息/next-action/remote-delivery、Brief、WorkItem、Message、Run、
68
106
  决策/里程碑/事件、Role show/status/Session 检查、wake 详情、InputRequest、
69
107
  Run Context 与冻结展开使用有界详情读取。
70
108
 
109
+ 普通 Task 读取验证原调用者身份,但不按 Task 或 Assignment ID 隔离数据。Yui 是单用户本地产品,
110
+ 资源边界由本地文件权限和已认证服务传输承担,Task 归属不是租户边界。跨 Task 当前 Context
111
+ 保留调用者自己的 Task 身份,并标记 `reference-only`。搜索、记录、artifact 和原生会话证据
112
+ 不切换身份,不继承其他 Run 的指令,也不授予写入、inbox 处理、派工或外部效果权限。
113
+ 明确资源限制和 Job-owned Role 限制仍有效。原生会话读取无需 Yui 网关或 Task 映射;
114
+ 应使用实际合法可用的读取工具,并保持工作相关范围。
115
+
116
+ completed 结果仍可读。简单问答无需重开;同结果请求或明确未履行承诺需要持续诊断、
117
+ 证据交接、必要权限协调或已授权交付时,当前 Leader 可自行重开自己的未归档结果。
118
+ 诊断仍只读;重开保留历史完成证据,不解除停止、不恢复取消意图、不升级 planning
119
+ Session,也不授予外部效果权限。
120
+
71
121
  使用 `--json` 读取顶层 `data`;Run Context 和展开使用 `data.context`,Run Context delta 使用 `data.contextDelta`。
72
122
  长详情用同一读取命令加 `--cursor <contentPage.nextCursor>` 继续。按 offset 顺序拼接
73
123
  `text`,校验相同 source 与 digest,最后一次性解析 JSON。不要分别解析块,也不要把
74
124
  第一块当成完整报告。
75
125
 
126
+ 可复制的 Node.js 消费示例见
127
+ [详情读取示例](cli-information-contract.md#copyable-detail-reading-example):
128
+ 只对指定的 `task context inspect` 原文沿游标续读,验证 source/digest/连续 offset,
129
+ 直到 `complete: true` 才拼接解析一次;不是“两页读完”,也不自动重试拒绝或源变化。
130
+ 示例只读取,不代替 Agent 阅读、claim 或 ACK;大输出须保存在自有临时目录并分段读取。
131
+ 不要把半页 `text` 传给 `jq fromjson`,其错误可能回显整段长文。
132
+ 已获取页面的元数据可用
133
+ `.data.contentPage | {offset,len:(.text|length),complete,nextCursor}` 查看,不必重取正文。
134
+ 此示例按需查阅,不是每次通知的新必读内容。
135
+
136
+ 同一 Task 中已经确定的 1–8 条独立原文可一次读取:
137
+ `task context inspect <task> --refs '<发现结果中的 ref 对象 JSON 数组>'`。
138
+ 手写命令可改用重复的 `--context-ref <store/refId@digest>`,复用 dispatch
139
+ 的精确引用写法,避免 JSON 引号。两种选择格式不能混用,也不能混入单条选择参数。
140
+ 每条必须含 `store`、`refId`、`digest`;可选 `revision` 仅为发现元数据,
141
+ 不另作新鲜度校验。返回 `{taskId, items}`,每项与单条 inspect 相同。
142
+ 整批共用原有 32 KiB 预算;出现 `contentPage` 时保留相同顺序的引用并沿
143
+ `--cursor` 续读。任一引用过期、重复、不可用或越权都拒绝整批读取。
144
+ 各原文独立绑定 digest,不建立跨记录原子快照,不自动选材,不 claim/ACK,
145
+ 也不扩大权限。只需一条时继续使用原有单条入口。
146
+
76
147
  列表包含 `items`、`total`、`complete`、`nextCursor`。计数、条目和游标校验处于同一
77
148
  授权范围。游标是不透明位置,不是通行令牌:每页重新授权。集合或文档改变时明确报错,
78
149
  重新读取,不混合版本;无需持久分页 Session。可变集合不保证并发写入期间无中断遍历。
@@ -124,7 +195,23 @@ Run 增量基于精确父 Snapshot,返回完整变更 `refs` 与 `removedRefs`
124
195
  ## 效果与例外
125
196
 
126
197
  Message send/queue/steer 回执保留身份、digest、正文字节数及原有提交/投递/control
127
- 状态,不回显正文。Brief 更新返回 saved 引用。没有新增等待、重试、确认或审批阶段。
198
+ 状态,不回显正文。`operator submit --json`采用同一结构:
199
+ `data.taskId`、`data.message`(有界消息回执)、`data.submission`(保存时的
200
+ phase/planning/activation/delivery/next-step事实),不再只返回`output`字符串;
201
+ 普通文本输出不变。同key重试复现原提交反馈,不用Task后来的状态重新解释。
202
+ 回执不是原文,也不证明Leader已经完成。
203
+ `task decision record|supersede --json`返回有界保存回执:`data.taskId`、`effect: "saved"`、
204
+ `data.decision`(身份、状态、时间戳、整记录digest及rationale字节数)。
205
+ 完整保存记录的JSON不超过2048 UTF-8字节时,
206
+ `decision`同时包含该记录全部字段,`contentOmitted: false`,可直接核对
207
+ 实际短值,不再附带`read`后续读取指针;更大记录设`contentOmitted: true`,
208
+ 附带准确`read`入口,省略标题、rationale及取代原因
209
+ 正文而不截断。digest始终对应完整原始记录,不包含回执额外字段;
210
+ 需要完整读取时仍用`decision show`。人类文本不变,
211
+ JSON调用方改读`data`而非旧`output`字符串。
212
+ 这证明保存状态而非语义验收;丢失响应不授权重复record。
213
+ Brief 更新返回 saved 引用。
214
+ 没有新增等待、重试、确认或审批阶段。
128
215
  重复读游标绝不能重放变更。
129
216
 
130
217
  激活、完成、集成和输入控制仍是完整事务业务操作,即使内部有多步工程机制。
@@ -136,6 +223,21 @@ Message send/queue/steer 回执保留身份、digest、正文字节数及原有
136
223
  读取仍有自己的用途契约;不宣称它们全部受 32 KiB 限制。Web 全详情投影是独立消费者,
137
224
  不会被 CLI 摘要悄悄替代。大 Project Knowledge 与 Task 证据用定向 Context 发现。
138
225
 
139
- 典型通知读取一次当前 Context、一次固定 wake,再逐条读取相关原文(或其全部文档页)。
226
+ 典型通知读取当前 Context 和固定 wake,再补取尚未完整返回的相关原文及其全部文档页。
227
+ 聚焦 wake 的 JSON 对普通 Message 直接返回完整 `value`:每条最多 4 KiB,
228
+ 合计最多 8 KiB,标记 `contentOmitted: false` 并附当前版本的精确 `ref`。
229
+ 已有完整值可直接使用;长消息与结果报告保留读取入口,完成通知不替代报告。
230
+ 完整内联值的 `refreshRead` 仅用于按需刷新当前来源,不是必需的后续读取;
231
+ 只有原文省略时才返回 `read`。原先无条件跟随 `messages[].read` 的消费者应先检查
232
+ `contentOmitted`,完整时使用 `value`。纯文本输出只展示摘要,因此仍保留原文链接。
233
+ 当前 Leader 的 `inbox show <wake>` 在 `originalContext` 返回相同聚焦原文;
234
+ 已有完整值无需再次 `wake show`。权限、外层分页、claim/ACK 边界不变。
235
+ 对已有 `wake-*` 的变更回执,导航字段由 `originals` 改为 `refreshOriginals`:
236
+ 仅在聚焦原文缺失、不完整或需要刷新时使用,不因 claim 本身重复读取。
237
+ 对 `pending-*` 的 claim(含相同请求的幂等重试)仍返回 `originals`,
238
+ 因为初次查看尚未提供固定窗口原文。这是 JSON 导航字段变化,消费者需区分两类入口;
239
+ 不记录读取历史,也不免除完整读取相关原文的要求。
240
+ 固定窗口选择的是身份,不是可变消息正文的历史快照;后来修改由精确引用区分。
241
+ `--history` 不附带这些正文,claim 与 ACK 语义不变。
140
242
  不要为了入口故意省略的详情重复读聚合。只有原文超过内联预算才增加原文分页调用;
141
243
  摘要不能代替完整原文。