refactor(utils/ui): selective re-exports replace star re-exports (ADR-025 Layer 2)

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
This commit is contained in:
Jesús Pérez 2026-04-17 07:55:46 +01:00
parent 8de5e63c2b
commit 522531271d
Signed by: jesus
GPG key ID: 9F243E355E0BC939

View file

@ -1,10 +1,25 @@
# UI facade — selective re-exports (ADR-025 Phase 3 Layer 2).
# Previously used `export use <file>.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]