From 14d09c61be3043579aa2c659f5fd1745f16a3e58 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 6 Aug 2026 01:46:50 +0100 Subject: [PATCH] Bind Verse topology to deployed repository Body --- .../src/bin/epiphany-cluster-daemon.rs | 7 +- .../src/bin/epiphany-prompt-context-smoke.rs | 1 + epiphany-core/src/bin/epiphany-verse-query.rs | 13 +++ ...phany-workspace-coverage-recovery-smoke.rs | 7 +- .../src/coordinator_launch_context.rs | 1 + epiphany-core/src/cultmesh_integration.rs | 87 ++++++++++++++++--- epiphany-core/src/prompt_context.rs | 7 +- notes/epiphany-current-algorithmic-map.md | 5 ++ 8 files changed, 111 insertions(+), 17 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-cluster-daemon.rs b/epiphany-core/src/bin/epiphany-cluster-daemon.rs index 482b5441..f6e1b86c 100644 --- a/epiphany-core/src/bin/epiphany-cluster-daemon.rs +++ b/epiphany-core/src/bin/epiphany-cluster-daemon.rs @@ -271,7 +271,12 @@ mod tests { fn heartbeat_writes_liveness_without_minting_provider_truth() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("heartbeat-only.ccmp"); - seed_epiphany_local_verse_context(&store, "runtime-test", "2026-07-15T12:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "runtime-test", + "2026-07-15T12:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let args = Args { command: "heartbeat".to_string(), store: store.clone(), diff --git a/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs b/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs index 59235822..47ea67ae 100644 --- a/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs +++ b/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs @@ -39,6 +39,7 @@ fn main() -> Result<()> { &store, "epiphany-prompt-context-smoke", "2026-06-02T00:00:00Z", + "repo:C:/fixture/Epiphany", )?; let local_verse = query_epiphany_local_verse_context(&store, "epiphany-prompt-context-smoke")?; let memory_context = plan_memory_graph_context_cut( diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index c5380880..12fd063b 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -30,6 +30,7 @@ use epiphany_core::EpiphanyCultMeshSwarmBrakeEntry; use epiphany_core::EpiphanyCultMeshWorkLoopTelemetryEntry; use epiphany_core::EpiphanyLocalVerseContext; use epiphany_core::EpiphanyServiceExecutionAuditCheck; +#[cfg(test)] use epiphany_core::default_epiphany_cultmesh_swarm_brake; use epiphany_core::engage_epiphany_cultmesh_swarm_brake; use epiphany_core::epiphany_cluster_service_execution_audit_report; @@ -77,6 +78,7 @@ use epiphany_core::write_epiphany_cultmesh_daemon_poke_receipt; use epiphany_core::write_epiphany_cultmesh_daemon_restart_policy; use epiphany_core::write_epiphany_cultmesh_daemon_status; use epiphany_core::write_epiphany_cultmesh_daemon_tool_invocation_intent; +#[cfg(test)] use epiphany_core::write_epiphany_cultmesh_swarm_brake; use epiphany_core::write_epiphany_cultmesh_work_loop_telemetry; use serde::Serialize; @@ -299,19 +301,29 @@ fn run_cli() -> Result<()> { let args = Args::parse()?; match args.command.as_str() { "seed" => { + let body_domain = args + .body_domain + .as_deref() + .context("seed requires --body-domain repo:")?; seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), Utc::now().to_rfc3339(), + body_domain, )?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; println!("{}", serde_json::to_string_pretty(&context)?); } "seed-compact" | "seed-only" => { + let body_domain = args + .body_domain + .as_deref() + .context("seed-compact requires --body-domain repo:")?; seed_epiphany_local_verse_context( &args.store, args.runtime_id.clone(), Utc::now().to_rfc3339(), + body_domain, )?; println!( "{}", @@ -1036,6 +1048,7 @@ fn run_cli() -> Result<()> { &args.store, args.runtime_id.clone(), "2026-06-02T00:00:00Z", + "repo:C:/fixture/Epiphany", )?; seed_quarantined_smoke_daemon_statuses(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; diff --git a/epiphany-core/src/bin/epiphany-workspace-coverage-recovery-smoke.rs b/epiphany-core/src/bin/epiphany-workspace-coverage-recovery-smoke.rs index f859d741..e1f34d72 100644 --- a/epiphany-core/src/bin/epiphany-workspace-coverage-recovery-smoke.rs +++ b/epiphany-core/src/bin/epiphany-workspace-coverage-recovery-smoke.rs @@ -62,7 +62,12 @@ fn main() -> Result<()> { bind_runtime_to_agent_memory_swarm(&runtime, &agents, &chrono::Utc::now().to_rfc3339())?; bind_repository_body(&repo, &body, &runtime, &format!("smoke-{smoke_id}"))?; observe_repository_body(&repo, &body, &runtime)?; - seed_epiphany_local_verse_context(&verse, RUNTIME_ID, chrono::Utc::now().to_rfc3339())?; + seed_epiphany_local_verse_context( + &verse, + RUNTIME_ID, + chrono::Utc::now().to_rfc3339(), + "repo:C:/fixture/Epiphany", + )?; let _process_cleanup = ManagedProcessCleanup { verse: verse.clone(), }; diff --git a/epiphany-core/src/coordinator_launch_context.rs b/epiphany-core/src/coordinator_launch_context.rs index cacf7b87..70b7a1aa 100644 --- a/epiphany-core/src/coordinator_launch_context.rs +++ b/epiphany-core/src/coordinator_launch_context.rs @@ -1201,6 +1201,7 @@ mod tests { local_verse_store_path(&runtime_store), EPIPHANY_LOCAL_VERSE_RUNTIME_ID, "2026-07-12T00:00:00Z", + "repo:C:/fixture/Epiphany", )?; let rendered = render_launch_dynamic_prompt_context( diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index d8f53365..8380fbde 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -6174,11 +6174,16 @@ pub fn seed_epiphany_local_verse_context( store_path: impl AsRef, runtime_id: impl Into, generated_at_utc: impl Into, + body_domain: impl Into, ) -> Result<()> { let store_path = store_path.as_ref(); retire_epiphany_cultmesh_legacy_provider_documents(store_path)?; let runtime_id = runtime_id.into(); let generated_at_utc = generated_at_utc.into(); + let body_domain = body_domain.into(); + if !body_domain.starts_with("repo:") || body_domain.trim() == "repo:" { + anyhow::bail!("local Verse repository topology requires an explicit repo: Body domain"); + } let status = EpiphanyCultMeshStatusEntry { schema_version: EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION.to_string(), runtime_id: runtime_id.clone(), @@ -6190,7 +6195,7 @@ pub fn seed_epiphany_local_verse_context( write_epiphany_cultmesh_status(store_path, status)?; write_epiphany_cultmesh_verse_policies(store_path, runtime_id.clone())?; write_epiphany_cultmesh_global_room_policies(store_path, runtime_id.clone())?; - write_epiphany_cultmesh_cluster_topology(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_cluster_topology(store_path, runtime_id.clone(), body_domain)?; { let node = open_epiphany_cultmesh_node(store_path, runtime_id.clone())?; if node @@ -6786,6 +6791,13 @@ pub fn write_epiphany_cultmesh_global_room_policies( } pub fn epiphany_cultmesh_cluster_topology() -> Vec { + epiphany_cultmesh_cluster_topology_for_body("repo:unbound") +} + +pub fn epiphany_cultmesh_cluster_topology_for_body( + body_domain: impl Into, +) -> Vec { + let body_domain = body_domain.into(); [ ("self", "coordinator", "Self", false), ("hands", "implementation", "Hands", false), @@ -6805,7 +6817,7 @@ pub fn epiphany_cultmesh_cluster_topology() -> Vec Vec, runtime_id: impl Into, + body_domain: impl Into, ) -> Result> { let mut node = open_epiphany_cultmesh_node(store_path, runtime_id)?; let mut written = Vec::new(); - for cluster in epiphany_cultmesh_cluster_topology() { + for cluster in epiphany_cultmesh_cluster_topology_for_body(body_domain) { written.push(node.put(cluster.cluster_id.clone(), &cluster)?); } node.flush()?; @@ -9621,7 +9634,11 @@ mod tests { fn cluster_topology_names_private_verses_body_daemons_and_eve_surfaces() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-cluster-topology.ccmp"); - let written = write_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")?; + let written = write_epiphany_cultmesh_cluster_topology( + &store, + "epiphany-test", + "repo:C:/fixture/Epiphany", + )?; assert_eq!(written.len(), 7); let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?; @@ -9631,7 +9648,7 @@ mod tests { node.get_required::("epiphany.cluster.hands")?; assert_eq!(persona.private_verse_id, "epiphany.cluster.persona.private"); - assert_eq!(persona.body_domain, "repo:E:/Projects/EpiphanyAgent"); + assert_eq!(persona.body_domain, "repo:C:/fixture/Epiphany"); assert_eq!(persona.daemon_id, "epiphany-daemon-persona"); assert_eq!(persona.eve_surface_id, "eve://epiphany/persona"); assert!(persona.public_persona_discussion_allowed); @@ -9682,7 +9699,11 @@ mod tests { fn legacy_provider_rows_are_not_live_discovery_state() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-eve-surface-states.ccmp"); - write_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")?; + write_epiphany_cultmesh_cluster_topology( + &store, + "epiphany-test", + "repo:C:/fixture/Epiphany", + )?; publish_all_test_provider_state(&store)?; let context = query_epiphany_local_verse_context(&store, "epiphany-test")?; assert!(context.odin_advertisements.is_empty()); @@ -9717,7 +9738,11 @@ mod tests { fn daemon_statuses_cover_every_cluster_without_private_state() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-daemon-statuses.ccmp"); - write_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")?; + write_epiphany_cultmesh_cluster_topology( + &store, + "epiphany-test", + "repo:C:/fixture/Epiphany", + )?; let statuses = write_epiphany_cultmesh_daemon_statuses( &store, "epiphany-test", @@ -9760,7 +9785,11 @@ mod tests { fn declared_daemon_targets_do_not_materialize_observed_liveness() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-declared-versus-observed.ccmp"); - let topology = write_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")?; + let topology = write_epiphany_cultmesh_cluster_topology( + &store, + "epiphany-test", + "repo:C:/fixture/Epiphany", + )?; assert_eq!(topology.len(), 7); assert!(load_epiphany_cultmesh_daemon_liveness(&store, "epiphany-test")?.is_empty()); @@ -9959,7 +9988,12 @@ mod tests { fn swarm_brake_round_trips_and_projects_status() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-swarm-brake.ccmp"); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-17T00:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-06-17T00:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let brake = load_epiphany_cultmesh_swarm_brake(&store, "epiphany-test")? .expect("seeded swarm brake exists"); @@ -10007,7 +10041,12 @@ mod tests { fn persona_speech_audit_round_trips_and_projects_without_private_content() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-persona-speech-audit.ccmp"); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-17T00:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-06-17T00:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let audit = EpiphanyCultMeshPersonaSpeechAuditEntry { schema_version: EPIPHANY_CULTMESH_PERSONA_SPEECH_AUDIT_SCHEMA_VERSION.to_string(), audit_id: "persona-speech-audit-test".to_string(), @@ -10095,7 +10134,12 @@ mod tests { { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-weksa-lowering.ccmp"); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-21T00:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-06-21T00:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let receipt = EpiphanyCultMeshWeksaLoweringReceiptEntry { schema_version: EPIPHANY_CULTMESH_WEKSA_LOWERING_RECEIPT_SCHEMA_VERSION.to_string(), receipt_id: "weksa-lowering-receipt-test".to_string(), @@ -10762,7 +10806,12 @@ mod tests { fn local_verse_bootstrap_does_not_publish_provider_owned_state() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-local-verse.ccmp"); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-02T00:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-06-02T00:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let context = query_epiphany_local_verse_context(&store, "epiphany-test")?; @@ -10808,7 +10857,12 @@ mod tests { fn explicit_bootstrap_retires_legacy_provider_forgery() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-provider-boundary.ccmp"); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-07-12T00:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-07-12T00:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let sentinel_before = open_epiphany_cultmesh_node(&store, "epiphany-test")? .get_required::(EPIPHANY_CULTMESH_STATUS_KEY)?; @@ -10835,7 +10889,12 @@ mod tests { .get_required::(EPIPHANY_CULTMESH_STATUS_KEY)?, sentinel_before ); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-07-12T00:01:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-07-12T00:01:00Z", + "repo:C:/fixture/Epiphany", + )?; assert!(retire_epiphany_cultmesh_legacy_provider_documents(&store)?.is_empty()); let error = diff --git a/epiphany-core/src/prompt_context.rs b/epiphany-core/src/prompt_context.rs index ac072633..c21b4187 100644 --- a/epiphany-core/src/prompt_context.rs +++ b/epiphany-core/src/prompt_context.rs @@ -425,7 +425,12 @@ mod tests { fn prompt_context_renders_verse_and_memory_without_state_authority() -> anyhow::Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-local-verse.ccmp"); - seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-02T00:00:00Z")?; + seed_epiphany_local_verse_context( + &store, + "epiphany-test", + "2026-06-02T00:00:00Z", + "repo:C:/fixture/Epiphany", + )?; let _seeded_verse = query_epiphany_local_verse_context(&store, "epiphany-test")?; let bifrost_intent = epiphany_cultmesh_bifrost_body_change_publication_intent( "bifrost-publication-intent-prompt-test", diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 99f20bf0..bd967180 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -166,6 +166,11 @@ and organ contracts only. It does not publish Odin provider advertisements, Eve surfaces, or daemon-hosted tools. Those families require provider publication; discovery preserves their absence. +- Bootstrap receives the authenticated repository Body domain explicitly and + stamps that exact domain into every cluster declaration. Cluster topology no + longer owns a compiled workstation path; seed commands fail closed when the + Body domain is absent or is not a non-empty `repo:` domain. Stored topology is + the only live source for downstream liveness, policy, Eve, and tool routing. - The generic Verse query CLI has no provider-advertisement preview or Odin publication command. Provider bodies must publish their own discovery state; central declared topology cannot be lowered into `active`/`daemon-live`