Codebase healthPhase 1 — Documentation & setup

pub(crate) visibility pass

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

jackin has a real library surface: crates/jackin/src/lib.rs publicly exports most top-level modules and crates/jackin/src/bin/role.rs 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)

  • Lint enabled: unreachable_pub = "deny" now lives in the root workspace lint table in Cargo.toml. 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 crates/jackin-config/src/planner.rs, BUILTIN_ROLES in crates/jackin-config/src/app_config/roles.rs, and selected attach helpers in crates/jackin-runtime/src/runtime/attach.rs. Treat those as current candidates, not shipped facts.

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 crates/jackin/src/lib.rs — 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

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.

On this page