Commit Graph

3 Commits (1493af9fea47e8e1255eeb6c8a81531bf765a06d)

Author SHA1 Message Date
ahmed.mujtaba 4086bbdeb4 permission module base applied 2026-09-04 16:48:30 +05:00
Talha Ahmed 600d438af3 Analytics: report library, NL ask, TTH baseline, source spend
Builds the four remaining analytics gaps from the architecture plan:

- Report library (REQ-ANL-03): new backend/reports module - saved reports
  as parameterisations of the governed analytics queries (never free-form
  SQL), rolling window_days filters, recorded runs, CSV export via
  Content-Disposition. Reports screen gains the library card with
  create/run/export/delete plus a results modal.
- Natural-language analytics (REQ-ANL-05, ADR-0010): POST /analytics/ask
  maps a question onto one whitelisted intent, runs the same governed
  query the dashboard uses, then narrates the numbers. Ask Analytics card
  on the Analytics screen; LLM outages 503 without touching the charts.
- Time-to-hire baseline (REQ-ANL-08): KPIs surface tth_baseline_* from
  org setting analytics.tth_baseline ({days,source}); not hardcoded
  per OPEN-12. analytics added to org-settings categories. Reports TTH
  card shows the delta when set.
- Source spend (REQ-ANL-09 cost side): hiring costs can be tagged with a
  source channel; source performance returns tagged spend and
  cost-per-application, including spend-only rows for channels with zero
  applications (wasted spend must stay visible). Log-cost modal and
  Source Performance table on Reports; untagged spend stays
  cost-per-hire only.

Verified live: migration autogenerated and applied (saved_reports,
report_runs, hiring_costs.source_channel_id), 50 backend tests, vite
build + smoke/token/theme suites, and a headless-browser drive of both
screens end to end.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-21 17:24:35 +05:00
ahmed.mujtaba 64eae32259 . 2026-08-17 20:37:30 +05:00