@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 +1 @@
1
- 11
1
+ 44
@@ -0,0 +1,51 @@
1
+ # Archive a Task
2
+
3
+ Read before an authorized archive or cleanup of retained archive resources.
4
+ This is not required merely to record publication or reopen a result.
5
+
6
+ ## Archive separately
7
+
8
+ Completion does not authorize archive. A delivery Leader with original user
9
+ authorization may use [ordinary archive](../../yui-leader/references/authorization.md);
10
+ this grants no force or abandonment authority. Otherwise the Operator obtains authorization for
11
+ the exact Task, checks archive eligibility, then uses `--integrated` for verified
12
+ merged delivery or `--abandon` for deliberate non-delivery. General archive
13
+ approval never implies `--force` authority. Preserve the Task record.
14
+
15
+ Ordinary archive requires settled business, exact delivery (or authorized
16
+ abandonment), and proven stopped execution. It commits logical archive before
17
+ one foreground resource cleanup. Safe physical retention—dirty diagnostics,
18
+ missing-path recovery gaps, or remaining Git registrations—is not a reason to
19
+ force archive or rewrite old Integration outcomes. Terminal failed/superseded
20
+ Integration history stays readable; an active/conflicted attempt or unknown
21
+ execution still requires settlement.
22
+
23
+ With explicit force authorization for a completed or cancelled (retired) Task, use
24
+ `yui task archive <task> (--integrated|--abandon) --force`. Force commits the
25
+ archive and stops new Task scheduling before attempting safe foreground cleanup.
26
+ Missing/stale delivery evidence, unresolved execution and cleanup errors become
27
+ warnings with retained resource references; they do not block that commit.
28
+ Authority, lifecycle, identity and mandatory audit persistence still fail closed.
29
+
30
+ Force does not verify a merge, accept work, stop unknown execution, discard dirty
31
+ data or imply abandonment. Keep the requested disposition and original
32
+ Publication/completion evidence. Unverified local commits and resources that
33
+ cannot be safely released stay owned and traceable. Late runtime events remain
34
+ source evidence, not authority to resume or settle unknown input.
35
+
36
+ Read `task show <task> --json` for `data.archive.warnings`,
37
+ `data.archive.retainedResources` and `data.archive.cleanupEvents`. These bounded
38
+ views include counts and inspection actions; read the existing paginated
39
+ `task event list` and Task context resource inventory for omitted evidence.
40
+ A successful archive
41
+ exit means `archived=true`, not that cleanup fully succeeded. `cleanupFinished`
42
+ means the foreground pass finished, not that every resource was removed.
43
+ `allResourcesReleased` separately requires release evidence and no retained
44
+ resources. Historical warnings do not disappear after a successful later pass.
45
+ If cleanup was interrupted, the Task stays archived. Repeating archive only
46
+ reports current facts. After inspecting the exact retained owner/reason, use
47
+ `task archive-cleanup <task>` for one new bounded pass, or the reported
48
+ WorkItem/Review/Integration cleanup entry. Every pass rechecks current identity,
49
+ runtime and Git registration facts; it is not an atomic batch and does not
50
+ discard unknown material. Registry-only remnants require the existing resource
51
+ inspection route, not a global `worktree prune`. No background retry is implied.
@@ -0,0 +1,41 @@
1
+ # Command discovery
2
+
3
+ Read before using help/capability discovery or diagnosing a hidden command.
4
+ The shared [yui-runtime](../SKILL.md) remains the loading and authority contract.
5
+
6
+ Use the narrowest known `yui --json help <command ...>` path through the authorized
7
+ CLI; do not rediscover its ancestors first. A leaf includes its complete usage
8
+ and options; default group help lists immediate children only. When an action
9
+ needs several commands in a known small group, use
10
+ `yui --json help <group ...> --recursive` once instead of serial child lookups.
11
+ Keep root or broad groups non-recursive for discovery; expand only the needed
12
+ group and recover any truncated output. Neither form grants execution authority.
13
+ Help, examples and shell completion
14
+ share the catalog projection; public terminals and unmanaged Agents share one
15
+ public view. This offline view is only guidance, not an authenticated permission
16
+ or a way to switch Roles. An incomplete or stale managed identity must not be
17
+ cleared to obtain public execution authority.
18
+
19
+ For Codex, the native `CODEX_THREAD_ID` takes precedence over the transport's
20
+ `YUI_NATIVE_SESSION_ID`; a newly created thread can legitimately lack the latter.
21
+ Other adapters do not borrow Codex identity for offline discovery. A missing
22
+ transport variable or hidden help entry alone does not prove Session failure.
23
+ Discovery does not establish that a Session is current: actual execution still
24
+ revalidates Session, Task/Assignment, workspace, resource and Grant boundaries.
25
+
26
+ When capability discovery appears in that view, use `capability search` for
27
+ templates and `capability describe <name> --task
28
+ <task-id> --input '<json>'` for supported exact authorization assessments.
29
+ No `access` field means no exact authorization conclusion was made: supply the
30
+ required parameters and follow the domain's existing execution checks. Hidden
31
+ operations are omitted; `requestable` includes the exact missing Grant bounds
32
+ and existing request route; `authorized` remains subject to execution-time
33
+ revalidation. Provider outages do not change this authorization observation.
34
+
35
+ Discovery never sends requests, consumes Grants, starts plugins or approves
36
+ effects. If the Task actually needs a requestable operation, use the existing
37
+ Assignment Message to Leader, Leader InputRequest, or Operator path. Preserve
38
+ the exact action, resource/plugin, digest, environment and phase. A response is
39
+ not a Grant. Existing source-authorized Leader Grant operations and Operator
40
+ Grant authority remain unchanged; never expand an authorization source or
41
+ solicit real-resource validation merely because an operation is requestable.
@@ -0,0 +1,65 @@
1
+ # Continue a completed result
2
+
3
+ Read before reopening a completed, unarchived Task for authorized same-result
4
+ follow-up or an explicitly identified unfulfilled commitment. This grants no
5
+ new authority.
6
+
7
+ ## Post-completion routing boundary
8
+
9
+ An authorized same-result follow-up or explicitly identified unfulfilled
10
+ commitment may require reopening for tracked diagnosis, evidence handoff,
11
+ necessary coordination, implementation or delivery. A simple factual query
12
+ does not. Diagnosis remains read-only unless changes are requested; reopening
13
+ does not turn discussion into implementation. The current matching Leader may call `task reopen <task>` for
14
+ its own Task and continue that request; an Operator handoff is not mandatory,
15
+ and neither Role needs the user to additionally say “reopen.” Read the original
16
+ completion, fixed heads/reports, Publication, new request and current authority
17
+ first. Inspect the reopen result and current Context before executing; delivery
18
+ still requires the current Session's delivery authority, legal workspace and an
19
+ enabled execution gate.
20
+
21
+ If the Leader already received the request, use its original durable input and
22
+ continue after reopening; do not resend it or create a self-wake. Preserve a
23
+ direct-conversation request and its boundaries in Task records when needed,
24
+ without impersonating user/Operator input. When the Operator or user is routing
25
+ new input, use the existing two operations:
26
+
27
+ ```sh
28
+ yui task reopen <task>
29
+ yui operator submit "<new request, authority, boundaries and prior evidence>" \
30
+ --task <task> --intent <discuss|develop> --request-id <id>
31
+ ```
32
+
33
+ Unaddressed `task message send` with the same intent/key options is an alternative
34
+ to the second command, not an additional send. Ordinary send/queue/submit still
35
+ refuses completed Tasks before saving new input; no intent implicitly changes
36
+ lifecycle and there is no auto-reopen option. `--to leader` instead requires an existing
37
+ WorkItem/ReviewRound Assignment.
38
+
39
+ Reopen returns the Task to active and clears its current completion fields;
40
+ original completion events, fixed commits/artifacts and Publication history stay
41
+ intact. The Leader must assess the new request and separately accept any new
42
+ result, not pretend old validation proves changed work. Reopen does not replay
43
+ historical Messages/Runs, change the Role's Agent/model/permissions, or lift an
44
+ independent execution stop. Choose `discuss` for diagnosis/explanation and
45
+ `develop` only with implementation authority. Simple queries, record-only input,
46
+ ordinary notifications, Session recovery or an opportunity for improvement do
47
+ not themselves authorize resumption. New goals need their own Task, not an
48
+ expanded old result.
49
+ Cancelled intent needs explicit
50
+ user/Operator restoration authority and cannot be restored by the Leader;
51
+ archived Tasks cannot reopen. A stopped gate still needs
52
+ the separately authorized start/cleanup path.
53
+
54
+ These are two atomic operations, not one transaction. Read the reopen result and
55
+ the submission's saved/queued receipt separately. If the second step fails,
56
+ inspect current Task/Message facts and continue only the unapplied step within
57
+ unchanged authority. Keep the same submission key on a matching retry; unknown
58
+ native or external effects are never replay permission. Do not reopen again just
59
+ to retry input after another completion, cancellation or stop. A lifecycle-only
60
+ notification may precede the new Message: the Leader waits for the actual request,
61
+ without rerunning old work or immediately completing the reopened Task.
62
+
63
+ Publication recording, diff/adopt and verification remain separately authorized
64
+ atomic operations on completed, unarchived results. They need no reopening when
65
+ no further execution is requested, and never grant authority for code changes.
@@ -67,37 +67,6 @@ timestamp. On rejection, reread current facts and reconcile only the intended
67
67
  fields; do not blindly copy an old summary under a newly read guard.
68
68
  An old Session still cannot write through this operation.
69
69
 
70
- ## Maintain a baseline and incremental history
71
-
72
- For current Task facts, retain `coreCursor` from `task context <task>`.
73
- `task context delta <task> --after <coreCursor>` returns **event history**, not
74
- a replacement current view. Retain the same `--after` on every continuation;
75
- use `--continuation` until `complete: true`, then advance to `throughCursor`.
76
- The window's upper bound is fixed. Later arrivals belong to the next read.
77
-
78
- Deduplicate by source Home + Task + event ID, and process numeric event order
79
- within that stream. `createdAt` is occurrence/recording metadata, not a global
80
- causal clock; native acceptance, delivery and acknowledgement are separate
81
- facts. Never apply a late event's old payload over a newer current record.
82
- Re-read affected current refs with their digest when making a decision.
83
- An empty delta preserves the baseline; `stateChanged` can still require a
84
- current read because not every shared fact is a Task event.
85
-
86
- Cursors from another Home/Task, incompatible or invalid continuations, missing
87
- baselines and source changes require a fresh bounded current read. Do not join
88
- pages from different windows or versions. A failed original-detail digest
89
- requires rediscovery; a content page must be reassembled only with its own
90
- source digest. None of these reads consumes input or permits replay.
91
-
92
- Frozen Run context is a different stream. Keep its exact Snapshot and
93
- Assignment. `deltaRefs` is a launch hint, not a complete patch. The explicit
94
- Run delta reports complete changed `refs` and `removedRefs` against its named
95
- parent Snapshot, with large documents paginated. Apply removals only to that
96
- frozen inventory; an empty delta is a no-op. Mutable Task facts and current
97
- inbox clarifications must be refreshed separately within read scope; they
98
- never expand the frozen Assignment or change a Review candidate.
99
-
100
- Focused wakes use exact input refs, including delayed and same-timestamp
101
- inputs. Timestamp-window discovery is under `--history` (or a historical wake
102
- without refs), not new delivery authority. Original event and Message reads
103
- remain available without rewriting or replaying them.
70
+ Before consuming Task event or frozen Run deltas, read
71
+ [Incremental context](incremental-context.md). A handoff or conflict handled
72
+ with current facts alone does not require that protocol.
@@ -0,0 +1,61 @@
1
+ # Complete context reads
2
+
3
+ Read when discovering missing context, following a wake/result pointer, or
4
+ assembling paginated original bodies. Ordinary complete originals need no
5
+ additional discovery. This is an operation manual, not a turn-entry dependency.
6
+
7
+ Read every relevant original requirement/result/authorization page before its
8
+ decision. CLI JSON is in top-level `data`, not encoded `output`. Lists expose
9
+ `items`, `total`, `complete`, `nextCursor`; summaries/first pages are not full
10
+ bodies. The 32 KiB compact-JSON budget includes nested structure/cursors, with
11
+ summaries limited to 512 UTF-8 bytes. Skill checks are metadata-only but paginate
12
+ when large. Discover only what is needed, not all history.
13
+
14
+ Long reads replace the value with `contentPage` (Run context/expand:
15
+ `data.context`; delta: `data.contextDelta`). Repeat the same read using
16
+ `--cursor <nextCursor>` until complete, concatenate `text` by offset and parse
17
+ once under the same source/digest. Restart on source change; never mix chunks
18
+ or use read cursors for mutation. Reads neither consume queues nor acknowledge
19
+ implementation or authorize replay.
20
+
21
+ - Task current Context holds bounded facts/Message refs, not event/terminal Run
22
+ history. `collections`/`attention` flag incomplete discovery: use
23
+ `task context list <task> --store <store> [--cursor <cursor>]`, then
24
+ `task context inspect <task> --store <store> --ref <refId> --digest <digest>`.
25
+ For 1–8 known independent originals in that Task, `task context inspect <task>
26
+ --context-ref <store/refId@digest> ...` returns `items` under the same total
27
+ budget. Repeat the flag for each reference; no JSON quoting is needed.
28
+ `--refs '<JSON array of exact ref objects>'` is another batch form.
29
+ Choose one form: single `--store/--ref/--digest`, repeated `--context-ref`,
30
+ or `--refs`; do not mix them. A stale/unavailable ref rejects the group.
31
+ Follow `contentPage` with the same ordered selection.
32
+ Group needed reads, not the whole directory: reuse unchanged complete bodies
33
+ still available, and fetch missing/changed originals. After loss/compaction,
34
+ reconstruct the current action's working set, not every historical source.
35
+ Task Message current view excludes explicit ACK/retirement, not uncertain
36
+ delivery; default all view is history.
37
+ - For wakes read the complete focused input/result view and relevant originals.
38
+ `task wake show <task> <wake>` preserves fixed windows/explicit older refs,
39
+ deduplicates inputs and supplies exact reads. In the focused JSON view, a
40
+ current Leader's `inbox show <wake>` exposes the same view in `originalContext`
41
+ (wake metadata stays at the top level); no second wake read is needed when
42
+ that content is already complete and current. Neither read claims the input.
43
+ In either carrier, a
44
+ message's `contentOmitted: false` and `value` provide its complete current
45
+ original with a versioned `ref`; use that body rather than fetching it again.
46
+ Long messages and result reports retain their exact read; a completion notice
47
+ is not a report. Reconcile later revisions against the fixed wake, not by
48
+ assuming its current value was the originally delivered version. Use `--history`
49
+ only for needed diagnostics/window history; complete pagination in either view.
50
+ Ordinary disposition needs no unrelated events or merely started Runs.
51
+ Event deltas are fixed-upper-bound history, not replacement current state.
52
+ - A result Message's `context inspect` carries the report, when available, in
53
+ `result.output` beside `value` (per item in a batch). The Message body may be
54
+ only a completion notice; a `Yui-Summary:` first line does not make the whole
55
+ report a summary. Finish any `contentPage` before using it.
56
+ `task message show <task/message>` and `task run show <task>/<run> --view result`
57
+ are alternative complete-report reads, not follow-up steps after obtaining
58
+ that same report. Use Run `--view full` when input/launch audit facts are needed.
59
+ Result is the original, not a summary; finish its pages. Read additional
60
+ execution facts only when needed: `task run show <task>/<run> --view status --json`
61
+ omits input/report bodies. Status/report receipt is not semantic acceptance.
@@ -0,0 +1,61 @@
1
+ # Dispatched Run context
2
+
3
+ Required for every explicitly dispatched managed Task AgentRun before planning
4
+ or acting. Follow the shared loading rules in [yui-runtime](../SKILL.md);
5
+ this procedure does not apply to direct conversation or Global Context.
6
+
7
+ 1. Read the exact AgentRun identity from the newest Bootstrap Envelope.
8
+ 2. Before acting, load its authorized pack using the current Session Manifest's
9
+ Context command and the exact Task/Run identity:
10
+
11
+ ```sh
12
+ yui task run context "<task-id>/<run-id>" --json
13
+ ```
14
+
15
+ 3. Verify that the returned Task, AgentRun, Role, purpose, Snapshot digest, workspace,
16
+ and Adapter match the Envelope and Session Manifest. Stop and report a
17
+ context-load failure if the pack is missing, stale, unauthorized, malformed,
18
+ or mismatched. Never request an inline/full-prompt fallback.
19
+ 4. Use the entry's `pointers` (including each pointer's summary) first. They are
20
+ a bounded window into the frozen readable-ref inventory. `pointerPage`
21
+ reports total/complete/nextCursor; discover further relevant refs with
22
+ `task run context <task>/<run> --view refs [--cursor <cursor>]`.
23
+ `deltaRefs` samples changed identities, with `deltaRefsTotal` reporting coverage.
24
+ Entry, `--view full` and `--view refs` are alternative discovery views, not a
25
+ sequence. Once the needed pointers are present, expand their originals directly.
26
+ A complete pointer page needs no `refs` reread; a full pack already contains
27
+ those pointers and the input, but not the referenced original bodies.
28
+ If `input.directiveOmitted` is true, read the complete assigned input with
29
+ `--view input` before acting; its entry summary is not the instruction body.
30
+ Otherwise the returned `input.directive` is complete and needs no additional
31
+ input/full read. Use full only for genuinely missing pack details, not to
32
+ certify an already complete entry or replace required original expansion.
33
+ Expand only an authorized ref when
34
+ its full value is needed, selecting it by the pointer's exact `store` and
35
+ `refId`:
36
+
37
+ ```sh
38
+ yui task run context expand "<task-id>/<run-id>" <ref-id> --store <store> --mode full --json
39
+ ```
40
+
41
+ `--store` is required, even when the ref id is unique. Select both fields
42
+ from the exact authorized pointer; never infer a store from the id.
43
+ For 1–8 known independent originals in this same Run, one expansion can use
44
+ repeated `--context-ref <store/refId>` from those frozen pointers,
45
+ instead of positional `<ref-id> --store`. It returns `items` under
46
+ `data.context`, sharing the ordinary page budget. Repeat the same ordered
47
+ selection with `--cursor` when paged; do not mix single and batch forms.
48
+ The Run already pins its Snapshot; optional `@digest` adds an exact match check.
49
+ Dispatched Runs require an explicit frozen Snapshot. A historical Run
50
+ without one is audit-only: current Task facts cannot reconstruct its
51
+ execution Context.
52
+
53
+ A pointer or summary is not the request's body. Before planning or executing,
54
+ read the relevant WorkItem/Task requirements and referenced user/Operator
55
+ messages; use the expansion command above or the Leader's current Task Context.
56
+ Reports remain evidence, not authority to enlarge the assignment.
57
+
58
+ 5. On a later wake, refresh current Task facts separately from frozen Run refs.
59
+ Use a Run delta only against its exact declared Snapshot lineage; `deltaRefs`
60
+ is a hint, not a complete patch. If no baseline is available, reload the
61
+ exact pack; do not reconstruct state from transcript memory.
@@ -0,0 +1,105 @@
1
+ # Failed execution and Provider recovery
2
+
3
+ Read when a native Turn or launch failed, before retry or a manual successor.
4
+ Apply the common boundaries in [Runtime recovery](recovery.md) first.
5
+
6
+ ## Inspect the failed execution
7
+
8
+ Read the referenced `runtime.agent-error`, exact AgentRun, Role Session and
9
+ affected WorkItem, ReviewRound or Integration. Use `task next-action` and
10
+ `execution audit` as decision support, not as an automatic plan.
11
+ Active or quiet observations are not a Task-wide lock or proof of failure.
12
+
13
+ ### Configuration and model-name failures
14
+
15
+ The already-running caller handles a failed launch: Worker/Reviewer failures
16
+ go to their Leader, and an unavailable Leader's failure goes to the existing
17
+ Operator channel. A target that did not start cannot repair itself. Read the
18
+ referenced error once; do not create a recovery Agent, a polling loop or a new
19
+ Task merely to handle it.
20
+
21
+ Use the error's capability-query pointer to inspect native metadata with the
22
+ recorded failed configuration:
23
+
24
+ ```sh
25
+ yui task event show <task> <error-event>
26
+ yui task role capabilities <task> <role> --error <error-event> --refresh
27
+ ```
28
+
29
+ The query uses the Controller's Provider environment, not your own Agent's
30
+ possibly different account variables, and requires that Controller to be running.
31
+ It preserves the requested model, workspace, profile/settings selection and
32
+ configured Agent identity. Native settings files and credentials are still read
33
+ currently, not copied into error history. A historical error without a recorded
34
+ configuration, or a changed Agent command/bindings, returns a diagnosis instead
35
+ of borrowing today's Role configuration. To inspect the desired next launch
36
+ explicitly, omit `--error`. Distinguish live enumeration, identity-matched cached
37
+ observations, declared static adapter inputs, and unavailable fields. Read field
38
+ reasons, warnings, observation/attempt times and the current query error: a live
39
+ query can contain static or unavailable fields, and a cache hit is not current
40
+ Provider confirmation. Do not treat an alias list as a complete Provider
41
+ whitelist or a static/custom choice as proven native support.
42
+
43
+ Reconcile the original user requirement with exact native IDs and alias
44
+ mappings. Correcting the name of the same authorized model is routine recovery;
45
+ selecting another model, account, permission or cost boundary is not. If there
46
+ is no proven equivalent, preserve the failure and report the missing choice.
47
+ Do not guess names, select a similarly named variant, or silently fall back.
48
+
49
+ After correcting only the intended configuration, choose the existing operation
50
+ that matches current facts. A rejected notification retains its input:
51
+
52
+ ```sh
53
+ yui task wake show <task> <wake>
54
+ yui task wake retry <task> <wake> --reason "<correction and evidence>"
55
+ ```
56
+
57
+ Retry does not replace a Session or change its immutable effective configuration.
58
+ If an existing Session must adopt changed settings, read
59
+ [Session replacement](session-replacement.md) before that operation; an assigned
60
+ Run uses its own legal retry operation.
61
+ Accepted or uncertain input cannot be replayed through notification retry.
62
+ Configuration failure is not transient infrastructure recovery, and unchanged
63
+ configuration does not justify another attempt.
64
+
65
+ ### Bounded infrastructure retry
66
+
67
+ The Controller, not the Agent, counts and schedules qualifying transient
68
+ Provider retries: at most five automatic executions after the initial failure,
69
+ within one ten-minute recovery window. Native acceptance, activity and partial
70
+ output do not reset that count. Only proven native success resets the chain;
71
+ it neither accepts a WorkItem nor completes a Task. Unknown delivery remains
72
+ fenced for exact readback; it is never replayed.
73
+
74
+ Inspect the current `providerRetry`/`retry` projection in Context, or use
75
+ `task role session retry <task> <role> show`; Global Sessions use
76
+ `session retry <role> show`. While `waiting` or `in-flight`, do not dispatch a
77
+ duplicate or add a private retry loop/resend. After recovery inspect prior work
78
+ and external receipts before continuing; recovery instructions grant no new
79
+ authority. A readable failed Run remains immutable evidence while its recovery
80
+ successor handles the same responsibility and frozen Review boundary.
81
+
82
+ `cancel` withdraws pending automatic recovery; `disable` additionally disables
83
+ future automatic chains on that Provider binding. Neither stops an admitted
84
+ native Turn. `enable` permits future failures to qualify, without replaying
85
+ old failures. These controls require the existing user/supervisor authority.
86
+
87
+ `exhausted`, `cancelled` and `needs-attention` preserve the error, input and
88
+ work. Read their exact reason, then choose an authorized next action. Unsupported
89
+ Hosts/Adapters or unprovable Session/background state do not trigger automatic
90
+ replacement, cleanup, model switching or a new grant.
91
+
92
+ A failed AgentRun is immutable; retry creates a new attempt. Reuse a recoverable
93
+ Session when useful and load the new attempt's current context, not an old
94
+ Assignment from memory. A new Host process need not mean a new native Session.
95
+ Preserve frozen Review candidates and selected synthesis sources on retry.
96
+ An infrastructure failure is not a defect in the business result.
97
+
98
+ Native internal retries are not failed terminals: observe without submitting
99
+ another input. A missing automatic retry record is not evidence of exhausted
100
+ budget or a damaged Session. An explicit `task run retry <task>/<run>` can
101
+ continue from the current exact failed Turn even without an earlier automatic
102
+ chain. Codex `systemError` alone does not require replacement; the normal
103
+ submission path checks that the latest Turn is that failed Turn and background
104
+ execution is empty. Missing or changed proof is a refusal, not permission to
105
+ replay, change models or silently replace the Session.
@@ -0,0 +1,18 @@
1
+ # Global input discovery
2
+
3
+ Read when the Global Context pending page needs expansion or delivery diagnostics
4
+ are relevant; receiving one exact original uses Runtime’s inbox contract directly.
5
+
6
+ Global Context `pending` is bounded current/available-input discovery, not
7
+ receipt debt or retry history; the Manifest's profile remains canonical.
8
+ Its separate `currentOriginals` contains complete small Messages correlated to
9
+ this managed Turn. Reuse the matching original; absence means use its exact read,
10
+ not no input. It neither claims nor handles the Message, and future queued or
11
+ historical bodies are not included. Read missing originals with `role message show <role> <message-id>
12
+ --json`; continue incomplete pending pages with `role message list <role>
13
+ --current --cursor <nextCursor>`. Accepted delivery retains its all-list record.
14
+ `historyCount` is missing handling evidence, not new work.
15
+
16
+ For classified delivery diagnostics, read the diagnostics section of
17
+ [Global input controls](global-input-controls.md) in its full file. That does
18
+ not authorize sending or controlling input.
@@ -0,0 +1,44 @@
1
+ # Global input controls
2
+
3
+ Read before sending, steering or interrupting GlobalRole input, enabling
4
+ controlled Global delivery, or inspecting classified delivery diagnostics.
5
+ This is not required just to receive an input;
6
+ use [yui-runtime](../SKILL.md)'s own-inbox flow for that.
7
+
8
+ A GlobalRole's durable input uses the same three actions as a Task Role,
9
+ addressed by the Role's own name instead of a Task. The local-user Web surface
10
+ exposes this contract. Use `yui role message queue|steer <role> <text>` or
11
+ `yui role interrupt <role>` through the public CLI. Queue/steer require a stable
12
+ `--request-id`; steer/interrupt require the exact `--expected-target`.
13
+ Configuration remains under `config role` and lifecycle under `session`.
14
+ Do not fabricate Task/Run ownership or borrow the browser's user authority to
15
+ bypass a managed Session boundary.
16
+
17
+ Queue and steer
18
+ save an owned Message; bare interrupt records a control request, not a new
19
+ Message. Each uses a stable request id and that Role's own Session; none fabricates a Task or
20
+ runId to reuse Task-scoped delivery. `queue` delivers at the Role's next legal
21
+ opportunity and is idempotent by request id. `steer` and `interrupt` affect only
22
+ the exact current native Turn — a stale `--expected-target`, an incapable plan,
23
+ or an unproven delivery leaves the Message saved and reports the reason, and
24
+ `interrupt` stops only through the Provider's native cancel with an optional
25
+ `--then-message` naming one already-saved GlobalRole Message. When the Role holds
26
+ no live managed Turn, a steer or interrupt is `NO_ACTIVE_TURN` and never falls
27
+ back to another action.
28
+
29
+ New controlled Global Sessions use the existing Host console, not the native
30
+ TUI, with the configured Agent, permissions and workspace unchanged. A live
31
+ unmanaged Session is not silently replaced or adopted; use an explicit Session
32
+ lifecycle action before enabling controlled delivery.
33
+
34
+ Only an exact terminal and the original Session/writer boundary release a then
35
+ handoff. Never resubmit accepted/unconfirmed steer through changed request IDs
36
+ or composed then; only conclusive rejection permits an explicit new attempt.
37
+
38
+ ## Inspect delivery diagnostics
39
+
40
+ `role message list <role> --diagnostics` reports classified original failures
41
+ with first/latest occurrence, distinct-observation count and recovery evidence,
42
+ not repeated polls of one observation. `--diagnostic <key>` pages originals.
43
+ Recovery notices neither ACK input nor prove effects undone;
44
+ `interrupt-requested` proves neither Turn nor background stop.
@@ -0,0 +1,30 @@
1
+ # Host custody, protocol and upgrades
2
+
3
+ Read for Host protocol/custody or persistence failures, or when diagnosing or
4
+ changing Host custody during an upgrade. An ordinary Controller outage alone
5
+ does not require it. Apply [Runtime recovery](recovery.md) first.
6
+
7
+ Compatible upgrades preserve logical Sessions. Build generations and historical
8
+ Skill packages are provenance, not continuation gates. Load current stable
9
+ Skills and current authority; never change a user's model, account, native
10
+ permissions or workspace to make an upgrade work.
11
+
12
+ Within Host control/event v1, status advertises `controlCapabilities` and the
13
+ loaded `hostImplementation`, independently of `endpointImplementation`. Missing
14
+ capabilities or `eventDelivery` are unreported, not healthy. A Controller must
15
+ not repeatedly send an unsupported `reconcile-turn`; the existing raw Inbox
16
+ still permits exact event consumption without executing the input again.
17
+ Current Hosts retain unpersisted original facts during a filesystem failure;
18
+ keep that process alive until persistence recovers. Those volatile bytes cannot
19
+ be recovered after process loss merely by restarting the Controller.
20
+
21
+ Program/storage upgrade success does not mean Host replacement succeeded.
22
+ Compatible live Hosts may continue, including busy ones. A new Host may resume
23
+ the same native Session only through the existing authorized lifecycle after
24
+ exact execution, background resources and writer release are proven. An idle
25
+ status, a stopped proxy or a missing control field is insufficient. Unknown
26
+ effects preserve the original Session, input and resources; do not force-kill,
27
+ replay, hot-replace loaded modules or silently create a new Session. Existing
28
+ explicit stop/replacement authority is separate from an ordinary upgrade.
29
+ Unsupported protocols require an explicit bounded recovery plan, not arbitrary
30
+ historical Host adoption. Storage migration remains independently fenced.
@@ -0,0 +1,77 @@
1
+ # Inbox recovery and retained handling
2
+
3
+ At an exact native terminal, engineering checks for unacknowledged inputs
4
+ correlated to that turn and emits at most one existing notification. This is
5
+ missing-evidence detection, never semantic ACK or proof of absent effects.
6
+ Reminder-only turns do not generate another reminder. The retained originals
7
+ remain inspectable if the bounded reminder is also missed; do not start a
8
+ private polling/retry loop or copy the business input to obtain another turn.
9
+ Task Assignment checks go to Leader for inspection and existing handoff or
10
+ retirement, not automatic Worker/Reviewer replay. Exact terminal can end an
11
+ active-consumption notification reservation without acknowledging its input;
12
+ it does not infer or release an uncertain native writer.
13
+
14
+ For obsolete Global input that was conclusively not submitted, use
15
+ `yui inbox retire <entry> --request-id <stable-id> --reason "<disposition>"`
16
+ after inspecting the original and current facts. Retirement preserves the
17
+ original target, claim and explicit management evidence; it is not ACK.
18
+ Accepted input uses normal claim/ack reconciliation. Unknown/pending control,
19
+ transport acceptance and interrupt-then ownership cannot be retired through
20
+ this operation. Task Messages retain the existing Leader `task message retire`
21
+ and exact-Assignment handoff paths.
22
+
23
+ Apply Runtime's claim/ACK contract: interrupted claims remain discoverable,
24
+ non-expiring and unreplayed. A rightful successor must inspect the original
25
+ input and prior effects before completing authorized handling and acknowledging;
26
+ never replay uncertain external actions.
27
+ After legal Session replacement, initialization can arrive before old handling
28
+ is settled. This recovery notification is not the original business input or
29
+ an acknowledgement. Read the current inbox and prior effects first. For
30
+ `claimed-by-previous-session`, retain the original claim: do not claim again.
31
+ Finish only the still-authorized handling and use a new stable ack request ID
32
+ with a concrete disposition; the receipt retains both the old claimant and
33
+ the current acknowledging actor. New queued input remains separate.
34
+ For an exact-Session input already claimed by its selected Session, a rightful
35
+ successor may explicitly settle that handling after inspecting the original
36
+ and prior effects. This preserves the original target and claim; it grants no
37
+ permission to submit or execute the input in a different Session.
38
+ An Assignment change does not inherit handling authority. If the original Run
39
+ stopped before acknowledgement, ask the Leader to inspect its exact native
40
+ terminal and use the existing `task message handoff` to the current authorized
41
+ Assignment. The original claim remains; handoff never resubmits it automatically.
42
+ If that Assignment is obsolete, the Leader may inspect the original and prior
43
+ effects, then explicitly use `task message retire <task/message> --reason "<disposition>"`.
44
+ Retirement preserves the original claim and records the management decision;
45
+ it neither fabricates an acknowledgement nor proves native execution stopped.
46
+ An unfinished claim fences its Assignment, not unrelated work of the same Role.
47
+
48
+ In-flight, unknown, not-yet-delivered explicit interrupt-then and
49
+ unsettled steer inputs retain their existing owner/receipt and report a bounded
50
+ reason instead of being taken over. Use existing exact-receipt recovery when
51
+ needed; do not change request IDs, clear identity, or copy input to bypass it.
52
+ A steer with no control receipt was not submitted; it may be explicitly handled
53
+ and acknowledged in its authorized inbox, without converting it into a queue.
54
+ Accepted Global inputs, delivered Leader windows and current Assignment
55
+ continuations remain in the inbox until explicitly handled through the normal
56
+ claim/originals/prior-effects/ACK flow above, never another native delivery.
57
+ Claiming never resends input. A current rightful successor may settle accepted
58
+ Global input or a Leader window only after inspecting prior effects, retaining
59
+ the original delivery target. Pending/unknown acceptance remains blocked;
60
+ claiming cannot bypass it or authorize replay.
61
+ An explicitly released Leader notification (`notification.resolved` with
62
+ `released-without-replay`) can be claimed for evidence inspection and settlement
63
+ after verified native stop. Its original delivery status stays unknown or
64
+ unaccepted; handling it cannot retarget Session-specific instructions or
65
+ authorize re-executing unknown effects. If a required fact or user decision is
66
+ unavailable, preserve the claim and report that exact boundary.
67
+
68
+ An ack belongs to the exact original and revision: fixed windows pin
69
+ `message.updated` event identities, including same-timestamp edits. A later
70
+ revision still needs its own handling. Before Task completion, settle handled
71
+ user-input windows; native acceptance or a terminal does not settle them.
72
+ Original Messages, wake windows and handling receipts remain readable after
73
+ acknowledgement. Lost context, Session continuation and installation upgrades
74
+ do not reset receipts. If ack fails after an external effect, read back the
75
+ original claim and the external receipt before retrying the same ack; do not
76
+ repeat the effect. This is durable handling evidence, not arbitrary external
77
+ exactly-once execution.