femo-plugin 1.0.4 → 1.0.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.
- package/LICENSE +1 -1
- package/NOTICE +8 -0
- package/README.md +12 -1
- package/docs/ActiveRoadmaps/Func/345/201/234/346/255/242/350/257/255/344/271/211-/351/201/227/345/274/203/346/216/245/347/273/255-/346/226/275/345/267/245/346/270/205/345/215/225.md +91 -0
- package/docs/ActiveRoadmaps//345/217/214user/346/226/275/345/267/245/346/270/205/345/215/225.md +326 -0
- package/docs/Specs//346/212/225/345/275/261/344/270/255/345/277/203/350/241/214/345/215/217/350/256/256.md +616 -569
- package/femo2host/AGENTS.md +1 -1
- package/femo2host/femoGenConnector/engine-client.mjs +7 -2
- package/femo2host/femoGenConnector/file-dialogs.mjs +108 -2
- package/femo2host/femoToolcall/chronica.py +99 -19
- package/femo2host/femo_api.py +14 -1
- package/femo2host/host/actor-core.d.mts +25 -0
- package/femo2host/host/actor-core.mjs +72 -0
- package/femo2host/host/cast-core.d.mts +3 -0
- package/femo2host/host/cast-core.mjs +14 -0
- package/femo2host/host/daemon-client.mjs +59 -10
- package/femo2host/host/hub-render-core.d.mts +2 -0
- package/femo2host/host/hub-render-core.mjs +6 -2
- package/femo2host/host/run-state-core.d.mts +4 -0
- package/femo2host/host/run-state-core.mjs +4 -0
- package/femo2host/host/speech-core.mjs +11 -4
- package/femo2host/host/tools-core.d.mts +11 -0
- package/femo2host/host/tools-core.mjs +39 -0
- package/femo2host/mailbox.py +630 -545
- package/femo2host/projectionCenter/app.css +61 -0
- package/femo2host/projectionCenter/composer.mjs +233 -20
- package/femo2host/projectionCenter/identity.mjs +131 -0
- package/femo2host/projectionCenter/index.html +55 -1
- package/femo2host/projectionCenter/main.mjs +231 -35
- package/femo2host/projectionCenter/panels.mjs +108 -16
- package/femo2host/projectionCenter/render.mjs +813 -695
- package/femo2host/projectionCenter/state.mjs +30 -0
- package/femo2host/projectionCenter/util.mjs +28 -0
- package/femo2host/projection_hub.py +1796 -230
- package/femo2host/python/femo_bridge.py +303 -33
- package/femo2host/python/femo_daemon.py +1528 -1209
- package/femo2host/python/mirror_window.py +237 -0
- package/femoBridges/ContextExample.py +113 -71
- package/femoCompiler/AGENTS.md +1 -0
- package/femoCompiler/FEMO_parser.py +2641 -2567
- package/femoCompiler/FEMO_runtime.py +217 -44
- package/femoCompiler/FEMO_scope_resolver.py +26 -12
- package/femoCompiler/block_collector.py +24 -27
- package/femoCompiler/db_utils.py +560 -503
- package/femoCompiler/femoAsync.py +466 -436
- package/femoCompiler/func_registry.py +74 -0
- package/femoCompiler/protocol.py +127 -127
- package/femoCompiler/save_dialog.py +497 -446
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/AI/350/201/212/345/244/251/345/256/244-/345/270/246agent/347/211/210.femo +229 -142
- package/femoExamples/AI/350/201/212/345/244/251/345/256/244/random_wait_time.py +91 -2
- package/femoExamples/LuxFiat/luxfiat-loop.femo +0 -1
- package/femoExamples/LuxFiat/luxfiat-simple.femo +23 -24
- package/femoExamples/debug/347/245/236/345/231/250/debug/347/245/236/345/231/250.femo +221 -222
- package/femoExamples/discussion.femo +72 -72
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210-9/344/272/272/351/242/204/345/245/263/347/214/216.femo +1 -2
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200-/350/255/246/351/225/277/347/211/210.femo +1 -2
- package/femoExamples//347/213/274/344/272/272/346/235/200//347/213/274/344/272/272/346/235/200.femo +1 -2
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225-/350/217/234/345/270/202/345/234/272/345/261/200.femo +1 -1
- package/femoExamples//350/260/201/346/230/257/345/215/247/345/272/225//350/260/201/346/230/257/345/215/247/345/272/225.femo +1 -1
- package/femoGen/document_ch.html +1 -0
- package/femoGen/document_en.html +1 -0
- package/femoGen/index.html +1 -0
- package/femoGen/intro_ch.html +1 -0
- package/femoGen/intro_en.html +1 -0
- package/femoGen/package.json +7 -0
- package/femoGen/public/femo-logo-slogan.svg +5 -0
- package/femoGen/public/femo-logo.svg +6 -1
- package/femoGen/src/femoParser.jsx +14 -0
- package/hostAdapter/dshAdapter/host/femo-skill.ts +23 -10
- package/hostAdapter/dshAdapter/host/routes/projection-input.ts +3 -0
- package/hostAdapter/dshAdapter/lib/client.js +20 -2
- package/hostAdapter/dshAdapter/lib/client.js.map +2 -2
- package/hostAdapter/dshAdapter/lib/main.js +161 -18
- package/hostAdapter/dshAdapter/lib/main.js.map +3 -3
- package/hostAdapter/dshAdapter/package.json +11 -1
- package/hostAdapter/webAdapter/console/index.html +13 -4
- package/hostAdapter/webAdapter/extension/background.js +16 -5
- package/hostAdapter/webAdapter/extension/seat-agent-core.js +836 -791
- package/hostAdapter/webAdapter/extension/sidepanel/actors.mjs +101 -0
- package/hostAdapter/webAdapter/extension/sidepanel/main.mjs +81 -20
- package/hostAdapter/webAdapter/extension/sidepanel/reconnect.mjs +33 -0
- package/hostAdapter/webAdapter/extension/sidepanel/run-control.mjs +22 -11
- package/hostAdapter/webAdapter/extension/sidepanel/seats.mjs +6 -20
- package/hostAdapter/webAdapter/extension/sidepanel.html +31 -8
- package/hostAdapter/webAdapter/native/install-native-host.mjs +1 -0
- package/hostAdapter/webAdapter/native/register-core.mjs +69 -28
- package/hostAdapter/webAdapter/native/web-launcher.sh +37 -0
- package/hostAdapter/webAdapter/package.json +7 -0
- package/hostAdapter/webAdapter/readme.md +51 -10
- package/hostAdapter/webAdapter/server/bridge.mjs +1 -1
- package/hostAdapter/webAdapter/server/runtime.mjs +51 -5
- package/hostAdapter/webAdapter/server/seats.mjs +11 -6
- package/hostAdapter/webAdapter/server/service.mjs +108 -15
- package/hostAdapter/webAdapter/shared/seats-core.mjs +31 -6
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/SITE.md +7 -0
- package/hostAdapter/webAdapter/sites/chat.deepseek.com/content.js +83 -68
- package/hostAdapter/webAdapter/sites/chatglm.cn/inject.js +76 -4
- package/hostAdapter/webAdapter/sites/chatgpt.com/SITE.md +7 -1
- package/hostAdapter/webAdapter/sites/chatgpt.com/content.js +37 -5
- package/hostAdapter/webAdapter/sites/chatgpt.com/inject.js +40 -4
- package/hostAdapter/webAdapter/start-service.command +16 -0
- package/hostAdapter/webAdapter/tests/chatgpt-input.test.mjs +58 -0
- package/hostAdapter/webAdapter/tests/chatgpt-parser.test.mjs +37 -0
- package/hostAdapter/webAdapter/tests/deepseek-sanitize.test.mjs +68 -0
- package/hostAdapter/webAdapter/tests/runtime.test.mjs +42 -0
- package/hostAdapter/webAdapter/tests/seats-core.test.mjs +37 -1
- package/hostAdapter/webAdapter/tests/smoke-service.mjs +261 -232
- package/hostAdapter/zcodeAdapter/runtime/speech-collect.mjs +6 -0
- package/hostAdapter/zcodeAdapter/skills/femo/SKILL.md +3 -0
- package/hostAdapter/zcodeAdapter/tests/unbound-actors.test.mjs +51 -0
- package/package.json +7 -1
- package//350/257/255/346/263/225/346/226/207/346/241/243.md +1224 -1202
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
# -*- coding: utf-8 -*-
|
|
3
|
+
# mirror_window.py — FEMO 引擎日志镜窗(macOS / tkinter 版,2026-10-10)。
|
|
4
|
+
#
|
|
5
|
+
# 背景:原打算用 JXA(osascript -l JavaScript)驱 AppKit 造原生小窗,但在
|
|
6
|
+
# macOS 26 上实测该路不再渲染窗口(CGWindowListCopyWindowInfo 实测 bounds=0x0、
|
|
7
|
+
# 不进 onscreen 列表;同一台机器上 Swift / tkinter 窗口均正常)。故改用 Python
|
|
8
|
+
# 标准库 tkinter——与引擎同语言、零第三方依赖(tkinter 随 Python 发行)。本件由
|
|
9
|
+
# femo_daemon._LogMirrorWindowMac 以子进程方式拉起,契约与 Windows 版逐条对齐:
|
|
10
|
+
# · 200ms 跟随日志文件增量;单次灌入上限 CHUNK_MAX(防历史全量/日志爆发卡死),
|
|
11
|
+
# 窗内文本超 TRIM_CHARS 截头(镜像不是账本);日志被清/轮转自动清窗重头;
|
|
12
|
+
# · 显隐控制走 ctl 控制文件(daemon 写 'show'/'hide',本件每拍读并应用;
|
|
13
|
+
# 程序隐藏绝不等于关窗——「关窗=杀引擎」只归真人点红 X);
|
|
14
|
+
# · 用户点红 X:本件在 ctl 写 'closed' 后自退,daemon 守视线程据此 os._exit(0)
|
|
15
|
+
# (与 Win32 WM_DESTROY → os._exit 同一语义);
|
|
16
|
+
# · 引擎心跳:daemon 守视线程每秒往 .beat 追加一字节;本件每拍比文件长度,
|
|
17
|
+
# 超过 HEARTBEAT_MAX_TICKS 拍没变 = 引擎没了,孤儿窗安静自退(不陪死人)。
|
|
18
|
+
# 参数全部走环境变量(FEMO_MIRROR_LOG / FEMO_MIRROR_CTL / FEMO_MIRROR_PID),
|
|
19
|
+
# 无 argv 转义层;启动时 ctl='hide' 则不亮窗出生(闸的程序隐藏先于出生的竞态)。
|
|
20
|
+
import os
|
|
21
|
+
import sys
|
|
22
|
+
|
|
23
|
+
LOG_PATH = os.environ.get('FEMO_MIRROR_LOG', '')
|
|
24
|
+
CTL_PATH = os.environ.get('FEMO_MIRROR_CTL', '')
|
|
25
|
+
DAEMON_PID = os.environ.get('FEMO_MIRROR_PID', '?')
|
|
26
|
+
BEAT_PATH = CTL_PATH + '.beat'
|
|
27
|
+
|
|
28
|
+
POLL_MS = 200 # 跟随节拍,与 Win 版 200ms 一致
|
|
29
|
+
HEARTBEAT_MAX_TICKS = 75 # .beat 长度连续这么多拍没变 = 引擎没了(约 15s)
|
|
30
|
+
TRIM_CHARS = 200 * 1024 # 窗内文本上限(字符),与 Win 版 TRIM_LINES 精神一致
|
|
31
|
+
CHUNK_MAX = 256 * 1024 # 单次灌入上限(字节)——Win 版同款防卡死
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def read_text(path):
|
|
35
|
+
try:
|
|
36
|
+
with open(path, 'r', encoding='utf-8', errors='replace') as f:
|
|
37
|
+
return f.read()
|
|
38
|
+
except OSError:
|
|
39
|
+
return ''
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def write_text(path, text):
|
|
43
|
+
try:
|
|
44
|
+
with open(path, 'w', encoding='utf-8') as f:
|
|
45
|
+
f.write(text)
|
|
46
|
+
except OSError:
|
|
47
|
+
pass
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def file_size(path):
|
|
51
|
+
try:
|
|
52
|
+
return os.path.getsize(path)
|
|
53
|
+
except OSError:
|
|
54
|
+
return 0
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# ── Dock 图标同步(2026-10-10):tkinter 进程默认 Regular 型,Dock 里有 Python
|
|
58
|
+
# 图标。隐藏窗时顺带把图标藏掉、显示时再放回来(用户拍板)。用 stdlib 的 ctypes
|
|
59
|
+
# 调 Objective-C 运行时切 macOS 激活策略:Regular(0)=有 Dock 图标/菜单栏;
|
|
60
|
+
# Accessory(1)=无 Dock 图标(后台型,窗仍可显示)。不依赖 pyobjc。
|
|
61
|
+
_OBJC_LIB = None
|
|
62
|
+
_OBJC_TRIED = False
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def _objc():
|
|
66
|
+
"""惰性加载 libobjc + 选好函数签名(只试一次)。不可用返回 None。"""
|
|
67
|
+
global _OBJC_LIB, _OBJC_TRIED
|
|
68
|
+
if _OBJC_TRIED:
|
|
69
|
+
return _OBJC_LIB
|
|
70
|
+
_OBJC_TRIED = True
|
|
71
|
+
try:
|
|
72
|
+
import ctypes
|
|
73
|
+
import ctypes.util
|
|
74
|
+
lib = ctypes.cdll.LoadLibrary(ctypes.util.find_library('objc'))
|
|
75
|
+
lib.objc_getClass.restype = ctypes.c_void_p
|
|
76
|
+
lib.objc_getClass.argtypes = [ctypes.c_char_p]
|
|
77
|
+
lib.sel_registerName.restype = ctypes.c_void_p
|
|
78
|
+
lib.sel_registerName.argtypes = [ctypes.c_char_p]
|
|
79
|
+
_OBJC_LIB = lib
|
|
80
|
+
except Exception:
|
|
81
|
+
_OBJC_LIB = None
|
|
82
|
+
return _OBJC_LIB
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def set_dock_visible(visible):
|
|
86
|
+
"""切本进程激活策略:visible=True → Regular(0)(Dock 图标在);False →
|
|
87
|
+
Accessory(1)(Dock 图标隐)。必须主线程调用(Tk 主循环即主线程)。
|
|
88
|
+
失败安静降级——Dock 图标是脸面不是命,不影响窗本体。返回是否成功。"""
|
|
89
|
+
lib = _objc()
|
|
90
|
+
if lib is None:
|
|
91
|
+
return False
|
|
92
|
+
try:
|
|
93
|
+
import ctypes
|
|
94
|
+
NSApp = lib.objc_getClass(b'NSApplication')
|
|
95
|
+
lib.objc_msgSend.restype = ctypes.c_void_p
|
|
96
|
+
lib.objc_msgSend.argtypes = [ctypes.c_void_p, ctypes.c_void_p]
|
|
97
|
+
app = lib.objc_msgSend(NSApp, lib.sel_registerName(b'sharedApplication'))
|
|
98
|
+
if not app:
|
|
99
|
+
return False
|
|
100
|
+
lib.objc_msgSend.restype = ctypes.c_bool
|
|
101
|
+
lib.objc_msgSend.argtypes = [ctypes.c_void_p, ctypes.c_void_p, ctypes.c_long]
|
|
102
|
+
return bool(lib.objc_msgSend(
|
|
103
|
+
app, lib.sel_registerName(b'setActivationPolicy:'), 0 if visible else 1))
|
|
104
|
+
except Exception:
|
|
105
|
+
return False
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def main():
|
|
109
|
+
try:
|
|
110
|
+
import tkinter as tk
|
|
111
|
+
except Exception as exc: # 无 tkinter:响亮留痕并退出(窗是脸不是命)
|
|
112
|
+
sys.stderr.write('mirror_window: 无 tkinter(%s)——镜窗弃。\n' % exc)
|
|
113
|
+
return 2
|
|
114
|
+
|
|
115
|
+
root = tk.Tk()
|
|
116
|
+
root.title('FEMO 引擎常驻进程 pid=%s —— 关窗=杀引擎(会自动重生)' % DAEMON_PID)
|
|
117
|
+
root.geometry('1000x600')
|
|
118
|
+
root.minsize(360, 200)
|
|
119
|
+
root.configure(bg='#14100A') # 与 Win32 版同色系(深底暖白字)
|
|
120
|
+
|
|
121
|
+
txt = tk.Text(
|
|
122
|
+
root, bg='#14100A', fg='#E9DED8', font=('Menlo', 13),
|
|
123
|
+
wrap='none', insertbackground='#E9DED8',
|
|
124
|
+
highlightthickness=0, borderwidth=0, padx=8, pady=6)
|
|
125
|
+
txt.pack(fill='both', expand=True)
|
|
126
|
+
txt.configure(state='disabled')
|
|
127
|
+
|
|
128
|
+
st = {
|
|
129
|
+
'pos': 0, 'text_len': 0, 'applied': 'show',
|
|
130
|
+
'last_cmd': (read_text(CTL_PATH) or '').strip(),
|
|
131
|
+
'exiting': False, 'tick': 0,
|
|
132
|
+
'last_beat_len': -1, 'last_beat_tick': 0,
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
def close_window():
|
|
136
|
+
"""真人点红 X(或 close-test 端口)的唯一出口:写 'closed' 帧自退。
|
|
137
|
+
程序化隐藏走 withdraw(),完全不进这条路——天然区分「程序隐藏」与
|
|
138
|
+
「真人关窗」。daemon 守视线程读到 'closed' 即 os._exit(0)(关窗=杀引擎)。"""
|
|
139
|
+
if st['exiting']:
|
|
140
|
+
return
|
|
141
|
+
st['exiting'] = True
|
|
142
|
+
write_text(CTL_PATH, 'closed')
|
|
143
|
+
try:
|
|
144
|
+
root.destroy()
|
|
145
|
+
except Exception:
|
|
146
|
+
pass
|
|
147
|
+
|
|
148
|
+
root.protocol('WM_DELETE_WINDOW', close_window)
|
|
149
|
+
|
|
150
|
+
def pump_log():
|
|
151
|
+
try:
|
|
152
|
+
sz = os.path.getsize(LOG_PATH)
|
|
153
|
+
except OSError:
|
|
154
|
+
return
|
|
155
|
+
if sz < st['pos']: # 日志被清/轮转:清窗重头
|
|
156
|
+
st['pos'] = 0
|
|
157
|
+
st['text_len'] = 0
|
|
158
|
+
txt.configure(state='normal')
|
|
159
|
+
txt.delete('1.0', 'end')
|
|
160
|
+
txt.configure(state='disabled')
|
|
161
|
+
if sz == st['pos']:
|
|
162
|
+
return
|
|
163
|
+
try:
|
|
164
|
+
with open(LOG_PATH, 'rb') as f:
|
|
165
|
+
f.seek(st['pos'])
|
|
166
|
+
chunk = f.read(min(sz - st['pos'], CHUNK_MAX))
|
|
167
|
+
st['pos'] = f.tell()
|
|
168
|
+
except OSError:
|
|
169
|
+
return
|
|
170
|
+
if not chunk:
|
|
171
|
+
return
|
|
172
|
+
s = chunk.decode('utf-8', errors='replace')
|
|
173
|
+
txt.configure(state='normal')
|
|
174
|
+
txt.insert('end', s)
|
|
175
|
+
st['text_len'] += len(s)
|
|
176
|
+
if st['text_len'] > TRIM_CHARS: # 截头:镜像不是账本
|
|
177
|
+
excess = st['text_len'] - TRIM_CHARS
|
|
178
|
+
txt.delete('1.0', '1.0 + %dc' % excess)
|
|
179
|
+
st['text_len'] = TRIM_CHARS
|
|
180
|
+
txt.see('end')
|
|
181
|
+
txt.configure(state='disabled')
|
|
182
|
+
|
|
183
|
+
def tick():
|
|
184
|
+
if st['exiting']:
|
|
185
|
+
return
|
|
186
|
+
st['tick'] += 1
|
|
187
|
+
try:
|
|
188
|
+
cmd = (read_text(CTL_PATH) or '').strip()
|
|
189
|
+
if cmd != st['last_cmd']:
|
|
190
|
+
st['last_cmd'] = cmd
|
|
191
|
+
if cmd == 'hide':
|
|
192
|
+
root.withdraw()
|
|
193
|
+
set_dock_visible(False) # Dock 图标一并隐掉
|
|
194
|
+
st['applied'] = 'hide'
|
|
195
|
+
elif cmd == 'show':
|
|
196
|
+
set_dock_visible(True) # Dock 图标放回来
|
|
197
|
+
root.deiconify()
|
|
198
|
+
root.lift()
|
|
199
|
+
st['applied'] = 'show'
|
|
200
|
+
elif cmd == 'close-test':
|
|
201
|
+
close_window() # E2E:走真人红 X 完全相同的出口
|
|
202
|
+
return
|
|
203
|
+
# 孤儿自退:心跳停跳(只比 .beat 长度,不碰日期桥接)
|
|
204
|
+
bl = file_size(BEAT_PATH)
|
|
205
|
+
if bl != st['last_beat_len']:
|
|
206
|
+
st['last_beat_len'] = bl
|
|
207
|
+
st['last_beat_tick'] = st['tick']
|
|
208
|
+
if st['tick'] - st['last_beat_tick'] > HEARTBEAT_MAX_TICKS:
|
|
209
|
+
st['exiting'] = True
|
|
210
|
+
try:
|
|
211
|
+
root.destroy()
|
|
212
|
+
except Exception:
|
|
213
|
+
pass
|
|
214
|
+
return
|
|
215
|
+
pump_log()
|
|
216
|
+
except Exception:
|
|
217
|
+
pass # 窗是脸不是命:单拍失败吞掉
|
|
218
|
+
root.after(POLL_MS, tick)
|
|
219
|
+
|
|
220
|
+
if st['last_cmd'] == 'hide': # 出生即藏(闸已定隐藏)
|
|
221
|
+
root.withdraw()
|
|
222
|
+
set_dock_visible(False) # Dock 图标同步藏起来
|
|
223
|
+
st['applied'] = 'hide'
|
|
224
|
+
else: # 出生即亮(闸只在愿显示时创建本窗)
|
|
225
|
+
set_dock_visible(True) # 出生有 Dock 图标
|
|
226
|
+
st['applied'] = 'show'
|
|
227
|
+
|
|
228
|
+
root.after(POLL_MS, tick)
|
|
229
|
+
try:
|
|
230
|
+
root.mainloop()
|
|
231
|
+
except Exception:
|
|
232
|
+
pass
|
|
233
|
+
return 0
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
if __name__ == '__main__':
|
|
237
|
+
sys.exit(main())
|
|
@@ -109,19 +109,32 @@ def _get_records_visible_to(
|
|
|
109
109
|
max_turns: int = 20,
|
|
110
110
|
offset: int = 0,
|
|
111
111
|
after_turn: Optional[int] = None,
|
|
112
|
+
actor_ids: List[str] = None,
|
|
112
113
|
) -> List[Dict[str, Any]]:
|
|
113
114
|
"""获取指定 user 或 soul 可见的对话记录(仅当前 session)。
|
|
114
115
|
|
|
115
116
|
after_turn:只取 turn_id > after_turn 的行(增量窗口;None=不过滤)。
|
|
117
|
+
|
|
118
|
+
【actor_scope 第三通道(2026-10-11 双user 刀A)】作者拍板可见性三本账:
|
|
119
|
+
戏内可见性归 actor_scope 和 soul_scope(scope 写了谁就存谁);user_scope
|
|
120
|
+
是参与权存证(哪个人类用户拥有或参与了这段记录),不参与戏内可见性判定。
|
|
121
|
+
行分两代:
|
|
122
|
+
· 旧行(actor_scope 列为空串,列补列前的存量)——完全走旧口径(提问者
|
|
123
|
+
全裸=全可见;user/soul 两通道),行为零变化;
|
|
124
|
+
· 新行(actor_scope 恒为 JSON 数组,'[]' 也是)——三 scope 全空=全员
|
|
125
|
+
可见(作者拍板);否则按 soul/actor 两通道判(提问者 soul ∈ 行
|
|
126
|
+
soul_scope,或提问者 @ 名 ∈ 行 actor_scope)。
|
|
116
127
|
"""
|
|
117
128
|
user_ids = user_ids or []
|
|
118
129
|
soul_ids = soul_ids or []
|
|
130
|
+
actor_ids = actor_ids or []
|
|
119
131
|
conn = _get_conn()
|
|
120
132
|
results = []
|
|
121
133
|
|
|
122
134
|
query = """
|
|
123
135
|
SELECT session_id, turn_id, oratio_idx, user_prompt AS content,
|
|
124
|
-
timestamp, user_id, soul_id, user_scope, soul_scope,
|
|
136
|
+
timestamp, user_id, soul_id, user_scope, soul_scope, actor_scope,
|
|
137
|
+
actor,
|
|
125
138
|
'human' AS source
|
|
126
139
|
FROM dialog
|
|
127
140
|
"""
|
|
@@ -136,26 +149,36 @@ def _get_records_visible_to(
|
|
|
136
149
|
query += " WHERE " + " AND ".join(conditions)
|
|
137
150
|
query += " ORDER BY session_id, turn_id, oratio_idx DESC"
|
|
138
151
|
|
|
152
|
+
def _visible(row) -> bool:
|
|
153
|
+
"""行可见性判定(dialog / react 两表共用一份,防两处漂移)。"""
|
|
154
|
+
row_user = parse_scope_field(row["user_scope"] or "[]")
|
|
155
|
+
row_soul = parse_scope_field(row["soul_scope"] or "[]")
|
|
156
|
+
row_actor_raw = row["actor_scope"] if "actor_scope" in row.keys() else ''
|
|
157
|
+
row_actor = parse_scope_field(row_actor_raw or "[]")
|
|
158
|
+
if not row_actor_raw:
|
|
159
|
+
# 旧行(补列前落库):旧口径原样——提问者全裸=全可见;user/soul 匹配。
|
|
160
|
+
no_filter = not user_ids and not soul_ids
|
|
161
|
+
match_user = user_ids and ids_match_scope(row_user, user_ids)
|
|
162
|
+
match_soul = soul_ids and ids_match_scope(row_soul, soul_ids)
|
|
163
|
+
return no_filter or bool(match_user) or bool(match_soul)
|
|
164
|
+
# 新行:三 scope 全空=全员可见;否则 soul/actor 两通道(user 维度是
|
|
165
|
+
# 参与权存证,不判戏内可见性——作者拍板「戏内可见性归 Actor 和 Soul」)。
|
|
166
|
+
if not row_user and not row_soul and not row_actor:
|
|
167
|
+
return True
|
|
168
|
+
match_soul = soul_ids and ids_match_scope(row_soul, soul_ids)
|
|
169
|
+
match_actor = actor_ids and ids_match_scope(row_actor, actor_ids)
|
|
170
|
+
return bool(match_soul) or bool(match_actor)
|
|
171
|
+
|
|
139
172
|
cursor = conn.execute(query, params)
|
|
140
173
|
for row in cursor:
|
|
141
|
-
|
|
142
|
-
soul_scope = parse_scope_field(row["soul_scope"] or "[]")
|
|
143
|
-
# 无 user 无 soul(裸 actor):不过滤——本 session 全部记录可见
|
|
144
|
-
# (无角色设定 = 无隔离;有 user/soul 时行为不变)。
|
|
145
|
-
no_filter = not user_ids and not soul_ids
|
|
146
|
-
match_user = user_ids and ids_match_scope(user_scope, user_ids)
|
|
147
|
-
match_soul = soul_ids and ids_match_scope(soul_scope, soul_ids)
|
|
148
|
-
print(f"[ctx-dbg] dialog turn={row['turn_id']} src={row['source']} "
|
|
149
|
-
f"u_scope={user_scope} s_scope={soul_scope} "
|
|
150
|
-
f"ask_u={user_ids} ask_s={soul_ids} no_filter={no_filter} "
|
|
151
|
-
f"match_user={match_user} match_soul={match_soul}")
|
|
152
|
-
if no_filter or match_user or match_soul:
|
|
174
|
+
if _visible(row):
|
|
153
175
|
results.append(dict(row))
|
|
154
176
|
|
|
155
177
|
if include_ai:
|
|
156
178
|
query2 = """
|
|
157
179
|
SELECT session_id, turn_id, step_idx, response AS content,
|
|
158
|
-
timestamp, soul_id, user_scope, soul_scope,
|
|
180
|
+
timestamp, soul_id, user_scope, soul_scope, actor_scope,
|
|
181
|
+
actor,
|
|
159
182
|
cot, tool_call, tool_result,
|
|
160
183
|
'ai' AS source
|
|
161
184
|
FROM react_steps
|
|
@@ -166,16 +189,7 @@ def _get_records_visible_to(
|
|
|
166
189
|
|
|
167
190
|
cursor2 = conn.execute(query2, params)
|
|
168
191
|
for row in cursor2:
|
|
169
|
-
|
|
170
|
-
soul_scope = parse_scope_field(row["soul_scope"] or "[]")
|
|
171
|
-
no_filter = not user_ids and not soul_ids
|
|
172
|
-
match_user = user_ids and ids_match_scope(user_scope, user_ids)
|
|
173
|
-
match_soul = soul_ids and ids_match_scope(soul_scope, soul_ids)
|
|
174
|
-
print(f"[ctx-dbg] react turn={row['turn_id']} src={row['source']} "
|
|
175
|
-
f"u_scope={user_scope} s_scope={soul_scope} "
|
|
176
|
-
f"ask_u={user_ids} ask_s={soul_ids} no_filter={no_filter} "
|
|
177
|
-
f"match_user={match_user} match_soul={match_soul}")
|
|
178
|
-
if no_filter or match_user or match_soul:
|
|
192
|
+
if _visible(row):
|
|
179
193
|
results.append(dict(row))
|
|
180
194
|
|
|
181
195
|
conn.close()
|
|
@@ -211,15 +225,21 @@ def _get_records_visible_to(
|
|
|
211
225
|
|
|
212
226
|
|
|
213
227
|
def _actor_scope_ids(actor_info: dict) -> tuple:
|
|
214
|
-
"""从 actor_info 提取 (user_ids, soul_ids)
|
|
228
|
+
"""从 actor_info 提取 (user_ids, soul_ids, actor_ids) 提问者身份。
|
|
229
|
+
|
|
230
|
+
actor_ids(2026-10-11 双user 刀A):@ 全名(actor_info['actor'],引擎拼
|
|
231
|
+
actor_info 时随行)——读侧 actor_scope 匹配的钥匙,AI 人类都有。"""
|
|
215
232
|
user_ids = []
|
|
216
233
|
soul_ids = []
|
|
234
|
+
actor_ids = []
|
|
217
235
|
info = actor_info or {}
|
|
218
236
|
if "user" in info:
|
|
219
237
|
user_ids.append(str(info["user"]))
|
|
220
238
|
if "soul" in info:
|
|
221
239
|
soul_ids.append(str(info["soul"]))
|
|
222
|
-
|
|
240
|
+
if info.get("actor"):
|
|
241
|
+
actor_ids.append(str(info["actor"]))
|
|
242
|
+
return user_ids, soul_ids, actor_ids
|
|
223
243
|
|
|
224
244
|
|
|
225
245
|
def _last_speech_turn(session_id: int, soul_id: str) -> Optional[int]:
|
|
@@ -252,7 +272,9 @@ def _render_context(records: List[Dict[str, Any]], soul_ids: List[str],
|
|
|
252
272
|
单名(原行为)。
|
|
253
273
|
|
|
254
274
|
as_json=True:结构化形态——发言条目列表的 JSON 串(ensure_ascii=False)。
|
|
255
|
-
每条 {"
|
|
275
|
+
每条 {"actor", "soul_name", "steps": [...]}(2026-10-11 刀H 定稿:第一格=
|
|
276
|
+
剧本 actor 名,第二格=soul_name 位——AI 的 soul 名 / 人类的绑定 user 显示
|
|
277
|
+
名;soul id 不再进上下文);steps = 该发言的逐轮轨迹:
|
|
256
278
|
- dialog 行(旁白/提醒/人类输入)天然单轮 → steps 只有一个
|
|
257
279
|
{"response": 内容};
|
|
258
280
|
- AI 发言按 react 轮逐轮展开,每轮 {"cot"?, "tool_call"?, "tool_result"?,
|
|
@@ -293,47 +315,58 @@ def _render_context(records: List[Dict[str, Any]], soul_ids: List[str],
|
|
|
293
315
|
return s
|
|
294
316
|
return str(raw)
|
|
295
317
|
|
|
296
|
-
def
|
|
318
|
+
def get_names(record):
|
|
319
|
+
"""条目双名拆分(2026-10-11 用户拍板,刀H):返回 (actor, soul_name)。
|
|
320
|
+
actor=剧本里的 actor 名(Chronica actor 列直读;旧行/列空回退 actors_def
|
|
321
|
+
的角色映射;没有就是空串)。soul_name 位:AI=soul 的 soul_name(无绑定
|
|
322
|
+
soul 或 soul 无名=空);人类=绑定 user 的 user_name(无绑定/无名=空)。
|
|
323
|
+
soul id 不再进上下文(用户拍板「不显示 soul id」)。返回 None=整条不进
|
|
324
|
+
(引擎内部行:femo-/femoshow- 前缀之外的 femo- 系)。"""
|
|
325
|
+
row_actor = ""
|
|
326
|
+
try:
|
|
327
|
+
if "actor" in record.keys():
|
|
328
|
+
row_actor = str(record.get("actor") or "").strip()
|
|
329
|
+
except AttributeError:
|
|
330
|
+
row_actor = str(record.get("actor") or "").strip()
|
|
297
331
|
source = record.get("source")
|
|
298
332
|
if source == "human":
|
|
299
333
|
uid = _parse_first_id(record.get("user_id"))
|
|
300
334
|
row_soul = _parse_first_id(record.get("soul_id", ""))
|
|
301
|
-
# 角色名:先按行 user_id 认领(source 落库行),再按行 soul_id 兜底
|
|
302
|
-
# (无 source 回退 owner 的行)——人类角色自己的行两种键都可能带。
|
|
303
|
-
role = (human_user_map.get(uid) if uid else None) \
|
|
304
|
-
or (human_soul_map.get(row_soul) if row_soul else None)
|
|
305
|
-
if not uid and not row_soul:
|
|
306
|
-
return _dual_name(role, "用户")
|
|
307
335
|
if uid and uid.startswith('femoshow-'):
|
|
308
|
-
return "[节点提醒]"
|
|
336
|
+
return ("[节点提醒]", "")
|
|
309
337
|
if uid and uid.startswith('femo-'):
|
|
310
338
|
return None
|
|
311
|
-
#
|
|
312
|
-
#
|
|
313
|
-
if
|
|
314
|
-
if row_soul
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
339
|
+
# actor:Chronica 列直读优先;旧行回退 actors_def 认领(先按行
|
|
340
|
+
# user_id,再按行 soul_id——无 source 回退 owner 的行两种键都可能带)
|
|
341
|
+
role = (human_user_map.get(uid) if uid else None) \
|
|
342
|
+
or (human_soul_map.get(row_soul) if row_soul else None)
|
|
343
|
+
actor = row_actor or role or ""
|
|
344
|
+
# 第二个显示位:人类读绑定 user 的 user_name(用户拍板「有绑定 user
|
|
345
|
+
# 就显示 user name,没绑定或没写 name 就留空」)
|
|
346
|
+
soul_disp = ""
|
|
347
|
+
if uid:
|
|
348
|
+
if uid not in name_cache:
|
|
349
|
+
user = get_user_by_id(uid)
|
|
350
|
+
name_cache[uid] = str((user or {}).get("user_name") or "").strip()
|
|
351
|
+
soul_disp = name_cache[uid]
|
|
352
|
+
return (actor, soul_disp)
|
|
322
353
|
else: # ai
|
|
323
354
|
sid = _parse_first_id(record.get("soul_id"))
|
|
324
355
|
if not sid:
|
|
325
|
-
# 裸角色行(无 soul
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
356
|
+
# 裸角色行(无 soul):无键可认领,actor 尽量给(列上有就上)
|
|
357
|
+
return (row_actor, "")
|
|
358
|
+
# actor:Chronica 列直读优先(台词行记执行者角色名);旧行回退
|
|
359
|
+
# actors_def 的 soul→角色 映射(source:main 裸天使走 'main' 键)
|
|
360
|
+
actor = row_actor or str(ai_soul_map.get(sid) or "")
|
|
361
|
+
# 第二个显示位:soul 的 soul_name(用户拍板「有绑定 soul 就显示
|
|
362
|
+
# soul name,没绑定或这个 soul 没有 name 就留空」)——source:main
|
|
363
|
+
# 伪 soul 无角色卡,旧版强显 'main' 的兜底退役,留空。
|
|
364
|
+
soul_disp = ""
|
|
333
365
|
if sid not in name_cache:
|
|
334
366
|
soul = get_soul_by_id(sid)
|
|
335
|
-
name_cache[sid] = soul.get("soul_name"
|
|
336
|
-
|
|
367
|
+
name_cache[sid] = str((soul or {}).get("soul_name") or "").strip()
|
|
368
|
+
soul_disp = name_cache[sid]
|
|
369
|
+
return (actor, soul_disp)
|
|
337
370
|
|
|
338
371
|
def _is_self(row):
|
|
339
372
|
row_soul = str(row.get("soul_id") or "")
|
|
@@ -347,26 +380,29 @@ def _render_context(records: List[Dict[str, Any]], soul_ids: List[str],
|
|
|
347
380
|
items = []
|
|
348
381
|
seq = 0
|
|
349
382
|
for r in records:
|
|
350
|
-
|
|
351
|
-
if
|
|
383
|
+
names = get_names(r)
|
|
384
|
+
if names is None:
|
|
352
385
|
continue
|
|
353
386
|
ts = r.get("timestamp", 0) or 0
|
|
354
387
|
turn = r.get("turn_id", 0) or 0
|
|
355
388
|
if r.get("source") == "ai":
|
|
356
389
|
key = (turn, str(r.get("soul_id") or ""))
|
|
357
|
-
g = ai_groups.setdefault(key, {"rows": [], "ts": ts, "
|
|
390
|
+
g = ai_groups.setdefault(key, {"rows": [], "ts": ts, "names": names, "self": _is_self(r)})
|
|
358
391
|
g["rows"].append(r)
|
|
359
392
|
g["ts"] = min(g["ts"], ts)
|
|
360
393
|
else:
|
|
361
394
|
entry = {
|
|
362
|
-
|
|
363
|
-
|
|
395
|
+
# 刀H 条目形状(2026-10-11 用户拍板):第一格=actor name(剧本
|
|
396
|
+
# 角色名),第二格=soul_name 位(人类=user 显示名)——soul id
|
|
397
|
+
# 不再进上下文。
|
|
398
|
+
"actor": names[0],
|
|
399
|
+
"soul_name": names[1],
|
|
364
400
|
# 统一条目形状(2026-09-13 v2):一切发言都是 steps——dialog 行
|
|
365
401
|
# (旁白/提醒/人类输入)天然单轮,AI 行见下方逐 react 轮展开。
|
|
366
402
|
"steps": [{"response": r.get("content", "")}],
|
|
367
403
|
}
|
|
368
404
|
# femoshow-* 行 = 节点提醒(showprompt 的落库形态)——文本形态渲染成
|
|
369
|
-
# [节点提醒] 前缀(
|
|
405
|
+
# [节点提醒] 前缀(get_names 已返回),JSON 形态加标记位供消费方识别。
|
|
370
406
|
if str(r.get("user_id") or "").startswith("femoshow-"):
|
|
371
407
|
entry["showprompt"] = True
|
|
372
408
|
items.append((turn, ts, r.get("oratio_idx", 0) or 0, seq, entry, None))
|
|
@@ -411,7 +447,7 @@ def _render_context(records: List[Dict[str, Any]], soul_ids: List[str],
|
|
|
411
447
|
steps.append(step)
|
|
412
448
|
if not rounds:
|
|
413
449
|
continue
|
|
414
|
-
entry = {"
|
|
450
|
+
entry = {"actor": g["names"][0], "soul_name": g["names"][1], "steps": steps}
|
|
415
451
|
# idx 取大数:同一 turn 内 react 块永远排在 prompt/show/人类输入之后
|
|
416
452
|
items.append((key[0], g["ts"], 10 ** 9, seq, entry, rounds))
|
|
417
453
|
seq += 1
|
|
@@ -420,10 +456,13 @@ def _render_context(records: List[Dict[str, Any]], soul_ids: List[str],
|
|
|
420
456
|
return json.dumps([it[4] for it in items], ensure_ascii=False)
|
|
421
457
|
lines = []
|
|
422
458
|
for _, _, _, _, entry, rounds in items:
|
|
459
|
+
# 文本形态双名拼装沿用旧观感(刀H:条目改存 actor/soul_name 两格,
|
|
460
|
+
# 双名 = '@角色(显示名)';两格全空才退简洁兜底——兼容壳路径用)
|
|
461
|
+
nm = _dual_name(entry.get('actor', ''), entry.get('soul_name', '')) or '未署名'
|
|
423
462
|
if rounds is None:
|
|
424
|
-
lines.append(f"[{
|
|
463
|
+
lines.append(f"[{nm}]:\n{entry['steps'][0]['response']}")
|
|
425
464
|
else:
|
|
426
|
-
lines.append(f"[{
|
|
465
|
+
lines.append(f"[{nm}]:\n" + "\n\n".join(rounds))
|
|
427
466
|
return "\n\n".join(lines)
|
|
428
467
|
|
|
429
468
|
|
|
@@ -530,7 +569,7 @@ def _fetch_visible(session_id: int, actor_info: dict, mode: str):
|
|
|
530
569
|
full=从头全量(原有行为,不动游标不剔除自己);incremental/FFTI=交付
|
|
531
570
|
游标之后(缺键查库定起点,无既往发言=从头),窗口剔除自己、交付后推
|
|
532
571
|
游标。返回 (records, soul_ids)。"""
|
|
533
|
-
user_ids, soul_ids = _actor_scope_ids(actor_info)
|
|
572
|
+
user_ids, soul_ids, actor_ids = _actor_scope_ids(actor_info)
|
|
534
573
|
ask_soul = soul_ids[0] if soul_ids else ''
|
|
535
574
|
track = mode in (MODE_INCREMENTAL, MODE_FIRST_FULL_THEN_INCREMENTAL)
|
|
536
575
|
after_turn = _delivery_cursor(session_id, ask_soul) if track else None
|
|
@@ -541,6 +580,7 @@ def _fetch_visible(session_id: int, actor_info: dict, mode: str):
|
|
|
541
580
|
include_ai=True,
|
|
542
581
|
max_turns=999999, # 足够大的数,取所有记录
|
|
543
582
|
after_turn=after_turn, # 增量窗口=交付游标(2026-09-16 修:算了没传=增量恒全量)
|
|
583
|
+
actor_ids=actor_ids if actor_ids else None,
|
|
544
584
|
)
|
|
545
585
|
if not track:
|
|
546
586
|
return records, soul_ids
|
|
@@ -626,7 +666,7 @@ def resolve_context_mode(session_id: int, actor_info: dict, mode: str) -> str:
|
|
|
626
666
|
带 system 层,之后增量只带增量面(2026-09-13 上下文 JSON 化配套)。"""
|
|
627
667
|
if mode != MODE_FIRST_FULL_THEN_INCREMENTAL:
|
|
628
668
|
return mode
|
|
629
|
-
|
|
669
|
+
_u, soul_ids, _a = _actor_scope_ids(actor_info or {})
|
|
630
670
|
ask_soul = soul_ids[0] if soul_ids else ''
|
|
631
671
|
return MODE_FULL if _last_speech_turn(session_id, ask_soul) is None else MODE_INCREMENTAL
|
|
632
672
|
|
|
@@ -634,10 +674,12 @@ def resolve_context_mode(session_id: int, actor_info: dict, mode: str) -> str:
|
|
|
634
674
|
def build_session_context_json(session_id: int, actor_info: dict,
|
|
635
675
|
mode: str = MODE_FULL,
|
|
636
676
|
actors_def: dict = None) -> str:
|
|
637
|
-
"""build_session_context 的 JSON 形态(2026-09-13 上下文 JSON
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
677
|
+
"""build_session_context 的 JSON 形态(2026-09-13 上下文 JSON 化;
|
|
678
|
+
2026-10-11 刀H 条目改 {"actor", "soul_name", "steps"}):返回发言条目列表
|
|
679
|
+
的 JSON 串,actor=剧本角色名、soul_name 位=AI 的 soul 名 / 人类的绑定
|
|
680
|
+
user 显示名(soul id 不再进上下文)——steps 为逐轮轨迹(dialog 行单轮;
|
|
681
|
+
AI 行按 react 轮展开,每轮 cot / tool_call / tool_result / response 按键
|
|
682
|
+
存在性表达 VISIBILITY)。
|
|
641
683
|
mode 语义与 build_session_context 完全一致;未知 mode 同样硬报错。"""
|
|
642
684
|
if mode not in _KNOWN_MODES:
|
|
643
685
|
raise ValueError(
|
package/femoCompiler/AGENTS.md
CHANGED
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
## 四、变量世界:声明说了算,分支各拿各的副本,汇合按规矩合并
|
|
56
56
|
|
|
57
57
|
- **声明表是唯一权威**。一切读写先查声明,未声明读写一律响亮报错——不猜、不现建、不默认空值。这条在变量世界格外较真:静默兜底的变量错误会沿着上下文传给下游每一个角色,戏演歪了没人知道歪在哪。
|
|
58
|
+
- **@actor 变量的名字永远带着 @(2026-10-10 拍板)**:@ 打头的变量名,@ 就是名字的第一个字,不是可摘可戴的记号——任何地方都不要把它开头那个 @ 摘掉,任何地方也不要反过来给名字补上 @,它一直在变量名开头就好,不用去也不用加。写码时把 @ 当成名字里的一个字母:查它、存它、传它、比它,全带着 @ 来。(作者原话:「你就当@是个字母,是名字的一部分。就像你不会把Alice的A去掉改成lice,你也不能把@玩家1的@去掉改成玩家1。」)立这条的道理:随手「剥个前缀再比对」的小聪明一多,同一个名字在不同环节各长一个样,账就对不上,还查不出是哪半路改的装。名字的正身只在声明表里存着那一份,其余环节只许原样传递,不许修整。
|
|
58
59
|
- **fork 的语义(宪法 1.1)**:一个 task 分叉,母 task 即终止(在变量世界层面不再存在),每个孩子拿一份**值副本**(深拷贝)。深拷贝失败(变量里存了文件句柄之类)响亮报错,绝不静默退化成共享引用——「分支串值」正是当年要根治的坑:两个分支改同一个对象,互相污染还查无实据。连带的设计要求写在报错文案里:变量中不该存不可拷贝的对象,要存就存它的描述(路径、id)。
|
|
59
60
|
- **join 的语义,与 fork 完全解耦(拍板)**:fork 只管分叉,后面有没有 join 与它无关;join 只管收拢——到达的 task 签到交出自己的环境,凑齐后合并出**新 task**,由最后到达的协程「变身」携带新世界从 join 出口继续,出口节点只跑一遍,其余到达者终止。等待集不认 fork 配对,按流程图拓扑反溯(沿 join 的入边反向收集上游分叉点与嵌套 join)——所以作者随便嵌套,fork 前不见 join、join 后不见 fork,编译期不做任何配对限制。
|
|
60
61
|
- **凑齐判定是 task 维度的「签到 ∪ 已终止」**:自然死亡的分支不用等(其对变量的修改丢弃、发 join_missed 警告)。这条判定防的是 join(all) 死等——作者的分支可能死路走尽,引擎不能陪葬。配合上一条:分叉点哪怕一个分支都没活下来,也算「已发生」,不会让下游 join 白等。
|