Commit graph

10 commits

Author SHA1 Message Date
Jesús Pérez
889feeb37c
perf(server): split server-list to dedicated thin handler + ADR-025 pre-commit guard 2026-04-17 21:58:40 +01:00
Jesús Pérez
271f41aa53
refactor(cli): single-route CLI entry — delete legacy Nu runner (ADR-025 Phase 4 B) 2026-04-17 21:42:20 +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
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
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
Jesús Pérez
0ccd697e55
chore: update scripts 2026-01-08 21:14:49 +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
Jesús Pérez
d8b3cee856
chore: codebase 2025-10-07 10:32:04 +01:00