Repository navigation
Description
Context
Each of the four importers (ChatGPT, Claude AI, Claude Code, Codex) independently calls build_markdown_from_chunks() and persist_document(). There is no shared processing step between parsing provider-specific JSON and writing the final Markdown. This means:
-
Branch structure is discarded. ChatGPT exports include a full message DAG via
mappingwith parent pointers — edits and regenerations create forks. Claude AI exports can carryparent_id/parentUuidon messages. Currently everything is linearised into one transcript. Forks vanish. -
No queryable metadata store. The only record of a conversation's structure is the Markdown front matter. To answer "how many branches does this conversation have?" or "what's the total word count across all Claude imports?" you'd need to reparse every
.mdfile. -
Duplicated orchestration logic. Each importer assembles chunks, calls the render function, calls persist, handles skip/dirty logic, and constructs an
ImportResult. The four implementations are nearly identical in structure but diverge in small ways (some checkpersist_result.skippeddifferently, some set different extra_state keys).
Additional gaps
-
Token counts lack word-count companions. Token counts are model-dependent approximations. There's no deterministic word count to sanity-check against.
-
No per-turn timestamps in output. The front matter records
sourceModifiedTimebut individual turns don't show when they occurred. For long conversations spanning hours or days, temporal context is lost. -
Escaped footnotes render poorly. Multiple providers double-escape bracket references (
\[1\]instead of[1]). These appear as literal backslash-bracket sequences in the rendered Markdown. -
ChatGPT citation tokens are opaque. ChatGPT embeds citation markers as private-use Unicode characters (U+E200–U+E202) that render as empty rectangles or invisible characters.
-
No
--forceflag on import commands. If a user hand-edits a Markdown file and then re-imports, the importer skips the conversation silently. There's no way to say "overwrite my edits." -
Pydantic overhead in the hot path. The Codex importer uses Pydantic models for JSONL line parsing, which rejects valid entries with unexpected fields and adds import latency.
Scope
- All four importers
- Render pipeline (word counts, timestamps, citation resolution)
- CLI import subcommands (--force, summary formatting)
- New SQLite schema for conversation/branch/message metadata
- New branch planning module for DAG traversal
- Provider documentation updates
Out of scope: query CLI for the SQLite store (that's downstream), HTML rendering of branch views, migration tooling for existing archives.
Activity
fix: address remaining code review findings (#5-#14)