Post-F: закрепить open-scope и bidirectional value-flow integrity
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveAddressIntent } from "../src/services/addressIntentResolver";
|
||||
|
||||
describe("address intent resolver bidirectional value-flow arbitration", () => {
|
||||
it("keeps incoming-vs-outgoing comparison out of one-sided payout routes", () => {
|
||||
const result = resolveAddressIntent(
|
||||
"\u0447\u0442\u043e \u043f\u043e \u041e\u041e\u041e \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u041f\u043b\u044e\u0441 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432 2020 \u0433\u043e\u0434\u0443: \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0438\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0434\u0435\u043d\u044c\u0433\u0438?"
|
||||
);
|
||||
|
||||
expect(result.intent).toBe("unknown");
|
||||
expect(result.reasons).toContain("unicode_bidirectional_value_flow_deferred_to_discovery");
|
||||
});
|
||||
});
|
||||
@@ -4734,6 +4734,25 @@ describe("address decompose stage follow-up carryover", () => {
|
||||
expect(result?.baseReasons).not.toContain("open_items_from_followup_context");
|
||||
});
|
||||
|
||||
it("asks for organization when an open value-flow total explicitly requests one-organization scope", async () => {
|
||||
const service = new AddressQueryService();
|
||||
const result = await service.tryHandle(
|
||||
"\u0421 \u0416\u0443\u043a\u043e\u0432\u043a\u043e\u0439 \u0437\u0430\u043a\u043e\u043d\u0447\u0438\u043b\u0438. \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0443\u0436\u043d\u0430 \u0434\u0440\u0443\u0433\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430: \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0434\u0435\u043d\u0435\u0436\u043d\u044b\u0439 \u0441\u0440\u0435\u0437 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u0434\u043b\u044f \u043e\u0442\u0432\u0435\u0442\u0430 \u043d\u0443\u0436\u043d\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u044f, \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u0442\u043e\u0447\u043d\u0438 \u0435\u0435. \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u043e\u043e\u0431\u0449\u0435 \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0445 \u0434\u0435\u043d\u0435\u0433 \u0431\u044b\u043b\u043e \u0437\u0430 2020 \u0433\u043e\u0434?",
|
||||
{
|
||||
knownOrganizations: [
|
||||
"\u041e\u041e\u041e \u0410\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 \u041f\u043b\u044e\u0441",
|
||||
"\u041e\u041e\u041e \u0420\u043e\u043c\u0430\u0448\u043a\u0430"
|
||||
]
|
||||
}
|
||||
);
|
||||
|
||||
expect(result?.reply_type).toBe("partial_coverage");
|
||||
expect(result?.debug.missing_required_filters).toContain("organization");
|
||||
expect(result?.debug.mcp_call_status).toBe("skipped");
|
||||
expect(result?.debug.reasons).toContain("organization_clarification_required_from_explicit_value_flow_scope");
|
||||
expect(result?.reply_text).toMatch(/организац/iu);
|
||||
});
|
||||
|
||||
it("keeps balance family in follow-up when user gives compact account token", () => {
|
||||
const result = runAddressDecomposeStage("вернись на 2020-12-31 по 60", {
|
||||
previous_intent: "documents_forming_balance",
|
||||
|
||||
Reference in New Issue
Block a user