Commit e71d1fa
feat: rename tracer to recap with loop detection and enhanced viewer (#381)
* feat: rename tracer to recap with loop detection, post-session summary, and enhanced viewer
- Rename `Tracer` class to `Recap` with backward-compat aliases
- Rename CLI command `trace` to `recap` (hidden `trace` alias preserved)
- Add loop detection: flags repeated tool calls with same input (3+ in last 10)
- Add post-session summary: `narrative`, `topTools`, `loops` in trace output
- New Summary tab (default) in HTML viewer with:
- Truncated prompt with expand toggle
- Files changed with SQL diff previews
- Tool-agnostic outcome extraction (dbt, pytest, Airflow, pip, SQL)
- Deduped dbt commands with pass/fail status, clickable to waterfall
- Smart command grouping (boring ls/cd collapsed, meaningful shown)
- Error details with resolution tracking
- Cost breakdown in collapsible section
- Virality: Share Recap (self-contained HTML download), Copy Summary (markdown),
Copy Link, branded footer
- Fix XSS: timeline items escaped with `e()`
- Fix memory leak: per-session `sessionUserMsgIds` with cleanup on eviction
- Fix JS syntax: onclick quote escaping in collapsible section
- Bound `toolCallHistory` to prevent unbounded growth (cap at 200)
- Summary view wrapped in try-catch for visible error messages
- Update all 13 test files for rename + 8 new adversarial viewer tests
- Update docs: `tracing.md` → `recap.md`, CLI/TUI references updated
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: share/copy buttons scoping bug + `t.text` undefined + adversarial viewer tests
- Fix critical bug: Share Recap and Copy Summary buttons referenced variables
from Summary IIFE scope — rewrote `buildMarkdownSummary` to be self-contained
- Fix `t.text` → `t.result` in narrative (was rendering "undefined")
- Fix `sessionUserMsgIds` not cleaned on MAX_RECAPS eviction (memory leak)
- Fix zero cost display: show `$0.00` instead of em-dash
- Add try-catch error boundary around Summary view rendering
- Add 8 adversarial viewer tests: XSS, NaN/Infinity, null metadata,
200+ spans, JS syntax validation, tool-agnostic outcomes, backward compat
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address all 10 CodeRabbit review comments
- Track loops by `(tool, inputHash)` not just tool name (#2)
- Use "Failed after" narrative for error traces (#3)
- Add keyboard accessibility to viewer tabs (role, tabindex, Enter/Space) (#4)
- Use full command as dedup key, not `slice(0,60)` (#5)
- Sort timeline events by time before rendering (#6)
- Pass `tracesDir` to footer text in `listRecaps` (#7)
- Increase `MAX_RECAPS` to 100, add eviction warning log (#8)
- Resolve assistant `parentID` for recap enrichment (#9)
- Remove unused `tracer` variable in test (#10)
- Clarify `--no-trace` backward-compat flag in docs (#1)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: add screenshots and update recap viewer documentation
- Add Summary tab and full-page screenshots to docs
- Update viewer section with 5-tab description
- Detail what Summary tab shows: files changed, outcomes, timeline, cost
- Add screenshot at top of recap.md for quick visual reference
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: move Recap to Use section, Telemetry to Reference
- Move Recap from Configure > Observability to Use (peer to Commands, Skills)
- Move Telemetry from Configure > Observability to Reference (internal analytics)
- Remove the Observability section entirely
Recap is a feature users interact with after sessions, not a config setting.
Telemetry is internal product analytics, not user-facing observability.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: viewer UX improvements from 100-trace analysis
- Collapse Files Changed after 5 entries with "Show all N files" toggle
- Rename "GENS" → "LLM Calls" in header cards
- Hide Tokens card when cost is $0 (not actionable without cost context)
- Hide Cost metric card when $0.00 (wasted space)
- Add prominent error summary banner right after header metrics
- Improved dbt outcome detection: catch [PASS], [ERROR], N of M, Compilation Error
- Outcome detection rate improved from 18% → 33% across 100 real traces
- Updated doc screenshots with cleaner samples
Tested across 100 real production traces: 0 crashes, 0 JS errors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: always show Cost and Tokens cards
$0.00 is a valid cost (Anthropic Max plan). Hiding it implies
we don't support cost tracking.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: tool-agnostic outcome extraction for schema, validation, SQL, lineage tools
500-trace analysis revealed:
- Schema tasks: 0% outcome visibility → 100%
- Validation tasks: 0% outcome visibility → 100%
- SQL tasks: 55% outcome visibility → 100%
Added outcome extraction for:
- schema_inspect, lineage_check, altimate_core_validate results
- SQL error messages (not just row counts)
- Improved empty session display (shows prompt if available)
Tested across 500 diverse synthetic traces (SQL, Airflow, Dagster,
Python, schema, validation, migration, connectors) + 100 real traces.
0 crashes, 0 JS errors.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: address 4 new CodeRabbit review comments
- Add `inputHash` to `TraceFile.summary.loops` schema type (#11)
- Replace `startTrace()` API name with plain language in docs (#12)
- Use `CSS.escape()` for spanId in querySelector to handle special chars (#13)
- Sort spans by startTime before searching for error resolution (#14)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: round 3 review — sort spans once, clean narrative for 0 LLM calls
- Sort spans once before error resolution loop instead of per-error (perf)
- Narrative omits "Made 0 LLM calls" for tool-only sessions (UX)
- Updated tests to match new narrative format
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add missing `altimate_change` markers for recap rename in upstream-shared files
Wrap renamed code (Tracer→Recap, trace→recap) with markers so the
Marker Guard CI check passes. The diff-based checker uses -U5 context
windows per hunk — markers must be close enough to added lines to
appear within each hunk's context.
Files fixed:
- `trace.ts` — handler body, option descriptions, viewer message, compat alias
- `app.tsx` — recapViewerServer return, openRecapInBrowser function
- `dialog-trace-list.tsx` — error title, Recaps title, compat alias
- `worker.ts` — getOrCreateRecap, part events, session title/finalization
- `index.ts` — .command(RecapCommand) registration
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: add altimate_change markers to all upstream-shared files
Marker Guard CI was failing — 5 upstream-shared files had custom
code (recap rename) without altimate_change markers.
Fixed: trace.ts, app.tsx, dialog-trace-list.tsx, worker.ts, index.ts
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: type errors in training-import.test.ts from main merge
Pre-existing type issues from main: mock missing `context`/`rule`
fields and readFile return type mismatch.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d1e8419 commit e71d1fa
File tree
31 files changed
+2393
-593
lines changed- .github/meta
- docs
- docs
- assets/images/recap
- configure
- data-engineering/guides
- usage
- packages/opencode
- src
- altimate/observability
- cli/cmd
- tui
- component
- test-results
- test/altimate
31 files changed
+2393
-593
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
3 | | - | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
21 | 13 | | |
22 | 14 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
131 | 131 | | |
132 | 132 | | |
133 | 133 | | |
134 | | - | |
135 | | - | |
| 134 | + | |
| 135 | + | |
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| |||
Loading
Loading
Lines changed: 78 additions & 52 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
6 | 11 | | |
7 | 12 | | |
8 | 13 | | |
9 | 14 | | |
10 | | - | |
| 15 | + | |
11 | 16 | | |
12 | | - | |
| 17 | + | |
13 | 18 | | |
14 | | - | |
15 | | - | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | | - | |
18 | | - | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
23 | | - | |
| 28 | + | |
24 | 29 | | |
25 | 30 | | |
26 | 31 | | |
| |||
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| 39 | + | |
| 40 | + | |
34 | 41 | | |
35 | 42 | | |
36 | 43 | | |
37 | | - | |
| 44 | + | |
38 | 45 | | |
39 | 46 | | |
40 | 47 | | |
| |||
44 | 51 | | |
45 | 52 | | |
46 | 53 | | |
47 | | - | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
69 | 76 | | |
70 | 77 | | |
71 | | - | |
| 78 | + | |
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| |||
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
87 | | - | |
| 94 | + | |
88 | 95 | | |
89 | | - | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | | - | |
| 99 | + | |
93 | 100 | | |
94 | 101 | | |
95 | | - | |
| 102 | + | |
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
| |||
105 | 112 | | |
106 | 113 | | |
107 | 114 | | |
108 | | - | |
| 115 | + | |
109 | 116 | | |
110 | | - | |
| 117 | + | |
111 | 118 | | |
112 | 119 | | |
113 | | - | |
| 120 | + | |
114 | 121 | | |
115 | 122 | | |
116 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
117 | 128 | | |
118 | | - | |
119 | | - | |
120 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
121 | 143 | | |
122 | 144 | | |
123 | 145 | | |
| |||
126 | 148 | | |
127 | 149 | | |
128 | 150 | | |
129 | | - | |
| 151 | + | |
130 | 152 | | |
131 | 153 | | |
132 | 154 | | |
133 | | - | |
| 155 | + | |
134 | 156 | | |
135 | 157 | | |
136 | 158 | | |
137 | 159 | | |
138 | 160 | | |
139 | | - | |
140 | | - | |
| 161 | + | |
| 162 | + | |
141 | 163 | | |
142 | 164 | | |
143 | 165 | | |
144 | 166 | | |
145 | 167 | | |
146 | 168 | | |
147 | | - | |
| 169 | + | |
148 | 170 | | |
149 | 171 | | |
150 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
151 | 177 | | |
152 | 178 | | |
153 | | - | |
| 179 | + | |
154 | 180 | | |
155 | 181 | | |
156 | 182 | | |
| |||
171 | 197 | | |
172 | 198 | | |
173 | 199 | | |
174 | | - | |
| 200 | + | |
175 | 201 | | |
176 | 202 | | |
177 | 203 | | |
| |||
182 | 208 | | |
183 | 209 | | |
184 | 210 | | |
185 | | - | |
| 211 | + | |
186 | 212 | | |
187 | | - | |
| 213 | + | |
188 | 214 | | |
189 | 215 | | |
190 | 216 | | |
| |||
296 | 322 | | |
297 | 323 | | |
298 | 324 | | |
299 | | - | |
| 325 | + | |
300 | 326 | | |
301 | | - | |
| 327 | + | |
302 | 328 | | |
303 | | - | |
| 329 | + | |
304 | 330 | | |
305 | | - | |
| 331 | + | |
306 | 332 | | |
307 | | - | |
| 333 | + | |
308 | 334 | | |
309 | 335 | | |
310 | 336 | | |
| |||
313 | 339 | | |
314 | 340 | | |
315 | 341 | | |
316 | | - | |
| 342 | + | |
317 | 343 | | |
318 | | - | |
| 344 | + | |
319 | 345 | | |
320 | | - | |
| 346 | + | |
321 | 347 | | |
322 | 348 | | |
323 | | - | |
324 | | - | |
| 349 | + | |
| 350 | + | |
325 | 351 | | |
326 | | - | |
327 | | - | |
| 352 | + | |
| 353 | + | |
328 | 354 | | |
329 | 355 | | |
330 | | - | |
| 356 | + | |
331 | 357 | | |
332 | 358 | | |
333 | 359 | | |
334 | | - | |
| 360 | + | |
335 | 361 | | |
336 | 362 | | |
337 | 363 | | |
338 | 364 | | |
339 | 365 | | |
340 | | - | |
| 366 | + | |
341 | 367 | | |
342 | 368 | | |
343 | | - | |
| 369 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
| 145 | + | |
| 146 | + | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | | - | |
| 160 | + | |
161 | 161 | | |
162 | 162 | | |
163 | | - | |
164 | | - | |
| 163 | + | |
| 164 | + | |
165 | 165 | | |
166 | | - | |
167 | | - | |
| 166 | + | |
| 167 | + | |
168 | 168 | | |
| 169 | + | |
| 170 | + | |
0 commit comments