Repair Raven Vili RUDP deployment
This commit is contained in:
parent
eb3e1b9ca5
commit
b20710125d
6 changed files with 420 additions and 68 deletions
|
|
@ -890,10 +890,10 @@ fn swarm_surgery_plan(
|
|||
updated_at: &str,
|
||||
) -> IdunnSwarmSurgeryPlanRecord {
|
||||
let next_target = [
|
||||
"vili",
|
||||
"yggdrasil-streampixels",
|
||||
"yggdrasil-repixelizer",
|
||||
"yggdrasil-heimdall",
|
||||
"vili",
|
||||
]
|
||||
.iter()
|
||||
.copied()
|
||||
|
|
@ -937,11 +937,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 12: move Vili and remaining runtime daemons from compatibility probes to daemon-published RUDP state; Raven Muninn scheduled-task actions are now verified background-only, while Vili Raven refresh remains the next shared-host deployment cut."
|
||||
"Phase 12: Vili and Raven Muninn now run through verified background-only shared-host launch paths with live daemon-published RUDP health; StreamPixels Yggdrasil deployment is the next cross-host cut."
|
||||
.to_string(),
|
||||
next_target: next_target.to_string(),
|
||||
cut_line:
|
||||
"Muninn, Idunn, Odin, Stonks, Weksa, VoidBot, Nightwing Gjallar, Mimir Eve dashboard, Nightwing Eve dashboard, and Nightwing Eve browser reference now exercise daemon-owned RUDP health. Vili has an in-process RUDP health publisher with local Idunn acceptance proof, but live Raven deployment and GameCult\\Vili restart remain blocked until the Raven Vili task is refreshed and verified. Live Raven Muninn task actions have been repaired and verified to execute wscript.exe hidden launchers directly for GameCult-Muninn, GameCult-Muninn-Activate, and GameCult-Muninn-VideoProof."
|
||||
"Muninn, Vili, Idunn, Odin, Stonks, Weksa, VoidBot, Nightwing Gjallar, Mimir Eve dashboard, Nightwing Eve dashboard, and Nightwing Eve browser reference 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."
|
||||
.to_string(),
|
||||
verification_layer:
|
||||
"CultMesh keepalive store records plus live Idunn decision cycles, not process exit codes or chat summaries."
|
||||
|
|
@ -994,9 +994,9 @@ fn daemon_transport_profile(
|
|||
"Nightwing Eve browser reference health is published over CultNet/RUDP from the Mimir.EveBrowserReference service process; provider advertisement and command boundaries remain migration debt before the service probe can be deleted.",
|
||||
),
|
||||
"vili" => (
|
||||
"rudp-health-and-local-cultcache-implemented + live Raven compatibility.local-command",
|
||||
"raven-deploy-blocked",
|
||||
"Vili has an in-process CultNet/RUDP Idunn health publisher plus local CultCache provider, operator, command_boundary, and transport_profile records; live Raven deployment and scheduled-task restart are blocked while Raven SSH is unreachable.",
|
||||
"daemon-published-rudp-health + daemon-owned-cultcache-service-boundary + compatibility.http-websocket fallback",
|
||||
"partial-rudp-health-and-provider-store-live",
|
||||
"Vili now publishes vili.cultnet-rudp-animation-health over CultNet/RUDP from the hidden Raven GameCult\\Vili task, and its daemon-owned vili.service.cc store contains provider advertisement, operator state, Eve surface, command_boundary, and transport_profile records; HTTP and WebSocket remain operator/debug lowerings.",
|
||||
),
|
||||
"yggdrasil-streampixels" => (
|
||||
"daemon-published-rudp-health-local-proof + daemon-owned-cultcache-service-boundary + compatibility.ssh-systemd-http fallback",
|
||||
|
|
@ -1096,7 +1096,7 @@ fn daemon_surgery_plan(target: &DaemonTarget, updated_at: &str) -> IdunnDaemonSu
|
|||
"Switch Idunn from the compatibility health command to the daemon-owned RUDP health record.".to_string(),
|
||||
"Delete or demote the old probe to a xenos-boundary compatibility check with no lifecycle authority.".to_string(),
|
||||
];
|
||||
let mut blockers = Vec::new();
|
||||
let blockers = Vec::new();
|
||||
|
||||
match target.daemon_id.as_str() {
|
||||
"odin" => {
|
||||
|
|
@ -1248,29 +1248,25 @@ fn daemon_surgery_plan(target: &DaemonTarget, updated_at: &str) -> IdunnDaemonSu
|
|||
.to_string();
|
||||
}
|
||||
"vili" => {
|
||||
status = "rudp-health-and-cultcache-state-implemented-raven-deploy-blocked";
|
||||
status = "partial-rudp-health-and-provider-store-live";
|
||||
owner = "Vili animation runtime";
|
||||
current_mechanism =
|
||||
"Vili now has an in-process CultNet/RUDP Idunn health publisher in the Node animation daemon plus a Vili-owned vili.service.cc CultCache store containing provider advertisement, operator state, Eve surface, command_boundary, and transport_profile records. Local smoke proof shows Idunn accepts vili.cultnet-rudp-animation-health, and Odin local discovery can ingest the Vili provider advertisement plus command/transport records from that store. Live Raven still runs the compatibility health/deck path until the updated Vili task can be deployed and restarted on that host."
|
||||
"Vili now runs on Raven through the hidden GameCult\\Vili scheduled task, which launches start-vili-daemon.ps1 with --idunn-rudp-health 10.77.0.2:17870 and contract vili.cultnet-rudp-animation-health. Live Idunn accepts that daemon-published health from 10.77.0.4, and Vili writes a daemon-owned vili.service.cc CultCache store containing provider advertisement, operator state, Eve surface, command_boundary, and transport_profile records."
|
||||
.to_string();
|
||||
intended_authority =
|
||||
"Vili publishes animation daemon health, provider advertisement, operator state, command boundary, and transport profile as typed CultMesh/CultNet records over cultnet.transport.rudp.v0; HTTP and WebSocket remain renderer/operator lowerings only."
|
||||
.to_string();
|
||||
cut_line =
|
||||
"Deploy the updated Vili daemon and scheduled-task startup path on Raven, then demote health-vili.cmd and the HTTP deck checks to compatibility witnesses with no lifecycle truth."
|
||||
"Keep health-vili.cmd and the HTTP/WebSocket deck checks as fallback/operator lowerings only until Odin consumes Vili provider records natively and the compatibility health endpoint is demoted to a manual witness."
|
||||
.to_string();
|
||||
steps = vec![
|
||||
"Keep the in-process Vili idunn.daemon_health RUDP publisher wired through scripts/vili-daemon.mjs.".to_string(),
|
||||
"Keep Vili's provider advertisement, operator state, Eve surface, command_boundary, and transport_profile records in the daemon-owned vili.service.cc store.".to_string(),
|
||||
"Deploy the updated Vili package and npm dependency lock on Raven when SSH is reachable.".to_string(),
|
||||
"Restart GameCult\\Vili so the task launches the daemon with --idunn-rudp-health 10.77.0.2:17870 and contract vili.cultnet-rudp-animation-health.".to_string(),
|
||||
"Verify live Idunn accepts vili.cultnet-rudp-animation-health from Raven over cultnet.transport.rudp.v0 before compatibility probe fallback.".to_string(),
|
||||
"Keep Odin provider discovery pointed at Vili's daemon-owned vili.service.cc store; after Raven deploy, demote health-vili.cmd and HTTP/WebSocket deck probes to fallback witnesses only.".to_string(),
|
||||
"Keep scripts/restart-vili.ps1 syncing the authoritative Vili runtime plus flattened CultLib node_modules into Raven before reinstalling the hidden task.".to_string(),
|
||||
"Keep GameCult\\Vili executing wscript.exe hidden launcher arguments that pass --idunn-rudp-health 10.77.0.2:17870, --idunn-daemon vili, and --idunn-health-contract vili.cultnet-rudp-animation-health.".to_string(),
|
||||
"Keep Idunn bound on 0.0.0.0:17870 so WireGuard peers such as Raven can publish daemon-owned health over cultnet.transport.rudp.v0.".to_string(),
|
||||
"Keep Odin provider discovery pointed at Vili's daemon-owned vili.service.cc store; then demote health-vili.cmd and HTTP/WebSocket deck probes to fallback witnesses only.".to_string(),
|
||||
];
|
||||
blockers.push(
|
||||
"Raven SSH currently times out, so the updated Vili runtime cannot be deployed or restarted on the live host."
|
||||
.to_string(),
|
||||
);
|
||||
}
|
||||
"nightwing-eve-dashboard" | "nightwing-eve-browser-reference" => {
|
||||
severity = "medium";
|
||||
|
|
@ -2321,11 +2317,13 @@ mod tests {
|
|||
assert_eq!(plan.plan_id, "swarm-surgery:starfire-local");
|
||||
assert_eq!(plan.status, "active-transport-migration");
|
||||
assert_eq!(plan.next_target, "vili");
|
||||
assert!(plan.current_phase.contains("Vili"));
|
||||
assert!(plan.current_phase.contains("StreamPixels"));
|
||||
assert!(
|
||||
plan.cut_line
|
||||
.contains("Muninn, Idunn, Odin, Stonks, Weksa, VoidBot, Nightwing Gjallar, Mimir Eve dashboard, Nightwing Eve dashboard, and Nightwing Eve browser reference")
|
||||
.contains("Muninn, Vili, Idunn, Odin, Stonks, Weksa, VoidBot, Nightwing Gjallar, Mimir Eve dashboard, Nightwing Eve dashboard, and Nightwing Eve browser reference")
|
||||
);
|
||||
assert!(plan.cut_line.contains("GameCult\\Vili"));
|
||||
assert!(plan.cut_line.contains("10.77.0.4"));
|
||||
assert!(plan.cut_line.contains("GameCult-Muninn-Activate"));
|
||||
assert!(plan.cut_line.contains("GameCult-Muninn-VideoProof"));
|
||||
assert!(plan.cut_line.contains("Muninn task actions"));
|
||||
|
|
@ -2442,21 +2440,20 @@ mod tests {
|
|||
let vili_plan = daemon_surgery_plan(&vili, "unix:100");
|
||||
assert_eq!(
|
||||
vili_plan.status,
|
||||
"rudp-health-and-cultcache-state-implemented-raven-deploy-blocked"
|
||||
"partial-rudp-health-and-provider-store-live"
|
||||
);
|
||||
assert!(vili_plan.current_mechanism.contains("vili.service.cc"));
|
||||
assert!(vili_plan.current_mechanism.contains("GameCult\\Vili"));
|
||||
assert!(
|
||||
vili_plan
|
||||
.steps
|
||||
.iter()
|
||||
.any(|step| step.contains("command_boundary"))
|
||||
);
|
||||
assert!(
|
||||
vili_plan
|
||||
.blockers
|
||||
.iter()
|
||||
.any(|blocker| blocker.contains("Raven SSH currently times out"))
|
||||
);
|
||||
assert!(vili_plan.steps.iter().any(
|
||||
|step| step.contains("0.0.0.0:17870") && step.contains("Raven")
|
||||
));
|
||||
assert!(vili_plan.blockers.is_empty());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
|
|
@ -292,8 +292,9 @@ Raven's Muninn scheduled-task repair is a separate ops invariant:
|
|||
`GameCult-Muninn-VideoProof` must execute `wscript.exe` hidden launcher actions,
|
||||
not raw `.cmd` task actions.
|
||||
|
||||
Next: move Vili off compatibility health/deck checks, then continue
|
||||
runtime-by-runtime until compatibility probes can be deleted or demoted. Weksa
|
||||
Next: move the remaining Yggdrasil deployments off compatibility health/deck
|
||||
checks, then continue runtime-by-runtime until compatibility probes can be
|
||||
deleted or demoted. 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
|
||||
|
|
@ -312,9 +313,10 @@ 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
|
||||
input to replace the current Odin WebSocket lowering bridge. Raven Muninn task
|
||||
action repair is queued separately and remains blocked while Raven is
|
||||
unreachable over SSH; the prepared actuator is
|
||||
`scripts\repair-raven-muninn-task-actions.ps1`.
|
||||
action repair is no longer queued: the live host now executes
|
||||
`GameCult-Muninn`, `GameCult-Muninn-Activate`, and
|
||||
`GameCult-Muninn-VideoProof` through hidden `wscript.exe` launchers, and the
|
||||
repair actuator remains `scripts\repair-raven-muninn-task-actions.ps1`.
|
||||
|
||||
Vili's Node daemon now has an in-process Idunn RUDP publisher for
|
||||
`vili.cultnet-rudp-animation-health`, and local smoke proof shows Idunn accepts
|
||||
|
|
@ -322,11 +324,11 @@ that record over `cultnet.transport.rudp.v0`. Vili also writes
|
|||
`.vili\vili.service.cc` with daemon-owned provider advertisement, operator
|
||||
state, Eve surface, command boundary, and transport profile records. Odin local
|
||||
provider discovery can ingest that typed store, including the Vili command
|
||||
boundary and transport profile. That is implementation proof, not live Raven
|
||||
deployment proof. Vili remains the active cut until Raven is reachable, the
|
||||
updated package is deployed there, and
|
||||
`GameCult\Vili` is restarted with
|
||||
`--idunn-rudp-health 10.77.0.2:17870`.
|
||||
boundary and transport profile. That is now live Raven proof as well: Odin's
|
||||
`scripts\restart-vili.ps1` refreshes the Raven runtime from the authoritative
|
||||
local Vili and CultLib files, reinstalls the hidden `GameCult\Vili` task with
|
||||
`--idunn-rudp-health 10.77.0.2:17870`, and restarts it. Live Idunn accepts
|
||||
`vili.cultnet-rudp-animation-health` from `10.77.0.4`.
|
||||
|
||||
No ad hoc JSON manifest, HTTP endpoint, TCP socket, or WebSocket bridge may
|
||||
become the live state owner. Debug projections are fine when they name the
|
||||
|
|
|
|||
|
|
@ -1,2 +1,2 @@
|
|||
@echo off
|
||||
ssh -o BatchMode=yes raven "cmd /c E:\Projects\Vili\scripts\restart-vili-daemon.cmd"
|
||||
powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -File "%~dp0restart-vili.ps1" %*
|
||||
|
|
|
|||
291
scripts/restart-vili.ps1
Normal file
291
scripts/restart-vili.ps1
Normal file
|
|
@ -0,0 +1,291 @@
|
|||
param(
|
||||
[string] $RavenHost = "raven",
|
||||
[string] $LocalViliRoot = "E:\Projects\Vili",
|
||||
[string] $LocalCultLibRoot = "E:\Projects\CultLib",
|
||||
[string] $RemoteViliRoot = "E:\Projects\Vili",
|
||||
[int] $Port = 8824,
|
||||
[string] $HostName = "0.0.0.0",
|
||||
[string] $StateRoot = "E:\Projects\Vili\.vili",
|
||||
[string] $IdunnRudpHealth = "10.77.0.2:17870",
|
||||
[string] $IdunnDaemon = "vili",
|
||||
[string] $IdunnHealthContract = "vili.cultnet-rudp-animation-health",
|
||||
[int] $IdunnHealthIntervalSeconds = 15
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$localFiles = @(
|
||||
(Join-Path $LocalViliRoot "package.json"),
|
||||
(Join-Path $LocalViliRoot "package-lock.json"),
|
||||
(Join-Path $LocalViliRoot "scripts\health-vili-daemon.cmd"),
|
||||
(Join-Path $LocalViliRoot "scripts\idunn-rudp.cjs"),
|
||||
(Join-Path $LocalViliRoot "scripts\install-vili-task.ps1"),
|
||||
(Join-Path $LocalViliRoot "scripts\restart-vili-daemon.cmd"),
|
||||
(Join-Path $LocalViliRoot "scripts\restart-vili-daemon.ps1"),
|
||||
(Join-Path $LocalViliRoot "scripts\run-hidden-powershell.vbs"),
|
||||
(Join-Path $LocalViliRoot "scripts\run-vili-daemon.ps1"),
|
||||
(Join-Path $LocalViliRoot "scripts\start-vili-daemon.ps1"),
|
||||
(Join-Path $LocalViliRoot "scripts\vili-daemon.mjs"),
|
||||
(Join-Path $LocalCultLibRoot "packages\cultnet-ts"),
|
||||
(Join-Path $LocalCultLibRoot "packages\cultcache-ts"),
|
||||
(Join-Path $LocalCultLibRoot "node_modules\ajv"),
|
||||
(Join-Path $LocalCultLibRoot "node_modules\fast-deep-equal"),
|
||||
(Join-Path $LocalCultLibRoot "node_modules\fast-uri"),
|
||||
(Join-Path $LocalCultLibRoot "node_modules\json-schema-traverse"),
|
||||
(Join-Path $LocalCultLibRoot "node_modules\require-from-string"),
|
||||
(Join-Path $LocalViliRoot "node_modules\@msgpack"),
|
||||
(Join-Path $LocalViliRoot "node_modules\ws")
|
||||
)
|
||||
|
||||
foreach ($path in $localFiles) {
|
||||
if (-not (Test-Path -LiteralPath $path)) {
|
||||
throw "Required Vili runtime path not found: $path"
|
||||
}
|
||||
}
|
||||
|
||||
$syncId = [guid]::NewGuid().ToString("N")
|
||||
$remoteSyncRootPs = "$RemoteViliRoot\.odin-vili-sync-$syncId"
|
||||
$remoteSyncRootSftp = ($remoteSyncRootPs -replace "\\", "/")
|
||||
$remoteTempPs = "C:\Windows\Temp\odin-raven-vili-restart-$syncId.ps1"
|
||||
$remoteTempSftp = ($remoteTempPs -replace "\\", "/")
|
||||
$remoteBundlePs = "C:\Windows\Temp\odin-raven-vili-bundle-$syncId.zip"
|
||||
$remoteBundleSftp = ($remoteBundlePs -replace "\\", "/")
|
||||
$localRemoteScript = Join-Path $env:TEMP "odin-raven-vili-restart-$syncId.ps1"
|
||||
$localSftpBatch = Join-Path $env:TEMP "odin-raven-vili-restart-$syncId.sftp"
|
||||
$localBundleRoot = Join-Path $env:TEMP "odin-raven-vili-bundle-$syncId"
|
||||
$localBundleScripts = Join-Path $localBundleRoot "scripts"
|
||||
$localBundleNodeModules = Join-Path $localBundleRoot "node_modules"
|
||||
$localBundleZip = Join-Path $env:TEMP "odin-raven-vili-bundle-$syncId.zip"
|
||||
|
||||
$remoteScript = @"
|
||||
`$ErrorActionPreference = "Stop"
|
||||
`$ProgressPreference = "SilentlyContinue"
|
||||
|
||||
`$remoteRoot = "$RemoteViliRoot"
|
||||
`$syncRoot = "$remoteSyncRootPs"
|
||||
`$scriptsRoot = Join-Path `$remoteRoot "scripts"
|
||||
`$stateRoot = "$StateRoot"
|
||||
`$nodeModulesRoot = Join-Path `$remoteRoot "node_modules"
|
||||
`$pidPath = Join-Path `$stateRoot "vili-daemon.pid"
|
||||
|
||||
try {
|
||||
Expand-Archive -LiteralPath "$remoteBundlePs" -DestinationPath `$syncRoot -Force
|
||||
if (-not (Test-Path -LiteralPath `$syncRoot)) {
|
||||
throw "Uploaded sync root not found at `$syncRoot"
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath `$pidPath) {
|
||||
`$existingPid = (Get-Content -LiteralPath `$pidPath -Raw -ErrorAction SilentlyContinue).Trim()
|
||||
if (`$existingPid -match '^\d+$') {
|
||||
`$process = Get-Process -Id ([int] `$existingPid) -ErrorAction SilentlyContinue
|
||||
if (`$null -ne `$process) {
|
||||
Stop-Process -Id `$process.Id -Force
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
}
|
||||
Remove-Item -LiteralPath `$pidPath -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path `$scriptsRoot | Out-Null
|
||||
New-Item -ItemType Directory -Force -Path `$stateRoot | Out-Null
|
||||
|
||||
Copy-Item -LiteralPath (Join-Path `$syncRoot "package.json") -Destination (Join-Path `$remoteRoot "package.json") -Force
|
||||
Copy-Item -LiteralPath (Join-Path `$syncRoot "package-lock.json") -Destination (Join-Path `$remoteRoot "package-lock.json") -Force
|
||||
|
||||
`$scriptFiles = @(
|
||||
"health-vili-daemon.cmd",
|
||||
"idunn-rudp.cjs",
|
||||
"install-vili-task.ps1",
|
||||
"restart-vili-daemon.cmd",
|
||||
"restart-vili-daemon.ps1",
|
||||
"run-hidden-powershell.vbs",
|
||||
"run-vili-daemon.ps1",
|
||||
"start-vili-daemon.ps1",
|
||||
"vili-daemon.mjs"
|
||||
)
|
||||
|
||||
foreach (`$name in `$scriptFiles) {
|
||||
Copy-Item -LiteralPath (Join-Path `$syncRoot "scripts\`$name") -Destination (Join-Path `$scriptsRoot `$name) -Force
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath `$nodeModulesRoot) {
|
||||
Remove-Item -LiteralPath `$nodeModulesRoot -Recurse -Force
|
||||
}
|
||||
Move-Item -LiteralPath (Join-Path `$syncRoot "node_modules") -Destination `$nodeModulesRoot -Force
|
||||
|
||||
& powershell.exe @(
|
||||
"-NoProfile",
|
||||
"-NonInteractive",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", (Join-Path `$scriptsRoot "install-vili-task.ps1"),
|
||||
"-TaskName", "GameCult\Vili",
|
||||
"-Port", "$Port",
|
||||
"-HostName", "$HostName",
|
||||
"-StateRoot", "$StateRoot",
|
||||
"-IdunnRudpHealth", "$IdunnRudpHealth",
|
||||
"-IdunnDaemon", "$IdunnDaemon",
|
||||
"-IdunnHealthContract", "$IdunnHealthContract",
|
||||
"-IdunnHealthIntervalSeconds", "$IdunnHealthIntervalSeconds"
|
||||
)
|
||||
|
||||
& powershell.exe @(
|
||||
"-NoProfile",
|
||||
"-NonInteractive",
|
||||
"-ExecutionPolicy", "Bypass",
|
||||
"-File", (Join-Path `$scriptsRoot "restart-vili-daemon.ps1"),
|
||||
"-Port", "$Port",
|
||||
"-HostName", "$HostName",
|
||||
"-StateRoot", "$StateRoot",
|
||||
"-IdunnRudpHealth", "$IdunnRudpHealth",
|
||||
"-IdunnDaemon", "$IdunnDaemon",
|
||||
"-IdunnHealthContract", "$IdunnHealthContract",
|
||||
"-IdunnHealthIntervalSeconds", "$IdunnHealthIntervalSeconds"
|
||||
)
|
||||
|
||||
`$task = Get-ScheduledTask -TaskName "Vili" -TaskPath "\GameCult\" -ErrorAction Stop
|
||||
`$action = @(`$task.Actions)[0]
|
||||
if (`$action.Execute -notmatch '(^|\\)wscript\.exe$') {
|
||||
throw "GameCult\Vili action executes `$(`$action.Execute), expected wscript.exe"
|
||||
}
|
||||
if (`$action.Arguments -notlike "*run-hidden-powershell.vbs*") {
|
||||
throw "GameCult\Vili action arguments do not reference run-hidden-powershell.vbs"
|
||||
}
|
||||
`$taskHealthChecks = @(
|
||||
(`$action.Arguments -like "*-IdunnRudpHealth*"),
|
||||
(`$action.Arguments -like "*$IdunnRudpHealth*"),
|
||||
(`$action.Arguments -like "*-IdunnDaemon*"),
|
||||
(`$action.Arguments -like "*$IdunnDaemon*"),
|
||||
(`$action.Arguments -like "*-IdunnHealthContract*"),
|
||||
(`$action.Arguments -like "*$IdunnHealthContract*")
|
||||
)
|
||||
if (`$taskHealthChecks -contains `$false) {
|
||||
throw "GameCult\Vili action arguments do not carry the Idunn RUDP health contract."
|
||||
}
|
||||
|
||||
`$process = Get-CimInstance Win32_Process |
|
||||
Where-Object { `$_.CommandLine -like '*vili-daemon.mjs*' } |
|
||||
Select-Object -First 1
|
||||
if (`$null -eq `$process) {
|
||||
throw "Vili process is not running after restart."
|
||||
}
|
||||
`$processHealthChecks = @(
|
||||
(`$process.CommandLine -like "*--idunn-rudp-health*"),
|
||||
(`$process.CommandLine -like "*$IdunnRudpHealth*"),
|
||||
(`$process.CommandLine -like "*--idunn-daemon*"),
|
||||
(`$process.CommandLine -like "*$IdunnDaemon*"),
|
||||
(`$process.CommandLine -like "*--idunn-health-contract*"),
|
||||
(`$process.CommandLine -like "*$IdunnHealthContract*")
|
||||
)
|
||||
if (`$processHealthChecks -contains `$false) {
|
||||
throw "Vili process command line does not include the Idunn RUDP health arguments."
|
||||
}
|
||||
|
||||
`$statePath = Join-Path `$stateRoot "operator-state.json"
|
||||
`$deadline = (Get-Date).AddSeconds(30)
|
||||
`$state = `$null
|
||||
while ((Get-Date) -lt `$deadline) {
|
||||
if (Test-Path -LiteralPath `$statePath) {
|
||||
try {
|
||||
`$state = Get-Content -LiteralPath `$statePath -Raw | ConvertFrom-Json
|
||||
if (`$null -ne `$state.idunnRudpHealth -and `$state.idunnRudpHealth.status -eq "published") {
|
||||
break
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
Start-Sleep -Seconds 1
|
||||
}
|
||||
if (`$null -eq `$state -or `$null -eq `$state.idunnRudpHealth) {
|
||||
throw "Vili operator-state.json did not publish idunnRudpHealth after restart."
|
||||
}
|
||||
if (`$state.idunnRudpHealth.status -ne "published") {
|
||||
throw "Vili idunnRudpHealth status is `$(`$state.idunnRudpHealth.status): `$(`$state.idunnRudpHealth.error)"
|
||||
}
|
||||
|
||||
Write-Host "Vili Raven runtime repaired and restarted with Idunn RUDP health."
|
||||
Write-Host "ProcessId=`$(`$process.ProcessId)"
|
||||
Write-Host "TaskArguments=`$(`$action.Arguments)"
|
||||
Write-Host "HealthStatus=`$(`$state.idunnRudpHealth.status)"
|
||||
Write-Host "HealthContract=`$(`$state.idunnRudpHealth.contract)"
|
||||
} finally {
|
||||
Remove-Item -LiteralPath `$syncRoot -Recurse -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -LiteralPath "$remoteBundlePs" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
"@
|
||||
|
||||
$batchLines = @(
|
||||
"put ""$localBundleZip"" ""$remoteBundleSftp""",
|
||||
"put ""$localRemoteScript"" ""$remoteTempSftp"""
|
||||
)
|
||||
|
||||
try {
|
||||
$moduleCopies = @(
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "packages\cultnet-ts"); Destination = (Join-Path $localBundleNodeModules "cultnet-ts") },
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "packages\cultcache-ts"); Destination = (Join-Path $localBundleNodeModules "cultcache-ts") },
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "node_modules\ajv"); Destination = (Join-Path $localBundleNodeModules "ajv") },
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "node_modules\fast-deep-equal"); Destination = (Join-Path $localBundleNodeModules "fast-deep-equal") },
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "node_modules\fast-uri"); Destination = (Join-Path $localBundleNodeModules "fast-uri") },
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "node_modules\json-schema-traverse"); Destination = (Join-Path $localBundleNodeModules "json-schema-traverse") },
|
||||
@{ Source = (Join-Path $LocalCultLibRoot "node_modules\require-from-string"); Destination = (Join-Path $localBundleNodeModules "require-from-string") },
|
||||
@{ Source = (Join-Path $LocalViliRoot "node_modules\@msgpack"); Destination = (Join-Path $localBundleNodeModules "@msgpack") },
|
||||
@{ Source = (Join-Path $LocalViliRoot "node_modules\ws"); Destination = (Join-Path $localBundleNodeModules "ws") }
|
||||
)
|
||||
New-Item -ItemType Directory -Force -Path $localBundleScripts, $localBundleNodeModules | Out-Null
|
||||
Copy-Item -LiteralPath (Join-Path $LocalViliRoot "package.json") -Destination (Join-Path $localBundleRoot "package.json") -Force
|
||||
Copy-Item -LiteralPath (Join-Path $LocalViliRoot "package-lock.json") -Destination (Join-Path $localBundleRoot "package-lock.json") -Force
|
||||
$scriptCopies = @(
|
||||
"health-vili-daemon.cmd",
|
||||
"idunn-rudp.cjs",
|
||||
"install-vili-task.ps1",
|
||||
"restart-vili-daemon.cmd",
|
||||
"restart-vili-daemon.ps1",
|
||||
"run-hidden-powershell.vbs",
|
||||
"run-vili-daemon.ps1",
|
||||
"start-vili-daemon.ps1",
|
||||
"vili-daemon.mjs"
|
||||
)
|
||||
foreach ($scriptName in $scriptCopies) {
|
||||
Copy-Item -LiteralPath (Join-Path $LocalViliRoot "scripts\$scriptName") -Destination (Join-Path $localBundleScripts $scriptName) -Force
|
||||
}
|
||||
foreach ($copy in $moduleCopies) {
|
||||
New-Item -ItemType Directory -Force -Path (Split-Path -Parent $copy.Destination) | Out-Null
|
||||
Copy-Item -LiteralPath $copy.Source -Destination $copy.Destination -Recurse -Force
|
||||
}
|
||||
if (Test-Path -LiteralPath $localBundleZip) {
|
||||
Remove-Item -LiteralPath $localBundleZip -Force
|
||||
}
|
||||
Compress-Archive -Path (Join-Path $localBundleRoot "*") -DestinationPath $localBundleZip -CompressionLevel Optimal
|
||||
Set-Content -LiteralPath $localRemoteScript -Encoding ASCII -Value $remoteScript
|
||||
Set-Content -LiteralPath $localSftpBatch -Encoding ASCII -Value ($batchLines -join "`r`n")
|
||||
& sftp.exe -b $localSftpBatch $RavenHost
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
$remoteRunner = @"
|
||||
`$ErrorActionPreference = "Stop"
|
||||
try {
|
||||
& "$remoteTempPs"
|
||||
`$code = `$LASTEXITCODE
|
||||
} finally {
|
||||
Remove-Item -LiteralPath "$remoteTempPs" -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
exit `$code
|
||||
"@
|
||||
$encodedRunner = [Convert]::ToBase64String([Text.Encoding]::Unicode.GetBytes($remoteRunner))
|
||||
& ssh.exe -o BatchMode=yes -o ConnectTimeout=10 $RavenHost "powershell.exe -NoProfile -NonInteractive -ExecutionPolicy Bypass -EncodedCommand $encodedRunner"
|
||||
} finally {
|
||||
Remove-Item -LiteralPath $localRemoteScript, $localSftpBatch -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -LiteralPath $localBundleZip -Force -ErrorAction SilentlyContinue
|
||||
Remove-Item -LiteralPath $localBundleRoot -Recurse -Force -ErrorAction SilentlyContinue
|
||||
}
|
||||
|
||||
$restartExit = $LASTEXITCODE
|
||||
if ($restartExit -eq 0) {
|
||||
Start-Sleep -Seconds 2
|
||||
try {
|
||||
& curl.exe -fsS --max-time 15 "http://10.77.0.4:$Port/operator-state" | Out-Null
|
||||
} catch {
|
||||
}
|
||||
}
|
||||
exit $restartExit
|
||||
|
|
@ -15,6 +15,52 @@ $errLog = Join-Path $StateDir "idunn.err.log"
|
|||
|
||||
New-Item -ItemType Directory -Force -Path $StateDir | Out-Null
|
||||
|
||||
function Get-IdunnStartupDetail {
|
||||
$detail = ""
|
||||
if (Test-Path -LiteralPath $outLog) { $detail += Get-Content -Raw -LiteralPath $outLog }
|
||||
if (Test-Path -LiteralPath $errLog) { $detail += Get-Content -Raw -LiteralPath $errLog }
|
||||
return $detail
|
||||
}
|
||||
|
||||
function Move-CorruptIdunnStoreAside {
|
||||
param(
|
||||
[string] $StorePath
|
||||
)
|
||||
|
||||
if (-not (Test-Path -LiteralPath $StorePath)) {
|
||||
return $null
|
||||
}
|
||||
|
||||
$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"
|
||||
$corruptPath = Join-Path $StateDir "idunn.keepalive.corrupt-$timestamp.cc"
|
||||
Move-Item -LiteralPath $StorePath -Destination $corruptPath -Force
|
||||
Remove-Item -LiteralPath "$StorePath.lock" -Force -ErrorAction SilentlyContinue
|
||||
Write-Host "Archived corrupt Idunn store to $corruptPath"
|
||||
return $corruptPath
|
||||
}
|
||||
|
||||
function Start-IdunnProcess {
|
||||
param(
|
||||
[string] $IdunnExe,
|
||||
[object[]] $Arguments,
|
||||
[string] $RepoRoot,
|
||||
[string] $OutLog,
|
||||
[string] $ErrLog,
|
||||
[string] $PidPath
|
||||
)
|
||||
|
||||
$process = Start-Process -FilePath $IdunnExe `
|
||||
-ArgumentList $Arguments `
|
||||
-WorkingDirectory $RepoRoot `
|
||||
-WindowStyle Hidden `
|
||||
-PassThru `
|
||||
-RedirectStandardOutput $OutLog `
|
||||
-RedirectStandardError $ErrLog
|
||||
$process.Id | Set-Content -Encoding ASCII -LiteralPath $PidPath
|
||||
Start-Sleep -Seconds 2
|
||||
return $process
|
||||
}
|
||||
|
||||
if (-not (Test-Path -LiteralPath $idunnExe)) {
|
||||
Push-Location -LiteralPath $repoRoot
|
||||
try {
|
||||
|
|
@ -89,20 +135,30 @@ if (Test-Path -LiteralPath $operatorAlarmCommand) {
|
|||
$arguments += @("--operator-alarm-command", $operatorAlarmCommand)
|
||||
}
|
||||
|
||||
$process = Start-Process -FilePath $idunnExe `
|
||||
-ArgumentList $arguments `
|
||||
-WorkingDirectory $repoRoot `
|
||||
-WindowStyle Hidden `
|
||||
-PassThru `
|
||||
-RedirectStandardOutput $outLog `
|
||||
-RedirectStandardError $errLog
|
||||
$process.Id | Set-Content -Encoding ASCII -LiteralPath $pidPath
|
||||
$process = Start-IdunnProcess `
|
||||
-IdunnExe $idunnExe `
|
||||
-Arguments $arguments `
|
||||
-RepoRoot $repoRoot `
|
||||
-OutLog $outLog `
|
||||
-ErrLog $errLog `
|
||||
-PidPath $pidPath
|
||||
|
||||
Start-Sleep -Seconds 2
|
||||
if ($process.HasExited) {
|
||||
$detail = ""
|
||||
if (Test-Path -LiteralPath $outLog) { $detail += Get-Content -Raw -LiteralPath $outLog }
|
||||
if (Test-Path -LiteralPath $errLog) { $detail += Get-Content -Raw -LiteralPath $errLog }
|
||||
$detail = Get-IdunnStartupDetail
|
||||
if ($detail -like "*failed to decode MessagePack*" -and (Test-Path -LiteralPath $storePath)) {
|
||||
Move-CorruptIdunnStoreAside -StorePath $storePath | Out-Null
|
||||
$process = Start-IdunnProcess `
|
||||
-IdunnExe $idunnExe `
|
||||
-Arguments $arguments `
|
||||
-RepoRoot $repoRoot `
|
||||
-OutLog $outLog `
|
||||
-ErrLog $errLog `
|
||||
-PidPath $pidPath
|
||||
}
|
||||
}
|
||||
|
||||
if ($process.HasExited) {
|
||||
$detail = Get-IdunnStartupDetail
|
||||
throw "Idunn swarm supervisor exited immediately with code $($process.ExitCode).`n$detail"
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -179,8 +179,10 @@ loopback CultNet hello over `cultnet.transport.rudp.v0`. That proves Idunn's
|
|||
Rust body can use the RUDP substrate before it asks the rest of the swarm to
|
||||
walk through the same door.
|
||||
|
||||
The local swarm also opens a RUDP health ingress at `127.0.0.1:17870` unless
|
||||
started with `--rudp-health-bind none`. It accepts raw
|
||||
The daemon itself defaults to `127.0.0.1:17870`, but
|
||||
`scripts/start-idunn-local.ps1` launches the local swarm with
|
||||
`--rudp-health-bind 0.0.0.0:17870` so WireGuard peers such as Raven and
|
||||
Nightwing can publish to `10.77.0.2:17870`. It accepts raw
|
||||
`idunn.daemon_health` document puts on the canonical CNR0 RUDP `schema` channel
|
||||
and writes them into the keepalive store. That is daemon-owned health
|
||||
publication, not restart/deploy authority. On Windows, UDP reset reports from
|
||||
|
|
@ -193,22 +195,26 @@ probe. The record must match the daemon id, health contract, RUDP transport,
|
|||
and freshness window; otherwise the compatibility probe remains fallback
|
||||
evidence.
|
||||
|
||||
The current active cut is Vili plus Raven task-action repair, with Weksa's
|
||||
provider-store boundary now advanced locally. Vili publishes RUDP health locally
|
||||
and writes a daemon-owned `.vili\vili.service.cc` store with provider
|
||||
advertisement, operator state, Eve surface, command boundary, and transport
|
||||
profile records; Odin local discovery can ingest that typed store. Live Raven
|
||||
deployment remains blocked while SSH is unreachable. Weksa publishes RUDP health
|
||||
and a daemon-owned provider store containing provider advertisement, operator
|
||||
state, Eve surface, command boundary, and transport profile records; Odin local
|
||||
discovery can ingest that typed store too. Weksa still owes CultNet/RUDP command
|
||||
document ingress for MiMo VoiceDesign before its HTTP command route can become
|
||||
debug-only. Stonks publishes RUDP health and a daemon-owned CultCache store
|
||||
containing provider advertisement, market snapshot, Eve surface, command
|
||||
boundary, and transport profile records; Odin local discovery can ingest that
|
||||
store as provider truth. StreamPixels now publishes a service-owned CultCache
|
||||
boundary store with provider advertisement, command boundary, transport profile,
|
||||
and Idunn health summary; Odin local discovery can ingest that store, and local
|
||||
The current active cut has moved past Raven daemon launcher surgery and into the
|
||||
remaining Yggdrasil deployments. 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)
|
||||
syncs the authoritative Vili runtime plus flattened CultLib node modules before
|
||||
reinstalling the hidden task. Vili also writes a daemon-owned
|
||||
`.vili\vili.service.cc` store with provider advertisement, operator state, Eve
|
||||
surface, command boundary, and transport profile records; Odin local discovery
|
||||
can ingest that typed store. Weksa publishes RUDP health and a daemon-owned
|
||||
provider store containing provider advertisement, operator state, Eve surface,
|
||||
command boundary, and transport profile records; Odin local discovery can ingest
|
||||
that typed store too. Weksa still owes CultNet/RUDP command document ingress
|
||||
for MiMo VoiceDesign before its HTTP command route can become debug-only.
|
||||
Stonks publishes RUDP health and a daemon-owned CultCache store containing
|
||||
provider advertisement, market snapshot, Eve surface, command boundary, and
|
||||
transport profile records; Odin local discovery can ingest that store as
|
||||
provider truth. StreamPixels now publishes a service-owned CultCache boundary
|
||||
store with provider advertisement, command boundary, transport profile, and
|
||||
Idunn health summary; Odin local discovery can ingest that store, and local
|
||||
Idunn has accepted StreamPixels daemon health over CultNet/RUDP. Yggdrasil
|
||||
deployment remains owed before SSH/systemd/HTTP probes are only debug
|
||||
witnesses. Raven Muninn task actions are also an explicit ops invariant: Task
|
||||
|
|
|
|||
Loading…
Reference in a new issue