From daac4cb1f946a98a239df7c1660af17121c40bc7 Mon Sep 17 00:00:00 2001 From: EMRG Evolution Date: Fri, 7 Aug 2026 22:17:11 +0800 Subject: [PATCH] =?UTF-8?q?emrg:=20evolution=5Fprompt=20quick-ref=20?= =?UTF-8?q?=E2=80=94=20add=20#553/#554=20entries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emrg/server/evolution_prompt.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emrg/server/evolution_prompt.md b/emrg/server/evolution_prompt.md index 8cb8de9..339ea91 100644 --- a/emrg/server/evolution_prompt.md +++ b/emrg/server/evolution_prompt.md @@ -342,6 +342,8 @@ When reading rants, follow these rules: > - GitHub PAT auth + setup-git (#548 GCM rant 10:17 Stage 2a:GUI 设置页 GitHub 连接区——github_connect daemon 命令(`gh auth login --with-token`,token 走 stdin 永不进 argv(防 ps 泄露);成功后 `gh auth setup-git` 让 git 用 gh 当 credential helper → push/pull/fetch 永不回退 GCM;复用 _check_github_auth 同解析器重验 user 单一事实源);github_disconnect(`gh auth logout --hostname github.com`);dispatch github_connect_result/disconnect_result 帧;GUI RESPONSE_TYPES/IPC/preload 全链路 + 15 条 zh/en i18n;+8 测试 534→542(含 stdin 送达断言固化"token 不进 argv")) ✅ > - GitHub device-flow auth (#549 GCM rant 10:17 Stage 2b:首选授权路径不开终端不弹 GCM——github_connect_web daemon 命令 spawn `gh auth login --web`(stdin=DEVNULL prompt-free,探针实证非 TTY 仍输出 code+URL),解析一次性 code + device URL 返 GUI;后台任务保活 gh 至授权完成/300s 超时 kill(proc 存 self,cancel 竞态直 kill 防泄漏——task.cancel() 对未启动 task 不执行 body);GUI 设置页无 token 优先 device flow + 新对话框(大号 code + shell.openExternal 开浏览器 + 3s github_status 轮询直至授权);PAT 仍为受限环境兜底;+6 测试 542→548) ✅ > - GitHub connect banner (#550 GCM rant 10:17 Stage 2c:演化计数增长(=演化刚产出需推 GitHub)且未认证时横幅提示"启用自进化需连接 GitHub → [去连接]"——挂钩 maybeShowEvolutionToast 增长检测点(每日 gate 前,每次增长都查);maybeShowGithubBanner 查 github_status 未认证则显示,[去连接] 打开设置页 GitHub 区,[关闭] 本会话不再弹;本地聊天不依赖 GitHub 启动不打扰;与 #548/#549 闭环(横幅→设置→device flow→已连接);GUI +1=92(正反两态 + seed hidden 判别 + 源码断言)) ✅ +> - Windows TUI Unicode input via ReadConsoleInputW (#553 rant 21:35:47 宿主实测 v0.2.11 中文 IME 仍乱码——#546 VT input 只解决功能键 ANSI 化,字符输入仍走 os.read 字节流按控制台输入代码页(中文系统 GBK/CP936)交付,UTF-8 假设输入链必乱;修复=win32.py 新增 ctypes INPUT_RECORD 结构(KEY_EVENT_RECORD 固定宽度 c_int/c_uint/c_ushort——wintypes.BOOL/DWORD 是 c_long/c_ulong,LP64 POSIX 8B 会把结构撑到 32/40B 而非 Win32 ABI 16/20B,须固定宽度+布局断言测试钉死)+ read_console_unicode(ReadConsoleInputW:UnicodeChar≠0→UTF-8 编码(IME 中文),==0→既有 _LEGACY_SCAN_TO_ANSI 扫描码表→ANSI CSI)+ flush_console_input(raw mode 入口清残余字节流)+ 纯函数 _key_event_to_bytes;app.py _win_stdin_loop 改宽字符路径(非阻塞+5ms 防忙轮询,POSIX 路径不动);win32 模块 POSIX 可导入(守卫 msvcrt/windll)→ 纯逻辑+模拟记录循环单测可移植(ctypes setattr 带点号路径静默 no-op 须逐段 get/set);+24 测试 548→572) ✅ +> - GUI interleaved text/tool message order (#554 rant 21:57:10 完整回合(LLM 文本+工具交替)显示顺序错乱:文本段全拼在顶部、工具行全堆下面(TUI 是顺序交错);根因=handleDelta 每 request_id 复用同一 assistant 节点而 handleToolStart 独立 append 工具行→后续文本段全落回第一个节点;修复=groupNodes 值改 {node,nodes,hasText,sealed}:handleToolStart 在组已有文本时封存当前段,handleDelta 遇 sealed 新建文本段节点(旧节点保留 DOM 原位),handleDone/clearTyping 遍历全段逐个渲染/清 typing;G104 工具先行(无文本)不封存→文本落既有节点防空泡;+1 smoke 测试(text,tool,text,tool,text 交错=5 节点独立成块,判别力实证=去 seal 逻辑即红/恢复即绿);doc GUI 91→93;npm test 93) ✅ #### 2.2 Latest GitHub code changes