conversation-session-v4-permission.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-permission",
  4. "spec": "./test/e2e/conversation-session/permissions/conversation-session-v4-permission.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "v4-permission-title",
  8. "description": "E2E_V4_PERMISSION_WRITE 首发的 case-local 标题生成响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "E2E_V4_PERMISSION_WRITE 首发会触发默认 title sidecar;固定 case-local 标题响应,避免 default replay 回退 legacy provider-basic,并用该首发 marker 隔离跨 case 匹配。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_V4_PERMISSION_WRITE"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "v4-permission-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"V4 Permission E2E\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "v4-permission-write-call",
  32. "description": "M4 resolveInteraction 门禁:Write tool_use,默认模式下触发权限弹窗。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "Write 是需要审批的破坏性工具,用于验证 v4 前向 resolveInteraction 命令收口反向权限请求。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_V4_PERMISSION_WRITE"],
  43. "bodyIncludes": ["E2E_V4_PERMISSION_WRITE"],
  44. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "toolUse": {
  49. "id": "toolu_v4_permission_write",
  50. "name": "Write",
  51. "input": {
  52. "file_path": "{{e2eRuntimeRoot}}/conversation-session-v4-permission/write-output.txt",
  53. "content": "E2E_V4_PERMISSION_RESULT\n"
  54. }
  55. }
  56. }
  57. },
  58. {
  59. "id": "v4-permission-final",
  60. "description": "M4 resolveInteraction 门禁:批准后 tool_result 回灌 → 最终文本。",
  61. "metadata": {
  62. "kind": "main",
  63. "timingPolicy": "fast-text",
  64. "source": "synthetic",
  65. "syntheticReason": "权限批准后工具执行成功,模型据 tool_result 给出终态文本。"
  66. },
  67. "match": {
  68. "method": "POST",
  69. "pathIncludes": "/messages",
  70. "bodyIncludes": ["E2E_V4_PERMISSION_WRITE", "toolu_v4_permission_write"],
  71. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  72. },
  73. "response": {
  74. "statusCode": 200,
  75. "text": {
  76. "id": "v4-permission-final",
  77. "inputTokens": 80,
  78. "outputTokens": 8,
  79. "text": "V4_PERMISSION_DONE"
  80. }
  81. }
  82. },
  83. {
  84. "id": "v4-permission-allow-feedback-title",
  85. "description": "Allow once 携带反馈 case 的标题生成响应。",
  86. "metadata": {
  87. "kind": "common",
  88. "timingPolicy": "fast-text",
  89. "source": "synthetic",
  90. "syntheticReason": "独立 prompt marker 隔离允许路径。"
  91. },
  92. "match": {
  93. "method": "POST",
  94. "pathIncludes": "/messages",
  95. "bodyIncludes": ["Generate a concise title", "E2E_V4_PERMISSION_ALLOW_FEEDBACK"]
  96. },
  97. "response": {
  98. "statusCode": 200,
  99. "text": {
  100. "id": "v4-permission-allow-feedback-title",
  101. "inputTokens": 64,
  102. "outputTokens": 8,
  103. "text": "{\"title\":\"V4 Permission Allow Feedback E2E\"}"
  104. }
  105. }
  106. },
  107. {
  108. "id": "v4-permission-allow-feedback-call",
  109. "description": "Allow once 携带反馈 case 首发的 Write tool_use。",
  110. "metadata": {
  111. "kind": "main",
  112. "timingPolicy": "fast-text",
  113. "source": "synthetic",
  114. "syntheticReason": "验证填写反馈不改变 allow decision。"
  115. },
  116. "maxMatches": 1,
  117. "match": {
  118. "method": "POST",
  119. "pathIncludes": "/messages",
  120. "lastUserMessageIncludes": ["E2E_V4_PERMISSION_ALLOW_FEEDBACK"],
  121. "bodyIncludes": ["E2E_V4_PERMISSION_ALLOW_FEEDBACK"],
  122. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  123. },
  124. "response": {
  125. "statusCode": 200,
  126. "toolUse": {
  127. "id": "toolu_v4_permission_allow_feedback",
  128. "name": "Write",
  129. "input": {
  130. "file_path": "{{e2eRuntimeRoot}}/conversation-session-v4-permission/allow-feedback-output.txt",
  131. "content": "E2E_V4_PERMISSION_ALLOW_FEEDBACK_RESULT\n"
  132. }
  133. }
  134. }
  135. },
  136. {
  137. "id": "v4-permission-allow-feedback-final",
  138. "description": "Allow once 携带反馈后的终态响应。",
  139. "metadata": {
  140. "kind": "main",
  141. "timingPolicy": "fast-text",
  142. "source": "synthetic",
  143. "syntheticReason": "验证允许路径继续执行且不回灌 feedback。"
  144. },
  145. "match": {
  146. "method": "POST",
  147. "pathIncludes": "/messages",
  148. "bodyIncludes": ["E2E_V4_PERMISSION_ALLOW_FEEDBACK", "toolu_v4_permission_allow_feedback"],
  149. "bodyExcludes": [
  150. "Generate a concise title",
  151. "CRITICAL: Respond with TEXT ONLY",
  152. "This note must be ignored when allowing the tool."
  153. ]
  154. },
  155. "response": {
  156. "statusCode": 200,
  157. "text": {
  158. "id": "v4-permission-allow-feedback-final",
  159. "inputTokens": 80,
  160. "outputTokens": 8,
  161. "text": "V4_PERMISSION_ALLOW_FEEDBACK_DONE"
  162. }
  163. }
  164. },
  165. {
  166. "id": "v4-permission-deny-title",
  167. "description": "Deny with feedback case 的标题生成响应。",
  168. "metadata": {
  169. "kind": "common",
  170. "timingPolicy": "fast-text",
  171. "source": "synthetic",
  172. "syntheticReason": "Deny with feedback 使用独立 prompt marker,避免与批准路径复用 provider fixture。"
  173. },
  174. "match": {
  175. "method": "POST",
  176. "pathIncludes": "/messages",
  177. "bodyIncludes": ["Generate a concise title", "E2E_V4_PERMISSION_DENY_FEEDBACK"]
  178. },
  179. "response": {
  180. "statusCode": 200,
  181. "text": {
  182. "id": "v4-permission-deny-title",
  183. "inputTokens": 64,
  184. "outputTokens": 8,
  185. "text": "{\"title\":\"V4 Permission Deny E2E\"}"
  186. }
  187. }
  188. },
  189. {
  190. "id": "v4-permission-deny-call",
  191. "description": "Deny with feedback 的 Enter / 确认两条 case 各自首发的 Write tool_use;排除 tool_result continuation。",
  192. "metadata": {
  193. "kind": "main",
  194. "timingPolicy": "fast-text",
  195. "source": "synthetic",
  196. "syntheticReason": "Write 权限请求用于验证反馈拒绝不会执行工具。"
  197. },
  198. "maxMatches": 2,
  199. "match": {
  200. "method": "POST",
  201. "pathIncludes": "/messages",
  202. "lastUserMessageIncludes": ["E2E_V4_PERMISSION_DENY_FEEDBACK"],
  203. "bodyIncludes": ["E2E_V4_PERMISSION_DENY_FEEDBACK"],
  204. "bodyExcludes": [
  205. "Generate a concise title",
  206. "CRITICAL: Respond with TEXT ONLY",
  207. "toolu_v4_permission_deny_feedback"
  208. ]
  209. },
  210. "response": {
  211. "statusCode": 200,
  212. "toolUse": {
  213. "id": "toolu_v4_permission_deny_feedback",
  214. "name": "Write",
  215. "input": {
  216. "file_path": "{{e2eRuntimeRoot}}/conversation-session-v4-permission/deny-output.txt",
  217. "content": "E2E_V4_PERMISSION_DENY_RESULT\n"
  218. }
  219. }
  220. }
  221. },
  222. {
  223. "id": "v4-permission-deny-final",
  224. "description": "Deny with feedback 后 provider-visible denied tool_result 的收口响应。",
  225. "metadata": {
  226. "kind": "main",
  227. "timingPolicy": "fast-text",
  228. "source": "synthetic",
  229. "syntheticReason": "反馈必须与同一个 denied tool_result 一起进入 provider continuation。"
  230. },
  231. "match": {
  232. "method": "POST",
  233. "pathIncludes": "/messages",
  234. "bodyIncludes": [
  235. "E2E_V4_PERMISSION_DENY_FEEDBACK",
  236. "toolu_v4_permission_deny_feedback",
  237. "The user doesn't want to proceed with this tool use",
  238. "To tell you how to proceed, the user said:",
  239. "Do not write the file"
  240. ],
  241. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  242. },
  243. "response": {
  244. "statusCode": 200,
  245. "text": {
  246. "id": "v4-permission-deny-final",
  247. "inputTokens": 80,
  248. "outputTokens": 8,
  249. "text": "V4_PERMISSION_DENY_DONE"
  250. }
  251. }
  252. },
  253. {
  254. "id": "v4-permission-deny-blank-title",
  255. "description": "空白反馈拒绝 case 的标题生成响应。",
  256. "metadata": {
  257. "kind": "common",
  258. "timingPolicy": "fast-text",
  259. "source": "synthetic",
  260. "syntheticReason": "独立 prompt marker 隔离空白反馈路径。"
  261. },
  262. "match": {
  263. "method": "POST",
  264. "pathIncludes": "/messages",
  265. "bodyIncludes": ["Generate a concise title", "E2E_V4_PERMISSION_DENY_BLANK"]
  266. },
  267. "response": {
  268. "statusCode": 200,
  269. "text": {
  270. "id": "v4-permission-deny-blank-title",
  271. "inputTokens": 64,
  272. "outputTokens": 8,
  273. "text": "{\"title\":\"V4 Permission Blank Deny E2E\"}"
  274. }
  275. }
  276. },
  277. {
  278. "id": "v4-permission-deny-blank-call",
  279. "description": "空白反馈拒绝 case 首发的 Write tool_use。",
  280. "metadata": {
  281. "kind": "main",
  282. "timingPolicy": "fast-text",
  283. "source": "synthetic",
  284. "syntheticReason": "验证空白反馈回退基础 Deny 文案。"
  285. },
  286. "maxMatches": 1,
  287. "match": {
  288. "method": "POST",
  289. "pathIncludes": "/messages",
  290. "lastUserMessageIncludes": ["E2E_V4_PERMISSION_DENY_BLANK"],
  291. "bodyIncludes": ["E2E_V4_PERMISSION_DENY_BLANK"],
  292. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  293. },
  294. "response": {
  295. "statusCode": 200,
  296. "toolUse": {
  297. "id": "toolu_v4_permission_deny_blank",
  298. "name": "Write",
  299. "input": {
  300. "file_path": "{{e2eRuntimeRoot}}/conversation-session-v4-permission/deny-blank-output.txt",
  301. "content": "E2E_V4_PERMISSION_DENY_BLANK_RESULT\n"
  302. }
  303. }
  304. }
  305. },
  306. {
  307. "id": "v4-permission-deny-blank-final",
  308. "description": "空白反馈拒绝后的基础 Deny 文案收口响应。",
  309. "metadata": {
  310. "kind": "main",
  311. "timingPolicy": "fast-text",
  312. "source": "synthetic",
  313. "syntheticReason": "provider-visible tool_result 不应包含 feedback suffix。"
  314. },
  315. "match": {
  316. "method": "POST",
  317. "pathIncludes": "/messages",
  318. "bodyIncludes": [
  319. "E2E_V4_PERMISSION_DENY_BLANK",
  320. "toolu_v4_permission_deny_blank",
  321. "The user doesn't want to proceed with this tool use",
  322. "The tool use was rejected",
  323. "STOP what you are doing and wait for the user to tell you how to proceed."
  324. ],
  325. "bodyExcludes": [
  326. "Generate a concise title",
  327. "CRITICAL: Respond with TEXT ONLY",
  328. "To tell you how to proceed, the user said:"
  329. ]
  330. },
  331. "response": {
  332. "statusCode": 200,
  333. "text": {
  334. "id": "v4-permission-deny-blank-final",
  335. "inputTokens": 80,
  336. "outputTokens": 8,
  337. "text": "V4_PERMISSION_DENY_BLANK_DONE"
  338. }
  339. }
  340. }
  341. ]
  342. }