# Simple OCI Implementation Test
# Quick validation of OCI implementation

print "OCI Implementation Validation"
print "=============================="
print ""

# Test 1: Check KCL syntax
print "1. Checking KCL dependencies schema..."
try {
    cd provisioning/kcl
    kcl run dependencies.k | ignore
    print "   ✓ KCL schemas compile successfully"
} catch {
    print "   ✗ KCL schema compilation failed"
}

# Test 2: Check file existence
print ""
print "2. Checking OCI implementation files..."

let files = [
    "provisioning/kcl/dependencies.k"
    "provisioning/core/nulib/lib_provisioning/oci/client.nu"
    "provisioning/core/nulib/lib_provisioning/oci/commands.nu"
    "provisioning/core/nulib/lib_provisioning/oci/mod.nu"
    "provisioning/core/nulib/lib_provisioning/dependencies/resolver.nu"
    "provisioning/core/nulib/lib_provisioning/dependencies/mod.nu"
    "provisioning/tools/oci-package.nu"
    "provisioning/tools/migrate-to-oci.nu"
]

for file in $files {
    if ($file | path exists) {
        print $"   ✓ ($file | path basename)"
    } else {
        print $"   ✗ ($file | path basename) MISSING"
    }
}

# Test 3: Check documentation
print ""
print "3. Checking documentation..."

let docs = [
    "docs/architecture/MULTI_REPO_ARCHITECTURE.md"
    "docs/user/OCI_REGISTRY_GUIDE.md"
    "docs/QUICK_REFERENCE_OCI.md"
    "MULTI_REPO_OCI_IMPLEMENTATION_SUMMARY.md"
]

for doc in $docs {
    if ($doc | path exists) {
        print $"   ✓ ($doc | path basename)"
    } else {
        print $"   ✗ ($doc | path basename) MISSING"
    }
}

# Test 4: Count lines
print ""
print "4. Implementation size..."

let total = (wc -l provisioning/kcl/dependencies.k provisioning/core/nulib/lib_provisioning/oci/*.nu provisioning/core/nulib/lib_provisioning/dependencies/*.nu provisioning/tools/oci-package.nu provisioning/tools/migrate-to-oci.nu 2>/dev/null | tail -1 | str trim | split row " " | first)

print $"   Total lines: ($total)"

print ""
print "=============================="
print "✓ OCI Implementation Complete"
