[codex] collect cursor usage events#27
Merged
Merged
Conversation
- Add native Cursor UsageEvent collection that reuses the existing CSV parser and preserves row-based identity. - Cover event mapping, malformed local data, and default versus explicit Cursor directory rules. - Record EBTA-006 workspace review and verification evidence.
There was a problem hiding this comment.
Pull request overview
Adds native Cursor CollectUsageEvents support so Cursor CSV usage rows can be emitted as provider.UsageEvent records (enabling event-based aggregation flows later) while preserving existing Cursor CSV parsing and collection semantics.
Changes:
- Implement
(*cursor.Provider).CollectUsageEventsby reusing existing CSV discovery +parseUsageCSVand mapping each parsed row to aprovider.UsageEvent. - Add focused provider tests covering row→event mapping, invalid CSV skipping, deterministic ordering, and default-root vs explicit-dir scan rules.
- Record EBTA-006 workspace artifacts (review notes, test strategy, verification) and mark EBTA-006 as done in the EBTA plan doc.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
provider/cursor/parser.go |
Adds CollectUsageEvents and row→event mapping (SourcePath, EventID) while keeping existing CSV behavior. |
provider/cursor/parser_test.go |
Adds tests for event collection/mapping, invalid-data skipping, deterministic ordering, and directory resolution rules; asserts interface implementation. |
docs/plans/2026-04-16-event-based-token-aggregation-task.md |
Updates EBTA task board entry to mark EBTA-006 complete with verification notes. |
workspace/EBTA-006/verification.md |
Documents executed gates and verification evidence for EBTA-006. |
workspace/EBTA-006/test_strategy.md |
Captures the intended test plan and verification commands for EBTA-006. |
workspace/EBTA-006/review.md |
Records multi-agent review findings and the resolved EventID stability concern. |
workspace/EBTA-006/original_impl.md |
Summarizes pre-change Cursor provider semantics and the identified gap. |
workspace/EBTA-006/new_impl.md |
Documents considered implementation options and rationale. |
workspace/EBTA-006/final_impl_v1.md |
Documents the final implementation plan and acceptance criteria details. |
workspace/EBTA-006/final_impl.md |
Points to the final plan used for the implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
CollectUsageEventssupport by mapping existing CSV rows toprovider.UsageEventValidation
go test ./provider/cursor -run 'TestCollectUsageEvents'go test ./provider/cursor -run 'Test(CollectUsageEvents|ParseUsageCSV|CollectSessions)'go test ./provider/cursor ./cursorgo test ./stats -run TestAggregateEventsmake fmtmake testmake vetmake buildmake lintReview Notes
Multi-agent review found one path-spelling-dependent
EventIDissue in the first implementation. The final patch fixes it by keepingEventIDrow-based (SessionID) andSourcePathseparate.