Smitaambiger opened a new pull request, #656:
URL: https://github.com/apache/burr/pull/656

   Closes #407
   
   This PR adds AST-based validation for undeclared state reads in 
function-based actions.
   
   ### What this does
   
   - Parses the originating function using `inspect.getsource`
   - Walks the AST to detect `state["<literal>"]` accesses
   - Compares detected keys with declared `reads=[...]`
   - Raises `ValueError` if undeclared keys are accessed
   - Skips validation when source is unavailable
   
   ### Why
   
   Prevents silent bugs caused by accessing state keys that were not declared 
in `reads`, enforcing stricter action correctness.
   
   ### Tests
   
   - Added unit tests covering:
     - Valid declared reads
     - Undeclared read detection
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to