PB-017 — AI Economy Analytics
Owner: @ma7moudalysalem • Priority: High • Iteration: 3 • Est: 21 pts
Spec folder: .specify/specs/PB-017-ai-economy/
SRS section: docs/SRS.md section 8.4 + FR-246..FR-258
Architecture: docs/ANALYTICS.md — section 6 (redaction) + figures 130, 131, 136
Goal
Turn every row already being written to AiInteractions into a FinOps + quality dashboard. Cost split by feature + provider, budget-alert automation, recommendation click-through, token efficiency, monthly redaction audit.
User stories
- US-174 AI cost dashboard (5 pts)
- US-175 Budget alert automation (3 pts)
- US-176 Recommendation CTR tracking (8 pts) — adds
RecommendationClickEvent entity
- US-177 Token efficiency metrics (3 pts)
- US-178 PII redaction compliance audit (2 pts) — adds
AiRedactionAuditSample entity
Data-model additions
Two new OLTP tables — see ERD context view 6:
RecommendationClickEvent — CTR source
AiRedactionAuditSample — monthly 50-prompt sample
Blocking dependencies
- PB-008 AI Features (source of
AiInteractions — already shipped)
- PB-016 Gold layer (FactAiInteraction joins with RecommendationClickEvent)
- PB-011 Admin portal (hosts the new dashboard pages)
Ready for review
Done when the five AI Economy widgets are live, clicks are logged end-to-end, monthly redaction audit runs automatically, target CTR ≥ 15% and miss rate < 1% are trackable.
PB-017 — AI Economy Analytics
Owner: @ma7moudalysalem • Priority: High • Iteration: 3 • Est: 21 pts
Spec folder:
.specify/specs/PB-017-ai-economy/SRS section:
docs/SRS.mdsection 8.4 + FR-246..FR-258Architecture:
docs/ANALYTICS.md— section 6 (redaction) + figures 130, 131, 136Goal
Turn every row already being written to
AiInteractionsinto a FinOps + quality dashboard. Cost split by feature + provider, budget-alert automation, recommendation click-through, token efficiency, monthly redaction audit.User stories
RecommendationClickEvententityAiRedactionAuditSampleentityData-model additions
Two new OLTP tables — see ERD context view 6:
RecommendationClickEvent— CTR sourceAiRedactionAuditSample— monthly 50-prompt sampleBlocking dependencies
AiInteractions— already shipped)Ready for review
Done when the five AI Economy widgets are live, clicks are logged end-to-end, monthly redaction audit runs automatically, target CTR ≥ 15% and miss rate < 1% are trackable.