| from dataclasses import dataclass, field | |
| from typing import Dict, List, Any, Optional | |
| class Action: | |
| action_type: str # read_logs, analyze_error, edit_config, run_tests, validate_fix, submit_solution | |
| parameters: Dict[str, Any] # e.g., {"target_step": "build", "new_value": "npm test"} | |
| confidence: float # agent's self-reported confidence (0.0 to 1.0) | |
| reasoning: str # agent's internal reasoning string | |
| class Observation: | |
| pipeline_yaml: str # current YAML config | |
| error_message: str # latest error | |
| logs: List[str] # execution logs | |
| step_blame_scores: Dict[str, float] # causal blame scores per pipeline step (0-1) | |
| available_actions: List[str] # action space mask | |
| episode_history: List[Dict[str, Any]] # past actions + outcomes | |
| memory_hits: List[Dict[str, Any]] # similar past failures retrieved from memory bank | |