refactor(workspace/*): selective imports in 5 files (ADR-025 L2)

Five workspace/ files, 2 stars each -> selective.

workspace/sync.nu:
  user/config.nu [get-active-workspace get-workspace-path]
  config/accessor  DROPPED (dead)

workspace/notation.nu:
  user/config.nu [load-user-config]
  utils/config    DROPPED (dead)

workspace/migration.nu:
  user/config.nu       [get-workspace-path validate-workspace-exists]
  workspace/version.nu [5 symbols — add-migration-record, ...]

workspace/enforcement.nu:
  user/config.nu       [get-active-workspace get-active-workspace-details]
  workspace/version.nu [check-workspace-compatibility validate-workspace-structure]

workspace/detection.nu:
  user/config.nu       [get-active-workspace]
  workspace/notation.nu [get-workspace-path list-workspaces]
  — pre-existing name collision: get-workspace-path + list-workspaces
    exported by BOTH user/config and notation. Attributed to notation.nu
    (consistent with workspace/commands.nu treatment).

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

Refs: ADR-025
This commit is contained in:
Jesús Pérez 2026-04-17 09:04:29 +01:00
parent d50fa22d92
commit f2985043ee
Signed by: jesus
GPG key ID: 9F243E355E0BC939
5 changed files with 21 additions and 10 deletions

View file

@ -1,8 +1,12 @@
# Workspace and Infrastructure Detection # Workspace and Infrastructure Detection
# Provides PWD-based inference and context management for workspace and infrastructure # Provides PWD-based inference and context management for workspace and infrastructure
use ../user/config.nu * # Selective imports (ADR-025 Phase 3 Layer 2).
use notation.nu * # Name collision: get-workspace-path + list-workspaces exported by both
# user/config.nu and workspace/notation.nu. Attribute to notation.nu
# (consistent with workspace/commands.nu treatment).
use lib_provisioning/user/config.nu [get-active-workspace]
use lib_provisioning/workspace/notation.nu [get-workspace-path list-workspaces]
# Infer workspace from current working directory # Infer workspace from current working directory
# Checks if PWD is inside any registered workspace path # Checks if PWD is inside any registered workspace path

View file

@ -2,8 +2,9 @@
# Enforces workspace requirements for all provisioning operations # Enforces workspace requirements for all provisioning operations
use std log use std log
use ../user/config.nu * # Selective imports (ADR-025 Phase 3 Layer 2).
use version.nu * use lib_provisioning/user/config.nu [get-active-workspace get-active-workspace-details]
use lib_provisioning/workspace/version.nu [check-workspace-compatibility validate-workspace-structure]
# Commands that are allowed without an active workspace # Commands that are allowed without an active workspace
export def get-workspace-exempt-commands [] { export def get-workspace-exempt-commands [] {

View file

@ -2,8 +2,12 @@
# Handles workspace migrations between versions with backups and rollback # Handles workspace migrations between versions with backups and rollback
use std log use std log
use ../user/config.nu * # Selective imports (ADR-025 Phase 3 Layer 2).
use version.nu * use lib_provisioning/user/config.nu [get-workspace-path validate-workspace-exists]
use lib_provisioning/workspace/version.nu [
add-migration-record get-system-version get-workspace-metadata-path
init-workspace-metadata load-workspace-metadata
]
# Migration strategy definitions # Migration strategy definitions
export def get-migration-strategies [] { export def get-migration-strategies [] {

View file

@ -1,8 +1,9 @@
# Workspace:Infrastructure Notation Parser # Workspace:Infrastructure Notation Parser
# Handles parsing and validation of unified workspace:infra notation # Handles parsing and validation of unified workspace:infra notation
use ../user/config.nu * # Selective imports (ADR-025 Phase 3 Layer 2).
use ../utils/config.nu * # utils/config star-import was dead — dropped.
use lib_provisioning/user/config.nu [load-user-config]
# Parse workspace:infra notation # Parse workspace:infra notation
# Supports both "workspace" and "workspace:infra" formats # Supports both "workspace" and "workspace:infra" formats

View file

@ -1,8 +1,9 @@
# Workspace sync and update operations # Workspace sync and update operations
# Synchronizes workspace hidden directories with provisioning source # Synchronizes workspace hidden directories with provisioning source
use ../config/accessor.nu * # Selective imports (ADR-025 Phase 3 Layer 2).
use ../user/config.nu * # config/accessor star-import was dead — dropped.
use lib_provisioning/user/config.nu [get-active-workspace get-workspace-path]
# Update all workspace hidden directories and content # Update all workspace hidden directories and content
export def "workspace update" [ export def "workspace update" [