Skip to content

refactor: rename Recap back to Trace for AI model comprehension#443

Merged
anandgupta42 merged 3 commits intomainfrom
refactor/rename-recap-to-trace
Mar 24, 2026
Merged

refactor: rename Recap back to Trace for AI model comprehension#443
anandgupta42 merged 3 commits intomainfrom
refactor/rename-recap-to-trace

Conversation

@anandgupta42
Copy link
Copy Markdown
Contributor

@anandgupta42 anandgupta42 commented Mar 24, 2026

What does this PR do?

Renames "Recap" back to "Trace" across the entire codebase (source, tests, docs, viewer). AI models natively understand "trace" as standard observability terminology but struggle with the non-standard "recap" — users reported that "compare recaps" confuses models while "compare traces" works perfectly.

29 files changed across:

  • Source (7 files): Class RecapTrace, CLI command recaptrace, TUI /recap/trace, viewer branding
  • Docs (7 files): recap.mdtrace.md, all doc references, image directory renamed
  • Tests (12 files): All imports and variable names updated
  • Other (3 files): README, CHANGELOG, mkdocs.yml

Backward-compat aliases preserved: Tracer, Recap both point to Trace. CLI recap and TUI /recap kept as hidden aliases.

Type of change

  • Refactoring (no functional changes)

Issue for this PR

Closes #442

How did you verify your code works?

  • TypeScript typecheck passes (turbo typecheck — 5/5 packages)
  • Upstream marker check passes (bun run script/upstream/analyze.ts --markers --base main --strict)
  • All backward-compat aliases verified: Tracer, Recap exports, CLI recap alias, TUI /recap alias
  • 6-model consensus code review (Claude, GPT 5.2, Gemini 3.1, Kimi K2.5, MiniMax M2.5, GLM-5)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code where necessary
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • New and existing tests pass with my changes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Documentation

    • Updated docs, guides, CLI help, and navigation to rename observability feature from "Recap" to "Trace" and to reference tracing behavior and configuration.
  • Refactor

    • Rebranded viewer, UI text, share/export labels, and exported HTML filenames to "Trace" (session recordings).
    • CLI/TUI commands and help now use trace//trace (examples: altimate trace list/view).
  • Chores

    • Backward-compatible aliases retained; "recap" references remain supported but are deprecated.

AI models (Claude, GPT, etc.) struggle to understand "compare recaps" but
natively understand "compare traces" — `trace` is standard observability
terminology. This reverts the Tracer→Recap rename while keeping backward-
compat aliases for both `Tracer` and `Recap`.

**Source code (7 files):**
- Class `Recap` → `Trace` in `tracing.ts` with backward-compat aliases
- CLI command `recap` → `trace` with `recap` kept as hidden alias
- TUI slash command `/recap` → `/trace` with `recap` kept as alias
- Viewer branding: "Altimate Recap" → "Altimate Trace"
- All variable/function names updated (`sessionRecaps` → `sessionTraces`, etc.)

**Documentation (7 files):**
- `docs/configure/recap.md` → `docs/configure/trace.md`
- All doc references updated: CLI, TUI, CI/headless guides
- Image directory `assets/images/recap/` → `assets/images/trace/`

**Tests (12 files):**
- All imports updated `Recap` → `Trace`
- Variable shadowing fixed: `const trace: TraceFile` → `const traceFile`

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review to trigger a review.

Tip: disable this comment in your organization's Code Review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: e59d5d8d-2c06-455e-9960-386bdb41eb03

📥 Commits

Reviewing files that changed from the base of the PR and between 82e9ff8 and c708ed0.

📒 Files selected for processing (6)
  • packages/opencode/src/cli/cmd/tui/app.tsx
  • packages/opencode/src/cli/cmd/tui/worker.ts
  • packages/opencode/test/altimate/tracing-adversarial-snapshot.test.ts
  • packages/opencode/test/altimate/tracing-de-attributes.test.ts
  • packages/opencode/test/altimate/tracing-display-crash.test.ts
  • packages/opencode/test/altimate/tracing-e2e.test.ts
✅ Files skipped from review due to trivial changes (6)
  • packages/opencode/test/altimate/tracing-adversarial-snapshot.test.ts
  • packages/opencode/test/altimate/tracing-de-attributes.test.ts
  • packages/opencode/test/altimate/tracing-display-crash.test.ts
  • packages/opencode/src/cli/cmd/tui/worker.ts
  • packages/opencode/src/cli/cmd/tui/app.tsx
  • packages/opencode/test/altimate/tracing-e2e.test.ts

📝 Walkthrough

Walkthrough

This PR renames the observability feature terminology from "Recap" back to "Trace" across docs, CLI, TUI, viewer, core observability code, and tests, and adds backward-compatible aliases to preserve existing API compatibility.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md, README.md, docs/mkdocs.yml, docs/docs/configure/trace.md, docs/docs/data-engineering/guides/ci-headless.md, docs/docs/usage/ci-headless.md, docs/docs/usage/cli.md, docs/docs/usage/tui.md
Renamed user-facing docs and navigation entries from "Recap" to "Trace", updated CLI examples and links, and changed config/flag wording (e.g., --no-trace) and viewer/share text.
Core Observability
packages/opencode/src/altimate/observability/tracing.ts, packages/opencode/src/altimate/observability/viewer.ts
Renamed exported class RecapTrace, moved active singleton/accessors to Trace, added deprecated backward-compat aliases (Recap/TracerTrace), and updated generated viewer branding, filenames, and in-page labels from "Recap" → "Trace".
CLI & TUI
packages/opencode/src/cli/cmd/trace.ts, packages/opencode/src/cli/cmd/tui/app.tsx, packages/opencode/src/cli/cmd/tui/component/dialog-trace-list.tsx, packages/opencode/src/cli/cmd/tui/worker.ts, packages/opencode/src/index.ts
Replaced recap command/exports with trace equivalents (RecapCommandTraceCommand, recap subcommand → trace, swapped aliases), renamed TUI helpers/dialogs/state/maps and viewer URL helpers to trace-based names, and updated user-facing strings.
Tests
packages/opencode/test/altimate/tracing*.test.ts (multiple files)
Consistent test-side renames: local parsed trace variables renamed from tracetraceFile and all assertions/uses updated; no test logic or expected values changed.
Misc (packaging/config)
packages/opencode/src/... (imports/registrations)
Updated import wiring and CLI command registrations to use trace-related exports and names.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • mdesmet
  • suryaiyer95

Poem

🐰 I hopped through code, from Recap to Trace,

renamed each corner, left no misplaced space.
Aliases shelter the old and the new,
session recordings hum as observability grew.
A tiny rabbit cheers: "Clean names — that's our pace!"

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 31.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title clearly and concisely describes the main change: renaming 'Recap' back to 'Trace' for AI model comprehension. It accurately reflects the primary objective of the refactoring.
Description check ✅ Passed The PR description provides a comprehensive overview including what changed (29 files across source, docs, tests), why (AI model comprehension of standard observability terminology), verification steps (TypeScript typecheck, upstream marker check, backward-compat validation), and includes the required checklist items marked complete.
Linked Issues check ✅ Passed The code changes comprehensively address issue #442's requirements: renamed 'Recap' to 'Trace' throughout source code (class, CLI command, TUI command, viewer branding), documentation (7 files), and tests (12 files), while preserving backward-compatibility aliases (Tracer, Recap exports and CLI/TUI aliases) as specified. All coding requirements from the linked issue are met.
Out of Scope Changes check ✅ Passed All changes are directly related to the refactoring objective of renaming 'Recap' to 'Trace'. Changes include renaming classes, CLI commands, TUI commands, documentation, test variables, and viewer branding—all scoped to this terminology update with no unrelated functional modifications or feature additions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/rename-recap-to-trace

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (4)
packages/opencode/test/altimate/tracing-display-crash.test.ts (1)

2-2: Top-level comment wording can be clearer.

“traceFile list display” reads like an implementation detail; “trace list display” is cleaner documentation wording.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/opencode/test/altimate/tracing-display-crash.test.ts` at line 2,
Update the top-level test file comment to use clearer wording: replace
"traceFile list display" with "trace list display" in the file's header comment
so it documents the test purpose more cleanly; locate the comment at the top of
packages/opencode/test/altimate/tracing-display-crash.test.ts and change that
phrase while preserving the rest of the sentence (e.g., "Tests for trace list
display, title handling, formatting utilities, ...").
packages/opencode/test/altimate/tracing-adversarial-snapshot.test.ts (1)

7-7: Prefer “trace viewer” in prose comments.

“live traceFile viewer” reads like an internal variable name rather than user-facing terminology; “live trace viewer” is clearer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/opencode/test/altimate/tracing-adversarial-snapshot.test.ts` at line
7, Update the prose comment that currently says "live traceFile viewer" to use
the user-facing term "live trace viewer" instead; search for the exact phrase
"live traceFile viewer" (or similar occurrences of "traceFile" in comments) and
replace it with "live trace viewer" so the comment reads clearly as user-facing
text.
packages/opencode/test/altimate/tracing-e2e.test.ts (1)

6-11: Comment text reads awkwardly with variable-style wording.

Consider “trace file” and “trace viewer” in the header comments for readability.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/opencode/test/altimate/tracing-e2e.test.ts` around lines 6 - 11, The
header comment enumerating test goals uses variable-style terms like "traceFile"
and "traceFile viewer server" which read awkwardly; update the phrasing to use
natural language (e.g., "trace file" and "trace viewer") consistently across the
header so items such as "The traceFile file is valid..." and "The traceFile
viewer server works correctly" become "The trace file is valid and complete at
every point" and "The trace viewer server works correctly" to improve
readability and consistency.
packages/opencode/test/altimate/tracing-de-attributes.test.ts (1)

2-2: Consider simplifying the docstring wording.

“traceFile attributes” can be read as a variable name; “trace file attributes” is clearer.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/opencode/test/altimate/tracing-de-attributes.test.ts` at line 2,
Update the top-of-file docstring/comment that currently reads "Tests for data
engineering domain-specific traceFile attributes." to use clearer wording "trace
file attributes" (i.e., change "traceFile attributes" → "trace file attributes")
so the phrase isn't interpreted as a variable name; edit the header comment in
tracing-de-attributes.test.ts accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/opencode/src/cli/cmd/tui/app.tsx`:
- Around line 42-45: getTraceViewerUrl currently pins traceViewerTracesDir only
when traceViewerServer is first created, so subsequent calls with a new
tracesDir still generate URLs pointing at the old directory; to fix, always
update traceViewerTracesDir = Trace.getTracesDir(tracesDir) at the start of
getTraceViewerUrl (before creating/returning the URL) so the server uses the
latest path on every call and apply the same change where similar logic appears
(references: getTraceViewerUrl, traceViewerTracesDir, traceViewerServer,
Trace.getTracesDir).

In `@packages/opencode/src/cli/cmd/tui/worker.ts`:
- Around line 50-54: startEventStream() can be called multiple times (e.g., on
rpc.setWorkspace) but per-session state stored in sessionTraces and
sessionUserMsgIds is never cleared, causing stale traces to leak across stream
restarts; update startEventStream() (or the restart path) to reset per-session
state by calling sessionTraces.clear() and sessionUserMsgIds.clear() (and
reinitialize any related counters or limits like MAX_TRACES handling if
applicable) before establishing the new stream so each session starts with a
clean trace state.

---

Nitpick comments:
In `@packages/opencode/test/altimate/tracing-adversarial-snapshot.test.ts`:
- Line 7: Update the prose comment that currently says "live traceFile viewer"
to use the user-facing term "live trace viewer" instead; search for the exact
phrase "live traceFile viewer" (or similar occurrences of "traceFile" in
comments) and replace it with "live trace viewer" so the comment reads clearly
as user-facing text.

In `@packages/opencode/test/altimate/tracing-de-attributes.test.ts`:
- Line 2: Update the top-of-file docstring/comment that currently reads "Tests
for data engineering domain-specific traceFile attributes." to use clearer
wording "trace file attributes" (i.e., change "traceFile attributes" → "trace
file attributes") so the phrase isn't interpreted as a variable name; edit the
header comment in tracing-de-attributes.test.ts accordingly.

In `@packages/opencode/test/altimate/tracing-display-crash.test.ts`:
- Line 2: Update the top-level test file comment to use clearer wording: replace
"traceFile list display" with "trace list display" in the file's header comment
so it documents the test purpose more cleanly; locate the comment at the top of
packages/opencode/test/altimate/tracing-display-crash.test.ts and change that
phrase while preserving the rest of the sentence (e.g., "Tests for trace list
display, title handling, formatting utilities, ...").

In `@packages/opencode/test/altimate/tracing-e2e.test.ts`:
- Around line 6-11: The header comment enumerating test goals uses
variable-style terms like "traceFile" and "traceFile viewer server" which read
awkwardly; update the phrasing to use natural language (e.g., "trace file" and
"trace viewer") consistently across the header so items such as "The traceFile
file is valid..." and "The traceFile viewer server works correctly" become "The
trace file is valid and complete at every point" and "The trace viewer server
works correctly" to improve readability and consistency.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 535e44ed-19d5-4342-bfc8-02b1825ef7b8

📥 Commits

Reviewing files that changed from the base of the PR and between 167d4a7 and 82e9ff8.

⛔ Files ignored due to path filters (2)
  • docs/docs/assets/images/trace/summary-full.png is excluded by !**/*.png
  • docs/docs/assets/images/trace/summary-tab.png is excluded by !**/*.png
📒 Files selected for processing (27)
  • CHANGELOG.md
  • README.md
  • docs/docs/configure/trace.md
  • docs/docs/data-engineering/guides/ci-headless.md
  • docs/docs/usage/ci-headless.md
  • docs/docs/usage/cli.md
  • docs/docs/usage/tui.md
  • docs/mkdocs.yml
  • packages/opencode/src/altimate/observability/tracing.ts
  • packages/opencode/src/altimate/observability/viewer.ts
  • packages/opencode/src/cli/cmd/trace.ts
  • packages/opencode/src/cli/cmd/tui/app.tsx
  • packages/opencode/src/cli/cmd/tui/component/dialog-trace-list.tsx
  • packages/opencode/src/cli/cmd/tui/worker.ts
  • packages/opencode/src/index.ts
  • packages/opencode/test/altimate/tracing-adversarial-2.test.ts
  • packages/opencode/test/altimate/tracing-adversarial-final.test.ts
  • packages/opencode/test/altimate/tracing-adversarial-snapshot.test.ts
  • packages/opencode/test/altimate/tracing-adversarial.test.ts
  • packages/opencode/test/altimate/tracing-de-attributes.test.ts
  • packages/opencode/test/altimate/tracing-display-crash.test.ts
  • packages/opencode/test/altimate/tracing-e2e.test.ts
  • packages/opencode/test/altimate/tracing-final-audit.test.ts
  • packages/opencode/test/altimate/tracing-integration.test.ts
  • packages/opencode/test/altimate/tracing-persistence.test.ts
  • packages/opencode/test/altimate/tracing-thorough.test.ts
  • packages/opencode/test/altimate/tracing.test.ts

- Keep `traceViewerTracesDir` in sync on every URL request, not just
  on first server creation (app.tsx)
- Reset per-session trace state (`sessionTraces`, `sessionUserMsgIds`)
  when restarting the event stream in worker.ts
- Fix "traceFile" variable-style wording in test file comments to use
  natural language ("trace file", "trace viewer", "trace list")

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@anandgupta42 anandgupta42 merged commit 12ed190 into main Mar 24, 2026
12 checks passed
@anandgupta42 anandgupta42 deleted the refactor/rename-recap-to-trace branch March 25, 2026 02:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: rename Recap back to Trace for AI model comprehension

1 participant