feat(analytics): add role activation and retention rollups - #310
Merged
JSONbored merged 7 commits intoJun 2, 2026
Merged
Conversation
|
Documentation Updates 1 document(s) were updated by changes in this PR: Gittensory ArchitectureView Changes@@ -103,7 +103,7 @@
### **I. Database Layer (`src/db/`)**
-The database uses Drizzle ORM with Cloudflare D1 (SQLite) [[30]](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/src/db/client.ts). The schema spans 50+ tables across 16 migrations [[31]](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/migrations), grouped into six categories: GitHub integration (installations, repositories, repositorySettings), sync state (repoSyncState, repoSyncSegments), scoring (scoringModelSnapshots, scorePreviews, contributorEvidence), agent orchestration (agentRuns, agentActions, agentContextSnapshots), auth/compliance (authSessions, auditEvents), and analytics (productUsageEvents, productUsageDailyRollups) [[32]](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/src/db/schema.ts).
+The database uses Drizzle ORM with Cloudflare D1 (SQLite) [[30]](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/src/db/client.ts). The schema spans 50+ tables across 17 migrations [[31]](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/migrations), grouped into six categories: GitHub integration (installations, repositories, repositorySettings), sync state (repoSyncState, repoSyncSegments), scoring (scoringModelSnapshots, scorePreviews, contributorEvidence), agent orchestration (agentRuns, agentActions, agentContextSnapshots), auth/compliance (authSessions, auditEvents), and analytics (productUsageEvents, productUsageDailyRollups) [[32]](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/src/db/schema.ts). Daily usage rollups track activation funnels, role segmentation, surface-level activation, and 7-day and 30-day retention metrics.
### **J. Queue Processor (`src/queue/`)**
@@ -336,7 +336,7 @@
### Data Layer
-**Database:** Cloudflare D1 (SQLite at the edge) with a binding named [`DB`](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/wrangler.jsonc#L50-L57) pointing to the `gittensory` database. The schema comprises [50+ tables across 16 migrations](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/migrations), spanning GitHub integration, sync state, scoring, agent orchestration, auth/compliance, and analytics.
+**Database:** Cloudflare D1 (SQLite at the edge) with a binding named [`DB`](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/wrangler.jsonc#L50-L57) pointing to the `gittensory` database. The schema comprises [50+ tables across 17 migrations](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/migrations), spanning GitHub integration, sync state, scoring, agent orchestration, auth/compliance, and analytics. Daily usage rollups track activation funnels, role segmentation, surface-level activation, and 7-day and 30-day retention metrics.
**ORM:** [Drizzle ORM ^0.45.0](https://github.com/JSONbored/gittensory/blob/40c019c82d87568c232fbe7fabf50212e983075a/package.json#L62) provides type-safe query construction and schema management.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #250
Scope
CONTRIBUTING.mdand does not reintroduce GitHub Pages, VitePress,site/, orCNAME.Validation
git diff --checknpm run actionlintnpm run typechecknpm run test:coveragelocally; global coverage stays at or above 97% for lines, statements, functions, and branches (aim for 98%+ branch coverage locally so CI variance does not fail near the threshold)npm run test:workersnpm run build:mcpnpm run test:mcp-packnpm run ui:openapi:checknpm run ui:lintnpm run ui:typechecknpm run ui:buildnpm audit --audit-level=moderateIf any required check was skipped, explain why:
Safety
Notes
0017_product_usage_role_retention_rollups.sqlfor new daily-rollup JSON columns.unknown.