From 9bb170b8e6d90e0207c715613d05e52b04ac25db Mon Sep 17 00:00:00 2001 From: argszero Date: Sun, 9 Aug 2026 10:03:54 +0800 Subject: [PATCH] =?UTF-8?q?emrg:=20evolution=5Fprompt=20quick-ref=20?= =?UTF-8?q?=E2=80=94=20add=20#589=20G129=20stale-check=20exception=20narro?= =?UTF-8?q?wing=20entry?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- emrg/server/evolution_prompt.md | 1 + 1 file changed, 1 insertion(+) diff --git a/emrg/server/evolution_prompt.md b/emrg/server/evolution_prompt.md index 43c8bad..f0027dd 100644 --- a/emrg/server/evolution_prompt.md +++ b/emrg/server/evolution_prompt.md @@ -363,6 +363,7 @@ When reading rants, follow these rules: > - GUI test port-file isolation + scheduler connect-failure alert (#583 外部贡献 pm25coder,G129 rant 2026-08-09T08:03:46:Windows 测试 setupTempHome 只设 HOME 不设 USERPROFILE,os.homedir() 仍读 USERPROFILE → 假 port/token 写进真实 ~/.emrg/emrgd.port → 演化周期 10h 连不上 daemon(WinError 1225);修复=①daemon_client.js PORT_FILE(projectDir=os.homedir()) 参数化,全部调用点传 this.projectDir,生产默认不变;②测试隔离守卫 assertPortFileInTmp(写 port 文件前断言路径在 tmpHome 内)+ setupTempHome 一并重定向 USERPROFILE;③integration findPython 上溯 3 级(test→gui→emrg→仓库根,此前 2 级解析到 emrg/ 包目录找不到 .venv → 回退 PATH 损坏 python.exe);④scheduler `_CONNECT_FAIL_ALERT=3` 连续连接失败计数器:达阈值 WARNING→ERROR 升级 + 可操作提示(检查 emrgd.port),成功连接归零,失败不写 log 不计空循环;⑤doc-count guard 纳入 README.cn.md(CJK 全角括号/「N 项」归一化);+2 pytest 634→636,GUI 96 全绿) ✅ > - Saturation halt → low-frequency heartbeat full cycles (#585 宿主 rant 2026-08-09T09:35:55,覆盖 #559 完全停机:保护=降频不是停止,**永不停机**——≥30 空轮后不 skip,按 heartbeat 间隔继续跑完整六步循环;`_heartbeat_interval()` = max(interval, min(interval×8, 8h))(60s 任务→480s=8 分钟 / 10min→80min / 1h→8h / ≥8h 任务不变);run loop wait_timeout 饱和时用 heartbeat,manual trigger / 上游 ls-remote 推进立即恢复正常频率(计数清零);`_saturation_halt_active()` → `_saturation_heartbeat_active()`,日志 "never halting";新 rant 最迟一个心跳周期内处理;持久化语义不变;+3 pytest 636→639(公式 7 例 / 饱和 tick 仍跑完整 cycle / 日志无 "skipping" / 上游恢复 / 无 git 仓库不崩),639 全绿,README/Agent/README.cn 计数同步) ✅ > - Windows integration-test tree-kill (#587 外部贡献 pm25coder,G130 同族于 G129 rant 2026-08-09T08:03:46:Windows 集成测试 `process.kill(-pid)` 进程组杀是 no-op(负 PID 不受支持,抛 ESRCH)→ 被 kill 的 daemon 变孤儿进程残留,G43 stale-port 重连测试本地必挂;修复=新增 `killProcessTree` 帮助函数(win32 分支 `taskkill /PID /T /F` 树杀+强杀,windowsHide:true + stdio:ignore + 错误吞掉;POSIX 分支保持既有 group-kill),killDaemon SIGTERM→3s→SIGKILL 回退链与 stale-port 测试两处调用点全部改走帮助函数;纯测试改动(21+/3-,GUI 96 / pytest 639 计数不变);判别力=负 PID 语义平台差异,win32 分支由本地实跑验证,POSIX 分支 CI 31289054189 SUCCESS 无回归) ✅ +> - Stale-check exception narrowing (#589 外部贡献 pm25coder,G129 同族续:`check_and_restart_if_stale()` 裸 `except Exception` 吞掉一切——AuthError(token 不匹配=配置/安装问题,用户必须看到)与编程错误(AttributeError 等真 bug)被静默隐藏,掩盖 #583 家族根因;修复=收窄为仅瞬态清单(ConnectionRefusedError/FileNotFoundError/OSError/JSONDecodeError/TimeoutError/**ConnectionClosed**——websockets 握手后 ping 中途断线场景),AuthError 与编程错误向上传播给 ensure_connected 调用者;+2 测试 639→641(AuthError 传播 / AttributeError 传播,负态 test_server_unreachable_silent 仍吞瞬态),三处文档计数同步;判别力=删 `not error` 即红/删 return 即 "log" not in captured 红) ✅ #### 2.2 Latest GitHub code changes