conversation-session-v4-bash-command-prefix-permission.json 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. {
  2. "version": 1,
  3. "caseName": "conversation-session-v4-bash-command-prefix-permission",
  4. "spec": "./test/e2e/conversation-session/permissions/conversation-session-v4-bash-command-prefix-permission.test.ts",
  5. "fixtures": [
  6. {
  7. "id": "bpr-prefix-title",
  8. "description": "BPR 首发标题响应。",
  9. "metadata": {
  10. "kind": "common",
  11. "source": "synthetic",
  12. "timingPolicy": "fast-text",
  13. "syntheticReason": "用首发 marker 隔离标题请求。"
  14. },
  15. "match": {
  16. "method": "POST",
  17. "pathIncludes": "/messages",
  18. "bodyIncludes": ["Generate a concise title", "E2E_BPR_PREFIX_FIRST"]
  19. },
  20. "response": {
  21. "statusCode": 200,
  22. "text": {
  23. "id": "bpr-prefix-title",
  24. "inputTokens": 64,
  25. "outputTokens": 8,
  26. "text": "{\"title\":\"Bash Prefix Permission\"}"
  27. }
  28. }
  29. },
  30. {
  31. "id": "bpr-prefix-first-call",
  32. "description": "首次 lint script。",
  33. "metadata": {
  34. "kind": "main",
  35. "source": "synthetic",
  36. "timingPolicy": "fast-text",
  37. "syntheticReason": "固定 Bash command,验证 prefix suggestion。"
  38. },
  39. "match": {
  40. "method": "POST",
  41. "pathIncludes": "/messages",
  42. "lastUserMessageIncludes": ["E2E_BPR_PREFIX_FIRST"],
  43. "bodyExcludes": [
  44. "Generate a concise title",
  45. "CRITICAL: Respond with TEXT ONLY",
  46. "E2E_BPR_PREFIX_SAME",
  47. "E2E_BPR_PREFIX_SIBLING"
  48. ]
  49. },
  50. "response": {
  51. "statusCode": 200,
  52. "toolUse": {
  53. "id": "toolu_bpr_prefix_first",
  54. "name": "Bash",
  55. "input": {
  56. "command": "pnpm --dir .zcode-e2e/conversation-session-v4-bash-command-prefix-permission run lint -- --first"
  57. }
  58. }
  59. }
  60. },
  61. {
  62. "id": "bpr-prefix-first-final",
  63. "description": "首次 lint 收口。",
  64. "metadata": {
  65. "kind": "main",
  66. "source": "synthetic",
  67. "timingPolicy": "fast-text",
  68. "syntheticReason": "证明首次工具执行收口。"
  69. },
  70. "match": {
  71. "method": "POST",
  72. "pathIncludes": "/messages",
  73. "bodyIncludes": ["E2E_BPR_PREFIX_FIRST", "toolu_bpr_prefix_first"],
  74. "bodyExcludes": [
  75. "Generate a concise title",
  76. "CRITICAL: Respond with TEXT ONLY",
  77. "E2E_BPR_PREFIX_SAME",
  78. "E2E_BPR_PREFIX_SIBLING"
  79. ]
  80. },
  81. "response": {
  82. "statusCode": 200,
  83. "text": {
  84. "id": "bpr-prefix-first-final",
  85. "inputTokens": 80,
  86. "outputTokens": 8,
  87. "text": "E2E_BPR_PREFIX_FIRST_DONE"
  88. }
  89. }
  90. },
  91. {
  92. "id": "bpr-prefix-same-call",
  93. "description": "同 lint script 不同参数。",
  94. "metadata": {
  95. "kind": "main",
  96. "source": "synthetic",
  97. "timingPolicy": "fast-text",
  98. "syntheticReason": "验证已持久 prefix 自动允许。"
  99. },
  100. "match": {
  101. "method": "POST",
  102. "pathIncludes": "/messages",
  103. "lastUserMessageIncludes": ["E2E_BPR_PREFIX_SAME"],
  104. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  105. },
  106. "response": {
  107. "statusCode": 200,
  108. "toolUse": {
  109. "id": "toolu_bpr_prefix_same",
  110. "name": "Bash",
  111. "input": {
  112. "command": "pnpm --dir .zcode-e2e/conversation-session-v4-bash-command-prefix-permission run lint -- --second"
  113. }
  114. }
  115. }
  116. },
  117. {
  118. "id": "bpr-prefix-same-final",
  119. "description": "同 script 自动允许后收口。",
  120. "metadata": {
  121. "kind": "main",
  122. "source": "synthetic",
  123. "timingPolicy": "fast-text",
  124. "syntheticReason": "无权限弹窗时仍需稳定完成 turn。"
  125. },
  126. "match": {
  127. "method": "POST",
  128. "pathIncludes": "/messages",
  129. "bodyIncludes": ["E2E_BPR_PREFIX_SAME", "toolu_bpr_prefix_same"],
  130. "bodyExcludes": [
  131. "Generate a concise title",
  132. "CRITICAL: Respond with TEXT ONLY",
  133. "E2E_BPR_PREFIX_SIBLING"
  134. ]
  135. },
  136. "response": {
  137. "statusCode": 200,
  138. "text": {
  139. "id": "bpr-prefix-same-final",
  140. "inputTokens": 80,
  141. "outputTokens": 8,
  142. "text": "E2E_BPR_PREFIX_SAME_DONE"
  143. }
  144. }
  145. },
  146. {
  147. "id": "bpr-prefix-sibling-call",
  148. "description": "sibling test script。",
  149. "metadata": {
  150. "kind": "main",
  151. "source": "synthetic",
  152. "timingPolicy": "fast-text",
  153. "syntheticReason": "验证 lint prefix 不扩权到 sibling script。"
  154. },
  155. "match": {
  156. "method": "POST",
  157. "pathIncludes": "/messages",
  158. "lastUserMessageIncludes": ["E2E_BPR_PREFIX_SIBLING"],
  159. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  160. },
  161. "response": {
  162. "statusCode": 200,
  163. "toolUse": {
  164. "id": "toolu_bpr_prefix_sibling",
  165. "name": "Bash",
  166. "input": {
  167. "command": "pnpm --dir .zcode-e2e/conversation-session-v4-bash-command-prefix-permission run test -- --sibling"
  168. }
  169. }
  170. }
  171. },
  172. {
  173. "id": "bpr-prefix-sibling-final",
  174. "description": "sibling 批准一次后收口。",
  175. "metadata": {
  176. "kind": "main",
  177. "source": "synthetic",
  178. "timingPolicy": "fast-text",
  179. "syntheticReason": "清理 pending broker 并稳定收口。"
  180. },
  181. "match": {
  182. "method": "POST",
  183. "pathIncludes": "/messages",
  184. "bodyIncludes": ["E2E_BPR_PREFIX_SIBLING", "toolu_bpr_prefix_sibling"],
  185. "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
  186. },
  187. "response": {
  188. "statusCode": 200,
  189. "text": {
  190. "id": "bpr-prefix-sibling-final",
  191. "inputTokens": 80,
  192. "outputTokens": 8,
  193. "text": "E2E_BPR_PREFIX_SIBLING_DONE"
  194. }
  195. }
  196. }
  197. ]
  198. }