Skip to content

[codex] add event aggregation foundation#26

Merged
Miss-you merged 2 commits into
mainfrom
codex/ebta-001-core-events
Apr 16, 2026
Merged

[codex] add event aggregation foundation#26
Miss-you merged 2 commits into
mainfrom
codex/ebta-001-core-events

Conversation

@Miss-you

Copy link
Copy Markdown
Owner

Summary

  • Add provider.UsageEvent and optional provider.UsageEventProvider as the foundation for event-based token aggregation.
  • Add timezone-aware event filtering and daily aggregation helpers in stats.
  • Add focused tests for cross-day event attribution, timezone grouping, distinct session counting, source-path fallback, model grouping, and date filtering.
  • Mark EBTA-001 done in the event aggregation task board and add supporting OpenSpec/workspace artifacts.

Validation

  • make fmt
  • make test
  • make vet
  • make build
  • make lint
  • secret scan over main...HEAD

Notes

This PR only lands the shared event model and stats foundation. Command integration and native provider event collectors remain split into follow-up task-board items (EBTA-002 through EBTA-010).

Copilot AI review requested due to automatic review settings April 16, 2026 08:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the core foundation for event-based token aggregation by introducing a shared UsageEvent model in provider and new timezone-aware event filtering/aggregation helpers in stats, along with focused tests and supporting OpenSpec/workspace artifacts.

Changes:

  • Introduce provider.UsageEvent and optional provider.UsageEventProvider for timestamped usage deltas.
  • Add stats.AggregateEventsByDayWithDimension and stats.FilterEventsByDateRange for localized daily aggregation + inclusive date filtering.
  • Add focused unit tests and supporting OpenSpec/task-board/workspace documentation for EBTA-001.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
workspace/EBTA-001/test_strategy.md Documents the focused test plan for EBTA-001.
workspace/EBTA-001/review.md Records EBTA-001 review scope and findings.
workspace/EBTA-001/original_impl.md Captures limitations of the pre-event model approach.
workspace/EBTA-001/new_impl.md Describes the candidate event-based implementation approach.
workspace/EBTA-001/final_impl_v1.md Implementation plan iteration notes.
workspace/EBTA-001/final_impl.md Final implementation plan and semantics summary.
stats/events.go Implements event-based daily aggregation + localized date filtering helpers.
stats/events_test.go Adds tests for cross-day attribution, timezone grouping, distinct session counting, and filtering.
provider/provider.go Adds new event model and optional provider interface.
openspec/changes/event-based-token-aggregation-core/.openspec.yaml Registers the OpenSpec change metadata.
openspec/changes/event-based-token-aggregation-core/design.md Design rationale/decisions for EBTA-001.
openspec/changes/event-based-token-aggregation-core/proposal.md Proposal overview and impact statement.
openspec/changes/event-based-token-aggregation-core/specs/event-based-token-aggregation-core/spec.md Requirements/spec for event model + stats behavior.
openspec/changes/event-based-token-aggregation-core/tasks.md Tracks implementation tasks for the OpenSpec change.
docs/plans/2026-04-16-event-based-token-aggregation-task.md Marks EBTA-001 done and appends change-log entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread stats/events.go Outdated
@Miss-you
Miss-you merged commit 6d3a51f into main Apr 16, 2026
7 checks passed
@Miss-you
Miss-you deleted the codex/ebta-001-core-events branch April 16, 2026 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants