// debug-fixtures.js — inlined batch 3 fixtures for the debug menu. // // The renderer loads as file:// so it can't fetch() JSON without a // custom IPC seam; inlining the six fixtures keeps the debug loader // dependency-free. Source of truth stays fixtures/trace-samples/1.4-* // and 1.6-*; whenever those change, regenerate this file with: // // node -e 'for (const f of ["1.6-workflow-seq","1.6-workflow-fanout","1.6-workflow-dag","1.6-workflow-iter","1.6-workflow-branch","1.4-subagent-structured-return"]) { console.log(f, ":", JSON.stringify(require("./fixtures/trace-samples/" + f + ".json")).length, "bytes") }' // // (or the python one-liner in the batch 3 commit message). // // The `_mock:true` marker each fixture carries at the top tells the // workflow-view / subagent-view modules to render an honest "mock · // workflow/* 未上 wire" chip. Wire uptake is tracked as and // #150 (workflow event broadcast + structured-return slot). 'use strict'; const FIXTURES = { workflowSeq: {"_mock": true, "_mockReason": "workflow/* Cordis events are not on the wire yet (see the historical note at panels-c-controller.js:198); the wire patch belongs to impl-plugin-wire. This fixture demos the §1.6 sequential shape: a workflow tool call plus 5 step-progress events (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"}}]}, workflowFanout: {"_mock": true, "_mockReason": "Same caveat as 1.6-workflow-seq.json. Demos the fan-out family: one fan-out step spawning 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\"}"}}]}, workflowDag: {"_mock": true, "_mockReason": "Same caveat as 1.6-workflow-seq.json. DAG family: 6 nodes with multi-in and multi-out edges.", "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\"}"}}]}, workflowIter: {"_mock": true, "_mockReason": "Same caveat as 1.6-workflow-seq.json. Iter family: a while loop over 3 iterations.", "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\"}"}}]}, workflowBranch: {"_mock": true, "_mockReason": "Same caveat as 1.6-workflow-seq.json. Branch family: a decision fork where a step output picks the following 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\"}"}}]}, subagentReturn: [{"_mock": true, "_mockReason": "Subagent structured JSON return: subagent.finished.lastAssistantMessage on the wire is 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 under 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```"}]}}], }; const debugFixturesApi = { FIXTURES, get: (key) => FIXTURES[key] || null, keys: () => Object.keys(FIXTURES), }; if (typeof module !== 'undefined' && module.exports) module.exports = debugFixturesApi; if (typeof window !== 'undefined') window.__dshDebugFixtures = debugFixturesApi;