- 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.
61 lines
2.1 KiB
Text
61 lines
2.1 KiB
Text
# Module: Path Resolution Utilities
|
|
# Purpose: Provides helpers for resolving provisioning project root and constructing absolute paths
|
|
# Used by: TypeDialog integration, setup wizard, auth forms
|
|
|
|
# Resolve provisioning project root with multiple fallback strategies
|
|
# Returns: The root directory that CONTAINS the provisioning folder
|
|
export def resolve-provisioning-root [] {
|
|
if "PROVISIONING_ROOT" in $env {
|
|
return $env.PROVISIONING_ROOT
|
|
}
|
|
|
|
if "PROVISIONING" in $env {
|
|
# PROVISIONING env var points to the provisioning folder itself
|
|
# We need its parent directory
|
|
let provisioning_dir = $env.PROVISIONING
|
|
let parent = ($provisioning_dir | path dirname)
|
|
|
|
# Verify the parent contains the provisioning folder
|
|
if ($parent | path join "provisioning" | path exists) {
|
|
return $parent
|
|
} else {
|
|
# PROVISIONING is already the project root
|
|
return $provisioning_dir
|
|
}
|
|
}
|
|
|
|
# Find project root by walking up from current directory
|
|
# We're looking for the directory that CONTAINS the provisioning folder
|
|
mut search_dir = (pwd)
|
|
mut found_root = ""
|
|
|
|
# Try 10 levels up maximum to find project root
|
|
for i in (0..9) {
|
|
let provisioning_path = ($search_dir | path join "provisioning")
|
|
if ($provisioning_path | path exists) and (($provisioning_path | path type) == "dir") {
|
|
# Found the root - it's the parent of the provisioning dir
|
|
$found_root = $search_dir
|
|
break
|
|
}
|
|
|
|
let parent = ($search_dir | path dirname)
|
|
if $parent == $search_dir {
|
|
break # Reached filesystem root
|
|
}
|
|
|
|
$search_dir = $parent
|
|
}
|
|
|
|
if ($found_root | is-empty) {
|
|
# Last resort: return current directory
|
|
pwd
|
|
} else {
|
|
$found_root
|
|
}
|
|
}
|
|
|
|
# Get TypeDialog form path with absolute resolution
|
|
export def get-typedialog-form-path [form_name: string] {
|
|
let provisioning_root = (resolve-provisioning-root)
|
|
$provisioning_root | path join "provisioning" ".typedialog" "core" "forms" $form_name
|
|
}
|