sovereign-router / scripts /build-all-components.ps1
SNAPKITTYWEST's picture
Add sovereign-router source: router-server.mjs, kernel-registry, agent-registry, omega-field, MAGMA verbs
931572e verified
Raw
History Blame Contribute Delete
8.75 kB
# Master build script for SNAPKITTYWEST sovereign compute stack (PowerShell)
# Builds all components: Haskell, C++, C#, OCaml
$ErrorActionPreference = "Continue"
Write-Host "============================================" -ForegroundColor Cyan
Write-Host "SNAPKITTYWEST Sovereign Compute Stack Build" -ForegroundColor Cyan
Write-Host "============================================" -ForegroundColor Cyan
Write-Host ""
# Track results
$HaskellOk = $false
$CppOk = $false
$CsharpOk = $false
$OcamlOk = $false
# ════════════════════════════════════════════════════════════════
# Phase 1: Haskell Datalog Engine
# ════════════════════════════════════════════════════════════════
Write-Host "Phase 1: Haskell Datalog Engine" -ForegroundColor Yellow
Write-Host "--------------------------------"
if (Get-Command ghc -ErrorAction SilentlyContinue) {
Write-Host " GHC found: $(ghc --version)"
if (Get-Command cabal -ErrorAction SilentlyContinue) {
Write-Host " Building Haskell Datalog Engine..."
Push-Location errant/datalog
if (cabal build 2>&1) {
Write-Host " βœ“ Haskell Datalog Engine built successfully" -ForegroundColor Green
$HaskellOk = $true
} else {
Write-Host " βœ— Haskell Datalog Engine build failed" -ForegroundColor Red
}
Pop-Location
} else {
Write-Host " βœ— cabal not found" -ForegroundColor Red
}
} else {
Write-Host " βœ— GHC not found (Haskell build skipped)" -ForegroundColor Yellow
}
Write-Host ""
# ════════════════════════════════════════════════════════════════
# Phase 2: C++ Modules
# ════════════════════════════════════════════════════════════════
Write-Host "Phase 2: C++ Modules" -ForegroundColor Yellow
Write-Host "--------------------"
if (Get-Command cmake -ErrorAction SilentlyContinue) {
Write-Host " CMake found: $(cmake --version | Select-Object -First 1)"
Write-Host " Building C++ modules..."
Push-Location sovereign-utqc/cpp
if (cmake -S . -B build) {
if (cmake --build build) {
Write-Host " βœ“ C++ modules built successfully" -ForegroundColor Green
$CppOk = $true
} else {
Write-Host " βœ— C++ modules build failed" -ForegroundColor Red
}
} else {
Write-Host " βœ— CMake configuration failed" -ForegroundColor Red
}
Pop-Location
} else {
Write-Host " βœ— CMake not found (C++ build skipped)" -ForegroundColor Yellow
}
Write-Host ""
# ════════════════════════════════════════════════════════════════
# Phase 3: C# AGT
# ════════════════════════════════════════════════════════════════
Write-Host "Phase 3: C# AGT" -ForegroundColor Yellow
Write-Host "----------------"
if (Get-Command dotnet -ErrorAction SilentlyContinue) {
Write-Host " .NET found: $(dotnet --version)"
Write-Host " Building C# AGT..."
Push-Location sovereign-utqc/csharp
if (dotnet build SnapKitty.AGT.slnx --configuration Release 2>&1) {
Write-Host " βœ“ C# AGT built successfully" -ForegroundColor Green
Write-Host " Running tests..."
if (dotnet test SnapKitty.AGT.slnx --configuration Release --no-build 2>&1) {
Write-Host " βœ“ C# AGT tests passed" -ForegroundColor Green
$CsharpOk = $true
} else {
Write-Host " βœ— C# AGT tests failed" -ForegroundColor Red
}
} else {
Write-Host " βœ— C# AGT build failed" -ForegroundColor Red
}
Pop-Location
} else {
Write-Host " βœ— .NET not found (C# build skipped)" -ForegroundColor Yellow
}
Write-Host ""
# ════════════════════════════════════════════════════════════════
# Phase 4: OCaml snap-prism
# ════════════════════════════════════════════════════════════════
Write-Host "Phase 4: OCaml snap-prism" -ForegroundColor Yellow
Write-Host "-------------------------"
if (Get-Command dune -ErrorAction SilentlyContinue) {
Write-Host " dune found: $(dune --version)"
Write-Host " Building OCaml snap-prism..."
Push-Location sovereign-utqc/snap-prism-ocaml
if (dune build 2>&1) {
Write-Host " βœ“ OCaml snap-prism built successfully" -ForegroundColor Green
Write-Host " Running tests..."
if (dune runtest 2>&1) {
Write-Host " βœ“ OCaml snap-prism tests passed" -ForegroundColor Green
$OcamlOk = $true
} else {
Write-Host " βœ— OCaml snap-prism tests failed" -ForegroundColor Red
}
} else {
Write-Host " βœ— OCaml snap-prism build failed" -ForegroundColor Red
}
Pop-Location
} else {
Write-Host " βœ— dune not found (OCaml build skipped)" -ForegroundColor Yellow
}
Write-Host ""
# ════════════════════════════════════════════════════════════════
# Phase 5: Rust Workspaces
# ════════════════════════════════════════════════════════════════
Write-Host "Phase 5: Rust Workspaces" -ForegroundColor Yellow
Write-Host "------------------------"
if (Get-Command cargo -ErrorAction SilentlyContinue) {
Write-Host " Cargo found: $(cargo --version)"
Write-Host " Building sovereign-utqc..."
if (cargo test --manifest-path sovereign-utqc/Cargo.toml --workspace 2>&1) {
Write-Host " βœ“ sovereign-utqc tests passed" -ForegroundColor Green
} else {
Write-Host " βœ— sovereign-utqc tests failed" -ForegroundColor Red
}
Write-Host " Building sovereign-llm..."
if (cargo test --manifest-path sovereign-llm/Cargo.toml --workspace 2>&1) {
Write-Host " βœ“ sovereign-llm tests passed" -ForegroundColor Green
} else {
Write-Host " βœ— sovereign-llm tests failed" -ForegroundColor Red
}
} else {
Write-Host " βœ— Cargo not found (Rust build skipped)" -ForegroundColor Yellow
}
Write-Host ""
# ════════════════════════════════════════════════════════════════
# Summary
# ════════════════════════════════════════════════════════════════
Write-Host "============================================" -ForegroundColor Cyan
Write-Host "Build Summary" -ForegroundColor Cyan
Write-Host "============================================" -ForegroundColor Cyan
Write-Host ""
Write-Host " Haskell Datalog: $(if ($HaskellOk) { 'βœ“ PASS' } else { 'βœ— FAIL' })"
Write-Host " C++ Modules: $(if ($CppOk) { 'βœ“ PASS' } else { 'βœ— FAIL' })"
Write-Host " C# AGT: $(if ($CsharpOk) { 'βœ“ PASS' } else { 'βœ— FAIL' })"
Write-Host " OCaml snap-prism: $(if ($OcamlOk) { 'βœ“ PASS' } else { 'βœ— FAIL' })"
Write-Host ""
# Calculate total
$Total = @($HaskellOk, $CppOk, $CsharpOk, $OcamlOk) | Where-Object { $_ } | Measure-Object | Select-Object -ExpandProperty Count
Write-Host " Total: $Total/4 components built successfully"
Write-Host ""
if ($Total -eq 4) {
Write-Host "All components built successfully!" -ForegroundColor Green
exit 0
} else {
Write-Host "Some components failed to build." -ForegroundColor Yellow
exit 1
}