From 0aa0b187d7732f7ed5c1f27c50f52589d496b604 Mon Sep 17 00:00:00 2001 From: Michael Mikovsky <77305074+Astatin3@users.noreply.github.com> Date: Sun, 26 Apr 2026 13:55:53 -0600 Subject: [PATCH] Tighten compile-time leaf inventory checks --- unshell-leaves/src/remote_shell/mod.rs | 7 +++++++ unshell-macros/src/leaf_decl.rs | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/unshell-leaves/src/remote_shell/mod.rs b/unshell-leaves/src/remote_shell/mod.rs index 0eeb2d8..1936d7e 100644 --- a/unshell-leaves/src/remote_shell/mod.rs +++ b/unshell-leaves/src/remote_shell/mod.rs @@ -12,11 +12,18 @@ pub mod endpoint; #[cfg(feature = "leaf_tui")] pub mod tui; +#[cfg(feature = "leaf_endpoint")] +pub use endpoint::Open; #[cfg(feature = "leaf_endpoint")] pub use endpoint::RemoteShellEndpoint; #[cfg(feature = "leaf_tui")] pub use tui::RemoteShellTui; +#[cfg(not(feature = "leaf_endpoint"))] +/// Compile-time procedure symbol kept available even when the endpoint runtime is +/// not built, so the leaf declaration still validates its declared inventory. +pub struct Open; + /// Open-request payload for the remote shell leaf. /// /// The shell currently needs no structured arguments, but a named payload type is diff --git a/unshell-macros/src/leaf_decl.rs b/unshell-macros/src/leaf_decl.rs index 9b97af7..818c7c4 100644 --- a/unshell-macros/src/leaf_decl.rs +++ b/unshell-macros/src/leaf_decl.rs @@ -167,6 +167,7 @@ pub(crate) fn expand_leaf_declaration(input: LeafDeclarationInput) -> Result>(); + let procedure_type_checks = input.procedures.iter(); let endpoint_impl = input .endpoint_struct @@ -225,6 +226,10 @@ pub(crate) fn expand_leaf_declaration(input: LeafDeclarationInput) -> Result;)* + }; + #endpoint_impl #tui_impl })