Repository navigation
Add drill-through: from aggregates to the sessions that compose them - #1295
Closed
ozymandiashh wants to merge 4 commits into
Closed
ozymandiashh wants to merge 4 commits into
ozymandiashh wants to merge 4 commits into
Conversation
… the CLI reports sessions --format json --contributions attaches turn-granular segments (day, task category, carried git branch, short-model costs, active PR set) that partition each session, so a selection can sum its exact share (20 of a session's 100) while aggregate totals reconcile. Legacy prLinks-only transcripts carry the whole set with the approx even-split marker, matching the by-PR report. The menubar payload's topSessions and project sessionDetails now carry provider + sessionId (+ raw projectKey for topSessions) so the desktop can open the exact session behind a row, and topActivities carries the raw TaskCategory for chips. serve learns the --contributions flag so the desktop's resident child can answer it.
…n drawer InvestigationFilters is a normalized, serializable selection (days, providers, projects, models, categories, PRs, project-scoped branches, provider-scoped sessions) with OR within a dimension and AND across them. Contribution math walks each row's segments and multiplies per-dimension shares, so sums reconcile every dimension's aggregate exactly; rows without segments are excluded and disclosed. NavState + the history stack back the in-app Back/Forward (filters, sort, page depth, open drawer) and the restart snapshot. The drawer shows metadata, full totals beside the in-selection figures, and the per-model/category/branch/day/PR breakdowns with an Escape-and-focus-return contract.
…s, drawer, history Every report grows real entries: Overview day bars, expensive sessions (provider+id matched), model names, task categories, Spend projects, and PR cards. The Sessions destination renders the selection chips with per-chip removal and Clear, fetches the contributions report once per population (widened to cover the selected days so a day outside the top-bar period still reconciles), computes every chip combination client-side over the full population, and shows each row's contribution beside its full cost. Row clicks open the side drawer (Escape closes, focus returns); the top bar gains Back/Forward (Cmd+[ / Cmd+] on macOS, Alt+arrows elsewhere) over the in-app history; the position survives a renderer restart. IPC gains getSessionsContributions with the same argv validation as the plain report.
Member
|
Landed as #1316 (2d18da0) with your commits and authorship intact, rebased onto current main, plus three fixes found on real data: the new sessions handler now carries the Projects-pane filter from #1307 (it landed beside it with no textual conflict and silently bypassed it), rawCategory is now actually produced so category drill-through works (it was declared and forwarded but never written), and the model drill keys off the display name so it matches the segments (0 of 19 matched before). Contribution partition verified exact over 1929 sessions. One gap left open and tracked in #1317: the pull-request row is not wired. Thank you. |
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.
Connect desktop aggregates to the sessions behind them: day, model, category, project and PR selections open a filtered session list with a detail drawer and navigation history. The view separates each session's contribution to the selection from its full cost.
sessions --format json --contributionssupplies canonical project ids and call-day segments with model costs and actual per-model call/token counts. Provider identity participates in row matching; ambiguous identities remain explicitly unattributable. Each call follows its own timestamp across midnight. Model usage is independent of model price, including free models and supplementary accounting. PR selection retains the existing even-share attribution rules. Older cached payloads without model usage are excluded with a coverage disclosure when a model filter needs that data, and the report cache namespace is refreshed.Concrete regression fixtures now return:
Validation: full root suite compared with upstream/main
a1805393(3,948 passed; the same four Node 26 DEP0205 stderr failures as main). The full app run had 905 passes and three timing failures in unchangedelectron/cli.test.ts; rerunning that entire file alone passed all 81 tests (four skipped). Root/app typechecks and CLI/Electron/renderer builds passed. The production contribution engine and renderer selection functions were replayed over the concrete fixtures above; all corrected values reconcile. The main project-filter suite passes all nine tests on Node 24.Branch, period-comparison and work-unit integrations across the other feature PRs remain separate work. Details:
docs/drill-through.md.