/** * **Insight primitives** — `GET /api/v1/insights/*` (ADR 0051 §4, sketch §D). * * Two registry metrics that answer the questions an agent otherwise re-derives * from raw rows on every turn: * * - `insight_baseline` — what is normal for one metric in one scene; * - `insight_movers` — what changed, ranked by how unusual the change is; * - `insight_anomalies` — which buckets of one metric do not belong, and what * inside the metric accounts for them (#306). * * The plugin is deliberately thin (ADR 0005). Everything that decides an answer * lives in `@uptimizr/db`'s pure `src/insights/`: which metrics have a portable * bucket series, how the window resolves, and every statistic. This file does * three things — validate at the boundary, fan the bucket reads out under a * declared cap, and shape the envelope. * * It is a separate plugin rather than more routes in `query.ts` because it is a * separate *kind* of read: a derived metric composed of other metrics' series, * which needs its own error vocabulary (a metric can be unknown, not comparable, * or comparable but not bucketable — three different 400s) and its own bounded * fan-out. One registration line in `app.ts` is the whole coupling. */ import type { FastifyPluginAsync } from "fastify"; import type { CollectorStore } from "../store.js"; interface Options { store: CollectorStore; } /** * Insight API. Every route is scoped to the authenticated project and needs the * ordinary `query` capability — an insight is a read of the project's own * telemetry, nothing more. */ export declare const insightRoutes: FastifyPluginAsync; export {}; //# sourceMappingURL=insights.d.ts.map