diff --git a/crates/idunn-daemon/src/main.rs b/crates/idunn-daemon/src/main.rs index 288d6e6..912145d 100644 --- a/crates/idunn-daemon/src/main.rs +++ b/crates/idunn-daemon/src/main.rs @@ -890,7 +890,6 @@ fn swarm_surgery_plan( updated_at: &str, ) -> IdunnSwarmSurgeryPlanRecord { let next_target = [ - "yggdrasil-heimdall", "yggdrasil-repixelizer", ] .iter() @@ -935,11 +934,11 @@ fn swarm_surgery_plan( "5. Delete or demote compatibility probes once every target has daemon-owned publication and advertised lifecycle authority.".to_string(), ], current_phase: - "Phase 13: StreamPixels now publishes daemon-owned RUDP health from the live Yggdrasil service runtime; Heimdall is the next cross-host cut because it already advertises a typed redacted witness surface but still lacks daemon-published Idunn health and command-boundary transport records." + "Phase 14: Heimdall now publishes daemon-owned RUDP health and a daemon-owned boundary witness store from the live Yggdrasil service runtime; repixelizer is the next cross-host cut because it still keeps daemon truth behind GUI/systemd compatibility checks." .to_string(), next_target: next_target.to_string(), cut_line: - "Muninn, Vili, Idunn, Odin, Stonks, Weksa, VoidBot, Nightwing Gjallar, Mimir Eve dashboard, Nightwing Eve dashboard, Nightwing Eve browser reference, and Yggdrasil StreamPixels now exercise daemon-owned RUDP health. Raven GameCult\\Vili has been refreshed from Odin, the hidden scheduled task now launches start-vili-daemon.ps1 with Idunn RUDP arguments, and live Idunn accepts vili.cultnet-rudp-animation-health from 10.77.0.4. Live Raven Muninn task actions remain repaired and verified to execute wscript.exe hidden launchers directly for GameCult-Muninn, GameCult-Muninn-Activate, and GameCult-Muninn-VideoProof, the long-running Muninn serve bodies on Raven, Nightwing, and Starfire now carry their own --idunn-rudp-health, --idunn-daemon, and --idunn-health-contract identity while Idunn accepts muninn from 10.77.0.4, nightwing-muninn from 10.77.0.3, and starfire-muninn from 127.0.0.1, and live Yggdrasil StreamPixels publishes yggdrasil-streampixels from 10.77.0.1. Heimdall and repixelizer remain the cross-host compatibility debt." + "Muninn, Vili, Idunn, Odin, Stonks, Weksa, VoidBot, Nightwing Gjallar, Mimir Eve dashboard, Nightwing Eve dashboard, Nightwing Eve browser reference, Yggdrasil StreamPixels, and Yggdrasil Heimdall now exercise daemon-owned RUDP health. Raven GameCult\\Vili has been refreshed from Odin, the hidden scheduled task now launches start-vili-daemon.ps1 with Idunn RUDP arguments, and live Idunn accepts vili.cultnet-rudp-animation-health from 10.77.0.4. Live Raven Muninn task actions remain repaired and verified to execute wscript.exe hidden launchers directly for GameCult-Muninn, GameCult-Muninn-Activate, and GameCult-Muninn-VideoProof, the long-running Muninn serve bodies on Raven, Nightwing, and Starfire now carry their own --idunn-rudp-health, --idunn-daemon, and --idunn-health-contract identity while Idunn accepts muninn from 10.77.0.4, nightwing-muninn from 10.77.0.3, and starfire-muninn from 127.0.0.1, live Yggdrasil StreamPixels publishes yggdrasil-streampixels from 10.77.0.1, and live Yggdrasil Heimdall publishes heimdall.cultnet-rudp-provider-health from 10.77.0.1 with a boundary store at /srv/heimdall/cultcache/heimdall.service.cc. Repixelizer remains the next cross-host compatibility debt." .to_string(), verification_layer: "CultMesh keepalive store records plus live Idunn decision cycles, not process exit codes or chat summaries." @@ -1017,9 +1016,9 @@ fn daemon_transport_profile( "StreamPixels now publishes daemon-owned RUDP health and a daemon-owned CultCache boundary from the live Yggdrasil service runtime; Idunn accepts yggdrasil-streampixels from 10.77.0.1 and the boundary store at /srv/streampixels/app/.streampixels-data/cultcache/streampixels.service.cc remains the service-owned witness behind the compatibility checks.", ), "yggdrasil-heimdall" => ( - "compatibility.ssh-systemd-http + read-only-redacted-cultcache-witness-planned", - "transport-surgery-required", - "Heimdall is still observed through systemd, /healthz, JWKS, discovery, and nginx compatibility checks on Yggdrasil. The repo already defines redacted CultCache witness descriptors and a Heimdall provider advertisement fixture, but the live service does not yet publish daemon-owned Idunn health, command_boundary, or transport_profile records over CultNet/RUDP.", + "daemon-published-rudp-health + daemon-owned-cultcache-boundary-store + compatibility.ssh-systemd-http fallback", + "partial-rudp-health-and-provider-store-live", + "Heimdall now publishes daemon-owned Idunn health over CultNet/RUDP from the live Yggdrasil service runtime, and its daemon-owned boundary store at /srv/heimdall/cultcache/heimdall.service.cc carries provider advertisement, command_boundary, transport_profile, and daemon-health summary state. /healthz, JWKS, discovery, systemd, and nginx remain compatibility witnesses.", ), "yggdrasil-repixelizer" => ( "compatibility.ssh-systemd-http fallback", @@ -1378,22 +1377,24 @@ fn daemon_surgery_plan(target: &DaemonTarget, updated_at: &str) -> IdunnDaemonSu } "yggdrasil-heimdall" => { severity = "medium"; + status = "partial-rudp-health-and-provider-store-live"; owner = "Heimdall service runtime plus Yggdrasil source-artifact lane"; current_mechanism = - "Heimdall is currently checked on Yggdrasil through systemd liveness, /healthz, JWKS, discovery, and nginx routing via check-heimdall.sh. Its repo already defines redacted CultCache witness descriptors and a Heimdall provider advertisement fixture in src/verse-witness.ts, but the live service still lacks daemon-published Idunn health and runtime-published command_boundary / transport_profile records." + "Heimdall now publishes heimdall.cultnet-rudp-provider-health over CultNet/RUDP from the live Yggdrasil service runtime, and its daemon-owned boundary store at /srv/heimdall/cultcache/heimdall.service.cc contains provider advertisement, command_boundary, transport_profile, and daemon-health summary state. The Yggdrasil source-artifact lane now ships the required CultLib snapshot beside the app artifact, while check-heimdall.sh still verifies systemd, /healthz, JWKS, discovery, nginx, and the boundary witness." .to_string(); intended_authority = - "Heimdall keeps public HTTP as the product boundary while publishing daemon health, provider advertisement, redacted witness surfaces, command boundary, and transport profile as internal CultNet/RUDP state." + "Heimdall keeps public HTTP as the product boundary while publishing daemon health, provider advertisement, command boundary, and transport profile as internal CultNet/RUDP state, with full redacted auth-document witness export following as a separate auth-safe pass." .to_string(); cut_line = - "Systemd, /healthz, JWKS, discovery, and nginx routing stop deciding daemon truth once Heimdall publishes internal RUDP health and runtime-owned command_boundary / transport_profile records alongside its redacted witness surface." + "Keep the Heimdall boundary store and in-process RUDP publisher live on Yggdrasil; systemd, /healthz, JWKS, discovery, and nginx routing are deployment/debug witnesses only once Odin ingests the typed store and Idunn no longer needs compatibility proof." .to_string(); steps = vec![ - "Promote Heimdall's src/verse-witness.ts advertisement from planned fixture/export into a runtime-owned provider surface with daemon-owned update timestamps.".to_string(), - "Publish Heimdall daemon health over CultNet/RUDP from the live Yggdrasil service runtime with a dedicated Idunn health contract instead of yggdrasil.source-deployment-freshness.".to_string(), - "Publish Heimdall command_boundary and transport_profile records from the runtime so deploy/restart authority is inspectable without the compatibility scripts.".to_string(), - "Teach Odin to ingest Heimdall's provider advertisement and redacted witness surfaces as typed state instead of treating HTTP discovery and JWKS as daemon truth.".to_string(), - "Demote check-heimdall.sh, systemd, /healthz, JWKS, discovery, and nginx routing to deployment/debug witnesses once the runtime publications are live.".to_string(), + "Keep Heimdall's src/verse-witness.ts advertisement published through the runtime-owned boundary store with daemon-owned update timestamps.".to_string(), + "Keep Heimdall daemon health published over CultNet/RUDP from the live Yggdrasil service runtime with contract heimdall.cultnet-rudp-provider-health.".to_string(), + "Keep Heimdall command_boundary and transport_profile records in the runtime-owned boundary store so deploy/restart authority is inspectable without the compatibility scripts.".to_string(), + "Keep the Yggdrasil Heimdall source-artifact lane shipping the app artifact plus the CultLib cultnet-ts/cultcache-ts snapshot through a tiny remote runner script instead of brittle inline SSH quoting.".to_string(), + "Teach Odin to ingest Heimdall's provider advertisement and future redacted witness surfaces as typed state instead of treating HTTP discovery and JWKS as daemon truth.".to_string(), + "Demote check-heimdall.sh, systemd, /healthz, JWKS, discovery, and nginx routing to deployment/debug witnesses once Odin and Idunn consume the typed store without compatibility help.".to_string(), ]; } "yggdrasil-repixelizer" => { @@ -2436,11 +2437,11 @@ mod tests { assert_eq!(plan.plan_id, "swarm-surgery:starfire-local"); assert_eq!(plan.status, "active-transport-migration"); - assert_eq!(plan.next_target, "yggdrasil-heimdall"); - assert!(plan.current_phase.contains("Heimdall")); + assert_eq!(plan.next_target, "yggdrasil-repixelizer"); + assert!(plan.current_phase.contains("repixelizer")); assert!( plan.cut_line - .contains("Yggdrasil StreamPixels now exercise daemon-owned RUDP health") + .contains("Yggdrasil Heimdall now exercise daemon-owned RUDP health") ); assert!(plan.cut_line.contains("GameCult\\Vili")); assert!(plan.cut_line.contains("10.77.0.4")); @@ -2454,7 +2455,9 @@ mod tests { assert!(plan.cut_line.contains("verified")); assert!(plan.cut_line.contains("yggdrasil-streampixels")); assert!(plan.cut_line.contains("10.77.0.1")); - assert!(plan.cut_line.contains("Heimdall and repixelizer")); + assert!(plan.cut_line.contains("heimdall.cultnet-rudp-provider-health")); + assert!(plan.cut_line.contains("/srv/heimdall/cultcache/heimdall.service.cc")); + assert!(plan.cut_line.contains("Repixelizer remains")); assert!(plan.verification_layer.contains("CultMesh keepalive store")); assert!( plan.invariants @@ -2634,17 +2637,17 @@ mod tests { )); let heimdall_plan = daemon_surgery_plan(&yggdrasil_heimdall, "unix:100"); - assert_eq!(heimdall_plan.status, "transport-surgery-required"); + assert_eq!(heimdall_plan.status, "partial-rudp-health-and-provider-store-live"); assert!( heimdall_plan .current_mechanism - .contains("src/verse-witness.ts") + .contains("/srv/heimdall/cultcache/heimdall.service.cc") ); assert!( heimdall_plan .steps .iter() - .any(|step| step.contains("redacted witness")) + .any(|step| step.contains("CultLib cultnet-ts/cultcache-ts snapshot")) ); assert!( heimdall_plan @@ -2799,7 +2802,7 @@ mod tests { } #[test] - fn heimdall_transport_profile_marks_witness_planned_state() { + fn heimdall_transport_profile_marks_boundary_store_live() { let heimdall = DaemonTarget { daemon_id: "yggdrasil-heimdall".to_string(), verse_id: "yggdrasil.local".to_string(), @@ -2817,13 +2820,13 @@ mod tests { let profile = daemon_transport_profile(&heimdall, "unix:100"); - assert_eq!(profile.state, "transport-surgery-required"); + assert_eq!(profile.state, "partial-rudp-health-and-provider-store-live"); assert!( profile .current_transport - .contains("read-only-redacted-cultcache-witness-planned") + .contains("daemon-owned-cultcache-boundary-store") ); - assert!(profile.cut_line.contains("command_boundary")); + assert!(profile.cut_line.contains("/srv/heimdall/cultcache/heimdall.service.cc")); } #[test] diff --git a/docs/idunn.md b/docs/idunn.md index 433428e..8cd94ed 100644 --- a/docs/idunn.md +++ b/docs/idunn.md @@ -298,12 +298,15 @@ own `--idunn-rudp-health`, `--idunn-daemon`, and `--idunn-health-contract` arguments. Next: move the remaining Yggdrasil deployments off compatibility health/deck -checks, starting with Heimdall and then repixelizer, then continue +checks, with repixelizer now the explicit next cut, then continue runtime-by-runtime until compatibility probes can be deleted or demoted. -Heimdall is the honest next cut because its repo already advertises redacted -CultCache witness descriptors and a provider surface in `src/verse-witness.ts`, -but the live Yggdrasil service still lacks daemon-published Idunn health plus -runtime-owned command_boundary and transport_profile records. Weksa +Heimdall has now crossed the first live transport line: the Yggdrasil runtime +publishes `heimdall.cultnet-rudp-provider-health`, writes a daemon-owned +boundary witness at `/srv/heimdall/cultcache/heimdall.service.cc`, and the +deploy lane ships the required `CultLib` snapshot beside the app artifact. +Heimdall still owes Odin ingestion of that boundary store plus the later +redacted auth-document witness export, but it is no longer waiting on basic +RUDP keepalive surgery. Weksa now publishes daemon-owned provider advertisement, operator state, Eve surface, command boundary, and transport profile records in its provider store, and Odin local discovery can ingest those records. Weksa still owes CultNet/RUDP command @@ -328,7 +331,7 @@ once Odin consumes the typed store without fallback. Repixelizer still remains plain GUI/systemd compatibility debt today: `repixelizer-gui.service`, `/api/health`, `/api/config`, and nginx routing are still the live witnesses until the runtime publishes internal RUDP health and typed queue/provider -state. VoidBot, Gjallar, Mimir, and +state, so it is the next Yggdrasil target. VoidBot, Gjallar, Mimir, and the Nightwing Eve runtime services still owe provider advertisement and command-boundary RUDP publication before their compatibility surfaces can be purely display/debug lowerings; Gjallar also owes native CultMesh/RUDP deck diff --git a/scripts/deploy-yggdrasil-heimdall.cmd b/scripts/deploy-yggdrasil-heimdall.cmd index cd9b241..a837232 100644 --- a/scripts/deploy-yggdrasil-heimdall.cmd +++ b/scripts/deploy-yggdrasil-heimdall.cmd @@ -1,2 +1,2 @@ @echo off -powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\deploy-yggdrasil-source-app.ps1 -AppId yggdrasil-heimdall -RepoRoot E:\Projects\Heimdall -AppUser heimdall -RemoteAppHome /srv/heimdall -RemoteTarballName heimdall-source.tar -DeployScript E:\Projects\gamecult-ops\scripts\deploy-heimdall.sh -CheckScript E:\Projects\gamecult-ops\scripts\check-heimdall.sh +powershell.exe -NoProfile -ExecutionPolicy Bypass -File E:\Projects\Odin\scripts\deploy-yggdrasil-heimdall.ps1 diff --git a/scripts/deploy-yggdrasil-heimdall.ps1 b/scripts/deploy-yggdrasil-heimdall.ps1 new file mode 100644 index 0000000..e869f47 --- /dev/null +++ b/scripts/deploy-yggdrasil-heimdall.ps1 @@ -0,0 +1,135 @@ +param( + [string] $SshTarget = "yggdrasil", + [string] $RepoRoot = "E:\Projects\Heimdall", + [string] $CultLibRoot = "E:\Projects\CultLib", + [string] $AppUser = "heimdall", + [string] $RemoteAppHome = "/srv/heimdall", + [string] $RemoteTarballName = "heimdall-source.tar", + [string] $RemoteCultLibTarballName = "heimdall-cultlib.tar", + [string] $DeployScript = "E:\Projects\gamecult-ops\scripts\deploy-heimdall.sh", + [string] $CheckScript = "E:\Projects\gamecult-ops\scripts\check-heimdall.sh" +) + +$ErrorActionPreference = "Stop" + +foreach ($path in @($RepoRoot, $CultLibRoot, $DeployScript, $CheckScript)) { + if (-not (Test-Path -LiteralPath $path)) { + throw "Required path not found: $path" + } +} + +$heimdallCommit = (git -C $RepoRoot rev-parse HEAD).Trim() +if ([string]::IsNullOrWhiteSpace($heimdallCommit)) { + throw "Could not determine Heimdall git revision." +} +$cultLibCommit = (git -C $CultLibRoot rev-parse HEAD).Trim() +if ([string]::IsNullOrWhiteSpace($cultLibCommit)) { + throw "Could not determine CultLib git revision." +} + +$scratch = Join-Path "E:\Projects\Odin\scratch\idunn-deploy" "yggdrasil-heimdall" +$sourceTarPath = Join-Path $scratch $RemoteTarballName +$cultLibTarPath = Join-Path $scratch $RemoteCultLibTarballName +$manifestPath = Join-Path $scratch "deployment-manifest.txt" +New-Item -ItemType Directory -Force -Path $scratch | Out-Null + +git -C $RepoRoot archive --format=tar --output=$sourceTarPath HEAD +if ($LASTEXITCODE -ne 0) { + throw "git archive failed for $RepoRoot" +} + +if (Test-Path -LiteralPath $cultLibTarPath) { + Remove-Item -LiteralPath $cultLibTarPath -Force +} +tar.exe -cf $cultLibTarPath -C $CultLibRoot packages/cultnet-ts packages/cultcache-ts +if ($LASTEXITCODE -ne 0) { + throw "CultLib tar build failed for $CultLibRoot" +} + +$sourceHash = (Get-FileHash $sourceTarPath -Algorithm SHA256).Hash.ToLowerInvariant() +$cultLibHash = (Get-FileHash $cultLibTarPath -Algorithm SHA256).Hash.ToLowerInvariant() +$deployedAt = [DateTimeOffset]::UtcNow.ToString("O") +@( + "schema=gamecult.idunn.deployment_manifest.v1" + "appId=yggdrasil-heimdall" + "repoRoot=$RepoRoot" + "gitCommit=$heimdallCommit" + "artifact=$RemoteTarballName" + "sha256=$sourceHash" + "cultLibRepoRoot=$CultLibRoot" + "cultLibGitCommit=$cultLibCommit" + "cultLibArtifact=$RemoteCultLibTarballName" + "cultLibSha256=$cultLibHash" + "deployedAtUtc=$deployedAt" +) | Set-Content -Encoding ASCII -LiteralPath $manifestPath + +$remoteDeploy = "/home/gamecultadmin/$([IO.Path]::GetFileName($DeployScript))" +$remoteCheck = "/home/gamecultadmin/$([IO.Path]::GetFileName($CheckScript))" +$remoteSourceTarball = "/home/gamecultadmin/$RemoteTarballName" +$remoteCultLibTarball = "/home/gamecultadmin/$RemoteCultLibTarballName" +$remoteManifest = "/home/gamecultadmin/yggdrasil-heimdall-deployment-manifest.txt" +$remoteRunner = "/home/gamecultadmin/run-yggdrasil-heimdall-deploy.sh" +$targetSourceTarball = "$RemoteAppHome/$RemoteTarballName" +$targetCultLibTarball = "$RemoteAppHome/$RemoteCultLibTarballName" +$targetManifest = "$RemoteAppHome/deployment-manifest.txt" + +$sftpBatchPath = Join-Path $scratch "yggdrasil-heimdall-upload.sftp" +$runnerPath = Join-Path $scratch "run-yggdrasil-heimdall-deploy.sh" +$runnerScript = @" +#!/usr/bin/env bash +set -euo pipefail + +sudo -n install -d -o '$AppUser' -g '$AppUser' '$RemoteAppHome' +sudo -n install -o '$AppUser' -g '$AppUser' -m 600 '$remoteSourceTarball' '$targetSourceTarball' +sudo -n install -o '$AppUser' -g '$AppUser' -m 600 '$remoteCultLibTarball' '$targetCultLibTarball' +sudo -n install -m 644 '$remoteManifest' '$targetManifest' +chmod +x '$remoteDeploy' '$remoteCheck' +sudo -n bash '$remoteDeploy' + +check_ok=0 +for i in `$(seq 1 30); do + if sudo -n bash '$remoteCheck'; then + check_ok=1 + break + fi + sleep 2 +done + +if [ "`$check_ok" -ne 1 ]; then + sudo -n bash '$remoteCheck' + exit 1 +fi +"@.Replace("`r`n", "`n") +[System.IO.File]::WriteAllText($runnerPath, $runnerScript, [System.Text.Encoding]::ASCII) +@( + "put ""$sourceTarPath"" ""$remoteSourceTarball""" + "put ""$cultLibTarPath"" ""$remoteCultLibTarball""" + "put ""$DeployScript"" ""$remoteDeploy""" + "put ""$CheckScript"" ""$remoteCheck""" + "put ""$manifestPath"" ""$remoteManifest""" + "put ""$runnerPath"" ""$remoteRunner""" +) | Set-Content -Encoding ASCII -LiteralPath $sftpBatchPath + +try { + & sftp.exe -b $sftpBatchPath $SshTarget + if ($LASTEXITCODE -ne 0) { + throw "sftp upload failed for yggdrasil-heimdall" + } + + & ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $SshTarget "chmod +x '$remoteRunner' && bash '$remoteRunner'" + $remoteExit = $LASTEXITCODE + & ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $SshTarget "rm -f '$remoteRunner'" + if ($remoteExit -ne 0) { + throw "remote deploy/check failed for yggdrasil-heimdall" + } +} +finally { + Remove-Item -LiteralPath $runnerPath -Force -ErrorAction SilentlyContinue + Remove-Item -LiteralPath $sftpBatchPath -Force -ErrorAction SilentlyContinue +} + +Write-Host "yggdrasil-heimdall deployed with CultLib snapshot." +Write-Host " heimdallCommit=$heimdallCommit" +Write-Host " cultLibCommit=$cultLibCommit" +Write-Host " artifactSha256=$sourceHash" +Write-Host " cultLibSha256=$cultLibHash" diff --git a/src/Idunn/README.md b/src/Idunn/README.md index 0ee94f5..8e9a30a 100644 --- a/src/Idunn/README.md +++ b/src/Idunn/README.md @@ -196,12 +196,14 @@ and freshness window; otherwise the compatibility probe remains fallback evidence. The current active cut has moved past Raven daemon launcher surgery and into the -remaining Yggdrasil deployments, with Heimdall now the explicit next target and -repixelizer after it. Heimdall is the honest next cut because its repo already -contains redacted witness descriptors and a provider advertisement fixture in -`src/verse-witness.ts`, but the live Yggdrasil service still lacks -daemon-published Idunn health plus runtime-owned command_boundary and -transport_profile records. Vili now publishes RUDP health from Raven +remaining Yggdrasil deployments, with repixelizer now the explicit next target. +Heimdall has crossed the first live transport cut: the Yggdrasil runtime now +publishes `heimdall.cultnet-rudp-provider-health`, writes a daemon-owned +boundary witness at `/srv/heimdall/cultcache/heimdall.service.cc`, and ships +the required `CultLib` snapshot through the source-artifact lane. Heimdall +still owes Odin ingestion of that typed store plus the later redacted +auth-document witness export, but it is no longer blocked on basic daemon +health publication. Vili now publishes RUDP health from Raven through the hidden `GameCult\Vili` scheduled task, and live Idunn accepts `vili.cultnet-rudp-animation-health` from `10.77.0.4`. The Raven repair actuator in [restart-vili.ps1](/E:/Projects/Odin/scripts/restart-vili.ps1) @@ -229,7 +231,8 @@ now lives at `/srv/streampixels/app/.streampixels-data/cultcache/streampixels.service.cc`. The remaining debt is only to demote SSH/systemd/HTTP probes from compatibility proof to deployment/debug witness once Odin consumes the typed store without -fallback. Repixelizer is still plain GUI/systemd compatibility debt for now: +fallback. Repixelizer is still plain GUI/systemd compatibility debt for now, +which makes it the next Yggdrasil surgery target: `repixelizer-gui.service`, `/api/health`, `/api/config`, and nginx routing are still the live witnesses until the runtime publishes internal RUDP health and typed queue/provider state. Raven Muninn task actions are also an explicit ops invariant: Task