Custom post rewrite rule not working

The undesirable answer I alluded to in my question is to intercept WordPress’ routing and URL generation. Manipulate the URLs with:

add_filter('post_type_link', 'my_post_link', 10, 3);
function my_post_link($permalink, $post, $leavename) {
  if ($post->post_type == 'publication') {
    $year = date('Y', strtotime($post->post_date));
    return site_url("/publications/$year/$post->post_name");
  }
  return $permalink;
}

Then intercept the routing:

add_action('template_redirect', 'my_template_redirect');
function my_template_redirect() {
  if (preg_match('!^/publications/([0-9]+)/([a-z0-9-]+)/?!i', $uri, $matches)) {
    $year = $matches[1];
    $publication = $matches[2];

    $ps = get_posts(array(
      'post_type' => 'publication',
      'year' => $year,
      'name' => $publication,
      'numberposts' => 1,
      ));
    if (!empty($ps)) {
      global $post;
      $post = array_shift($ps);
      setup_postdata($post);

      global $wp_query;
      $wp_query->is_404 = false;

      include(get_stylesheet_directory().'/single-publication.php');
      exit;
    }
  }
}

This works, but it’s ugly and nasty!. There are other ways of doing it that involve working with WordPress’ rewrite table, but those are also less than ideal. I’d like to find a nicer solution if possible.