Skip to content

[TD-12] Only 10 pub(crate) declarations across the workspace #330

Open

Description

@intendednull

Audit finding from #300 (commit 679f9fe)

Severity: low
Category: tech debt / API surface
File: tree-wide; counted by rg "^pub\(crate\)" --type rust
Obvious fix: no

Description

Only 10 lines start with pub(crate), while top files declare 60+ pub fn/struct/enum (icons.rs:60, client/storage.rs:33, web/state.rs:32, agent/tools.rs:31). For a workspace where most crates have a clear single consumer (web ← client ← state ← storage), much of this is over-exposed, increasing the API surface that breaks downstream on refactor.

Impact / Threat

Maintenance — accidental coupling, harder to evolve internals.

Suggested fix

Run cargo public-api (or manual review) on client, state, web to flag items used only inside the crate; downgrade to pub(crate) or pub(super).

Verify

rg "^pub\(crate\)" --type rust crates/ | wc -l
rg "^pub fn|^pub struct|^pub enum" --type rust -c crates/ | sort -t: -k2 -nr | head
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions