ARCH: замкнуть all-time continuity после metadata retrieval

This commit is contained in:
2026-04-23 14:23:04 +03:00
parent 4a6ac6bd99
commit 14465c7fde
6 changed files with 300 additions and 2 deletions
@@ -200,11 +200,23 @@ function explicitOrganizationScope(pilot: AssistantMcpDiscoveryPilotExecutionCon
return normalized.length > 0 ? normalized : null;
}
function hasAllTimeScope(pilot: AssistantMcpDiscoveryPilotExecutionContract): boolean {
return (
dryRunHasAxis(pilot, "all_time_scope") ||
pilot.reason_codes.includes("mcp_discovery_all_time_scope_signal_detected") ||
pilot.dry_run.reason_codes.includes("mcp_discovery_all_time_scope_signal_detected")
);
}
function documentOrMovementScopeRu(pilot: AssistantMcpDiscoveryPilotExecutionContract): string {
const entity = firstEntityCandidate(pilot);
const period = explicitDateScope(pilot);
const entityPart = entity ? ` по контрагенту ${entity}` : "";
const periodPart = period ? ` за ${period}` : " в проверенном окне";
const periodPart = period
? ` за ${period}`
: hasAllTimeScope(pilot)
? " за все доступное время"
: " в проверенном окне";
return `${entityPart}${periodPart}`;
}