-
Notifications
You must be signed in to change notification settings - Fork 18
Open
Description
Problem
Every mod.rs does pub use foo::* and lib.rs re-exports everything:
pub use adapter::chat::*;
pub use augmentation::*;
pub use core::*;
pub use data::*;
// ... etcThis makes the entire crate flat at the root — hundreds of items. Consequences:
- Name collisions (e.g.
PredictionvsPredicted, DSRsToolCallvs rigToolCall) - Impossible to tell what's public API vs internal
- IDE autocomplete noise
- Adding anything to any submodule automatically becomes public
Proposal
Move to explicit re-exports at the crate root:
// Core types users need
pub use core::{Module, Signature, Predict, Predicted, CallMetadata, PredictError, LM};
pub use core::signature::SignatureSchema;
// ... etcKeep pub mod for submodules so users can reach internals via dspy_rs::core::whatever if needed, but the root namespace should be curated.
Impact
- Breaking change for downstream code that relies on flat imports
- But the crate is pre-1.0, so this is the time to do it
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels