Skip to content

relay#598: session history: Claude reader, discovered records, history list - #605

Merged
barelyworkingcode merged 10 commits into
epic/596-session-historyfrom
feat/598-session-history
Oct 23, 2026
Merged

barelyworkingcode merged 10 commits into
epic/596-session-historyfrom
feat/598-session-history

Conversation

@barelyworkingcode

Copy link
Copy Markdown
Owner

Closes #598

Adds the session history: a Claude transcript reader, discovered ledger records, GET /api/session-history (class execute), the session.history admin op and relay session history [--project] [--json]. Child of #596; base is epic/596-session-history.

Non-obvious decisions

  • The listing prints folder and stem raw (both are charset-checked in shell) and base64-encodes only the home once. The per-file encoding cost about 10 CPU-seconds every 15 s on a store of 4,000 transcripts. It now takes about 0.45 s.
  • A transcript is absent only on an answered, complete listing whose scope holds its folder and has not refused it. A capped listing, a failed find/stat or a symlinked folder all read unknown, so relay#600 can never purge on partial evidence (Amendments 21–40).
  • Discovered records are capped at 2,000 per machine. The oldest are evicted in the same ledger save. An eviction is not a purge and writes no audit row.

Contract amendments

The planner wrote Amendments 1–40 into #598 (and into #596 and #600 where they apply). Ownership added cmd/relay/router.go (one field) and cmd/relay/server_core.go (two lines). The Go budget rose to 1,600 lines; the branch adds 1,557.

Rounds and cost

  • Review rounds: 3. Round 1 was blocking on the listing cost. Round 2 was blocking because a failed listing read as complete, and one test could not fail. Round 3 was clean. Its minor findings (host prefix filter on the symlink pass, an incomplete marker at the link cap, stale comments) are fixed in d0b0fbb.
  • Fix attempts: 2 after the first implementation, plus one minor round.
  • Tokens: about 1.0 M across dev, test writer, three reviewers and the planner.

Tests

e2e/features/g1_session_history_test.go: 13 tests, all green with -count=1 -run 'TestHistory|TestFeatureMapCoverage'. Per the epic brief the full suite and stack runs wait for the joint close; the targeted run is what was run.

Review: no blocking findings (round 3, default model)
Journey: n/a: this child adds no journey; relay#599 owns session-history-terminal for the epic
Break-and-restore: TestHistoryTitleRule red with the custom-title rule disabled (claude.go); restored byte for byte. TestHistoryDiscoveredAfterRestart red with discovered rows dropped before a listing answers; restored byte for byte.

🤖 Generated with Claude Code

barelyworkingcode and others added 10 commits October 22, 2026 17:23
…rompt titles)

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@barelyworkingcode
barelyworkingcode merged commit 294b190 into epic/596-session-history Oct 23, 2026
@barelyworkingcode
barelyworkingcode deleted the feat/598-session-history branch October 23, 2026 01:12
@barelyworkingcode

Copy link
Copy Markdown
Owner Author

merge-check: merged. approved, target, contract, evidence, owner
Report: 2. The gates themselves: criterion removed GET /api/session-history lists each ledger record and each discovered record as one row, newest lastActiveAt first, at most 500. (issue #598); 2. The gates themselves: criterion removed After a relay restart, the history lists the same discovered records, with titles once the first scan ends. (issue #598); 2. The gates themselves: criterion removed A machine whose store root is missing, or whose listing reaches the cap, reports answered: false for that scan. (issue #598)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant