File size: 1,132 Bytes
0eebcd6
 
7d1d233
0eebcd6
 
 
7d1d233
 
 
 
 
 
0eebcd6
 
 
 
 
 
7d1d233
0eebcd6
 
 
 
 
 
 
 
 
 
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
# 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