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

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