ОРРКЕСТРАЦИЯ - Оркестрация домена: ужесточить автофикс loop и назначать primary repair focus

This commit is contained in:
2026-04-15 08:09:42 +03:00
parent 5934f5f3fc
commit bc381c012e
16 changed files with 956 additions and 38 deletions
@@ -436,4 +436,35 @@ describe("inventory selected-object follow-up", () => {
expect(String(result?.reply_text ?? "").split("\n")[0]).toContain("ИП Покупатель");
expect(String(result?.reply_text ?? "")).toContain("Документы выбытия");
});
it("matches sale-trace item anchors from subconto fields when the item is not materialized explicitly", async () => {
executeAddressMcpQueryMock.mockResolvedValueOnce({
fetched_rows: 1,
matched_rows: 1,
raw_rows: [
{
Period: "2020-04-12T00:00:00Z",
Registrator: "Реализация товаров и услуг 00000000112 от 12.04.2020 0:00:00",
AccountDt: "90.02",
AccountKt: "41.01",
Amount: 833.33,
SubcontoDt1: "Шкаф картотечный 1000*400*2100",
SubcontoKt1: "ИП Покупатель",
SubcontoKt2: "Коммерческая структура",
Organization: "ООО \\Альтернатива Плюс\\"
}
],
rows: [],
error: null
});
const service = new AddressQueryService();
const result = await service.tryHandle("Кому был продан товар Шкаф картотечный 1000*400*2100?", {});
expect(result?.handled).toBe(true);
expect(result?.debug.detected_intent).toBe("inventory_sale_trace_for_item");
expect(result?.debug.mcp_call_status).toBe("matched_non_empty");
expect(result?.debug.rows_matched).toBeGreaterThan(0);
expect(String(result?.reply_text ?? "")).not.toContain("совпадений не нашлось");
});
});