""" FastAPI application for the Shopify Store Audit & Remediation Environment. Endpoints: POST /reset - Reset the environment (accepts task selection) POST /step - Execute an action GET /state - Get current environment state GET /schema - Get action/observation schemas WS /ws - WebSocket for persistent sessions """ try: from openenv.core.env_server.http_server import create_app except Exception as e: raise ImportError( "openenv is required. Install with: pip install openenv-core[core]" ) from e try: from ..models import ShopifyStoreAuditAction, ShopifyStoreAuditObservation from .shopify_store_audit_environment import ShopifyStoreAuditEnvironment except ImportError: from models import ShopifyStoreAuditAction, ShopifyStoreAuditObservation from server.shopify_store_audit_environment import ShopifyStoreAuditEnvironment from fastapi.responses import HTMLResponse, JSONResponse try: from .tasks import ALL_TASKS except ImportError: from server.tasks import ALL_TASKS try: from .graders import grade_product_listing_qa, grade_seo_collection_optimization, grade_full_store_audit except ImportError: from server.graders import grade_product_listing_qa, grade_seo_collection_optimization, grade_full_store_audit GRADER_MAP = { "product_listing_qa": grade_product_listing_qa, "seo_collection_optimization": grade_seo_collection_optimization, "full_store_audit": grade_full_store_audit, } app = create_app( ShopifyStoreAuditEnvironment, ShopifyStoreAuditAction, ShopifyStoreAuditObservation, env_name="shopify_store_audit", max_concurrent_envs=2, ) LANDING_HTML = """
RL environment with real Shopify product data — 45 products, 184 discoverable issues, shaped rewards
8 issues 路 25 steps
Issues listed with suggested commands. Agent fills in params.
12 issues 路 35 steps
Issue descriptions shown. Agent picks commands & params.
20 issues 路 50 steps
Only category counts. Agent must discover issues itself.
/health — health check/tasks — enumerate tasks & graders/reset — reset (body: {})/step — action (body: {"action":{"command":"...","params":{}}})/state — current state/schema — action/observation schemas/grade — run grader on sample/ws — persistent WebSocket session