codeburn/tests/fixtures
iamtoruk 4fa16a2293 fix(dsh): correct usage attribution against the real session format
Reviewed src/providers/dsh.ts against deepseek-harness @ 99f6f02f and fixed
what the format says but the parser did not:

- A forked session's log replays its parent's events verbatim, and codeburn
  parses the parent's own log as its own session, so every inherited call was
  billed twice. The header's parentSession + seedLength mark that prefix;
  events with seq < seedLength are now skipped.
- The model now comes from the reporting assistant/message's own
  message.source, which is what actually served the step. request/header only
  describes the request DSH was about to make, and is the fallback.
- user/message also carries agent-injected context (runtime snapshots, skill
  bodies) under source.kind 'plugin'; only a typed prompt becomes the preview,
  and it is bounded to 500 chars like every other provider rather than holding
  a whole injected system prompt per turn.
- A log stamped with a session format version other than 0 is skipped with a
  notice. The format is pinned at 0 upstream with no compatibility implied, so
  reading a bumped format under today's assumptions would report confident
  wrong numbers.
- Timestamps go through the seconds-vs-milliseconds guard and fall back to the
  header createdAt, so a call can no longer carry an empty timestamp and land
  in the undated cache shard.
- The compressed read buffers the whole log to scan its frames, so it now takes
  the same oversize guard readSessionFile applies to the uncompressed variant.
- The zstd-unavailable notice fired once per session log; each distinct notice
  is now emitted once.
- Emit workingDirectory beside projectPath, as codex does.

Tests add the upstream examples/acp-agent snapshot as a fixture, covering the
real record shapes: packed reasoning-chunks/tool-call-chunks storage rows, a
plugin-injected user/message beside the typed one, and both the streamed usage
chunk and the final assistant/message usage for the same step. Plus the same
snapshot re-encoded as multi-frame zstd with a torn tail (identical output), a
forked session, an unsupported format version, and unparsable lines.
2026-08-17 10:59:52 -07:00
..
antigravity-cli-current fix(antigravity): read current agy antigravity-cli on-disk layout (#541) 2026-06-22 01:08:44 +02:00
cursor-agent/workspace-less/projects/agent-transcripts/1031d227-0c67-4e17-8954-0b6e2b3322f0 fix(cursor-agent): ingest workspace-less CLI transcript layout (#542) 2026-06-22 00:55:01 +02:00
dsh fix(dsh): correct usage attribution against the real session format 2026-08-17 10:59:52 -07:00
open-design/namespaces/release-stable/data/runs feat(providers): add open-design provider for per-model usage tracking (#559) 2026-06-28 19:17:23 +02:00
security test(security): add failing test for HIGH-1 prototype pollution 2026-04-17 08:32:18 +02:00
cache-refresh-corrupt-owner.ts fix(cache): recover a corrupt session-refresh lock instead of freezing ingestion 2026-07-30 13:06:25 +05:30
cache-refresh-slow-owner.ts fix(cache): recover a corrupt session-refresh lock instead of freezing ingestion 2026-07-30 13:06:25 +05:30
cache-refresh-worker.ts perf(cache): shard the session cache per provider 2026-08-16 19:03:12 -07:00
mock-discovery-register.mjs fix(cli): surface mDNS scan errors, robust spend-flow rollup + date label, harden tests 2026-07-10 16:20:41 -07:00
mock-idp.ts fix(sync): address attribution review — cwd-fallback egress, Windows paths, PR-link validation 2026-08-02 12:29:18 +00:00
session-cache-io.ts perf(cache): shard the session cache per provider 2026-08-16 19:03:12 -07:00