Where is the node_type variable set? Looking at the documentation for the Drupal 8 html.html.twig template file, I notice node_type is listed between the available variables for that template file.
Contrary to the other variables available to that template file, thought, node_type is not set from template_preprocess_html() nor _template_preprocess_default_variables(), which are the functions I expect to set the documented variables for that template file.

What function or method initializes node_type to the bundle of the currently viewed node for html.html.twig?
node_type is set in node_preprocess_html() from the Node module.

/**
 * Implements hook_preprocess_HOOK() for HTML document templates.
 */
function node_preprocess_html(&amp;$variables) {
  // If on an individual node page, add the node type to body classes.
  if (($node = \Drupal::routeMatch()-&gt;getParameter('node')) &amp;&amp; $node instanceof NodeInterface) {
    $variables['node_type'] = $node-&gt;getType();
  }
}