From b97911987f7ce4eb64e0775715312fa8f3019df7 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 16 Jul 2026 20:01:08 +0100 Subject: [PATCH] Bootstrap runtime Mind and Body identities --- .../src/bin/epiphany-repository-body.rs | 32 ++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/epiphany-core/src/bin/epiphany-repository-body.rs b/epiphany-core/src/bin/epiphany-repository-body.rs index 1fc993bc..25620624 100644 --- a/epiphany-core/src/bin/epiphany-repository-body.rs +++ b/epiphany-core/src/bin/epiphany-repository-body.rs @@ -1,4 +1,5 @@ use anyhow::{Result, bail}; +use chrono::Utc; use epiphany_core::{ ObserveOutcome, RuntimeSpineInitOptions, bind_repository_body, bind_runtime_to_agent_memory_swarm, ensure_agent_memory_swarm_identity, @@ -12,6 +13,35 @@ fn main() -> Result<()> { return usage(); }; match command { + "bootstrap" => { + let repo = PathBuf::from(required(&args, "--repo")?); + let store = PathBuf::from(required(&args, "--store")?); + let runtime_store = PathBuf::from(required(&args, "--runtime-store")?); + let agent_store = PathBuf::from(required(&args, "--agent-store")?); + let workspace_id = required(&args, "--workspace-id")?; + let runtime_id = required(&args, "--runtime-id")?; + let swarm_id = required(&args, "--swarm-id")?; + let at = Utc::now().to_rfc3339(); + initialize_runtime_spine( + &runtime_store, + RuntimeSpineInitOptions { + runtime_id: runtime_id.to_string(), + display_name: format!("Epiphany {runtime_id}"), + created_at: at.clone(), + }, + )?; + ensure_agent_memory_swarm_identity(&agent_store, swarm_id)?; + bind_runtime_to_agent_memory_swarm(&runtime_store, &agent_store, &at)?; + let binding = bind_repository_body(&repo, &store, &runtime_store, workspace_id)?; + println!( + "bootstrapped workspace={} swarm={} runtime={} scope={} root={}", + binding.workspace_id, + binding.swarm_id, + binding.runtime_id, + binding.scope, + binding.git_top_level + ); + } "bind" => { let binding = bind_repository_body( &PathBuf::from(required(&args, "--repo")?), @@ -80,7 +110,7 @@ fn required<'a>(args: &'a [String], name: &str) -> Result<&'a str> { } fn usage() -> Result { bail!( - "usage: epiphany-repository-body bind --repo PATH --store PATH --runtime-store PATH --workspace-id ID | observe --repo PATH --store PATH --runtime-store PATH | status --store PATH | smoke" + "usage: epiphany-repository-body bootstrap --repo PATH --store PATH --runtime-store PATH --agent-store PATH --workspace-id ID --runtime-id ID --swarm-id ID | bind --repo PATH --store PATH --runtime-store PATH --workspace-id ID | observe --repo PATH --store PATH --runtime-store PATH | status --store PATH | smoke" ) } fn smoke() -> Result<()> {