hamishivi commited on
Commit
f605550
·
verified ·
1 Parent(s): f6907fc

Publish tmax conversion with complete task files and resumable image builder

Browse files
README.md ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ dataset_info:
3
+ features:
4
+ - name: messages
5
+ list:
6
+ - name: content
7
+ dtype: string
8
+ - name: role
9
+ dtype: string
10
+ - name: ground_truth
11
+ dtype: string
12
+ - name: dataset
13
+ dtype: string
14
+ - name: env_config
15
+ struct:
16
+ - name: env_name
17
+ dtype: string
18
+ - name: image
19
+ dtype: string
20
+ - name: task_id
21
+ dtype: string
22
+ - name: source
23
+ dtype: string
24
+ splits:
25
+ - name: train
26
+ num_bytes: 21228188
27
+ num_examples: 5431
28
+ download_size: 5213319
29
+ dataset_size: 21228188
30
+ configs:
31
+ - config_name: default
32
+ data_files:
33
+ - split: train
34
+ path: data/train-*
35
+ license: cc-by-4.0
36
+ language:
37
+ - en
38
+ tags:
39
+ - tmax
40
+ - terminal
41
+ - agents
42
+ - reinforcement-learning
43
+ ---
44
+
45
+ # CalibForge for tmax
46
+
47
+ **Images available:** this conversion reuses verified public upstream images pinned by digest.
48
+
49
+ All **5,431** task directories from [AweAI-Team/CalibForge](https://huggingface.co/datasets/AweAI-Team/CalibForge), pinned to `fb1e75441a94b8bb0ced08acd6b59e711704d70a`, converted to tmax's `swerl_vanillux_sandbox` format.
50
+
51
+ The train split uses the same `messages`, `ground_truth`, `dataset`, `env_config`, and `source` schema as the other `hamishivi/agent-task-*` datasets. Messages use the tmax Vanillux templates; `dataset` is `passthrough`. Task IDs are prefixed with `calibforge__` to avoid collisions when combining task archives. `task-manifest.json` maps them back to original paths.
52
+
53
+ `task-data.tar.gz` contains a directory per task with all original task files preserved byte-for-byte, plus `image.txt`. Instructions, verifiers, build contexts, metadata, and reference solutions are retained. The tmax loader exposes only environment seed files and defers tests until submission; reference solutions are not mounted into the agent sandbox.
54
+
55
+ ## Usage
56
+
57
+ ```python
58
+ from datasets import load_dataset
59
+ from huggingface_hub import hf_hub_download
60
+
61
+ train = load_dataset("hamishivi/agent-task-calibforge", split="train")
62
+ archive = hf_hub_download("hamishivi/agent-task-calibforge", "task-data.tar.gz", repo_type="dataset")
63
+ ```
64
+
65
+ Extract the archive and set the sandbox `task_data_dir` to the directory containing the task directories. Every row specifies its image explicitly. Task resource requirements and verifier timeouts remain in the original `task.toml`; configure the training harness accordingly.
66
+
67
+ ## Images
68
+
69
+ The 5,431 public upstream image references are reused and pinned by registry digest. Image manifests were verified accessible before publication.
70
+
71
+ ## Validation and attribution
72
+
73
+ All rows passed schema and Parquet round-trip checks, and every archived task file was checked against the downloaded source bytes. See `validation.json`. This does not constitute an evaluation of every task or a full training run.
74
+
75
+ The upstream license is cc-by-4.0. Consult the upstream dataset card for citation and provenance. tmax Vanillux prompts are adapted from mini-swe-agent (MIT).
76
+
77
+ ## Reproducibility and runtime coverage
78
+
79
+ This conversion targets `hamishivi/tmax-private`, branch `geomean_mask`, commit `9fff7af6e86f2589830637772ff5b10b1c080131`. All original task files are preserved; added task IDs, training rows, and image references adapt the packaging for tmax. See `UPSTREAM_README.md` for the source authors' attribution and citation details.
80
+
81
+ Validation covers all task records and archived file contents. No container build or runtime task evaluation was performed for this release. Upstream validation claims do not replace testing in your training harness.
82
+
83
+ ## Resumable image builds
84
+
85
+ Requires Docker Buildx and a Docker Hub login with write access to the target image repository. The script skips published tags and digest-pinned upstream images, saves per-image logs, and retries unfinished builds on the next run.
86
+
87
+ ```sh
88
+ mkdir -p tasks
89
+ tar -xzf task-data.tar.gz -C tasks
90
+ python build_dataset_images.py --task-data-dir tasks --manifest task-manifest.json --workers 8 --timeout 1800
91
+ ```
92
+
93
+ Images built by this script target Linux AMD64. If using another Docker Hub namespace, update image references consistently in the manifest, training records, and task `image.txt` files. The image status file is a publication-time snapshot.
94
+
95
+ Extract CalibForge on a case-sensitive filesystem (standard Linux filesystems work). One upstream task contains distinct fixtures named `n_structure_capitalized_TRUE.json` and `n_structure_capitalized_True.json`; both are preserved in this archive.
UPSTREAM_README.md ADDED
@@ -0,0 +1,110 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ pretty_name: CalibForge
3
+ language:
4
+ - en
5
+ size_categories:
6
+ - 1K<n<10K
7
+ tags:
8
+ - terminal
9
+ - bash
10
+ - code
11
+ - docker
12
+ configs:
13
+ - config_name: default
14
+ data_files:
15
+ - split: train
16
+ path: metadata.jsonl
17
+ ---
18
+
19
+ # CalibForge
20
+
21
+ [![GitHub](https://img.shields.io/badge/GitHub-Repo-181717?logo=github&logoColor=white)](https://github.com/AweAI-Team/CalibForge)
22
+ [![Hugging Face Datasets](https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Datasets-blue)](https://huggingface.co/datasets/AweAI-Team/CalibForge)
23
+ [![Scaffold](https://img.shields.io/badge/%F0%9F%8F%97%EF%B8%8F%20Scaffold-AweAgent-orange.svg)](https://github.com/AweAI-Team/AweAgent/tree/main/recipes/terminal_bench_v2)
24
+ [![License](https://img.shields.io/badge/License-CC%20BY%204.0-green.svg)](LICENSE)
25
+
26
+ <p align="center">
27
+ <img src="figures/abstract.png" width="100%" />
28
+ </p>
29
+
30
+ CalibForge is a collection of 5,431 executable and verifiable terminal-agent tasks constructed with adversarial solver calibration.
31
+
32
+ CalibForge uses solver behavior during task construction in two complementary ways:
33
+
34
+ - **Multi-solver calibration** retains tasks that expose disagreement across a heterogeneous solver pool.
35
+ - **Contrastive solver calibration** targets a designated strong-pass and weak-fail capability relation.
36
+
37
+ ## Dataset structure
38
+
39
+ ```text
40
+ CalibForge/
41
+ ├── README.md
42
+ ├── metadata.jsonl
43
+ ├── image_mapping.jsonl
44
+ ├── multi_solver/
45
+ │ └── <task_id>/
46
+ │ ├── instruction.md
47
+ │ ├── task.toml
48
+ │ ├── environment/
49
+ │ └── tests/
50
+ └── contrastive_solver/
51
+ └── <task_id>/
52
+ ├── instruction.md
53
+ ├── task.toml
54
+ ├── environment/
55
+ └── tests/
56
+ ```
57
+
58
+ | Subset | Calibration criterion | Tasks |
59
+ |:--|:--|--:|
60
+ | `multi_solver` | At least one solver succeeds and at least one solver fails | 1,263 |
61
+ | `contrastive_solver` | The stronger solver succeeds and the designated weaker solver fails | 4,168 |
62
+ | **Total** | | **5,431** |
63
+
64
+ Every task directory contains:
65
+
66
+ - `instruction.md`: the instruction shown to the terminal agent.
67
+ - `task.toml`: task metadata, timeouts, resource requirements, and the public Docker image reference.
68
+ - `environment/`: the Dockerfile and files needed to reproduce the task environment.
69
+ - `tests/`: the verifier entry point and its supporting files.
70
+
71
+ Each task directory is stored in Harbor style.
72
+
73
+ ## Docker environments
74
+
75
+ The exact image for each task is recorded in its `task.toml` and in `image_mapping.jsonl`.
76
+
77
+ For example:
78
+
79
+ ```bash
80
+ docker pull \
81
+ aweaiteam/calibforge:data-processing_20260415_002933_001_20260514_013004_644492
82
+ ```
83
+
84
+ To inspect a task image interactively:
85
+
86
+ ```bash
87
+ TASK=contrastive_solver/data-processing_20260415_002933_001
88
+ IMAGE=$(python - <<'PY'
89
+ import tomllib
90
+
91
+ with open("contrastive_solver/data-processing_20260415_002933_001/task.toml", "rb") as f:
92
+ print(tomllib.load(f)["environment"]["docker_image"])
93
+ PY
94
+ )
95
+ docker run --rm -it "$IMAGE" bash
96
+ ```
97
+
98
+ ## Download
99
+
100
+ Download the complete repository with `huggingface_hub`:
101
+
102
+ ```python
103
+ from huggingface_hub import snapshot_download
104
+
105
+ snapshot_download(
106
+ repo_id="AweAI-Team/CalibForge",
107
+ repo_type="dataset",
108
+ local_dir="CalibForge",
109
+ )
110
+ ```
build_dataset_images.py ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Build missing images from an extracted tmax task archive, with resumable logs.
2
+
3
+ Example:
4
+ python build_dataset_images.py --task-data-dir ./tasks --manifest task-manifest.json
5
+
6
+ Requires Docker Buildx and a Docker Hub login with write access to image repos.
7
+ Targets Linux AMD64; leaves source task files and verifiers unchanged.
8
+ """
9
+ import argparse
10
+ from concurrent.futures import ThreadPoolExecutor, as_completed
11
+ import json
12
+ from pathlib import Path
13
+ import subprocess
14
+ import time
15
+ import urllib.error
16
+ import urllib.request
17
+
18
+
19
+ def existing_tags(repository):
20
+ url = f'https://hub.docker.com/v2/repositories/{repository}/tags?page_size=100'
21
+ tags = set()
22
+ while url:
23
+ try:
24
+ with urllib.request.urlopen(url, timeout=30) as response:
25
+ data = json.load(response)
26
+ except urllib.error.HTTPError as exc:
27
+ if exc.code == 404:
28
+ return tags
29
+ raise
30
+ tags.update(item['name'] for item in data['results'])
31
+ url = data.get('next')
32
+ return tags
33
+
34
+
35
+ def build(entry, args):
36
+ image = entry['image']
37
+ name = image.rsplit(':', 1)[-1]
38
+ state = args.log_dir / f'{name}.json'
39
+ if not args.force and state.exists() and json.loads(state.read_text()).get('ok'):
40
+ return dict(image=image,ok=True,skipped=True)
41
+ context = args.task_data_dir / entry['task_id'] / 'environment'
42
+ assert (context / 'Dockerfile').is_file(), str(context)
43
+ log = args.log_dir / f'{name}.log'
44
+ metadata = args.log_dir / f'{name}.metadata.json'
45
+ command = ['docker','buildx','build','--platform',args.platform,'--provenance=false','--push','--metadata-file',str(metadata),'-t',image]
46
+ if args.builder:
47
+ command += ['--builder',args.builder]
48
+ command.append(str(context))
49
+ start = time.monotonic()
50
+ try:
51
+ with log.open('w') as output:
52
+ proc = subprocess.run(command,stdout=output,stderr=subprocess.STDOUT,timeout=args.timeout)
53
+ result = dict(image=image,task_id=entry['task_id'],ok=proc.returncode==0,exit_code=proc.returncode,seconds=round(time.monotonic()-start,2))
54
+ if result['ok']:
55
+ result['digest'] = json.loads(metadata.read_text())['containerimage.digest']
56
+ except subprocess.TimeoutExpired:
57
+ result = dict(image=image,task_id=entry['task_id'],ok=False,error='build timeout')
58
+ state.write_text(json.dumps(result,indent=2)+'\n')
59
+ return result
60
+
61
+
62
+ if __name__ == '__main__':
63
+ parser = argparse.ArgumentParser(description=__doc__)
64
+ parser.add_argument('--task-data-dir',required=True,type=Path)
65
+ parser.add_argument('--manifest',default=Path('task-manifest.json'),type=Path)
66
+ parser.add_argument('--log-dir',default=Path('image-build-logs'),type=Path)
67
+ parser.add_argument('--workers',default=8,type=int)
68
+ parser.add_argument('--timeout',default=900,type=int)
69
+ parser.add_argument('--platform',default='linux/amd64')
70
+ parser.add_argument('--builder')
71
+ parser.add_argument('--max-images',type=int)
72
+ parser.add_argument('--force',action='store_true')
73
+ args = parser.parse_args()
74
+ args.log_dir.mkdir(parents=True,exist_ok=True)
75
+ entries = list({r['image']:r for r in json.loads(args.manifest.read_text()) if '@sha256:' not in r['image']}.values())
76
+ if not args.force:
77
+ repos = {r['image'].rsplit(':',1)[0] for r in entries}
78
+ published = {f'{repo}:{tag}' for repo in repos for tag in existing_tags(repo)}
79
+ entries = [r for r in entries if r['image'] not in published]
80
+ if args.max_images is not None:
81
+ entries = entries[:args.max_images]
82
+ print(f'{len(entries)} missing image(s) to build',flush=True)
83
+ failures = 0
84
+ with ThreadPoolExecutor(max_workers=args.workers) as pool:
85
+ for future in as_completed([pool.submit(build,entry,args) for entry in entries]):
86
+ result = future.result()
87
+ failures += not result['ok']
88
+ print(json.dumps(result),flush=True)
89
+ print(f'Complete: {failures} failed build(s); rerun to retry.',flush=True)
90
+ raise SystemExit(bool(failures))
data/train-00000-of-00001.parquet ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:b81dcfd174d086faa4aa4d94727b89a628a9a6769f02a23179d817fac1f953f9
3
+ size 5213319
image-build-status.json ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ {
2
+ "task_counts_by_image_status": {
3
+ "verified_public_upstream": 5431
4
+ },
5
+ "unique_images": 5341,
6
+ "builds_run_for_this_release": false
7
+ }
task-data.tar.gz ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:79672cdec29ec9160b663e99dd0bb17be656c74756dea59c68a4fe2d285abb80
3
+ size 510167808
task-manifest.json ADDED
The diff for this file is too large to render. See raw diff
 
validation.json ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "source": "AweAI-Team/CalibForge",
3
+ "source_revision": "fb1e75441a94b8bb0ced08acd6b59e711704d70a",
4
+ "rows": 5431,
5
+ "unique_task_ids": 5431,
6
+ "preserved_task_files": 47132,
7
+ "archive_sha256": "79672cdec29ec9160b663e99dd0bb17be656c74756dea59c68a4fe2d285abb80",
8
+ "parquet_sha256": "b81dcfd174d086faa4aa4d94727b89a628a9a6769f02a23179d817fac1f953f9",
9
+ "schema_reference": "hamishivi/agent-task-endless-terminals",
10
+ "schema_reference_revision": "cb36a05d834fa31a6cc983a89245c11c48141db9",
11
+ "checks": [
12
+ "unique task IDs",
13
+ "reference schema equality",
14
+ "Parquet round-trip equality",
15
+ "all task files preserved byte-for-byte",
16
+ "no unresolved Git LFS pointers",
17
+ "archive checksum validation"
18
+ ]
19
+ }