RouteCatalogController, RouteMetricsController, AgentRegistrationController all had inline SQL using SUM() on AggregateFunction columns from stats_1m_* AggregatingMergeTree tables. Replace with countMerge/countIfMerge/sumMerge. Also fix time_bucket() → toStartOfInterval() and ::double → toFloat64(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>