1 parent
a8f689e39c
commit
c340aec110
59 files changed
+1108
-1590
No files matched your search
@@ -269,7 +269,7 @@ test('a tool summary names the input a reader looks for', () => {
|
||||
assert.equal(summarizeToolUse('Read', { file_path: '/a/b.cs', limit: 20 }), 'Read · /a/b.cs')
|
||||
assert.equal(summarizeToolUse('Grep', { pattern: 'foo', path: '/x' }), 'Grep · foo')
|
||||
assert.equal(summarizeToolUse('TodoWrite', { todos: [] }), 'TodoWrite')
|
||||
assert.equal(summarizeToolUse('mcp__geek2api_search_ab1234__web_search', { query: 'latest release' }), 'Geek2API WebSearch · latest release')
|
||||
assert.equal(summarizeToolUse('mcp__infstarapi_search_ab1234__web_search', { query: 'latest release' }), 'InfStarAPI WebSearch · latest release')
|
||||
assert.equal(summarizeToolUse('Bash', { command: 'x'.repeat(400) }).length, 'Bash · '.length + 160)
|
||||
})
|
||||
|
||||
@@ -389,7 +389,7 @@ function bridgeStub() {
|
||||
let closed = false
|
||||
return {
|
||||
configPath: '/private-run/mcp.json',
|
||||
toolName: 'mcp__geek2api_search_ab1234__web_search',
|
||||
toolName: 'mcp__infstarapi_search_ab1234__web_search',
|
||||
instructions: 'Use the MCP search tool; native WebSearch is disabled.',
|
||||
backend: 'claude',
|
||||
close: async () => { if (!closed) { closes++; closed = true } },
|
||||
@@ -401,7 +401,7 @@ function bridgeStub() {
|
||||
const credential = async () => ({ baseUrl: 'https://hk.geek2api.com', token: 'sk-plugin-secret', label: 'test' })
|
||||
|
||||
test('MCP argv grants only the exact read-only search tool and disables native WebSearch in every mode', () => {
|
||||
const bridge = { configPath: '/private-run/mcp.json', toolName: 'mcp__geek2api_search_ab1234__web_search', instructions: 'Use MCP search.' }
|
||||
const bridge = { configPath: '/private-run/mcp.json', toolName: 'mcp__infstarapi_search_ab1234__web_search', instructions: 'Use MCP search.' }
|
||||
for (const mode of ['read-only', 'edit', 'full']) {
|
||||
const args = buildClaudeArgs({ mode, searchBridge: bridge })
|
||||
assert.equal(args[args.indexOf('--disallowedTools') + 1], 'WebSearch')
|
||||
@@ -650,7 +650,7 @@ function assertPlansClean(recorded) {
|
||||
for (const path of recorded.created) assert.equal(existsSync(path), false, 'owned plan directory must be gone')
|
||||
}
|
||||
|
||||
test('a submitted plan is inline text or a bounded markdown file inside its bound private directory', t => {
|
||||
test('a submitted plan is inline text or a bounded markdown file inside its bound private directory', { skip: process.platform === 'win32' }, t => {
|
||||
const root = testDirectory(t)
|
||||
const planDirectory = join(root, 'private')
|
||||
mkdirSync(planDirectory)
|
||||
@@ -975,7 +975,7 @@ test('ordinary Read/Bash/MCP execution errors never consume the plan permission
|
||||
['Read', "EACCES: permission denied, open '/private/file'"],
|
||||
['Bash', 'fatal: not a git repository'],
|
||||
['Bash', 'Permission denied: ./script.sh'],
|
||||
['mcp__geek2api_search_ab1234__web_search', 'Geek2API search failed on the selected backend.'],
|
||||
['mcp__infstarapi_search_ab1234__web_search', 'InfStarAPI search failed on the selected backend.'],
|
||||
// Gate-like text returned by a read is still not a native write denial.
|
||||
['Read', 'Cannot write to /outside/no while in plan mode.'],
|
||||
]
|
||||
@@ -1230,7 +1230,7 @@ test('cancelled plan setup removes its directory before a late bridge factory se
|
||||
}
|
||||
})
|
||||
|
||||
test('replaced directory identities are never recursively removed, even during cleanup', async () => {
|
||||
test('replaced directory identities are never recursively removed, even during cleanup', { skip: process.platform === 'win32' }, async () => {
|
||||
const recorded = recordingPlanFs()
|
||||
const originalLstat = recorded.fs.lstatSync
|
||||
let changed = false
|
||||
@@ -1262,7 +1262,7 @@ test('replaced directory identities are never recursively removed, even during c
|
||||
}
|
||||
})
|
||||
|
||||
test('a bound root replaced by a symlink cannot authorize reading another directory', t => {
|
||||
test('a bound root replaced by a symlink cannot authorize reading another directory', { skip: process.platform === 'win32' }, t => {
|
||||
const root = testDirectory(t)
|
||||
const planDirectory = join(root, 'private')
|
||||
const saved = join(root, 'saved-private')
|
||||
|
||||
Reference in new issue
Block a user