@zq-silk/yui 0.8.2 → 0.8.6

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 (68) hide show
  1. package/ARCHITECTURE.md +40 -22
  2. package/README.md +61 -9
  3. package/dist/cli/commandCatalog.js +31 -14
  4. package/dist/cli/operatorWizard.js +10 -20
  5. package/dist/cli.js +187 -22
  6. package/dist/commands/executionAuditCommands.js +30 -0
  7. package/dist/commands/operatorCommands.js +42 -1
  8. package/dist/commands/taskCommands.js +648 -74
  9. package/dist/commands/taskCompletionGate.js +166 -2
  10. package/dist/commands/taskContextCommand.js +6 -1
  11. package/dist/commands/taskInputCommands.js +48 -10
  12. package/dist/commands/taskNextActionCommand.js +36 -3
  13. package/dist/context/runContextPack.js +19 -4
  14. package/dist/context/sessionBootstrapManifest.js +83 -2
  15. package/dist/controller/clientRuntime.js +7 -7
  16. package/dist/controller/controller.js +16 -8
  17. package/dist/controller/fileSchedulerStoreAdapter.js +64 -5
  18. package/dist/controller/handoverCandidate.js +10 -3
  19. package/dist/controller/sessionNotify.js +4 -22
  20. package/dist/executor/agentAdapter.js +2 -2
  21. package/dist/executor/agentExecutor.js +25 -5
  22. package/dist/executor/fileRoleLaunchPlanner.js +16 -11
  23. package/dist/integration/gitIntegrationService.js +50 -2
  24. package/dist/integration/integrationCheckEvidenceReuse.js +53 -0
  25. package/dist/observability/executionAudit.js +47 -1
  26. package/dist/observability/faultClassification.js +6 -4
  27. package/dist/observability/orchestrationMetrics.js +196 -0
  28. package/dist/operator/operatorSessionHistory.js +36 -0
  29. package/dist/release/releaseHandover.js +7 -5
  30. package/dist/release/runtimeRelease.js +15 -0
  31. package/dist/repository/gitWorkspace.js +7 -4
  32. package/dist/repository/taskBaseFreshness.js +4 -2
  33. package/dist/repository/taskWorkspaceCoordinator.js +13 -10
  34. package/dist/review/deltaRecheck.js +3 -2
  35. package/dist/review/reviewFindingLedger.js +5 -4
  36. package/dist/review/reviewOutcomeClassifier.js +252 -54
  37. package/dist/review/taskFinalReviewContractEvent.js +1 -0
  38. package/dist/review/taskFinalReviewContractRebind.js +350 -0
  39. package/dist/run/agentRun.js +2 -2
  40. package/dist/run/runIdentity.js +10 -70
  41. package/dist/runtime/agentHost.js +3 -4
  42. package/dist/runtime/codexAppServerRuntime.js +6 -0
  43. package/dist/runtime/firstProgressStopLoss.js +52 -0
  44. package/dist/runtime/launchBroker.js +10 -2
  45. package/dist/runtime/runtimeDeadlines.js +14 -0
  46. package/dist/runtime/sessionTitle.js +24 -12
  47. package/dist/runtime/structuredProviderHost.js +7 -1
  48. package/dist/runtime/tmuxAdapters.js +10 -3
  49. package/dist/scheduler/activeRoleRunDelivery.js +20 -18
  50. package/dist/scheduler/leaderWakeupProcessor.js +33 -2
  51. package/dist/scheduler/wakeReason.js +2 -0
  52. package/dist/storage/sqliteStore.js +10 -1
  53. package/dist/storage/taskStore.js +12 -1
  54. package/dist/task/completionReadiness.js +91 -19
  55. package/dist/task/deliveryGuard.js +3 -1
  56. package/dist/task/nextAction.js +146 -51
  57. package/dist/task/publicationReference.js +1 -0
  58. package/dist/task/repairWave.js +14 -1
  59. package/dist/task/task.js +10 -0
  60. package/dist/web/webSnapshot.js +7 -1
  61. package/dist/workItem/workItem.js +12 -0
  62. package/dist/workspace/workItemChangeSetManager.js +2 -1
  63. package/i18n/README.zh-CN.md +28 -8
  64. package/package.json +1 -1
  65. package/skills/yui-leader/SKILL.md +79 -32
  66. package/skills/yui-operator/SKILL.md +51 -10
  67. package/skills/yui-reviewer/SKILL.md +23 -0
  68. package/skills/yui-runtime/SKILL.md +7 -2
@@ -106,7 +106,8 @@ yui project add app /absolute/workspace/app \
106
106
  yui project update app --alias app-cli --development develop
107
107
  yui project list
108
108
 
109
- yui task create "交付 CSV 导出" --project app
109
+ yui task create "修复 CSV 转义" --project app --delivery direct
110
+ yui task create "交付 CSV 导出" --project app --delivery integrated
110
111
  yui task update <task-id> --priority high --tags release,csv --due-at 2026-08-01T00:00:00Z
111
112
  yui task update <task-id> --clear-priority --clear-tags --clear-due-at
112
113
  yui task show <task-id>
@@ -114,6 +115,16 @@ yui task context <task-id>
114
115
  yui task activate <task-id>
115
116
  ```
116
117
 
118
+ Project 交付路径显式分为两类,但仍复用现有 Task schema。`direct` 用于
119
+ Project Policy 允许的单一低风险修复:Leader 直接在干净且已提交的 Task main
120
+ 实现、验证并完成,不要求 WorkItem、IntegrationAttempt 或由全局策略自动创建的
121
+ final ReviewRound。`integrated` 用于受保护、跨 Project、迁移、授权、并发/恢复、
122
+ 破坏性或发布改动,并要求 WorkItem、ChangeSet 与 committed Integration 证据。
123
+ 全局 final-review 策略只自动约束 integrated Task。direct Task 可使用有边界的原生
124
+ review;若需要独立托管的 final Review,必须在 Task main 前进前提升为 integrated。
125
+ 一旦已有提交或交付证据,提升会 fail closed,避免早期修改失去 ChangeSet provenance。
126
+ 旧的 `--require-integration` 等价于 `--delivery integrated`,且 integrated 不可降级。
127
+
117
128
  面向用户的时间默认按北京时间(`Asia/Shanghai`)显示;持久化记录和
118
129
  `--json` 数据仍使用 UTC/RFC 3339。可通过以下命令查看或修改 IANA 时区:
119
130
 
@@ -150,8 +161,9 @@ AgentRun 不创建新 WorkItem,也不会递归触发审查。审查以自然
150
161
  唤醒 Leader;Leader 决定验收、reject 后在原 Role 与原 Session 中修复、
151
162
  再次审查,或通过 InputRequest 询问用户。审查失败会保留为可见证据并
152
163
  唤醒 Leader,但不会取代 Leader 的最终判断。
153
- `final` 不为每个 WorkItem 创建完整 ReviewRound;`task complete` 会在每个绑定
154
- Project 都有 committed Integration 后排队一次 Task 级 Review。冻结的集成头
164
+ `final` 不为每个 WorkItem 创建完整 ReviewRound;integrated Task
165
+ `task complete` 会在每个绑定 Project 都有 committed Integration 后排队一次
166
+ Task 级 Review。direct Task 不会因可变的全局 final 配置自动增加 Review。冻结的集成头
155
167
  发生变化时才会重新排队,旧报告仍保留为证据。Reviewer 按 Project Policy/Knowledge
156
168
  检查整个 Task,并只报告有直接证据的可达、重要、可行动问题或有限验证缺口。
157
169
  所有候选、ReviewRound 和 Leader 决策都集中在原 WorkItem 下;reject
@@ -230,6 +242,7 @@ WorkItem workspace 之间移动时,Yui 会退役已停止的旧 Session;下
230
242
  ```sh
231
243
  yui operator submit "比较 CSV 与 JSON 的兼容性" --task <task-id>
232
244
  yui operator submit "研究更小的缓存设计"
245
+ yui operator status
233
246
  yui operator list
234
247
  yui operator resume
235
248
  yui operator resume --last
@@ -254,12 +267,13 @@ Operator 会结合 Project Catalog 和现有 Task context 路由请求。同一
254
267
  目标的追加需求、修复、审查和咨询继续进入原 Task,即使它涉及多个 Project。
255
268
  目标、所有权边界或生命周期独立时才创建新 Task。需求、Bug 和咨询共用同一
256
269
  Task/WorkItem 模型,不增加额外任务类型。
257
- `operator list` 按固定的最近更新时间倒序展示历史对话,并显示 Agent
270
+ `operator status` GlobalRole 选中的唯一 active writer 与保留的历史对话
271
+ 分开展示。`operator list` 按固定的最近更新时间倒序展示历史对话,并显示 Agent
258
272
  及可读的标题或摘要;底层 provider session ID 始终保持内部实现细节。
259
273
  若 adapter 尚未提供这些元数据,Yui 会显示 provider 和稳定的 Yui
260
- 短引用,确保无标题会话仍可区分。`operator resume` 使用同一个轻量编号列表,
261
- `--last` 可直接恢复最近一条;
262
- `operator new` 创建空白对话,并把原对话保留在历史中。
274
+ 短引用,确保无标题会话仍可区分。`operator resume` 使用轻量历史编号列表,
275
+ `--last` 可直接恢复最近一条;新建会话不会伪装成 resume 选项,必须显式使用
276
+ `operator new`,并把原对话保留在历史中。
263
277
 
264
278
  从已配置的全局 Worker 创建 Task Role,应用 Profile 并派发 WorkItem:
265
279
 
@@ -430,7 +444,13 @@ yui task complete <task-id> --summary "CSV 导出已交付并验证"
430
444
  yui task reopen <task-id>
431
445
  ```
432
446
 
433
- completed Task 在显式 reopen 前会拒绝消息、派发、进入 session、重试和迟到的 yield。每个隔离 WorkItem worktree 必须先显式清理,清理时也会删除其受管分支;archive 还必须通过 `--integrated` 或 `--abandon` 明确 Task main 的处理结果,之后才会停止 session 并清理干净的 Task main。Task 与 WorkItem 记录都会保留,Task main 分支作为恢复信息保留,不会被静默删除。
447
+ completed Task 在显式 reopen 前会拒绝消息、派发、进入 session、重试和迟到的
448
+ yield。终态 WorkItem、Review、Integration 与 Lane worktree 会作为非阻塞的
449
+ completion advisory 返回,但必须在 archive 前处理。每个隔离 WorkItem worktree
450
+ 仍需显式标记 integrated 或 abandoned,清理时也会删除其受管分支;archive 还必须
451
+ 通过 `--integrated` 或 `--abandon` 明确 Task main 的处理结果,之后才会停止
452
+ session 并清理干净的 Task main。Task 与 WorkItem 记录都会保留,Task main 分支
453
+ 作为恢复信息保留,不会被静默删除。
434
454
  Task 生命周期的交互选择只展示有效来源状态:activate 只展示 Draft,complete 只展示 active,reopen 只展示 completed。
435
455
 
436
456
  ## Session 与 tmux
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zq-silk/yui",
3
- "version": "0.8.2",
3
+ "version": "0.8.6",
4
4
  "description": "Local control plane for long-running native agent CLI sessions backed by tmux.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -33,10 +33,16 @@ workspace or infer a Lane result from a non-durable checkout.
33
33
 
34
34
  ## Default to the Leader-first fast path
35
35
 
36
- For ordinary, continuous, single-Project development, create one roleless
37
- WorkItem for the bounded result. Keep its investigation, implementation,
38
- targeted checks, and ordinary review fixes together. A phase name is not a
39
- reason to create another WorkItem, Role, Session, Run, Message, or Input.
36
+ Start from the Task's recorded delivery path:
37
+
38
+ - **Direct**: for a low-risk Project Task, implement, commit, and verify in the
39
+ managed Task main. Do not create a WorkItem, ChangeSet, IntegrationAttempt,
40
+ Worker Role, or managed ReviewRound merely to leave more records.
41
+ - **Integrated**: create one roleless WorkItem for the bounded result. Keep its
42
+ investigation, implementation, targeted checks, and ordinary review fixes
43
+ together. Split only for independently acceptable ownership or real parallel
44
+ value; a phase name is not a reason to create another WorkItem, Role,
45
+ Session, Run, Message, or Input.
40
46
 
41
47
  Choose the executor in this order:
42
48
 
@@ -54,18 +60,19 @@ Do not dispatch a Task Role merely to obtain a fresh context, run a command,
54
60
  perform a routine small edit, or add an intermediate review. Direct and native
55
61
  execution add no Worker Role, Worker Yui Session, or Worker AgentRun. The exact
56
62
  Leader Run remains active until an explicit Yui yield, completion, or exact
57
- failure; native child lifecycle never decides that Run outcome. The WorkItem
58
- and its workspace remain the durable delivery boundary.
63
+ failure; native child lifecycle never decides that Run outcome. Task main is
64
+ the direct path's durable delivery boundary; the WorkItem and its workspace are
65
+ the integrated path's boundary.
59
66
 
60
67
  Provider-native foreground and background child lifecycle stays owned by the
61
68
  current Agent Session. Structured child completion notifications may resume the
62
69
  Leader in later provider Turns while the same Yui AgentRun remains active.
63
70
 
64
- A Project-backed code result still uses one WorkItem-owned Develop workspace
65
- and a clean committed Candidate. The fast path compresses orchestration, not
66
- delivery evidence: Candidate, ChangeSet, committed Integration, acceptance,
67
- Task-final Review when supplied by the configured review policy, and Task
68
- completion remain distinct judgments and records.
71
+ A direct Project result uses a clean committed Task main and exact completion
72
+ head proof. An integrated result uses one WorkItem-owned Develop workspace and
73
+ a clean committed Candidate; Candidate, ChangeSet, committed Integration,
74
+ acceptance, Task-final Review when required, and Task completion remain
75
+ distinct judgments and records.
69
76
 
70
77
  Use this validation and review cadence unless Project Policy requires more:
71
78
 
@@ -75,15 +82,24 @@ Use this validation and review cadence unless Project Policy requires more:
75
82
  2. Have a native child return one consolidated result for the requested round.
76
83
  The Leader inspects that result, the diff, and the acceptance criteria; do
77
84
  not create progress handoffs or poll the child.
78
- 3. Capture the reviewed Candidate and run the Project Policy's complete
79
- delivery validation once on the Integration candidate. Treat that committed
80
- Integration and its check as the pre-delivery evidence; do not run the same
81
- full suite earlier merely for reassurance.
82
- 4. For the normal final-review policy, use one independent Task-final Review of
83
- the frozen committed Integration heads before completion. Do not substitute
84
- per-WorkItem ReviewRounds. If the selected Yui Core does not supply that
85
- primitive, report the capability gap instead of emulating it with new state
86
- or repeated reviews.
85
+ 3. For direct delivery, run Project Policy's complete local delivery validation
86
+ once on the final Task-main commit, then complete. Use a bounded native
87
+ review when useful. If an independently managed final Review is required,
88
+ promote to integrated before Task main advances. An already established
89
+ immutable final Review remains binding.
90
+ 4. For integrated delivery, capture the Candidate and run the complete delivery
91
+ validation once on the Integration candidate. Use one independent Task-final
92
+ Review of the frozen committed heads when policy requires it; do not
93
+ substitute per-WorkItem ReviewRounds or repeat a successful full check on an
94
+ unchanged commit.
95
+
96
+ Yui may reuse a successful Integration check only for the same Task, Project,
97
+ exact candidate commit, ordered check commands, immutable runtime release, and
98
+ available DurableJob logs. Treat that reused result as the same local
99
+ Integration evidence; do not start another DurableJob for ceremony. A changed
100
+ commit, command order, runtime release, missing log, or VerificationPlan always
101
+ reruns. PR CI remains an independent environment and is not replaced by local
102
+ evidence reuse.
87
103
 
88
104
  Route a reachable finding back to the original execution unit: the Leader
89
105
  fixes direct work, the same native child handles its bounded correction, and
@@ -100,6 +116,16 @@ children through adapter metadata, and routes a later result reference through
100
116
  the durable inbox. Do not poll, send a waiting Message, rewrite a checkpoint,
101
117
  or yield merely to preserve that native wait.
102
118
 
119
+ Before the first durable Leader action, Yui permits at most one automatic
120
+ same-Session Provider continuation. If two fresh Leader generations still
121
+ produce no WorkItem, Review, Integration, or Leader-attributed durable event,
122
+ the Controller stops before a third generation, marks recovery failed, and
123
+ hands the exact evidence to the unique global Operator. Do not bypass that
124
+ stop-loss by manufacturing another Role, Run, Session, or Task. The Operator
125
+ must inspect the failure and explicitly recover or change the configured
126
+ Leader; after first durable progress, ordinary bounded Provider retry policy
127
+ continues to apply.
128
+
103
129
  Native child results have an explicit durability boundary. A native subagent is
104
130
  best-effort by default: its result returns through the parent Conversation, and
105
131
  if the parent Session is lost before Yui externalizes the result, rerun the
@@ -515,15 +541,30 @@ authorized expansions.
515
541
  or ask the user.
516
542
  - Route a reachable final-Review finding to the original Worker while that
517
543
  WorkItem is open; otherwise create the smallest Repair WorkItem. Resolve
518
- cross-WorkItem repairs in a bounded Repair WorkItem, use Leader/Integration
544
+ all findings from one final Review in one consolidated Repair WorkItem by
545
+ default. Select `task review finding repair-wave --strategy parallel` only
546
+ when the groups have independently acceptable ownership and the concurrency
547
+ benefit exceeds the added Integration and Review cost. Use Leader/Integration
519
548
  for merge or small local fixes, and create an architecture WorkItem only for
520
549
  a genuinely cross-cutting design issue. The Leader owns the decision and
521
550
  completion; routine retries and routing do not need an InputRequest.
522
551
  - A failed review is terminal evidence, not an automatic retry. Retry a
523
552
  WorkItem review with a new `task work review`, accept with an explicit
524
- rationale, or ask the user. For an exact failed Task-scoped final Review Run,
525
- `yui task run retry <run-id>` requests one independent ReviewRound over the
526
- same frozen Task candidate; repeating the same exact retry reuses that Round.
553
+ rationale, or ask the user. `yui task run retry <run-id>` retries an exact
554
+ failed Task-final Reviewer execution under the same semantic ReviewRound. If
555
+ that immutable Round is durably proven non-semantic without any review
556
+ checks, evidence, finding, or ambiguous output—even when a pre-review
557
+ context/workspace failure historically terminalized it as completed/yielded—
558
+ the Leader may run
559
+ `yui task review force-fresh <task>/<review-round>` to create one distinct
560
+ full Round over the identical frozen heads. It fails closed for every
561
+ semantic or ambiguous prior result; target the new failed Round explicitly
562
+ if another non-semantic failure occurs.
563
+ - Use `task next-action`'s derived Review outcome literally: non-semantic means
564
+ recover the same frozen head with `force-fresh`; ambiguous means diagnose the
565
+ inconsistent evidence without creating a Repair WorkItem; only semantic
566
+ negative evidence may create a repair wave. Non-semantic and ambiguous
567
+ attempts do not consume the full semantic Review budget.
527
568
  - If the same non-resource user choice or unavailable external fact repeats,
528
569
  persist context and create an InputRequest instead of looping. Never use an
529
570
  InputRequest to solicit authorization for an unrequested real-resource test;
@@ -606,6 +647,10 @@ yui task integration cleanup <integration-id>
606
647
  yui task work cleanup <task>/<work> --integrated
607
648
  ```
608
649
 
650
+ Terminal child worktrees are completion advisories, not semantic blockers.
651
+ Clean them before archive; do not create a new WorkItem, ReviewRound, or Run
652
+ only to make cleanup happen before Task completion.
653
+
609
654
  Use `--abandon` only for deliberate discard. Dirty worktrees remain available
610
655
  for capture or resolution. Cleanup must never stop a Role already serving a
611
656
  newer WorkItem. If the original execution Session cannot be resumed, surface
@@ -681,14 +726,16 @@ results are outstanding: the provider owns their completion notifications, and
681
726
  Yui keeps this AgentRun active across intermediate provider Turns. After native
682
727
  work drains, continue to Task completion, InputRequest, or final yield.
683
728
 
684
- Complete only after required WorkItems are accepted, Role work is terminal,
685
- latest isolated results are integrated or deliberately abandoned, and user
686
- inputs are resolved. Task completion is a semantic boundary: it records the
687
- result and notifies the global Operator; it does not infer runtime cleanup or
688
- stop this Leader. Do not kill tmux panes, edit Session records, or add a
689
- provider-specific cleanup step. After completion succeeds, end the current
690
- Turn immediately so the Operator can perform the explicit archive boundary;
691
- do not stop or mutate the native Session yourself.
729
+ Complete only after the selected delivery path's evidence is satisfied, Role
730
+ work is terminal, latest isolated results are integrated or deliberately
731
+ abandoned, and user inputs are resolved. Direct delivery has no WorkItem gate;
732
+ integrated delivery retains it. Task completion is a semantic boundary: it
733
+ records exact Project heads, reports terminal-workspace cleanup advisories, and
734
+ notifies the global Operator. It does not stop this Leader. Do not kill tmux
735
+ panes, edit Session records, or add a provider-specific cleanup step. After
736
+ completion succeeds, end the current Turn immediately so the Operator can
737
+ settle advisories and perform the explicit archive boundary; do not stop or
738
+ mutate the native Session yourself.
692
739
 
693
740
  ```sh
694
741
  yui task complete <task-id> --summary "<outcome, validation, and remaining risks>"
@@ -115,12 +115,18 @@ outcome may bind multiple Projects and independent base refs. A feature, bug
115
115
  fix, and question do not need separate Task types; intent and acceptance
116
116
  criteria carry the difference.
117
117
 
118
+ The Task title is the human-facing label used in Agent session lists. Keep it to
119
+ one concise outcome phrase, ideally within 20 characters. Put request details,
120
+ constraints, and context in the Task description or the first routed Message; do
121
+ not add `Yui`, Role, or Task-id prefixes because Yui adds those when naming
122
+ native sessions.
123
+
118
124
  ```sh
119
125
  yui operator submit "<related request>" --task <task-id>
120
126
  yui task create "<distinct mission>" \
121
127
  --project <project-a> --project <project-b> \
122
128
  --base <project-a>=<ref> --base <project-b>=<ref> \
123
- --require-integration
129
+ --delivery integrated
124
130
  yui operator submit "<request and routing context>" --task <new-task-id>
125
131
  yui task activate <new-task-id>
126
132
  ```
@@ -139,11 +145,25 @@ separate Tasks merely because it spans several Projects or files. A Task may
139
145
  carry many features and rounds of WorkItems toward its shared outcome, but it is
140
146
  not a permanent backlog; genuinely independent goals become their own Tasks.
141
147
 
142
- Use `--require-integration` whenever completing the mission requires changing
143
- and delivering Project files. Yui then requires a WorkItem, ChangeSet, and
144
- committed Integration before completion. Omit it for read-only investigation,
145
- questions, or other outcomes that do not deliver repository changes. State
146
- which completion rule was recorded when reporting the newly created Task.
148
+ Choose the Project delivery path before activation and report it with the Task:
149
+
150
+ - `--delivery direct` for one bounded, low-risk outcome that Project Policy
151
+ allows the Leader to implement and verify on Task main. Direct delivery does
152
+ not require a WorkItem, ChangeSet, IntegrationAttempt, or policy-created
153
+ managed ReviewRound; it still requires a clean committed managed Task main.
154
+ - `--delivery integrated` when Project Policy requires independent provenance,
155
+ Integration CAS, or final Review, and whenever the change crosses Projects,
156
+ storage/migration, permission or authorization, destructive behavior,
157
+ concurrency/recovery invariants, or release machinery. It requires the
158
+ WorkItem, ChangeSet, and committed Integration evidence chain.
159
+ - Omit `--delivery` only for a Task with no Project bindings. The legacy
160
+ `--require-integration` flag remains an alias for `--delivery integrated`.
161
+
162
+ Risk is a Leader/Project Policy judgment, not a file-count score. When evidence
163
+ changes the risk, promotion from direct to integrated is explicit and
164
+ irreversible; never silently downgrade an integrated Task to make completion
165
+ easier. Do not pre-create WorkItems merely because integrated delivery might
166
+ become necessary later.
147
167
 
148
168
  Managed workspaces are owner-keyed, not Role-keyed: Task main, WorkItem
149
169
  Develop, ReviewRound, and IntegrationAttempt each retain their own durable
@@ -158,10 +178,16 @@ outcome: keep it on the original Task, submit only the delta and its reason, and
158
178
  let the Leader retire the affected WorkItem, optionally name its replacement,
159
179
  and create the replacement. When a change instead abandons the current outcome for an
160
180
  independent one, do not force it onto the original Task; apply the strict
161
- new-Task rule above. If the delta changes
162
- a read-only Task into Project delivery work, first run
163
- `yui task update <task-id> --require-integration`, read back the Task completion
164
- rule, and only then submit the delta. When a completed Task
181
+ new-Task rule above. If the delta promotes a Project-backed direct Task into
182
+ guarded delivery, first run
183
+ `yui task update <task-id> --delivery integrated`, read back the delivery path,
184
+ and only then submit the delta. Promotion is allowed only while Task main is
185
+ still at its recorded base and no WorkItem, ChangeSet, Integration, or Review
186
+ evidence exists. If implementation already advanced Task main, keep the branch
187
+ intact and either finish under the direct contract or create an integrated
188
+ replacement Task; never manufacture provenance for earlier commits. Bind a
189
+ Project before selecting a delivery path
190
+ for a previously Gitless Task. When a completed Task
165
191
  receives genuinely new work, reopen it only if it is still the same outcome;
166
192
  otherwise create a follow-up Task and reference the earlier result.
167
193
 
@@ -283,6 +309,12 @@ ChangeSet is integrated.
283
309
 
284
310
  - Enter the global Session with `yui operator enter`; do not recursively run it
285
311
  from inside Operator.
312
+ - Use `yui operator status` to distinguish the one GlobalRole-selected active
313
+ writer from retained historical conversations. Historical Sessions are
314
+ evidence only and never a second Operator authority. Use `operator resume`
315
+ only for an existing explicit conversation; creating a conversation is the
316
+ separate, deliberate `operator new` action. Recovery must never create an
317
+ extra Operator Session implicitly.
286
318
  - Enter an active Task Leader with `yui task enter <task-id>`, or a persistent
287
319
  Role with `yui task enter <task-id> <role>`.
288
320
  - Relay explicit Task information with
@@ -310,6 +342,15 @@ ChangeSet is integrated.
310
342
  Run, Agent, receipt, launch, and Session identities; never reconstruct them
311
343
  from terminal text or ask the user to paste them.
312
344
  - Retry only an explicitly failed recovery Job.
345
+ - When a Leader first-progress stop-loss is reported, inspect its two exact
346
+ native generations and absence of durable progress. Do not request a third
347
+ automatic generation or create another Operator. Recover the existing Task
348
+ only after choosing an explicit valid Leader configuration or a direct
349
+ maintenance action.
350
+ - Use `yui task next-action <task>` and `yui execution audit` orchestration
351
+ advisories as read-only cost evidence. They may flag excess WorkItems,
352
+ repeated Reviews/checks, pre-progress generations, or terminal workspaces;
353
+ they never authorize acceptance, deletion, or automatic protocol changes.
313
354
 
314
355
  A Task terminal notification reports the outcome, user impact, remaining risk,
315
356
  and whether the Task is archive-eligible; it grants no archive authority. Task
@@ -20,6 +20,29 @@ A Role is an executor, not a workspace owner: the ReviewRound owns its fresh
20
20
  workspace. Review edits are confined to that workspace, never modify the
21
21
  WorkItem Develop workspace, and never become a ChangeSet source.
22
22
 
23
+ ## Separate infrastructure failure from review judgment
24
+
25
+ Verify the exact Run identity, Context Pack, frozen head, and ReviewRound-owned
26
+ workspace before inspecting candidate sources. If context loading or workspace
27
+ binding fails before review begins:
28
+
29
+ - do not inspect the candidate, run candidate checks, invent findings, accept
30
+ risk, or claim the frozen result was reviewed;
31
+ - return only the exact infrastructure diagnosis, with no semantic findings or
32
+ checks, through the assigned Review Run;
33
+ - do not recommend a Repair WorkItem—the Leader must recover the same frozen
34
+ review boundary with `task review force-fresh` when Yui proves the outcome
35
+ non-semantic;
36
+ - if any candidate inspection or Reviewer output did occur, report it
37
+ explicitly. Mixed infrastructure and semantic evidence is ambiguous and must
38
+ fail closed, never be relabeled as a clean transport failure.
39
+
40
+ Yui derives `semantic`, `non-semantic`, or `ambiguous` from the immutable
41
+ Round, Run receipt, completion Event, and finding evidence. Never write or
42
+ simulate a classification field. A non-semantic attempt consumes no semantic
43
+ Review budget and cannot satisfy acceptance; an ambiguous attempt requires
44
+ Leader diagnosis before another review or repair decision.
45
+
23
46
  Keep the context layers distinct. Yui Core owns ReviewRound identity,
24
47
  lifecycle, access, workspace, and exact-yield safety; this generic Skill owns
25
48
  portable review behavior; Agent-native Project Skills and Project Policy and
@@ -23,12 +23,17 @@ For every managed Task Run:
23
23
  context-load failure if the pack is missing, stale, unauthorized, malformed,
24
24
  or mismatched. Never request an inline/full-prompt fallback.
25
25
  4. Use pack summaries and pointers first. Expand only an authorized ref when
26
- its full value is needed:
26
+ its full value is needed, selecting it by the pointer's exact `store` and
27
+ `refId`:
27
28
 
28
29
  ```sh
29
- "$YUI_SESSION_CLI" task run context expand "$YUI_TASK_ID/<run-id>" <ref-id> --mode full --json
30
+ "$YUI_SESSION_CLI" task run context expand "$YUI_TASK_ID/<run-id>" <ref-id> --store <store> --mode full --json
30
31
  ```
31
32
 
33
+ A bare `<ref-id>` remains supported only when it identifies exactly one
34
+ authorized pointer. If multiple stores use that id, bare expansion fails
35
+ closed; never guess which store was intended.
36
+
32
37
  5. On a later wake, request only the declared delta after the last pack cursor.
33
38
  If no cursor is available, reload the exact pack; do not reconstruct state
34
39
  from transcript memory.