feat(deepseek): add DeepSeek Harness transcript provider - #72
Open
tommy0103 wants to merge 2 commits into
Open
Conversation
Index DeepSeek Harness session artifacts under $DSH_HOME/sessions
(default ~/.dsh/sessions) into the shared schema as a new 'deepseek'
source, alongside claude, codex, kimi, and pi.
The adapter is line-incremental like claude: a 'mtime:lines' cursor skips
already-indexed lines (countMode 'delta'), falling back to a full reparse
('total') on first index or when a crash repair truncated the artifact
below the indexed line count. Subagent child sessions project into their
parent session as sidechain messages plus a subagent row via the header's
origin/parentSession fields. Messages use stable uuids of the form
deepseek:<sessionId>:<line> so raw() can return the original artifact line.
zstd: a new core util (packages/core/src/zstd.ts) ports the frame scanner
from @deepseek-ai/dsh-session-persistence-jsonl (MIT) and decodes complete
frames via node:zlib, skipping a torn crash tail with no new dependencies.
Tests: golden parse tests (plaintext/zstd/torn tail/incremental delta/
truncation fallback/subagent/discover/raw), ADR-0007 session-detail
conformance with a persist round-trip, and updated registry/schema-doc
assertions. Full suite passes (473 tests).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
deepseekprovider adapter that indexes DeepSeek Harness session artifacts ($DSH_HOME/sessions, default~/.dsh/sessions) into the shared Obelisk schema, alongsideclaude,codex,kimi, andpi.What changed
packages/core/src/providers/deepseek.ts— the provider adapter:mtime:linescursor skips already-indexed lines (countMode: 'delta'), with a full reparse ('total') on first index or when a crash repair truncated the artifact below the indexed line count.origin: 'subagent'+parentSession) project into their parent session as sidechain messages plus asubagentrow.user/messageevents with a non-usersource kind map tois_meta(injected system prompts / skill reminders).tool/call<->tool/resultcorrelation viacallId; thinking (reasoning) blocks becomecontent_type: 'thinking'messages ordered before the text message soassembleSessionDetailfolds them correctly.deepseek:<sessionId>:<line>(plus:0/:1suffixes for thinking/text) soraw()returns the original artifact line.$DSH_HOME; falls back to~/.dsh/sessions.packages/core/src/zstd.ts— ports the frame scanner from@deepseek-ai/dsh-session-persistence-jsonl(MIT, attribution header kept) and decodes complete frames via built-innode:zlib(zstd), skipping a torn crash tail. No new runtime dependencies.builtins.ts/package.json— provider registration and exports.tests/deepseek-parse.test.mjs(golden: plaintext / zstd frames / torn tail / incremental delta resume / truncation fallback / subagent / discover / raw),tests/deepseek-session-detail.test.mjs(ADR-0007 conformance: parse ->assembleSessionDetail-> persist round-trip), plus updated registry and schema-doc assertions.DSH_HOMEso CLI tests resolve the deepseek root against the temp HOME (the deepseek provider prefers$DSH_HOMEover~/.dsh).Design notes
inactivevisibility handling: DSH compaction summarizes history but never supersedes branches (no tree semantics), so all messages stayvisible, consistent with claude/codex.tool/callrecord to disk before the tool body runs (session-checkpoint-policy), so a CLI invocation's nonce record is indexed before the resolver runs. Verified end-to-end (overview().current.session_idresolves to the invoking DSH session in a live environment).Verification
npm run typecheck— clean.npm test— 473/473 pass.~/.dsh/sessionsartifact (zstd), searched, and confirmed the live DSH session is recognized as the invoking session via the nonce path.