conversation-session-v4-rewind-files.json 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-rewind-files",
  4. "spec": "./test/e2e/conversation-session/conversation-session-v4-rewind-files.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "v4-rewind-files-title",
  8. "description": "PV4-21/22 文件 rewind case-local 标题响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "标题不参与 workspace rewind 语义,用通用 marker 隔离两条 case。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_V4_REWIND_FILE"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "v4-rewind-files-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"V4 Rewind Files E2E\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "v4-rewind-files-safe-read",
  32. "description": "PV4-21 先 Read safe.txt,建立 Write 前 read state。",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "固定产生可安全回滚的已有文件 checkpoint。"
  38. },
  39. "maxMatches": 1,
  40. "match": {
  41. "method": "POST",
  42. "pathIncludes": "/messages",
  43. "lastUserMessageIncludes": ["E2E_V4_REWIND_FILE_SAFE"],
  44. "lastUserMessageExcludes": ["E2E_V4_REWIND_FILE_SAFE_EDITED"],
  45. "bodyExcludes": [
  46. "Generate a concise title",
  47. "toolu_v4_rewind_files_safe_read"
  48. ]
  49. },
  50. "response": {
  51. "statusCode": 200,
  52. "toolUse": {
  53. "id": "toolu_v4_rewind_files_safe_read",
  54. "messageId": "msg_v4_rewind_files_safe_read",
  55. "name": "Read",
  56. "input": { "file_path": "v4-rewind-files-e2e/safe.txt" }
  57. }
  58. }
  59. },
  60. {
  61. "id": "v4-rewind-files-safe-write",
  62. "description": "PV4-21 Write safe.txt 并产生安全 checkpoint。",
  63. "metadata": {
  64. "kind": "main",
  65. "timingPolicy": "fast-text",
  66. "source": "synthetic",
  67. "syntheticReason": "实际改文件,供组合 rewind 恢复 beforeContent。"
  68. },
  69. "maxMatches": 1,
  70. "match": {
  71. "method": "POST",
  72. "pathIncludes": "/messages",
  73. "bodyIncludes": ["E2E_V4_REWIND_FILE_SAFE", "safe-before"],
  74. "bodyExcludes": [
  75. "Generate a concise title",
  76. "toolu_v4_rewind_files_safe_write"
  77. ]
  78. },
  79. "response": {
  80. "statusCode": 200,
  81. "toolUse": {
  82. "id": "toolu_v4_rewind_files_safe_write",
  83. "messageId": "msg_v4_rewind_files_safe_write",
  84. "name": "Write",
  85. "input": {
  86. "file_path": "v4-rewind-files-e2e/safe.txt",
  87. "content": "safe-after\n"
  88. }
  89. }
  90. }
  91. },
  92. {
  93. "id": "v4-rewind-files-safe-final",
  94. "description": "PV4-21 文件写入后的原分支回复。",
  95. "metadata": {
  96. "kind": "main",
  97. "timingPolicy": "fast-text",
  98. "source": "synthetic",
  99. "syntheticReason": "给 branch cut 提供可见旧回复证据。"
  100. },
  101. "maxMatches": 1,
  102. "match": {
  103. "method": "POST",
  104. "pathIncludes": "/messages",
  105. "bodyIncludes": [
  106. "E2E_V4_REWIND_FILE_SAFE",
  107. "The file v4-rewind-files-e2e/safe.txt has been updated successfully"
  108. ],
  109. "bodyExcludes": [
  110. "Generate a concise title",
  111. "E2E_V4_REWIND_FILE_SAFE_EDITED"
  112. ]
  113. },
  114. "response": {
  115. "statusCode": 200,
  116. "text": {
  117. "id": "v4-rewind-files-safe-final",
  118. "inputTokens": 96,
  119. "outputTokens": 8,
  120. "text": "V4_REWIND_FILE_SAFE_ORIGINAL_REPLY"
  121. }
  122. }
  123. },
  124. {
  125. "id": "v4-rewind-files-safe-edited",
  126. "description": "PV4-21 文件恢复 + branch cut 后的编辑回复。",
  127. "metadata": {
  128. "kind": "main",
  129. "timingPolicy": "fast-text",
  130. "source": "synthetic",
  131. "syntheticReason": "确认组合命令只重发编辑后 intent。"
  132. },
  133. "maxMatches": 1,
  134. "match": {
  135. "method": "POST",
  136. "pathIncludes": "/messages",
  137. "lastUserMessageIncludes": ["E2E_V4_REWIND_FILE_SAFE_EDITED"],
  138. "bodyExcludes": ["Generate a concise title"]
  139. },
  140. "response": {
  141. "statusCode": 200,
  142. "text": {
  143. "id": "v4-rewind-files-safe-edited",
  144. "inputTokens": 64,
  145. "outputTokens": 8,
  146. "text": "V4_REWIND_FILE_SAFE_EDITED_REPLY"
  147. }
  148. }
  149. },
  150. {
  151. "id": "v4-rewind-files-conflict-read",
  152. "description": "PV4-22 先 Read conflict.txt,建立 checkpoint。",
  153. "metadata": {
  154. "kind": "main",
  155. "timingPolicy": "fast-text",
  156. "source": "synthetic",
  157. "syntheticReason": "后续外部改写将使 preview 返回 external_modified。"
  158. },
  159. "maxMatches": 1,
  160. "match": {
  161. "method": "POST",
  162. "pathIncludes": "/messages",
  163. "lastUserMessageIncludes": ["E2E_V4_REWIND_FILE_CONFLICT"],
  164. "lastUserMessageExcludes": ["E2E_V4_REWIND_FILE_CONFLICT_EDITED"],
  165. "bodyExcludes": [
  166. "Generate a concise title",
  167. "toolu_v4_rewind_files_conflict_read"
  168. ]
  169. },
  170. "response": {
  171. "statusCode": 200,
  172. "toolUse": {
  173. "id": "toolu_v4_rewind_files_conflict_read",
  174. "messageId": "msg_v4_rewind_files_conflict_read",
  175. "name": "Read",
  176. "input": { "file_path": "v4-rewind-files-e2e/conflict.txt" }
  177. }
  178. }
  179. },
  180. {
  181. "id": "v4-rewind-files-conflict-write",
  182. "description": "PV4-22 Write conflict.txt 并产生 checkpoint。",
  183. "metadata": {
  184. "kind": "main",
  185. "timingPolicy": "fast-text",
  186. "source": "synthetic",
  187. "syntheticReason": "在 edit 前由测试外部改写,触发 fail-closed。"
  188. },
  189. "maxMatches": 1,
  190. "match": {
  191. "method": "POST",
  192. "pathIncludes": "/messages",
  193. "bodyIncludes": ["E2E_V4_REWIND_FILE_CONFLICT", "conflict-before"],
  194. "bodyExcludes": [
  195. "Generate a concise title",
  196. "toolu_v4_rewind_files_conflict_write"
  197. ]
  198. },
  199. "response": {
  200. "statusCode": 200,
  201. "toolUse": {
  202. "id": "toolu_v4_rewind_files_conflict_write",
  203. "messageId": "msg_v4_rewind_files_conflict_write",
  204. "name": "Write",
  205. "input": {
  206. "file_path": "v4-rewind-files-e2e/conflict.txt",
  207. "content": "conflict-after\n"
  208. }
  209. }
  210. }
  211. },
  212. {
  213. "id": "v4-rewind-files-conflict-final",
  214. "description": "PV4-22 外部修改前的原分支回复。",
  215. "metadata": {
  216. "kind": "main",
  217. "timingPolicy": "fast-text",
  218. "source": "synthetic",
  219. "syntheticReason": "blocked 期间必须继续可见。"
  220. },
  221. "maxMatches": 1,
  222. "match": {
  223. "method": "POST",
  224. "pathIncludes": "/messages",
  225. "bodyIncludes": [
  226. "E2E_V4_REWIND_FILE_CONFLICT",
  227. "The file v4-rewind-files-e2e/conflict.txt has been updated successfully"
  228. ],
  229. "bodyExcludes": [
  230. "Generate a concise title",
  231. "E2E_V4_REWIND_FILE_CONFLICT_EDITED"
  232. ]
  233. },
  234. "response": {
  235. "statusCode": 200,
  236. "text": {
  237. "id": "v4-rewind-files-conflict-final",
  238. "inputTokens": 96,
  239. "outputTokens": 8,
  240. "text": "V4_REWIND_FILE_CONFLICT_ORIGINAL_REPLY"
  241. }
  242. }
  243. },
  244. {
  245. "id": "v4-rewind-files-conflict-edited",
  246. "description": "PV4-22 仅重置对话降级命令的回复。",
  247. "metadata": {
  248. "kind": "main",
  249. "timingPolicy": "fast-text",
  250. "source": "synthetic",
  251. "syntheticReason": "证明新 commandId preserve 只发起一次新请求。"
  252. },
  253. "maxMatches": 1,
  254. "match": {
  255. "method": "POST",
  256. "pathIncludes": "/messages",
  257. "lastUserMessageIncludes": ["E2E_V4_REWIND_FILE_CONFLICT_EDITED"],
  258. "bodyExcludes": ["Generate a concise title"]
  259. },
  260. "response": {
  261. "statusCode": 200,
  262. "text": {
  263. "id": "v4-rewind-files-conflict-edited",
  264. "inputTokens": 64,
  265. "outputTokens": 8,
  266. "text": "V4_REWIND_FILE_CONFLICT_EDITED_REPLY"
  267. }
  268. }
  269. }
  270. ]
  271. }