# Workspace Configuration Verification Script # Confirms that config.defaults.toml is NOT loaded at runtime export def verify-workspace-architecture [] { print "šŸ” Verifying Workspace Configuration Architecture" print "==================================================" print "" mut all_checks_passed = true # Check 1: Templates directory exists print "šŸ“‹ Check 1: Template directory exists" let templates_dir = ($env.PROVISIONING | path join "config/templates") if ($templates_dir | path exists) { print " āœ… Templates directory found: $templates_dir" } else { print " āŒ Templates directory NOT found" $all_checks_passed = false } # Check 2: All template files exist print "\nšŸ“‹ Check 2: All template files exist" let required_templates = [ "workspace-provisioning.yaml.template" "provider-aws.toml.template" "provider-local.toml.template" "provider-upcloud.toml.template" "kms.toml.template" "user-context.yaml.template" "README.md" ] for template in $required_templates { let template_path = ($templates_dir | path join $template) if ($template_path | path exists) { print $" āœ… ($template)" } else { print $" āŒ ($template) NOT found" $all_checks_passed = false } } # Check 3: Workspace init module exists print "\nšŸ“‹ Check 3: Workspace init module exists" let init_module = ($env.PROVISIONING | path join "core/nulib/lib_provisioning/workspace/init.nu") if ($init_module | path exists) { print " āœ… Workspace init module found" } else { print " āŒ Workspace init module NOT found" $all_checks_passed = false } # Check 4: Config loader has been updated print "\nšŸ“‹ Check 4: Config loader has new workspace functions" let loader_module = ($env.PROVISIONING | path join "core/nulib/lib_provisioning/config/loader.nu") if ($loader_module | path exists) { let loader_content = (open $loader_module) if ($loader_content | str contains "get-active-workspace") { print " āœ… get-active-workspace() function exists" } else { print " āŒ get-active-workspace() function NOT found" $all_checks_passed = false } if ($loader_content | str contains "def get-defaults-config-path") { print " āŒ OLD get-defaults-config-path() function still exists (should be removed)" $all_checks_passed = false } else { print " āœ… OLD get-defaults-config-path() function has been removed" } if ($loader_content | str contains "workspace/{name}/config/provisioning.yaml") { print " āœ… New workspace hierarchy documented in code" } else { print " āš ļø New workspace hierarchy comment not found" } if ($loader_content | str contains "from yaml") { print " āœ… YAML format support added" } else { print " āŒ YAML format support NOT found" $all_checks_passed = false } } else { print " āŒ Config loader module NOT found" $all_checks_passed = false } # Check 5: Documentation exists print "\nšŸ“‹ Check 5: Documentation exists" let docs = [ ($env.HOME | path join "Development/provisioning/docs/configuration/workspace-config-architecture.md") ($env.HOME | path join "Development/provisioning/docs/configuration/WORKSPACE_CONFIG_IMPLEMENTATION_SUMMARY.md") ] for doc in $docs { if ($doc | path exists) { print $" āœ… ($doc | path basename)" } else { print $" āŒ ($doc | path basename) NOT found" $all_checks_passed = false } } # Check 6: config.defaults.toml still exists (as template) print "\nšŸ“‹ Check 6: config.defaults.toml exists as template" let defaults_file = ($env.PROVISIONING | path join "config/config.defaults.toml") if ($defaults_file | path exists) { print " āœ… config.defaults.toml exists (as template only)" print " ā„¹ļø This file is NEVER loaded at runtime" } else { print " āš ļø config.defaults.toml not found (should exist as template reference)" } print "\n" + "=" * 50 if $all_checks_passed { print "āœ… All critical checks passed!" } else { print "āŒ Some checks failed!" print "Please review the failures above and fix the issues." } $all_checks_passed } export def main [] { verify-workspace-architecture }