rawknee-69 commited on
Commit
9d7a42e
·
1 Parent(s): 9237ddb

here you go

Browse files
.gitignore CHANGED
@@ -5,3 +5,4 @@ __pycache__/
5
  docs/
6
  AGENTS.md
7
  .cursor/
 
 
5
  docs/
6
  AGENTS.md
7
  .cursor/
8
+ .env
Dockerfile CHANGED
@@ -19,7 +19,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
19
 
20
  ENV PYTHONPATH="/app/env:$PYTHONPATH"
21
  ENV PATH="/app/env/.venv/bin:$PATH"
22
- ENV WORKERS=4
23
  ENV MAX_CONCURRENT_ENVS=100
24
 
25
  EXPOSE 7860
 
19
 
20
  ENV PYTHONPATH="/app/env:$PYTHONPATH"
21
  ENV PATH="/app/env/.venv/bin:$PATH"
22
+ ENV WORKERS=1
23
  ENV MAX_CONCURRENT_ENVS=100
24
 
25
  EXPOSE 7860
README.md CHANGED
@@ -115,10 +115,26 @@ uv run uvicorn incident_ops_env.server.app:app --port 7860
115
 
116
  ### Docker
117
  ```bash
118
- docker build -f incident_ops_env/server/Dockerfile -t incident-ops-env .
119
  docker run -p 7860:7860 incident-ops-env
120
  ```
121
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  ### Client Usage
123
  ```python
124
  from incident_ops_env import IncidentAction, IncidentOpsEnv
@@ -152,6 +168,20 @@ If Docker is unavailable in your shell session, skip that check:
152
  .venv/bin/python scripts/phase_readiness.py --runs 3 --skip-docker
153
  ```
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  ## Baseline Scores
156
  Scripted deterministic baseline (`BASELINE_PROVIDER=scripted`) reproducibly reports:
157
 
 
115
 
116
  ### Docker
117
  ```bash
118
+ docker build -f Dockerfile -t incident-ops-env .
119
  docker run -p 7860:7860 incident-ops-env
120
  ```
121
 
122
+ ### Gradio Observability UI
123
+
124
+ The app exposes a Gradio UI at `/ui` with:
125
+
126
+ - Episode runner (reset/step/state)
127
+ - Task and grader explorer
128
+ - Baseline trigger/inspection
129
+ - Live metrics monitor (`/metrics` + `/ws/metrics`)
130
+ - Scenario upload and validation tools
131
+
132
+ When running locally:
133
+
134
+ ```bash
135
+ open http://localhost:7860/ui
136
+ ```
137
+
138
  ### Client Usage
139
  ```python
140
  from incident_ops_env import IncidentAction, IncidentOpsEnv
 
168
  .venv/bin/python scripts/phase_readiness.py --runs 3 --skip-docker
169
  ```
170
 
171
+ For deployed HF Space smoke checks:
172
+
173
+ ```bash
174
+ .venv/bin/python scripts/phase_readiness.py --runs 3 --space-url "https://<your-space>.hf.space"
175
+ ```
176
+
177
+ ### HF Smoke Test Commands
178
+
179
+ ```bash
180
+ curl -sS https://<your-space>.hf.space/health
181
+ curl -sS https://<your-space>.hf.space/tasks
182
+ curl -sS -X POST https://<your-space>.hf.space/reset -H "content-type: application/json" -d '{"task_id":1,"seed":42}'
183
+ ```
184
+
185
  ## Baseline Scores
186
  Scripted deterministic baseline (`BASELINE_PROVIDER=scripted`) reproducibly reports:
187
 
incident_ops_env/server/Dockerfile CHANGED
@@ -19,7 +19,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
19
 
20
  ENV PYTHONPATH="/app/env:$PYTHONPATH"
21
  ENV PATH="/app/env/.venv/bin:$PATH"
22
- ENV WORKERS=4
23
  ENV MAX_CONCURRENT_ENVS=100
24
 
25
  EXPOSE 7860
 
19
 
20
  ENV PYTHONPATH="/app/env:$PYTHONPATH"
21
  ENV PATH="/app/env/.venv/bin:$PATH"
22
+ ENV WORKERS=1
23
  ENV MAX_CONCURRENT_ENVS=100
24
 
25
  EXPOSE 7860
incident_ops_env/server/app.py CHANGED
@@ -1,19 +1,27 @@
1
  from __future__ import annotations
2
 
 
3
  import json
4
  import time
5
  import uuid
6
  from pathlib import Path
7
  from typing import Any, Literal
8
 
 
9
  from fastapi import FastAPI, Header, HTTPException, Request, WebSocket, WebSocketDisconnect
10
  from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
11
  from pydantic import BaseModel, Field
12
 
13
  import baseline as baseline_runner
14
  from incident_ops_env.models import IncidentAction, IncidentObservation
15
- from incident_ops_env.server.metrics import metrics
 
 
 
 
 
16
  from incident_ops_env.server.session_manager import SessionManager
 
17
 
18
 
19
  app = FastAPI(title="IncidentOpsEnv", version="1.0.0")
@@ -49,11 +57,25 @@ class GraderRequest(BaseModel):
49
  session_id: str = Field(min_length=1)
50
 
51
 
 
 
 
 
52
  @app.middleware("http")
53
  async def metrics_middleware(request: Request, call_next):
54
  start = time.time()
55
  response = await call_next(request)
56
- metrics.record_request(request.url.path, (time.time() - start) * 1000)
 
 
 
 
 
 
 
 
 
 
57
  return response
58
 
59
 
@@ -129,8 +151,22 @@ async def tasks() -> dict:
129
  @app.post("/reset")
130
  async def reset(payload: ResetRequest, x_session_id: str | None = Header(default=None, alias="X-Session-ID")) -> ResetResponse:
131
  session_id, env = session_manager.create_or_get_session(x_session_id)
132
- obs = env.reset(task_id=payload.task_id, scenario_id=payload.scenario_id, seed=payload.seed)
 
 
 
 
 
133
  metrics.record_episode_start(session_id, payload.task_id)
 
 
 
 
 
 
 
 
 
134
  return ResetResponse(observation=obs, session_id=session_id)
135
 
136
 
@@ -142,10 +178,35 @@ async def step(payload: StepRequest, x_session_id: str | None = Header(default=N
142
  if env is None:
143
  raise HTTPException(status_code=404, detail="Unknown session_id. Call /reset first.")
144
  action = payload.action
145
- result = env.step(action)
 
 
 
146
  metrics.record_step(x_session_id, action.action_type.value, result.reward, result.observation.last_action_was_valid)
 
 
 
 
 
 
 
 
 
 
 
147
  if result.done:
148
- metrics.record_episode_end(x_session_id, env.grade(), env.step_number)
 
 
 
 
 
 
 
 
 
 
 
149
  return {
150
  "observation": result.observation.model_dump(),
151
  "reward": result.reward,
@@ -173,20 +234,64 @@ async def grader(payload: GraderRequest) -> dict[str, Any]:
173
  raise HTTPException(status_code=404, detail="Unknown session_id.")
174
  if not env.is_done:
175
  raise HTTPException(status_code=409, detail="Episode not complete. Finish episode before grading.")
176
- return {
177
- "score": env.grade(),
 
178
  "task_id": env.task_id,
179
  "episode_id": env.episode_id,
180
  "scenario_id": env.scenario_id,
181
  "breakdown": env.reward_breakdown,
182
  "grader_version": "1.0.0",
183
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
184
 
185
 
186
  @app.post("/baseline")
187
  async def baseline() -> dict:
188
  try:
189
- return baseline_runner.run_baseline_sync()
190
  except EnvironmentError as exc:
191
  raise HTTPException(status_code=503, detail="No LLM API key configured.") from exc
192
 
@@ -242,3 +347,26 @@ async def websocket_endpoint(websocket: WebSocket):
242
  await websocket.send_text(json.dumps({"type": "state_result", **env.state().model_dump()}))
243
  except WebSocketDisconnect:
244
  return
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from __future__ import annotations
2
 
3
+ import asyncio
4
  import json
5
  import time
6
  import uuid
7
  from pathlib import Path
8
  from typing import Any, Literal
9
 
10
+ import gradio as gr
11
  from fastapi import FastAPI, Header, HTTPException, Request, WebSocket, WebSocketDisconnect
12
  from fastapi.responses import HTMLResponse, JSONResponse, PlainTextResponse
13
  from pydantic import BaseModel, Field
14
 
15
  import baseline as baseline_runner
16
  from incident_ops_env.models import IncidentAction, IncidentObservation
17
+ from incident_ops_env.server.metrics import metrics, metrics_hub
18
+ from incident_ops_env.server.scenario_loader import (
19
+ list_scenarios_for_task,
20
+ registry,
21
+ validate_scenario_data,
22
+ )
23
  from incident_ops_env.server.session_manager import SessionManager
24
+ from ui import build_gradio_app
25
 
26
 
27
  app = FastAPI(title="IncidentOpsEnv", version="1.0.0")
 
57
  session_id: str = Field(min_length=1)
58
 
59
 
60
+ class ScenarioRequest(BaseModel):
61
+ scenario: dict[str, Any]
62
+
63
+
64
  @app.middleware("http")
65
  async def metrics_middleware(request: Request, call_next):
66
  start = time.time()
67
  response = await call_next(request)
68
+ latency_ms = (time.time() - start) * 1000
69
+ metrics.record_request(request.url.path, latency_ms)
70
+ await metrics_hub.publish(
71
+ {
72
+ "type": "request",
73
+ "path": request.url.path,
74
+ "method": request.method,
75
+ "latency_ms": round(latency_ms, 2),
76
+ "timestamp": time.time(),
77
+ }
78
+ )
79
  return response
80
 
81
 
 
151
  @app.post("/reset")
152
  async def reset(payload: ResetRequest, x_session_id: str | None = Header(default=None, alias="X-Session-ID")) -> ResetResponse:
153
  session_id, env = session_manager.create_or_get_session(x_session_id)
154
+ try:
155
+ obs = env.reset(task_id=payload.task_id, scenario_id=payload.scenario_id, seed=payload.seed)
156
+ except FileNotFoundError as exc:
157
+ raise HTTPException(status_code=404, detail=str(exc)) from exc
158
+ except ValueError as exc:
159
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
160
  metrics.record_episode_start(session_id, payload.task_id)
161
+ await metrics_hub.publish(
162
+ {
163
+ "type": "episode_start",
164
+ "session_id": session_id,
165
+ "task_id": payload.task_id,
166
+ "scenario_id": env.scenario_id,
167
+ "timestamp": time.time(),
168
+ }
169
+ )
170
  return ResetResponse(observation=obs, session_id=session_id)
171
 
172
 
 
178
  if env is None:
179
  raise HTTPException(status_code=404, detail="Unknown session_id. Call /reset first.")
180
  action = payload.action
181
+ try:
182
+ result = env.step(action)
183
+ except RuntimeError as exc:
184
+ raise HTTPException(status_code=409, detail=str(exc)) from exc
185
  metrics.record_step(x_session_id, action.action_type.value, result.reward, result.observation.last_action_was_valid)
186
+ await metrics_hub.publish(
187
+ {
188
+ "type": "step",
189
+ "session_id": x_session_id,
190
+ "action_type": action.action_type.value,
191
+ "reward": result.reward,
192
+ "done": result.done,
193
+ "valid": result.observation.last_action_was_valid,
194
+ "timestamp": time.time(),
195
+ }
196
+ )
197
  if result.done:
198
+ episode_score = env.grade()
199
+ metrics.record_episode_end(x_session_id, episode_score, env.step_number)
200
+ await metrics_hub.publish(
201
+ {
202
+ "type": "episode_end",
203
+ "session_id": x_session_id,
204
+ "task_id": env.task_id,
205
+ "score": episode_score,
206
+ "steps": env.step_number,
207
+ "timestamp": time.time(),
208
+ }
209
+ )
210
  return {
211
  "observation": result.observation.model_dump(),
212
  "reward": result.reward,
 
234
  raise HTTPException(status_code=404, detail="Unknown session_id.")
235
  if not env.is_done:
236
  raise HTTPException(status_code=409, detail="Episode not complete. Finish episode before grading.")
237
+ score = env.grade()
238
+ grader_payload = {
239
+ "score": score,
240
  "task_id": env.task_id,
241
  "episode_id": env.episode_id,
242
  "scenario_id": env.scenario_id,
243
  "breakdown": env.reward_breakdown,
244
  "grader_version": "1.0.0",
245
  }
246
+ await metrics_hub.publish(
247
+ {
248
+ "type": "grader",
249
+ "session_id": session_id,
250
+ "task_id": env.task_id,
251
+ "score": score,
252
+ "timestamp": time.time(),
253
+ }
254
+ )
255
+ return grader_payload
256
+
257
+
258
+ @app.get("/scenarios")
259
+ async def scenarios() -> dict[str, Any]:
260
+ built_in: dict[str, list[str]] = {}
261
+ for task_id in (1, 2, 3):
262
+ built_in[f"task_{task_id}"] = [item["scenario_id"] for item in list_scenarios_for_task(task_id, include_uploaded=False)]
263
+ return {
264
+ "built_in": built_in,
265
+ "uploaded": registry.list_uploaded_ids(),
266
+ }
267
+
268
+
269
+ @app.post("/scenarios/validate")
270
+ async def validate_scenario(payload: ScenarioRequest) -> dict[str, Any]:
271
+ scenario = validate_scenario_data(payload.scenario)
272
+ return {
273
+ "valid": True,
274
+ "scenario_id": scenario["scenario_id"],
275
+ "task_id": scenario["task_id"],
276
+ }
277
+
278
+
279
+ @app.post("/scenarios/upload")
280
+ async def upload_scenario(payload: ScenarioRequest) -> dict[str, Any]:
281
+ scenario = validate_scenario_data(payload.scenario)
282
+ path = registry.save_uploaded_scenario(scenario)
283
+ return {
284
+ "uploaded": True,
285
+ "scenario_id": scenario["scenario_id"],
286
+ "task_id": scenario["task_id"],
287
+ "path": str(path),
288
+ }
289
 
290
 
291
  @app.post("/baseline")
292
  async def baseline() -> dict:
293
  try:
294
+ return await baseline_runner.run_baseline()
295
  except EnvironmentError as exc:
296
  raise HTTPException(status_code=503, detail="No LLM API key configured.") from exc
297
 
 
347
  await websocket.send_text(json.dumps({"type": "state_result", **env.state().model_dump()}))
348
  except WebSocketDisconnect:
349
  return
350
+
351
+
352
+ @app.websocket("/ws/metrics")
353
+ async def metrics_websocket_endpoint(websocket: WebSocket):
354
+ await websocket.accept()
355
+ queue = metrics_hub.subscribe()
356
+ try:
357
+ while True:
358
+ try:
359
+ event = await asyncio.wait_for(queue.get(), timeout=1.0)
360
+ await websocket.send_text(json.dumps(event))
361
+ except asyncio.TimeoutError:
362
+ await websocket.send_text(
363
+ json.dumps({"type": "snapshot", "timestamp": time.time(), "payload": metrics.snapshot()})
364
+ )
365
+ except WebSocketDisconnect:
366
+ return
367
+ finally:
368
+ metrics_hub.unsubscribe(queue)
369
+
370
+
371
+ gradio_demo = build_gradio_app()
372
+ app = gr.mount_gradio_app(app, gradio_demo, path="/ui")
incident_ops_env/server/environment.py CHANGED
@@ -54,7 +54,11 @@ class IncidentOpsEnvironment:
54
  if seed is not None:
55
  random.seed(seed)
56
 
57
- scenario = load_scenario_by_id(scenario_id) if scenario_id else random.choice(list_scenarios_for_task(task_id))
 
 
 
 
58
  self.current_scenario = deepcopy(scenario)
59
  self.episode_id = str(uuid.uuid4())
60
  self.task_id = task_id
 
54
  if seed is not None:
55
  random.seed(seed)
56
 
57
+ scenario = (
58
+ load_scenario_by_id(scenario_id, expected_task_id=task_id)
59
+ if scenario_id
60
+ else random.choice(list_scenarios_for_task(task_id))
61
+ )
62
  self.current_scenario = deepcopy(scenario)
63
  self.episode_id = str(uuid.uuid4())
64
  self.task_id = task_id
incident_ops_env/server/llm_provider.py CHANGED
@@ -29,7 +29,7 @@ class OpenAIProvider(LLMProvider):
29
 
30
 
31
  class GeminiProvider(LLMProvider):
32
- def __init__(self, model: str = "gemini-2.0-flash"):
33
  import google.generativeai as genai
34
 
35
  genai.configure(api_key=os.environ["GEMINI_API_KEY"])
 
29
 
30
 
31
  class GeminiProvider(LLMProvider):
32
+ def __init__(self, model: str = "gemini-2.5-flash"):
33
  import google.generativeai as genai
34
 
35
  genai.configure(api_key=os.environ["GEMINI_API_KEY"])
incident_ops_env/server/metrics.py CHANGED
@@ -3,6 +3,7 @@ from __future__ import annotations
3
  import threading
4
  import time
5
  from collections import defaultdict, deque
 
6
 
7
 
8
  class IncidentMetrics:
@@ -114,4 +115,29 @@ class IncidentMetrics:
114
  }
115
 
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  metrics = IncidentMetrics()
 
 
3
  import threading
4
  import time
5
  from collections import defaultdict, deque
6
+ from asyncio import Queue
7
 
8
 
9
  class IncidentMetrics:
 
115
  }
116
 
117
 
118
+ class LiveMetricsHub:
119
+ def __init__(self) -> None:
120
+ self._lock = threading.Lock()
121
+ self._subscribers: set[Queue] = set()
122
+
123
+ def subscribe(self) -> Queue:
124
+ queue: Queue = Queue(maxsize=200)
125
+ with self._lock:
126
+ self._subscribers.add(queue)
127
+ return queue
128
+
129
+ def unsubscribe(self, queue: Queue) -> None:
130
+ with self._lock:
131
+ self._subscribers.discard(queue)
132
+
133
+ async def publish(self, event: dict) -> None:
134
+ with self._lock:
135
+ subscribers = list(self._subscribers)
136
+ for queue in subscribers:
137
+ if queue.full():
138
+ _ = queue.get_nowait()
139
+ queue.put_nowait(event)
140
+
141
+
142
  metrics = IncidentMetrics()
143
+ metrics_hub = LiveMetricsHub()
incident_ops_env/server/scenario_loader.py CHANGED
@@ -4,8 +4,11 @@ import json
4
  from pathlib import Path
5
  from typing import Any
6
 
 
 
7
 
8
  SCENARIO_DIR = Path(__file__).resolve().parents[1] / "scenarios"
 
9
 
10
 
11
  def _validate_common_scenario(scenario: dict[str, Any]) -> None:
@@ -21,26 +24,79 @@ def _validate_common_scenario(scenario: dict[str, Any]) -> None:
21
  raise ValueError("ground_truth must be an object.")
22
 
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  def load_scenario_file(path: Path) -> dict[str, Any]:
25
  data = json.loads(path.read_text(encoding="utf-8"))
26
- _validate_common_scenario(data)
27
- return data
28
 
29
 
30
- def load_scenario_by_id(scenario_id: str) -> dict[str, Any]:
31
  path = SCENARIO_DIR / f"{scenario_id}.json"
32
- if not path.exists():
33
- raise FileNotFoundError(f"Scenario file not found: {path.name}")
34
- return load_scenario_file(path)
 
 
 
35
 
36
 
37
- def list_scenarios_for_task(task_id: int) -> list[dict[str, Any]]:
38
  if task_id not in (1, 2, 3):
39
  raise ValueError("task_id must be 1, 2, or 3.")
40
  prefix = f"task{task_id}_"
41
  scenarios: list[dict[str, Any]] = []
42
  for path in sorted(SCENARIO_DIR.glob(f"{prefix}*.json")):
43
  scenarios.append(load_scenario_file(path))
 
 
 
 
 
 
 
 
44
  if not scenarios:
45
  raise FileNotFoundError(f"No scenarios found for task_id={task_id}.")
46
  return scenarios
 
4
  from pathlib import Path
5
  from typing import Any
6
 
7
+ from incident_ops_env.server.scenario_registry import ScenarioRegistry
8
+
9
 
10
  SCENARIO_DIR = Path(__file__).resolve().parents[1] / "scenarios"
11
+ registry = ScenarioRegistry()
12
 
13
 
14
  def _validate_common_scenario(scenario: dict[str, Any]) -> None:
 
24
  raise ValueError("ground_truth must be an object.")
25
 
26
 
27
+ def _validate_task_specific(scenario: dict[str, Any]) -> None:
28
+ task_id = scenario["task_id"]
29
+ ground_truth = scenario["ground_truth"]
30
+ if task_id == 1:
31
+ required = {"severity", "service", "pattern_type"}
32
+ missing = required - set(ground_truth.keys())
33
+ if missing:
34
+ raise ValueError(f"Task 1 ground_truth missing keys: {sorted(missing)}")
35
+ return
36
+ if task_id == 2:
37
+ if "log_database" not in scenario or not isinstance(scenario["log_database"], dict):
38
+ raise ValueError("Task 2 scenario requires log_database object.")
39
+ if "metric_database" not in scenario or not isinstance(scenario["metric_database"], dict):
40
+ raise ValueError("Task 2 scenario requires metric_database object.")
41
+ required = {"root_cause_service", "correct_mitigation_command", "relevant_metrics"}
42
+ missing = required - set(ground_truth.keys())
43
+ if missing:
44
+ raise ValueError(f"Task 2 ground_truth missing keys: {sorted(missing)}")
45
+ return
46
+ if task_id == 3:
47
+ if "runbook" not in scenario or not isinstance(scenario["runbook"], list) or not scenario["runbook"]:
48
+ raise ValueError("Task 3 scenario requires non-empty runbook list.")
49
+ required = {
50
+ "correct_escalation_team",
51
+ "required_postmortem_keywords",
52
+ "steps_that_should_complete",
53
+ "step_that_should_escalate",
54
+ }
55
+ missing = required - set(ground_truth.keys())
56
+ if missing:
57
+ raise ValueError(f"Task 3 ground_truth missing keys: {sorted(missing)}")
58
+
59
+
60
+ def validate_scenario_data(scenario: dict[str, Any], expected_task_id: int | None = None) -> dict[str, Any]:
61
+ _validate_common_scenario(scenario)
62
+ _validate_task_specific(scenario)
63
+ if expected_task_id is not None and scenario["task_id"] != expected_task_id:
64
+ raise ValueError(
65
+ f"Scenario task_id={scenario['task_id']} does not match requested task_id={expected_task_id}."
66
+ )
67
+ return scenario
68
+
69
+
70
  def load_scenario_file(path: Path) -> dict[str, Any]:
71
  data = json.loads(path.read_text(encoding="utf-8"))
72
+ return validate_scenario_data(data)
 
73
 
74
 
75
+ def load_scenario_by_id(scenario_id: str, expected_task_id: int | None = None) -> dict[str, Any]:
76
  path = SCENARIO_DIR / f"{scenario_id}.json"
77
+ if path.exists():
78
+ return validate_scenario_data(load_scenario_file(path), expected_task_id=expected_task_id)
79
+ uploaded_path = registry.get_uploaded_path(scenario_id)
80
+ if uploaded_path is not None:
81
+ return validate_scenario_data(load_scenario_file(uploaded_path), expected_task_id=expected_task_id)
82
+ raise FileNotFoundError(f"Scenario file not found: {scenario_id}.json")
83
 
84
 
85
+ def list_scenarios_for_task(task_id: int, include_uploaded: bool = False) -> list[dict[str, Any]]:
86
  if task_id not in (1, 2, 3):
87
  raise ValueError("task_id must be 1, 2, or 3.")
88
  prefix = f"task{task_id}_"
89
  scenarios: list[dict[str, Any]] = []
90
  for path in sorted(SCENARIO_DIR.glob(f"{prefix}*.json")):
91
  scenarios.append(load_scenario_file(path))
92
+ if include_uploaded:
93
+ for scenario_id in registry.list_uploaded_ids():
94
+ uploaded_path = registry.get_uploaded_path(scenario_id)
95
+ if uploaded_path is None:
96
+ continue
97
+ scenario = load_scenario_file(uploaded_path)
98
+ if scenario["task_id"] == task_id:
99
+ scenarios.append(scenario)
100
  if not scenarios:
101
  raise FileNotFoundError(f"No scenarios found for task_id={task_id}.")
102
  return scenarios
incident_ops_env/server/scenario_registry.py ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ import re
5
+ from pathlib import Path
6
+ from typing import Any
7
+
8
+
9
+ DEFAULT_UPLOAD_DIR = Path("/tmp/incident_ops_env_uploads")
10
+ SCENARIO_ID_RE = re.compile(r"^[a-zA-Z0-9_\-]{3,80}$")
11
+
12
+
13
+ class ScenarioRegistry:
14
+ def __init__(self, upload_dir: Path | None = None) -> None:
15
+ self.upload_dir = upload_dir or DEFAULT_UPLOAD_DIR
16
+ self.upload_dir.mkdir(parents=True, exist_ok=True)
17
+
18
+ def list_uploaded_ids(self) -> list[str]:
19
+ scenario_ids: list[str] = []
20
+ for path in sorted(self.upload_dir.glob("*.json")):
21
+ scenario_ids.append(path.stem)
22
+ return scenario_ids
23
+
24
+ def get_uploaded_path(self, scenario_id: str) -> Path | None:
25
+ if not SCENARIO_ID_RE.match(scenario_id):
26
+ return None
27
+ path = self.upload_dir / f"{scenario_id}.json"
28
+ if path.exists():
29
+ return path
30
+ return None
31
+
32
+ def save_uploaded_scenario(self, scenario: dict[str, Any]) -> Path:
33
+ scenario_id = str(scenario.get("scenario_id", ""))
34
+ if not SCENARIO_ID_RE.match(scenario_id):
35
+ raise ValueError(
36
+ "scenario_id must be 3-80 characters and use only letters, numbers, hyphen, underscore."
37
+ )
38
+ path = self.upload_dir / f"{scenario_id}.json"
39
+ path.write_text(json.dumps(scenario, indent=2), encoding="utf-8")
40
+ return path
pyproject.toml CHANGED
@@ -14,6 +14,7 @@ dependencies = [
14
  "openenv-core>=0.1.1",
15
  "websockets>=13.0",
16
  "prometheus-client>=0.21.0",
 
17
  ]
18
 
19
  [project.optional-dependencies]
 
14
  "openenv-core>=0.1.1",
15
  "websockets>=13.0",
16
  "prometheus-client>=0.21.0",
17
+ "gradio>=5.20.0",
18
  ]
19
 
20
  [project.optional-dependencies]
scripts/phase_readiness.py CHANGED
@@ -6,6 +6,7 @@ import os
6
  import subprocess
7
  from dataclasses import dataclass
8
 
 
9
  from fastapi.testclient import TestClient
10
 
11
  from baseline import run_baseline_sync
@@ -22,7 +23,7 @@ class CheckResult:
22
 
23
  def check_openenv_contract() -> CheckResult:
24
  client = TestClient(app)
25
- required = ["/health", "/tasks", "/reset", "/step", "/state", "/grader"]
26
  found = {route.path for route in app.routes}
27
  missing = [path for path in required if path not in found]
28
  if missing:
@@ -63,6 +64,65 @@ def check_phase1_api_flow() -> CheckResult:
63
  return CheckResult("Baseline API flow", True, "reset -> step -> grader path works")
64
 
65
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  def check_baseline_reproducibility(runs: int) -> CheckResult:
67
  original_provider = os.environ.get("BASELINE_PROVIDER")
68
  original_url = os.environ.get("BASELINE_ENV_URL")
@@ -91,7 +151,7 @@ def check_baseline_reproducibility(runs: int) -> CheckResult:
91
 
92
 
93
  def check_docker_build() -> CheckResult:
94
- command = ["docker", "build", "-f", "incident_ops_env/server/Dockerfile", "-t", "incident-ops-env:readiness", "."]
95
  proc = subprocess.run(command, capture_output=True, text=True)
96
  if proc.returncode == 0:
97
  return CheckResult("Dockerfile builds", True, "docker build succeeded")
@@ -101,20 +161,39 @@ def check_docker_build() -> CheckResult:
101
  return CheckResult("Dockerfile builds", False, text.splitlines()[-1] if text else "docker build failed")
102
 
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  def main() -> None:
105
  parser = argparse.ArgumentParser(description="Phase readiness checks for IncidentOpsEnv.")
106
  parser.add_argument("--runs", type=int, default=3, help="Number of baseline runs for variance check.")
107
  parser.add_argument("--skip-docker", action="store_true", help="Skip Docker build gate check.")
 
108
  args = parser.parse_args()
109
 
110
  checks = [
111
  check_openenv_contract(),
112
  check_tasks_and_graders(),
113
  check_phase1_api_flow(),
 
114
  check_baseline_reproducibility(runs=args.runs),
115
  ]
116
  if not args.skip_docker:
117
  checks.append(check_docker_build())
 
 
118
 
119
  print("=== Phase 1: Automated Validation ===")
120
  for check in checks:
 
6
  import subprocess
7
  from dataclasses import dataclass
8
 
9
+ import httpx
10
  from fastapi.testclient import TestClient
11
 
12
  from baseline import run_baseline_sync
 
23
 
24
  def check_openenv_contract() -> CheckResult:
25
  client = TestClient(app)
26
+ required = ["/health", "/tasks", "/reset", "/step", "/state", "/grader", "/baseline"]
27
  found = {route.path for route in app.routes}
28
  missing = [path for path in required if path not in found]
29
  if missing:
 
64
  return CheckResult("Baseline API flow", True, "reset -> step -> grader path works")
65
 
66
 
67
+ def check_grader_bounds() -> CheckResult:
68
+ client = TestClient(app)
69
+ scores: dict[int, float] = {}
70
+ for task_id in (1, 2, 3):
71
+ reset = client.post("/reset", json={"task_id": task_id, "seed": 42})
72
+ if reset.status_code != 200:
73
+ return CheckResult("Grader bounds [0.0,1.0]", False, f"/reset failed for task {task_id}")
74
+ session_id = reset.json()["session_id"]
75
+ headers = {"X-Session-ID": session_id}
76
+ done = False
77
+ max_loops = 40
78
+ loops = 0
79
+ while not done and loops < max_loops:
80
+ loops += 1
81
+ if task_id == 1:
82
+ action = {
83
+ "action_type": "classify_alert",
84
+ "severity": "P2",
85
+ "service_name": "payment-service",
86
+ "pattern_type": "database_overload",
87
+ }
88
+ elif task_id == 2:
89
+ if loops == 1:
90
+ action = {"action_type": "filter_logs", "log_service": "checkout-service"}
91
+ elif loops == 2:
92
+ action = {"action_type": "get_metric", "metric_name": "error_rate", "service_name": "checkout-service"}
93
+ elif loops == 3:
94
+ action = {"action_type": "identify_service", "service_name": "checkout-service"}
95
+ else:
96
+ action = {"action_type": "propose_mitigation", "command": "kubectl rollout undo deployment/checkout-service"}
97
+ else:
98
+ state = client.get("/state", headers=headers)
99
+ if state.status_code != 200:
100
+ return CheckResult("Grader bounds [0.0,1.0]", False, f"/state failed for task {task_id}")
101
+ state_data = state.json()
102
+ if state_data.get("is_done"):
103
+ done = True
104
+ break
105
+ if loops >= 20:
106
+ action = {
107
+ "action_type": "write_postmortem",
108
+ "postmortem_text": "database connection pool checkout-service mitigation and prevention",
109
+ }
110
+ else:
111
+ action = {"action_type": "no_op"}
112
+ step = client.post("/step", json={"action": action}, headers=headers)
113
+ if step.status_code != 200:
114
+ return CheckResult("Grader bounds [0.0,1.0]", False, f"/step failed for task {task_id}: {step.status_code}")
115
+ done = bool(step.json().get("done"))
116
+ grade = client.post("/grader", json={"session_id": session_id})
117
+ if grade.status_code != 200:
118
+ return CheckResult("Grader bounds [0.0,1.0]", False, f"/grader failed for task {task_id}")
119
+ score = float(grade.json()["score"])
120
+ scores[task_id] = score
121
+ if score < 0.0 or score > 1.0:
122
+ return CheckResult("Grader bounds [0.0,1.0]", False, f"Task {task_id} score out of range: {score}")
123
+ return CheckResult("Grader bounds [0.0,1.0]", True, f"Scores within range: {scores}")
124
+
125
+
126
  def check_baseline_reproducibility(runs: int) -> CheckResult:
127
  original_provider = os.environ.get("BASELINE_PROVIDER")
128
  original_url = os.environ.get("BASELINE_ENV_URL")
 
151
 
152
 
153
  def check_docker_build() -> CheckResult:
154
+ command = ["docker", "build", "-f", "Dockerfile", "-t", "incident-ops-env:readiness", "."]
155
  proc = subprocess.run(command, capture_output=True, text=True)
156
  if proc.returncode == 0:
157
  return CheckResult("Dockerfile builds", True, "docker build succeeded")
 
161
  return CheckResult("Dockerfile builds", False, text.splitlines()[-1] if text else "docker build failed")
162
 
163
 
164
+ def check_space_url(space_url: str) -> CheckResult:
165
+ base = space_url.rstrip("/")
166
+ try:
167
+ with httpx.Client(timeout=30.0) as client:
168
+ health = client.get(f"{base}/health")
169
+ if health.status_code != 200:
170
+ return CheckResult("Space URL smoke test", False, f"/health returned {health.status_code}")
171
+ reset = client.post(f"{base}/reset", json={"task_id": 1, "seed": 42})
172
+ if reset.status_code != 200:
173
+ return CheckResult("Space URL smoke test", False, f"/reset returned {reset.status_code}")
174
+ except Exception as exc:
175
+ return CheckResult("Space URL smoke test", False, f"Request failure: {exc}")
176
+ return CheckResult("Space URL smoke test", True, "Space responded with 200 for /health and /reset")
177
+
178
+
179
  def main() -> None:
180
  parser = argparse.ArgumentParser(description="Phase readiness checks for IncidentOpsEnv.")
181
  parser.add_argument("--runs", type=int, default=3, help="Number of baseline runs for variance check.")
182
  parser.add_argument("--skip-docker", action="store_true", help="Skip Docker build gate check.")
183
+ parser.add_argument("--space-url", type=str, default="", help="Optional deployed HF Space base URL for smoke checks.")
184
  args = parser.parse_args()
185
 
186
  checks = [
187
  check_openenv_contract(),
188
  check_tasks_and_graders(),
189
  check_phase1_api_flow(),
190
+ check_grader_bounds(),
191
  check_baseline_reproducibility(runs=args.runs),
192
  ]
193
  if not args.skip_docker:
194
  checks.append(check_docker_build())
195
+ if args.space_url:
196
+ checks.append(check_space_url(args.space_url))
197
 
198
  print("=== Phase 1: Automated Validation ===")
199
  for check in checks:
tests/test_api.py CHANGED
@@ -37,3 +37,41 @@ def test_baseline_returns_503_without_provider_key(monkeypatch):
37
  response = client.post("/baseline")
38
  assert response.status_code == 503
39
  assert response.json()["detail"] == "No LLM API key configured."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  response = client.post("/baseline")
38
  assert response.status_code == 503
39
  assert response.json()["detail"] == "No LLM API key configured."
40
+
41
+
42
+ def test_scenarios_endpoints():
43
+ client = TestClient(app)
44
+ listing = client.get("/scenarios")
45
+ assert listing.status_code == 200
46
+ data = listing.json()
47
+ assert "built_in" in data
48
+ assert "task_1" in data["built_in"]
49
+
50
+ valid_payload = {
51
+ "scenario": {
52
+ "task_id": 1,
53
+ "scenario_id": "uploaded_task1_sample",
54
+ "alerts": [
55
+ {
56
+ "alert_id": "ALT-UP-1",
57
+ "title": "uploaded alert",
58
+ "severity": "P2",
59
+ "service": "payment-service",
60
+ "triggered_at": "2026-03-27T01:00:00Z",
61
+ "metadata": {"resolved": False},
62
+ }
63
+ ],
64
+ "ground_truth": {"severity": "P2", "service": "payment-service", "pattern_type": "database_overload"},
65
+ }
66
+ }
67
+ validate = client.post("/scenarios/validate", json=valid_payload)
68
+ assert validate.status_code == 200
69
+ upload = client.post("/scenarios/upload", json=valid_payload)
70
+ assert upload.status_code == 200
71
+
72
+
73
+ def test_metrics_websocket_stream_snapshot():
74
+ client = TestClient(app)
75
+ with client.websocket_connect("/ws/metrics") as websocket:
76
+ message = websocket.receive_json()
77
+ assert message["type"] in {"snapshot", "request", "episode_start", "step", "episode_end", "grader"}
tests/test_models_and_scenarios.py CHANGED
@@ -1,5 +1,5 @@
1
  from incident_ops_env.models import ActionType, IncidentAction
2
- from incident_ops_env.server.scenario_loader import list_scenarios_for_task, load_scenario_by_id
3
 
4
 
5
  def test_action_model_basic():
@@ -14,9 +14,9 @@ def test_action_model_basic():
14
 
15
 
16
  def test_scenario_loader_by_task():
17
- task1 = list_scenarios_for_task(1)
18
- task2 = list_scenarios_for_task(2)
19
- task3 = list_scenarios_for_task(3)
20
  assert len(task1) == 3
21
  assert len(task2) == 3
22
  assert len(task3) == 3
@@ -26,3 +26,41 @@ def test_scenario_loader_by_id():
26
  scenario = load_scenario_by_id("task2_medium_001")
27
  assert scenario["task_id"] == 2
28
  assert "ground_truth" in scenario
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from incident_ops_env.models import ActionType, IncidentAction
2
+ from incident_ops_env.server.scenario_loader import list_scenarios_for_task, load_scenario_by_id, validate_scenario_data
3
 
4
 
5
  def test_action_model_basic():
 
14
 
15
 
16
  def test_scenario_loader_by_task():
17
+ task1 = list_scenarios_for_task(1, include_uploaded=False)
18
+ task2 = list_scenarios_for_task(2, include_uploaded=False)
19
+ task3 = list_scenarios_for_task(3, include_uploaded=False)
20
  assert len(task1) == 3
21
  assert len(task2) == 3
22
  assert len(task3) == 3
 
26
  scenario = load_scenario_by_id("task2_medium_001")
27
  assert scenario["task_id"] == 2
28
  assert "ground_truth" in scenario
29
+
30
+
31
+ def test_scenario_task_mismatch_rejected():
32
+ try:
33
+ load_scenario_by_id("task2_medium_001", expected_task_id=1)
34
+ except ValueError as exc:
35
+ assert "does not match requested task_id" in str(exc)
36
+ return
37
+ raise AssertionError("Expected ValueError for mismatched task_id")
38
+
39
+
40
+ def test_validate_scenario_data_task3_requires_runbook():
41
+ bad_scenario = {
42
+ "task_id": 3,
43
+ "scenario_id": "bad_task3",
44
+ "alerts": [
45
+ {
46
+ "alert_id": "ALT-1",
47
+ "title": "alert",
48
+ "severity": "P1",
49
+ "service": "checkout-service",
50
+ "triggered_at": "2026-03-27T00:00:00Z",
51
+ "metadata": {},
52
+ }
53
+ ],
54
+ "ground_truth": {
55
+ "correct_escalation_team": "database",
56
+ "required_postmortem_keywords": ["database"],
57
+ "steps_that_should_complete": ["step_1"],
58
+ "step_that_should_escalate": "step_2",
59
+ },
60
+ }
61
+ try:
62
+ validate_scenario_data(bad_scenario)
63
+ except ValueError as exc:
64
+ assert "requires non-empty runbook list" in str(exc)
65
+ return
66
+ raise AssertionError("Expected ValueError when task3 runbook is missing")
ui/__init__.py ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ from ui.gradio_app import build_gradio_app
2
+
3
+ __all__ = ["build_gradio_app"]
ui/gradio_app.py ADDED
@@ -0,0 +1,186 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from __future__ import annotations
2
+
3
+ import json
4
+ import os
5
+ from typing import Any
6
+
7
+ import gradio as gr
8
+ import httpx
9
+
10
+
11
+ def _backend_base_url() -> str:
12
+ return os.environ.get("UI_BACKEND_URL", "http://127.0.0.1:7860")
13
+
14
+
15
+ def _request(method: str, path: str, payload: dict[str, Any] | None = None, headers: dict[str, str] | None = None) -> dict:
16
+ url = _backend_base_url().rstrip("/") + path
17
+ with httpx.Client(timeout=60.0) as client:
18
+ response = client.request(method=method, url=url, json=payload, headers=headers)
19
+ response.raise_for_status()
20
+ return response.json()
21
+
22
+
23
+ def run_reset(task_id: int, scenario_id: str, seed: int | None) -> tuple[str, str, str]:
24
+ body: dict[str, Any] = {"task_id": int(task_id)}
25
+ if scenario_id.strip():
26
+ body["scenario_id"] = scenario_id.strip()
27
+ if seed is not None:
28
+ body["seed"] = int(seed)
29
+ payload = _request("POST", "/reset", body)
30
+ return (
31
+ payload["session_id"],
32
+ json.dumps(payload["observation"], indent=2),
33
+ json.dumps({"status": "reset_complete"}, indent=2),
34
+ )
35
+
36
+
37
+ def run_step(session_id: str, action_json: str) -> tuple[str, str, str]:
38
+ if not session_id.strip():
39
+ return "", "", "Missing session_id. Run reset first."
40
+ try:
41
+ action_payload = json.loads(action_json)
42
+ except json.JSONDecodeError as exc:
43
+ return "", "", f"Invalid action JSON: {exc}"
44
+ payload = _request(
45
+ "POST",
46
+ "/step",
47
+ {"action": action_payload},
48
+ headers={"X-Session-ID": session_id.strip()},
49
+ )
50
+ return (
51
+ json.dumps(payload["observation"], indent=2),
52
+ json.dumps(
53
+ {
54
+ "reward": payload["reward"],
55
+ "reward_model": payload.get("reward_model", {}),
56
+ "done": payload["done"],
57
+ "info": payload.get("info", {}),
58
+ },
59
+ indent=2,
60
+ ),
61
+ "step_complete",
62
+ )
63
+
64
+
65
+ def fetch_state(session_id: str) -> str:
66
+ if not session_id.strip():
67
+ return "Missing session_id."
68
+ payload = _request("GET", "/state", headers={"X-Session-ID": session_id.strip()})
69
+ return json.dumps(payload, indent=2)
70
+
71
+
72
+ def fetch_tasks() -> str:
73
+ payload = _request("GET", "/tasks")
74
+ return json.dumps(payload, indent=2)
75
+
76
+
77
+ def fetch_metrics() -> str:
78
+ payload = _request("GET", "/metrics")
79
+ return json.dumps(payload, indent=2)
80
+
81
+
82
+ def run_baseline() -> str:
83
+ payload = _request("POST", "/baseline")
84
+ return json.dumps(payload, indent=2)
85
+
86
+
87
+ def run_grader(session_id: str) -> str:
88
+ if not session_id.strip():
89
+ return "Missing session_id."
90
+ payload = _request("POST", "/grader", {"session_id": session_id.strip()})
91
+ return json.dumps(payload, indent=2)
92
+
93
+
94
+ def upload_scenario(file_obj) -> str:
95
+ if file_obj is None:
96
+ return "No file selected."
97
+ with open(file_obj.name, encoding="utf-8") as handle:
98
+ content = json.load(handle)
99
+ payload = _request("POST", "/scenarios/upload", {"scenario": content})
100
+ return json.dumps(payload, indent=2)
101
+
102
+
103
+ def validate_scenario(file_obj) -> str:
104
+ if file_obj is None:
105
+ return "No file selected."
106
+ with open(file_obj.name, encoding="utf-8") as handle:
107
+ content = json.load(handle)
108
+ payload = _request("POST", "/scenarios/validate", {"scenario": content})
109
+ return json.dumps(payload, indent=2)
110
+
111
+
112
+ def list_scenarios() -> str:
113
+ payload = _request("GET", "/scenarios")
114
+ return json.dumps(payload, indent=2)
115
+
116
+
117
+ def metrics_stream_info() -> str:
118
+ base = _backend_base_url().rstrip("/")
119
+ ws_url = base.replace("http://", "ws://").replace("https://", "wss://") + "/ws/metrics"
120
+ return f"Live metrics stream endpoint: {ws_url}"
121
+
122
+
123
+ def build_gradio_app() -> gr.Blocks:
124
+ with gr.Blocks(title="IncidentOpsEnv Observability UI") as demo:
125
+ gr.Markdown("# IncidentOpsEnv - Gradio Observability")
126
+ gr.Markdown("Use this UI to inspect episodes, backend metrics, graders, baseline runs, and scenario uploads.")
127
+
128
+ with gr.Tab("Episode Runner"):
129
+ with gr.Row():
130
+ task_id = gr.Dropdown(choices=[1, 2, 3], value=1, label="Task ID")
131
+ scenario_id = gr.Textbox(label="Scenario ID (optional)")
132
+ seed = gr.Number(label="Seed (optional)", precision=0)
133
+ reset_btn = gr.Button("Reset Episode")
134
+ session_id = gr.Textbox(label="Session ID")
135
+ observation_box = gr.Code(label="Observation", language="json")
136
+ reset_status = gr.Textbox(label="Reset Status")
137
+
138
+ gr.Markdown("### Step with JSON action")
139
+ action_json = gr.Code(
140
+ value='{\n "action_type": "no_op"\n}',
141
+ language="json",
142
+ label="Action JSON",
143
+ )
144
+ step_btn = gr.Button("Run Step")
145
+ step_observation = gr.Code(label="Observation After Step", language="json")
146
+ step_meta = gr.Code(label="Reward/Done/Info", language="json")
147
+ step_status = gr.Textbox(label="Step Status")
148
+ state_btn = gr.Button("Fetch State")
149
+ state_box = gr.Code(label="Current State", language="json")
150
+
151
+ reset_btn.click(run_reset, [task_id, scenario_id, seed], [session_id, observation_box, reset_status])
152
+ step_btn.click(run_step, [session_id, action_json], [step_observation, step_meta, step_status])
153
+ state_btn.click(fetch_state, [session_id], [state_box])
154
+
155
+ with gr.Tab("Tasks and Grader"):
156
+ tasks_btn = gr.Button("Load /tasks")
157
+ tasks_box = gr.Code(label="Tasks", language="json")
158
+ grader_btn = gr.Button("Run /grader for Session")
159
+ grader_box = gr.Code(label="Grader Result", language="json")
160
+ tasks_btn.click(fetch_tasks, None, [tasks_box])
161
+ grader_btn.click(run_grader, [session_id], [grader_box])
162
+
163
+ with gr.Tab("Metrics"):
164
+ metrics_btn = gr.Button("Refresh Metrics")
165
+ metrics_box = gr.Code(label="/metrics snapshot", language="json")
166
+ ws_info = gr.Textbox(label="Live Stream Endpoint", value=metrics_stream_info())
167
+ metrics_btn.click(fetch_metrics, None, [metrics_box])
168
+ gr.Timer(2.0).tick(fetch_metrics, None, [metrics_box])
169
+
170
+ with gr.Tab("Baseline"):
171
+ baseline_btn = gr.Button("Run /baseline")
172
+ baseline_box = gr.Code(label="Baseline Result", language="json")
173
+ baseline_btn.click(run_baseline, None, [baseline_box])
174
+
175
+ with gr.Tab("Scenario Upload/Validation"):
176
+ file_input = gr.File(label="Upload scenario JSON")
177
+ validate_btn = gr.Button("Validate Scenario")
178
+ validate_out = gr.Code(label="Validation Result", language="json")
179
+ upload_btn = gr.Button("Upload Scenario")
180
+ upload_out = gr.Code(label="Upload Result", language="json")
181
+ list_btn = gr.Button("List Scenarios")
182
+ list_out = gr.Code(label="Scenario Registry", language="json")
183
+ validate_btn.click(validate_scenario, [file_input], [validate_out])
184
+ upload_btn.click(upload_scenario, [file_input], [upload_out])
185
+ list_btn.click(list_scenarios, None, [list_out])
186
+ return demo
uv.lock CHANGED
@@ -2,7 +2,9 @@ version = 1
2
  revision = 3
3
  requires-python = ">=3.11"
4
  resolution-markers = [
5
- "python_full_version >= '3.14'",
 
 
6
  "python_full_version == '3.13.*' and sys_platform == 'win32'",
7
  "python_full_version == '3.13.*' and sys_platform == 'emscripten'",
8
  "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32'",
@@ -571,8 +573,7 @@ source = { registry = "https://pypi.org/simple" }
571
  dependencies = [
572
  { name = "annotated-doc" },
573
  { name = "pydantic" },
574
- { name = "starlette", version = "0.52.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14'" },
575
- { name = "starlette", version = "1.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14'" },
576
  { name = "typing-extensions" },
577
  { name = "typing-inspection" },
578
  ]
@@ -754,36 +755,36 @@ name = "gradio"
754
  version = "6.10.0"
755
  source = { registry = "https://pypi.org/simple" }
756
  dependencies = [
757
- { name = "aiofiles", marker = "python_full_version < '3.14'" },
758
- { name = "anyio", marker = "python_full_version < '3.14'" },
759
- { name = "audioop-lts", marker = "python_full_version == '3.13.*'" },
760
- { name = "brotli", marker = "python_full_version < '3.14'" },
761
- { name = "fastapi", marker = "python_full_version < '3.14'" },
762
- { name = "ffmpy", marker = "python_full_version < '3.14'" },
763
- { name = "gradio-client", marker = "python_full_version < '3.14'" },
764
- { name = "groovy", marker = "python_full_version < '3.14'" },
765
- { name = "hf-gradio", marker = "python_full_version < '3.14'" },
766
- { name = "httpx", marker = "python_full_version < '3.14'" },
767
- { name = "huggingface-hub", marker = "python_full_version < '3.14'" },
768
- { name = "jinja2", marker = "python_full_version < '3.14'" },
769
- { name = "markupsafe", marker = "python_full_version < '3.14'" },
770
- { name = "numpy", marker = "python_full_version < '3.14'" },
771
- { name = "orjson", marker = "python_full_version < '3.14'" },
772
- { name = "packaging", marker = "python_full_version < '3.14'" },
773
- { name = "pandas", marker = "python_full_version < '3.14'" },
774
- { name = "pillow", marker = "python_full_version < '3.14'" },
775
- { name = "pydantic", marker = "python_full_version < '3.14'" },
776
- { name = "pydub", marker = "python_full_version < '3.14'" },
777
- { name = "python-multipart", marker = "python_full_version < '3.14'" },
778
- { name = "pytz", marker = "python_full_version < '3.14'" },
779
- { name = "pyyaml", marker = "python_full_version < '3.14'" },
780
- { name = "safehttpx", marker = "python_full_version < '3.14'" },
781
- { name = "semantic-version", marker = "python_full_version < '3.14'" },
782
- { name = "starlette", version = "0.52.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14'" },
783
- { name = "tomlkit", marker = "python_full_version < '3.14'" },
784
- { name = "typer", marker = "python_full_version < '3.14'" },
785
- { name = "typing-extensions", marker = "python_full_version < '3.14'" },
786
- { name = "uvicorn", marker = "python_full_version < '3.14'" },
787
  ]
788
  sdist = { url = "https://files.pythonhosted.org/packages/c4/74/740c507b076263f9064ca39c5c244d773c8d4063e1ce630b57d6197ac50f/gradio-6.10.0.tar.gz", hash = "sha256:f76797536f5b62bc1558f622017351133d0087ee5f51aab139af04e82ed3bf2a", size = 58021607, upload-time = "2026-03-24T21:20:13.399Z" }
789
  wheels = [
@@ -795,11 +796,11 @@ name = "gradio-client"
795
  version = "2.4.0"
796
  source = { registry = "https://pypi.org/simple" }
797
  dependencies = [
798
- { name = "fsspec", marker = "python_full_version < '3.14'" },
799
- { name = "httpx", marker = "python_full_version < '3.14'" },
800
- { name = "huggingface-hub", marker = "python_full_version < '3.14'" },
801
- { name = "packaging", marker = "python_full_version < '3.14'" },
802
- { name = "typing-extensions", marker = "python_full_version < '3.14'" },
803
  ]
804
  sdist = { url = "https://files.pythonhosted.org/packages/4e/4a/ddfaa8b3fef0238768a42301a3361981af1afd90f92c27adfe6cd031eca7/gradio_client-2.4.0.tar.gz", hash = "sha256:781885374f86759b8db5195e13e716c301d14e48e0442aef63362f1eeea4cce2", size = 58203, upload-time = "2026-03-24T21:20:25.276Z" }
805
  wheels = [
@@ -894,8 +895,8 @@ name = "hf-gradio"
894
  version = "0.3.0"
895
  source = { registry = "https://pypi.org/simple" }
896
  dependencies = [
897
- { name = "gradio-client", marker = "python_full_version < '3.14'" },
898
- { name = "typer", marker = "python_full_version < '3.14'" },
899
  ]
900
  wheels = [
901
  { url = "https://files.pythonhosted.org/packages/4c/52/04816d2a15691a63cec3187e3e592c4493448eb4834492eadd532972b035/hf_gradio-0.3.0-py3-none-any.whl", hash = "sha256:159d33d1f0affae8164d29c0c51a63dfcc0bbc90803b07c6f139137206a796ae", size = 4154, upload-time = "2026-03-23T19:50:08.586Z" },
@@ -1066,6 +1067,7 @@ source = { editable = "." }
1066
  dependencies = [
1067
  { name = "fastapi" },
1068
  { name = "google-generativeai" },
 
1069
  { name = "httpx" },
1070
  { name = "openai" },
1071
  { name = "openenv-core", version = "0.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14'" },
@@ -1087,6 +1089,7 @@ dev = [
1087
  requires-dist = [
1088
  { name = "fastapi", specifier = ">=0.115.0" },
1089
  { name = "google-generativeai", specifier = ">=0.8.3" },
 
1090
  { name = "httpx", specifier = ">=0.27.0" },
1091
  { name = "openai", specifier = ">=1.54.0" },
1092
  { name = "openenv-core", specifier = ">=0.1.1" },
@@ -1159,7 +1162,7 @@ name = "jinja2"
1159
  version = "3.1.6"
1160
  source = { registry = "https://pypi.org/simple" }
1161
  dependencies = [
1162
- { name = "markupsafe", marker = "python_full_version < '3.14'" },
1163
  ]
1164
  sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
1165
  wheels = [
@@ -1420,8 +1423,7 @@ dependencies = [
1420
  { name = "python-multipart" },
1421
  { name = "pywin32", marker = "sys_platform == 'win32'" },
1422
  { name = "sse-starlette" },
1423
- { name = "starlette", version = "0.52.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14'" },
1424
- { name = "starlette", version = "1.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14'" },
1425
  { name = "typing-extensions" },
1426
  { name = "typing-inspection" },
1427
  { name = "uvicorn", marker = "sys_platform != 'emscripten'" },
@@ -1564,7 +1566,9 @@ name = "openenv-core"
1564
  version = "0.2.1"
1565
  source = { registry = "https://pypi.org/simple" }
1566
  resolution-markers = [
1567
- "python_full_version >= '3.14'",
 
 
1568
  ]
1569
  dependencies = [
1570
  { name = "fastapi", marker = "python_full_version >= '3.14'" },
@@ -1715,9 +1719,9 @@ name = "pandas"
1715
  version = "3.0.1"
1716
  source = { registry = "https://pypi.org/simple" }
1717
  dependencies = [
1718
- { name = "numpy", marker = "python_full_version < '3.14'" },
1719
- { name = "python-dateutil", marker = "python_full_version < '3.14'" },
1720
- { name = "tzdata", marker = "(python_full_version < '3.14' and sys_platform == 'emscripten') or (python_full_version < '3.14' and sys_platform == 'win32')" },
1721
  ]
1722
  sdist = { url = "https://files.pythonhosted.org/packages/2e/0c/b28ed414f080ee0ad153f848586d61d1878f91689950f037f976ce15f6c8/pandas-3.0.1.tar.gz", hash = "sha256:4186a699674af418f655dbd420ed87f50d56b4cd6603784279d9eef6627823c8", size = 4641901, upload-time = "2026-02-17T22:20:16.434Z" }
1723
  wheels = [
@@ -2189,7 +2193,7 @@ name = "python-dateutil"
2189
  version = "2.9.0.post0"
2190
  source = { registry = "https://pypi.org/simple" }
2191
  dependencies = [
2192
- { name = "six", marker = "python_full_version < '3.14'" },
2193
  ]
2194
  sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" }
2195
  wheels = [
@@ -2474,7 +2478,7 @@ name = "safehttpx"
2474
  version = "0.1.7"
2475
  source = { registry = "https://pypi.org/simple" }
2476
  dependencies = [
2477
- { name = "httpx", marker = "python_full_version < '3.14'" },
2478
  ]
2479
  sdist = { url = "https://files.pythonhosted.org/packages/89/d1/4282284d9cf1ee873607a46442da977fc3c985059315ab23610be31d5885/safehttpx-0.1.7.tar.gz", hash = "sha256:db201c0978c41eddb8bb480f3eee59dd67304fdd91646035e9d9a720049a9d23", size = 10385, upload-time = "2025-10-24T18:30:09.783Z" }
2480
  wheels = [
@@ -2486,8 +2490,8 @@ name = "secretstorage"
2486
  version = "3.5.0"
2487
  source = { registry = "https://pypi.org/simple" }
2488
  dependencies = [
2489
- { name = "cryptography", marker = "(python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'emscripten' and sys_platform != 'win32')" },
2490
- { name = "jeepney", marker = "(python_full_version >= '3.14' and sys_platform == 'emscripten') or (python_full_version >= '3.14' and sys_platform == 'win32') or (sys_platform != 'emscripten' and sys_platform != 'win32')" },
2491
  ]
2492
  sdist = { url = "https://files.pythonhosted.org/packages/1c/03/e834bcd866f2f8a49a85eaff47340affa3bfa391ee9912a952a1faa68c7b/secretstorage-3.5.0.tar.gz", hash = "sha256:f04b8e4689cbce351744d5537bf6b1329c6fc68f91fa666f60a380edddcd11be", size = 19884, upload-time = "2025-11-23T19:02:53.191Z" }
2493
  wheels = [
@@ -2536,8 +2540,7 @@ version = "3.3.3"
2536
  source = { registry = "https://pypi.org/simple" }
2537
  dependencies = [
2538
  { name = "anyio" },
2539
- { name = "starlette", version = "0.52.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.14'" },
2540
- { name = "starlette", version = "1.0.0", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14'" },
2541
  ]
2542
  sdist = { url = "https://files.pythonhosted.org/packages/14/2f/9223c24f568bb7a0c03d751e609844dce0968f13b39a3f73fbb3a96cd27a/sse_starlette-3.3.3.tar.gz", hash = "sha256:72a95d7575fd5129bd0ae15275ac6432bb35ac542fdebb82889c24bb9f3f4049", size = 32420, upload-time = "2026-03-17T20:05:55.529Z" }
2543
  wheels = [
@@ -2548,16 +2551,8 @@ wheels = [
2548
  name = "starlette"
2549
  version = "0.52.1"
2550
  source = { registry = "https://pypi.org/simple" }
2551
- resolution-markers = [
2552
- "python_full_version == '3.13.*' and sys_platform == 'win32'",
2553
- "python_full_version == '3.13.*' and sys_platform == 'emscripten'",
2554
- "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32'",
2555
- "python_full_version < '3.13' and sys_platform == 'win32'",
2556
- "python_full_version < '3.13' and sys_platform == 'emscripten'",
2557
- "python_full_version < '3.13' and sys_platform != 'emscripten' and sys_platform != 'win32'",
2558
- ]
2559
  dependencies = [
2560
- { name = "anyio", marker = "python_full_version < '3.14'" },
2561
  { name = "typing-extensions", marker = "python_full_version < '3.13'" },
2562
  ]
2563
  sdist = { url = "https://files.pythonhosted.org/packages/c4/68/79977123bb7be889ad680d79a40f339082c1978b5cfcf62c2d8d196873ac/starlette-0.52.1.tar.gz", hash = "sha256:834edd1b0a23167694292e94f597773bc3f89f362be6effee198165a35d62933", size = 2653702, upload-time = "2026-01-18T13:34:11.062Z" }
@@ -2565,21 +2560,6 @@ wheels = [
2565
  { url = "https://files.pythonhosted.org/packages/81/0d/13d1d239a25cbfb19e740db83143e95c772a1fe10202dda4b76792b114dd/starlette-0.52.1-py3-none-any.whl", hash = "sha256:0029d43eb3d273bc4f83a08720b4912ea4b071087a3b48db01b7c839f7954d74", size = 74272, upload-time = "2026-01-18T13:34:09.188Z" },
2566
  ]
2567
 
2568
- [[package]]
2569
- name = "starlette"
2570
- version = "1.0.0"
2571
- source = { registry = "https://pypi.org/simple" }
2572
- resolution-markers = [
2573
- "python_full_version >= '3.14'",
2574
- ]
2575
- dependencies = [
2576
- { name = "anyio", marker = "python_full_version >= '3.14'" },
2577
- ]
2578
- sdist = { url = "https://files.pythonhosted.org/packages/81/69/17425771797c36cded50b7fe44e850315d039f28b15901ab44839e70b593/starlette-1.0.0.tar.gz", hash = "sha256:6a4beaf1f81bb472fd19ea9b918b50dc3a77a6f2e190a12954b25e6ed5eea149", size = 2655289, upload-time = "2026-03-22T18:29:46.779Z" }
2579
- wheels = [
2580
- { url = "https://files.pythonhosted.org/packages/0b/c9/584bc9651441b4ba60cc4d557d8a547b5aff901af35bda3a4ee30c819b82/starlette-1.0.0-py3-none-any.whl", hash = "sha256:d3ec55e0bb321692d275455ddfd3df75fff145d009685eb40dc91fc66b03d38b", size = 72651, upload-time = "2026-03-22T18:29:45.111Z" },
2581
- ]
2582
-
2583
  [[package]]
2584
  name = "tomli"
2585
  version = "2.4.1"
 
2
  revision = 3
3
  requires-python = ">=3.11"
4
  resolution-markers = [
5
+ "python_full_version >= '3.14' and sys_platform == 'win32'",
6
+ "python_full_version >= '3.14' and sys_platform == 'emscripten'",
7
+ "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'",
8
  "python_full_version == '3.13.*' and sys_platform == 'win32'",
9
  "python_full_version == '3.13.*' and sys_platform == 'emscripten'",
10
  "python_full_version == '3.13.*' and sys_platform != 'emscripten' and sys_platform != 'win32'",
 
573
  dependencies = [
574
  { name = "annotated-doc" },
575
  { name = "pydantic" },
576
+ { name = "starlette" },
 
577
  { name = "typing-extensions" },
578
  { name = "typing-inspection" },
579
  ]
 
755
  version = "6.10.0"
756
  source = { registry = "https://pypi.org/simple" }
757
  dependencies = [
758
+ { name = "aiofiles" },
759
+ { name = "anyio" },
760
+ { name = "audioop-lts", marker = "python_full_version >= '3.13'" },
761
+ { name = "brotli" },
762
+ { name = "fastapi" },
763
+ { name = "ffmpy" },
764
+ { name = "gradio-client" },
765
+ { name = "groovy" },
766
+ { name = "hf-gradio" },
767
+ { name = "httpx" },
768
+ { name = "huggingface-hub" },
769
+ { name = "jinja2" },
770
+ { name = "markupsafe" },
771
+ { name = "numpy" },
772
+ { name = "orjson" },
773
+ { name = "packaging" },
774
+ { name = "pandas" },
775
+ { name = "pillow" },
776
+ { name = "pydantic" },
777
+ { name = "pydub" },
778
+ { name = "python-multipart" },
779
+ { name = "pytz" },
780
+ { name = "pyyaml" },
781
+ { name = "safehttpx" },
782
+ { name = "semantic-version" },
783
+ { name = "starlette" },
784
+ { name = "tomlkit" },
785
+ { name = "typer" },
786
+ { name = "typing-extensions" },
787
+ { name = "uvicorn" },
788
  ]
789
  sdist = { url = "https://files.pythonhosted.org/packages/c4/74/740c507b076263f9064ca39c5c244d773c8d4063e1ce630b57d6197ac50f/gradio-6.10.0.tar.gz", hash = "sha256:f76797536f5b62bc1558f622017351133d0087ee5f51aab139af04e82ed3bf2a", size = 58021607, upload-time = "2026-03-24T21:20:13.399Z" }
790
  wheels = [
 
796
  version = "2.4.0"
797
  source = { registry = "https://pypi.org/simple" }
798
  dependencies = [
799
+ { name = "fsspec" },
800
+ { name = "httpx" },
801
+ { name = "huggingface-hub" },
802
+ { name = "packaging" },
803
+ { name = "typing-extensions" },
804
  ]
805
  sdist = { url = "https://files.pythonhosted.org/packages/4e/4a/ddfaa8b3fef0238768a42301a3361981af1afd90f92c27adfe6cd031eca7/gradio_client-2.4.0.tar.gz", hash = "sha256:781885374f86759b8db5195e13e716c301d14e48e0442aef63362f1eeea4cce2", size = 58203, upload-time = "2026-03-24T21:20:25.276Z" }
806
  wheels = [
 
895
  version = "0.3.0"
896
  source = { registry = "https://pypi.org/simple" }
897
  dependencies = [
898
+ { name = "gradio-client" },
899
+ { name = "typer" },
900
  ]
901
  wheels = [
902
  { url = "https://files.pythonhosted.org/packages/4c/52/04816d2a15691a63cec3187e3e592c4493448eb4834492eadd532972b035/hf_gradio-0.3.0-py3-none-any.whl", hash = "sha256:159d33d1f0affae8164d29c0c51a63dfcc0bbc90803b07c6f139137206a796ae", size = 4154, upload-time = "2026-03-23T19:50:08.586Z" },
 
1067
  dependencies = [
1068
  { name = "fastapi" },
1069
  { name = "google-generativeai" },
1070
+ { name = "gradio" },
1071
  { name = "httpx" },
1072
  { name = "openai" },
1073
  { name = "openenv-core", version = "0.2.1", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version >= '3.14'" },
 
1089
  requires-dist = [
1090
  { name = "fastapi", specifier = ">=0.115.0" },
1091
  { name = "google-generativeai", specifier = ">=0.8.3" },
1092
+ { name = "gradio", specifier = ">=5.20.0" },
1093
  { name = "httpx", specifier = ">=0.27.0" },
1094
  { name = "openai", specifier = ">=1.54.0" },
1095
  { name = "openenv-core", specifier = ">=0.1.1" },
 
1162
  version = "3.1.6"
1163
  source = { registry = "https://pypi.org/simple" }
1164
  dependencies = [
1165
+ { name = "markupsafe" },
1166
  ]
1167
  sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
1168
  wheels = [
 
1423
  { name = "python-multipart" },
1424
  { name = "pywin32", marker = "sys_platform == 'win32'" },
1425
  { name = "sse-starlette" },
1426
+ { name = "starlette" },
 
1427
  { name = "typing-extensions" },
1428
  { name = "typing-inspection" },
1429
  { name = "uvicorn", marker = "sys_platform != 'emscripten'" },
 
1566
  version = "0.2.1"
1567
  source = { registry = "https://pypi.org/simple" }
1568
  resolution-markers = [
1569
+ "python_full_version >= '3.14' and sys_platform == 'win32'",
1570
+ "python_full_version >= '3.14' and sys_platform == 'emscripten'",
1571
+ "python_full_version >= '3.14' and sys_platform != 'emscripten' and sys_platform != 'win32'",
1572
  ]
1573
  dependencies = [
1574
  { name = "fastapi", marker = "python_full_version >= '3.14'" },
 
1719
  version = "3.0.1"
1720
  source = { registry = "https://pypi.org/simple" }
1721
  dependencies = [
1722
+ { name = "numpy" },
1723
+ { name = "python-dateutil" },
1724
+ { name = "tzdata", marker = "sys_platform == 'emscripten' or sys_platform == 'win32'" },
1725
  ]
1726
  sdist = { url = "https://files.pythonhosted.org/packages/2e/0c/b28ed414f080ee0ad153f848586d61d1878f91689950f037f976ce15f6c8/pandas-3.0.1.tar.gz", hash = "sha256:4186a699674af418f655dbd420ed87f50d56b4cd6603784279d9eef6627823c8", size = 4641901, upload-time = "2026-02-17T22:20:16.434Z" }
1727
  wheels = [
 
2193
  version = "2.9.0.post0"
2194
  source = { registry = "https://pypi.org/simple" }
2195
  dependencies = [
2196
+ { name = "six" },
2197
  ]
2198
  sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" }
2199
  wheels = [
 
2478
  version = "0.1.7"
2479
  source = { registry = "https://pypi.org/simple" }
2480
  dependencies = [
2481
+ { name = "httpx" },
2482
  ]
2483
  sdist = { url = "https://files.pythonhosted.org/packages/89/d1/4282284d9cf1ee873607a46442da977fc3c985059315ab23610be31d5885/safehttpx-0.1.7.tar.gz", hash = "sha256:db201c0978c41eddb8bb480f3eee59dd67304fdd91646035e9d9a720049a9d23", size = 10385, upload-time = "2025-10-24T18:30:09.783Z" }
2484
  wheels = [
 
2490
  version = "3.5.0"
2491
  source = { registry = "https://pypi.org/simple" }
2492
  dependencies = [
2493
+ { name = "cryptography", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
2494
+ { name = "jeepney", marker = "sys_platform != 'emscripten' and sys_platform != 'win32'" },
2495
  ]
2496
  sdist = { url = "https://files.pythonhosted.org/packages/1c/03/e834bcd866f2f8a49a85eaff47340affa3bfa391ee9912a952a1faa68c7b/secretstorage-3.5.0.tar.gz", hash = "sha256:f04b8e4689cbce351744d5537bf6b1329c6fc68f91fa666f60a380edddcd11be", size = 19884, upload-time = "2025-11-23T19:02:53.191Z" }
2497
  wheels = [
 
2540
  source = { registry = "https://pypi.org/simple" }
2541
  dependencies = [
2542
  { name = "anyio" },
2543
+ { name = "starlette" },
 
2544
  ]
2545
  sdist = { url = "https://files.pythonhosted.org/packages/14/2f/9223c24f568bb7a0c03d751e609844dce0968f13b39a3f73fbb3a96cd27a/sse_starlette-3.3.3.tar.gz", hash = "sha256:72a95d7575fd5129bd0ae15275ac6432bb35ac542fdebb82889c24bb9f3f4049", size = 32420, upload-time = "2026-03-17T20:05:55.529Z" }
2546
  wheels = [
 
2551
  name = "starlette"
2552
  version = "0.52.1"
2553
  source = { registry = "https://pypi.org/simple" }
 
 
 
 
 
 
 
 
2554
  dependencies = [
2555
+ { name = "anyio" },
2556
  { name = "typing-extensions", marker = "python_full_version < '3.13'" },
2557
  ]
2558
  sdist = { url = "https://files.pythonhosted.org/packages/c4/68/79977123bb7be889ad680d79a40f339082c1978b5cfcf62c2d8d196873ac/starlette-0.52.1.tar.gz", hash = "sha256:834edd1b0a23167694292e94f597773bc3f89f362be6effee198165a35d62933", size = 2653702, upload-time = "2026-01-18T13:34:11.062Z" }
 
2560
  { url = "https://files.pythonhosted.org/packages/81/0d/13d1d239a25cbfb19e740db83143e95c772a1fe10202dda4b76792b114dd/starlette-0.52.1-py3-none-any.whl", hash = "sha256:0029d43eb3d273bc4f83a08720b4912ea4b071087a3b48db01b7c839f7954d74", size = 74272, upload-time = "2026-01-18T13:34:09.188Z" },
2561
  ]
2562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2563
  [[package]]
2564
  name = "tomli"
2565
  version = "2.4.1"