Skip to content

feat: use per-session UUID files instead of single latest.jsonl#94

Merged
steve-calvert-glean merged 1 commit into
mainfrom
session-per-file
Apr 13, 2026
Merged

feat: use per-session UUID files instead of single latest.jsonl#94
steve-calvert-glean merged 1 commit into
mainfrom
session-per-file

Conversation

@steve-calvert-glean
Copy link
Copy Markdown
Collaborator

Summary

  • Each session now gets its own UUID-named file ({uuid}.jsonl) instead of overwriting a single latest.jsonl
  • LoadLatest() finds the most recently modified .jsonl by mtime — no hardcoded filename
  • New sessions generate a v4 UUID via crypto/rand (no external dependency)
  • Legacy latest.json and latest.jsonl files are migrated to UUID-named files automatically
  • Preserves all previous sessions on disk, enabling future /resume-style features

Test plan

  • Unit test: UUID generation produces valid 36-char format, unique each call
  • Unit test: new session creates UUID-named file (not "latest")
  • Unit test: findLatestSession picks most recently modified file
  • Unit test: non-JSONL files are ignored
  • Unit test: empty directory returns no session
  • All existing JSONL tests (append, corrupt lines, migration) pass
  • mise run test:all passes (490 tests, lint clean, binary builds)

Each session now gets its own UUID-named file (e.g. {uuid}.jsonl)
instead of always overwriting latest.jsonl. LoadLatest finds the
most recently modified .jsonl file by mtime. Legacy latest.json
and latest.jsonl files are migrated to UUID-named files automatically.
@steve-calvert-glean steve-calvert-glean requested a review from a team as a code owner April 12, 2026 19:07
@steve-calvert-glean steve-calvert-glean added the enhancement New feature or request label Apr 12, 2026
@steve-calvert-glean steve-calvert-glean merged commit 267c80b into main Apr 13, 2026
7 checks passed
@steve-calvert-glean steve-calvert-glean deleted the session-per-file branch April 13, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant