Record commit and decision counts per push in PostHog
Return the commits a push added and the valid decision records in them from indexPush. Send one commits.recorded event after the push is fully processed. Plannotator review returned no changes requested. All 117 tests, typecheck, production build, and diff checks pass.
2 decisions
Send one commits.recorded event per processed push with commit_count and decision_count taken from the pushed commits.
Why
- Counts from the commits stay the same when a queue retry repeats indexing
- Sending after the final step keeps a partial failure from producing an event
Assumes
- Full redelivery of a processed push is rare, and it double-counts that push
Touches
decisions.tspushes.tsanalytics.tsproduct-analytics.md
Send no commits.recorded event for pushes that the reconciliation sweep finds.
Why
- Sweep pushes have no human or agent identity
Touches
pushes.ts
5 files changed · +47 −6
apps/backend/analytics.ts+2 −0
apps/backend/decisions.ts+6 −4
apps/backend/pushes.ts+5 −1
apps/backend/test/pushes.test.ts+27 −0
docs/product-analytics.md+7 −1