Spaces:
Sleeping
Sleeping
Restructure to flat template layout; add pyproject + uv.lock; pass openenv validate
30c52ad verified | """Pydantic Action and Observation models for DiskPanic.""" | |
| from typing import Optional | |
| from pydantic import Field | |
| from openenv.core import Action, Observation | |
| class DiskPanicAction(Action): | |
| """An SRE agent's action: a single bash-like command.""" | |
| command: str = Field( | |
| ..., | |
| description=( | |
| "A bash-like command. Supported: ls, df, du, cat, rm, find, " | |
| "sha256sum, systemctl (status/start/is-active), and " | |
| "'echo \"content\" > /path/to/file' for writing files." | |
| ), | |
| ) | |
| class DiskPanicObservation(Observation): | |
| """State of the simulated server after the last command.""" | |
| stdout: str = Field(default="", description="Output of the last command") | |
| df_output: str = Field(default="", description="Current simulated `df -h /`") | |
| service_status: str = Field(default="unknown", description="State of app.service") | |
| task_id: str = Field(default="easy", description="Current task id (easy/medium/hard)") | |
| step: int = Field(default=0, description="Step count in current episode") | |
| last_error: Optional[str] = Field(default=None, description="Last command error, if any") | |