@wrongstack/bench 0.260.0
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/LICENSE +21 -0
- package/README.md +107 -0
- package/dist/index.d.ts +606 -0
- package/dist/index.js +1050 -0
- package/dist/index.js.map +1 -0
- package/package.json +45 -0
- package/subsets/swe-bench-verified-50.json +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ECOSTACK TECHNOLOGY OÜ
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# @wrongstack/bench
|
|
2
|
+
|
|
3
|
+
Model-independent agentic benchmark harness for WrongStack.
|
|
4
|
+
|
|
5
|
+
## What it measures
|
|
6
|
+
|
|
7
|
+
WrongStack is the **harness** — system prompt, tool set, agent loop, scaffolding.
|
|
8
|
+
The model is the only swappable variable. Each (task × model) cell runs the real
|
|
9
|
+
`wstack` binary in single-shot mode (`--output-json`) inside an isolated workdir;
|
|
10
|
+
the result is graded by the **suite's own tests** — never an LLM. This is the
|
|
11
|
+
difference from `wstack modeldiag eval`, which ranks free-form answers with an
|
|
12
|
+
LLM judge (model-dependent).
|
|
13
|
+
|
|
14
|
+
Two invariants keep the report objective:
|
|
15
|
+
|
|
16
|
+
1. **Deterministic grading.** Polyglot runs the exercise's hidden tests;
|
|
17
|
+
SWE-bench runs `FAIL_TO_PASS` / `PASS_TO_PASS`. Exit code decides pass/fail.
|
|
18
|
+
2. **Harness fingerprint.** Every report is stamped with
|
|
19
|
+
`sha256(cliVersion, toolNames, maxIterations, yolo, subsetId)`. Rows compare
|
|
20
|
+
only when the fingerprint matches; change the prompt/tools/version and old
|
|
21
|
+
numbers are marked stale.
|
|
22
|
+
|
|
23
|
+
## Suites
|
|
24
|
+
|
|
25
|
+
| Suite | Standard | Grader | Status |
|
|
26
|
+
|---|---|---|---|
|
|
27
|
+
| `polyglot` | Aider polyglot (225 Exercism exercises, 6 languages) | run hidden tests in workdir | ✅ Docker-free, graded inline |
|
|
28
|
+
| `swebench` | SWE-bench Verified (fixed subset) | export predictions → official harness (inline Docker grading via injectable hook) | ✅ runs + exports; ⚙️ inline grading pluggable |
|
|
29
|
+
|
|
30
|
+
For SWE-bench the bench runs the agent on each materialized instance and extracts a
|
|
31
|
+
conformant model patch (`git diff`, with held-out test files and harness bookkeeping —
|
|
32
|
+
`.gitignore` / `.wrongstack/` — stripped), then writes a `predictions-<cell>.jsonl` in the
|
|
33
|
+
official format. Grading itself is delegated to the canonical
|
|
34
|
+
`princeton-nlp/SWE-bench` harness (deterministic, version-sensitive) rather than
|
|
35
|
+
re-implemented — or plugged in inline via a `SwebenchExternalGrade` hook when Docker is
|
|
36
|
+
available. Exported-but-ungraded rows show `—` in the report's Pass@1 column so they never
|
|
37
|
+
masquerade as failures.
|
|
38
|
+
|
|
39
|
+
## Requirements
|
|
40
|
+
|
|
41
|
+
- **API keys in env** — providers read keys from the environment (e.g.
|
|
42
|
+
`ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`). The isolated
|
|
43
|
+
`WRONGSTACK_HOME` carries no secrets.
|
|
44
|
+
- **Polyglot:** a local checkout of the polyglot-benchmark repo plus the
|
|
45
|
+
language toolchains you want to grade (Python+pytest, Node+npm, Go, Rust,
|
|
46
|
+
…). Languages whose toolchain is missing are simply skipped at grade time.
|
|
47
|
+
- **SWE-bench (Phase 2):** Docker + a prepared dataset directory.
|
|
48
|
+
|
|
49
|
+
## Usage
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
# 1. Get the exercises
|
|
53
|
+
git clone https://github.com/Aider-AI/polyglot-benchmark /path/to/polyglot
|
|
54
|
+
|
|
55
|
+
# 2. Define the model matrix (bench.config.json)
|
|
56
|
+
cat > bench.config.json <<'JSON'
|
|
57
|
+
{
|
|
58
|
+
"maxIterations": 40,
|
|
59
|
+
"concurrency": 4,
|
|
60
|
+
"timeoutMs": 600000,
|
|
61
|
+
"cells": [
|
|
62
|
+
{ "label": "opus-4.8", "provider": "anthropic", "model": "claude-opus-4-8" },
|
|
63
|
+
{ "label": "gpt-5.4", "provider": "openai", "model": "gpt-5.4" }
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
JSON
|
|
67
|
+
|
|
68
|
+
# 3. Run (start small with --limit)
|
|
69
|
+
wstack bench run --suite polyglot --polyglot-dir /path/to/polyglot \
|
|
70
|
+
--models bench.config.json --limit 5 --out ./bench-results
|
|
71
|
+
|
|
72
|
+
# 4. Re-render the markdown report from a finished run
|
|
73
|
+
wstack bench report ./bench-results/<timestamp>
|
|
74
|
+
|
|
75
|
+
# List available suites + configured cells
|
|
76
|
+
wstack bench list --models bench.config.json
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Artifacts per run (`bench-results/<timestamp>/`):
|
|
80
|
+
|
|
81
|
+
- `results.jsonl` — one row per (task × cell)
|
|
82
|
+
- `summary.json` — fingerprint + folded cell results
|
|
83
|
+
- `report.md` — the leaderboard (sorted by pass@1)
|
|
84
|
+
|
|
85
|
+
## SWE-bench dataset layout
|
|
86
|
+
|
|
87
|
+
`--dataset-dir <path>` must contain one directory per pinned instance id:
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
<datasetDir>/<instance_id>/
|
|
91
|
+
repo/ git checkout at base_commit
|
|
92
|
+
instance.json { problem_statement, test_patch, FAIL_TO_PASS, PASS_TO_PASS, image }
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Run the agents and export predictions (no Docker needed):
|
|
97
|
+
wstack bench run --suite swebench --dataset-dir ./swe-data --models bench.config.json --limit 5
|
|
98
|
+
|
|
99
|
+
# Then grade with the official harness:
|
|
100
|
+
python -m swebench.harness.run_evaluation \
|
|
101
|
+
--predictions_path ./bench-results/<ts>/predictions-<cell>.jsonl --run_id my-run
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The pinned subset lives in `subsets/swe-bench-verified-50.json` — replace the
|
|
105
|
+
starter list with your chosen N instance ids from the official
|
|
106
|
+
`princeton-nlp/SWE-bench_Verified` dataset and never change it afterwards
|
|
107
|
+
(changing the subset changes the fingerprint).
|