conversation-session-guarded.json 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-guarded",
  4. "spec": "./test/e2e/conversation-session/task-management/conversation-session-guarded.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "guarded-title",
  8. "description": "Guarded case-local title",
  9. "metadata": {
  10. "kind": "common",
  11. "timingPolicy": "fast-text",
  12. "source": "synthetic",
  13. "syntheticReason": "隔离模式及审批 E2E 的标题 sidecar,不依赖真实模型。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_GUARDED_"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "guarded-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"Guarded E2E\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "E2E_GUARDED_RM-call",
  32. "description": "Guarded Bash tool call",
  33. "metadata": {
  34. "kind": "main",
  35. "timingPolicy": "fast-text",
  36. "source": "synthetic",
  37. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "bodyIncludes": ["E2E_GUARDED_RM"],
  43. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  44. "lastUserMessageIncludes": ["E2E_GUARDED_RM"]
  45. },
  46. "response": {
  47. "statusCode": 200,
  48. "toolUse": {
  49. "id": "toolu_E2E_GUARDED_RM",
  50. "name": "Bash",
  51. "input": {
  52. "command": "cd .zcode-e2e/conversation-session-guarded && echo executed >> E2E_GUARDED_RM.executed && rm -rf remove-target --help --version"
  53. }
  54. }
  55. }
  56. },
  57. {
  58. "id": "E2E_GUARDED_RM-final",
  59. "description": "Provider-visible tool result continuation",
  60. "metadata": {
  61. "kind": "main",
  62. "timingPolicy": "fast-text",
  63. "source": "synthetic",
  64. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  65. },
  66. "match": {
  67. "method": "POST",
  68. "pathIncludes": "/messages",
  69. "bodyIncludes": ["E2E_GUARDED_RM", "toolu_E2E_GUARDED_RM"],
  70. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  71. },
  72. "response": {
  73. "statusCode": 200,
  74. "text": {
  75. "id": "E2E_GUARDED_RM-final",
  76. "inputTokens": 80,
  77. "outputTokens": 8,
  78. "text": "E2E_GUARDED_RM_DONE"
  79. }
  80. }
  81. },
  82. {
  83. "id": "E2E_GUARDED_STORAGE-call",
  84. "description": "Guarded Bash tool call",
  85. "metadata": {
  86. "kind": "main",
  87. "timingPolicy": "fast-text",
  88. "source": "synthetic",
  89. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  90. },
  91. "match": {
  92. "method": "POST",
  93. "pathIncludes": "/messages",
  94. "bodyIncludes": ["E2E_GUARDED_STORAGE"],
  95. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  96. "lastUserMessageIncludes": ["E2E_GUARDED_STORAGE"]
  97. },
  98. "response": {
  99. "statusCode": 200,
  100. "toolUse": {
  101. "id": "toolu_E2E_GUARDED_STORAGE",
  102. "name": "Bash",
  103. "input": {
  104. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_STORAGE.executed; dd if=.zcode-e2e/conversation-session-guarded/missing-input of=.zcode-e2e/conversation-session-guarded/disk-output count=0"
  105. }
  106. }
  107. }
  108. },
  109. {
  110. "id": "E2E_GUARDED_STORAGE-final",
  111. "description": "Provider-visible tool result continuation",
  112. "metadata": {
  113. "kind": "main",
  114. "timingPolicy": "fast-text",
  115. "source": "synthetic",
  116. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  117. },
  118. "match": {
  119. "method": "POST",
  120. "pathIncludes": "/messages",
  121. "bodyIncludes": ["E2E_GUARDED_STORAGE", "toolu_E2E_GUARDED_STORAGE"],
  122. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  123. },
  124. "response": {
  125. "statusCode": 200,
  126. "text": {
  127. "id": "E2E_GUARDED_STORAGE-final",
  128. "inputTokens": 80,
  129. "outputTokens": 8,
  130. "text": "E2E_GUARDED_STORAGE_DONE"
  131. }
  132. }
  133. },
  134. {
  135. "id": "E2E_GUARDED_RESET-call",
  136. "description": "Guarded Bash tool call",
  137. "metadata": {
  138. "kind": "main",
  139. "timingPolicy": "fast-text",
  140. "source": "synthetic",
  141. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  142. },
  143. "match": {
  144. "method": "POST",
  145. "pathIncludes": "/messages",
  146. "bodyIncludes": ["E2E_GUARDED_RESET"],
  147. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  148. "lastUserMessageIncludes": ["E2E_GUARDED_RESET"]
  149. },
  150. "response": {
  151. "statusCode": 200,
  152. "toolUse": {
  153. "id": "toolu_E2E_GUARDED_RESET",
  154. "name": "Bash",
  155. "input": {
  156. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_RESET.executed; git -C .zcode-e2e/conversation-session-guarded/missing-repo reset --hard"
  157. }
  158. }
  159. }
  160. },
  161. {
  162. "id": "E2E_GUARDED_RESET-final",
  163. "description": "Provider-visible tool result continuation",
  164. "metadata": {
  165. "kind": "main",
  166. "timingPolicy": "fast-text",
  167. "source": "synthetic",
  168. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  169. },
  170. "match": {
  171. "method": "POST",
  172. "pathIncludes": "/messages",
  173. "bodyIncludes": ["E2E_GUARDED_RESET", "toolu_E2E_GUARDED_RESET"],
  174. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  175. },
  176. "response": {
  177. "statusCode": 200,
  178. "text": {
  179. "id": "E2E_GUARDED_RESET-final",
  180. "inputTokens": 80,
  181. "outputTokens": 8,
  182. "text": "E2E_GUARDED_RESET_DONE"
  183. }
  184. }
  185. },
  186. {
  187. "id": "E2E_GUARDED_CLEAN-call",
  188. "description": "Guarded Bash tool call",
  189. "metadata": {
  190. "kind": "main",
  191. "timingPolicy": "fast-text",
  192. "source": "synthetic",
  193. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  194. },
  195. "match": {
  196. "method": "POST",
  197. "pathIncludes": "/messages",
  198. "bodyIncludes": ["E2E_GUARDED_CLEAN"],
  199. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  200. "lastUserMessageIncludes": ["E2E_GUARDED_CLEAN"]
  201. },
  202. "response": {
  203. "statusCode": 200,
  204. "toolUse": {
  205. "id": "toolu_E2E_GUARDED_CLEAN",
  206. "name": "Bash",
  207. "input": {
  208. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_CLEAN.executed; git -C .zcode-e2e/conversation-session-guarded/missing-repo clean -fd"
  209. }
  210. }
  211. }
  212. },
  213. {
  214. "id": "E2E_GUARDED_CLEAN-final",
  215. "description": "Provider-visible tool result continuation",
  216. "metadata": {
  217. "kind": "main",
  218. "timingPolicy": "fast-text",
  219. "source": "synthetic",
  220. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  221. },
  222. "match": {
  223. "method": "POST",
  224. "pathIncludes": "/messages",
  225. "bodyIncludes": ["E2E_GUARDED_CLEAN", "toolu_E2E_GUARDED_CLEAN"],
  226. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  227. },
  228. "response": {
  229. "statusCode": 200,
  230. "text": {
  231. "id": "E2E_GUARDED_CLEAN-final",
  232. "inputTokens": 80,
  233. "outputTokens": 8,
  234. "text": "E2E_GUARDED_CLEAN_DONE"
  235. }
  236. }
  237. },
  238. {
  239. "id": "E2E_GUARDED_PUSH-call",
  240. "description": "Guarded Bash tool call",
  241. "metadata": {
  242. "kind": "main",
  243. "timingPolicy": "fast-text",
  244. "source": "synthetic",
  245. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  246. },
  247. "match": {
  248. "method": "POST",
  249. "pathIncludes": "/messages",
  250. "bodyIncludes": ["E2E_GUARDED_PUSH"],
  251. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  252. "lastUserMessageIncludes": ["E2E_GUARDED_PUSH"]
  253. },
  254. "response": {
  255. "statusCode": 200,
  256. "toolUse": {
  257. "id": "toolu_E2E_GUARDED_PUSH",
  258. "name": "Bash",
  259. "input": {
  260. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_PUSH.executed; git -C .zcode-e2e/conversation-session-guarded/missing-repo push --force .zcode-e2e/conversation-session-guarded/missing-remote HEAD"
  261. }
  262. }
  263. }
  264. },
  265. {
  266. "id": "E2E_GUARDED_PUSH-final",
  267. "description": "Provider-visible tool result continuation",
  268. "metadata": {
  269. "kind": "main",
  270. "timingPolicy": "fast-text",
  271. "source": "synthetic",
  272. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  273. },
  274. "match": {
  275. "method": "POST",
  276. "pathIncludes": "/messages",
  277. "bodyIncludes": ["E2E_GUARDED_PUSH", "toolu_E2E_GUARDED_PUSH"],
  278. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  279. },
  280. "response": {
  281. "statusCode": 200,
  282. "text": {
  283. "id": "E2E_GUARDED_PUSH-final",
  284. "inputTokens": 80,
  285. "outputTokens": 8,
  286. "text": "E2E_GUARDED_PUSH_DONE"
  287. }
  288. }
  289. },
  290. {
  291. "id": "E2E_GUARDED_DISCARD-call",
  292. "description": "Guarded Bash tool call",
  293. "metadata": {
  294. "kind": "main",
  295. "timingPolicy": "fast-text",
  296. "source": "synthetic",
  297. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  298. },
  299. "match": {
  300. "method": "POST",
  301. "pathIncludes": "/messages",
  302. "bodyIncludes": ["E2E_GUARDED_DISCARD"],
  303. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  304. "lastUserMessageIncludes": ["E2E_GUARDED_DISCARD"]
  305. },
  306. "response": {
  307. "statusCode": 200,
  308. "toolUse": {
  309. "id": "toolu_E2E_GUARDED_DISCARD",
  310. "name": "Bash",
  311. "input": {
  312. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_DISCARD.executed; git -C .zcode-e2e/conversation-session-guarded/missing-repo checkout -f main"
  313. }
  314. }
  315. }
  316. },
  317. {
  318. "id": "E2E_GUARDED_DISCARD-final",
  319. "description": "Provider-visible tool result continuation",
  320. "metadata": {
  321. "kind": "main",
  322. "timingPolicy": "fast-text",
  323. "source": "synthetic",
  324. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  325. },
  326. "match": {
  327. "method": "POST",
  328. "pathIncludes": "/messages",
  329. "bodyIncludes": ["E2E_GUARDED_DISCARD", "toolu_E2E_GUARDED_DISCARD"],
  330. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  331. },
  332. "response": {
  333. "statusCode": 200,
  334. "text": {
  335. "id": "E2E_GUARDED_DISCARD-final",
  336. "inputTokens": 80,
  337. "outputTokens": 8,
  338. "text": "E2E_GUARDED_DISCARD_DONE"
  339. }
  340. }
  341. },
  342. {
  343. "id": "E2E_GUARDED_STASH-call",
  344. "description": "Guarded Bash tool call",
  345. "metadata": {
  346. "kind": "main",
  347. "timingPolicy": "fast-text",
  348. "source": "synthetic",
  349. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  350. },
  351. "match": {
  352. "method": "POST",
  353. "pathIncludes": "/messages",
  354. "bodyIncludes": ["E2E_GUARDED_STASH"],
  355. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  356. "lastUserMessageIncludes": ["E2E_GUARDED_STASH"]
  357. },
  358. "response": {
  359. "statusCode": 200,
  360. "toolUse": {
  361. "id": "toolu_E2E_GUARDED_STASH",
  362. "name": "Bash",
  363. "input": {
  364. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_STASH.executed; git -C .zcode-e2e/conversation-session-guarded/missing-repo stash clear"
  365. }
  366. }
  367. }
  368. },
  369. {
  370. "id": "E2E_GUARDED_STASH-final",
  371. "description": "Provider-visible tool result continuation",
  372. "metadata": {
  373. "kind": "main",
  374. "timingPolicy": "fast-text",
  375. "source": "synthetic",
  376. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  377. },
  378. "match": {
  379. "method": "POST",
  380. "pathIncludes": "/messages",
  381. "bodyIncludes": ["E2E_GUARDED_STASH", "toolu_E2E_GUARDED_STASH"],
  382. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  383. },
  384. "response": {
  385. "statusCode": 200,
  386. "text": {
  387. "id": "E2E_GUARDED_STASH-final",
  388. "inputTokens": 80,
  389. "outputTokens": 8,
  390. "text": "E2E_GUARDED_STASH_DONE"
  391. }
  392. }
  393. },
  394. {
  395. "id": "E2E_GUARDED_WORKTREE-call",
  396. "description": "Guarded Bash tool call",
  397. "metadata": {
  398. "kind": "main",
  399. "timingPolicy": "fast-text",
  400. "source": "synthetic",
  401. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  402. },
  403. "match": {
  404. "method": "POST",
  405. "pathIncludes": "/messages",
  406. "bodyIncludes": ["E2E_GUARDED_WORKTREE"],
  407. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  408. "lastUserMessageIncludes": ["E2E_GUARDED_WORKTREE"]
  409. },
  410. "response": {
  411. "statusCode": 200,
  412. "toolUse": {
  413. "id": "toolu_E2E_GUARDED_WORKTREE",
  414. "name": "Bash",
  415. "input": {
  416. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_WORKTREE.executed; git -C .zcode-e2e/conversation-session-guarded/missing-repo worktree remove -ff .zcode-e2e/conversation-session-guarded/missing-tree"
  417. }
  418. }
  419. }
  420. },
  421. {
  422. "id": "E2E_GUARDED_WORKTREE-final",
  423. "description": "Provider-visible tool result continuation",
  424. "metadata": {
  425. "kind": "main",
  426. "timingPolicy": "fast-text",
  427. "source": "synthetic",
  428. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  429. },
  430. "match": {
  431. "method": "POST",
  432. "pathIncludes": "/messages",
  433. "bodyIncludes": ["E2E_GUARDED_WORKTREE", "toolu_E2E_GUARDED_WORKTREE"],
  434. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  435. },
  436. "response": {
  437. "statusCode": 200,
  438. "text": {
  439. "id": "E2E_GUARDED_WORKTREE-final",
  440. "inputTokens": 80,
  441. "outputTokens": 8,
  442. "text": "E2E_GUARDED_WORKTREE_DONE"
  443. }
  444. }
  445. },
  446. {
  447. "id": "E2E_GUARDED_RSYNC-call",
  448. "description": "Guarded Bash tool call",
  449. "metadata": {
  450. "kind": "main",
  451. "timingPolicy": "fast-text",
  452. "source": "synthetic",
  453. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  454. },
  455. "match": {
  456. "method": "POST",
  457. "pathIncludes": "/messages",
  458. "bodyIncludes": ["E2E_GUARDED_RSYNC"],
  459. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  460. "lastUserMessageIncludes": ["E2E_GUARDED_RSYNC"]
  461. },
  462. "response": {
  463. "statusCode": 200,
  464. "toolUse": {
  465. "id": "toolu_E2E_GUARDED_RSYNC",
  466. "name": "Bash",
  467. "input": {
  468. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_RSYNC.executed; rsync --delete .zcode-e2e/conversation-session-guarded/missing-source/ .zcode-e2e/conversation-session-guarded/missing-dest/"
  469. }
  470. }
  471. }
  472. },
  473. {
  474. "id": "E2E_GUARDED_RSYNC-final",
  475. "description": "Provider-visible tool result continuation",
  476. "metadata": {
  477. "kind": "main",
  478. "timingPolicy": "fast-text",
  479. "source": "synthetic",
  480. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  481. },
  482. "match": {
  483. "method": "POST",
  484. "pathIncludes": "/messages",
  485. "bodyIncludes": ["E2E_GUARDED_RSYNC", "toolu_E2E_GUARDED_RSYNC"],
  486. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  487. },
  488. "response": {
  489. "statusCode": 200,
  490. "text": {
  491. "id": "E2E_GUARDED_RSYNC-final",
  492. "inputTokens": 80,
  493. "outputTokens": 8,
  494. "text": "E2E_GUARDED_RSYNC_DONE"
  495. }
  496. }
  497. },
  498. {
  499. "id": "E2E_GUARDED_ALLOW-call",
  500. "description": "Guarded Bash tool call",
  501. "metadata": {
  502. "kind": "main",
  503. "timingPolicy": "fast-text",
  504. "source": "synthetic",
  505. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  506. },
  507. "match": {
  508. "method": "POST",
  509. "pathIncludes": "/messages",
  510. "bodyIncludes": ["E2E_GUARDED_ALLOW"],
  511. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  512. "lastUserMessageIncludes": ["E2E_GUARDED_ALLOW"]
  513. },
  514. "response": {
  515. "statusCode": 200,
  516. "toolUse": {
  517. "id": "toolu_E2E_GUARDED_ALLOW",
  518. "name": "Bash",
  519. "input": {
  520. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_ALLOW.executed; rm -rf .zcode-e2e/conversation-session-guarded/E2E_GUARDED_ALLOW.target"
  521. }
  522. }
  523. }
  524. },
  525. {
  526. "id": "E2E_GUARDED_ALLOW-final",
  527. "description": "Provider-visible tool result continuation",
  528. "metadata": {
  529. "kind": "main",
  530. "timingPolicy": "fast-text",
  531. "source": "synthetic",
  532. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  533. },
  534. "match": {
  535. "method": "POST",
  536. "pathIncludes": "/messages",
  537. "bodyIncludes": ["E2E_GUARDED_ALLOW", "toolu_E2E_GUARDED_ALLOW"],
  538. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  539. },
  540. "response": {
  541. "statusCode": 200,
  542. "text": {
  543. "id": "E2E_GUARDED_ALLOW-final",
  544. "inputTokens": 80,
  545. "outputTokens": 8,
  546. "text": "E2E_GUARDED_ALLOW_DONE"
  547. }
  548. }
  549. },
  550. {
  551. "id": "E2E_GUARDED_YOLO-call",
  552. "description": "Guarded Bash tool call",
  553. "metadata": {
  554. "kind": "main",
  555. "timingPolicy": "fast-text",
  556. "source": "synthetic",
  557. "syntheticReason": "固定危险命令,授权由真实 broker 执行;命令只引用 case 自有或不存在的目标。"
  558. },
  559. "match": {
  560. "method": "POST",
  561. "pathIncludes": "/messages",
  562. "bodyIncludes": ["E2E_GUARDED_YOLO"],
  563. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  564. "lastUserMessageIncludes": ["E2E_GUARDED_YOLO"]
  565. },
  566. "response": {
  567. "statusCode": 200,
  568. "toolUse": {
  569. "id": "toolu_E2E_GUARDED_YOLO",
  570. "name": "Bash",
  571. "input": {
  572. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_YOLO.executed; rm -rf .zcode-e2e/conversation-session-guarded/E2E_GUARDED_YOLO.target"
  573. }
  574. }
  575. }
  576. },
  577. {
  578. "id": "E2E_GUARDED_YOLO-final",
  579. "description": "Provider-visible tool result continuation",
  580. "metadata": {
  581. "kind": "main",
  582. "timingPolicy": "fast-text",
  583. "source": "synthetic",
  584. "syntheticReason": "只有收到对应 tool_result 才返回终态;spec 检查 isError 和拒绝反馈。"
  585. },
  586. "match": {
  587. "method": "POST",
  588. "pathIncludes": "/messages",
  589. "bodyIncludes": ["E2E_GUARDED_YOLO", "toolu_E2E_GUARDED_YOLO"],
  590. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  591. },
  592. "response": {
  593. "statusCode": 200,
  594. "text": {
  595. "id": "E2E_GUARDED_YOLO-final",
  596. "inputTokens": 80,
  597. "outputTokens": 8,
  598. "text": "E2E_GUARDED_YOLO_DONE"
  599. }
  600. }
  601. },
  602. {
  603. "id": "E2E_GUARDED_QUESTION_PRESET-call",
  604. "description": "Guarded real interaction",
  605. "metadata": {
  606. "kind": "main",
  607. "timingPolicy": "fast-text",
  608. "source": "synthetic",
  609. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  610. },
  611. "maxMatches": 1,
  612. "match": {
  613. "method": "POST",
  614. "pathIncludes": "/messages",
  615. "bodyIncludes": ["E2E_GUARDED_QUESTION_PRESET"],
  616. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  617. "lastUserMessageIncludes": ["E2E_GUARDED_QUESTION_PRESET"]
  618. },
  619. "response": {
  620. "statusCode": 200,
  621. "toolUse": {
  622. "id": "toolu_E2E_GUARDED_QUESTION_PRESET",
  623. "name": "AskUserQuestion",
  624. "input": {
  625. "questions": [
  626. {
  627. "header": "Guarded",
  628. "question": "Which color?",
  629. "options": [
  630. {
  631. "label": "Blue",
  632. "description": "Use blue"
  633. },
  634. {
  635. "label": "Red",
  636. "description": "Use red"
  637. }
  638. ]
  639. }
  640. ]
  641. }
  642. }
  643. }
  644. },
  645. {
  646. "id": "E2E_GUARDED_QUESTION_PRESET-final",
  647. "description": "Guarded provider-visible continuation",
  648. "metadata": {
  649. "kind": "main",
  650. "timingPolicy": "fast-text",
  651. "source": "synthetic",
  652. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  653. },
  654. "maxMatches": 1,
  655. "match": {
  656. "method": "POST",
  657. "pathIncludes": "/messages",
  658. "bodyIncludes": ["E2E_GUARDED_QUESTION_PRESET", "toolu_E2E_GUARDED_QUESTION_PRESET"],
  659. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  660. },
  661. "response": {
  662. "statusCode": 200,
  663. "text": {
  664. "id": "E2E_GUARDED_QUESTION_PRESET-final",
  665. "inputTokens": 80,
  666. "outputTokens": 8,
  667. "text": "E2E_GUARDED_QUESTION_PRESET_DONE"
  668. }
  669. }
  670. },
  671. {
  672. "id": "E2E_GUARDED_QUESTION_CUSTOM-call",
  673. "description": "Guarded real interaction",
  674. "metadata": {
  675. "kind": "main",
  676. "timingPolicy": "fast-text",
  677. "source": "synthetic",
  678. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  679. },
  680. "maxMatches": 1,
  681. "match": {
  682. "method": "POST",
  683. "pathIncludes": "/messages",
  684. "bodyIncludes": ["E2E_GUARDED_QUESTION_CUSTOM"],
  685. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  686. "lastUserMessageIncludes": ["E2E_GUARDED_QUESTION_CUSTOM"]
  687. },
  688. "response": {
  689. "statusCode": 200,
  690. "toolUse": {
  691. "id": "toolu_E2E_GUARDED_QUESTION_CUSTOM",
  692. "name": "AskUserQuestion",
  693. "input": {
  694. "questions": [
  695. {
  696. "header": "Guarded",
  697. "question": "Which color?",
  698. "options": [
  699. {
  700. "label": "Blue",
  701. "description": "Use blue"
  702. },
  703. {
  704. "label": "Red",
  705. "description": "Use red"
  706. }
  707. ]
  708. }
  709. ]
  710. }
  711. }
  712. }
  713. },
  714. {
  715. "id": "E2E_GUARDED_QUESTION_CUSTOM-final",
  716. "description": "Guarded provider-visible continuation",
  717. "metadata": {
  718. "kind": "main",
  719. "timingPolicy": "fast-text",
  720. "source": "synthetic",
  721. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  722. },
  723. "maxMatches": 1,
  724. "match": {
  725. "method": "POST",
  726. "pathIncludes": "/messages",
  727. "bodyIncludes": ["E2E_GUARDED_QUESTION_CUSTOM", "toolu_E2E_GUARDED_QUESTION_CUSTOM"],
  728. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  729. },
  730. "response": {
  731. "statusCode": 200,
  732. "text": {
  733. "id": "E2E_GUARDED_QUESTION_CUSTOM-final",
  734. "inputTokens": 80,
  735. "outputTokens": 8,
  736. "text": "E2E_GUARDED_QUESTION_CUSTOM_DONE"
  737. }
  738. }
  739. },
  740. {
  741. "id": "E2E_GUARDED_QUESTION_EMPTY-call",
  742. "description": "Guarded real interaction",
  743. "metadata": {
  744. "kind": "main",
  745. "timingPolicy": "fast-text",
  746. "source": "synthetic",
  747. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  748. },
  749. "maxMatches": 1,
  750. "match": {
  751. "method": "POST",
  752. "pathIncludes": "/messages",
  753. "bodyIncludes": ["E2E_GUARDED_QUESTION_EMPTY"],
  754. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  755. "lastUserMessageIncludes": ["E2E_GUARDED_QUESTION_EMPTY"]
  756. },
  757. "response": {
  758. "statusCode": 200,
  759. "toolUse": {
  760. "id": "toolu_E2E_GUARDED_QUESTION_EMPTY",
  761. "name": "AskUserQuestion",
  762. "input": {
  763. "questions": [
  764. {
  765. "header": "Guarded",
  766. "question": "Which color?",
  767. "options": [
  768. {
  769. "label": "Blue",
  770. "description": "Use blue"
  771. },
  772. {
  773. "label": "Red",
  774. "description": "Use red"
  775. }
  776. ]
  777. }
  778. ]
  779. }
  780. }
  781. }
  782. },
  783. {
  784. "id": "E2E_GUARDED_QUESTION_EMPTY-final",
  785. "description": "Guarded provider-visible continuation",
  786. "metadata": {
  787. "kind": "main",
  788. "timingPolicy": "fast-text",
  789. "source": "synthetic",
  790. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  791. },
  792. "maxMatches": 1,
  793. "match": {
  794. "method": "POST",
  795. "pathIncludes": "/messages",
  796. "bodyIncludes": ["E2E_GUARDED_QUESTION_EMPTY", "toolu_E2E_GUARDED_QUESTION_EMPTY"],
  797. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  798. },
  799. "response": {
  800. "statusCode": 200,
  801. "text": {
  802. "id": "E2E_GUARDED_QUESTION_EMPTY-final",
  803. "inputTokens": 80,
  804. "outputTokens": 8,
  805. "text": "E2E_GUARDED_QUESTION_EMPTY_DONE"
  806. }
  807. }
  808. },
  809. {
  810. "id": "E2E_GUARDED_QUESTION_DENY-call",
  811. "description": "Guarded real interaction",
  812. "metadata": {
  813. "kind": "main",
  814. "timingPolicy": "fast-text",
  815. "source": "synthetic",
  816. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  817. },
  818. "maxMatches": 1,
  819. "match": {
  820. "method": "POST",
  821. "pathIncludes": "/messages",
  822. "bodyIncludes": ["E2E_GUARDED_QUESTION_DENY"],
  823. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  824. "lastUserMessageIncludes": ["E2E_GUARDED_QUESTION_DENY"]
  825. },
  826. "response": {
  827. "statusCode": 200,
  828. "toolUse": {
  829. "id": "toolu_E2E_GUARDED_QUESTION_DENY",
  830. "name": "AskUserQuestion",
  831. "input": {
  832. "questions": [
  833. {
  834. "header": "Guarded",
  835. "question": "Which color?",
  836. "options": [
  837. {
  838. "label": "Blue",
  839. "description": "Use blue"
  840. },
  841. {
  842. "label": "Red",
  843. "description": "Use red"
  844. }
  845. ]
  846. }
  847. ]
  848. }
  849. }
  850. }
  851. },
  852. {
  853. "id": "E2E_GUARDED_QUESTION_DENY-final",
  854. "description": "Guarded provider-visible continuation",
  855. "metadata": {
  856. "kind": "main",
  857. "timingPolicy": "fast-text",
  858. "source": "synthetic",
  859. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  860. },
  861. "maxMatches": 1,
  862. "match": {
  863. "method": "POST",
  864. "pathIncludes": "/messages",
  865. "bodyIncludes": ["E2E_GUARDED_QUESTION_DENY", "toolu_E2E_GUARDED_QUESTION_DENY"],
  866. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  867. },
  868. "response": {
  869. "statusCode": 200,
  870. "text": {
  871. "id": "E2E_GUARDED_QUESTION_DENY-final",
  872. "inputTokens": 80,
  873. "outputTokens": 8,
  874. "text": "E2E_GUARDED_QUESTION_DENY_DONE"
  875. }
  876. }
  877. },
  878. {
  879. "id": "E2E_GUARDED_PARENT-call",
  880. "description": "Guarded real interaction",
  881. "metadata": {
  882. "kind": "main",
  883. "timingPolicy": "fast-text",
  884. "source": "synthetic",
  885. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  886. },
  887. "maxMatches": 1,
  888. "match": {
  889. "method": "POST",
  890. "pathIncludes": "/messages",
  891. "bodyIncludes": ["E2E_GUARDED_PARENT"],
  892. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  893. "lastUserMessageIncludes": ["E2E_GUARDED_PARENT"]
  894. },
  895. "response": {
  896. "statusCode": 200,
  897. "toolUse": {
  898. "id": "toolu_E2E_GUARDED_PARENT",
  899. "name": "Agent",
  900. "input": {
  901. "description": "Guarded child approval",
  902. "prompt": "E2E_GUARDED_CHILD Run the fixture command once.",
  903. "subagent_type": "general-purpose"
  904. }
  905. }
  906. }
  907. },
  908. {
  909. "id": "E2E_GUARDED_CHILD-call",
  910. "description": "Guarded real interaction",
  911. "metadata": {
  912. "kind": "main",
  913. "timingPolicy": "fast-text",
  914. "source": "synthetic",
  915. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  916. },
  917. "maxMatches": 1,
  918. "match": {
  919. "method": "POST",
  920. "pathIncludes": "/messages",
  921. "bodyIncludes": ["E2E_GUARDED_CHILD"],
  922. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"],
  923. "lastUserMessageIncludes": ["E2E_GUARDED_CHILD"]
  924. },
  925. "response": {
  926. "statusCode": 200,
  927. "toolUse": {
  928. "id": "toolu_E2E_GUARDED_CHILD",
  929. "name": "Bash",
  930. "input": {
  931. "command": "echo executed >> .zcode-e2e/conversation-session-guarded/E2E_GUARDED_CHILD.executed; rm -rf .zcode-e2e/conversation-session-guarded/child-target"
  932. }
  933. }
  934. }
  935. },
  936. {
  937. "id": "E2E_GUARDED_CHILD-final",
  938. "description": "Guarded provider-visible continuation",
  939. "metadata": {
  940. "kind": "main",
  941. "timingPolicy": "fast-text",
  942. "source": "synthetic",
  943. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  944. },
  945. "maxMatches": 1,
  946. "match": {
  947. "method": "POST",
  948. "pathIncludes": "/messages",
  949. "bodyIncludes": ["E2E_GUARDED_CHILD", "toolu_E2E_GUARDED_CHILD", "Guarded child refused"],
  950. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  951. },
  952. "response": {
  953. "statusCode": 200,
  954. "text": {
  955. "id": "E2E_GUARDED_CHILD-final",
  956. "inputTokens": 80,
  957. "outputTokens": 8,
  958. "text": "E2E_GUARDED_CHILD_DONE"
  959. }
  960. }
  961. },
  962. {
  963. "id": "E2E_GUARDED_PARENT-final",
  964. "description": "Guarded provider-visible continuation",
  965. "metadata": {
  966. "kind": "main",
  967. "timingPolicy": "fast-text",
  968. "source": "synthetic",
  969. "syntheticReason": "固定工具调用,使用真实用户交互 broker;断言 provider-visible 答案/拒绝和单次执行。"
  970. },
  971. "maxMatches": 1,
  972. "match": {
  973. "method": "POST",
  974. "pathIncludes": "/messages",
  975. "bodyIncludes": [
  976. "E2E_GUARDED_PARENT",
  977. "toolu_E2E_GUARDED_PARENT",
  978. "E2E_GUARDED_CHILD_DONE"
  979. ],
  980. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  981. },
  982. "response": {
  983. "statusCode": 200,
  984. "text": {
  985. "id": "E2E_GUARDED_PARENT-final",
  986. "inputTokens": 80,
  987. "outputTokens": 8,
  988. "text": "E2E_GUARDED_PARENT_DONE"
  989. }
  990. }
  991. }
  992. ]
  993. }