From 74407daf8a97715179d6c844046adda985408cd5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 12 Jul 2026 21:20:05 +0100 Subject: [PATCH] Require bootstrap before query mutations --- .../src/bin/epiphany-cluster-daemon.rs | 9 +- .../src/bin/epiphany-daemon-supervisor.rs | 58 ++-- .../src/bin/epiphany-heartbeat-store.rs | 15 +- .../src/bin/epiphany-operator-run.rs | 12 +- .../src/bin/epiphany-operator-snapshot.rs | 2 +- ...any-repo-deployment-config-family-smoke.rs | 8 +- epiphany-core/src/bin/epiphany-verse-query.rs | 272 +++++++++--------- .../bin/epiphany-weksa-interlingua-smoke.rs | 16 +- epiphany-core/src/cultmesh_integration.rs | 48 ++-- epiphany-core/src/lib.rs | 20 +- epiphany-core/src/prompt_context.rs | 10 +- ...onceptual-substitution-audit-2026-07-12.md | 16 ++ notes/epiphany-current-algorithmic-map.md | 4 + notes/fresh-workspace-handoff.md | 3 + state/ledgers.msgpack | Bin 436006 -> 436396 bytes state/map.yaml | 2 +- 16 files changed, 238 insertions(+), 257 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-cluster-daemon.rs b/epiphany-core/src/bin/epiphany-cluster-daemon.rs index 8540bd66..98efdd68 100644 --- a/epiphany-core/src/bin/epiphany-cluster-daemon.rs +++ b/epiphany-core/src/bin/epiphany-cluster-daemon.rs @@ -1,12 +1,12 @@ use anyhow::Context; use anyhow::Result; use chrono::Utc; +use epiphany_core::EPIPHANY_CULTMESH_DAEMON_STATUS_SCHEMA_VERSION; +use epiphany_core::EpiphanyCultMeshDaemonStatusEntry; use epiphany_core::load_epiphany_cultmesh_cluster_topology; use epiphany_core::load_epiphany_cultmesh_daemon_liveness; use epiphany_core::publish_epiphany_cultmesh_provider_state; use epiphany_core::write_epiphany_cultmesh_daemon_status; -use epiphany_core::EpiphanyCultMeshDaemonStatusEntry; -use epiphany_core::EPIPHANY_CULTMESH_DAEMON_STATUS_SCHEMA_VERSION; use serde_json::json; use std::env; use std::path::PathBuf; @@ -75,7 +75,10 @@ fn write_heartbeat(args: &Args, iteration: u64) -> Result Result<()> { args.store.display() ) })?; - let topology = - load_epiphany_cultmesh_cluster_topology(&args.store, args.runtime_id.clone())?; + let topology = load_epiphany_cultmesh_cluster_topology(&args.store, args.runtime_id.clone())?; if topology.is_empty() { anyhow::bail!( "local Verse has no persisted cluster topology at {}; run explicit bootstrap before daemon-supervisor commands", @@ -161,9 +160,7 @@ fn seed_supervisor_smoke_fixture(args: &Args) -> Result<()> { .components() .any(|component| component.as_os_str() == ".epiphany-smoke") { - anyhow::bail!( - "daemon-supervisor smoke fixtures may write only beneath .epiphany-smoke" - ); + anyhow::bail!("daemon-supervisor smoke fixtures may write only beneath .epiphany-smoke"); } seed_epiphany_local_verse_context( &args.store, @@ -173,7 +170,6 @@ fn seed_supervisor_smoke_fixture(args: &Args) -> Result<()> { } fn reconcile(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -417,7 +413,6 @@ fn service_launch(args: Args) -> Result<()> { } fn managed_service_policy(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let command = service_command_path(&args)?; @@ -648,7 +643,6 @@ fn managed_service_reconcile(mut args: Args) -> Result<()> { } fn service_runbook(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -702,7 +696,6 @@ fn service_runbook(args: Args) -> Result<()> { } fn repo_work_service_audit(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -897,7 +890,6 @@ fn service_artifact_status(artifact_ref: &str) -> &'static str { } fn cluster_daemon_runbook(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -968,7 +960,6 @@ fn cluster_daemon_runbook(args: Args) -> Result<()> { } fn cluster_windows_service_install(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1098,7 +1089,6 @@ fn cluster_windows_service_install(args: Args) -> Result<()> { } fn cluster_windows_service_audit(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1206,7 +1196,6 @@ fn cluster_windows_service_audit(args: Args) -> Result<()> { } fn cluster_windows_service_control(args: Args, control: &str) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1345,7 +1334,6 @@ fn cluster_windows_service_control(args: Args, control: &str) -> Result<()> { } fn windows_service_install(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1441,7 +1429,6 @@ fn windows_service_install(args: Args) -> Result<()> { } fn windows_service_status(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1498,7 +1485,6 @@ fn windows_service_status(args: Args) -> Result<()> { } fn windows_service_execution_readiness(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1551,7 +1537,6 @@ fn windows_service_execution_readiness(args: Args) -> Result<()> { } fn cluster_windows_service_execution_readiness(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1618,7 +1603,6 @@ fn cluster_windows_service_execution_readiness(args: Args) -> Result<()> { } fn windows_service_execution_audit(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1680,7 +1664,6 @@ fn windows_service_execution_audit(args: Args) -> Result<()> { } fn windows_service_execution_audit_smoke(args: Args) -> Result<()> { - seed_supervisor_smoke_fixture(&args)?; let started_at = Utc::now(); @@ -1771,7 +1754,6 @@ fn windows_service_execution_audit_smoke(args: Args) -> Result<()> { } fn cluster_windows_service_execution_runbook(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1862,7 +1844,6 @@ fn cluster_windows_service_execution_runbook(args: Args) -> Result<()> { } fn cluster_windows_service_execution_audit(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -1923,7 +1904,6 @@ fn cluster_windows_service_execution_audit(args: Args) -> Result<()> { } fn cluster_windows_service_execution_audit_smoke(args: Args) -> Result<()> { - seed_supervisor_smoke_fixture(&args)?; let started_at = Utc::now(); @@ -2071,7 +2051,6 @@ fn elevated_powershell_runbook_command(path: &str) -> String { } fn windows_service_execution_runbook(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -2165,7 +2144,6 @@ fn windows_service_execution_runbook(args: Args) -> Result<()> { } fn windows_service_reconcile(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -2264,7 +2242,6 @@ fn windows_service_reconcile(args: Args) -> Result<()> { } fn windows_service_control(args: Args, control: &str) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; @@ -2509,7 +2486,6 @@ fn run_tick(args: &Args, iteration: u64, next_wake_utc: Option) -> Resul } fn write_policy(args: Args) -> Result<()> { - require_supervisor_bootstrap(&args)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; diff --git a/epiphany-core/src/bin/epiphany-heartbeat-store.rs b/epiphany-core/src/bin/epiphany-heartbeat-store.rs index f05ecff7..461ce36d 100644 --- a/epiphany-core/src/bin/epiphany-heartbeat-store.rs +++ b/epiphany-core/src/bin/epiphany-heartbeat-store.rs @@ -1,8 +1,8 @@ use anyhow::Context; use anyhow::Result; use anyhow::anyhow; -use epiphany_core::GhostlightSceneParticipantSeed; use epiphany_core::EpiphanyCultMeshSwarmBrakeEntry; +use epiphany_core::GhostlightSceneParticipantSeed; use epiphany_core::HeartbeatCompleteOptions; use epiphany_core::HeartbeatHeatUpdateOptions; use epiphany_core::HeartbeatPumpOptions; @@ -391,7 +391,9 @@ fn main() -> Result<()> { } "serve" => { if interval_seconds == 0 { - return Err(anyhow!("serve requires --interval-seconds greater than zero")); + return Err(anyhow!( + "serve requires --interval-seconds greater than zero" + )); } let store_path = store_path.ok_or_else(|| anyhow!("serve requires --store"))?; let artifact_dir = @@ -557,11 +559,10 @@ fn active_swarm_brake( if !local_verse_store.exists() { return Ok(None); } - Ok(load_epiphany_cultmesh_swarm_brake( - local_verse_store, - "epiphany-local", - )? - .filter(|brake| brake.status == "engaged")) + Ok( + load_epiphany_cultmesh_swarm_brake(local_verse_store, "epiphany-local")? + .filter(|brake| brake.status == "engaged"), + ) } fn parse_scene_participant(raw: &str) -> Result { diff --git a/epiphany-core/src/bin/epiphany-operator-run.rs b/epiphany-core/src/bin/epiphany-operator-run.rs index c18056e2..514d6752 100644 --- a/epiphany-core/src/bin/epiphany-operator-run.rs +++ b/epiphany-core/src/bin/epiphany-operator-run.rs @@ -1,6 +1,11 @@ use anyhow::Context; use anyhow::Result; use chrono::Utc; +use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; +use epiphany_core::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION; +use epiphany_core::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION; +use epiphany_core::EpiphanyCultMeshOperatorRunIntentEntry; +use epiphany_core::EpiphanyCultMeshOperatorRunReceiptEntry; use epiphany_core::epiphany_cultmesh_coordinator_run_receipt_from_summary_json; use epiphany_core::epiphany_cultmesh_hands_action_gate_from_summary_json; use epiphany_core::epiphany_cultmesh_role_review_event_from_summary_json; @@ -11,13 +16,8 @@ use epiphany_core::write_epiphany_cultmesh_hands_action_gate; use epiphany_core::write_epiphany_cultmesh_operator_run_intent; use epiphany_core::write_epiphany_cultmesh_operator_run_receipt; use epiphany_core::write_epiphany_cultmesh_role_review_event; -use epiphany_core::EpiphanyCultMeshOperatorRunIntentEntry; -use epiphany_core::EpiphanyCultMeshOperatorRunReceiptEntry; -use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; -use epiphany_core::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION; -use epiphany_core::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION; -use serde_json::json; use serde_json::Value; +use serde_json::json; use std::env; use std::fs; use std::path::PathBuf; diff --git a/epiphany-core/src/bin/epiphany-operator-snapshot.rs b/epiphany-core/src/bin/epiphany-operator-snapshot.rs index afab13a9..86271459 100644 --- a/epiphany-core/src/bin/epiphany-operator-snapshot.rs +++ b/epiphany-core/src/bin/epiphany-operator-snapshot.rs @@ -4,8 +4,8 @@ use chrono::Utc; use epiphany_core::epiphany_cultmesh_operator_snapshot_from_status_json; use epiphany_core::load_latest_epiphany_cultmesh_operator_snapshot; use epiphany_core::write_epiphany_cultmesh_operator_snapshot; -use serde_json::json; use serde_json::Value; +use serde_json::json; use std::env; use std::fs; use std::path::PathBuf; diff --git a/epiphany-core/src/bin/epiphany-repo-deployment-config-family-smoke.rs b/epiphany-core/src/bin/epiphany-repo-deployment-config-family-smoke.rs index 288ce740..5028a529 100644 --- a/epiphany-core/src/bin/epiphany-repo-deployment-config-family-smoke.rs +++ b/epiphany-core/src/bin/epiphany-repo-deployment-config-family-smoke.rs @@ -1,13 +1,13 @@ -use anyhow::anyhow; use anyhow::Context; use anyhow::Result; +use anyhow::anyhow; use chrono::Utc; -use epiphany_core::write_epiphany_cultmesh_idunn_aftercare_audit_receipt; -use epiphany_core::write_epiphany_cultmesh_idunn_deployment_receipt; use epiphany_core::EpiphanyCultMeshIdunnAftercareAuditReceiptEntry; use epiphany_core::EpiphanyCultMeshIdunnDeploymentReceiptEntry; -use serde_json::json; +use epiphany_core::write_epiphany_cultmesh_idunn_aftercare_audit_receipt; +use epiphany_core::write_epiphany_cultmesh_idunn_deployment_receipt; use serde_json::Value; +use serde_json::json; use std::env; use std::fs; use std::path::Path; diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs index 588b1414..0868eb58 100644 --- a/epiphany-core/src/bin/epiphany-verse-query.rs +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -1,78 +1,10 @@ use anyhow::Context; use anyhow::Result; use chrono::Utc; -use epiphany_core::default_epiphany_cultmesh_swarm_brake; -use epiphany_core::epiphany_cluster_service_execution_audit_report; -use epiphany_core::epiphany_cultmesh_agent_state_soa_summary_from_entry; -use epiphany_core::epiphany_cultmesh_bifrost_body_change_publication_intent; -use epiphany_core::epiphany_cultmesh_bifrost_body_change_publication_receipt_for_intent; -use epiphany_core::epiphany_cultmesh_bifrost_collaboration_feedback; -use epiphany_core::epiphany_cultmesh_bifrost_github_publication_receipt_for_publication; -use epiphany_core::epiphany_cultmesh_daemon_poke_intent_from_status; -use epiphany_core::epiphany_cultmesh_daemon_poke_receipt_for_intent; -use epiphany_core::epiphany_cultmesh_daemon_tool_invocation_intent_from_capability; -use epiphany_core::epiphany_cultmesh_daemon_tool_invocation_receipt_for_intent; -use epiphany_core::epiphany_cultmesh_eve_connection_intent_from_advertisement; -use epiphany_core::epiphany_cultmesh_eve_connection_receipt_for_intent; -use epiphany_core::epiphany_cultmesh_imagination_consensus_receipt_for_feedback; -use epiphany_core::epiphany_service_execution_audit_report; -use epiphany_core::load_agent_state_soa_entry; -use epiphany_core::load_epiphany_cultmesh_cluster_topology; -use epiphany_core::load_epiphany_cultmesh_daemon_liveness; -use epiphany_core::load_epiphany_cultmesh_daemon_restart_policy_directory; -use epiphany_core::load_epiphany_cultmesh_daemon_service_lifecycle_receipts; -use epiphany_core::load_epiphany_cultmesh_daemon_tool_directory; -use epiphany_core::load_epiphany_cultmesh_eve_surface_directory; -use epiphany_core::load_epiphany_cultmesh_managed_service_policies; -use epiphany_core::load_epiphany_cultmesh_repo_work_map_entries; -use epiphany_core::load_epiphany_cultmesh_repo_work_overviews; -use epiphany_core::load_epiphany_cultmesh_repo_work_public_proofs; -use epiphany_core::load_epiphany_cultmesh_repo_work_readiness_reports; -use epiphany_core::load_epiphany_cultmesh_repo_work_readiness_reviews; -use epiphany_core::load_epiphany_cultmesh_swarm_brake; -use epiphany_core::load_latest_epiphany_cultmesh_agent_state_soa_summary; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_artifact_acceptance_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_body_change_publication_intent; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_body_change_publication_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_collaboration_feedback; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_github_publication_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_metrics_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_bifrost_public_proof_publication_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_daemon_tool_invocation_intent; -use epiphany_core::load_latest_epiphany_cultmesh_eve_connection_intent; -use epiphany_core::load_latest_epiphany_cultmesh_eve_connection_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_idunn_aftercare_audit_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_idunn_deployment_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_imagination_consensus_receipt; -use epiphany_core::load_latest_epiphany_cultmesh_repo_work_map_entry; -use epiphany_core::load_latest_epiphany_cultmesh_repo_work_overview; -use epiphany_core::load_latest_epiphany_cultmesh_repo_work_public_proof; -use epiphany_core::load_latest_epiphany_cultmesh_repo_work_readiness; -use epiphany_core::load_latest_epiphany_cultmesh_repo_work_readiness_review; -use epiphany_core::observe_native_process; -use epiphany_core::open_epiphany_cultmesh_node; -use epiphany_core::query_epiphany_local_verse_context; -use epiphany_core::seed_epiphany_local_verse_context; -use epiphany_core::write_epiphany_cultmesh_agent_state_soa_summary; -use epiphany_core::write_epiphany_cultmesh_bifrost_body_change_publication_intent; -use epiphany_core::write_epiphany_cultmesh_bifrost_body_change_publication_receipt; -use epiphany_core::write_epiphany_cultmesh_bifrost_collaboration_feedback; -use epiphany_core::write_epiphany_cultmesh_bifrost_github_publication_receipt; -use epiphany_core::write_epiphany_cultmesh_daemon_poke_intent; -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_service_lifecycle_receipt; -use epiphany_core::write_epiphany_cultmesh_daemon_status; -use epiphany_core::write_epiphany_cultmesh_daemon_statuses; -use epiphany_core::write_epiphany_cultmesh_daemon_tool_invocation_intent; -use epiphany_core::write_epiphany_cultmesh_daemon_tool_invocation_receipt; -use epiphany_core::write_epiphany_cultmesh_eve_connection_intent; -use epiphany_core::write_epiphany_cultmesh_eve_connection_receipt; -use epiphany_core::write_epiphany_cultmesh_imagination_consensus_receipt; -use epiphany_core::publish_epiphany_cultmesh_provider_state; -use epiphany_core::write_epiphany_cultmesh_swarm_brake; -use epiphany_core::write_epiphany_cultmesh_work_loop_telemetry; +use epiphany_core::EPIPHANY_CULTMESH_DAEMON_RESTART_POLICY_SCHEMA_VERSION; +use epiphany_core::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_SCHEMA_VERSION; +use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; +use epiphany_core::EPIPHANY_CULTMESH_WORK_LOOP_TELEMETRY_SCHEMA_VERSION; use epiphany_core::EpiphanyAgentStateSoaEntry; use epiphany_core::EpiphanyCultMeshAgentStateSoaSummaryEntry; use epiphany_core::EpiphanyCultMeshBifrostArtifactAcceptanceReceiptEntry; @@ -103,10 +35,79 @@ use epiphany_core::EpiphanyCultMeshSwarmBrakeEntry; use epiphany_core::EpiphanyCultMeshWorkLoopTelemetryEntry; use epiphany_core::EpiphanyLocalVerseContext; use epiphany_core::EpiphanyServiceExecutionAuditCheck; -use epiphany_core::EPIPHANY_CULTMESH_DAEMON_RESTART_POLICY_SCHEMA_VERSION; -use epiphany_core::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_SCHEMA_VERSION; -use epiphany_core::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; -use epiphany_core::EPIPHANY_CULTMESH_WORK_LOOP_TELEMETRY_SCHEMA_VERSION; +use epiphany_core::default_epiphany_cultmesh_swarm_brake; +use epiphany_core::epiphany_cluster_service_execution_audit_report; +use epiphany_core::epiphany_cultmesh_agent_state_soa_summary_from_entry; +use epiphany_core::epiphany_cultmesh_bifrost_body_change_publication_intent; +use epiphany_core::epiphany_cultmesh_bifrost_body_change_publication_receipt_for_intent; +use epiphany_core::epiphany_cultmesh_bifrost_collaboration_feedback; +use epiphany_core::epiphany_cultmesh_bifrost_github_publication_receipt_for_publication; +use epiphany_core::epiphany_cultmesh_daemon_poke_intent_from_status; +use epiphany_core::epiphany_cultmesh_daemon_poke_receipt_for_intent; +use epiphany_core::epiphany_cultmesh_daemon_tool_invocation_intent_from_capability; +use epiphany_core::epiphany_cultmesh_daemon_tool_invocation_receipt_for_intent; +use epiphany_core::epiphany_cultmesh_eve_connection_intent_from_advertisement; +use epiphany_core::epiphany_cultmesh_eve_connection_receipt_for_intent; +use epiphany_core::epiphany_cultmesh_imagination_consensus_receipt_for_feedback; +use epiphany_core::epiphany_service_execution_audit_report; +use epiphany_core::load_agent_state_soa_entry; +use epiphany_core::load_epiphany_cultmesh_cluster_topology; +use epiphany_core::load_epiphany_cultmesh_daemon_liveness; +use epiphany_core::load_epiphany_cultmesh_daemon_restart_policy_directory; +use epiphany_core::load_epiphany_cultmesh_daemon_service_lifecycle_receipts; +use epiphany_core::load_epiphany_cultmesh_daemon_tool_directory; +use epiphany_core::load_epiphany_cultmesh_eve_surface_directory; +use epiphany_core::load_epiphany_cultmesh_managed_service_policies; +use epiphany_core::load_epiphany_cultmesh_repo_work_map_entries; +use epiphany_core::load_epiphany_cultmesh_repo_work_overviews; +use epiphany_core::load_epiphany_cultmesh_repo_work_public_proofs; +use epiphany_core::load_epiphany_cultmesh_repo_work_readiness_reports; +use epiphany_core::load_epiphany_cultmesh_repo_work_readiness_reviews; +use epiphany_core::load_epiphany_cultmesh_status; +use epiphany_core::load_epiphany_cultmesh_swarm_brake; +use epiphany_core::load_latest_epiphany_cultmesh_agent_state_soa_summary; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_artifact_acceptance_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_body_change_publication_intent; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_body_change_publication_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_collaboration_feedback; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_github_publication_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_metrics_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_bifrost_public_proof_publication_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_daemon_service_lifecycle_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_daemon_tool_invocation_intent; +use epiphany_core::load_latest_epiphany_cultmesh_eve_connection_intent; +use epiphany_core::load_latest_epiphany_cultmesh_eve_connection_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_idunn_aftercare_audit_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_idunn_deployment_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_imagination_consensus_receipt; +use epiphany_core::load_latest_epiphany_cultmesh_repo_work_map_entry; +use epiphany_core::load_latest_epiphany_cultmesh_repo_work_overview; +use epiphany_core::load_latest_epiphany_cultmesh_repo_work_public_proof; +use epiphany_core::load_latest_epiphany_cultmesh_repo_work_readiness; +use epiphany_core::load_latest_epiphany_cultmesh_repo_work_readiness_review; +use epiphany_core::observe_native_process; +use epiphany_core::open_epiphany_cultmesh_node; +use epiphany_core::publish_epiphany_cultmesh_provider_state; +use epiphany_core::query_epiphany_local_verse_context; +use epiphany_core::seed_epiphany_local_verse_context; +use epiphany_core::write_epiphany_cultmesh_agent_state_soa_summary; +use epiphany_core::write_epiphany_cultmesh_bifrost_body_change_publication_intent; +use epiphany_core::write_epiphany_cultmesh_bifrost_body_change_publication_receipt; +use epiphany_core::write_epiphany_cultmesh_bifrost_collaboration_feedback; +use epiphany_core::write_epiphany_cultmesh_bifrost_github_publication_receipt; +use epiphany_core::write_epiphany_cultmesh_daemon_poke_intent; +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_service_lifecycle_receipt; +use epiphany_core::write_epiphany_cultmesh_daemon_status; +use epiphany_core::write_epiphany_cultmesh_daemon_statuses; +use epiphany_core::write_epiphany_cultmesh_daemon_tool_invocation_intent; +use epiphany_core::write_epiphany_cultmesh_daemon_tool_invocation_receipt; +use epiphany_core::write_epiphany_cultmesh_eve_connection_intent; +use epiphany_core::write_epiphany_cultmesh_eve_connection_receipt; +use epiphany_core::write_epiphany_cultmesh_imagination_consensus_receipt; +use epiphany_core::write_epiphany_cultmesh_swarm_brake; +use epiphany_core::write_epiphany_cultmesh_work_loop_telemetry; use serde::Serialize; use serde_json::json; use sha2::Digest; @@ -186,6 +187,24 @@ fn main() -> Result<()> { } } +fn require_query_bootstrap(args: &Args) -> Result<()> { + load_epiphany_cultmesh_status(&args.store, args.runtime_id.clone())? + .with_context(|| { + format!( + "local Verse is not bootstrapped at {}; run epiphany-verse-query seed-compact before mutating query commands", + args.store.display() + ) + })?; + let topology = load_epiphany_cultmesh_cluster_topology(&args.store, args.runtime_id.clone())?; + if topology.is_empty() { + anyhow::bail!( + "local Verse has no persisted cluster topology at {}; run epiphany-verse-query seed-compact before mutating query commands", + args.store.display() + ); + } + Ok(()) +} + fn run_cli() -> Result<()> { let args = Args::parse()?; match args.command.as_str() { @@ -361,11 +380,8 @@ fn run_cli() -> Result<()> { run_invoke_tool_command(&args)?; } "swarm-brake" | "brake" => { - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + require_query_bootstrap(&args)?; + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; let created_at_utc = Utc::now().to_rfc3339(); let status = args @@ -564,11 +580,9 @@ fn run_cli() -> Result<()> { } "poke-daemon" | "daemon-poke" => { reject_daemon_poke_response_fields(&args)?; - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; let daemon_id = args .daemon_id @@ -595,13 +609,8 @@ fn run_cli() -> Result<()> { .collect::() ) }); - let poke_result = write_daemon_poke_intent( - &args, - &context, - daemon_status, - intent_id, - reason, - )?; + let poke_result = + write_daemon_poke_intent(&args, &context, daemon_status, intent_id, reason)?; let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; if context.latest_daemon_poke_intent.is_none() { anyhow::bail!("local Verse query lost daemon poke intent after write"); @@ -627,11 +636,9 @@ fn run_cli() -> Result<()> { } "poke-down-daemons" | "poke-unready-daemons" | "daemon-poke-down" => { reject_daemon_poke_response_fields(&args)?; - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id.clone())?; let pokes = write_poke_intents_for_non_ready_daemons(&args, &context)?; let poke_tui_rows = pokes.iter().map(poke_result_tui_row).collect::>(); @@ -790,11 +797,9 @@ fn run_cli() -> Result<()> { "bifrost-publication accepts requester intent fields only; Bifrost and the GitHub publication adapter own receipt, ledger, credit, and publication-result fields" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let intent_id = args .intent_id .clone() @@ -917,11 +922,9 @@ fn run_cli() -> Result<()> { "bifrost-public-proof selects a pending public proof only; Bifrost owns ledger, review, credit, destination, publication, and receipt result fields" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let (latest_public_proof, public_proofs) = load_repo_work_public_proofs(&args)?; let selected_public_proof = if let Some(public_proof_id) = args.public_proof_id.as_ref() { @@ -980,11 +983,9 @@ fn run_cli() -> Result<()> { "bifrost-artifact-acceptance inspects a pending repo request only; Maintainer/Bifrost owns artifact, proof, review, ledger, acceptance identity/status, and accepted-by result fields" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let (_, map_entries) = load_repo_work_map_entries(&args)?; let map_entry = latest_repo_work_map_entry_for_family( &map_entries, @@ -1036,11 +1037,9 @@ fn run_cli() -> Result<()> { "bifrost-metrics inspects a pending repo request only; Bifrost/Maintainer owns accepted artifact, spend, review load, credit, proof, summary, and receipt result fields" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let (_, map_entries) = load_repo_work_map_entries(&args)?; let map_entry = latest_repo_work_map_entry_for_family(&map_entries, "repo.metrics_request") @@ -1127,11 +1126,9 @@ fn run_cli() -> Result<()> { "collaboration-feedback accepts Persona feedback fields only; Imagination owns consensus receipt, participants, packet, status, and adoption gate" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let feedback_id = args .feedback_id .clone() @@ -1239,11 +1236,9 @@ fn run_cli() -> Result<()> { "connect-eve accepts consumer intent fields only; the advertised Eve provider owns connection receipt id and status" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(&args)?; + let directory = load_epiphany_cultmesh_eve_surface_directory(&args.store, args.runtime_id.clone())?; let (_target_cluster, target, _target_surface) = if let Some(advertisement_id) = @@ -1348,10 +1343,9 @@ fn run_cli() -> Result<()> { args.runtime_id.clone(), "2026-06-02T00:00:00Z", )?; - for cluster in load_epiphany_cultmesh_cluster_topology( - &args.store, - args.runtime_id.clone(), - )? { + for cluster in + load_epiphany_cultmesh_cluster_topology(&args.store, args.runtime_id.clone())? + { publish_epiphany_cultmesh_provider_state( &args.store, args.runtime_id.clone(), @@ -9361,11 +9355,7 @@ fn bifrost_accounting_status(closed: bool, present: bool, private_state_exposed: } fn present_word(present: bool) -> &'static str { - if present { - "present" - } else { - "missing" - } + if present { "present" } else { "missing" } } fn collaboration_feedback_tui_rows( @@ -9524,11 +9514,9 @@ fn run_invoke_tool_command(args: &Args) -> Result<()> { "invoke-tool accepts requester intent fields only; the host daemon owns receipt status, result references, and result summaries" ); } - seed_epiphany_local_verse_context( - &args.store, - args.runtime_id.clone(), - Utc::now().to_rfc3339(), - )?; + + require_query_bootstrap(args)?; + let capability_id = args .capability_id .as_deref() diff --git a/epiphany-core/src/bin/epiphany-weksa-interlingua-smoke.rs b/epiphany-core/src/bin/epiphany-weksa-interlingua-smoke.rs index 1dd16e57..e39a675a 100644 --- a/epiphany-core/src/bin/epiphany-weksa-interlingua-smoke.rs +++ b/epiphany-core/src/bin/epiphany-weksa-interlingua-smoke.rs @@ -1,19 +1,19 @@ use anyhow::Result; use chrono::Utc; +use epiphany_core::EPIPHANY_CULTMESH_LOCAL_AREA_VERSE_ID; +use epiphany_core::EPIPHANY_CULTMESH_WEKSA_LOWERING_RECEIPT_SCHEMA_VERSION; +use epiphany_core::EpiphanyCultMeshWeksaLoweringReceiptEntry; +use epiphany_core::WEKSA_INTERLINGUA_PACKET_SCHEMA_VERSION; +use epiphany_core::WEKSA_TARGET_LOWERING_RECEIPT_SCHEMA_VERSION; +use epiphany_core::WEKSA_TARGET_LOWERING_REQUEST_SCHEMA_VERSION; +use epiphany_core::WeksaInterlinguaInput; +use epiphany_core::WeksaSpeakerContext; use epiphany_core::build_weksa_interlingua_packet; use epiphany_core::build_weksa_lowering_prompt; use epiphany_core::build_weksa_target_lowering_request; use epiphany_core::load_latest_epiphany_cultmesh_weksa_lowering_receipt; use epiphany_core::record_weksa_target_lowering_receipt; use epiphany_core::write_epiphany_cultmesh_weksa_lowering_receipt; -use epiphany_core::EpiphanyCultMeshWeksaLoweringReceiptEntry; -use epiphany_core::WeksaInterlinguaInput; -use epiphany_core::WeksaSpeakerContext; -use epiphany_core::EPIPHANY_CULTMESH_LOCAL_AREA_VERSE_ID; -use epiphany_core::EPIPHANY_CULTMESH_WEKSA_LOWERING_RECEIPT_SCHEMA_VERSION; -use epiphany_core::WEKSA_INTERLINGUA_PACKET_SCHEMA_VERSION; -use epiphany_core::WEKSA_TARGET_LOWERING_RECEIPT_SCHEMA_VERSION; -use epiphany_core::WEKSA_TARGET_LOWERING_REQUEST_SCHEMA_VERSION; use std::path::PathBuf; fn main() -> Result<()> { diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index 2d110436..1bf27f03 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -7179,11 +7179,7 @@ mod tests { fn publish_all_test_provider_state(store: &Path) -> Result<()> { for cluster in epiphany_cultmesh_cluster_topology() { - publish_epiphany_cultmesh_provider_state( - store, - "epiphany-test", - &cluster.daemon_id, - )?; + publish_epiphany_cultmesh_provider_state(store, "epiphany-test", &cluster.daemon_id)?; } Ok(()) } @@ -8659,11 +8655,7 @@ mod tests { fn daemon_tool_invocation_intent_and_receipt_round_trip_for_any_agent() -> Result<()> { let temp = tempfile::tempdir()?; let store = temp.path().join("epiphany-daemon-tool-invocation.ccmp"); - publish_epiphany_cultmesh_provider_state( - &store, - "epiphany-test", - "epiphany-daemon-hands", - )?; + publish_epiphany_cultmesh_provider_state(&store, "epiphany-test", "epiphany-daemon-hands")?; let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?; let hands_action = node.get_required::( @@ -9334,27 +9326,29 @@ mod tests { let store = temp.path().join("epiphany-provider-boundary.ccmp"); seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-07-12T00:00:00Z")?; - publish_epiphany_cultmesh_provider_state( - &store, - "epiphany-test", - "epiphany-daemon-hands", - )?; + publish_epiphany_cultmesh_provider_state(&store, "epiphany-test", "epiphany-daemon-hands")?; let context = query_epiphany_local_verse_context(&store, "epiphany-test")?; assert_eq!(context.odin_advertisements.len(), 1); assert_eq!(context.eve_surface_states.len(), 1); assert_eq!(context.daemon_tool_capabilities.len(), 3); - assert!(context - .odin_advertisements - .iter() - .all(|entry| entry.cluster_id == "epiphany.cluster.hands")); - assert!(context - .eve_surface_states - .iter() - .all(|entry| entry.cluster_id == "epiphany.cluster.hands")); - assert!(context - .daemon_tool_capabilities - .iter() - .all(|entry| entry.host_daemon_id == "epiphany-daemon-hands")); + assert!( + context + .odin_advertisements + .iter() + .all(|entry| entry.cluster_id == "epiphany.cluster.hands") + ); + assert!( + context + .eve_surface_states + .iter() + .all(|entry| entry.cluster_id == "epiphany.cluster.hands") + ); + assert!( + context + .daemon_tool_capabilities + .iter() + .all(|entry| entry.host_daemon_id == "epiphany-daemon-hands") + ); let error = publish_epiphany_cultmesh_provider_state( &store, diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 38717735..0084e07e 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -21,9 +21,9 @@ mod modeling_gateway; mod organ_dependencies; mod persona_memory_cache; mod persona_turn; +mod process_observation; mod promotion; mod prompt_context; -mod process_observation; mod proposal; mod retrieval; mod runtime_spine; @@ -221,8 +221,6 @@ pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_SCHEDULER_RECEIPT_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_LATEST_KEY; pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_SCHEMA_VERSION; pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_SERVICE_LIFECYCLE_RECEIPT_TYPE; -pub use cultmesh_integration::EPIPHANY_CULTMESH_MANAGED_SERVICE_POLICY_SCHEMA_VERSION; -pub use cultmesh_integration::EPIPHANY_CULTMESH_MANAGED_SERVICE_POLICY_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_STATUS_SCHEMA_VERSION; pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_STATUS_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_DAEMON_TOOL_CAPABILITY_SCHEMA_VERSION; @@ -259,6 +257,8 @@ pub use cultmesh_integration::EPIPHANY_CULTMESH_INTERNAL_TIER; pub use cultmesh_integration::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; pub use cultmesh_integration::EPIPHANY_CULTMESH_LOCAL_AREA_TIER; pub use cultmesh_integration::EPIPHANY_CULTMESH_LOCAL_AREA_VERSE_ID; +pub use cultmesh_integration::EPIPHANY_CULTMESH_MANAGED_SERVICE_POLICY_SCHEMA_VERSION; +pub use cultmesh_integration::EPIPHANY_CULTMESH_MANAGED_SERVICE_POLICY_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION; pub use cultmesh_integration::EPIPHANY_CULTMESH_MIND_CONTRACT_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_LATEST_KEY; @@ -329,7 +329,6 @@ pub use cultmesh_integration::EpiphanyCultMeshDaemonPokeReceiptEntry; pub use cultmesh_integration::EpiphanyCultMeshDaemonRestartPolicyEntry; pub use cultmesh_integration::EpiphanyCultMeshDaemonSchedulerReceiptEntry; pub use cultmesh_integration::EpiphanyCultMeshDaemonServiceLifecycleReceiptEntry; -pub use cultmesh_integration::EpiphanyCultMeshManagedServicePolicyEntry; pub use cultmesh_integration::EpiphanyCultMeshDaemonStatusEntry; pub use cultmesh_integration::EpiphanyCultMeshDaemonToolCapabilityEntry; pub use cultmesh_integration::EpiphanyCultMeshDaemonToolInvocationIntentEntry; @@ -345,6 +344,7 @@ pub use cultmesh_integration::EpiphanyCultMeshHandsContractEntry; pub use cultmesh_integration::EpiphanyCultMeshIdunnAftercareAuditReceiptEntry; pub use cultmesh_integration::EpiphanyCultMeshIdunnDeploymentReceiptEntry; pub use cultmesh_integration::EpiphanyCultMeshImaginationConsensusReceiptEntry; +pub use cultmesh_integration::EpiphanyCultMeshManagedServicePolicyEntry; pub use cultmesh_integration::EpiphanyCultMeshMindContractEntry; pub use cultmesh_integration::EpiphanyCultMeshOdinAdvertisementEntry; pub use cultmesh_integration::EpiphanyCultMeshOperatorRunIntentEntry; @@ -413,12 +413,12 @@ pub use cultmesh_integration::load_epiphany_cultmesh_daemon_liveness; pub use cultmesh_integration::load_epiphany_cultmesh_daemon_restart_policy; pub use cultmesh_integration::load_epiphany_cultmesh_daemon_restart_policy_directory; pub use cultmesh_integration::load_epiphany_cultmesh_daemon_service_lifecycle_receipts; -pub use cultmesh_integration::load_epiphany_cultmesh_managed_service_policy; -pub use cultmesh_integration::load_epiphany_cultmesh_managed_service_policies; pub use cultmesh_integration::load_epiphany_cultmesh_daemon_tool_directory; pub use cultmesh_integration::load_epiphany_cultmesh_eve_surface_directory; pub use cultmesh_integration::load_epiphany_cultmesh_idunn_aftercare_audit_receipt; pub use cultmesh_integration::load_epiphany_cultmesh_idunn_deployment_receipt; +pub use cultmesh_integration::load_epiphany_cultmesh_managed_service_policies; +pub use cultmesh_integration::load_epiphany_cultmesh_managed_service_policy; pub use cultmesh_integration::load_epiphany_cultmesh_operator_snapshot; pub use cultmesh_integration::load_epiphany_cultmesh_operator_status; pub use cultmesh_integration::load_epiphany_cultmesh_repo_work_map_entries; @@ -462,6 +462,7 @@ pub use cultmesh_integration::load_latest_epiphany_cultmesh_role_review_event; pub use cultmesh_integration::load_latest_epiphany_cultmesh_weksa_lowering_receipt; pub use cultmesh_integration::load_latest_epiphany_cultmesh_work_loop_telemetry; pub use cultmesh_integration::open_epiphany_cultmesh_node; +pub use cultmesh_integration::publish_epiphany_cultmesh_provider_state; pub use cultmesh_integration::query_epiphany_local_verse_context; pub use cultmesh_integration::seed_epiphany_local_verse_context; pub use cultmesh_integration::write_epiphany_cultmesh_agent_state_soa_summary; @@ -480,7 +481,6 @@ pub use cultmesh_integration::write_epiphany_cultmesh_daemon_poke_receipt; pub use cultmesh_integration::write_epiphany_cultmesh_daemon_restart_policy; pub use cultmesh_integration::write_epiphany_cultmesh_daemon_scheduler_receipt; pub use cultmesh_integration::write_epiphany_cultmesh_daemon_service_lifecycle_receipt; -pub use cultmesh_integration::write_epiphany_cultmesh_managed_service_policy; pub use cultmesh_integration::write_epiphany_cultmesh_daemon_status; pub use cultmesh_integration::write_epiphany_cultmesh_daemon_statuses; pub use cultmesh_integration::write_epiphany_cultmesh_daemon_tool_invocation_intent; @@ -494,7 +494,7 @@ pub use cultmesh_integration::write_epiphany_cultmesh_hands_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_idunn_aftercare_audit_receipt; pub use cultmesh_integration::write_epiphany_cultmesh_idunn_deployment_receipt; pub use cultmesh_integration::write_epiphany_cultmesh_imagination_consensus_receipt; -pub use cultmesh_integration::publish_epiphany_cultmesh_provider_state; +pub use cultmesh_integration::write_epiphany_cultmesh_managed_service_policy; pub use cultmesh_integration::write_epiphany_cultmesh_mind_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_operator_run_intent; pub use cultmesh_integration::write_epiphany_cultmesh_operator_run_receipt; @@ -668,8 +668,6 @@ pub use modeling_gateway::RepoWorkMapEntry; pub use modeling_gateway::RepoWorkModelingFinding; pub use modeling_gateway::RepoWorkModelingRequest; pub use modeling_gateway::RepoWorkModelingRoute; -pub use process_observation::EpiphanyProcessObservation; -pub use process_observation::observe_native_process; pub use organ_dependencies::EPIPHANY_LAUNCH_ORGAN_CONTRACT_SCHEMA_VERSION; pub use organ_dependencies::EPIPHANY_ORGAN_DEPENDENCY_SCHEMA_VERSION; pub use organ_dependencies::EPIPHANY_STANDING_ORGANS; @@ -715,6 +713,8 @@ pub use persona_turn::build_persona_turn_prompt; pub use persona_turn::persona_projected_surface_is_clean; pub use persona_turn::render_persona_semantic_memory_recall; pub use persona_turn::semantic_memory_recall_from_heartbeat_action; +pub use process_observation::EpiphanyProcessObservation; +pub use process_observation::observe_native_process; pub use promotion::EpiphanyPromotionDecision; pub use promotion::EpiphanyPromotionInput; pub use promotion::EpiphanyStateReplacementValidationInput; diff --git a/epiphany-core/src/prompt_context.rs b/epiphany-core/src/prompt_context.rs index f442c0d6..28972081 100644 --- a/epiphany-core/src/prompt_context.rs +++ b/epiphany-core/src/prompt_context.rs @@ -397,6 +397,8 @@ mod tests { use crate::epiphany_cultmesh_bifrost_github_publication_receipt_for_publication; use crate::epiphany_cultmesh_daemon_tool_invocation_intent_from_capability; use crate::epiphany_cultmesh_daemon_tool_invocation_receipt_for_intent; + use crate::load_epiphany_cultmesh_cluster_topology; + use crate::publish_epiphany_cultmesh_provider_state; use crate::query_epiphany_local_verse_context; use crate::seed_epiphany_local_verse_context; use crate::write_epiphany_cultmesh_agent_state_soa_summary; @@ -405,8 +407,6 @@ mod tests { use crate::write_epiphany_cultmesh_bifrost_github_publication_receipt; use crate::write_epiphany_cultmesh_daemon_tool_invocation_intent; use crate::write_epiphany_cultmesh_daemon_tool_invocation_receipt; - use crate::load_epiphany_cultmesh_cluster_topology; - use crate::publish_epiphany_cultmesh_provider_state; use crate::write_epiphany_cultmesh_work_loop_telemetry; use epiphany_state_model::EpiphanyMemoryContextPacket; use epiphany_state_model::EpiphanyMemoryFreshnessStatus; @@ -418,11 +418,7 @@ mod tests { let store = temp.path().join("epiphany-local-verse.ccmp"); seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-02T00:00:00Z")?; for cluster in load_epiphany_cultmesh_cluster_topology(&store, "epiphany-test")? { - publish_epiphany_cultmesh_provider_state( - &store, - "epiphany-test", - &cluster.daemon_id, - )?; + publish_epiphany_cultmesh_provider_state(&store, "epiphany-test", &cluster.daemon_id)?; } let seeded_verse = query_epiphany_local_verse_context(&store, "epiphany-test")?; let hands_action = seeded_verse diff --git a/notes/conceptual-substitution-audit-2026-07-12.md b/notes/conceptual-substitution-audit-2026-07-12.md index 4fac5925..318ad846 100644 --- a/notes/conceptual-substitution-audit-2026-07-12.md +++ b/notes/conceptual-substitution-audit-2026-07-12.md @@ -153,3 +153,19 @@ retain explicit fixture initialization, but it is isolated behind `seed_supervisor_smoke_fixture`, which refuses every store outside an `.epiphany-smoke` path before writing. Idunn consumes shared initialization; it does not own or repair it. + +## Query mutation/bootstrap split + +Ten requester/operator paths in `epiphany-verse-query` still invoked generic +bootstrap: swarm brake, single/batch daemon poke, daemon tool intent, Bifrost +body-change/public-proof/artifact/metrics requests, Persona collaboration +feedback, and Eve connection intent. A bounded requester could therefore create +shared policy, topology, contracts, brake defaults, and operator status merely +by submitting its own document. + +Only the explicit `seed`, `seed-compact`/`seed-only`, and quarantined `smoke` +paths may initialize the local Verse. Every other mutating query command passes +`require_query_bootstrap`, which reads persisted Epiphany status and topology +and refuses before store creation when either is absent. Requesters now write +into an existing body; they cannot manufacture the body as a side effect of +asking it for work. diff --git a/notes/epiphany-current-algorithmic-map.md b/notes/epiphany-current-algorithmic-map.md index 1e0bacb2..5e29a329 100644 --- a/notes/epiphany-current-algorithmic-map.md +++ b/notes/epiphany-current-algorithmic-map.md @@ -102,6 +102,10 @@ every production lifecycle, policy, scheduler, runbook, audit, status, and control path. Only its two synthetic audit-smoke commands may initialize fixtures, and only beneath `.epiphany-smoke`. +- In `epiphany-verse-query`, only explicit seed commands and the fixed + quarantined smoke initialize local Verse state. Every operator/requester + mutation requires persisted status and topology before writing its bounded + brake, poke, tool, Eve, Bifrost, metrics, artifact, or feedback document. - Store/runtime overrides fail before fixture seeding or receipt construction. - Negative proof: targeting `state/local-verse.ccmp` was rejected and its SHA-256 did not change. - Positive proof: the built-in quarantined smoke completes successfully and reports its quarantine coordinates. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 04d20ac8..2fea958a 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -27,6 +27,9 @@ The confirmed conceptual substitutions have been cut: - daemon-supervisor production commands likewise require persisted bootstrap and cannot create shared state. Its two audit-smoke fixture initializers are hard-confined beneath `.epiphany-smoke`. +- query-CLI requester/operator mutations also require persisted bootstrap. + Only explicit seed commands and the fixed aggregate smoke may initialize the + shared local Verse. The presentation boundary is now plain: `swarm overview` is a generic compact read-only projection. Gjallar is a downstream TUI application on Nightwing and is not an Epiphany organ, provider, owner, runtime, or architectural dependency. Eve/CultUI graphs may be lowered or composited downstream without Epiphany caring which presentation client does it. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 47af1a6d67cfc0f2ae65f7abc74d7922afd1a0c7..7884584e9393928c45ed9c75aee89873a3894ab7 100644 GIT binary patch delta 321 zcmY+8KTiTd5XHSiu8>&JkVs-Oi7nutXaQ7ob|%DF*e%PPY+!ef-8lst3kyPNaoG=` zfyTnb!f#+{;zzNub|@|0O!8*(dvEnsfBmk%?L|B7&e`ep=T@>_z8^%>D5^Xb@uG+$ z)@GMj+pO|O5hqVCA)F_><&&e%aXVChOZ%0pK5Bc5Lr^;O7D=r{Xu{7ru01%M=I9CC zq0P_Y delta 56 zcmZ2;QEJ&asST2hTt-%=7E#9-*p@MGR%R?@WaMg|%G5rUi4llFG&2yh05R+KsZ4AW GmjD3y%@IBT diff --git a/state/map.yaml b/state/map.yaml index 962fe2bd..153a8b71 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -70,7 +70,7 @@ data_flow: - move historical proof to git, commits, smoke artifacts, or distilled evidence rather than plan prose active_subgoals: - - Use `notes/conceptual-substitution-audit-2026-07-12.md` plus `notes/receipt-writer-provenance-audit-2026-07-12.md` as the current authority-corrosion maps. Snapshot promotion, synthetic smoke escape, unbound operator completion, hidden service execution flags, generic-bootstrap publication of provider advertisements/Eve surfaces/hosted tools, the central topology-derived Odin publisher, all-provider state writers, cluster-daemon bootstrap, and daemon-supervisor production bootstrap are cut. Provider absence survives bootstrap; the query CLI cannot proclaim seven providers active over RUDP; each cluster daemon writes only its own presence and pulse; Idunn production paths require shared initialization rather than repainting it; supervisor audit-smoke seeding is confined beneath `.epiphany-smoke`. Next remove or test-gate dead public receipt constructors where provider binaries are absent and audit remaining projections, caches, schedulers, adapters, and non-receipt smokes for borrowed authority or path escape. + - Use `notes/conceptual-substitution-audit-2026-07-12.md` plus `notes/receipt-writer-provenance-audit-2026-07-12.md` as the current authority-corrosion maps. Snapshot promotion, synthetic smoke escape, unbound operator completion, hidden service execution flags, generic-bootstrap publication of provider advertisements/Eve surfaces/hosted tools, the central topology-derived Odin publisher, all-provider state writers, cluster-daemon bootstrap, daemon-supervisor production bootstrap, and requester/operator query-side bootstrap are cut. Provider absence survives bootstrap; only explicit seed/fixture paths initialize; each cluster daemon writes its own presence and pulse; Idunn and requester paths require the shared body rather than repainting it; synthetic seeding is quarantined. Next remove or test-gate dead public receipt constructors where provider binaries are absent and audit remaining projections, caches, schedulers, adapters, and non-receipt smokes for borrowed authority or path escape. - `swarm-overview` is an Epiphany-local, renderer-neutral diagnostic projection over provider-owned typed state. It owns no lifecycle, discovery, composition, or mutation authority. Epiphany publishes clean provider-owned Eve surfaces; Odin may discover them; downstream lowerers and compositors remain outside Epiphany's concern. - Idunn owns daemon survival and service lifecycle physiology. Codex/operator sessions may inspect, generate runbooks, and route explicit operator authority, but keeping daemons alive belongs to Idunn-owned service lifecycle receipts, scheduler policy, audits, and aftercare. Do not let Self, diagnostic projections, or ad hoc wrapper summaries become a second daemon-keeper. Global tool readbacks for Self `service-health`, `service-policy-directory`, and `swarm-online-runbook` state `lifecycleOwner=Idunn` and `hostedBody=Epiphany` without service mutation or private-state exposure. - Use `notes/epiphany-cultmesh-dreaming-roadmap.md` as the design authority for distributed Epiphany dreaming. Public dreams are separately authored typed documents distributed through CultMesh/CultNet; private state remains local and cannot be shared by flipping a visibility flag. Foreign dreams are external thought weather until a reviewed local adoption receipt digests them into memory, planning, doctrine, or governance.