Post-F: укрепить inventory selected-object provenance

This commit is contained in:
2026-04-24 08:18:02 +03:00
parent 0158419b65
commit 972db24779
6 changed files with 90 additions and 3 deletions
@@ -1168,6 +1168,7 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo
followupContext.current_frame_kind === "inventory_drilldown";
const inventorySelectedObjectFollowup = inventoryLineageActive &&
(hasSelectedObjectInventorySignal(normalizedMessage) || (previousIsInventoryFamily && hasFollowupSignal));
const hasExplicitInventoryItemReference = /(?:товар|номенклатур|позици|склад|остат|sku|item|product|товар|номенклатур|позици|склад|остат)/iu.test(normalizedMessage) || hasSelectedObjectInlineSnapshotMetadata(normalizedMessage);
const inventoryPurchaseDateVatBridge = inventorySelectedObjectFollowup && hasInventoryPurchaseDateVatBridgeCue(normalizedMessage);
if (inventoryPurchaseDateVatBridge &&
(detectedIntent.intent === "unknown" ||
@@ -1191,6 +1192,16 @@ function deriveIntentWithFollowupContext(detectedIntent, userMessage, followupCo
reasons: [...detectedIntent.reasons, "intent_adjusted_to_vat_followup_context"]
};
}
if (!inventoryLineageActive &&
hasAnyPartyAnchor &&
!hasExplicitInventoryItemReference &&
detectedIntent.intent === "inventory_purchase_documents_for_item") {
return {
intent: hasPreviousContract && !hasPreviousCounterparty ? "list_documents_by_contract" : "list_documents_by_counterparty",
confidence: "low",
reasons: [...detectedIntent.reasons, "intent_adjusted_from_non_inventory_followup_context"]
};
}
const allowOpenItemsFollowupFallback = detectedIntent.intent === "unknown" && !isVatFollowup;
if (allowOpenItemsFollowupFallback &&
!inventorySelectedObjectFollowup &&