self-bench 0.3.0 → 0.3.3
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 +9 -0
- package/Dockerfile +38 -0
- package/Dockerfile.sandbox +24 -0
- package/README.md +103 -171
- 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/api.d.ts.map +1 -1
- package/dist/api.js +40 -2
- 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.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 +26 -8
- 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 +0 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -2
- package/dist/config.js.map +1 -1
- package/dist/contracts.d.ts +1 -1
- package/dist/contracts.d.ts.map +1 -1
- package/dist/eval-main.js +3 -3
- package/dist/evaluate.d.ts.map +1 -1
- package/dist/evaluate.js +12 -7
- package/dist/evaluate.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/reaudit-main.js +10 -7
- package/dist/reaudit-main.js.map +1 -1
- package/dist/repair-main.js +8 -5
- 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-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-validation-repair.bundle.js +9 -9
- package/dist/sandbox-validation-repair.js +11 -9
- package/dist/sandbox-validation-repair.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} +2 -3
- package/dist/temporal/activities.d.ts.map +1 -0
- package/dist/{activities.js → temporal/activities.js} +44 -33
- 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} +5 -9
- 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/validate-main.js +1 -1
- package/docs/evaluations.md +68 -0
- package/docs/operations.md +169 -0
- package/docs/task-construction.md +94 -0
- package/package.json +33 -20
- package/scripts/verify-package.ts +57 -0
- package/scripts/write-build-metadata.ts +27 -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 +277 -0
- package/src/artifacts.ts +357 -0
- package/src/audit.ts +106 -0
- package/src/build-metadata.ts +3 -0
- package/src/cli.ts +359 -0
- package/src/codex-review.ts +229 -0
- package/src/config.ts +114 -0
- package/src/contracts.ts +204 -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 +298 -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 +457 -0
- package/src/reaudit-main.ts +195 -0
- package/src/repair-main.ts +206 -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 +156 -0
- package/src/sandbox-review.ts +19 -0
- package/src/sandbox-validation-repair.ts +177 -0
- package/src/sandbox.ts +51 -0
- package/src/subscription-auth.ts +80 -0
- package/src/temporal/activities.ts +1241 -0
- package/src/temporal/connection.ts +23 -0
- package/src/temporal/worker-main.ts +28 -0
- package/src/temporal/workflow.ts +519 -0
- package/src/validate-main.ts +171 -0
- package/src/validation-repair.ts +94 -0
- package/tsconfig.build.json +13 -0
- package/tsconfig.json +21 -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
ADDED
package/Dockerfile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
FROM oven/bun:1.3.14-debian AS build
|
|
2
|
+
|
|
3
|
+
WORKDIR /app
|
|
4
|
+
ARG SELFBENCH_BUILD_COMMIT
|
|
5
|
+
COPY package.json bun.lock ./
|
|
6
|
+
RUN bun install --frozen-lockfile
|
|
7
|
+
COPY biome.json tsconfig.json tsconfig.build.json ./
|
|
8
|
+
COPY src ./src
|
|
9
|
+
COPY review ./review
|
|
10
|
+
COPY scripts ./scripts
|
|
11
|
+
RUN bun run build
|
|
12
|
+
|
|
13
|
+
FROM docker:29.4.0-cli AS docker-cli
|
|
14
|
+
|
|
15
|
+
FROM node:22-bookworm
|
|
16
|
+
|
|
17
|
+
ARG HARBOR_VERSION=0.20.1.dev202608040148
|
|
18
|
+
RUN apt-get update \
|
|
19
|
+
&& apt-get install -y --no-install-recommends bash ca-certificates curl gh git jq ripgrep tar \
|
|
20
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
21
|
+
&& curl -LsSf https://astral.sh/uv/0.11.3/install.sh | env UV_INSTALL_DIR=/usr/local/bin UV_NO_MODIFY_PATH=1 sh \
|
|
22
|
+
&& env UV_PYTHON_INSTALL_DIR=/opt/uv-python UV_TOOL_DIR=/opt/uv-tools UV_TOOL_BIN_DIR=/usr/local/bin uv tool install --python 3.12 "harbor[modal]==${HARBOR_VERSION}" \
|
|
23
|
+
&& chmod -R a+rX /opt/uv-python /opt/uv-tools
|
|
24
|
+
COPY --from=docker-cli /usr/local/bin/docker /usr/local/bin/docker
|
|
25
|
+
COPY --from=docker-cli /usr/local/libexec/docker/cli-plugins /usr/local/libexec/docker/cli-plugins
|
|
26
|
+
|
|
27
|
+
ENV NODE_ENV=production
|
|
28
|
+
ENV PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin
|
|
29
|
+
WORKDIR /app
|
|
30
|
+
RUN mkdir -p /var/lib/selfbench/artifacts && chown -R node:node /var/lib/selfbench
|
|
31
|
+
COPY --from=build /app/node_modules ./node_modules
|
|
32
|
+
COPY --from=build /app/dist ./dist
|
|
33
|
+
COPY src/extensions ./src/extensions
|
|
34
|
+
COPY src/skills ./src/skills
|
|
35
|
+
COPY package.json ./package.json
|
|
36
|
+
|
|
37
|
+
USER node
|
|
38
|
+
CMD ["node", "dist/api-main.js"]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
FROM node:22-bookworm
|
|
2
|
+
|
|
3
|
+
ARG PI_VERSION=0.84.0
|
|
4
|
+
ARG CODEX_VERSION=0.146.1
|
|
5
|
+
ARG GH_VERSION=2.89.0
|
|
6
|
+
ARG TARGETARCH
|
|
7
|
+
|
|
8
|
+
RUN apt-get update \
|
|
9
|
+
&& apt-get install -y --no-install-recommends bash ca-certificates curl git jq ripgrep unzip xz-utils \
|
|
10
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
11
|
+
RUN case "${TARGETARCH}" in \
|
|
12
|
+
amd64) GH_SHA256=d0422caade520530e76c1c558da47daebaa8e1203d6b7ff10ad7d6faba3490d8 ;; \
|
|
13
|
+
arm64) GH_SHA256=9e64a623dfc242990aa5d9b3f507111149c4282f66b68eaad1dc79eeb13b9ce5 ;; \
|
|
14
|
+
*) echo "unsupported architecture: ${TARGETARCH}" >&2; exit 1 ;; \
|
|
15
|
+
esac \
|
|
16
|
+
&& curl -fsSL "https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${TARGETARCH}.tar.gz" -o /tmp/gh.tar.gz \
|
|
17
|
+
&& echo "${GH_SHA256} /tmp/gh.tar.gz" | sha256sum -c - \
|
|
18
|
+
&& tar -xzf /tmp/gh.tar.gz -C /tmp \
|
|
19
|
+
&& mv "/tmp/gh_${GH_VERSION}_linux_${TARGETARCH}/bin/gh" /usr/local/bin/gh \
|
|
20
|
+
&& rm -rf /tmp/gh.tar.gz "/tmp/gh_${GH_VERSION}_linux_${TARGETARCH}"
|
|
21
|
+
RUN npm install --global --ignore-scripts "@earendil-works/pi-coding-agent@${PI_VERSION}"
|
|
22
|
+
RUN npm install --global "@openai/codex@${CODEX_VERSION}"
|
|
23
|
+
|
|
24
|
+
WORKDIR /work
|
package/README.md
CHANGED
|
@@ -1,254 +1,186 @@
|
|
|
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.
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
19
30
|
|
|
20
31
|
- [Bun](https://bun.sh/) 1.3.14 or newer
|
|
21
32
|
- Docker with Compose
|
|
22
|
-
-
|
|
23
|
-
- `gh
|
|
24
|
-
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
Modal execution additionally requires a Modal account and token. Temporal Cloud execution additionally requires a Temporal Cloud namespace and a durable artifact store such as Google Cloud Storage.
|
|
28
|
-
|
|
29
|
-
## Install from source
|
|
30
|
-
|
|
31
|
-
The package is not currently published to npm. Clone the repository and build it locally:
|
|
32
|
-
|
|
33
|
-
```bash
|
|
34
|
-
git clone https://github.com/mupt-ai/self-bench.git
|
|
35
|
-
cd self-bench
|
|
36
|
-
bun install --frozen-lockfile
|
|
37
|
-
bun run build
|
|
38
|
-
```
|
|
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
|
|
39
37
|
|
|
40
|
-
|
|
38
|
+
Install self-bench and authenticate Modal and GitHub:
|
|
41
39
|
|
|
42
40
|
```bash
|
|
43
|
-
bun
|
|
44
|
-
|
|
41
|
+
bun add --global self-bench
|
|
42
|
+
modal token new
|
|
43
|
+
gh auth login
|
|
45
44
|
```
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
Set the model and GitHub credentials used by the local worker, plus a random token that protects the local self-bench API:
|
|
48
47
|
|
|
49
48
|
```bash
|
|
50
|
-
|
|
49
|
+
export OPENAI_API_KEY=...
|
|
50
|
+
export GH_TOKEN="$(gh auth token)"
|
|
51
|
+
export SELFBENCH_API_TOKEN="$(openssl rand -hex 24)"
|
|
51
52
|
```
|
|
52
53
|
|
|
53
|
-
|
|
54
|
+
### 1. Start self-bench
|
|
54
55
|
|
|
55
56
|
```bash
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
codex login
|
|
57
|
+
self-bench up --backend modal
|
|
58
|
+
export SELFBENCH_API_URL=http://127.0.0.1:8080
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
|
|
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.
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
### 2. Build a benchmark
|
|
64
64
|
|
|
65
65
|
```bash
|
|
66
|
-
|
|
67
|
-
export GH_TOKEN="$(gh auth token)"
|
|
68
|
-
|
|
69
|
-
selfbench up --backend docker
|
|
70
|
-
export SELFBENCH_API_URL=http://127.0.0.1:8080
|
|
71
|
-
|
|
72
|
-
selfbench run \
|
|
66
|
+
self-bench run \
|
|
73
67
|
--repo /absolute/path/to/your/repository \
|
|
74
|
-
--easy-count
|
|
75
|
-
--medium-count
|
|
68
|
+
--easy-count 10 \
|
|
69
|
+
--medium-count 10 \
|
|
76
70
|
--hard-count 10 \
|
|
77
|
-
--output ./
|
|
71
|
+
--output ./self-bench-evals.tar.gz
|
|
78
72
|
```
|
|
79
73
|
|
|
80
|
-
|
|
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.
|
|
81
75
|
|
|
82
|
-
|
|
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.
|
|
83
77
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
## Local commands
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
selfbench status RUN_ID
|
|
90
|
-
selfbench list
|
|
91
|
-
selfbench cancel RUN_ID
|
|
92
|
-
selfbench download RUN_ID ./selfbench-evals.tar.gz
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
If you are working from source rather than using `bun link`, use the same commands through Bun:
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
bun run cli -- status RUN_ID
|
|
99
|
-
```
|
|
78
|
+
### 3. Compare models with Harbor
|
|
100
79
|
|
|
101
|
-
|
|
80
|
+
Install Harbor and extract the generated tasks:
|
|
102
81
|
|
|
103
82
|
```bash
|
|
104
|
-
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Named Docker volumes retain Temporal history and generated artifacts. Back them up before removing them if you need to resume or inspect old runs.
|
|
108
|
-
|
|
109
|
-
## Reliable setup for larger repositories
|
|
110
|
-
|
|
111
|
-
For large repositories or unattended runs, use Temporal Cloud for workflow state and Modal for disposable execution sandboxes. Temporal Cloud does not host the SelfBench API or worker; deploy those separately.
|
|
112
|
-
|
|
113
|
-
```text
|
|
114
|
-
selfbench CLI
|
|
115
|
-
-> SelfBench API
|
|
116
|
-
-> Temporal Cloud namespace
|
|
117
|
-
-> persistent SelfBench worker
|
|
118
|
-
-> Modal sandboxes
|
|
119
|
-
-> GCS artifact storage
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
The API and worker must use the same image version, Temporal namespace, task queue, artifact configuration, and `SELFBENCH_BUILD_COMMIT`. Keep the worker running on a long-lived container service; do not run it on a scale-to-zero request service. The API can run as a normal HTTP service.
|
|
83
|
+
uv tool install --python 3.12 'harbor[modal]==0.20.1.dev202608040148'
|
|
123
84
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
SELFBENCH_TEMPORAL_ADDRESS=your-namespace.tmprl.cloud:7233
|
|
132
|
-
SELFBENCH_TEMPORAL_NAMESPACE=your-namespace
|
|
133
|
-
SELFBENCH_TEMPORAL_API_KEY=...
|
|
134
|
-
SELFBENCH_TEMPORAL_TLS=true
|
|
135
|
-
SELFBENCH_TASK_QUEUE=selfbench-production
|
|
136
|
-
SELFBENCH_ARTIFACT_BACKEND=gcs
|
|
137
|
-
SELFBENCH_GCS_BUCKET=your-selfbench-artifacts
|
|
138
|
-
SELFBENCH_GCS_PREFIX=selfbench
|
|
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
|
|
139
92
|
```
|
|
140
93
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
### 2. Deploy the API
|
|
144
|
-
|
|
145
|
-
Build and deploy `Dockerfile` as a service listening on port 8080. Configure:
|
|
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:
|
|
146
95
|
|
|
147
96
|
```bash
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
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
|
|
158
109
|
```
|
|
159
110
|
|
|
160
|
-
|
|
111
|
+
The evaluated agent receives the base repository and task instruction, but not the hidden tests or reference solution.
|
|
161
112
|
|
|
162
|
-
|
|
163
|
-
export SELFBENCH_API_URL=https://selfbench-api.example.com
|
|
164
|
-
export SELFBENCH_API_TOKEN=use-a-secret-value
|
|
165
|
-
```
|
|
113
|
+
See [Running self-bench evaluations](docs/evaluations.md) for running one task and using the optional resumable matrix helper.
|
|
166
114
|
|
|
167
|
-
|
|
115
|
+
## Run management
|
|
168
116
|
|
|
169
|
-
|
|
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.
|
|
170
118
|
|
|
171
119
|
```bash
|
|
172
|
-
|
|
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
|
|
173
124
|
```
|
|
174
125
|
|
|
175
|
-
|
|
126
|
+
Stop the local stack with:
|
|
176
127
|
|
|
177
128
|
```bash
|
|
178
|
-
|
|
179
|
-
SELFBENCH_HARBOR_ENVIRONMENT=modal
|
|
180
|
-
MODAL_TOKEN_ID=...
|
|
181
|
-
MODAL_TOKEN_SECRET=...
|
|
182
|
-
GH_TOKEN=...
|
|
183
|
-
SELFBENCH_PI_AUTH_JSON=...
|
|
129
|
+
self-bench down
|
|
184
130
|
```
|
|
185
131
|
|
|
186
|
-
|
|
132
|
+
Named Docker volumes retain Temporal history and generated artifacts.
|
|
187
133
|
|
|
188
|
-
|
|
134
|
+
## Other deployments
|
|
189
135
|
|
|
190
|
-
|
|
191
|
-
selfbench run \
|
|
192
|
-
--repo /absolute/path/to/your/repository \
|
|
193
|
-
--easy-count 2 \
|
|
194
|
-
--medium-count 2 \
|
|
195
|
-
--output ./selfbench-evals.tar.gz
|
|
196
|
-
```
|
|
136
|
+
The quickstart is the recommended setup: a local stack with Modal sandboxes.
|
|
197
137
|
|
|
198
|
-
|
|
138
|
+
- **Local stack + Docker sandboxes:** use `self-bench up --backend docker` when you want all execution on your machine.
|
|
139
|
+
- **Temporal Cloud + Modal:** use this for persistent unattended workers and large repositories.
|
|
199
140
|
|
|
200
|
-
|
|
141
|
+
See [Operations and deployment](docs/operations.md) for backend configuration, credentials, persistence, object storage, and the complete Temporal Cloud deployment.
|
|
201
142
|
|
|
202
|
-
|
|
203
|
-
- Start with one or two candidates per tier to confirm credentials, provenance, and repository compatibility before increasing the budget.
|
|
204
|
-
- Treat counts as authoring attempts, not accepted-task guarantees.
|
|
205
|
-
- Keep the worker alive for the entire run; discovery and authoring are retryable, but a missing worker stops progress.
|
|
206
|
-
- Keep GCS and Temporal state persistent. Do not delete the artifact prefix or Temporal namespace while runs are active.
|
|
207
|
-
- Use a dedicated task queue for each deployment and ensure the API and worker use exactly the same value.
|
|
208
|
-
- Use `status`, `list`, and `download` from any machine that can reach the API.
|
|
143
|
+
## How tasks are validated
|
|
209
144
|
|
|
210
|
-
|
|
145
|
+
An accepted task must:
|
|
211
146
|
|
|
212
|
-
|
|
147
|
+
1. Preserve a real human request from repository history.
|
|
148
|
+
2. Start from the repository state before the completed change.
|
|
149
|
+
3. Include hidden tests that fail against the base snapshot.
|
|
150
|
+
4. Pass after applying the original implementation.
|
|
151
|
+
5. Survive deterministic reruns and an independent model review that rejects tests tied to private details of the reference solution.
|
|
213
152
|
|
|
214
|
-
|
|
215
|
-
# Local Docker sandboxes; simplest, usually one activity at a time
|
|
216
|
-
selfbench up --backend docker
|
|
153
|
+
Exports contain repository snapshots, hidden tests, and reference solutions. They are sensitive and unencrypted; keep them private.
|
|
217
154
|
|
|
218
|
-
|
|
219
|
-
modal token new
|
|
220
|
-
selfbench up --backend modal
|
|
221
|
-
```
|
|
155
|
+
See [Task construction and validation](docs/task-construction.md) for the full acceptance rules and archive format.
|
|
222
156
|
|
|
223
|
-
|
|
157
|
+
## Development
|
|
224
158
|
|
|
225
159
|
```bash
|
|
226
|
-
|
|
160
|
+
git clone https://github.com/mupt-ai/self-bench.git
|
|
161
|
+
cd self-bench
|
|
162
|
+
bun install --frozen-lockfile
|
|
163
|
+
bun run validate
|
|
227
164
|
```
|
|
228
165
|
|
|
229
|
-
|
|
166
|
+
Run the CLI directly from source:
|
|
230
167
|
|
|
231
168
|
```bash
|
|
232
|
-
bun
|
|
233
|
-
bun run check
|
|
234
|
-
bun run test
|
|
235
|
-
bun run build
|
|
236
|
-
bun run validate
|
|
169
|
+
bun run cli -- --help
|
|
237
170
|
```
|
|
238
171
|
|
|
239
172
|
Useful development commands:
|
|
240
173
|
|
|
241
174
|
```bash
|
|
242
|
-
bun run cli -- --help
|
|
243
175
|
bun run dev:api
|
|
244
176
|
bun run dev:worker
|
|
245
177
|
bun run dev:review
|
|
246
178
|
```
|
|
247
179
|
|
|
248
|
-
|
|
180
|
+
## Documentation
|
|
249
181
|
|
|
250
|
-
- [Task construction](docs/task-construction.md)
|
|
251
|
-
- [
|
|
182
|
+
- [Task construction and validation](docs/task-construction.md)
|
|
183
|
+
- [Running evaluations](docs/evaluations.md)
|
|
252
184
|
- [Operations and deployment](docs/operations.md)
|
|
253
185
|
|
|
254
186
|
## License
|
package/biome.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.5.7/schema.json",
|
|
3
|
+
"files": {
|
|
4
|
+
"includes": ["src/**/*.ts", "tests/**/*.ts", "review/src/**/*.{ts,tsx}"]
|
|
5
|
+
},
|
|
6
|
+
"formatter": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"indentStyle": "space",
|
|
9
|
+
"indentWidth": 2,
|
|
10
|
+
"lineWidth": 100
|
|
11
|
+
},
|
|
12
|
+
"linter": {
|
|
13
|
+
"enabled": true,
|
|
14
|
+
"rules": {
|
|
15
|
+
"preset": "recommended"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|