sre-incident-responder / openapi.json
kaori02's picture
feat: SRE OpenEnv submission
0a0941a
{
"openapi": "3.1.0",
"info": {
"title": "SRE OpenEnv - Infrastructure Incident Responder",
"description": "An OpenEnv-compatible environment simulating a microservice cluster with real Redis and MariaDB backends. Agents diagnose and resolve infrastructure incidents across 3 difficulty tiers.",
"version": "1.0.0"
},
"paths": {
"/reset": {
"post": {
"summary": "Reset",
"description": "Reset the environment for a specific task.",
"operationId": "reset_reset_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ResetRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EnvironmentState"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/step": {
"post": {
"summary": "Step",
"description": "Execute an action in the environment.",
"operationId": "step_step_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/StepRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Observation"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/state": {
"get": {
"summary": "State",
"description": "Get the current environment state.",
"operationId": "state_state_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EnvironmentState"
}
}
}
}
}
}
},
"/tasks": {
"get": {
"summary": "Tasks",
"description": "List all available tasks.",
"operationId": "tasks_tasks_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/TaskInfo"
},
"type": "array",
"title": "Response Tasks Tasks Get"
}
}
}
}
}
}
},
"/grader": {
"post": {
"summary": "Grader",
"description": "Grade the current episode for a task using live health checks.",
"operationId": "grader_grader_post",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GraderRequest"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/GraderResult"
}
}
}
},
"422": {
"description": "Validation Error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/HTTPValidationError"
}
}
}
}
}
}
},
"/baseline": {
"get": {
"summary": "Baseline",
"description": "Run the built-in baseline agent on all tasks and return results.",
"operationId": "baseline_baseline_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/BaselineResult"
},
"type": "array",
"title": "Response Baseline Baseline Get"
}
}
}
}
}
}
},
"/health": {
"get": {
"summary": "Health",
"description": "Health check endpoint.",
"operationId": "health_health_get",
"responses": {
"200": {
"description": "Successful Response",
"content": {
"application/json": {
"schema": {
"additionalProperties": true,
"type": "object",
"title": "Response Health Health Get"
}
}
}
}
}
}
}
},
"components": {
"schemas": {
"Action": {
"properties": {
"action_type": {
"$ref": "#/components/schemas/ActionType"
},
"target_service": {
"anyOf": [
{
"$ref": "#/components/schemas/ServiceName"
},
{
"type": "null"
}
]
},
"parameters": {
"additionalProperties": true,
"type": "object",
"title": "Parameters"
}
},
"type": "object",
"required": [
"action_type"
],
"title": "Action",
"description": "An action the agent can take in the environment."
},
"ActionType": {
"type": "string",
"enum": [
"check_health",
"check_logs",
"restart_service",
"analyze_logs",
"update_config",
"rollback_config",
"run_diagnostics",
"scale_service",
"nop"
],
"title": "ActionType",
"description": "Available agent actions."
},
"BaselineResult": {
"properties": {
"task_id": {
"type": "string",
"title": "Task Id"
},
"actions_taken": {
"items": {
"$ref": "#/components/schemas/Action"
},
"type": "array",
"title": "Actions Taken"
},
"final_reward": {
"type": "number",
"title": "Final Reward"
},
"passed": {
"type": "boolean",
"title": "Passed"
},
"steps_used": {
"type": "integer",
"title": "Steps Used"
}
},
"type": "object",
"required": [
"task_id",
"actions_taken",
"final_reward",
"passed",
"steps_used"
],
"title": "BaselineResult",
"description": "Result from running the baseline agent."
},
"EnvironmentState": {
"properties": {
"services": {
"items": {
"$ref": "#/components/schemas/ServiceState"
},
"type": "array",
"title": "Services"
},
"step_count": {
"type": "integer",
"title": "Step Count",
"default": 0
},
"max_steps": {
"type": "integer",
"title": "Max Steps",
"default": 50
},
"total_reward": {
"type": "number",
"title": "Total Reward",
"default": 0.0
},
"done": {
"type": "boolean",
"title": "Done",
"default": false
},
"task_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Task Id"
}
},
"type": "object",
"required": [
"services"
],
"title": "EnvironmentState",
"description": "Full observable state of the SRE environment."
},
"GraderRequest": {
"properties": {
"task_id": {
"type": "string",
"title": "Task Id"
}
},
"type": "object",
"required": [
"task_id"
],
"title": "GraderRequest",
"description": "Request body for /grader."
},
"GraderResult": {
"properties": {
"task_id": {
"type": "string",
"title": "Task Id"
},
"passed": {
"type": "boolean",
"title": "Passed"
},
"score": {
"type": "number",
"maximum": 1.0,
"minimum": 0.0,
"title": "Score"
},
"message": {
"type": "string",
"title": "Message"
},
"details": {
"additionalProperties": true,
"type": "object",
"title": "Details"
}
},
"type": "object",
"required": [
"task_id",
"passed",
"score",
"message"
],
"title": "GraderResult",
"description": "Result from the grading function."
},
"HTTPValidationError": {
"properties": {
"detail": {
"items": {
"$ref": "#/components/schemas/ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
},
"Observation": {
"properties": {
"message": {
"type": "string",
"title": "Message"
},
"data": {
"additionalProperties": true,
"type": "object",
"title": "Data"
},
"success": {
"type": "boolean",
"title": "Success",
"default": true
},
"reward": {
"type": "number",
"title": "Reward",
"default": 0.0
}
},
"type": "object",
"required": [
"message"
],
"title": "Observation",
"description": "An observation returned after taking an action."
},
"ResetRequest": {
"properties": {
"task_id": {
"type": "string",
"title": "Task Id"
}
},
"type": "object",
"required": [
"task_id"
],
"title": "ResetRequest",
"description": "Request body for /reset."
},
"ServiceName": {
"type": "string",
"enum": [
"gateway",
"auth",
"payment",
"database"
],
"title": "ServiceName",
"description": "Names of microservices in the cluster."
},
"ServiceState": {
"properties": {
"name": {
"$ref": "#/components/schemas/ServiceName"
},
"status": {
"$ref": "#/components/schemas/ServiceStatus"
},
"uptime_seconds": {
"type": "integer",
"title": "Uptime Seconds",
"default": 0
},
"error_count": {
"type": "integer",
"title": "Error Count",
"default": 0
},
"last_error": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Last Error"
},
"config": {
"additionalProperties": true,
"type": "object",
"title": "Config"
}
},
"type": "object",
"required": [
"name",
"status"
],
"title": "ServiceState",
"description": "State of a single microservice."
},
"ServiceStatus": {
"type": "string",
"enum": [
"healthy",
"degraded",
"down",
"oom"
],
"title": "ServiceStatus",
"description": "Status of a microservice."
},
"StepRequest": {
"properties": {
"action": {
"$ref": "#/components/schemas/Action"
}
},
"type": "object",
"required": [
"action"
],
"title": "StepRequest",
"description": "Request body for /step."
},
"TaskInfo": {
"properties": {
"id": {
"type": "string",
"title": "Id"
},
"name": {
"type": "string",
"title": "Name"
},
"description": {
"type": "string",
"title": "Description"
},
"difficulty": {
"type": "string",
"title": "Difficulty"
},
"max_steps": {
"type": "integer",
"title": "Max Steps"
},
"tags": {
"items": {
"type": "string"
},
"type": "array",
"title": "Tags"
}
},
"type": "object",
"required": [
"id",
"name",
"description",
"difficulty",
"max_steps"
],
"title": "TaskInfo",
"description": "Metadata about an SRE task."
},
"ValidationError": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
},
"input": {
"title": "Input"
},
"ctx": {
"type": "object",
"title": "Context"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
}
}
}
}