In-memory persistence for stateless WASM environments.
Since LLM tool calls execute independently in the Pyodide loop, we must retain
robust pointers to the active GlassBox Dataset between Inspector, Cleaner, and Trainer hits.
StateManager
verify_dataset
Validates safety rule enforcing LLM calls InspectDataAPI before attempting
to clean or train on nil references.
Source code in glassbox/ironclaw/state.py
| def verify_dataset(self) -> Any:
"""
Validates safety rule enforcing LLM calls InspectDataAPI before attempting
to clean or train on nil references.
"""
dataset = self.get("dataset")
if dataset is None:
raise ValueError("No active dataset. The agent must run InspectDataAPI first.")
return dataset
|