schema_version int64 3 3 | instance_id stringclasses 30
values | spec dict | mask_patch stringclasses 30
values | gold_patch stringclasses 30
values | mutant_patch stringlengths 295 1.33k | test_patch stringclasses 30
values | proof dict | metadata dict |
|---|---|---|---|---|---|---|---|---|
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {
"spec_id": "S5",
"text": "The method resets: - Import tracking sets for regular and typing imports",
"category": "behavioral",
"code_mapping": [
{
"file": "metaflow/cmd/develop/stub_generator.py",
"lines": "335-339",
"function": "_reset"
}
]
} | diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py
index 50d9ca29..9ee2a2e0 100644
--- a/metaflow/cmd/develop/stub_generator.py
+++ b/metaflow/cmd/develop/stub_generator.py
@@ -328,28 +328,28 @@ class StubGenerator:
self._reset()
- def _reset(self):
- # "... | diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py
index 50d9ca29..9ee2a2e0 100644
+++ a/metaflow/cmd/develop/stub_generator.py
--- b/metaflow/cmd/develop/stub_generator.py
@@ -328,28 +328,28 @@ class StubGenerator:
self._reset()
+ def _reset(self):
+ # "... | diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py
index 50d9ca29..884e1de8 100644
--- a/metaflow/cmd/develop/stub_generator.py
+++ b/metaflow/cmd/develop/stub_generator.py
@@ -333,11 +333,11 @@ class StubGenerator:
# but simplifies code quite a bit.
# Impor... | diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py
deleted file mode 100644
index c115c463..00000000
--- a/test/cmd/develop/test_stub_generator.py
+++ /dev/null
@@ -1,525 +0,0 @@
-import tempfile
-import typing
-import inspect
-from typing import TypeVar, Optional
-from unitt... | {
"case_contract": "Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positional arguments for the target callable.\n- `kwargs`: a dict mapping string keys to keyword argument values for the target\n callable.\n\n`check_case(case)` must invoke the target using\n`target(*case[\"args\"], **ca... | {
"preservation_probes": [
{
"spec_id": "S6",
"shared_functions": 1,
"shared_lines": 1
},
{
"spec_id": "S10",
"shared_functions": 1,
"shared_lines": 0
},
{
"spec_id": "S7",
"shared_functions": 1,
"shared_lines": 0
},
{
"spec_id": ... |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S6","text":"The method resets: - Sub-module import tracking","category":"behavioral","co(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S5","shared_functions":1,"shared_lines":1},{"spec_id":"S10","sha(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S7","text":"The method resets: - TypeVar definitions dictionary","category":"behavioral"(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S10","shared_functions":1,"shared_lines":0},{"spec_id":"S5","sha(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S9","text":"The method resets: - Generated stub content list","category":"behavioral","c(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S10","shared_functions":1,"shared_lines":0},{"spec_id":"S5","sha(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S10","text":"The method resets: - Current parent module reference","category":"behaviora(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S5","shared_functions":1,"shared_lines":0},{"spec_id":"S6","shar(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S20","text":"name : str — The name of the class for which to generate the stub. clazz (...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S21","shared_functions":1,"shared_lines":0},{"spec_id":"S22","sh(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S24","text":"Processes static methods, class methods, and regular methods with appropria(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S23","shared_functions":1,"shared_lines":11},{"spec_id":"S27","s(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S27","text":"Skips __init__ method generation for TriggeredRun and DeployedFlow subclass(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S23","shared_functions":1,"shared_lines":5},{"spec_id":"S24","sh(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S32","text":"name : str — The name of the function for which to generate the stub. fun(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S33","shared_functions":1,"shared_lines":0},{"spec_id":"S34","sh(...TRUNCATED) |
3 | Netflix__metaflow.b390a8d4.test_stub_generator.7bf08c98.lv1 | {"spec_id":"S33","text":"Either 'func' or 'sign' must be provided, but not necessarily both / func :(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/metaflow/cmd/develop/stub_generator.py b/metaflow/cmd/develop/stub_generator.py\nindex(...TRUNCATED) | "diff --git a/test/cmd/develop/test_stub_generator.py b/test/cmd/develop/test_stub_generator.py\ndel(...TRUNCATED) | {"case_contract":"Every case is a dict with exactly two keys:\n\n- `args`: a tuple or list of positi(...TRUNCATED) | {"preservation_probes":[{"spec_id":"S32","shared_functions":1,"shared_lines":0},{"spec_id":"S34","sh(...TRUNCATED) |
SpecGuardBench
SpecGuardBench measures whether a coding agent can build a reliable validation harness from a natural-language specification. A task gives the agent one atomic specification of a feature, the repository, and a reference implementation. The agent writes a scenario generator (build_cases()) and executable checks (check_case(case)). The harness is run against implementations that satisfy the specifications and violate them. A faithful harness rejects the violating implementation and accepts the gold implementation and every valid alternative. Meanwhile it should achieve high coverage.
The tasks are built on 30 feature instances of FeatureBench from 13 Python repositories.
| Split | Tasks | Instances |
|---|---|---|
full |
291 | 30 |
lite |
100 | 30 |
The Lite Set is a stratified sample of the Full Set
Loading
from datasets import load_dataset
full = load_dataset("coxhin/SpecGuardBench", split="full")
lite = load_dataset("coxhin/SpecGuardBench", split="lite")
Fields
Each record is one task.
| Field | Content |
|---|---|
schema_version |
record format version (3) |
instance_id |
FeatureBench instance |
spec |
the atomic specification: spec_id, text, category, and code_mapping (the gold code it maps to, which the agent is not shown) |
mask_patch |
FeatureBench's patch that removes the feature from the repository |
gold_patch |
the gold implementation: the reverse of mask_patch, without the fail-to-pass test files |
mutant_patch |
the violating implementation, as a patch on top of the gold implementation |
test_patch |
FeatureBench's patch that deletes the instance's fail-to-pass test files |
proof.case_contract |
the case contract: the format of a test scenario and how the checks must call the target |
metadata.preservation_probes |
the tasks that take this violating implementation as a valid alternative; each entry gives that task's spec_id and how many functions and lines the gold code of the two specifications shares (shared_functions, shared_lines) |
The agent is given spec.spec_id, spec.category, spec.text and proof.case_contract, together with a repository that holds the reference implementation. The other fields build that repository and score the harness.
The valid alternative implementations of a task are the violating implementations of other tasks in the same instance whose metadata.preservation_probes list the task. The evaluation scores up to three per task, those sharing the most code with it.
mask_patch, gold_patch and test_patch are the same for every task of an instance.
Files
| Path | Content |
|---|---|
data/full-*.parquet |
the full split |
data/lite-*.parquet |
the lite split |
raw/full_set.jsonl |
the 291 tasks as JSON lines, with the same fields; the evaluation pipeline reads this file |
raw/lite_set.tsv |
the Lite Set as tab-separated instance_id and spec_id pairs |
raw/instances.jsonl |
the 30 FeatureBench instances |
The construction record of each task, including its differential witness, is in data/full_set.jsonl of the code repository.
Running the evaluation
The evaluation pipeline is at github.com/coxhin/SpecGuardBench. It reads the files under raw/:
hf download coxhin/SpecGuardBench --repo-type dataset --include "raw/*" --local-dir .
Pass raw/full_set.jsonl as MUTATION_OUTPUT, and raw/lite_set.tsv as SPEC_SUBSET for the Lite Set. The Lite Set is also evaluated from raw/full_set.jsonl, because the valid alternatives of a task come from other tasks of its instance. Each task runs in the FeatureBench image of its instance (docker.io/libercoders/featurebench-specs_*), and the pipeline reads instance metadata from LiberCoders/FeatureBench.
License
MIT. The patches contain code from the 13 upstream repositories, which remains under each repository's own license.
- Downloads last month
- 82