# state.py — Shared State for Autonomous Python Coding Agent from typing import TypedDict # pyhton class that lets us to define dictionary with specific key names class State(TypedDict): task: str # original user requests plan: str # plans before writing code code: str # code generated by this test_result: str # this stores what happened when code is generated it failed crashed or passed ? error: str # message if code execution failed or not ? fixed_code: str # fixed code explanation: str review: str final_code: str retries: int security_retries: int complexity_retries: int reflection_retries: int # own counter — reflection loop no longer piggybacks on "retries" passed: bool is_secure: bool is_simple: bool ast_valid: bool generated_tests: str hypothesis_result: str benchmark_ms: float reflection_ok: bool reflection_notes: str confidence_score: int