@zq-silk/yui 0.15.9 → 0.15.11

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 (100) hide show
  1. package/dist/agent/launchEnvironment.js +7 -0
  2. package/dist/cli/commandCatalog.js +26 -6
  3. package/dist/cli/interactionPolicy.js +3 -3
  4. package/dist/cli/updateOrchestrator.js +24 -1
  5. package/dist/cli/updatePorts.js +7 -3
  6. package/dist/cli/upgradeCommand.js +42 -2
  7. package/dist/cli.js +336 -93
  8. package/dist/commands/globalRoleCommands.js +314 -4
  9. package/dist/commands/projectCommands.js +6 -7
  10. package/dist/commands/releaseCommands.js +18 -0
  11. package/dist/commands/taskActor.js +25 -0
  12. package/dist/commands/taskCommands.js +511 -83
  13. package/dist/commands/taskIntegrationCommands.js +16 -38
  14. package/dist/commands/taskIntegrationQueueCommands.js +1 -1
  15. package/dist/commands/taskRemoteDeliveryCommand.js +6 -6
  16. package/dist/commands/taskRoleRuntimeStatus.js +35 -0
  17. package/dist/context/taskContext.js +38 -2
  18. package/dist/controller/agentHostObservation.js +155 -0
  19. package/dist/controller/clientRuntime.js +17 -2
  20. package/dist/controller/controller.js +3 -0
  21. package/dist/controller/fileSchedulerStoreAdapter.js +446 -13
  22. package/dist/controller/globalInputDelivery.js +119 -0
  23. package/dist/controller/jobControl.js +6 -2
  24. package/dist/controller/resourceInventory.js +14 -4
  25. package/dist/controller/resourceInventoryLinux.js +2 -6
  26. package/dist/controller/runtime.js +81 -6
  27. package/dist/controller/runtimeEventInbox.js +32 -3
  28. package/dist/controller/runtimeEventProcessor.js +26 -6
  29. package/dist/controller/runtimeHookRunFence.js +75 -19
  30. package/dist/controller/structuredProviderObservation.js +133 -70
  31. package/dist/coordination/workMailboxQueue.js +5 -0
  32. package/dist/execution/workItemExecutionProjection.js +1 -1
  33. package/dist/executor/agentExecutor.js +64 -4
  34. package/dist/executor/executorRegistry.js +3 -0
  35. package/dist/executor/fileRoleLaunchPlanner.js +78 -118
  36. package/dist/integration/deliveryObligation.js +2 -1
  37. package/dist/integration/gitIntegrationService.js +312 -382
  38. package/dist/integration/integrationAttempt.js +30 -4
  39. package/dist/integration/integrationQueueService.js +7 -7
  40. package/dist/integration/integrationSourceApplication.js +323 -0
  41. package/dist/message/globalInterrupt.js +33 -0
  42. package/dist/message/inputControlResolution.js +106 -0
  43. package/dist/message/message.js +367 -0
  44. package/dist/message/messageContinuation.js +126 -3
  45. package/dist/message/taskInterrupt.js +34 -0
  46. package/dist/observability/orchestrationMetrics.js +1 -1
  47. package/dist/release/releaseHandover.js +22 -0
  48. package/dist/release/releaseWorkflowPorts.js +15 -7
  49. package/dist/repository/gitWorkspace.js +72 -15
  50. package/dist/repository/taskWorkspaceCoordinator.js +134 -0
  51. package/dist/repository/taskWorkspacePreparer.js +120 -49
  52. package/dist/repository/workItemCandidateSnapshot.js +34 -0
  53. package/dist/resources/resourceDiscovery.js +3 -2
  54. package/dist/runtime/agentHost.js +152 -72
  55. package/dist/runtime/agentHostCompatibility.js +127 -0
  56. package/dist/runtime/agentHostProtocol.js +53 -0
  57. package/dist/runtime/executionEnvironment.js +0 -19
  58. package/dist/runtime/launchBroker.js +6 -0
  59. package/dist/runtime/sessionReconciliation.js +4 -4
  60. package/dist/runtime/taskRuntimeIsolation.js +30 -6
  61. package/dist/runtime/tmuxAdapters.js +5 -3
  62. package/dist/scheduler/operatorEvent.js +4 -0
  63. package/dist/scheduler/taskExecutionProjection.js +12 -1
  64. package/dist/scheduler/wakeReason.js +7 -1
  65. package/dist/scheduler/wakeupQueue.js +2 -0
  66. package/dist/setup/setupCommand.js +26 -8
  67. package/dist/storage/homeLayout.js +130 -0
  68. package/dist/storage/migrations/collapseWorktreeLayout.js +963 -0
  69. package/dist/storage/migrations/integrationContinuation.js +104 -0
  70. package/dist/storage/migrations/unifyHomeLayout.js +925 -0
  71. package/dist/storage/sqliteSchema.js +136 -4
  72. package/dist/storage/sqliteStore.js +40 -1
  73. package/dist/storage/storageVersions.js +1 -1
  74. package/dist/storage/storeRpc.js +1 -0
  75. package/dist/storage/upgrade/upgradeOrchestrator.js +95 -2
  76. package/dist/task/archiveDiagnostics.js +128 -0
  77. package/dist/task/nextAction.js +44 -11
  78. package/dist/web/assets/client/app.js +55 -0
  79. package/dist/web/assets/client/components.js +1 -0
  80. package/dist/web/assets/client/i18n.js +6 -0
  81. package/dist/web/assets/client/taskSurface.js +106 -0
  82. package/dist/web/assets/client/view.js +7 -4
  83. package/dist/web/assets/shell.js +23 -0
  84. package/dist/web/assets/styles/layout.js +1 -1
  85. package/dist/web/assets/styles/widgets.js +12 -0
  86. package/dist/web/webServer.js +117 -1
  87. package/dist/web/webSnapshot.js +4 -3
  88. package/dist/web/webTaskSurface.js +222 -5
  89. package/dist/workspace/workItemChangeSetManager.js +18 -2
  90. package/docs/release-workflow.md +39 -0
  91. package/docs/release-workflow.zh-CN.md +29 -0
  92. package/docs/sqlite-control-plane-design.md +223 -1
  93. package/docs/testing/verification-levels.md +24 -0
  94. package/docs/testing/verification-levels.zh-CN.md +11 -0
  95. package/package.json +1 -1
  96. package/skills/yui-leader/references/execution.md +151 -49
  97. package/skills/yui-leader/references/integration.md +52 -2
  98. package/skills/yui-operator/SKILL.md +6 -1
  99. package/skills/yui-runtime/SKILL.md +27 -0
  100. package/skills/yui-runtime/references/publication.md +20 -0
@@ -53,12 +53,36 @@ regressions, and fast regressions do not establish real-model behavior.
53
53
  authentication helpers, rewritten approval records, or secrets forwarded
54
54
  to unrelated adapters; native authentication selection stays with Claude. Environment refresh
55
55
  removes revoked keys and keeps values out of durable Task/Role records.
56
+ 15. ordinary Integration conflicts continue without a decision gate; exact Git
57
+ receipts and an admitted Job resume interrupted delivery without replay.
58
+ Validation settlement distinguishes current check conditions from an
59
+ already-applied CAS. Migration preserves provable old bound FF Jobs and
60
+ classifies old conflicts without inventing successful checks.
61
+ 16. explicit force archive commits before cleanup and preserves uncertain
62
+ delivery/runtime evidence; partial cleanup and late results remain traceable,
63
+ while archived runtime resources never become automatically safe to delete.
64
+ 17. Host facts reach the existing Inbox even when its compiled store cannot
65
+ read the Home; Controller-side fencing, ACK-loss replay, and legacy-Host
66
+ upgrade refusal preserve the original execution. A frozen independent v1
67
+ protocol producer remains the same process across a real 19→22 migration,
68
+ authenticates RPCs to both Controllers through refreshed discovery, and
69
+ retains facts during the disconnected window. Production launch planning
70
+ also preserves scoped startup evidence before native Session adoption
71
+ without exporting a Run ID into the Session environment.
72
+ This fixture is the minimum supported new wire contract, not a claim that
73
+ pre-fix released Hosts can be hot-patched.
74
+ Archive racing Host ingress retains the complete source envelope without
75
+ reopening the Task or settling original uncertain input.
56
76
 
57
77
  Keep the test phase seconds-scale; measure TypeScript build separately. Record
58
78
  incremental runtime when adding a critical regression. The seven recovery boundary
59
79
  cases initially add about 0.4 seconds of test bodies (about 0.6 seconds standalone,
60
80
  including module startup) on the development host. Avoid sleep-based checks or
61
81
  mandatory model/daemon launches in the permanent suite.
82
+ The Integration continuation regressions use disposable Git repositories,
83
+ SQLite and fake Jobs, without a provider or shared Home. Their test bodies
84
+ take about 3 seconds on the development host; validation settlement adds
85
+ about 1.4 seconds to the initial 1.5-second coverage.
62
86
 
63
87
  ## Skill and instruction changes
64
88
 
@@ -43,6 +43,17 @@ Yui 是一个单用户本地产品。永久验证保护关键的 happy path 和
43
43
  14. Claude 收到其原生环境和 settings 路径,而没有被注入的认证 helper、被改写的批准
44
44
  记录,也没有把 secret 转发给无关适配器;原生认证选择仍归 Claude。环境刷新移除
45
45
  已撤销的 key,并把值挡在持久 Task/Role 记录之外。
46
+ 15. 普通 Integration 冲突可直接继续;准确 Git 与 Job 证据恢复中断交付,
47
+ 不重放已执行的步骤,也不把已发生的 CAS 与新的验证条件混为一谈。
48
+ 16. 明确授权的 force archive 先提交归档,再独立记录清理;不确定输入与晚到
49
+ 结果仍可追溯,归档不使保留资源自动变得可删除。
50
+ 17. 即使 Host 编译版本的存储代码无法读取 Home,事实仍先进入现有 Inbox;
51
+ Controller 侧归属校验、ACK 丢失重放和 legacy Host 升级拒绝保护原始执行。
52
+ 独立冻结的 v1 协议生产者在真实 19→22 迁移前后保持同一进程,通过新 discovery
53
+ 分别向两个 Controller 发出认证 RPC,并在断线窗口保留事实。生产 launch 路径
54
+ 在不向 Session 环境导出 Run ID 的前提下保留 scoped 启动证据。该 fixture 代表最低
55
+ 支持的新线协议,不声称已发布的修复前 Host 可以原地热更新。
56
+ 归档与 Host 消费交错时保留完整来源 envelope,不重新打开 Task 或结算原不确定输入。
46
57
 
47
58
  把测试阶段保持在秒级;单独度量 TypeScript 构建。新增一个关键回归时记录其增量运行
48
59
  时长。这七个恢复边界用例在开发主机上最初约增加 0.4 秒的测试体(独立运行约 0.6 秒,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.15.9",
3
+ "version": "0.15.11",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -22,29 +22,56 @@ implementation patterns, scheduling options, review routing, or recoverable
22
22
  runtime actions. Create an InputRequest only for a real product choice, new
23
23
  authority, irreversible external effect, or unavailable external fact.
24
24
 
25
- ## Choose execution topology from ownership
26
-
27
- A WorkItem is one substantial requirement with an independent owner and useful
28
- acceptance boundary. It is not a container for every phase, file, test,
29
- finding, repair, or progress update. Task type, risk labels, file count, and
30
- subsystem names do not determine topology.
31
-
32
- Choose the smallest useful executor:
33
-
34
- 1. **Leader directly** when current context, authority, and tools are enough.
35
- 2. **Native subagent** for bounded specialist attention or parallel
36
- investigation inside the current Agent Session when a best-effort child
37
- result is sufficient.
38
- 3. **Task Role AgentRun** when work needs independent durable ownership, a distinct
39
- Agent/provider or credential set, a managed workspace, or a separately
40
- recoverable Session and AgentRun lifecycle.
41
-
42
- Create multiple WorkItems only when their requirements can make useful
43
- independent progress, normally in parallel, and the coordination and
44
- Integration cost is lower than keeping one coherent owner. Keep coupled
45
- changes together.
46
-
47
- An ordinary WorkItem uses its assignee directly; dispatch without `--lane-role`.
25
+ ## Separate the work unit, executor, and concurrency
26
+
27
+ Honor the user's explicit choice of direct work or delegation. Otherwise make
28
+ three independent judgments; Review is a fourth judgment below.
29
+
30
+ **Does this result need its own management and acceptance boundary?** A WorkItem
31
+ is a substantial result worth managing and accepting separately inside the Task.
32
+ It need not have a different person, an independent release, or parallel execution.
33
+ Use zero WorkItems when the Task already holds one coherent outcome. One WorkItem
34
+ can be Leader-owned or hold a justified whole-result managed Assignment and
35
+ Candidate. Copying the Task unchanged or displaying progress is not a reason
36
+ to create it. Do not split analysis, editing, testing, Review, and ordinary
37
+ repairs into phase-shaped WorkItems.
38
+
39
+ **Who should execute?** Direct Leader execution is the default viable path for
40
+ one coupled result when current context, delivery authority, and tools suffice.
41
+ A native child can supply bounded specialist attention or parallel investigation
42
+ inside this Session when a best-effort result suffices; it creates no Yui identity,
43
+ authority, or WorkItem by itself.
44
+
45
+ Choose a managed Worker only for a concrete benefit that repays requirement
46
+ restatement, context reload, startup, waiting, inspection/rework, Integration,
47
+ and lifecycle management. Benefits include safely parallel independent results,
48
+ a needed capability or execution environment, a genuinely necessary separately
49
+ recoverable lifecycle, freeing the Leader for another actual responsibility,
50
+ or explicit user delegation. An available Worker, cheaper/different model,
51
+ many files, high risk, long duration, or generic maintainability alone is not
52
+ enough. Risk can justify independent Review without delegating implementation.
53
+ When delegation involves a material tradeoff, leave one sentence of concrete
54
+ benefit in the existing Brief; no form, approval, or separate decision record
55
+ is needed.
56
+
57
+ **Should separate units run concurrently?** Multiple WorkItems may run serially
58
+ because of a real dependency, or concurrently when their results can advance
59
+ independently and the net benefit exceeds coordination and Integration cost.
60
+ Neither a single WorkItem nor multiple executors proves parallelism. Keep
61
+ coupled changes together.
62
+
63
+ For example, fix one coupled behavior directly in Task main, even when it touches
64
+ many files. Delegate an independent import tool while the Leader implements its
65
+ consumer when the two have a stable boundary and useful parallel progress.
66
+ Keep two separately accepted stages serial when the second genuinely needs the
67
+ first result. Do not wrap a whole Task in an `implementer` WorkItem merely because
68
+ that Role exists.
69
+
70
+ Apply these choices to new work. Do not automatically cancel an existing Worker,
71
+ reassign/retire WorkItems, or move workspaces to conform to a new default; preserve
72
+ their current ownership and evidence until a justified explicit change.
73
+
74
+ An ordinary managed dispatch uses the WorkItem assignee; omit `--lane-role`.
48
75
  Use [replicated execution](replicated-execution.md) only when
49
76
  independent attempts over the same frozen Assignment repay their coordination
50
77
  cost. Direct managed execution already provides durable ownership.
@@ -79,8 +106,9 @@ messages and Task Brief. Neither `next-action` nor a disabled default review
79
106
  policy authorizes dropping them to make completion easier.
80
107
 
81
108
  An Integration Job's success is not the final target update. For that
82
- notification, read [Integration](integration.md) and finish the same
83
- attempt; do not start a duplicate operation.
109
+ notification, read [Integration](integration.md) and continue from its exact
110
+ evidence; do not start a duplicate operation. Read that guidance also for an
111
+ ordinary Git conflict or an attempt that cannot be reliably resumed.
84
112
 
85
113
  Before dispatch, Review, Integration, or completion, inspect
86
114
  `liveTaskState.activeRuns` and `liveTaskState.activeTaskReviews` in the current
@@ -90,7 +118,36 @@ global Task lock.
90
118
 
91
119
  ## Execute the chosen path
92
120
 
93
- Dispatch establishes the first owner and frozen Assignment. For ordinary
121
+ ### Choose input timing without changing intent
122
+
123
+ Submission intent (`record`, `discuss`, `develop`) and delivery timing are
124
+ different facts. Input controls do not activate a Task, expand an Assignment,
125
+ or elevate a planning Session. Keep the submission contract when using `send`;
126
+ choose queue, steer or interrupt from the user's intent and current facts:
127
+
128
+ ```sh
129
+ yui task message queue <task> "<continuation>" --request-id <id> --to <role> --work-item <work-id>
130
+ yui task message steer <task> "<current-turn correction>" --request-id <id> --to leader --expected-target <turn>
131
+ yui task role interrupt <task> <role> --expected-target <turn> [--then-message <task/message>] [--request-id <id>]
132
+ ```
133
+
134
+ Queue waits for the next legal opportunity. Steer addresses only the exact
135
+ current native Turn; Worker/Reviewer steer also needs its existing WorkItem or
136
+ ReviewRound. Bare interrupt stores a control request, not a new Message.
137
+ `interrupt-requested` is not a terminal or proof that background resources
138
+ stopped. Then names an already-saved input and reserves its next opportunity
139
+ only within the original Session/writer boundary.
140
+
141
+ Read `task role session inspect` first. Unsupported and proven-unsubmitted
142
+ steer may be composed with interrupt when the user's intent permits stopping;
143
+ accepted, pending or unknown steer must not be resent through another action
144
+ or request id. Never silently cancel, replace a Session or downgrade to queue.
145
+
146
+ Global inputs use `role message queue|steer <role>` and `role interrupt <role>`
147
+ with their own owner, not a fabricated Task/Run. See
148
+ [Runtime](../../yui-runtime/SKILL.md) for scope and controlled-console boundaries.
149
+
150
+ Managed dispatch freezes the Assignment for its assignee. For ordinary
94
151
  clarification, feedback or a continuation of that same work, send a Message:
95
152
 
96
153
  ```sh
@@ -112,37 +169,72 @@ For unknown delivery or Session replacement, read
112
169
  [runtime recovery](../../yui-runtime/references/recovery.md). Preserve the original
113
170
  input; do not replay uncertainty or treat it as a global Task lock.
114
171
 
115
- For direct work, change only Task main, keep it on its managed branch, commit
116
- the result, and leave it clean. Run the smallest check that can catch the
117
- changed behavior while implementing.
172
+ ### Direct delivery with zero WorkItems
118
173
 
119
- For a substantial delegated requirement:
174
+ The current delivery Leader needs no self-dispatched AgentRun or placeholder
175
+ WorkItem. Read the full Task requirements and relevant Messages, then implement,
176
+ verify, and fix the coherent result in Task main on its managed branch. Commit
177
+ and leave it clean. Run focused checks while changing behavior and the required
178
+ Project delivery checks on the final result.
120
179
 
121
- ```sh
122
- yui task work create <task-id> "<title>" \
123
- --project <project-to-modify> \
124
- --objective "<bounded outcome>" \
125
- --accept "<observable criterion>"
126
- ```
180
+ Keep the Brief as a current summary, not a replacement for Task requirements.
181
+ Preserve changed intent and reasons in Messages/Decisions, substantial documents
182
+ in Task artifacts, and code and verification evidence in the actual delivery.
183
+ Zero WorkItems reduces coordination records, not requirements or evidence.
127
184
 
128
- Add `--after` only for a real dependency. Likely file overlap is not by itself
129
- a dependency. A Worker may read the complete authorized Task context but may
130
- write only its WorkItem Projects and workspace.
185
+ Inspect the complete final diff and decide Review separately. If a Task-final
186
+ Review is required or adds useful evidence, request it against the clean Task
187
+ heads using `yui task review request <task> --role <reviewer>`. No WorkItem is
188
+ needed. Consume the original result, fix reachable findings directly in Task
189
+ main, and decide whether the changed result needs another Review. Honor immutable
190
+ Review contracts and explicit user/Project requirements even if a default is
191
+ disabled. Once the outcome and obligations are satisfied, use `task complete`
192
+ with the outcome, checks, and remaining risk; a final chat message is not completion.
193
+
194
+ ### Leader-owned WorkItem
131
195
 
132
- For a Leader-owned WorkItem, mark it running, complete it directly, then record
133
- its actual result:
196
+ Use this only when the result merits separate management/acceptance. Omit
197
+ `--role` for direct execution: the Leader owns coordination and performs the
198
+ work without a managed executor Assignment. `--role leader` instead selects the
199
+ Leader Role as a **managed AgentRun executor**; it is not how to label direct
200
+ ownership. Do not self-dispatch merely to gain execution authority.
201
+
202
+ For a writable Project result, create and inspect its WorkItem-owned workspace
203
+ before editing. The Leader can work there directly; isolation does not require a
204
+ Worker. Task main, WorkItem Develop, and Review workspaces remain distinct owners.
134
205
 
135
206
  ```sh
207
+ yui task work create <task> "<separately accepted result>" \
208
+ --project <project> --objective "<outcome>" --accept "<criterion>"
209
+ yui task work isolate <work-id>
136
210
  yui task work update <work-id> running
211
+ # Implement and verify in the returned WorkItem workspace; commit and leave it clean.
137
212
  yui task work update <work-id> done --summary "<result and evidence>"
138
- yui task work accept <work-id> --summary "<explicit acceptance and evidence>"
139
213
  ```
140
214
 
215
+ `done` freezes a direct Candidate, not an AgentRun result or acceptance.
216
+ Inspect it, then integrate the exact isolated result before acceptance:
217
+
218
+ ```sh
219
+ yui task integration start <task> --work-item <work-id> \
220
+ --project <project> --strategy <ff|cherry-pick|merge|manual>
221
+ # Inspect the attempt and finish it through Integration's normal checks/continuation.
222
+ yui task work accept <work-id> --summary "<decision and evidence>"
223
+ ```
224
+
225
+ Read [Integration](integration.md) for checks, continuation, and recovery.
226
+ Keep the same unit through ordinary fixes.
227
+ A read-only or Gitless result with no writable Projects needs no Git isolation;
228
+ submit its actual evidence and accept it explicitly. Existing exact Task-final
229
+ metadata-only Candidates retain their contract; do not establish a special Review
230
+ contract merely to avoid the ordinary writable WorkItem isolation boundary.
231
+
141
232
  For a native child, pass a bounded brief and applicable Profile constraints
142
233
  through the provider's child tools. A small investigation needs no synthetic
143
234
  WorkItem. If the child implements an existing Leader-owned WorkItem, keep that
144
- WorkItem roleless and mark it running. Native children inherit only current
145
- parent authority and gain no Yui Role, AgentRun, Session or broader workspace. Their
235
+ WorkItem roleless, supply its exact workspace and scope, and mark it running.
236
+ Native children inherit only current parent authority and gain no Yui Role,
237
+ AgentRun, Session or broader workspace. Their
146
238
  results are best-effort until Yui externalizes them; use a managed Task Role
147
239
  when independent durability matters. Inspect the returned result before
148
240
  submitting `done` or recording failure progress. `done` creates a Candidate;
@@ -153,20 +245,27 @@ materializing a Task Role, not when launching a native child. The child
153
245
  inherits the Leader Agent; apply a Profile model or effort only when the native
154
246
  tool actually supports and confirms that override.
155
247
 
156
- For a managed Task Role:
248
+ ### Managed Task Role
157
249
 
158
250
  ```sh
159
251
  yui task role add <task-id> <role> --profile <profile>
160
252
  yui task role show <task-id> <role>
161
- yui task work create <task-id> "<outcome>" --role <role>
253
+ yui task work create <task-id> "<outcome>" --role <role> \
254
+ --project <project> --objective "<bounded outcome>" --accept "<criterion>"
162
255
  yui task work dispatch <work-id> --input "<decision-complete brief>"
163
256
  ```
164
257
 
258
+ Add `--after` only for a real dependency. Likely file overlap is not by itself
259
+ a dependency. A Worker may read the complete authorized Task context but may
260
+ write only its WorkItem Projects and workspace. Dispatch prepares that isolated
261
+ workspace and freezes the Assignment; inspect the completed original AgentRun
262
+ result before submitting its exact Candidate, integrating, and accepting.
263
+
165
264
  Profiles carry portable behavior plus either a dynamic Global Worker runtime
166
265
  source or an explicit Agent with optional model and effort. Applying a Profile
167
266
  to a Task Role resolves and freezes the complete binding; later Profile or
168
267
  Global Worker changes do not rewrite that Role. Before dispatch, use
169
- `profile show` and `task role show` to read the exact behavior, Agent, model,
268
+ `config profile show` and `task role show` to read the exact behavior, Agent, model,
170
269
  effort, Profile, and workspace. Do not reconstruct or guess launch
171
270
  configuration. Use the WorkItem assignee directly unless replicated execution
172
271
  was deliberately selected.
@@ -254,8 +353,11 @@ External delivery and Task completion remain separate facts.
254
353
  After a ReviewRound is terminal, the Leader or authorized Operator owns
255
354
  `task work review cleanup <task>/<round>`. Preserve dirty diagnostic evidence
256
355
  and resolve it explicitly; do not ask a Reviewer to clean its own runtime
257
- after its final report. Cleanup can remain advisory at completion, but all
258
- required resources must be settled before user-authorized archive.
356
+ after its final report. Cleanup can remain advisory at completion. Ordinary
357
+ archive requires settled resources; explicitly authorized force archive preserves
358
+ unresolved resources and diagnostics under the shared
359
+ [archive contract](../../yui-runtime/references/publication.md). The Leader
360
+ does not gain independent archive authorization.
259
361
 
260
362
  Complete only when the Task outcome is satisfied, required checks and review
261
363
  contracts are settled, WorkItems are accepted or deliberately retired, latest
@@ -11,7 +11,7 @@ before acceptance:
11
11
  ```sh
12
12
  yui task work capture <work-id>
13
13
  yui task integration start <task> --project <project> \
14
- --change-set <change-set-id> \
14
+ --work-item <work-id> --strategy <ff|cherry-pick|merge|manual> \
15
15
  --check "<Project Policy command>"
16
16
  yui task work accept <work-id> --summary "<decision and evidence>"
17
17
  ```
@@ -20,7 +20,23 @@ These are distinct decisions; confirm Integration succeeded before acceptance.
20
20
  Preserve each managed workspace's owner and the Task's recorded base. Do not
21
21
  silently advance that base because a remote branch moved.
22
22
 
23
- ## Finish the same attempt
23
+ ## Resolve ordinary Git conflicts yourself
24
+
25
+ `conflicted` is an engineering step owned by the Leader, not a request for
26
+ user authorization. Read both sides' intent and the current Task contract,
27
+ inspect the exact Integration source, target and workspace, resolve and stage
28
+ the files there, then run `integration continue`. No preceding
29
+ `resolve --option manual-resolution` is required for an ordinary conflict.
30
+ Core completes the matching Git operation, records the candidate, runs or
31
+ recovers its exact checks and advances the original target by CAS.
32
+
33
+ Do not close the Task execution gate, stop unrelated work, create an
34
+ InputRequest or end in passive waiting merely because Git conflicted.
35
+ Escalate only a real product choice, changed scope, unavailable external fact
36
+ or new authority. The explicit `manual` strategy still requires a recorded
37
+ resolution rationale; it is not the ordinary conflict path.
38
+
39
+ ## Continue from exact evidence
24
40
 
25
41
  For direct Integration checks running as a DurableJob, Job success is not
26
42
  the final target update. Read the terminal result, then use:
@@ -32,8 +48,42 @@ yui task integration continue <task>/<integration>
32
48
  This also applies when no manual conflict resolution was needed. Do not start
33
49
  a duplicate Integration or wait for an empty queue to finalize it.
34
50
 
51
+ Resume interrupted Git/Job work on this attempt when its source/candidate and
52
+ Job identities can be proved. A clean HEAD, leftover REBASE_HEAD or successful
53
+ Job alone does not prove source application or target advancement. Read
54
+ diagnostics when evidence is missing or the source, workspace, candidate,
55
+ target or check conditions changed. Never blindly replay a finished rebase
56
+ or repeat a successful unchanged check.
57
+
35
58
  Resolve failures using the exact conflict or check evidence and the supplied
36
59
  Integration workspace. Never bypass compare-and-swap, update managed refs by
37
60
  hand, or create a replacement WorkItem for ordinary Integration correction.
38
61
  Recheck changed behavior or unresolved failures; do not rerun unchanged
39
62
  successful validation without a current reason.
63
+
64
+ ## Abandon an unprovable attempt without discarding delivery
65
+
66
+ If this attempt cannot safely continue, preserve its candidate, modifications,
67
+ logs and successful evidence, then formally `integration abort --reason ...`
68
+ (or reject a pending resolution). A failed attempt does not require keeping
69
+ the same ID forever or repairing a shared installation before any delivery.
70
+ Choose a new Integration or another already-authorized delivery path.
71
+
72
+ For `validating`, `abort` checks the exact target and Jobs under the same Git
73
+ fence as `continue`. An unadvanced target can be abandoned despite changed
74
+ check conditions. If CAS already advanced the target, the action records
75
+ `committed` instead of pretending delivery was aborted. Read the returned
76
+ outcome. A concurrent operation, unknown Job, or ambiguous target requires
77
+ inspection, not a forced status change or rollback of current Project policy.
78
+
79
+ Formal abort preserves history and workspaces. It is not Git abort, branch
80
+ deletion, target advancement, or proof that a Job/process has stopped.
81
+ Inspect all Jobs owned by the exact attempt, including an unbound Job;
82
+ cancel and establish quiescence by exact identity before reusing or cleaning
83
+ resources. Successful Job evidence and Task acceptance remain separate.
84
+
85
+ Direct Task-main delivery is an alternative only when current delivery
86
+ authority, ownership and the Task contract already permit it, with no other
87
+ writer or active check using that workspace. Do not edit managed refs or the
88
+ control-plane DB, modify another owner's workspace, upgrade shared tools,
89
+ or expand publication authority to work around an Integration failure.
@@ -192,7 +192,12 @@ yui task input cancel <task> <input> --reason "<Leader-owned decision>"
192
192
  After an authorized PR/MR operation or before archive, read
193
193
  [publication and archive boundaries](../yui-runtime/references/publication.md).
194
194
  Record confirmed delivery facts promptly. Completion does not authorize
195
- archive, and archive approval does not authorize forced cleanup.
195
+ archive, and ordinary archive approval does not authorize `--force`.
196
+ When the user explicitly authorizes force archive for an eligible terminal
197
+ Task, archive even if delivery proof or cleanup is incomplete. Report the
198
+ warnings and retained resources without claiming merge verification or physical
199
+ quiescence. Force archive is not permission to delete dirty/uncertain resources,
200
+ kill unrelated execution, abandon delivery or rewrite historical evidence.
196
201
 
197
202
  ## Recover from evidence, not from imagined states
198
203
 
@@ -91,6 +91,33 @@ Global context grants no Task implementation workspace. Read a Task only after
91
91
  the Operator has routed to its public/task-authorized context command; never
92
92
  invent a Task AgentRun identity for a GlobalRole.
93
93
 
94
+ A GlobalRole's durable input uses the same three actions as a Task Role,
95
+ addressed by the Role's own name instead of a Task: `yui role message
96
+ queue|steer <global-role>` and `yui role interrupt <global-role>`. Queue and steer
97
+ save an owned Message; bare interrupt records a control request, not a new
98
+ Message. Each uses a stable request id and that Role's own Session; none fabricates a Task or
99
+ runId to reuse Task-scoped delivery. `queue` delivers at the Role's next legal
100
+ opportunity and is idempotent by request id. `steer` and `interrupt` affect only
101
+ the exact current native Turn — a stale `--expected-target`, an incapable plan,
102
+ or an unproven delivery leaves the Message saved and reports the reason, and
103
+ `interrupt` stops only through the Provider's native cancel with an optional
104
+ `--then-message` naming one already-saved GlobalRole Message. When the Role holds
105
+ no live managed Turn, a steer or interrupt is `NO_ACTIVE_TURN` and never falls
106
+ back to another action.
107
+
108
+ New controlled Global Sessions use the existing Host console, not the native
109
+ TUI, with the configured Agent, permissions and workspace unchanged. A live
110
+ unmanaged Session is not silently replaced or adopted; use an explicit Session
111
+ lifecycle action before enabling controlled delivery.
112
+
113
+ Context reads never consume queue entries. Read the referenced Message in full
114
+ from Session Context. Native/transport acceptance is not implementation, and
115
+ `interrupt-requested` is not a stopped Turn or stopped background resources.
116
+ Only an exact terminal and the original Session/writer boundary can release a
117
+ then handoff. An accepted or unconfirmed steer must not be submitted again by
118
+ changing its request id or composing then. A conclusive rejection permits an
119
+ explicit new control attempt; uncertainty does not.
120
+
94
121
  ## Preserve intent and authority
95
122
 
96
123
  An analysis, diagnosis, or review request is read-only unless the user also
@@ -20,3 +20,23 @@ Completion does not authorize archive. The Operator obtains authorization for
20
20
  the exact Task, checks archive eligibility, then uses `--integrated` for verified
21
21
  merged delivery or `--abandon` for deliberate non-delivery. General archive
22
22
  approval never implies `--force` authority. Preserve the Task record.
23
+
24
+ With explicit force authorization for a completed or retired Task, use
25
+ `yui task archive <task> (--integrated|--abandon) --force`. Force commits the
26
+ archive and stops new Task scheduling before attempting safe foreground cleanup.
27
+ Missing/stale delivery evidence, unresolved execution and cleanup errors become
28
+ warnings with retained resource references; they do not block that commit.
29
+ Authority, lifecycle, identity and mandatory audit persistence still fail closed.
30
+
31
+ Force does not verify a merge, accept work, stop unknown execution, discard dirty
32
+ data or imply abandonment. Keep the requested disposition and original
33
+ Publication/completion evidence. Unverified local commits and resources that
34
+ cannot be safely released stay owned and traceable. Late runtime events remain
35
+ source evidence, not authority to resume or settle unknown input.
36
+
37
+ Read `task show <task> --json` for `archive.warnings`, `retainedResources` and
38
+ cleanup events; `task context` also retains the original records/events. A
39
+ successful archive exit means `archived=true`, not that cleanup fully succeeded.
40
+ If cleanup was interrupted, the Task stays archived. Repeating archive only
41
+ reports current facts; use explicit, exact-owner resource operations after
42
+ inspection instead of re-running broad cleanup. No background retry is implied.