feat: replace Langfuse with local-first tracing system
Merged
AN
8mo ago+10604+10604+01234567890123456789012345678901234567890123456789-263-263-012345678901234567890123456789
What does this PR do?
Replaces the Langfuse SDK integration with a vendor-neutral, exporter-based tracing system. Every CLI and TUI session now captures full traces (generations, tool calls, tokens, cost, timing) as local JSON files with an interactive HTML viewer.
Core additions:
Tracerclass withFileExporter(local JSON) andHttpExporter(remote endpoints)- 4-mode HTML trace viewer (Waterfall, Tree, Chat, Log) via
Bun.serve altimate-code trace listandaltimate-code trace viewCLI commands- Data engineering semantic attributes for warehouse/SQL/dbt/quality/cost
- Config schema:
tracing.enabled,tracing.dir,tracing.maxFiles,tracing.exporters
Key design decisions:
- Crash-safe:
writeFileSyncin signal handlers, atomic tmp+rename snapshots - Config-aware: TUI and CLI both honor
tracing.*config settings - Fail-safe: all tracing methods wrapped in try-catch, never crashes the app
- Localhost-only: trace viewer server binds to
127.0.0.1 - Session finalization: TUI traces end on
session.status=idle
Type of change
- New feature (non-breaking change which adds functionality)
Issue for this PR
Closes #182
How did you verify your code works?
- 380 tests across 13 test files (unit, integration, adversarial, e2e)
- TypeScript type-check passes (0 new errors)
- Manual testing of
trace list,trace view, and TUI/tracecommand - 6-model code review (Claude, GPT 5.2 Codex, Gemini 3.1 Pro, Kimi K2.5, MiniMax M2.5, GLM-5) with convergence round
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, particularly in hard-to-understand areas
- I have made corresponding changes to the documentation
- My changes generate no new warnings
- I have added tests that prove my fix is effective or that my feature works
- New and existing unit tests pass locally with my changes