From 9d58d9b87ccf1e5f4223f2c4dc912ccac26eb0eb Mon Sep 17 00:00:00 2001 From: Yuri Yaryshev Date: Sun, 6 Dec 2026 17:47:58 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5:=20=D0=B2=20=D1=82=D0=B5=D0=BA=D1=81?= =?UTF-8?q?=D1=82=D0=B5=20=D0=BD=D0=B0=D0=BF=D0=BE=D0=BC=D0=B8=D0=BD=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20(=D0=B2=D1=85=D0=BE=D0=B4=207)=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D0=BF=D0=B0=D0=B4=D0=B0=D0=BB=D0=B0=20=D0=B1=D1=83?= =?UTF-8?q?=D0=BA=D0=B2=D0=B0=20s=20(=D1=80=D0=B5=D0=B3=D1=8D=D0=BA=D1=81?= =?UTF-8?q?=D0=BF=20/s+/=20=D0=B2=D0=BC=D0=B5=D1=81=D1=82=D0=BE=20/\s+/);?= =?UTF-8?q?=20=D1=82=D0=B5=D1=81=D1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- .../khbuild_assistant_prep/src/agents/step2.test.ts | 11 +++++++++++ packages/khbuild_assistant_prep/src/agents/step2.ts | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 packages/khbuild_assistant_prep/src/agents/step2.test.ts diff --git a/packages/khbuild_assistant_prep/src/agents/step2.test.ts b/packages/khbuild_assistant_prep/src/agents/step2.test.ts new file mode 100644 index 0000000..17f858e --- /dev/null +++ b/packages/khbuild_assistant_prep/src/agents/step2.test.ts @@ -0,0 +1,11 @@ +import { describe, expect, it } from "vitest"; +import { formatPackage } from "./step2.js"; + +describe("formatPackage: вход (7)", () => { + it("текст последнего напоминания не искажается (буквы s и пробелы сохраняются, переводы строк схлопываются)", () => { + const text = formatPackage([ + { input_no: 7, jt_task_id: "T1", payload: { reminders: 2, last_reminded_at: "2026-12-04", last_reminder_text: "Thanks, Arthur.\n\nMeasured against the seawall; decision pending" } }, + ] as never); + expect(text).toContain("«Thanks, Arthur. Measured against the seawall; decision pending»"); + }); +}); diff --git a/packages/khbuild_assistant_prep/src/agents/step2.ts b/packages/khbuild_assistant_prep/src/agents/step2.ts index 8a898d9..595fec7 100644 --- a/packages/khbuild_assistant_prep/src/agents/step2.ts +++ b/packages/khbuild_assistant_prep/src/agents/step2.ts @@ -39,7 +39,7 @@ export function formatPackage(rows: PackageRow[]): string { for (const r of items) { if (no === 7) { const p = r.payload ?? {}; - out.push(`- задача ${r.jt_task_id ?? "(без задачи)"}: напоминаний ${p.reminders ?? "?"}, последнее ${p.last_reminded_at ?? "?"}, ответ: ${p.last_reply_outcome ?? "-"} ${p.last_reply_summary ?? ""}${p.last_reminder_text ? ` | текст последнего напоминания: «${String(p.last_reminder_text).replace(/s+/g, " ")}»` : ""}`.trim()); + out.push(`- задача ${r.jt_task_id ?? "(без задачи)"}: напоминаний ${p.reminders ?? "?"}, последнее ${p.last_reminded_at ?? "?"}, ответ: ${p.last_reply_outcome ?? "-"} ${p.last_reply_summary ?? ""}${p.last_reminder_text ? ` | текст последнего напоминания: «${String(p.last_reminder_text).replace(/\s+/g, " ")}»` : ""}`.trim()); continue; } const dates = r.start_date || r.end_date ? ` | ${r.start_date ?? "?"} .. ${r.end_date ?? "?"}` : "";