SKILL.md
Release Skill
This skill orchestrates the repo-embedded deployment tooling and documents the openenv-namespace canonicalization process.
Prerequisites
hfCLI authenticated (runhf auth loginor setHF_TOKEN).- Local build dependencies installed so
scripts/preparehfdeployment.shcan stage Docker contexts. - Access to
scripts/managehfcollection.pyfor collection updates and discovery.
Primary Flow
- Stage envs with
scripts/preparehfdeployment.sh. Default arguments deploy every deployable env fromenvs/. Pass--env <name>to target a subset. The script:
- Resolves the requested OpenEnv ref for staged dependency rewrites. If 0.2.2 is only a release-candidate label and no v0.2.2 tag exists yet, the script should fall back to main for env dependency rewrites while keeping the Hub suffix at -0.2.2. - Rewrites loose openenv-core[core]>=... specs and direct Dockerfile installs to git+https://github.com/huggingface/OpenEnv.git@<resolved-ref> so the sweep does not silently install 0.2.1 from PyPI. - Builds a staging tree with src/, envs/<env>/, and a rewritten Dockerfile that sets BASEIMAGE to ghcr.io/huggingface/openenv-base:latest unless a hash is supplied. - Generates a README with Hub metadata, enforces openenv/openenv-<version> tags, and adds the HUBTAG used in collection sync. - Uses hf repo create/hf upload plus visibility flags to push Docker spaces.
- Suffix naming and privacy. Deploy to private spaces named
<env>-0.2.2(setSPACE_SUFFIX=-0.2.2or rely on the version-derived default). Use--privateto keep the collection private for now. The repo deploy script should update only the versioned collection during this phase, not the global tagged collection. - Runtime verification. For private Spaces, verify through authenticated
hf.spacedomains, not anonymous browser URLs. Usescripts/verifyprivatespaces.py --hf-namespace openenv --suffix -0.2.2or inspecthf spaces info <space>plus the runtime domain fromruntime.raw.domains. Preferhf spaces ls --expand=runtimeto confirmRUNNING/SLEEPING. For stuck or error states, consultscripts/preparehfdeployment.shlogic or fall back to thehf-space-recoveryskill.
- Do not treat /health alone as sufficient. This sweep found false positives where /health was 200 but runtime use still failed: chatenv-0.2.2 returned 500 on /reset, and tbench2env-0.2.2 also returned 500 on /reset. - For HTTP envs, an authenticated POST /reset is the minimum usability gate. If the action schema is simple, follow with a schema-correct POST /step probe as well; snakeenv, finrlenv, and sumorlenv all surfaced step-time failures that a health-only check would miss. - Some envs are slow enough that POST /reset may time out on a 20-second probe (gitenv, unityenv). Treat those as inconclusive until manually retried with a longer timeout or an env-specific probe. - Certain canonical spaces such as openenv/echo_env and the TextArena variants expose multiple READY runtime domains. The verifier now probes every READY domain and reports success once any domain returns usable data, so the canonical status is based on the first passing domain rather than the first listed domain.
Canonical update decision
- Canonical environments (no suffix) should point to
mainonly when the private-0.2.2candidate builds and passes health checks. - If a suffixed space fails to start or its Docker build is broken, leave the canonical reference untouched and pin that env’s
pyproject.tomldependency to<0.2.2to prevent inadvertent upgrades. - When a suffixed space succeeds, add it to the private versioned collection with
scripts/managehfcollection.py --version 0.2.2 --collection-namespace openenv --skip-global-collection --space-id <space>. - Existing unsuffixed canonicals are only a subset of
envs/. Before promotion, map repo envs to actual canonical repos on the Hub:
- direct matches: atarienv, browsergymenv, chatenv, codingenv, echoenv, openspielenv, sumorlenv - repo-name mismatches: replenv -> openenv/repl, tbench2env -> openenv/tbench2 - textarena aliases: textarenaenv promotes into productized canonicals such as openenv/sudoku and openenv/wordle, not openenv/textarenaenv - do not infer repo names from the env directory when the namespace already has a canonical alias; list the current openenv spaces first and promote into the existing repo when one exists - Observed canonical spaces in openenv as of this sweep include openenv/atarienv, openenv/browsergymenv, openenv/chatenv, openenv/codingenv, openenv/echoenv, openenv/finqaenv, openenv/openspielenv, openenv/repl, openenv/sudoku, openenv/wordle, openenv/sumorl_env, and openenv/tbench2; keep this list current when planning canonical promotions.
Collection handling
- Run
scripts/managehfcollection.pywith a single release tuple (namespaceopenenv, version0.2.2, suffix-0.2.2). - Default behavior adds discovered tagged spaces to the versioned collection, creating or reusing the slug
OpenEnv Environment Hub <version>. - Supply
--space-idexplicitly for each successfully redeployed suffixed space to avoid relying on discovery heuristics and to document the tested set. - For canonical updates, handle repo-name mismatches explicitly.
replenvmaps toopenenv/repl,tbench2envmaps toopenenv/tbench2, andtextarena_envmay be represented by productized aliases such asopenenv/sudokuoropenenv/wordlerather than an env-dir-matching Space.
Toolchain reminders
- Always run the release script from the repo root so relative paths to
envs/,src/, andpyproject.tomlresolve. - Keep
uv syncdetached at the start of Docker builds: the helper script injectsuv install/uv syncedits automatically. scripts/preparehfdeployment.sh --skip-collectioncan be used when only validating builds without touching collections.- For private-space verification, anonymous
https://<space>.hf.space/...requests return a generic 404. Use an authenticated header from the locally logged-inhftoken orscripts/verifyprivatespaces.py. - Canonical spaces may expose multiple
READYdomains. Do not stop at the first one. In this sweep,openenv/echo_envadvertised bothopenenv-echo-env-v2.hf.spaceandopenenv-echo-env.hf.space, andopenenv/sudokuadvertised bothopenenv-textarena.hf.spaceandopenenv-sudoku.hf.space; the first domain in each pair returned 404 while the second served the env correctly. Probe everyREADYdomain until one passes. - If a suffixed repo already contains the intended Dockerfile/source fix but HF still shows an old
BUILDERROR, useHfApi().restartspace(..., factory_reboot=True)to force a fresh rebuild of the same commit. - When
scripts/preparehfdeployment.shstages legacy Dockerfiles thatCOPY src/core/, it now injectsCOPY src/openenv/ /app/src/openenv/and limitsPYTHONPATHto/app/srcbecause exposing/app/src/coreearlier shadowed the stdlibtypesmodule and triggeredImportError: cannot import name 'GenericAlias'.
Env-Specific Fix Patterns
browsergym_env: avoid live Hub-timegit cloneof MiniWoB++ when possible. A pinned tarball snapshot is more reproducible than cloning the repo during every Space build.websearch_env: stagedopenenv-corerewrites can becomegit+https://...dependencies, so the builder image must havegitavailable beforeuv sync.mazeenvandsnakeenv: when a Dockerfile stages the repo root under/app/env, add/app/env/src/core:/app/env/src:/app/envtoPYTHONPATHso the Space can use the checked-out repo sources and compatibility shims during validation.- Legacy Dockerfiles that add
/app/src/coredirectly toPYTHONPATHcan shadow the Python stdlib with/app/src/core/types.py, causing startup failures likeImportError: cannot import name 'GenericAlias' from partially initialized module 'types'. Stagesrc/openenv/into/app/src/openenv/and put only/app/srconPYTHONPATH.
Post-release cleanup
- Record which envs passed vs. failed. Failed envs should stay pinned below
0.2.2until a fix is committed. - Archive or delete test suffix spaces once their artifacts are promoted to canonical releases to reduce clutter in the
openenvnamespace. - Capture
hf spaces info/curl .../healthoutput for the final success set so the release briefing notes the exact runtime status used to flip canonical references.