Part of #1075. Depends on #1091 (Phase 2).
What
Same mechanical change as Phase 2 (run(gremlin), replace state.X with gremlin.state.X), but Loop has the most complex state interactions — it rebinds artifacts, records fields, calls record_bail(), and manages scope across iterations — so it gets its own phase.
Verify every state.* call in loop.py has a clear mapping through gremlin.state.*. Remove the State import.
Files
Part of #1075. Depends on #1091 (Phase 2).
What
Same mechanical change as Phase 2 (
run(gremlin), replacestate.Xwithgremlin.state.X), but Loop has the most complex state interactions — it rebinds artifacts, records fields, callsrecord_bail(), and manages scope across iterations — so it gets its own phase.Verify every
state.*call inloop.pyhas a clear mapping throughgremlin.state.*. Remove theStateimport.Files
gremlins/stages/loop.py