diff --git a/epiphany-core/src/bin/epiphany-daemon-supervisor.rs b/epiphany-core/src/bin/epiphany-daemon-supervisor.rs index 38d1aeaf..dc826803 100644 --- a/epiphany-core/src/bin/epiphany-daemon-supervisor.rs +++ b/epiphany-core/src/bin/epiphany-daemon-supervisor.rs @@ -3,6 +3,10 @@ use anyhow::Result; use chrono::DateTime; use chrono::Duration; use chrono::Utc; +use cultnet_rs::{ + GameCultProviderHealthIdentity, ServiceIdentitySigner, enroll_service_identity_at, + export_service_identity_trust_anchor, open_service_identity_at, +}; use ed25519_dalek::SigningKey; use epiphany_core::EPIPHANY_CULTMESH_DAEMON_RESTART_POLICY_SCHEMA_VERSION; use epiphany_core::EPIPHANY_CULTMESH_DAEMON_SCHEDULER_RECEIPT_SCHEMA_VERSION; @@ -191,6 +195,8 @@ fn dispatch(args: Args) -> Result<()> { "managed-service-task-uninstall" => managed_service_task_control(args, "uninstall"), "migrate-retired-operator-status" => migrate_retired_operator_status(args), "migrate-semantic-attempts-v0" => migrate_semantic_attempts_v0(args), + "provider-health-identity-enroll" => provider_health_identity_enroll(args), + "provider-health-identity-export" => provider_health_identity_export(args), "semantic-projector-service-status" => semantic_projector_service_status(args), "service-plan" => service_plan(args), "service-launch" | "launch-service" | "start-service" => service_launch(args), @@ -269,6 +275,46 @@ fn append_fatal_log(path: &Path, error: &anyhow::Error) -> Result<()> { Ok(()) } +fn provider_health_identity_enroll(args: Args) -> Result<()> { + let path = args.idunn_provider_health_identity_store.context( + "provider-health identity enrollment requires --idunn-provider-health-identity-store", + )?; + let signer = enroll_service_identity_at::(&path)?; + println!( + "{}", + serde_json::to_string_pretty(&json!({ + "schemaVersion": "epiphany.provider_health_identity_enrollment.v1", + "identityId": signer.entry().identity_id, + "privateStateExposed": false, + }))? + ); + Ok(()) +} + +fn provider_health_identity_export(args: Args) -> Result<()> { + let private = args.idunn_provider_health_identity_store.context( + "provider-health identity export requires --idunn-provider-health-identity-store", + )?; + let public = args.idunn_provider_health_public_anchor.context( + "provider-health identity export requires --idunn-provider-health-public-anchor", + )?; + if private == public { + anyhow::bail!("provider-health private identity and public anchor paths must differ"); + } + let signer = open_service_identity_at::(&private)?; + export_service_identity_trust_anchor(&signer, &public)?; + println!( + "{}", + serde_json::to_string_pretty(&json!({ + "schemaVersion": "epiphany.provider_health_identity_export.v1", + "identityId": signer.entry().identity_id, + "publicAnchor": public, + "privateStateExposed": false, + }))? + ); + Ok(()) +} + fn refuse_false_windows_scm_authority() -> Result<()> { anyhow::bail!( "Windows SCM deployment is unsupported: this executable is a foreground console process, not a Windows service host; use managed-service-task-plan/install/status/start/stop/uninstall" @@ -858,9 +904,12 @@ fn managed_service_serve(args: Args) -> Result<()> { if fs::canonicalize(env::current_exe()?)? != expected_supervisor { anyhow::bail!("managed-service reconciler executable is not the pinned release supervisor"); } - let health_signer = open_default_host_identity()?; + let health_signer = args + .idunn_provider_health_identity_store + .as_deref() + .map(open_service_identity_at::) + .transpose()?; let health_publisher_incarnation = Uuid::new_v4().to_string(); - let health_publisher_process = capture_process_instance(std::process::id())?; let mut iteration = 0_u64; loop { let (release, release_witness_sha256) = pinned_packaged_release(&args, true)?; @@ -881,8 +930,7 @@ fn managed_service_serve(args: Args) -> Result<()> { &policies, &health_publisher_incarnation, iteration, - &health_publisher_process, - &health_signer, + health_signer.as_ref(), ); println!( "{}", @@ -912,13 +960,13 @@ fn publish_managed_service_iteration_health( policies: &[EpiphanyCultMeshManagedServicePolicyEntry], publisher_incarnation_id: &str, publisher_sequence: u64, - publisher_process: &ProcessInstanceIdentity, - health_signer: &epiphany_core::HostIdentitySigner, + health_signer: Option<&ServiceIdentitySigner>, ) { - let (Some(endpoint), Some(daemon_id), Some(health_contract)) = ( + let (Some(endpoint), Some(daemon_id), Some(health_contract), Some(health_signer)) = ( args.idunn_rudp_health, args.idunn_daemon.as_deref(), args.idunn_health_contract.as_deref(), + health_signer, ) else { return; }; @@ -929,7 +977,6 @@ fn publish_managed_service_iteration_health( let mut expected = required.len(); let mut terminal_current = 0_usize; let mut warming = 0_usize; - let mut workspace_evidence = None; let mut contradictions = Vec::new(); if let (Some(heartbeat_store), Some(resident_store)) = ( args.resident_heartbeat_store.as_deref(), @@ -1044,15 +1091,8 @@ fn publish_managed_service_iteration_health( &args.runtime_id, host.entry(), ) { - Ok(Some(authority)) => { + Ok(Some(_authority)) => { terminal_current += 1; - workspace_evidence = Some(format!( - "workspaceTerminalReceiptId={} workspacePlanId={} workspaceBodyObservationId={} workspaceBodyGeneration={}", - authority.receipt_id, - authority.plan_id, - authority.body_observation_id, - authority.body_generation - )); } Ok(None) => { let launch = match load_latest_workspace_coverage_managed_process_launch( @@ -1083,11 +1123,6 @@ fn publish_managed_service_iteration_health( Ok(advanced) if Utc::now().signed_duration_since(advanced) >= Duration::zero() && Utc::now().signed_duration_since(advanced) <= Duration::seconds(WORKSPACE_PROGRESS_NO_ADVANCE_LEASE_SECONDS) => { warming += 1; - workspace_evidence = Some(format!( - "workspaceProgressId={} workspaceCheckpointId={} workspacePlanId={} workspaceCompletedUnits={} workspaceTotalUnits={} workspaceLastAdvancedAt={}", - authority.progress_id, authority.checkpoint_id, authority.plan_id, - authority.completed_units, authority.total_units, authority.last_advanced_at_utc - )); } Ok(_) => contradictions.push("workspace advancement sight exceeded the supervisor no-advance lease".into()), Err(error) => contradictions.push(format!("workspace advancement sight time is invalid: {error:#}")), @@ -1126,22 +1161,14 @@ fn publish_managed_service_iteration_health( warming_service_count: warming, contradictions, }); - match health.and_then(|mut health| { + match health.and_then(|health| { let witness_sha256 = epiphany_packaged_release_witness_sha256(release)?; if witness_sha256 != authenticated_release_witness_sha256 { anyhow::bail!("aggregate health release witness changed after authentication"); } - health.detail.push_str(&format!( - " releaseId={} witnessSha256={} sourceCommit={}", - release.release_id, witness_sha256, release.source_commit_sha - )); - if let Some(evidence) = &workspace_evidence { - health.detail.push(' '); - health.detail.push_str(evidence); - } let signed = sign_epiphany_runtime_health( health, - "epiphany-daemon-supervisor", + &args.runtime_id, &release.release_id, &witness_sha256, &release.source_commit_sha, @@ -1150,10 +1177,9 @@ fn publish_managed_service_iteration_health( .context("aggregate health requires --idunn-deployment-request-id")?, publisher_incarnation_id, publisher_sequence, - publisher_process, health_signer, )?; - publish_idunn_daemon_health_rudp(endpoint, "epiphany-daemon-supervisor", &signed) + publish_idunn_daemon_health_rudp(endpoint, &args.runtime_id, &signed) }) { Ok(()) => {} Err(error) => eprintln!("Epiphany could not publish aggregate Idunn health: {error:#}"), @@ -5030,18 +5056,30 @@ mod semantic_projector_authority_tests { #[test] fn idunn_health_configuration_is_explicit_and_all_or_none() { let endpoint: SocketAddr = "127.0.0.1:17870".parse().unwrap(); - assert!(validate_idunn_health_options(None, None, None, None).is_ok()); + let identity_store = Path::new("provider-health.cc"); + assert!(validate_idunn_health_options(None, None, None, None, None).is_ok()); assert!( validate_idunn_health_options( Some(&endpoint), Some("yggdrasil-epiphany"), Some("epiphany.cultnet-rudp-runtime-health"), Some("deploy-request-test"), + Some(identity_store), ) .is_ok() ); - assert!(validate_idunn_health_options(Some(&endpoint), None, None, None).is_err()); - assert!(validate_idunn_health_options(None, Some("epiphany"), None, None).is_err()); + assert!(validate_idunn_health_options(Some(&endpoint), None, None, None, None).is_err()); + assert!(validate_idunn_health_options(None, Some("epiphany"), None, None, None).is_err()); + assert!( + validate_idunn_health_options( + Some(&endpoint), + Some("yggdrasil-epiphany"), + Some("epiphany.cultnet-rudp-runtime-health"), + Some("deploy-request-test"), + None, + ) + .is_err() + ); } #[test] @@ -5172,6 +5210,8 @@ struct Args { idunn_daemon: Option, idunn_health_contract: Option, idunn_deployment_request_id: Option, + idunn_provider_health_identity_store: Option, + idunn_provider_health_public_anchor: Option, resident_heartbeat_store: Option, resident_self_store: Option, resident_provider_stale_seconds: u64, @@ -5232,6 +5272,8 @@ impl Args { let mut idunn_daemon = None; let mut idunn_health_contract = None; let mut idunn_deployment_request_id = None; + let mut idunn_provider_health_identity_store = None; + let mut idunn_provider_health_public_anchor = None; let mut resident_heartbeat_store = None; let mut resident_self_store = None; let mut resident_provider_stale_seconds = 180_u64; @@ -5441,6 +5483,18 @@ impl Args { .context("missing --idunn-deployment-request-id value")?, ); } + "--idunn-provider-health-identity-store" => { + idunn_provider_health_identity_store = + Some(PathBuf::from(values.next().context( + "missing --idunn-provider-health-identity-store value", + )?)); + } + "--idunn-provider-health-public-anchor" => { + idunn_provider_health_public_anchor = + Some(PathBuf::from(values.next().context( + "missing --idunn-provider-health-public-anchor value", + )?)); + } "--resident-heartbeat-store" => { resident_heartbeat_store = Some(PathBuf::from( values @@ -5515,6 +5569,8 @@ impl Args { | "managed-service-task-uninstall" | "migrate-retired-operator-status" | "migrate-semantic-attempts-v0" + | "provider-health-identity-enroll" + | "provider-health-identity-export" | "semantic-projector-service-status" | "service-plan" | "install-service" @@ -5588,12 +5644,47 @@ impl Args { if !matches!(restart_mode.as_str(), "always" | "on-failure" | "never") { anyhow::bail!("--restart-mode must be always, on-failure, or never"); } - validate_idunn_health_options( - idunn_rudp_health.as_ref(), - idunn_daemon.as_deref(), - idunn_health_contract.as_deref(), - idunn_deployment_request_id.as_deref(), - )?; + if matches!( + command.as_str(), + "provider-health-identity-enroll" | "provider-health-identity-export" + ) { + if [ + idunn_rudp_health.is_some(), + idunn_daemon.is_some(), + idunn_health_contract.is_some(), + idunn_deployment_request_id.is_some(), + ] + .into_iter() + .any(|present| present) + { + anyhow::bail!("provider-health identity commands cannot publish health"); + } + if idunn_provider_health_identity_store.is_none() { + anyhow::bail!( + "provider-health identity command requires --idunn-provider-health-identity-store" + ); + } + if command == "provider-health-identity-enroll" + && idunn_provider_health_public_anchor.is_some() + { + anyhow::bail!( + "provider-health enrollment cannot write a public anchor; use provider-health-identity-export" + ); + } + } else { + validate_idunn_health_options( + idunn_rudp_health.as_ref(), + idunn_daemon.as_deref(), + idunn_health_contract.as_deref(), + idunn_deployment_request_id.as_deref(), + idunn_provider_health_identity_store.as_deref(), + )?; + if idunn_provider_health_public_anchor.is_some() { + anyhow::bail!( + "--idunn-provider-health-public-anchor belongs only to provider-health-identity-export" + ); + } + } let operator_health_fields = [ operator_service_readiness_store.is_some(), operator_executor_trust_anchor.is_some(), @@ -5656,6 +5747,8 @@ impl Args { idunn_daemon, idunn_health_contract, idunn_deployment_request_id, + idunn_provider_health_identity_store, + idunn_provider_health_public_anchor, resident_heartbeat_store, resident_self_store, resident_provider_stale_seconds, @@ -5671,16 +5764,18 @@ fn validate_idunn_health_options( daemon_id: Option<&str>, health_contract: Option<&str>, deployment_request_id: Option<&str>, + identity_store: Option<&Path>, ) -> Result<()> { let fields = [ endpoint.is_some(), daemon_id.is_some(), health_contract.is_some(), deployment_request_id.is_some(), + identity_store.is_some(), ]; if fields.into_iter().any(|present| present) && !fields.into_iter().all(|present| present) { anyhow::bail!( - "--idunn-rudp-health, --idunn-daemon, --idunn-health-contract, and --idunn-deployment-request-id are all-or-none" + "--idunn-rudp-health, --idunn-daemon, --idunn-health-contract, --idunn-deployment-request-id, and --idunn-provider-health-identity-store are all-or-none" ); } for (label, value) in [ diff --git a/epiphany-core/src/idunn_runtime_health.rs b/epiphany-core/src/idunn_runtime_health.rs index 1cd7d031..77289786 100644 --- a/epiphany-core/src/idunn_runtime_health.rs +++ b/epiphany-core/src/idunn_runtime_health.rs @@ -1,22 +1,17 @@ use anyhow::{Context, Result, anyhow, bail}; +use cultcache_rs::DatabaseEntry; use cultnet_rs::{ CultNetMessage, CultNetRawDocumentRecord, CultNetRawPayloadEncoding, CultNetRudpSocketTransportConnection, CultNetRudpSocketTransportOptions, CultNetWireContract, - encode_cultnet_message_to_vec, + GameCultProviderHealthIdentity, IdunnSignedDaemonHealthPurpose, IdunnSignedDaemonHealthRecord, + ServiceIdentitySigner, encode_cultnet_message_to_vec, }; use serde::{Deserialize, Serialize}; use std::net::{SocketAddr, UdpSocket}; use std::time::{Duration, Instant}; -pub const IDUNN_DAEMON_HEALTH_TYPE: &str = "idunn.daemon_health"; -pub const IDUNN_DAEMON_HEALTH_SCHEMA_VERSION: &str = "idunn.daemon_health.v1"; -pub const EPIPHANY_SIGNED_RUNTIME_HEALTH_TYPE: &str = "epiphany.idunn_signed_runtime_health"; -pub const EPIPHANY_SIGNED_RUNTIME_HEALTH_SCHEMA_VERSION: &str = - "epiphany.idunn_signed_runtime_health.v0"; pub const EPIPHANY_IDUNN_RUNTIME_HEALTH_CONTRACT: &str = "epiphany.cultnet-rudp-runtime-health"; pub const CULTNET_RUDP_PROTOCOL_ID: &str = "cultnet.transport.rudp.v0"; -// Shared Idunn daemon-health RUDP contract. This must match the Idunn ingress -// constant; a private Epiphany connection id cannot complete the handshake. const IDUNN_HEALTH_RUDP_CONNECTION_ID: u32 = 0x1d0d_0001; #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] @@ -30,26 +25,6 @@ pub struct IdunnDaemonHealthDocument { pub transport: String, } -#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] -pub struct EpiphanySignedRuntimeHealthDocument { - pub schema_version: String, - pub health: IdunnDaemonHealthDocument, - pub source_runtime_id: String, - pub release_id: String, - pub release_witness_sha256: String, - pub source_commit: String, - pub deployment_request_id: String, - pub publisher_incarnation_id: String, - pub publisher_sequence: u64, - pub publisher_process_id: u32, - pub publisher_process_creation_token: u64, - pub publisher_process_created_at: String, - pub publisher_executable_path: String, - pub signer_identity_id: String, - pub signature_algorithm: String, - pub signature: Vec, -} - pub fn sign_epiphany_runtime_health( health: IdunnDaemonHealthDocument, source_runtime_id: &str, @@ -59,38 +34,41 @@ pub fn sign_epiphany_runtime_health( deployment_request_id: &str, publisher_incarnation_id: &str, publisher_sequence: u64, - process: &crate::ProcessInstanceIdentity, - signer: &crate::HostIdentitySigner, -) -> Result { + signer: &ServiceIdentitySigner, +) -> Result { validate_health_document(&health)?; - let mut document = EpiphanySignedRuntimeHealthDocument { - schema_version: EPIPHANY_SIGNED_RUNTIME_HEALTH_SCHEMA_VERSION.into(), - health, + let observed_at_unix_millis = chrono::DateTime::parse_from_rfc3339(&health.observed_at)? + .timestamp_millis() + .try_into() + .context("runtime health observation precedes Unix epoch")?; + let mut record = IdunnSignedDaemonHealthRecord { + schema_version: "idunn.signed_daemon_health.v1".into(), + daemon_id: health.daemon_id, + health_contract: health.health_contract, source_runtime_id: source_runtime_id.into(), - release_id: release_id.into(), - release_witness_sha256: release_witness_sha256.into(), - source_commit: source_commit.into(), - deployment_request_id: deployment_request_id.into(), + state: health.state, + detail: health.detail, + signer_identity_id: signer.entry().identity_id.clone(), publisher_incarnation_id: publisher_incarnation_id.into(), publisher_sequence, - publisher_process_id: process.process_id, - publisher_process_creation_token: process.creation_token, - publisher_process_created_at: process - .created_at_rfc3339 - .clone() - .context("runtime health publisher process creation time is unavailable")?, - publisher_executable_path: process.executable_path.display().to_string(), - signer_identity_id: signer.entry().identity_id.clone(), + observed_at_unix_millis, + release_id: Some(release_id.into()), + release_witness_sha256: Some(release_witness_sha256.into()), + source_commit: Some(source_commit.into()), + deployment_id: Some(deployment_request_id.into()), signature_algorithm: "ed25519".into(), signature: Vec::new(), + private_state_exposed: false, }; - validate_signed_health_shape(&document, false)?; - let statement = signed_health_statement(&document)?; - document.signature = signer - .sign(EPIPHANY_SIGNED_RUNTIME_HEALTH_TYPE, &statement)? - .signature; - validate_signed_health_shape(&document, true)?; - Ok(document) + validate_unsigned_record(&record)?; + let canonical = canonical_unsigned_record(&record)?; + let proof = signer.sign::(&canonical); + if proof.identity_id != record.signer_identity_id { + bail!("provider-health signer identity disagrees with record") + } + record.signature = proof.signature; + record.validate()?; + Ok(record) } #[derive(Clone, Debug, PartialEq, Eq)] @@ -123,93 +101,67 @@ pub fn derive_epiphany_aggregate_runtime_health( { bail!("managed service health counts exceed the expected service count"); } - let (state, detail) = if !input.contradictions.is_empty() { - ( - "failed", - format!( - "Epiphany runtime authority is contradictory: {}", - input.contradictions.join("; ") - ), - ) + ("failed", "runtime-contradiction") } else if !input.release_authenticated { - ( - "failed", - "Epiphany packaged release authentication failed.".to_string(), - ) + ("failed", "release-authentication-failed") } else if input.terminal_current_service_count == input.expected_service_count { - ( - "active", - format!( - "Epiphany packaged release and all {} managed services have terminal current authority.", - input.expected_service_count - ), - ) + ("active", "managed-services-current") } else if input.warming_service_count > 0 && input .terminal_current_service_count .saturating_add(input.warming_service_count) == input.expected_service_count { - ( - "warming", - format!( - "Epiphany is advancing authenticated durable work: {} terminal current, {} warming, {} expected.", - input.terminal_current_service_count, - input.warming_service_count, - input.expected_service_count - ), - ) + ("warming", "managed-services-warming") } else { - ( - "degraded", - format!( - "Epiphany is reconciling managed services: {} terminal current, {} warming, {} expected.", - input.terminal_current_service_count, - input.warming_service_count, - input.expected_service_count - ), - ) + ("degraded", "managed-services-reconciling") }; - Ok(IdunnDaemonHealthDocument { daemon_id: input.daemon_id, - state: state.to_string(), - detail, + state: state.into(), + detail: detail.into(), observed_at: input.observed_at, health_contract: input.health_contract, - publication_source: "daemon-published".to_string(), - transport: CULTNET_RUDP_PROTOCOL_ID.to_string(), + publication_source: "daemon-published".into(), + transport: CULTNET_RUDP_PROTOCOL_ID.into(), }) } pub fn publish_idunn_daemon_health_rudp( endpoint: SocketAddr, source_runtime_id: &str, - signed: &EpiphanySignedRuntimeHealthDocument, + signed: &IdunnSignedDaemonHealthRecord, ) -> Result<()> { - validate_signed_health_shape(signed, true)?; + signed.validate()?; require_id(source_runtime_id, "health publisher runtime id")?; if source_runtime_id != signed.source_runtime_id { bail!("health transport source disagrees with signed source runtime"); } + let payload = rmp_serde::to_vec(signed).context("encoding canonical signed Idunn health")?; + let decoded: IdunnSignedDaemonHealthRecord = rmp_serde::from_slice(&payload)?; + if decoded != *signed || rmp_serde::to_vec(&decoded)? != payload { + bail!("signed Idunn health encoding is noncanonical"); + } let message = CultNetMessage::DocumentPutRaw { message_id: format!( - "epiphany-health:{}:{}", - signed.health.daemon_id, - signed.health.observed_at.replace(':', "-") + "epiphany-signed-health:{}:{}:{}", + signed.daemon_id, signed.publisher_incarnation_id, signed.publisher_sequence ), document: CultNetRawDocumentRecord { - schema_id: EPIPHANY_SIGNED_RUNTIME_HEALTH_TYPE.to_string(), - record_key: signed.health.daemon_id.clone(), - stored_at: signed.health.observed_at.clone(), + schema_id: IdunnSignedDaemonHealthRecord::TYPE.into(), + record_key: signed.daemon_id.clone(), + stored_at: chrono::DateTime::from_timestamp_millis( + signed.observed_at_unix_millis.try_into()?, + ) + .context("signed health observation time is invalid")? + .to_rfc3339(), payload_encoding: CultNetRawPayloadEncoding::Messagepack, - payload: rmp_serde::to_vec_named(signed) - .context("encoding signed Epiphany Idunn daemon health")?, - source_runtime_id: Some(source_runtime_id.to_string()), - source_agent_id: None, - source_role: Some("daemon-health-publisher".to_string()), - tags: Some(vec![CULTNET_RUDP_PROTOCOL_ID.to_string()]), + payload, + source_runtime_id: Some(source_runtime_id.into()), + source_agent_id: Some(signed.signer_identity_id.clone()), + source_role: Some("signed-daemon-health-publisher".into()), + tags: Some(vec![CULTNET_RUDP_PROTOCOL_ID.into()]), }, }; let bind = if endpoint.is_ipv4() { @@ -238,80 +190,29 @@ pub fn publish_idunn_daemon_health_rudp( )); } } - let payload = encode_cultnet_message_to_vec(&message, CultNetWireContract::CultNetSchemaV0) - .context("encoding Idunn health CultNet message")?; - transport - .send("schema", payload) - .with_context(|| format!("sending Epiphany Idunn health to {endpoint}")) + transport.send( + "schema", + encode_cultnet_message_to_vec(&message, CultNetWireContract::CultNetSchemaV0)?, + )?; + Ok(()) } -fn signed_health_statement(document: &EpiphanySignedRuntimeHealthDocument) -> Result> { - let mut unsigned = document.clone(); +fn canonical_unsigned_record(record: &IdunnSignedDaemonHealthRecord) -> Result> { + let mut unsigned = record.clone(); unsigned.signature.clear(); - validate_signed_health_shape(&unsigned, false)?; - rmp_serde::to_vec_named(&unsigned).context("encoding signed runtime health statement") + validate_unsigned_record(&unsigned)?; + rmp_serde::to_vec(&unsigned).context("encoding canonical unsigned Idunn health") } -fn validate_signed_health_shape( - document: &EpiphanySignedRuntimeHealthDocument, - signed: bool, -) -> Result<()> { - if document.schema_version != EPIPHANY_SIGNED_RUNTIME_HEALTH_SCHEMA_VERSION { - bail!("signed Epiphany runtime health schema is invalid"); +fn validate_unsigned_record(record: &IdunnSignedDaemonHealthRecord) -> Result<()> { + if !record.signature.is_empty() { + bail!("unsigned signing record already contains a signature"); } - validate_health_document(&document.health)?; - for (label, value) in [ - ("source runtime id", document.source_runtime_id.as_str()), - ("release id", document.release_id.as_str()), - ("source commit", document.source_commit.as_str()), - ( - "deployment request id", - document.deployment_request_id.as_str(), - ), - ( - "publisher incarnation id", - document.publisher_incarnation_id.as_str(), - ), - ( - "publisher process creation time", - document.publisher_process_created_at.as_str(), - ), - ( - "publisher executable path", - document.publisher_executable_path.as_str(), - ), - ("signer identity id", document.signer_identity_id.as_str()), - ] { - require_id(value, label)?; - } - uuid::Uuid::parse_str(&document.publisher_incarnation_id) + let mut signed_shape = record.clone(); + signed_shape.signature = vec![0; 64]; + signed_shape.validate()?; + uuid::Uuid::parse_str(&record.publisher_incarnation_id) .context("publisher incarnation id must be UUID")?; - if document.publisher_sequence == 0 - || document.publisher_process_id == 0 - || document.publisher_process_creation_token == 0 - { - bail!("signed Epiphany runtime health publisher identity is invalid"); - } - chrono::DateTime::parse_from_rfc3339(&document.publisher_process_created_at)?; - let witness = document - .release_witness_sha256 - .strip_prefix("sha256-") - .unwrap_or(&document.release_witness_sha256); - if witness.len() != 64 - || !witness - .bytes() - .all(|byte| byte.is_ascii_hexdigit() && !byte.is_ascii_uppercase()) - || document.source_commit.len() != 40 - || !document - .source_commit - .bytes() - .all(|byte| byte.is_ascii_hexdigit() && !byte.is_ascii_uppercase()) - || document.signature_algorithm != "ed25519" - || (signed && document.signature.len() != 64) - || (!signed && !document.signature.is_empty()) - { - bail!("signed Epiphany runtime health cryptographic shape is invalid"); - } Ok(()) } @@ -325,17 +226,28 @@ fn validate_health_document(health: &IdunnDaemonHealthDocument) -> Result<()> { ) { bail!("unsupported Idunn daemon health state"); } + if !matches!( + health.detail.as_str(), + "runtime-contradiction" + | "release-authentication-failed" + | "managed-services-current" + | "managed-services-warming" + | "managed-services-reconciling" + ) { + bail!("Idunn daemon health detail is not a bounded generic reason"); + } if health.publication_source != "daemon-published" || health.transport != CULTNET_RUDP_PROTOCOL_ID { bail!("Idunn daemon health publication authority is invalid"); } + chrono::DateTime::parse_from_rfc3339(&health.observed_at)?; Ok(()) } fn require_id(value: &str, label: &str) -> Result<()> { - if value.trim().is_empty() { - bail!("{label} is required"); + if value.trim().is_empty() || value.len() > 256 || value.chars().any(char::is_control) { + bail!("{label} is empty, oversized, or contains control characters"); } Ok(()) } @@ -343,30 +255,16 @@ fn require_id(value: &str, label: &str) -> Result<()> { #[cfg(test)] mod tests { use super::*; - use cultnet_rs::decode_cultnet_message_from_slice; + use cultnet_rs::{ + ServiceIdentityProfile, ServiceIdentitySignature, ServiceSignaturePurpose, + decode_cultnet_message_from_slice, enroll_service_identity_at, + verify_service_identity_signature, + }; use std::thread; - fn signed_health(health: IdunnDaemonHealthDocument) -> EpiphanySignedRuntimeHealthDocument { - let root = tempfile::tempdir().unwrap(); - let signer = crate::enroll_host_identity_at(&root.path().join("host.ccmp")).unwrap(); - sign_epiphany_runtime_health( - health, - "epiphany-daemon-supervisor", - "release-test", - &format!("sha256-{}", "a".repeat(64)), - &"b".repeat(40), - "deploy-request-test", - "00000000-0000-4000-8000-000000000001", - 1, - &crate::ProcessInstanceIdentity { - process_id: 42, - creation_token: 7, - created_at_rfc3339: Some("2026-07-16T00:00:00Z".into()), - executable_path: std::path::PathBuf::from("/srv/epiphany/supervisor"), - }, - &signer, - ) - .unwrap() + struct WrongPurpose; + impl ServiceSignaturePurpose for WrongPurpose { + const PURPOSE: &'static [u8] = b"wrong-purpose"; } fn input(current: usize) -> EpiphanyAggregateRuntimeHealthInput { @@ -382,69 +280,186 @@ mod tests { } } + fn signed_health() -> ( + tempfile::TempDir, + ServiceIdentitySigner, + IdunnSignedDaemonHealthRecord, + ) { + let root = tempfile::tempdir().unwrap(); + let signer = enroll_service_identity_at::( + &root.path().join("provider.cc"), + ) + .unwrap(); + let record = sign_epiphany_runtime_health( + derive_epiphany_aggregate_runtime_health(input(2)).unwrap(), + "epiphany-yggdrasil", + "release-test", + &format!("sha256-{}", "a".repeat(64)), + &"b".repeat(40), + "deploy-request-test", + "00000000-0000-4000-8000-000000000001", + 1, + &signer, + ) + .unwrap(); + (root, signer, record) + } + #[test] - fn aggregate_health_requires_every_current_lineage() { + fn aggregate_health_uses_closed_nonprivate_reasons() { assert_eq!( derive_epiphany_aggregate_runtime_health(input(2)) .unwrap() - .state, - "active" + .detail, + "managed-services-current" ); + let mut warming = input(1); + warming.warming_service_count = 1; assert_eq!( - derive_epiphany_aggregate_runtime_health(input(1)) + derive_epiphany_aggregate_runtime_health(warming) .unwrap() - .state, - "degraded" + .detail, + "managed-services-warming" ); - } - - #[test] - fn aggregate_health_names_authenticated_nonterminal_work_as_warming() { - let mut value = input(1); - value.warming_service_count = 1; - let health = derive_epiphany_aggregate_runtime_health(value).unwrap(); - assert_eq!(health.state, "warming"); - assert!(health.detail.contains("1 terminal current, 1 warming")); - } - - #[test] - fn warming_cannot_hide_a_missing_required_service() { - let mut value = input(0); - value.warming_service_count = 1; - assert_eq!( - derive_epiphany_aggregate_runtime_health(value) - .unwrap() - .state, - "degraded" - ); - } - - #[test] - fn aggregate_health_fails_authenticated_contradictions() { - let mut value = input(2); - value + let mut failed = input(2); + failed .contradictions - .push("semantic child uses stale policy".into()); - let health = derive_epiphany_aggregate_runtime_health(value).unwrap(); - assert_eq!(health.state, "failed"); - assert!(health.detail.contains("stale policy")); + .push("secret path and process detail".into()); + assert_eq!( + derive_epiphany_aggregate_runtime_health(failed) + .unwrap() + .detail, + "runtime-contradiction" + ); } #[test] - fn semantic_sight_cannot_substitute_for_runtime_lineage() { - let health = derive_epiphany_aggregate_runtime_health(input(0)).unwrap(); - assert_ne!(health.state, "active"); + fn canonical_record_binds_exact_release_and_process_continuity() { + let (_root, signer, record) = signed_health(); + assert_eq!(record.source_runtime_id, "epiphany-yggdrasil"); + assert_eq!(record.release_id.as_deref(), Some("release-test")); + assert_eq!(record.deployment_id.as_deref(), Some("deploy-request-test")); + assert_eq!(record.publisher_sequence, 1); + assert!(!record.private_state_exposed); + let statement = canonical_unsigned_record(&record).unwrap(); + let proof = ServiceIdentitySignature { + identity_id: record.signer_identity_id.clone(), + signature: record.signature.clone(), + }; + verify_service_identity_signature::< + GameCultProviderHealthIdentity, + IdunnSignedDaemonHealthPurpose, + >(&signer.trust_anchor().unwrap(), &statement, &proof) + .unwrap(); + assert_eq!(&statement[..3], &[0xdc, 0, 17]); } #[test] - fn health_document_rejects_alien_publication_authority() { - let mut health = derive_epiphany_aggregate_runtime_health(input(2)).unwrap(); - health.publication_source = "probe".into(); - assert!(validate_health_document(&health).is_err()); + fn wrong_purpose_key_mutation_and_noncanonical_encoding_fail() { + let (_root, signer, record) = signed_health(); + let statement = canonical_unsigned_record(&record).unwrap(); + let wrong = signer.sign::(&statement); + assert!( + verify_service_identity_signature::< + GameCultProviderHealthIdentity, + IdunnSignedDaemonHealthPurpose, + >(&signer.trust_anchor().unwrap(), &statement, &wrong) + .is_err() + ); + let other_root = tempfile::tempdir().unwrap(); + let other = enroll_service_identity_at::( + &other_root.path().join("other.cc"), + ) + .unwrap(); + let proof = ServiceIdentitySignature { + identity_id: record.signer_identity_id.clone(), + signature: record.signature.clone(), + }; + assert!( + verify_service_identity_signature::< + GameCultProviderHealthIdentity, + IdunnSignedDaemonHealthPurpose, + >(&other.trust_anchor().unwrap(), &statement, &proof) + .is_err() + ); + let mut mutated = record.clone(); + mutated.state = "failed".into(); + assert!( + verify_service_identity_signature::< + GameCultProviderHealthIdentity, + IdunnSignedDaemonHealthPurpose, + >( + &signer.trust_anchor().unwrap(), + &canonical_unsigned_record(&mutated).unwrap(), + &proof + ) + .is_err() + ); + let named = rmp_serde::to_vec(&serde_json::json!({ + "schema_version": record.schema_version, + "daemon_id": record.daemon_id, + "health_contract": record.health_contract, + "source_runtime_id": record.source_runtime_id, + "state": record.state, + "detail": record.detail, + "signer_identity_id": record.signer_identity_id, + "publisher_incarnation_id": record.publisher_incarnation_id, + "publisher_sequence": record.publisher_sequence, + "observed_at_unix_millis": record.observed_at_unix_millis, + "release_id": record.release_id, + "release_witness_sha256": record.release_witness_sha256, + "source_commit": record.source_commit, + "deployment_id": record.deployment_id, + "signature_algorithm": record.signature_algorithm, + "signature": [], + "private_state_exposed": record.private_state_exposed, + })) + .unwrap(); + assert!( + verify_service_identity_signature::< + GameCultProviderHealthIdentity, + IdunnSignedDaemonHealthPurpose, + >(&signer.trust_anchor().unwrap(), &named, &proof) + .is_err() + ); } #[test] - fn rudp_publisher_emits_exact_messagepack_health_document() { + fn sequence_and_incarnation_are_strict() { + let (_root, signer, record) = signed_health(); + let health = derive_epiphany_aggregate_runtime_health(input(2)).unwrap(); + assert!( + sign_epiphany_runtime_health( + health.clone(), + "epiphany-yggdrasil", + "r", + &format!("sha256-{}", "a".repeat(64)), + &"b".repeat(40), + "d", + "bad", + 2, + &signer + ) + .is_err() + ); + assert!( + sign_epiphany_runtime_health( + health, + "epiphany-yggdrasil", + "r", + &format!("sha256-{}", "a".repeat(64)), + &"b".repeat(40), + "d", + &record.publisher_incarnation_id, + 0, + &signer + ) + .is_err() + ); + } + + #[test] + fn rudp_publisher_emits_exact_canonical_tuple() { let socket = UdpSocket::bind("127.0.0.1:0").unwrap(); socket .set_read_timeout(Some(Duration::from_millis(100))) @@ -469,40 +484,34 @@ mod tests { .unwrap(); } transport.poll_resends().unwrap(); - assert!(Instant::now() < deadline, "health frame timed out"); + assert!(Instant::now() < deadline); } }); - let health = derive_epiphany_aggregate_runtime_health(input(2)).unwrap(); - let signed = signed_health(health.clone()); - publish_idunn_daemon_health_rudp(endpoint, "epiphany-daemon-supervisor", &signed).unwrap(); + let (_root, _signer, record) = signed_health(); + publish_idunn_daemon_health_rudp(endpoint, "epiphany-yggdrasil", &record).unwrap(); let CultNetMessage::DocumentPutRaw { document, .. } = server.join().unwrap() else { - panic!("publisher emitted a non-document message") + panic!("wrong message") }; - assert_eq!(document.schema_id, EPIPHANY_SIGNED_RUNTIME_HEALTH_TYPE); - assert_eq!(document.record_key, health.daemon_id); + assert_eq!(document.schema_id, IdunnSignedDaemonHealthRecord::TYPE); assert_eq!( - document.payload_encoding, - CultNetRawPayloadEncoding::Messagepack + document.source_role.as_deref(), + Some("signed-daemon-health-publisher") ); - let decoded: EpiphanySignedRuntimeHealthDocument = + let decoded: IdunnSignedDaemonHealthRecord = rmp_serde::from_slice(&document.payload).unwrap(); - assert_eq!(decoded, signed); + assert_eq!(decoded, record); + assert_eq!(rmp_serde::to_vec(&decoded).unwrap(), document.payload); } #[test] - fn rudp_publisher_fails_closed_when_idunn_does_not_accept() { - let reserved = UdpSocket::bind("127.0.0.1:0").unwrap(); - let endpoint = reserved.local_addr().unwrap(); - drop(reserved); - let health = signed_health(derive_epiphany_aggregate_runtime_health(input(2)).unwrap()); - assert!( - publish_idunn_daemon_health_rudp(endpoint, "epiphany-daemon-supervisor", &health,) - .is_err() + fn identity_profile_is_not_host_identity() { + assert_eq!( + GameCultProviderHealthIdentity::TRUST_ANCHOR_SCHEMA, + "gamecult.provider_health_identity.trust_anchor.v1" + ); + assert_ne!( + GameCultProviderHealthIdentity::ID_DOMAIN, + b"epiphany.host-incarnation.identity.v0\0" ); - } - - #[test] - fn rudp_publisher_uses_the_idunn_daemon_health_connection_contract() { - assert_eq!(IDUNN_HEALTH_RUDP_CONNECTION_ID, 0x1d0d_0001); } } diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 0d319989..536d99a2 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -686,9 +686,7 @@ pub use idunn_provider_health::{ }; pub use idunn_runtime_health::{ CULTNET_RUDP_PROTOCOL_ID, EPIPHANY_IDUNN_RUNTIME_HEALTH_CONTRACT, - EPIPHANY_SIGNED_RUNTIME_HEALTH_SCHEMA_VERSION, EPIPHANY_SIGNED_RUNTIME_HEALTH_TYPE, - EpiphanyAggregateRuntimeHealthInput, EpiphanySignedRuntimeHealthDocument, - IDUNN_DAEMON_HEALTH_SCHEMA_VERSION, IDUNN_DAEMON_HEALTH_TYPE, IdunnDaemonHealthDocument, + EpiphanyAggregateRuntimeHealthInput, IdunnDaemonHealthDocument, derive_epiphany_aggregate_runtime_health, publish_idunn_daemon_health_rudp, sign_epiphany_runtime_health, }; diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 2ca7d258..1a74977d 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1,5 +1,30 @@ # Fresh Workspace Handoff +## Epiphany canonical signed-health publisher landed (2026-07-19) + +The Epiphany supervisor now publishes the generic canonical +`idunn.signed_daemon_health.v1` 17-field positional CultCache record using a +dedicated `GameCultProviderHealthIdentity`, exact `runtime_id`, release witness, +source commit, deployment request, one UUID per supervisor process, and checked +monotonic sequence. It no longer signs provider health with host identity or +publishes the Epiphany-only v0 contract. Detail is a bounded generic reason and +never carries process, path, contradiction, or workspace evidence. + +The existing `epiphany-daemon-supervisor` binary owns explicit immutable +`provider-health-identity-enroll` and public-only +`provider-health-identity-export` commands, so no package role was added. The +serve path opens the private typed store only; it never creates identity during +runtime. CultNet owner commit `a1001dc` now owns the shared signed record schema, +17 keyed fields, and validation beside the provider identity and signing +purpose. Focused publisher tests pass 6/6, supervisor tests 25/25, full core +library 603/0/1, and a live isolated enroll/export smoke produced distinct +private and public CultCache files without exposing private state. + +Next: advance Odin to the CultNet owner commit and remove/re-export its duplicate +Rust signed-health record, then install root trust bindings and finish the Idunn +public projection/query path. Status remains untouched until that chain is +complete. + ## Organizational Yggdrasil deployment is live and braked (2026-07-19) Epiphany's ordinary organizational product path is now deployed on Yggdrasil, @@ -80,7 +105,7 @@ set atomically with per-pair projection/provider replay rules. Root key rotation is possible only through a newer pinned anchor whose binding follows prior admission/evaluation and whose new projection follows the binding; packet keys cannot rotate trust. Missing or invalid input never deletes prior admission. -CultNet owner commit `014f998b97c37a34055ce0af069ebaead32d11fb` +CultNet owner commit `a1001dc` supplies the shared contracts, identity verifier, pure query, and mature RUDP transport. Focused tests pass 5/5, full core library 606/0/1, and the sole integration target 1/1. Next migrate the two publishers and root bindings, diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 7641a4f9..fd0c5365 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index b5c8da9f..adabd08b 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -19,7 +19,8 @@ experiment: swarm_brake_authority: "The only physical brake truth is the runtime-scoped CultMesh key epiphany-local/swarm-brake. Observation uses swarm-brake-status and is byte-pure; mutation uses swarm-brake-set and requires explicit engaged/released status, canonical document id epiphany/swarm-brake, actor, and reason. Legacy swarm-brake/brake commands refuse. The stable owner is epiphany.swarm-brake; command actors are provenance, not owners. Release refuses absent or foreign/legacy identity. Idunn alone may adopt an already-engaged legacy head into the canonical identity during deployment, without any released interval. Discord Sleep preserves foreign brakes; Wake releases only the exact canonical owner. Resident readiness reads the same key, and deployment admission requires brakeEngaged=true before service restart." discord_mind_review_owner: "The typed Discord operator core routes Reviews/Review into the canonical frontier-plan Mind owner, not a parallel queue. Reviews exposes only bounded request/candidate/model/frontier identities. Exact Adopt/Refuse/Hold revalidates immutable Imagination and current RepoModel bindings; Hold/Refuse are terminal inert receipts; Adopt alone uses the existing RepoModel CAS and creates no Hands authority, Substrate grant, Persona speech, Bifrost release, or Idunn deployment. Decision provenance is typed as Mind worker or authenticated operator command/admission/packet/actor; downstream RepoModel provenance is typed as worker result or frontier-plan decision, with Option absence instead of empty sentinels. Replay time derives from immutable issuance, machine faults are not terminal refusals, CultCache v0 decision tuples decode explicitly, and signed v0 deliveries may drain only the original four commands. The v1 Epiphany/Bifrost/VoidBot chain is deployed on Yggdrasil behind an engaged canonical brake; the remaining proof is operator-safe Discord interaction, not schema or deployment work." discord_status_truth: "The deployed Status command reads a narrow coordinator snapshot and the independently owned swarm brake. It namespaces the coordinator fields as coordinator-snapshot/, coordinator-state/, and coordinator-action/; VoidBot labels them Coordinator snapshot and Coordinator action. It explicitly refuses to call them deployment/provider readiness and does not authenticate or compose packaged-release, resident-readiness, Idunn, or Bifrost health. Audit found no usable Idunn/Bifrost ingress: generic idunn.daemon_health.v1 is typed but unsigned, trusts self-declared publication source/transport, and has no authenticated Idunn outward projection. Odin branch codex/ygg-organizational-idunn commit be8836f now verifies generic signed health against an exact root trust binding, atomically admits statement+judgment+health under monotonic CAS, rejoins current trust on managed reads, and quarantines unsigned packets under a diagnostic-only type/key that cannot reset continuity or suppress recovery. The outward contract is deliberately narrower than Idunn's complete managed judgment: `idunn.authenticated_provider_health_projection.v1` asserts only a current authenticated provider statement joined to its admission, root binding, and optional deployment lineage. Missing publication, release drift, and dependency failure are absence of that assertion; they may not be conceptually substituted into provider health. Idunn signs the bounded assertion with a separately stored typed service identity and writes only a dedicated public CultCache store. A generic CultNet snapshot server carries exact bytes from that public store. Epiphany pins the Idunn public trust anchor and locally verifies signature, freshness, replay monotonicity, requested daemon/contract, and release/deployment lineage before lowering bounded status to Discord. Odin transports bytes but never recreates health truth. Private Idunn state, provider detail, unsigned diagnostics, PID sight, generic ready strings, caller booleans, and provider signatures cannot substitute. The source is intentionally not deployable until Epiphany and Bifrost publishers, root bindings, Idunn projection, public query, and consumer verification migrate together." - idunn_provider_health_consumer: "Epiphany now owns a pure read/admission organ for Idunn's public `idunn.authenticated_provider_health_projection.v1` records. It builds an exact CultNet raw-snapshot query for the required daemon/contract pairs, rejects duplicates, extras, and missing records, requires canonical MessagePack and exact transport/runtime/schema/key identity, validates the closed provider state/reason contract, verifies the Idunn signature with the root-pinned typed service trust anchor and fixed purpose, enforces anchor and local TTL lifetimes plus Forbidden-or-Exact release lineage, and atomically CAS-admits the complete required set into a dedicated CultCache store. Durable admissions preserve projection/provider sequence and incarnation, exact signed digests, Idunn signer/runtime, anchor digest/bound time, and release lineage. Same-anchor replay is refused; a root anchor rotation resets continuity only when its bound time strictly follows the prior admitted/evaluated sight and the new signed projection follows that binding. An old anchor or packet-supplied self key cannot rotate trust. Invalid, absent, stale, substituted, or replayed input performs no write and cannot erase the last admission. CultNet owner commit `014f998b97c37a34055ce0af069ebaead32d11fb` now owns the shared identity/contracts/query/RUDP organs consumed here. This module grants no Status, Mind, Hands, Bifrost, Idunn, Wake, release, or deployment authority. Focused hostile proof passes 5/5; the full Epiphany core library passes 606/0/1 and its sole integration target passes 1/1." + idunn_provider_health_consumer: "Epiphany now owns a pure read/admission organ for Idunn's public `idunn.authenticated_provider_health_projection.v1` records. It builds an exact CultNet raw-snapshot query for the required daemon/contract pairs, rejects duplicates, extras, and missing records, requires canonical MessagePack and exact transport/runtime/schema/key identity, validates the closed provider state/reason contract, verifies the Idunn signature with the root-pinned typed service trust anchor and fixed purpose, enforces anchor and local TTL lifetimes plus Forbidden-or-Exact release lineage, and atomically CAS-admits the complete required set into a dedicated CultCache store. Durable admissions preserve projection/provider sequence and incarnation, exact signed digests, Idunn signer/runtime, anchor digest/bound time, and release lineage. Same-anchor replay is refused; a root anchor rotation resets continuity only when its bound time strictly follows the prior admitted/evaluated sight and the new signed projection follows that binding. An old anchor or packet-supplied self key cannot rotate trust. Invalid, absent, stale, substituted, or replayed input performs no write and cannot erase the last admission. CultNet owner commit `a1001dc` now also owns the canonical `idunn.signed_daemon_health.v1` record beside the shared identity/contracts/query/RUDP organs consumed here. This module grants no Status, Mind, Hands, Bifrost, Idunn, Wake, release, or deployment authority." + epiphany_signed_provider_health_publisher: "The daemon supervisor now publishes only the canonical generic 17-field positional `idunn.signed_daemon_health.v1` record, signed over the empty-signature tuple with CultNet's dedicated `GameCultProviderHealthIdentity` and `IdunnSignedDaemonHealthPurpose`. The record binds exact supervisor runtime id, release id/witness, source commit, deployment request, one process UUID incarnation, and checked monotonic sequence; detail is a bounded generic reason and private state is false. Runtime opens an immutable typed provider identity store and never enrolls implicitly. Explicit enroll/export commands live in the existing supervisor binary and export a distinct public-only anchor, so package witness roles do not change. Host identity and the Epiphany-only v0 health contract are no longer publisher authorities. Focused publisher tests pass 6/6, supervisor tests 25/25, full library 603/0/1, and isolated live enroll/export smoke passed." status: active phase: phase_6_reflection_boundary premise: > @@ -813,4 +814,4 @@ current_status: - Candidate `b8517d9d7905eb62314db675cc2f0688510aa5bd` proved stale launch terminalization and current-policy replacement launch: supervisor PID `1147968` launched replacement workspace projector PID `1148157`, whose authenticated ready heartbeat advanced while the engaged brake held. Recovery still stalled because the old Body claim could be read only through current-claim authentication, which correctly rejected its historical policy before the mismatch recovery branch. The candidate was rolled back and revoked; no deployment witness exists. Claim sight now has two explicit authorities: current authentication is required for provider projection work and rejects stale launches; recovery authentication proves the old signed claim/body/route lineage only. Supervisor recovery and directive writing use the recovery reader, while old launch authentication inside the atomic lease-transfer transaction is historical and the replacement launch/heartbeat remain current-policy evidence. The full causal test performs an actual policy rotation and proves current refusal, historical recovery, directive fencing, lease transfer, successor current sight, and replay/tamper boundaries. Full core passes 573/573 with one ignored; all binaries compile. - Candidate `351355d3baee2d475f84168136380d2f50197ef8` authenticated the historical claim and started all three owners under the brake, but recovery refused because the claim named an older launch than the current replacement's direct parent. Repeated failed candidate deployments had formed a valid signed replacement chain, while recovery still assumed one direct old-to-new edge. The exact Idunn process group was terminated, all services stopped, active pointer and witness removed, and Bifrost authority revoked. No deployment witness exists. Recovery now authenticates the complete immutable chain from the claim's historical launch to the live current-policy descendant: every intermediate launch is host-signed, every parent termination id and envelope digest is exact, chronology is ordered, cycles and broken edges refuse, and the selected endpoint must be current. Directive writing, receipt verification, atomic lease transfer, and supervisor resume share this proof. Typed refusal now exposes the exact lineage fault instead of swallowing it. The causal recovery test contains a real intermediate generation and still proves the full fenced transaction. Full library passes 573/573 with one ignored; supervisor authority tests pass 24/24. - Candidate `a70fe275195740ecefc2984b32ebd8ae93658c18` proved the full signed multi-generation chain and emitted recovery directive `06165fb6-97bd-4c27-97e3-38af03dec72d` from historical claim `c6df4335-7080-4d5f-80fc-4fa18a9d16ce` to current launch `9414c32f-f53c-450c-bc19-a69f5ba04a29`. The replacement projector nevertheless kept refusing stale-policy claim sight because its pulse authenticated the not-yet-created current successor claim before looking for the recovery directive. Supervisor replayed the same directive without mutating Body, exposing a circular ordering fault. The exact Idunn process group was terminated, services stopped, pointer and witness removed, and Bifrost authority revoked; no deployment witness exists. Projector recovery directive consumption now precedes all ordinary projection work and invokes the already idempotent atomic transfer directly. Current claim sight is an output of recovery, never a prerequisite for it. Full library now passes 574/574 with one ignored; supervisor authority tests pass 24/24. - next_action: "Complete the remaining authenticated outward provider-health path before claiming provider health in Discord Status: migrate Epiphany and Bifrost to dedicated signed-health publisher identities, install root-owned Idunn trust bindings, finish Idunn's dedicated public CultCache snapshot serving, and wire Status through Epiphany's now-landed read-only verifier/admission organ. Missing provider assertion must remain explicit absence, not synthesized managed health. Then deploy through Bifrost/Idunn under the engaged brake and run the operator-safe Discord Status plus ordinary Persona-feedback proof. Do not test Wake or reboot the host." + next_action: "Advance Odin to CultNet `a1001dc` and remove/re-export its duplicate Rust `IdunnSignedDaemonHealthRecord`, then complete root-owned Idunn trust bindings and Idunn's dedicated public CultCache snapshot serving. Epiphany and Bifrost canonical dedicated-identity publishers are landed. Wire Status only after the authenticated projection chain is complete; missing provider assertion remains explicit absence. Deploy through Bifrost/Idunn under the engaged brake. Do not test Wake or reboot the host." diff --git a/vendor/cultnet-rs b/vendor/cultnet-rs index 014f998b..a1001dc8 160000 --- a/vendor/cultnet-rs +++ b/vendor/cultnet-rs @@ -1 +1 @@ -Subproject commit 014f998b97c37a34055ce0af069ebaead32d11fb +Subproject commit a1001dc855aa4de04859d01d8be4c966f510f557