@happyvertical/smrt-analytics 0.60.18 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +8 -0
- package/README.md +8 -0
- package/agents/observability.md +72 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/manifest.json +1 -1
- package/dist/observability.d.ts +240 -0
- package/dist/observability.d.ts.map +1 -0
- package/dist/observability.js +420 -0
- package/dist/observability.js.map +1 -0
- package/dist/smrt-knowledge.json +13 -6
- package/dist/smrt-knowledge.okf.md +7 -2
- package/package.json +13 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observability.js","names":[],"sources":["../src/observability.ts"],"sourcesContent":["/**\n * Read-only OpenObserve reader for the `default/project_observability` stream\n * (happyvertical/smrt#4908).\n *\n * SERVER-ONLY. This entry point (`@happyvertical/smrt-analytics/observability`)\n * is deliberately not re-exported from the package root or `./browser`, and it\n * refuses to run in a browser. The credential is resolved at call time and sent\n * only in the `Authorization` header of the search request; it is never stored,\n * logged, or placed in an error message.\n *\n * Stream shape. The iac collector (`project-observability/runtime.py`,\n * `collect()`) writes LONG-FORMAT rows every 10 minutes: one row per\n * (project, source, entity) per poll. Every row carries `project`, `source`\n * (`matomo`, `glitchtip`, `bifrost`, `workloads`, `deployments`, `ci`, plus the\n * opt-in `codex`/`claude` configuration rows, which this reader ignores),\n * `entity`, `record_kind` (`snapshot`), `status` (`connected`, `not_connected`,\n * `error`), `_timestamp`, `observed_at` and `last_success_at` (microseconds),\n * plus source-specific fields:\n *\n * | source | fields |\n * | ----------- | -------------------------------------------------------------------- |\n * | matomo | period, visitors, visits, actions |\n * | glitchtip | period, window_start, window_end, error_events, error_events_current_hour |\n * | bifrost | context, period, requests, input_tokens, output_tokens, total_tokens, estimated_cost_usd (gateway estimate, USD), budget_usd, budget_used_usd, budget_reset, cost_kind |\n * | workloads | namespace, desired/ready/updated_replicas, images (deployment rows); cpu_cores, memory_bytes, measured_at (pod rows) |\n * | deployments | ready, revision, transition_at |\n * | ci | workflow, run_status, conclusion, revision, run_updated_at |\n *\n * A source with no data or a failed poll is a single row with entity\n * `connection` and status `not_connected` or `error`. Fields the collector does\n * not write (a dashboard URL, integer-minor-unit cost) are not invented: AI cost\n * is the collector's USD estimate, and metrics absent from a row are `null`.\n *\n * @packageDocumentation\n */\n\nexport const PROJECT_OBSERVABILITY_SOURCES = [\n 'matomo',\n 'glitchtip',\n 'bifrost',\n 'workloads',\n 'deployments',\n 'ci',\n] as const;\n\nexport type ProjectObservabilitySource =\n (typeof PROJECT_OBSERVABILITY_SOURCES)[number];\n\n/** Collector connection state of a row. */\nexport type ProjectObservabilityStatus =\n | 'connected'\n | 'not_connected'\n | 'error'\n | (string & {});\n\ninterface RecordBase {\n project: string;\n entity: string;\n status: ProjectObservabilityStatus;\n /** Poll time (`observed_at`), microseconds since epoch. */\n observedAtMicros: number;\n /** Poll time, ISO 8601 UTC. */\n observedAt: string;\n lastSuccessAtMicros: number | null;\n}\n\nexport interface MatomoRecord extends RecordBase {\n source: 'matomo';\n period: string | null;\n visitors: number | null;\n visits: number | null;\n actions: number | null;\n}\n\nexport interface GlitchtipRecord extends RecordBase {\n source: 'glitchtip';\n period: string | null;\n windowStart: string | null;\n windowEnd: string | null;\n errorEvents: number | null;\n errorEventsCurrentHour: number | null;\n}\n\nexport interface BifrostRecord extends RecordBase {\n source: 'bifrost';\n context: string | null;\n period: string | null;\n requests: number | null;\n inputTokens: number | null;\n outputTokens: number | null;\n totalTokens: number | null;\n /** Gateway estimate in USD (decimal), never an invoice. */\n estimatedCostUsd: number | null;\n budgetUsd: number | null;\n budgetUsedUsd: number | null;\n budgetReset: string | null;\n costKind: string | null;\n}\n\nexport interface WorkloadsRecord extends RecordBase {\n source: 'workloads';\n namespace: string | null;\n desiredReplicas: number | null;\n readyReplicas: number | null;\n updatedReplicas: number | null;\n images: string | null;\n cpuCores: number | null;\n memoryBytes: number | null;\n measuredAt: string | null;\n}\n\nexport interface DeploymentsRecord extends RecordBase {\n source: 'deployments';\n /** Flux Ready condition status: `True`, `False`, `Unknown`. */\n ready: string | null;\n revision: string | null;\n transitionAt: string | null;\n}\n\nexport interface CiRecord extends RecordBase {\n source: 'ci';\n workflow: string | null;\n runStatus: string | null;\n /** GitHub conclusion, or `pending`. */\n conclusion: string | null;\n revision: string | null;\n runUpdatedAt: string | null;\n}\n\n/** One typed collector row, discriminated by `source`. */\nexport type ProjectObservabilityRecord =\n | MatomoRecord\n | GlitchtipRecord\n | BifrostRecord\n | WorkloadsRecord\n | DeploymentsRecord\n | CiRecord;\n\nexport interface ProjectSourceState {\n status: ProjectObservabilityStatus;\n observedAtMicros: number;\n lastSuccessAtMicros: number | null;\n}\n\n/** Per-project totals over the latest poll. `null` means no data, never 0. */\nexport interface ProjectObservabilitySummary {\n /** Matomo unique visitors today, summed over sites. */\n visitors: number | null;\n /** GlitchTip error events, last 24 complete UTC hours. */\n errorEvents: number | null;\n /** Bifrost rolling-24h total tokens over the project's keys. */\n aiTotalTokens: number | null;\n /** Bifrost rolling-24h estimated cost in USD. */\n aiEstimatedCostUsd: number | null;\n /** Sum of desired / ready replicas over deployment rows. */\n workloadsDesired: number | null;\n workloadsReady: number | null;\n /** Flux kustomizations Ready=True / total. */\n deploymentsReady: number | null;\n deploymentsTotal: number | null;\n /** Latest CI conclusion per repository (entity = `owner/repo`). */\n latestCi: { repository: string; conclusion: string | null }[];\n}\n\n/** Latest records for one project folded into a snapshot. */\nexport interface ProjectObservabilitySnapshot {\n projectId: string;\n /** Newest poll across sources. */\n observedAtMicros: number;\n observedAt: string;\n sources: Partial<Record<ProjectObservabilitySource, ProjectSourceState>>;\n /** Latest data rows per source (connection rows excluded). */\n records: {\n [S in ProjectObservabilitySource]: Extract<\n ProjectObservabilityRecord,\n { source: S }\n >[];\n };\n summary: ProjectObservabilitySummary;\n}\n\n/** Credential scheme for the `Authorization` header. */\nexport type ObservabilityAuthScheme = 'Basic' | 'Bearer';\n\ntype MaybeAsync<T> = T | Promise<T>;\n\n/** Structural subset of `SecretService` so callers can pass one directly. */\nexport interface ObservabilitySecretSource {\n retrieve(name: string): Promise<{ value: string }>;\n}\n\nexport interface OpenObserveStreamReaderOptions {\n /** Base URL, e.g. `https://openobserve.example.com`. Resolved per call. */\n endpoint: string | (() => MaybeAsync<string>);\n /**\n * Returns the read-only credential (the pre-encoded Basic token, or a bearer\n * token). Resolved per call; see {@link credentialFromSecret}.\n */\n credential: () => MaybeAsync<string>;\n authScheme?: ObservabilityAuthScheme;\n /** OpenObserve organization. Default `default`. */\n org?: string;\n /** Stream name. Default `project_observability`. */\n stream?: string;\n /** Injected fetch (tests). Default global `fetch`. */\n fetch?: typeof fetch;\n /** Per-request timeout in ms. Default 10000. */\n timeoutMs?: number;\n /**\n * Max rows per query. Exceeding it throws rather than silently truncating.\n * Default 5000.\n */\n maxRows?: number;\n /** Clock override for window defaults (tests). */\n now?: () => Date;\n}\n\nexport interface ProjectObservabilityQuery {\n /** Window start (inclusive). Default: `end` minus 24h. */\n start?: Date;\n /** Window end. Default: now. */\n end?: Date;\n /** Restrict to these project ids. */\n projectIds?: readonly string[];\n}\n\n/** Error raised by the reader. The message never contains the credential. */\nexport class OpenObserveReadError extends Error {\n readonly status?: number;\n constructor(message: string, status?: number) {\n super(message);\n this.name = 'OpenObserveReadError';\n this.status = status;\n }\n}\n\n/** Build a `credential` resolver from a secrets store entry (e.g. `SecretService`). */\nexport function credentialFromSecret(\n source: ObservabilitySecretSource,\n secretName: string,\n): () => Promise<string> {\n return async () => (await source.retrieve(secretName)).value;\n}\n\nconst DAY_MS = 24 * 60 * 60 * 1000;\nconst PROJECT_ID_PATTERN = /^[a-z][a-z0-9-]{0,62}$/;\nconst NAME_PATTERN = /^[A-Za-z0-9_.-]+$/;\nconst CONNECTION = 'connection';\n\nfunction toNum(value: unknown): number | null {\n if (typeof value === 'number' && Number.isFinite(value)) return value;\n if (typeof value === 'string' && value.trim() !== '') {\n const n = Number(value);\n return Number.isFinite(n) ? n : null;\n }\n return null;\n}\n\nfunction toText(value: unknown): string | null {\n return typeof value === 'string' && value !== '' ? value : null;\n}\n\nfunction isSource(value: unknown): value is ProjectObservabilitySource {\n return (PROJECT_OBSERVABILITY_SOURCES as readonly unknown[]).includes(value);\n}\n\n/**\n * Normalize one raw stream hit into a typed record. Returns null for rows that\n * are not collector snapshots of a known source (e.g. `codex`/`claude`\n * configuration rows) or lack a project, entity, or timestamp.\n */\nexport function parseProjectObservabilityRecord(\n raw: unknown,\n): ProjectObservabilityRecord | null {\n if (typeof raw !== 'object' || raw === null) return null;\n const r = raw as Record<string, unknown>;\n const project = toText(r.project);\n const entity = toText(r.entity);\n const observed = toNum(r.observed_at) ?? toNum(r._timestamp);\n if (!project || !entity || observed === null || !isSource(r.source)) {\n return null;\n }\n if (r.record_kind !== undefined && r.record_kind !== 'snapshot') return null;\n const base = {\n project,\n entity,\n status: toText(r.status) ?? 'unknown',\n observedAtMicros: observed,\n observedAt: new Date(Math.floor(observed / 1000)).toISOString(),\n lastSuccessAtMicros: toNum(r.last_success_at),\n };\n switch (r.source) {\n case 'matomo':\n return {\n ...base,\n source: 'matomo',\n period: toText(r.period),\n visitors: toNum(r.visitors),\n visits: toNum(r.visits),\n actions: toNum(r.actions),\n };\n case 'glitchtip':\n return {\n ...base,\n source: 'glitchtip',\n period: toText(r.period),\n windowStart: toText(r.window_start),\n windowEnd: toText(r.window_end),\n errorEvents: toNum(r.error_events),\n errorEventsCurrentHour: toNum(r.error_events_current_hour),\n };\n case 'bifrost':\n return {\n ...base,\n source: 'bifrost',\n context: toText(r.context),\n period: toText(r.period),\n requests: toNum(r.requests),\n inputTokens: toNum(r.input_tokens),\n outputTokens: toNum(r.output_tokens),\n totalTokens: toNum(r.total_tokens),\n estimatedCostUsd: toNum(r.estimated_cost_usd),\n budgetUsd: toNum(r.budget_usd),\n budgetUsedUsd: toNum(r.budget_used_usd),\n budgetReset: toText(r.budget_reset),\n costKind: toText(r.cost_kind),\n };\n case 'workloads':\n return {\n ...base,\n source: 'workloads',\n namespace: toText(r.namespace),\n desiredReplicas: toNum(r.desired_replicas),\n readyReplicas: toNum(r.ready_replicas),\n updatedReplicas: toNum(r.updated_replicas),\n images: toText(r.images),\n cpuCores: toNum(r.cpu_cores),\n memoryBytes: toNum(r.memory_bytes),\n measuredAt: toText(r.measured_at),\n };\n case 'deployments':\n return {\n ...base,\n source: 'deployments',\n ready: toText(r.ready),\n revision: toText(r.revision),\n transitionAt: toText(r.transition_at),\n };\n case 'ci':\n return {\n ...base,\n source: 'ci',\n workflow: toText(r.workflow),\n runStatus: toText(r.run_status),\n conclusion: toText(r.conclusion),\n revision: toText(r.revision),\n runUpdatedAt: toText(r.run_updated_at),\n };\n }\n}\n\nfunction sumOf(values: (number | null)[]): number | null {\n const present = values.filter((v): v is number => v !== null);\n return present.length === 0 ? null : present.reduce((a, b) => a + b, 0);\n}\n\n/**\n * Fold records into per-project snapshots. Groups by (project, source, entity)\n * keeping the newest row, then keeps only entities seen in each source's latest\n * poll so entities the collector stopped reporting do not linger.\n */\nexport function foldProjectSnapshots(\n records: readonly ProjectObservabilityRecord[],\n): ProjectObservabilitySnapshot[] {\n const latest = new Map<string, ProjectObservabilityRecord>();\n for (const rec of records) {\n const key = JSON.stringify([rec.project, rec.source, rec.entity]);\n const cur = latest.get(key);\n if (!cur || rec.observedAtMicros > cur.observedAtMicros)\n latest.set(key, rec);\n }\n const poll = new Map<string, number>();\n for (const rec of latest.values()) {\n const key = `${rec.project}\\u0000${rec.source}`;\n poll.set(key, Math.max(poll.get(key) ?? 0, rec.observedAtMicros));\n }\n const byProject = new Map<string, ProjectObservabilityRecord[]>();\n for (const rec of latest.values()) {\n if (\n rec.observedAtMicros !== poll.get(`${rec.project}\\u0000${rec.source}`)\n ) {\n continue;\n }\n const list = byProject.get(rec.project) ?? [];\n list.push(rec);\n byProject.set(rec.project, list);\n }\n return [...byProject.entries()]\n .sort(([a], [b]) => a.localeCompare(b))\n .map(([projectId, recs]) => buildSnapshot(projectId, recs));\n}\n\nfunction buildSnapshot(\n projectId: string,\n recs: ProjectObservabilityRecord[],\n): ProjectObservabilitySnapshot {\n const records = {\n matomo: [],\n glitchtip: [],\n bifrost: [],\n workloads: [],\n deployments: [],\n ci: [],\n } as ProjectObservabilitySnapshot['records'];\n const sources: ProjectObservabilitySnapshot['sources'] = {};\n let newest = 0;\n for (const rec of recs.sort((a, b) => a.entity.localeCompare(b.entity))) {\n newest = Math.max(newest, rec.observedAtMicros);\n if (rec.entity === CONNECTION || !sources[rec.source]) {\n sources[rec.source] = {\n status: rec.status,\n observedAtMicros: rec.observedAtMicros,\n lastSuccessAtMicros: rec.lastSuccessAtMicros,\n };\n }\n if (rec.entity !== CONNECTION) {\n (records[rec.source] as ProjectObservabilityRecord[]).push(rec);\n }\n }\n const deploys = records.workloads.filter((w) => w.desiredReplicas !== null);\n const aiRolling = records.bifrost.filter(\n (b) => b.period === 'rolling_24h' && b.totalTokens !== null,\n );\n return {\n projectId,\n observedAtMicros: newest,\n observedAt: new Date(Math.floor(newest / 1000)).toISOString(),\n sources,\n records,\n summary: {\n visitors: sumOf(records.matomo.map((m) => m.visitors)),\n errorEvents: sumOf(records.glitchtip.map((g) => g.errorEvents)),\n aiTotalTokens: sumOf(aiRolling.map((b) => b.totalTokens)),\n aiEstimatedCostUsd: sumOf(aiRolling.map((b) => b.estimatedCostUsd)),\n workloadsDesired: sumOf(deploys.map((w) => w.desiredReplicas)),\n workloadsReady: sumOf(deploys.map((w) => w.readyReplicas)),\n deploymentsReady:\n records.deployments.length === 0\n ? null\n : records.deployments.filter((d) => d.ready === 'True').length,\n deploymentsTotal:\n records.deployments.length === 0 ? null : records.deployments.length,\n latestCi: records.ci.map((c) => ({\n repository: c.entity,\n conclusion: c.conclusion,\n })),\n },\n };\n}\n\nfunction isBrowser(): boolean {\n const g = globalThis as { window?: unknown; document?: unknown };\n return typeof g.window !== 'undefined' && typeof g.document !== 'undefined';\n}\n\n/** Read-only client for the per-project observability stream. */\nexport class OpenObserveStreamReader {\n private readonly options: OpenObserveStreamReaderOptions;\n private readonly org: string;\n private readonly stream: string;\n\n constructor(options: OpenObserveStreamReaderOptions) {\n const org = options.org ?? 'default';\n const stream = options.stream ?? 'project_observability';\n if (!NAME_PATTERN.test(org) || !NAME_PATTERN.test(stream)) {\n throw new OpenObserveReadError('Invalid org or stream name');\n }\n this.options = options;\n this.org = org;\n this.stream = stream;\n }\n\n /** Every collector snapshot row in the window, newest poll first. */\n async queryWindow(\n query: ProjectObservabilityQuery = {},\n ): Promise<ProjectObservabilityRecord[]> {\n const where = this.where(query.projectIds);\n const sql = `SELECT * FROM \"${this.stream}\"${where} ORDER BY observed_at DESC`;\n return this.search(query, sql);\n }\n\n /**\n * Latest snapshot per project in the window (default last 24h). The newest row\n * per (project, source, entity) is chosen server-side, so the row cap bounds\n * distinct entities, not poll history.\n */\n async latestPerProject(\n query: ProjectObservabilityQuery = {},\n ): Promise<ProjectObservabilitySnapshot[]> {\n const where = this.where(query.projectIds);\n const sql =\n `SELECT * FROM (SELECT *, row_number() OVER (PARTITION BY project, source, entity ORDER BY observed_at DESC) AS rn ` +\n `FROM \"${this.stream}\"${where}) WHERE rn = 1 ORDER BY project, source, entity`;\n return foldProjectSnapshots(await this.search(query, sql));\n }\n\n private where(projectIds?: readonly string[]): string {\n const clauses = [`record_kind = 'snapshot'`];\n if (projectIds && projectIds.length > 0) {\n for (const id of projectIds) {\n if (!PROJECT_ID_PATTERN.test(id)) {\n throw new OpenObserveReadError('Invalid project id in query');\n }\n }\n clauses.push(\n `project IN (${projectIds.map((id) => `'${id}'`).join(', ')})`,\n );\n }\n return ` WHERE ${clauses.join(' AND ')}`;\n }\n\n private async search(\n query: ProjectObservabilityQuery,\n sql: string,\n ): Promise<ProjectObservabilityRecord[]> {\n if (isBrowser()) {\n throw new OpenObserveReadError(\n 'OpenObserveStreamReader is server-only and cannot run in a browser',\n );\n }\n const now = (this.options.now ?? (() => new Date()))();\n const end = query.end ?? now;\n const start = query.start ?? new Date(end.getTime() - DAY_MS);\n if (Number.isNaN(start.getTime()) || Number.isNaN(end.getTime())) {\n throw new OpenObserveReadError('Query window contains an invalid date');\n }\n if (start.getTime() >= end.getTime()) {\n throw new OpenObserveReadError('Query window start must precede end');\n }\n\n const endpoint =\n typeof this.options.endpoint === 'function'\n ? await this.options.endpoint()\n : this.options.endpoint;\n const credential = await this.options.credential();\n if (!endpoint || !credential) {\n throw new OpenObserveReadError(\n 'OpenObserve endpoint and credential must be configured',\n );\n }\n const maxRows = this.options.maxRows ?? 5000;\n const url = `${endpoint.replace(/\\/+$/, '')}/api/${this.org}/_search`;\n const body = JSON.stringify({\n query: {\n sql,\n start_time: start.getTime() * 1000,\n end_time: end.getTime() * 1000,\n from: 0,\n size: maxRows + 1,\n },\n });\n\n const doFetch = this.options.fetch ?? fetch;\n const redact = (text: string): string =>\n text.split(credential).join('[redacted]').slice(0, 200);\n let response: Response;\n try {\n response = await doFetch(url, {\n method: 'POST',\n headers: {\n Authorization: `${this.options.authScheme ?? 'Basic'} ${credential}`,\n 'Content-Type': 'application/json',\n Accept: 'application/json',\n },\n body,\n signal: AbortSignal.timeout(this.options.timeoutMs ?? 10_000),\n });\n } catch (error) {\n const reason = error instanceof Error ? error.name : 'error';\n throw new OpenObserveReadError(\n redact(`OpenObserve request failed (${reason})`),\n );\n }\n if (!response.ok) {\n throw new OpenObserveReadError(\n redact(`OpenObserve search failed with HTTP ${response.status}`),\n response.status,\n );\n }\n let payload: unknown;\n try {\n payload = await response.json();\n } catch {\n throw new OpenObserveReadError('OpenObserve returned a non-JSON body');\n }\n const hits = (payload as { hits?: unknown } | null)?.hits;\n if (!Array.isArray(hits)) {\n throw new OpenObserveReadError('OpenObserve response has no hits array');\n }\n if (hits.length > maxRows) {\n throw new OpenObserveReadError(\n `OpenObserve result exceeded the ${maxRows}-row cap; narrow the window or raise maxRows`,\n );\n }\n return hits\n .map(parseProjectObservabilityRecord)\n .filter((rec): rec is ProjectObservabilityRecord => rec !== null);\n }\n}\n\nconst T1 = 1_760_000_000_000_000;\nconst T2 = T1 + 600_000_000;\nfunction polled(project: string, observed: number) {\n return {\n project,\n _timestamp: observed,\n observed_at: observed,\n last_success_at: observed,\n record_kind: 'snapshot',\n status: 'connected',\n };\n}\n\n/**\n * Fixture raw stream hits in the collector's long format (obviously fake data).\n * Project `example-site` has two polls (the older with different values) and a\n * failed GlitchTip source; `example-internal` has only workloads and an\n * unconnected Matomo. Includes an opt-in `codex` configuration row that the\n * reader must ignore.\n */\nexport const PROJECT_OBSERVABILITY_FIXTURE_HITS: readonly Record<\n string,\n unknown\n>[] = [\n // Older poll of example-site.\n {\n ...polled('example-site', T1),\n source: 'matomo',\n entity: '7',\n period: 'today_site_timezone',\n visitors: 100,\n visits: 120,\n actions: 300,\n },\n {\n ...polled('example-site', T1),\n source: 'ci',\n entity: 'example-org/example-site',\n workflow: 'CI',\n run_status: 'completed',\n conclusion: 'failure',\n revision: '0000000000000000000000000000000000000001',\n run_updated_at: '2025-10-09T08:00:00Z',\n },\n // Latest poll of example-site.\n {\n ...polled('example-site', T2),\n source: 'matomo',\n entity: '7',\n period: 'today_site_timezone',\n visitors: 120,\n visits: 150,\n actions: 340,\n },\n {\n ...polled('example-site', T2),\n source: 'bifrost',\n entity: 'vk-example',\n context: 'app',\n period: 'rolling_24h',\n requests: 12,\n input_tokens: 30000,\n output_tokens: 15000,\n total_tokens: 45000,\n estimated_cost_usd: 2.75,\n cost_kind: 'gateway_estimate',\n },\n {\n ...polled('example-site', T2),\n source: 'bifrost',\n entity: 'vk-example:budget-1',\n context: 'app',\n period: '1M',\n budget_usd: 50,\n budget_used_usd: 12.5,\n budget_reset: '2025-10-01T00:00:00Z',\n cost_kind: 'governance_estimate',\n },\n {\n ...polled('example-site', T2),\n source: 'workloads',\n entity: 'example-ns/web',\n namespace: 'example-ns',\n desired_replicas: 2,\n ready_replicas: 2,\n updated_replicas: 2,\n images: 'registry.example.invalid/web:1',\n },\n {\n ...polled('example-site', T2),\n source: 'workloads',\n entity: 'example-ns/web-abc',\n namespace: 'example-ns',\n cpu_cores: 0.05,\n memory_bytes: 104857600,\n measured_at: '2025-10-09T11:59:00Z',\n },\n {\n ...polled('example-site', T2),\n source: 'deployments',\n entity: 'example-site',\n ready: 'True',\n revision: 'main@sha1:0000000000000000000000000000000000000002',\n transition_at: '2025-10-08T10:00:00Z',\n },\n {\n ...polled('example-site', T2),\n source: 'ci',\n entity: 'example-org/example-site',\n workflow: 'CI',\n run_status: 'completed',\n conclusion: 'success',\n revision: '0000000000000000000000000000000000000002',\n run_updated_at: '2025-10-09T11:00:00Z',\n },\n {\n ...polled('example-site', T2),\n source: 'glitchtip',\n entity: 'connection',\n status: 'error',\n last_success_at: undefined,\n },\n {\n project: 'example-site',\n source: 'codex',\n entity: 'connection',\n record_kind: 'configuration',\n status: 'opt_in_import_required',\n _timestamp: T2,\n observed_at: T2,\n },\n // Second project.\n {\n ...polled('example-internal', T2),\n source: 'matomo',\n entity: 'connection',\n status: 'not_connected',\n last_success_at: undefined,\n },\n {\n ...polled('example-internal', T2),\n source: 'workloads',\n entity: 'internal-ns/api',\n namespace: 'internal-ns',\n desired_replicas: 1,\n ready_replicas: 0,\n updated_replicas: 1,\n images: 'registry.example.invalid/api:3',\n },\n];\n\n/** Fixture records parsed from {@link PROJECT_OBSERVABILITY_FIXTURE_HITS}. */\nexport const PROJECT_OBSERVABILITY_FIXTURE_RECORDS: readonly ProjectObservabilityRecord[] =\n PROJECT_OBSERVABILITY_FIXTURE_HITS.map(\n parseProjectObservabilityRecord,\n ).filter((rec): rec is ProjectObservabilityRecord => rec !== null);\n"],"mappings":";AAoCO,IAAM,gCAAgC;CAC3C;CACA;CACA;CACA;CACA;CACA;AACF;AAwLO,IAAM,uBAAN,cAAmC,MAAM;CACrC;CACT,YAAY,SAAiB,QAAiB;EAC5C,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,SAAS;CAChB;AACF;AAGO,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AQ,IAAI"}
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,20 +3,22 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-analytics",
|
|
6
|
-
"packageVersion": "0.
|
|
6
|
+
"packageVersion": "0.61.0",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
12
|
-
"agents": "
|
|
13
|
-
"moduleDoc:agents/browser.md": "af729304f8ffe8106261665b23f7bbeedcf64fdb08a46f22df1f0bea100ab21b"
|
|
10
|
+
"manifest": "f367a4cd4668d6bc6ec635b59619b40034156db4de15ab067a4abcd3443cff60",
|
|
11
|
+
"packageJson": "8289a2dbaa7e07e2a408c7a6c706a6f984250e6d0b83126611ae0932c21741b4",
|
|
12
|
+
"agents": "717c16e4cfe1d56e0d434f46ca4aa1c41c22efc09377a6229ca0d22483e93bfa",
|
|
13
|
+
"moduleDoc:agents/browser.md": "af729304f8ffe8106261665b23f7bbeedcf64fdb08a46f22df1f0bea100ab21b",
|
|
14
|
+
"moduleDoc:agents/observability.md": "6d3ff42d13238aae2e4cf279287fcf505f1fc8bf0e0929d8ab215e7a672178de"
|
|
14
15
|
},
|
|
15
16
|
"exports": [
|
|
16
17
|
".",
|
|
17
18
|
"./browser",
|
|
18
19
|
"./manifest",
|
|
19
20
|
"./manifest.json",
|
|
21
|
+
"./observability",
|
|
20
22
|
"./playground",
|
|
21
23
|
"./svelte",
|
|
22
24
|
"./ui"
|
|
@@ -3637,12 +3639,17 @@
|
|
|
3637
3639
|
"polymorphicAssociations": 0,
|
|
3638
3640
|
"uuidColumns": 22
|
|
3639
3641
|
},
|
|
3640
|
-
"agentDoc": "# @happyvertical/smrt-analytics\n\nGA4/Plausible/Matomo analytics integration with server-side event tracking and AI-powered reporting.\n\n## Models\n\n- **AnalyticsProperty**: GA4 property, Plausible site, or Matomo site. Provider metadata, status, sync timestamps.\n- **AnalyticsDataStream**: web/iOS/Android data streams. Measurement IDs (G-XXXXXX for GA4, Firebase app ID for mobile).\n- **AnalyticsEvent**: tracked events with params (JSON), retry queue, conversion classification.\n- **AnalyticsReport**: saved report configs with dimensions/metrics (JSON), scheduling (daily/weekly/monthly), result caching.\n\nAll models use STI (`tableStrategy: 'sti'`).\n\nAll four persisted models are `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId` (#1410), matching the framework convention used by sibling domain packages (ads/jobs/commerce). **When a tenant context is active**, the interceptor auto-filters `list`/`get`/raw reads and binds `create`/`save` writes to that tenant, keeping one tenant's properties, data streams, events (end-user PII), and cached report rows from reaching another. Because the mode is `optional`, the interceptor intentionally passes **through unfiltered when no tenant context is established** — so a surface is only safe insofar as it establishes tenant context first. Generated SvelteKit routes do this (#1540); the CLI/MCP code paths do not yet, which is a known framework-level residual (fail-closed tenant context for CLI/MCP) tracked outside this package, not an analytics-specific gap.\n\n## Key Collection Methods\n\n`findByExternalId()`, `findByProvider()`, `findNeedingSync()`, `findGA4Properties()`, `findPlausibleSites()`, `findMatomoSites()`\n\n## AI Operations\n\n`analyzePerformance()`, `analyzeResults()`, `hasPositiveTrends()` route through registered prompts (see Prompt Registry below) so tenant overrides apply via `resolvePrompt()`. `isPerformingWell()` still uses the inline `is()` shortcut.\n\n## Prompt Registry\n\nThree prompts are registered at module-load time via `definePrompt()` from `@happyvertical/smrt-prompts`. Re-exported from the package root for tenant override targeting. Tiers follow the #4755 rule (`../prompts/AGENTS.md`); calls bind them through `prepareAiOperation()`.\n\n| Key | Method | Tier | Variables (PII-conscious) |\n|-----|--------|------|---------------------------|\n| `smrtAnalytics.property.analyzePerformance` | `AnalyticsProperty.analyzePerformance()` | `good` | `period`, `propertyDisplayName`, `propertyProvider` |\n| `smrtAnalytics.report.analyzeResults` | `AnalyticsReport.analyzeResults()` | `good` | `reportName`, `reportDimensions`, `reportMetrics`, `dateRangeStart`, `dateRangeEnd`, `rowCount`, `reportData` |\n| `smrtAnalytics.report.hasPositiveTrends` | `AnalyticsReport.hasPositiveTrends()` | `cheap` | `reportMetrics`, `reportData` |\n\n**Excluded from variables (never reach the AI provider):**\n- `id`, `propertyId`, `tenantId`, `externalId` — internal foreign keys / UUIDs that link to identifying records.\n- `apiSecret`, `measurementId`, `siteDomain` — provider credentials and platform-specific identifiers (GA4 API secrets, Matomo `idSite`, custom `G-XXXX` measurement IDs).\n- `providerMetadata` — extensible JSON blob that may contain credentials, account IDs, or other configuration secrets.\n- `lastError`, raw `dimensionFilter` / `metricFilter` JSON — internal error strings (may contain auth tokens) and filter expressions that may reference cookie IDs, user-pseudo-IDs, or IP-derived geos.\n\n**`resultData` is forwarded verbatim.** This package does not — and cannot — strip PII from result rows, because the row schema is determined by the dimensions/metrics the caller asked the analytics provider to return. If the caller persists rows containing a `userPseudoId`, `clientId`, IP-derived geolocation, or any other identifier, those fields WILL reach the AI provider. Callers must:\n\n- exclude PII-bearing dimensions before persisting `resultData` (e.g. don't request `userPseudoId` as a GA4 dimension), or\n- apply a column allowlist at the call site before invoking `analyzeResults()`, or\n- override the prompt template via `PromptOverride` to redact rows.\n\nThe forwarding contract is pinned by a regression test in `src/__tests__/analytics-report-prompt.test.ts`.\n\nSee `src/prompts.ts` for the full rationale block.\n\n## UI Registry\n\nSvelte components live in `src/svelte/` and auto-register with `ModuleUIRegistry` from `@happyvertical/smrt-ui/registry` when `@happyvertical/smrt-analytics/svelte` is imported.\n\nSlot declarations live in `src/ui.ts`, exported via the `./ui` package subpath. The slots are: `analytics-summary`, `events-table`, `property-info`, `property-status-badge`, `stat-card`, `trend-badge` (see `ANALYTICS_UI_SLOTS` for icons / categories / display order).\n\n```typescript\nimport '@happyvertical/smrt-analytics/svelte'; // side-effect: registers slots\nimport { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';\nconst StatCard = ModuleUIRegistry.get('@happyvertical/smrt-analytics', 'stat-card');\n```\n\n## Recipes (#3719)\n\n`src/recipes.ts` declares `analytics.reports` (`AnalyticsReportsRecipe`:\n`AnalyticsProperty` and `AnalyticsReport`), emitted into the built\n`manifest.json` and `smrt-knowledge.json` `recipes`. `AnalyticsEvent` and\n`AnalyticsDataStream` are left out: event tracking and stream setup are separate\nconcerns. User-facing help is `src/reports.recipe.md` (#3591); keep it and the\n`@field({ description })` text on the two models in plain language, and never\nreference a `sensitive` field (`apiSecret`, `providerMetadata`) in help.\n\n- **Runtime is `server`.** Reports and their rows live in the app database, the\n AI summary needs a server-held key, and provider credentials sit on the\n property row (so no `providers` are declared: there are no env secrets to name).\n- **One route, deliberately.** `/analytics/summary` mounts\n `@happyvertical/smrt-analytics/svelte#AnalyticsSummary`, which renders an empty\n state without data. `PropertyInfo` and `EventsTable` take required row props\n and throw with none, so they are not routes; a host places them in its own\n pages. Add a route only for a component that survives being mounted bare.\n- **No demo seed.** The playground sample data is module-local, not an export.\n- **What the assistant can do.** Generated MCP exposes `list` and `get` on\n `AnalyticsReport` only; `analyzeResults()` is a model method the app calls,\n not a tool. The help says so and points at `reports.query` (declared reports,\n `@happyvertical/smrt-reports`) and `reports.runtime.*` (runtime reports,\n `@happyvertical/smrt-chat`) for aggregates over the app's own data.\n\n`src/__tests__/recipes.test.ts` runs the real scan, manifest and generation\npasses in memory and renders the help. See\n[core recipes](../core/agents/recipes.md).\n\n## Gotchas\n\n- **`apiSecret` / `providerMetadata` stripped from API/MCP**: marked `@field({ sensitive: true })` (#1540) so they never appear in generated responses or `where` filters. They are still stored at rest **unencrypted** — envelope encryption via `@happyvertical/smrt-secrets` is a separate, breaking follow-up (tracked, not done here).\n- **Event retry at model level**: no background job integration\n- **JSON fields**: params, dimensions, metrics use string storage with getter/setter helpers\n- **Measurement IDs differ per platform**: G-XXXXXX (GA4 web) vs Firebase app ID (mobile)\n- **`analyzeResults` is now a single AI call**: previously issued a second freeform `do()` to summarize \"top 3 insights\"; folded into the registered template, and `insights` mirrors `analysis` in the response shape.\n\n## Browser tracking (#4251)\n\nThe isolated `./browser` subpath owns the optional browser tracker and Matomo\nHTTP adapter; it must never import model registration or the server SDK.\nThe optional `smrt-ui/analytics` context connects shared component standard\nevents to the configured provider. See [browser contract](agents/browser.md).\n",
|
|
3642
|
+
"agentDoc": "# @happyvertical/smrt-analytics\n\nGA4/Plausible/Matomo analytics integration with server-side event tracking and AI-powered reporting.\n\n## Models\n\n- **AnalyticsProperty**: GA4 property, Plausible site, or Matomo site. Provider metadata, status, sync timestamps.\n- **AnalyticsDataStream**: web/iOS/Android data streams. Measurement IDs (G-XXXXXX for GA4, Firebase app ID for mobile).\n- **AnalyticsEvent**: tracked events with params (JSON), retry queue, conversion classification.\n- **AnalyticsReport**: saved report configs with dimensions/metrics (JSON), scheduling (daily/weekly/monthly), result caching.\n\nAll models use STI (`tableStrategy: 'sti'`).\n\nAll four persisted models are `@TenantScoped({ mode: 'optional' })` with a nullable `tenantId` (#1410), matching the framework convention used by sibling domain packages (ads/jobs/commerce). **When a tenant context is active**, the interceptor auto-filters `list`/`get`/raw reads and binds `create`/`save` writes to that tenant, keeping one tenant's properties, data streams, events (end-user PII), and cached report rows from reaching another. Because the mode is `optional`, the interceptor intentionally passes **through unfiltered when no tenant context is established** — so a surface is only safe insofar as it establishes tenant context first. Generated SvelteKit routes do this (#1540); the CLI/MCP code paths do not yet, which is a known framework-level residual (fail-closed tenant context for CLI/MCP) tracked outside this package, not an analytics-specific gap.\n\n## Key Collection Methods\n\n`findByExternalId()`, `findByProvider()`, `findNeedingSync()`, `findGA4Properties()`, `findPlausibleSites()`, `findMatomoSites()`\n\n## AI Operations\n\n`analyzePerformance()`, `analyzeResults()`, `hasPositiveTrends()` route through registered prompts (see Prompt Registry below) so tenant overrides apply via `resolvePrompt()`. `isPerformingWell()` still uses the inline `is()` shortcut.\n\n## Prompt Registry\n\nThree prompts are registered at module-load time via `definePrompt()` from `@happyvertical/smrt-prompts`. Re-exported from the package root for tenant override targeting. Tiers follow the #4755 rule (`../prompts/AGENTS.md`); calls bind them through `prepareAiOperation()`.\n\n| Key | Method | Tier | Variables (PII-conscious) |\n|-----|--------|------|---------------------------|\n| `smrtAnalytics.property.analyzePerformance` | `AnalyticsProperty.analyzePerformance()` | `good` | `period`, `propertyDisplayName`, `propertyProvider` |\n| `smrtAnalytics.report.analyzeResults` | `AnalyticsReport.analyzeResults()` | `good` | `reportName`, `reportDimensions`, `reportMetrics`, `dateRangeStart`, `dateRangeEnd`, `rowCount`, `reportData` |\n| `smrtAnalytics.report.hasPositiveTrends` | `AnalyticsReport.hasPositiveTrends()` | `cheap` | `reportMetrics`, `reportData` |\n\n**Excluded from variables (never reach the AI provider):**\n- `id`, `propertyId`, `tenantId`, `externalId` — internal foreign keys / UUIDs that link to identifying records.\n- `apiSecret`, `measurementId`, `siteDomain` — provider credentials and platform-specific identifiers (GA4 API secrets, Matomo `idSite`, custom `G-XXXX` measurement IDs).\n- `providerMetadata` — extensible JSON blob that may contain credentials, account IDs, or other configuration secrets.\n- `lastError`, raw `dimensionFilter` / `metricFilter` JSON — internal error strings (may contain auth tokens) and filter expressions that may reference cookie IDs, user-pseudo-IDs, or IP-derived geos.\n\n**`resultData` is forwarded verbatim.** This package does not — and cannot — strip PII from result rows, because the row schema is determined by the dimensions/metrics the caller asked the analytics provider to return. If the caller persists rows containing a `userPseudoId`, `clientId`, IP-derived geolocation, or any other identifier, those fields WILL reach the AI provider. Callers must:\n\n- exclude PII-bearing dimensions before persisting `resultData` (e.g. don't request `userPseudoId` as a GA4 dimension), or\n- apply a column allowlist at the call site before invoking `analyzeResults()`, or\n- override the prompt template via `PromptOverride` to redact rows.\n\nThe forwarding contract is pinned by a regression test in `src/__tests__/analytics-report-prompt.test.ts`.\n\nSee `src/prompts.ts` for the full rationale block.\n\n## UI Registry\n\nSvelte components live in `src/svelte/` and auto-register with `ModuleUIRegistry` from `@happyvertical/smrt-ui/registry` when `@happyvertical/smrt-analytics/svelte` is imported.\n\nSlot declarations live in `src/ui.ts`, exported via the `./ui` package subpath. The slots are: `analytics-summary`, `events-table`, `property-info`, `property-status-badge`, `stat-card`, `trend-badge` (see `ANALYTICS_UI_SLOTS` for icons / categories / display order).\n\n```typescript\nimport '@happyvertical/smrt-analytics/svelte'; // side-effect: registers slots\nimport { ModuleUIRegistry } from '@happyvertical/smrt-ui/registry';\nconst StatCard = ModuleUIRegistry.get('@happyvertical/smrt-analytics', 'stat-card');\n```\n\n## Recipes (#3719)\n\n`src/recipes.ts` declares `analytics.reports` (`AnalyticsReportsRecipe`:\n`AnalyticsProperty` and `AnalyticsReport`), emitted into the built\n`manifest.json` and `smrt-knowledge.json` `recipes`. `AnalyticsEvent` and\n`AnalyticsDataStream` are left out: event tracking and stream setup are separate\nconcerns. User-facing help is `src/reports.recipe.md` (#3591); keep it and the\n`@field({ description })` text on the two models in plain language, and never\nreference a `sensitive` field (`apiSecret`, `providerMetadata`) in help.\n\n- **Runtime is `server`.** Reports and their rows live in the app database, the\n AI summary needs a server-held key, and provider credentials sit on the\n property row (so no `providers` are declared: there are no env secrets to name).\n- **One route, deliberately.** `/analytics/summary` mounts\n `@happyvertical/smrt-analytics/svelte#AnalyticsSummary`, which renders an empty\n state without data. `PropertyInfo` and `EventsTable` take required row props\n and throw with none, so they are not routes; a host places them in its own\n pages. Add a route only for a component that survives being mounted bare.\n- **No demo seed.** The playground sample data is module-local, not an export.\n- **What the assistant can do.** Generated MCP exposes `list` and `get` on\n `AnalyticsReport` only; `analyzeResults()` is a model method the app calls,\n not a tool. The help says so and points at `reports.query` (declared reports,\n `@happyvertical/smrt-reports`) and `reports.runtime.*` (runtime reports,\n `@happyvertical/smrt-chat`) for aggregates over the app's own data.\n\n`src/__tests__/recipes.test.ts` runs the real scan, manifest and generation\npasses in memory and renders the help. See\n[core recipes](../core/agents/recipes.md).\n\n## Gotchas\n\n- **`apiSecret` / `providerMetadata` stripped from API/MCP**: marked `@field({ sensitive: true })` (#1540) so they never appear in generated responses or `where` filters. They are still stored at rest **unencrypted** — envelope encryption via `@happyvertical/smrt-secrets` is a separate, breaking follow-up (tracked, not done here).\n- **Event retry at model level**: no background job integration\n- **JSON fields**: params, dimensions, metrics use string storage with getter/setter helpers\n- **Measurement IDs differ per platform**: G-XXXXXX (GA4 web) vs Firebase app ID (mobile)\n- **`analyzeResults` is now a single AI call**: previously issued a second freeform `do()` to summarize \"top 3 insights\"; folded into the registered template, and `insights` mirrors `analysis` in the response shape.\n\n## Browser tracking (#4251)\n\nThe isolated `./browser` subpath owns the optional browser tracker and Matomo\nHTTP adapter; it must never import model registration or the server SDK.\nThe optional `smrt-ui/analytics` context connects shared component standard\nevents to the configured provider. See [browser contract](agents/browser.md).\n\n## OpenObserve stream reader (#4908)\n\nThe server-only `./observability` subpath reads the\n`default/project_observability` stream (latest row per project, time window)\nwith a credential resolved from the secrets store at call time; never export it\nthrough the root or `./browser` barrels, and never log credentials. See\n[observability contract](agents/observability.md).\n",
|
|
3641
3643
|
"moduleDocs": [
|
|
3642
3644
|
{
|
|
3643
3645
|
"path": "agents/browser.md",
|
|
3644
3646
|
"module": "browser",
|
|
3645
3647
|
"content": "# Browser analytics (#4251)\n\n`@happyvertical/smrt-analytics/browser` is an isolated browser entry, without\nmodel registration or server SDK imports. SDK analytics already owns server\nMatomo reporting/tracking/admin; its Node transport is not browser-compatible.\nThis adapter uses Matomo's free Tracking HTTP API:\nhttps://developer.matomo.org/api-reference/tracking-api\n\nHosts install `setAnalyticsContext(name => tracker?.track(name))` from\n`@happyvertical/smrt-ui/analytics` during root component initialization, then\ncreate/dispose a tracker on browser mount/config changes. Standard events are\nallowlisted by default; apps add only business-specific static definitions.\n`STANDARD_ANALYTICS_EVENTS` is also exported for inspection.\nComponents have no Matomo dependency and absent context is a noop. Configure\n`PUBLIC_ANALYTICS_ENABLED=true`, `PUBLIC_MATOMO_URL`, `PUBLIC_MATOMO_SITE_ID`.\nDevelopment additionally requires `PUBLIC_ANALYTICS_ALLOW_DEVELOPMENT=true`.\nOptional `PUBLIC_ANALYTICS_HEARTBEAT_SECONDS` (minimum 5) sends a Matomo ping\nonly while the document is visible/focused. No background/unload listeners.\n\nOn SvelteKit afterNavigate, use `safeRoutePath(page.route.id)` (null excludes\nunknown routes), combine with origin and a static title, then `pageview`.\nDo not pass location.pathname for dynamic routes. Queries/fragments are always\nremoved. Virtual pages and iframe event-only `context({url,title})` are supported.\nNo browser location URL, referrer or document title is read implicitly.\n\nShared events: Planner opened and successful explicit cookbook application;\nproject question open→answered and decision open→decided; preview link open\n(engagement), pending→approved/rejected (persisted props). Initial historical\nrows and unchanged/error/cancelled results never count as conversions. Planner\nhydration does not count as applying a cookbook. Apps must update authoritative\nprops after their saves and must not emit these events again. No shared\ninvitation acceptance UI exists, so this slice cannot claim that server outcome.\nNo server-side conversion retry/attribution or exact-once persistence is promised.\n\nViews dedupe consecutive sanitized URLs; events dedupe per static key and page\ncontext. Counts therefore measure a successful outcome per view, not total\ntransactions. Business outcomes can pass `track(key, {dedupeKey: receiptId})`\nfor distinct confirmed submissions; this key stays in memory and never enters\nthe provider payload. Failed transport is best effort without retries/logging, and\nno-cors responses cannot prove Matomo acceptance. Actual collector receipt is a\nseparate integration check. Network requests carry no cookie, HTTP referrer,\nvisitor ID, private data, dimensions, query, token, chat, email or freeform input.\nThe server naturally receives IP/User-Agent headers; configure Matomo retention\nand IP anonymization at the deployment boundary. No unique visitor accuracy is\npromised without an identifier. CSP connect-src must allow the configured host.\n\n## Behavior-to-test matrix\n\nAll rows: actor browser visitor; executor N/A (no persistence/transactions);\nSQL dialect N/A (no database); runtime browser and inert SSR.\n\n| Invariant | Trigger / positive | Negative | Edge / level / command |\n|---|---|---|---|\n| Config gating | explicit production enable | missing, malformed, dev, SSR | env public strings; unit; analytics browser.test.ts |\n| Privacy/navigation | template page + static allowlist | query/hash, unknown key/cross-origin | provider seam; unit; analytics browser.test.ts |\n| Lifecycle/dedupe | new SPA route + success | repeated route/key, disposed | timer/provider errors; unit; analytics browser.test.ts |\n| Engagement | visible focused interval | hidden/unfocused/disposed | timer; unit; analytics browser.test.ts |\n| Matomo protocol | view/event/ping | invalid endpoint/site | fetch minimal payload/failure; unit; analytics browser.test.ts |\n| Auto shared outcomes | observed persisted transition | historical, unchanged/failure, rerender | context + component; ui analytics and projects UI tests |\n| Planner success | explicit applied signal | hydration, failed commands, unmounted | state + lifecycle; planner tests |\n\nFocused validation uses package `exec vitest run` with the named tests; build\nsmrt-ui first, then analytics/projects/planner; verify package exports afterward.\nThis is a new feature; base bug reproduction N/A.\n"
|
|
3648
|
+
},
|
|
3649
|
+
{
|
|
3650
|
+
"path": "agents/observability.md",
|
|
3651
|
+
"module": "observability",
|
|
3652
|
+
"content": "# OpenObserve stream reader (#4908)\n\n`@happyvertical/smrt-analytics/observability` is a **server-only**, read-only\nclient for the OpenObserve stream `default/project_observability`. It is a\ndedicated subpath: never re-exported from the package root or `./browser`, no\nmodel registration, and it throws `OpenObserveReadError` if run in a browser.\n\n```ts\nimport {\n OpenObserveStreamReader,\n credentialFromSecret,\n} from '@happyvertical/smrt-analytics/observability';\n\nconst reader = new OpenObserveStreamReader({\n endpoint: () => config.openobserve.url, // resolved per call\n credential: credentialFromSecret(secretService, 'openobserve.read'),\n});\nconst projects = await reader.latestPerProject(); // snapshot per project, last 24h\nconst rows = await reader.queryWindow({ start, end, projectIds: ['site-a'] });\n```\n\n## Stream shape (source of truth: iac `project-observability/runtime.py`)\n\nThe collector writes **long-format** rows every 10 minutes: one row per\n(project, source, entity) per poll. Common columns: `project`, `source`,\n`entity`, `record_kind` (`snapshot`), `status` (`connected`, `not_connected`,\n`error`), `_timestamp`, `observed_at`, `last_success_at` (microseconds).\nSource-specific columns:\n\n- `matomo`: `period`, `visitors`, `visits`, `actions`\n- `glitchtip`: `period`, `window_start`, `window_end`, `error_events`,\n `error_events_current_hour`\n- `bifrost`: `context`, `period`, `requests`, `input_tokens`, `output_tokens`,\n `total_tokens`, `estimated_cost_usd`, `budget_usd`, `budget_used_usd`,\n `budget_reset`, `cost_kind`\n- `workloads`: deployment rows (`namespace`, `desired/ready/updated_replicas`,\n `images`) and pod rows (`cpu_cores`, `memory_bytes`, `measured_at`)\n- `deployments`: `ready`, `revision`, `transition_at`\n- `ci`: `workflow`, `run_status`, `conclusion`, `revision`, `run_updated_at`\n\nA source with no data or a failed poll is one row with entity `connection` and\nstatus `not_connected` or `error`. `codex`/`claude` configuration rows and\nnon-`snapshot` rows are ignored.\n\n## Reader behavior\n\n- `parseProjectObservabilityRecord()` yields a typed record per source\n (`ProjectObservabilityRecord`, discriminated by `source`). Fields a row does\n not carry are `null`, never `0`.\n- `latestPerProject()` picks the newest row per (project, source, entity) in SQL\n (window function), then `foldProjectSnapshots()` keeps only entities from each\n source's latest poll and builds a `ProjectObservabilitySnapshot`: per-source\n `sources` state, latest `records`, and a `summary` (visitors, error events,\n AI tokens and USD estimate from `rolling_24h` rows, replicas, Flux ready\n counts, latest CI per repository).\n- Not provided by the collector, so not modeled: a detail-dashboard URL (the\n dashboards use id `project-<project id>`; build the link in the app) and\n integer-minor-unit AI cost (the collector reports a USD gateway estimate).\n- `queryWindow()` returns raw records newest first. Both methods throw when the result exceeds\n result exceeds `maxRows` (default 5000) instead of silently truncating.\n- Invalid `start`/`end` dates are rejected. Project ids must match the\n collector's `[a-z][a-z0-9-]{0,62}`; org and stream names are validated.\n\n## Credential and tests\n\nThe credential is a read-only OpenObserve credential from the secrets store\n(`SecretService.retrieve` via structural `ObservabilitySecretSource`; no\n`smrt-secrets` dependency, DAG #1582). It is resolved on every call, sent only\nin the `Authorization` header (`Basic` by default, or `Bearer`), and scrubbed\nfrom errors. `PROJECT_OBSERVABILITY_FIXTURE_HITS` / `_RECORDS` are fake\nlong-format fixtures; tests inject `fetch` with placeholder tokens, no\ncontainers.\n"
|
|
3646
3653
|
}
|
|
3647
3654
|
],
|
|
3648
3655
|
"recipes": [
|
|
@@ -5,10 +5,10 @@ description: "Analytics integration models for SMRT framework"
|
|
|
5
5
|
status: "stable"
|
|
6
6
|
generated:
|
|
7
7
|
by: "smrt/scripts/generate-knowledge-okf.ts"
|
|
8
|
-
at: "2026-11-
|
|
8
|
+
at: "2026-11-13T17:44:32Z"
|
|
9
9
|
audience: "internal"
|
|
10
10
|
evidence_level: "source-inspected"
|
|
11
|
-
source_revision: "sha256:
|
|
11
|
+
source_revision: "sha256:2a5d43d02ab7c8fb5d86757d6e9559bf7ac6b4d955c0e5bcba3a188318636194"
|
|
12
12
|
sources:
|
|
13
13
|
- id: "manifest"
|
|
14
14
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/analytics/package.json"
|
|
@@ -19,6 +19,9 @@ sources:
|
|
|
19
19
|
- id: "agents-2"
|
|
20
20
|
resource: "https://github.com/happyvertical/smrt/blob/main/packages/analytics/agents/browser.md"
|
|
21
21
|
title: "@happyvertical/smrt-analytics packages/analytics/agents/browser.md"
|
|
22
|
+
- id: "agents-3"
|
|
23
|
+
resource: "https://github.com/happyvertical/smrt/blob/main/packages/analytics/agents/observability.md"
|
|
24
|
+
title: "@happyvertical/smrt-analytics packages/analytics/agents/observability.md"
|
|
22
25
|
---
|
|
23
26
|
|
|
24
27
|
# @happyvertical/smrt-analytics
|
|
@@ -34,6 +37,7 @@ sources:
|
|
|
34
37
|
|
|
35
38
|
- `packages/analytics/AGENTS.md`
|
|
36
39
|
- `packages/analytics/agents/browser.md`
|
|
40
|
+
- `packages/analytics/agents/observability.md`
|
|
37
41
|
|
|
38
42
|
## Framework dependencies
|
|
39
43
|
|
|
@@ -55,6 +59,7 @@ sources:
|
|
|
55
59
|
- `./browser`
|
|
56
60
|
- `./manifest`
|
|
57
61
|
- `./manifest.json`
|
|
62
|
+
- `./observability`
|
|
58
63
|
- `./playground`
|
|
59
64
|
- `./svelte`
|
|
60
65
|
- `./ui`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-analytics",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Analytics integration models for SMRT framework",
|
|
6
6
|
"type": "module",
|
|
@@ -35,14 +35,18 @@
|
|
|
35
35
|
"./browser": {
|
|
36
36
|
"types": "./dist/browser.d.ts",
|
|
37
37
|
"import": "./dist/browser.js"
|
|
38
|
+
},
|
|
39
|
+
"./observability": {
|
|
40
|
+
"types": "./dist/observability.d.ts",
|
|
41
|
+
"import": "./dist/observability.js"
|
|
38
42
|
}
|
|
39
43
|
},
|
|
40
44
|
"dependencies": {
|
|
41
|
-
"@happyvertical/smrt-core": "0.
|
|
42
|
-
"@happyvertical/smrt-prompts": "0.
|
|
43
|
-
"@happyvertical/smrt-tenancy": "0.
|
|
44
|
-
"@happyvertical/smrt-types": "0.
|
|
45
|
-
"@happyvertical/smrt-ui": "0.
|
|
45
|
+
"@happyvertical/smrt-core": "0.61.0",
|
|
46
|
+
"@happyvertical/smrt-prompts": "0.61.0",
|
|
47
|
+
"@happyvertical/smrt-tenancy": "0.61.0",
|
|
48
|
+
"@happyvertical/smrt-types": "0.61.0",
|
|
49
|
+
"@happyvertical/smrt-ui": "0.61.0"
|
|
46
50
|
},
|
|
47
51
|
"peerDependencies": {
|
|
48
52
|
"svelte": "^5.57.0"
|
|
@@ -53,9 +57,9 @@
|
|
|
53
57
|
}
|
|
54
58
|
},
|
|
55
59
|
"devDependencies": {
|
|
56
|
-
"@happyvertical/smrt-scanner": "0.
|
|
57
|
-
"@happyvertical/smrt-vitest": "0.
|
|
58
|
-
"@happyvertical/sql": "^0.112.
|
|
60
|
+
"@happyvertical/smrt-scanner": "0.61.0",
|
|
61
|
+
"@happyvertical/smrt-vitest": "0.61.0",
|
|
62
|
+
"@happyvertical/sql": "^0.112.3",
|
|
59
63
|
"@sveltejs/package": "^2.5.8",
|
|
60
64
|
"@types/node": "24.13.6",
|
|
61
65
|
"svelte-check": "^4.7.6",
|