conversation-session-dynamic-workflow-gray-always-on-artifacts.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-dynamic-workflow-gray-always-on-artifacts",
  4. "spec": "./test/e2e/conversation-session/workflows/conversation-session-dynamic-workflow-gray-always-on-artifacts.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "dwk-title",
  8. "metadata": {
  9. "kind": "common",
  10. "source": "synthetic",
  11. "timingPolicy": "fast-text",
  12. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  13. },
  14. "match": {
  15. "method": "POST",
  16. "pathIncludes": "/messages",
  17. "bodyExcludes": [],
  18. "bodyIncludes": ["Generate a concise title", "E2E_DWK_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "headers": {
  23. "content-type": "application/json; charset=utf-8"
  24. },
  25. "body": "{\"id\":\"msg_upstream_e2e_text\",\"type\":\"message\",\"role\":\"assistant\",\"model\":\"deepseek-v4-flash\",\"content\":[{\"type\":\"text\",\"text\":\"{\\\"title\\\":\\\"工作流产物 E2E\\\"}\"}],\"stop_reason\":\"end_turn\",\"stop_sequence\":null,\"usage\":{\"input_tokens\":128,\"cache_creation_input_tokens\":0,\"cache_read_input_tokens\":0,\"output_tokens\":12,\"service_tier\":\"standard\"}}"
  26. }
  27. },
  28. {
  29. "id": "dwk-a-notified",
  30. "metadata": {
  31. "kind": "main",
  32. "source": "synthetic",
  33. "timingPolicy": "fast-text",
  34. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  35. },
  36. "match": {
  37. "method": "POST",
  38. "pathIncludes": "/messages",
  39. "bodyExcludes": [
  40. "Generate a concise title",
  41. "CRITICAL: Respond with TEXT ONLY",
  42. "You are now acting as the memory extraction subagent"
  43. ],
  44. "lastUserMessageIncludes": ["<task-notification>", "E2E_DWK_A_RESULT"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "text": "E2E_DWK_A_DIGESTED 工作流已完成:笔记与分数表已交付。"
  49. }
  50. },
  51. {
  52. "id": "dwk-b-notified",
  53. "metadata": {
  54. "kind": "main",
  55. "source": "synthetic",
  56. "timingPolicy": "fast-text",
  57. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  58. },
  59. "match": {
  60. "method": "POST",
  61. "pathIncludes": "/messages",
  62. "bodyExcludes": [
  63. "Generate a concise title",
  64. "CRITICAL: Respond with TEXT ONLY",
  65. "You are now acting as the memory extraction subagent"
  66. ],
  67. "lastUserMessageIncludes": ["<task-notification>", "E2E_DWK_B_RESULT"]
  68. },
  69. "response": {
  70. "statusCode": 200,
  71. "text": "E2E_DWK_B_DIGESTED 工作流已完成:看板已更新。"
  72. }
  73. },
  74. {
  75. "id": "dwk-c-notified",
  76. "metadata": {
  77. "kind": "main",
  78. "source": "synthetic",
  79. "timingPolicy": "fast-text",
  80. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  81. },
  82. "match": {
  83. "method": "POST",
  84. "pathIncludes": "/messages",
  85. "bodyExcludes": [
  86. "Generate a concise title",
  87. "CRITICAL: Respond with TEXT ONLY",
  88. "You are now acting as the memory extraction subagent"
  89. ],
  90. "lastUserMessageIncludes": ["<task-notification>", "E2E_DWK_BAD_BOARD"]
  91. },
  92. "response": {
  93. "statusCode": 200,
  94. "text": "E2E_DWK_C_DIGESTED 工作流出错:看板定义不合法。"
  95. }
  96. },
  97. {
  98. "id": "dwk-a-skill",
  99. "metadata": {
  100. "kind": "main",
  101. "source": "synthetic",
  102. "timingPolicy": "fast-text",
  103. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  104. },
  105. "match": {
  106. "method": "POST",
  107. "pathIncludes": "/messages",
  108. "bodyExcludes": [
  109. "Generate a concise title",
  110. "CRITICAL: Respond with TEXT ONLY",
  111. "You are now acting as the memory extraction subagent",
  112. "toolu_dwk_a_skill"
  113. ],
  114. "lastUserMessageIncludes": ["E2E_DWK_A_START"]
  115. },
  116. "response": {
  117. "statusCode": 200,
  118. "toolUse": {
  119. "id": "toolu_dwk_a_skill",
  120. "name": "Skill",
  121. "input": {
  122. "skill": "dynamic-workflows"
  123. }
  124. }
  125. },
  126. "maxMatches": 1
  127. },
  128. {
  129. "id": "dwk-a-create",
  130. "metadata": {
  131. "kind": "main",
  132. "source": "synthetic",
  133. "timingPolicy": "fast-text",
  134. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  135. },
  136. "match": {
  137. "method": "POST",
  138. "pathIncludes": "/messages",
  139. "bodyExcludes": [
  140. "Generate a concise title",
  141. "CRITICAL: Respond with TEXT ONLY",
  142. "You are now acting as the memory extraction subagent",
  143. "toolu_dwk_a_create"
  144. ],
  145. "bodyIncludes": ["E2E_DWK_A_START", "toolu_dwk_a_skill"]
  146. },
  147. "response": {
  148. "statusCode": 200,
  149. "toolUse": {
  150. "id": "toolu_dwk_a_create",
  151. "name": "CreateWorkflow",
  152. "input": {
  153. "name": "E2E 产物交付",
  154. "script": "phase(\"起草\");\nawait artifact.markdown(\"dwk-notes\", \"# E2E 笔记 v1\\n\\nE2E_DWK_NOTES_V1 初稿。\\n\", { title: \"E2E 笔记\", description: \"E2E 两版笔记的说明\", primary: true });\n// 闸:第一版发布后停住,让用例先看到只有一版的产物条。\nawait world.run(\"node\", [\"-e\", \"const fs = require(\\\"node:fs\\\"); const timer = setInterval(() => { if (fs.existsSync(\\\"{{e2eRuntimeRoot}}/dwk-gate-a\\\")) clearInterval(timer); }, 100);\"], { output: \"discard\", timeoutMs: 600000 });\nphase(\"定稿\");\n// 同一个 id 再发布一次:第二版。标题与说明是每一版自己的,primary 跟着 id 走、不必重复。\nawait artifact.markdown(\"dwk-notes\", \"# E2E 笔记 v2\\n\\nE2E_DWK_NOTES_V2 定稿。\\n\", { title: \"E2E 笔记\", description: \"E2E 两版笔记的说明\" });\nawait artifact.file(\"dwk-scores\", \".zcode-e2e/dwk-scores.csv\", { title: \"E2E 分数表\" });\nreturn \"E2E_DWK_A_RESULT 笔记与分数表已交付。\";"
  155. }
  156. }
  157. },
  158. "maxMatches": 1
  159. },
  160. {
  161. "id": "dwk-a-created",
  162. "metadata": {
  163. "kind": "main",
  164. "source": "synthetic",
  165. "timingPolicy": "fast-text",
  166. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  167. },
  168. "match": {
  169. "method": "POST",
  170. "pathIncludes": "/messages",
  171. "bodyExcludes": [
  172. "Generate a concise title",
  173. "CRITICAL: Respond with TEXT ONLY",
  174. "You are now acting as the memory extraction subagent"
  175. ],
  176. "bodyIncludes": ["E2E_DWK_A_START", "toolu_dwk_a_create"]
  177. },
  178. "response": {
  179. "statusCode": 200,
  180. "text": "E2E_DWK_A_STARTED 工作流已启动,结束时会通知我。"
  181. },
  182. "maxMatches": 1
  183. },
  184. {
  185. "id": "dwk-b-skill",
  186. "metadata": {
  187. "kind": "main",
  188. "source": "synthetic",
  189. "timingPolicy": "fast-text",
  190. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  191. },
  192. "match": {
  193. "method": "POST",
  194. "pathIncludes": "/messages",
  195. "bodyExcludes": [
  196. "Generate a concise title",
  197. "CRITICAL: Respond with TEXT ONLY",
  198. "You are now acting as the memory extraction subagent",
  199. "toolu_dwk_b_skill"
  200. ],
  201. "lastUserMessageIncludes": ["E2E_DWK_B_START"]
  202. },
  203. "response": {
  204. "statusCode": 200,
  205. "toolUse": {
  206. "id": "toolu_dwk_b_skill",
  207. "name": "Skill",
  208. "input": {
  209. "skill": "dynamic-workflows"
  210. }
  211. }
  212. },
  213. "maxMatches": 1
  214. },
  215. {
  216. "id": "dwk-b-create",
  217. "metadata": {
  218. "kind": "main",
  219. "source": "synthetic",
  220. "timingPolicy": "fast-text",
  221. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  222. },
  223. "match": {
  224. "method": "POST",
  225. "pathIncludes": "/messages",
  226. "bodyExcludes": [
  227. "Generate a concise title",
  228. "CRITICAL: Respond with TEXT ONLY",
  229. "You are now acting as the memory extraction subagent",
  230. "toolu_dwk_b_create"
  231. ],
  232. "bodyIncludes": ["E2E_DWK_B_START", "toolu_dwk_b_skill"]
  233. },
  234. "response": {
  235. "statusCode": 200,
  236. "toolUse": {
  237. "id": "toolu_dwk_b_create",
  238. "name": "CreateWorkflow",
  239. "input": {
  240. "name": "E2E 产物看板",
  241. "script": "artifact.table(\"dwk-table\", { title: \"E2E 用例表\", columns: [{ field: \"name\", label: \"用例\" }, { field: \"ms\", label: \"耗时\", unit: \"ms\" }], key: \"name\" });\nartifact.metrics(\"dwk-metrics\", { title: \"E2E 指标\", metrics: [{ field: \"passed\", label: \"通过\" }, { field: \"failed\", label: \"失败\" }, { field: \"rate\", label: \"通过率\", unit: \"%\" }] });\nartifact.chart(\"dwk-chart\", { title: \"E2E 趋势\", type: \"line\", x: { field: \"round\", label: \"轮次\" }, y: [{ field: \"ms\", label: \"耗时\", unit: \"ms\" }, { field: \"mem\", label: \"内存\", unit: \"MB\" }] });\nartifact.board(\"dwk-board\", { title: \"E2E 看板\", key: \"name\", status: \"state\", columns: [\"待办\", \"进行中\", \"完成\"], cardTitle: \"name\", detail: [{ field: \"owner\", label: \"负责人\" }] });\nphase(\"汇报\");\n// 表:四个用例,alpha 报两次(按 key 覆盖同一行)。\nreport({ name: \"alpha\", ms: 120 }, \"dwk-table\");\nreport({ name: \"beta\", ms: 80 }, \"dwk-table\");\nreport({ name: \"gamma\", ms: 95 }, \"dwk-table\");\nreport({ name: \"delta\", ms: 60 }, \"dwk-table\");\nreport({ name: \"alpha\", ms: 110 }, \"dwk-table\");\n// 指标:每块取最新一条带该字段的条目。\nreport({ passed: 7, failed: 1 }, \"dwk-metrics\");\nreport({ passed: 8, rate: 88.9 }, \"dwk-metrics\");\n// 图:三个点,两条序列。\nreport({ round: 1, ms: 120, mem: 30 }, \"dwk-chart\");\nreport({ round: 2, ms: 100, mem: 31 }, \"dwk-chart\");\nreport({ round: 3, ms: 95, mem: 32 }, \"dwk-chart\");\n// 看板:任务一后来移到「完成」,任务三的状态不在列里,落进「其他」。\nreport({ name: \"任务一\", state: \"待办\", owner: \"甲\" }, \"dwk-board\");\nreport({ name: \"任务二\", state: \"进行中\", owner: \"乙\" }, \"dwk-board\");\nreport({ name: \"任务三\", state: \"搁置\", owner: \"丙\" }, \"dwk-board\");\nreport({ name: \"任务一\", state: \"完成\", owner: \"甲\" }, \"dwk-board\");\nawait world.run(\"node\", [\"-e\", \"0\"], { output: \"discard\" });\nreturn \"E2E_DWK_B_RESULT 看板已更新。\";"
  242. }
  243. }
  244. },
  245. "maxMatches": 1
  246. },
  247. {
  248. "id": "dwk-b-created",
  249. "metadata": {
  250. "kind": "main",
  251. "source": "synthetic",
  252. "timingPolicy": "fast-text",
  253. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  254. },
  255. "match": {
  256. "method": "POST",
  257. "pathIncludes": "/messages",
  258. "bodyExcludes": [
  259. "Generate a concise title",
  260. "CRITICAL: Respond with TEXT ONLY",
  261. "You are now acting as the memory extraction subagent"
  262. ],
  263. "bodyIncludes": ["E2E_DWK_B_START", "toolu_dwk_b_create"]
  264. },
  265. "response": {
  266. "statusCode": 200,
  267. "text": "E2E_DWK_B_STARTED 工作流已启动,结束时会通知我。"
  268. },
  269. "maxMatches": 1
  270. },
  271. {
  272. "id": "dwk-c-skill",
  273. "metadata": {
  274. "kind": "main",
  275. "source": "synthetic",
  276. "timingPolicy": "fast-text",
  277. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  278. },
  279. "match": {
  280. "method": "POST",
  281. "pathIncludes": "/messages",
  282. "bodyExcludes": [
  283. "Generate a concise title",
  284. "CRITICAL: Respond with TEXT ONLY",
  285. "You are now acting as the memory extraction subagent",
  286. "toolu_dwk_c_skill"
  287. ],
  288. "lastUserMessageIncludes": ["E2E_DWK_C_START"]
  289. },
  290. "response": {
  291. "statusCode": 200,
  292. "toolUse": {
  293. "id": "toolu_dwk_c_skill",
  294. "name": "Skill",
  295. "input": {
  296. "skill": "dynamic-workflows"
  297. }
  298. }
  299. },
  300. "maxMatches": 1
  301. },
  302. {
  303. "id": "dwk-c-create",
  304. "metadata": {
  305. "kind": "main",
  306. "source": "synthetic",
  307. "timingPolicy": "fast-text",
  308. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  309. },
  310. "match": {
  311. "method": "POST",
  312. "pathIncludes": "/messages",
  313. "bodyExcludes": [
  314. "Generate a concise title",
  315. "CRITICAL: Respond with TEXT ONLY",
  316. "You are now acting as the memory extraction subagent",
  317. "toolu_dwk_c_create"
  318. ],
  319. "bodyIncludes": ["E2E_DWK_C_START", "toolu_dwk_c_skill"]
  320. },
  321. "response": {
  322. "statusCode": 200,
  323. "toolUse": {
  324. "id": "toolu_dwk_c_create",
  325. "name": "CreateWorkflow",
  326. "input": {
  327. "name": "E2E 产物出错",
  328. "script": "artifact.metrics(\"dwk-empty\", { title: \"E2E 空指标\", metrics: [{ field: \"passed\", label: \"通过\" }] });\nartifact.table(\"dwk-partial\", { title: \"E2E 半张表\", columns: [{ field: \"name\", label: \"用例\" }] });\nphase(\"汇报\");\nreport({ name: \"epsilon\" }, \"dwk-partial\");\nreport({ name: \"zeta\" }, \"dwk-partial\");\nawait world.run(\"node\", [\"-e\", \"0\"], { output: \"discard\" });\n// 列为空的看板:类型上合法,引擎的形状校验拒绝它,整个 run 出错。\nartifact.board(\"E2E_DWK_BAD_BOARD\", { title: \"E2E 坏看板\", key: \"name\", status: \"state\", columns: [] });\nreturn \"E2E_DWK_C_UNREACHABLE\";"
  329. }
  330. }
  331. },
  332. "maxMatches": 1
  333. },
  334. {
  335. "id": "dwk-c-created",
  336. "metadata": {
  337. "kind": "main",
  338. "source": "synthetic",
  339. "timingPolicy": "fast-text",
  340. "syntheticReason": "固定 Skill/CreateWorkflow 与收尾回复的模型选择;真实 Skill 加载、工作流编译、确认窗、run 引擎、产物发布与看板声明、完成/出错通知由 Agent 执行。"
  341. },
  342. "match": {
  343. "method": "POST",
  344. "pathIncludes": "/messages",
  345. "bodyExcludes": [
  346. "Generate a concise title",
  347. "CRITICAL: Respond with TEXT ONLY",
  348. "You are now acting as the memory extraction subagent"
  349. ],
  350. "bodyIncludes": ["E2E_DWK_C_START", "toolu_dwk_c_create"]
  351. },
  352. "response": {
  353. "statusCode": 200,
  354. "text": "E2E_DWK_C_STARTED 工作流已启动,结束时会通知我。"
  355. },
  356. "maxMatches": 1
  357. }
  358. ]
  359. }