Skip to content

Read DSH session format v4 written by dsh 0.2.0-rc.2 - #1612

Merged
iamtoruk merged 3 commits into
getagentseal:mainfrom
ozymandiashh:fix/1584-dsh-session-v4
Oct 5, 2026
Merged

iamtoruk merged 3 commits into
getagentseal:mainfrom
ozymandiashh:fix/1584-dsh-session-v4

Conversation

@ozymandiashh

Copy link
Copy Markdown
Collaborator

Summary

Fixes #1584.

@deepseek-ai/dsh 0.2.0-rc.2 writes session.v4.jsonl.zstd, so discovery skipped every DSH session with skipping DSH sessions written in session format version 4; upgrade codeburn and DeepSeek Harness contributed no usage anywhere.

This admits format v4 after the semantic reader update the docs prescribe for format bumps, not by relaxing the check:

  • Verified the reader's whole consumption surface against DSH's official sessionFormatCatalog (recovery: 'strict', validation: 'current', @deepseek-ai/dsh-session-format-catalog@0.2.0-rc.2): dense seq, usage at assistant/message's data.usage (which gains an informational totalTokens sum this parser ignores) or its embedded stream, the tagged session/end-seed inheritance rule, and llm/retry-started attempt slots are all unchanged in v4. The restore of the fixtures and of a real 0.2.0-rc.2 log both pass strict/current validation.
  • What v4 does change — tool-result messages lifted to role tool, unknown tags namespaced plugin:<name>, surfaceOp append/replace metadata, new header fields (agentPreset, origin), untagged session/end-seed markers that unseeded sessions now also write — is either ignored by the reader or already handled by it (the seeded/unseeded consistency checks key on the inherited tag, which v4 keeps as the only inheritance marker).
  • Adds v4.jsonl / v4-retry.jsonl fixtures with the same buckets as v0-v3 (uncached input 100, output 20, cache read 30, write 5) and extends the per-version parse tests (totals, retry accounting, embedded-stream preference, tagged inherited-prefix exclusion) to v4. The session.v4-as-unknown-version discovery test moves to v5.
  • Bumps PROVIDER_PARSE_VERSIONS.dsh so cached skip-era sessions recompute.

Testing

  • npx vitest run tests/providers/dsh.test.ts — 86 passed (including the new v4 variants).
  • Full suite passes (three unrelated CLI tests flake on timeouts under full-suite load here and pass in isolation).
  • Real 0.2.0-rc.2 log (~/.dsh/sessions, one session, 119 events):
$ npx tsx src/cli.ts doctor --provider dsh --json
  "provider": "dsh", "status": "ok", "candidatesFound": 1,
  "sampled": 1, "parsedOk": 1, "parseFailed": 0, "verdict": "OK (1 session)"

$ npx tsx src/cli.ts overview --provider dsh
  Tokens  123,002   Calls  12   Cache hit  90.1%
  Input 11,783 · Output 3,699 · Cache read 107,520

The parsed totals match the official catalog artifact for the same log exactly (sum of its 12 assistant/message usage records).

dsh 0.2.0-rc.2 stamps every session log v4, so discovery skipped each one
and DeepSeek Harness contributed no usage anywhere (getagentseal#1584).

Admitting v4 only after verifying the reader's whole consumption surface
against DSH's official sessionFormatCatalog (recovery: 'strict',
validation: 'current', @deepseek-ai/dsh-session-format-catalog@0.2.0-rc.2),
per the semantic-update rule docs/providers/dsh.md prescribes for format
bumps: dense seq, usage at assistant/message data.usage (plus a new
informational totalTokens sum) or the embedded stream, tagged end-seed
inheritance, and llm/retry-started attempt slots are all unchanged. What
v4 does change (tool-result role lift, plugin: tag namespacing, surfaceOp
append/replace metadata, new header fields, untagged end-seed markers in
unseeded sessions) is ignored or already handled.

Adds catalog-validated v4 fixtures (same buckets as v0-v3 plus the
informational totalTokens) and extends the per-version parse tests to v4.
Bumps the dsh parse version so cached skip-era sessions recompute.

Verified end to end against a real 0.2.0-rc.2 log: doctor reports the
session readable, and the parsed totals (12 calls, input 11783, output
3699, cache read 107520) match the official catalog artifact exactly.
@ozymandiashh
ozymandiashh requested a review from iamtoruk as a code owner October 3, 2026 22:49
@ozymandiashh ozymandiashh added bug Something isn't working area: cli The codeburn CLI and its core parsing/reporting engine area: docs README and docs/ content provider: deepseek harness DeepSeek Harness provider labels Oct 4, 2026
@iamtoruk
iamtoruk merged commit 78d9cea into getagentseal:main Oct 5, 2026
26 of 27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli The codeburn CLI and its core parsing/reporting engine area: docs README and docs/ content bug Something isn't working provider: deepseek harness DeepSeek Harness provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dsh: support session format v4 (DSH 0.2.0-rc.2 writes v4; every session is skipped)

2 participants