From 4d8d2ef2eccb0a8cb1f5fa491af8c4d306eaae07 Mon Sep 17 00:00:00 2001 From: Jaideep <67646710+jdchawla29@users.noreply.github.com> Date: Mon, 17 Aug 2026 16:53:55 -0700 Subject: [PATCH 1/5] add SDK example environments --- .github/workflows/ci.yml | 27 + .gitignore | 4 +- README.md | 4 +- docs/v6/guides/creating-an-environment.mdx | 7 +- docs/v6/reference/cli.mdx | 19 +- docs/v6/start/quickstart.mdx | 5 +- environments/coding/.dockerignore | 8 + environments/coding/.gitignore | 30 + environments/coding/Dockerfile.hud | 21 + environments/coding/README.md | 75 + environments/coding/coding/__init__.py | 1 + environments/coding/coding/grading.py | 107 + environments/coding/coding/repo.py | 134 ++ environments/coding/env.py | 229 +++ environments/coding/flask-4992.bundle | Bin 0 -> 742071 bytes environments/coding/pyproject.toml | 40 + environments/coding/tasks.py | 66 + environments/coding/tests/__init__.py | 0 environments/coding/tests/conftest.py | 8 + environments/coding/tests/test_env.py | 25 + environments/coding/tests/test_grading.py | 101 + .../coding/tests/test_local_rollout.py | 196 ++ environments/coding/tests/test_tasks.py | 64 + environments/coding/uv.lock | 1723 +++++++++++++++++ environments/cua/.dockerignore | 6 + environments/cua/.env.example | 2 + environments/cua/.gitignore | 47 + environments/cua/Dockerfile.hud | 22 + environments/cua/README.md | 86 + environments/cua/env.py | 103 + environments/cua/pyproject.toml | 43 + environments/cua/supervisord.conf | 61 + environments/cua/tasks.py | 96 + environments/cua/tests/conftest.py | 8 + environments/cua/tests/test_env.py | 64 + environments/cua/uv.lock | 1644 ++++++++++++++++ hud/cli/init.py | 130 +- hud/cli/presets.py | 272 +-- hud/cli/templates.py | 25 +- hud/cli/tests/test_init.py | 209 +- pyproject.toml | 2 + 41 files changed, 5393 insertions(+), 321 deletions(-) create mode 100644 environments/coding/.dockerignore create mode 100644 environments/coding/.gitignore create mode 100644 environments/coding/Dockerfile.hud create mode 100644 environments/coding/README.md create mode 100644 environments/coding/coding/__init__.py create mode 100644 environments/coding/coding/grading.py create mode 100644 environments/coding/coding/repo.py create mode 100644 environments/coding/env.py create mode 100644 environments/coding/flask-4992.bundle create mode 100644 environments/coding/pyproject.toml create mode 100644 environments/coding/tasks.py create mode 100644 environments/coding/tests/__init__.py create mode 100644 environments/coding/tests/conftest.py create mode 100644 environments/coding/tests/test_env.py create mode 100644 environments/coding/tests/test_grading.py create mode 100644 environments/coding/tests/test_local_rollout.py create mode 100644 environments/coding/tests/test_tasks.py create mode 100644 environments/coding/uv.lock create mode 100644 environments/cua/.dockerignore create mode 100644 environments/cua/.env.example create mode 100644 environments/cua/.gitignore create mode 100644 environments/cua/Dockerfile.hud create mode 100644 environments/cua/README.md create mode 100644 environments/cua/env.py create mode 100644 environments/cua/pyproject.toml create mode 100644 environments/cua/supervisord.conf create mode 100644 environments/cua/tasks.py create mode 100644 environments/cua/tests/conftest.py create mode 100644 environments/cua/tests/test_env.py create mode 100644 environments/cua/uv.lock diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cb017e5b..75e5bf436 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,6 +26,33 @@ jobs: - name: Run tests run: uv run --python ${{ matrix.python-version }} --with=".[dev]" pytest --cov --cov-report='' + templates: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + template: [coding, cua] + + steps: + - name: Check out code + uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v5 + + - name: Install template with the SDK from this checkout + working-directory: environments/${{ matrix.template }} + run: | + uv sync --all-extras + uv pip install -e ../.. + + - name: Run template checks + working-directory: environments/${{ matrix.template }} + run: | + uv run --no-sync ruff format . --check + uv run --no-sync ruff check . + uv run --no-sync pytest -q + lint-ruff: runs-on: ubuntu-latest steps: diff --git a/.gitignore b/.gitignore index 409d4254b..5426ec1ea 100644 --- a/.gitignore +++ b/.gitignore @@ -62,7 +62,9 @@ hud/rl/checkpoints_test/ docs/internal -environments/ +environments/* +!environments/coding/ +!environments/cua/ experiments/ .memories/ diff --git a/README.md b/README.md index 4a06edc15..36ce2c12e 100644 --- a/README.md +++ b/README.md @@ -37,10 +37,12 @@ hud set HUD_API_KEY=your-key-here # or: export HUD_API_KEY=your-key-here ``` -Then scaffold your first environment: +Then start from the coding environment, or choose another example environment: ```bash hud init my-env +hud init my-desktop-env --template cua +hud init my-custom-env --template blank ``` ![Agent running on SheetBench](docs/src/images/trace_sheet.gif) diff --git a/docs/v6/guides/creating-an-environment.mdx b/docs/v6/guides/creating-an-environment.mdx index 74020c525..fc239863f 100644 --- a/docs/v6/guides/creating-an-environment.mdx +++ b/docs/v6/guides/creating-an-environment.mdx @@ -13,10 +13,11 @@ On this page: [Start](#start) · [The `env.py` file](#the-envpy-file) · [Capabi ## Start -Run `hud init` in your terminal. This lets you select a template to start with, the default is a blank template. +Run `hud init` in your terminal. A named non-interactive run starts from the coding environment; an +interactive run lets you choose. This guide uses `blank` because it builds each part from scratch. ```bash -hud init my-env +hud init my-env --template blank cd my-env ``` @@ -306,5 +307,5 @@ A HUD environment isn't locked to HUD: its tasks export through the experimental ## See environment examples -For more to build on, pick a different starting point with `hud init`, or read the +For more to build on, choose the coding or computer-use example with `hud init`, or read the [cookbooks](/v6/cookbooks/index) for worked environments like a coding agent and an ops diagnostics task. diff --git a/docs/v6/reference/cli.mdx b/docs/v6/reference/cli.mdx index dd7659443..b3655bbdd 100644 --- a/docs/v6/reference/cli.mdx +++ b/docs/v6/reference/cli.mdx @@ -10,19 +10,24 @@ Install the CLI with `uv tool install hud --python 3.12`. Authenticate once with ### `hud init` -Scaffold a new environment package in a fresh `` directory. The `blank` template (the default with no preset, and the first option in the interactive picker) writes a minimal local scaffold - `env.py` (environment, templates, capabilities), `tasks.py` (concrete task rows), `Dockerfile.hud`, and `pyproject.toml` - no network, no API key. Every other preset downloads a starter environment from GitHub instead. +Start a new environment package in a fresh `` directory. HUD provides example environments from the SDK +repository; a named non-interactive run uses `coding` by default. In a source checkout, `hud init` +copies the matching `environments/` directory. An installed release +fetches the matching SDK tag and extracts that same directory, so the example always matches the +installed SDK rather than `main`. The `blank` example is the exception: it generates a minimal local +scaffold with no network access. ```bash -hud init # pick a template → ./