Skip to content

Commit c645b99

Browse files
committed
docs: explain author validation workflows
1 parent b96fbbc commit c645b99

8 files changed

Lines changed: 77 additions & 27 deletions

File tree

.claude/skills/generate-openenv-env/assets/openenv_env_template/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ You can easily deploy your OpenEnv environment to Hugging Face Spaces using the
6868
# From the environment directory (where openenv.yaml is located)
6969
openenv push
7070

71-
# Or specify options
72-
openenv push --namespace my-org --private
71+
# Or specify a target Space
72+
openenv push --repo-id my-org/__ENV_NAME__ --private
7373
```
7474

7575
The `openenv push` command will:
76-
1. Validate that the directory is an OpenEnv environment (checks for `openenv.yaml`)
77-
2. Prepare a custom build for Hugging Face Docker space (enables web interface)
78-
3. Upload to Hugging Face (ensuring you're logged in)
76+
1. Authenticate and prepare the exact Space revision
77+
2. Run strict publish validation in a dedicated Hugging Face Sandbox
78+
3. Add `.openenv/validation-report.json` and upload the validated revision
7979

8080
### Prerequisites
8181

8282
- Authenticate with Hugging Face: The command will prompt for login if not already authenticated
8383

8484
### Options
8585

86-
- `--directory`, `-d`: Directory containing the OpenEnv environment (defaults to current directory)
86+
- Positional `directory`: Directory containing the OpenEnv environment (defaults to current directory)
8787
- `--repo-id`, `-r`: Repository ID in format 'username/repo-name' (defaults to 'username/env-name' from openenv.yaml)
8888
- `--base-image`, `-b`: Base Docker image to use (overrides Dockerfile FROM)
8989
- `--private`: Deploy the space as private (default: public)

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ The OpenEnv CLI provides commands to manage environments:
273273
- **`openenv serve`** - Serve an environment locally with optional auto-reload
274274
- **`openenv build`** - Build the Docker image for an environment
275275
- **`openenv fork <space-id>`** - Fork a Space from HF Hub to your account
276-
- **`openenv validate`** - Validate an environment configuration
276+
- **`openenv validate`** - Validate locally or in a dedicated HF Sandbox; use
277+
`--profile publish --remote` for the strict author gate
277278

278279
### Quick Start
279280

docs/source/getting_started/contributing-envs.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,23 @@ openenv push --private
4646
openenv push path/to/my_env
4747
```
4848

49-
That's it. The CLI validates your environment, stages the files, adds the Hugging Face Space frontmatter, enables the web interface, and uploads everything. Your environment will be live at
49+
That's it. The CLI authenticates with Hugging Face, prepares the exact Space
50+
revision, runs the strict `publish` profile on that snapshot in a dedicated HF
51+
Sandbox, adds an unofficial author report, and uploads the same revision. Your
52+
environment will be live at
5053
`https://huggingface.co/spaces/<your-username>/my_env`.
5154

5255
> [!WARNING]
53-
> If you are getting errors on deployment, it is likely because the environment structure is not valid. Run `openenv validate --verbose` to see the errors. This checks for the required files (`openenv.yaml`, `pyproject.toml`, `server/app.py`) and validates the Dockerfile and entry points.
56+
> Run `openenv validate --profile publish --remote --verbose` before pushing.
57+
> Failed and incomplete criteria include configuration locations and suggested
58+
> fixes. A publish-ready environment also needs a `task.toml` requirements
59+
> envelope; `openenv init` creates a Harbor schema 1.1 starting point. Existing
60+
> environments created before this template must add truthful CPU, memory,
61+
> storage, GPU, and internet requirements rather than copying placeholders.
62+
63+
The uploaded `.openenv/validation-report.json` records author validation; it is
64+
not certification. A future Hub service will run broader security,
65+
reproducibility, artifact, and training-value checks independently.
5466

5567
## 2. Fork Someone Else's Environment
5668

docs/source/getting_started/environment-builder.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ openenv init my_env
7474
openenv init my_env --output-dir /Users/you/envs
7575
```
7676

77-
The command creates a fully-typed template with `openenv.yaml`, `pyproject.toml`, `uv.lock`, Docker assets, and stub implementations. If you're working inside this repo, move the generated folder under `envs/`.
77+
The command creates a fully-typed template with `openenv.yaml`, a Harbor schema
78+
1.1 `task.toml` resource envelope, `pyproject.toml`, `uv.lock`, Docker assets,
79+
and stub implementations. If you're working inside this repo, move the
80+
generated folder under `envs/`.
7881

7982
Typical layout:
8083

@@ -85,6 +88,7 @@ my_env/
8588
├── client.py
8689
├── models.py
8790
├── openenv.yaml
91+
├── task.toml
8892
├── pyproject.toml
8993
├── uv.lock
9094
└── server/
@@ -318,6 +322,7 @@ From the environment directory:
318322
cd envs/my_env
319323
openenv build # Builds Docker image (auto-detects context)
320324
openenv validate --verbose
325+
openenv validate --profile publish --remote --output validation.json
321326
```
322327

323328
`openenv build` understands both standalone environments and in-repo ones. Useful flags:
@@ -327,7 +332,12 @@ openenv validate --verbose
327332
- `--dockerfile` / `--context`: custom locations when experimenting
328333
- `--no-cache`: force fresh dependency installs
329334

330-
`openenv validate` checks for required files, ensures the Dockerfile/server entrypoints function, and lists supported deployment modes. The command exits non-zero if issues are found so you can wire it into CI.
335+
`openenv validate` always uses the shared validation report. The `static` and
336+
`runtime` profiles support fast iteration; `publish` is strict and exits
337+
non-zero when a blocking check fails, errors, or cannot run. `--remote` runs
338+
the environment in a dedicated HF Sandbox. Human output includes typed fixes,
339+
while `--json` or `--output` provides the same structured report for agents and
340+
CI.
331341

332342
### 8. Push & Share with `openenv push`
333343

@@ -361,7 +371,12 @@ Key options:
361371
- `--env-var/-e KEY=VALUE`: set a public Space variable (repeatable); overrides matching keys from `variables:` in `openenv.yaml`
362372
- `--secret KEY=VALUE`: set a private Space secret (repeatable); value is never logged
363373

364-
The command validates your `openenv.yaml`, injects Hugging Face frontmatter when needed, and uploads the prepared bundle.
374+
For Hub pushes, the command prepares the bundle (including Hugging Face
375+
frontmatter), validates that exact snapshot remotely, and uploads it together
376+
with `.openenv/validation-report.json`. That versioned report is unofficial
377+
author evidence. When deployed, the Hub's broader certification suite will
378+
publish an independent result rather than trusting or overwriting the author
379+
report.
365380
Space variables and secrets are only applied on direct Hugging Face Space pushes;
366381
they are not available for `--registry`, and they cannot be staged through
367382
`--create-pr`.

docs/source/reference/cli.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,24 @@ openenv validate path/to/env --profile static
4848
openenv validate path/to/env --profile runtime --json
4949
openenv validate --url http://127.0.0.1:8000 --profile runtime --json
5050
openenv validate path/to/env --profile full --output validation.json
51+
openenv validate path/to/env --profile publish --remote --output validation.json
5152
```
5253

5354
`static` checks source and packaging, `runtime` adds a launched or connected
5455
server, and `full` records every policy criterion while marking unavailable
55-
remote capabilities as skipped. Local reports never claim official
56-
certification. Automatic local launch executes the environment checkout as the
57-
current user and is intended only for trusted development source; use `--url`
58-
for a server you already isolated.
56+
remote capabilities as skipped. `publish` runs the runtime check set as a
57+
strict author gate: every blocking criterion must pass, so blocking skips are
58+
reported as incomplete and exit non-zero. Reports include typed diagnostics,
59+
repository-relative locations, display-only remediation, and safe evidence
60+
with `--verbose`.
61+
62+
`--remote` uploads the environment revision and the initiating validator source
63+
to a new dedicated Hugging Face Sandbox. The HF token authorizes Sandbox
64+
creation but is not forwarded into the workload. The returned report uses the
65+
same schema and remains unofficial; it never claims Hub certification.
66+
Automatic local launch executes the checkout as the current user and is only
67+
for trusted development source. Use `--url` for a server you already isolated,
68+
or `--remote` to isolate source execution.
5969

6070
This command intentionally targets the served OpenEnv spec. Shared reports
6171
record spec, adapter, and execution-model provenance, but `openenv validate`
@@ -66,6 +76,12 @@ task workflow is tracked in [issue #898](https://github.com/huggingface/OpenEnv/
6676

6777
## `openenv push`
6878

79+
Hub pushes automatically require a passing remote `publish` report. The CLI
80+
adds a portable copy to `.openenv/validation-report.json` in the same uploaded
81+
revision. This is author evidence for debugging and automation, not the richer
82+
independent certification report that the planned Hub validation service will
83+
produce.
84+
6985
[[autodoc]] openenv.cli.commands.push.push
7086

7187
## `openenv serve`

src/openenv/cli/commands/push.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -723,9 +723,12 @@ def push(
723723
Push an OpenEnv environment to Hugging Face Spaces or a custom Docker registry.
724724
725725
This command:
726-
1. Validates that the directory is an OpenEnv environment (openenv.yaml present)
727-
2. Builds and pushes to Hugging Face Spaces or custom Docker registry
728-
3. Optionally enables web interface for deployment
726+
1. Prepares the exact Hub upload and validates it in a dedicated HF Sandbox
727+
2. Requires every blocking publish criterion to pass
728+
3. Uploads a portable, unofficial `.openenv/validation-report.json`
729+
730+
Custom registry pushes run the same strict publish profile locally before
731+
building. The versioned Hub report is author evidence, not certification.
729732
730733
The web interface is enabled by default when pushing to HuggingFace Spaces,
731734
but disabled by default when pushing to a custom Docker registry.
@@ -738,7 +741,6 @@ def push(
738741
$ openenv push
739742
740743
# Push to HuggingFace repo and open a Pull Request
741-
$ openenv push my-org/my-env --create-pr
742744
$ openenv push --repo-id my-org/my-env --create-pr
743745
744746
# Push to HuggingFace without web interface

src/openenv/cli/commands/validate.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ def validate(
104104
versioned runtime API contract and returns a criteria-based JSON report.
105105
Every profile emits the RFC 008 shared report. The publish profile is a
106106
strict release gate: blocking skipped checks are incomplete and exit
107-
non-zero.
107+
non-zero. `--remote` runs the same plan in a fresh dedicated Hugging Face
108+
Sandbox and returns the same report schema.
108109
Reports identify the served OpenEnv spec and pinned adapter; external task
109110
package formats are intentionally outside this command's dispatch surface.
110111
Automatic runtime launch is intended for trusted local source; connect to
@@ -129,6 +130,9 @@ def validate(
129130
130131
# Run every locally available check and record remote-only skips
131132
$ openenv validate envs/echo_env --profile full --output report.json
133+
134+
# Run the strict author gate remotely and save its structured guidance
135+
$ openenv validate envs/echo_env --profile publish --remote --output report.json
132136
```
133137
"""
134138
runtime_target = url

src/openenv/cli/templates/openenv_env/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,22 +68,22 @@ You can easily deploy your OpenEnv environment to Hugging Face Spaces using the
6868
# From the environment directory (where openenv.yaml is located)
6969
openenv push
7070

71-
# Or specify options
72-
openenv push --namespace my-org --private
71+
# Or specify a target Space
72+
openenv push --repo-id my-org/__ENV_NAME__ --private
7373
```
7474

7575
The `openenv push` command will:
76-
1. Validate that the directory is an OpenEnv environment (checks for `openenv.yaml`)
77-
2. Prepare a custom build for Hugging Face Docker space (enables web interface)
78-
3. Upload to Hugging Face (ensuring you're logged in)
76+
1. Authenticate and prepare the exact Space revision
77+
2. Run strict publish validation in a dedicated Hugging Face Sandbox
78+
3. Add `.openenv/validation-report.json` and upload the validated revision
7979

8080
### Prerequisites
8181

8282
- Authenticate with Hugging Face: The command will prompt for login if not already authenticated
8383

8484
### Options
8585

86-
- `--directory`, `-d`: Directory containing the OpenEnv environment (defaults to current directory)
86+
- Positional `directory`: Directory containing the OpenEnv environment (defaults to current directory)
8787
- `--repo-id`, `-r`: Repository ID in format 'username/repo-name' (defaults to 'username/env-name' from openenv.yaml)
8888
- `--base-image`, `-b`: Base Docker image to use (overrides Dockerfile FROM)
8989
- `--private`: Deploy the space as private (default: public)

0 commit comments

Comments
 (0)