Усилить reliability gate и принять margin semantic replay
This commit is contained in:
@@ -113,6 +113,16 @@ describe("addressIntentResolver regression bridges", () => {
|
||||
expect(result.reasons).toContain("unicode_nomenclature_margin_ranking_bridge_signal_detected");
|
||||
});
|
||||
|
||||
it("routes bare highest-margin nomenclature wording away from inventory snapshot", () => {
|
||||
const result = resolveAddressIntent(
|
||||
"\u041a\u0430\u043a\u0430\u044f \u043d\u043e\u043c\u0435\u043d\u043a\u043b\u0430\u0442\u0443\u0440\u0430 \u0431\u044b\u043b\u0430 \u0441\u0430\u043c\u043e\u0439 \u043c\u0430\u0440\u0436\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430 2020 \u0433\u043e\u0434?"
|
||||
);
|
||||
|
||||
expect(result.intent).toBe("inventory_margin_ranking_for_nomenclature");
|
||||
expect(result.intent).not.toBe("inventory_on_hand_as_of_date");
|
||||
expect(result.reasons).toContain("unicode_nomenclature_margin_ranking_bridge_signal_detected");
|
||||
});
|
||||
|
||||
it("detects bare historical inventory root with explicit month-year", () => {
|
||||
const result = resolveAddressIntent("остатки на март 2016");
|
||||
|
||||
|
||||
@@ -18,6 +18,15 @@ describe("addressInventoryIntentSignals", () => {
|
||||
expect(result?.reasons).toContain("inventory_on_hand_signal_detected");
|
||||
});
|
||||
|
||||
it("keeps bare highest-margin nomenclature wording out of the stock snapshot route", () => {
|
||||
const result = resolveInventoryAddressIntent(
|
||||
"\u041a\u0430\u043a\u0430\u044f \u043d\u043e\u043c\u0435\u043d\u043a\u043b\u0430\u0442\u0443\u0440\u0430 \u0431\u044b\u043b\u0430 \u0441\u0430\u043c\u043e\u0439 \u043c\u0430\u0440\u0436\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u0437\u0430 2020 \u0433\u043e\u0434?"
|
||||
);
|
||||
|
||||
expect(result?.intent).toBe("inventory_margin_ranking_for_nomenclature");
|
||||
expect(result?.reasons).toContain("inventory_margin_ranking_signal_detected");
|
||||
});
|
||||
|
||||
it("classifies selected-object purchase provenance wording through the extracted inventory owner", () => {
|
||||
const result = resolveInventoryAddressIntent("selected object supplier provenance");
|
||||
|
||||
|
||||
+27
@@ -232,6 +232,33 @@ describe("inventory profitability selected-object regressions", () => {
|
||||
expect(result?.intent.reasons).toContain("intent_adjusted_to_inventory_margin_ranking_followup_context");
|
||||
});
|
||||
|
||||
it("keeps margin basis follow-up inside ranking context instead of asking for an item", () => {
|
||||
const marginFollowupContext = {
|
||||
previous_intent: "inventory_margin_ranking_for_nomenclature" as const,
|
||||
target_intent: "inventory_margin_ranking_for_nomenclature" as const,
|
||||
root_intent: "inventory_margin_ranking_for_nomenclature" as const,
|
||||
previous_filters: {
|
||||
organization: "OOO Alternative Plus",
|
||||
period_from: "2020-01-01",
|
||||
period_to: "2020-12-31"
|
||||
},
|
||||
previous_anchor_type: "unknown" as const,
|
||||
previous_anchor_value: null
|
||||
};
|
||||
|
||||
const result = runAddressDecomposeStage(
|
||||
"\u0410 \u0438\u0437 \u0447\u0435\u0433\u043e \u0442\u044b \u044d\u0442\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u0438 \u0447\u0435\u0433\u043e \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0434\u043b\u044f \u0442\u043e\u0447\u043d\u043e\u0439 \u043c\u0430\u0440\u0436\u0438?",
|
||||
marginFollowupContext
|
||||
);
|
||||
|
||||
expect(result).not.toBeNull();
|
||||
expect(result?.intent.intent).toBe("inventory_margin_ranking_for_nomenclature");
|
||||
expect(result?.filters.extracted_filters.period_from).toBe("2020-01-01");
|
||||
expect(result?.filters.extracted_filters.period_to).toBe("2020-12-31");
|
||||
expect(result?.filters.missing_required_filters).toEqual([]);
|
||||
expect(result?.intent.reasons).toContain("intent_adjusted_to_inventory_margin_ranking_followup_context");
|
||||
});
|
||||
|
||||
it("does not pivot margin follow-up account-41 correction into a balance snapshot", () => {
|
||||
const marginFollowupContext = {
|
||||
previous_intent: "inventory_margin_ranking_for_nomenclature" as const,
|
||||
|
||||
Reference in New Issue
Block a user