sessiongraph 1.0.12 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/docs/cli.md CHANGED
@@ -29,6 +29,22 @@ and generated command documentation. These commands do not open or create a libr
29
29
  The manifest describes aliases, argument cardinality, option types, accepted values,
30
30
  defaults, effects, examples, and result shapes. Commands never prompt on stdin.
31
31
 
32
+ ## Indexed commit history
33
+
34
+ ```sh
35
+ sessiongraph commits opencode:SESSION_ID --limit 50 --json
36
+ sessiongraph events opencode:SESSION_ID --item EVIDENCE_EVENT_ID --json
37
+ ```
38
+
39
+ `commits` reads normalized SQLite links, never scans messages or runs Git. Follow
40
+ `nextCursor` with the same session; refreshing history invalidates old cursors.
41
+ Each item contains the recorded SHA (possibly abbreviated), execution directory,
42
+ operation (`created`, `amended`, `cherry-picked`), nullable action time, and saved
43
+ evidence event ID. `coverage` distinguishes pending, indexed, partial, and
44
+ unavailable history. A zero recorded count does not prove no commits occurred.
45
+ Run `sources sync` to index older imports; unavailable sources keep their saved
46
+ history. See the [coverage matrix](import-coverage.md#imported-data-by-harness).
47
+
32
48
  ## Set up, remove, and sync sources
33
49
 
34
50
  ```sh
package/docs/guide.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  **Explore & visualize all your LLM sessions**
4
4
 
5
- A local-first galaxy of your LLM sessions. Import local agent histories, explore relationships and changed files, search conversations, and fly through their timeline. Core source coverage is listed below; the [extended format matrix](import-coverage.md) covers additional harnesses, metadata-only sources, and detection-only integrations.
5
+ A local-first galaxy of your LLM sessions. Import local agent histories, explore relationships and changed files, search conversations, and fly through their timeline. Core source coverage is listed below; the [extended format matrix](import-coverage.md) covers additional harnesses and metadata-only sources with session identities and dates.
6
6
 
7
7
  ## Open SessionGraph
8
8
 
@@ -73,7 +73,7 @@ Time presets and custom date ranges, source/project/directory filters, the archi
73
73
  Onboarding closes automatically after a successful import and library refresh. Import failures remain visible with retry controls.
74
74
 
75
75
  - Source/native session IDs are the stable identity: importing the same session again updates its existing record. Duplicate source files and repeated message IDs do not create extra sessions/messages.
76
- - Unchanged source revisions skip history reads. Changed sessions are reread and their normalized messages, timeline events, file evidence, and index version are replaced in one SQLite transaction.
76
+ - Unchanged source revisions skip history reads unless an extraction version requires refresh. Changed sessions are reread and their normalized messages, timeline events, commit links, file evidence, and index version are replaced in one SQLite transaction.
77
77
  - Failed or interrupted updates retain the previous saved history. Re-import retries unfinished sessions. Import status reports counts, failures, and coverage limitations.
78
78
  - Forks and children remain distinct even if their text overlaps. Different harnesses' sessions are not merged based on matching titles, timestamps, or similar text.
79
79
  - Deselecting a source stops future imports; saved sessions remain browsable offline. Missing source files are not treated as a request to erase SessionGraph's local copy.
@@ -86,7 +86,7 @@ Onboarding closes automatically after a successful import and library refresh. I
86
86
  | OpenCode | Official authenticated local service discovery and V2 GET API | Explicit forks and child IDs; authoritative snapshot paths where available. OpenCode must be running for an import, but not to browse saved data. Remote endpoints are rejected. |
87
87
  | Claude Code | SDK conversation-chain parsing with read-only local transcript discovery; legacy `~/.claude/transcripts/` envelopes | CLI and VS Code extension sessions, including IDE-prefixed prompts omitted by the SDK listing. Project transcripts take precedence over overlapping legacy exports. Preserves recorded message times and explicit subagent metadata. SDK-visible history can omit pre-compaction text. No inferred fork ancestry. File evidence requires a successful matching edit-tool result. |
88
88
  | Codex | Bounded streaming reads of active/archived JSONL, zstd/gzip archives, and suffixed rollout copies | Native session IDs deduplicate copies; active uncompressed rollouts take precedence. Explicit recorded fork/parent fields; completed file-change events. Mirrored event text is not imported twice. Store-only/cloud-only history and ordinary ChatGPT desktop/web chats are not imported. |
89
- | T3 Code | Private read-only snapshot of the local server's `~/.t3/userdata/statev2.sqlite`; legacy `state.sqlite` fallback | T3 app threads retain their own titles, messages, ordered activity, recorded forks/children, and worktree paths. Strong recorded provider-thread IDs link overlapping Codex, Claude Code, and OpenCode imports; when the T3 conversation is complete, a uniquely linked provider session is shown through its T3 thread instead of appearing twice. Legacy V1 provides partial text history. Attachments and checkpoint file snapshots are omitted. |
89
+ | T3 Code | Private read-only snapshot of the local server's `~/.t3/userdata/statev2.sqlite`; legacy `state.sqlite` fallback | T3 app threads retain their own titles, messages, ordered activity, recorded forks/children, and worktree paths. Strong recorded provider-thread IDs group uniquely linked Codex, Claude Code, and OpenCode histories under one T3 map entry once user messages are imported, including partial histories. The inspector opens each linked provider's saved messages separately. Empty, pending, or ambiguous bindings retain separate entries. Legacy V1 provides partial text history. Attachments and checkpoint file snapshots are omitted. |
90
90
  | Cursor | IDE JSONL transcripts, CLI/ACP stores, and legacy Composer `state.vscdb` databases in application `User/globalStorage` and `User/workspaceStorage` | Inline conversations, conversation maps, and separate bubble records preserve native creation dates. Modern representations take precedence while retaining Composer's original start date. Missing bubble times stay unknown. Older `.txt` transcripts, cloud-only and SDK-only history are excluded. |
91
91
  | Gemini CLI | `~/.gemini/tmp/*/chats/` JSON/JSONL; sandbox cache equivalent | Reconstructs append-only patches and rewinds. Explicit subagent directories form parent links. Workspace identity comes from `.project_root`; unknown directories stay unknown. |
92
92
  | Qwen Code | `~/.qwen/projects/*/chats/*.jsonl` | Recorded forks and parent sessions remain distinct. Tool results retain call IDs and recorded execution status. Daemon-only histories are excluded. |
@@ -122,16 +122,29 @@ These file adapters read stable snapshots bounded to 32 MB combined, 50,000 reco
122
122
 
123
123
  - Select **Cursor** in **Manage sources**, then import. Cursor need not be running. This is a local-format adapter, not a supported Cursor history-export API; the [Cursor SDK](https://cursor.com/docs/sdk/typescript) documents its own local agent store.
124
124
  - IDE exports are marked partial because tool results and pre-compaction context may be absent. Recorded message IDs are preserved; otherwise stable byte offsets or ordered blob occurrences retain repeated identical turns. Images and unsupported content are disclosed as omitted. A broken primary store never downgrades saved history to a shorter transcript export.
125
+ - Titles and human message text skip known leading context envelopes, including attached files, web results, and image scaffolding. Literal markup inside a user query is preserved. Native turn-end/error records remain source events even when no conversation started; lifecycle-only exports never erase a previously saved conversation. NULL Composer marker rows are ignored; genuinely oversized payloads still respect import bounds.
125
126
  - Only recorded message timestamps and Cursor's leading timezone-qualified timestamp envelope place message dots. Missing timestamps remain unknown. When session creation is unavailable, placement uses the first recorded message or the file timestamp, with a coverage note.
126
127
  - Working directories come from recorded metadata or an unambiguous forward match against Cursor's workspace folder metadata. Encoded project names are never reverse-decoded into guessed paths. Choose a folder in the launcher when the original directory is unknown.
127
128
  - Store reads copy the database and its WAL into a temporary private directory, verify that the source stayed stable, and open only the copy with read-only SQLite. CLI/ACP limits: 20,000 histories, 256 MB per database/WAL, 2 MB per blob, and 64 MB / 50,000 nodes / 16 million text characters per conversation. Legacy Composer permits an 8 GB database/WAL, 32 MB Composer record, 8 MB bubble, and 64 MB / 50,000 bubbles per conversation. At most two legacy/database snapshots are cached; copies are removed on eviction or process exit. Changing or unsupported stores preserve previously saved history.
128
129
  - Override discovery with `SESSIONGRAPH_CURSOR_HOME` (the `.cursor` directory) and `SESSIONGRAPH_CURSOR_USER_DATA_DIR` (Cursor's application data directory, containing `User/workspaceStorage`). These are SessionGraph settings. Custom-root histories use saved-context continuation.
129
130
 
131
+ ## Recorded commit history
132
+
133
+ Select a session to see **Recorded commits**. Timed commit operations appear as gold markers on its trail; clicking a marker or commit opens the saved tool result and its related request. Untimed actions and actions outside the session's recorded lifetime remain in the list, without invented marker positions. The graph displays up to 2,000 commit markers per selected session; the list is paginated.
134
+
135
+ Commit extraction runs during import for supported OpenCode, T3 V2, Codex, and Claude Code execution formats. It requires a correlated recorded execution/result, a confirmed creation outcome, and explicit repository context. The operation distinguishes creation, amendment, and cherry-pick. A successful commit followed by a failed push can still qualify; overall process success alone never qualifies. Ambiguous/unsupported syntax, missing results, inherited pre-fork events, and shortened payloads are disclosed as partial. No messages are scanned to read commit history or render commit markers.
136
+
137
+ The local SQLite `session_commits` table contains `session_id`, `sha`, `repository_path`, `operation`, nullable `occurred_at`, and `evidence_event_id`. It reuses existing tool-event payloads. Paths are recorded Git execution directories, not independently verified repository roots. Short object IDs remain visibly abbreviated and are never expanded by guessing. The per-session `commits` summary stores extraction version, state, count, indexing time, and coverage notes. Unknown/unindexed coverage has a null count. Schema v5 leaves older imports pending until Refresh; missing sources retain their saved history.
138
+
139
+ Read indexed history with `GET /api/sessiongraph/session/:id/commits?limit=50&cursor=…` or `sessiongraph commits <session-id> --json`. Pages include coverage, revision, evidence IDs, and a revision-bound `nextCursor`. Use the existing events endpoint/command to inspect evidence. Linked T3/provider histories retain their own indices; selecting the T3 thread does not add the provider's commits to its count. Publication remains limited to the existing public graph payload.
140
+
141
+ See the [harness data matrix](import-coverage.md#imported-data-by-harness) for verified source coverage and current limitations.
142
+
130
143
  ## Local storage and privacy
131
144
 
132
145
  **Your session content stays on this computer during import, search, and exploration.** No account. No cloud sync. No telemetry. See [Privacy and local data](../PRIVACY.md) for the full network disclosure and ways to verify the behavior.
133
146
 
134
- SessionGraph's own SQLite database stores source selection, the auto-import preference, session metadata, normalized messages and timeline events, file evidence, import revisions, and bounded search checkpoints. New installations use:
147
+ SessionGraph's own SQLite database stores source selection, the auto-import preference, session metadata, normalized messages and timeline events, evidence-linked commit history, file evidence, import revisions, and bounded search checkpoints. New installations use:
135
148
 
136
149
  - macOS: `~/Library/Application Support/SessionGraph/sessiongraph.sqlite`
137
150
  - Linux: `$XDG_DATA_HOME/sessiongraph/sessiongraph.sqlite` (default `~/.local/share/sessiongraph/sessiongraph.sqlite`)
@@ -2,7 +2,89 @@
2
2
 
3
3
  The comparison uses [Tokscale at `8d9b509`](https://github.com/junhoyeo/tokscale/tree/8d9b509c4d719f3385e3c2464b770dc5257cb354), especially its scanner and session parsers. Tokscale is a format reference, not a runtime dependency. Its usage inventory includes providers, account aggregates, and opaque metadata; those are not equivalent to conversation history.
4
4
 
5
- The source picker includes the independent harnesses from that inventory. **Metadata only** imports a native session without conversation messages. **Detection only** explains why an available usage source cannot be imported and creates no sessions. Other sources import the recognized conversation/event formats below; this is not a guarantee of every historical version or complete pre-compaction context. The existing core sources are documented in the [guide](guide.md#source-coverage).
5
+ The source picker includes harnesses that can provide session identities and dates, including explicitly disclosed inferred placement dates. **Metadata only** imports a session without conversation messages. Usage-only inputs that cannot establish a session list and dates are excluded. Other sources import the recognized conversation/event formats below; this is not a guarantee of every historical version or complete pre-compaction context. The existing core sources are documented in the [guide](guide.md#source-coverage).
6
+
7
+ ## Imported data by harness
8
+
9
+ This table describes **the current importer**, not every capability of the harness. ✅ = explicitly decoded in the supported format; ⚠️ = conditional, partial, or representation-dependent; ❌ = not extracted from the supported inputs. Even ✅ does not guarantee that every session recorded the field. Missing data stays unknown. “Files” means confirmed recorded changes, not reads, mentions, or proposed edits. “Links” means explicit session forks/children, not Git branches or chronological proximity.
10
+
11
+ | Harness | Messages | Tool calls/results | Changed files | Commit index | Workspace directory | Session links |
12
+ | --- | --- | --- | --- | --- | --- | --- |
13
+ | OpenCode V2 | ✅ | ✅ | ✅ snapshots / edits | ⚠️ confirmed executions | ✅ + move events | ✅ forks / children |
14
+ | Claude Code | ⚠️ SDK-visible chain | ✅ | ⚠️ successful edits | ⚠️ executions / native Git result | ✅ recorded cwd | ⚠️ children |
15
+ | Codex | ✅ local rollouts | ✅ | ✅ completed patches | ⚠️ confirmed executions | ✅ header / turn cwd | ✅ forks / children |
16
+ | T3 Code | ⚠️ V2 activity; V1 text | ⚠️ V2 only | ⚠️ actual-path changes | ⚠️ V2 executions | ✅ thread/worktree; per-command cwd conditional | ✅ explicit links + provider bindings |
17
+ | Cursor | ⚠️ representation-dependent | ⚠️ missing results in exports | ❌ | ❌ | ⚠️ metadata / verified workspace | ⚠️ explicit native fields |
18
+ | Gemini CLI | ✅ | ✅ | ⚠️ successful edits | ❌ | ⚠️ project-root marker | ⚠️ children |
19
+ | Qwen Code | ✅ | ✅ | ⚠️ successful edits | ❌ | ⚠️ recorded cwd | ✅ forks / children |
20
+ | Pi | ✅ retained tree | ✅ | ⚠️ successful edits | ❌ | ✅ header cwd | ❌ |
21
+ | GitHub Copilot CLI | ✅ | ✅ | ✅ applied fileEdits | ❌ | ⚠️ session context | ⚠️ children |
22
+ | GitHub Copilot Chat | ⚠️ saved VS Code chat | ✅ saved invocations | ⚠️ accepted edits | ❌ | ⚠️ single-folder local workspace | ❌ |
23
+ | Cline | ⚠️ API snapshots | ⚠️ retained blocks | ⚠️ successful edits | ❌ | ⚠️ matching metadata | ⚠️ recorded task/CLI links |
24
+ | Roo Code | ⚠️ API snapshots | ⚠️ retained blocks | ⚠️ successful edits | ❌ | ⚠️ matching metadata | ⚠️ task parents |
25
+ | Kilo Code extension | ⚠️ API snapshots | ⚠️ retained blocks | ⚠️ successful edits | ❌ | ⚠️ matching metadata | ⚠️ task parents |
26
+ | Continue | ⚠️ conversation snapshots | ⚠️ retained blocks | ❌ | ❌ | ⚠️ workspaceDirectory | ❌ |
27
+ | Prime Agent | ✅ Pi format | ✅ Pi format | ⚠️ successful edits | ❌ | ⚠️ header cwd | ❌ |
28
+ | Oh My Pi | ✅ Pi format | ✅ Pi format | ⚠️ successful edits | ❌ | ⚠️ header cwd | ❌ |
29
+ | Senpi / OmO Native | ✅ Pi format | ✅ Pi format | ⚠️ successful edits | ❌ | ⚠️ header cwd | ❌ |
30
+ | Kimchi | ✅ Pi format | ✅ Pi format | ⚠️ successful edits | ❌ | ⚠️ header cwd | ❌ |
31
+ | Gajae-Code | ✅ Pi format | ✅ Pi format | ⚠️ successful edits | ❌ | ⚠️ header cwd | ❌ |
32
+ | OpenClaw | ⚠️ DB / Pi export | ⚠️ retained message events | ⚠️ Pi export only | ❌ | ⚠️ Pi header only | ❌ |
33
+ | Hermes Agent | ✅ saved rows / summaries | ⚠️ retained blocks | ❌ | ❌ | ✅ native cwd | ✅ explicit forks / subagents |
34
+ | Amp | ⚠️ local / exported messages | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
35
+ | Factory Droid | ⚠️ envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
36
+ | Codebuff | ⚠️ chat snapshots | ⚠️ retained blocks | ❌ | ❌ | ❌ | ❌ |
37
+ | Freebuff | ⚠️ chat snapshots | ⚠️ retained blocks | ❌ | ❌ | ❌ | ❌ |
38
+ | Kimi CLI / Code | ⚠️ retained context; untimed | ⚠️ context tool messages | ❌ | ❌ | ❌ | ❌ |
39
+ | Grok Build | ⚠️ ACP chunks | ⚠️ basic events, not full executions | ❌ | ❌ | ❌ | ❌ |
40
+ | Jcode | ⚠️ snapshot + journal | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded metadata | ❌ |
41
+ | Cherry Studio (agent mode) | ⚠️ Claude envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
42
+ | Command Code | ⚠️ envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
43
+ | ZCode | ⚠️ legacy envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
44
+ | CodeBuddy | ⚠️ envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
45
+ | WorkBuddy | ⚠️ envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
46
+ | Proma | ⚠️ Pi / legacy envelopes | ⚠️ retained blocks | ⚠️ Pi format only | ❌ | ⚠️ header / recorded cwd | ❌ |
47
+ | DeepSeek Harness | ⚠️ final saved messages | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded metadata | ❌ |
48
+ | Aside | ⚠️ envelopes | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded cwd | ❌ |
49
+ | Mistral Vibe | ⚠️ saved context | ⚠️ retained blocks | ❌ | ❌ | ⚠️ recorded metadata | ❌ |
50
+ | Goose | ⚠️ saved rows | ⚠️ content variants | ❌ | ❌ | ✅ working_dir | ⚠️ explicit subagents |
51
+ | Zed Agent | ⚠️ native threads; untimed | ⚠️ tool-use blocks | ❌ | ❌ | ⚠️ single folder | ❌ |
52
+ | Devin CLI | ⚠️ retained message nodes | ⚠️ retained blocks | ❌ | ❌ | ✅ working_directory | ❌ |
53
+ | Devin Desktop | ⚠️ ACP notifications | ⚠️ basic events | ❌ | ❌ | ❌ | ❌ |
54
+ | Crush | ⚠️ saved parts / summaries | ⚠️ retained blocks | ❌ | ❌ | ⚠️ project registry | ❌ |
55
+ | Octofriend | ⚠️ native IR | ⚠️ supported IR blocks | ❌ | ❌ | ✅ native cwd | ❌ |
56
+ | Kilo CLI | ⚠️ native parts | ✅ tool states | ❌ | ❌ | ✅ native directory | ❌ |
57
+ | MiMo Code | ⚠️ native parts | ✅ tool states | ❌ | ❌ | ✅ native directory | ❌ |
58
+ | Xiaomi MiMo AI desktop | ⚠️ native parts | ✅ tool states | ❌ | ❌ | ✅ native directory | ❌ |
59
+ | Unsloth Studio | ⚠️ saved content | ⚠️ supported blocks | ❌ | ❌ | ❌ | ⚠️ explicit forks |
60
+ | Kiro | ⚠️ CLI / IDE / SQLite | ⚠️ representation-dependent | ❌ | ❌ | ⚠️ recorded metadata | ❌ |
61
+ | Mux | ⚠️ archive + active chat | ⚠️ retained blocks | ❌ | ❌ | ❌ | ❌ |
62
+ | MiniMax Code | ⚠️ existing captured messages | ⚠️ captured blocks | ❌ | ❌ | ❌ | ❌ |
63
+ | Muse Code | ⚠️ recognized event bodies | ⚠️ recognized blocks | ❌ | ❌ | ✅ workspace_root | ❌ |
64
+ | Junie | ⚠️ basic events only | ❌ full executions | ❌ | ❌ | ❌ | ❌ |
65
+ | Augment Code | ⚠️ response text only | ❌ | ❌ | ❌ | ❌ | ❌ |
66
+ | OpenCodeReview | ⚠️ review responses only | ❌ | ❌ | ❌ | ⚠️ header cwd | ❌ |
67
+ | Fx | ❌ metadata only | ❌ | ❌ | ❌ | ✅ workspace_root | ❌ |
68
+ | Antigravity cache | ❌ metadata only | ❌ | ❌ | ❌ | ❌ | ❌ |
69
+ | Antigravity CLI | ❌ opaque conversations | ❌ | ❌ | ❌ | ⚠️ protobuf workspace | ❌ |
70
+ | Antigravity extension | ❌ opaque conversations | ❌ | ❌ | ❌ | ⚠️ protobuf workspace | ❌ |
71
+
72
+ Session identity, title, source, recorded creation/update dates, and available model/provider metadata accompany imported sessions. Message timestamps, usage, reasoning, and attachments are independently conditional; a readable conversation does not imply complete timing or token/cost totals. Unsupported/binary blocks remain disclosed omissions. Recorded native usage is never estimated from text.
73
+
74
+ ### Native Git data versus the commit index
75
+
76
+ | Harness | Native evidence available | Current treatment |
77
+ | --- | --- | --- |
78
+ | OpenCode V2 | ✅ shell input/result, optional exit/truncation metadata and explicit workdir; ✅ location-switch events | Preserve execution metadata and index conservative confirmed Git operations. Directory moves remain generic events, not a normalized location history. |
79
+ | Claude Code | ✅ Bash calls/results and envelope cwd; ⚠️ SDK declares `gitOperation.commit`; ⚠️ recorded `gitBranch` | Correlate calls/results across the full import. Enrich the SDK-visible UUID chain from raw envelopes; accept validated native commit results when present. Native Git persistence is contract/fixture-tested, not confirmed by the small audited live sample. Branch observations are not indexed. |
80
+ | Codex | ✅ tool calls/results; ⚠️ turn cwd; ⚠️ header `git.commit_hash`, branch and repository URL | Preserve execution cwd and parse recognized result envelopes. Starting HEAD is never creation evidence; header Git observations are not indexed. |
81
+ | T3 Code | ✅ V2 command input/output/status; ⚠️ exit code/native call ID/per-call cwd; ✅ thread branch/worktree and separate checkpoint records | Preserve execution metadata. Commands need explicit execution context or absolute `cd` / `git -C`; the thread's latest directory is not substituted. Branch/checkpoint data remains outside this lean index. |
82
+ | Hermes | ✅ native cwd; ⚠️ mutable `git_branch` / `git_repo_root` | Import cwd; branch/repository observations and commit extraction are not implemented. |
83
+ | Other harnesses | ⚠️ tool-result formats may contain more Git evidence | No validated commit extraction yet. A ❌ in the index column is an importer limitation, not proof that the harness lacks Git data. |
84
+
85
+ The index stores only **created**, **amended**, and **cherry-picked** actions with saved execution evidence. Pushes, `git log`, starting HEADs, chat claims, and internal harness checkpoints are excluded. A commit creator need not be the author of every included change. The parser accepts a deliberately small shell grammar: direct Git operations, optional `cd` / `git -C`, and `&&` chains of add/commit/push. Scripts, substitutions, heredocs, pipelines, redirects, ambiguous output, and missing/truncated evidence remain partial. Full SHAs stay full; abbreviated SHAs stay abbreviated. No Git command, repository scan, or network enrichment runs during import or reads.
86
+
87
+ `session.commits` reports `pending`, `indexed`, `partial`, or `unavailable`, extraction version, recorded count (nullable), and explanatory coverage. `indexed` means the supported extraction completed on the available records—not a complete audit of all real-world commits. Upgraded libraries start pending and refresh even when source revisions are unchanged. Failed refreshes retain the previous index. T3 and linked provider histories keep separate attribution; they are not summed or silently merged. See [commit history](guide.md#recorded-commit-history) for the UI/API and [CLI reference](cli.md).
6
88
 
7
89
  ## Local conversation formats
8
90
 
@@ -16,7 +98,7 @@ Paths below use `~` for the user's home. XDG data/config locations respect their
16
98
  | `kimchi` / Kimchi | `~/.config/kimchi/harness/sessions/` | Pi-format entries. |
17
99
  | `gajae` / Gajae-Code | `~/.gjc/agent/sessions/`, XDG `gjc/sessions/` | Pi-format entries. |
18
100
  | `openclaw` / OpenClaw | `~/.openclaw/agents/*/{sessions/,agent/openclaw-agent.sqlite}`; `.clawdbot`, `.moltbot`, `.moldbot` equivalents | SQLite transcript events take precedence over overlapping JSONL/zstd exports. Rollover and event-parent links do not imply ancestry. Non-message SQLite events are currently omitted. |
19
- | `hermes` / Hermes Agent | `~/.hermes/state.db`, `profiles/*/state.db` | Native messages and retained summaries. Only `source=subagent` establishes a child link; `_branched_from` establishes a fork. Compression/reset parents are not ancestry. |
101
+ | `hermes` / Hermes Agent | `~/.hermes/state.db`, `profiles/*/state.db` | Native messages and retained summaries. Structured content uses Hermes's explicit NUL + `json:` marker; ordinary JSON-looking text stays text. Only `source=subagent` establishes a child link; `_branched_from` establishes a fork. Compression/reset parents are not ancestry. |
20
102
  | `amp` / Amp | XDG `amp/threads/`, Tokscale `amp-cache/threads/` | Local/exported thread messages. No sync is invoked. Usage-ledger times are not assigned to prompts. |
21
103
  | `droid` / Factory Droid | `~/.factory/sessions/` | Saved conversation envelopes; excludes usage apportionment. |
22
104
  | `codebuff`, `freebuff` / Codebuff, Freebuff | XDG config `manicode`, `manicode-dev`, `manicode-staging` chat messages | A positive `base2-free` root-agent marker assigns Freebuff; shared storage is not imported into both sources. No text-based token estimates. |
@@ -57,7 +139,7 @@ Paths below use `~` for the user's home. XDG data/config locations respect their
57
139
  | `antigravity` / Antigravity | Tokscale `antigravity-cache/sessions/*.jsonl` | **Metadata only.** Native session identity; earliest recorded usage date places it. No sync or local RPC. |
58
140
  | `antigravity-cli`, `antigravity-extension` | `~/.gemini/{antigravity-cli,antigravity}/conversations/*.db` | **Metadata only.** Bounded protobuf trajectory creation/workspace metadata. Conversation protobufs remain opaque; unknown timestamps are not guessed. |
59
141
 
60
- **Detection only:** `reasonix` (`~/.reasonix/stats/`), `trae` (Tokscale `trae-cache/sessions/`), `warp` (Tokscale `warp-cache/`), `lm-studio` (`~/.lmstudio/server-logs/`), and `hindsight` (`~/.hindsight/usage/`). These compared inputs contain request/account usage rather than supported native conversation histories. Reasonix's separate transcripts are not yet supported. Detection produces an explanation and no synthetic sessions.
142
+ **Excluded usage-only inputs:** Reasonix statistics, Trae and Warp/Oz usage caches, LM Studio server logs, and Hindsight memory-operation usage cannot establish supported session lists with dates. They are not offered as import sources. The schema v6 upgrade removes their obsolete selections, custom paths, status records, and active source filters; saved sessions and other source settings are retained. Fx and Antigravity remain available because their supported metadata formats provide session identities and dates.
61
143
 
62
144
  **Provider attribution:** Sakana Fugu rollouts remain Codex sessions. Synthetic remains the provider of its originating harness; Octofriend has its own source. They do not create duplicate source identities.
63
145
 
@@ -71,4 +153,4 @@ File imports are bounded to 32 MB combined expanded data and 50,000 messages. SQ
71
153
 
72
154
  Missing message timestamps remain unknown. Native dates place database sessions; undated database histories are skipped with a warning. File histories can fall back to file dates and disclose this. Unsupported message blocks, binary attachments, missing tools, and absent snapshots remain partial. Token counts are never estimated from text; usage aggregates are not converted into conversations. No new harness is enabled automatically, and continuing a session remains an explicit user action through supported launch destinations.
73
155
 
74
- Fixture tests cover each parser family, registry/display-name consistency, duplicate representations, compressed archives, legacy Cursor bubbles, immutable DB/WAL reads, source changes, partial events, metadata-only sources, and saved-history retention. Native writers inspected in addition to Tokscale include Hermes, Goose, Zed, Octofriend, Mux, and Unsloth.
156
+ Fixture tests cover each parser family, registry/display-name consistency, duplicate representations, compressed archives, legacy Cursor bubbles, immutable DB/WAL reads, source changes, partial events, metadata-only sources, and saved-history retention. Native writers inspected in addition to Tokscale include Hermes, Goose, Zed, Octofriend, Mux, and Unsloth. See [the importer comparison](importer-comparison.md) for the title, content-decoding, and cross-source identity decisions informed by CASS and Agent Sessions.
@@ -0,0 +1,48 @@
1
+ # History importer comparison
2
+
3
+ Reviewed November 6, 2026. These are source-code comparisons, not claims that another project's entire importer is correct. References are pinned so later upstream changes do not alter the evidence.
4
+
5
+ ## CASS / Franken Agent Detection
6
+
7
+ [CASS](https://github.com/Dicklesworthstone/coding_agent_session_search/tree/298f51895585ab086d8b129b9a475a3b26609407) delegates its core connectors to [Franken Agent Detection at `6b337ba`](https://github.com/Dicklesworthstone/franken_agent_detection/tree/6b337ba434b72c65c6c5a748b7ec47885f840ac0), pinned in CASS's Cargo manifest.
8
+
9
+ - Its [Codex connector](https://github.com/Dicklesworthstone/franken_agent_detection/blob/6b337ba434b72c65c6c5a748b7ec47885f840ac0/src/connectors/codex.rs#L987-L1004) skips injected-context user records when deriving a title. It also tests mirrored `event_msg` / `response_item` prompts so they do not become duplicate messages.
10
+ - Its [Cursor connector](https://github.com/Dicklesworthstone/franken_agent_detection/blob/6b337ba434b72c65c6c5a748b7ec47885f840ac0/src/connectors/cursor.rs#L495-L504) excludes NULL-valued Composer marker rows explicitly. A marker is not a corrupt conversation. It deduplicates native session IDs across database representations.
11
+ - Its [Hermes connector](https://github.com/Dicklesworthstone/franken_agent_detection/blob/6b337ba434b72c65c6c5a748b7ec47885f840ac0/src/connectors/hermes.rs#L246-L284) reads message content as text rather than guessing JSON from punctuation.
12
+
13
+ **Applied here:** source-specific title normalization, NULL-marker filtering, and native-identity deduplication. Our raw histories remain separate from the map's grouping, and unchanged parser revisions are invalidated when decoding changes.
14
+
15
+ ## Agent Sessions
16
+
17
+ [Agent Sessions at `555fbfd`](https://github.com/jazzyalex/agent-sessions/tree/555fbfddaa286b63cdef2ef13db88cb9cf320d87) is a comparable local history browser.
18
+
19
+ - Its [title selection](https://github.com/jazzyalex/agent-sessions/blob/555fbfddaa286b63cdef2ef13db88cb9cf320d87/AgentSessions/Model/Session.swift#L666-L740) prioritizes custom titles and filters harness preambles before falling back to other text.
20
+ - Its [Cursor parser](https://github.com/jazzyalex/agent-sessions/blob/555fbfddaa286b63cdef2ef13db88cb9cf320d87/AgentSessions/Services/CursorSessionParser.swift#L48-L58) recognizes error-only `turn_ended` records. Its user-query tag removal does not cover every attachment/web-context envelope encountered in our audit.
21
+ - Some of its preamble checks search for phrases anywhere in a message. Those heuristics can also match a legitimate request quoting a prompt or XML example.
22
+
23
+ **Applied here:** retain native Codex names before prompt fallbacks, preserve Cursor lifecycle errors, and normalize only recognized leading context. Strip context before payload truncation so a long injected preamble cannot consume the real prompt's entire budget. Keep literal markup inside user queries intact. Context-only blocks remain source events rather than user-message dots.
24
+
25
+ ## Hermes's native writer is the content-format authority
26
+
27
+ Hermes [encodes and decodes structured content](https://github.com/NousResearch/hermes-agent/blob/90d6b98fd86d20981ee06ddd5b7d93e4320f26a4/hermes_state_messages.py#L139-L169) using a reserved NUL + `json:` prefix. Ordinary strings are unchanged, even if they are valid JSON. Literal strings starting with the reserved prefix are JSON-string-escaped. Malformed marked content falls back to its original text.
28
+
29
+ **Applied here:** follow that contract exactly. Do not parse `[IMPORTANT: ...]`, JSON followed by prose, or a literal JSON example as structured conversation blocks. This fixes whole-session rejection without discarding the offending message. Empty native sessions are reported separately from unreadable histories.
30
+
31
+ ## Tokscale
32
+
33
+ [Tokscale at `82613d2`](https://github.com/junhoyeo/tokscale/tree/82613d2f5e96654ce3729892afbb0025979f1c75) remains useful for format discovery, native IDs, and archived rollout coverage. Its [Codex parser](https://github.com/junhoyeo/tokscale/blob/82613d2f5e96654ce3729892afbb0025979f1c75/crates/tokscale-core/src/sessions/codex.rs) derives deduplication identity from in-file session metadata. Its [Hermes parser](https://github.com/junhoyeo/tokscale/blob/82613d2f5e96654ce3729892afbb0025979f1c75/crates/tokscale-core/src/sessions/hermes.rs#L1-L19) primarily reconstructs usage from session aggregates and logged API calls.
34
+
35
+ **Boundary:** usage aggregates and billing deduplication are not conversation reconstruction. SessionGraph imports recorded messages and times rather than manufacturing turns or allocating aggregate usage to prompts.
36
+
37
+ ## T3 / provider overlap
38
+
39
+ The inspected connectors do not establish a reusable T3-to-provider ownership rule. SessionGraph uses T3's explicit, strong provider bindings. Matching titles, timestamps, or similar messages never establish identity.
40
+
41
+ - A uniquely bound T3 thread with imported user messages occupies one map entry, even when attachment or payload omissions make it partial.
42
+ - The inspector offers the separately saved provider history. Grouping does not overwrite, append, or merge the two transcripts, and partial coverage remains visible.
43
+ - Empty or pending T3 histories do not hide native sessions. All binding claimants count when checking ambiguity, including pending or partial ones.
44
+ - Snapshot changes during T3 discovery get up to three fresh-copy attempts. Only the consistency-race error is retried; schema errors still surface. Paged reads remain pinned to one verified snapshot.
45
+
46
+ ## Remaining format boundaries
47
+
48
+ Attachments and checkpoint snapshots are still not imported by T3. Cursor Composer values above the existing 32 MB limit are still bounded and reported; NULL markers are excluded from that warning. Native histories that are genuinely empty cannot supply conversation messages. Live validation covers installed sources; fixture tests cover parser families for unavailable harnesses.
@@ -0,0 +1,176 @@
1
+ # Session-linked commits, files, branches, and directories
2
+
3
+ Investigation: November 6, 2026. Implementation update: November 8, 2026.
4
+
5
+ ## Implemented first version
6
+
7
+ The approved lean design is now implemented in source: existing sessions and tool events, one `session_commits` table, and small per-session extraction metadata. Execution cwd/exit codes and conditional Claude native Git results are retained; conservative creation/amendment/cherry-pick extraction runs atomically during import. Indexed API/CLI reads, selected-session graph markers, and evidence inspection are available. See the [guide](guide.md#recorded-commit-history) and [harness data matrix](import-coverage.md#imported-data-by-harness) for actual supported behavior.
8
+
9
+ The broad multi-table design below is **historical and superseded for this feature**. Separate repository, payload, branch, location, file-summary, and checkpoint indices remain proposals. Provider histories keep their own commit attribution; they are not automatically aggregated. Full local Git enrichment and arbitrary-shell parsing are not implemented. The contract-supported Claude native-result path has fixture coverage; the original live-sample limitation still applies.
10
+
11
+ <details>
12
+ <summary>Original investigation and broader proposal (historical)</summary>
13
+
14
+ ## Conclusion
15
+
16
+ Normalize evidence once during import, then serve indexed session-to-artifact links to the graph. We already read changed histories during import; rendering should never need another conversation scan to discover commits or files.
17
+
18
+ There is no universal source-provided `session.commits` or complete audit log of everything a session changed. Several sources provide strong structured evidence, and others provide matching tool executions/results from which particular operations can be extracted. Keep the relationship and its evidence explicit: **created a commit**, **started at a commit**, and **mentioned a commit** are different facts.
19
+
20
+ Likewise, a workspace snapshot establishes a change during an interval, not exclusive authorship when another agent or person shares that workspace. "Recorded changes" is supportable; "every change made by this agent" is generally not.
21
+
22
+ ## What the current app stores
23
+
24
+ - [`Session`](../packages/core/src/types.ts) contains native identity, one directory/project, explicit lineage/provider links, timing, and available model/usage metadata. There are no normalized commits, Git branches, repository identities, or directory histories.
25
+ - [`ImportedMessage`](../server/adapters/types.ts) contains per-message file evidence, tool names, and structured timeline events. File evidence currently stores only `path`, evidence category, and `steps`; it loses change kind, rename pairing, and line statistics.
26
+ - [`SessionGraphStore.detail()`](../server/store.ts) reparses 120 saved message JSON objects per request and aggregates their files/tools. [`loadFiles()`](../src/main.ts) requests every page when selecting a session. This is the scan that a materialized index should replace.
27
+ - [`timeline_items`](../server/event-store.ts) already indexes event identity, time, kind, and tool-call correlation, but commits/branches/locations are not extracted into queryable records.
28
+ - OpenCode's [`summarizeMessages()`](../server/opencode.ts) recognizes directory moves, but [`opencodeAdapter.read()`](../server/adapters/opencode.ts) does not carry its `locations` into imported messages. The saved detail endpoint always returns `locations: []`. Some move payloads survive as generic event text instead.
29
+ - [`Importer`](../server/importer.ts) already skips unchanged source revisions and replaces a session's messages/events in one transaction. This is the natural integration point for artifact extraction and replacement.
30
+
31
+ ## Source findings
32
+
33
+ "Available" below means observed in the audited source format or specified by its inspected contract. It does not promise that older versions or every session populated the field. Source-specific execution parsing is a potential extension unless explicitly described as imported today.
34
+
35
+ | Source | Commit evidence | File evidence | Branch/repository/directory evidence |
36
+ | --- | --- | --- | --- |
37
+ | **OpenCode V2** | No created-commit collection in the inspected session API. Shell input/result, call ID, completion time, and shell result metadata can support extraction. | Imported `snapshot.files`, with start/end snapshot coverage, or successful edit tools when complete snapshots are absent. | Session `location.directory`, project canonical directory/sandboxes, and recorded `location-switched` messages. VCS endpoints expose location state, not historical session branch ownership. |
38
+ | **Claude Code** | Installed SDK declares structured `BashOutput.gitOperation.commit` with SHA, kind, and optional branch. This is an especially useful native path when producers persist it. Otherwise correlate Bash calls/results. | Imported successful Edit/Write/MultiEdit/NotebookEdit results. Raw `file-history-snapshot` records also exist, but their backup semantics need separate validation before using them as a changed-file list. | SDK session metadata has `gitBranch`; raw transcript envelopes have `cwd` and `gitBranch`. These fields can provide recorded observations, rather than a complete branch-switch ledger. |
39
+ | **Codex** | Optional `session_meta.payload.git.commit_hash` is a context/base commit, **not a created commit**. Completed command output can support operation extraction. | Imported successful `patch_apply_end`, completed FileChange items, and explicit moves. | Optional header `git.branch`/`repository_url`, `cwd`, and observed `runtime_workspace_roots`; turn contexts can record later `cwd`. Git header data is currently dropped. |
40
+ | **T3 Code V2** | Saved command items contain command input/output, status, native provider identity, and `exitCode`. Actual commit-success output was observed. Checkpoint refs are internal snapshots, not user commits. | Completed actual-path `file_change` items are imported. Separate checkpoint projections also contain `files[]` with path, kind, additions, and deletions; these are currently omitted. OpenCode tool labels such as `patch` are not paths. | Thread `branch`, `worktreePath`, project `workspace_root`; checkpoint scopes also record `cwd`. Branch and checkpoint scope metadata are currently omitted. Strong provider links permit additional native-source evidence. |
41
+ | **Hermes** | No dedicated created-commit relation found in the inspected sessions schema/adapter. Retained tool calls/results are candidates for source-specific extraction. | Current adapter does not normalize file changes; successful tool-result decoding would need additional work. | Native sessions table has `cwd`, `git_branch`, `git_repo_root`, and a Git metadata generation. Only `cwd` is currently imported. Git fields are mutable observations, not history. |
42
+ | **Cursor** | No normalized commit relation in current readers. Exported calls/results are incomplete and cannot establish a complete commit history. | Current reader intentionally supplies no verified file evidence; requests/attachments are insufficient. | Recorded cwd/workspace metadata, with conservative path matching. No verified native Git-branch history in the audited readers. |
43
+ | **GitHub Copilot CLI** | Correlated execution start/complete events offer a possible extraction path; no created-commit collection in our reader. | Explicit result `fileEdits[]` is already imported, including changes that succeeded within a partially failed operation. "Committed" here means applied file mutations, not Git commits. | Recorded session-start context cwd; other Git metadata needs format validation before promising support. |
44
+ | **GitHub Copilot Chat** | Saved tool invocations/results may permit extraction where full output and execution context survive. | Explicit accepted-edit events are imported. References, proposals, and undo events are not accepted changes. | Explicit working directory or a verified single-folder workspace. Multi-root/remote folders must not be guessed. |
45
+ | **Gemini / Qwen** | Correlated recorded tool executions can support extraction; no dedicated commit collection currently imported. | Successful matching edit results already imported. | Gemini project-root marker; Qwen recorded cwd. No verified Git-branch ledger in the audited readers. |
46
+ | **Pi and Pi-format sources** | Tool calls/results can support extraction where status and output are retained. | Pi-format parser extracts successful write/edit evidence, including when used by additional harness adapters. | Header cwd. Conversation-tree branches and `branch_summary` are **not Git branches**. |
47
+ | **Cline / Roo / Kilo extension** | Potential from structured calls/results; coverage is limited by retained API-conversation snapshots. | Matching successful edit tools where recorded. XML requests alone are insufficient. | Matching task/session metadata supplies workspace and explicit lineage. Checkpoint/branch semantics outside current readers need validation. |
48
+ | **Continue** | Potential from retained execution results; no dedicated commit index. | Current reader does not extract verified edits. | `workspaceDirectory`; no verified Git history in the current reader. |
49
+ | **Other conversation adapters** | No native commit index implemented. Validate each producer's execution/result format before enabling extraction. | Mostly message-oriented readers; do not infer support merely because tool text exists. | Selected cwd/working-directory/folder fields where explicitly available; missing paths remain unknown. |
50
+ | **Metadata-only / detection-only sources** | Insufficient evidence for session-created commits. | Insufficient change evidence. | Some expose native session/workspace identity; detection-only inputs create no sessions. |
51
+
52
+ The additional conversation adapters include Amp, Droid, Codebuff/Freebuff, Kimi, Grok, Jcode, Cherry Studio, Command Code, ZCode, CodeBuddy, WorkBuddy, Proma, DeepSeek Harness, Aside, Vibe, Goose, Zed, Devin, Crush, Octofriend, Kilo CLI, MiMo, Unsloth, Kiro, Mux, and captured MiniMax histories. OpenClaw varies by representation: the database reader is message-oriented, while its Pi-format export reader can extract successful edits. See [extended import coverage](import-coverage.md) for the complete registry and format limitations. These sources were reviewed at the adapter/format level, not all against live installations.
53
+
54
+ ### Particularly useful data we currently discard
55
+
56
+ **T3 checkpoints.** The inspected SQLite schema has `orchestration_v2_projection_checkpoints`, linked by thread/scope/run/node, with status and capture time. Ready checkpoints with nonempty file lists were observed. `orchestration_v2_projection_checkpoint_scopes` supplies cwd. Checkpoint activity items carry `checkpointId`, `scopeId`, and files as well: consume one authoritative representation and deduplicate by checkpoint ID. Validate the interval/baseline before summing line changes. Empty lists on unavailable/missing checkpoints are not proof of no edits. Refs under `refs/t3/orchestration-v2/checkpoints/...` must remain a separate checkpoint category even when backed by Git commit objects.
57
+
58
+ **T3 commands.** The adapter currently preserves input/output but drops `exitCode` and, for ordinary commands, native call identity. Preserve both before extracting operations. The command projection can omit the provider's per-call cwd, so use scoped directory evidence or the linked provider record when necessary; do not blindly attach every operation to the thread's latest directory.
59
+
60
+ **Claude native Git results.** SDK `0.3.312` / Claude Code `2.1.312` declares:
61
+
62
+ ```ts
63
+ gitOperation?: {
64
+ commit?: { sha: string; kind: 'committed' | 'amended' | 'cherry-picked'; branch?: string };
65
+ push?: { branch: string };
66
+ branch?: { ref: string; action: 'merged' | 'rebased' };
67
+ pr?: { number: number; url?: string; action: string };
68
+ }
69
+ ```
70
+
71
+ The live SDK user-message envelope exposes `tool_use_result`; on-disk producers can use a different envelope spelling that must be checked. The narrower `getSessionMessages()` return type does not expose structured tool output or Git metadata. Our transcript loader already reads raw entries before using the SDK conversation-chain parser, so an enrichment pass can join retained entries to returned message UUIDs without flattening away those fields or including abandoned conversation branches accidentally. The small surviving local Claude sample confirmed `cwd`, `gitBranch`, and file-history records, **not an actual `gitOperation` result**. Treat Git-operation persistence as contract-supported and requiring a producer-specific fixture/live example before shipping.
72
+
73
+ **Codex metadata.** Sampled rollouts confirmed optional `git.commit_hash`, `git.branch`, and `git.repository_url`. Other sampled headers lacked Git metadata. Preserve them as observations attached to the header, with their recorded timing; never count the initial SHA as a session-created commit.
74
+
75
+ **Hermes Git fields.** The installed writer updates cwd and Git metadata together, with generation checks for asynchronous probes. It may retain a previous nonempty Git value when a same-cwd probe fails. Store this as the harness's recorded metadata observation, not an exact historical checkout event or current disk truth.
76
+
77
+ **OpenCode execution metadata.** The local API exposed completed shell `state.metadata.exit`, `status`, and `truncated`. Our generic timeline conversion retains content but drops this metadata. A completed tool envelope alone is insufficient to prove a successful Git command. The V2 API also exposes session snapshot diffs and durable logs; neither is a native list of commits created by a session. `revert/commit` applies a staged session revert, not a Git commit operation.
78
+
79
+ ## Reliability rules
80
+
81
+ ### Commits
82
+
83
+ Accept a created-commit link from a validated native operation result, or a correlated Git execution with a confirmed commit outcome and unambiguous repository context. Keep extraction provenance so users can inspect the evidence.
84
+
85
+ - Prefer native structured results. Fallback parsers should understand a small set of execution formats and actual command syntax, not search arbitrary prose for hexadecimal strings or `git commit`.
86
+ - A successful command request, "I committed it," a `git log` listing, an initial HEAD, or matching timestamps does not establish creation.
87
+ - Preserve full object IDs when available. Resolve abbreviated IDs only against the identified local repository and require an unambiguous commit object. Keep unresolved evidence explicit; do not invent the remaining hash.
88
+ - Optional read-only Git enrichment can fetch subject, parents, object format, and commit dates in batches after attribution. It validates/enriches the object; it does not establish which session created it. Do not fetch repositories or inspect every repository's full log per session.
89
+ - A shell command can create a commit and then fail during push/test. Conversely, `git commit ...; echo done` can return zero after commit failure. Overall exit status is not enough: attribute the specific operation. Background execution requires its eventual result.
90
+ - Distinguish creation, amendment, cherry-pick, merge/rebase effects, push, base/checkout observation, and reference. A pushed commit need not have been created in that session.
91
+ - Use recorded execution time for a graph action marker. Git author/committer dates are separate and may be rewritten or backdated.
92
+ - Exclude harness checkpoint refs from normal commit markers. Copied/inherited history in a fork does not mean the child created the parent's commits.
93
+
94
+ ### Files
95
+
96
+ Accept actual source snapshots/file-change records and confirmed successful edit results. Preserve whether the evidence is a workspace delta or an agent tool mutation.
97
+
98
+ - A file read, mention, proposed patch, attachment, or tool name is not a change.
99
+ - Snapshot coverage can miss files excluded by the source, transient edits reverted within one interval, or changes outside its workspace. Edit tools can miss shell scripts, generators, formatters, and external changes. The union is useful, but still has a coverage boundary.
100
+ - Paths require source-specific resolution: snapshot-relative paths, per-call cwd, and session cwd are not interchangeable. Preserve original path and resolution base; do not resolve old relative paths against the session's latest directory.
101
+ - Keep rename source/destination and operation type when explicitly recorded. A filename is not a stable identity across renames.
102
+ - `steps` currently counts recorded evidence steps, not lines or unique tool invocations. Do not double-count matching snapshot and tool evidence. Snapshot line deltas over overlapping intervals cannot be summed as net session changes.
103
+
104
+ ### Branches, repositories, and directories
105
+
106
+ Define "touched" explicitly rather than using one undifferentiated string list:
107
+
108
+ - Branch: `observed`, `created`, `checked_out`, `merged`, `rebased`, or `pushed`.
109
+ - Directory: `session_workspace`, `execution_cwd`, `workspace_move`, or `modified_file_parent`.
110
+ - Repository: observed native metadata or a verified local repository/worktree association.
111
+
112
+ Starting/last-recorded branch fields do not enumerate every intermediate branch. Working in a file's parent directory is different from running a command there. `cd` in a command may be subshell-local; `git -C`, explicit workdir, worktree moves, remote execution, and multi-repository commands need their own context. Worktree directory names must never be decoded into guessed branch names. Git's current branch and reflog alone cannot reconstruct session attribution.
113
+
114
+ ## Proposed normalized model
115
+
116
+ Use ordinary relational links with `session_id` foreign keys, backed by a compact summary on the existing session object. The following are conceptual tables, not a migration:
117
+
118
+ | Record | Important fields |
119
+ | --- | --- |
120
+ | `repositories` | Local repository identity, object format, verified common Git directory when available; retain observed roots/aliases separately. Remote URL alone is not unique. |
121
+ | `commits` | Repository ID + full object ID; optional subject, parents, author/committer dates. |
122
+ | `session_commits` | Session ID, commit ID, relationship, recorded action time, evidence reference. |
123
+ | `session_files` | Session ID, repository/workspace scope, resolved or explicitly unresolved path, observed-change summary, evidence coverage. |
124
+ | `session_branches` | Session ID, repository/workspace scope, branch/ref, relationship, recorded observation/action time. |
125
+ | `session_locations` | Session ID, directory/worktree, relationship, recorded time and source order. |
126
+ | `session_checkpoints` | Session ID, native checkpoint ID/ref, scope/baseline, capture time/status; file deltas kept separate from Git commits. |
127
+ | `artifact_evidence` | Owning source/native session, native message/event/call/checkpoint ID, extraction version, status, evidence kind, time provenance, source revision. |
128
+ | `session_artifact_summary` | Indexed counts, per-category coverage, artifact revision, bounded marker summary if needed. |
129
+
130
+ Keep the action/evidence rows as well as unique artifact links: one commit can have multiple recorded operations or sources; multiple sessions may contribute to a file or refer to a commit. Do not use a global SHA or path alone to collapse repository/workspace identity. Unknown repository scope should remain distinct until a verified association exists.
131
+
132
+ Index by `(session_id, ...)`, by `(session_id, occurred_at)`, and by repository/object ID. A time-first marker index can support graph-wide date windows. Store `occurred_at = NULL` when absent; source order remains available without invented marker positions.
133
+
134
+ Per-category coverage should include support, extraction completion, revision/version, missing/truncated input, and the evidence scope. "Finished extracting observed edits" is not "proved that all filesystem edits were captured." Unknown is not zero; counts should mean **recorded/confirmed items**, with coverage attached. A single `capabilities.files` boolean or conversation `coverage.history` flag cannot express this.
135
+
136
+ ### Import and invalidation
137
+
138
+ 1. Read session-level metadata directly during discovery where available.
139
+ 2. Extract native artifact facts from raw records while the adapter already reads history, before text/payload truncation discards structured fields. Bound artifact extraction independently and disclose limits.
140
+ 3. Correlate tool requests/results across pages by native call identity and session scope. Do not rely on a one-message overlap for nonadjacent or parallel calls. Preserve source order and handle duplicate/inherited records explicitly.
141
+ 4. Normalize and deduplicate facts, then atomically replace artifact links, evidence, summary, messages, events, and search invalidation in the existing snapshot transaction. Failed refreshes retain the previous saved artifact snapshot.
142
+ 5. Track an artifact extractor version separately from source revision. An unchanged source still needs reprocessing after extractor changes. Include newly consumed checkpoint/metadata dependencies in revision calculation.
143
+ 6. Backfill from saved structured events/files when sufficient. Fields already discarded, including native checkpoint lists and structured tool metadata, require source refresh. An unavailable source stays unavailable rather than becoming an empty list.
144
+ 7. For T3, aggregate evidence from explicitly and unambiguously linked provider sessions. Retain original ownership and native call IDs, deduplicate mirrors, and invalidate the visible T3 summary when a linked provider revision changes. Ambiguous links must not merge unrelated evidence.
145
+
146
+ ### Fast graph reads
147
+
148
+ - Keep the graph's session payload small: counts, coverage, revision, and optionally a small bounded marker preview. Do not attach every file path and full commit body to every session in the initial graph response.
149
+ - Fetch lightweight commit markers for visible session IDs/time windows in bounded batches. Include only IDs, session links, action times, and display data. Query normalized artifact indexes, never message JSON. Cache against artifact revision.
150
+ - Use clustering/level of detail and explicit result limits for large graphs; omitted markers must be distinguishable from missing source data. Untimed commits remain in the inspector instead of being placed at fabricated times.
151
+ - Lazy-load a selected session's full artifacts and evidence from the same indexes. Existing file-detail routes can retain their public shape while changing their backing query from message scans to indexed file summaries.
152
+ - Optional Git enrichment is cached by repository/object ID and occurs outside the rendering path. It should not delay showing already-confirmed session evidence.
153
+
154
+ ## Other useful session-linked facts
155
+
156
+ Native session identity, explicit forks/children/provider bindings, recorded message times, tool calls/results and statuses, model/provider observations, and available token/cost totals can use the same provenance conventions. T3 also records linked/branch PR references, and Claude's SDK declares PR operations. A linked PR is an association; an explicit created/merged operation is an action. Token usage, model metadata, and lineage still have source-specific coverage, and T3/provider mirrors must not double-count them.
157
+
158
+ ## Recommended order
159
+
160
+ 1. Materialize currently imported file/tool evidence and add per-category coverage. Preserve OpenCode directory moves and the verified branch/repository metadata from Claude, Codex, T3, and Hermes.
161
+ 2. Add T3 ready-checkpoint file evidence, preserving scope/baseline and keeping internal checkpoints distinct from commits.
162
+ 3. Add commit evidence extraction: validated Claude native results when present, then conservative OpenCode/T3/Codex execution parsers with repository context and success checks.
163
+ 4. Render lightweight commit markers and indexed artifact details. Expand other sources only as their native result formats are verified.
164
+
165
+ Meaningful implementation checks should cover failed/dry-run/multi-command commits, successful commit followed by failed push, short-hash ambiguity, internal checkpoints, branch moves, relative paths across workspaces, fork-inherited history, duplicate T3/provider evidence, page-boundary correlation, unavailable sources, truncation, and atomic replacement. Verify graph reads do not query `messages` or parse timeline payloads after indexing.
166
+
167
+ ## Evidence and scope of this audit
168
+
169
+ - Reviewed all registered adapter families, current storage/import code, timeline indexes, and the file-detail loading path.
170
+ - Inspected T3 and Hermes native schemas through private read-only SQLite copies, including T3 ready checkpoint file shapes and successful/failed command result shapes.
171
+ - Inspected bounded local Codex and Claude transcript samples. Some saved transcript paths no longer existed; the surviving Claude sample was small. These samples establish field presence, not population-wide completeness.
172
+ - Used OpenCode's authenticated loopback GET API for its live OpenAPI schema, session/message shapes, shell result metadata, and snapshot shapes. No OpenCode database access or agent execution was used. Public contract: [OpenCode V2 API](https://opencode.ai/v2/docs/api).
173
+ - Inspected the installed Claude SDK's `sdk-tools.d.ts` (`BashOutput.gitOperation`), `sdk.d.ts` (`SDKSessionInfo`, `SDKUserMessage`, `SessionMessage`), and installed Hermes metadata writer semantics.
174
+ - Diagnostics and local field-shape reports are in ignored `tmp/audit-session-evidence*`. The investigation did not import into or rewrite the persistent SessionGraph library. No runtime behavior or artifact index was implemented.
175
+
176
+ </details>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sessiongraph",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -25,11 +25,11 @@
25
25
  "README.md"
26
26
  ],
27
27
  "optionalDependencies": {
28
- "sessiongraph-app-darwin-arm64": "1.0.12",
29
- "sessiongraph-app-darwin-x64": "1.0.12",
30
- "sessiongraph-app-linux-arm64": "1.0.12",
31
- "sessiongraph-app-linux-x64": "1.0.12",
32
- "sessiongraph-app-win32-x64": "1.0.12"
28
+ "sessiongraph-app-darwin-arm64": "1.0.14",
29
+ "sessiongraph-app-darwin-x64": "1.0.14",
30
+ "sessiongraph-app-linux-arm64": "1.0.14",
31
+ "sessiongraph-app-linux-x64": "1.0.14",
32
+ "sessiongraph-app-win32-x64": "1.0.14"
33
33
  },
34
34
  "type": "module",
35
35
  "engines": {
@@ -75,5 +75,5 @@
75
75
  "vite": "^7.2.0"
76
76
  },
77
77
  "packageManager": "pnpm@11.10.0",
78
- "sessionGraphCommit": "d99e40d05031062b93e980d62c5fd68e296d7e2c"
78
+ "sessionGraphCommit": "c87091e2fdb0c2bc8c26e5e36411cf3d9ad6c687"
79
79
  }
@@ -1 +0,0 @@
1
- import{n as u}from"./index-CIhs02tq.js";function p(t,e,c){t.open&&(t.addEventListener("close",()=>c(e),{once:!0}),t.close())}function b(t,e,c){const l=document.createDocumentFragment(),i=document.createElement("header");i.className="sharing-header";const s=document.createElement("h2");s.id=`sharing-${e}-title`,s.textContent="Share SessionGraph",t.setAttribute("aria-labelledby",s.id);const n=document.createElement("button");n.type="button",n.className="text-button",n.textContent="Close",n.setAttribute("aria-label","Close sharing"),n.onclick=()=>t.close(),i.append(s,n);const r=document.createElement("div");r.className="sharing-modes",r.setAttribute("role","group"),r.setAttribute("aria-label","Share method");for(const a of["publish","video"]){const o=document.createElement("button");o.type="button",o.dataset.shareMode=a,o.textContent=a==="publish"?"Publish":"Video",o.setAttribute("aria-pressed",String(a===e)),o.onclick=()=>{a!==e&&p(t,a,c)},r.append(o)}return l.append(i,r),l}async function d(t,e){await u("plugin:opener|open_url",{url:t,with:e})}function h(t){const e=new URL(t);if(!["https:","http:"].includes(e.protocol)||e.username||e.password)throw new Error("Choose a valid web link.");return e.href}async function f(t,e=d){await e(h(t))}export{h as e,f as o,b as s};