diff --git a/tools/secretary-stop-hook.mjs b/tools/secretary-stop-hook.mjs index 42b8208..fa10098 100644 --- a/tools/secretary-stop-hook.mjs +++ b/tools/secretary-stop-hook.mjs @@ -100,8 +100,12 @@ async function main() { // Шаг хода (Слой 1) ведёт хук детерминированно — пишется ВСЕГДА; протокол к записи через merge // (при срыве reconcile категории заморожены, но перечень ходов не получает дыр). + // Модельная суть хода (если reconcile её вернул) — иначе фолбэк firstSentence в buildStepLine. + const modelStep = (updated && updated.step) || null; + if (updated && 'step' in updated) delete updated.step; // транзитное — в protocol.json не сохраняем const step = { turn, session, - text: buildStepLine({ turn, user: ex.user, assistant: ex.assistant, actions: (ex.actions || []).map((a) => a.tool) }) }; + text: buildStepLine({ turn, user: ex.user, assistant: ex.assistant, + actions: (ex.actions || []).map((a) => a.tool), essence: modelStep }) }; const toWrite = mergeTurnIntoProtocol({ proto, updated, step }); // Вернуть реестр СВ из снимка (reconcile его НЕ владеет) — иначе он перенумеровывает СВ.