Skip to content

feat: add scaleswe v1 taskset + per-task setup/workdir hooks - #1616

Merged
mikasenghaas merged 6 commits into
feat/nano-as-v1from
feat/scaleswe-v1
Jun 11, 2026
Merged

feat: add scaleswe v1 taskset + per-task setup/workdir hooks#1616
mikasenghaas merged 6 commits into
feat/nano-as-v1from
feat/scaleswe-v1

Conversation

@mikasenghaas

@mikasenghaas mikasenghaas commented Jun 11, 2026

Copy link
Copy Markdown
Member

Summary

Adds the scaleswe-v1 taskset (a v1 port of the v0 ComposableEnv Scale-SWE taskset) plus three small, general framework hooks that agentic/SWE tasksets need.

scaleswe-v1 (examples/tasksets/scaleswe_v1)

Scale-SWE (AweAI-Team/Scale-SWE) rows ship a per-task Docker image with the repo, pre_commands that reset it to the base commit on a clean scaleswe branch, F2P/P2P pytest ids, and an optional f2p_patch / f2p_script carrying the failing test.

  • Each row → a ScaleSWETask carrying its image + workdir and the SWE metadata.
  • setup(task, runtime) runs the row's pre_commands in the live runtime before the agent.
  • The single solved reward restores the test files to base (the agent only fixes the source), applies the f2p test, and runs the merged F2P+P2P ids through a self-contained score.py (run by the testbed python) — 1.0 iff every expected id passes. Host-side reward stays tiny; the pytest run + JUnit matching live in score.py.
  • Dataset hardcoded (AweAI-Team/Scale-SWE, train); the row's image_url is used as-is (the prime sandbox pulls the raw Docker Hub image — no registry prefix needed).

Framework hooks (general)

  • Task.workdir — injected into the runtime config's workdir (symmetric with Task.image), so the agent and scoring run in the row's repo dir, not the default /app.
  • Taskset.setup(task, runtime) — no-op by default; run by the rollout after runtime.start() and before the harness, for per-task runtime prep.
  • Taskset.NEEDS_CONTAINER — ClassVar; the Environment refuses the subprocess runtime for a taskset that sets it (scaleswe-v1 sets it True).

Validation

100-rollout eval on glm-5.1 (rlm harness, prime runtime, uncapped):

  • 49/100 solved (49%), avg_reward=0.490; 51.6% among cleanly-completed (5 rollouts hit rlm/sandbox infra failures — harness exited 1 / prime exec failed — none in the taskset or scorer).
  • Confirms per-task image+workdir injection, setup() pre_commands, and the f2p/P2P pytest scorer all produce correct 0/1 rewards at scale.
  • ruff check --isolated / ruff format --isolated --check clean.

Note

Cursor Bugbot is generating a summary for commit 46da6d1. Configure here.

Note

Add ScaleSWE v1 taskset with per-task setup and workdir hooks

  • Adds a new scaleswe_v1 taskset that loads tasks from the AweAI-Team/Scale-SWE dataset, runs pre-commands to prepare the repo, applies optional fail-to-pass patches/scripts, and scores results via pytest JUnit XML output.
  • Adds a score.py CLI scorer that normalizes test IDs, parses JUnit XML, and emits 1.0 or 0.0 based on whether all expected tests passed.
  • Extends Taskset with a NEEDS_CONTAINER class variable and an async setup hook; Rollout.run now calls setup before starting tools.
  • Extends Task with an optional workdir field; Environment.__init__ propagates it to the runtime config when supported.
  • Risk: Environment now raises ValueError at construction time if a container-required taskset is paired with a SubprocessConfig runtime.

Macroscope summarized 46da6d1.

mikasenghaas and others added 2 commits June 10, 2026 23:56
scaleswe-v1 ports the v0 ComposableEnv Scale-SWE taskset to v1: each row carries
its per-task image + workdir, runs its pre_commands in setup() before the agent,
and scores with a single `solved` reward that restores the test files to base,
applies the f2p test, and runs the merged F2P+P2P pytest ids through a
self-contained scorer (1.0 iff every expected id passes).

Two small, general framework hooks enable it:
- Task.workdir, injected into the runtime config (symmetric with Task.image), so
  the agent and scoring run in the row's repo dir.
- Taskset.setup(task, runtime), run by the rollout after runtime.start() and
  before the harness, for per-task runtime prep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Comment thread verifiers/v1/env.py Outdated
mikasenghaas and others added 2 commits June 11, 2026 00:08
- add Taskset.NEEDS_CONTAINER ClassVar; the Environment refuses the subprocess
  runtime for a taskset that sets it. scaleswe-v1 sets NEEDS_CONTAINER = True.
- drop scaleswe's dataset_name/split knobs (hardcode AweAI-Team/Scale-SWE train);
  the taskset uses the base TasksetConfig.
- drop the pre_commands guard — all 20181 Scale-SWE rows carry pre_commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The prime sandbox pulls the raw Docker Hub image (aweaiteam/scaleswe:<tag>)
directly — verified in a smoke — so the us-central1 prod-sandbox prefix the v0
env prepended is unnecessary. Use the row's image_url as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mikasenghaas
mikasenghaas marked this pull request as ready for review June 11, 2026 01:13
mikasenghaas and others added 2 commits June 11, 2026 01:13
runtime_for injected task.workdir unconditionally, overriding a user-set
--harness.runtime.workdir. Apply the task's workdir only when the runtime
config's is still the default — matching the "cli/toml > task > default"
precedence the resources loop already uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mikasenghaas
mikasenghaas merged commit fd2f865 into feat/nano-as-v1 Jun 11, 2026
5 checks passed
@macroscopeapp

macroscopeapp Bot commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Needs human review

This PR introduces new v1 framework features (per-task setup hooks, workdir injection, container validation) and a substantial new taskset. These are new capabilities affecting runtime behavior, not minor changes. Additionally, two unresolved review comments identify potential logic issues in the taskset implementation.

You can customize Macroscope's approvability policy. Learn more.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6818779. Configure here.

if result.exit_code != 0:
raise vf.ProgramError(
f"scaleswe setup failed ({task.name}): {result.stderr.strip()[-500:]}"
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing pre_commands validation

Medium Severity

setup runs pre_commands without checking they are non-empty after normalization, so a row with missing or whitespace-only pre_commands still passes setup. The v0 Scale-SWE taskset raises in that case; here the repo may never be reset before the agent runs.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6818779. Configure here.

test_ids = task.fail_to_pass + task.pass_to_pass
if not test_ids:
return 0.0
await runtime.run(["sh", "-c", RESTORE], {**ENV, "base": task.base_commit})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Missing base commit check

Medium Severity

The solved reward runs the RESTORE script with an empty base when base_commit is missing, instead of failing fast. The v0 taskset rejects rows without parent_commit/base_commit before restoring tests.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6818779. Configure here.

Comment thread verifiers/v1/task.py
"""Working directory the harness and scoring run in — the Environment injects it into
the runtime config's `workdir` (where the runtime supports one). For a containerized
task whose image puts the working tree at a non-default path (e.g. a SWE row's
`/workspace/<repo>`)."""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Undocumented v1 framework hooks

Medium Severity

This PR adds user-facing v1 APIs (Task.workdir, Taskset.setup, Taskset.NEEDS_CONTAINER, and related env/rollout wiring) but does not update the project docs that describe v1 authoring and evaluation. Authors need that behavior documented to use SWE-style tasksets correctly.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: BugBot Instructions

Reviewed by Cursor Bugbot for commit 6818779. Configure here.

pull Bot pushed a commit to Stars1233/verifiers that referenced this pull request Jun 23, 2026
…tellect-ai#1616)

* feat(v1): add scaleswe taskset + per-task setup/workdir hooks

scaleswe-v1 ports the v0 ComposableEnv Scale-SWE taskset to v1: each row carries
its per-task image + workdir, runs its pre_commands in setup() before the agent,
and scores with a single `solved` reward that restores the test files to base,
applies the f2p test, and runs the merged F2P+P2P pytest ids through a
self-contained scorer (1.0 iff every expected id passes).

Two small, general framework hooks enable it:
- Task.workdir, injected into the runtime config (symmetric with Task.image), so
  the agent and scoring run in the row's repo dir.
- Taskset.setup(task, runtime), run by the rollout after runtime.start() and
  before the harness, for per-task runtime prep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: rename scaleswe _scorer.py -> score.py

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* feat(v1): NEEDS_CONTAINER taskset flag; trim scaleswe config

- add Taskset.NEEDS_CONTAINER ClassVar; the Environment refuses the subprocess
  runtime for a taskset that sets it. scaleswe-v1 sets NEEDS_CONTAINER = True.
- drop scaleswe's dataset_name/split knobs (hardcode AweAI-Team/Scale-SWE train);
  the taskset uses the base TasksetConfig.
- drop the pre_commands guard — all 20181 Scale-SWE rows carry pre_commands.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: drop the GCP registry prefix from scaleswe images

The prime sandbox pulls the raw Docker Hub image (aweaiteam/scaleswe:<tag>)
directly — verified in a smoke — so the us-central1 prod-sandbox prefix the v0
env prepended is unnecessary. Use the row's image_url as-is.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* fix(v1): honor cli/toml workdir over the task's

runtime_for injected task.workdir unconditionally, overriding a user-set
--harness.runtime.workdir. Apply the task's workdir only when the runtime
config's is still the default — matching the "cli/toml > task > default"
precedence the resources loop already uses.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* chore: drop redundant comment on workdir precedence

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant