From 522531271d58299255e39fe4e2f744bf39ced1b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesu=CC=81s=20Pe=CC=81rez?= Date: Fri, 17 Apr 2026 07:55:46 +0100 Subject: [PATCH] refactor(utils/ui): selective re-exports replace star re-exports (ADR-025 Layer 2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ui.nu is a 5-line facade re-exporting UI primitives from clean.nu, error.nu, help.nu, interface.nu, undefined.nu. All five used `export use X *` — ADR-025 transitivity rule prohibits these root star-re-exports. Replaced each star with explicit symbol lists (19 symbols total): clean.nu [cleanup] (1) error.nu [throw-error safe-execute] (2) help.nu [parse_help_command] (1) interface.nu [13 symbols, one per line] (13) undefined.nu [option_undefined invalid_task] (2) The facade keeps the 2 callers (cmd/environment.nu, cmd/lib.nu) working with their existing `use ../utils/ui.nu *` pattern — the consumers see identical behaviour, but the symbol set is now explicit and bounded. Validation: nu --ide-check 50 ui.nu -> 0 errors nu --ide-check 50 cmd/environment.nu -> 0 errors (regression check) nu --ide-check 50 cmd/lib.nu -> 0 errors (regression check) Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 2 --- nulib/lib_provisioning/utils/ui.nu | 33 ++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/nulib/lib_provisioning/utils/ui.nu b/nulib/lib_provisioning/utils/ui.nu index effd3b4..28577cc 100644 --- a/nulib/lib_provisioning/utils/ui.nu +++ b/nulib/lib_provisioning/utils/ui.nu @@ -1,10 +1,25 @@ +# UI facade — selective re-exports (ADR-025 Phase 3 Layer 2). +# Previously used `export use .nu *` which propagates the full export graph +# of each file through every consumer. Selective re-exports keep the facade's +# convenience (one import gets all UI primitives) while bounding the symbol set +# so transitivity checks can verify what leaks through. -# Exclude minor or specific parts for global 'export use' - - -export use clean.nu * -export use error.nu * -export use help.nu * - -export use interface.nu * -export use undefined.nu * +export use clean.nu [cleanup] +export use error.nu [throw-error safe-execute] +export use help.nu [parse_help_command] +export use interface.nu [ + get-provisioning-no-terminal + get-provisioning-out + set-provisioning-no-terminal + set-provisioning-out + get-notify-icon + _ansi + format_out + _print + end_run + show_clip_to + log_debug + desktop_run_notify + detect_claude_code +] +export use undefined.nu [option_undefined invalid_task]