refactor(cmd/lib + config/loader/core + config/encryption): selective (ADR-025 L2)

Three files with 3 stars each -> selective.

cmd/lib.nu:
  utils/init.nu     [get-workspace-path get-provisioning-infra-path] (kept)
  sops/lib.nu       [find-sops-key on_sops]
  config/accessor   DROPPED (dead)
  utils/ui.nu       DROPPED (dead)

config/loader/core.nu:
  All 3 star-imports (interpolators, context_manager, sops_handler) were
  dead — NONE of their exports are used in the file body. All dropped.

config/encryption.nu:
  sops/lib.nu          [3 symbols — get-sops-age-key-file is_sops_file on_sops]
  kms/lib.nu           [on_kms]
  plugins/kms.nu       [3 symbols] (already selective; kept)
  config/accessor      DROPPED (dead)

Deferred from this batch: cmd/environment.nu.
It calls 7+ functions that are not defined anywhere in the codebase
(list-available-environments, get-current-environment, switch-environment,
init-environment-config, show-config, compare-environments, etc.).
Converting its star-imports to selective would surface those as undefined
symbol errors. Needs the Blocker-1 style treatment (stubs or elimination)
in a dedicated commit. Tracked as follow-up.

Validation: all 3 nu --ide-check 50 -> 0 errors.

Refs: ADR-025
This commit is contained in:
Jesús Pérez 2026-04-17 08:58:20 +01:00
parent a58a215fd4
commit ee68806cb1
Signed by: jesus
GPG key ID: 9F243E355E0BC939
3 changed files with 12 additions and 11 deletions

View file

@ -1,9 +1,9 @@
# Made for prepare and postrun
use ../config/accessor.nu *
use ../utils/ui.nu *
use ../utils/init.nu [get-workspace-path get-provisioning-infra-path]
use ../sops *
# Selective imports (ADR-025 Phase 3 Layer 2).
# config/accessor and utils/ui star-imports were dead — dropped.
use lib_provisioning/utils/init.nu [get-workspace-path get-provisioning-infra-path]
use lib_provisioning/sops/lib.nu [find-sops-key on_sops]
export def log_debug [
msg: string

View file

@ -3,10 +3,11 @@
# Optimized with nu_plugin_kms for 10x performance improvement
use std log
use ../sops/lib.nu *
use ../kms/lib.nu *
use ../plugins/kms.nu [plugin-kms-decrypt plugin-kms-encrypt plugin-kms-info]
use accessor.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# config/accessor star-import was dead — dropped.
use lib_provisioning/sops/lib.nu [get-sops-age-key-file is_sops_file on_sops]
use lib_provisioning/kms/lib.nu [on_kms]
use lib_provisioning/plugins/kms.nu [plugin-kms-decrypt plugin-kms-encrypt plugin-kms-info]
# Detect if a config file is encrypted
export def is-encrypted-config [

View file

@ -3,9 +3,9 @@
# Dependencies: interpolators, validators, context_manager, sops_handler, cache modules
use std log
use ../interpolators.nu *
use ../context_manager.nu *
use ../sops_handler.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# All 3 star-imports (interpolators, context_manager, sops_handler) were dead
# in this file (no exported symbols used). Dropped.
# Cache integration - temporarily disabled due to Nushell parser issues
# use ../cache/core.nu *