Open
Conversation
Contributor
Greptile SummaryThis PR adds runtime validation to the Major changes:
Alignment with principles:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[openenv validate] --> B{Target type?}
B -->|URL / --url flag| C[validate_running_environment]
B -->|Local path| D[validate_multi_mode_deployment]
C --> C1[Check /openapi.json]
C1 --> C2[Check /health]
C2 --> C3[Check /metadata]
C3 --> C4[Check /schema]
C4 --> C5[Check /mcp]
C5 --> C6{Has /reset endpoint?}
C6 -->|Yes| C7[Mode: simulation<br/>Expect /step, /state]
C6 -->|No| C8[Mode: production<br/>Expect no /step, /state]
C7 --> C9[Generate JSON report]
C8 --> C9
D --> D1[Check pyproject.toml]
D1 --> D2[Check uv.lock]
D2 --> D3[Check server/app.py]
D3 --> D4[Check dependencies]
D4 --> D5{--json flag?}
D5 -->|Yes| D6[Output JSON report]
D5 -->|No| D7[Output text report]
C9 --> E[Exit with status]
D6 --> E
D7 --> E
Last reviewed commit: 4709978 |
wukaixingxp
requested changes
Feb 27, 2026
Contributor
wukaixingxp
left a comment
There was a problem hiding this comment.
was able to run this and got some results. I wonder if we can have a summary section where it shows x / Y test passed, failure: openapi_version_available False, mcp_endpoint False so users can easily see the gaps:
(base) ➜ OpenEnv git:(validate-in-cli) ✗ openenv validate https://openenv-wordle.hf.space
{
"target": "https://openenv-wordle.hf.space",
"validation_type": "running_environment",
"standard_version": "1.0.0",
"standard_profile": "openenv-http/1.x",
"mode": "simulation",
"passed": false,
"criteria": [
{
"id": "openapi_version_available",
"description": "GET /openapi.json returns OpenAPI info.version",
"passed": true,
"required": true,
"expected": {
"status_code": 200,
"info.version": "string"
},
"actual": {
"status_code": 200,
"info.version": "1.0.0"
}
},
{
"id": "health_endpoint",
"description": "GET /health returns healthy status",
"passed": true,
"required": true,
"expected": {
"status_code": 200,
"status": "healthy"
},
"actual": {
"status_code": 200,
"status": "healthy"
}
},
{
"id": "metadata_endpoint",
"description": "GET /metadata returns name and description",
"passed": true,
"required": true,
"expected": {
"status_code": 200,
"fields": [
"name",
"description"
]
},
"actual": {
"status_code": 200,
"name": "TextArenaEnvironment",
"description": "TextArenaEnvironment environment"
}
},
{
"id": "schema_endpoint",
"description": "GET /schema returns action, observation, and state schemas",
"passed": true,
"required": true,
"expected": {
"status_code": 200,
"fields": [
"action",
"observation",
"state"
]
},
"actual": {
"status_code": 200,
"has_action": true,
"has_observation": true,
"has_state": true
}
},
{
"id": "mcp_endpoint",
"description": "POST /mcp is reachable and returns JSON-RPC payload",
"passed": false,
"required": true,
"expected": {
"status_code": 200,
"jsonrpc": "2.0"
},
"actual": {
"status_code": 404,
"jsonrpc": null
}
},
{
"id": "mode_endpoint_consistency",
"description": "OpenAPI endpoint set matches OpenEnv mode contract",
"passed": true,
"required": true,
"expected": {
"/reset": true,
"/step": true,
"/state": true
},
"actual": {
"/reset": true,
"/step": true,
"/state": true
}
}
]
}
(base) ➜ OpenEnv git:(validate-in-cli) ✗ openenv validate https://huggingface.co/spaces/wukaixingxp/coding-env-test
{
"target": "https://huggingface.co/spaces/wukaixingxp/coding-env-test",
"validation_type": "running_environment",
"standard_version": "unknown",
"standard_profile": "openenv-http/unknown",
"mode": "unknown",
"passed": false,
"criteria": [
{
"id": "openapi_version_available",
"description": "GET /openapi.json returns OpenAPI info.version",
"passed": false,
"required": true,
"details": "Response missing required OpenAPI info.version field",
"expected": {
"status_code": 200,
"info.version": "string"
},
"actual": {
"status_code": 400,
"body_type": "non_json"
}
},
{
"id": "health_endpoint",
"description": "GET /health returns healthy status",
"passed": false,
"required": true,
"expected": {
"status_code": 200,
"status": "healthy"
},
"actual": {
"status_code": 404,
"status": null
}
},
{
"id": "metadata_endpoint",
"description": "GET /metadata returns name and description",
"passed": false,
"required": true,
"expected": {
"status_code": 200,
"fields": [
"name",
"description"
]
},
"actual": {
"status_code": 404,
"name": null,
"description": null
}
},
{
"id": "schema_endpoint",
"description": "GET /schema returns action, observation, and state schemas",
"passed": false,
"required": true,
"expected": {
"status_code": 200,
"fields": [
"action",
"observation",
"state"
]
},
"actual": {
"status_code": 404,
"has_action": false,
"has_observation": false,
"has_state": false
}
},
{
"id": "mcp_endpoint",
"description": "POST /mcp is reachable and returns JSON-RPC payload",
"passed": false,
"required": true,
"expected": {
"status_code": 200,
"jsonrpc": "2.0"
},
"actual": {
"status_code": 404,
"jsonrpc": null
}
},
{
"id": "mode_endpoint_consistency",
"description": "OpenAPI endpoint set matches OpenEnv mode contract",
"passed": false,
"required": true,
"details": "Cannot determine mode without OpenAPI paths",
"expected": {
"openapi.paths": "present"
},
"actual": {
"openapi.paths": "missing"
}
}
]
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a validation feature to the cli which works like this:
output
{ "target": "https://openenv-wordle.hf.space", "validation_type": "running_environment", "standard_version": "1.0.0", "standard_profile": "openenv-http/1.x", "mode": "simulation", "passed": false, "criteria": [ { "id": "openapi_version_available", "description": "GET /openapi.json returns OpenAPI info.version", "passed": true, "required": true, "expected": { "status_code": 200, "info.version": "string" }, "actual": { "status_code": 200, "info.version": "1.0.0" } }, { "id": "health_endpoint", "description": "GET /health returns healthy status", "passed": true, "required": true, "expected": { "status_code": 200, "status": "healthy" }, "actual": { "status_code": 200, "status": "healthy" } }, { "id": "metadata_endpoint", "description": "GET /metadata returns name and description", "passed": true, "required": true, "expected": { "status_code": 200, "fields": [ "name", "description" ] }, "actual": { "status_code": 200, "name": "TextArenaEnvironment", "description": "TextArenaEnvironment environment" } }, { "id": "schema_endpoint", "description": "GET /schema returns action, observation, and state schemas", "passed": true, "required": true, "expected": { "status_code": 200, "fields": [ "action", "observation", "state" ] }, "actual": { "status_code": 200, "has_action": true, "has_observation": true, "has_state": true } }, { "id": "mcp_endpoint", "description": "POST /mcp is reachable and returns JSON-RPC payload", "passed": false, "required": true, "expected": { "status_code": 200, "jsonrpc": "2.0" }, "actual": { "status_code": 404, "jsonrpc": null } }, { "id": "mode_endpoint_consistency", "description": "OpenAPI endpoint set matches OpenEnv mode contract", "passed": true, "required": true, "expected": { "/reset": true, "/step": true, "/state": true }, "actual": { "/reset": true, "/step": true, "/state": true } } ] }Type of Change
Alignment Checklist
Before submitting, verify:
.claude/docs/PRINCIPLES.mdand this PR aligns with our principles.claude/docs/INVARIANTS.mdand no invariants are violated/pre-submit-pr(orbash .claude/hooks/lint.shand tests) and addressed all issuesRFC Status
Test Plan
Claude Code Review