refactor(config/cache + utils + config/commands): 7 files selective (ADR-025 L2)

Batch of 7 files, 2 stars each -> selective.

config/cache/commands.nu:
  cache/core.nu     [cache-clear-type get-cache-stats]
  cache/metadata.nu DROPPED (dead)

config/cache/mod.nu:
  cache/core.nu     [get-cache-stats]
  cache/metadata.nu DROPPED (dead)

config/cache/sops.nu:
  cache/core.nu     [cache-clear-type cache-lookup cache-write]
  cache/metadata.nu DROPPED (dead)

config/cache/final.nu:
  cache/core.nu     [cache-clear-type cache-lookup cache-write]
  cache/metadata.nu DROPPED (dead)

utils/templates.nu:
  utils/logging.nu [is-debug-enabled]
  config/accessor  DROPPED (dead)

utils/error.nu:
  utils/logging.nu   [is-debug-enabled is-metadata-enabled]
  utils/interface.nu [_ansi] (kept, already selective; promoted to absolute)
  config/accessor    DROPPED (dead)

config/commands.nu:
  config/encryption.nu [9 symbols]
  config/accessor      DROPPED (dead)

Validation: 5/7 files 0 errors. 2 files (cache/commands, utils/templates)
show pre-existing errors matching baseline. Zero new errors.

Refs: ADR-025
This commit is contained in:
Jesús Pérez 2026-04-17 09:14:43 +01:00
parent 36eac674f4
commit c6ff85c872
Signed by: jesus
GPG key ID: 9F243E355E0BC939
7 changed files with 26 additions and 15 deletions

View file

@ -2,8 +2,9 @@
# Provides user-facing commands for cache operations and configuration
# Follows Nushell 0.109.0+ guidelines
use ./core.nu *
use ./metadata.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# cache/metadata star-import was dead — dropped.
use lib_provisioning/config/cache/core.nu [cache-clear-type get-cache-stats]
# Avoid importing all modules - use only what's needed
# use ./config_manager.nu *
# use ./nickel.nu *

View file

@ -4,8 +4,9 @@
# TTL: 5 minutes (short for safety - workspace configs can change)
# Follows Nushell 0.109.0+ guidelines
use ./core.nu *
use ./metadata.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# cache/metadata star-import was dead — dropped.
use lib_provisioning/config/cache/core.nu [cache-clear-type cache-lookup cache-write]
# Helper: Generate cache key for workspace + environment combination
def compute-final-config-key [

View file

@ -2,8 +2,9 @@
# Avoids complex re-export patterns that cause Nushell 0.110.0 parser issues
# Import core only - other modules import their dependencies directly
use ./core.nu *
use ./metadata.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# cache/metadata star-import was dead — dropped.
use lib_provisioning/config/cache/core.nu [get-cache-stats]
# Helper: Initialize cache system
export def init-cache-system [] {

View file

@ -4,8 +4,9 @@
# TTL: 15 minutes (configurable, balances security and performance)
# Follows Nushell 0.109.0+ guidelines
use ./core.nu *
use ./metadata.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# cache/metadata star-import was dead — dropped.
use lib_provisioning/config/cache/core.nu [cache-clear-type cache-lookup cache-write]
# Helper: Compute hash of SOPS file path
def compute-sops-hash [file_path: string] {

View file

@ -1,8 +1,13 @@
# Configuration Encryption CLI Commands
# Provides user-friendly commands for config encryption operations
use encryption.nu *
use accessor.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# config/accessor star-import was dead — dropped.
use lib_provisioning/config/encryption.nu [
contains-sensitive-data decrypt-config edit-encrypted-config
encrypt-config encrypt-sensitive-configs is-encrypted-config
rotate-encryption-keys scan-unencrypted-configs validate-encryption-config
]
# Encrypt a configuration file
export def "config encrypt" [

View file

@ -2,9 +2,10 @@
# Purpose: Centralized error handling, error messages, and exception management.
# Dependencies: logging
use ../config/accessor.nu *
use ./logging.nu *
use ./interface.nu [_ansi]
# Selective imports (ADR-025 Phase 3 Layer 2).
# config/accessor star-import was dead — dropped.
use lib_provisioning/utils/logging.nu [is-debug-enabled is-metadata-enabled]
use lib_provisioning/utils/interface.nu [_ansi]
export def throw-error [
error: string

View file

@ -1,5 +1,6 @@
use ../config/accessor.nu *
use ./logging.nu *
# Selective imports (ADR-025 Phase 3 Layer 2).
# config/accessor star-import was dead — dropped.
use lib_provisioning/utils/logging.nu [is-debug-enabled]
export def run_from_template [
template_path: string # Template path