prvng_core/nulib/taskservs
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
..
check_mode.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
create.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
dag-executor.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
delete.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
deps_validator.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
discover.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
generate.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
handlers.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
load.nu chore: release 1.0.11 - nu script cleanup & refactoring + i18n fluentd 2026-01-14 02:00:23 +00:00
mod.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
ops.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
README.md chore: release 1.0.11 - nu script cleanup & refactoring + i18n fluentd 2026-01-14 02:00:23 +00:00
run.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
status.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
test.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
update.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
utils.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00
validate.nu feat(core): three-layer DAG, unified component arch, commands-registry cache, Nushell 0.112.2 migration 2026-04-17 04:27:33 +01:00

Taskserv Validation & Testing System

Version: 1.0.0 Status: Production Ready


Quick Start

Validate Before Deployment

# Complete validation (recommended)
provisioning taskserv validate kubernetes

# Check mode (dry-run)
provisioning taskserv create kubernetes --check

# Sandbox testing
provisioning taskserv test kubernetes --runtime docker

Available Commands

Command Description
taskserv validate <name> Multi-level validation (Nickel, templates, scripts, dependencies)
taskserv check-deps <name> Check dependencies against infrastructure
taskserv create <name> --check Dry-run with preview (no actual deployment)
taskserv test <name> Test in sandbox container

Validation Levels

1. Static Validation

  • Nickel schema syntax
  • Jinja2 template syntax
  • Shell script validation (shellcheck)
  • Fast - No infrastructure needed

2. Dependency Validation

  • Required dependencies available
  • Conflict detection
  • Resource requirements
  • Health check configuration

3. Check Mode (Dry-Run)

  • All static validations
  • Dependency checking
  • Configuration preview
  • Prerequisites verification
  • 🚫 No actual deployment

4. Sandbox Testing

  • Package prerequisites
  • Configuration validity
  • Script execution
  • Health check simulation
  • 🐳 Requires Docker/Podman

Examples

Complete Validation Workflow

# 1. Static validation
provisioning taskserv validate kubernetes --level static

# 2. Check dependencies
provisioning taskserv check-deps kubernetes --infra my-project

# 3. Dry-run with preview
provisioning taskserv create kubernetes --check -v

# 4. Sandbox testing
provisioning taskserv test kubernetes --runtime docker

# 5. Deploy (after all checks pass)
provisioning taskserv create kubernetes

Quick Validation

# All validations in one command
provisioning taskserv validate kubernetes --level all -v

CI/CD Integration

# .gitlab-ci.yml
validate:
  script:
    - provisioning taskserv validate kubernetes --out json
    - provisioning taskserv check-deps kubernetes --infra prod

test:
  script:
    - provisioning taskserv test kubernetes --runtime docker

deploy:
  script:
    - provisioning taskserv create kubernetes
  only:
    - main

Module Structure

taskservs/
├── validate.nu           # Main validation framework
├── deps_validator.nu     # Dependency validation
├── check_mode.nu         # Enhanced check mode
├── test.nu               # Sandbox testing
├── create.nu             # Taskserv creation
├── delete.nu             # Taskserv deletion
├── update.nu             # Taskserv updates
├── generate.nu           # Configuration generation
├── handlers.nu           # Core handlers
├── run.nu                # Execution engine
├── utils.nu              # Utilities
├── ops.nu                # Operations
└── mod.nu                # Module exports

Key Features

Multi-Level Validation

  • Static, dependency, prerequisite, and health check validation
  • Fail-fast with clear error messages
  • Verbose mode for detailed output

🎯 Enhanced Check Mode

  • Comprehensive dry-run before deployment
  • Configuration preview
  • File listing
  • No SSH required in check mode

🐳 Sandbox Testing

  • Isolated container environment
  • Docker and Podman support
  • Keep containers for debugging
  • Multiple test scenarios

📊 Multiple Output Formats

  • Text (default, human-readable)
  • JSON (for automation)
  • YAML (for configuration)

🔗 Dependency Management

  • Automatic dependency detection
  • Conflict resolution
  • Resource requirement validation
  • Health check configuration

Dependencies

Required

  • Nushell 0.107.1+
  • Nickel 0.11.3+

Optional

  • shellcheck - Enhanced script validation
  • docker or podman - Sandbox testing
  • glow or bat - Better markdown rendering

Documentation


Troubleshooting

Validation Errors

# Check Nickel syntax
nickel fmt <file>.ncl

# Validate dependencies manually
nickel run extensions/taskservs/<name>/nickel/dependencies.ncl

# Run with verbose output
provisioning taskserv validate <name> -v

Sandbox Testing Issues

# Check Docker is running
docker ps

# Keep container for debugging
provisioning taskserv test <name> --keep

# Connect to container
docker exec -it taskserv-test-<name> bash

shellcheck not found

# macOS
brew install shellcheck

# Ubuntu/Debian
apt install shellcheck

Contributing

When adding new validation checks:

  1. Add validation function in appropriate module
  2. Update validate.nu to call new check
  3. Add tests in tests/ directory
  4. Update documentation
  5. Add examples in this README

Version History

Version Date Changes
1.0.0 2025-10-06 Initial validation and testing system

Maintained By: Infrastructure Team Status: Production Ready