self-bench 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dockerignore +10 -0
- package/Dockerfile +37 -0
- package/Dockerfile.sandbox +24 -0
- package/README.md +34 -26
- package/biome.json +18 -0
- package/bun.lock +1182 -0
- package/compose.yaml +85 -0
- package/dist/agent-smoke-main.js +1 -1
- package/dist/build-metadata.d.ts +2 -0
- package/dist/build-metadata.d.ts.map +1 -0
- package/dist/build-metadata.js +2 -0
- package/dist/build-metadata.js.map +1 -0
- package/dist/cli.js +18 -8
- package/dist/cli.js.map +1 -1
- package/dist/eval-main.js +1 -1
- package/dist/reaudit-main.js +1 -1
- package/dist/repair-main.js +1 -1
- package/dist/validate-main.js +1 -1
- package/docs/evaluations.md +67 -0
- package/docs/operations.md +178 -0
- package/docs/task-construction.md +94 -0
- package/package.json +28 -15
- package/scripts/verify-package.ts +57 -0
- package/scripts/write-build-metadata.ts +27 -0
- package/src/activities.ts +1236 -0
- package/src/agent-smoke-main.ts +63 -0
- package/src/agent-smoke.ts +132 -0
- package/src/api-main.ts +12 -0
- package/src/api.ts +239 -0
- package/src/artifacts.ts +361 -0
- package/src/audit.ts +106 -0
- package/src/build-metadata.ts +3 -0
- package/src/cli.ts +350 -0
- package/src/codex-review.ts +220 -0
- package/src/config.ts +117 -0
- package/src/contracts.ts +209 -0
- package/src/coupling.ts +259 -0
- package/src/docker-executor.ts +115 -0
- package/src/eval-main.ts +92 -0
- package/src/evaluate.ts +293 -0
- package/src/github.ts +26 -0
- package/src/harbor-results.ts +142 -0
- package/src/harbor-task.ts +528 -0
- package/src/hash.ts +5 -0
- package/src/modal-auth.ts +11 -0
- package/src/modal-executor.ts +176 -0
- package/src/parallel.ts +24 -0
- package/src/process.ts +165 -0
- package/src/provenance.ts +458 -0
- package/src/reaudit-main.ts +192 -0
- package/src/repair-main.ts +203 -0
- package/src/repair.ts +55 -0
- package/src/run-wait.ts +40 -0
- package/src/sandbox-author.ts +19 -0
- package/src/sandbox-repair.ts +160 -0
- package/src/sandbox-review.ts +17 -0
- package/src/sandbox-validation-repair.ts +174 -0
- package/src/sandbox.ts +51 -0
- package/src/subscription-auth.ts +67 -0
- package/src/temporal.ts +23 -0
- package/src/validate-main.ts +171 -0
- package/src/validation-repair.ts +94 -0
- package/src/worker-main.ts +32 -0
- package/src/workflow.ts +519 -0
- package/tsconfig.build.json +13 -0
- package/tsconfig.json +21 -0
package/compose.yaml
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
name: selfbench
|
|
2
|
+
|
|
3
|
+
services:
|
|
4
|
+
postgres:
|
|
5
|
+
image: postgres:17.6-bookworm
|
|
6
|
+
environment:
|
|
7
|
+
POSTGRES_DB: temporal
|
|
8
|
+
POSTGRES_USER: temporal
|
|
9
|
+
POSTGRES_PASSWORD: temporal
|
|
10
|
+
volumes:
|
|
11
|
+
- temporal-postgres:/var/lib/postgresql/data
|
|
12
|
+
healthcheck:
|
|
13
|
+
test: ["CMD-SHELL", "pg_isready -U temporal"]
|
|
14
|
+
interval: 5s
|
|
15
|
+
timeout: 5s
|
|
16
|
+
retries: 20
|
|
17
|
+
|
|
18
|
+
temporal:
|
|
19
|
+
image: temporalio/auto-setup:1.29.6
|
|
20
|
+
depends_on:
|
|
21
|
+
postgres:
|
|
22
|
+
condition: service_healthy
|
|
23
|
+
environment:
|
|
24
|
+
DB: postgres12
|
|
25
|
+
DB_PORT: 5432
|
|
26
|
+
POSTGRES_USER: temporal
|
|
27
|
+
POSTGRES_PWD: temporal
|
|
28
|
+
POSTGRES_SEEDS: postgres
|
|
29
|
+
ports:
|
|
30
|
+
- "127.0.0.1:7233:7233"
|
|
31
|
+
restart: on-failure
|
|
32
|
+
|
|
33
|
+
api:
|
|
34
|
+
image: selfbench:local
|
|
35
|
+
build:
|
|
36
|
+
context: .
|
|
37
|
+
args:
|
|
38
|
+
SELFBENCH_BUILD_COMMIT: ${SELFBENCH_BUILD_COMMIT:-}
|
|
39
|
+
depends_on:
|
|
40
|
+
- temporal
|
|
41
|
+
environment: &selfbench-environment
|
|
42
|
+
SELFBENCH_API_HOST: 0.0.0.0
|
|
43
|
+
SELFBENCH_API_TOKEN: ${SELFBENCH_API_TOKEN:-selfbench-local}
|
|
44
|
+
SELFBENCH_BUILD_COMMIT: ${SELFBENCH_BUILD_COMMIT:-}
|
|
45
|
+
SELFBENCH_TEMPORAL_ADDRESS: temporal:7233
|
|
46
|
+
SELFBENCH_ARTIFACT_BACKEND: local
|
|
47
|
+
SELFBENCH_ARTIFACT_DIR: /var/lib/selfbench/artifacts
|
|
48
|
+
SELFBENCH_EXECUTION_BACKEND: ${SELFBENCH_EXECUTION_BACKEND:-docker}
|
|
49
|
+
SELFBENCH_DOCKER_IMAGE: selfbench-sandbox:local
|
|
50
|
+
SELFBENCH_HARBOR_ENVIRONMENT: ${SELFBENCH_HARBOR_ENVIRONMENT:-${SELFBENCH_EXECUTION_BACKEND:-docker}}
|
|
51
|
+
ports:
|
|
52
|
+
- "127.0.0.1:8080:8080"
|
|
53
|
+
volumes:
|
|
54
|
+
- artifacts:/var/lib/selfbench/artifacts
|
|
55
|
+
restart: on-failure
|
|
56
|
+
|
|
57
|
+
worker:
|
|
58
|
+
image: selfbench:local
|
|
59
|
+
build:
|
|
60
|
+
context: .
|
|
61
|
+
args:
|
|
62
|
+
SELFBENCH_BUILD_COMMIT: ${SELFBENCH_BUILD_COMMIT:-}
|
|
63
|
+
command: ["node", "dist/worker-main.js"]
|
|
64
|
+
depends_on:
|
|
65
|
+
- temporal
|
|
66
|
+
environment:
|
|
67
|
+
<<: *selfbench-environment
|
|
68
|
+
GH_TOKEN: ${GH_TOKEN:-}
|
|
69
|
+
MODAL_TOKEN_ID: ${MODAL_TOKEN_ID:-}
|
|
70
|
+
MODAL_TOKEN_SECRET: ${MODAL_TOKEN_SECRET:-}
|
|
71
|
+
CODEX_AUTH_JSON_PATH: /root/.codex/auth.json
|
|
72
|
+
user: root
|
|
73
|
+
group_add:
|
|
74
|
+
- ${DOCKER_GID:-0}
|
|
75
|
+
volumes:
|
|
76
|
+
- /var/run/docker.sock:/var/run/docker.sock
|
|
77
|
+
- ${SELFBENCH_MODAL_CONFIG_PATH:-/dev/null}:/root/.modal.toml:ro
|
|
78
|
+
- ${SELFBENCH_PI_AUTH_PATH:-${HOME}/.pi/agent/auth.json}:/root/.pi/agent/auth.json:ro
|
|
79
|
+
- ${SELFBENCH_CODEX_AUTH_PATH:-${HOME}/.codex/auth.json}:/root/.codex/auth.json:ro
|
|
80
|
+
- artifacts:/var/lib/selfbench/artifacts
|
|
81
|
+
restart: on-failure
|
|
82
|
+
|
|
83
|
+
volumes:
|
|
84
|
+
artifacts:
|
|
85
|
+
temporal-postgres:
|
package/dist/agent-smoke-main.js
CHANGED
|
@@ -16,7 +16,7 @@ if (parsed.values.help) {
|
|
|
16
16
|
console.log(`Attempt installation and instantiation of every pinned Harbor adapter.
|
|
17
17
|
|
|
18
18
|
Usage:
|
|
19
|
-
|
|
19
|
+
self-bench-agent-smoke --task DIRECTORY --jobs DIRECTORY [options]
|
|
20
20
|
|
|
21
21
|
Options:
|
|
22
22
|
--harbor PATH Harbor executable (default: harbor)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-metadata.d.ts","sourceRoot":"","sources":["../src/build-metadata.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,QAAyD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-metadata.js","sourceRoot":"","sources":["../src/build-metadata.ts"],"names":[],"mappings":"AAAA,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAExC,MAAM,CAAC,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,sBAAsB,IAAI,gBAAgB,CAAC"}
|
package/dist/cli.js
CHANGED
|
@@ -7,6 +7,7 @@ import { Readable, Transform } from "node:stream";
|
|
|
7
7
|
import { pipeline } from "node:stream/promises";
|
|
8
8
|
import { fileURLToPath } from "node:url";
|
|
9
9
|
import { parseArgs } from "node:util";
|
|
10
|
+
import { buildCommit } from "./build-metadata.js";
|
|
10
11
|
import { runCommand } from "./process.js";
|
|
11
12
|
import { collectGitHubPullRequestProvenance, collectRepositoryProvenance } from "./provenance.js";
|
|
12
13
|
import { waitForRun } from "./run-wait.js";
|
|
@@ -59,6 +60,7 @@ async function up(args) {
|
|
|
59
60
|
const backend = parsed.values.backend;
|
|
60
61
|
const environment = {
|
|
61
62
|
...process.env,
|
|
63
|
+
SELFBENCH_BUILD_COMMIT: await resolveSelfBenchCommit(),
|
|
62
64
|
SELFBENCH_EXECUTION_BACKEND: backend,
|
|
63
65
|
SELFBENCH_HARBOR_ENVIRONMENT: backend,
|
|
64
66
|
...(backend === "modal"
|
|
@@ -184,8 +186,16 @@ async function resolveSelfBenchCommit() {
|
|
|
184
186
|
if (process.env.SELFBENCH_BUILD_COMMIT) {
|
|
185
187
|
return process.env.SELFBENCH_BUILD_COMMIT;
|
|
186
188
|
}
|
|
189
|
+
if (/^[0-9a-f]{40}$/i.test(buildCommit) && !/^0+$/.test(buildCommit)) {
|
|
190
|
+
return buildCommit;
|
|
191
|
+
}
|
|
187
192
|
const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
|
|
188
|
-
|
|
193
|
+
try {
|
|
194
|
+
return (await runCommand("git", ["-C", root, "rev-parse", "HEAD"])).stdout.trim();
|
|
195
|
+
}
|
|
196
|
+
catch {
|
|
197
|
+
throw new Error("SelfBench was built without commit metadata; set SELFBENCH_BUILD_COMMIT to a full commit SHA");
|
|
198
|
+
}
|
|
189
199
|
}
|
|
190
200
|
async function passthrough(method, path) {
|
|
191
201
|
console.log(JSON.stringify(await requestJson(path, { method }), null, 2));
|
|
@@ -278,13 +288,13 @@ function printHelp() {
|
|
|
278
288
|
console.log(`SelfBench creates durable tiered Harbor evaluations.
|
|
279
289
|
|
|
280
290
|
Usage:
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
291
|
+
self-bench up [--backend docker|modal] [--modal-config PATH]
|
|
292
|
+
self-bench run --repo PATH [--easy-count N] [--medium-count N] [--hard-count N]
|
|
293
|
+
[--model MODEL] [--run-id ID] [--wait] [--output OUTPUT.tar.gz]
|
|
294
|
+
self-bench status RUN_ID
|
|
295
|
+
self-bench cancel RUN_ID
|
|
296
|
+
self-bench download RUN_ID OUTPUT.tar.gz
|
|
297
|
+
self-bench list
|
|
288
298
|
|
|
289
299
|
The up command starts the local stack and configures both sandbox execution and Harbor validation for
|
|
290
300
|
one backend. Modal uses ~/.modal.toml unless --modal-config overrides it.
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,kCAAkC,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAwB,UAAU,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,OAA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AAK,EAAE,CAAC;AAC1C,CAAC;AAED,SAAS,kBAAkB,CAAC,KAAa,EAAE,KAAa;IACtD,MAAM,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC7B,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,gCAAgC,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,MAAM,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,MAAM,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;AAC7G,CAAC;AAED,SAAS,IAAI,CAAC,OAAe;IAC3B,MAAM,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC;AAC3B,CAAC;AAED,SAAS,SAAS;IAChB,OAAO,CAAC,GAAG,CAAC;;;;;;;;;;;;;;;;;6FAiB+E,CAAC,CAAC;AAC/F,CAAC"}
|
package/dist/eval-main.js
CHANGED
|
@@ -19,7 +19,7 @@ if (parsed.values.help) {
|
|
|
19
19
|
console.log(`Run Harbor tasks through the fixed Codex subscription model matrix.
|
|
20
20
|
|
|
21
21
|
Usage:
|
|
22
|
-
|
|
22
|
+
self-bench-eval (--export FILE.tar.gz | --tasks DIRECTORY) --jobs DIRECTORY [options]
|
|
23
23
|
|
|
24
24
|
Options:
|
|
25
25
|
--tasks DIRECTORY Expanded Harbor tasks (one or more)
|
package/dist/reaudit-main.js
CHANGED
|
@@ -25,7 +25,7 @@ if (parsed.values.help) {
|
|
|
25
25
|
console.log(`Re-audit expanded Harbor tasks for test-to-gold coupling.
|
|
26
26
|
|
|
27
27
|
Usage:
|
|
28
|
-
|
|
28
|
+
self-bench-reaudit --tasks DIRECTORY --output REPORT.json [options]
|
|
29
29
|
|
|
30
30
|
Options:
|
|
31
31
|
--concurrency N Concurrent Sol reviews (default: 10)
|
package/dist/repair-main.js
CHANGED
|
@@ -25,7 +25,7 @@ if (parsed.values.help) {
|
|
|
25
25
|
console.log(`Repair coupled tests in expanded Harbor tasks.
|
|
26
26
|
|
|
27
27
|
Usage:
|
|
28
|
-
|
|
28
|
+
self-bench-repair --tasks DIRECTORY --review REPORT.json --output DIRECTORY [options]
|
|
29
29
|
|
|
30
30
|
Options:
|
|
31
31
|
--concurrency N Concurrent repair sandboxes (default: 9)
|
package/dist/validate-main.js
CHANGED
|
@@ -19,7 +19,7 @@ if (parsed.values.help) {
|
|
|
19
19
|
console.log(`Run Harbor nop and oracle gates for expanded SelfBench tasks.
|
|
20
20
|
|
|
21
21
|
Usage:
|
|
22
|
-
|
|
22
|
+
self-bench-validate --tasks DIRECTORY --jobs DIRECTORY [options]
|
|
23
23
|
|
|
24
24
|
Options:
|
|
25
25
|
--environment NAME Harbor environment (default: modal)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Running SelfBench evaluations
|
|
2
|
+
|
|
3
|
+
A SelfBench export contains a manifest and one archive per accepted Harbor task:
|
|
4
|
+
|
|
5
|
+
```text
|
|
6
|
+
manifest.json
|
|
7
|
+
tasks/
|
|
8
|
+
└── TASK_ID.tar.gz
|
|
9
|
+
└── harbor-task/
|
|
10
|
+
├── task.toml
|
|
11
|
+
├── instruction.md
|
|
12
|
+
├── environment/
|
|
13
|
+
├── tests/
|
|
14
|
+
└── solution/
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Exports include repository snapshots, held-out tests, and reference solutions. They are sensitive and unencrypted; keep them private.
|
|
18
|
+
|
|
19
|
+
## Run one task
|
|
20
|
+
|
|
21
|
+
Extract the export and select a task:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
mkdir -p ./export ./selected-task
|
|
25
|
+
tar -xzf ./my-evals.tar.gz -C ./export
|
|
26
|
+
|
|
27
|
+
TASK_ID="$(jq -r '.tasks[0].taskId' ./export/manifest.json)"
|
|
28
|
+
tar -xzf "./export/tasks/$TASK_ID.tar.gz" -C ./selected-task
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Install Harbor and run Codex against it:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
uv tool install --python 3.12 'harbor[modal]==0.20.1.dev202608040148'
|
|
35
|
+
|
|
36
|
+
export CODEX_FORCE_AUTH_JSON=1
|
|
37
|
+
export CODEX_AUTH_JSON_PATH="$HOME/.codex/auth.json"
|
|
38
|
+
env -u OPENAI_API_KEY harbor run \
|
|
39
|
+
--path ./selected-task/harbor-task \
|
|
40
|
+
--agent codex \
|
|
41
|
+
--model gpt-5.6-sol \
|
|
42
|
+
--ak version=0.146.1 \
|
|
43
|
+
--ak reasoning_effort=high \
|
|
44
|
+
--env modal \
|
|
45
|
+
--jobs-dir ./harbor-jobs \
|
|
46
|
+
--yes
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
The `solution/` directory is used only for explicit oracle validation and is never mounted for coding-agent trials.
|
|
50
|
+
|
|
51
|
+
## Run the model matrix
|
|
52
|
+
|
|
53
|
+
The included matrix runner evaluates every exported task with `gpt-5.6-sol`, `gpt-5.6-terra`, and `gpt-5.6-luna`. It reuses completed Harbor jobs after a restart.
|
|
54
|
+
|
|
55
|
+
From the SelfBench checkout:
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
env -u OPENAI_API_KEY node dist/eval-main.js \
|
|
59
|
+
--export ./my-evals.tar.gz \
|
|
60
|
+
--jobs ./matrix-jobs \
|
|
61
|
+
--harbor harbor \
|
|
62
|
+
--environment modal \
|
|
63
|
+
--concurrency 20 \
|
|
64
|
+
--auth "$HOME/.codex/auth.json"
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
The harness requires ChatGPT-backed Codex authentication and does not forward `OPENAI_API_KEY`.
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# Operations and deployment
|
|
2
|
+
|
|
3
|
+
This document covers SelfBench configuration, persistence, authentication, the HTTP API, and cloud deployment. Start with the repository [README](../README.md) for the shortest local workflow.
|
|
4
|
+
|
|
5
|
+
## Local stack
|
|
6
|
+
|
|
7
|
+
`docker compose up` starts:
|
|
8
|
+
|
|
9
|
+
- Postgres for Temporal state;
|
|
10
|
+
- Temporal;
|
|
11
|
+
- the SelfBench API;
|
|
12
|
+
- the SelfBench worker;
|
|
13
|
+
- a persistent artifact volume.
|
|
14
|
+
|
|
15
|
+
The worker mounts the host Docker socket for local sandboxes. The API never receives the Docker socket or model credentials. The local Postgres user and password are development defaults, both named `temporal`.
|
|
16
|
+
|
|
17
|
+
Temporal and artifact state live in the `selfbench_temporal-postgres` and `selfbench_artifacts` volumes. Back up those volumes before an upgrade when workflow history or generated artifacts must be retained. SelfBench has no application database migrations.
|
|
18
|
+
|
|
19
|
+
## Credentials
|
|
20
|
+
|
|
21
|
+
SelfBench uses three separate credentials:
|
|
22
|
+
|
|
23
|
+
- `gh auth login` supplies read access to merged pull requests. Export `GH_TOKEN="$(gh auth token)"` for the worker. Write access is not required.
|
|
24
|
+
- Pi's `openai-codex` entry in `~/.pi/agent/auth.json` powers discovery, authoring, and review.
|
|
25
|
+
- `~/.codex/auth.json` powers the constrained repair step and agent evaluation.
|
|
26
|
+
|
|
27
|
+
Both model credentials must be backed by a ChatGPT subscription. SelfBench removes API-key fields and does not fall back to `OPENAI_API_KEY`.
|
|
28
|
+
|
|
29
|
+
Compose mounts the default auth files read-only. Override their host paths before starting the stack when necessary:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
export SELFBENCH_PI_AUTH_PATH=/absolute/path/to/pi-auth.json
|
|
33
|
+
export SELFBENCH_CODEX_AUTH_PATH=/absolute/path/to/codex-auth.json
|
|
34
|
+
self-bench up
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Execution backends
|
|
38
|
+
|
|
39
|
+
### Docker
|
|
40
|
+
|
|
41
|
+
Build the worker's sandbox image once:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
self-bench up --backend docker
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Docker defaults to one activity at a time because sandboxes share the host. Each candidate defaults to 4 CPUs, 8,192 MB RAM, and 20,480 MB storage. Authored tasks may request other positive limits.
|
|
48
|
+
|
|
49
|
+
### Modal
|
|
50
|
+
|
|
51
|
+
Authenticate Modal and mount its profile into the worker:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
modal token new
|
|
55
|
+
|
|
56
|
+
self-bench up --backend modal
|
|
57
|
+
|
|
58
|
+
# If your profile is not at ~/.modal.toml:
|
|
59
|
+
self-bench up --backend modal --modal-config /absolute/path/to/.modal.toml
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`self-bench up` selects both sandbox execution and Harbor validation for the requested backend. Modal mounts `~/.modal.toml` by default; `--modal-config` overrides that path. A secret manager may provide `MODAL_TOKEN_ID` and `MODAL_TOKEN_SECRET` instead. Empty token environment variables are removed at worker startup so they cannot override a valid mounted profile.
|
|
63
|
+
|
|
64
|
+
Modal defaults to 20 concurrent worker activities. Discovery starts eight independently retryable shards, and candidate slots are continuously refilled. Discovery and authoring stop after eight minutes without process output; review stops after five. Discovery also has a 45-minute per-attempt deadline and up to three attempts per shard.
|
|
65
|
+
|
|
66
|
+
## CLI behavior
|
|
67
|
+
|
|
68
|
+
`self-bench run` requires an absolute or relative path to a Git checkout whose `origin` is an HTTPS or SSH GitHub URL. It pins `HEAD`; uncommitted content is excluded.
|
|
69
|
+
|
|
70
|
+
The CLI collects two types of provenance:
|
|
71
|
+
|
|
72
|
+
1. sanitized user messages from Pi, Claude Code, and Codex sessions associated with the checkout or its worktrees;
|
|
73
|
+
2. exact titles and bodies from up to 500 recent merged pull requests by non-bot authors that clear coarse tier-appropriate size thresholds.
|
|
74
|
+
|
|
75
|
+
GitHub records remain labeled `github-pull-request` and are bound to their own repository, PR number, and canonical URL. Local requests are preferred when they clearly describe the same change. Common credential forms and injected harness context are removed, but this is not a general secret scanner.
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
self-bench run \
|
|
79
|
+
--repo /absolute/path/to/repository \
|
|
80
|
+
--easy-count 5 \
|
|
81
|
+
--medium-count 10 \
|
|
82
|
+
--hard-count 5 \
|
|
83
|
+
--model gpt-5.6-sol \
|
|
84
|
+
--output ./self-bench-tasks.tar.gz
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The three tier counts total 1–100. Each is a fixed candidate authoring budget, not an accepted-task target: rejected candidates are not replaced. Discovery expands only until it fills each requested tier budget, then accepted tasks are exported.
|
|
88
|
+
|
|
89
|
+
`--output` implies `--wait`. It reports phase changes, requires a successful Temporal terminal state, downloads with create-only filesystem semantics, and verifies the API-provided SHA-256.
|
|
90
|
+
|
|
91
|
+
A custom `--run-id` must contain 3–63 lowercase letters, digits, or hyphens and start with a letter or digit.
|
|
92
|
+
|
|
93
|
+
## HTTP API
|
|
94
|
+
|
|
95
|
+
The CLI is the recommended client. The API exposes:
|
|
96
|
+
|
|
97
|
+
| Method | Path | Purpose |
|
|
98
|
+
| --- | --- | --- |
|
|
99
|
+
| `GET` | `/healthz` | Liveness check |
|
|
100
|
+
| `POST` | `/v1/provenance?runId=...` | Store sanitized provenance JSONL |
|
|
101
|
+
| `POST` | `/v1/runs` | Start a tiered candidate workflow |
|
|
102
|
+
| `GET` | `/v1/runs` | List workflows |
|
|
103
|
+
| `GET` | `/v1/runs/:runId` | Read progress and rejection reasons |
|
|
104
|
+
| `POST` | `/v1/runs/:runId/cancel` | Request Temporal cancellation |
|
|
105
|
+
| `GET` | `/v1/runs/:runId/export` | Download a completed export |
|
|
106
|
+
|
|
107
|
+
`/healthz` is unauthenticated. Every other route requires `Authorization: Bearer $SELFBENCH_API_TOKEN` when the token is configured. Startup fails if the API binds beyond loopback without a token.
|
|
108
|
+
|
|
109
|
+
Run status includes its phase, accepted/rejected counts, per-candidate stage, discovery wave, completed/failed shard counts, and current candidates. Failed generation runs use a new run ID; the separate agent matrix is resumable through completed Harbor job reuse.
|
|
110
|
+
|
|
111
|
+
SelfBench has no remote deletion route. Delete local artifact-volume data or GCS run prefixes through normal operator tooling.
|
|
112
|
+
|
|
113
|
+
## Configuration
|
|
114
|
+
|
|
115
|
+
| Variable | Default | Used by |
|
|
116
|
+
| --- | --- | --- |
|
|
117
|
+
| `SELFBENCH_API_HOST` | `127.0.0.1` | API |
|
|
118
|
+
| `SELFBENCH_API_PORT` | `8080` | API |
|
|
119
|
+
| `SELFBENCH_API_TOKEN` | unset | API and CLI |
|
|
120
|
+
| `SELFBENCH_ARTIFACT_BACKEND` | `local` | API and worker |
|
|
121
|
+
| `SELFBENCH_ARTIFACT_DIR` | `.selfbench/artifacts` | Local artifact store |
|
|
122
|
+
| `SELFBENCH_GCS_BUCKET` | — | GCS artifact store |
|
|
123
|
+
| `SELFBENCH_GCS_PREFIX` | `selfbench` | GCS artifact store |
|
|
124
|
+
| `SELFBENCH_EXECUTION_BACKEND` | `docker` | Worker; set by `self-bench up --backend` locally |
|
|
125
|
+
| `SELFBENCH_HARBOR_ENVIRONMENT` | execution backend | Worker; set by `self-bench up --backend` locally |
|
|
126
|
+
| `SELFBENCH_ACTIVITY_CONCURRENCY` | `1` Docker, `20` Modal | Worker |
|
|
127
|
+
| `SELFBENCH_MODAL_APP` | `selfbench` | Modal worker |
|
|
128
|
+
| `SELFBENCH_MODAL_ENVIRONMENT` | — | Modal worker |
|
|
129
|
+
| `SELFBENCH_MODAL_IMAGE` | `node:22-bookworm` | Modal worker |
|
|
130
|
+
| `SELFBENCH_MODAL_CONFIG_PATH` | `/dev/null` | Compose host mount; set by `self-bench up --modal-config` locally |
|
|
131
|
+
| `SELFBENCH_TEMPORAL_ADDRESS` | `127.0.0.1:7233` | API and worker |
|
|
132
|
+
| `SELFBENCH_TEMPORAL_NAMESPACE` | `default` | API and worker |
|
|
133
|
+
| `SELFBENCH_TASK_QUEUE` | `selfbench-dev` | API and worker |
|
|
134
|
+
| `SELFBENCH_PI_AUTH_PATH` | `~/.pi/agent/auth.json` | Compose host mount |
|
|
135
|
+
| `SELFBENCH_PI_AUTH_JSON` | — | Worker secret alternative |
|
|
136
|
+
| `SELFBENCH_CODEX_AUTH_PATH` | `~/.codex/auth.json` | Compose host mount |
|
|
137
|
+
| `GH_TOKEN` | — | Worker GitHub reads |
|
|
138
|
+
| `CODEX_AUTH_JSON_PATH` | `~/.codex/auth.json` | Worker and matrix harness |
|
|
139
|
+
|
|
140
|
+
## Cloud topology
|
|
141
|
+
|
|
142
|
+
The API is a regular request-oriented HTTP service suitable for Cloud Run. Deploy `Dockerfile` with its default `node dist/api-main.js` command and port 8080:
|
|
143
|
+
|
|
144
|
+
```text
|
|
145
|
+
SELFBENCH_API_HOST=0.0.0.0
|
|
146
|
+
SELFBENCH_API_TOKEN=...
|
|
147
|
+
SELFBENCH_ARTIFACT_BACKEND=gcs
|
|
148
|
+
SELFBENCH_GCS_BUCKET=...
|
|
149
|
+
SELFBENCH_GCS_PREFIX=selfbench
|
|
150
|
+
SELFBENCH_TEMPORAL_ADDRESS=...
|
|
151
|
+
SELFBENCH_TEMPORAL_NAMESPACE=...
|
|
152
|
+
SELFBENCH_TEMPORAL_API_KEY=...
|
|
153
|
+
SELFBENCH_TEMPORAL_TLS=true
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Run `node dist/worker-main.js` from the same image digest on a long-running container platform, not a scale-to-zero request service. Give it the same Temporal, task queue, and GCS configuration plus:
|
|
157
|
+
|
|
158
|
+
```text
|
|
159
|
+
SELFBENCH_EXECUTION_BACKEND=modal
|
|
160
|
+
SELFBENCH_HARBOR_ENVIRONMENT=modal
|
|
161
|
+
MODAL_TOKEN_ID=...
|
|
162
|
+
MODAL_TOKEN_SECRET=...
|
|
163
|
+
GH_TOKEN=...
|
|
164
|
+
SELFBENCH_PI_AUTH_JSON=...
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
The worker owns model, GitHub, Modal, and Harbor credentials. Use separate least-privilege service accounts and a secret manager. Grant GCS object access only to the configured prefix, use a TLS-enabled Temporal namespace, and keep API/worker image digests and `SELFBENCH_TASK_QUEUE` identical.
|
|
168
|
+
|
|
169
|
+
This repository defines the application boundary, not turnkey cloud infrastructure. Project, region, ingress, IAM, GCS, and Temporal provisioning remain deployment-specific.
|
|
170
|
+
|
|
171
|
+
## Security boundary
|
|
172
|
+
|
|
173
|
+
- Exports contain source snapshots, held-out tests, and reference solutions. They are sensitive and unencrypted.
|
|
174
|
+
- Artifact references carry byte length and SHA-256; reads verify integrity.
|
|
175
|
+
- Local artifact paths and GCS object names are confined to their configured roots. GCS IAM should enforce the same prefix independently.
|
|
176
|
+
- Author and review sandboxes receive only Pi's validated `openai-codex` OAuth entry. Repair receives a validated ChatGPT Codex token set with API-key fields removed.
|
|
177
|
+
- Sandboxes contain both a source checkout and a short-lived model credential. Use SelfBench only with repositories you trust to execute; it is not a malware-analysis service.
|
|
178
|
+
- Docker uses disposable containers and volumes and removes them after normal completion. A host crash can leave resources for an operator to inspect and remove. Modal uses disposable Sandboxes.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Task construction and validation
|
|
2
|
+
|
|
3
|
+
SelfBench creates easy, medium, and hard Harbor evaluations from completed pull requests. This document defines the task boundary, validation gates, repair behavior, and export contents.
|
|
4
|
+
|
|
5
|
+
## Terms
|
|
6
|
+
|
|
7
|
+
- A **candidate** is one possible source pull request.
|
|
8
|
+
- The **base snapshot** is the repository state before the change.
|
|
9
|
+
- The **reference patch** or **gold** is the known-good non-test implementation.
|
|
10
|
+
- The **held-out test patch** is grader code hidden from evaluated agents.
|
|
11
|
+
- A **fail-to-pass** test fails on the base snapshot and passes after a correct implementation.
|
|
12
|
+
- A **pass-to-pass** test already passes at the base and protects existing behavior.
|
|
13
|
+
- A Harbor **nop** run applies no solution; an **oracle** run applies the saved reference patch.
|
|
14
|
+
- **Test-to-gold coupling** means a test passes only because it knows the saved implementation's private structure rather than the requested behavior.
|
|
15
|
+
|
|
16
|
+
## Provenance
|
|
17
|
+
|
|
18
|
+
Each task is grounded in one retained human request. SelfBench prefers exact user messages from local Pi, Claude Code, or Codex sessions associated with the repository or its worktrees. For third-party repositories, an exact GitHub pull-request title and optional body from a non-bot author is also valid.
|
|
19
|
+
|
|
20
|
+
GitHub records are stored with a distinct `github-pull-request` source type, canonical URL, and PR number. Discovery cannot pair the request from one PR with another PR. A model-authored benchmark instruction may restate the retained request but may not add behavior inferred only from the implementation or tests.
|
|
21
|
+
|
|
22
|
+
## Difficulty gates
|
|
23
|
+
|
|
24
|
+
Profiles are eligibility rules, not empirical claims about model success:
|
|
25
|
+
|
|
26
|
+
| Difficulty | Reference patch | Fail-to-pass | Pass-to-pass |
|
|
27
|
+
| --- | --- | --- | --- |
|
|
28
|
+
| easy | at least 20 changed lines across 1 implementation path | at least 1 | no minimum |
|
|
29
|
+
| medium | at least 50 changed lines across 2 implementation paths | at least 1 | at least 1 |
|
|
30
|
+
| hard | at least 100 changed lines across 3 implementation paths | at least 1 | at least 2 |
|
|
31
|
+
|
|
32
|
+
Every accepted task also requires a held-out test patch with no file overlap with the reference patch, deterministic repository-native setup and tests, a passing nop/oracle split, and independent anti-coupling review.
|
|
33
|
+
|
|
34
|
+
The size gate is mechanical. Generated or vendored code suitability remains a review judgment. Git LFS, submodules, generated changes, and service-heavy integration suites receive no special path and may be rejected during authoring or validation.
|
|
35
|
+
|
|
36
|
+
## Agent-visible boundary
|
|
37
|
+
|
|
38
|
+
An evaluated coding agent receives:
|
|
39
|
+
|
|
40
|
+
- the base repository snapshot;
|
|
41
|
+
- a standalone instruction preserving the human request;
|
|
42
|
+
- the task's declared environment.
|
|
43
|
+
|
|
44
|
+
It does not receive the held-out test patch or reference solution. Harbor mounts `solution/` only for the explicit oracle agent.
|
|
45
|
+
|
|
46
|
+
Held-out tests must exercise an existing public API, command, persistence boundary, or extension seam. They may not import gold-specific private helpers or prescribe exact internal SQL, query counts, private schemas, object identity, telemetry layout, incidental error wording, or UI composition unless the source request explicitly makes that artifact public.
|
|
47
|
+
|
|
48
|
+
## Validation and repair
|
|
49
|
+
|
|
50
|
+
Static audit runs before sandbox validation. Harbor then proves:
|
|
51
|
+
|
|
52
|
+
1. `nop`: selected new tests fail while selected regressions pass;
|
|
53
|
+
2. `oracle`: the reference patch applies and every selected test passes;
|
|
54
|
+
3. determinism: the fail-to-pass selection passes a second time with the oracle.
|
|
55
|
+
|
|
56
|
+
A fresh model session reviews the prompt and tests without inheriting the authoring conversation. When it finds repairable test-to-gold coupling, Temporal schedules one constrained repair in another sandbox. Repair may modify only paths already changed by the held-out test patch. It cannot change the request, base snapshot, or reference implementation.
|
|
57
|
+
|
|
58
|
+
After repair, the task repeats static audit, nop, oracle, and independent review from the beginning. A second failure rejects the candidate.
|
|
59
|
+
|
|
60
|
+
## Toolchains
|
|
61
|
+
|
|
62
|
+
The task compiler has setup layers for Node.js, Bun, Python, Go, and Rust. The author supplies fixed repository-native setup and test commands; compatibility is validated per candidate instead of promised for every repository.
|
|
63
|
+
|
|
64
|
+
When the reference patch changes a recognized dependency manifest or lockfile, the hidden verifier image repeats setup with the trusted reference state and then resets source files to the base snapshot. This prevents stale base dependencies from invalidating the oracle without exposing the reference patch to the coding-agent environment.
|
|
65
|
+
|
|
66
|
+
A test selector is one repository-native identifier substituted into the task's `{tests}` command template. For example, `bun test {tests}` may receive one new test path and two existing regression paths. Pytest, Go, Rust, and custom runners use their own selectors.
|
|
67
|
+
|
|
68
|
+
## Export
|
|
69
|
+
|
|
70
|
+
The run export is a gzip-compressed tar archive:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
manifest.json
|
|
74
|
+
tasks/
|
|
75
|
+
├── task-one.tar.gz
|
|
76
|
+
└── task-two.tar.gz
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
`manifest.json` pins the source repository commit, SelfBench build identity, execution backend, task IDs, and archive SHA-256 values. Each task archive is a native Harbor task:
|
|
80
|
+
|
|
81
|
+
```text
|
|
82
|
+
harbor-task/
|
|
83
|
+
├── task.toml
|
|
84
|
+
├── instruction.md
|
|
85
|
+
├── environment/
|
|
86
|
+
├── tests/
|
|
87
|
+
└── solution/
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The export includes the repository snapshot at each selected base commit, held-out tests, and reference solutions. It excludes Git history, local provenance/session records, and author/reviewer transcripts.
|
|
91
|
+
|
|
92
|
+
The manifest digest detects accidental corruption but is not a signature because it sits inside the same archive. Extract only exports from a trusted SelfBench deployment and store them as private benchmark material.
|
|
93
|
+
|
|
94
|
+
The complete model-facing authoring and anti-coupling rubric is in [`src/skills/selfbench/SKILL.md`](../src/skills/selfbench/SKILL.md).
|