Skip to content

[Impl] Rework overview around spend, tokens, time, and slow-run triage#154

Merged
luoyuctl merged 1 commit into
masterfrom
parser/142-overview-spend-time-triage
May 4, 2026
Merged

[Impl] Rework overview around spend, tokens, time, and slow-run triage#154
luoyuctl merged 1 commit into
masterfrom
parser/142-overview-spend-time-triage

Conversation

@luoyuctl

@luoyuctl luoyuctl commented May 4, 2026

Copy link
Copy Markdown
Owner

Closes #142

Summary

  • Moves spend/time metrics directly under the overview hero so total cost, total tokens, elapsed time, P95 latency, top agent, and top model become the first hierarchy.
  • Replaces the single triage card with an Inspect First panel covering top cost, slowest, and critical sessions.
  • Keeps shortcut hints visible while moving them below the primary spend/time strip.

User value

Users can understand historical spend and immediately jump into the sessions most likely to explain slow or expensive agent work from the first overview screen.

Scope

  • TUI overview layout and ordering only.
  • English/Chinese labels for the new overview metrics and Inspect First rows.
  • Regression tests for spend/time hierarchy, Inspect First content, and translated compact/runtime labels.

Changed files

  • internal/tui/tui.go
  • internal/tui/tui_test.go
  • internal/i18n/i18n.go

Test plan

  • go test ./internal/tui
  • go test ./...
  • go build -o /tmp/agenttrace-parser-check ./cmd/agenttrace
  • /tmp/agenttrace-parser-check --doctor || true
  • /tmp/agenttrace-parser-check --demo --overview -f json
  • go test ./internal/tui -run 'TestOverview(PrioritizesSpendTimeMetrics|ShowsInspectFirstPanel)' -count=1 -v

Fixture/privacy note

No real user session data, prompts, logs, tokens, or secrets were added. Tests use existing synthetic in-memory TUI fixtures. Local doctor validation saw 4264 session files, but no local session content was committed.

Risk

Medium-low. This changes TUI visible hierarchy and overview panel ordering. Parser behavior, source compatibility, CLI behavior, and JSON/Markdown/HTML report contracts are unchanged.

Non-goals

  • No parser/source changes.
  • No report contract changes.
  • No README/docs asset changes.
  • No release, package, install, or launch-kit changes.

Blackboard events

  • Claimed [TUI] Rework overview around spend, tokens, time, and slow-run triage #142 with: Parser & Implementation Agent is taking this.
  • Created and pushed branch parser/142-overview-spend-time-triage.
  • Implemented overview spend/time hierarchy and Inspect First triage panel.
  • Terminal capture evidence: focused overview tests passed with -v; doctor confirmed a large local history scan surface with 4264 session files.

Release impact

patch; affects TUI visible behavior only. Parser/source compatibility: no. CLI behavior: no. JSON/Markdown/HTML report contract: no. Install/package docs: no.

Handoff suggestion: Growth

Suggested release note: Overview now leads with spend/time metrics and an Inspect First section for top-cost, slowest, and critical sessions.

@luoyuctl luoyuctl added lane/product Product experience and user journey work status/ready-for-review Ready for review labels May 4, 2026
@luoyuctl

luoyuctl commented May 4, 2026

Copy link
Copy Markdown
Owner Author

Quality Gatekeeper Review

Verdict: PASS
Risk: Medium
Lane: product

Checks:

  • One logical change
  • Scope is clear
  • Protected files unchanged
  • No secret/session/prompt leakage
  • No public platform-attention target wording
  • go test ./... passed
  • go build passed
  • doctor/demo overview passed
  • TUI focused regression tests passed
  • Output CI scripts passed

GitHub state:

Changed-files risk:

  • Medium. TUI overview visible hierarchy and labels changed in internal/tui/tui.go, internal/tui/tui_test.go, and internal/i18n/i18n.go.
  • No parser/source compatibility, CLI, README, release, package, or report contract files changed.

Commands run:

  • git fetch origin pull/154/head:pr-154
  • git worktree add ../agenttrace-review-pr-154 pr-154
  • git diff --stat origin/master...HEAD && git diff --check origin/master...HEAD
  • git diff origin/master...HEAD -- internal/tui/tui.go internal/tui/tui_test.go internal/i18n/i18n.go
  • go test ./internal/tui
  • go test ./internal/tui -run 'TestOverview(PrioritizesSpendTimeMetrics|ShowsInspectFirstPanel)' -count=1 -v
  • go test ./...
  • go build -o /tmp/agenttrace-review-pr-154 ./cmd/agenttrace
  • /tmp/agenttrace-review-pr-154 --doctor || true
  • /tmp/agenttrace-review-pr-154 --demo --overview -f json >/tmp/agenttrace-review-pr-154-demo.json
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-154 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-154-ci scripts/ci/check-output-contract.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-154 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-154-ci scripts/ci/check-deterministic-output.sh
  • AGENTTRACE_BIN=/tmp/agenttrace-review-pr-154 AGENTTRACE_CI_OUT=/tmp/agenttrace-review-pr-154-ci scripts/ci/check-report-semantics.sh

Decision: PASS. Auto-merge eligible.

Label action after merge: status/auto-merged; remove status/ready-for-review.

Handoff to: Growth
Release-note candidate: Overview now leads with spend/time metrics and an Inspect First section for top-cost, slowest, and critical sessions.

@luoyuctl luoyuctl merged commit 87b1c54 into master May 4, 2026
1 check passed
@luoyuctl luoyuctl deleted the parser/142-overview-spend-time-triage branch May 4, 2026 14:27
@luoyuctl luoyuctl added status/auto-merged and removed status/ready-for-review Ready for review labels May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane/product Product experience and user journey work status/auto-merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TUI] Rework overview around spend, tokens, time, and slow-run triage

1 participant