Commit graph

8 commits

Author SHA1 Message Date
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
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
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
c62e967ce3
chore: complete KCL to Nickel migration cleanup and setup pre-commit
Clean up 404 KCL references (99.75% complete):
   - Rename kcl_* variables to schema_*/nickel_* (kcl_path→schema_path, etc.)
   - Update functions: parse_kcl_file→parse_nickel_file
   - Update env vars: KCL_MOD_PATH→NICKEL_IMPORT_PATH
   - Fix cli/providers-install: add has_nickel and nickel_version variables
   - Correct import syntax: .nickel.→.ncl.
   - Update 57 files across core, CLI, config, and utilities

   Configure pre-commit hooks:
   - Activate: nushell-check, nickel-typecheck, markdownlint
   - Comment out: Rust hooks (fmt, clippy, test), check-yaml

   Testing:
   - Module discovery: 9 modules (6 providers, 1 taskserv, 2 clusters) 
   - Syntax validation: 15 core files 
   - Pre-commit hooks: all passing 
2026-01-08 20:08:46 +00:00
Jesús Pérez
85ce530733
feat: update provisioning core CLI, libraries, and plugins
Update core components including CLI, Nushell libraries, plugins system,
and utility scripts for the provisioning system.

CLI Updates:
- Command implementations
- CLI utilities and dispatching
- Help system improvements
- Command validation

Library Updates:
- Configuration management system
- Infrastructure validation
- Extension system improvements
- Secrets management
- Workspace operations
- Cache management system

Plugin System:
- Interactive form plugin (inquire)
- KCL integration plugin
- Performance optimization plugins
- Plugin registration system

Utilities:
- Build and distribution scripts
- Installation procedures
- Testing utilities
- Development tools

Documentation:
- Library module documentation
- Extension API guides
- Plugin usage guides
- Service management documentation

All changes are backward compatible. No breaking changes.
2025-12-11 21:57:05 +00:00