CHANGELOG
v1.2.0-dev - 2026-02-25
PHASE_55 — KPI Cube
KPI-1/2: KpiCubeBuilder + 10 canonical patterns:
lib/ai/kpi-cube.ts(new) —buildCubeForDataset(datasetId, schema)builds Redis-backed cube at upload time; parallelPromise.allover 10 patterns with 7-day TTL (604800s)CUBE_PATTERNSarray:metric_by_day,metric_by_week,metric_by_month,top_n_by_metric,period_over_period,distribution_by_dim,latest_value,min_max_avg,cumulative_metric,rolling_7d_avg- Column detection helpers:
detectMetricColumns(numeric non-id),detectDateColumn(type=date or name heuristic) - Coverage manifest stored at
kpi:cube:coverage:{datasetId}; TTL patterns skip gracefully on null SQL
KPI-1 (integration): Dataset upload triggers cube build:
app/api/datasets/route.ts— fire-and-forgetbuildCubeForDataset(id, schemaJson).catch(warn)after DB insert
KPI-3: KpiCubeLookup in orchestrator:
lib/ai/orchestrator.ts—lookupCube(datasetId, intent)called before PlannerAgent; cache hit bypasses all LLM calls- Hit/miss counters:
kpi:cube:hits:{datasetId}/kpi:cube:misses:{datasetId}incremented fire-and-forget
KPI-4: Delta-aware invalidation:
lib/ai/kpi-cube.ts—invalidateCubePartitions(datasetId, changedDateRange?): partial range deletes time-partitioned patterns; full invalidation deletes all 10 + coverage
KPI-5: Ops hit-rate metrics:
app/api/ops/metrics/route.ts—kpi_cube: { hit_rate, total_hits, total_misses }via Redis key scan; null when no data or Redis unavailable
Tests:
tests/unit/lib/ai/kpi-cube.test.ts(new) — 24 tests: column detection, all 10 buildSQL outputs, matchFn intent routing, buildCubeForDataset Redis calls + TTL, lookupCube hit/miss, invalidateCubePartitions full+partial
PHASE_50 — Elite Conversion Polish
P5: Welcome Wizard:
components/onboarding/WelcomeWizard.tsx(new) — 3-step onboarding modal: Welcome (value prop + checklist), Upload (drag-drop zone + 3 sample presets), Ask (4 example questions)- localStorage key
insights-ai:welcome-wizard-completeprevents re-showing after first completion - AnimatePresence backdrop + modal; per-step slide transitions; progress dots navigation; skip on every step
useReducedMotioncompliance: static opacity transitions when reduced motion preferred
P7: First-insight celebration:
components/chat/ChatInterface.tsx—toast.success("Your first insight! Keep exploring your data.")fires once per user on first completed query result- localStorage flag
insights-ai:first-insight-doneensures single-fire; reduced-motion: toast only (no sparkle)
P13: Error/404 page redesign:
app/error.tsx— cancelable countdown:Cancelbutton alongside 5s auto-retry timer clearssetInterval; human-readableerror.messagesurface above digest; dev-only<details>stack trace (process.env.NODE_ENV === "development"); animated entrance withuseReducedMotionapp/not-found.tsx(converted to"use client") — animated entrance withuseReducedMotion; wandering-path SVG (bezier curves + endpoint dot, no compass); new copy "This page went exploring and got lost"; inline search bar routes to/dashboard?q=...
P14: Scroll-to-bottom FAB:
components/chat/ChatInterface.tsx—ArrowDownfloating action button,AnimatePresencefade in/out; appears whendistFromBottom > 200px; scrolls to bottom on click
P17: Layout meta tags:
app/layout.tsx— canonical URL<link rel="canonical" href={NEXT_PUBLIC_APP_URL} />; explicit<meta property="og:image" content=".../api/og" />;<link rel="apple-touch-icon" href="/icon.svg" sizes="any" />;<meta name="twitter:card" content="summary_large_image" />
P19: Pricing toggle wired to real prices:
app/pricing/page.tsx(converted to"use client") —MONTHLY_PRICESrecord;TierPricecomponent usinguseAnimatedPricefromPricingToggle.tsx;annualstate wired toPricingToggle onChange; default annual selected
P1-P4, P6, P8-P12, P15-P16, P18: Confirmed already implemented (logo cloud, usage counter, TestimonialCarousel, scroll progress, sample datasets, error taxonomy, agent labels, typing indicator rotation, command palette + shortcut overlay, focus rings, placeholder styling, PWA manifest)
Tests:
tests/unit/components/premium-ui-batch3.test.ts— updated assertion to match new not-found.tsx copy ("went exploring and got lost")
PHASE_51 — Agent Correctness
AC-1: Claim-evidence linking:
lib/ai/schemas.ts— addedevidence_query_id: z.string().optional()toInsightResultSchemalib/types/index.ts— addedevidence_query_id?: stringtoInsightResultinterfacelib/ai/agents/insight-synthesis.ts—deriveQueryId(sql)computes first 16 hex chars of SHA-256(sql); injected post-parse
AC-2: Evidence coverage enforcement:
lib/ai/verification.ts—EvidenceCoverageReportinterface +checkEvidenceCoverage(insights, expectedQueryId?)function- Returns
{ passed: boolean, violations: string[] }; violation on missing or mismatchedevidence_query_id
AC-3: Formal orchestrator fallback modes:
lib/ai/orchestrator.ts—OrchestratorModeconst (FULL=0 | REDUCED=1 | SINGLE=2 | DETERMINISTIC_ONLY=3)OrchestratorModeContextinterface +selectOrchestratorMode()pure function- Mode 3 upfront check in
runQueryPipeline: when both circuit breakers OPEN, falls back to deterministic or returns 503
AC-4: Statistical significance gate:
lib/utils/statistics.ts(new) —zScore,isStatisticallySignificant(|z|≥1.96, n≥30),hasStrongClaimLanguage,hedgeStatisticalLanguage(single-pass combined regex — no chain substitution)lib/ai/agents/insight-synthesis.ts—applyStatisticsGatehedges summary+insights when rowCount < 30
AC-5: Ops metrics stubs:
app/api/ops/metrics/route.ts— addedclaims_without_evidence_countandfallback_mode_distributionto response
AC-6: Tests (54 new, all passing):
tests/unit/lib/utils/statistics.test.ts(22 tests) — zScore, significance, hasStrongClaimLanguage, hedgeStatisticalLanguagetests/unit/lib/ai/agents/insight-synthesis.test.ts(+4 tests) — evidence_query_id shape, determinism, statistical hedging gatetests/unit/lib/ai/orchestrator.test.ts(+7 tests) — selectOrchestratorMode all 4 modes + Mode 3 integration
AC-7: Per-agent token cap:
lib/ai/config.ts—getInsightModelcapped atmin(1024, MAX_LLM_OUTPUT_TOKENS)(was 2048)lib/ai/orchestrator.ts—AGENT_MAX_OUTPUT_TOKENSconst documents per-agent caps
PHASE_52 — DAG Planner
DAG-1: TaskGraph types + Zod schema:
lib/ai/task-graph.ts—AgentTaskType,AgentLifecycle,AgentTask,TaskGraph,TaskTracetypes- Zod schema validates: no circular deps (DFS), all
depends_onrefs exist
DAG-2: PlannerAgent (Haiku):
lib/ai/agents/planner-agent.ts— callsclaude-haiku-4-5-20251001, emits TaskGraph JSON, falls back to default graph on invalid outputlib/ai/prompts/planner-agent.ts— planning prompt with minimal graph instructions
DAG-3: Budget allocator:
allocateBudgets()— 10% planner / 75% execution / 15% verifier; exec tasks split proportionally bycomplexity_weightbuildDefaultGraph()— standard 4-task fallback: DATA_PROFILE → QUERY_GEN → INSIGHTS → VERIFYMAX_TOTAL_TOKENS_PER_REQUESTenv var (default: 60,000)
DAG-4: Orchestrator refactor:
lib/ai/orchestrator.ts—runQueryPipelinenow callsPlannerAgentbefore the LangGraph pipeline;taskGraphadded toQueryPipelineState- Topological ordering preserved via existing LangGraph node sequence
DAG-5: Per-task trace logging:
emitTaskTrace()— writes tousage_logstable (reuses existing schema); falls back to structured log on DB errortopoSort()utility exported from task-graph.ts- Trace emitted for each completed pipeline node in stream loop
DAG-6: Tests:
tests/unit/lib/ai/task-graph.test.ts— DAG validation, cycle detection, budget allocation, topoSort, emitTaskTracetests/unit/lib/ai/agents/planner-agent.test.ts— valid parse, fallback on no JSON, fallback on cycle, fallback on API errortests/unit/lib/ai/orchestrator.test.ts— added planner + task-graph mocks
PHASE_49 — Elite Interactions
M1: Motion presets module — Added slideInLeft, slideInRight, slideInDown, blurIn, scaleRotateIn variants to lib/utils/motion-presets.ts
M2: Page transitions — components/layout/PageTransition.tsx scroll-to-top on route change
M3: Chart animation choreography — animationBegin=200ms delay in ScatterPlot, AreaChart; BigNumber adaptive duration 300 + digits×180ms
M4: Animated AI avatar — Pulsing ring during streaming (avatarPulse CSS), agent icon differentiation (Search/CheckCircle/Zap/Sparkles) based on pipeline stage
M5: Message action toolbar — Copy + Save query buttons in hover toolbar in ChatMessage
M6: Enhanced confidence ring — Already implemented in prior work (ConfidenceBadge SVG ring)
M7: Optimistic UI — Already implemented in chat-store (user message + placeholder appear instantly)
M8: Content-aware skeletons — Skeleton component variant="shimmer"|"pulse", role="status" on loading.tsx
M9: will-change audit — willChange: "opacity" on streaming cursor + avatar pulse; Framer Motion handles transforms automatically
M10: ARIA live regions — role="progressbar" + aria-valuenow/min/max added to AgentProgress; ChatInterface already had role="log" + aria-live="polite"
M11: Rich chart tooltip — glass-md styling, tooltipIn CSS enter animation, smart format detection (currency/percentage/int/float)
M12: Code block enhancements — Line number gutter, SQL syntax highlighting (keyword/string/comment/number tokens via CSS classes), diff mode (+/- line coloring)
M13: AnimatedSection direction system — direction prop (up/down/left/right/scale/blur), staggerChildren prop using stagger factory, springs.gentle transition, delay clamped to 0.8s
PHASE_48 — Elite Design Tokens
T7: Wordmark gradient variant — gradient variant added to components/ui/Wordmark.tsx; aria-label on icon-only; hover animation via group
T9: Input token migration — duration-normal added to input.tsx transition
T10: Opacity scale — --opacity-subtle/ghost/muted/dim/strong CSS vars + Tailwind opacity extend
T11: Shimmer + glass utilities — shimmer keyframe + animation in Tailwind; .glass-sm/md/lg CSS utilities; streamCursor + avatarPulse keyframes
v1.1.0-dev - 2026-02-25
PHASE_47 — Code Quality
ENG-7: Standardized error responses:
lib/api/error-response.ts— newerrorResponse(),unauthorizedError(),forbiddenError(),notFoundError(),validationError(),internalError()and more helpers- Applied to 10 routes: alerts, notifications, saved-queries, datasets, conversations, organizations
- Fixed pre-existing type errors:
app/pricing/page.tsx,lib/payments/credits.ts(Stripe v20pricing.price),components/landing/AnimatedSection.tsx
ENG-13: Split ChatMessage.tsx (1,248 → 564 lines):
- Extracted
MarkdownCodeBlock→components/chat/MarkdownCode.tsx - Extracted
ReactionBar→components/chat/ReactionBar.tsx - Extracted
CommentsSection→components/chat/CommentsSection.tsx - Extracted
PinToDashboard→components/chat/PinToDashboard.tsx
ENG-16: 3 new DB indexes:
idx_activity_feed_useronactivityFeed.userIdidx_scheduled_reports_next_runonscheduledReports.nextRunAtidx_msg_comments_useronmessageComments.userId
ENG-18: Removed unused wget from Dockerfile runner stage (reduces attack surface ~500KB)
ENG-20: Added OPS_OWNER_IDS and BYPASS_AUTH to .env.example with documentation
ENG-21..26: Critical bug fixes from audit:
- JSON.parse wrapped in try-catch in 6 agent files (builder, planner, insight-synthesis, query-generation, intent-understanding, schema-analysis)
- Dummy API key fallback → proper 503 response with
LLM_NOT_CONFIGUREDcode - Saved-queries: DB try-catch + .safeParse() instead of .parse()
- v2/conversations: consistent
v2Error()+ runtime type validation - DomainId: validated against allowlist before casting in packs route
- WORD_BOUNDARY_CACHE: capped at 1000 entries with FIFO eviction
PHASE_36 — Intelligence Credit System & Pricing Migration
Credit Cost Model (P1):
lib/ai/config.ts—CREDIT_COSTSmap,intentToCreditTier(),creditCostForIntent(); Simple: 2cr, Standard: 5cr, Complex: 15cr, Dashboard: 25cr, Forecast: 40cr
Credit DB Tables (P2):
lib/db/schema.ts—userCreditsandcreditLedger(append-only audit) tablesdrizzle/0010_credits.sql+drizzle/0010_down.sql
Credit Deduction Logic (P3):
lib/payments/credits.ts—getCreditBalance(),grantMonthlyCredits(),deductCredits()(monthly-first drain),applyTopUpCredits(),checkCreditBalance(),triggerAutoTopUpIfNeeded()app/api/chat/route.ts— credit pre-flight after intent; fire-and-forget deduction after success
Credit Top-Up Purchase (P4 + P5):
app/api/credits/topup/route.ts— Stripe Checkoutmode: "payment"for 250/1000/5000cr packsapp/api/webhooks/stripe/route.ts— one-time top-up + monthly credit grants on subscription events
Pricing Page (P6):
app/pricing/page.tsx— 6-tier ladder (Free/Starter/Pro/Growth/Enterprise/API) + top-up packs section
Usage Banner (P7):
components/layout/UpgradeUsageBanner.tsx— dual-path credit/query-count display
Stripe Price IDs (P8):
lib/payments/stripe.ts—PlanType,CREDIT_MONTHLY_ALLOTMENT,STARTER_PRICE_ID(backwards-compat alias),NEW_PRO_PRICE_ID,GROWTH_PRICE_ID,TOPUP_PRICE_IDS
Migration Script (P9):
scripts/migrate-pro-to-starter.mjs— batch Clerk metadata update with--dry-run+--limit=Nflags
Domain Pack Add-On Checkout (P10):
app/api/packs/[packId]/subscribe/route.ts— Stripe subscription checkout for all 7 domain packs
Plan Types + Feature Flag + Tests (P11):
lib/feature-flags.ts—enableCreditSystemflag (default: false, gate: 1,000+ paying users)app/api/checkout/route.ts— expanded plan enum; default changed"pro"→"starter"tests/unit/lib/payments/credits.test.ts— 15 unit tests for credit tier mapping + ALLOTMENT values
Result: 1254 passing (11 test regressions fixed: checkout default plan, chat/cache credits mock)
PHASE_37 — Technical Debt
ISR / Cache Revalidation:
export const revalidate = 300added to 4 dashboard RSC page shells (dashboard, history, alerts, pinned)revalidatePath('/dashboard')called on dataset create/update/deleterevalidatePath('/dashboard/history')called on conversation create- Architecture documented in
ARCH_ISR_CACHE.md
Event Bus:
lib/events/types.ts— typedAppEvent+AppEventTypeunion (7 event types)lib/events/bus.ts— Redis list queue (LPUSH/RPOP),publish()/drainBatch()/on()/dispatch()/api/cron/process-events— consumer cron; routes dataset.created/deleted + conversation.created → activity feed- Events wired from dataset POST/DELETE and conversation POST routes
Billing Idempotency:
lib/billing/idempotency.ts— Redis SETNX-based guard, 60s TTL,billingIdempotency(userId, action, discriminator)/api/checkout— idempotency guard added; all 3 plan branches commit on success/api/billing/cancel— idempotency guard added for save_offer / cancel / reactivate actions
DB Tracked Migrations:
npm run db:migratenow runsdrizzle-kit migrate(tracked, safe for staging/prod)npm run db:pushadded as local-dev alias fordrizzle-kit push:pg(dangerous — local only)ARCH_DB_MIGRATIONS.md— documents workflow, rollback strategy, and CI integration- All 10 existing migrations (0000–0009) already have
_down.sqlrollback scripts
Background Jobs:
lib/jobs/runner.ts—registerJob()/runJob()/getLastJobResult()/listJobs(); timeout enforcement + Redis result store (24h TTL)ARCH_BACKGROUND_JOBS.md— documents cron schedule, job pattern, security, failure handling
Result: 1243 passing (7 test regressions fixed)
v1.1.0-dev - 2026-02-24
PHASE_35 — CI/CD Performance
CI pipeline restructured for parallel execution (~25min → target <12min on PRs):
- O1 Bundle analyzer (
npm run analyze) gated tomainpushes only — saves ~10–15 min on every PR check - O2 Parallel jobs:
secret-scan,lint,type-check,testall run concurrently;buildstarts only after all pass - O3
public/duckdb/cached in GitHub Actions bypackage-lock.jsonhash; DuckDB WASM copy skipped on warm cache;npm ci --ignore-scriptsused in all jobs - S1 Removed redundant
prebuildscript frompackage.json—postinstallalready handles DuckDB WASM copy - O4
timeout-minutes: 3onRun load smoke teststep — prevents infinite hang if server fails to start - O5 TruffleHog secret scan extracted to standalone job — fails immediately without waiting for lint/test/build
- O6 Vitest uses
pool: 'threads'withmaxThreads: 2in CI; auto-detects locally
Test fixes (pre-existing failures surfaced by O6):
schema-analysis.test.ts— updated to match newrunSchemaAnalysis(intent, userQuery, schema)signaturerate-limit.test.ts— Redis mock updated fromincr/expire/ttltoeval(Phase 33 Lua script migration)alerts-route.test.ts— replaced stub file with proper placeholder test suiteconversations-routes.test.ts,datasets.test.ts,notifications-route.test.ts,notification-center.test.ts— added.offset()to DB mock chains; addedRequestarg toGET()calls
Result: 1129 passing, 0 failing (was 1098 + hidden failures)
v1.0.0-dev - 2026-02-18
Phase 17 launch prep completion batch.
- Closed remaining Phase 17 launch tasks:
- A3: full API route integration matrix coverage complete across
app/api/**/route.tsfamilies - A4: launch-critical E2E matrix rebuilt in
tests/e2e/launch-readiness-flows.spec.tswith deterministic mocked flows:- full chat flow (query, follow-up, export, delete)
- conversation management (create, rename, search, navigate, delete)
- dataset lifecycle (upload path, rename, delete)
- settings/API key and billing portal flows
- mobile dashboard navigation/chat coverage
- A5: coverage gate moved to 80% for launch-critical API scope in
vitest.config.ts
- A3: full API route integration matrix coverage complete across
- Added public status page at
/status(app/status/page.tsx) and linked it from landing/pricing/footer/sidebar/settings; sitemap updated. - Added pricing validation reference (
docs/40_reference/30_business/BIZ_PRICING_VALIDATION.md) with margin scenarios and guardrail decisions. - Added load-test assets:
- k6 script:
scripts/load-tests/chat-load-test.js - npm command:
npm run test:load:chat - baseline runbook:
docs/40_reference/20_engineering/LOAD_TEST_BASELINE.md
- k6 script:
- Added conversation rename support (API + UI):
PATCH /api/conversations/[id]now supports title updates- history UI inline rename action in
components/chat/ChatHistory.tsx
- Pricing copy aligned with enforced free-tier query limit (50/month) on landing and pricing pages.
v0.2.8-dev - 2026-02-18
Phase 17 launch prep testing expansion batch.
- Added integration coverage for connection endpoint matrix (
tests/integration/api/connections-routes.test.ts):/api/connections/api/connections/[id]/api/connections/test/api/connections/[id]/test/api/connections/[id]/schema/api/connections/[id]/query- Includes auth, validation, not-found, success, and server-error assertions
- Added integration coverage for conversation endpoint matrix (
tests/integration/api/conversations-routes.test.ts):/api/conversations/api/conversations/[id]/api/conversations/[id]/messages- Includes auth, validation, ownership/not-found, and success assertions
- Added integration coverage for utility endpoints (
tests/integration/api/utility-routes.test.ts):/api/usage/api/transform/api/health/api/ready
- Added integration coverage for organization endpoints (
tests/integration/api/organizations-routes.test.ts):/api/organizations/api/organizations/[id]- Includes auth, validation, conflict, role/owner checks, and success assertions
- Added integration coverage for API key management (
tests/integration/api/api-keys-routes.test.ts):/api/settings/api-keys- Includes auth, permission, validation, not-found, and success assertions
- Added integration coverage for organization collaboration subroutes (
tests/integration/api/organization-collaboration-routes.test.ts):/api/organizations/[id]/members/api/organizations/[id]/members/[userId]/api/organizations/[id]/invitations/[invitationId]/api/organizations/[id]/invitations/[invitationId]/resend/api/organizations/[id]/datasets
- Added integration coverage for invitation token flows (
tests/integration/api/invitations-token-route.test.ts):/api/invitations/[token]GET/POST/DELETE- Includes preview, accept, decline, expired invite, and email-mismatch assertions
v0.2.7-dev - 2026-02-18
Phase 17 launch prep progress batch (AI-owned items).
- Added feature flag framework (
lib/feature-flags.ts) and wired key surfaces:- connector UI gating
- team/API settings gating
- public API middleware gating (
NEXT_PUBLIC_FF_PUBLIC_API) - anomaly detection gating in insights API
- Added launch-readiness UX and public pages:
- new
/changelogpage renderingCHANGELOG.md - changelog/status links in public and dashboard navigation areas
- dashboard billing past-due banner
- dashboard NPS survey modal (10-query trigger, monthly cooldown,
nps_submittedevent)
- new
- Added transactional email infrastructure upgrades:
- templates: welcome, weekly digest, payment failure
- resend helpers for welcome/digest/payment-failure delivery
- Clerk webhook now sends welcome email on
user.created - dunning flow now tracks failure count and stages reminder/final warning emails
- Added API versioning policy and implementation:
/api/v1/*responses now includeX-API-Version- deprecation policy docs added (
docs/40_reference/20_engineering/API_VERSIONING.md) - contracts and ops docs updated
- Expanded testing foundations:
- fixture-based LLM response library + helper
- new AI agent unit tests (intent, schema analysis, query generation, insight synthesis)
- new dunning unit coverage
- new Clerk webhook integration coverage
- broader API auth integration matrix
- new Playwright launch-readiness flow spec
- Validation executed:
npm run lintnpm run type-checknpm test -- --runnpm run buildnpm run test:e2e -- --project=chromium --grep "Launch readiness critical flows"
v0.2.6-dev - 2026-02-18
Phase 16 performance foundations completion batch.
- Added high-row-count virtualization for chat results tables using
@tanstack/react-virtualwith sticky headers, preserved sorting/CSV copy, and null-value highlighting - Added input debouncing improvements:
- Chat composer now keeps immediate local input state while debouncing external updates and flushing on submit
- Conversation history and dataset list filtering now use debounced search state
- Added bounded LRU behavior to in-memory Zustand caches:
- Conversations capped at 50 entries (
MAX_CONVERSATIONS) - Datasets capped at 100 entries (
MAX_CACHED_DATASETS) - Added unit coverage for both eviction helpers
- Conversations capped at 50 entries (
- Added client rendering performance optimizations via
contain: content,content-visibility, and targetedwill-changehints in chat/visualization-heavy surfaces - Added root-layout resource hints (
preconnect+dns-prefetch) for configured third-party origins - Added Web Vitals reporting pipeline (
web-vitals+WebVitalsReporter) to emitweb_vitalsanalytics events - Added streaming CSV load path for DuckDB files above 5MB with progress callbacks and upload-stage UI updates
- Added build/dev tooling updates:
next dev --turboenabled for local dev- bundle analyzer integration in
next.config.ts npm run analyzescript and CI artifact upload for.next/analyzeanalyzescript made cross-platform viacross-env
- Validation completed with
npm run lint,npm run type-check,npm test -- --run,npm run build, andnpm run analyze
v0.2.5-dev - 2026-02-18
Phase 15 onboarding and accessibility completion batch.
- Added built-in sample datasets and schema descriptions under
public/sample-data/for zero-friction onboarding (ecommerce-orders.csv,saas-metrics.csv,marketing-campaigns.csv,column-descriptions.json) - Added dashboard zero-state redesign with "Try with sample data" flow, sample upload path in dataset store, and sample dataset badge rendering in dataset cards
- Replaced static prompt chips with schema-driven suggestions (
lib/ai/generate-example-questions.ts) including per-dataset localStorage caching and fallback questions - Added reusable trust badge UI and surfaced it above the fold across dashboard/upload/chat contexts
- Added activation and product analytics instrumentation:
- Activation funnel events:
dataset_uploaded,first_query,aha_moment,return_visit - Standard usage events:
query_submitted,query_success,query_failed,chart_exported,feedback_given - Added missing events:
conversation_created,dataset_deleted,sql_edited,chart_filter_clicked
- Activation funnel events:
- Enabled
@vercel/analyticsin root layout (<Analytics />) - Added WCAG-focused accessibility improvements:
- Skip-to-content link and
#main-contenttarget aria-livestatus announcements for query processing and SSE completion summariesrole="status"androle="alert"wiring on progress and validation/error surfacesaria-describedbyon validated form inputs- Auto-generated chart alt text with SVG
aria-label+ injected<desc>summaries
- Skip-to-content link and
- Verified with
npm run lint,npm run type-check, andnpm test -- --run(all passing)
v0.2.4-dev - 2026-02-18
Phase 14 cost tracking completion batch.
- Added robust token usage extraction across Anthropic/OpenAI LangChain response metadata (
lib/ai/token-usage.ts) and switched routing costs to authoritative model pricing (MODEL_COSTS,calculateCost) - Added per-agent usage attribution in orchestrator (
intent_understanding,schema_analysis,query_generation) with total token/cost rollups in pipeline outputs - Added monthly LLM budget controls with fail-open Redis behavior (
lib/ai/budget.ts) and enforced caps in chat/API query routes with402 BUDGET_EXCEEDEDresponses - Added cost persistence schema and migrations:
messagescolumns:input_tokens,output_tokens,cost_usd,model_used- new
usage_logstable + index (drizzle/0007_cost_tracking.sql,drizzle/0007_down.sql)
- Added usage persistence flow from chat UI to conversation message API and agent-level usage log writes for chat + API paths
- Added internal cost dashboard endpoint (
GET /api/admin/costs) with period aggregation and cost-per-query metrics - Added cost telemetry and alerts: query-level
llm_costPostHog events, daily spend warn threshold ($50), and daily alert event threshold ($100) - Updated free-tier query limit defaults to env-configurable
50(FREE_TIER_QUERY_LIMIT/NEXT_PUBLIC_FREE_TIER_QUERY_LIMIT) - Added unit coverage for token usage extraction and model cost calculation (
tests/unit/lib/ai/token-usage.test.ts)
v0.2.3-dev - 2026-02-18
Phase 13 security and compliance completion batch.
- Added security foundations: centralized app errors (
lib/errors.ts), RBAC middleware (lib/middleware/rbac.ts), input sanitization helpers (lib/middleware/sanitize.ts), and audit logging helper (lib/audit.ts) - Added DB/security schema updates:
audit_logstable,datasets.deleted_atsoft-delete column,connections.password_key_version, plus migration/down scripts (drizzle/0006_security_compliance.sql,drizzle/0006_down.sql) - Hardened APIs: Stripe webhook idempotency, CSP policy headers, soft-delete + dataset restore flow, 30-day dataset purge cron endpoint, and standardized rate-limit limit headers on 429s
- Improved encryption and validation: connector key-version support, broad API request sanitization/validation, and transform-agent LLM output validation via Zod
- Completed code quality cleanup: removed remaining
as unknown asassertions andeslint-disablesuppressions in app/lib code paths - Verified with
npm run lint,npm run type-check, andnpm test -- --run
v0.2.2-dev - 2026-02-18
Phase 12 observability and reliability completion batch.
- Added structured server logging foundation (
pino) and migratedapp/api+libserver paths offconsole.* - Added request context + correlation ID propagation and request logging middleware (
x-request-id, Sentry breadcrumb/tag wiring) - Added
/api/readyendpoint and expanded/api/healthwith per-check latency and overall status reporting - Added OpenTelemetry bootstrap/instrumentation plumbing with manual spans in the AI orchestrator pipeline
- Added graceful shutdown handling (signal hooks, SSE drain notifications, shutdown callbacks, DB/telemetry cleanup hooks)
- Added Redis retry/exponential backoff improvements and circuit-breaker on-open alert callbacks
- Added ops docs:
docs/40_reference/10_ops/ALERTING_RULES.md,docs/40_reference/10_ops/BACKUP_STRATEGY.md,docs/40_reference/10_ops/LOG_AGGREGATION.md
v0.2.1-dev - 2026-02-18
Phase 11 completion batch (AI-owned tasks).
- Compliance and privacy updates: cookie consent banner, expanded privacy policy (GDPR/CCPA/subprocessors/retention), account deletion API and settings flow
- Reliability and monitoring updates:
circuit_breaker_opentelemetry, enhanced rate-limit telemetry, Stripe dunning handling for failed payments and past-due subscriptions - AI infrastructure updates: prompt version hashing + metadata persistence, confidence calibration telemetry on feedback, low-confidence clarification rerun with
preComputedIntent - Testing updates: new cache integration suite, webhook and chat enhancements, accessibility expansion, keyboard navigation coverage, chat history/export E2E coverage
- Data model update: added message
metadatacolumn and migration (drizzle/0005_prompt_metadata.sql)
v0.2.0-dev - 2026-02-18
Phase 11 hardening updates (security, telemetry, and testing).
- Rate limiting now fails closed when Redis is unavailable (
lib/rate-limit.ts) - Added
rate_limit_hitPostHog server event capture on limit enforcement and Redis outages (lib/rate-limit.ts) - Chat API now applies user plan-aware rate limits and includes real token usage in model usage logging (
app/api/chat/route.ts) - Added integration tests for rate-limit edge cases and expanded chat rate-limit assertions (
tests/integration/api/rate-limit.test.ts,tests/integration/api/chat.test.ts) - Fixed token usage metadata typing in query generation (
lib/ai/agents/query-generation.ts)
v0.2.0-plan - 2026-02-18
Roadmap expansion and delivery planning (v0.2 through v2.0).
- 680-item feature roadmap research (docs/90_sandbox/research/FEATURE_ROADMAP_RESEARCH.md)
- 13 new PHASE files (PHASE_12-PHASE_24) covering observability, security, cost tracking, UX, connectors, collaboration, platform intelligence
- Updated ROADMAP, DELIVERY_INDEX, PHASE_INDEX, STATE, CONTRACTS, BUILD_PACK
- Audit findings added to SEC_SECURITY, PERF_PERFORMANCE, OPS_RELIABILITY, TEST_TESTING
- No code changes - documentation and planning only
v0.1.0 - 2026-02-18
Initial MVP code-complete (Phases 01-08). Not yet deployed or validated against real services.
- Next.js 15 + TypeScript strict mode, Tailwind CSS + shadcn/ui
- DuckDB WASM client-side SQL execution
- 9-agent LangGraph AI pipeline: intent -> schema -> query -> validation -> execution -> synthesis + anomaly + forecast + transform
- Chat interface with SSE streaming, agent progress, follow-up chips
- 11 chart types with auto-selection and PNG export (Recharts)
- Clerk auth + Stripe checkout + webhooks + billing portal
- PostgreSQL (Drizzle ORM, 10 tables, 5 migrations) + Upstash Redis + Pinecone semantic cache
- Organizations/teams with invitations and role-based permissions
- Database connectors (PostgreSQL, MySQL)
- Public API v1 (datasets, conversations, query) + API key management
- Chart sharing, embed page, shared conversation page
- Sentry + PostHog monitoring configured
- 16 test files: unit, integration, E2E (Playwright)
- GitHub Actions CI workflow