From ad2292ee320afd4f75cdad805d2ec6d9f40326f8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 23 Aug 2026 18:53:48 +0200 Subject: [PATCH] Delete unearned Persona identity executables --- Cargo.toml | 8 ---- ...piphany-persona-discord-permit-identity.rs | 24 ---------- .../bin/epiphany-persona-mouth-identity.rs | 41 ---------------- epiphany-core/src/persona_discord_crossing.rs | 48 ------------------- epiphany-core/src/persona_discord_permit.rs | 48 ------------------- epiphany-release-construction/src/lib.rs | 8 ---- 6 files changed, 177 deletions(-) delete mode 100644 epiphany-core/src/bin/epiphany-persona-discord-permit-identity.rs delete mode 100644 epiphany-core/src/bin/epiphany-persona-mouth-identity.rs diff --git a/Cargo.toml b/Cargo.toml index bee978d9..9f48cba9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,18 +118,10 @@ name = "epiphany-persona-service" path = "epiphany-openai-runtime/src/bin/epiphany-persona-service.rs" required-features = ["openai-runtime"] -[[bin]] -name = "epiphany-persona-mouth-identity" -path = "epiphany-core/src/bin/epiphany-persona-mouth-identity.rs" - [[bin]] name = "epiphany-persona-discord-permit" path = "epiphany-core/src/bin/epiphany-persona-discord-permit.rs" -[[bin]] -name = "epiphany-persona-discord-permit-identity" -path = "epiphany-core/src/bin/epiphany-persona-discord-permit-identity.rs" - [[bin]] name = "epiphany-mvp-coordinator" path = "epiphany-core/src/bin/epiphany-mvp-coordinator.rs" diff --git a/epiphany-core/src/bin/epiphany-persona-discord-permit-identity.rs b/epiphany-core/src/bin/epiphany-persona-discord-permit-identity.rs deleted file mode 100644 index 87dc251c..00000000 --- a/epiphany-core/src/bin/epiphany-persona-discord-permit-identity.rs +++ /dev/null @@ -1,24 +0,0 @@ -use anyhow::{Result, anyhow}; -use std::{env, path::PathBuf}; -fn main() -> Result<()> { - let mut identity = None; - let mut anchor = None; - let mut runtime = "epiphany-yggdrasil".to_string(); - let mut args = env::args().skip(1); - while let Some(key) = args.next() { - let value = args - .next() - .ok_or_else(|| anyhow!("{key} requires a value"))?; - match key.as_str() { - "--permit-identity-store" => identity = Some(PathBuf::from(value)), - "--permit-anchor" => anchor = Some(PathBuf::from(value)), - "--runtime-id" => runtime = value, - _ => return Err(anyhow!("unknown argument {key}")), - } - } - epiphany_core::ensure_epiphany_permit_identity( - &identity.ok_or_else(|| anyhow!("--permit-identity-store is required"))?, - &anchor.ok_or_else(|| anyhow!("--permit-anchor is required"))?, - &runtime, - ) -} diff --git a/epiphany-core/src/bin/epiphany-persona-mouth-identity.rs b/epiphany-core/src/bin/epiphany-persona-mouth-identity.rs deleted file mode 100644 index 74cbe63e..00000000 --- a/epiphany-core/src/bin/epiphany-persona-mouth-identity.rs +++ /dev/null @@ -1,41 +0,0 @@ -use std::{env, path::PathBuf}; - -use anyhow::{Result, anyhow}; -use epiphany_core::{ - enroll_persona_discord_request_identity, export_persona_discord_request_anchor_candidate, -}; - -fn main() -> Result<()> { - let mut mouth_identity_store = None; - let mut mouth_request_anchor = None; - let mut runtime_id = None; - let mut args = env::args().skip(1); - while let Some(arg) = args.next() { - let value = args - .next() - .ok_or_else(|| anyhow!("{arg} requires a value"))?; - match arg.as_str() { - "--mouth-identity-store" => mouth_identity_store = Some(PathBuf::from(value)), - "--mouth-request-anchor" => mouth_request_anchor = Some(PathBuf::from(value)), - "--runtime-id" => runtime_id = Some(value), - _ => return Err(anyhow!("unknown argument {arg}")), - } - } - let identity = - mouth_identity_store.ok_or_else(|| anyhow!("--mouth-identity-store is required"))?; - let anchor = - mouth_request_anchor.ok_or_else(|| anyhow!("--mouth-request-anchor is required"))?; - let runtime = runtime_id.ok_or_else(|| anyhow!("--runtime-id is required"))?; - enroll_persona_discord_request_identity(&identity)?; - export_persona_discord_request_anchor_candidate(&identity, &anchor, &runtime)?; - println!( - "{}", - serde_json::json!({ - "schemaVersion": "epiphany.persona_mouth_identity_enrollment.v0", - "status": "ready", - "runtimeId": runtime, - "privateStateExposed": false - }) - ); - Ok(()) -} diff --git a/epiphany-core/src/persona_discord_crossing.rs b/epiphany-core/src/persona_discord_crossing.rs index cb4773b2..b534e1fb 100644 --- a/epiphany-core/src/persona_discord_crossing.rs +++ b/epiphany-core/src/persona_discord_crossing.rs @@ -193,54 +193,6 @@ pub fn open_persona_discord_request_identity( cultnet_rs::open_service_identity_at::(path) } -pub fn enroll_persona_discord_request_identity(path: &Path) -> Result<()> { - if path.exists() { - open_persona_discord_request_identity(path)?; - return Ok(()); - } - cultnet_rs::enroll_service_identity_at::(path)?; - Ok(()) -} - -pub fn export_persona_discord_request_anchor_candidate( - identity_store: &Path, - output: &Path, - runtime_id: &str, -) -> Result<()> { - let signer = open_persona_discord_request_identity(identity_store)?; - if output.exists() { - let existing = load_persona_discord_service_anchor(output)?; - validate_persona_discord_request_anchor(&existing, runtime_id)?; - if existing.signer_identity_id != signer.entry().identity_id - || existing.signer_public_key != signer.entry().public_key - { - bail!("existing request anchor candidate belongs to a different identity"); - } - return Ok(()); - } - let record = GameCultServiceTrustAnchorRecord { - schema_version: GAMECULT_SERVICE_TRUST_ANCHOR_SCHEMA.into(), - trust_anchor_id: format!("epiphany-persona-mouth:{runtime_id}:delivery-request:v0"), - service_id: EPIPHANY_PERSONA_MOUTH_SERVICE_ID.into(), - runtime_id: runtime_id.into(), - signer_identity_id: signer.entry().identity_id.clone(), - signer_public_key: signer.entry().public_key.clone(), - signature_algorithm: "ed25519".into(), - signing_purpose: PERSONA_DISCORD_DELIVERY_REQUEST_SIGNING_PURPOSE.into(), - signed_schema: PERSONA_DISCORD_DELIVERY_REQUEST_SCHEMA_VERSION.into(), - binding_authority: "root".into(), - bound_at_unix_millis: chrono::Utc::now().timestamp_millis().max(1) as u64, - expires_at_unix_millis: None, - private_state_exposed: false, - }; - record.validate()?; - if let Some(parent) = output.parent() { - std::fs::create_dir_all(parent)?; - } - std::fs::write(output, rmp_serde::to_vec(&record)?)?; - Ok(()) -} - pub fn request_signing_payload(request: &PersonaDiscordDeliveryRequest) -> Result> { Ok(rmp_serde::to_vec(&request_signing_tuple(request))?) } diff --git a/epiphany-core/src/persona_discord_permit.rs b/epiphany-core/src/persona_discord_permit.rs index 197e0d3d..bb3b1ac7 100644 --- a/epiphany-core/src/persona_discord_permit.rs +++ b/epiphany-core/src/persona_discord_permit.rs @@ -135,54 +135,6 @@ pub struct PersonaPermitIssuerConfig { pub provider_anchor: GameCultServiceTrustAnchorRecord, } -pub fn ensure_epiphany_permit_identity( - identity_store: &Path, - anchor_output: &Path, - runtime_id: &str, -) -> Result<()> { - let signer = if identity_store.exists() { - cultnet_rs::open_service_identity_at::(identity_store)? - } else { - cultnet_rs::enroll_service_identity_at::(identity_store)? - }; - if anchor_output.exists() { - let anchor: GameCultServiceTrustAnchorRecord = - rmp_serde::from_slice(&std::fs::read(anchor_output)?)?; - anchor.validate()?; - if anchor.service_id != "epiphany-persona-discord-permit" - || anchor.runtime_id != runtime_id - || anchor.signer_identity_id != signer.entry().identity_id - || anchor.signer_public_key != signer.entry().public_key - || anchor.signing_purpose != PERMIT_PURPOSE - || anchor.signed_schema != PERMIT_SCHEMA - { - bail!("existing permit anchor candidate differs from enrolled identity/profile"); - } - return Ok(()); - } - let anchor = GameCultServiceTrustAnchorRecord { - schema_version: cultnet_rs::GAMECULT_SERVICE_TRUST_ANCHOR_SCHEMA.into(), - trust_anchor_id: format!("epiphany-persona-discord-permit:{runtime_id}:v0"), - service_id: "epiphany-persona-discord-permit".into(), - runtime_id: runtime_id.into(), - signer_identity_id: signer.entry().identity_id.clone(), - signer_public_key: signer.entry().public_key.clone(), - signature_algorithm: "ed25519".into(), - signing_purpose: PERMIT_PURPOSE.into(), - signed_schema: PERMIT_SCHEMA.into(), - binding_authority: "root".into(), - bound_at_unix_millis: chrono::Utc::now().timestamp_millis().max(1) as u64, - expires_at_unix_millis: None, - private_state_exposed: false, - }; - anchor.validate()?; - if let Some(parent) = anchor_output.parent() { - std::fs::create_dir_all(parent)?; - } - std::fs::write(anchor_output, rmp_serde::to_vec(&anchor)?)?; - Ok(()) -} - pub fn issue_persona_discord_permit( config: &PersonaPermitIssuerConfig, signer: &ServiceIdentitySigner, diff --git a/epiphany-release-construction/src/lib.rs b/epiphany-release-construction/src/lib.rs index c9f7267e..8707d179 100644 --- a/epiphany-release-construction/src/lib.rs +++ b/epiphany-release-construction/src/lib.rs @@ -101,18 +101,10 @@ pub fn required_packaged_release_binaries(target_triple: &str) -> Vec<(&'static file_name("epiphany-persona-feedback-ingress"), ), ("persona-service", file_name("epiphany-persona-service")), - ( - "persona-mouth-identity", - file_name("epiphany-persona-mouth-identity"), - ), ( "persona-discord-permit", file_name("epiphany-persona-discord-permit"), ), - ( - "persona-discord-permit-identity", - file_name("epiphany-persona-discord-permit-identity"), - ), ("coordinator", file_name("epiphany-mvp-coordinator")), ("frontier-proposal", file_name("epiphany-frontier-proposal")), ("hands-action", file_name("epiphany-hands-action")),