from fastapi import FastAPI from fastapi.responses import HTMLResponse from env.openenv_wrapper import ConflictArbitrationEnv from pydantic import BaseModel app = FastAPI(title="Conflict Arbitration Environment") env = ConflictArbitrationEnv() HOMEPAGE = """
| GET /health | liveness check | returns status + env name |
| POST /reset | start a new episode | returns spec + Agent A/B outputs |
| POST /step | submit Agent C decision | returns reward + merge result |
| GET /state | full episode ground truth | logging/debug only |
| GET /docs | interactive OpenAPI UI | try every endpoint live |
curl https://testingaccc-conflict-arbitration-env.hf.space/health
curl -X POST https://testingaccc-conflict-arbitration-env.hf.space/reset
curl -X POST https://testingaccc-conflict-arbitration-env.hf.space/step \\
-H "Content-Type: application/json" \\
-d '{"conflict_detected": true, "action": "stop_a",
"reason": "A drifted", "correction_request": "use canonical name"}'
{
"conflict_detected": true | false,
"action": "stop_a" | "stop_b" | "nothing",
"reason": "one sentence describing the conflict",
"correction_request": "specific instruction to the stopped agent"
}