From 296cf34ae9fff3f5c8aebacd4e2afe34408c198d Mon Sep 17 00:00:00 2001 From: Levi Neuwirth Date: Mon, 6 Jul 2026 11:57:56 -0400 Subject: [PATCH] refactor(lua): re-export install_* wiring fns to preserve the public API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review follow-up on the F-016 split. install_diag / install_project_index / install_mcp were `pub fn` reachable at crate::lua_bindings::install_* be- fore the split, but moving them into private child modules dropped those paths without a re-export — shrinking the public API, which the split is supposed to preserve. (They take crate-internal handle types so no external caller can invoke them, and none does, so nothing actually broke — but the paths should still resolve.) Re-export all three alongside the factories/handles already re-exported, restoring the paths for the two already-merged tranches (diag, index) too. Deliberately narrowing these to pub(crate) is left as a separate change. Validated: fmt clean; clippy --lib clean under both Lua flavors; full lib suite 1437 passed / 0 failed under luajit. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_014TXbAwk27agwhrNNrhLi2U --- docs/lua-bindings-split-framing.md | 9 +++++++++ src/lua_bindings/mod.rs | 14 +++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/docs/lua-bindings-split-framing.md b/docs/lua-bindings-split-framing.md index c387516..1304f0d 100644 --- a/docs/lua-bindings-split-framing.md +++ b/docs/lua-bindings-split-framing.md @@ -230,5 +230,14 @@ McpServerIdLua` (moving it into a private module had dropped it from the crate surface, surfacing as dead-code on `id()`; the split must not shrink the public API). `mod.rs`: 14,603 → 14,020 lines. +Review follow-up: the `pub` `install_*` wiring fns (`install_diag`, +`install_project_index`, `install_mcp`) were `pub` before the split but +weren't re-exported, silently dropping their `crate::lua_bindings::*` +paths. They take crate-internal handle types (so no external caller can +invoke them, and none does), but to keep the split strictly API-preserving +they're now re-exported alongside the factories/handles — restoring the +paths for the two already-merged tranches too. Deliberately narrowing them +to `pub(crate)` is left as a separate, intentional change. + Validated: `cargo fmt` clean; `clippy --lib` clean under **both** flavors; full lib suite **1437 passed / 0 failed** under **both** luajit and lua54. diff --git a/src/lua_bindings/mod.rs b/src/lua_bindings/mod.rs index 412a813..5a171d6 100644 --- a/src/lua_bindings/mod.rs +++ b/src/lua_bindings/mod.rs @@ -81,11 +81,15 @@ use crate::workers_buffer; mod diag; mod index; mod mcp; -pub use index::{SharedProjectIndexer, make_project_indexer}; -// `McpServerIdLua` is re-exported to preserve its prior public path -// (`crate::lua_bindings::McpServerIdLua`) — the split must not shrink the -// public API surface. -pub use mcp::{McpServerIdLua, make_mcp_manager}; +// Every `pub` item a moved domain owned is re-exported so its prior +// `crate::lua_bindings::` path still resolves — the split must not +// shrink the public API surface. That includes the `install_*` wiring fns: +// they take crate-internal handle types (so external callers can't invoke +// them), but they were `pub`, so their paths are preserved for +// compile-compatibility; any deliberate narrowing is a separate change. +pub use diag::install_diag; +pub use index::{SharedProjectIndexer, install_project_index, make_project_indexer}; +pub use mcp::{McpServerIdLua, install_mcp, make_mcp_manager}; // --------------------------------------------------------------------------- // Shared registry alias