Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions docs/source/environments/thinkingbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ because tasks are selected deterministically by UID. Concurrent sessions are
stacked independent environment instances, one trajectory per instance; they
are not multiplexed trajectories.

Executable assets come from the pinned `thinkingbox-bench-v1.0` release in
[`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data).
The [Hugging Face `microsoft/ThinkingBox-Bench`
dataset](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench) is a
viewer-friendly representation, while GitHub remains the executable source.
Executable assets come from the pinned `thinkingbox-bench-v1.0` release,
downloaded from
[`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data),
the copy linked from Microsoft's
[ThinkingBox post](https://huggingface.co/blog/microsoft/thinkingbox). The
environment checks the bundle against its pinned SHA-256, so it only accepts
that release. `microsoft/thinkingbox-data` and the Hugging Face
`microsoft/ThinkingBox-Bench` viewer dataset are not public at the moment.

## Configuration

Expand Down Expand Up @@ -131,9 +134,9 @@ Please cite the paper if ThinkingBox is useful in your experiments.
for Agents in Stateful Business Workflows](https://arxiv.org/abs/2608.19741)
- Framework: [`microsoft/thinkingbox`](https://github.com/microsoft/thinkingbox)
- Executable benchmark:
[`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data)
- Viewer dataset:
[`microsoft/ThinkingBox-Bench`](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench)
[`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data)
(`microsoft/thinkingbox-data` is not public at the moment)
- Blog post: [ThinkingBox on Hugging Face](https://huggingface.co/blog/microsoft/thinkingbox)

```bibtex
@misc{li2026successisntreliabilitythinkingbox,
Expand Down
19 changes: 11 additions & 8 deletions envs/thinkingbox_env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,14 @@ because tasks are selected deterministically by UID. Concurrent sessions are
stacked independent environment instances, one trajectory per instance; they
are not multiplexed trajectories.

Executable assets come from the pinned `thinkingbox-bench-v1.0` release in
[`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data).
The [Hugging Face `microsoft/ThinkingBox-Bench`
dataset](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench) is a
viewer-friendly representation, while GitHub remains the executable source.
Executable assets come from the pinned `thinkingbox-bench-v1.0` release,
downloaded from
[`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data),
the copy linked from Microsoft's
[ThinkingBox post](https://huggingface.co/blog/microsoft/thinkingbox). The
environment checks the bundle against its pinned SHA-256, so it only accepts
that release. `microsoft/thinkingbox-data` and the Hugging Face
`microsoft/ThinkingBox-Bench` viewer dataset are not public at the moment.

## Configuration

Expand Down Expand Up @@ -142,9 +145,9 @@ Please cite the paper if ThinkingBox is useful in your experiments.
for Agents in Stateful Business Workflows](https://arxiv.org/abs/2608.19741)
- Framework: [`microsoft/thinkingbox`](https://github.com/microsoft/thinkingbox)
- Executable benchmark:
[`microsoft/thinkingbox-data`](https://github.com/microsoft/thinkingbox-data)
- Viewer dataset:
[`microsoft/ThinkingBox-Bench`](https://huggingface.co/datasets/microsoft/ThinkingBox-Bench)
[`MrSergSanch/thinkingbox-data`](https://github.com/MrSergSanch/thinkingbox-data)
(`microsoft/thinkingbox-data` is not public at the moment)
- Blog post: [ThinkingBox on Hugging Face](https://huggingface.co/blog/microsoft/thinkingbox)

```bibtex
@misc{li2026successisntreliabilitythinkingbox,
Expand Down
4 changes: 4 additions & 0 deletions envs/thinkingbox_env/benchmark_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,10 @@ def _extract_archive(archive: Path, destination: Path) -> None:
relative_parts = path.parts[1:]
if not relative_parts or relative_parts[0] not in _ALLOWED_TOP_LEVELS:
continue
# _bundle_sha256 does not hash bytecode, so never extract it: an
# unverified .pyc next to the bundled servers could be imported.
if "__pycache__" in relative_parts or path.suffix in {".pyc", ".pyo"}:
continue
if (
member.issym()
or member.islnk()
Expand Down
4 changes: 3 additions & 1 deletion envs/thinkingbox_env/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
DATA_BUNDLE_SHA256 = "16803d95d161ca06309d95f0dbbcbbb7b3fdf8a61e2b4eacfe920781b12f18ff"
DATA_MANIFEST_PATH = "releases/thinkingbox_bench_v1/testlist_thinkingbox_bench_v1.yaml"
DATA_ARCHIVE_URL = (
f"https://codeload.github.com/microsoft/thinkingbox-data/tar.gz/{DATA_COMMIT}"
# microsoft/thinkingbox-data is not public. This is the copy Microsoft's
# ThinkingBox post links, DATA_BUNDLE_SHA256 checks it is the pinned release.
f"https://codeload.github.com/MrSergSanch/thinkingbox-data/tar.gz/{DATA_COMMIT}"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: microsoft/thinkingbox-data 404s and MrSergSanch/thinkingbox-data is public at the same pinned commit, matching the official HF ThinkingBox blog post's (mislabeled) link. DATA_BUNDLE_SHA256 below is unchanged and still gates content, so this only swaps the host, not the trust model for content integrity.

Worth a maintainer sign-off that a personal account is acceptable as the long-term source here vs. a stopgap — see the alignment flag in the top-level review for details.

)


Expand Down
25 changes: 25 additions & 0 deletions tests/envs/test_thinkingbox_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -1753,6 +1753,31 @@ def test_archive_extraction_keeps_safe_members_beneath_destination(
assert not (destination / "README.md").exists()


def test_archive_extraction_skips_bytecode_the_bundle_hash_ignores(
tmp_path: Path,
) -> None:
archive = tmp_path / "bytecode.tar.gz"
payload = b"bytes"
with tarfile.open(archive, "w:gz") as output:
for name in (
"root/servers/tool.py",
"root/servers/__pycache__/tool.cpython-312.pyc",
"root/dataset/case.pyc",
"root/dataset/case.pyo",
):
member = tarfile.TarInfo(name)
member.size = len(payload)
output.addfile(member, io.BytesIO(payload))

destination = tmp_path / "out"
_extract_archive(archive, destination)

assert (destination / "servers/tool.py").read_bytes() == payload
assert not (destination / "servers/__pycache__").exists()
assert not (destination / "dataset/case.pyc").exists()
assert not (destination / "dataset/case.pyo").exists()


def test_archive_extraction_rejects_resolved_target_escape(tmp_path: Path) -> None:
archive = tmp_path / "symlink-parent.tar.gz"
payload = b"bad"
Expand Down