| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- {
- "version": 1,
- "caseName": "conversation-session-v4-bash-command-prefix-permission",
- "spec": "./test/e2e/conversation-session/permissions/conversation-session-v4-bash-command-prefix-permission.test.ts",
- "fixtures": [
- {
- "id": "bpr-prefix-title",
- "description": "BPR 首发标题响应。",
- "metadata": {
- "kind": "common",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "用首发 marker 隔离标题请求。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["Generate a concise title", "E2E_BPR_PREFIX_FIRST"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "bpr-prefix-title",
- "inputTokens": 64,
- "outputTokens": 8,
- "text": "{\"title\":\"Bash Prefix Permission\"}"
- }
- }
- },
- {
- "id": "bpr-prefix-first-call",
- "description": "首次 lint script。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "固定 Bash command,验证 prefix suggestion。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BPR_PREFIX_FIRST"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_BPR_PREFIX_SAME",
- "E2E_BPR_PREFIX_SIBLING"
- ]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_bpr_prefix_first",
- "name": "Bash",
- "input": {
- "command": "pnpm --dir .zcode-e2e/conversation-session-v4-bash-command-prefix-permission run lint -- --first"
- }
- }
- }
- },
- {
- "id": "bpr-prefix-first-final",
- "description": "首次 lint 收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "证明首次工具执行收口。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BPR_PREFIX_FIRST", "toolu_bpr_prefix_first"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_BPR_PREFIX_SAME",
- "E2E_BPR_PREFIX_SIBLING"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "bpr-prefix-first-final",
- "inputTokens": 80,
- "outputTokens": 8,
- "text": "E2E_BPR_PREFIX_FIRST_DONE"
- }
- }
- },
- {
- "id": "bpr-prefix-same-call",
- "description": "同 lint script 不同参数。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "验证已持久 prefix 自动允许。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BPR_PREFIX_SAME"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_bpr_prefix_same",
- "name": "Bash",
- "input": {
- "command": "pnpm --dir .zcode-e2e/conversation-session-v4-bash-command-prefix-permission run lint -- --second"
- }
- }
- }
- },
- {
- "id": "bpr-prefix-same-final",
- "description": "同 script 自动允许后收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "无权限弹窗时仍需稳定完成 turn。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BPR_PREFIX_SAME", "toolu_bpr_prefix_same"],
- "bodyExcludes": [
- "Generate a concise title",
- "CRITICAL: Respond with TEXT ONLY",
- "E2E_BPR_PREFIX_SIBLING"
- ]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "bpr-prefix-same-final",
- "inputTokens": 80,
- "outputTokens": 8,
- "text": "E2E_BPR_PREFIX_SAME_DONE"
- }
- }
- },
- {
- "id": "bpr-prefix-sibling-call",
- "description": "sibling test script。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "验证 lint prefix 不扩权到 sibling script。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "lastUserMessageIncludes": ["E2E_BPR_PREFIX_SIBLING"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "toolUse": {
- "id": "toolu_bpr_prefix_sibling",
- "name": "Bash",
- "input": {
- "command": "pnpm --dir .zcode-e2e/conversation-session-v4-bash-command-prefix-permission run test -- --sibling"
- }
- }
- }
- },
- {
- "id": "bpr-prefix-sibling-final",
- "description": "sibling 批准一次后收口。",
- "metadata": {
- "kind": "main",
- "source": "synthetic",
- "timingPolicy": "fast-text",
- "syntheticReason": "清理 pending broker 并稳定收口。"
- },
- "match": {
- "method": "POST",
- "pathIncludes": "/messages",
- "bodyIncludes": ["E2E_BPR_PREFIX_SIBLING", "toolu_bpr_prefix_sibling"],
- "bodyExcludes": ["Generate a concise title", "CRITICAL: Respond with TEXT ONLY"]
- },
- "response": {
- "statusCode": 200,
- "text": {
- "id": "bpr-prefix-sibling-final",
- "inputTokens": 80,
- "outputTokens": 8,
- "text": "E2E_BPR_PREFIX_SIBLING_DONE"
- }
- }
- }
- ]
- }
|