Planner Autonomy: закрепить boundary inventory templates

This commit is contained in:
2026-05-01 13:17:09 +03:00
parent 9243642400
commit 3f7caae668
5 changed files with 114 additions and 2 deletions
@@ -73,6 +73,7 @@ function isInternalMechanicsLine(value: string): boolean {
text.includes("runtime_") ||
text.includes("planner_") ||
text.includes("catalog_") ||
text.includes("scope is not implemented yet") ||
text.includes("needs more scope before execution") ||
text.includes("mcp_execution_performed")
);
@@ -138,6 +139,10 @@ function isMetadataPilot(pilot: AssistantMcpDiscoveryPilotExecutionContract): bo
return pilot.pilot_scope === "metadata_inspection_v1";
}
function isInventoryTemplatePilot(pilot: AssistantMcpDiscoveryPilotExecutionContract): boolean {
return pilot.pilot_scope === "inventory_route_template_v1";
}
function isCatalogDrilldownPilot(pilot: AssistantMcpDiscoveryPilotExecutionContract): boolean {
return (
isMetadataPilot(pilot) &&
@@ -386,6 +391,9 @@ function headlineFor(mode: AssistantMcpDiscoveryAnswerMode, pilot: AssistantMcpD
if (isEntityResolutionPilot(pilot) && mode === "confirmed_with_bounded_inference") {
return "По каталогу 1С найден вероятный контрагент; это заземление сущности для следующего шага, а не еще бизнес-ответ по данным.";
}
if (isInventoryTemplatePilot(pilot) && mode === "checked_sources_only") {
return "Инвентарный route-template уже выбран, но live-исполнение этого generic MCP контура еще не подключено; складской/товарный факт не подтвержден.";
}
if (isEntityResolutionPilot(pilot) && mode === "needs_clarification") {
return "По каталогу 1С нашлось несколько похожих контрагентов, и без уточнения нельзя честно выбрать правильную сущность.";
}
@@ -523,6 +531,9 @@ function nextStepFor(mode: AssistantMcpDiscoveryAnswerMode, pilot: AssistantMcpD
if (mode === "needs_clarification") {
return "Уточните контрагента, период или организацию, и я смогу выполнить проверку по 1С.";
}
if (mode === "checked_sources_only" && isInventoryTemplatePilot(pilot)) {
return "Следующий шаг - связать inventory route-template с exact inventory runtime и затем проверить live-прогоном.";
}
if (mode === "confirmed_with_bounded_inference" && pilot.derived_metadata_surface) {
const surface = pilot.derived_metadata_surface;
if (surface.ambiguity_detected && surface.ambiguity_entity_sets.length > 0) {
@@ -577,6 +588,10 @@ function buildMustNotClaim(pilot: AssistantMcpDiscoveryPilotExecutionContract):
claims.push("Do not claim legal identity uniqueness when several catalog candidates are still plausible.");
claims.push("Do not imply that the resolved entity has already been used in a downstream data probe.");
}
if (isInventoryTemplatePilot(pilot)) {
claims.push("Do not present inventory route-template planning as executed stock, supplier, purchase, or sale evidence.");
claims.push("Do not expose inventory_route_template_v1 or MCP primitive names in the user answer.");
}
if (pilot.evidence.confirmed_facts.length === 0) {
claims.push("Do not claim a confirmed business fact when confirmed_facts is empty.");
}