feat(analytics): add privacy-safe usage event spine - #182
Merged
JSONbored merged 2 commits intoJun 1, 2026
Conversation
This was referenced Jun 1, 2026
oktofeesh1
force-pushed
the
codex/analytics-usage-event-spine
branch
2 times, most recently
from
June 1, 2026 18:19
ccb86ed to
245ec06
Compare
Adds product_usage_events storage and repository helpers with hashed actor/session identifiers and sanitized metadata. Instruments API, MCP, extension, and GitHub App command surfaces, with telemetry write failures isolated from product paths. Adds unit and integration regressions for no token, source, local-path, or raw actor leakage and resilient analytics failure handling. Validation: - npm run test:ci - Codex Security diff scan
Removes API-token fallback from product usage pseudonymization so credentials are never used as hash material. Adds a regression proving actor and session hashes stay null when only the API token is configured. Validation: - npm run test:ci - npm run test -- test/unit/product-usage.test.ts - Codex Security diff scan
oktofeesh1
force-pushed
the
codex/analytics-usage-event-spine
branch
from
June 1, 2026 18:28
245ec06 to
7433583
Compare
JSONbored
approved these changes
Jun 1, 2026
JSONbored
left a comment
Owner
There was a problem hiding this comment.
@oktofeesh1 This is ready from my side. The usage-event spine is a large foundational change, but the branch is green, merge-clean, and covers the D1 schema, API routes, MCP surface, queue ingestion, repositories, and integration/unit tests.
A few notes:
- The event model is privacy-safe by construction rather than storing raw private context.
- The API/MCP wiring and route-error tests are included, which is the right bar for this surface.
- This should land before the dependent analytics rollup/reporting PRs.
This was referenced Jul 2, 2026
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
What changed
product_usage_events.PRODUCT_USAGE_HASH_SALTfor actor/session hashing; without it, hashes are null.Why
Validation
npm run test:cinpm run test -- test/unit/product-usage.test.ts test/unit/queue.test.ts test/integration/api.test.ts test/integration/routes-errors.test.tsnpm run typecheckNotes
PRODUCT_USAGE_HASH_SALTonly; if no dedicated salt is configured, actor/session hashes are null.