You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we need to figure out some way to have it be type checked though, which seems tricky, because we want to preserve the behavior of DSPy modules where modules can add (or mutate) fields.
CacheEntry → store raw messages + BamlValue, not Prediction
load_jsonl/save_examples_as_jsonl → deprecate or make generic over Serialize/Deserialize
Then Example can become pub(crate) or removed entirely
MetaSignature: probably not needed once Example is gone. The typed SignatureSchema + Facet reflection covers field mutation (optimizers already use named_parameters walker to find and mutate Predict leaves).
Activity
darinkishore commentedon Feb 12, 2026
Codebase audit — remaining untyped signature usage
Where
Example(untyped HashMap) still lives:Cache (
utils/cache.rs):Cache::get(&self, key: RawExample)— cache key is derived from ExampleCache::insert(&mut self, key: RawExample, ...)CacheEntry { prompt: String, prediction: Prediction }— Prediction is also untypedSerialization (
data/serialize.rs):load_jsonl()returnsVec<Example>(untyped)save_examples_as_jsonl()takesVec<Example>Prediction (
data/prediction.rs):Predictionlikely wraps untyped data (need to check)Macros (
lib.rs):field!macro emitsserde_json::Valuevia schemarssign!macro createsPredict::<__InlineSignature>::new()but doesn't wire up typed infra__macro_supportre-exportsschemarssolely forfield!Specials (
core/specials.rs):History,ToolCallderiveschemars::JsonSchemaschemars removal path:
specials.rsto BamlType/Facet (Migrate specials.rs (History, ToolCall, NoTool) to typed architecture #72)field!/sign!to emit typedSignatureSchema(Modernize field!/sign!/hashmap! macros to emit typed SignatureSchema #73)schemarsfrom__macro_supportandCargo.tomlExample removal path:
CompletionRequest(Cache: fix key to be request-based, not Example-based #71)CacheEntry→ store raw messages + BamlValue, not Predictionload_jsonl/save_examples_as_jsonl→ deprecate or make generic overSerialize/DeserializeExamplecan becomepub(crate)or removed entirelyMetaSignature: probably not needed once Example is gone. The typed
SignatureSchema+ Facet reflection covers field mutation (optimizers already usenamed_parameterswalker to find and mutate Predict leaves).