Planner Autonomy: выбрать comparison chain для явного bidirectional graph

This commit is contained in:
2026-05-01 14:20:24 +03:00
parent 1c1383b8b5
commit ea96df9ca1
5 changed files with 27 additions and 17 deletions
@@ -703,16 +703,19 @@ function recipeFor(input: AssistantMcpDiscoveryPlannerInput): PlannerRecipe {
}
if (graphFactFamily === "value_flow") {
if (dataNeedGraph?.comparison_need === "incoming_vs_outgoing" && !hasSubjectCandidates(dataNeedGraph)) {
if (dataNeedGraph?.comparison_need === "incoming_vs_outgoing") {
pushUnique(axes, "amount");
pushUnique(axes, "coverage_target");
if (requestedAggregationAxis === "month" || graphAggregation === "by_month") {
pushUnique(axes, "calendar_month");
}
const template = getAssistantMcpCatalogChainTemplate("value_flow_comparison");
const fallbackPrimitives = hasSubjectCandidates(dataNeedGraph)
? (["resolve_entity_reference", ...template.fallback_primitives] as AssistantMcpDiscoveryPrimitive[])
: template.fallback_primitives;
const primitiveSelection = selectPrimitivesFromGraphAndCatalog({
dataNeedGraph,
fallbackPrimitives: template.fallback_primitives,
fallbackPrimitives,
requiredAxes: axes,
metadataSurface: input.metadataSurface,
actionFamily: action,