Part of #1075. Depends on #1093 (Phase 4). Can be worked in parallel with #1094 (Phase 5).
What
The remaining external callers don't run stages; they read or write state for orchestration purposes (listing, landing, resuming). They should hold a Gremlin and access gremlin.state.* directly rather than calling StateData.load, build_state, etc.
| File |
Currently uses |
Route to |
fleet/land.py |
landable_shape, resolve_artifact_dir, StateData, build_state |
Gremlin.load(gremlin_id) → gremlin.state.* |
fleet/views.py |
StateData for status reads |
Gremlin.load(gremlin_id).state.* |
executor/run.py |
StateData.load, resolve_artifact_dir, resolve_state_file |
Already uses Gremlin; remove residual direct calls, access via gremlin.state.* |
launcher.py |
StateData, validate_gremlin_id |
Gremlin constructor + gremlin.state.* |
cli/resume.py |
validate_gremlin_id |
Gremlin.validate_id() or launcher.resume() |
utils/proc.py |
State under TYPE_CHECKING only |
Change type annotation to Gremlin |
Add a Gremlin.load(gremlin_id) classmethod so callers that only need to inspect persisted state don't have to call StateData.load directly — they get a Gremlin with gremlin.state pre-populated from disk. Remove state.py imports from each file.
Files
gremlins/fleet/land.py
gremlins/fleet/views.py
gremlins/executor/run.py
gremlins/launcher.py
gremlins/cli/resume.py
gremlins/utils/proc.py
gremlins/executor/gremlin.py (new load classmethod)
Part of #1075. Depends on #1093 (Phase 4). Can be worked in parallel with #1094 (Phase 5).
What
The remaining external callers don't run stages; they read or write state for orchestration purposes (listing, landing, resuming). They should hold a
Gremlinand accessgremlin.state.*directly rather than callingStateData.load,build_state, etc.fleet/land.pylandable_shape,resolve_artifact_dir,StateData,build_stateGremlin.load(gremlin_id)→gremlin.state.*fleet/views.pyStateDatafor status readsGremlin.load(gremlin_id).state.*executor/run.pyStateData.load,resolve_artifact_dir,resolve_state_fileGremlin; remove residual direct calls, access viagremlin.state.*launcher.pyStateData,validate_gremlin_idGremlinconstructor +gremlin.state.*cli/resume.pyvalidate_gremlin_idGremlin.validate_id()orlauncher.resume()utils/proc.pyStateunderTYPE_CHECKINGonlyGremlinAdd a
Gremlin.load(gremlin_id)classmethod so callers that only need to inspect persisted state don't have to callStateData.loaddirectly — they get aGremlinwithgremlin.statepre-populated from disk. Removestate.pyimports from each file.Files
gremlins/fleet/land.pygremlins/fleet/views.pygremlins/executor/run.pygremlins/launcher.pygremlins/cli/resume.pygremlins/utils/proc.pygremlins/executor/gremlin.py(newloadclassmethod)