fix(loop-engine): 「配方跑完了还没算办完」交人消息改 kind: observation —— R10 第六处

这条是五(六)处里最不能隐身的:它是配方没做到位时交人的那一句,人打开工作日志
想知道的第一件事就是「为什么停了」,而从前 kind: 'result' 不在 SKELETON 里,
这条消息永远进不了工作日志,单子看着像凭空卡住。只改 kind,detail 不动。

card 动作里「这一步已经发过卡,不再发第二张」那条保持 internal: true 不改 ——
它每次重入(卡开着的每一拍)都会打一遍,是典型的排障痕,machinery() 的过滤
存在的意义就是滤掉这类;摆到人面前只会把真正要看的东西淹掉。

新增回归测试:跑真实的 turn-runner.ts,让案例落到「没 guide、没发卡、doneWhen
不成立」这条分支,把捕获到的留痕喂给 structuredLog 全程,断言可见且归系统。

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LKMZDwMbyKzjw6Hembwvet
This commit is contained in:
xcs
2026-08-29 07:09:10 +08:00
co-authored by Claude Opus 5
parent fc48920c32
commit 2bb974a10d
2 changed files with 39 additions and 2 deletions
@@ -2052,10 +2052,15 @@ export function createTurnRunner(deps: TurnRunnerDeps): LoopEngineService {
}
if (current.guide.trim() === '') {
/* 没有 guide、没发卡、doneWhen 也不成立 → 配方没做到位,是包的 bug,交人 */
/*
* 没有 guide、没发卡、doneWhen 也不成立 → 配方没做到位,是包的 bug,交人。
* **kind: 'observation'**(2026-08-29,R10 第六处)—— 从前是 `kind: 'result'`,
* 不在 `SKELETON` 里,这条**交人**的消息永远进不了工作日志,单子看着像凭空卡住,
* 而人打开日志想知道的第一件事就是「为什么停了」。只改 kind,detail 不动。
*/
await deps.memory.append({
taskId,
kind: 'result',
kind: 'observation',
title: `「${current.item}」的配方跑完了,可这一步还没算办完 —— 交给你看一眼`,
detail: { auto: current.item },
});