File size: 1,122 Bytes
f3b0a91 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | """Typed OpenEnv contracts. State carries no answers, checks or scores (OpenEnv gotcha G5)."""
from __future__ import annotations
from typing import Literal, Optional
from pydantic import ConfigDict
from openenv.core.env_server.types import Action, Observation, State
class AlertForgeAction(Action):
model_config = ConfigDict(extra="forbid")
tool: Literal["list_files", "read_file", "write_file", "replace_in_file", "run_checks", "route_test", "submit"]
path: Optional[str] = None # relative to monitoring/
content: Optional[str] = None # write_file
old: Optional[str] = None # replace_in_file (must match exactly once)
new: Optional[str] = None
labels: Optional[dict[str, str]] = None # route_test
class AlertForgeObservation(Observation):
output: str = ""
ok: bool = True
step: int = 0
steps_left: int = 0
task_id: str = ""
instruction: str = "" # filled on reset only
class AlertForgeState(State):
task_id: str = ""
tier: str = ""
workflow: str = ""
split: str = "train"
submitted: bool = False
|