Commit graph

67 commits

Author SHA1 Message Date
Jesús Pérez
e8f86d0997
refactor(imports): selective imports in 16 fat-import files (ADR-025 Phase 4.3a) 2026-04-17 17:57:00 +01:00
Jesús Pérez
205402e990
refactor(wrapper): delete 5 remaining fast-paths — single-route complete (ADR-025 Phase 4)
Removed the final 5 fast-path intercepts and their scripts. All list/query
commands now route through a single semantic path.

Bash wrapper — removed intercept blocks:
  - `workspace list/active/info` (was: _nu_minimal + query-workspace-info.nu)
  - `env/allenv`                 (was: _nu_minimal "env-quick | table")
  - `provider/providers list`    (was: scripts/query-providers.nu)
  - `infra list/info`            (was: scripts/query-infra.nu + query-infra-detail.nu)
  - `validate config`            (was: scripts/validate-config.nu)

Preserved in wrapper:
  - workspace `--help` intercept (avoids full load for help)
  - infra with no args → `provisioning help infrastructure` (help menu)

Fast-path scripts deleted:
  - nulib/scripts/query-providers.nu
  - nulib/scripts/query-workspace-info.nu
  - nulib/scripts/query-infra.nu
  - nulib/scripts/query-infra-detail.nu
  - nulib/scripts/validate-config.nu

Remaining scripts/ files (all legitimate, not fast-paths):
  - get-help-category.nu       (help category parsing)
  - prov-bootstrap.nu          (bootstrap logic, not a data query)
  - prov-cluster-deploy.nu     (deploy execution, not a list)
  - validate-command.nu        (registry validation used by _validate_command)
  - README.md

Transitional note:
  These commands temporarily route through the main dispatch `*)` default case
  which still uses $RUNNER (the 492-line Nu runner). Cold-start for them is
  currently slow (~70s in fat-path). Phase 4.3/4.4 will empty root mod.nu and
  delete the Nu runner — restoring <1s cold-start for all commands.

Single-route invariant achieved:
  - No command has two implementations with different semantics
  - Daemon and cache become purely orthogonal concerns (transport + read
    optimization), toggleable without changing what the command returns

Refs: ADR-025 Phase 4, workspaces/libre-daoshi/.coder/2026-04-17-server-list-daemon-middleware.info.md
2026-04-17 17:43:18 +01:00
Jesús Pérez
5d9ce3c591
refactor(wrapper): delete 3 fast-paths — single-route principle (ADR-025 Phase 4)
Removed fast-path intercepts and their scripts for taskserv/server/cluster list
commands. These commands now route exclusively to their thin handlers which
invoke the full semantic path (middleware + live provider state).

Bash wrapper — removed intercept blocks:
  - `taskserv/task list`       (was: scripts/query-taskservs.nu)
  - `server/s list/l`          (was: scripts/query-servers.nu via lib_minimal)
  - `cluster/cl list`          (was: scripts/query-clusters.nu via lib_minimal)

Fast-path scripts deleted:
  - nulib/scripts/query-taskservs.nu
  - nulib/scripts/query-servers.nu
  - nulib/scripts/query-clusters.nu

Preserved:
  - Daemon routing for server list/ls/l (added by parallel work — still routes
    to daemon; daemon internally dispatches to thin handler)
  - Thin handlers provisioning-{taskserv,server,cluster}.nu (ADR-025 canonical)
  - Their `list/ls/l` cases already exist and call `main list` in the full path

Rationale — why single route matters:
The parallel server-list investigation documented that `server list` fast-path
returned different columns than `server ls` (incomplete data — workspace
detection failures, silent fallbacks). Two implementations = two semantics =
bugs of divergence. Deleting the fast-path forces ONE semantic route; daemon
and cache become orthogonal transport/optimization concerns that can be
toggled without changing what the command returns.

Net effect:
  - Same command always returns same data (post-Phase4 all list commands
    align; pre-Phase4 only taskserv/server/cluster are aligned)
  - `prvng server list` with daemon on/off returns identical data
  - Cold-start impact: minor regression (~200-500ms) while Phase 4 completes —
    once mod.nu is emptied and thin handlers fully selective, cold-start drops
    to <1s for these commands even without daemon

Refs: ADR-025 Phase 4, workspaces/libre-daoshi/.coder/2026-04-17-server-list-daemon-middleware.info.md
2026-04-17 17:39:44 +01:00
Jesús Pérez
bea0477b25
refactor(18 files): selective imports — drive to 94.6% elimination (ADR-025 L2/L3)
Final mega-batch of single-star conversions combined in one commit.

=== Orchestrator facades (Layer 3, expanded to explicit symbol lists) ===
  config/accessor.nu            18 symbols (bridges accessor/mod)
  config/accessor_generated.nu  18 symbols (consumer of accessor)
  utils/version.nu              35 symbols (bridges version/mod)
  dependencies/mod.nu            7 symbols from resolver.nu
  oci_registry/mod.nu           12 multi-word "oci-registry X" subcommands
  oci/commands.nu               12 symbols from oci/client.nu
                                + removed redundant `use ./client.nu *` that
                                  was duplicated below the selective import

=== Selective imports (Layer 2) ===
  platform/discovery.nu         target.nu [5 symbols]
  platform/health.nu            target.nu [2 symbols]
  platform/connection.nu        user/config [get-active-workspace]
  vm/preparer.nu                vm/detector [check-vm-capability]
  vm/backend_libvirt.nu         result.nu [7 symbols]
  extensions/tests/test_versions.nu  versions [5 symbols]
  utils/version/loader.nu       nickel_processor [ncl-eval ncl-eval-soft]

=== Dead imports dropped ===
  platform/credentials.nu       user/config
  platform/activation.nu        target
  config/cache/core.nu          cache/metadata
  config/interpolation/core.nu  helpers/environment
  utils/version/loader.nu       version/core (kept nickel_processor)

=== Also included (pre-existing edits from earlier session) ===
  utils/settings.nu             pilot selective imports — reformatted
                                (file was modified externally during session)

Validation: all 18 files match pre-existing baselines (0 errors for clean
ones; 4/18/24/45/50/50 for pre-existing transitive noise).

MILESTONE: 94.6% of star-imports eliminated (370 → 20).

Remaining 20 star-lines in 5 files are intentional:
- lib_provisioning/mod.nu      (13 stars — root facade; empties in ADR-025 Phase 4)
- integrations/mod.nu          (2 stars — re-exports already-selective children)
- cmd/environment.nu           (3 stars — contains ~7 undefined function calls;
                                needs Blocker-1 style cleanup follow-up)
- providers/loader.nu          (1 dynamic `use ($entry_point) *` — runtime dispatch)
- vm/cleanup_scheduler.nu      (1 in string template — not a real import)

Refs: ADR-025
2026-04-17 17:10:47 +01:00
Jesús Pérez
844f6f9297
refactor(17 files final batch): selective imports — drive to 94% elimination (ADR-025 L2/L3)
Final large batch of single-star conversions.

Orchestrator facades (Layer 3, expanded to explicit symbol lists):
  config/accessor.nu          18 symbols (bridges accessor/mod)
  config/accessor_generated.nu 18 symbols (consumer of accessor)
  utils/version.nu            35 symbols (bridges version/mod)
  dependencies/mod.nu         7 symbols from resolver.nu
  oci_registry/mod.nu         12 multi-word "oci-registry X" subcommands
  oci/commands.nu             12 symbols from oci/client.nu

Selective imports (Layer 2):
  platform/discovery.nu       target.nu [5 symbols]
  platform/health.nu          target.nu [2 symbols]
  platform/connection.nu      user/config [get-active-workspace]
  vm/preparer.nu              vm/detector [check-vm-capability]
  vm/backend_libvirt.nu       result.nu [7 symbols]
  extensions/tests/test_versions.nu  versions [5 symbols]
  utils/version/loader.nu     utils/nickel_processor [ncl-eval ncl-eval-soft]

Dead imports dropped:
  platform/credentials.nu     user/config
  platform/activation.nu      target
  config/cache/core.nu        cache/metadata
  config/interpolation/core.nu helpers/environment
  utils/version/loader.nu     version/core (kept nickel_processor)

Validation: all 17 files match pre-existing baselines (or 0 errors for clean
ones). Pre-existing noise in vm/, dependencies/, oci_registry/, oci/commands
is known transitive — unrelated to this work.

MILESTONE: 94% of star-imports eliminated (370 → 21).

Remaining 21 star-lines in 6 files are intentional exceptions:
- integrations/mod.nu      (2 stars, re-exports already-selective children;
                            acceptable bounded scope)
- cmd/environment.nu       (3 stars, contains ~7 undefined function calls —
                            needs Blocker-1 style cleanup in follow-up commit)
- providers/loader.nu      (1 dynamic `use ($entry_point) *` — runtime dispatch)
- vm/cleanup_scheduler.nu  (1 in string template — not a real import)
- lib_provisioning/mod.nu  (13 stars — root facade; empties in ADR-025 Phase 4)

Refs: ADR-025
2026-04-17 17:08:10 +01:00
Jesús Pérez
48c82ac79a
refactor(10 files): selective imports batch 4 (ADR-025 L2)
10 utils/* + workspace/migrate_to_kcl + mode/* files.

Selective imports:
  utils/imports.nu    accessor/functions [get-providers-path get-prov-lib-path get-core-nulib-path]
  utils/logging.nu    accessor/core [config-get]
  utils/generate.nu   accessor/functions [2 symbols]
  utils/files.nu      accessor/core [config-get] + secrets/lib [decode_secret_file]
  utils/qr.nu         accessor/functions [get-provisioning-url]
  utils/undefined.nu  interface + init (kept); accessor DEAD
  utils/interface.nu  accessor/core [config-get] + accessor/functions [get-provisioning-url] + logging [is-debug-enabled]

Dead imports dropped:
  workspace/migrate_to_kcl.nu   config/accessor
  mode/commands.nu              utils/logging
  mode/validator.nu             utils/logging

Validation: all 10 match pre-existing baselines (25/50/42/2 for noisy files,
0 for the others). No new errors.

Refs: ADR-025
2026-04-17 12:20:21 +01:00
Jesús Pérez
1ac3401315
refactor(15 single-star batch 3): selective imports + dead drop (ADR-025 L2)
15 files. Most are dead `use ../config/accessor.nu *` imports dropped.

Selective imports:
  setup/utils.nu                 config/accessor/functions [get-providers-path]
  setup/detection.nu             setup/mod [8 symbols]
  plugins/secretumvault.nu       config/accessor/core [config-get]
  plugins/orchestrator.nu        config/accessor/core [config-get]
  kms/client.nu                  utils/error + utils/interface + plugins/kms
  deploy.nu                      result.nu [7 symbols]
  dependencies/resolver.nu       config/loader [get-config]

Dead imports dropped:
  setup/config.nu                config/accessor
  extensions/profiles.nu         config/accessor
  extensions/loader.nu           config/accessor
  workspace/init.nu              config/accessor
  utils/help.nu                  config/accessor
  utils/error_fixed.nu           config/accessor
  utils/error_clean.nu           config/accessor
  utils/error_final.nu           config/accessor
  dependencies/resolver.nu       oci/client

Validation: all 15 match or IMPROVE baseline:
  - 11 files: 0 errors
  - utils/error_fixed  4 -> 1  (IMPROVED)
  - utils/error_clean  4 -> 1  (IMPROVED)
  - dependencies/resolver  50 = 50 (unchanged pre-existing noise)
  - deploy.nu          19 = 19 (unchanged; file is orphaned — zero importers)

Refs: ADR-025
2026-04-17 12:17:22 +01:00
Jesús Pérez
e5ffc55104
refactor(23 files): selective imports + dangling/broken cleanup (ADR-025 L2/L3)
Large combined batch of 23 files refactored from star-imports to selective.
Grouped because two sub-batches accumulated in staging without intermediate
commit.

=== Orchestrator facades (Layer 3) ===
  ai/mod.nu              [12 symbols from ai/lib.nu]
  config/loader.nu       [14 symbols from loader/mod.nu]
  config/accessor/mod.nu [15 symbols from accessor/functions.nu]
  sops/mod.nu            [11 symbols from sops/lib.nu]
  user/mod.nu            [16 symbols from user/config.nu]

=== Selective imports ===
  defs/lists.nu                      utils/on_select (kept, selective)
  services/manager.nu                (all dead dropped)
  webhook/ai_webhook.nu              ai/lib [4] + settings/lib
  kms/lib.nu                         utils/error + utils/interface + plugins/kms
  gitea/locking.nu                   api_client [8]
  gitea/workspace_git.nu             api_client [3]
  gitea/extension_publish.nu         api_client [8] + config/loader
  infra_validator/rules_engine.nu    config_loader [3]
  plugins/kms.nu                     config/accessor/core [config-get]
  coredns/api_client.nu              config/loader [get-config]

=== Dangling imports removed (target file does not exist) ===
  coredns/docker.nu                  ../utils/log.nu → deleted (uses corefile.nu [2])
  coredns/zones.nu                   ../utils/log.nu → deleted (uses corefile.nu [1])
  coredns/service.nu                 ../utils/log.nu → deleted (uses corefile.nu [2])
  coredns/corefile.nu                ../utils/log.nu → deleted

=== Broken paths cleaned up ===
  project/detect.nu   Former `use ../../../lib_provisioning *` resolved to
    non-existent path (core/lib_provisioning). Silent no-op at runtime.
    Removed. Error count went 19 -> 17.

=== Dead imports dropped ===
  utils/ssh.nu           config/accessor DROPPED (dead)
  utils/init.nu          config/accessor DROPPED (dead)
  infra_validator/agent_interface.nu   report_generator DROPPED (dead)

=== Dynamic imports preserved ===
  providers/loader.nu   line 179 `use ($provider_entry.entry_point) *` is
    intentional runtime dispatch — not convertible to selective.

Validation: all files match pre-existing baseline. Gitea subsystem has
known pre-existing 50-error noise (transitive); independent of this work.

Refs: ADR-025
2026-04-17 12:13:13 +01:00
Jesús Pérez
2f75500702
refactor(5 test files): selective imports + remove dangling (ADR-025 L2)
Five test files, 2 stars each -> selective.

config/encryption_tests.nu:
  config/encryption.nu [7 symbols]
  kms/client.nu        [kms-status]

extensions/tests/test_cache.nu:
  extensions/cache.nu  DROPPED (dead)
  utils/logger.nu      REMOVED (file does not exist — dangling)

extensions/tests/test_oci_client.nu:
  oci/client.nu   [4 symbols]
  utils/logger.nu REMOVED (dangling)

extensions/tests/test_discovery.nu:
  extensions/discovery.nu [5 symbols]
  utils/logger.nu         REMOVED (dangling)

config/loader/test.nu:
  config/validators.nu   [validate-interpolation]
  config/interpolators   DROPPED (dead)

Pre-existing bug found and removed: 3 test files imported
`../../utils/logger.nu` which doesn't exist. Star-import silenced the
missing-file error; with selective imports it would fail. Cleanest fix:
remove the dangling import (the files never actually used any symbols
from logger.nu — it was a zombie import from a long-deleted file).

Validation: 4 files 0 errors. encryption_tests.nu has 1 pre-existing
error matching baseline.

Refs: ADR-025
2026-04-17 09:18:19 +01:00
Jesús Pérez
3e747e1317
refactor(6 production files): plugins_defs + setup + platform + oci + auth_core (ADR-025 L2)
Six production 2-star files -> selective.

plugins_defs.nu:
  utils/nickel_processor.nu [ncl-eval] (kept, already selective)
  utils/ + config/accessor   DROPPED (both dead)

setup/provctl_integration.nu:
  setup/mod.nu   [8 symbols]
  setup/detection DROPPED (dead)

setup/provider.nu:
  setup/mod.nu     [9 symbols]
  setup/validation DROPPED (dead)

platform/autostart.nu:
  platform/target.nu [get-deployment-service-config get-enabled-services]
  platform/health.nu [check-service-health]

plugins/auth_core.nu:
  config/accessor/core.nu [config-get]
  commands/traits.nu      [get-command-metadata]

oci/client.nu:
  utils/logging.nu [log-debug log-error log-info]
  config/accessor  DROPPED (dead)

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

Refs: ADR-025
2026-04-17 09:16:21 +01:00
Jesús Pérez
c6ff85c872
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
2026-04-17 09:14:43 +01:00
Jesús Pérez
36eac674f4
refactor(7 files): extensions + diagnostics + sops + packaging (ADR-025 L2)
Large batch of 7 files, 2 stars each -> selective.

extensions/versions.nu:
  utils/logging.nu [log-debug log-error]
  oci/client.nu    [4 symbols]

extensions/discovery.nu:
  utils/logging.nu [log-debug log-error log-info]
  oci/client.nu    [6 symbols]
  extensions/versions.nu [is-semver sort-by-semver get-latest-version]
    — kept, already selective; promoted to absolute path

extensions/registry.nu:
  extensions/loader.nu [discover-providers discover-taskservs]
  config/accessor      DROPPED (dead)

diagnostics/next_steps.nu:
  user/config.nu  [load-user-config]
  config/accessor DROPPED (dead)

diagnostics/health_check.nu:
  config/accessor/core.nu [config-get]
  user/config.nu          [get-user-config-path load-user-config]

sops/lib.nu:
  utils/interface.nu [_ansi _print]
  utils/init.nu      [3 symbols] (already selective; promoted to absolute)
  config/accessor    DROPPED (dead)

packaging.nu:
  config/accessor/core.nu [get-config]
  utils/ star-import      DROPPED (dead)

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

Refs: ADR-025
2026-04-17 09:12:55 +01:00
Jesús Pérez
5f60c1093b
refactor(5 subsystem mod.nu facades): selective re-exports (ADR-025 L3)
Batch of 5+1 facades converted from star re-exports to explicit symbol lists.

defs/mod.nu:
  about.nu [about_info]
  lists.nu [6 symbols]

integrations/mod.nu:
  ecosystem * (already selective — its re-exports are bounded)
  iac *       (fixed in same commit)

integrations/iac/mod.nu  (bonus fix):
  Former `use iac_orchestrator *` was TWO bugs: (1) missing `./` prefix made
  the import path ambiguous, (2) plain `use` vs `export use` meant the facade
  never actually re-exported anything. Converted to
  `export use ./iac_orchestrator.nu [5 symbols]`.
  Side-effect: nu --ide-check errors went 2 -> 4 because iac_orchestrator.nu
  now actually loads and its pre-existing bugs become visible. Not a
  regression — bugs were hidden, now surfaced.

kms/mod.nu:
  lib.nu    [5 symbols]
  client.nu [6 symbols including multi-word "main"]

mode/mod.nu:
  commands.nu [8 multi-word "mode X"]
  validator.nu [2 symbols]

oci/mod.nu:
  client.nu   [12 symbols]
  commands.nu [11 multi-word "oci X"]

Validation: errors match baseline for all 5 (defs, integrations, kms, mode,
oci). integrations/iac/mod.nu +2 errors are pre-existing bugs in
iac_orchestrator.nu revealed by correct facade behaviour.

Refs: ADR-025
2026-04-17 09:11:19 +01:00
Jesús Pérez
f12fdce746
refactor(vm/*): selective imports in 4 vm/ files (ADR-025 L2)
Four vm/ files, 2 stars each -> selective.

vm/state_recovery.nu:
  vm_persistence.nu [get-vm-persistence-info list-permanent-vms]
  vm/lifecycle.nu   [vm-info vm-start]

vm/ssh_utils.nu:
  vm/backend_libvirt.nu [libvirt-get-vm-ip]
  vm/persistence.nu     [get-vm-state]

vm/lifecycle.nu:
  vm/backend_libvirt.nu [8 symbols — libvirt-* ops]
  vm/persistence.nu     [4 symbols — state tracking]

vm/golden_image_builder.nu:
  vm/lifecycle.nu      [vm-create vm-info vm-stop]
  vm/vm_persistence.nu DROPPED (dead)

Validation: 39-50 pre-existing errors each (matches baseline). Zero new.

Refs: ADR-025
2026-04-17 09:06:21 +01:00
Jesús Pérez
f2985043ee
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
2026-04-17 09:04:29 +01:00
Jesús Pérez
d50fa22d92
refactor(module_loader + layers + diagnostics): selective imports (ADR-025 L2/L3)
Four files, 3 stars each -> selective.

module_loader.nu:
  config/accessor/core.nu [config-get get-config]
  config/cache/simple-cache.nu  DROPPED (dead)
  utils/                        DROPPED (dead)

layers/resolver.nu:
  taskservs/discover.nu [discover-taskservs get-taskserv-info]
  providers/discover.nu [discover-providers get-provider-info]
  clusters/discover.nu  [discover-clusters get-cluster-info]

  Note: these 3 discover.nu files live outside lib_provisioning/ (at
  core/nulib/{taskservs,providers,clusters}/). Absolute paths from
  nulib/ root preserved. Former relative paths (../../) replaced.

diagnostics/system_status.nu:
  config/accessor/core.nu [config-get]
  user/config.nu          [load-user-config]
  plugins/mod.nu          DROPPED (dead)

diagnostics/mod.nu (Layer 3 facade):
  system_status.nu ["provisioning status" "provisioning status-json"]
  health_check.nu  ["provisioning health" "provisioning health-json"]
  next_steps.nu    ["provisioning next" "provisioning phase"]
  All multi-word Nu subcommands, quoted per syntax.

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

Refs: ADR-025
2026-04-17 09:02:05 +01:00
Jesús Pérez
ee68806cb1
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
2026-04-17 08:58:20 +01:00
Jesús Pérez
a58a215fd4
refactor(utils/clean + providers/registry + plugins/auth): selective (ADR-025 L2)
Three files with 3 stars each -> selective.

utils/clean.nu:
  utils/logging.nu   [is-debug-enabled]
  utils/interface.nu [_ansi _print]
  config/accessor    DROPPED (dead)

providers/registry.nu:
  config/accessor/core.nu [config-get]
  utils/logging.nu        [log-debug]
  providers/interface.nu  DROPPED (dead)

plugins/auth.nu:
  config/accessor/core.nu [config-get]
  auth_impl.nu (re-export) [23 symbols]  — converted to explicit list
  utils/path-utils.nu  DROPPED (dead)

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

Refs: ADR-025
2026-04-17 08:54:33 +01:00
Jesús Pérez
ded87bfd65
refactor(utils/version + service-check): selective imports (ADR-025 L2)
Three utils/ files, 3 star-imports each -> selective.

utils/version/taskserv.nu:
  utils/interface.nu [_print]
  version/core.nu    DROPPED (dead)
  version/loader.nu  DROPPED (dead)

utils/version/registry.nu:
  version/core.nu     [fetch-versions]
  version/taskserv.nu [discover-taskserv-configurations]
  utils/interface.nu  [_print]

utils/service-check.nu:
  platform/target.nu          [get-deployment-service-config get-enabled-services]
  platform/health.nu          [check-service-health]
  platform/service-manager.nu [get-external-services]

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

Refs: ADR-025
2026-04-17 08:50:07 +01:00
Jesús Pérez
95b2f72ab0
refactor(cache/coredns/extensions/vm): selective imports — 6 files (ADR-025 L2)
Combined batch of 6 L2 refactors. Same mechanical pattern (star -> selective);
grouped in one commit because batch 1 was staged but not committed before
batch 2 was prepared.

=== extensions/commands.nu (4 stars -> 1 selective, 3 dead) ===
  loader_oci.nu [load-extension] (kept, already selective)
  discovery.nu  [4 symbols]
  cache.nu / versions.nu / utils/logging.nu  DROPPED (dead)

=== coredns/commands.nu (4 stars -> 3 selective, 2 dead + 1 broken) ===
  config/loader.nu [get-config] (already selective; promoted to absolute)
  service.nu  [8 symbols]
  zones.nu    [9 symbols]
  corefile.nu [2 symbols]
  utils/log.nu         REMOVED (file does not exist — dangling import)
  utils/logging.nu     DROPPED (dead)

=== cache/agent.nu (4 stars -> 2 selective, 2 dead) ===
  cache_manager.nu [4 symbols]
  batch_updater.nu [2 symbols]
  version_loader.nu / grace_checker.nu  DROPPED (dead)

=== vm/vm_persistence.nu (3 stars -> 2 selective, 1 dead) ===
  result.nu        [6 symbols]
  vm/lifecycle.nu  [vm-delete]
  vm/persistence.nu  DROPPED (dead)

=== vm/nested_provisioning.nu (3 stars -> 3 selective) ===
  vm/lifecycle.nu            [vm-info]
  vm/volume_management.nu    [volume-attach volume-detach]
  vm/network_management.nu   [network-connect network-disconnect]

=== vm/cleanup_scheduler.nu (3 stars -> 1 selective, 1 dead) ===
  vm/vm_persistence.nu [4 symbols]
  vm/lifecycle.nu      DROPPED (dead)
  Note: line ~211 embeds an intentional template string containing
  `use lib_provisioning/vm/cleanup_scheduler.nu *` — it's Nu script code
  written to disk at runtime for the scheduler daemon. NOT a real import.

Validation (ide-check 50 errors after vs baseline):
  extensions/commands.nu   0 vs 0    ✓
  coredns/commands.nu      50 vs 50  ✓ (pre-existing transitive noise)
  cache/agent.nu           0 vs 0    ✓
  vm/vm_persistence.nu     50 vs 50  ✓
  vm/nested_provisioning.nu 50 vs 50 ✓
  vm/cleanup_scheduler.nu  50 vs 50  ✓

21 star-imports eliminated (~10% of remaining 221).

Refs: ADR-025
2026-04-17 08:47:32 +01:00
Jesús Pérez
6a9acd2f41
refactor(vm/version/auth_impl): selective imports batch (ADR-025 L2)
Three unrelated files, 4 stars each -> selective. Batched because pattern
is mechanical.

vm/multi_tier_deployment.nu:
  network_management.nu [network-create]
  nested_provisioning.nu [nested-vm-create nested-vm-delete]
  volume_management.nu   DROPPED (dead)
  lifecycle.nu           DROPPED (dead)

utils/version/manager.nu:
  version/core.nu      [check-version]
  version/loader.nu    [discover-configurations load-configuration-file]
  version/formatter.nu [format-results]
  utils/interface.nu   [_print]

plugins/auth_impl.nu:
  config/accessor/core.nu [config-get]
  commands/traits.nu      [get-command-metadata]
  plugins/auth_core.nu    [plugin-login plugin-mfa-enroll plugin-verify]
  utils/path-utils.nu     [get-typedialog-form-path] — inline import at
    line 392 also converted (was `use ../utils/path-utils.nu *`).

Validation:
  vm/multi_tier_deployment.nu     50 errors (all PRE-EXISTING, baseline match)
  utils/version/manager.nu         0 errors
  plugins/auth_impl.nu             0 errors

Refs: ADR-025
2026-04-17 08:41:12 +01:00
Jesús Pérez
f289b95cd1
refactor(providers/extensions/plugins): selective imports batch (ADR-025 L2/L3)
Three unrelated files grouped in one commit because each is a mechanical
3-5 star -> selective conversion with small cleanups.

providers/loader.nu (L2):
  registry.nu  [4 symbols]
  logging.nu   [2 symbols]
  interface.nu DROPPED (dead)
  Note: dynamic `use ($provider_entry.entry_point) *` at line ~173 is
  intentional runtime dispatch; not convertible.

extensions/loader_oci.nu (L2):
  logging.nu     [3 symbols]
  oci/client.nu  [7 symbols]
  loader.nu      [4 symbols] — fixed comma-separated list syntax quirk
  config/accessor  DROPPED (dead)
  extensions/cache DROPPED (dead)

plugins/mod.nu (L3 facade):
  auth.nu          [1 symbol]
  kms.nu           [8 symbols]
  secretumvault.nu [9 symbols]
  config/accessor  DROPPED (dead)
  + added `use utils/interface.nu [_ansi]` — _ansi was used in body but
    previously arrived through implicit star chain; now explicit.

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

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md
2026-04-17 08:38:42 +01:00
Jesús Pérez
34b389c8c8
refactor(workspace/services commands): selective imports (ADR-025 L2)
Two workspace+services command files converted, batched because they share
the same pattern (4 stars each -> selective).

workspace/commands.nu:
  user/config.nu           [11 symbols]
  utils/hints.nu           [show-next-step]
  platform/activation.nu   [activate-workspace-platform]
  workspace/notation.nu    [3 symbols]

  Pre-existing name collision documented: get-workspace-path and
  list-workspaces are exported by BOTH user/config.nu and notation.nu.
  Star-import resolved via last-wins (notation.nu). Selective version
  attributes both to notation.nu to preserve behaviour.

services/commands.nu:
  services/manager.nu      [9 symbols]
  services/health.nu       [2 symbols]
  services/preflight.nu    [4 symbols]
  services/dependencies.nu [5 symbols]

Validation: both files nu --ide-check 50 -> 0 errors.

Refs: ADR-025
2026-04-17 08:36:17 +01:00
Jesús Pérez
e92896cbfa
refactor(gitea/commands): selective imports + drop 1 dead (ADR-025 L2)
gitea/commands.nu had 5 star-imports. 4 converted, 1 dead dropped:

  api_client.nu        -> 9 symbols
  service.nu           -> 8 symbols
  locking.nu           -> 7 symbols
  extension_publish.nu -> 4 symbols
  workspace_git.nu     -> DROPPED (0 used symbols, dead import)

All imports now use absolute paths from nulib/ root.

Validation: 50 pre-existing errors (matches baseline via stash-compare).
Zero new errors introduced.

Refs: ADR-025
2026-04-17 08:34:16 +01:00
Jesús Pérez
aeff136164
refactor(setup): selective imports in wizard/system/platform (ADR-025 L2)
Three setup/ files converted from star-imports to selective imports with
absolute paths. All three follow the same pattern (4 stars each -> selective),
bundled in one commit since they share the same dependency surface.

setup/wizard.nu:
  setup/mod.nu       [11 symbols — detection/print helpers]
  setup/detection.nu [4 symbols — deployment capabilities + report]
  utils/path-utils.nu [get-typedialog-form-path]
  setup/validation.nu  DROPPED (0 used symbols — dead import)

setup/system.nu:
  setup/mod.nu    [17 symbols — ensure-config-dirs + print + sys info + save]
  setup/wizard.nu [3 symbols — run-*]
  utils/nickel_processor.nu [ncl-eval-soft]  (kept, already selective)
  setup/detection.nu   DROPPED (0 used)
  setup/validation.nu  DROPPED (0 used)

setup/platform.nu:
  setup/mod.nu        [11 symbols — print + sys info + save/load TOML]
  setup/detection.nu  [5 symbols — has-docker/kubectl/...]
  platform/bootstrap.nu [bootstrap-platform]
  setup/validation.nu   DROPPED (0 used)

Validation (all 3): nu --ide-check 50 -> 0 errors, matches baseline.

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 2
2026-04-17 08:31:21 +01:00
Jesús Pérez
b551554519
refactor(setup/mod): selective imports + drop dead logging import (ADR-025 L3)
setup/mod.nu had 4 star-imports. Resolution per target:

Converted to selective:
  config/accessor.nu      -> [config-get]                   1 symbol
  utils.nu (re-export)    -> [create_versions_file ...]     4 symbols
  config.nu (re-export)   -> [env_file_providers ...]       2 symbols

Dropped:
  utils/logging.nu        -> 0 used symbols in this file    DEAD

Also promoted the accessor import to absolute path
(lib_provisioning/config/accessor/core.nu) per ADR-025 rule.

Validation:
  nu --ide-check 50 setup/mod.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:29:31 +01:00
Jesús Pérez
61b81b1b67
refactor(config/loader/mod): selective re-exports replace 5 star re-exports (ADR-025 L3)
config/loader/mod.nu had 5 `export use X *`. Each is now explicit.

Symbol counts per target:
  core.nu         1
  validator.nu    6
  environment.nu  4
  test.nu         2
  dag.nu          1

Total: 14 symbols.

With loader/mod.nu now star-free, the orchestrator loader.nu (1-line
re-export) could be converted from `export use loader.nu *` to selective
in config/mod.nu. Tracked as follow-up — once loader/mod.nu and
accessor/mod.nu are both clean, config/mod.nu's 2 orchestrator exceptions
can be resolved.

Validation:
  nu --ide-check 50 config/loader/mod.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:28:13 +01:00
Jesús Pérez
d976df188a
refactor(config/mod): selective re-exports for 4 of 6 targets (ADR-025 L3)
config/mod.nu had 6 `export use X *`. Partial conversion:

Converted to selective:
  accessor_generated.nu  80 symbols (schema-driven generated accessors)
  migration.nu            6 symbols
  encryption.nu          12 symbols
  commands.nu            11 symbols (multi-word "config X" + main)

Kept as star re-exports (with inline comment explaining why):
  loader.nu     - 1-line orchestrator → loader/mod.nu (itself has 5 stars)
  accessor.nu   - 1-line orchestrator → accessor/mod.nu (itself has 3 stars)

Rationale for the 2 exceptions: loader.nu and accessor.nu are thin
orchestrator files that re-export their sub-subsystems. Flattening them
requires a prior pass refactoring loader/ and accessor/ subtrees. Tracked
as follow-up in the transitivity DAG.

Validation:
  nu --ide-check 50 config/mod.nu -> 1 error (pre-existing, verified by
    stash-and-compare). Zero new errors introduced.

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:23:33 +01:00
Jesús Pérez
7140929724
refactor(integrations/ecosystem/mod): selective re-exports + fix facade intent (ADR-025 L3)
ecosystem/mod.nu had 5 `use ./X.nu *` — NOT `export use`. The comment
claimed "Re-exports all ecosystem integration providers" but no export
actually happened (plain `use` makes symbols visible only inside this
file, not to consumers). Parent `integrations/mod.nu` does
`use ./ecosystem *` expecting propagation that never occurred.

Fixed both issues in one commit:
1. Promote each `use` to `export use` so the facade actually re-exports.
2. Replace each star with an explicit symbol list.

Symbol counts per target:
  runtime.nu        5
  backup.nu         6
  ssh_advanced.nu   6
  gitops.nu         7
  service.nu        8

Total: 32 symbols re-exported (previously: 0, due to the use-vs-export-use bug).

Behaviour change note: consumers that rely on integrations/ecosystem/* symbols
via `use lib_provisioning/integrations *` may now see symbols that were
silently missing before. This is the documented intent restored.

Validation:
  nu --ide-check 50 ecosystem/mod.nu -> 41 errors (all PRE-EXISTING,
    verified by stash-and-compare). Zero new errors introduced.

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:21:37 +01:00
Jesús Pérez
f3684adb33
refactor(gitea/mod): selective re-exports replace 6 star re-exports (ADR-025 L3)
gitea/mod.nu had 6 `export use X *`. Each is now explicit.

Symbol counts per target:
  api_client.nu        28
  service.nu           10
  workspace_git.nu     17
  locking.nu            9
  extension_publish.nu  6
  commands.nu          24  (all multi-word "gitea X")

Total: 94 symbols, 24 quoted multi-word Nu subcommands.

Validation:
  nu --ide-check 50 gitea/mod.nu -> 50 errors (all PRE-EXISTING)
    Verified by stash-and-compare: the unmodified original mod.nu also
    produced 50 errors from the same imported files. Zero errors
    introduced by this refactor.

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:19:53 +01:00
Jesús Pérez
0706803339
refactor(services/mod): selective re-exports replace 6 star re-exports (ADR-025 L3)
services/mod.nu had 6 `export use X *`. Each is now explicit.

Symbol counts per target:
  manager.nu       13
  lifecycle.nu      4
  health.nu         5
  preflight.nu      7
  dependencies.nu   8
  commands.nu      19  (multi-word: 7 "platform X" + 12 "services X")

Total: 56 symbols, 19 quoted multi-word Nu subcommands.

Validation:
  nu --ide-check 50 services/mod.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:16:49 +01:00
Jesús Pérez
3b76beb769
refactor(utils/version/mod): selective re-exports replace 6 star re-exports (ADR-025 L3)
utils/version/mod.nu had 6 `export use X *`. Each is now explicit.

Symbol counts per target:
  core.nu       6
  formatter.nu  3
  loader.nu     6
  manager.nu    7
  registry.nu   6
  taskserv.nu   7

Total: 35 symbols re-exported.

Validation:
  nu --ide-check 50 version/mod.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:12:30 +01:00
Jesús Pérez
220153f124
refactor(extensions/mod): selective re-exports replace 8 star re-exports (ADR-025 L3)
extensions/mod.nu had 8 `export use X *`. Each is now explicit symbol list.

Symbol counts per target:
  loader.nu       7
  registry.nu    13
  profiles.nu     7
  loader_oci.nu   1
  cache.nu        9
  versions.nu     8
  discovery.nu    8
  commands.nu    13  (all multi-word "ext X" subcommands, quoted)

Total: 66 symbols re-exported, 13 quoted multi-word.

Validation:
  nu --ide-check 50 extensions/mod.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:11:22 +01:00
Jesús Pérez
03f1dcadf7
refactor(platform/mod): selective re-exports replace 8 star re-exports (ADR-025 L3)
platform/mod.nu had 8 `export use X *`. Each is now explicit symbol list.

Symbol counts per target:
  target.nu           12
  discovery.nu         5
  health.nu            4
  credentials.nu       6
  connection.nu        9
  cli.nu               7
  autostart.nu         7
  service-manager.nu  15

Total: 65 symbols re-exported.

Pre-existing duplicate symbols surfaced by the explicit listing (not caused
by this commit — the `export use X *` pattern silently shadowed them):
  - get-service-status: connection.nu (arg) + autostart.nu (no arg)
  - start-required-services: service-manager.nu + autostart.nu
  - load-deployment-mode: target.nu + service-manager.nu

Leaving duplicates as-is; resolving the naming collisions is out of scope
for ADR-025 (tracked as pre-existing bug to address in a separate commit).

Validation:
  nu --ide-check 50 platform/mod.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:10:24 +01:00
Jesús Pérez
5efd0426d8
refactor(workspace/mod): selective re-exports with multi-word commands (ADR-025 L3)
workspace/mod.nu had 9 `export use X *`. Each is now an explicit symbol list.

New pattern encountered: three files export Nu multi-word subcommands
(`export def "workspace activate"`, `export def "workspace list"`, etc.).
These are re-exported with Nu's quoted-string syntax in the selective list:

  export use commands.nu [
      "workspace activate" "workspace active" "workspace list" ...
  ]

Symbol counts per target:
  init.nu            3
  config_commands.nu 6
  commands.nu       14  (all multi-word "workspace X")
  verify.nu          2
  helpers.nu        13
  version.nu        11
  enforcement.nu     7
  migration.nu       9
  sync.nu            3  (all multi-word "workspace X")

Total: 68 symbols, 17 quoted multi-word commands.

Validation:
  nu --ide-check 50 workspace/mod.nu -> 0 errors, 0 warnings

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:07:39 +01:00
Jesús Pérez
baf74b5395
refactor(utils/mod): selective re-exports replace 16 star re-exports (ADR-025 L3)
utils/mod.nu was the top subsystem facade (10 stars reported in the DAG,
16 on closer inspection). Each `export use X *` is now `export use X [symbols]`
with an explicit list.

Symbol counts per target:
  interface.nu  13
  init.nu       13
  logging.nu    13
  settings.nu   19  (file already selective per pilot commit 8de5e63)
  imports.nu    16
  generate.nu    6
  ssh.nu         5
  files.nu       4
  error.nu       2
  undefined.nu   2
  format.nu      2
  templates.nu   2
  clean.nu       1
  help.nu        1
  on_select.nu   1
  qr.nu          1

Total: 101 distinct symbols re-exported by name. Consumers using
`use lib_provisioning/utils *` see an identical symbol set, but every
symbol is now auditable.

Validation:
  nu --ide-check 50 utils/mod.nu -> 4 errors, all pre-existing (verified
    by stash-and-compare against the pre-refactor version). Zero new
    errors introduced.

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 3
2026-04-17 08:03:51 +01:00
Jesús Pérez
e4fe2298f8
refactor(platform/bootstrap): selective imports + drop 3 dead imports (ADR-025 L2)
bootstrap.nu had 5 star-imports. Body scan showed only 2 of the 5 files
contributed any used symbols:

  config/accessor.nu      -> config-get
  services/health.nu      -> wait-for-service

The other 3 files were imported with `use X *` but supplied zero used
symbols — dead imports inherited from an earlier architecture:

  utils/logging.nu       (0 used)   dropped
  services/lifecycle.nu  (0 used)   dropped
  services/dependencies.nu (0 used) dropped

All imports now use absolute paths from nulib/ root. Existing selective
imports (context_manager, setup/mod, nickel_processor) kept as-is and
promoted to absolute paths for consistency with ADR-025 rule.

Validation:
  nu --ide-check 50 platform/bootstrap.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md Layer 2
2026-04-17 08:01:04 +01:00
Jesús Pérez
4b95148324
refactor(platform/cli): selective imports + stub dead platform-config (ADR-025 L2)
Two changes in this file:

1. Replace 5 star-imports with selective imports (absolute paths):

   Before:
     use target.nu *
     use discovery.nu *
     use health.nu *
     use autostart.nu *
     use connection.nu *

   After:
     use lib_provisioning/platform/health.nu [check-all-services check-required-services]
     use lib_provisioning/platform/discovery.nu [list-services]
     use lib_provisioning/platform/autostart.nu [start-required-services]
     use lib_provisioning/platform/connection.nu [init-connection-metadata show-connection-status]

   platform/target.nu drops from the import list — nothing from target.nu is
   actually used in this file once load-platform-target (see #2) is removed.

2. Stub platform-config function.

   platform-config called `load-platform-target`, a symbol with zero
   definitions in the entire codebase (same class as on_clusters from
   blocker 1). The function was dead at runtime. Replaced body with a
   user-facing message pointing to `prvng platform list` which works.

Validation:
  nu --ide-check 50 platform/cli.nu -> 0 errors

Refs: ADR-025, .coder/benchmarks/phase2-findings.md blockers (extended)
2026-04-17 07:58:00 +01:00
Jesús Pérez
522531271d
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
2026-04-17 07:55:46 +01:00
Jesús Pérez
8de5e63c2b
refactor(lib_provisioning/utils/settings): selective imports (ADR-025 pilot)
First real star-import removal. settings.nu is the highest fan-in importer
in the lib_provisioning/ transitivity DAG (8 star-imports, common ancestor
for most symbols consumed by the 16 root fat-import files).

Before:
  use ../config/accessor.nu *
  use ./logging.nu *
  use ./nickel_processor.nu *
  use ./error.nu [throw-error]
  use ./init.nu [get-provisioning-infra-path get-provisioning-name get-provisioning-resources]
  use ../../../../extensions/providers/prov_lib/middleware.nu *
  use ../context.nu *
  use ../sops/mod.nu *
  use ../workspace/detection.nu *
  use ../user/config.nu *

After (absolute paths from nulib/ root, named-symbol imports):
  use lib_provisioning/config/accessor/core.nu [config-get]
  use lib_provisioning/context.nu [setup_user_context]
  use lib_provisioning/sops/lib.nu [is_sops_file decode_sops_file on_sops]
  use lib_provisioning/user/config.nu [get-workspace-default-infra get-workspace-path]
  use lib_provisioning/utils/error.nu [throw-error]
  use lib_provisioning/utils/init.nu [get-provisioning-infra-path get-provisioning-name get-provisioning-resources get-work-format]
  use lib_provisioning/utils/interface.nu [_ansi _print]
  use lib_provisioning/utils/logging.nu [is-debug-enabled]
  use lib_provisioning/utils/nickel_processor.nu [ncl-eval ncl-eval-soft process_nickel_export_raw]
  use lib_provisioning/workspace/detection.nu [detect-infra-from-pwd get-effective-workspace infer-workspace-from-pwd]
  use ../../../../extensions/providers/prov_lib/middleware.nu [mw_create_cache mw_ip_from_cache]

Cross-tree middleware import kept relative — the target is outside nulib/
(public extension API consumed by workspaces). Only two specific middleware
symbols are pulled; the rest of middleware.nu is no longer in settings.nu
scope.

Method: grep bare identifiers in settings.nu body, intersect with each
star-imported target's export set, record origin. Followed pattern from
Phase 3 pilot methodology (ADR-025 section "Fix call sites bottom-up").

Validation:
  nu --ide-check 50 lib_provisioning/utils/settings.nu
  -> 0 errors, 0 warnings (type hints only)

Transitivity note: several target files (error.nu, logging.nu, init.nu,
sops/lib.nu, detection.nu) still contain star-imports of their own. This
pilot proves the pattern works; subsequent commits will climb the DAG
leaves-first and eventually remove those remaining stars.

Refs: ADR-025, .coder/benchmarks/phase2-transitivity.md (Layer 3 priority)
2026-04-17 07:53:08 +01:00
Jesús Pérez
037acd52eb
refactor(lib): remove dead export-env blocks (ADR-025 blocker 4)
Two export-env blocks in lib_provisioning/ ran at module load time as side
effects of the lib_provisioning/mod.nu star-import chain. ADR-025 empties
that chain; the side effects were never going to fire again and neither has
a remaining reader that depends on them.

1. lib_provisioning/cmd/env.nu
   Former block: called check_env (a pre-flight gate for PROVISIONING_VARS /
   PROVISIONING_WORKSPACE_PATH / PROVISIONING_WK_ENV_PATH existence) and set
   $env.PROVISIONING_DEBUG = false. Nobody imports cmd/env.nu directly; every
   downstream reader of PROVISIONING_DEBUG either sets it explicitly via a
   --debug flag branch or reads it with `?` + default fallback.

2. lib_provisioning/providers/registry.nu
   Former block: $env.PROVIDER_REGISTRY_INITIALIZED = false. The four read
   sites in registry.nu already use `$env.PROVIDER_REGISTRY_INITIALIZED? |
   default false`; the unset state is equivalent to false. Zero behaviour
   change.

Both files now carry a comment explaining the removal so future contributors
understand the history without reading ADR-025.

Refs: ADR-025, .coder/benchmarks/phase2-findings.md export-env decisions
2026-04-17 07:47:19 +01:00
Jesús Pérez
c917b058b3
fix(core): resolve undefined symbols hidden by lib_provisioning star-imports
Six symbols were referenced across the codebase but had no definition anywhere.
Star-imports from lib_provisioning/mod.nu silenced the missing-def errors at
parse time; at runtime the call sites either threw or took dead code paths.
ADR-025 Phase 2 (AST audit) surfaced them as blockers for Phase 3 because
selective imports would expose them as "variable not found" errors.

Resolution: add stub getters in lib_provisioning/config/accessor/functions.nu
following the existing pattern (env -> config -> PROVISIONING-derived -> ""):

  - get-providers-path          (14 call sites)
  - get-prov-lib-path           (2 call sites)
  - get-core-nulib-path         (7 call sites)
  - get-provisioning-generate-dirpath  (5 call sites)
  - get-provisioning-generate-defsfile (1 call site)
  - get-provisioning-req-versions (4 call sites)

All existing callers already guard results with is-empty / path exists checks,
so empty-string returns fall back to safe no-op paths.

show_tools_info (main_provisioning/tools.nu) was missing a guard around its
open call; added is-empty / path-exists check matching sibling fns.

The only non-path symbol (on_clusters in clusters/create.nu) had no recoverable
implementation; its closure is replaced with a user-facing message directing
to 'prvng cluster deploy' (the supported workflow).

Refs: ADR-025, .coder/benchmarks/phase2-findings.md blockers section
2026-04-17 07:46:03 +01:00
Jesús Pérez
a6ecf5b7fb
fix(core): resolve undefined symbols hidden by lib_provisioning star-imports
Six symbols were referenced across the codebase but had no definition anywhere.
Star-imports from lib_provisioning/mod.nu silenced the missing-def errors at
parse time; at runtime the call sites either threw or took dead code paths.
ADR-025 Phase 2 (AST audit) surfaced them as blockers for Phase 3 because
selective imports would expose them as "variable not found" errors.

Resolution: add stub getters in lib_provisioning/config/accessor/functions.nu
following the existing pattern (env -> config -> PROVISIONING-derived -> ""):

  - get-providers-path          (14 call sites)
  - get-prov-lib-path           (2 call sites)
  - get-core-nulib-path         (7 call sites)
  - get-provisioning-generate-dirpath  (5 call sites)
  - get-provisioning-generate-defsfile (1 call site)
  - get-provisioning-req-versions (4 call sites)

All existing callers already guard results with is-empty / path exists checks,
so empty-string returns fall back to safe no-op paths.

show_tools_info (main_provisioning/tools.nu) was missing a guard around its
open call; added is-empty / path-exists check matching sibling fns.

The only non-path symbol (on_clusters in clusters/create.nu) had no recoverable
implementation; its closure is replaced with a user-facing message directing
to 'prvng cluster deploy' (the supported workflow).

Refs: ADR-025, .coder/benchmarks/phase2-findings.md blockers section
2026-04-17 07:43:34 +01:00
Jesús Pérez
758848fff9
fix(core): resolve undefined symbols hidden by lib_provisioning star-imports
Six symbols were referenced across the codebase but had no definition anywhere.
Star-imports from lib_provisioning/mod.nu silenced the missing-def errors at
parse time; at runtime the call sites either threw or took dead code paths.
ADR-025 Phase 2 (AST audit) surfaced them as blockers for Phase 3 because
selective imports would expose them as "variable not found" errors.

Resolution: add stub getters in lib_provisioning/config/accessor/functions.nu
following the existing pattern (env -> config -> PROVISIONING-derived -> ""):

  - get-providers-path          (14 call sites)
  - get-prov-lib-path           (2 call sites)
  - get-core-nulib-path         (7 call sites)
  - get-provisioning-generate-dirpath  (5 call sites)
  - get-provisioning-generate-defsfile (1 call site)
  - get-provisioning-req-versions (4 call sites)

All existing callers already guard results with is-empty / path exists checks,
so empty-string returns fall back to safe no-op paths.

show_tools_info (main_provisioning/tools.nu) was missing a guard around its
open call; added is-empty / path-exists check matching sibling fns.

The only non-path symbol (on_clusters in clusters/create.nu) had no recoverable
implementation; its closure is replaced with a user-facing message directing
to 'prvng cluster deploy' (the supported workflow).

Refs: ADR-025, .coder/benchmarks/phase2-findings.md blockers section
2026-04-17 07:41:35 +01:00
Jesús Pérez
def1515bfe
chore: untrack session files (already gitignored) 2026-04-17 04:33:49 +01:00
Jesús Pérez
894046ef5a
feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration
- DAG architecture: `dag show/validate/export` (nulib/main_provisioning/dag.nu),
    config loader (lib_provisioning/config/loader/dag.nu), taskserv dag-executor.
    Backed by schemas/lib/dag/*.ncl; orchestrator emits NATS events via
    WorkspaceComposition::into_workflow. See ADR-020, ADR-021.
  - Unified Component Architecture: components/mod.nu, main_provisioning/
    {components,workflow,extensions,ontoref-queries}.nu. Full workflow engine with
    topological sort and NATS subject emission. Blocks A-H complete (libre-daoshi).
  - Commands-registry: nulib/commands-registry.ncl (Nickel source, 314 lines) +
    JSON cache at ~/.cache/provisioning/commands-registry.json rebuilt on source
    change. cli/provisioning fast-path alias expansion avoids cold Nu startup.
    ADDING_COMMANDS.md documents new-command workflow.
  - Platform service manager: service-manager.nu (+573), startup.nu (+611),
    service-check.nu (+255); autostart/bootstrap/health/target refactored.
  - Nushell 0.112.2 migration: removed all try/catch and bash redirections;
    external commands prefixed with ^; type signatures enforced. Driven by
    scripts/refactor-try-catch{,-simplified}.nu.
  - TTY stack: removed shlib/*-tty.sh; replaced by cli/tty-dispatch.sh,
    tty-filter.sh, tty-commands.conf.
  - New domain modules: images/ (golden image lifecycle), workspace/{state,sync}.nu,
    main_provisioning/{bootstrap,cluster-deploy,fip,state}.nu, commands/{state,
    build,integrations/auth,utilities/alias}.nu, platform.nu expanded (+874).
  - Config loader overhaul: loader/core.nu slimmed (-759), cache/core.nu
    refactored (-454), removed legacy loaders/file_loader.nu (-330).
  - Thirteen new provisioning-<domain>.nu top-level modules for bash dispatcher.
  - Tests: test_workspace_state.nu (+351); updates to test_oci_registry,
    test_services.
  - README + CHANGELOG updated.
2026-04-17 04:27:33 +01:00
Jesús Pérez
adb28be45a
chore: Fix try cath and nushell bugs, fix long script files, review for nu 0.110.0 2026-01-21 10:24:17 +00:00
Jesús Pérez
825d1f0e88
chore: fix more try/catch and errors 2026-01-17 03:57:20 +00:00
Jesús Pérez
08563bc973
chore: remove bak files 2026-01-14 03:33:05 +00:00
Jesús Pérez
eb20fec7de
chore: release 1.0.11 - nu script cleanup & refactoring + i18n fluentd
- Documented Fluent-based i18n system with locale detection
  - Bumped version from 1.0.10 to 1.0.11
2026-01-14 02:00:23 +00:00