Skip to content

Commit 7dfec25

Browse files
authored
test: group security suites by folder (#35)
1 parent 07534e2 commit 7dfec25

14 files changed

Lines changed: 25 additions & 25 deletions

File tree

docs/architecture/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Key implications:
9494

9595
- The provider/tool surface is the capability boundary, not the JavaScript syntax itself.
9696
- Fresh runtimes, schema validation, JSON-only boundaries, timeouts, memory limits, and bounded logs are defense-in-depth features.
97-
- In-process execution still shares the host process. Use a separate process, container, VM, or similar boundary when the code source is hostile or multi-tenant.
97+
- In-process and worker-hosted execution still share the host process. Use `@execbox/remote` behind a separate process, container, VM, or similar boundary when the code source is hostile or multi-tenant.
9898
- Wrapping third-party MCP servers is a separate dependency-trust decision from letting end users author guest code.
9999

100100
## Architecture In One Paragraph

docs/architecture/execbox-executors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ If all shells are busy and the pool is already at `maxSize`, the next `acquire()
114114

115115
- Successful executions return the shell to the pool.
116116
- Normal guest/runtime/tool failures also return the shell, because they do not imply a poisoned host shell.
117-
- `timeout` and `internal_error` results evict the shell, because those outcomes mean the worker/child or transport state may no longer be trustworthy.
117+
- `timeout` and `internal_error` results evict the shell, because those outcomes mean the worker or transport state may no longer be trustworthy.
118118
- Idle pooled shells are evicted after `idleTimeoutMs`, down to `minSize`.
119119
- `dispose()` tears down the executor-owned pool and any idle shells it still owns.
120120

docs/architecture/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ Key implications:
5555

5656
- The provider/tool surface is the capability boundary, not the JavaScript syntax itself.
5757
- Fresh runtimes, schema validation, JSON-only boundaries, timeouts, memory limits, and bounded logs are defense-in-depth features.
58-
- In-process execution still shares the host process. Use a separate process, container, VM, or similar boundary when the code source is hostile or multi-tenant.
58+
- In-process and worker-hosted execution still share the host process. Use `@execbox/remote` behind a separate process, container, VM, or similar boundary when the code source is hostile or multi-tenant.
5959
- Wrapping third-party MCP servers is a separate dependency-trust decision from letting end users author guest code.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"package:check": "npm_config_cache=$PWD/.npm-cache CI=1 npm run build",
3535
"test": "vitest run",
3636
"test:dist-smoke": "node --import tsx scripts/test-dist-smoke.ts",
37-
"test:security": "node ./node_modules/vitest/vitest.mjs run packages/core/__tests__/security/isJsonSerializable.test.ts packages/core/__tests__/core/createToolCallDispatcher.test.ts packages/core/__tests__/protocol/hostSession.test.ts packages/quickjs/__tests__/protocolEndpoint.test.ts packages/quickjs/__tests__/remoteEndpoint.test.ts && node ./node_modules/vitest/vitest.mjs run packages/core/__tests__/mcp/penetration.test.ts packages/remote/__tests__/penetration.test.ts packages/quickjs/__tests__/hostedPenetration.test.ts && node ./node_modules/vitest/vitest.mjs run packages/quickjs/__tests__/workerHostLifecycle.test.ts",
37+
"test:security": "vitest run packages/*/__tests__/security",
3838
"test:watch": "vitest",
3939
"typecheck": "tsc --noEmit && node --import tsx scripts/check-workspace-entrypoints.ts"
4040
},

packages/core/__tests__/core/createToolCallDispatcher.test.ts renamed to packages/core/__tests__/security/createToolCallDispatcher.test.ts

File renamed without changes.

packages/core/__tests__/mcp/penetration.test.ts renamed to packages/core/__tests__/security/mcp/penetration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { QuickJsExecutor } from "@execbox/quickjs";
22

3-
import { runWrappedMcpPenetrationSuite } from "../../test-support/runWrappedMcpPenetrationSuite";
3+
import { runWrappedMcpPenetrationSuite } from "../../../test-support/runWrappedMcpPenetrationSuite";
44

55
runWrappedMcpPenetrationSuite(
66
"QuickJS wrapped MCP penetration tests",

packages/core/__tests__/protocol/hostSession.test.ts renamed to packages/core/__tests__/security/protocol/hostSession.test.ts

File renamed without changes.

packages/core/src/protocol/nodeBootstrap.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const SOURCE_MODE_EXEC_ARGV = ["--conditions=source", "--import", "tsx"];
22

33
/**
4-
* Returns the extra Node flags needed to launch transport-backed child entries
4+
* Returns the extra Node flags needed to launch transport-backed worker entries
55
* directly from source during local development and tests.
66
*/
77
export function getNodeTransportExecArgv(

packages/quickjs/__tests__/hostedPenetration.test.ts renamed to packages/quickjs/__tests__/security/hostedPenetration.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { QuickJsExecutor } from "../src/index";
2-
import { runWrappedMcpPenetrationSuite } from "../../core/test-support/runWrappedMcpPenetrationSuite";
1+
import { runWrappedMcpPenetrationSuite } from "../../../core/test-support/runWrappedMcpPenetrationSuite";
2+
import { QuickJsExecutor } from "../../src/index";
33

44
runWrappedMcpPenetrationSuite(
55
"QuickJsExecutor worker host wrapped MCP",

packages/quickjs/__tests__/protocolEndpoint.test.ts renamed to packages/quickjs/__tests__/security/protocolEndpoint.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { describe, expect, it } from "vitest";
22

33
import type { DispatcherMessage, RunnerMessage } from "@execbox/core/protocol";
44

5-
import { attachQuickJsProtocolEndpoint } from "../src/runner/protocolEndpoint";
5+
import { attachQuickJsProtocolEndpoint } from "../../src/runner/protocolEndpoint";
66

77
const runtimeOptions = {
88
maxLogChars: 64_000,

0 commit comments

Comments
 (0)