From 9ef1313a7a5c658bf66d9ff7be8eb37325a95ce0 Mon Sep 17 00:00:00 2001 From: Jordan Ritter Date: Wed, 17 Jun 2026 10:51:12 -0700 Subject: [PATCH] =?UTF-8?q?Release=20v1.15.3=20=E2=80=94=20analytics:=20hi?= =?UTF-8?q?de=20blocked=20from=20empty-results,=20add=20Blocked=20Queries?= =?UTF-8?q?=20panel,=20Pacific=20timestamps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Empty Result Queries (Last 7 days) excludes blocked=true rows so the v1.15.2 blocklist short-circuits don't double-count as 'real users found nothing' content gaps. Predicate is 'blocked = false', safe for historical rows (schema declares BOOLEAN NOT NULL DEFAULT FALSE). - New Blocked Queries (Last 7 days) panel on /analytics — count + last_seen + up to 5 sample queries per block_reason, surfaced via a new /api/analytics/blocked-queries route. Window honors 'days' but no filter wiring (the rows the blocklist short-circuited never reached the layer filters describe). - Every absolute timestamp on the /analytics dashboard now renders in America/Los_Angeles via Intl.DateTimeFormat (DST-aware: PDT in summer, PST in winter). Storage (Postgres TIMESTAMPTZ in UTC), server window math, and URL from/to contract are unchanged — only display flips. --- CHANGELOG.md | 8 + docs/analytics.html | 313 ++++++++++++++---- package.json | 2 +- .../analytics-auth-length-check.test.ts | 2 + src/__tests__/analytics-error-log-ip.test.ts | 4 + .../analytics-sendfile-correlation.test.ts | 1 + src/__tests__/analytics-server.test.ts | 84 +++++ src/__tests__/analytics-ui.test.ts | 211 ++++++++++++ src/__tests__/analytics.test.ts | 100 ++++++ src/cli.ts | 2 +- src/db/analytics.ts | 100 ++++++ src/server.ts | 30 ++ 12 files changed, 798 insertions(+), 59 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82b9d24..7ea720d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # @copilotkit/pathfinder +## 1.15.3 + +### Patch Changes + +- **Analytics view — "Empty Result Queries" excludes blocked rows**: rows the v1.15.2 abuse blocklist short-circuited (`blocked = true`) are filtered out of the "Empty Result Queries (Last 7 days)" table. Those queries never reached retrieval, so `result_count = 0` is a known by-design outcome — not a content gap. Previously they showed up alongside genuine empty-result rows because the SQL filtered on `result_count = 0` alone. The blocked-column predicate is `blocked = false`, which is safe for historical rows that predate the column (the schema declares `BOOLEAN NOT NULL DEFAULT FALSE`). +- **New "Blocked Queries (Last 7 days)" panel on /analytics**: surfaces the rows the blocklist caught, grouped by `block_reason` with hit count, last-seen timestamp, and up to 5 sample queries per reason. Operators can now see the blocklist actively catching abuse instead of inferring it from the absence of off-topic rows in the empty-results table. The panel deliberately ignores tool/source/request-source filters — those carry no meaning for rows the blocklist short-circuited before retrieval — but does honor the same `days` window as the rest of the dashboard. +- **Analytics timestamps render in Pacific time (DST-aware)**: every absolute timestamp on the /analytics operator-facing page now renders in `America/Los_Angeles` via `Intl.DateTimeFormat`, emitting e.g. `2026-06-17 09:40:32 PDT` (or `PST` in winter). The dashboard is operated from Pacific; UTC timestamps forced an in-head conversion on every read. Storage and URL contracts are unchanged — Postgres still stores `created_at TIMESTAMPTZ` in UTC, the server still computes windows in UTC, and the URL `from`/`to` contract is still a UTC calendar date. Only display flips. + ## 1.15.2 ### Patch Changes diff --git a/docs/analytics.html b/docs/analytics.html index ce460dc..502d3e8 100644 --- a/docs/analytics.html +++ b/docs/analytics.html @@ -4,19 +4,41 @@ Pathfinder Analytics - - - - - - - - - - - - - + + + + + + + + + + + + +