Session parsing, timeline generation, and HTML/video rendering
6+ findings dispositioned. AX-6 maintained (stale testify refs removed).
Code:
- parser_test.go: fixed EOF-truncated JSONL fixtures
- parser.go: ListSessionsSeq skips transcripts when quick scan fails;
added oversized-line coverage
- parser.go: symlink pre-check replaced with O_NOFOLLOW descriptor
opens + Fstat for FetchSession and ListSessionsSeq (TOCTOU-safe)
- test_helpers_test.go: assert* helpers changed from fatal to
non-fatal reporting
- tests/cli/session/main.go: derived expectations from current code
(CodeRabbit's suggested literals were incorrect for current impl)
+ filepath.Join nit; preserved correct behaviour
CI / config:
- .golangci.yml: migrated to v2 schema
- tests/cli/session/Taskfile.yaml: 'test' broadened to run go vet +
go test + CLI smoke
- PR title: made specific
Doc:
- AX-2 docstring coverage: comments added to all Go funcs in touched
files (closes pre-merge docstring warning)
- README + CLAUDE.md + CODEX.md + CONTEXT.md + TODO.md +
docs/{architecture,development,index}.md + kb/Home.md: removed
stale testify references, aligned to stdlib testing
Disposition:
- SonarCloud / GHAS: no separate PR comments/checks; gh pr checks
only reports CodeRabbit. RESOLVED-COMMENT.
Verification: gofmt clean, golangci-lint v2 0 issues, GOWORK=off
go vet + go test -count=1 ./... pass with explicit cache paths,
task -d tests/cli/session clean.
Closes findings on https://github.com/dAppCore/go-session/pull/5
Co-authored-by: Codex <noreply@openai.com>
|
||
|---|---|---|
| .core | ||
| .forgejo/workflows | ||
| docs | ||
| kb | ||
| specs | ||
| tests/cli/session | ||
| .editorconfig | ||
| .gitignore | ||
| .golangci.yml | ||
| analytics.go | ||
| analytics_test.go | ||
| bench_test.go | ||
| CLAUDE.md | ||
| CODEX.md | ||
| CONTEXT.md | ||
| CONTRIBUTING.md | ||
| conventions_test.go | ||
| core_helpers.go | ||
| GEMINI.md | ||
| go.mod | ||
| go.sum | ||
| html.go | ||
| html_test.go | ||
| parser.go | ||
| parser_test.go | ||
| PROMPT.md | ||
| README.md | ||
| RECENT.md | ||
| search.go | ||
| search_test.go | ||
| test_helpers_test.go | ||
| threats.md | ||
| TODO.md | ||
| video.go | ||
| video_test.go | ||
go-session
Claude Code JSONL transcript parser, analytics engine, and HTML timeline renderer. Parses Claude Code session files into structured event arrays (tool calls with round-trip durations, user and assistant messages), computes per-tool analytics (call counts, error rates, average and peak latency, estimated token usage), renders self-contained HTML timelines with collapsible panels and client-side search, and generates VHS tape scripts for MP4 video output. No external runtime dependencies — stdlib only.
Module: dappco.re/go/session
Licence: EUPL-1.2
Language: Go 1.26
Quick Start
import "dappco.re/go/session"
sess, stats, err := session.ParseTranscript("/path/to/session.jsonl")
analytics := session.Analyse(sess)
fmt.Println(session.FormatAnalytics(analytics))
// Render interactive HTML timeline
err = session.RenderHTML(sess, "timeline.html")
// Search across all sessions in a directory
results, err := session.Search("~/.claude/projects/my-project", "git commit")
Documentation
- Architecture — JSONL format, parsing pipeline, event types, analytics, HTML rendering, XSS protection
- Development Guide — prerequisites, build, test patterns, coding standards
- Project History — completed phases, known limitations, future considerations
Build & Test
go test ./...
go vet ./...
go build ./...
Licence
European Union Public Licence 1.2 — see LICENCE for details.