Planner Autonomy: добавить reason-коды catalog-alignment

This commit is contained in:
2026-05-01 15:28:29 +03:00
parent 67f5e908c9
commit 755e2521e8
6 changed files with 59 additions and 3 deletions
@@ -142,6 +142,27 @@ function pushAllUnique(target: string[], values: string[]): void {
}
}
function pushCatalogChainTemplateAlignmentReasons(
target: string[],
alignment: AssistantMcpDiscoveryCatalogChainTemplateAlignment
): void {
if (alignment.top_chain_template_match) {
pushReason(target, "planner_catalog_chain_template_alignment_evaluated");
if (alignment.selected_chain_matches_top) {
pushReason(target, "planner_selected_chain_matches_catalog_top");
} else if (alignment.selected_chain_in_catalog_matches) {
pushReason(target, "planner_selected_chain_uses_lower_rank_catalog_match");
} else {
pushReason(target, "planner_selected_chain_outside_catalog_match_set");
}
return;
}
if (alignment.selected_chain_is_catalog_template) {
pushReason(target, "planner_catalog_chain_template_alignment_unscored");
}
}
const LIFECYCLE_BOUNDED_INFERENCE_REASON_CODES = [
"planner_lifecycle_bounded_activity_window_template",
"planner_lifecycle_legal_fact_boundary_required"
@@ -1255,6 +1276,7 @@ export function planAssistantMcpDiscovery(
if (budgetOverride.maxProbeCount) {
pushReason(reasonCodes, "planner_enabled_chunked_coverage_probe_budget");
}
pushCatalogChainTemplateAlignmentReasons(reasonCodes, catalogChainTemplateAlignment);
const plan = buildAssistantMcpDiscoveryPlan({
semanticDataNeed,