АРЧ АП11 - Архитектура: протянуть continuity snapshot в living-chat organization authority и добавить оценку риска правки в AGENTS
This commit is contained in:
@@ -219,4 +219,39 @@ describe("assistant living chat runtime adapter", () => {
|
||||
expect(output.debug?.living_chat_response_source).toBe("deterministic_memory_recap_contract");
|
||||
expect(executeLlmChat).not.toHaveBeenCalled();
|
||||
});
|
||||
it("uses continuity-backed active organization for organization-fact boundary even when session scope is empty", async () => {
|
||||
const executeLlmChat = vi.fn(async () => "raw-llm");
|
||||
const input = buildRuntimeInput({
|
||||
userMessage: "сколько лет альтернативе плюс",
|
||||
sessionItems: [
|
||||
{
|
||||
role: "assistant",
|
||||
debug: {
|
||||
execution_lane: "address_query",
|
||||
answer_grounding_check: {
|
||||
status: "grounded"
|
||||
},
|
||||
detected_intent: "receivables_confirmed_as_of_date",
|
||||
extracted_filters: {
|
||||
organization: "ООО Альтернатива Плюс",
|
||||
as_of_date: "2020-03-31"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
hasOrganizationFactLookupSignal: () => true,
|
||||
buildAssistantOrganizationFactBoundaryReply: (organization: string | null) => `org-boundary:${organization ?? "none"}`,
|
||||
executeLlmChat
|
||||
});
|
||||
|
||||
const output = await runAssistantLivingChatRuntime(input);
|
||||
|
||||
expect(output.handled).toBe(true);
|
||||
expect(output.chatText).toBe("org-boundary:ООО Альтернатива Плюс");
|
||||
expect(output.debug?.living_chat_response_source).toBe("deterministic_organization_fact_boundary");
|
||||
expect(output.debug?.assistant_active_organization).toBe("ООО Альтернатива Плюс");
|
||||
expect(output.debug?.living_chat_continuity_grounded_context_detected).toBe(true);
|
||||
expect(output.debug?.living_chat_continuity_active_organization).toBe("ООО Альтернатива Плюс");
|
||||
expect(executeLlmChat).not.toHaveBeenCalled();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user