Commit: 2f26d91 · Finding: ARCH-07
Problem
crates/client/src/lib.rs:1-1941 is the single largest file in the crate, declaring 18 pub mod entries plus several pub use shortcuts. ClientHandle has a small intended public API (views(), mutations()), but the enforced public surface includes mentions, mutations, state, state_actors, presence, views, etc.
Callers (web, agent) can — and do — pick from any of them, making "what's public" impossible to reason about.
Fix
- Demote most
pub mod to pub(crate) mod or plain mod.
- Re-export the narrow surface callers need:
ClientHandle, ClientConfig, ClientError, ClientEvent, ClientView*, ClientMutations, trust types.
- Split
lib.rs into lib.rs (~50 lines of re-exports) + handle.rs (ClientHandle / ClientConfig) + error.rs + event_receiver.rs.
Obvious? No — broad API changes.
Commit:
2f26d91· Finding:ARCH-07Problem
crates/client/src/lib.rs:1-1941is the single largest file in the crate, declaring 18pub modentries plus severalpub useshortcuts.ClientHandlehas a small intended public API (views(),mutations()), but the enforced public surface includesmentions,mutations,state,state_actors,presence,views, etc.Callers (web, agent) can — and do — pick from any of them, making "what's public" impossible to reason about.
Fix
pub modtopub(crate) modor plainmod.ClientHandle,ClientConfig,ClientError,ClientEvent,ClientView*,ClientMutations, trust types.lib.rsintolib.rs(~50 lines of re-exports) +handle.rs(ClientHandle/ClientConfig) +error.rs+event_receiver.rs.Obvious? No — broad API changes.