Planner Autonomy: поднять inventory routes в MCP catalog
This commit is contained in:
@@ -86,6 +86,40 @@ function businessFactFamilyFor(input: {
|
||||
if (combined.includes("entity discovery") || combined.includes("entity_resolution")) {
|
||||
return "entity_grounding";
|
||||
}
|
||||
if (
|
||||
combined.includes("inventory") ||
|
||||
combined.includes("stock") ||
|
||||
combined.includes("warehouse") ||
|
||||
combined.includes("item provenance") ||
|
||||
combined.includes("purchase provenance")
|
||||
) {
|
||||
if (
|
||||
combined.includes("sale_trace") ||
|
||||
combined.includes("sale trace") ||
|
||||
combined.includes("buyer") ||
|
||||
combined.includes("purchase_to_sale") ||
|
||||
combined.includes("purchase-to-sale")
|
||||
) {
|
||||
return "inventory_sale_trace";
|
||||
}
|
||||
if (
|
||||
combined.includes("supplier_overlap") ||
|
||||
combined.includes("supplier overlap") ||
|
||||
combined.includes("supplier stock") ||
|
||||
combined.includes("stock by supplier")
|
||||
) {
|
||||
return "inventory_supplier_overlap";
|
||||
}
|
||||
if (
|
||||
combined.includes("purchase_provenance") ||
|
||||
combined.includes("purchase provenance") ||
|
||||
combined.includes("purchase document") ||
|
||||
combined.includes("supplier provenance")
|
||||
) {
|
||||
return "inventory_purchase_provenance";
|
||||
}
|
||||
return "inventory_stock_snapshot";
|
||||
}
|
||||
if (combined.includes("lifecycle") || combined.includes("activity")) {
|
||||
return "activity_lifecycle";
|
||||
}
|
||||
@@ -140,6 +174,12 @@ function timeScopeNeedFor(input: {
|
||||
if (input.family === "activity_lifecycle") {
|
||||
return "open_activity_window";
|
||||
}
|
||||
if (input.family === "inventory_stock_snapshot" || input.family === "inventory_supplier_overlap") {
|
||||
return input.explicitDateScope ? "explicit_period" : "as_of_date_required";
|
||||
}
|
||||
if (input.family === "inventory_purchase_provenance" || input.family === "inventory_sale_trace") {
|
||||
return input.explicitDateScope ? "explicit_period" : null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -328,6 +368,30 @@ function decompositionCandidatesFor(input: {
|
||||
pushUnique(result, "fetch_supporting_documents");
|
||||
pushUnique(result, "probe_coverage");
|
||||
pushUnique(result, "explain_evidence_basis");
|
||||
return result;
|
||||
}
|
||||
if (input.family === "inventory_stock_snapshot") {
|
||||
pushUnique(result, "fetch_scoped_movements");
|
||||
pushUnique(result, "aggregate_checked_amounts");
|
||||
pushUnique(result, "probe_coverage");
|
||||
pushUnique(result, "explain_evidence_basis");
|
||||
return result;
|
||||
}
|
||||
if (input.family === "inventory_supplier_overlap") {
|
||||
pushUnique(result, "resolve_entity_reference");
|
||||
pushUnique(result, "fetch_scoped_movements");
|
||||
pushUnique(result, "fetch_scoped_documents");
|
||||
pushUnique(result, "aggregate_checked_amounts");
|
||||
pushUnique(result, "probe_coverage");
|
||||
pushUnique(result, "explain_evidence_basis");
|
||||
return result;
|
||||
}
|
||||
if (input.family === "inventory_purchase_provenance" || input.family === "inventory_sale_trace") {
|
||||
pushUnique(result, "resolve_entity_reference");
|
||||
pushUnique(result, "fetch_scoped_documents");
|
||||
pushUnique(result, "drilldown_related_objects");
|
||||
pushUnique(result, "probe_coverage");
|
||||
pushUnique(result, "explain_evidence_basis");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -346,6 +410,15 @@ function forbiddenOverclaimFlagsFor(family: string | null): string[] {
|
||||
if (family === "value_flow" || family === "movement_evidence" || family === "document_evidence") {
|
||||
pushUnique(result, "no_unchecked_fact_totals");
|
||||
}
|
||||
if (family === "inventory_stock_snapshot") {
|
||||
pushUnique(result, "no_unchecked_stock_snapshot");
|
||||
}
|
||||
if (family === "inventory_purchase_provenance" || family === "inventory_supplier_overlap") {
|
||||
pushUnique(result, "no_unproven_supplier_attribution");
|
||||
}
|
||||
if (family === "inventory_sale_trace") {
|
||||
pushUnique(result, "no_unproven_buyer_or_sale_trace");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -394,6 +467,9 @@ export function buildAssistantMcpDiscoveryDataNeedGraph(
|
||||
family: businessFactFamily,
|
||||
subjectResolutionOptional
|
||||
});
|
||||
const inventoryStockSnapshotWithoutSubject =
|
||||
subjectCandidates.length === 0 &&
|
||||
businessFactFamily === "inventory_stock_snapshot";
|
||||
const clarificationGaps: string[] = [];
|
||||
if (unsupported === "metadata_lane_choice_clarification" || action === "resolve_next_lane") {
|
||||
pushUnique(clarificationGaps, "lane_family_choice");
|
||||
@@ -415,7 +491,8 @@ export function buildAssistantMcpDiscoveryDataNeedGraph(
|
||||
subjectCandidates.length === 0 &&
|
||||
businessFactFamily !== "schema_surface" &&
|
||||
!openScopeWithoutSubject &&
|
||||
!metadataScopedOpenLaneWithoutSubject
|
||||
!metadataScopedOpenLaneWithoutSubject &&
|
||||
!inventoryStockSnapshotWithoutSubject
|
||||
) {
|
||||
pushUnique(clarificationGaps, "subject");
|
||||
}
|
||||
@@ -427,6 +504,9 @@ export function buildAssistantMcpDiscoveryDataNeedGraph(
|
||||
if (timeScopeNeed === "period_required" && !explicitDateScope) {
|
||||
pushUnique(clarificationGaps, "period");
|
||||
}
|
||||
if (timeScopeNeed === "as_of_date_required" && !explicitDateScope) {
|
||||
pushUnique(clarificationGaps, "as_of_date");
|
||||
}
|
||||
const decompositionCandidates = decompositionCandidatesFor({
|
||||
family: businessFactFamily,
|
||||
action,
|
||||
|
||||
Reference in New Issue
Block a user