Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions PARITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,24 @@ JavaScript saver rejected Python's `msgpack` serializer type. The production
adapter therefore delegates to the official Python saver and message reducer
instead of decoding SQLite blobs or assuming cross-language wire compatibility.

## DeepSeek Harness (dsh)

The dsh adapter was checked on 2026-08-15 against three local DeepSeek Harness
sessions without retaining or printing transcript content, paths, identifiers,
arguments, results, or other private fields. dsh persists a zstd-compressed
append-only JSONL event stream; the adapter intentionally accepts the
decompressed JSONL payload and does not add a zstd dependency.

Observed sessions used a top-level `session` header; `request/header` model
configuration; `user/message` and aggregate `assistant/message` content blocks;
direct `tool/call` and `tool/result` lifecycle events; plus turn/step,
permission, title, request-context, and streaming chunk events. The decoder
maps message text/reasoning and direct tool lifecycle events, ignores chunks to
avoid duplicate assistant text, and uses source-native message/call ids for
canonical identity. Sanitized fixtures cover the header, model and cwd metadata,
turns, user and assistant messages, reasoning, a linked successful tool call and
result, and ignored chunks.

## OpenCode native export

The OpenCode adapter was implemented against the native-format parser in
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ and is empty when the transcript required no recoverable cleanup.
| [`codex`](src/adapters/codex/) | Native Codex rollout JSONL | `codex` |
| [`copilot-cli`](src/adapters/copilot-cli/) | Native GitHub Copilot CLI event JSONL | `copilot-cli` |
| [`cursor`](src/adapters/cursor/) | Cursor role/message content-block JSONL capture | `cursor` |
| [`dsh`](src/adapters/dsh/) | Decompressed DeepSeek Harness session JSONL event stream | `dsh` |
| [`droid`](src/adapters/droid/) | Native Droid session JSONL | `droid` |
| [`gemini-cli`](src/adapters/gemini-cli/) | Native Gemini CLI whole-session JSON | `gemini-cli` |
| [`hermes`](src/adapters/hermes/) | Session-store message-row array or a `{ "session": {...}, "messages": [...] }` envelope | `hermes` |
Expand Down
11 changes: 11 additions & 0 deletions fixtures/dsh/happy-path/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"records": [
{ "role": "meta", "source": "dsh", "cwd": "/home/user/project", "model": "deepseek-chat" },
{ "role": "user", "content": "List the project files.", "timestamp": "2026-08-15T22:07:26.800Z" },
{ "role": "assistant", "content": null, "tool_calls": [{ "id": "toolu-1", "name": "bash", "args": "{\"cmd\":\"ls\"}" }], "timestamp": "2026-08-15T22:07:27.000Z" },
{ "role": "reasoning", "content": "I should inspect the directory.", "timestamp": "2026-08-15T22:07:27.100Z" },
{ "role": "tool", "tool_call_id": "toolu-1", "content": "README.md\nsrc", "ok": true, "timestamp": "2026-08-15T22:07:27.200Z" },
{ "role": "assistant", "content": "The project contains README.md and src.", "timestamp": "2026-08-15T22:07:27.400Z" }
],
"diagnostics": []
}
12 changes: 12 additions & 0 deletions fixtures/dsh/happy-path/input.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{"type":"session","version":0,"id":"session-00000000-0000-0000-0000-000000000001","createdAt":1786831646414,"cwd":"/home/user/project","delegationDepth":0,"agentPreset":"standard"}
{"type":"permission/preset","seq":0,"time":1786831646606,"data":{"preset":"workspace-write"}}
{"type":"request/header","seq":1,"time":1786831646610,"data":{"header":{"system":"<redacted>","tools":[{"name":"bash"}],"config":{"provider":"deepseek","model":"deepseek-chat","maxTokens":8192}},"reason":"initial"}}
{"type":"turn/start","seq":2,"time":1786831646700,"data":{"turn":1}}
{"type":"user/message","seq":3,"time":1786831646800,"data":{"id":"msg-user-1","role":"user","content":[{"type":"text","text":"List the project files."}],"source":{"kind":"interactive"}}}
{"type":"assistant/chunk","seq":4,"time":1786831646900,"data":{"turn":1,"step":1,"chunk":{"type":"text","text":"I will "}}}
{"type":"tool/call","seq":5,"time":1786831647000,"data":{"turn":1,"step":1,"callId":"toolu-1","name":"bash","arguments":"{\"cmd\":\"ls\"}"}}
{"type":"assistant/message","seq":6,"time":1786831647100,"data":{"turn":1,"step":1,"message":{"id":"msg-assistant-call","role":"assistant","content":[{"type":"reasoning","text":"I should inspect the directory."},{"type":"tool-call","id":"toolu-1","name":"bash","arguments":"{\"cmd\":\"ls\"}"}],"source":{"kind":"model"}}}}
{"type":"tool/result","seq":7,"time":1786831647200,"data":{"turn":1,"step":1,"message":{"id":"msg-tool-1","role":"tool","content":[{"type":"tool-result","toolCallId":"toolu-1","content":[{"type":"text","text":"README.md\nsrc"}],"isError":false}],"source":{"kind":"tool"}}}}
{"type":"assistant/chunk","seq":8,"time":1786831647300,"data":{"turn":1,"step":2,"chunk":{"type":"text","text":"The project "}}}
{"type":"assistant/message","seq":9,"time":1786831647400,"data":{"turn":1,"step":2,"message":{"id":"msg-assistant-final","role":"assistant","content":[{"type":"text","text":"The project contains README.md and src."}],"source":{"kind":"model"}}}}
{"type":"turn/end","seq":10,"time":1786831647500,"data":{"turn":1,"reason":{"kind":"completed"}}}
4 changes: 2 additions & 2 deletions python/src/trajectory/_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
from typing import Literal, TypedDict, Union

TrajectorySource = Literal[
"claude-code", "codex", "copilot-cli", "cursor", "droid", "gemini-cli", "hermes", "letta-code", "omp", "openclaw", "opencode", "openhands", "pi"
"claude-code", "codex", "copilot-cli", "cursor", "dsh", "droid", "gemini-cli", "hermes", "letta-code", "omp", "openclaw", "opencode", "openhands", "pi"
]
CheckpointTrajectorySource = Literal["deepagents"]
AnyTrajectorySource = Literal[
"claude-code", "codex", "copilot-cli", "cursor", "droid", "gemini-cli", "hermes", "letta-code", "omp", "openclaw", "opencode", "openhands", "pi", "deepagents"
"claude-code", "codex", "copilot-cli", "cursor", "dsh", "droid", "gemini-cli", "hermes", "letta-code", "omp", "openclaw", "opencode", "openhands", "pi", "deepagents"
]
ToolResultTruncationStrategy = Literal["head", "head-tail"]
ToolResultPolicy = Literal["include", "omit"]
Expand Down
Loading