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
{{ message }}
Repository navigation
Flatten pub-use-star re-exports into explicit public API #76
core/mod.rs → pub use lm::*; pub use module::*; pub use specials::*; pub use settings::*; etc.
data/mod.rs → pub use dataloader::*; pub use example::*; pub use prediction::*; etc.
This creates a flat namespace at crate root with name collisions already present (DSRs ToolCall vs rig ToolCall).
Proposed curated root exports:
// Types every user needspubuse core::signature::Signature;pubuse core::module::Module;pubuse core::schema::SignatureSchema;pubuse core::predicted::{Predicted,CallMetadata};pubuse core::errors::{PredictError,ParseError,LmError};pubuse core::lm::LM;pubuse core::settings::configure;pubuse predictors::predict::Predict;pubuse predictors::example::Example;pubuse modules::chain_of_thought::ChainOfThought;pubuse augmentation::WithReasoning;pubuse evaluate::{TypedMetric, evaluate_trainset};pubuse optimizer::{Optimizer,COPRO,GEPA,MIPROv2};pubuse data::dataloader::DataLoader;// Keep pub mod for everything so users CAN reach internalspubmod adapter;pubmod core;// ...
Breaking change scope: Any downstream code using use dspy_rs::* that relied on internal types being at root level. But the crate is pre-1.0 and the downstream user count is small. Better to do this now.
Approach: do it in one PR. cargo check against all tests/examples will catch everything that breaks. Most fixes will be adding a module path prefix.
Activity
darinkishore commentedon Feb 12, 2026
Codebase audit — current re-export surface
lib.rs lines 100-112:
Plus each
mod.rsdoes its ownpub use *:core/mod.rs→pub use lm::*; pub use module::*; pub use specials::*; pub use settings::*;etc.data/mod.rs→pub use dataloader::*; pub use example::*; pub use prediction::*;etc.This creates a flat namespace at crate root with name collisions already present (DSRs
ToolCallvs rigToolCall).Proposed curated root exports:
Breaking change scope: Any downstream code using
use dspy_rs::*that relied on internal types being at root level. But the crate is pre-1.0 and the downstream user count is small. Better to do this now.Approach: do it in one PR.
cargo checkagainst all tests/examples will catch everything that breaks. Most fixes will be adding a module path prefix.