# pub(crate) visibility pass (https://jackin.tailrocks.com/roadmap/pub-crate-visibility/)



**Status**: Partially implemented — `unreachable_pub = "deny"` is now enabled in the workspace lint baseline; remaining work is any intentional visibility cleanup found by fresh compiler/clippy evidence, not the old advisory-warning count.

## Problem [#problem]

`jackin` has a real library surface: <RepoFile path="crates/jackin/src/lib.rs">crates/jackin/src/lib.rs</RepoFile> publicly exports most top-level modules and <RepoFile path="crates/jackin/src/bin/role.rs">crates/jackin/src/bin/role.rs</RepoFile> consumes the library. That means a blanket "binary crate ⇒ convert everything to `pub(crate)`" pass would be wrong. The actual readability problem is narrower: some items are still wider than needed.

## What shipped (2026-06-02) [#what-shipped-2026-06-02]

* **Lint enabled**: `unreachable_pub = "deny"` now lives in the root workspace lint table in <RepoFile path="Cargo.toml">Cargo.toml</RepoFile>. The old advisory pass is complete enough that CI treats new unreachable-public items as hard errors.
* **Some low-hanging-fruit items were narrowed**, including `EnvLayerState`, `LaunchError`, `inspect_attach_outcome`, and `parse_session_count` in the runtime launch/attach area.
* **Fresh audit correction:** several older “fixed” bullets were too broad. Current code still has wider visibility on some previously named candidates, including planner types/functions in <RepoFile path="crates/jackin-config/src/planner.rs">crates/jackin-config/src/planner.rs</RepoFile>, `BUILTIN_ROLES` in <RepoFile path="crates/jackin-config/src/app_config/roles.rs">crates/jackin-config/src/app\_config/roles.rs</RepoFile>, and selected attach helpers in <RepoFile path="crates/jackin-runtime/src/runtime/attach.rs">crates/jackin-runtime/src/runtime/attach.rs</RepoFile>. Treat those as current candidates, not shipped facts.

## Remaining work [#remaining-work]

Do not use the old advisory-warning snapshot; it predates the deny baseline. Re-audit from current compiler/clippy output before opening any follow-up, then scope the pass to concrete items that still leak wider visibility than needed.

The next pass should:

1. Decide the intended library surface in <RepoFile path="crates/jackin/src/lib.rs">crates/jackin/src/lib.rs</RepoFile> — what truly needs to stay `pub` for `main.rs`, `jackin-role`, and tests.
2. Work through the private-module clusters (console services, runtime universe) where `pub(super)` is the obvious narrowing.
3. Verify `cargo nextest run` still passes after each batch.

## What stays `pub` [#what-stays-pub]

* `pub fn run` and other intentionally exported library entrypoints used by sibling binaries
* validation helpers consumed by <RepoFile path="crates/jackin/src/bin/role.rs">crates/jackin/src/bin/role.rs</RepoFile>
* any types that are deliberately part of the internal library boundary exposed from <RepoFile path="crates/jackin/src/lib.rs">crates/jackin/src/lib.rs</RepoFile>

## Caveats [#caveats]

Do not treat `unreachable_pub` as a turnkey "convert hundreds of bare `pub` items" script. It is a cleanup aid for the current exported shape, not a substitute for deciding what the library boundary should be.
