Skip to content

feat: entire recap command#1015

Merged
peyton-alt merged 26 commits into
mainfrom
entire-activity
May 5, 2026
Merged

feat: entire recap command#1015
peyton-alt merged 26 commits into
mainfrom
entire-activity

Conversation

@peyton-alt
Copy link
Copy Markdown
Contributor

@peyton-alt peyton-alt commented Apr 23, 2026

https://entire.io/gh/entireio/cli/trails/bd45a590a611

Summary

  • Redesigns the entire recap terminal output per spec at docs/2026-04-22-entire-recap-visual-redesign-design.md
  • Three-panel layout (summary → activity strip → agents), per-agent cards with comparison bars
  • Wires CLI to the new /api/v1/me/recap endpoint (pairs with entirehq/entire.io#1604)
  • New TUI v keybinding cycles view mode (me/team/both)
  • Drops --30 flag (redundant with --month), drops the worktrees/labels/repos bottom panel

Changes

  • Server clientcmd/entire/cli/recap/me_recap.go (new) fetches /api/v1/me/recap; recap.go prefers it with fallback to the old three-endpoint stack.
  • Bar primitivecmd/entire/cli/recap/render_bar.go (new) renders comparison bars with 9 TDD unit tests.
  • Summary panelrender_summary.go (new): you / team metric rows + reflowing top line + context line. Empty signals omit instead of placeholder.
  • Activity striprender_activity.go (new): every cell rendered (including zero days), axis anchored to today, most active annotation.
  • Agents card — rewritten around three field groups: bars → team qualitative → your qualitative. Empty rows drop entirely.
  • View toggle--view me|contributors|both + TUI v key. Prefixes only in both mode.
  • Cleanup — removes Range30d, removes bottom panel, adds JSON tags to LabelCount.

Pairs with

  • Server endpoint: entirehq/entire.io#1604 (draft)

Test plan

  • 9 renderComparisonBar unit tests (TDD, all pass)
  • Summary / activity / agents card renderer tests updated
  • mise run check — full CI gate green (90s)
  • Live smoke vs. local wrangler dev: renders the spec output with real me + team data

Out of scope / follow-ups

  • Rename recapactivity per docs/2026-04-21-entire-activity-replan.md
  • Server-side aggregateByAgent unit tests (against entire.io)

🤖 Generated with Claude Code


Note

Medium Risk
Adds a new entire recap command that combines local session data with authenticated server endpoints and a new on-disk cache, plus an optional TUI mode; regressions would primarily impact CLI output and network interactions. Risk is moderated by extensive unit tests and best-effort fallbacks when auth/API data is unavailable.

Overview
Introduces a new entire recap command that summarizes recent checkpoint activity with a redesigned 3-panel terminal layout (summary, activity strip, per-agent cards) and optional TUI rendering.

The recap pipeline now loads local session/checkpoint state, links checkpoints to commits via Entire-Checkpoint trailers, and optionally enriches checkpoints from the API (labels/skills/tool profile) using a safe, version-aware disk cache that avoids caching “empty/pending” analyses.

Adds team/contributor comparisons by fetching aggregated data from the new /api/v1/me/recap endpoint (with fallback to legacy repo-overview endpoints + batch analyses), plus new flags for time range, agent filtering, view mode (me|contributors|both), refresh-cache, and allowing insecure HTTP for local dev.

Reviewed by Cursor Bugbot for commit 32c0f74. Configure here.

Copilot AI review requested due to automatic review settings April 23, 2026 17:44
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 32c0f74. Configure here.

Comment thread cmd/entire/cli/recap/render_activity.go Outdated
Comment thread cmd/entire/cli/recap/agents_card.go Outdated
Comment thread cmd/entire/cli/recap.go Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Implements a redesigned entire recap experience (static + TUI) with new visual layout and “me vs team” comparisons, and wires contributor data to the new /api/v1/me/recap endpoint with a fallback to legacy overview endpoints. Also factors relative-time formatting into a shared stringutil.TimeAgo.

Changes:

  • Adds new recap command (static renderer + Bubble Tea TUI) with range/agent filtering and v view-mode cycling (me/contributors/both).
  • Introduces recap data model, loaders, enrichment/cache, server-client types, and multiple render primitives (panels, summary, activity strip, agent cards, bars).
  • Extracts TimeAgo into stringutil and updates existing CLI surfaces to use it.

Reviewed changes

Copilot reviewed 65 out of 65 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
go.mod Promotes go-isatty to a direct dependency for recap format auto-detection.
cmd/entire/cli/trail_cmd.go Switches to stringutil.TimeAgo in trail listing output.
cmd/entire/cli/testutil/testutil.go Adds GitCommitWithMsg helper for commits with bodies/trailers.
cmd/entire/cli/testutil/git_commit_with_msg_test.go Tests GitCommitWithMsg preserves trailers in commit messages.
cmd/entire/cli/stringutil/time.go Adds shared TimeAgo formatter.
cmd/entire/cli/stringutil/time_test.go Unit tests for TimeAgo.
cmd/entire/cli/status_test.go Removes the old inline timeAgo tests (moved to stringutil).
cmd/entire/cli/status_style.go Uses stringutil.TimeAgo for “active …” display.
cmd/entire/cli/status.go Removes local timeAgo and uses stringutil.TimeAgo.
cmd/entire/cli/sessions.go Uses stringutil.TimeAgo in session rendering.
cmd/entire/cli/search_tui.go Uses stringutil.TimeAgo in search UI “age” formatting.
cmd/entire/cli/root.go Registers the new recap command.
cmd/entire/cli/recap.go Adds the recap Cobra command, format selection, contributor fetching, cache refresh, and TUI runner.
cmd/entire/cli/recap_test.go Tests flag parsing/registration and format resolution behavior.
cmd/entire/cli/recap/tui.go Implements Bubble Tea model for interactive recap (range/agent/view toggles).
cmd/entire/cli/recap/tui_test.go Tests TUI model behavior and keybindings (range/agent/view/quit).
cmd/entire/cli/recap/tool_categorize.go Adds tool invocation categorization logic for recap metrics.
cmd/entire/cli/recap/tool_categorize_test.go Tests tool categorization mapping.
cmd/entire/cli/recap/testutil_test.go Adds heavy test fixtures for isolated git/session/checkpoint metadata setup.
cmd/entire/cli/recap/styles.go Defines recap lipgloss style palette/roles and plain-mode behavior.
cmd/entire/cli/recap/styles_test.go Tests style behavior (plain mode no ANSI, text preservation).
cmd/entire/cli/recap/render_summary.go Implements redesigned summary panel rendering (you/team/top/context).
cmd/entire/cli/recap/render_summary_test.go Tests summary rendering and “top line” reflow/omission.
cmd/entire/cli/recap/render_static.go Implements full static recap renderer + session fallback.
cmd/entire/cli/recap/render_static_test.go Tests static output panels, placeholders, and “no bottom panel” behavior.
cmd/entire/cli/recap/render_panel.go Adds shared panel wrapper renderer.
cmd/entire/cli/recap/render_panel_test.go Tests panel wrapper behavior under various widths/titles.
cmd/entire/cli/recap/render_chart.go Adds heatmap strip, gradient bar, and intra-day strip renderers.
cmd/entire/cli/recap/render_chart_test.go Tests chart primitives for edge cases and formatting.
cmd/entire/cli/recap/render_bar.go Adds you/team comparison bar primitive.
cmd/entire/cli/recap/render_bar_test.go Tests comparison bar behavior across many scenarios.
cmd/entire/cli/recap/render_activity.go Implements activity strip panel with peak annotation and axis labels.
cmd/entire/cli/recap/render_activity_test.go Tests activity strip rendering rules (zeros, peak annotation, day peak hour).
cmd/entire/cli/recap/model.go Defines recap data model projections and enums.
cmd/entire/cli/recap/model_test.go Tests model helpers like SpanMinutes and DataSource.String().
cmd/entire/cli/recap/model_range_test.go Compile-time guard that Range30d is removed.
cmd/entire/cli/recap/metrics.go Adds aggregation helpers (range/day/agent/repo, dominant label).
cmd/entire/cli/recap/metrics_test.go Tests metrics/aggregation correctness and thresholds.
cmd/entire/cli/recap/me_recap.go Adds client/types for /api/v1/me/recap and conversion to local shapes.
cmd/entire/cli/recap/load.go Loads local session/checkpoint data, links commits, stamps repos, enriches via API.
cmd/entire/cli/recap/load_test.go Tests recap loading defaults and scope/enrichment behaviors.
cmd/entire/cli/recap/load_checkpoints_test.go Tests checkpoint attachment, dedupe, and linked-commit propagation.
cmd/entire/cli/recap/load_linked.go Implements linked commit lookup via git log trailer scanning.
cmd/entire/cli/recap/load_linked_test.go Tests linked commit lookup by trailer.
cmd/entire/cli/recap/insights.go Adds “next action” hint selection.
cmd/entire/cli/recap/insights_test.go Tests next-action priority rules.
cmd/entire/cli/recap/heatmap.go Adds daily heatmap builder + intensity tiers.
cmd/entire/cli/recap/heatmap_test.go Tests heatmap bucketing and intensity mapping.
cmd/entire/cli/recap/enrich.go Adds checkpoint analysis enrichment with caching and safety checks.
cmd/entire/cli/recap/enrich_test.go Tests enrichment behavior, caching, deep-copy, and invalid repo handling.
cmd/entire/cli/recap/cache.go Adds on-disk analysis cache with key validation and atomic writes.
cmd/entire/cli/recap/cache_test.go Tests cache behavior (round-trip, versioning, traversal rejection, atomicity).
cmd/entire/cli/recap/api_types.go Adds API response types + canonical label taxonomy filtering.
cmd/entire/cli/recap/api_types_test.go Tests JSON unmarshal + canonical label set behavior.
cmd/entire/cli/recap/aggregate.go Adds tool-profile/worktree aggregations + repo resolution.
cmd/entire/cli/recap/aggregate_test.go Tests aggregation helpers + repo remote parsing.
cmd/entire/cli/recap/contributors.go Fetches/merges contributor data (legacy overview stack + batch analyses).
cmd/entire/cli/recap/contributors_test.go Tests contributor merge/application behavior.
cmd/entire/cli/recap/badges.go Adds deterministic local badges (active/linked/delegated/resumed).
cmd/entire/cli/recap/badges_test.go Tests badge computation.
cmd/entire/cli/recap/agents_card.go Builds/renders agent cards with comparison bars and qualitative blocks.
cmd/entire/cli/recap/agents_card_test.go Tests agent-card rendering across view modes and widths.

Comment thread cmd/entire/cli/recap.go Outdated
Comment thread cmd/entire/cli/recap_test.go Outdated
Comment thread cmd/entire/cli/recap/agents_card.go Outdated
Comment thread cmd/entire/cli/recap/render_panel.go Outdated
Comment thread cmd/entire/cli/recap/render_summary.go Outdated
Comment thread cmd/entire/cli/recap/render_bar.go Outdated
Comment thread cmd/entire/cli/recap/render_activity.go Outdated
@peyton-alt peyton-alt force-pushed the entire-activity branch 2 times, most recently from f0b7762 to 385bfcf Compare April 23, 2026 19:23
peyton-alt and others added 14 commits April 23, 2026 12:27
Introduces the 'entire recap' CLI command that shows checkpoint activity
across day/week/month/90d ranges. Local session loading, api enrichment
cache, view builder, heatmap, badges, aggregators, contributors fetch
from the repo-overview endpoints, TUI + static renderers.

This is the baseline from which follow-up commits wire /api/v1/me/recap,
redesign the visual layout with comparison bars, and add the view toggle.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: a8b9ab719bdc
Pairs with entirehq/entire.io#1604. Prefers the consolidated /me/recap
endpoint when available; falls back to the three-endpoint stack when
the server doesn't have /me/recap yet.

- Adds me_recap.go with FetchMeRecap, TimeframeForRange, and
  ContributorsFromMeRecap for the fast-path client.
- Adds stampRepos so cp.Repo is populated for local checkpoints.
- Adds hasUsefulSignal to invalidate cache entries with empty payloads.
- Adds AnalysisStatusComplete guard in EnrichCheckpoint to skip pending
  or failed rows instead of poisoning the cache with blanks.
- Adds SkillsUsed/MCPServers to RecapCheckpoint + CheckpointAnalysisResponse.
- Threads Notes diagnostic footer through View.
- JSON-tags LabelCount so musttag accepts it in decode paths.
- Uses repoUnknown constant in aggregate_test.go (goconst fix).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 0de0ce0a0421
--30 rolling-30-days overlaps with --month (this calendar month) for
practical purposes. Range30d had no persisted state (feature hasn't
shipped), so no migration needed. Users who type --30 get cobra's
native unknown-flag error with suggestion pointing at --90 or --month.

Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 0d929f3248b7
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Agents panel spec
Plan Chunk 2.

Adds:
- team lipgloss style (magenta 170, bold) for contributors column accent
- renderComparisonBar(you, team, width, styles) primitive with 9 TDD tests
  covering: you>team, team>you, equal (striped), one-sided (both directions),
  tiny-vs-huge rounding floor, both-zero drop, narrow/wide width clamping.

No wiring yet — Chunk 5 will integrate this into the agents card.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 4db4bb19673f
The Equal test was using width=10 which contradicted the spec's min=12.
Keep the spec constant and update the test to use width=12 (and expect
6+6 striped cells, not 5+5).

Entire-Checkpoint: 8968e65373ea
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Summary
Plan Chunk 3.

Drops the Top agent / Top skill / Focus / Top model placeholder rows.
New top line reflows when signals are empty; disappears when all four
are empty. You/team split mirrors the Agents panel framing.
Moves summary rendering into its own file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 9837c81fcc5a
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Activity
Plan Chunk 4.

Renders every cell (including zero days) so the strip fills its full
width. Anchors rightmost to today. Adds 'most active: <time>'
annotation to the top-right (hourly for --day, 'Jan 2' for longer
ranges). Moves activity rendering into its own file.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 780df16ce84f
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Agents
Plan Chunk 5.

Per-agent card now has 3 bar rows (tokens/sessions/checkpoints) +
team qualitative block + your qualitative block, each skipped when
irrelevant. Drops MCP servers and Distinct contribs per spec.
Alphabetical tie-break on combined-sessions sort for snapshot
determinism. Panel-level you/team legend replaces per-card headers.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 9abf315e5966
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Page composition
Plan Chunk 6.

Labels already inside agent cards (team labels rows). Repos inside agent
cards too (your repos). Worktrees adds no daily value. Three-panel output
(summary → activity → agents) is the new shape.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: ee3fef263e39
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Header bar
Plan Chunk 7.

Cycles ViewBoth → ViewMe → ViewContributors → ViewBoth.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 83ad8e15f554
Spec: docs/2026-04-22-entire-recap-visual-redesign-design.md §Minimum
terminal width. Plan Chunk 8.

When the bar drops below barMinWidth (12 cells) the primitive returns
empty; the card row renders just the numeric readout. Preserves
usability on <70-col terminals.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Entire-Checkpoint: 07f7775d23d8
…heckpoints

- Tokens now read from s.TokenUsage (session-level) instead of the
  always-nil cp.TokenUsage. projectCheckpoint in load.go intentionally
  leaves cp.TokenUsage unset; the aggregators hadn't been updated.
- renderSummaryBand no longer duplicates the range title — renderPanel
  already shows view.Title, so the inner title line was a double.
- Top-agent calculation now weights each session by 1 + len(Checkpoints)
  so an agent with 23 sessions but 0 checkpoints doesn't outrank one
  with 15 sessions and 106 checkpoints.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: a6117ab65f84
… ships

Removes FetchContributors and the three-endpoint merge stack
(agent-activity + contributor-agents + contributor-tokens) since
the consolidated /api/v1/me/recap endpoint landed in
entirehq/entire.io#1604.

Keeps ContributorsData + AgentContrib as the shared shape — still
used by the me_recap.go adapter and the view renderer.

Entire-Checkpoint: 95a5057707a2
peyton-alt and others added 4 commits April 23, 2026 12:59
- applyContributors was dropping ContribLabels/Skills/ToolMix from the
  /me/recap response; those fields now flow into AgentCard so team
  labels/skills/tool mix rows actually render.
- Labels use the mockup's ● bullet with semantic color instead of
  '<label> <pct>%' — the percentage was noise.
- Agents panel title now includes the range ('Agents · 90d', etc.)
  per the mockup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Entire-Checkpoint: 77908e4c5ac6
Removes 4 unused aggregators (AggregateRange, AggregateByDay,
AggregateByAgent, AggregateByRepo) and the 4 summary types that only
they consumed (RecapRangeSummary, RecapAgentSummary, RecapRepoSummary,
RecapDay). Drops heatmap.go entirely (4 unused exports left from an
abandoned local heatmap path) and tool_categorize.go (unused local
tool-time classifier now that tool-time comes from the server).

Also fixes a missed registration: newRecapCmd() was never wired into
root.go in the prior foundation commit, so `entire recap` wouldn't
appear in --help or execute. Adds the one-line AddCommand.

Net -674 lines in the recap package.

Entire-Checkpoint: 97097f304a34
The team-side aggregates (labels, skills, tool mix) already flowed from
/api/v1/me/recap into the agents card via b15d9d4. This mirrors the
same plumbing on the me-side so the user's own row matches the dashboard
counts instead of being recomputed from local checkpoint state.

What changes:
- AgentCard gains MeLabels / MeSkills / MeToolMix, populated by a new
  applyServerMe pass that overlays /me/recap's me-side aggregates on
  the locally-bucketed cards.
- recap.go's fetchContributorsWithDiag becomes fetchRecapDataWithDiag,
  returning (serverMe, contributors, daily, diag) in one round trip
  with explicit since/until bounds derived from the CLI's range —
  replacing the looser TimeframeForRange handoff.
- BuildOpts gains ServerMe + ServerDaily; runRecapTUI/NewTUIModel
  thread them through so the v / 1-4 keybindings can rebuild the view
  from the cached fetch instead of re-hitting the server.
- me_recap.go gains MeFromMeRecap, parallel to ContributorsFromMeRecap.
  The static + activity renderers prefer server daily counts when
  available, falling back to local aggregation when offline.
- Two new tests pin formatToolMix's normalization of raw category
  counts to top-3 percentage bars.

Pairs with entirehq/entire.io#1604 (now perf-fixed via Promise.all).
MCP servers stay deliberately unrendered per c990a5e.

Entire-Checkpoint: d69c684aa89d
@peyton-alt peyton-alt changed the title feat(recap): new visual layout with me/team comparison bars feat(entire recap): new visual layout with me/team comparison bars Apr 27, 2026
@peyton-alt peyton-alt changed the title feat(entire recap): new visual layout with me/team comparison bars feat: entire recap command Apr 27, 2026
The three-panel rendered output (summary + activity strip + agents card)
regularly exceeds the visible terminal height, especially when the agents
card lists 4+ agents with bars and qualitative rows. The previous
TUIModel handed the full string straight to bubbletea, which clipped at
the bottom and offered no scroll affordance — users had to shrink their
terminal font to see the rest.

Wraps the rendered body in a bubbles `viewport.Model`:
- ↑/↓, j/k, page up/down, mouse wheel scroll within the rendered output
- Help line stays pinned outside the viewport so the keybind hint is
  always visible regardless of scroll position
- Range/agent/view-mode toggles refresh viewport content and snap scroll
  back to the top so the summary is always seen first
- Pre-WindowSizeMsg renders a static fallback for the brief flash before
  bubbletea sends the initial size; viewport takes over on first message

Mirrors the viewport pattern already used in activity_tui.go.

Entire-Checkpoint: 7f3827580375
Range toggles (d/w/m/4) used to either show frozen day-1 data (server
fields cached forever) or display the previous range's numbers under
the new range's title (after we added refetch but before we cleared
stale fields). This wires the TUI through a proper cache:

- On startup, seed cache[initialRange] with the synchronous fetch's
  payload, then fire prefetches for the other 3 ranges in parallel via
  tea.Batch. After ~1-5s background round-trip every range toggle is
  a cache hit.
- On range toggle: cache hit -> swap data, instant render. Cache miss
  with no in-flight fetch -> clear server fields (so we don't display
  the previous range's numbers under the new title), mark loading,
  fire the fetch. Cache miss with in-flight fetch -> mark loading and
  wait for the existing reply.
- Active days now reads from server daily counts when present, matching
  the dashboard cross-worktree count instead of undercounting from
  local sessions.

Pairs with entirehq/entire.io#1604 server-side perf work.

Entire-Checkpoint: 8ac353ca5a57
CI's gofmt check caught struct field misalignment in TUIModel that
my local lint missed (we'd run gofmt -s -w on a formatted tree, but
this section needed re-alignment after the cache+inFlight fields were
added). gofmt -s -d output was empty locally yet CI rejected; rerunning
gofmt -w produced this 3-line whitespace fix.

Entire-Checkpoint: 288a91aff142
@peyton-alt
Copy link
Copy Markdown
Contributor Author

Example: #1113 makes interactive with toggles
entire-recap-90-days

@peyton-alt peyton-alt marked this pull request as ready for review May 5, 2026 01:05
@peyton-alt peyton-alt requested a review from a team as a code owner May 5, 2026 01:05
@peyton-alt peyton-alt merged commit 5513156 into main May 5, 2026
9 checks passed
@peyton-alt peyton-alt deleted the entire-activity branch May 5, 2026 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants