
evalspace
Coding agent evaluation framework for running repeatable experiments across different environments.
[!IMPORTANT]
(WIP) This project is under development. Expect breaking changes without deprecation. Do not recommend for production use yet. Feedback and contributions are very welcome!
Features
- Library and CLI usage.
- Typed
*.experiment.ts experiment files.
- Pluggable environments (
local, docker).
- Internal agent resolution with registry-based extension.
- Lifecycle hooks powered by
hookable.
- Structured run artifacts + cache-based skip of passing evals.
Install
pnpm add evalspace
Experiment Shape
Each experiment points to an evals/ directory. Every eval directory must contain PROMPT.md.
Directory example:
evals/
hello-world/
PROMPT.md
VERIFY.sh
Example foo.experiment.ts:
import { createLocalEnvironment, defineExperiment } from 'evalspace'
const environment = createLocalEnvironment({
name: 'local',
agent: {
name: 'codex',
model: 'gpt-5.3-codex',
},
})
export default defineExperiment({
name: 'foo',
environment,
evals: '*',
// These files are copied only after the agent runs the prompt.
verifyFiles: ['*.test.ts'],
scripts: {
// Used when VERIFY.sh is not present.
verify: 'npm run verify',
},
hooks: {
'workspace:prepare': async (_environment, _evalId, files) => {
files.push('./skills')
},
},
})
Verify Contract
Pass/fail is determined by verify command exit code:
0 => passed
- non-zero => failed
Verify resolution order per eval:
VERIFY.sh in eval directory.
scripts.verify from experiment config.
- error if neither exists.
verifyFiles can list paths or globs relative to each eval directory for files that should be copied only after the agent prompt run (for example test files needed by verification).
CLI
evalspace run playground/foo.experiment.ts
evalspace list "**/*.experiment.ts"
evalspace inspect playground/foo.experiment.ts
evalspace run in human-readable mode shows a live per-eval status list (queued, preparing, agent, verifying, final result) and then prints a final results table with Eval, Status, Duration, and Cache.
Run options
--output <path>: artifact root directory.
--no-cache: disable skip-from-cache.
--eval <glob>: limit to matching eval directories (repeatable).
--concurrency <n|cpu>: worker parallelism.
--json: print only the JSON summary (no live status output or final table text).
Library API
import {
createLocalEnvironment,
defineDockerEnvironment,
defineExperiment,
registerAgent,
runExperiment,
} from 'evalspace'
Local Environment
createWorkspace() creates a unique temp workspace under os.tmpdir() using fs.mkdtemp.
Docker Environment
Supports:
single mode: one container per run, per-eval folder workspace.
multi mode: one container per eval.
You can build a runtime image from a Dockerfile so agent tooling is installed once and reused:
import { defineDockerEnvironment } from 'evalspace'
defineDockerEnvironment({
name: 'docker',
mode: 'single',
image: {
dockerfile: './docker/codex.Dockerfile',
dockerImageTag: 'evalspace:codex-node24',
},
agent: {
name: 'codex',
model: 'gpt-5.3-codex',
},
})
image.dockerfile accepts:
- a path string (
'./docker/codex.Dockerfile')
{ path: './docker/codex.Dockerfile' }
{ content: 'FROM node:24-slim\n...' }
For codex in Docker, you can pass auth in two ways:
- Login with API key (runs
echo '<apiKey>' | codex login --with-api-key inside container):
defineDockerEnvironment({
name: 'docker',
agent: {
name: 'codex',
model: 'gpt-5.3-codex',
codexAuth: {
method: 'api-key',
apiKey: process.env.OPENAI_API_KEY!,
},
},
})
- Copy host
~/.codex/auth.json into container:
defineDockerEnvironment({
name: 'docker',
agent: {
name: 'codex',
model: 'gpt-5.3-codex',
codexAuth: {
method: 'auth-file',
// optional; defaults to ~/.codex/auth.json
authFilePath: '~/.codex/auth.json',
},
},
})
Example codex.Dockerfile:
FROM node:24-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates git \
&& rm -rf /var/lib/apt/lists/* \
&& npm install -g @openai/codex@latest --include=optional
Artifacts
Default output root: <experimentBaseDir>/.evalspace
Per run:
runs/<runId>/summary.json
runs/<runId>/evals/<evalId>/result.json
runs/<runId>/evals/<evalId>/agent.stdout.log
runs/<runId>/evals/<evalId>/agent.stderr.log
runs/<runId>/evals/<evalId>/verify.stdout.log
runs/<runId>/evals/<evalId>/verify.stderr.log
Cache:
Only prior passing evals are skipped from cache.
Development
pnpm install
pnpm typecheck
pnpm test
pnpm build
Run the real Docker integration test (node:24-slim) when Docker is available:
EVALSPACE_RUN_DOCKER_TESTS=1 pnpm test -- --run packages/evalspace/tests/environments.docker.integration.test.ts