← all branches

feat/mrr-tables

needs attentionviewing older commit
7bc9dd8 · incrementalpre-PRreviewed 2026-08-10 17:59 UTC1H · 8M · 6L · 3I
The branch
Purpose
Establish a correct MRR taxonomy in PostHog analytics: replace 'subs vs descargas' with 'Monitoreo (recurrente) vs Descarga única', applied consistently across all MRR insights and the interactive pivot.
Goal
Unified MRR taxonomy across PostHog dashboards aligned with the pivot script model
Sub-goals
  • SG-1: Remove mrr_subscription_based insight (framed Neto/Pilgrim's as a separate product incorrectly)
  • SG-2: Update mrr_coverage_gap to use recurrence-based split via proportional allocation
  • SG-3: Add mrr_monthly_base shared local CTE for 6-month trend data
  • SG-4: Add mrr_tendencia_producto and mrr_tendencia_plan monthly trend line insights
The changes (whole branch)
What
Removed mrr_subscription_based insight; added mrr_monthly_base shared CTE local; updated mrr_coverage_gap SQL to split by recurrence; added two new monthly trend line insights (by product, by plan); adjusted dashboard layout.
Why
The old model treated Neto/Pilgrim's (billingUnit=subscription) as a distinct product, when they are just monitored RPUs billed recurringly — the same action as credit-account monitored RPUs. The new model uses recurrence (monitored vs one-time download) as the product axis, consistently with the interactive pivot script.
Areas
infra/posthog/insights.tf+160368infra/posthog/dashboards.tf+1427
Blast
2 files, +174/−395; PostHog analytics IaC only — no app code, no migrations, no API changes
snapshot-bias-in-mon-cte historical-data-limitations model-divergence-trend-vs-gap
CI/typecheck· PostHog Terraform — no CI on this branchcoderabbit· no .coderabbit.yaml

Findings · 16

correctness5

high

mon CTE is a current snapshot — misclassifies historical monitored/one-time downloads

infra/posthog/insights.tf

The mon CTE selects CURRENT monitored RPUs; downloads on since-cancelled RPUs get wrongly classified. Structural schema limitation.

medium

subs CTE undercounts historical months — hard-deleted cancelled subscriptions missing

infra/posthog/insights.tf

medium

mrr_coverage_gap medido fallback (t=0): full org MRR assigned to Descarga única for dormant active orgs

infra/posthog/insights.tf

medium

credit CTE reprices historical downloads at current org plan rate — distorts past MRR in trend lines

infra/posthog/insights.tf

low

Dashboard y=5 row: right half empty after removing mrr_subscription_based

infra/posthog/dashboards.tf

security2

medium

Company MRR constants hard-coded in Terraform locals (pre-existing)

infra/posthog/insights.tf

low

Org names and plan slugs as chart series labels in internal analytics dashboard

infra/posthog/insights.tf

conventions2

medium

mrr_monthly_base should be d3_mrr_monthly_base — breaks the d3_ prefix convention

infra/posthog/insights.tf

low

chartSettings uses padded alignment — terraform fmt will normalize

infra/posthog/insights.tf

tests2

medium

Trend lines vs Coverage Gap model divergence undocumented for chart readers

infra/posthog/insights.tf

low

terraform state rm needed if mrr_subscription_based is in Terraform state before apply

infra/posthog/insights.tf

improvement4

medium

mon CTE duplicated in mrr_monthly_base and mrr_coverage_gap — extract to shared local

infra/posthog/insights.tf

medium

mrr_tendencia_producto and mrr_tendencia_plan are structurally identical — for_each candidate

infra/posthog/insights.tf

low

Terminal CTE alias f is opaque in a shared local

infra/posthog/insights.tf

low

range(6) includes current partial month — 'last 6 months' comment is misleading

infra/posthog/insights.tf

seo1

info

SEO lens skipped — no apps/web/** files in diff

History · 3 commits

  1. 6662df4safeincremental0H · 0M · 2L2026-08-10 18:15
  2. 7bc9dd8needs attentionincremental1H · 8M · 6L2026-08-10 17:59current
  3. 870badcneeds attentionfull1H · 3M · 3L2026-08-07 23:15