diff --git a/snapshots/session/claude-code-mods/cordis.snapshot.yml b/snapshots/session/claude-code-mods/cordis.snapshot.yml index 8478c4b4d1..a608762f05 100644 --- a/snapshots/session/claude-code-mods/cordis.snapshot.yml +++ b/snapshots/session/claude-code-mods/cordis.snapshot.yml @@ -32,6 +32,8 @@ - insert: - id: claude-code-mods name: '@deepseek-ai/dsh-experimental-claude-code-mods' + - id: workspace-changes + name: '@deepseek-ai/dsh-workspace-changes' - id: claude-code-mod-snapshot-guard name: './demo-mod.ts' - id: claude-code-mod-replay-theater diff --git a/snapshots/session/claude-code-mods/cordis.yml b/snapshots/session/claude-code-mods/cordis.yml index e0630ec014..2e2149735f 100644 --- a/snapshots/session/claude-code-mods/cordis.yml +++ b/snapshots/session/claude-code-mods/cordis.yml @@ -7,6 +7,8 @@ - insert: - id: claude-code-mods name: '@deepseek-ai/dsh-experimental-claude-code-mods' + - id: workspace-changes + name: '@deepseek-ai/dsh-workspace-changes' - id: claude-code-mod-snapshot-guard name: './demo-mod.ts' - id: claude-code-mod-replay-theater diff --git a/snapshots/session/claude-code-mods/demo-mod.ts b/snapshots/session/claude-code-mods/demo-mod.ts index cac5fd40ad..114ab65c22 100644 --- a/snapshots/session/claude-code-mods/demo-mod.ts +++ b/snapshots/session/claude-code-mods/demo-mod.ts @@ -1,9 +1,8 @@ import { defineMod } from '@deepseek-ai/dsh-experimental-claude-code-mods' /** - * A mod whose effects reach the Session log: it adds a context line after - * each prompt and refuses a force push, so the recording shows what the - * model sees from a `prompt.submit` rewrite and a `tool.call` deny. + * Scenario mod: adds prompt context, reports current-directory operations, + * and refuses forced Git pushes. */ export default defineMod({ name: 'snapshot-guard', @@ -13,6 +12,23 @@ export default defineMod({ const r = await next(e) return { ...r, context: [...r.context ?? [], 'Context from the snapshot-guard mod: this workspace is a demo checkout.'] } }) + on('tool.call', { tool: 'working_directory' }, async ($, e, next) => { + const result = await next(e) + if (typeof e.cd !== 'string' || result.deny !== undefined || result.isError) return result + const cwd = await $.session.cwd() + const root = await $.session.root() + const read = await $.fs.read('witness.txt') + const exists = await $.fs.exists('witness.txt') + const stat = await $.fs.stat('witness.txt') + const listed = (await $.fs.list('.')).some(entry => entry.name === 'witness.txt') + const process = await $.process.run(['node', '-e', 'process.stdout.write(String(process.cwd() === process.argv[1]))', cwd]) + const facts = JSON.stringify({ + directory: cwd.split('/').pop(), rootIsCurrent: cwd === root, read, exists, stat: stat.kind, listed, + processCwdMatches: process.stdout === 'true', + }) + await $.fs.write('mods-directory.json', facts + '\n') + return { ...result, result: String(result.result) + '\nMods directory facts: ' + facts } + }) on('tool.call', { tool: 'Bash' }, (_$, e, next) => { if (/\bgit\s+push\b[^\n]*\s(--force|-f)\b/u.test(String(e.command ?? ''))) { return { deny: `snapshot-guard refused this command: ${String(e.command)}` } diff --git a/snapshots/session/working-directory-consumers/session.v4.jsonl b/snapshots/session/working-directory-consumers/session.v4.jsonl new file mode 100644 index 0000000000..541a9ce51c --- /dev/null +++ b/snapshots/session/working-directory-consumers/session.v4.jsonl @@ -0,0 +1,68 @@ +{"type":"session","version":4,"id":"{{session:1}}","createdAt":0,"cwd":"{{cwd}}","isSeeded":false,"delegationDepth":0} +{"type":"permission/preset","data":{"preset":"danger-full-access"}} +{"type":"sandbox/mode","data":{"mode":"danger-full-access"}} +{"type":"approval/policy","data":{"policy":"never"}} +{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"inserted":[{"content":[{"type":"text","text":"Read the current directory with working_directory. Enter selected, write result.txt with exactly \"created inside selected\\n\", enter ../second, and read witness.txt. Use bash to run exactly `cd .. && rm -rf second`, then read the current directory again. Reply with exactly WORKING_DIRECTORY_OK."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"}]}} +{"type":"turn/start","data":{"turn":1}} +{"type":"agent/inbox/spliced","data":{"target":"next-turn","start":0,"removedCount":1,"inserted":[]}} +{"type":"step/start","data":{"turn":1,"step":1}} +{"type":"system/message","data":{"turn":1,"step":1,"message":{"role":"system","content":[{"type":"text","text":"{{system}}"}],"source":{"kind":"system-prompt"},"id":"{{message:2}}"}},"surfaceOp":"append"} +{"type":"user/message","data":{"content":[{"type":"text","text":"Read the current directory with working_directory. Enter selected, write result.txt with exactly \"created inside selected\\n\", enter ../second, and read witness.txt. Use bash to run exactly `cd .. && rm -rf second`, then read the current directory again. Reply with exactly WORKING_DIRECTORY_OK."},{"type":"text","text":"Context from the snapshot-guard mod: this workspace is a demo checkout."}],"source":{"kind":"user"},"role":"user","id":"{{message:1}}"},"surfaceOp":"append"} +{"type":"user/message","data":{"content":[{"type":"text","text":"Current runtime context. This snapshot supersedes earlier runtime-context snapshots.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{message:3}}"},"surfaceOp":"append"} +{"type":"request/header","data":{"header":{"config":{"provider":"deepseek-official","model":"deepseek-v4-flash","maxTokens":256000,"reasoningEffort":"max"},"adapterDefaults":{"reasoningEffort":true,"maxTokens":true},"tools":"{{tools}}"},"reason":"initial"}} +{"type":"request/context","data":{"provider":"deepseek-official","model":"deepseek-v4-flash","contextWindow":1000000}} +{"type":"session/title","data":{"title":"Read the current directory with","messageSeqs":[8],"source":{"kind":"fallback"}}} +{"type":"assistant/message","data":{"turn":1,"step":1,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:4}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684830,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684830,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-1","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791186684830,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684830,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":1,"callId":"directory-1","name":"working_directory","arguments":"{}"}} +{"type":"tool/result","data":{"turn":1,"step":1,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-1"},"toolCallId":"directory-1","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:5}}"}},"sourceEventSeqs":[14],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":1}} +{"type":"step/start","data":{"turn":1,"step":2}} +{"type":"assistant/message","data":{"turn":1,"step":2,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:6}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684855,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684855,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}}},{"type":"chunk","time":1791186684855,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684855,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":2,"callId":"directory-2","name":"working_directory","arguments":"{\"cd\":\"selected\"}"}} +{"type":"working-directory/change","data":{"cwd":"{{cwd}}/selected"}} +{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:7}}"}]}} +{"type":"tool/result","data":{"turn":1,"step":2,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-2"},"toolCallId":"directory-2","content":[{"type":"text","text":"{{cwd}}/selected\nMods directory facts: {\"directory\":\"selected\",\"rootIsCurrent\":false,\"read\":\"selected witness\\n\",\"exists\":true,\"stat\":\"file\",\"listed\":true,\"processCwdMatches\":true}"}],"isError":false,"id":"{{message:8}}"}},"sourceEventSeqs":[19],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":2}} +{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}} +{"type":"step/start","data":{"turn":1,"step":3}} +{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}\" to \"{{cwd}}/selected\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:7}}"},"surfaceOp":"append"} +{"type":"user/message","data":{"content":[{"type":"text","text":"Current runtime context. This snapshot supersedes earlier runtime-context snapshots.\n\nCurrent working directory: \"{{cwd}}/selected\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/selected\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{message:9}}"},"surfaceOp":"append"} +{"type":"assistant/message","data":{"turn":1,"step":3,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:10}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684879,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684879,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}}},{"type":"chunk","time":1791186684879,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684879,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":3,"callId":"directory-3","name":"write","arguments":"{\"file_path\":\"result.txt\",\"content\":\"created inside selected\\n\"}"}} +{"type":"tool/result","data":{"turn":1,"step":3,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-3"},"toolCallId":"directory-3","content":[{"type":"text","text":"{{cwd}}/selected/result.txt\nfile\n\nCreated file\n"}],"isError":false,"id":"{{message:11}}"},"meta":{"operation":"create","path":"{{cwd}}/selected/result.txt","diffs":[]}},"sourceEventSeqs":[29],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":3}} +{"type":"step/start","data":{"turn":1,"step":4}} +{"type":"assistant/message","data":{"turn":1,"step":4,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:12}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684909,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684909,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}}},{"type":"chunk","time":1791186684909,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684909,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":4,"callId":"directory-4","name":"working_directory","arguments":"{\"cd\":\"../second\"}"}} +{"type":"working-directory/change","data":{"cwd":"{{cwd}}/second"}} +{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/selected\" to \"{{cwd}}/second\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"}]}} +{"type":"tool/result","data":{"turn":1,"step":4,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-4"},"toolCallId":"directory-4","content":[{"type":"text","text":"{{cwd}}/second\nMods directory facts: {\"directory\":\"second\",\"rootIsCurrent\":false,\"read\":\"second directory\\n\",\"exists\":true,\"stat\":\"file\",\"listed\":true,\"processCwdMatches\":true}"}],"isError":false,"id":"{{message:14}}"}},"sourceEventSeqs":[34],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":4}} +{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}} +{"type":"step/start","data":{"turn":1,"step":5}} +{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory changed from \"{{cwd}}/selected\" to \"{{cwd}}/second\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:13}}"},"surfaceOp":"append"} +{"type":"user/message","data":{"content":[{"type":"text","text":"Current runtime context. This snapshot supersedes earlier runtime-context snapshots.\n\nCurrent working directory: \"{{cwd}}/second\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}/second\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{message:15}}"},"surfaceOp":"append"} +{"type":"assistant/message","data":{"turn":1,"step":5,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:16}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684935,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684935,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}}},{"type":"chunk","time":1791186684935,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684936,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":5,"callId":"directory-5","name":"read","arguments":"{\"file_path\":\"witness.txt\"}"}} +{"type":"tool/result","data":{"turn":1,"step":5,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-5"},"toolCallId":"directory-5","content":[{"type":"text","text":"{{cwd}}/second/witness.txt\nfile\n\n1: second directory\n\n(End of file - total 1 lines)\n"}],"isError":false,"id":"{{message:17}}"},"meta":{"path":"{{cwd}}/second/witness.txt","offset":1,"lines":[{"number":1,"text":"second directory"}],"totalLines":1}},"sourceEventSeqs":[44],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":5}} +{"type":"step/start","data":{"turn":1,"step":6}} +{"type":"assistant/message","data":{"turn":1,"step":6,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:18}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684960,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684960,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}}},{"type":"chunk","time":1791186684960,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684960,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":6,"callId":"directory-6","name":"bash","arguments":"{\"command\":\"cd .. && rm -rf second\",\"description\":\"Remove the selected directory to exercise recovery\"}"}} +{"type":"tool/result","data":{"turn":1,"step":6,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-6"},"toolCallId":"directory-6","content":[{"type":"text","text":"(no output)"}],"isError":false,"id":"{{message:19}}"},"meta":{"cwd":"{{cwd}}/second"}},"sourceEventSeqs":[49],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":6}} +{"type":"working-directory/change","data":{"cwd":"{{cwd}}"}} +{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"inserted":[{"content":[{"type":"text","text":"The working directory \"{{cwd}}/second\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:20}}"}]}} +{"type":"step/start","data":{"turn":1,"step":7}} +{"type":"user/message","data":{"content":[{"type":"text","text":"Current runtime context. This snapshot supersedes earlier runtime-context snapshots.\n\nCurrent working directory: \"{{cwd}}\".\n\nCurrent DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations.\n\nApproval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}],"source":{"kind":"runtime-context","form":"snapshot","sections":[{"name":"working-directory:current","text":"Current working directory: \"{{cwd}}\"."},{"name":"sandbox:policy","text":"Current DSH file policy: danger-full-access. The DSH file sandbox does not restrict file modifications by available operations."},{"name":"approval:policy","text":"Approval prompts are disabled in this session: actions that require approval are rejected automatically — do not request sandbox escalation (do not set `sandbox_permissions`)."}]},"role":"user","id":"{{message:21}}"},"surfaceOp":"append"} +{"type":"assistant/message","data":{"turn":1,"step":7,"message":{"role":"assistant","content":[{"type":"tool-call","id":"directory-7","name":"working_directory","arguments":"{}"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:22}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186684994,"chunk":{"type":"block-start","index":0,"blockType":"tool-call"}},{"type":"chunk","time":1791186684994,"chunk":{"type":"block-end","index":0,"block":{"type":"tool-call","id":"directory-7","name":"working_directory","arguments":"{}"}}},{"type":"chunk","time":1791186684994,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186684994,"chunk":{"type":"finish","reason":{"kind":"tool-calls"}}}]},"surfaceOp":"append"} +{"type":"tool/call","data":{"turn":1,"step":7,"callId":"directory-7","name":"working_directory","arguments":"{}"}} +{"type":"tool/result","data":{"turn":1,"step":7,"message":{"role":"tool","source":{"kind":"tool","callId":"directory-7"},"toolCallId":"directory-7","content":[{"type":"text","text":"{{cwd}}"}],"isError":false,"id":"{{message:23}}"}},"sourceEventSeqs":[57],"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":7}} +{"type":"agent/inbox/spliced","data":{"target":"next-step","start":0,"removedCount":1,"inserted":[]}} +{"type":"step/start","data":{"turn":1,"step":8}} +{"type":"user/message","data":{"content":[{"type":"text","text":"The working directory \"{{cwd}}/second\" is unavailable. The working directory is now \"{{cwd}}\"."}],"source":{"kind":"working-directory"},"role":"user","id":"{{message:20}}"},"surfaceOp":"append"} +{"type":"assistant/message","data":{"turn":1,"step":8,"message":{"role":"assistant","content":[{"type":"text","text":"WORKING_DIRECTORY_OK"}],"source":{"kind":"model","provider":"deepseek-official","model":"deepseek-v4-flash"},"id":"{{message:24}}"},"usage":{"inputTokens":10,"outputTokens":5},"stream":[{"type":"chunk","time":1791186685015,"chunk":{"type":"block-start","index":0,"blockType":"text"}},{"type":"chunk","time":1791186685015,"chunk":{"type":"block-end","index":0,"block":{"type":"text","text":"WORKING_DIRECTORY_OK"}}},{"type":"chunk","time":1791186685015,"chunk":{"type":"usage","usage":{"inputTokens":10,"outputTokens":5}}},{"type":"chunk","time":1791186685015,"chunk":{"type":"finish","reason":{"kind":"stop"}}}]},"surfaceOp":"append"} +{"type":"step/end","data":{"turn":1,"step":8}} +{"type":"workspace/changes","data":{"turn":1}} +{"type":"turn/end","data":{"turn":1,"reason":{"kind":"completed"}}} diff --git a/snapshots/session/working-directory-consumers/snapshot.yml b/snapshots/session/working-directory-consumers/snapshot.yml new file mode 100644 index 0000000000..9958f8c29a --- /dev/null +++ b/snapshots/session/working-directory-consumers/snapshot.yml @@ -0,0 +1,10 @@ +version: 1 +scenario: working-directory-consumers +profile: headless +composition: claude-code-mods +recording: authored +header: + class: claude-code-mods +platform: posix +workspace: + final: true diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/input.txt b/snapshots/session/working-directory-consumers/workspace.expected/selected/input.txt new file mode 100644 index 0000000000..a1c2155342 --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace.expected/selected/input.txt @@ -0,0 +1 @@ +keep this file diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/mods-directory.json b/snapshots/session/working-directory-consumers/workspace.expected/selected/mods-directory.json new file mode 100644 index 0000000000..c2c27a8bbe --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace.expected/selected/mods-directory.json @@ -0,0 +1 @@ +{"directory":"selected","rootIsCurrent":false,"read":"selected witness\n","exists":true,"stat":"file","listed":true,"processCwdMatches":true} diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/result.txt b/snapshots/session/working-directory-consumers/workspace.expected/selected/result.txt new file mode 100644 index 0000000000..1dc18d3122 --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace.expected/selected/result.txt @@ -0,0 +1 @@ +created inside selected diff --git a/snapshots/session/working-directory-consumers/workspace.expected/selected/witness.txt b/snapshots/session/working-directory-consumers/workspace.expected/selected/witness.txt new file mode 100644 index 0000000000..eb04b8e4e0 --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace.expected/selected/witness.txt @@ -0,0 +1 @@ +selected witness diff --git a/snapshots/session/working-directory-consumers/workspace/second/witness.txt b/snapshots/session/working-directory-consumers/workspace/second/witness.txt new file mode 100644 index 0000000000..595987b80f --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace/second/witness.txt @@ -0,0 +1 @@ +second directory diff --git a/snapshots/session/working-directory-consumers/workspace/selected/input.txt b/snapshots/session/working-directory-consumers/workspace/selected/input.txt new file mode 100644 index 0000000000..a1c2155342 --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace/selected/input.txt @@ -0,0 +1 @@ +keep this file diff --git a/snapshots/session/working-directory-consumers/workspace/selected/witness.txt b/snapshots/session/working-directory-consumers/workspace/selected/witness.txt new file mode 100644 index 0000000000..eb04b8e4e0 --- /dev/null +++ b/snapshots/session/working-directory-consumers/workspace/selected/witness.txt @@ -0,0 +1 @@ +selected witness