Commit graph

5 commits

Author SHA1 Message Date
Snider
89a431c1b9 feat: modernise to Go 1.26 iterators and stdlib helpers
All checks were successful
Security Scan / security (push) Successful in 11s
Test / test (push) Successful in 1m58s
Add ListSessionsSeq, EventsSeq, SearchSeq iterators for streaming.
Use slices.SortFunc, slices.Sorted(maps.Keys()), slices.Collect
in ListSessions, Search, FormatAnalytics, extractToolInput.

Co-Authored-By: Gemini <noreply@google.com>
Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-23 05:25:55 +00:00
Snider
14586940fe refactor: apply go fix modernizers for Go 1.26
Automated fixes: interface{} → any, range-over-int, t.Context(),
wg.Go(), strings.SplitSeq, strings.Builder, slices.Contains,
maps helpers, min/max builtins.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-22 21:00:17 +00:00
Claude
1031905018
feat(parser): add robustness for truncated JSONL and malformed lines
Phase 1: graceful error recovery, streaming parse, skip malformed lines.

- Add ParseTranscriptReader for io.Reader-based streaming (pipes, buffers)
- Refactor to shared parseFromReader, eliminating code duplication
- Bump scanner buffer to 8 MiB for very large tool outputs
- 18 new tests: streaming, custom MCP tools, binary garbage, edge cases
- Coverage: 93.0% (up from 90.9%), 104 total tests

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:34:43 +00:00
Snider
a6fb93408b feat(parser): Phase 1+2 — parse stats, truncation detection, session analytics
Phase 1: ParseTranscript now returns (*Session, *ParseStats, error).
ParseStats tracks TotalLines, SkippedLines, OrphanedToolCalls, and
Warnings (line numbers + previews for bad JSON, orphaned tool IDs,
truncated final line detection). All call sites updated.

Phase 2: New analytics.go with Analyse() and FormatAnalytics().
SessionAnalytics computes Duration, ActiveTime, ToolCounts, ErrorCounts,
SuccessRate, AvgLatency, MaxLatency, and token estimation.

Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 07:40:52 +00:00
Snider
474b0861e1 feat: extract go-session from core/go pkg/session
Session parsing, timeline generation, HTML/video rendering.
Zero external dependencies (stdlib only).
Module: forge.lthn.ai/core/go-session

Co-Authored-By: Virgil <virgil@lethean.io>
2026-02-19 16:09:12 +00:00