From 616a2c8e7432ec7600000526af9ebcb0b3205b7e Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 4 Sep 2026 15:12:23 +0200 Subject: [PATCH] Finish the interrupted rustfmt pass The worktree had been sitting on a partial `cargo fmt` run: 15 files reflowed, mostly multi-line derive attributes collapsed onto one line, with no semantic change anywhere in the diff. It was never finished -- `cargo fmt --check` still flagged resident_readiness.rs, which the pass had not reached. Completed rather than reverted, since the formatting is what rustfmt produces and leaving it half-applied is the only bad option. 16 test binaries pass. Co-Authored-By: Claude Opus 5 --- .../src/bin/epiphany-repository-body.rs | 7 +++-- epiphany-core/src/coordinator_status.rs | 2 +- epiphany-core/src/cultmesh_integration.rs | 22 +++++++++++----- epiphany-core/src/lib.rs | 12 ++++----- epiphany-core/src/memory_graph/validation.rs | 4 +-- epiphany-core/src/mind_documents.rs | 8 +++--- epiphany-core/src/persona_turn.rs | 1 - epiphany-core/src/process_observation.rs | 4 +-- epiphany-core/src/repo_model_documents.rs | 10 ++++--- epiphany-core/src/repository_body_observer.rs | 5 ++-- epiphany-core/src/resident_readiness.rs | 1 - epiphany-core/src/state_model.rs | 16 +++--------- epiphany-core/src/substrate_gate.rs | 5 +--- .../src/surfaces/coordinator_decision.rs | 7 +++-- .../src/surfaces/research_decision.rs | 2 +- epiphany-core/src/surfaces/role_board.rs | 26 +++++++++---------- epiphany-tool-mcp-runtime/src/config.rs | 8 +++--- epiphany-tool-mcp-runtime/src/main.rs | 3 +-- .../src/native_source.rs | 12 +++------ 19 files changed, 68 insertions(+), 87 deletions(-) diff --git a/epiphany-core/src/bin/epiphany-repository-body.rs b/epiphany-core/src/bin/epiphany-repository-body.rs index 9b6bd8a3..e940ab75 100644 --- a/epiphany-core/src/bin/epiphany-repository-body.rs +++ b/epiphany-core/src/bin/epiphany-repository-body.rs @@ -2,10 +2,9 @@ use anyhow::{Result, bail}; use chrono::Utc; use epiphany_core::{ EpiphanyMemoryAnchor, EpiphanyMemoryDomain, EpiphanyMemoryLifecycle, EpiphanyMemoryNode, - EpiphanyMemoryNodeKind, EpiphanyRepoModelSeed, - EpiphanyRepoModelSeedDocuments, ObserveOutcome, RuntimeSpineInitOptions, - admit_repository_body_observation, bind_repository_body, bind_runtime_to_swarm, - initialize_keyed_repo_model, initialize_runtime_spine, + EpiphanyMemoryNodeKind, EpiphanyRepoModelSeed, EpiphanyRepoModelSeedDocuments, ObserveOutcome, + RuntimeSpineInitOptions, admit_repository_body_observation, bind_repository_body, + bind_runtime_to_swarm, initialize_keyed_repo_model, initialize_runtime_spine, load_current_runtime_repository_body_basis, load_repository_body_status, observe_repository_body, }; diff --git a/epiphany-core/src/coordinator_status.rs b/epiphany-core/src/coordinator_status.rs index 01fed8d7..a4faf243 100644 --- a/epiphany-core/src/coordinator_status.rs +++ b/epiphany-core/src/coordinator_status.rs @@ -1,9 +1,9 @@ -use anyhow::{Context, Result}; use crate::{ EpiphanyCoordinatorInput, EpiphanyCurrentWorkProjection, EpiphanyRoleBoardInput, RepoFrontierPlanningLifecycle, RepoFrontierPlanningLifecycleStage, RepoFrontierResearchLifecycle, RepoFrontierResearchLifecycleStage, derive_role_board, }; +use anyhow::{Context, Result}; use serde_json::{Value, json}; use std::{ env, diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index 290b1177..18254033 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -5,8 +5,7 @@ use cultmesh_rs::{CultMesh, CultMeshNode, CultMeshNodeOptions, cultmesh_document use std::path::Path; pub const EPIPHANY_CULTMESH_SWARM_BRAKE_TYPE: &str = "epiphany.cultmesh.swarm_brake"; -pub const EPIPHANY_CULTMESH_SWARM_BRAKE_SCHEMA_VERSION: &str = - "epiphany.cultmesh.swarm_brake.v0"; +pub const EPIPHANY_CULTMESH_SWARM_BRAKE_SCHEMA_VERSION: &str = "epiphany.cultmesh.swarm_brake.v0"; pub const EPIPHANY_CULTMESH_SWARM_BRAKE_KEY: &str = "epiphany-local/swarm-brake"; pub const EPIPHANY_CANONICAL_SWARM_BRAKE_ID: &str = "epiphany/swarm-brake"; pub const EPIPHANY_CANONICAL_SWARM_BRAKE_OWNER: &str = "epiphany.swarm-brake"; @@ -109,7 +108,9 @@ pub fn engage_epiphany_cultmesh_swarm_brake( return Err(anyhow!("swarm brake engagement requires an actor identity")); } if allow_engaged_adoption && actor_id != "Idunn" { - return Err(anyhow!("only Idunn may adopt an already-engaged legacy brake")); + return Err(anyhow!( + "only Idunn may adopt an already-engaged legacy brake" + )); } if let Some(current) = load_epiphany_cultmesh_swarm_brake(&store_path, runtime_id.clone())? { let foreign = current.brake_id != EPIPHANY_CANONICAL_SWARM_BRAKE_ID @@ -196,7 +197,9 @@ fn validate_swarm_brake(brake: &EpiphanyCultMeshSwarmBrakeEntry) -> Result<()> { || brake.runtime_id.trim().is_empty() || brake.created_at_utc.trim().is_empty() { - return Err(anyhow!("swarm brake identity, scope, runtime, and timestamp are required")); + return Err(anyhow!( + "swarm brake identity, scope, runtime, and timestamp are required" + )); } if !matches!(brake.status.as_str(), "released" | "engaged") { return Err(anyhow!("swarm brake status must be released or engaged")); @@ -206,7 +209,9 @@ fn validate_swarm_brake(brake: &EpiphanyCultMeshSwarmBrakeEntry) -> Result<()> { || brake.operator_agent_id.trim().is_empty() || (brake.affected_clusters.is_empty() && brake.protected_surfaces.is_empty())) { - return Err(anyhow!("engaged swarm brake requires operator id, reason, and scope")); + return Err(anyhow!( + "engaged swarm brake requires operator id, reason, and scope" + )); } Ok(()) } @@ -229,7 +234,12 @@ mod tests { )?; assert_eq!(engaged.status, "engaged"); assert_eq!(engaged.brake_id, EPIPHANY_CANONICAL_SWARM_BRAKE_ID); - assert!(engaged.protected_surfaces.iter().any(|value| value == "hands.consequence")); + assert!( + engaged + .protected_surfaces + .iter() + .any(|value| value == "hands.consequence") + ); assert_eq!( load_epiphany_cultmesh_swarm_brake(&store, "runtime")?, Some(engaged) diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 69b0f26b..30dac8b8 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -30,8 +30,8 @@ mod runtime_spine; mod runtime_store_backend; mod runtime_worker_attempt; mod soul_gateway; -mod state_model; mod state_ledger; +mod state_model; mod substrate_gate; mod surfaces; @@ -92,9 +92,8 @@ pub use cultmesh_integration::{ EPIPHANY_CULTMESH_SWARM_BRAKE_KEY, EPIPHANY_CULTMESH_SWARM_BRAKE_SCHEMA_VERSION, EPIPHANY_CULTMESH_SWARM_BRAKE_TYPE, EpiphanyCultMeshDocuments, EpiphanyCultMeshSwarmBrakeEntry, default_epiphany_cultmesh_swarm_brake, engage_epiphany_cultmesh_swarm_brake, - load_epiphany_cultmesh_swarm_brake, - open_epiphany_cultmesh_node, release_epiphany_cultmesh_swarm_brake, - write_epiphany_cultmesh_swarm_brake, + load_epiphany_cultmesh_swarm_brake, open_epiphany_cultmesh_node, + release_epiphany_cultmesh_swarm_brake, write_epiphany_cultmesh_swarm_brake, }; pub use current_work::*; @@ -104,8 +103,7 @@ pub use imagination_consideration::{ CANDIDATE_SCHEMA as IMAGINATION_CONSIDERATION_CANDIDATE_SCHEMA_VERSION, ImaginationConsiderationCandidate, ImaginationConsiderationDisposition, ImaginationConsiderationQuestion, ImaginationConsiderationRequest, - ImaginationConsiderationReviewRoute, - ImaginationOptionDraft, QuotedPersonaFeedbackEvidence, + ImaginationConsiderationReviewRoute, ImaginationOptionDraft, QuotedPersonaFeedbackEvidence, REQUEST_CONTRACT as IMAGINATION_CONSIDERATION_REQUEST_CONTRACT, REQUEST_SCHEMA as IMAGINATION_CONSIDERATION_REQUEST_SCHEMA_VERSION, candidate_id_for_launch as imagination_consideration_candidate_id_for_launch, @@ -262,7 +260,6 @@ pub use runtime_spine::terminalize_model_pass_failure_session; pub use runtime_spine::terminalize_runtime_job; pub(crate) use runtime_worker_attempt::{RuntimeTypedRequestRef, WorkerProcessStatus}; pub use soul_gateway::*; -pub use state_model::*; pub use state_ledger::EpiphanyBranchRecord; pub use state_ledger::EpiphanyLedgerEvidenceRecord; pub use state_ledger::EpiphanyStateLedgerEntry; @@ -270,6 +267,7 @@ pub use state_ledger::add_state_branch; pub use state_ledger::append_state_evidence; pub use state_ledger::close_state_branch; pub use state_ledger::load_state_ledger; +pub use state_model::*; pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION; pub use substrate_gate::SubstrateGateRepoAccessGrantReceipt; pub use substrate_gate::substrate_gate_coordinator_implementation_grant; diff --git a/epiphany-core/src/memory_graph/validation.rs b/epiphany-core/src/memory_graph/validation.rs index e064e708..40950c7e 100644 --- a/epiphany-core/src/memory_graph/validation.rs +++ b/epiphany-core/src/memory_graph/validation.rs @@ -22,9 +22,7 @@ pub(crate) fn repo_paths_are_canonical_and_safe(paths: &[String]) -> bool { }) } -pub(crate) fn frontier_item_has_routeable_repository_scope( - item: &crate::RepoFrontierItem, -) -> bool { +pub(crate) fn frontier_item_has_routeable_repository_scope(item: &crate::RepoFrontierItem) -> bool { !item.repository_scope.is_empty() && repo_paths_are_canonical_and_safe(&item.repository_scope) } diff --git a/epiphany-core/src/mind_documents.rs b/epiphany-core/src/mind_documents.rs index 2d3839a5..6c5ccc2c 100644 --- a/epiphany-core/src/mind_documents.rs +++ b/epiphany-core/src/mind_documents.rs @@ -1,11 +1,11 @@ use std::path::Path; +use crate::state_model::{ + EpiphanyEvidenceRecord, EpiphanyInvariant, EpiphanyInvestigationCheckpoint, EpiphanyModeState, + EpiphanyObservation, EpiphanySubgoal, +}; use anyhow::{Result, anyhow}; use cultcache_rs::{CultCache, CultCacheEnvelope, DatabaseEntry}; -use crate::state_model::{ - EpiphanyEvidenceRecord, EpiphanyInvariant, EpiphanyInvestigationCheckpoint, - EpiphanyModeState, EpiphanyObservation, EpiphanySubgoal, -}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; diff --git a/epiphany-core/src/persona_turn.rs b/epiphany-core/src/persona_turn.rs index df2c2085..a697e144 100644 --- a/epiphany-core/src/persona_turn.rs +++ b/epiphany-core/src/persona_turn.rs @@ -572,7 +572,6 @@ fn fallback<'a>(value: &'a str, fallback: &'a str) -> &'a str { mod tests { use super::*; - #[test] fn typed_interpreter_effects_reject_channel_escape_and_mixed_drop() { let valid = r#"{"schemaVersion":"epiphany.persona_interpreter_effect_set.v0","effects":[{"kind":"state_note","memory_kind":"memory","summary":"The operator expects a native conversational nerve."},{"kind":"say","channel_id":"aquarium","content":"The nerve is live.","speech_act":"status","register":"concise","safety_notes":[]}]}"#; diff --git a/epiphany-core/src/process_observation.rs b/epiphany-core/src/process_observation.rs index 7503f977..728d40fc 100644 --- a/epiphany-core/src/process_observation.rs +++ b/epiphany-core/src/process_observation.rs @@ -109,8 +109,8 @@ mod platform { use chrono::{DateTime, SecondsFormat, Utc}; use std::os::windows::ffi::OsStringExt; use windows_sys::Win32::Foundation::{ - CloseHandle, ERROR_ACCESS_DENIED, ERROR_NO_MORE_FILES, FILETIME, - GetLastError, INVALID_HANDLE_VALUE, WAIT_FAILED, WAIT_OBJECT_0, WAIT_TIMEOUT, + CloseHandle, ERROR_ACCESS_DENIED, ERROR_NO_MORE_FILES, FILETIME, GetLastError, + INVALID_HANDLE_VALUE, WAIT_FAILED, WAIT_OBJECT_0, WAIT_TIMEOUT, }; use windows_sys::Win32::System::Diagnostics::ToolHelp::{ CreateToolhelp32Snapshot, PROCESSENTRY32W, Process32FirstW, Process32NextW, diff --git a/epiphany-core/src/repo_model_documents.rs b/epiphany-core/src/repo_model_documents.rs index ba47407c..ab8f7ad8 100644 --- a/epiphany-core/src/repo_model_documents.rs +++ b/epiphany-core/src/repo_model_documents.rs @@ -1,12 +1,12 @@ use std::collections::{BTreeMap, BTreeSet}; use std::path::Path; -use anyhow::{Result, anyhow}; -use cultcache_rs::{CultCache, CultCacheEnvelope, DatabaseEntry}; use crate::state_model::{ EpiphanyMemoryDomain, EpiphanyMemoryEdge, EpiphanyMemoryGraphSnapshot, EpiphanyMemoryNode, RepoFrontierItem, }; +use anyhow::{Result, anyhow}; +use cultcache_rs::{CultCache, CultCacheEnvelope, DatabaseEntry}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -1532,10 +1532,10 @@ fn validate_claim_obligations( #[cfg(test)] mod tests { use super::*; - use crate::{RuntimeSpineInitOptions, initialize_runtime_spine}; use crate::state_model::{ EpiphanyMemoryEdgeKind, EpiphanyMemoryLifecycle, EpiphanyMemoryNodeKind, RepoFrontierStatus, }; + use crate::{RuntimeSpineInitOptions, initialize_runtime_spine}; fn bind_test_body( store: &Path, @@ -2243,7 +2243,9 @@ mod tests { && source.document_key == offer_id.to_string() })); cache.pull_all_backing_stores()?; - offer_view.reasoning_basis().validate_against_cache(&cache)?; + offer_view + .reasoning_basis() + .validate_against_cache(&cache)?; let eve = crate::AtlasRepositoryIdentity::new("gamecult-local", "eve")?; let eve_surface = uuid::Uuid::new_v4(); diff --git a/epiphany-core/src/repository_body_observer.rs b/epiphany-core/src/repository_body_observer.rs index 27fcb370..9f406fba 100644 --- a/epiphany-core/src/repository_body_observer.rs +++ b/epiphany-core/src/repository_body_observer.rs @@ -214,7 +214,6 @@ pub struct RepositoryBodyManifest { pub entries: Vec, } - #[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)] #[cultcache(type = "epiphany.repository_body.head", schema = "RepositoryBodyHead")] pub struct RepositoryBodyHead { @@ -331,7 +330,7 @@ pub fn admit_repository_body_observation( BODY_OBSERVATION_TYPE, &basis.observation_id, ) - .ok_or_else(|| anyhow!("repository Body observation source is absent"))?; + .ok_or_else(|| anyhow!("repository Body observation source is absent"))?; let source_observation = crate::EpiphanyMindDocumentVersion::from_envelope("epiphany-repository-body", source)?; let document = crate::EpiphanyMindRepositoryBodyObservationDocument { @@ -1356,7 +1355,7 @@ fn validate_runtime_binding_entries( EpiphanyRuntimeSwarmBinding::TYPE, RUNTIME_SWARM_BINDING_KEY, ) - .ok_or_else(|| anyhow!("runtime store has no immutable swarm binding"))?, + .ok_or_else(|| anyhow!("runtime store has no immutable swarm binding"))?, )?; if binding.schema_version != RUNTIME_SWARM_BINDING_SCHEMA_VERSION || binding.binding_id != RUNTIME_SWARM_BINDING_KEY diff --git a/epiphany-core/src/resident_readiness.rs b/epiphany-core/src/resident_readiness.rs index fae352bd..4e48704c 100644 --- a/epiphany-core/src/resident_readiness.rs +++ b/epiphany-core/src/resident_readiness.rs @@ -954,5 +954,4 @@ mod tests { value.observed_at_millis = 2_001; assert_eq!(failures(&value), vec!["future-observation"]); } - } diff --git a/epiphany-core/src/state_model.rs b/epiphany-core/src/state_model.rs index 6f19b1a4..356811a3 100644 --- a/epiphany-core/src/state_model.rs +++ b/epiphany-core/src/state_model.rs @@ -93,9 +93,7 @@ pub struct EpiphanyModeState { pub kind: Option, } -#[derive( - Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default, -)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default)] #[serde(rename_all = "snake_case")] pub enum EpiphanyModeKind { Plan, @@ -205,9 +203,7 @@ pub struct EpiphanyMemoryDomain { pub lifecycle: EpiphanyMemoryLifecycle, } -#[derive( - Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default, -)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default)] #[serde(rename_all = "snake_case")] pub enum EpiphanyMemoryLifecycle { #[default] @@ -218,9 +214,7 @@ pub enum EpiphanyMemoryLifecycle { Stale, } -#[derive( - Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default, -)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default)] #[serde(rename_all = "snake_case")] pub enum EpiphanyMemoryNodeKind { #[default] @@ -259,9 +253,7 @@ pub struct EpiphanyMemoryNode { pub updated_at: Option, } -#[derive( - Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default, -)] +#[derive(Serialize, Deserialize, Clone, Copy, Debug, PartialEq, Eq, Hash, Default)] #[serde(rename_all = "snake_case")] pub enum EpiphanyMemoryEdgeKind { #[default] diff --git a/epiphany-core/src/substrate_gate.rs b/epiphany-core/src/substrate_gate.rs index 7892a007..1217db80 100644 --- a/epiphany-core/src/substrate_gate.rs +++ b/epiphany-core/src/substrate_gate.rs @@ -69,10 +69,7 @@ pub fn substrate_gate_operation_for_governed_tool( tool_name: &str, ) -> Option<&'static str> { match (server, tool_name) { - ( - "epiphany_source", - "read_file" | "directory_inventory" | "git_show", - ) + ("epiphany_source", "read_file" | "directory_inventory" | "git_show") | ("epiphany_state", "resident_grant_lifecycle") => { Some(SUBSTRATE_GATE_SOURCE_READ_OPERATION) } diff --git a/epiphany-core/src/surfaces/coordinator_decision.rs b/epiphany-core/src/surfaces/coordinator_decision.rs index 6b852009..15b4aa38 100644 --- a/epiphany-core/src/surfaces/coordinator_decision.rs +++ b/epiphany-core/src/surfaces/coordinator_decision.rs @@ -134,10 +134,9 @@ fn continuation_decision( launch, &format!("The exact {label} obligation has no live attempt."), ), - EpiphanyAgentPassContinuationAction::Wait => decision( - wait, - &format!("The exact {label} attempt is still live."), - ), + EpiphanyAgentPassContinuationAction::Wait => { + decision(wait, &format!("The exact {label} attempt is still live.")) + } EpiphanyAgentPassContinuationAction::Review => decision( review, &format!("The exact {label} result awaits its family admission owner."), diff --git a/epiphany-core/src/surfaces/research_decision.rs b/epiphany-core/src/surfaces/research_decision.rs index 119c1d07..e562044e 100644 --- a/epiphany-core/src/surfaces/research_decision.rs +++ b/epiphany-core/src/surfaces/research_decision.rs @@ -1,7 +1,7 @@ -use anyhow::{Result, anyhow}; use crate::state_model::EpiphanyEvidenceRecord; use crate::state_model::EpiphanyInvestigationCheckpoint; use crate::state_model::EpiphanyObservation; +use anyhow::{Result, anyhow}; use serde::{Deserialize, Serialize}; use std::collections::BTreeSet; diff --git a/epiphany-core/src/surfaces/role_board.rs b/epiphany-core/src/surfaces/role_board.rs index d0d3cb59..80d2fa9a 100644 --- a/epiphany-core/src/surfaces/role_board.rs +++ b/epiphany-core/src/surfaces/role_board.rs @@ -21,20 +21,18 @@ pub struct EpiphanyRoleBoardLane { pub fn derive_role_board(input: EpiphanyRoleBoardInput) -> Vec { let missing = !input.mind_present; - let lane = |title: &str, status, note: &str| { - EpiphanyRoleBoardLane { - title: title.into(), - status: if missing { - EpiphanyCoordinatorRoleStatus::Blocked - } else { - status - }, - note: if missing { - "Canonical keyed Mind is missing.".into() - } else { - note.into() - }, - } + let lane = |title: &str, status, note: &str| EpiphanyRoleBoardLane { + title: title.into(), + status: if missing { + EpiphanyCoordinatorRoleStatus::Blocked + } else { + status + }, + note: if missing { + "Canonical keyed Mind is missing.".into() + } else { + note.into() + }, }; let modeling_action = input diff --git a/epiphany-tool-mcp-runtime/src/config.rs b/epiphany-tool-mcp-runtime/src/config.rs index d1f29e93..b7171e9f 100644 --- a/epiphany-tool-mcp-runtime/src/config.rs +++ b/epiphany-tool-mcp-runtime/src/config.rs @@ -198,9 +198,8 @@ mod tests { #[test] fn parses_only_the_owned_stdio_and_http_subset() -> Result<()> { - let config = McpRuntimeConfig::from_toml( - &format!( - r#" + let config = McpRuntimeConfig::from_toml(&format!( + r#" [mcp_servers.local] command = "{ABSOLUTE_COMMAND}" args = ["--stdio"] @@ -211,8 +210,7 @@ url = "https://example.test/mcp" bearer_token_env_var = "MCP_TOKEN" tool_timeout_sec = 4 "# - ), - )?; + ))?; assert!(matches!( config.server("local")?.transport, McpTransportConfig::Stdio { .. } diff --git a/epiphany-tool-mcp-runtime/src/main.rs b/epiphany-tool-mcp-runtime/src/main.rs index d748e402..72b6f54c 100644 --- a/epiphany-tool-mcp-runtime/src/main.rs +++ b/epiphany-tool-mcp-runtime/src/main.rs @@ -353,8 +353,7 @@ mod tests { private_state_exposed: false, }, )?; - let grant = epiphany_core::issue_resident_self_grant(&resident_store, 2)? - .expect("grant"); + let grant = epiphany_core::issue_resident_self_grant(&resident_store, 2)?.expect("grant"); let intent = EpiphanyToolInvocationIntent::new( "native-state-read", EPIPHANY_TOOL_RUNTIME_ADAPTER_ID, diff --git a/epiphany-tool-mcp-runtime/src/native_source.rs b/epiphany-tool-mcp-runtime/src/native_source.rs index 42bfaecf..59f7ca90 100644 --- a/epiphany-tool-mcp-runtime/src/native_source.rs +++ b/epiphany-tool-mcp-runtime/src/native_source.rs @@ -7,10 +7,7 @@ use std::path::{Path, PathBuf}; use std::process::{Command, Stdio}; use std::thread; -pub fn execute_epiphany_source( - intent: &EpiphanyToolInvocationIntent, - cwd: &Path, -) -> Result { +pub fn execute_epiphany_source(intent: &EpiphanyToolInvocationIntent, cwd: &Path) -> Result { let arguments: Value = serde_json::from_str(&intent.arguments_json).context("arguments_json is not valid JSON")?; if !arguments.is_object() { @@ -292,11 +289,8 @@ mod tests { )?; assert_eq!(value["content"], "2: two\n3: three"); assert!( - execute_epiphany_source( - &intent("read_file", r#"{"path":"../escape"}"#), - dir.path() - ) - .is_err() + execute_epiphany_source(&intent("read_file", r#"{"path":"../escape"}"#), dir.path()) + .is_err() ); Ok(()) }