self-bench 0.3.2 → 0.3.4
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 +0 -1
- package/Dockerfile +2 -1
- package/Dockerfile.sandbox +1 -1
- package/README.md +114 -170
- package/bun.lock +60 -12
- package/compose.yaml +11 -5
- package/dist/agent-smoke-main.js +3 -2
- package/dist/agent-smoke-main.js.map +1 -1
- package/dist/agent-smoke.d.ts +2 -1
- package/dist/agent-smoke.d.ts.map +1 -1
- package/dist/agent-smoke.js +6 -1
- package/dist/agent-smoke.js.map +1 -1
- package/dist/api.d.ts +24 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +65 -20
- package/dist/api.js.map +1 -1
- package/dist/artifacts.d.ts +0 -1
- package/dist/artifacts.d.ts.map +1 -1
- package/dist/artifacts.js +0 -3
- package/dist/artifacts.js.map +1 -1
- package/dist/build-metadata.js +1 -1
- package/dist/cli.js +75 -11
- package/dist/cli.js.map +1 -1
- package/dist/codex-review.d.ts +2 -1
- package/dist/codex-review.d.ts.map +1 -1
- package/dist/codex-review.js +26 -22
- package/dist/codex-review.js.map +1 -1
- package/dist/config.d.ts +36 -11
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +89 -17
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +23 -3
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +31 -6
- package/dist/contracts.js.map +1 -1
- package/dist/eval-main.js +5 -4
- package/dist/eval-main.js.map +1 -1
- package/dist/evaluate.d.ts +2 -1
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +14 -8
- package/dist/evaluate.js.map +1 -1
- package/dist/harbor-environment.d.ts +2 -0
- package/dist/harbor-environment.d.ts.map +1 -0
- package/dist/harbor-environment.js +15 -0
- package/dist/harbor-environment.js.map +1 -0
- package/dist/harbor-results.d.ts.map +1 -1
- package/dist/harbor-results.js +2 -0
- package/dist/harbor-results.js.map +1 -1
- package/dist/process.d.ts +2 -1
- package/dist/process.d.ts.map +1 -1
- package/dist/process.js.map +1 -1
- package/dist/provenance.d.ts +0 -1
- package/dist/provenance.d.ts.map +1 -1
- package/dist/provenance.js.map +1 -1
- package/dist/providers.d.ts +8 -0
- package/dist/providers.d.ts.map +1 -0
- package/dist/providers.js +14 -0
- package/dist/providers.js.map +1 -0
- package/dist/reaudit-main.js +14 -11
- package/dist/reaudit-main.js.map +1 -1
- package/dist/repair-main.js +12 -9
- package/dist/repair-main.js.map +1 -1
- package/dist/review/assets/index-CZ3G759O.js +1568 -0
- package/dist/review/assets/index-DgSLzX8l.css +1 -0
- package/dist/review/assets/{mojo-Blby8dQK.js → mojo-DJz3ZmWd.js} +1 -1
- package/dist/review/assets/typst-BUadGCkm.js +1 -0
- package/dist/review/index.html +2 -2
- package/dist/sandbox-author.bundle.js +40 -6
- package/dist/sandbox-repair.bundle.js +8 -7
- package/dist/sandbox-repair.js +7 -7
- package/dist/sandbox-repair.js.map +1 -1
- package/dist/sandbox-review.bundle.js +29 -25
- package/dist/sandbox-review.js +5 -3
- package/dist/sandbox-review.js.map +1 -1
- package/dist/sandbox-timeout.d.ts +11 -0
- package/dist/sandbox-timeout.d.ts.map +1 -0
- package/dist/sandbox-timeout.js +41 -0
- package/dist/sandbox-timeout.js.map +1 -0
- package/dist/sandbox-validation-repair.bundle.js +49 -15
- package/dist/sandbox-validation-repair.js +11 -9
- package/dist/sandbox-validation-repair.js.map +1 -1
- package/dist/sandbox.d.ts +2 -2
- package/dist/sandbox.d.ts.map +1 -1
- package/dist/sandbox.js +10 -3
- package/dist/sandbox.js.map +1 -1
- package/dist/subscription-auth.d.ts +12 -1
- package/dist/subscription-auth.d.ts.map +1 -1
- package/dist/subscription-auth.js +16 -16
- package/dist/subscription-auth.js.map +1 -1
- package/dist/{activities.d.ts → temporal/activities.d.ts} +3 -4
- package/dist/temporal/activities.d.ts.map +1 -0
- package/dist/{activities.js → temporal/activities.js} +51 -34
- package/dist/temporal/activities.js.map +1 -0
- package/dist/{temporal.d.ts → temporal/connection.d.ts} +2 -2
- package/dist/temporal/connection.d.ts.map +1 -0
- package/dist/{temporal.js → temporal/connection.js} +1 -1
- package/dist/temporal/connection.js.map +1 -0
- package/dist/{worker-main.d.ts.map → temporal/worker-main.d.ts.map} +1 -1
- package/dist/{worker-main.js → temporal/worker-main.js} +6 -10
- package/dist/temporal/worker-main.js.map +1 -0
- package/dist/{workflow.d.ts → temporal/workflow.d.ts} +1 -1
- package/dist/temporal/workflow.d.ts.map +1 -0
- package/dist/temporal/workflow.js.map +1 -0
- package/dist/terminal-prompts.d.ts +26 -0
- package/dist/terminal-prompts.d.ts.map +1 -0
- package/dist/terminal-prompts.js +137 -0
- package/dist/terminal-prompts.js.map +1 -0
- package/dist/terminal-reporter.d.ts +30 -0
- package/dist/terminal-reporter.d.ts.map +1 -0
- package/dist/terminal-reporter.js +90 -0
- package/dist/terminal-reporter.js.map +1 -0
- package/dist/validate-main.js +8 -2
- package/dist/validate-main.js.map +1 -1
- package/dist/vercel-cli.d.ts +64 -0
- package/dist/vercel-cli.d.ts.map +1 -0
- package/dist/vercel-cli.js +303 -0
- package/dist/vercel-cli.js.map +1 -0
- package/dist/vercel-command.d.ts +14 -0
- package/dist/vercel-command.d.ts.map +1 -0
- package/dist/vercel-command.js +93 -0
- package/dist/vercel-command.js.map +1 -0
- package/dist/vercel-executor.d.ts +14 -0
- package/dist/vercel-executor.d.ts.map +1 -0
- package/dist/vercel-executor.js +356 -0
- package/dist/vercel-executor.js.map +1 -0
- package/dist/vercel-fetch.d.ts +6 -0
- package/dist/vercel-fetch.d.ts.map +1 -0
- package/dist/vercel-fetch.js +39 -0
- package/dist/vercel-fetch.js.map +1 -0
- package/dist/vercel-profile.d.ts +34 -0
- package/dist/vercel-profile.d.ts.map +1 -0
- package/dist/vercel-profile.js +244 -0
- package/dist/vercel-profile.js.map +1 -0
- package/dist/vercel-runtime-image.d.ts +51 -0
- package/dist/vercel-runtime-image.d.ts.map +1 -0
- package/dist/vercel-runtime-image.js +123 -0
- package/dist/vercel-runtime-image.js.map +1 -0
- package/dist/vercel-setup-probe.d.ts +49 -0
- package/dist/vercel-setup-probe.d.ts.map +1 -0
- package/dist/vercel-setup-probe.js +151 -0
- package/dist/vercel-setup-probe.js.map +1 -0
- package/dist/vercel-setup.d.ts +42 -0
- package/dist/vercel-setup.d.ts.map +1 -0
- package/dist/vercel-setup.js +280 -0
- package/dist/vercel-setup.js.map +1 -0
- package/docs/evaluations.md +15 -12
- package/docs/operations.md +134 -21
- package/package.json +8 -6
- package/src/agent-smoke-main.ts +3 -2
- package/src/agent-smoke.ts +8 -2
- package/src/api.ts +71 -20
- package/src/artifacts.ts +0 -4
- package/src/cli.ts +81 -11
- package/src/codex-review.ts +63 -54
- package/src/config.ts +150 -28
- package/src/contracts.ts +33 -11
- package/src/eval-main.ts +5 -4
- package/src/evaluate.ts +18 -11
- package/src/harbor-environment.ts +17 -0
- package/src/harbor-results.ts +2 -0
- package/src/process.ts +3 -1
- package/src/provenance.ts +0 -1
- package/src/providers.ts +22 -0
- package/src/reaudit-main.ts +17 -11
- package/src/repair-main.ts +15 -9
- package/src/sandbox-repair.ts +7 -11
- package/src/sandbox-review.ts +5 -3
- package/src/sandbox-timeout.ts +56 -0
- package/src/sandbox-validation-repair.ts +13 -10
- package/src/sandbox.ts +15 -5
- package/src/subscription-auth.ts +30 -17
- package/src/{activities.ts → temporal/activities.ts} +53 -42
- package/src/{temporal.ts → temporal/connection.ts} +1 -1
- package/src/{worker-main.ts → temporal/worker-main.ts} +6 -10
- package/src/{workflow.ts → temporal/workflow.ts} +10 -10
- package/src/terminal-prompts.ts +197 -0
- package/src/terminal-reporter.ts +126 -0
- package/src/validate-main.ts +9 -3
- package/src/vercel-cli.ts +403 -0
- package/src/vercel-command.ts +127 -0
- package/src/vercel-executor.ts +448 -0
- package/src/vercel-fetch.ts +45 -0
- package/src/vercel-profile.ts +319 -0
- package/src/vercel-runtime-image.ts +204 -0
- package/src/vercel-setup-probe.ts +229 -0
- package/src/vercel-setup.ts +419 -0
- package/dist/activities.d.ts.map +0 -1
- package/dist/activities.js.map +0 -1
- package/dist/extensions/review.d.ts +0 -3
- package/dist/extensions/review.d.ts.map +0 -1
- package/dist/extensions/review.js +0 -44
- package/dist/extensions/review.js.map +0 -1
- package/dist/review/assets/index-Dq-6DFzI.css +0 -1
- package/dist/review/assets/index-DurW_RD7.js +0 -1567
- package/dist/review/assets/typst-DHCkPAjA.js +0 -1
- package/dist/temporal.d.ts.map +0 -1
- package/dist/temporal.js.map +0 -1
- package/dist/worker-main.js.map +0 -1
- package/dist/workflow.d.ts.map +0 -1
- package/dist/workflow.js.map +0 -1
- package/src/extensions/review.ts +0 -54
- /package/dist/{worker-main.d.ts → temporal/worker-main.d.ts} +0 -0
- /package/dist/{workflow.js → temporal/workflow.js} +0 -0
package/.dockerignore
CHANGED
package/Dockerfile
CHANGED
|
@@ -6,8 +6,9 @@ COPY package.json bun.lock ./
|
|
|
6
6
|
RUN bun install --frozen-lockfile
|
|
7
7
|
COPY biome.json tsconfig.json tsconfig.build.json ./
|
|
8
8
|
COPY src ./src
|
|
9
|
+
COPY review ./review
|
|
9
10
|
COPY scripts ./scripts
|
|
10
|
-
RUN bun run build
|
|
11
|
+
RUN bun run build
|
|
11
12
|
|
|
12
13
|
FROM docker:29.4.0-cli AS docker-cli
|
|
13
14
|
|
package/Dockerfile.sandbox
CHANGED
package/README.md
CHANGED
|
@@ -1,262 +1,206 @@
|
|
|
1
|
-
#
|
|
1
|
+
# self-bench
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/self-bench)
|
|
4
|
+
[](https://github.com/mupt-ai/self-bench/actions/workflows/ci.yml)
|
|
5
|
+
[](./LICENSE)
|
|
6
|
+
[](https://bun.sh/)
|
|
7
|
+
[](https://www.typescriptlang.org/)
|
|
4
8
|
|
|
5
|
-
|
|
9
|
+
**self-bench builds private coding-agent benchmarks from work already completed in your repository, so you can compare coding agents and models on tasks drawn from your own codebase.**
|
|
6
10
|
|
|
7
|
-
|
|
11
|
+
It finds completed requests from local coding sessions and merged GitHub pull requests, then reconstructs each task from the commit before the change. For every accepted task, self-bench creates hidden tests and a reference solution, proves that the task fails without a solution and passes with the original implementation, and exports a native task for [Harbor](https://harborframework.com/), a runner for coding-agent evaluations.
|
|
8
12
|
|
|
9
|
-
|
|
10
|
-
| --- | --- | --- | --- |
|
|
11
|
-
| Local | Trying SelfBench or small runs | Docker on your machine | Local Docker volumes |
|
|
12
|
-
| Temporal Cloud | Large repositories, long runs, and reliable unattended execution | Modal sandboxes | Temporal Cloud + object storage |
|
|
13
|
+
The result is a private `.tar.gz` benchmark that you can run against multiple models:
|
|
13
14
|
|
|
14
|
-
|
|
15
|
+
```text
|
|
16
|
+
Your repository history
|
|
17
|
+
↓
|
|
18
|
+
completed requests + implementations
|
|
19
|
+
↓
|
|
20
|
+
validated Harbor tasks with hidden tests
|
|
21
|
+
↓
|
|
22
|
+
gpt-5.6-luna vs gpt-5.6-terra vs gpt-5.6-sol
|
|
23
|
+
```
|
|
15
24
|
|
|
16
|
-
##
|
|
25
|
+
## Quickstart
|
|
17
26
|
|
|
18
|
-
|
|
27
|
+
This path runs the self-bench API, worker, and [Temporal](https://temporal.io/) workflow state locally while using [Modal](https://modal.com/) for disposable task-generation and validation sandboxes.
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
- `gh`, authenticated with access to the source repository
|
|
22
|
-
- Pi with an authenticated `openai-codex` account
|
|
23
|
-
- Codex CLI with an authenticated account
|
|
29
|
+
### Prerequisites
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
31
|
+
- [Bun](https://bun.sh/) 1.3.14 or newer
|
|
32
|
+
- Docker with Compose
|
|
33
|
+
- [Modal](https://modal.com/) CLI, account, and token (`pip install modal`)
|
|
34
|
+
- [`gh`](https://cli.github.com/), authenticated with read access to the repository
|
|
35
|
+
- An OpenAI API key with access to `gpt-5.6-sol`, `gpt-5.6-terra`, and `gpt-5.6-luna`
|
|
36
|
+
- A Git checkout with a GitHub `origin` and completed work in its history
|
|
28
37
|
|
|
29
|
-
Install
|
|
38
|
+
Install self-bench and authenticate Modal and GitHub:
|
|
30
39
|
|
|
31
40
|
```bash
|
|
32
41
|
bun add --global self-bench
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
For one-off use without a global install:
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
bunx self-bench --help
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
The package exposes `dist/cli.js` as `self-bench`.
|
|
43
|
-
|
|
44
|
-
To develop SelfBench itself, clone the repository and use Bun:
|
|
45
|
-
|
|
46
|
-
```bash
|
|
47
|
-
git clone https://github.com/mupt-ai/self-bench.git
|
|
48
|
-
cd self-bench
|
|
49
|
-
bun install --frozen-lockfile
|
|
50
|
-
bun run build
|
|
51
|
-
bun link
|
|
52
|
-
self-bench --help
|
|
42
|
+
modal token new
|
|
43
|
+
gh auth login
|
|
53
44
|
```
|
|
54
45
|
|
|
55
|
-
|
|
46
|
+
Set the model and GitHub credentials used by the local worker, plus a random token that protects the local self-bench API:
|
|
56
47
|
|
|
57
48
|
```bash
|
|
58
|
-
|
|
49
|
+
export OPENAI_API_KEY=...
|
|
50
|
+
export GH_TOKEN="$(gh auth token)"
|
|
51
|
+
export SELFBENCH_API_TOKEN="$(openssl rand -hex 24)"
|
|
59
52
|
```
|
|
60
53
|
|
|
61
|
-
|
|
54
|
+
### 1. Start self-bench
|
|
62
55
|
|
|
63
56
|
```bash
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
codex login
|
|
57
|
+
self-bench up --backend modal
|
|
58
|
+
export SELFBENCH_API_URL=http://127.0.0.1:8080
|
|
67
59
|
```
|
|
68
60
|
|
|
69
|
-
|
|
61
|
+
This starts Postgres, Temporal, the self-bench API, and a worker in Docker. The worker sends sandbox work to Modal; `SELFBENCH_API_URL` tells subsequent CLI commands where to reach the local API.
|
|
70
62
|
|
|
71
|
-
|
|
63
|
+
### 2. Build a benchmark
|
|
72
64
|
|
|
73
65
|
```bash
|
|
74
|
-
export SELFBENCH_API_TOKEN="$(openssl rand -hex 24)"
|
|
75
|
-
export GH_TOKEN="$(gh auth token)"
|
|
76
|
-
|
|
77
|
-
self-bench up --backend docker
|
|
78
|
-
export SELFBENCH_API_URL=http://127.0.0.1:8080
|
|
79
|
-
|
|
80
66
|
self-bench run \
|
|
81
67
|
--repo /absolute/path/to/your/repository \
|
|
82
|
-
--easy-count
|
|
83
|
-
--medium-count
|
|
68
|
+
--easy-count 10 \
|
|
69
|
+
--medium-count 10 \
|
|
84
70
|
--hard-count 10 \
|
|
85
71
|
--output ./self-bench-evals.tar.gz
|
|
86
72
|
```
|
|
87
73
|
|
|
88
|
-
|
|
74
|
+
Easy, medium, and hard candidates require at least 20, 50, and 100 changed implementation lines across 1, 2, and 3 paths respectively; the counts are generation budgets, not guarantees that every candidate will pass validation.
|
|
89
75
|
|
|
90
|
-
|
|
76
|
+
The repository must be a Git checkout with a GitHub `origin`. self-bench pins its current `HEAD`, ignores uncommitted changes, and may take hours to author, validate, review, and export the accepted tasks. `--output` waits for completion and verifies the downloaded archive with SHA-256.
|
|
91
77
|
|
|
92
|
-
|
|
78
|
+
### 3. Compare models with Harbor
|
|
93
79
|
|
|
94
|
-
|
|
80
|
+
Install Harbor and extract the generated tasks:
|
|
95
81
|
|
|
96
82
|
```bash
|
|
97
|
-
|
|
98
|
-
self-bench list
|
|
99
|
-
self-bench cancel RUN_ID
|
|
100
|
-
self-bench download RUN_ID ./self-bench-evals.tar.gz
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
If you are working from source rather than using `bun link`, use the same commands through Bun:
|
|
83
|
+
uv tool install --python 3.12 'harbor[modal]==0.20.1.dev202608040148'
|
|
104
84
|
|
|
105
|
-
|
|
106
|
-
|
|
85
|
+
mkdir -p ./self-bench-export ./self-bench-tasks
|
|
86
|
+
tar -xzf ./self-bench-evals.tar.gz -C ./self-bench-export
|
|
87
|
+
for archive in ./self-bench-export/tasks/*.tar.gz; do
|
|
88
|
+
task_id="$(basename "$archive" .tar.gz)"
|
|
89
|
+
mkdir -p "./self-bench-tasks/$task_id"
|
|
90
|
+
tar -xzf "$archive" --strip-components=1 -C "./self-bench-tasks/$task_id"
|
|
91
|
+
done
|
|
107
92
|
```
|
|
108
93
|
|
|
109
|
-
|
|
94
|
+
Run Harbor's Codex agent adapter once for all three models. Harbor evaluates every extracted task at high reasoning and keeps the model results in one job directory:
|
|
110
95
|
|
|
111
96
|
```bash
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
-> Temporal Cloud namespace
|
|
125
|
-
-> persistent SelfBench worker
|
|
126
|
-
-> Modal sandboxes
|
|
127
|
-
-> GCS artifact storage
|
|
97
|
+
harbor run \
|
|
98
|
+
--path ./self-bench-tasks \
|
|
99
|
+
--agent codex \
|
|
100
|
+
--model gpt-5.6-luna \
|
|
101
|
+
--model gpt-5.6-terra \
|
|
102
|
+
--model gpt-5.6-sol \
|
|
103
|
+
--ak version=0.146.1 \
|
|
104
|
+
--ak reasoning_effort=high \
|
|
105
|
+
--env modal \
|
|
106
|
+
--jobs-dir ./harbor-jobs \
|
|
107
|
+
--n-concurrent 20 \
|
|
108
|
+
--yes
|
|
128
109
|
```
|
|
129
110
|
|
|
130
|
-
The
|
|
111
|
+
The evaluated agent receives the base repository and task instruction, but not the hidden tests or reference solution.
|
|
131
112
|
|
|
132
|
-
|
|
113
|
+
See [Running self-bench evaluations](docs/evaluations.md) for running one task and using the optional resumable matrix helper.
|
|
133
114
|
|
|
134
|
-
|
|
115
|
+
## Run management
|
|
135
116
|
|
|
136
|
-
|
|
117
|
+
Closing the waiting CLI does not cancel a submitted workflow. If the local worker or Docker stack stops, work pauses until the worker is restarted.
|
|
137
118
|
|
|
138
119
|
```bash
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
SELFBENCH_TASK_QUEUE=selfbench-production
|
|
144
|
-
SELFBENCH_ARTIFACT_BACKEND=gcs
|
|
145
|
-
SELFBENCH_GCS_BUCKET=your-selfbench-artifacts
|
|
146
|
-
SELFBENCH_GCS_PREFIX=selfbench
|
|
120
|
+
self-bench list # find run IDs
|
|
121
|
+
self-bench status RUN_ID
|
|
122
|
+
self-bench cancel RUN_ID
|
|
123
|
+
self-bench download RUN_ID ./self-bench-evals.tar.gz
|
|
147
124
|
```
|
|
148
125
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
### 2. Deploy the API
|
|
152
|
-
|
|
153
|
-
Build and deploy `Dockerfile` as a service listening on port 8080. Configure:
|
|
126
|
+
Stop the local stack with:
|
|
154
127
|
|
|
155
128
|
```bash
|
|
156
|
-
|
|
157
|
-
SELFBENCH_API_TOKEN=use-a-secret-value
|
|
158
|
-
SELFBENCH_ARTIFACT_BACKEND=gcs
|
|
159
|
-
SELFBENCH_GCS_BUCKET=your-selfbench-artifacts
|
|
160
|
-
SELFBENCH_GCS_PREFIX=selfbench
|
|
161
|
-
SELFBENCH_TEMPORAL_ADDRESS=...
|
|
162
|
-
SELFBENCH_TEMPORAL_NAMESPACE=...
|
|
163
|
-
SELFBENCH_TEMPORAL_API_KEY=...
|
|
164
|
-
SELFBENCH_TEMPORAL_TLS=true
|
|
165
|
-
SELFBENCH_TASK_QUEUE=selfbench-production
|
|
129
|
+
self-bench down
|
|
166
130
|
```
|
|
167
131
|
|
|
168
|
-
|
|
132
|
+
Named Docker volumes retain Temporal history and generated artifacts.
|
|
169
133
|
|
|
170
|
-
|
|
171
|
-
export SELFBENCH_API_URL=https://selfbench-api.example.com
|
|
172
|
-
export SELFBENCH_API_TOKEN=use-a-secret-value
|
|
173
|
-
```
|
|
134
|
+
## Other deployments
|
|
174
135
|
|
|
175
|
-
|
|
136
|
+
The quickstart is the recommended setup: a local stack with Modal sandboxes.
|
|
176
137
|
|
|
177
|
-
|
|
138
|
+
- **Local stack + Docker sandboxes:** use `self-bench up --backend docker` when you want all execution on your machine.
|
|
139
|
+
- **Local stack + Vercel Sandbox:** run `self-bench setup vercel`, then explicitly choose Docker or Modal for Harbor validation.
|
|
140
|
+
- **Temporal Cloud + Modal:** use this for persistent unattended workers and large repositories.
|
|
178
141
|
|
|
179
|
-
|
|
180
|
-
node dist/worker-main.js
|
|
181
|
-
```
|
|
142
|
+
See [Operations and deployment](docs/operations.md) for backend configuration, credentials, persistence, object storage, and the complete Temporal Cloud deployment.
|
|
182
143
|
|
|
183
|
-
|
|
144
|
+
Generation sandboxes and Harbor validation are independent choices. Docker and Modal retain their matching defaults; Vercel must name a Harbor environment because Harbor does not currently provide a Vercel environment:
|
|
184
145
|
|
|
185
146
|
```bash
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
MODAL_TOKEN_SECRET=...
|
|
190
|
-
GH_TOKEN=...
|
|
191
|
-
SELFBENCH_PI_AUTH_JSON=...
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
Provide the Codex auth JSON to the worker at `/home/node/.codex/auth.json` (the default location in the production image), for example through a read-only secret mount. Alternatively, mount it elsewhere and set `CODEX_AUTH_JSON_PATH` to that file. Keep model credentials in the worker only; the API does not need them.
|
|
147
|
+
# Matching defaults
|
|
148
|
+
self-bench up --backend docker
|
|
149
|
+
self-bench up --backend modal
|
|
195
150
|
|
|
196
|
-
|
|
151
|
+
# Vercel generation with either supported Harbor environment
|
|
152
|
+
self-bench setup vercel
|
|
153
|
+
self-bench up --backend vercel --harbor-environment docker
|
|
154
|
+
self-bench up --backend vercel --harbor-environment modal
|
|
197
155
|
|
|
198
|
-
|
|
199
|
-
self-bench
|
|
200
|
-
|
|
201
|
-
--easy-count 2 \
|
|
202
|
-
--medium-count 2 \
|
|
203
|
-
--output ./self-bench-evals.tar.gz
|
|
156
|
+
# Explicit cross-provider combinations are also supported
|
|
157
|
+
self-bench up --backend docker --harbor-environment modal
|
|
158
|
+
self-bench up --backend modal --harbor-environment docker
|
|
204
159
|
```
|
|
205
160
|
|
|
206
|
-
|
|
161
|
+
Provider selection belongs to the worker, so all runs on one task queue use the same pairing. See [Vercel Sandbox setup](docs/operations.md#vercel-sandbox) for project authentication, publishing the runtime image, limits, cleanup, and troubleshooting.
|
|
207
162
|
|
|
208
|
-
|
|
163
|
+
## How tasks are validated
|
|
209
164
|
|
|
210
|
-
|
|
211
|
-
- Start with one or two candidates per tier to confirm credentials, provenance, and repository compatibility before increasing the budget.
|
|
212
|
-
- Treat counts as authoring attempts, not accepted-task guarantees.
|
|
213
|
-
- Keep the worker alive for the entire run; discovery and authoring are retryable, but a missing worker stops progress.
|
|
214
|
-
- Keep GCS and Temporal state persistent. Do not delete the artifact prefix or Temporal namespace while runs are active.
|
|
215
|
-
- Use a dedicated task queue for each deployment and ensure the API and worker use exactly the same value.
|
|
216
|
-
- Use `status`, `list`, and `download` from any machine that can reach the API.
|
|
165
|
+
An accepted task must:
|
|
217
166
|
|
|
218
|
-
|
|
167
|
+
1. Preserve a real human request from repository history.
|
|
168
|
+
2. Start from the repository state before the completed change.
|
|
169
|
+
3. Include hidden tests that fail against the base snapshot.
|
|
170
|
+
4. Pass after applying the original implementation.
|
|
171
|
+
5. Survive deterministic reruns and an independent model review that rejects tests tied to private details of the reference solution.
|
|
219
172
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
```bash
|
|
223
|
-
# Local Docker sandboxes; simplest, usually one activity at a time
|
|
224
|
-
self-bench up --backend docker
|
|
173
|
+
Exports contain repository snapshots, hidden tests, and reference solutions. They are sensitive and unencrypted; keep them private.
|
|
225
174
|
|
|
226
|
-
|
|
227
|
-
modal token new
|
|
228
|
-
self-bench up --backend modal
|
|
229
|
-
```
|
|
175
|
+
See [Task construction and validation](docs/task-construction.md) for the full acceptance rules and archive format.
|
|
230
176
|
|
|
231
|
-
|
|
177
|
+
## Development
|
|
232
178
|
|
|
233
179
|
```bash
|
|
234
|
-
|
|
180
|
+
git clone https://github.com/mupt-ai/self-bench.git
|
|
181
|
+
cd self-bench
|
|
182
|
+
bun install --frozen-lockfile
|
|
183
|
+
bun run validate
|
|
235
184
|
```
|
|
236
185
|
|
|
237
|
-
|
|
186
|
+
Run the CLI directly from source:
|
|
238
187
|
|
|
239
188
|
```bash
|
|
240
|
-
bun
|
|
241
|
-
bun run check
|
|
242
|
-
bun run test
|
|
243
|
-
bun run build
|
|
244
|
-
bun run validate
|
|
189
|
+
bun run cli -- --help
|
|
245
190
|
```
|
|
246
191
|
|
|
247
192
|
Useful development commands:
|
|
248
193
|
|
|
249
194
|
```bash
|
|
250
|
-
bun run cli -- --help
|
|
251
195
|
bun run dev:api
|
|
252
196
|
bun run dev:worker
|
|
253
197
|
bun run dev:review
|
|
254
198
|
```
|
|
255
199
|
|
|
256
|
-
|
|
200
|
+
## Documentation
|
|
257
201
|
|
|
258
|
-
- [Task construction](docs/task-construction.md)
|
|
259
|
-
- [
|
|
202
|
+
- [Task construction and validation](docs/task-construction.md)
|
|
203
|
+
- [Running evaluations](docs/evaluations.md)
|
|
260
204
|
- [Operations and deployment](docs/operations.md)
|
|
261
205
|
|
|
262
206
|
## License
|