Skip to content

feat(panel): add insights overview to the outcomes tab - #150

Merged
StuBehan merged 1 commit into
mainfrom
feat/insights-tab
Aug 10, 2026
Merged

feat(panel): add insights overview to the outcomes tab#150
StuBehan merged 1 commit into
mainfrom
feat/insights-tab

Conversation

@StuBehan

@StuBehan StuBehan commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

What

Adds an Insights overview and folds it in with the existing per-ticket view as one Outcomes tab (⌘4), so usage and outcomes live together. No new capture: it reads the same handoff ledger plus the per-branch outcome/PR state the ticket view already computes, so the two agree by construction.

The Outcomes tab (two panes)

Lands on the Overview (the aggregate); carousels into the Tickets list, back (mirrors the Usage tab's pane carousel). Settings stays at ⌘5.

Overview (a scroll page: ↑↓ scroll, ⌘↑↓ jump, W cycles the window):

  • Shipped share headline: of the tokens spent in a trailing window (24h / 7d / 30d / 90d), how much sits on merged/pushed work versus in-flight versus abandoned (committed/needs-review gone quiet for over 14 days).
  • Spend bar partitioning tokens across those three buckets.
  • Top tickets by spend: the heaviest tickets/repos with their dominant outcome; click a row to open the ticket (STACKNUDGE_TICKET_URL) or its PR.
  • Agents: the token mix plus each agent's shipped share (whose work actually merges), and a Models mix rendered as shortened, wrapping pills.

Tickets: the existing per-ticket rollup, unchanged, now reached with / .

Design notes

  • Insights.summarize(...) is pure (no I/O) and unit-tested; it rolls up over the ledger plus the outcome/PR maps.
  • Extracted OutcomeWatcher.effective(local:pr:) so both panes share one "did it ship?" definition (a squash-merged branch reads shipped in each).
  • Promoted the model-name shortener to a shared ModelName.short (used by Sessions and Insights) and added a small FlowLayout so the model pills wrap instead of compressing.
  • Token-only for now (contextTokens, the same effort proxy the ticket view shows); per-model dollar cost and reclaimed-time are planned follow-ups.

Testing

  • InsightsTests: bucket math, shipped-share, the staleness cutoff, PR-supersedes-local, top-tickets ranking and dominant-status precedence, per-agent shipped share, window boundary, and empty/nil cases.
  • scripts/typecheck-tests.sh is green; assertions were verified locally via an in-module harness (swift test needs Xcode, so CI runs the real suite).

@StuBehan StuBehan changed the title feat(panel): add insights tab with spend-to-outcome rollup feat(panel): add insights overview to the outcomes tab Aug 10, 2026
@StuBehan
StuBehan merged commit 19111b2 into main Aug 10, 2026
6 checks passed
@StuBehan
StuBehan deleted the feat/insights-tab branch August 10, 2026 13:06
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.

1 participant