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 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-09-04 15:12:23 +02:00
commit 616a2c8e74
19 changed files with 68 additions and 87 deletions

View file

@ -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,
};

View file

@ -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,

View file

@ -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)

View file

@ -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;

View file

@ -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)
}

View file

@ -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};

View file

@ -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":[]}]}"#;

View file

@ -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,

View file

@ -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();

View file

@ -214,7 +214,6 @@ pub struct RepositoryBodyManifest {
pub entries: Vec<RepositoryBodyManifestEntry>,
}
#[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

View file

@ -954,5 +954,4 @@ mod tests {
value.observed_at_millis = 2_001;
assert_eq!(failures(&value), vec!["future-observation"]);
}
}

View file

@ -93,9 +93,7 @@ pub struct EpiphanyModeState {
pub kind: Option<EpiphanyModeKind>,
}
#[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<String>,
}
#[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]

View file

@ -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)
}

View file

@ -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."),

View file

@ -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;

View file

@ -21,20 +21,18 @@ pub struct EpiphanyRoleBoardLane {
pub fn derive_role_board(input: EpiphanyRoleBoardInput) -> Vec<EpiphanyRoleBoardLane> {
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

View file

@ -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 { .. }

View file

@ -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,

View file

@ -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<Value> {
pub fn execute_epiphany_source(intent: &EpiphanyToolInvocationIntent, cwd: &Path) -> Result<Value> {
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(())
}