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.
Files changed (203) hide show
  1. package/.dockerignore +0 -1
  2. package/Dockerfile +2 -1
  3. package/Dockerfile.sandbox +1 -1
  4. package/README.md +114 -170
  5. package/bun.lock +60 -12
  6. package/compose.yaml +11 -5
  7. package/dist/agent-smoke-main.js +3 -2
  8. package/dist/agent-smoke-main.js.map +1 -1
  9. package/dist/agent-smoke.d.ts +2 -1
  10. package/dist/agent-smoke.d.ts.map +1 -1
  11. package/dist/agent-smoke.js +6 -1
  12. package/dist/agent-smoke.js.map +1 -1
  13. package/dist/api.d.ts +24 -0
  14. package/dist/api.d.ts.map +1 -1
  15. package/dist/api.js +65 -20
  16. package/dist/api.js.map +1 -1
  17. package/dist/artifacts.d.ts +0 -1
  18. package/dist/artifacts.d.ts.map +1 -1
  19. package/dist/artifacts.js +0 -3
  20. package/dist/artifacts.js.map +1 -1
  21. package/dist/build-metadata.js +1 -1
  22. package/dist/cli.js +75 -11
  23. package/dist/cli.js.map +1 -1
  24. package/dist/codex-review.d.ts +2 -1
  25. package/dist/codex-review.d.ts.map +1 -1
  26. package/dist/codex-review.js +26 -22
  27. package/dist/codex-review.js.map +1 -1
  28. package/dist/config.d.ts +36 -11
  29. package/dist/config.d.ts.map +1 -1
  30. package/dist/config.js +89 -17
  31. package/dist/config.js.map +1 -1
  32. package/dist/contracts.d.ts +23 -3
  33. package/dist/contracts.d.ts.map +1 -1
  34. package/dist/contracts.js +31 -6
  35. package/dist/contracts.js.map +1 -1
  36. package/dist/eval-main.js +5 -4
  37. package/dist/eval-main.js.map +1 -1
  38. package/dist/evaluate.d.ts +2 -1
  39. package/dist/evaluate.d.ts.map +1 -1
  40. package/dist/evaluate.js +14 -8
  41. package/dist/evaluate.js.map +1 -1
  42. package/dist/harbor-environment.d.ts +2 -0
  43. package/dist/harbor-environment.d.ts.map +1 -0
  44. package/dist/harbor-environment.js +15 -0
  45. package/dist/harbor-environment.js.map +1 -0
  46. package/dist/harbor-results.d.ts.map +1 -1
  47. package/dist/harbor-results.js +2 -0
  48. package/dist/harbor-results.js.map +1 -1
  49. package/dist/process.d.ts +2 -1
  50. package/dist/process.d.ts.map +1 -1
  51. package/dist/process.js.map +1 -1
  52. package/dist/provenance.d.ts +0 -1
  53. package/dist/provenance.d.ts.map +1 -1
  54. package/dist/provenance.js.map +1 -1
  55. package/dist/providers.d.ts +8 -0
  56. package/dist/providers.d.ts.map +1 -0
  57. package/dist/providers.js +14 -0
  58. package/dist/providers.js.map +1 -0
  59. package/dist/reaudit-main.js +14 -11
  60. package/dist/reaudit-main.js.map +1 -1
  61. package/dist/repair-main.js +12 -9
  62. package/dist/repair-main.js.map +1 -1
  63. package/dist/review/assets/index-CZ3G759O.js +1568 -0
  64. package/dist/review/assets/index-DgSLzX8l.css +1 -0
  65. package/dist/review/assets/{mojo-Blby8dQK.js → mojo-DJz3ZmWd.js} +1 -1
  66. package/dist/review/assets/typst-BUadGCkm.js +1 -0
  67. package/dist/review/index.html +2 -2
  68. package/dist/sandbox-author.bundle.js +40 -6
  69. package/dist/sandbox-repair.bundle.js +8 -7
  70. package/dist/sandbox-repair.js +7 -7
  71. package/dist/sandbox-repair.js.map +1 -1
  72. package/dist/sandbox-review.bundle.js +29 -25
  73. package/dist/sandbox-review.js +5 -3
  74. package/dist/sandbox-review.js.map +1 -1
  75. package/dist/sandbox-timeout.d.ts +11 -0
  76. package/dist/sandbox-timeout.d.ts.map +1 -0
  77. package/dist/sandbox-timeout.js +41 -0
  78. package/dist/sandbox-timeout.js.map +1 -0
  79. package/dist/sandbox-validation-repair.bundle.js +49 -15
  80. package/dist/sandbox-validation-repair.js +11 -9
  81. package/dist/sandbox-validation-repair.js.map +1 -1
  82. package/dist/sandbox.d.ts +2 -2
  83. package/dist/sandbox.d.ts.map +1 -1
  84. package/dist/sandbox.js +10 -3
  85. package/dist/sandbox.js.map +1 -1
  86. package/dist/subscription-auth.d.ts +12 -1
  87. package/dist/subscription-auth.d.ts.map +1 -1
  88. package/dist/subscription-auth.js +16 -16
  89. package/dist/subscription-auth.js.map +1 -1
  90. package/dist/{activities.d.ts → temporal/activities.d.ts} +3 -4
  91. package/dist/temporal/activities.d.ts.map +1 -0
  92. package/dist/{activities.js → temporal/activities.js} +51 -34
  93. package/dist/temporal/activities.js.map +1 -0
  94. package/dist/{temporal.d.ts → temporal/connection.d.ts} +2 -2
  95. package/dist/temporal/connection.d.ts.map +1 -0
  96. package/dist/{temporal.js → temporal/connection.js} +1 -1
  97. package/dist/temporal/connection.js.map +1 -0
  98. package/dist/{worker-main.d.ts.map → temporal/worker-main.d.ts.map} +1 -1
  99. package/dist/{worker-main.js → temporal/worker-main.js} +6 -10
  100. package/dist/temporal/worker-main.js.map +1 -0
  101. package/dist/{workflow.d.ts → temporal/workflow.d.ts} +1 -1
  102. package/dist/temporal/workflow.d.ts.map +1 -0
  103. package/dist/temporal/workflow.js.map +1 -0
  104. package/dist/terminal-prompts.d.ts +26 -0
  105. package/dist/terminal-prompts.d.ts.map +1 -0
  106. package/dist/terminal-prompts.js +137 -0
  107. package/dist/terminal-prompts.js.map +1 -0
  108. package/dist/terminal-reporter.d.ts +30 -0
  109. package/dist/terminal-reporter.d.ts.map +1 -0
  110. package/dist/terminal-reporter.js +90 -0
  111. package/dist/terminal-reporter.js.map +1 -0
  112. package/dist/validate-main.js +8 -2
  113. package/dist/validate-main.js.map +1 -1
  114. package/dist/vercel-cli.d.ts +64 -0
  115. package/dist/vercel-cli.d.ts.map +1 -0
  116. package/dist/vercel-cli.js +303 -0
  117. package/dist/vercel-cli.js.map +1 -0
  118. package/dist/vercel-command.d.ts +14 -0
  119. package/dist/vercel-command.d.ts.map +1 -0
  120. package/dist/vercel-command.js +93 -0
  121. package/dist/vercel-command.js.map +1 -0
  122. package/dist/vercel-executor.d.ts +14 -0
  123. package/dist/vercel-executor.d.ts.map +1 -0
  124. package/dist/vercel-executor.js +356 -0
  125. package/dist/vercel-executor.js.map +1 -0
  126. package/dist/vercel-fetch.d.ts +6 -0
  127. package/dist/vercel-fetch.d.ts.map +1 -0
  128. package/dist/vercel-fetch.js +39 -0
  129. package/dist/vercel-fetch.js.map +1 -0
  130. package/dist/vercel-profile.d.ts +34 -0
  131. package/dist/vercel-profile.d.ts.map +1 -0
  132. package/dist/vercel-profile.js +244 -0
  133. package/dist/vercel-profile.js.map +1 -0
  134. package/dist/vercel-runtime-image.d.ts +51 -0
  135. package/dist/vercel-runtime-image.d.ts.map +1 -0
  136. package/dist/vercel-runtime-image.js +123 -0
  137. package/dist/vercel-runtime-image.js.map +1 -0
  138. package/dist/vercel-setup-probe.d.ts +49 -0
  139. package/dist/vercel-setup-probe.d.ts.map +1 -0
  140. package/dist/vercel-setup-probe.js +151 -0
  141. package/dist/vercel-setup-probe.js.map +1 -0
  142. package/dist/vercel-setup.d.ts +42 -0
  143. package/dist/vercel-setup.d.ts.map +1 -0
  144. package/dist/vercel-setup.js +280 -0
  145. package/dist/vercel-setup.js.map +1 -0
  146. package/docs/evaluations.md +15 -12
  147. package/docs/operations.md +134 -21
  148. package/package.json +8 -6
  149. package/src/agent-smoke-main.ts +3 -2
  150. package/src/agent-smoke.ts +8 -2
  151. package/src/api.ts +71 -20
  152. package/src/artifacts.ts +0 -4
  153. package/src/cli.ts +81 -11
  154. package/src/codex-review.ts +63 -54
  155. package/src/config.ts +150 -28
  156. package/src/contracts.ts +33 -11
  157. package/src/eval-main.ts +5 -4
  158. package/src/evaluate.ts +18 -11
  159. package/src/harbor-environment.ts +17 -0
  160. package/src/harbor-results.ts +2 -0
  161. package/src/process.ts +3 -1
  162. package/src/provenance.ts +0 -1
  163. package/src/providers.ts +22 -0
  164. package/src/reaudit-main.ts +17 -11
  165. package/src/repair-main.ts +15 -9
  166. package/src/sandbox-repair.ts +7 -11
  167. package/src/sandbox-review.ts +5 -3
  168. package/src/sandbox-timeout.ts +56 -0
  169. package/src/sandbox-validation-repair.ts +13 -10
  170. package/src/sandbox.ts +15 -5
  171. package/src/subscription-auth.ts +30 -17
  172. package/src/{activities.ts → temporal/activities.ts} +53 -42
  173. package/src/{temporal.ts → temporal/connection.ts} +1 -1
  174. package/src/{worker-main.ts → temporal/worker-main.ts} +6 -10
  175. package/src/{workflow.ts → temporal/workflow.ts} +10 -10
  176. package/src/terminal-prompts.ts +197 -0
  177. package/src/terminal-reporter.ts +126 -0
  178. package/src/validate-main.ts +9 -3
  179. package/src/vercel-cli.ts +403 -0
  180. package/src/vercel-command.ts +127 -0
  181. package/src/vercel-executor.ts +448 -0
  182. package/src/vercel-fetch.ts +45 -0
  183. package/src/vercel-profile.ts +319 -0
  184. package/src/vercel-runtime-image.ts +204 -0
  185. package/src/vercel-setup-probe.ts +229 -0
  186. package/src/vercel-setup.ts +419 -0
  187. package/dist/activities.d.ts.map +0 -1
  188. package/dist/activities.js.map +0 -1
  189. package/dist/extensions/review.d.ts +0 -3
  190. package/dist/extensions/review.d.ts.map +0 -1
  191. package/dist/extensions/review.js +0 -44
  192. package/dist/extensions/review.js.map +0 -1
  193. package/dist/review/assets/index-Dq-6DFzI.css +0 -1
  194. package/dist/review/assets/index-DurW_RD7.js +0 -1567
  195. package/dist/review/assets/typst-DHCkPAjA.js +0 -1
  196. package/dist/temporal.d.ts.map +0 -1
  197. package/dist/temporal.js.map +0 -1
  198. package/dist/worker-main.js.map +0 -1
  199. package/dist/workflow.d.ts.map +0 -1
  200. package/dist/workflow.js.map +0 -1
  201. package/src/extensions/review.ts +0 -54
  202. /package/dist/{worker-main.d.ts → temporal/worker-main.d.ts} +0 -0
  203. /package/dist/{workflow.js → temporal/workflow.js} +0 -0
package/.dockerignore CHANGED
@@ -5,6 +5,5 @@
5
5
  dist
6
6
  jobs
7
7
  node_modules
8
- review
9
8
  tests
10
9
  *.md
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:server
11
+ RUN bun run build
11
12
 
12
13
  FROM docker:29.4.0-cli AS docker-cli
13
14
 
@@ -1,4 +1,4 @@
1
- FROM node:22-bookworm
1
+ FROM node:22-bookworm@sha256:0557ac14e0d45d02ed563067b82856ca5e7aa3437fa28d98d4350ea9c3d9494a
2
2
 
3
3
  ARG PI_VERSION=0.84.0
4
4
  ARG CODEX_VERSION=0.146.1
package/README.md CHANGED
@@ -1,262 +1,206 @@
1
- # SelfBench
1
+ # self-bench
2
2
 
3
- SelfBench turns completed GitHub changes into private [Harbor](https://harborframework.com/) evaluations for coding agents. It finds real feature requests, builds tasks from the repository's base commit, hides the tests and reference solution, and checks that each task fails without a solution and passes with one.
3
+ [![npm version](https://img.shields.io/npm/v/self-bench?color=blue&label=npm)](https://www.npmjs.com/package/self-bench)
4
+ [![CI](https://github.com/mupt-ai/self-bench/actions/workflows/ci.yml/badge.svg)](https://github.com/mupt-ai/self-bench/actions/workflows/ci.yml)
5
+ [![license](https://img.shields.io/github/license/mupt-ai/self-bench?color=green)](./LICENSE)
6
+ [![Bun](https://img.shields.io/badge/runtime-Bun-f9f1e1?logo=bun&logoColor=000)](https://bun.sh/)
7
+ [![TypeScript](https://img.shields.io/badge/lang-TypeScript-3178c6?logo=typescript&logoColor=fff)](https://www.typescriptlang.org/)
4
8
 
5
- SelfBench is distributed as the [`self-bench`](https://www.npmjs.com/package/self-bench) package and installed with **Bun**.
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
- ## Choose your setup
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
- | Setup | Best for | Execution | State |
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
- After a run is submitted, the workflow continues independently of the waiting CLI process. The local worker still depends on your machine and its Docker stack; Temporal Cloud is the recommended setup when a run may take hours or your laptop should not be responsible for the worker.
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
- ## Prerequisites
25
+ ## Quickstart
17
26
 
18
- Installing the package requires [Bun](https://bun.sh/) 1.3.14 or newer. Running evaluations additionally requires:
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
- - Docker with Compose
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
- 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.
26
-
27
- ## Install
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 the CLI from the npm registry with Bun:
38
+ Install self-bench and authenticate Modal and GitHub:
30
39
 
31
40
  ```bash
32
41
  bun add --global self-bench
33
- self-bench --help
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
- During development, run the TypeScript entrypoint without linking:
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
- bun run cli -- --help
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
- Authenticate the tools before starting a run:
54
+ ### 1. Start self-bench
62
55
 
63
56
  ```bash
64
- gh auth login
65
- # In Pi: /login -> OpenAI Codex
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
- ## Quick start: local Docker
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
- This starts Postgres, Temporal, the SelfBench API, and a worker on your machine. The worker runs sandbox validation through Docker.
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 30 \
83
- --medium-count 30 \
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
- The `--repo` directory must be a Git checkout with a GitHub `origin`. SelfBench pins the current `HEAD`; uncommitted changes are ignored. It discovers candidate requests from sanitized local coding-session messages and merged, non-bot GitHub pull requests.
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
- This quick start authors 70 candidates: 30 easy, 30 medium, and 10 hard. Counts are authoring budgets, not accepted-task guarantees. Candidates can be rejected during authoring, validation, audit, or review, and rejected candidates are not replaced.
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
- A run may take hours. `--output` waits for the run to finish, then downloads and SHA-256-verifies the accepted tasks.
78
+ ### 3. Compare models with Harbor
93
79
 
94
- ## Local commands
80
+ Install Harbor and extract the generated tasks:
95
81
 
96
82
  ```bash
97
- self-bench status RUN_ID
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
- ```bash
106
- bun run cli -- status RUN_ID
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
- Stop the local stack with Docker Compose:
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
- docker compose down
113
- ```
114
-
115
- Named Docker volumes retain Temporal history and generated artifacts. Back them up before removing them if you need to resume or inspect old runs.
116
-
117
- ## Reliable setup for larger repositories
118
-
119
- 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.
120
-
121
- ```text
122
- self-bench CLI
123
- -> SelfBench API
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 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.
111
+ The evaluated agent receives the base repository and task instruction, but not the hidden tests or reference solution.
131
112
 
132
- ### 1. Prepare Temporal Cloud and GCS
113
+ See [Running self-bench evaluations](docs/evaluations.md) for running one task and using the optional resumable matrix helper.
133
114
 
134
- Create a Temporal Cloud namespace and obtain its address, namespace, API key, and TLS settings. Create a GCS bucket for SelfBench artifacts and give the worker/API service accounts access only to the SelfBench prefix.
115
+ ## Run management
135
116
 
136
- Set these values in the API and worker environments:
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
- SELFBENCH_TEMPORAL_ADDRESS=your-namespace.tmprl.cloud:7233
140
- SELFBENCH_TEMPORAL_NAMESPACE=your-namespace
141
- SELFBENCH_TEMPORAL_API_KEY=...
142
- SELFBENCH_TEMPORAL_TLS=true
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
- Do not use the local Compose defaults (`temporal` database credentials, loopback Temporal address, or local artifact volume) in a hosted deployment.
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
- SELFBENCH_API_HOST=0.0.0.0
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
- Then point the CLI at the API:
132
+ Named Docker volumes retain Temporal history and generated artifacts.
169
133
 
170
- ```bash
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
- ### 3. Deploy the worker
136
+ The quickstart is the recommended setup: a local stack with Modal sandboxes.
176
137
 
177
- Run the same image with this command:
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
- ```bash
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
- Give the worker the Temporal, GCS, and task-queue settings above, plus the credentials it needs to discover, author, validate, and review tasks:
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
- SELFBENCH_EXECUTION_BACKEND=modal
187
- SELFBENCH_HARBOR_ENVIRONMENT=modal
188
- MODAL_TOKEN_ID=...
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
- ### 4. Run against the hosted service
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
- ```bash
199
- self-bench run \
200
- --repo /absolute/path/to/your/repository \
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
- The CLI uploads only repository metadata and sanitized provenance. The worker performs discovery, authoring, sandbox validation, review, audit, and export remotely.
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
- ### Large-repository guidance
163
+ ## How tasks are validated
209
164
 
210
- - Prefer Modal over local Docker so the run is not tied to your laptop's CPU, memory, or Docker daemon.
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
- ## Backend options
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
- The local `up` command configures one execution backend for the stack:
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
- # Modal sandboxes; better for concurrency and larger runs
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
- For Modal, `self-bench up` uses `~/.modal.toml` by default. Override it with:
177
+ ## Development
232
178
 
233
179
  ```bash
234
- self-bench up --backend modal --modal-config /absolute/path/to/.modal.toml
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
- ## Development
186
+ Run the CLI directly from source:
238
187
 
239
188
  ```bash
240
- bun install --frozen-lockfile
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
- More detail is available in:
200
+ ## Documentation
257
201
 
258
- - [Task construction](docs/task-construction.md)
259
- - [Evaluation workflows](docs/evaluations.md)
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