feat(desktop): DSH Electron desktop shell — harness internals visualized

Minimal Electron shell over the DSH JSON-RPC runtime — a first-look at
what a ChatGPT.app-style host on top of the DeepSeek Harness looks
like, with the harness's normally-invisible internals (trace timeline,
context surface, subagent tree, compaction, plugin registry, rubrics)
brought forward as first-class UI surfaces so plugin authors and
researchers can see what the agent is actually doing.

Runs against three keyless-to-live profiles (stdio-echo works on
master out of the box; daemon-echo / daemon-vibe-echo activate once
the daemon-demo lands; stdio-deepseek and daemon-vibe hit the real
DeepSeek API when you supply a key). HARNESS_DEV auto-resolves to the
in-repo runtime when this shell ships under examples/desktop/, so a
fresh clone launches without config; env DSH_DEV_ROOT overrides for
custom layouts, and a sibling deepseek-harness-dev/ checkout is the
original dev workflow.

Cold-clone gate (P0 fixes for first-time-clone usability):
- HARNESS_DEV: 3-candidate resolver (env → walk-up in-repo marker →
  sibling), unit-tested via mock fs so ordering is locked without
  needing either real layout on disk.
- config yml leaves rewritten at assemble time so the sibling-clone
  paths (../../deepseek-harness-dev/examples/echo-agent/…) become
  the in-repo paths (../../echo-agent/…) in the released tree —
  source yml stays usable for local dev, released tree ships a
  working shape.
- pnpm-workspace.yaml allowBuilds.electron = true (was placeholder).
- missing-key card in stdio-deepseek offers a one-click switch to
  stdio-echo (the keyless profile that works on master) rather than
  daemon-echo (blocked on the not-yet-shipped daemon-demo).
- assemble-oss-release.sh rewrites the source-side breadcrumb name
  'dsh-desktop-demo' → 'dsh-desktop' for the released package.json.

FOUC guard on the onboarding gate (41fc5df carried) keeps the
first-launch splash from flashing before the runtime probe finishes.

Test suite (1634 tests in source, 3990 in the runtime repo) covers
resolver ordering, renderer classifiers, trace timeline shape,
compaction diff rendering, rubric parity, and the missing-key
onboarding paths.
This commit is contained in:
ZiyaZhang
2026-07-18 12:59:34 -07:00
parent 67053d1cf6
commit e8f5c0b51b
378 changed files with 104431 additions and 0 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,357 @@
[
{
"type": "user/message",
"time": 1721300000050,
"data": {
"content": [
{
"type": "text",
"text": "Read the top-of-file comment in src/lib/main.ts and summarise it."
}
]
},
"seq": 401
},
{
"type": "step/start",
"time": 1721300000100,
"data": {
"turn": 3,
"step": 0
},
"seq": 402
},
{
"type": "request/header",
"time": 1721300000150,
"data": {
"header": {
"model": "deepseek-chat",
"system": "You are DeepSeek Harness, a research-oriented coding agent built on the microkernel + plugin runtime described in the Harness team docs. Follow the tool schemas verbatim; never invent tools. When code blocks appear, wrap them in fenced blocks with a language tag. Refuse to answer questions unrelated to the current repository unless the user explicitly waives that constraint via /off-topic. Cite line numbers for any file-based claim, and prefer to read before writing.",
"tools": [
{
"name": "read",
"description": "Read a file from the workspace. Returns raw bytes as UTF-8 text unless the extension marks it binary; truncated to 65536 bytes with a `[…truncated]` marker.",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "Workspace-relative or absolute path"
}
},
"required": [
"path"
]
}
},
{
"name": "edit",
"description": "Edit a file in place by exact string replacement. Fails if `old` occurs zero or more than one times; caller must widen the context.",
"parameters": {
"type": "object",
"properties": {
"path": {
"type": "string"
},
"old": {
"type": "string"
},
"new": {
"type": "string"
}
},
"required": [
"path",
"old",
"new"
]
}
},
{
"name": "bash",
"description": "Run a shell command in the workspace root; stdout+stderr returned interleaved.",
"parameters": {
"type": "object",
"properties": {
"cmd": {
"type": "string"
},
"timeoutMs": {
"type": "number"
}
},
"required": [
"cmd"
]
}
}
],
"config": {
"temperature": 0.4,
"topP": 0.9,
"topK": 40,
"maxTokens": 4096,
"presencePenalty": 0.0,
"frequencyPenalty": 0.0,
"stopSequences": [
"</end>"
],
"seed": null
},
"messagePrefix": [
{
"role": "user",
"content": "Read the top-of-file comment in src/lib/main.ts and summarise it."
}
]
},
"reason": "step-start"
},
"seq": 403
},
{
"type": "hook/before-tool-call",
"time": 1721300000200,
"data": {
"hookName": "guard-tool-call",
"allowed": true
},
"seq": 404
},
{
"type": "assistant/chunk",
"time": 1721300000205,
"data": {
"chunk": {
"type": "text-delta",
"text": "I'll"
}
},
"seq": 405
},
{
"type": "assistant/chunk",
"time": 1721300000210,
"data": {
"chunk": {
"type": "text-delta",
"text": " read"
}
},
"seq": 406
},
{
"type": "assistant/chunk",
"time": 1721300000215,
"data": {
"chunk": {
"type": "text-delta",
"text": " the"
}
},
"seq": 407
},
{
"type": "assistant/chunk",
"time": 1721300000220,
"data": {
"chunk": {
"type": "text-delta",
"text": " file"
}
},
"seq": 408
},
{
"type": "assistant/chunk",
"time": 1721300000225,
"data": {
"chunk": {
"type": "text-delta",
"text": " and then"
}
},
"seq": 409
},
{
"type": "assistant/chunk",
"time": 1721300000230,
"data": {
"chunk": {
"type": "text-delta",
"text": " summarise"
}
},
"seq": 410
},
{
"type": "assistant/chunk",
"time": 1721300000235,
"data": {
"chunk": {
"type": "text-delta",
"text": " the top"
}
},
"seq": 411
},
{
"type": "assistant/chunk",
"time": 1721300000240,
"data": {
"chunk": {
"type": "text-delta",
"text": " comment"
}
},
"seq": 412
},
{
"type": "assistant/chunk",
"time": 1721300000245,
"data": {
"chunk": {
"type": "text-delta",
"text": "."
}
},
"seq": 413
},
{
"type": "tool/call",
"time": 1721300000295,
"data": {
"callId": "call_read_main_1",
"name": "read",
"arguments": "{\"path\": \"src/lib/main.ts\"}"
},
"seq": 414
},
{
"type": "tool/result",
"time": 1721300000345,
"data": {
"callId": "call_read_main_1",
"content": [
{
"type": "text",
"text": "// main.ts — cordis root, wires transports+session+agent-loop+plugins.\n// Entry point for the DeepSeek Harness runtime (…truncated 42 lines).\n"
}
],
"isError": false,
"meta": {
"card": "generic",
"durationMs": 88
}
},
"seq": 415
},
{
"type": "assistant/message",
"time": 1721300000395,
"data": {
"content": [
{
"type": "text",
"text": "The top comment says main.ts is the cordis root — it wires transports, session, agent-loop, and plugins together, and is the entry point for the DeepSeek Harness runtime."
}
],
"usage": {
"inputTokens": 842,
"outputTokens": 126,
"cacheReadTokens": 3120,
"cacheWriteTokens": 48,
"reasoningTokens": 0
}
},
"seq": 416
},
{
"type": "step/end",
"time": 1721300000445,
"data": {
"turn": 3,
"step": 0
},
"seq": 417
},
{
"type": "step/start",
"time": 1721300000495,
"data": {
"turn": 3,
"step": 1
},
"seq": 418
},
{
"type": "request/header-delta",
"time": 1721300000545,
"data": {
"delta": {
"messagePrefix": {
"append": [
{
"role": "assistant",
"content": "The top comment says main.ts is the cordis root — it wires transports, session, agent-loop, and plugins together, and is the entry point for the DeepSeek Harness runtime."
}
]
},
"config": {
"temperature": 0.2
}
},
"reason": "post-tool"
},
"seq": 419
},
{
"type": "assistant/chunk",
"time": 1721300000550,
"data": {
"chunk": {
"type": "text-delta",
"text": "Note: it is also the plugin"
}
},
"seq": 420
},
{
"type": "assistant/chunk",
"time": 1721300000555,
"data": {
"chunk": {
"type": "text-delta",
"text": " ecosystem's injection point."
}
},
"seq": 421
},
{
"type": "assistant/message",
"time": 1721300000605,
"data": {
"content": [
{
"type": "text",
"text": "Note: it is also the plugin ecosystem's injection point."
}
],
"usage": {
"inputTokens": 112,
"outputTokens": 22
}
},
"seq": 422
},
{
"type": "step/end",
"time": 1721300000655,
"data": {
"turn": 3,
"step": 1
},
"seq": 423
}
]

View File

@@ -0,0 +1,17 @@
[
{ "type": "turn/start", "seq": 100, "time": 1721116800000, "data": { "turn": 3, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "user/message", "seq": 101, "time": 1721116800001, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Add English docstrings for every entry in SessionEventMap in packages/core/session/src/types.ts" }], "source": { "kind": "user" } } },
{ "type": "step/start", "seq": 102, "time": 1721116800100, "data": { "turn": 3, "step": 0 } },
{ "type": "request/header", "seq": 103, "time": 1721116800101, "data": { "header": { "model": "deepseek-chat", "system": "…", "tools": [], "config": { "temperature": 0 }, "messagePrefix": [] }, "reason": "step-start" } },
{ "type": "assistant/chunk", "seq": 104, "time": 1721116800500, "data": { "turn": 3, "step": 0, "chunk": { "type": "text-delta", "text": "Reading the file first." } } },
{ "type": "assistant/message", "seq": 105, "time": 1721116800800, "surfaceOp": "append", "data": { "turn": 3, "step": 0, "content": [{ "type": "text", "text": "Reading the file first." }, { "type": "tool_use", "id": "call_read_1", "name": "read", "input": { "path": "packages/core/session/src/types.ts" } }], "usage": { "input": 512, "output": 48 } } },
{ "type": "tool/call", "seq": 106, "time": 1721116800801, "data": { "turn": 3, "step": 0, "callId": "call_read_1", "name": "read", "arguments": "{\"path\":\"packages/core/session/src/types.ts\"}" } },
{ "type": "tool/result", "seq": 107, "time": 1721116801200, "surfaceOp": "append", "data": { "turn": 3, "step": 0, "callId": "call_read_1", "content": [{ "type": "text", "text": "…380 lines of content…" }], "isError": false, "meta": { "card": "generic" } } },
{ "type": "step/end", "seq": 108, "time": 1721116801250, "data": { "turn": 3, "step": 0 } },
{ "type": "step/start", "seq": 109, "time": 1721116801260, "data": { "turn": 3, "step": 1 } },
{ "type": "assistant/message", "seq": 110, "time": 1721116803000, "surfaceOp": "append", "data": { "turn": 3, "step": 1, "content": [{ "type": "text", "text": "Docstrings added — writing the file back." }, { "type": "tool_use", "id": "call_edit_1", "name": "edit", "input": { "path": "packages/core/session/src/types.ts" } }], "usage": { "input": 1024, "output": 320 } } },
{ "type": "tool/call", "seq": 111, "time": 1721116803001, "data": { "turn": 3, "step": 1, "callId": "call_edit_1", "name": "edit", "arguments": "{\"path\":\"packages/core/session/src/types.ts\",\"old\":\"…\",\"new\":\"…\"}" } },
{ "type": "tool/result", "seq": 112, "time": 1721116803400, "surfaceOp": "append", "data": { "turn": 3, "step": 1, "callId": "call_edit_1", "content": [{ "type": "text", "text": "edited 32 hunks" }], "isError": false, "meta": { "card": "diff", "durationMs": 399, "files": [{ "path": "packages/core/session/src/types.ts", "hunks": 32 }] } } },
{ "type": "step/end", "seq": 113, "time": 1721116803410, "data": { "turn": 3, "step": 1 } },
{ "type": "turn/end", "seq": 114, "time": 1721116803411, "data": { "turn": 3, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,7 @@
[
{ "type": "turn/start", "seq": 1, "time": 1721116000000, "data": { "turn": 0, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "context/message", "seq": 2, "time": 1721116000010, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "# CLAUDE.md\n\nThis project is the DeepSeek Harness SDK, a Cordis-based plugin-driven agent framework. Every capability is a plugin.\n\n## Commands\n- pnpm run test\n- pnpm run typecheck\n\n(truncated)" }], "source": { "kind": "plugin", "plugin": "hooks-claude" } } },
{ "type": "context/message", "seq": 3, "time": 1721116000012, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "# AGENTS.md — Harness Packages\n\nEach npm package is named @deepseek-ai/dsh-<name>; vendored packages keep the upstream name and set private: true.\n\n(truncated)" }], "source": { "kind": "plugin", "plugin": "hooks-claude" } } },
{ "type": "user/message", "seq": 4, "time": 1721116000500, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Show me the core types in packages/core/session" }], "source": { "kind": "user" } } },
{ "type": "turn/end", "seq": 5, "time": 1721116005000, "data": { "turn": 0, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,10 @@
[
{ "type": "turn/start", "seq": 200, "time": 1721117000000, "data": { "turn": 5, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "user/message", "seq": 201, "time": 1721117000010, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Run pnpm run test:coverage" }], "source": { "kind": "user" } } },
{ "type": "step/start", "seq": 202, "time": 1721117000100, "data": { "turn": 5, "step": 0 } },
{ "type": "tool/call", "seq": 203, "time": 1721117000500, "data": { "turn": 5, "step": 0, "callId": "call_bash_1", "name": "bash", "arguments": "{\"command\":\"pnpm run test:coverage\"}" } },
{ "type": "context/message", "seq": 204, "time": 1721117000600, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "You are about to run a long-lived bash command. Prefer non-interactive flags; use `pnpm --silent` for less noise." }], "source": { "kind": "plugin", "plugin": "tool-bash" } } },
{ "type": "tool/result", "seq": 205, "time": 1721117030000, "surfaceOp": "append", "data": { "turn": 5, "step": 0, "callId": "call_bash_1", "content": [{ "type": "text", "text": "…coverage output…" }], "isError": false, "meta": { "card": "terminal", "durationMs": 29500 } } },
{ "type": "step/end", "seq": 206, "time": 1721117030100, "data": { "turn": 5, "step": 0 } },
{ "type": "turn/end", "seq": 207, "time": 1721117030110, "data": { "turn": 5, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,5 @@
[
{ "type": "turn/start", "seq": 300, "time": 1721117300000, "data": { "turn": 6, "trigger": { "kind": "injection", "source": { "kind": "plugin", "plugin": "time-context" } } } },
{ "type": "context/message", "seq": 301, "time": 1721117300001, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Current time: 2026-07-16T04:35:00Z (Asia/Shanghai +08:00). The user's last message was 2 minutes ago." }], "source": { "kind": "plugin", "plugin": "time-context" } } },
{ "type": "turn/end", "seq": 302, "time": 1721117300010, "data": { "turn": 6, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,9 @@
[
{ "type": "turn/start", "seq": 400, "time": 1721117400000, "data": { "turn": 7, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "step/start", "seq": 401, "time": 1721117400100, "data": { "turn": 7, "step": 3 } },
{ "type": "tool/call", "seq": 402, "time": 1721117400200, "data": { "turn": 7, "step": 3, "callId": "call_read_3", "name": "read", "arguments": "{\"path\":\"/etc/hosts\"}" } },
{ "type": "tool/result", "seq": 403, "time": 1721117400300, "surfaceOp": "append", "data": { "turn": 7, "step": 3, "callId": "call_read_3", "content": [{ "type": "text", "text": "…" }], "isError": false, "meta": { "card": "generic" } } },
{ "type": "step/end", "seq": 404, "time": 1721117400310, "data": { "turn": 7, "step": 3 } },
{ "type": "context/message", "seq": 405, "time": 1721117400320, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "You've called `read /etc/hosts` 3 times in this turn with identical arguments. This looks like a loop — consider a different approach or ask the user for clarification." }], "source": { "kind": "plugin", "plugin": "repeat-tool-guard" } } },
{ "type": "turn/end", "seq": 406, "time": 1721117400400, "data": { "turn": 7, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,6 @@
[
{ "type": "compact/start", "seq": 500, "time": 1721117500000, "data": { "turn": 8 } },
{ "type": "compact/summary", "seq": 501, "time": 1721117501500, "data": { "summary": [{ "type": "text", "text": "Earlier in this session (seqs 1–120): the user asked to add EN docstrings for SessionEventMap; assistant read types.ts, edited 32 comment blocks, and ran typecheck+lint gates green. Follow-ups: repeat this pattern for adjacent type files." }], "shadowedRange": { "start": 1, "end": 120 }, "shadowedSeqs": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120], "shadowedTokenCount": 14320, "model": "deepseek-chat", "maxTokens": 512 } },
{ "type": "compact/end", "seq": 502, "time": 1721117501600, "data": { "turn": 8 } },
{ "type": "user/message", "seq": 503, "time": 1721117501700, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Earlier in this session (seqs 1–120): the user asked to add EN docstrings for SessionEventMap; assistant read types.ts, edited 32 comment blocks, and ran typecheck+lint gates green. Follow-ups: repeat this pattern for adjacent type files." }], "source": { "kind": "plugin", "plugin": "compact" } } }
]

View File

@@ -0,0 +1,6 @@
[
{ "type": "turn/start", "seq": 600, "time": 1721117600000, "data": { "turn": 9, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "user/message", "seq": 601, "time": 1721117600010, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Stop asking me every time — auto-allow pnpm commands from now on." }], "source": { "kind": "user" } } },
{ "type": "context/message", "seq": 602, "time": 1721117600020, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Approval policy updated: pnpm subcommands now bypass user confirmation for this session. Previous policy: ask (always). New policy: allow-when-matches(/^pnpm(\\s|$)/)." }], "source": { "kind": "plugin", "plugin": "user-approval" } } },
{ "type": "turn/end", "seq": 603, "time": 1721117600030, "data": { "turn": 9, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,5 @@
[
{ "type": "turn/start", "seq": 700, "time": 1721117700000, "data": { "turn": 10, "trigger": { "kind": "injection", "source": { "kind": "plugin", "plugin": "acme-notifier" } } } },
{ "type": "context/message", "seq": 701, "time": 1721117700001, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "New GitHub notification: PR #457 got a review request from @reviewer-bot. Comment: 'please address the 4 blocking issues'." }], "source": { "kind": "plugin", "plugin": "acme-notifier" } } },
{ "type": "turn/end", "seq": 702, "time": 1721117700010, "data": { "turn": 10, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,6 @@
[
{ "type": "turn/start", "seq": 800, "time": 1721117800000, "data": { "turn": 11, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "context/message", "seq": 801, "time": 1721117800010, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "# skill: refactor-fs-writes\n\nWhen updating any FS-touching code path, always: (1) use `fs.promises` not sync APIs; (2) wrap in a session Effect for teardown; (3) add a test that observes the effect via `ctx.on('session/event', …)`." }], "source": { "kind": "user" } } },
{ "type": "user/message", "seq": 802, "time": 1721117800020, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Refactor the write path in packages/fs" }], "source": { "kind": "user" } } },
{ "type": "turn/end", "seq": 803, "time": 1721117800030, "data": { "turn": 11, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,170 @@
[
{
"_mock": true,
"_mockReason": "subagent structured JSON return: the wire's subagent.finished.lastAssistantMessage is currently ContentBlock[], with no dedicated structured-return slot. The demo borrows code_block(lang=json) as the agreed structured-return discriminator.",
"type": "_notification",
"method": "subagent.started",
"params": {
"parentSessionId": "root-abc",
"childSessionId": "sub-def"
}
},
{
"type": "turn/start",
"seq": 1,
"time": 1721118000000,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"trigger": {
"kind": "message",
"source": {
"kind": "plugin",
"plugin": "subagent-delegate"
}
}
}
},
{
"type": "user/message",
"seq": 2,
"time": 1721118000010,
"_sessionId": "sub-def",
"surfaceOp": "append",
"data": {
"content": [
{
"type": "text",
"text": "Find every SurfaceEventType reference in packages/core/session and return a file:line list."
}
],
"source": {
"kind": "plugin",
"plugin": "subagent-delegate"
}
}
},
{
"type": "step/start",
"seq": 3,
"time": 1721118000100,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"step": 0
}
},
{
"type": "tool/call",
"seq": 4,
"time": 1721118000200,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"step": 0,
"callId": "call_grep_1",
"name": "grep",
"arguments": "{\"pattern\":\"SurfaceEventType\",\"path\":\"packages/core/session\"}"
}
},
{
"type": "tool/result",
"seq": 5,
"time": 1721118000500,
"_sessionId": "sub-def",
"surfaceOp": "append",
"data": {
"turn": 0,
"step": 0,
"callId": "call_grep_1",
"content": [
{
"type": "text",
"text": "packages/core/session/src/types.ts:294\npackages/core/session/src/types.ts:298\npackages/core/session/src/index.ts:353"
}
],
"isError": false,
"meta": {
"card": "generic"
}
}
},
{
"type": "step/end",
"seq": 6,
"time": 1721118000510,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"step": 0
}
},
{
"type": "step/start",
"seq": 7,
"time": 1721118000520,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"step": 1
}
},
{
"type": "assistant/message",
"seq": 8,
"time": 1721118001500,
"_sessionId": "sub-def",
"surfaceOp": "append",
"data": {
"turn": 0,
"step": 1,
"content": [
{
"type": "text",
"text": "```json\n{\n \"references\": [\n { \"file\": \"packages/core/session/src/types.ts\", \"line\": 294 },\n { \"file\": \"packages/core/session/src/types.ts\", \"line\": 298 },\n { \"file\": \"packages/core/session/src/index.ts\", \"line\": 353 }\n ],\n \"total\": 3\n}\n```"
}
]
}
},
{
"type": "step/end",
"seq": 9,
"time": 1721118001510,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"step": 1
}
},
{
"type": "turn/end",
"seq": 10,
"time": 1721118001520,
"_sessionId": "sub-def",
"data": {
"turn": 0,
"reason": {
"kind": "completed"
}
}
},
{
"_mock": true,
"type": "_notification",
"method": "subagent.finished",
"params": {
"provider": "in-process",
"agentId": "sub-def",
"parentSessionId": "root-abc",
"childSessionId": "sub-def",
"status": "ok",
"stopReason": "completed",
"lastAssistantMessage": [
{
"type": "text",
"text": "```json\n{\n \"references\": [\n { \"file\": \"packages/core/session/src/types.ts\", \"line\": 294 },\n { \"file\": \"packages/core/session/src/types.ts\", \"line\": 298 },\n { \"file\": \"packages/core/session/src/index.ts\", \"line\": 353 }\n ],\n \"total\": 3\n}\n```"
}
]
}
}
]

View File

@@ -0,0 +1,51 @@
{
"_mock": true,
"_mockReason": "Like 1.6-workflow-seq.json. Branch family: decision fork — step output decides the downstream path.",
"workflow": {
"name": "package-diagnosis",
"kind": "branch",
"steps": [
{
"id": "diagnose",
"name": "run diagnostic",
"status": "done",
"durationMs": 4200,
"output": "leaked-fd"
},
{
"id": "decide",
"name": "decide branch",
"status": "done",
"durationMs": 20,
"chose": "path-B",
"reason": "leaked-fd triggers cleanup path"
},
{
"id": "path-A",
"name": "restart worker",
"status": "skipped"
},
{
"id": "path-B",
"name": "close all fds + restart",
"status": "running",
"durationMs": null,
"output": "1/3 fds closed"
}
]
},
"events": [
{
"type": "tool/call",
"seq": 1300,
"time": 1721119400000,
"data": {
"turn": 16,
"step": 0,
"callId": "call_wf_5",
"name": "workflow",
"arguments": "{\"name\":\"package-diagnosis\",\"kind\":\"branch\"}"
}
}
]
}

View File

@@ -0,0 +1,95 @@
{
"_mock": true,
"_mockReason": "Like 1.6-workflow-seq.json. DAG family: 6 nodes with multiple in- and out-degrees.",
"workflow": {
"name": "release-cut",
"kind": "dag",
"steps": [
{
"id": "checkout",
"name": "checkout master",
"status": "done",
"durationMs": 200,
"in": [],
"out": [
"build",
"docs"
]
},
{
"id": "build",
"name": "pnpm build",
"status": "done",
"durationMs": 12000,
"in": [
"checkout"
],
"out": [
"test-unit",
"test-e2e"
]
},
{
"id": "docs",
"name": "pnpm doc-sync",
"status": "done",
"durationMs": 2100,
"in": [
"checkout"
],
"out": [
"publish"
]
},
{
"id": "test-unit",
"name": "unit tests",
"status": "done",
"durationMs": 8000,
"in": [
"build"
],
"out": [
"publish"
]
},
{
"id": "test-e2e",
"name": "e2e tests",
"status": "running",
"durationMs": null,
"in": [
"build"
],
"out": [
"publish"
]
},
{
"id": "publish",
"name": "npm publish",
"status": "pending",
"in": [
"docs",
"test-unit",
"test-e2e"
],
"out": []
}
]
},
"events": [
{
"type": "tool/call",
"seq": 1100,
"time": 1721119200000,
"data": {
"turn": 14,
"step": 0,
"callId": "call_wf_3",
"name": "workflow",
"arguments": "{\"name\":\"release-cut\",\"kind\":\"dag\"}"
}
}
]
}

View File

@@ -0,0 +1,64 @@
{
"_mock": true,
"_mockReason": "Like 1.6-workflow-seq.json. Fan-out family: one fan-out step spawns 3 parallel subagent branches.",
"workflow": {
"name": "audit-three-packages",
"kind": "fan-out",
"steps": [
{
"id": "root",
"name": "start",
"status": "done",
"durationMs": 10
},
{
"id": "b1",
"name": "audit dsh-fs",
"status": "done",
"durationMs": 4200,
"parent": "root",
"output": "3 findings"
},
{
"id": "b2",
"name": "audit dsh-bash",
"status": "running",
"durationMs": null,
"parent": "root",
"output": "step 2/5"
},
{
"id": "b3",
"name": "audit dsh-web",
"status": "done",
"durationMs": 3100,
"parent": "root",
"output": "0 findings"
},
{
"id": "merge",
"name": "merge findings",
"status": "pending",
"parent": [
"b1",
"b2",
"b3"
]
}
]
},
"events": [
{
"type": "tool/call",
"seq": 1000,
"time": 1721119100000,
"data": {
"turn": 13,
"step": 0,
"callId": "call_wf_2",
"name": "workflow",
"arguments": "{\"name\":\"audit-three-packages\",\"kind\":\"fan-out\"}"
}
}
]
}

View File

@@ -0,0 +1,48 @@
{
"_mock": true,
"_mockReason": "Like 1.6-workflow-seq.json. Iter family: while loop over 3 rounds.",
"workflow": {
"name": "translate-all-comments",
"kind": "iter",
"loop": {
"predicate": "hasMoreFiles(remaining)",
"iterations": [
{
"n": 1,
"item": "packages/core/session/src/types.ts",
"status": "done",
"durationMs": 6200,
"output": "32 blocks translated"
},
{
"n": 2,
"item": "packages/core/agent/src/types.ts",
"status": "done",
"durationMs": 5800,
"output": "18 blocks translated"
},
{
"n": 3,
"item": "packages/core/tools/src/presentation.ts",
"status": "running",
"durationMs": null,
"output": "12/25 blocks"
}
]
}
},
"events": [
{
"type": "tool/call",
"seq": 1200,
"time": 1721119300000,
"data": {
"turn": 15,
"step": 0,
"callId": "call_wf_4",
"name": "workflow",
"arguments": "{\"name\":\"translate-all-comments\",\"kind\":\"iter\"}"
}
}
]
}

View File

@@ -0,0 +1,106 @@
{
"_mock": true,
"_mockReason": "workflow/* Cordis events are not yet on the wire (see the historical note in panels-c-controller.js:198); the wire patch belongs to impl-plugin-wire. This fixture demonstrates the sequential-flow shape (workflow tool call + 5 step-progress events; a local mock event type mock/workflow-step, not a real wire type).",
"workflow": {
"name": "translate-comments",
"kind": "seq",
"steps": [
{
"id": "s1",
"name": "read types.ts",
"status": "done",
"durationMs": 320,
"output": "480 lines"
},
{
"id": "s2",
"name": "extract comment blocks",
"status": "done",
"durationMs": 180,
"output": "32 blocks"
},
{
"id": "s3",
"name": "translate to zh",
"status": "running",
"durationMs": null,
"output": "in progress: 24/32"
},
{
"id": "s4",
"name": "write back edits",
"status": "pending",
"durationMs": null,
"output": null
},
{
"id": "s5",
"name": "run typecheck",
"status": "pending",
"durationMs": null,
"output": null
}
]
},
"events": [
{
"type": "tool/call",
"seq": 900,
"time": 1721119000000,
"data": {
"turn": 12,
"step": 0,
"callId": "call_wf_1",
"name": "workflow",
"arguments": "{\"name\":\"translate-comments\",\"kind\":\"seq\"}"
}
},
{
"type": "mock/workflow-step",
"seq": 901,
"time": 1721119000100,
"data": {
"stepId": "s1",
"status": "started"
}
},
{
"type": "mock/workflow-step",
"seq": 902,
"time": 1721119000420,
"data": {
"stepId": "s1",
"status": "done",
"output": "480 lines"
}
},
{
"type": "mock/workflow-step",
"seq": 903,
"time": 1721119000440,
"data": {
"stepId": "s2",
"status": "started"
}
},
{
"type": "mock/workflow-step",
"seq": 904,
"time": 1721119000620,
"data": {
"stepId": "s2",
"status": "done",
"output": "32 blocks"
}
},
{
"type": "mock/workflow-step",
"seq": 905,
"time": 1721119000640,
"data": {
"stepId": "s3",
"status": "started"
}
}
]
}

View File

@@ -0,0 +1,87 @@
[
{
"type": "assistant/message",
"seq": 148,
"time": 1721119500000,
"surfaceOp": "append",
"data": {
"turn": 17,
"step": 8,
"content": [
{
"type": "text",
"text": "…last assistant message, turn ends here…"
}
]
}
},
{
"type": "turn/end",
"seq": 149,
"time": 1721119500010,
"data": {
"turn": 17,
"reason": {
"kind": "completed"
}
}
},
{
"type": "compact/start",
"seq": 150,
"time": 1721119510000,
"data": {
"turn": 17
}
},
{
"type": "compact/summary",
"seq": 151,
"time": 1721119512500,
"data": {
"summary": [
{
"type": "text",
"text": "Session so far (seqs 1–149, turns 0–17): user asked to audit and translate SessionEventMap comments across 3 core packages; assistant used workflow(iter) to loop, translated 32+18+25 blocks total, ran typecheck+lint+coverage gates all green; found 0 regressions. Next likely: extend to bash/fs packages or land as a PR."
}
],
"shadowedRange": {
"start": 1,
"end": 149
},
"shadowedSeqs": [],
"shadowedTokenCount": 32180,
"model": "deepseek-chat",
"maxTokens": 512
}
},
{
"type": "compact/end",
"seq": 152,
"time": 1721119512600,
"data": {
"turn": 17
}
},
{
"type": "user/message",
"seq": 153,
"time": 1721119512700,
"surfaceOp": "append",
"data": {
"content": [
{
"type": "text",
"text": "Session so far (seqs 1–149, turns 0–17): user asked to audit and translate SessionEventMap comments across 3 core packages; assistant used workflow(iter) to loop, translated 32+18+25 blocks total, ran typecheck+lint+coverage gates all green; found 0 regressions. Next likely: extend to bash/fs packages or land as a PR."
}
],
"source": {
"kind": "plugin",
"plugin": "compact"
}
}
},
{
"_note": "shadowedSeqs is kept as an empty array in the sample to keep the file small; on a real machine it would be [1, 2, ..., 149] or a subset. The frontend can render shadowedRange from range boundaries alone to display \"149 events compressed\"."
}
]

View File

@@ -0,0 +1,161 @@
[
{
"_mock": true,
"_mockReason": "#162 rec 22-bis: one full turn showing the pi rhythm — reasoning → text → tool-row → tool-result → reasoning → text — all as sealed acts (replay path, no deltas). Used for shot 24 (turn container). Seqs increment monotonically inside the turn."
},
{
"type": "user/message",
"time": 1721400000050,
"seq": 501,
"data": {
"content": [
{ "type": "text", "text": "Add a comment header to src/lib/main.ts explaining its role, then verify the file still parses." }
]
}
},
{
"type": "step/start",
"time": 1721400000100,
"seq": 502,
"data": { "turn": 5, "step": 0 }
},
{
"type": "request/header",
"time": 1721400000150,
"seq": 503,
"data": {
"header": {
"model": "deepseek-chat",
"system": "You are DeepSeek Harness — a research coding agent.",
"tools": [
{ "name": "read", "description": "Read a file." },
{ "name": "edit", "description": "Edit a file by string replacement." },
{ "name": "bash", "description": "Run a shell command." }
],
"config": { "temperature": 0.3, "maxTokens": 4096 }
},
"reason": "step-start"
}
},
{
"type": "assistant/message",
"time": 1721400000400,
"seq": 504,
"data": {
"content": [
{ "type": "reasoning", "text": "I should first inspect the current top of the file so my header sits in the right position, then edit, then check parsing with a syntax-only run." },
{ "type": "text", "text": "I'll read the file, add the header, and verify it parses." }
],
"usage": { "inputTokens": 620, "outputTokens": 84, "reasoningTokens": 41 }
}
},
{
"type": "tool/call",
"time": 1721400000450,
"seq": 505,
"data": {
"callId": "call_read_5",
"name": "read",
"arguments": "{\"path\":\"src/lib/main.ts\"}"
}
},
{
"type": "tool/result",
"time": 1721400000520,
"seq": 506,
"data": {
"callId": "call_read_5",
"content": [
{ "type": "text", "text": "import { App } from './app'\nnew App().run()\n" }
],
"isError": false,
"meta": { "card": "generic", "durationMs": 62 }
}
},
{
"type": "tool/call",
"time": 1721400000560,
"seq": 507,
"data": {
"callId": "call_edit_5",
"name": "edit",
"arguments": "{\"path\":\"src/lib/main.ts\",\"old\":\"import { App } from './app'\",\"new\":\"// main.ts — entry point: boots the App composition root.\\nimport { App } from './app'\"}"
}
},
{
"type": "tool/result",
"time": 1721400000610,
"seq": 508,
"data": {
"callId": "call_edit_5",
"content": [ { "type": "text", "text": "edit applied (1 replacement)" } ],
"isError": false,
"meta": { "card": "diff", "durationMs": 44 }
}
},
{
"type": "assistant/message",
"time": 1721400000720,
"seq": 509,
"data": {
"content": [
{ "type": "reasoning", "text": "Now I need a cheap parse check that does not execute the boot chain — node --check on the file is enough." },
{ "type": "text", "text": "Header added. Verifying parse now." }
],
"usage": { "inputTokens": 700, "outputTokens": 60, "reasoningTokens": 28 }
}
},
{
"type": "tool/call",
"time": 1721400000740,
"seq": 510,
"data": {
"callId": "call_bash_5",
"name": "bash",
"arguments": "{\"cmd\":\"node --check src/lib/main.ts\"}"
}
},
{
"type": "tool/result",
"time": 1721400000880,
"seq": 511,
"data": {
"callId": "call_bash_5",
"content": [ { "type": "text", "text": "(no output; exit 0)" } ],
"isError": false,
"meta": { "card": "terminal", "durationMs": 138 }
}
},
{
"type": "assistant/message",
"time": 1721400000940,
"seq": 512,
"data": {
"content": [
{ "type": "text", "text": "Done. Header added, file still parses cleanly." }
],
"usage": {
"inputTokens": 780,
"outputTokens": 34,
"cacheReadTokens": 512,
"reasoningTokens": 12
}
}
},
{
"type": "step/end",
"time": 1721400001000,
"seq": 513,
"data": { "turn": 5, "step": 0 }
},
{
"type": "turn/end",
"time": 1721400001050,
"seq": 514,
"data": {
"turn": 5,
"reason": { "kind": "stop" },
"usage": { "inputTokens": 780, "outputTokens": 178, "cacheReadTokens": 512, "reasoningTokens": 81 }
}
}
]

View File

@@ -0,0 +1,76 @@
[
{
"_mock": true,
"_mockReason": "#162 rec 21 companion fixture (team-lead 2026-07-17 real-audience directive): a real research scenario where an engineer is debugging 'did my API/harness return thinking tokens or not?'. Two consecutive turns, SAME prompt shape, differing only in whether the assistant/message content carries a `reasoning` block (i.e., whether the request/header's request round-tripped a thinking field). Turn A has reasoning present (streamed via reasoning-delta chunks); turn B has no reasoning at all — same tokens output otherwise. Opening the reasoning block on A and finding no block on B gives a one-minute triage: 'the model DID think but the harness dropped it' vs 'the model returned no thinking' becomes visually obvious without diffing raw response bodies. The reasoning-tokens usage field is present on A, absent on B, mirroring the wire signal a responder would look at."
},
{ "type": "user/message", "time": 1721401800050, "seq": 801,
"data": { "content": [ { "type": "text", "text": "Turn A: what does dsh-brand's `pickPreset` fall back to when the preset name is unknown?" } ] } },
{ "type": "step/start", "time": 1721401800100, "seq": 802,
"data": { "turn": 8, "step": 0 } },
{ "type": "request/header", "time": 1721401800150, "seq": 803,
"data": {
"header": {
"model": "deepseek-chat",
"system": "You are a research coding agent.",
"tools": [ { "name": "read", "description": "Read a file." } ],
"config": { "temperature": 0.2, "maxTokens": 4096, "reasoning": { "enabled": true } }
},
"reason": "step-start"
}
},
{ "type": "assistant/chunk", "time": 1721401800200, "seq": 804,
"data": { "chunk": { "type": "reasoning-delta", "text": "The user is asking about pickPreset's unknown-name fallback." } } },
{ "type": "assistant/chunk", "time": 1721401800210, "seq": 805,
"data": { "chunk": { "type": "reasoning-delta", "text": " Looking at the code I remember it defaults to 'default' when the map lookup misses." } } },
{ "type": "assistant/chunk", "time": 1721401800220, "seq": 806,
"data": { "chunk": { "type": "reasoning-delta", "text": " Answering directly since we don't need a tool call to confirm this." } } },
{ "type": "assistant/chunk", "time": 1721401800240, "seq": 807,
"data": { "chunk": { "type": "text-delta", "text": "Falls back to the 'default' preset." } } },
{ "type": "assistant/message", "time": 1721401800300, "seq": 808,
"data": {
"content": [
{ "type": "reasoning", "text": "The user is asking about pickPreset's unknown-name fallback. Looking at the code I remember it defaults to 'default' when the map lookup misses. Answering directly since we don't need a tool call to confirm this." },
{ "type": "text", "text": "Falls back to the 'default' preset." }
],
"usage": { "inputTokens": 380, "outputTokens": 12, "reasoningTokens": 46 }
}
},
{ "type": "step/end", "time": 1721401800400, "seq": 809,
"data": { "turn": 8, "step": 0, "reason": "stop" } },
{ "type": "user/message", "time": 1721401801050, "seq": 810,
"data": { "content": [ { "type": "text", "text": "Turn B (rerun with reasoning disabled): what does dsh-brand's `pickPreset` fall back to when the preset name is unknown?" } ] } },
{ "type": "step/start", "time": 1721401801100, "seq": 811,
"data": { "turn": 9, "step": 0 } },
{ "type": "request/header", "time": 1721401801150, "seq": 812,
"data": {
"header": {
"model": "deepseek-chat",
"system": "You are a research coding agent.",
"tools": [ { "name": "read", "description": "Read a file." } ],
"config": { "temperature": 0.2, "maxTokens": 4096, "reasoning": { "enabled": false } }
},
"reason": "step-start"
}
},
{ "type": "assistant/chunk", "time": 1721401801240, "seq": 813,
"data": { "chunk": { "type": "text-delta", "text": "Falls back to the 'default' preset." } } },
{ "type": "assistant/message", "time": 1721401801300, "seq": 814,
"data": {
"content": [
{ "type": "text", "text": "Falls back to the 'default' preset." }
],
"usage": { "inputTokens": 380, "outputTokens": 12 }
}
},
{ "type": "step/end", "time": 1721401801400, "seq": 815,
"data": { "turn": 9, "step": 0, "reason": "stop" } }
]

View File

@@ -0,0 +1,173 @@
[
{
"_mock": true,
"_mockReason": "#162 rec 21 (reasoning first-class fold block): one turn with TWO reasoning blocks at different positions in the content stream — one before a tool call, one after the tool result. Reasoning is streamed via reasoning-delta chunks; the first block also has a text block ahead of it so the ordering of block indices exercises non-monotone content-block reveal."
},
{
"type": "user/message",
"time": 1721401000050,
"seq": 601,
"data": {
"content": [
{ "type": "text", "text": "Check whether packages/core/session/src/types.ts imports from dsh-brand, and if not, add the import." }
]
}
},
{
"type": "step/start",
"time": 1721401000100,
"seq": 602,
"data": { "turn": 6, "step": 0 }
},
{
"type": "request/header",
"time": 1721401000150,
"seq": 603,
"data": {
"header": {
"model": "deepseek-chat",
"system": "You are a research coding agent.",
"tools": [
{ "name": "read", "description": "Read a file." },
{ "name": "edit", "description": "Edit a file by string replacement." }
],
"config": { "temperature": 0.2, "maxTokens": 4096 }
},
"reason": "step-start"
}
},
{
"type": "assistant/chunk",
"time": 1721401000200,
"seq": 604,
"data": {
"chunk": {
"type": "reasoning-delta",
"text": "The user wants me to inspect the imports at the top of the file, so"
}
}
},
{
"type": "assistant/chunk",
"time": 1721401000210,
"seq": 605,
"data": {
"chunk": {
"type": "reasoning-delta",
"text": " a read call is the cheapest first move. If the import is already present"
}
}
},
{
"type": "assistant/chunk",
"time": 1721401000220,
"seq": 606,
"data": {
"chunk": {
"type": "reasoning-delta",
"text": " I can stop after one tool call, otherwise I edit."
}
}
},
{
"type": "assistant/chunk",
"time": 1721401000240,
"seq": 607,
"data": {
"chunk": { "type": "text-delta", "text": "Reading the file first to check the current imports." }
}
},
{
"type": "tool/call",
"time": 1721401000280,
"seq": 608,
"data": {
"callId": "call_read_6",
"name": "read",
"arguments": "{\"path\":\"packages/core/session/src/types.ts\"}"
}
},
{
"type": "tool/result",
"time": 1721401000360,
"seq": 609,
"data": {
"callId": "call_read_6",
"content": [
{ "type": "text", "text": "import type { SessionEvent } from './events'\nimport type { Branded } from '@deepseek-ai/dsh-brand'\n\nexport type SessionId = Branded<'SessionId', string>\n" }
],
"isError": false,
"meta": { "card": "generic", "durationMs": 74 }
}
},
{
"type": "assistant/chunk",
"time": 1721401000420,
"seq": 610,
"data": {
"chunk": {
"type": "reasoning-delta",
"text": "Good — the Branded import is already there on line 2, so the file is already"
}
}
},
{
"type": "assistant/chunk",
"time": 1721401000430,
"seq": 611,
"data": {
"chunk": {
"type": "reasoning-delta",
"text": " correct. I don't need to edit; I should just report what I found."
}
}
},
{
"type": "assistant/chunk",
"time": 1721401000450,
"seq": 612,
"data": {
"chunk": { "type": "text-delta", "text": "The import is already present at line 2 — no edit needed." }
}
},
{
"type": "assistant/message",
"time": 1721401000500,
"seq": 613,
"data": {
"content": [
{ "type": "text", "text": "Reading the file first to check the current imports." },
{ "type": "reasoning", "text": "The user wants me to inspect the imports at the top of the file, so a read call is the cheapest first move. If the import is already present I can stop after one tool call, otherwise I edit." },
{ "type": "text", "text": "The import is already present at line 2 — no edit needed." },
{ "type": "reasoning", "text": "Good — the Branded import is already there on line 2, so the file is already correct. I don't need to edit; I should just report what I found." }
],
"usage": {
"inputTokens": 520,
"outputTokens": 118,
"cacheReadTokens": 320,
"reasoningTokens": 62
}
}
},
{
"type": "step/end",
"time": 1721401000550,
"seq": 614,
"data": { "turn": 6, "step": 0 }
},
{
"type": "turn/end",
"time": 1721401000600,
"seq": 615,
"data": {
"turn": 6,
"reason": { "kind": "stop" },
"usage": {
"inputTokens": 520,
"outputTokens": 118,
"cacheReadTokens": 320,
"reasoningTokens": 62
}
}
}
]

View File

@@ -0,0 +1,130 @@
[
{
"_mock": true,
"_mockReason": "#162 rec 22 (partial-JSON tool row): assistant/chunk events carrying tool-call-delta pieces that concatenate to a valid write_file arguments JSON. Confirms the pi §2.3 four-frame table (from {} through path partial through path+content partial to sealed). Wire shape follows packages/llm/llm/src/types.ts:116 (StreamChunk union member tool-call-delta { index, id, name?, argumentsDelta }). Second call: run_bash streamed across 3 slices so aggregator tests exercise more than one open row."
},
{
"type": "user/message",
"time": 1721402000050,
"seq": 701,
"data": {
"content": [
{ "type": "text", "text": "Create src/lib/foo.ts exporting a bar() function, then run it via node -e to confirm the export works." }
]
}
},
{
"type": "step/start",
"time": 1721402000100,
"seq": 702,
"data": { "turn": 7, "step": 0 }
},
{
"type": "request/header",
"time": 1721402000150,
"seq": 703,
"data": {
"header": {
"model": "deepseek-chat",
"tools": [
{ "name": "write_file", "description": "Write a file to disk with the given content." },
{ "name": "run_bash", "description": "Run a shell command; returns stdout+stderr." }
]
},
"reason": "step-start"
}
},
{ "type": "assistant/chunk", "time": 1721402000210, "seq": 704,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "name": "write_file", "argumentsDelta": "{\"path\":\"" } } },
{ "type": "assistant/chunk", "time": 1721402000225, "seq": 705,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "argumentsDelta": "src/lib/f" } } },
{ "type": "assistant/chunk", "time": 1721402000240, "seq": 706,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "argumentsDelta": "oo.ts" } } },
{ "type": "assistant/chunk", "time": 1721402000255, "seq": 707,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "argumentsDelta": "\",\"content\":\"expor" } } },
{ "type": "assistant/chunk", "time": 1721402000270, "seq": 708,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "argumentsDelta": "t function bar(){" } } },
{ "type": "assistant/chunk", "time": 1721402000285, "seq": 709,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "argumentsDelta": " return 'bar' " } } },
{ "type": "assistant/chunk", "time": 1721402000300, "seq": 710,
"data": { "chunk": { "type": "tool-call-delta", "index": 0, "id": "call_write_1", "argumentsDelta": "}\"}" } } },
{
"type": "tool/call",
"time": 1721402000330,
"seq": 711,
"data": {
"callId": "call_write_1",
"name": "write_file",
"arguments": "{\"path\":\"src/lib/foo.ts\",\"content\":\"export function bar(){ return 'bar' }\"}"
}
},
{
"type": "tool/result",
"time": 1721402000390,
"seq": 712,
"data": {
"callId": "call_write_1",
"content": [ { "type": "text", "text": "wrote 42 bytes" } ],
"isError": false,
"meta": { "card": "generic", "durationMs": 52 }
}
},
{ "type": "assistant/chunk", "time": 1721402000420, "seq": 713,
"data": { "chunk": { "type": "tool-call-delta", "index": 1, "id": "call_bash_1", "name": "run_bash", "argumentsDelta": "{\"command\":\"node -" } } },
{ "type": "assistant/chunk", "time": 1721402000435, "seq": 714,
"data": { "chunk": { "type": "tool-call-delta", "index": 1, "id": "call_bash_1", "argumentsDelta": "e \\\"console.log(re" } } },
{ "type": "assistant/chunk", "time": 1721402000450, "seq": 715,
"data": { "chunk": { "type": "tool-call-delta", "index": 1, "id": "call_bash_1", "argumentsDelta": "quire('./src/lib/foo').bar())\\\"\"}" } } },
{
"type": "tool/call",
"time": 1721402000480,
"seq": 716,
"data": {
"callId": "call_bash_1",
"name": "run_bash",
"arguments": "{\"command\":\"node -e \\\"console.log(require('./src/lib/foo').bar())\\\"\"}"
}
},
{
"type": "tool/result",
"time": 1721402000640,
"seq": 717,
"data": {
"callId": "call_bash_1",
"content": [ { "type": "text", "text": "bar\n" } ],
"isError": false,
"meta": { "card": "terminal", "durationMs": 158 }
}
},
{
"type": "assistant/message",
"time": 1721402000700,
"seq": 718,
"data": {
"content": [
{ "type": "text", "text": "foo.ts written; node round-trip prints \"bar\" — export works." }
],
"usage": { "inputTokens": 380, "outputTokens": 42, "cacheReadTokens": 220 }
}
},
{
"type": "step/end",
"time": 1721402000740,
"seq": 719,
"data": { "turn": 7, "step": 0 }
},
{
"type": "turn/end",
"time": 1721402000780,
"seq": 720,
"data": {
"turn": 7,
"reason": { "kind": "stop" },
"usage": { "inputTokens": 380, "outputTokens": 42, "cacheReadTokens": 220 }
}
}
]

View File

@@ -0,0 +1,74 @@
[
{
"_mock": true,
"_mockReason": "#162 rec 32 (compact before/after diff tab): compact/summary event carrying 12 shadowed seqs (representing ~3.8k tokens of prior turn content), a ContentBlock[] summary block (~380 tokens), and full strategy metadata so the ratio bar can render (10.0x compression)."
},
{
"type": "assistant/message",
"time": 1721403000050,
"seq": 801,
"data": {
"turn": 12,
"step": 4,
"content": [
{ "type": "text", "text": "Refactor complete — will summarise the session so far." }
],
"usage": { "inputTokens": 4200, "outputTokens": 210 }
}
},
{
"type": "compact/start",
"time": 1721403000100,
"seq": 802,
"data": {
"reason": { "kind": "user" },
"model": "deepseek-chat",
"maxTokens": 800,
"shadowedRange": { "start": 121, "end": 132 },
"trigger": { "kind": "user" }
}
},
{
"type": "compact/summary",
"time": 1721403000450,
"seq": 803,
"data": {
"model": "deepseek-chat",
"maxTokens": 800,
"shadowedRange": { "start": 121, "end": 132 },
"shadowedSeqs": [121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132],
"shadowedTokenCount": 3812,
"summary": [
{ "type": "text", "text": "The session refactored src/lib/app.ts to split App into AppShell (thin) and AppCore (business logic), moved two utility functions to src/lib/util/*, and ran the unit suite (all 96 tests passed). Key decisions: (a) AppShell owns cli/env parsing only, (b) AppCore is constructor-injectable to make tests hermetic, (c) new util modules keep the previous public API by re-export. Follow-ups queued: rename AppShell.start → AppShell.run for symmetry with the interface, and cover the new AppCore.render path with an integration test." }
],
"trigger": { "kind": "user" }
}
},
{
"type": "compact/end",
"time": 1721403000500,
"seq": 804,
"data": { "model": "deepseek-chat", "shadowedRange": { "start": 121, "end": 132 } }
},
{
"_mock": true,
"_note": "The shadowedSeqs above are fully expanded so the demo can render one row per shadowed event without a live session/events fetch. In a real machine session, the compact-before column would lazy-load each seq via session/events {seq} (P0-1 expander). Below we ALSO include synthetic previews for each shadowed seq under _shadowedPreview so the demo can render text without wire access. Consumers of the diff renderer should call the wire path in production; this field is a demo-only convenience."
},
{
"_shadowedPreview": [
{ "seq": 121, "type": "user/message", "gist": "Refactor App: split shell and core, keep public API." },
{ "seq": 122, "type": "assistant/message", "gist": "Plan: 1) read src/lib/app.ts 2) draft AppShell/AppCore 3) move utils." },
{ "seq": 123, "type": "tool/call", "gist": "read(path=src/lib/app.ts)" },
{ "seq": 124, "type": "tool/result", "gist": "app.ts 240 lines, 3 exported functions, mixed cli+business logic." },
{ "seq": 125, "type": "assistant/message", "gist": "Splitting App into AppShell (cli parsing) and AppCore (business)." },
{ "seq": 126, "type": "tool/call", "gist": "edit(path=src/lib/app.ts, old=..., new=...)" },
{ "seq": 127, "type": "tool/result", "gist": "edit applied (1 replacement); AppShell/AppCore extracted." },
{ "seq": 128, "type": "tool/call", "gist": "write_file(path=src/lib/util/parse-args.ts)" },
{ "seq": 129, "type": "tool/result", "gist": "wrote 88 bytes" },
{ "seq": 130, "type": "tool/call", "gist": "run_bash(command=pnpm test)" },
{ "seq": 131, "type": "tool/result", "gist": "96 passed / 0 failed; 1.2s" },
{ "seq": 132, "type": "assistant/message", "gist": "Refactor complete — will summarise the session so far." }
]
}
]

View File

@@ -0,0 +1,267 @@
[
{
"_mock": true,
"_mockReason": "#162 rec 31 (subagent inline under parent's spawn row): parent turn issues a spawn_agent tool call, subagent.started fires, child session ran 3 turns of activity (read → edit → verify), subagent.finished carries a structured JSON return in the parent's tool/result content."
},
{
"type": "user/message",
"time": 1721404000050,
"seq": 901,
"data": {
"content": [
{ "type": "text", "text": "Have a subagent audit packages/core/session/src for unused exports and delete them, then report the count." }
]
}
},
{
"type": "step/start",
"time": 1721404000100,
"seq": 902,
"data": { "turn": 9, "step": 0 }
},
{
"type": "assistant/message",
"time": 1721404000200,
"seq": 903,
"data": {
"content": [
{ "type": "text", "text": "Spawning a subagent to run the audit." }
],
"usage": { "inputTokens": 420, "outputTokens": 12 }
}
},
{
"type": "tool/call",
"time": 1721404000260,
"seq": 904,
"data": {
"callId": "call_spawn_9",
"name": "spawn_agent",
"arguments": "{\"prompt\":\"Audit packages/core/session/src for unused exports, delete them, and return {removed: string[], count: number} as JSON.\",\"tools\":[\"read\",\"edit\",\"bash\"]}"
}
},
{
"_mock": true,
"type": "_notification",
"method": "subagent.started",
"params": { "parentSessionId": "root-abc", "childSessionId": "sub-def", "parentCallId": "call_spawn_9" }
},
{
"_sessionId": "sub-def",
"type": "user/message",
"time": 1721404000320,
"seq": 1,
"data": {
"content": [
{ "type": "text", "text": "Audit packages/core/session/src for unused exports, delete them, and return {removed: string[], count: number} as JSON." }
],
"source": { "kind": "plugin", "plugin": "subagent-delegate" }
}
},
{
"_sessionId": "sub-def",
"type": "assistant/message",
"time": 1721404000420,
"seq": 2,
"data": {
"content": [
{ "type": "reasoning", "text": "I'll list the source files first, then walk each one with the export inspector." },
{ "type": "text", "text": "Listing source files." }
],
"usage": { "inputTokens": 210, "outputTokens": 44, "reasoningTokens": 18 }
}
},
{
"_sessionId": "sub-def",
"type": "tool/call",
"time": 1721404000460,
"seq": 3,
"data": {
"callId": "sub_call_read_1",
"name": "read",
"arguments": "{\"path\":\"packages/core/session/src/index.ts\"}"
}
},
{
"_sessionId": "sub-def",
"type": "tool/result",
"time": 1721404000540,
"seq": 4,
"data": {
"callId": "sub_call_read_1",
"content": [ { "type": "text", "text": "export * from './events'\nexport * from './types'\nexport { legacyHelper } from './legacy' // orphan\n" } ],
"isError": false,
"meta": { "card": "generic", "durationMs": 72 }
}
},
{
"_sessionId": "sub-def",
"type": "assistant/message",
"time": 1721404000640,
"seq": 5,
"data": {
"content": [
{ "type": "text", "text": "legacyHelper looks orphaned; removing it." }
],
"usage": { "inputTokens": 260, "outputTokens": 12 }
}
},
{
"_sessionId": "sub-def",
"type": "tool/call",
"time": 1721404000700,
"seq": 6,
"data": {
"callId": "sub_call_edit_1",
"name": "edit",
"arguments": "{\"path\":\"packages/core/session/src/index.ts\",\"old\":\"export { legacyHelper } from './legacy' // orphan\\n\",\"new\":\"\"}"
}
},
{
"_sessionId": "sub-def",
"type": "tool/result",
"time": 1721404000760,
"seq": 7,
"data": {
"callId": "sub_call_edit_1",
"content": [ { "type": "text", "text": "edit applied (1 replacement)" } ],
"isError": false,
"meta": { "card": "diff", "durationMs": 44 }
}
},
{
"_sessionId": "sub-def",
"type": "tool/call",
"time": 1721404000800,
"seq": 8,
"data": {
"callId": "sub_call_bash_1",
"name": "bash",
"arguments": "{\"cmd\":\"pnpm typecheck --filter @deepseek-ai/dsh-session\"}"
}
},
{
"_sessionId": "sub-def",
"type": "tool/result",
"time": 1721404000980,
"seq": 9,
"data": {
"callId": "sub_call_bash_1",
"content": [ { "type": "text", "text": "typecheck OK (0 errors)" } ],
"isError": false,
"meta": { "card": "terminal", "durationMs": 172 }
}
},
{
"_sessionId": "sub-def",
"type": "assistant/message",
"time": 1721404001060,
"seq": 10,
"data": {
"content": [
{ "type": "text", "text": "```json\n{\"removed\":[\"legacyHelper\"],\"count\":1}\n```" }
],
"usage": { "inputTokens": 340, "outputTokens": 22 }
}
},
{
"_sessionId": "sub-def",
"type": "turn/end",
"time": 1721404001100,
"seq": 11,
"data": { "turn": 3, "reason": { "kind": "stop" } }
},
{
"_mock": true,
"type": "_notification",
"method": "subagent.finished",
"params": {
"parentSessionId": "root-abc",
"childSessionId": "sub-def",
"parentCallId": "call_spawn_9",
"status": "ok",
"lastAssistantMessage": [
{ "type": "text", "text": "```json\n{\"removed\":[\"legacyHelper\"],\"count\":1}\n```" }
],
"childEvents": [
{ "type": "user/message", "time": 1721404000320, "seq": 1,
"data": { "content": [ { "type": "text", "text": "Audit packages/core/session/src for unused exports, delete them, and return {removed: string[], count: number} as JSON." } ],
"source": { "kind": "plugin", "plugin": "subagent-delegate" } } },
{ "type": "assistant/message", "time": 1721404000420, "seq": 2,
"data": { "content": [
{ "type": "reasoning", "text": "I'll list the source files first, then walk each one with the export inspector." },
{ "type": "text", "text": "Listing source files." } ],
"usage": { "inputTokens": 210, "outputTokens": 44, "reasoningTokens": 18 } } },
{ "type": "tool/call", "time": 1721404000460, "seq": 3,
"data": { "callId": "sub_call_read_1", "name": "read",
"arguments": "{\"path\":\"packages/core/session/src/index.ts\"}" } },
{ "type": "tool/result", "time": 1721404000540, "seq": 4,
"data": { "callId": "sub_call_read_1",
"content": [ { "type": "text", "text": "export * from './events'\nexport * from './types'\nexport { legacyHelper } from './legacy' // orphan\n" } ],
"isError": false, "meta": { "card": "generic", "durationMs": 72 } } },
{ "type": "assistant/message", "time": 1721404000640, "seq": 5,
"data": { "content": [ { "type": "text", "text": "legacyHelper looks orphaned; removing it." } ],
"usage": { "inputTokens": 260, "outputTokens": 12 } } },
{ "type": "tool/call", "time": 1721404000700, "seq": 6,
"data": { "callId": "sub_call_edit_1", "name": "edit",
"arguments": "{\"path\":\"packages/core/session/src/index.ts\",\"old\":\"export { legacyHelper } from './legacy' // orphan\\n\",\"new\":\"\"}" } },
{ "type": "tool/result", "time": 1721404000760, "seq": 7,
"data": { "callId": "sub_call_edit_1",
"content": [ { "type": "text", "text": "edit applied (1 replacement)" } ],
"isError": false, "meta": { "card": "diff", "durationMs": 44 } } },
{ "type": "tool/call", "time": 1721404000800, "seq": 8,
"data": { "callId": "sub_call_bash_1", "name": "bash",
"arguments": "{\"cmd\":\"pnpm typecheck --filter @deepseek-ai/dsh-session\"}" } },
{ "type": "tool/result", "time": 1721404000980, "seq": 9,
"data": { "callId": "sub_call_bash_1",
"content": [ { "type": "text", "text": "typecheck OK (0 errors)" } ],
"isError": false, "meta": { "card": "terminal", "durationMs": 172 } } },
{ "type": "assistant/message", "time": 1721404001060, "seq": 10,
"data": { "content": [ { "type": "text", "text": "```json\n{\"removed\":[\"legacyHelper\"],\"count\":1}\n```" } ],
"usage": { "inputTokens": 340, "outputTokens": 22 } } },
{ "type": "turn/end", "time": 1721404001100, "seq": 11,
"data": { "turn": 3, "reason": { "kind": "stop" } } }
]
}
},
{
"type": "tool/result",
"time": 1721404001160,
"seq": 905,
"data": {
"callId": "call_spawn_9",
"content": [
{ "type": "text", "text": "```json\n{\"removed\":[\"legacyHelper\"],\"count\":1}\n```" }
],
"isError": false,
"meta": { "card": "generic", "durationMs": 840, "childSessionId": "sub-def" }
}
},
{
"type": "assistant/message",
"time": 1721404001240,
"seq": 906,
"data": {
"content": [
{ "type": "text", "text": "Subagent removed one unused export (legacyHelper). Typecheck passed." }
],
"usage": { "inputTokens": 560, "outputTokens": 24 }
}
},
{
"type": "step/end",
"time": 1721404001280,
"seq": 907,
"data": { "turn": 9, "step": 0 }
},
{
"type": "turn/end",
"time": 1721404001320,
"seq": 908,
"data": { "turn": 9, "reason": { "kind": "stop" } }
}
]

View File

@@ -0,0 +1,33 @@
[
{ "type": "turn/start", "seq": 1, "time": 1721260000000, "data": { "turn": 0, "trigger": { "kind": "message" } } },
{ "type": "user/message", "seq": 2, "time": 1721260000010, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Read the ranker docs, then implement fastPath, then verify the tests." }] } },
{ "type": "request/header", "seq": 3, "time": 1721260000020, "data": { "requestId": "req-001", "provider": "deepseek", "responseModel": "deepseek-chat" } },
{ "type": "step/start", "seq": 4, "time": 1721260000100, "data": { "turn": 0, "step": 0 } },
{ "type": "assistant/message", "seq": 5, "time": 1721260000900, "surfaceOp": "append", "data": { "turn": 0, "step": 0, "content": [{ "type": "text", "text": "I'll start by reading the ranker docs." }], "usage": { "inputTokens": 420, "outputTokens": 32 } } },
{ "type": "step/end", "seq": 6, "time": 1721260000910, "data": { "turn": 0, "step": 0 } },
{ "type": "step/start", "seq": 7, "time": 1721260001000, "data": { "turn": 0, "step": 1 } },
{ "type": "tool/call", "seq": 8, "time": 1721260001100, "data": { "turn": 0, "step": 1, "callId": "call_read_1", "name": "Read", "arguments": "{\"path\":\"docs/ranker.md\"}" } },
{ "type": "tool/result", "seq": 9, "time": 1721260001600, "surfaceOp": "append", "data": { "turn": 0, "step": 1, "callId": "call_read_1", "content": [{ "type": "text", "text": "ranker: computes candidate scores…" }], "isError": false, "meta": { "card": "generic" } } },
{ "type": "step/end", "seq": 10, "time": 1721260001610, "data": { "turn": 0, "step": 1 } },
{ "type": "step/start", "seq": 11, "time": 1721260001700, "data": { "turn": 0, "step": 2 } },
{ "type": "assistant/message", "seq": 12, "time": 1721260002300, "surfaceOp": "append", "data": { "turn": 0, "step": 2, "content": [{ "type": "text", "text": "Docs read. Editing the ranker to add fastPath." }], "usage": { "inputTokens": 780, "outputTokens": 44 } } },
{ "type": "step/end", "seq": 13, "time": 1721260002310, "data": { "turn": 0, "step": 2 } },
{ "type": "step/start", "seq": 14, "time": 1721260002400, "data": { "turn": 0, "step": 3 } },
{ "type": "tool/call", "seq": 15, "time": 1721260002500, "data": { "turn": 0, "step": 3, "callId": "call_edit_1", "name": "Edit", "arguments": "{\"path\":\"src/ranker.ts\",\"oldString\":\"function score(\",\"newString\":\"function fastPath(x){return x.pinned?1:0}\\nfunction score(\"}" } },
{ "type": "tool/result", "seq": 16, "time": 1721260003000, "surfaceOp": "append", "data": { "turn": 0, "step": 3, "callId": "call_edit_1", "content": [{ "type": "text", "text": "OK — 1 edit applied" }], "isError": false, "meta": { "card": "diff" } } },
{ "type": "step/end", "seq": 17, "time": 1721260003010, "data": { "turn": 0, "step": 3 } },
{ "type": "step/start", "seq": 18, "time": 1721260003100, "data": { "turn": 0, "step": 4 } },
{ "type": "tool/call", "seq": 19, "time": 1721260003200, "data": { "turn": 0, "step": 4, "callId": "call_bash_1", "name": "Bash", "arguments": "{\"command\":\"pnpm test src/ranker.test.ts\"}" } },
{ "type": "tool/result", "seq": 20, "time": 1721260004000, "surfaceOp": "append", "data": { "turn": 0, "step": 4, "callId": "call_bash_1", "content": [{ "type": "text", "text": "PASS src/ranker.test.ts (14/14)" }], "isError": false, "meta": { "card": "terminal" } } },
{ "type": "step/end", "seq": 21, "time": 1721260004010, "data": { "turn": 0, "step": 4 } },
{ "type": "step/start", "seq": 22, "time": 1721260004100, "data": { "turn": 0, "step": 5 } },
{ "type": "assistant/message", "seq": 23, "time": 1721260005000, "surfaceOp": "append", "data": { "turn": 0, "step": 5, "content": [{ "type": "text", "text": "Done. fastPath added and tests pass (14/14)." }], "usage": { "inputTokens": 1220, "outputTokens": 28 } } },
{ "type": "step/end", "seq": 24, "time": 1721260005010, "data": { "turn": 0, "step": 5 } },
{ "type": "turn/end", "seq": 25, "time": 1721260005020, "data": { "turn": 0, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,29 @@
[
{ "type": "turn/start", "seq": 1, "time": 1721270000000, "data": { "turn": 0, "trigger": { "kind": "message" } } },
{ "type": "user/message", "seq": 2, "time": 1721270000010, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Delegate the SurfaceEventType audit to a subagent, then compact, then verify." }] } },
{ "type": "step/start", "seq": 3, "time": 1721270000100, "data": { "turn": 0, "step": 0 } },
{ "type": "assistant/message", "seq": 4, "time": 1721270000700, "surfaceOp": "append", "data": { "turn": 0, "step": 0, "content": [{ "type": "text", "text": "Delegating to the audit subagent." }], "usage": { "inputTokens": 320, "outputTokens": 24 } } },
{ "type": "step/end", "seq": 5, "time": 1721270000710, "data": { "turn": 0, "step": 0 } },
{ "type": "step/start", "seq": 6, "time": 1721270000800, "data": { "turn": 0, "step": 1 } },
{ "type": "subagent/started", "seq": 7, "time": 1721270000900, "data": { "turn": 0, "step": 1, "childSessionId": "sub-audit-1" } },
{ "type": "tool/call", "seq": 8, "time": 1721270001000, "data": { "turn": 0, "step": 1, "callId": "call_delegate_1", "name": "SubagentDelegate", "arguments": "{\"childSessionId\":\"sub-audit-1\",\"prompt\":\"audit SurfaceEventType\"}" } },
{ "type": "tool/result", "seq": 9, "time": 1721270002500, "surfaceOp": "append", "data": { "turn": 0, "step": 1, "callId": "call_delegate_1", "content": [{ "type": "text", "text": "3 references found" }], "isError": false, "meta": { "card": "generic" } } },
{ "type": "step/end", "seq": 10, "time": 1721270002510, "data": { "turn": 0, "step": 1 } },
{ "type": "step/start", "seq": 11, "time": 1721270002600, "data": { "turn": 0, "step": 2 } },
{ "type": "compact/summary", "seq": 12, "time": 1721270002700, "data": { "turn": 0, "step": 2, "summary": "Prior tool loop condensed", "before": 8, "after": 3 } },
{ "type": "assistant/message", "seq": 13, "time": 1721270003000, "surfaceOp": "append", "data": { "turn": 0, "step": 2, "content": [{ "type": "text", "text": "Context compacted." }], "usage": { "inputTokens": 640, "outputTokens": 18 } } },
{ "type": "step/end", "seq": 14, "time": 1721270003010, "data": { "turn": 0, "step": 2 } },
{ "type": "step/start", "seq": 15, "time": 1721270003100, "data": { "turn": 0, "step": 3 } },
{ "type": "tool/call", "seq": 16, "time": 1721270003200, "data": { "turn": 0, "step": 3, "callId": "call_verify_1", "name": "Bash", "arguments": "{\"command\":\"pnpm test types.test.ts\"}" } },
{ "type": "tool/result", "seq": 17, "time": 1721270003800, "surfaceOp": "append", "data": { "turn": 0, "step": 3, "callId": "call_verify_1", "content": [{ "type": "text", "text": "PASS types.test.ts (7/7)" }], "isError": false, "meta": { "card": "terminal" } } },
{ "type": "step/end", "seq": 18, "time": 1721270003810, "data": { "turn": 0, "step": 3 } },
{ "type": "step/start", "seq": 19, "time": 1721270003900, "data": { "turn": 0, "step": 4 } },
{ "type": "assistant/message", "seq": 20, "time": 1721270004500, "surfaceOp": "append", "data": { "turn": 0, "step": 4, "content": [{ "type": "text", "text": "Audit complete: 3 references, tests green." }], "usage": { "inputTokens": 940, "outputTokens": 20 } } },
{ "type": "step/end", "seq": 21, "time": 1721270004510, "data": { "turn": 0, "step": 4 } },
{ "type": "turn/end", "seq": 22, "time": 1721270004520, "data": { "turn": 0, "reason": { "kind": "completed" } } }
]

View File

@@ -0,0 +1,49 @@
# trace-samples — 战略清单 v2 的样例事件流
demo 阶段的前端 mock 兜底数据。文件按战略清单 §1.x 分类,形状仿真真机 wire(`session.event` notification 里的 `SessionEvent`,参见 `packages/core/session/src/types.ts:210` 的 `SessionEventMap`)——**从 wire 返回体形状一路仿真到最终渲染结果**(`memory/multi-agent-shared-repo-rules.md` 第 4 条)。
## 命名约定
```
{clauseId}-{scenario}.json
```
例:`1.3-B-inject-mid-plugin.json` = 战略清单 §1.3 族 B(中途插件提醒)的样例。
每个文件是一个 JSON 数组,元素为完整 `SessionEvent`(含 `type / seq / time / data` 顶层字段,surface 类型可能附 `sourceEventSeqs / surfaceOp`)。**seq 严格递增,时间戳单调**——`renderer.js` 消费时不做去重/排序,样例直接可喂。
## 文件清单(对应 v2 §1)
| 子项 | 文件 | 说明 |
|------|------|------|
| §1.1 Trace | `1.1-trace-one-turn.json` | 一个完整 turn 的 step 三条(step_start/assistant_message/tool_call/tool_result/step_end),用于 trace 卡三段渲染 |
| §1.1 Trace 密流 | `1.1-trace-chunk-heavy.json` | 一 turn 一 step 携 115 条 `assistant/chunk` + `request/header` + `tool/call/result`,用于验证 chunk-run 折叠与逐行 JSON 展开(task #157) |
| §1.3 A | `1.3-A-inject-session-start.json` | hooks-claude 首 turn 塞 CLAUDE.md |
| §1.3 B | `1.3-B-inject-mid-plugin.json` | tool-bash 中途路径提示 |
| §1.3 C | `1.3-C-inject-time-tick.json` | time-context 定时 tick |
| §1.3 D | `1.3-D-inject-guard.json` | repeat-tool-guard 循环提示 |
| §1.3 E | `1.3-E-inject-compact-shadow.json` | compact-basic 影子 user_message(与 §1.7 合渲) |
| §1.3 F | `1.3-F-inject-approval-policy.json` | user-approval 策略切换 |
| §1.3 G | `1.3-G-inject-unknown-plugin.json` | 未知插件(兜底族) |
| §1.3 H | `1.3-H-inject-user.json` | user-injected skill include |
| §1.4 Subagent | `1.4-subagent-structured-return.json` | subagent.started/finished 一对 + 子 session 事件 + 结构化 JSON return(wire 侧空档:`lastAssistantMessage` 里第一个 code_block=json 时视为结构化 return) |
| §1.6 seq | `1.6-workflow-seq.json` | 顺序流 5 步(wire 空档,走前端 mock;带 `_mock: true` 标) |
| §1.6 fan-out | `1.6-workflow-fanout.json` | 一步派 3 分支并跑 |
| §1.6 DAG | `1.6-workflow-dag.json` | 6 节点 DAG(多入度多出度) |
| §1.6 iter | `1.6-workflow-iter.json` | while 循环 3 轮 |
| §1.6 branch | `1.6-workflow-branch.json` | 决策分叉 A/B 选一 |
| §1.7 Compact | `1.7-compact-three-events.json` | compact/start + compact/summary + compact/end + 影子 user_message(合渲 §1.3-E) |
| §4 Growth | `growth-three-stage.json` | 三段式演进:粗糙 prompt → 接入 rubric → +42% 通过率 |
| §2.1 turn (#162) | `2.1-turn-trajectory-mixed.json` | 一 turn 内 reasoning → text → tool-row → tool-result → reasoning → text(sealed,无 delta,走 replay 路径),用于 rec 22-bis 容器渲染验收 |
| §2.2 reasoning (#162) | `2.2-reasoning-interleaved.json` | 一 turn 两块 reasoning(tool call 前后各一),reasoning-delta 流式,用于 rec 21 折叠块 + 位置保真 |
| §2.3 toolcall stream (#162) | `2.3-toolcall-delta-stream.json` | write_file 7 片 + run_bash 3 片 `tool-call-delta`(`argumentsDelta` 拼接=最终 sealed args JSON),用于 rec 22 partial-JSON 行式渲染 |
| §2.5 compact diff (#162) | `2.5-compact-before-after.json` | 12 条 shadowedSeqs + 一块 summary(~10x 压缩比)+ 每 seq 的 `_shadowedPreview` demo 兜底文本,用于 rec 32 "前后对照"(tab) |
| §2.6 subagent inline (#162) | `2.6-subagent-inline-trace.json` | 父 turn `spawn_agent` + 子 session 3 turn 完整轨迹 + `subagent.started/finished` 通知 + 父侧 `tool/result` 携 `childSessionId` meta,用于 rec 31 子轨迹下钻 |
## 关于 mock 标记
真 wire 上没有的字段/事件(§1.6 workflow/*、§1.4 subagent 结构化 return 的 JSON discriminator)在样例里带 `_mock: true` 顶层字段 + 一条 `_mockReason: '...'` 说明。渲染插件应**忽略** `_mock` 字段(不影响真机路径),fixtures 加载器可用它区分"这条数据 wire 上是否已到齐"。
## 加载入口
demo 附带调试菜单里加一族 `mock: trace-sample …` 按钮,点击后从对应 fixture 文件读事件流并按 seq 逐条 dispatch,跟真事件走同一 renderer 路径。挂接位置:`src/renderer/renderer.js` 的 debug 菜单区(沿用 widget mock 的模式,见 `docs/widget-channel-design.md` §9)。

View File

@@ -0,0 +1,121 @@
[
{
"_mock": true,
"_mockReason": "Clickability audit P2 (2026-07-17): reasoning-heavy turn used by mock-reasoning-only to demo the DeepSeek differentiator — reasoning-delta chunks + usage.reasoningTokens are the DSH signal upstream Claude/OpenAI hosts don't surface. One turn, one step, one assistant message; the reasoning body dwarfs the visible reply, and usage carries reasoningTokens=982 so the tab chip reads honestly."
},
{
"type": "user/message",
"time": 1721501000050,
"seq": 5000,
"data": {
"content": [
{ "type": "text", "text": "Given the tri-view detail pane, where is the Reasoning tab supposed to live and why can most upstream hosts not show one?" }
]
}
},
{
"type": "turn/start",
"time": 1721501000080,
"seq": 5001,
"data": { "turn": 1, "trigger": "user" }
},
{
"type": "step/start",
"time": 1721501000100,
"seq": 5002,
"data": { "turn": 1, "step": 0 }
},
{
"type": "request/header",
"time": 1721501000110,
"seq": 5003,
"data": {
"header": {
"model": "deepseek-reasoner",
"provider": "deepseek",
"system": "You are a careful research assistant. Think step by step before you answer.",
"config": { "temperature": 0.3, "maxTokens": 4096 }
},
"reason": "step-start"
}
},
{
"type": "assistant/chunk",
"time": 1721501000300,
"seq": 5004,
"data": { "chunk": { "type": "reasoning-delta", "text": "Let me trace this carefully. The tri-view is Tree / Timeline / Graph, " } }
},
{
"type": "assistant/chunk",
"time": 1721501000350,
"seq": 5005,
"data": { "chunk": { "type": "reasoning-delta", "text": "and each of them lands a right-side detail pane on click. So the Reasoning tab lives inside that right-side pane, alongside Feedback / Input / Output / Attributes. " } }
},
{
"type": "assistant/chunk",
"time": 1721501000420,
"seq": 5006,
"data": { "chunk": { "type": "reasoning-delta", "text": "It's conditional — a step without reasoning-delta chunks or a positive usage.reasoningTokens hides the tab entirely, so casual turns don't get a fifth clickable that says nothing. " } }
},
{
"type": "assistant/chunk",
"time": 1721501000480,
"seq": 5007,
"data": { "chunk": { "type": "reasoning-delta", "text": "As for why upstreams don't show it: Anthropic's Claude ships an `extended_thinking` field on the API but hides the text in the product; OpenAI's o-series does the same with its `reasoning.summary`. " } }
},
{
"type": "assistant/chunk",
"time": 1721501000550,
"seq": 5008,
"data": { "chunk": { "type": "reasoning-delta", "text": "DeepSeek exposes reasoning as a first-class content-block type plus a dedicated reasoning-delta chunk, and DSH's aggregator forwards both to the UI. " } }
},
{
"type": "assistant/chunk",
"time": 1721501000620,
"seq": 5009,
"data": { "chunk": { "type": "reasoning-delta", "text": "So the visualisation happens because the wire carries the payload — the product is honest about what the model produced instead of collapsing it into a summary. That's the differentiator the audit calls out." } }
},
{
"type": "assistant/chunk",
"time": 1721501000700,
"seq": 5010,
"data": { "chunk": { "type": "text-delta", "text": "The Reasoning tab lives in the tri-view's right-side detail pane, next to Feedback / Input / Output / Attributes, and appears only when the step has reasoning-delta content or a positive usage.reasoningTokens. " } }
},
{
"type": "assistant/chunk",
"time": 1721501000740,
"seq": 5011,
"data": { "chunk": { "type": "text-delta", "text": "Most upstream hosts don't expose one because their wire hides reasoning: Anthropic keeps `extended_thinking` on the API only, OpenAI ships an aggregate `reasoning.summary`, and neither routes the raw stream to the UI. DeepSeek does — reasoning is a first-class content-block and its own chunk type — so DSH can render it faithfully." }
}
},
{
"type": "assistant/message",
"time": 1721501000800,
"seq": 5012,
"data": {
"content": [
{ "type": "reasoning", "text": "Let me trace this carefully. The tri-view is Tree / Timeline / Graph, and each of them lands a right-side detail pane on click. So the Reasoning tab lives inside that right-side pane, alongside Feedback / Input / Output / Attributes. It's conditional — a step without reasoning-delta chunks or a positive usage.reasoningTokens hides the tab entirely, so casual turns don't get a fifth clickable that says nothing. As for why upstreams don't show it: Anthropic's Claude ships an `extended_thinking` field on the API but hides the text in the product; OpenAI's o-series does the same with its `reasoning.summary`. DeepSeek exposes reasoning as a first-class content-block type plus a dedicated reasoning-delta chunk, and DSH's aggregator forwards both to the UI. So the visualisation happens because the wire carries the payload — the product is honest about what the model produced instead of collapsing it into a summary. That's the differentiator the audit calls out." },
{ "type": "text", "text": "The Reasoning tab lives in the tri-view's right-side detail pane, next to Feedback / Input / Output / Attributes, and appears only when the step has reasoning-delta content or a positive usage.reasoningTokens. Most upstream hosts don't expose one because their wire hides reasoning: Anthropic keeps `extended_thinking` on the API only, OpenAI ships an aggregate `reasoning.summary`, and neither routes the raw stream to the UI. DeepSeek does — reasoning is a first-class content-block and its own chunk type — so DSH can render it faithfully." }
],
"usage": {
"inputTokens": 214,
"outputTokens": 118,
"reasoningTokens": 982,
"cacheReadTokens": 0
},
"finish_reason": "stop"
}
},
{
"type": "step/end",
"time": 1721501000900,
"seq": 5013,
"data": { "turn": 1, "step": 0, "reason": { "kind": "stop" } }
},
{
"type": "turn/end",
"time": 1721501000950,
"seq": 5014,
"data": { "turn": 1, "reason": { "kind": "stop" } }
}
]

View File

@@ -0,0 +1,28 @@
[
{
"_mock": true,
"_mockReason": "Clickability audit insert (2026-07-17 user 実機 screenshot): a turn/end with no usage, no cost, no duration, no stopReason — the shape that used to produce '— · — / $? · — · —' + a stranded single-dot glyph. The fix: skip mounting the footer and glyph entirely (zero-drop rule guarantees per-field L2 reachability; the L0 footer is a gist row and gets to omit no-signal turns). Test asserts turn container renders no <footer.turn-footer> child."
},
{
"type": "user/message",
"time": 1721501500000,
"seq": 6000,
"data": {
"content": [
{ "type": "text", "text": "hi" }
]
}
},
{
"type": "turn/start",
"time": 1721501500010,
"seq": 6001,
"data": {}
},
{
"type": "turn/end",
"time": 1721501500020,
"seq": 6002,
"data": {}
}
]

View File

@@ -0,0 +1,48 @@
{
"_mock": true,
"_mockReason": "Growth data source aggregation via session/list+session/events is still backlog (task #92). During the demo we drive this page from a fixture that tells the three-stage evolution story: rough prompt -> add rubric -> pass rate +42%.",
"compactWindows": [
{
"id": "cw-2026-07-01",
"time": 1719811200000,
"model": "deepseek-chat",
"shadowedRange": { "start": 1, "end": 240 },
"shadowedTokenCount": 28500,
"summary": "Initial system prompt was one line: 'You are a coding assistant.' Out of 12 user questions, 5 went off track (agent ran plain `pnpm test` instead of `pnpm run test:coverage`; treated doc-sync as a typecheck step).",
"rubrics": [],
"errors": [
{ "id": "e1", "text": "test:coverage vs. unit test confused", "cause": "system prompt never spelled out the gate semantics", "createdAt": 1719815000000 }
],
"eval": { "name": "gate-order-eval", "pass": 5, "total": 12, "improvedTo": "42%" }
},
{
"id": "cw-2026-07-05",
"time": 1720155600000,
"model": "deepseek-chat",
"shadowedRange": { "start": 241, "end": 490 },
"shadowedTokenCount": 31200,
"summary": "Added an explicit gate order to the system prompt (typecheck -> lint -> coverage -> snapshot -> doc-sync). First rubric captured: 'when the user says \"run tests\", the default is `pnpm run test:coverage`'. Out of 15 user questions, only 1 went off track (progress: 5 -> 1).",
"rubrics": [
{ "id": "r1", "assertion": "When the user says 'run tests', the agent should invoke `pnpm run test:coverage`, not plain `pnpm run test`.", "expected": "test:coverage", "createdAt": 1720158000000 }
],
"errors": [
{ "id": "e2", "text": "doc-sync step was skipped before merge", "cause": "gate order listed doc-sync but never marked it required", "createdAt": 1720160000000 }
],
"eval": { "name": "gate-order-eval", "pass": 14, "total": 15, "prevPass": 5, "prevTotal": 12, "improvedFrom": "42%", "improvedTo": "93%" }
},
{
"id": "cw-2026-07-15",
"time": 1721001600000,
"model": "deepseek-chat",
"shadowedRange": { "start": 491, "end": 780 },
"shadowedTokenCount": 29800,
"summary": "After annotating doc-sync as a required gate, re-ran the eval: only 1 of 18 questions went off track (pass rate 5/12=42% -> 14/15=93% -> 17/18=94%). Evolution is stable; safe to promote to baseline.",
"rubrics": [
{ "id": "r1", "assertion": "When the user says 'run tests', the agent should invoke `pnpm run test:coverage`.", "expected": "test:coverage", "createdAt": 1720158000000 },
{ "id": "r2", "assertion": "doc-sync is a required gate; the agent must mention it before proposing a merge.", "expected": "doc-sync mentioned before merge", "createdAt": 1721005000000 }
],
"errors": [],
"eval": { "name": "gate-order-eval", "pass": 17, "total": 18, "prevPass": 14, "prevTotal": 15, "improvedFrom": "42%", "improvedTo": "94%" }
}
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,11 @@
[
{ "type": "turn/start", "seq": 200, "time": 1721117000000, "data": { "turn": 4, "trigger": { "kind": "message", "source": { "kind": "user" } } } },
{ "type": "user/message", "seq": 201, "time": 1721117000001, "surfaceOp": "append", "data": { "content": [{ "type": "text", "text": "Read x.ts and print its first line." }], "source": { "kind": "user" } } },
{ "type": "step/start", "seq": 202, "time": 1721117000100, "data": { "turn": 4, "step": 0 } },
{ "type": "request/header", "seq": 203, "time": 1721117000101, "data": { "header": { "model": "deepseek-chat", "provider": "deepseek", "system": "You are a coding assistant.", "tools": [{ "name": "read", "description": "read a file", "parameters": { "type": "object" } }], "config": { "temperature": 0, "topP": 0.9, "maxTokens": 4096 }, "messagePrefix": [] }, "reason": "step-start" } },
{ "type": "assistant/message", "seq": 204, "time": 1721117000800, "surfaceOp": "append", "data": { "turn": 4, "step": 0, "content": [{ "type": "text", "text": "Reading x.ts now." }, { "type": "tool_use", "id": "call_read_x", "name": "read", "input": { "path": "x.ts" } }], "usage": { "inputTokens": 512, "outputTokens": 48, "cacheReadTokens": 128 } } },
{ "type": "tool/call", "seq": 205, "time": 1721117000801, "data": { "turn": 4, "step": 0, "callId": "call_read_x", "name": "read", "arguments": "{\"path\":\"x.ts\"}" } },
{ "type": "tool/result", "seq": 206, "time": 1721117001200, "surfaceOp": "append", "data": { "turn": 4, "step": 0, "callId": "call_read_x", "isError": true, "content": [{ "type": "text", "text": "RuntimeError: file not found: x.ts\n at read (fs/file.ts:42:11)\n at tool.dispatch (loop.ts:118:8)" }], "error": { "name": "RuntimeError", "message": "file not found: x.ts" }, "meta": { "card": "generic", "durationMs": 399 } } },
{ "type": "step/end", "seq": 207, "time": 1721117001250, "data": { "turn": 4, "step": 0 } },
{ "type": "turn/end", "seq": 208, "time": 1721117001260, "data": { "turn": 4, "reason": { "kind": "error", "message": "tool failed" } } }
]

View File

@@ -0,0 +1,170 @@
[
{
"_mock": true,
"_mockReason": "Ticket #15 A (2026-07-17) live subagent sub-trajectory. Shape follows the real kernel wire (packages/ui/jsonrpc/src/server.ts:82-96, audited @ fa2065872): subagent.started carries only parent/child sessionId (no parentCallId); child session.event notifications ride the same session.event channel keyed on the child sessionId; subagent.finished carries status + lastAssistantMessage but not childEvents (they already flowed live). The renderer's live-routing table matches childSessionId → parent's spawn tool row via meta.lastSpawnCallId heuristic. Fixture plays: parent assistant announces plan → spawn_agent tool/call → subagent.started → 6 child session.events flowing live (turn/start, assistant/chunk×3, tool/call, tool/result, turn/end) → subagent.finished with structured JSON return."
},
{
"type": "user/message",
"time": 1721416000050,
"seq": 1001,
"data": {
"content": [
{ "type": "text", "text": "Have a subagent grep packages/core/session/src for `SessionEvent` usage sites and report the count." }
]
}
},
{
"type": "step/start",
"time": 1721416000100,
"seq": 1002,
"data": { "turn": 1, "step": 0 }
},
{
"type": "assistant/message",
"time": 1721416000200,
"seq": 1003,
"data": {
"content": [
{ "type": "text", "text": "Delegating the audit to a subagent." }
],
"usage": { "inputTokens": 120, "outputTokens": 8 }
}
},
{
"type": "tool/call",
"time": 1721416000260,
"seq": 1004,
"data": {
"callId": "call_spawn_live_1",
"name": "spawn_agent",
"arguments": "{\"prompt\":\"grep packages/core/session/src for SessionEvent usage sites\",\"tools\":[\"grep\",\"read\"]}"
}
},
{
"_mock": true,
"_mockReason": "subagent.started — real wire shape: only parent/child sessionId, no parentCallId. Renderer picks anchor from meta.lastSpawnCallId (heuristic).",
"type": "_notification",
"method": "subagent.started",
"params": { "parentSessionId": "root-align-a", "childSessionId": "sub-align-a-1" }
},
{
"_sessionId": "sub-align-a-1",
"type": "turn/start",
"time": 1721416000320,
"seq": 1,
"data": { "trigger": "spawn", "turn": 0 }
},
{
"_sessionId": "sub-align-a-1",
"type": "assistant/chunk",
"time": 1721416000360,
"seq": 2,
"data": {
"turn": 0,
"step": 0,
"chunk": { "type": "reasoning-delta", "text": "Planning grep pattern for SessionEvent." }
}
},
{
"_sessionId": "sub-align-a-1",
"type": "assistant/chunk",
"time": 1721416000420,
"seq": 3,
"data": {
"turn": 0,
"step": 0,
"chunk": { "type": "text-delta", "text": "Running grep for SessionEvent usage sites." }
}
},
{
"_sessionId": "sub-align-a-1",
"type": "tool/call",
"time": 1721416000480,
"seq": 4,
"data": {
"callId": "sub_call_grep_1",
"name": "grep",
"arguments": "{\"pattern\":\"SessionEvent\",\"path\":\"packages/core/session/src\"}"
}
},
{
"_sessionId": "sub-align-a-1",
"type": "tool/result",
"time": 1721416000620,
"seq": 5,
"data": {
"callId": "sub_call_grep_1",
"content": [ { "type": "text", "text": "packages/core/session/src/index.ts:44: export interface SessionEvent\npackages/core/session/src/index.ts:112: emit(event: SessionEvent)\npackages/core/session/src/index.ts:236: return { role, envelope }\n" } ],
"isError": false,
"meta": { "card": "generic", "durationMs": 140 }
}
},
{
"_sessionId": "sub-align-a-1",
"type": "assistant/chunk",
"time": 1721416000720,
"seq": 6,
"data": {
"turn": 0,
"step": 0,
"chunk": { "type": "text-delta", "text": "Found 3 SessionEvent usage sites in index.ts. Returning structured count." }
}
},
{
"_sessionId": "sub-align-a-1",
"type": "assistant/message",
"time": 1721416000780,
"seq": 7,
"data": {
"content": [
{ "type": "text", "text": "```json\n{\"count\":3,\"file\":\"packages/core/session/src/index.ts\",\"lines\":[44,112,236]}\n```" }
],
"usage": { "inputTokens": 350, "outputTokens": 42 }
}
},
{
"_sessionId": "sub-align-a-1",
"type": "turn/end",
"time": 1721416000840,
"seq": 8,
"data": { "reason": { "kind": "completed" } }
},
{
"_mock": true,
"_mockReason": "subagent.finished — real wire shape (server.ts:106-123): no childEvents (they already flowed live via session.event above); lastAssistantMessage carries the structured JSON so subagent-view.parseSubagentReturn can render the return section.",
"type": "_notification",
"method": "subagent.finished",
"params": {
"parentSessionId": "root-align-a",
"childSessionId": "sub-align-a-1",
"agentId": "agent-live-a-1",
"status": "ok",
"stopReason": "completed",
"provider": "deepseek",
"lastAssistantMessage": [
{ "type": "text", "text": "```json\n{\"count\":3,\"file\":\"packages/core/session/src/index.ts\",\"lines\":[44,112,236]}\n```" }
]
}
},
{
"type": "assistant/message",
"time": 1721416000920,
"seq": 1005,
"data": {
"content": [ { "type": "text", "text": "Subagent found 3 SessionEvent usage sites in index.ts (lines 44, 112, 236)." } ],
"usage": { "inputTokens": 260, "outputTokens": 24 }
}
},
{
"type": "step/end",
"time": 1721416000980,
"seq": 1006,
"data": { "turn": 1, "step": 0 }
},
{
"type": "turn/end",
"time": 1721416001040,
"seq": 1007,
"data": { "reason": { "kind": "completed" } }
}
]

View File

@@ -0,0 +1,94 @@
[
{
"_mock": true,
"_mockReason": "Ticket #15 B (2026-07-17) envelope:'raw' inject cards. Two raw injections: (1) workspace-context plugin with meta.kind='workspace-instructions' (typed shape — version + changes[]); (2) unknown-kind raw injection so the fallback generic card path is exercised. Interleaved with a tagged (envelope='context') plugin inject so a reviewer can visually A/B them side by side. Kernel wire seat: packages/core/session/src/types.ts:239-251 (envelope + meta fields) plus packages/core/session/src/index.ts:236-243 (raw = no <context> tag wrap). Audited @ deepseek-harness-dev fa2065872."
},
{
"type": "turn/start",
"time": 1721416100050,
"seq": 2001,
"data": { "trigger": "user", "turn": 1 }
},
{
"type": "user/message",
"time": 1721416100100,
"seq": 2002,
"data": {
"content": [
{ "type": "text", "text": "Refactor the diff-viewer to support side-by-side view." }
]
}
},
{
"_mock": true,
"_mockReason": "workspace-context plugin raw injection — the only known raw producer as of 07-17.",
"type": "context/message",
"time": 1721416100160,
"seq": 2003,
"data": {
"envelope": "raw",
"source": { "kind": "plugin", "plugin": "workspace-context" },
"meta": {
"kind": "workspace-instructions",
"version": "2026.07.17",
"changes": [
{ "path": "packages/plugins/diff-viewer/src/index.ts", "action": "add" },
{ "path": "packages/plugins/diff-viewer/README.md", "action": "add" },
{ "path": "packages/plugins/diff-viewer-legacy/src/index.ts", "action": "remove" }
]
},
"content": [
{ "type": "text", "text": "<workspace-instructions version=\"2026.07.17\">\nRecent changes in this workspace:\n + packages/plugins/diff-viewer/src/index.ts (new)\n + packages/plugins/diff-viewer/README.md (new)\n - packages/plugins/diff-viewer-legacy/src/index.ts (removed)\n\nWhen editing diff-viewer, prefer the new module path; the legacy path is scheduled for removal.\n</workspace-instructions>" }
]
}
},
{
"_mock": true,
"_mockReason": "Tagged (envelope absent) context/message from a first-party plugin — kept alongside so the visual A/B between tagged vs raw is easy to see in one selfie.",
"type": "context/message",
"time": 1721416100220,
"seq": 2004,
"data": {
"source": { "kind": "plugin", "plugin": "time-context" },
"content": [
{ "type": "text", "text": "Current time (Asia/Shanghai): 2026-07-17 14:52" }
]
}
},
{
"_mock": true,
"_mockReason": "Unknown-kind raw injection — meta.kind is a string the classifier doesn't recognise, so it falls back to the generic 'raw · <kind>' card. Zero-loss: full meta lands in the L2 JSON drawer.",
"type": "context/message",
"time": 1721416100280,
"seq": 2005,
"data": {
"envelope": "raw",
"source": { "kind": "plugin", "plugin": "experimental-context" },
"meta": {
"kind": "session-note",
"version": "0.1.0",
"note": "The user is refactoring diff-viewer; prefer minimal-diff patches."
},
"content": [
{ "type": "text", "text": "[experimental-context] Session note: the current work stream is a diff-viewer refactor. Keep patches minimal-diff shaped." }
]
}
},
{
"type": "assistant/message",
"time": 1721416100360,
"seq": 2006,
"data": {
"content": [
{ "type": "text", "text": "I'll refactor the diff-viewer to add a side-by-side mode. Given the workspace-instructions note, I'll target packages/plugins/diff-viewer/src/index.ts and skip the legacy path." }
],
"usage": { "inputTokens": 480, "outputTokens": 42 }
}
},
{
"type": "turn/end",
"time": 1721416100420,
"seq": 2007,
"data": { "reason": { "kind": "completed" } }
}
]