Skip to content

[ARCH-07] crates/client/src/lib.rs is 1,941 LOC with 18 pub mod entries — unbounded public surface #259

@intendednull

Description

@intendednull

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.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions