ОРРКЕСТРАЦИЯ - Усилить agent loop object-centric аудитом и добить pronoun follow-up по документам закупки

This commit is contained in:
2026-04-14 18:47:38 +03:00
parent cb0eb450d7
commit 97b2a9b028
19 changed files with 469 additions and 44 deletions
@@ -293,6 +293,7 @@ describe("address query shape classifier", () => {
useRubCurrency: true
}
);
expect(reply.text.split("\n")[0]).toContain("поставщиком");
expect(reply.text).toContain("Шкаф картотечный");
expect(reply.text).toContain("Поступление товаров и услуг 0001");
expect(reply.semantics?.result_mode).toBe("confirmed_balance");
@@ -319,6 +320,7 @@ describe("address query shape classifier", () => {
useRubCurrency: true
}
);
expect(reply.text.split("\n")[0]).toContain("поставщиком");
expect(reply.text).toContain("закупочный след");
expect(reply.text).toContain("Гамма-мебель, ООО");
expect(reply.semantics?.balance_confirmed).toBe(true);
@@ -345,6 +347,7 @@ describe("address query shape classifier", () => {
useRubCurrency: true
}
);
expect(reply.text.split("\n")[0]).toContain("покупатель");
expect(reply.text).toContain("след выбытия");
expect(reply.text).toContain("Реализация товаров и услуг 0007");
expect(reply.text).toContain("Департамент капитального ремонта города Москвы");
@@ -3947,6 +3950,28 @@ describe("address decompose stage follow-up carryover", () => {
).toBe(true);
});
it("promotes pronoun selected-item purchase-doc follow-up into inventory purchase documents with inherited date context", () => {
const result = runAddressDecomposeStage('покажи документы по этой позиции', {
previous_intent: "inventory_purchase_provenance_for_item",
previous_filters: {
as_of_date: "2019-03-31",
period_from: "2019-03-01",
period_to: "2019-03-31",
item: "Столешница 600*3050*26 дуб ниагара"
},
previous_anchor_type: "unknown",
previous_anchor_value: null
});
expect(result).not.toBeNull();
expect(result?.intent.intent).toBe("inventory_purchase_documents_for_item");
expect(result?.filters.extracted_filters.item).toBe("Столешница 600*3050*26 дуб ниагара");
expect(result?.filters.extracted_filters.as_of_date).toBe("2019-03-31");
expect(
result?.baseReasons?.includes("intent_adjusted_to_inventory_followup_context") ||
result?.intent.reasons.includes("inventory_selected_object_purchase_documents_signal_detected")
).toBe(true);
});
it("keeps slang all-customers-all-time wording in address lane via resolved intent fallback", () => {
const result = runAddressDecomposeStage("выведи всех заков за все время", null);
expect(result).not.toBeNull();