work-ally 0.2.0-alpha.1

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 (172) hide show
  1. package/AGENTS.md +110 -0
  2. package/DASHBOARD.md +160 -0
  3. package/PRODUCT.md +113 -0
  4. package/README.md +403 -0
  5. package/ally.sh +171 -0
  6. package/bridge/src/approval-rules.ts +360 -0
  7. package/bridge/src/channel-delivery.ts +207 -0
  8. package/bridge/src/channel-types.ts +22 -0
  9. package/bridge/src/channels/fake/adapter.ts +31 -0
  10. package/bridge/src/channels/feishu/adapter.ts +411 -0
  11. package/bridge/src/channels/feishu/approvals.ts +6 -0
  12. package/bridge/src/channels/feishu/formatter.ts +276 -0
  13. package/bridge/src/channels/feishu/normalize.ts +368 -0
  14. package/bridge/src/codex-config.ts +52 -0
  15. package/bridge/src/config.ts +240 -0
  16. package/bridge/src/fake-runtime-client.ts +505 -0
  17. package/bridge/src/handoff-service.ts +494 -0
  18. package/bridge/src/logger.ts +194 -0
  19. package/bridge/src/memory-digest.ts +186 -0
  20. package/bridge/src/receiver-approval-autonomy.ts +158 -0
  21. package/bridge/src/receiver-control-core.ts +140 -0
  22. package/bridge/src/receiver-control-work-session.ts +218 -0
  23. package/bridge/src/receiver-control.ts +83 -0
  24. package/bridge/src/receiver-delivery.ts +136 -0
  25. package/bridge/src/receiver-helpers.ts +96 -0
  26. package/bridge/src/receiver-human-gate.ts +333 -0
  27. package/bridge/src/receiver-inbound-preflight.ts +162 -0
  28. package/bridge/src/receiver-recovery.ts +236 -0
  29. package/bridge/src/receiver-runtime-callbacks.ts +367 -0
  30. package/bridge/src/receiver-runtime-policy.ts +132 -0
  31. package/bridge/src/receiver-runtime-state.ts +124 -0
  32. package/bridge/src/receiver-support-actions.ts +189 -0
  33. package/bridge/src/receiver-thread-start.ts +57 -0
  34. package/bridge/src/receiver-turn-coordination.ts +94 -0
  35. package/bridge/src/receiver-turn-execution.ts +257 -0
  36. package/bridge/src/receiver-turn-failure.ts +143 -0
  37. package/bridge/src/receiver-turn-result.ts +185 -0
  38. package/bridge/src/receiver-turn-steer.ts +70 -0
  39. package/bridge/src/receiver-work-session.ts +76 -0
  40. package/bridge/src/receiver.ts +329 -0
  41. package/bridge/src/router.ts +62 -0
  42. package/bridge/src/runtime-client-agent-messages.ts +150 -0
  43. package/bridge/src/runtime-client-message-dispatch.ts +176 -0
  44. package/bridge/src/runtime-client-protocol.ts +411 -0
  45. package/bridge/src/runtime-client-request-ops.ts +56 -0
  46. package/bridge/src/runtime-client-run-turn.ts +158 -0
  47. package/bridge/src/runtime-client-thread-ops.ts +270 -0
  48. package/bridge/src/runtime-client-transport.ts +309 -0
  49. package/bridge/src/runtime-client-turn-poll.ts +224 -0
  50. package/bridge/src/runtime-client-turn-read.ts +185 -0
  51. package/bridge/src/runtime-client-turn-state.ts +105 -0
  52. package/bridge/src/runtime-client.ts +344 -0
  53. package/bridge/src/runtime-user-input.ts +403 -0
  54. package/bridge/src/scheduler.ts +239 -0
  55. package/bridge/src/server-handoff-command.ts +364 -0
  56. package/bridge/src/server-main.ts +80 -0
  57. package/bridge/src/server-routine-command.ts +60 -0
  58. package/bridge/src/server-routine-execution.ts +222 -0
  59. package/bridge/src/server-runtime-app-support.ts +107 -0
  60. package/bridge/src/server-runtime-app.ts +238 -0
  61. package/bridge/src/server-thread-sync-command.ts +63 -0
  62. package/bridge/src/server.ts +17 -0
  63. package/bridge/src/session-store-delivery.ts +220 -0
  64. package/bridge/src/session-store-human-gate.ts +380 -0
  65. package/bridge/src/session-store-inbound-acceptance.ts +66 -0
  66. package/bridge/src/session-store-meta.ts +134 -0
  67. package/bridge/src/session-store-turn-ledger.ts +272 -0
  68. package/bridge/src/session-store.ts +380 -0
  69. package/bridge/src/system-notify.ts +220 -0
  70. package/bridge/src/thread-sync.ts +200 -0
  71. package/bridge/src/translator.ts +494 -0
  72. package/bridge/src/types.ts +289 -0
  73. package/bridge/src/utils.ts +104 -0
  74. package/bridge/src/work-session-store.ts +471 -0
  75. package/docs/.gitkeep +0 -0
  76. package/docs/architecture/codex-feishu-bridge-proposal.md +2742 -0
  77. package/docs/completed/FEATURE-feishu-markdown-and-reply-support.md +327 -0
  78. package/docs/completed/README.md +21 -0
  79. package/docs/completed/SPEC-approval-autonomy-and-safe-defaults.md +205 -0
  80. package/docs/completed/SPEC-approval-batch-and-strict-reply-shortcuts.md +153 -0
  81. package/docs/completed/SPEC-conversation-noise-reduction-and-busy-input-gate.md +538 -0
  82. package/docs/completed/SPEC-engineering-sop-skillization.md +190 -0
  83. package/docs/completed/SPEC-faithful-bridge-core-thinning-v2.md +376 -0
  84. package/docs/completed/SPEC-faithful-bridge-core-thinning.md +1071 -0
  85. package/docs/completed/SPEC-group-chat-sender-identity.md +301 -0
  86. package/docs/completed/SPEC-middleware-exception-visibility.md +227 -0
  87. package/docs/completed/SPEC-nightly-memory-digest-visibility.md +121 -0
  88. package/docs/completed/SPEC-project-group-chat-human-centered-conversation-mapping.md +326 -0
  89. package/docs/completed/SPEC-remove-cli-persona-bootstrap.md +201 -0
  90. package/docs/developer-workflow.md +49 -0
  91. package/docs/implementation/SPEC-codex-same-machine-session-handoff-implementation.md +239 -0
  92. package/docs/implementation/test-coverage-map.md +363 -0
  93. package/docs/implementation/work-ally-implementation-guide.md +790 -0
  94. package/docs/issues/README.md +10 -0
  95. package/docs/issues/pending/ANALYSIS-ally-premature-recovery-notice-and-task-state-semantics-2026-03-18.md +295 -0
  96. package/docs/issues/resolved/ANALYSIS-approval-waiting-visible-but-approval-artifact-missing-2026-03-16.md +466 -0
  97. package/docs/issues/resolved/ANALYSIS-blocking-state-visible-without-user-actionable-artifact-2026-03-16.md +261 -0
  98. package/docs/issues/resolved/ANALYSIS-codex-app-server-transport-disconnect-semantics-2026-03-14.md +606 -0
  99. package/docs/issues/resolved/ANALYSIS-premature-terminalization-on-fresh-thread-poll-and-object-error-leak-2026-03-16.md +348 -0
  100. package/docs/issues/resolved/ANALYSIS-runtime-turn-delivery-and-recovery-2026-03-14.md +603 -0
  101. package/docs/issues/resolved/ANALYSIS-self-test-gap-approval-waiting-visible-but-approval-artifact-missing-2026-03-16.md +166 -0
  102. package/docs/issues/resolved/ANALYSIS-self-test-gap-blocking-state-visible-without-user-actionable-artifact-2026-03-16.md +186 -0
  103. package/docs/issues/resolved/ANALYSIS-self-test-gap-premature-terminalization-on-fresh-thread-poll-and-object-error-leak-2026-03-16.md +166 -0
  104. package/docs/issues/resolved/REPORT-ally-runtime-turn-delivery-3b42fb8-2026-03-15.md +373 -0
  105. package/docs/manual-acceptance.md +127 -0
  106. package/docs/ops-runbook.md +44 -0
  107. package/docs/planning/FEATURE-memory-system.md +748 -0
  108. package/docs/planning/SPEC-active-turn-steer-and-context-compaction-visibility.md +269 -0
  109. package/docs/planning/SPEC-approval-rules-inheritance-and-local-validation-lane.md +450 -0
  110. package/docs/planning/SPEC-assistant-persona-bootstrap.md +199 -0
  111. package/docs/planning/SPEC-assistant-rename.md +610 -0
  112. package/docs/planning/SPEC-bridge-app-server-protocol-alignment.md +667 -0
  113. package/docs/planning/SPEC-claude-runtime-host-for-work-ally.md +434 -0
  114. package/docs/planning/SPEC-cli-feishu-codex-session-unification.md +236 -0
  115. package/docs/planning/SPEC-codex-same-machine-session-handoff.md +873 -0
  116. package/docs/planning/SPEC-feishu-reaction-shortcuts.md +282 -0
  117. package/docs/planning/SPEC-local-stable-release-boundary.md +166 -0
  118. package/docs/planning/SPEC-managed-thread-entry-and-surface-mobility.md +862 -0
  119. package/docs/planning/SPEC-minimal-bridge-semantics-and-user-visible-surface.md +362 -0
  120. package/docs/planning/SPEC-npm-alpha-distribution-and-install-first-release.md +222 -0
  121. package/docs/planning/SPEC-remove-websocket-runtime-transport.md +364 -0
  122. package/docs/planning/SPEC-runtime-abstraction-phase-1.md +424 -0
  123. package/docs/planning/SPEC-runtime-connection-and-turn-recovery-semantics.md +274 -0
  124. package/docs/planning/SPEC-session-presence-and-state-visibility.md +397 -0
  125. package/docs/planning/SPEC-skill-first-capability-packaging.md +338 -0
  126. package/docs/planning/SPEC-stable-archive-contract.md +456 -0
  127. package/docs/planning/SPEC-supervised-start-boundary.md +127 -0
  128. package/docs/planning/SPEC-user-barrier-reduction-and-activation.md +832 -0
  129. package/docs/planning/ally-next.md +1278 -0
  130. package/docs/planning/assistant-workbench-spec.md +725 -0
  131. package/docs/planning/product-workbench.md +283 -0
  132. package/docs/product-onboarding.md +227 -0
  133. package/docs/product-spec-standard.md +528 -0
  134. package/docs/troubleshooting.md +45 -0
  135. package/docs/user-quickstart.md +46 -0
  136. package/internal/dispatch.sh +95 -0
  137. package/internal/lib/common.sh +1450 -0
  138. package/internal/modules/assistant/manage.sh +1312 -0
  139. package/internal/modules/bootstrap/setup.sh +144 -0
  140. package/internal/modules/config/init-env.sh +10 -0
  141. package/internal/modules/global/manage.sh +154 -0
  142. package/internal/modules/handoff/manage.sh +54 -0
  143. package/internal/modules/mcp/manage.sh +83 -0
  144. package/internal/modules/ops/logs.sh +76 -0
  145. package/internal/modules/routines/manage.sh +55 -0
  146. package/internal/modules/runtime/assistant-autosave.sh +26 -0
  147. package/internal/modules/runtime/restart.sh +6 -0
  148. package/internal/modules/runtime/start.sh +283 -0
  149. package/internal/modules/runtime/status.sh +194 -0
  150. package/internal/modules/runtime/stop.sh +55 -0
  151. package/internal/modules/runtime/supervisor.sh +216 -0
  152. package/internal/modules/runtime/update.sh +26 -0
  153. package/package.json +41 -0
  154. package/runtime/config/.gitkeep +0 -0
  155. package/runtime/host/.gitkeep +0 -0
  156. package/runtime/host/healthcheck-codex-app-server.ts +22 -0
  157. package/runtime/host/ping-pong-codex-app-server.ts +66 -0
  158. package/runtime/host/probe-codex-app-server.ts +115 -0
  159. package/skills/archive-reader/SKILL.md +9 -0
  160. package/skills/feishu-production-debug/SKILL.md +37 -0
  161. package/skills/feishu-production-debug/references/feishu-debug-order.md +49 -0
  162. package/skills/feishu-production-debug/references/platform-permission-baseline.md +23 -0
  163. package/skills/issue-to-spec-triage/SKILL.md +44 -0
  164. package/skills/issue-to-spec-triage/references/triage-rules.md +66 -0
  165. package/skills/memory-digest/SKILL.md +9 -0
  166. package/skills/post-implementation-closure/SKILL.md +39 -0
  167. package/skills/post-implementation-closure/references/closure-checklist.md +45 -0
  168. package/skills/post-implementation-closure/references/doc-drift-map.md +49 -0
  169. package/skills/product-spec/SKILL.md +244 -0
  170. package/templates/env.example +5 -0
  171. package/templates/routines/nightly-memory-digest.yaml +10 -0
  172. package/templates/workspace/AGENTS.md +26 -0
@@ -0,0 +1,269 @@
1
+ # SPEC: Active Turn 默认 Steer 与 Context Compaction 可见性
2
+
3
+ 更新时间:2026-03-18
4
+ 状态:Shipped
5
+ Owner:work-ally product / engineering
6
+ 相关文档:
7
+ - `docs/planning/SPEC-bridge-app-server-protocol-alignment.md`
8
+ - `docs/planning/SPEC-session-presence-and-state-visibility.md`
9
+ - `PRODUCT.md`
10
+ - `AGENTS.md`
11
+
12
+ ## 1. Summary
13
+
14
+ 这是一条很小的协议收口型 feature,只做两件事:
15
+
16
+ 1. 当同一条 thread 仍有 active turn,且当前没有已对用户可见的 blocking request 时,用户新的普通自然语言输入默认走 `turn/steer`,不在 bridge 里再造 queue 模式。
17
+ 2. 当 Codex App Server 发出 `contextCompaction` item 时,若这条 turn 当前属于 `work-ally` 渠道侧可见工作流,bridge 诚实观测并发送一条轻量系统消息:`Codex 正在压缩当前会话上下文。`
18
+
19
+ 这不是新状态机,也不是一套“更聪明的中间层”。
20
+
21
+ 它的本质是把 `work-ally` 再往正确边界收紧一步:
22
+
23
+ > 官方已有稳定协议原语时,中间层默认直接复用;只补最小必要的产品可见性,不重做第二套语义。
24
+
25
+ ## 2. 背景
26
+
27
+ 目前有两个相邻问题。
28
+
29
+ ### 2.1 active turn 期间的新消息,产品合同还不够清楚
30
+
31
+ App Server 已提供:
32
+
33
+ - `turn/start`
34
+ - `turn/steer`
35
+ - `turn/interrupt`
36
+
37
+ 官方 CLI 的默认交互也更接近“运行中插话”,而不是“默认排队下一轮”。
38
+
39
+ 但如果 `work-ally` 在这里自己再加一层 queue / pending 队列 / 可配置模式,会把中间层做厚,并让用户多学一层并不必要的新概念。
40
+
41
+ ### 2.2 context compaction 是真实协议事实,但当前用户侧看不到
42
+
43
+ App Server 已经把 `contextCompaction` 暴露为协议 item。
44
+
45
+ 这意味着:
46
+
47
+ - Codex 正在压缩会话上下文,不再只是内部黑盒推测
48
+ - bridge 可以观测到这件事
49
+ - 如果用户正通过 Feishu / work-ally 渠道工作,中间层应诚实把这个事实轻量告诉用户
50
+
51
+ 但这件事不值得被做成重状态机或复杂面板;对话里一条克制系统消息就够了。
52
+
53
+ ## 3. 问题定义
54
+
55
+ 本专题要解决两个问题。
56
+
57
+ ### 3.1 busy follow-up 如果不拍板,工程实现容易继续分叉
58
+
59
+ 如果这里不明确规定默认行为,工程实现很容易在以下几种方向之间漂移:
60
+
61
+ - 本地 queue 一层
62
+ - 本地 busy gate 一层
63
+ - steer 一层
64
+ - 甚至再做用户配置
65
+
66
+ 结果是:
67
+
68
+ - 用户心智变复杂
69
+ - 中间层语义变厚
70
+ - 后续还要解释“到底什么时候 queue,什么时候 steer”
71
+
72
+ ### 3.2 context compaction 如果完全不可见,用户会误以为 assistant 卡住或失联
73
+
74
+ 当 Codex 压缩上下文时,用户可能看到:
75
+
76
+ - assistant 还在工作,但暂时没有新正文
77
+ - runtime 正常,只是内部在整理上下文
78
+
79
+ 如果 bridge 明明能观测到这个协议事实,却完全不说,用户很容易把它误解成:
80
+
81
+ - 卡住了
82
+ - 消息没送进去
83
+ - runtime 出异常了
84
+
85
+ ## 4. 目标
86
+
87
+ 本专题必须达成以下目标:
88
+
89
+ 1. 把 active turn 期间普通 follow-up 的默认路径拍板为 `turn/steer`。
90
+ 2. 明确这不是 queue feature,不新增 queue 模式、不新增用户配置。
91
+ 3. 当 App Server 发出 `contextCompaction` item 时,渠道侧能收到一条轻量系统消息。
92
+ 4. 文案保持克制,只表达协议事实,不扩成“中间层解释世界”。
93
+ 5. 保持 bridge 边界轻薄:复用官方协议原语,不重复发明第二套会话语义。
94
+
95
+ ## 5. 非目标
96
+
97
+ 本次明确不做:
98
+
99
+ 1. 不做 queue 模式。
100
+ 2. 不在用户面板里加入 `queue / steer` 配置。
101
+ 3. 不做 compaction 的完成提示、进度条、独立状态面板。
102
+ 4. 不把 compaction 事件上升成新的持久化工作流状态机。
103
+ 5. 不改写现有 approval / user-input blocking 合同。
104
+ 6. 不顺手扩写为“全面 runtime presence 重做”。
105
+
106
+ ## 6. 产品定义与用户路径
107
+
108
+ ### 6.1 一句话定义
109
+
110
+ `work-ally` 对 active turn follow-up 的默认产品定义是:
111
+
112
+ > 只要当前仍在同一条 active turn 上工作,且没有已经对用户可见的 blocking request,新的普通自然语言输入就默认作为“插话”进入当前 turn,而不是由 bridge 额外排队。
113
+
114
+ 同时:
115
+
116
+ > 当 Codex 自己开始压缩当前会话上下文时,bridge 只做诚实观测,并轻量通知用户一次。
117
+
118
+ ### 6.2 主路径 A:active turn 期间的新普通消息
119
+
120
+ 场景:
121
+
122
+ - 用户刚发过一条消息
123
+ - 当前 turn 仍在进行中
124
+ - 用户又补充一句自然语言
125
+
126
+ 路径:
127
+
128
+ 1. bridge 先判断这条输入不是 slash 命令。
129
+ 2. 如果当前存在 active turn,且当前没有已对用户可见的 approval / user-input blocking request,则默认调用 `turn/steer`。
130
+ 3. 新输入进入当前 turn,作为同一轮工作的 follow-up。
131
+ 4. bridge 不额外创建 queue,不向用户解释“这条先排队了”。
132
+
133
+ ### 6.3 主路径 B:发生 context compaction
134
+
135
+ 场景:
136
+
137
+ - 当前渠道侧有一条正在进行中的工作线程
138
+ - App Server 在该 turn 生命周期里发出 `contextCompaction` item
139
+
140
+ 路径:
141
+
142
+ 1. bridge 观测到 `contextCompaction` item started。
143
+ 2. 如果该 item 属于当前渠道侧可见 turn,则发送一条系统消息:`Codex 正在压缩当前会话上下文。`
144
+ 3. 该消息只表达事实,不追加额外解释,不额外开启新状态流。
145
+
146
+ ### 6.4 例外路径
147
+
148
+ 以下情况不走默认 steer:
149
+
150
+ 1. 输入是 slash 控制命令。
151
+ 2. 当前存在已对用户可见的 approval blocking request。
152
+ 3. 当前存在已对用户可见的 user-input blocking request。
153
+ 4. 当前不存在 active turn,此时正常走 `turn/start`。
154
+
155
+ ### 6.5 竞态回落
156
+
157
+ 如果 bridge 判断当前有 active turn,并尝试 `turn/steer`,但在真正调用时该 turn 已自然结束:
158
+
159
+ 1. bridge 可以做一次最小回落判断。
160
+ 2. 若当前 thread 已回到可继续 start 的状态,则将这条输入按正常新 turn 继续推进。
161
+ 3. 不因此引入本地 queue。
162
+
163
+ 要求:
164
+
165
+ - 这是一次协议竞态回落,不是 queue 语义。
166
+ - 文案不额外暴露内部细节,除非失败到用户可感知。
167
+
168
+ ## 7. 机制设计
169
+
170
+ ### 7.1 active turn follow-up 合同
171
+
172
+ 默认规则:
173
+
174
+ - `slash command`:仍由 bridge 本地消费。
175
+ - `visible blocking request reply`:仍走 approval / user-input 解析路径。
176
+ - `ordinary natural language`:
177
+ - 若存在 active turn,则优先 `turn/steer`
178
+ - 若不存在 active turn,则 `turn/start`
179
+
180
+ 这里的“存在 active turn”以 runtime / session 当前事实为准,不再额外引入本地 queue 状态。
181
+
182
+ ### 7.2 为什么不做 queue
183
+
184
+ 产品判断:
185
+
186
+ - queue 不是当前用户的真实问题。
187
+ - queue 会让用户开始思考“我刚刚那句到底是插话还是排队到下一轮”。
188
+ - queue 一旦开放成配置,又会引入更多解释、验证和 UI 成本。
189
+
190
+ 因此本期直接拍板:
191
+
192
+ - 默认 steer
193
+ - 不开放 queue
194
+ - 后续若真的出现稳定、明确、用户可感知的 queue 场景,再单独立 spec
195
+
196
+ ### 7.3 context compaction 通知合同
197
+
198
+ 触发条件:
199
+
200
+ - App Server 发出 `contextCompaction` item started
201
+ - 该 item 属于当前渠道侧正在进行、且用户可感知的一条工作 turn
202
+
203
+ 用户文案:
204
+
205
+ - `Codex 正在压缩当前会话上下文。`
206
+
207
+ 文案要求:
208
+
209
+ - 不写“自动”二字,避免对触发来源做超出协议事实的推断。
210
+ - 不写大段解释,不把它扩成帮助文档。
211
+ - 不追加“请稍候”这类低价值语气填充。
212
+
213
+ ### 7.4 去重与噪音控制
214
+
215
+ 为了避免 transport 抖动或重复事件导致刷屏,bridge 应做最小去重:
216
+
217
+ - 以 `threadId + turnId + itemId` 作为同一次 compaction 事件的去重键
218
+ - 同一个 compaction item 最多通知一次
219
+
220
+ 本期不要求把它做成长期 durable 账本;当前 turn 生命周期内的最小去重即可。
221
+
222
+ ### 7.5 与现有 state visibility 的关系
223
+
224
+ 这条通知不是新状态类别,只是对已有协议事实的一次轻量翻译。
225
+
226
+ 因此:
227
+
228
+ - 不新增 `compacting` 持久态
229
+ - 不要求 `/status` 先显示它
230
+ - 不改变“最终回复仍是主要结束信号”的原则
231
+
232
+ ## 8. 验收标准
233
+
234
+ 满足下面条件,才算完成:
235
+
236
+ 1. 当 active turn 存在且没有可见 blocking request 时,新的普通自然语言输入默认走 `turn/steer`。
237
+ 2. 当 active turn 不存在时,新的普通自然语言输入仍走 `turn/start`。
238
+ 3. 当存在可见 approval / user-input blocking request 时,bridge 不错误地把用户回复发成 steer。
239
+ 4. 当 App Server发出 `contextCompaction` item 时,渠道侧会收到系统消息:`Codex 正在压缩当前会话上下文。`
240
+ 5. 同一个 compaction item 不会重复通知多次。
241
+ 6. 实现中没有新增 queue 模式、没有新增用户配置项。
242
+
243
+ ## 9. 验证建议
244
+
245
+ 至少补齐下面验证:
246
+
247
+ - unit:active turn 下普通 follow-up 选择 `turn/steer` 的路由判断
248
+ - unit:visible blocking request 存在时,不走 steer
249
+ - integration:同一轮工作中第二条自然语言进入 steer 主路径
250
+ - integration:turn 在 steer 调用前自然结束时,最小回落到新 turn 的竞态路径
251
+ - integration:收到 `contextCompaction` item started 时,前台收到对应系统消息
252
+ - integration:重复 compaction 事件不会重复通知
253
+
254
+ ## 10. 风险 / 假设 / 待决问题
255
+
256
+ ### 10.1 风险
257
+
258
+ - 如果实现里对 active turn 的判断仍然混有旧 busy gate 语义,可能名义上说 steer,实际上仍被桥层提前拦截。
259
+ - 如果 compaction 事件与 channel 可见 turn 的关联关系没理清,可能会把不该前台可见的内部 turn 也通知出去。
260
+
261
+ ### 10.2 假设
262
+
263
+ - 当前 App Server 的 `contextCompaction` item 在 bridge 事件流中可稳定观测。
264
+ - 现有 session / turn ledger 已足够支撑最小去重键,不需要额外重型状态层。
265
+
266
+ ### 10.3 待决问题
267
+
268
+ 1. `/status` 是否需要在后续专题里顺手显示“最近一次 compaction 发生过”,本期不做。
269
+ 2. 若未来真的出现需要显式 queue 的用户场景,应另立 spec,而不是在本专题内偷扩。