From 28856b3f3c4b1b573409c44315abe4dbc4474bde Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 18 Jul 2026 20:32:56 +0100 Subject: [PATCH] Supervise Bifrost Persona feedback deployment --- crates/idunn-daemon/src/main.rs | 89 ++++++++++++++++++- ...loy-yggdrasil-bifrost-persona-feedback.ps1 | 14 +++ 2 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 scripts/deploy-yggdrasil-bifrost-persona-feedback.ps1 diff --git a/crates/idunn-daemon/src/main.rs b/crates/idunn-daemon/src/main.rs index 4aad4a4..c31f46c 100644 --- a/crates/idunn-daemon/src/main.rs +++ b/crates/idunn-daemon/src/main.rs @@ -692,7 +692,16 @@ fn missing_daemon_published_health( desired: &IdunnDesiredDaemonRecord, observed_at: &str, ) -> IdunnDaemonHealthRecord { - let (state, detail, transport) = if target.health_contract.restart_on_missing_publication { + let (state, detail, transport) = if target.health_contract.default_failure_state == "stale-deployment" { + ( + "stale-deployment", + format!( + "no fresh daemon-published {} record arrived over {}; Idunn owns this declared deployment boundary.", + desired.health_contract, CULTNET_RUDP_PROTOCOL_ID + ), + "cultmesh.missing-deployment-health-publication", + ) + } else if target.health_contract.restart_on_missing_publication { ( "failed", format!( @@ -2226,6 +2235,20 @@ fn swarm_targets(options: &SwarmOptions) -> Result> { enabled: true, interval_seconds: 300, }, + DaemonTarget { + daemon_id: "yggdrasil-bifrost-persona-feedback".to_string(), + verse_id: "yggdrasil.local".to_string(), + name: "Yggdrasil Bifrost Persona feedback".to_string(), + health_contract: health_contract( + "bifrost.cultnet-rudp-persona-feedback-health", + "stale-deployment", + ), + deploy_command: Some(script("deploy-yggdrasil-bifrost-persona-feedback.ps1")), + restart_command: None, + release: None, + enabled: true, + interval_seconds: 30, + }, DaemonTarget { daemon_id: "yggdrasil-repixelizer".to_string(), verse_id: "yggdrasil.local".to_string(), @@ -2620,7 +2643,11 @@ fn run_deployment( options: &CommonOptions, ) -> IdunnDeploymentResultRecord { let result_id = format!("result:{}", request.request_id); - match run_shell(&request.command, options) { + match run_shell_with_environment( + &request.command, + options, + &[("IDUNN_DEPLOYMENT_REQUEST_ID", request.request_id.as_str())], + ) { Ok(output) if output.status.success() => IdunnDeploymentResultRecord { result_id, request_id: request.request_id.clone(), @@ -2756,6 +2783,14 @@ fn rollout_result_record( } fn run_shell(command: &str, options: &CommonOptions) -> Result { + run_shell_with_environment(command, options, &[]) +} + +fn run_shell_with_environment( + command: &str, + options: &CommonOptions, + environment: &[(&str, &str)], +) -> Result { let mut process = if cfg!(windows) { let path = windows_command_path(); let command = format!(r#"set "PATH={path}" && set "Path={path}" && {command}"#); @@ -2772,6 +2807,9 @@ fn run_shell(command: &str, options: &CommonOptions) -> Result