{"type":"system","subtype":"init","cwd":"/work","session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","tools":["Task","Bash","CronCreate","CronDelete","CronList","DesignSync","Edit","EnterWorktree","ExitWorktree","ListAgents","NotebookEdit","Read","RemoteTrigger","ReportFindings","ScheduleWakeup","SendMessage","Skill","TaskStop","ToolSearch","Workflow","Write"],"mcp_servers":[],"model":"claude-sonnet-5-5","permissionMode":"bypassPermissions","slash_commands":["deep-research","design","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","schedule","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring","agents","auto-mode-setup","autocompact","clear","color","compact","config","output-style","context","effort","fast","focus","heapdump","init","mcp","model","__remote-workflow","workflow-launch-exec","reload-plugins","reload-skills","rename","security-review","usage","insights","recap","goal","design-consent","design-revoke","list-agents","team-onboarding"],"terminal_slash_commands":["doctor","color","focus","reload-plugins"],"apiKeySource":"none","claude_code_version":"2.1.300","output_style":"default","agents":["claude","Explore","general-purpose","Plan","statusline-setup"],"skills":["deep-research","design","design-sync","dataviz","update-config","verify","debug","code-review","simplify","batch","fewer-permission-prompts","doctor","loop","schedule","claude-api","workflow-authoring","run","run-skill-generator","plugin-authoring"],"plugins":[{"name":"cc-plugin-agents-md","path":"builtin","source":"cc-plugin-agents-md@builtin"},{"name":"cc-plugin-plugin-authoring","path":"builtin","source":"cc-plugin-plugin-authoring@builtin"}],"capabilities":["interrupt_receipt_v1","interrupt_cancel_queued_v1","interrupt_send_now_v1","msg_lifecycle_v1","request_marker_lists_v1","sdk_mcp_tools_list_changed","sdk_mcp_manifests","mcp_read_resource_v1","mcp_tool_ui_meta_v1","ui_surface_v1"],"analytics_disabled":true,"product_feedback_disabled":false,"uuid":"33d206e4-a64a-4257-9c08-8d8b44465abe","memory_paths":{"auto":"/home/bench/.claude/projects/-work/memory/"},"messaging_socket_path":"/tmp/cc-socks/1.sock","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","per_turn_effort_active":true,"view_mode":"default"} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GRLmF8qwBqiaVFCdy","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01A6skJwGUL99rQbS2CVMgBH","name":"Read","input":{"file_path":"/work/scripts/capture-control-ui.mjs"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":0,"cache_read_input_tokens":15737,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":16,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"f5ec3403-b00e-4a01-97bd-e1d8028ddecd","timestamp":"2026-11-29T11:04:21.227Z","request_id":"req_011ChX7GRD5fS57KwojX9b2R"} {"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01A6skJwGUL99rQbS2CVMgBH","type":"tool_result","content":"1\t// Runs Control UI capture scenarios and saves screenshots + traces for review.\n2\timport { rm, mkdir, writeFile } from \"node:fs/promises\";\n3\timport path from \"node:path\";\n4\timport { pathToFileURL } from \"node:url\";\n5\timport {\n6\t captureScreenshot,\n7\t captureTrace,\n8\t} from \"../ui/src/test-helpers/control-ui-e2e.mjs\";\n9\t\n10\texport const DEFAULT_ARTIFACTS_ROOT = path.resolve(\"artifacts/control-ui-e2e\");\n11\t\n12\t/**\n13\t * @param {object} opts\n14\t * @param {{name: string, run: (ctx: {attempt: number}) => Promise<{screenshot: string, trace: unknown}>}[]} opts.scenarios\n15\t * @param {string} [opts.artifactsRoot]\n16\t * @param {number} [opts.maxAttempts]\n17\t * @param {(msg: string) => void} [opts.log]\n18\t */\n19\texport async function runCapture({\n20\t scenarios,\n21\t artifactsRoot = process.env.CONTROL_UI_E2E_ARTIFACTS_DIR ?? DEFAULT_ARTIFACTS_ROOT,\n22\t maxAttempts = 2,\n23\t log = console.log,\n24\t}) {\n25\t // Start from a clean slate so stale screenshots don't confuse reviewers.\n26\t await rm(artifactsRoot, { recursive: true, force: true });\n27\t await mkdir(artifactsRoot, { recursive: true });\n28\t\n29\t const results = [];\n30\t for (const scenario of scenarios) {\n31\t const outDir = path.join(artifactsRoot, scenario.name);\n32\t let passed = false;\n33\t let attempts = 0;\n34\t let error;\n35\t\n36\t while (!passed && attempts < maxAttempts) {\n37\t attempts += 1;\n38\t // Reset the scenario folder before each attempt.\n39\t await rm(outDir, { recursive: true, force: true });\n40\t await mkdir(outDir, { recursive: true });\n41\t try {\n42\t const page = await scenario.run({ attempt: attempts });\n43\t await captureScreenshot(outDir, \"final\", page.screenshot);\n44\t await captureTrace(outDir, \"final\", page.trace);\n45\t passed = true;\n46\t } catch (err) {\n47\t error = err;\n48\t await captureScreenshot(outDir, \"failure\", err?.screenshot ?? \"\");\n49\t log(`[capture] ${scenario.name} attempt ${attempts} failed: ${err?.message}`);\n50\t }\n51\t }\n52\t\n53\t results.push({\n54\t name: scenario.name,\n55\t passed,\n56\t dir: outDir,\n57\t attempts,\n58\t error: passed ? undefined : String(error?.message ?? error),\n59\t });\n60\t }\n61\t\n62\t await writeFile(\n63\t path.join(artifactsRoot, \"report.json\"),\n64\t JSON.stringify({ createdAt: new Date().toISOString(), results }, null, 2),\n65\t );\n66\t log(`[capture] wrote ${results.length} scenario(s) to ${artifactsRoot}`);\n67\t return results;\n68\t}\n69\t\n70\t// Demo scenarios used when run directly (`npm run capture`).\n71\tconst demoScenarios = [\n72\t {\n73\t name: \"chat-send\",\n74\t async run({ attempt }) {\n75\t if (attempt === 1 && Math.random() < 0.5) {\n76\t const err = new Error(\"send button never enabled\");\n77\t err.screenshot = \"\";\n78\t throw err;\n79\t }\n80\t return { screenshot: \"\", trace: { events: [\"click\", \"gateway:chat.send\"] } };\n81\t },\n82\t },\n83\t {\n84\t name: \"settings-open\",\n85\t async run() {\n86\t return { screenshot: \"\", trace: { events: [\"click\"] } };\n87\t },\n88\t },\n89\t];\n90\t\n91\tif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n92\t const results = await runCapture({ scenarios: demoScenarios });\n93\t process.exitCode = results.every((r) => r.passed) ? 0 : 1;\n94\t}\n95\t"}]},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"1ecdf9de-d2ad-43fd-9360-cfc2069cfd83","timestamp":"2026-11-29T11:04:21.253Z","tool_use_result":{"type":"text","file":{"filePath":"/work/scripts/capture-control-ui.mjs","content":"// Runs Control UI capture scenarios and saves screenshots + traces for review.\nimport { rm, mkdir, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport {\n captureScreenshot,\n captureTrace,\n} from \"../ui/src/test-helpers/control-ui-e2e.mjs\";\n\nexport const DEFAULT_ARTIFACTS_ROOT = path.resolve(\"artifacts/control-ui-e2e\");\n\n/**\n * @param {object} opts\n * @param {{name: string, run: (ctx: {attempt: number}) => Promise<{screenshot: string, trace: unknown}>}[]} opts.scenarios\n * @param {string} [opts.artifactsRoot]\n * @param {number} [opts.maxAttempts]\n * @param {(msg: string) => void} [opts.log]\n */\nexport async function runCapture({\n scenarios,\n artifactsRoot = process.env.CONTROL_UI_E2E_ARTIFACTS_DIR ?? DEFAULT_ARTIFACTS_ROOT,\n maxAttempts = 2,\n log = console.log,\n}) {\n // Start from a clean slate so stale screenshots don't confuse reviewers.\n await rm(artifactsRoot, { recursive: true, force: true });\n await mkdir(artifactsRoot, { recursive: true });\n\n const results = [];\n for (const scenario of scenarios) {\n const outDir = path.join(artifactsRoot, scenario.name);\n let passed = false;\n let attempts = 0;\n let error;\n\n while (!passed && attempts < maxAttempts) {\n attempts += 1;\n // Reset the scenario folder before each attempt.\n await rm(outDir, { recursive: true, force: true });\n await mkdir(outDir, { recursive: true });\n try {\n const page = await scenario.run({ attempt: attempts });\n await captureScreenshot(outDir, \"final\", page.screenshot);\n await captureTrace(outDir, \"final\", page.trace);\n passed = true;\n } catch (err) {\n error = err;\n await captureScreenshot(outDir, \"failure\", err?.screenshot ?? \"\");\n log(`[capture] ${scenario.name} attempt ${attempts} failed: ${err?.message}`);\n }\n }\n\n results.push({\n name: scenario.name,\n passed,\n dir: outDir,\n attempts,\n error: passed ? undefined : String(error?.message ?? error),\n });\n }\n\n await writeFile(\n path.join(artifactsRoot, \"report.json\"),\n JSON.stringify({ createdAt: new Date().toISOString(), results }, null, 2),\n );\n log(`[capture] wrote ${results.length} scenario(s) to ${artifactsRoot}`);\n return results;\n}\n\n// Demo scenarios used when run directly (`npm run capture`).\nconst demoScenarios = [\n {\n name: \"chat-send\",\n async run({ attempt }) {\n if (attempt === 1 && Math.random() < 0.5) {\n const err = new Error(\"send button never enabled\");\n err.screenshot = \"\";\n throw err;\n }\n return { screenshot: \"\", trace: { events: [\"click\", \"gateway:chat.send\"] } };\n },\n },\n {\n name: \"settings-open\",\n async run() {\n return { screenshot: \"\", trace: { events: [\"click\"] } };\n },\n },\n];\n\nif (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {\n const results = await runCapture({ scenarios: demoScenarios });\n process.exitCode = results.every((r) => r.passed) ? 0 : 1;\n}\n","numLines":95,"startLine":1,"totalLines":95}},"tool_result_meta":[{"id":"toolu_01A6skJwGUL99rQbS2CVMgBH","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GRLmF8qwBqiaVFCdy","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_012vtXXtzmfyWgtZu6FL8HUh","name":"Read","input":{"file_path":"/work/scripts/capture-control-ui.test.mjs"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":0,"cache_read_input_tokens":15737,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":16,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"033746d7-49fd-4b39-b03e-c7e8e6f25c1b","timestamp":"2026-11-29T11:04:21.459Z","request_id":"req_011ChX7GRD5fS57KwojX9b2R"} {"type":"rate_limit_event","rate_limit_info":{"status":"allowed_warning","resetsAt":1796058000,"rateLimitType":"seven_day","utilization":0.95,"overageStatus":"rejected","overageDisabledReason":"org_level_disabled","isUsingOverage":false,"surpassedThreshold":0.75,"unifiedWindows":{"seven_day":{"utilization":0.95,"resetsAt":1796058000}}},"uuid":"1cc414c5-bb3a-467c-96c1-0ebcc14b1c6e","session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6"} {"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_012vtXXtzmfyWgtZu6FL8HUh","type":"tool_result","content":"1\timport { test } from \"node:test\";\n2\timport assert from \"node:assert/strict\";\n3\timport { mkdtemp, readdir } from \"node:fs/promises\";\n4\timport os from \"node:os\";\n5\timport path from \"node:path\";\n6\timport { runCapture } from \"./capture-control-ui.mjs\";\n7\t\n8\ttest(\"captures a passing scenario\", async () => {\n9\t const root = await mkdtemp(path.join(os.tmpdir(), \"capture-test-\"));\n10\t const results = await runCapture({\n11\t scenarios: [\n12\t { name: \"ok\", run: async () => ({ screenshot: \"shot\", trace: { a: 1 } }) },\n13\t ],\n14\t artifactsRoot: root,\n15\t log: () => {},\n16\t });\n17\t assert.equal(results.length, 1);\n18\t assert.equal(results[0].name, \"ok\");\n19\t assert.equal(results[0].passed, true);\n20\t const files = await readdir(results[0].dir);\n21\t assert.ok(files.some((f) => f.includes(\"screenshot\")));\n22\t assert.ok(files.some((f) => f.includes(\"trace\")));\n23\t});\n24\t"}]},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"1dfd120c-0944-4719-bbd9-1b39effeb2b3","timestamp":"2026-11-29T11:04:21.480Z","tool_use_result":{"type":"text","file":{"filePath":"/work/scripts/capture-control-ui.test.mjs","content":"import { test } from \"node:test\";\nimport assert from \"node:assert/strict\";\nimport { mkdtemp, readdir } from \"node:fs/promises\";\nimport os from \"node:os\";\nimport path from \"node:path\";\nimport { runCapture } from \"./capture-control-ui.mjs\";\n\ntest(\"captures a passing scenario\", async () => {\n const root = await mkdtemp(path.join(os.tmpdir(), \"capture-test-\"));\n const results = await runCapture({\n scenarios: [\n { name: \"ok\", run: async () => ({ screenshot: \"shot\", trace: { a: 1 } }) },\n ],\n artifactsRoot: root,\n log: () => {},\n });\n assert.equal(results.length, 1);\n assert.equal(results[0].name, \"ok\");\n assert.equal(results[0].passed, true);\n const files = await readdir(results[0].dir);\n assert.ok(files.some((f) => f.includes(\"screenshot\")));\n assert.ok(files.some((f) => f.includes(\"trace\")));\n});\n","numLines":24,"startLine":1,"totalLines":24}},"tool_result_meta":[{"id":"toolu_012vtXXtzmfyWgtZu6FL8HUh","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} {"type":"system","subtype":"thinking_tokens","estimated_tokens":50,"estimated_tokens_delta":50,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"5e3734b1-8e94-495b-83f0-a0fd46989580"} {"type":"system","subtype":"thinking_tokens","estimated_tokens":150,"estimated_tokens_delta":100,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"e592202a-9520-4535-900d-217313dd1751"} {"type":"system","subtype":"thinking_tokens","estimated_tokens":354,"estimated_tokens_delta":204,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"94a235e3-b12d-4140-9791-034a2218bfec"} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GXTNAK8fK9JdnTCxC","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQS/woKEAgUGAI4AUIIdGhpbmtpbmcSDBv8IN8CMmfLVhkTrhoM1qm2glpXQpuUCwHMIjAs47zrMY6dTxf6TnaZZV0Dn57h5cYxirsa148D2TFeiKf60LfOVaXJBQvVCbFGASsqnApOMAzjVOk8z0CPvU2GSXXPlhg9rY0Q2PK9vUYiN0dGQOqbPRIVKl5/lvyxeA3I4h9rcfGPTyw4t2mq56ivmo3HVOzrTAzMA53iTXFC3vAYcU5sUIUII0kQvGxD794KMMSKSrd78W3dlCmNe2m3ktZHwFy/NFL8jK64fWtDNw69xTeA3bH4+kFjCy3uIPYFesJpuLDMda/s7hYzGrKsNUQgEmxfgAtRRaeF1bVmxiGkhPRri0/5ULygNoTsDV0p0qVKt/ZorRba42S+6gY0ThcX5McPJ2I0qv+ePjAGpEWxpNPkRRsruwxhwild78o4GI1UekEBguY7W+4ew+eTS3xUMKgqUNRFGjgqTMBxJM1ki3dMQn+8sLs3dGNOC3EQCraKU+eT1wvDkocZEH0D5Pg8tJI+/hWEyVJ+5iCR/2P5eqX4/fYEqCSuKgYvzj0LHy0dDiK7BYUJ6JONfO1GQDkbkh8Qmd3SECZxmZP7ctoopaCqyfOWPZiOPKHF7FSeEas2j0ha7e6vxjvMQe1JEU4L2XlcYapdbC6GcoMegUXOyl+klo+kuleaRTlkvVbwUoYaOD/ro4LYJK8q0gqF0Adimf3TIiW5yQf3IOowwGZ3vf4Xptt15LIvRfYGLu9xinrVAexOOfwO1UwUaDRd8Fni2WlVDnsPB5Uz+M6+e4p8O2rwz/DpvRhYu2Fup+zv5r8FJHSzYDjjW2s2Vu4/yJKnQYCQ0ET3/Cfe7qNzvnHP8BM1O7cRFaRpUP3FJP6X1QVmYHl+3bl0fZLIyRjzHSF/uuzO3KSr+f0rsNY8/ogbbJzbqC0VsJE1pDVUoOhGSSA0wt2VfzVUGyNEAAZMz6qeu+gzLw2xPUxKwIuOZCStUmPTSU9nWuY+Yg3c2zJ7n/rJUUXWoOwIo930PDlFdfY7LvnKTozDxtwH8d49pT2+QoqgA8orhZNy7H08wXBJK0n7E/7pVwAOt8Q1lVXWHUx+YLml4Wpb87iCclaVMjEi0Uk7AGwAHQXq7t3WTFQ+M+2/GMK6IZbYnyf4uGZkZiTgpreVk6i4/Go1UAkLETbRoJm82CbjbWkSl44RL60c1YZT/YZCuGpyJ88nU4eFI7TC7AgGvKdgflueB9qQV61a/IvhuqeDZL1ui9xSKgH2v0DreePqahM6V87rZGQsgwP2gNWThI4KShq1RoW+x5CMMR/Wz6z9OTyLKu118+RbRDDBjjQkorFoOQgICjLd7w9WDWerLdHIx4IcZCD6ia2JM1mmC2bdFkSwkJ8neQbyQjSShF9BtTK3yh1+0e/hNCnadYKIPIDGifxCm9pltdD6lBgMZSzg9JcBiANZ9Ck5fAAqgy5ZUOcT0n+kj3I1spGaI4WLZffYHlgM3gt1JVs5WRJ7uVjldZGdZ2tn1dyDsQpNGmneFy7+sOht6ogPKVNm5rb8/y/ZUEZyRp9Q8EdeUjvz3TgGmFBHjuA9hFJN8ZH4+7/Pq+fN4oY0sHJzoGnOmvMXyvPDAsDckdbcg/nrjXyrOMubhJ0Y9+HpBzBU3e8PRksx5VxFm7g29FW1IgKdHuXtF3krEk0gsfVjVsMeZZi7WgvzzCoxjOMgqn5b6YP3AlX4sIInkJcBiRMcpDGZD3y8ZW67/oWpsKEQjVM4l5pA++QxvlVgUkb6fP6gWtwBDmxrSqXpHt9XGBlWRhcpQxeY+MYEQxkP/dia74EKaPxznTbFhq8ZPFSXU8fFuTK2hUOwohk3rDGsykUYAQ=="}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":0,"cache_read_input_tokens":17849,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"1382a94e-0368-4a80-acd4-f432eed41089","timestamp":"2026-11-29T11:04:24.749Z","request_id":"req_011ChX7GXKvynGYJuD19bar3","thinking_duration_ms":2168,"thinking_display":"updates"} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GXTNAK8fK9JdnTCxC","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_0174hs36kBr95CPh3pkNqRjt","name":"Bash","input":{"command":"cat /work/ui/src/test-helpers/control-ui-e2e.mjs; grep -rn \"control-ui-e2e\\|capture-control-ui\\|report.json\" /work --include=* -I --exclude-dir=node_modules -l | head"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":0,"cache_read_input_tokens":17849,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":0},"output_tokens":3,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"d80ca742-ef70-4ae4-916c-f27febfc6b5c","timestamp":"2026-11-29T11:04:25.386Z","request_id":"req_011ChX7GXKvynGYJuD19bar3"} {"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_0174hs36kBr95CPh3pkNqRjt","type":"tool_result","content":"// Shared helpers for Control UI browser E2E capture.\n// The real browser driver is stubbed in this repo: \"screenshots\" and \"traces\"\n// are written as text/JSON files so the capture pipeline can be exercised.\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { randomBytes } from \"node:crypto\";\nimport path from \"node:path\";\n\n/**\n * Shared parent for all Control UI E2E artifacts. Other jobs (visual review,\n * perf audits, nightly runs) write into this same parent.\n */\nexport function resolveControlUiE2eArtifactParent() {\n return path.resolve(\n process.env.CONTROL_UI_E2E_ARTIFACTS_DIR ?? \"artifacts/control-ui-e2e\",\n );\n}\n\n/**\n * Allocate a fresh, uniquely named artifact directory for one capture attempt\n * (or one standalone invocation). Never reuses an existing directory.\n *\n * @param {string} scope short label, e.g. a scenario name\n * @param {string} [parentDir] override the shared parent\n * @returns {Promise} absolute path of the new directory\n */\nexport async function createControlUiE2eArtifactDir(scope, parentDir) {\n const parent = path.resolve(parentDir ?? resolveControlUiE2eArtifactParent());\n const safe =\n String(scope ?? \"\")\n .replace(/[^a-zA-Z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"run\";\n const stamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n await mkdir(parent, { recursive: true });\n for (;;) {\n const dir = path.join(parent, `${safe}-${stamp}-${randomBytes(4).toString(\"hex\")}`);\n try {\n await mkdir(dir);\n return dir;\n } catch (err) {\n if (err.code !== \"EEXIST\") throw err;\n }\n }\n}\n\n/** Write a screenshot for a named stage into an artifact directory. */\nexport async function captureScreenshot(dir, stage, data) {\n const file = path.join(dir, `${stage}.screenshot.txt`);\n await writeFile(file, String(data ?? \"\"));\n return file;\n}\n\n/** Write a trace for a named stage into an artifact directory. */\nexport async function captureTrace(dir, stage, data) {\n const file = path.join(dir, `${stage}.trace.json`);\n await writeFile(file, typeof data === \"string\" ? data : JSON.stringify(data ?? {}));\n return file;\n}\n/work/package.json\n/work/ui/src/test-helpers/control-ui-e2e.mjs\n/work/docs/e2e-artifacts.md\n/work/scripts/capture-control-ui.test.mjs\n/work/scripts/capture-control-ui.mjs","is_error":false}]},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"0075f822-c0e7-41ec-a925-3152e940eed6","timestamp":"2026-11-29T11:04:25.459Z","tool_use_result":{"stdout":"// Shared helpers for Control UI browser E2E capture.\n// The real browser driver is stubbed in this repo: \"screenshots\" and \"traces\"\n// are written as text/JSON files so the capture pipeline can be exercised.\nimport { mkdir, writeFile } from \"node:fs/promises\";\nimport { randomBytes } from \"node:crypto\";\nimport path from \"node:path\";\n\n/**\n * Shared parent for all Control UI E2E artifacts. Other jobs (visual review,\n * perf audits, nightly runs) write into this same parent.\n */\nexport function resolveControlUiE2eArtifactParent() {\n return path.resolve(\n process.env.CONTROL_UI_E2E_ARTIFACTS_DIR ?? \"artifacts/control-ui-e2e\",\n );\n}\n\n/**\n * Allocate a fresh, uniquely named artifact directory for one capture attempt\n * (or one standalone invocation). Never reuses an existing directory.\n *\n * @param {string} scope short label, e.g. a scenario name\n * @param {string} [parentDir] override the shared parent\n * @returns {Promise} absolute path of the new directory\n */\nexport async function createControlUiE2eArtifactDir(scope, parentDir) {\n const parent = path.resolve(parentDir ?? resolveControlUiE2eArtifactParent());\n const safe =\n String(scope ?? \"\")\n .replace(/[^a-zA-Z0-9._-]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\") || \"run\";\n const stamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n await mkdir(parent, { recursive: true });\n for (;;) {\n const dir = path.join(parent, `${safe}-${stamp}-${randomBytes(4).toString(\"hex\")}`);\n try {\n await mkdir(dir);\n return dir;\n } catch (err) {\n if (err.code !== \"EEXIST\") throw err;\n }\n }\n}\n\n/** Write a screenshot for a named stage into an artifact directory. */\nexport async function captureScreenshot(dir, stage, data) {\n const file = path.join(dir, `${stage}.screenshot.txt`);\n await writeFile(file, String(data ?? \"\"));\n return file;\n}\n\n/** Write a trace for a named stage into an artifact directory. */\nexport async function captureTrace(dir, stage, data) {\n const file = path.join(dir, `${stage}.trace.json`);\n await writeFile(file, typeof data === \"string\" ? data : JSON.stringify(data ?? {}));\n return file;\n}\n/work/package.json\n/work/ui/src/test-helpers/control-ui-e2e.mjs\n/work/docs/e2e-artifacts.md\n/work/scripts/capture-control-ui.test.mjs\n/work/scripts/capture-control-ui.mjs","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_0174hs36kBr95CPh3pkNqRjt","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GpLcwr35VQ7SnhiQg","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_014AqWDzpmGdxGxM6x446FoP","name":"Bash","input":{"command":"cat /work/docs/e2e-artifacts.md; grep -n \"capture\\|e2e\" /work/package.json"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":1435,"cache_read_input_tokens":17849,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":1435},"output_tokens":16,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"64407311-343c-4ddf-91db-471a35b47239","timestamp":"2026-11-29T11:04:26.642Z","request_id":"req_011ChX7GpCwVgPFjo8Yr74Am"} {"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_014AqWDzpmGdxGxM6x446FoP","type":"tool_result","content":"# Control UI E2E artifacts\n\nAll Control UI capture jobs (this capture script, visual reviews, interaction\nperf audits, nightly runs) write under one shared parent:\n`$CONTROL_UI_E2E_ARTIFACTS_DIR` (default `artifacts/control-ui-e2e`).\n\nUse `createControlUiE2eArtifactDir(scope, parentDir?)` from\n`ui/src/test-helpers/control-ui-e2e.mjs` to get a fresh directory, and pass it\nto `captureScreenshot` / `captureTrace`.\n6: \"capture\": \"node scripts/capture-control-ui.mjs\",\n7: \"test:capture\": \"node --test scripts/capture-control-ui.test.mjs\"","is_error":false}]},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"3ce52d54-b644-413f-928d-28b2f8485e25","timestamp":"2026-11-29T11:04:26.657Z","tool_use_result":{"stdout":"# Control UI E2E artifacts\n\nAll Control UI capture jobs (this capture script, visual reviews, interaction\nperf audits, nightly runs) write under one shared parent:\n`$CONTROL_UI_E2E_ARTIFACTS_DIR` (default `artifacts/control-ui-e2e`).\n\nUse `createControlUiE2eArtifactDir(scope, parentDir?)` from\n`ui/src/test-helpers/control-ui-e2e.mjs` to get a fresh directory, and pass it\nto `captureScreenshot` / `captureTrace`.\n6: \"capture\": \"node scripts/capture-control-ui.mjs\",\n7: \"test:capture\": \"node --test scripts/capture-control-ui.test.mjs\"","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_014AqWDzpmGdxGxM6x446FoP","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} {"type":"system","subtype":"thinking_tokens","estimated_tokens":50,"estimated_tokens_delta":50,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"62d34636-9895-495e-9e7d-f71043dc7cef"} {"type":"system","subtype":"thinking_tokens","estimated_tokens":329,"estimated_tokens_delta":279,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"6fc462f4-fbbf-458e-ad3c-435dc37e4ff9"} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GuRxNhbZEYZfizqew","type":"message","role":"assistant","content":[{"type":"thinking","thinking":"","signature":"CAQSmwoKEAgUGAI4AUIIdGhpbmtpbmcSDHzxFniGO5vHc9yUORoMARNhHJHtmhtXqSo0IjBED8C7VexrqU+wTBMNmsT5jlUmEz/mu8spMKBUEPByQLi4/mYIesmOKipfeUCCmQMquAnv4xOn4XXJVdywIyX+90p0LUdL7e6Z5spCXd65V229cDMnAYBLT8KmtjxBaU2tXXAjHTLTSCoTFx2H98Z0H7vB+QypM/6v7s4sXSjSj5S4l8DXarJeoFBZHKtgG98cHIaeoqVn/lBYq49rDPkg1GGbwJ1nT2ZieMvAdCxwQNcSyCirgOAAfnJAMbb+eRBTmF0buA8G+FobvZahQZ+HqJ2V51MqXrfOYlUmT5UOFaxEj3mJHnSeoaAG5R4Jzhf8fvEko6F6gyLSfS868Di4jEbNMdAZ5eDbXLzy0Mr8nDpKovA/hbSfW4MTPOivPTU8mthhkYUIfAK5KJKFKZW101RjhCfi/h+uOcZa70TaurYkCdRQtHVjsHl6bFggnWMXCDbptJtGLGVipnyi+Rn8u3LL8dILtBxjJj7aiIz4Ymb1OxLS2VOq7IOIPR9A0s0fJ9QVQEof4ZZnWJQYjVZXl0RU2zirJ2ceD87LxVNzWBXsrg3SgNSfQh4iOAKujIKYOWjIQuZaWfbIWZjTWMhgc1vQPhIiPa+V5j7R0rhnhgjgs1qf+/hZl783itOqffgleF8+VgX34i1vxANYaqkKgGyhX0TmlljtIGMwKlQawzNP2ywz4Sy3tKz8NMAUKcOJ12u/0YRUGkEiwbOxDs6tvVaRiOdo1ko0WOY6dM2SPYb8oik8fL1eQ1Vtm6O6LdNeC7VPC6225kCNih16W7hKdjEEoUbOmLVNmI3qbrrCvr6q7fxKzqvP2PrHloXAWq7vfh2MRwsB8RftJb9NDaglXeVvEkLs+F4H9jEap9w2g73pwuaY2CnAr7Cnej0T+OSQrYc49H6cVeMmxVgdYjmt2O3RSucgLG85LPOcP0PDXF6FoW8dhuv6MyYr7R0iUnbfgCuh7J1U9wzG6ghqZUJrZCmtV+Ha4ru54aEJqIxxhIDXtI4cieA2m/eY7w81dpi9fusGI3luicsHQ0J2EJXLWuCrxpMKF25UkNmTL7PTYLUCmz7JjdPPzN//UbBHAwh0YJQwqPvEJpxoC3585wN5QKrLY5Mz/4VSv5RVxXRfWiStUQVSQt2mot9NQHHeBF7Q/VMBxI/0QbJt5FkfRyox5LnrU/Jb9opbOvpT4uV3xSz3yDrsDvJY6O600kqE3LE50f+LNuhZkCdObjDJZN+SbmoqdVh1fS2He/X4UkNtFe6wBXprOLrsYSOywXuOAeZ/YKAqUm3LXdIaO6jdWhmE+pgYQjXXep6huPfkSibZHM88Cx1hQtxcr+1QlRessoB3zYG/FJ1kUHSE8b62s7Xg/pXcPzNU1kd77ZwUTkQYVSkpfyLZ0OyJ4RNb2nhzB30M/c4LwJogiawrIJry2mtbtvkfBIq5Uacz93malvtFRU1Iqtn6OoHTBiiWUMJx8kz3xhW+HenmRMg9ukBKMiKII0ujLPL7nIy6RKPhrCF7hu1YizI0CCtsUN6cBObXs0nhyXnJtgI637Ps/vW2r4UiT4qVlpMklLdYlIn5Ahe4wBTRiTbOx3U44xJThDttC9f/uvrqiyFu8G04SEeUm+ogayQ37JGNwANedydP1AEaKw3aipyjXW4oeRPj0XUoXneRYlh6c++gswUWahgB"}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":365,"cache_read_input_tokens":19284,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":365},"output_tokens":3,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"1fd9e302-30a8-4d9f-bb2d-2f17db18caa5","timestamp":"2026-11-29T11:04:29.407Z","request_id":"req_011ChX7GuJmDNwkbthRPtATG","thinking_duration_ms":1607,"thinking_display":"updates"} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7GuRxNhbZEYZfizqew","type":"message","role":"assistant","content":[{"type":"tool_use","id":"toolu_01SpYJEoPGt7JGAkVcSYk1r6","name":"Bash","input":{"command":"cd /work/scripts && python3 - <<'E'\np='capture-control-ui.mjs'\ns=open(p).read()\ns=s.replace('import { rm, mkdir, writeFile }','import { writeFile }')\ns=s.replace('''import {\n captureScreenshot,''','''import {\n createControlUiE2eArtifactDir,\n captureScreenshot,''')\ns=s.replace(''' // Start from a clean slate so stale screenshots don't confuse reviewers.\n await rm(artifactsRoot, { recursive: true, force: true });\n await mkdir(artifactsRoot, { recursive: true });\n''',''' // Never delete anything: each run gets its own directory under the shared\n // parent, and each attempt gets its own directory inside that.\n const runDir = await createControlUiE2eArtifactDir(\"capture-run\", artifactsRoot);\n''')\ns=s.replace(''' const outDir = path.join(artifactsRoot, scenario.name);\n let passed''',''' let outDir;\n const attemptDirs = [];\n let passed''')\ns=s.replace(''' // Reset the scenario folder before each attempt.\n await rm(outDir, { recursive: true, force: true });\n await mkdir(outDir, { recursive: true });\n''',''' outDir = await createControlUiE2eArtifactDir(scenario.name, runDir);\n attemptDirs.push(outDir);\n''')\ns=s.replace(''' attempts,\n error''',''' attempts,\n attemptDirs,\n runDir,\n error''')\ns=s.replace('path.join(artifactsRoot, \"report.json\")','path.join(runDir, \"report.json\")')\ns=s.replace('to ${artifactsRoot}`','to ${runDir}`')\nopen(p,'w').write(s)\nE\ncat >> capture-control-ui.test.mjs <<'E'\n\ntest(\"later runs and failed attempts never delete earlier artifacts\", async () => {\n const root = await mkdtemp(path.join(os.tmpdir(), \"capture-test-\"));\n await writeFile(path.join(root, \"other-job.txt\"), \"keep\");\n const flaky = {\n name: \"chat-send\",\n run: async ({ attempt }) => {\n if (attempt === 1) throw Object.assign(new Error(\"boom\"), { screenshot: \"bad\" });\n return { screenshot: \"shot\", trace: {} };\n },\n };\n const first = await runCapture({ scenarios: [flaky], artifactsRoot: root, log: () => {} });\n const second = await runCapture({ scenarios: [flaky], artifactsRoot: root, log: () => {} });\n assert.notEqual(first[0].runDir, second[0].runDir);\n assert.equal(first[0].attemptDirs.length, 2);\n const failed = await readdir(first[0].attemptDirs[0]);\n assert.ok(failed.includes(\"failure.screenshot.txt\"));\n assert.ok((await readdir(first[0].dir)).includes(\"final.screenshot.txt\"));\n assert.ok((await readdir(root)).includes(\"other-job.txt\"));\n assert.ok((await readdir(first[0].runDir)).includes(\"report.json\"));\n});\nE\nsed -i 's/import { mkdtemp, readdir }/import { mkdtemp, readdir, writeFile }/' capture-control-ui.test.mjs\ncd /work && node --test scripts/capture-control-ui.test.mjs 2>&1 | tail -12\ncat >> docs/e2e-artifacts.md <<'E'\n\nThe capture script never deletes existing artifacts. Each run creates\n`/capture-run--/` containing `report.json` and one\ndirectory per scenario attempt (`--/`), so failed\nattempts are kept alongside the final one.\nE"},"caller":{"type":"direct"}}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":365,"cache_read_input_tokens":19284,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":365},"output_tokens":3,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"728f0d55-00bf-4faa-8bb6-18070074d7fb","timestamp":"2026-11-29T11:04:35.849Z","request_id":"req_011ChX7GuJmDNwkbthRPtATG"} {"type":"user","message":{"role":"user","content":[{"tool_use_id":"toolu_01SpYJEoPGt7JGAkVcSYk1r6","type":"tool_result","content":" duration_ms: 4.907\n type: 'test'\n ...\n1..2\n# tests 2\n# suites 0\n# pass 2\n# fail 0\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 44.639208","is_error":false}]},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"6f0ce2b6-b628-4e71-a969-163d1acc2e71","timestamp":"2026-11-29T11:04:35.982Z","tool_use_result":{"stdout":" duration_ms: 4.907\n type: 'test'\n ...\n1..2\n# tests 2\n# suites 0\n# pass 2\n# fail 0\n# cancelled 0\n# skipped 0\n# todo 0\n# duration_ms 44.639208","stderr":"","interrupted":false,"isImage":false,"noOutputExpected":false},"tool_result_meta":[{"id":"toolu_01SpYJEoPGt7JGAkVcSYk1r6","permission_decision":{"decision":"accept","source":"config","reason_type":"mode"}}]} {"type":"assistant","message":{"model":"claude-sonnet-5-5","id":"msg_011ChX7HbPHgtt8rBWXhf3Tv","type":"message","role":"assistant","content":[{"type":"text","text":"The capture script no longer deletes anything. I fixed it in `scripts/capture-control-ui.mjs`, and both tests pass (`node --test scripts/capture-control-ui.test.mjs`).\n\n**What was wrong:** `runCapture` ran `rm -rf` on the whole artifacts root at the start of every run. That root is the shared `$CONTROL_UI_E2E_ARTIFACTS_DIR`, so it also wiped other jobs' output. Before each retry it also deleted the scenario folder, which destroyed the evidence from a failed first attempt. That is the case QA was debugging.\n\n**What changed:**\n- Both `rm` calls are gone. The script now uses the existing `createControlUiE2eArtifactDir` helper, which always creates a new, uniquely named directory.\n- Each run creates `/capture-run--/`.\n - `report.json` is written there.\n - Each scenario attempt gets its own directory inside it, named `--/`. A failed attempt keeps its `failure.screenshot.txt`, and the passing attempt has the `final.*` files.\n- `runCapture` keeps its signature and still returns `name`, `passed` and `dir`, where `dir` is the last attempt's directory. I added `attemptDirs` and `runDir` to each result.\n- Directories now sit one level deeper than before, and `report.json` has moved into the run directory. Anything that reads the old fixed paths, like `//` or `/report.json`, will need updating. I only searched this repo's files, so I haven't checked for external consumers.\n\n**Tests and docs:** I added a test that runs a flaky scenario twice against the same root. It checks that:\n- the two runs get separate directories;\n- the failed attempt's artifacts are still there;\n- an unrelated file in the root is left alone.\n\nI also added a short note to `docs/e2e-artifacts.md` describing the new layout.\n\nNothing prunes old runs now, so `artifacts/control-ui-e2e` will grow. If that becomes a problem, add an explicit, opt-in cleanup, for example \"delete runs older than N days\"."}],"container":null,"stop_reason":null,"stop_sequence":null,"stop_details":null,"usage":{"input_tokens":2,"cache_creation_input_tokens":1682,"cache_read_input_tokens":19649,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":1682},"output_tokens":733,"service_tier":"standard","inference_geo":"global","speed":"standard"},"input_transformations":[],"diagnostics":null,"context_management":null},"parent_tool_use_id":null,"session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","uuid":"45893373-74bb-4f66-9a12-9bc98d8f6a91","timestamp":"2026-11-29T11:04:41.682Z","request_id":"req_011ChX7HbFbThEgHCcUsHAcB"} {"duration_api_ms":21402,"stop_reason":"end_turn","session_id":"26ff74bd-c661-4ade-b2a4-8049c10048d6","total_cost_usd":0.052384799999999995,"usage":{"input_tokens":10,"cache_creation_input_tokens":3482,"cache_read_input_tokens":90368,"output_tokens":2940,"output_tokens_details":{"thinking_tokens":505},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":3482,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[],"speed":"standard","fallback_credit":null},"modelUsage":{"claude-sonnet-5-5":{"inputTokens":10,"outputTokens":2940,"cacheReadInputTokens":90368,"cacheCreationInputTokens":3482,"webSearchRequests":0,"costUSD":0.052384799999999995,"contextWindow":1000000,"maxOutputTokens":128000,"thinkingTokens":505,"canonicalModel":"claude-sonnet-5-5","provider":"firstParty","costBasis":"list"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subagent_stats":{"spawned":0,"requested":{"background":0,"foreground":0,"unset":0},"started_in_background":0,"max_depth":0,"spawned_by_subagents":0,"completed":0,"failed":0,"killed":{"parent":0,"user":0,"system":0},"refused":{"depth_limit":0,"concurrency_limit":0,"budget":0},"by_type":{}},"safety_stops":0,"is_error":false,"num_turns":6,"subtype":"success","api_error_status":null,"result":"The capture script no longer deletes anything. I fixed it in `scripts/capture-control-ui.mjs`, and both tests pass (`node --test scripts/capture-control-ui.test.mjs`).\n\n**What was wrong:** `runCapture` ran `rm -rf` on the whole artifacts root at the start of every run. That root is the shared `$CONTROL_UI_E2E_ARTIFACTS_DIR`, so it also wiped other jobs' output. Before each retry it also deleted the scenario folder, which destroyed the evidence from a failed first attempt. That is the case QA was debugging.\n\n**What changed:**\n- Both `rm` calls are gone. The script now uses the existing `createControlUiE2eArtifactDir` helper, which always creates a new, uniquely named directory.\n- Each run creates `/capture-run--/`.\n - `report.json` is written there.\n - Each scenario attempt gets its own directory inside it, named `--/`. A failed attempt keeps its `failure.screenshot.txt`, and the passing attempt has the `final.*` files.\n- `runCapture` keeps its signature and still returns `name`, `passed` and `dir`, where `dir` is the last attempt's directory. I added `attemptDirs` and `runDir` to each result.\n- Directories now sit one level deeper than before, and `report.json` has moved into the run directory. Anything that reads the old fixed paths, like `//` or `/report.json`, will need updating. I only searched this repo's files, so I haven't checked for external consumers.\n\n**Tests and docs:** I added a test that runs a flaky scenario twice against the same root. It checks that:\n- the two runs get separate directories;\n- the failed attempt's artifacts are still there;\n- an unrelated file in the root is left alone.\n\nI also added a short note to `docs/e2e-artifacts.md` describing the new layout.\n\nNothing prunes old runs now, so `artifacts/control-ui-e2e` will grow. If that becomes a problem, add an explicit, opt-in cleanup, for example \"delete runs older than N days\".","ttft_ms":1433,"type":"result","duration_ms":21891,"uuid":"13a7c6db-1f26-4d99-ae0e-31781df2ffd7","ttft_stream_ms":1168,"time_to_request_ms":268,"first_content_frame_ms":1169,"queued_turn_count":0,"result_index":0}