From 25fc7b5ab488792a6cfb4c85db5e737094302966 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 27 May 2026 16:00:41 +0100 Subject: [PATCH] Add Hands Soul and Life contracts --- .../src/bin/epiphany-cultmesh-smoke.rs | 6 + epiphany-core/src/cultmesh_integration.rs | 259 ++++++++++++++++ epiphany-core/src/hands_gateway.rs | 158 ++++++++++ epiphany-core/src/lib.rs | 21 ++ epiphany-core/src/life_gateway.rs | 140 +++++++++ epiphany-core/src/runtime_spine.rs | 283 ++++++++++++++++++ epiphany-core/src/soul_gateway.rs | 140 +++++++++ notes/epiphany-fork-implementation-plan.md | 1 + notes/fresh-workspace-handoff.md | 23 +- notes/hands-cultnet-contracts.md | 44 +++ notes/life-cultnet-contracts.md | 42 +++ notes/perfect-machine-audit-roadmap.md | 38 ++- notes/soul-cultnet-contracts.md | 42 +++ state/ledgers.msgpack | Bin 152267 -> 152513 bytes state/map.yaml | 6 +- 15 files changed, 1180 insertions(+), 23 deletions(-) create mode 100644 epiphany-core/src/hands_gateway.rs create mode 100644 epiphany-core/src/life_gateway.rs create mode 100644 epiphany-core/src/soul_gateway.rs create mode 100644 notes/hands-cultnet-contracts.md create mode 100644 notes/life-cultnet-contracts.md create mode 100644 notes/soul-cultnet-contracts.md diff --git a/epiphany-core/src/bin/epiphany-cultmesh-smoke.rs b/epiphany-core/src/bin/epiphany-cultmesh-smoke.rs index 7bab20ef..9f138819 100644 --- a/epiphany-core/src/bin/epiphany-cultmesh-smoke.rs +++ b/epiphany-core/src/bin/epiphany-cultmesh-smoke.rs @@ -7,7 +7,10 @@ use epiphany_core::load_epiphany_cultmesh_status; use epiphany_core::write_epiphany_cultmesh_body_contracts; use epiphany_core::write_epiphany_cultmesh_eyes_contracts; use epiphany_core::write_epiphany_cultmesh_global_room_policies; +use epiphany_core::write_epiphany_cultmesh_hands_contracts; +use epiphany_core::write_epiphany_cultmesh_life_contracts; use epiphany_core::write_epiphany_cultmesh_mind_contracts; +use epiphany_core::write_epiphany_cultmesh_soul_contracts; use epiphany_core::write_epiphany_cultmesh_status; use epiphany_core::write_epiphany_cultmesh_verse_policies; use std::path::PathBuf; @@ -33,6 +36,9 @@ fn main() -> Result<()> { write_epiphany_cultmesh_mind_contracts(&store, "epiphany-cultmesh-smoke")?; write_epiphany_cultmesh_body_contracts(&store, "epiphany-cultmesh-smoke")?; write_epiphany_cultmesh_eyes_contracts(&store, "epiphany-cultmesh-smoke")?; + write_epiphany_cultmesh_hands_contracts(&store, "epiphany-cultmesh-smoke")?; + write_epiphany_cultmesh_soul_contracts(&store, "epiphany-cultmesh-smoke")?; + write_epiphany_cultmesh_life_contracts(&store, "epiphany-cultmesh-smoke")?; let loaded = load_epiphany_cultmesh_status(&store, "epiphany-cultmesh-smoke")?; if loaded != Some(status) { anyhow::bail!("CultMesh smoke failed to round-trip Epiphany status document"); diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index 7d5773e3..8d3d1a98 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -1,6 +1,9 @@ use crate::default_body_cultnet_contracts; use crate::default_eyes_cultnet_contracts; +use crate::default_hands_cultnet_contracts; +use crate::default_life_cultnet_contracts; use crate::default_mind_cultnet_contracts; +use crate::default_soul_cultnet_contracts; use anyhow::Result; use cultcache_rs::DatabaseEntry; use cultmesh_rs::CultMesh; @@ -26,6 +29,15 @@ pub const EPIPHANY_CULTMESH_BODY_CONTRACT_SCHEMA_VERSION: &str = pub const EPIPHANY_CULTMESH_EYES_CONTRACT_TYPE: &str = "epiphany.cultmesh.eyes_contract"; pub const EPIPHANY_CULTMESH_EYES_CONTRACT_SCHEMA_VERSION: &str = "epiphany.cultmesh.eyes_contract.v0"; +pub const EPIPHANY_CULTMESH_HANDS_CONTRACT_TYPE: &str = "epiphany.cultmesh.hands_contract"; +pub const EPIPHANY_CULTMESH_HANDS_CONTRACT_SCHEMA_VERSION: &str = + "epiphany.cultmesh.hands_contract.v0"; +pub const EPIPHANY_CULTMESH_SOUL_CONTRACT_TYPE: &str = "epiphany.cultmesh.soul_contract"; +pub const EPIPHANY_CULTMESH_SOUL_CONTRACT_SCHEMA_VERSION: &str = + "epiphany.cultmesh.soul_contract.v0"; +pub const EPIPHANY_CULTMESH_LIFE_CONTRACT_TYPE: &str = "epiphany.cultmesh.life_contract"; +pub const EPIPHANY_CULTMESH_LIFE_CONTRACT_SCHEMA_VERSION: &str = + "epiphany.cultmesh.life_contract.v0"; pub const EPIPHANY_CULTMESH_INTERNAL_VERSE_ID: &str = "epiphany-internal"; pub const EPIPHANY_CULTMESH_LOCAL_AREA_VERSE_ID: &str = "gamecult-local"; pub const EPIPHANY_CULTMESH_GLOBAL_VERSE_ID: &str = "epiphany-global"; @@ -189,6 +201,90 @@ pub struct EpiphanyCultMeshEyesContractEntry { pub notes: Vec, } +#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)] +#[cultcache( + type = "epiphany.cultmesh.hands_contract", + schema = "EpiphanyCultMeshHandsContractEntry" +)] +pub struct EpiphanyCultMeshHandsContractEntry { + #[cultcache(key = 0)] + pub schema_version: String, + #[cultcache(key = 1)] + pub contract_id: String, + #[cultcache(key = 2)] + pub verse_id: String, + #[cultcache(key = 3)] + pub document_type: String, + #[cultcache(key = 4)] + pub payload_schema_version: String, + #[cultcache(key = 5)] + pub authority: String, + #[cultcache(key = 6)] + pub operations: Vec, + #[cultcache(key = 7)] + pub intent_document_types: Vec, + #[cultcache(key = 8)] + pub receipt_document_types: Vec, + #[cultcache(key = 9)] + pub notes: Vec, +} + +#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)] +#[cultcache( + type = "epiphany.cultmesh.soul_contract", + schema = "EpiphanyCultMeshSoulContractEntry" +)] +pub struct EpiphanyCultMeshSoulContractEntry { + #[cultcache(key = 0)] + pub schema_version: String, + #[cultcache(key = 1)] + pub contract_id: String, + #[cultcache(key = 2)] + pub verse_id: String, + #[cultcache(key = 3)] + pub document_type: String, + #[cultcache(key = 4)] + pub payload_schema_version: String, + #[cultcache(key = 5)] + pub authority: String, + #[cultcache(key = 6)] + pub operations: Vec, + #[cultcache(key = 7)] + pub intent_document_types: Vec, + #[cultcache(key = 8)] + pub receipt_document_types: Vec, + #[cultcache(key = 9)] + pub notes: Vec, +} + +#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)] +#[cultcache( + type = "epiphany.cultmesh.life_contract", + schema = "EpiphanyCultMeshLifeContractEntry" +)] +pub struct EpiphanyCultMeshLifeContractEntry { + #[cultcache(key = 0)] + pub schema_version: String, + #[cultcache(key = 1)] + pub contract_id: String, + #[cultcache(key = 2)] + pub verse_id: String, + #[cultcache(key = 3)] + pub document_type: String, + #[cultcache(key = 4)] + pub payload_schema_version: String, + #[cultcache(key = 5)] + pub authority: String, + #[cultcache(key = 6)] + pub operations: Vec, + #[cultcache(key = 7)] + pub intent_document_types: Vec, + #[cultcache(key = 8)] + pub receipt_document_types: Vec, + #[cultcache(key = 9)] + pub notes: Vec, +} + cultmesh_documents!(EpiphanyCultMeshDocuments { EpiphanyCultMeshStatusEntry => EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION, EpiphanyCultMeshVersePolicyEntry => EPIPHANY_CULTMESH_VERSE_POLICY_SCHEMA_VERSION, @@ -196,6 +292,9 @@ cultmesh_documents!(EpiphanyCultMeshDocuments { EpiphanyCultMeshMindContractEntry => EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION, EpiphanyCultMeshBodyContractEntry => EPIPHANY_CULTMESH_BODY_CONTRACT_SCHEMA_VERSION, EpiphanyCultMeshEyesContractEntry => EPIPHANY_CULTMESH_EYES_CONTRACT_SCHEMA_VERSION, + EpiphanyCultMeshHandsContractEntry => EPIPHANY_CULTMESH_HANDS_CONTRACT_SCHEMA_VERSION, + EpiphanyCultMeshSoulContractEntry => EPIPHANY_CULTMESH_SOUL_CONTRACT_SCHEMA_VERSION, + EpiphanyCultMeshLifeContractEntry => EPIPHANY_CULTMESH_LIFE_CONTRACT_SCHEMA_VERSION, }); pub fn open_epiphany_cultmesh_node( @@ -437,6 +536,99 @@ pub fn write_epiphany_cultmesh_eyes_contracts( Ok(written) } +pub fn epiphany_cultmesh_hands_contracts() -> Vec { + default_hands_cultnet_contracts() + .into_iter() + .map(|contract| EpiphanyCultMeshHandsContractEntry { + schema_version: EPIPHANY_CULTMESH_HANDS_CONTRACT_SCHEMA_VERSION.to_string(), + contract_id: contract.contract_id, + verse_id: contract.verse_id, + document_type: contract.document_type, + payload_schema_version: contract.payload_schema_version, + authority: contract.authority, + operations: contract.operations, + intent_document_types: contract.intent_document_types, + receipt_document_types: contract.receipt_document_types, + notes: contract.notes, + }) + .collect() +} + +pub fn write_epiphany_cultmesh_hands_contracts( + store_path: impl AsRef, + runtime_id: impl Into, +) -> Result> { + let mut node = open_epiphany_cultmesh_node(store_path, runtime_id)?; + let mut written = Vec::new(); + for contract in epiphany_cultmesh_hands_contracts() { + written.push(node.put(contract.contract_id.clone(), &contract)?); + } + node.flush()?; + Ok(written) +} + +pub fn epiphany_cultmesh_soul_contracts() -> Vec { + default_soul_cultnet_contracts() + .into_iter() + .map(|contract| EpiphanyCultMeshSoulContractEntry { + schema_version: EPIPHANY_CULTMESH_SOUL_CONTRACT_SCHEMA_VERSION.to_string(), + contract_id: contract.contract_id, + verse_id: contract.verse_id, + document_type: contract.document_type, + payload_schema_version: contract.payload_schema_version, + authority: contract.authority, + operations: contract.operations, + intent_document_types: contract.intent_document_types, + receipt_document_types: contract.receipt_document_types, + notes: contract.notes, + }) + .collect() +} + +pub fn write_epiphany_cultmesh_soul_contracts( + store_path: impl AsRef, + runtime_id: impl Into, +) -> Result> { + let mut node = open_epiphany_cultmesh_node(store_path, runtime_id)?; + let mut written = Vec::new(); + for contract in epiphany_cultmesh_soul_contracts() { + written.push(node.put(contract.contract_id.clone(), &contract)?); + } + node.flush()?; + Ok(written) +} + +pub fn epiphany_cultmesh_life_contracts() -> Vec { + default_life_cultnet_contracts() + .into_iter() + .map(|contract| EpiphanyCultMeshLifeContractEntry { + schema_version: EPIPHANY_CULTMESH_LIFE_CONTRACT_SCHEMA_VERSION.to_string(), + contract_id: contract.contract_id, + verse_id: contract.verse_id, + document_type: contract.document_type, + payload_schema_version: contract.payload_schema_version, + authority: contract.authority, + operations: contract.operations, + intent_document_types: contract.intent_document_types, + receipt_document_types: contract.receipt_document_types, + notes: contract.notes, + }) + .collect() +} + +pub fn write_epiphany_cultmesh_life_contracts( + store_path: impl AsRef, + runtime_id: impl Into, +) -> Result> { + let mut node = open_epiphany_cultmesh_node(store_path, runtime_id)?; + let mut written = Vec::new(); + for contract in epiphany_cultmesh_life_contracts() { + written.push(node.put(contract.contract_id.clone(), &contract)?); + } + node.flush()?; + Ok(written) +} + #[cfg(test)] mod tests { use super::*; @@ -588,4 +780,71 @@ mod tests { ); Ok(()) } + + #[test] + fn hands_contracts_use_verses_to_keep_action_guarded() -> Result<()> { + let temp = tempfile::tempdir()?; + let store = temp.path().join("epiphany-hands-contracts.ccmp"); + let written = write_epiphany_cultmesh_hands_contracts(&store, "epiphany-test")?; + assert!(written.len() >= 5); + + let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?; + let action = node + .get_required::("epiphany.hands.action.review")?; + + assert_eq!(action.verse_id, EPIPHANY_CULTMESH_INTERNAL_VERSE_ID); + assert_eq!(action.authority, "hands"); + assert!( + action + .notes + .iter() + .any(|note| note.contains("action organ")) + ); + Ok(()) + } + + #[test] + fn soul_contracts_use_verses_to_keep_verification_guarded() -> Result<()> { + let temp = tempfile::tempdir()?; + let store = temp.path().join("epiphany-soul-contracts.ccmp"); + let written = write_epiphany_cultmesh_soul_contracts(&store, "epiphany-test")?; + assert!(written.len() >= 5); + + let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?; + let verification = node.get_required::( + "epiphany.soul.verification.review", + )?; + + assert_eq!(verification.verse_id, EPIPHANY_CULTMESH_INTERNAL_VERSE_ID); + assert_eq!(verification.authority, "soul"); + assert!( + verification + .notes + .iter() + .any(|note| note.contains("verification organ")) + ); + Ok(()) + } + + #[test] + fn life_contracts_use_verses_to_keep_continuity_guarded() -> Result<()> { + let temp = tempfile::tempdir()?; + let store = temp.path().join("epiphany-life-contracts.ccmp"); + let written = write_epiphany_cultmesh_life_contracts(&store, "epiphany-test")?; + assert!(written.len() >= 5); + + let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?; + let continuity = node + .get_required::("epiphany.life.continuity.review")?; + + assert_eq!(continuity.verse_id, EPIPHANY_CULTMESH_INTERNAL_VERSE_ID); + assert_eq!(continuity.authority, "life"); + assert!( + continuity + .notes + .iter() + .any(|note| note.contains("continuity organ")) + ); + Ok(()) + } } diff --git a/epiphany-core/src/hands_gateway.rs b/epiphany-core/src/hands_gateway.rs new file mode 100644 index 00000000..3a4977fe --- /dev/null +++ b/epiphany-core/src/hands_gateway.rs @@ -0,0 +1,158 @@ +use serde::Deserialize; +use serde::Serialize; + +pub const HANDS_ACTION_INTENT_TYPE: &str = "epiphany.hands.action_intent"; +pub const HANDS_ACTION_REVIEW_TYPE: &str = "epiphany.hands.action_review"; +pub const HANDS_COMMAND_RECEIPT_TYPE: &str = "epiphany.hands.command_receipt"; +pub const HANDS_PATCH_RECEIPT_TYPE: &str = "epiphany.hands.patch_receipt"; +pub const HANDS_COMMIT_RECEIPT_TYPE: &str = "epiphany.hands.commit_receipt"; +pub const HANDS_PR_RECEIPT_TYPE: &str = "epiphany.hands.pr_receipt"; +pub const HANDS_ROLLBACK_RECEIPT_TYPE: &str = "epiphany.hands.rollback_receipt"; +pub const HANDS_ACTION_REFUSAL_RECEIPT_TYPE: &str = "epiphany.hands.action_refusal_receipt"; +pub const HANDS_ACTION_INTENT_SCHEMA_VERSION: &str = "epiphany.hands.action_intent.v0"; +pub const HANDS_ACTION_REVIEW_SCHEMA_VERSION: &str = "epiphany.hands.action_review.v0"; +pub const HANDS_COMMAND_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.command_receipt.v0"; +pub const HANDS_PATCH_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.patch_receipt.v0"; +pub const HANDS_COMMIT_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.commit_receipt.v0"; +pub const HANDS_PR_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.pr_receipt.v0"; +pub const HANDS_ROLLBACK_RECEIPT_SCHEMA_VERSION: &str = "epiphany.hands.rollback_receipt.v0"; +pub const HANDS_ACTION_REFUSAL_RECEIPT_SCHEMA_VERSION: &str = + "epiphany.hands.action_refusal_receipt.v0"; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct HandsCultNetContract { + pub contract_id: String, + pub verse_id: String, + pub document_type: String, + pub payload_schema_version: String, + pub authority: String, + pub operations: Vec, + pub intent_document_types: Vec, + pub receipt_document_types: Vec, + pub notes: Vec, +} + +pub fn default_hands_cultnet_contracts() -> Vec { + vec![ + HandsCultNetContract { + contract_id: "epiphany.hands.action.review".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: HANDS_ACTION_INTENT_TYPE.to_string(), + payload_schema_version: HANDS_ACTION_INTENT_SCHEMA_VERSION.to_string(), + authority: "hands".to_string(), + operations: vec![ + "intentSubmit".to_string(), + "receiptWatch".to_string(), + "snapshot".to_string(), + ], + intent_document_types: vec![HANDS_ACTION_INTENT_TYPE.to_string()], + receipt_document_types: vec![ + HANDS_ACTION_REVIEW_TYPE.to_string(), + HANDS_COMMAND_RECEIPT_TYPE.to_string(), + HANDS_PATCH_RECEIPT_TYPE.to_string(), + HANDS_COMMIT_RECEIPT_TYPE.to_string(), + HANDS_PR_RECEIPT_TYPE.to_string(), + HANDS_ROLLBACK_RECEIPT_TYPE.to_string(), + HANDS_ACTION_REFUSAL_RECEIPT_TYPE.to_string(), + ], + notes: vec![ + "Hands is the action organ: commands, patches, commits, PRs, and rollbacks enter here as bounded action intents.".to_string(), + "Hands does not grant repo access; Body grants substrate access before Hands mutates, and Soul verifies the result after.".to_string(), + ], + }, + HandsCultNetContract { + contract_id: "epiphany.hands.action.review_receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: HANDS_ACTION_REVIEW_TYPE.to_string(), + payload_schema_version: HANDS_ACTION_REVIEW_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Hands reviews explain what action was allowed, refused, sequenced, or delegated after Body access was checked.".to_string(), + ], + }, + HandsCultNetContract { + contract_id: "epiphany.hands.command.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: HANDS_COMMAND_RECEIPT_TYPE.to_string(), + payload_schema_version: HANDS_COMMAND_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Command receipts prove what command ran, under which Body grant, and where output artifacts live.".to_string(), + ], + }, + HandsCultNetContract { + contract_id: "epiphany.hands.patch.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: HANDS_PATCH_RECEIPT_TYPE.to_string(), + payload_schema_version: HANDS_PATCH_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Patch receipts prove which files changed and which Body grant made the edit legal.".to_string(), + ], + }, + HandsCultNetContract { + contract_id: "epiphany.hands.commit_and_pr.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: HANDS_COMMIT_RECEIPT_TYPE.to_string(), + payload_schema_version: HANDS_COMMIT_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: vec![HANDS_PR_RECEIPT_TYPE.to_string()], + notes: vec![ + "Commit and PR receipts preserve publication consequences after Soul verification and operator policy allow them.".to_string(), + ], + }, + HandsCultNetContract { + contract_id: "epiphany.hands.rollback.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: HANDS_ROLLBACK_RECEIPT_TYPE.to_string(), + payload_schema_version: HANDS_ROLLBACK_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Rollback receipts prove a failed or refused action was unwound instead of hidden by later convergence.".to_string(), + ], + }, + ] +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn hands_contracts_make_internal_verse_the_action_gate() { + let contracts = default_hands_cultnet_contracts(); + let action = contracts + .iter() + .find(|contract| contract.contract_id == "epiphany.hands.action.review") + .expect("hands action review contract"); + + assert_eq!(action.verse_id, "epiphany-internal"); + assert_eq!(action.authority, "hands"); + assert!( + action + .notes + .iter() + .any(|note| note.contains("action organ")) + ); + assert!( + action + .receipt_document_types + .contains(&HANDS_PATCH_RECEIPT_TYPE.to_string()) + ); + } +} diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 74f5fd35..9009dab6 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -5,7 +5,9 @@ mod cultmesh_integration; mod distillation; mod eyes_gateway; mod face_turn; +mod hands_gateway; mod heartbeat_state; +mod life_gateway; mod memory_graph; mod mind_gateway; mod organ_dependencies; @@ -13,6 +15,7 @@ mod promotion; mod proposal; mod retrieval; mod runtime_spine; +mod soul_gateway; mod state_ledger; mod state_update; mod surfaces; @@ -84,12 +87,18 @@ pub use cultmesh_integration::EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_SCHEMA_VERSIO pub use cultmesh_integration::EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_GLOBAL_TIER; pub use cultmesh_integration::EPIPHANY_CULTMESH_GLOBAL_VERSE_ID; +pub use cultmesh_integration::EPIPHANY_CULTMESH_HANDS_CONTRACT_SCHEMA_VERSION; +pub use cultmesh_integration::EPIPHANY_CULTMESH_HANDS_CONTRACT_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_INTERNAL_TIER; pub use cultmesh_integration::EPIPHANY_CULTMESH_INTERNAL_VERSE_ID; +pub use cultmesh_integration::EPIPHANY_CULTMESH_LIFE_CONTRACT_SCHEMA_VERSION; +pub use cultmesh_integration::EPIPHANY_CULTMESH_LIFE_CONTRACT_TYPE; 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_MIND_CONTRACT_SCHEMA_VERSION; pub use cultmesh_integration::EPIPHANY_CULTMESH_MIND_CONTRACT_TYPE; +pub use cultmesh_integration::EPIPHANY_CULTMESH_SOUL_CONTRACT_SCHEMA_VERSION; +pub use cultmesh_integration::EPIPHANY_CULTMESH_SOUL_CONTRACT_TYPE; pub use cultmesh_integration::EPIPHANY_CULTMESH_STATUS_KEY; pub use cultmesh_integration::EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION; pub use cultmesh_integration::EPIPHANY_CULTMESH_STATUS_TYPE; @@ -99,20 +108,29 @@ pub use cultmesh_integration::EpiphanyCultMeshBodyContractEntry; pub use cultmesh_integration::EpiphanyCultMeshDocuments; pub use cultmesh_integration::EpiphanyCultMeshEyesContractEntry; pub use cultmesh_integration::EpiphanyCultMeshGlobalRoomPolicyEntry; +pub use cultmesh_integration::EpiphanyCultMeshHandsContractEntry; +pub use cultmesh_integration::EpiphanyCultMeshLifeContractEntry; pub use cultmesh_integration::EpiphanyCultMeshMindContractEntry; +pub use cultmesh_integration::EpiphanyCultMeshSoulContractEntry; pub use cultmesh_integration::EpiphanyCultMeshStatusEntry; pub use cultmesh_integration::EpiphanyCultMeshVersePolicyEntry; pub use cultmesh_integration::epiphany_cultmesh_body_contracts; pub use cultmesh_integration::epiphany_cultmesh_eyes_contracts; pub use cultmesh_integration::epiphany_cultmesh_global_room_policies; +pub use cultmesh_integration::epiphany_cultmesh_hands_contracts; +pub use cultmesh_integration::epiphany_cultmesh_life_contracts; pub use cultmesh_integration::epiphany_cultmesh_mind_contracts; +pub use cultmesh_integration::epiphany_cultmesh_soul_contracts; pub use cultmesh_integration::epiphany_cultmesh_verse_policies; pub use cultmesh_integration::load_epiphany_cultmesh_status; pub use cultmesh_integration::open_epiphany_cultmesh_node; pub use cultmesh_integration::write_epiphany_cultmesh_body_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_eyes_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_global_room_policies; +pub use cultmesh_integration::write_epiphany_cultmesh_hands_contracts; +pub use cultmesh_integration::write_epiphany_cultmesh_life_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_mind_contracts; +pub use cultmesh_integration::write_epiphany_cultmesh_soul_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_status; pub use cultmesh_integration::write_epiphany_cultmesh_verse_policies; pub use distillation::EpiphanyDistillInput; @@ -157,6 +175,7 @@ pub use face_turn::build_face_interpreter_prompt; pub use face_turn::build_face_projector_prompt; pub use face_turn::build_face_turn_prompt; pub use face_turn::face_projected_surface_is_clean; +pub use hands_gateway::*; pub use heartbeat_state::EpiphanyHeartbeatCognitionEntry; pub use heartbeat_state::EpiphanyHeartbeatStateEntry; pub use heartbeat_state::GhostlightSceneParticipantSeed; @@ -208,6 +227,7 @@ pub use heartbeat_state::validate_heartbeat_cognition; pub use heartbeat_state::validate_heartbeat_state; pub use heartbeat_state::write_heartbeat_cognition_entry; pub use heartbeat_state::write_heartbeat_state_entry; +pub use life_gateway::*; pub use memory_graph::EpiphanyMemoryEdgeKind; pub use memory_graph::EpiphanyMemoryEmbeddingManifest; pub use memory_graph::EpiphanyMemoryGraphEntry; @@ -341,6 +361,7 @@ pub use runtime_spine::runtime_spine_cache; pub use runtime_spine::runtime_spine_status; pub use runtime_spine::write_runtime_hello_frame; pub use runtime_spine::write_runtime_schema_catalog_json; +pub use soul_gateway::*; pub use state_ledger::EpiphanyBranchRecord; pub use state_ledger::EpiphanyLedgerEvidenceRecord; pub use state_ledger::EpiphanyStateLedgerEntry; diff --git a/epiphany-core/src/life_gateway.rs b/epiphany-core/src/life_gateway.rs new file mode 100644 index 00000000..f85c1419 --- /dev/null +++ b/epiphany-core/src/life_gateway.rs @@ -0,0 +1,140 @@ +use serde::Deserialize; +use serde::Serialize; + +pub const LIFE_CONTINUITY_PACKET_TYPE: &str = "epiphany.life.continuity_packet"; +pub const LIFE_COMPACTION_CHECKPOINT_TYPE: &str = "epiphany.life.compaction_checkpoint"; +pub const LIFE_SLEEP_DISTILLATION_TYPE: &str = "epiphany.life.sleep_distillation"; +pub const LIFE_RECOVERY_RECEIPT_TYPE: &str = "epiphany.life.recovery_receipt"; +pub const LIFE_STALE_TURN_REPAIR_TYPE: &str = "epiphany.life.stale_turn_repair"; +pub const LIFE_CONTINUITY_REFUSAL_RECEIPT_TYPE: &str = "epiphany.life.continuity_refusal_receipt"; +pub const LIFE_CONTINUITY_PACKET_SCHEMA_VERSION: &str = "epiphany.life.continuity_packet.v0"; +pub const LIFE_COMPACTION_CHECKPOINT_SCHEMA_VERSION: &str = + "epiphany.life.compaction_checkpoint.v0"; +pub const LIFE_SLEEP_DISTILLATION_SCHEMA_VERSION: &str = "epiphany.life.sleep_distillation.v0"; +pub const LIFE_RECOVERY_RECEIPT_SCHEMA_VERSION: &str = "epiphany.life.recovery_receipt.v0"; +pub const LIFE_STALE_TURN_REPAIR_SCHEMA_VERSION: &str = "epiphany.life.stale_turn_repair.v0"; +pub const LIFE_CONTINUITY_REFUSAL_RECEIPT_SCHEMA_VERSION: &str = + "epiphany.life.continuity_refusal_receipt.v0"; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct LifeCultNetContract { + pub contract_id: String, + pub verse_id: String, + pub document_type: String, + pub payload_schema_version: String, + pub authority: String, + pub operations: Vec, + pub intent_document_types: Vec, + pub receipt_document_types: Vec, + pub notes: Vec, +} + +pub fn default_life_cultnet_contracts() -> Vec { + vec![ + LifeCultNetContract { + contract_id: "epiphany.life.continuity.review".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: LIFE_CONTINUITY_PACKET_TYPE.to_string(), + payload_schema_version: LIFE_CONTINUITY_PACKET_SCHEMA_VERSION.to_string(), + authority: "life".to_string(), + operations: vec![ + "intentSubmit".to_string(), + "receiptWatch".to_string(), + "snapshot".to_string(), + ], + intent_document_types: vec![LIFE_CONTINUITY_PACKET_TYPE.to_string()], + receipt_document_types: vec![ + LIFE_COMPACTION_CHECKPOINT_TYPE.to_string(), + LIFE_SLEEP_DISTILLATION_TYPE.to_string(), + LIFE_RECOVERY_RECEIPT_TYPE.to_string(), + LIFE_STALE_TURN_REPAIR_TYPE.to_string(), + LIFE_CONTINUITY_REFUSAL_RECEIPT_TYPE.to_string(), + ], + notes: vec![ + "Life is the continuity organ: compaction, sleep, recovery, stale-turn repair, and handoff packets enter here.".to_string(), + "Life preserves what survives rupture; Mind decides which continuity material becomes durable state.".to_string(), + ], + }, + LifeCultNetContract { + contract_id: "epiphany.life.compaction_checkpoint.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: LIFE_COMPACTION_CHECKPOINT_TYPE.to_string(), + payload_schema_version: LIFE_COMPACTION_CHECKPOINT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Compaction checkpoints preserve the hot lesson before context rupture, not after the blackout has already eaten it.".to_string(), + ], + }, + LifeCultNetContract { + contract_id: "epiphany.life.sleep_distillation.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: LIFE_SLEEP_DISTILLATION_TYPE.to_string(), + payload_schema_version: LIFE_SLEEP_DISTILLATION_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Sleep distillation receipts separate durable lessons from rumination residue before Mind adoption.".to_string(), + ], + }, + LifeCultNetContract { + contract_id: "epiphany.life.recovery.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: LIFE_RECOVERY_RECEIPT_TYPE.to_string(), + payload_schema_version: LIFE_RECOVERY_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Recovery receipts explain what survived, what was rehydrated, and what must be regathered instead of imagined.".to_string(), + ], + }, + LifeCultNetContract { + contract_id: "epiphany.life.stale_turn_repair.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: LIFE_STALE_TURN_REPAIR_TYPE.to_string(), + payload_schema_version: LIFE_STALE_TURN_REPAIR_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Stale-turn repair receipts close or recover abandoned work without pretending the old turn completed cleanly.".to_string(), + ], + }, + ] +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn life_contracts_make_internal_verse_the_continuity_gate() { + let contracts = default_life_cultnet_contracts(); + let continuity = contracts + .iter() + .find(|contract| contract.contract_id == "epiphany.life.continuity.review") + .expect("life continuity review contract"); + + assert_eq!(continuity.verse_id, "epiphany-internal"); + assert_eq!(continuity.authority, "life"); + assert!( + continuity + .notes + .iter() + .any(|note| note.contains("continuity organ")) + ); + assert!( + continuity + .receipt_document_types + .contains(&LIFE_RECOVERY_RECEIPT_TYPE.to_string()) + ); + } +} diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index c3f477d2..1b8c3f2a 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -22,8 +22,10 @@ use crate::eyes_gateway::EYES_EVIDENCE_REVIEW_SCHEMA_VERSION; use crate::eyes_gateway::EYES_EVIDENCE_REVIEW_TYPE; use crate::eyes_gateway::EYES_SOURCE_LOOKUP_RECEIPT_SCHEMA_VERSION; use crate::eyes_gateway::EYES_SOURCE_LOOKUP_RECEIPT_TYPE; +use crate::hands_gateway::*; use crate::heartbeat_state::HEARTBEAT_STATE_SCHEMA_VERSION; use crate::heartbeat_state::HEARTBEAT_STATE_TYPE; +use crate::life_gateway::*; use crate::memory_graph::MEMORY_GRAPH_SCHEMA_VERSION; use crate::memory_graph::MEMORY_GRAPH_TYPE; use crate::mind_gateway::MIND_GATEWAY_REVIEW_SCHEMA_VERSION; @@ -38,6 +40,7 @@ use crate::mind_gateway::MIND_THOUGHT_SCHEMA_VERSION; use crate::mind_gateway::MIND_THOUGHT_TYPE; use crate::mind_gateway::MIND_VERSE_ADOPTION_RECEIPT_SCHEMA_VERSION; use crate::mind_gateway::MIND_VERSE_ADOPTION_RECEIPT_TYPE; +use crate::soul_gateway::*; use crate::state_ledger::STATE_LEDGER_SCHEMA_VERSION; use crate::state_ledger::STATE_LEDGER_STORE_TYPE; use crate::thread_state_store::THREAD_STATE_SCHEMA_VERSION; @@ -1706,6 +1709,286 @@ fn epiphany_mutation_contracts() -> Vec { vec![], vec!["Evidence refusal receipts preserve why Eyes would not certify a claim."], ), + mutation_contract( + HANDS_ACTION_INTENT_TYPE, + HANDS_ACTION_INTENT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::IntentSubmit, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::Coordinator, + vec![HANDS_ACTION_INTENT_TYPE], + vec![ + HANDS_ACTION_REVIEW_TYPE, + HANDS_COMMAND_RECEIPT_TYPE, + HANDS_PATCH_RECEIPT_TYPE, + HANDS_COMMIT_RECEIPT_TYPE, + HANDS_PR_RECEIPT_TYPE, + HANDS_ROLLBACK_RECEIPT_TYPE, + HANDS_ACTION_REFUSAL_RECEIPT_TYPE, + ], + vec![ + "Hands is the action organ: commands, patches, commits, PRs, and rollbacks enter as bounded action intents.", + "Body grants substrate access before Hands mutates; Soul verifies consequences after.", + ], + ), + mutation_contract( + HANDS_ACTION_REVIEW_TYPE, + HANDS_ACTION_REVIEW_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Hands reviews explain allowed, refused, sequenced, or delegated action."], + ), + mutation_contract( + HANDS_COMMAND_RECEIPT_TYPE, + HANDS_COMMAND_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Command receipts prove what command ran and under which Body grant."], + ), + mutation_contract( + HANDS_PATCH_RECEIPT_TYPE, + HANDS_PATCH_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Patch receipts prove file mutations and the scoped grant that permitted them."], + ), + mutation_contract( + HANDS_COMMIT_RECEIPT_TYPE, + HANDS_COMMIT_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![HANDS_PR_RECEIPT_TYPE], + vec!["Commit receipts preserve publication consequences after verification."], + ), + mutation_contract( + HANDS_PR_RECEIPT_TYPE, + HANDS_PR_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["PR receipts preserve outward publication consequences for operator review."], + ), + mutation_contract( + HANDS_ROLLBACK_RECEIPT_TYPE, + HANDS_ROLLBACK_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Rollback receipts prove failed action was unwound instead of hidden."], + ), + mutation_contract( + HANDS_ACTION_REFUSAL_RECEIPT_TYPE, + HANDS_ACTION_REFUSAL_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Hands refusal receipts preserve why an action intent was denied."], + ), + mutation_contract( + SOUL_VERIFICATION_REQUEST_TYPE, + SOUL_VERIFICATION_REQUEST_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::IntentSubmit, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::Coordinator, + vec![SOUL_VERIFICATION_REQUEST_TYPE], + vec![ + SOUL_INVARIANT_CHECK_TYPE, + SOUL_VERDICT_RECEIPT_TYPE, + SOUL_REGRESSION_RECEIPT_TYPE, + SOUL_REVIEW_RECEIPT_TYPE, + SOUL_VERIFICATION_REFUSAL_RECEIPT_TYPE, + ], + vec![ + "Soul is the verification organ: invariants, tests, review, falsification, and refusal enter here.", + "Soul verdicts inform Mind admission; they do not mutate repo or state by themselves.", + ], + ), + mutation_contract( + SOUL_INVARIANT_CHECK_TYPE, + SOUL_INVARIANT_CHECK_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec![ + "Invariant checks identify which promise was tested and whether old paths can still violate it.", + ], + ), + mutation_contract( + SOUL_VERDICT_RECEIPT_TYPE, + SOUL_VERDICT_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Verdict receipts are proof of sanctity or proof of failure."], + ), + mutation_contract( + SOUL_REGRESSION_RECEIPT_TYPE, + SOUL_REGRESSION_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec![ + "Regression receipts preserve violated invariants and surviving obsolete authorities.", + ], + ), + mutation_contract( + SOUL_REVIEW_RECEIPT_TYPE, + SOUL_REVIEW_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Review receipts preserve risks, missing tests, and falsification notes."], + ), + mutation_contract( + SOUL_VERIFICATION_REFUSAL_RECEIPT_TYPE, + SOUL_VERIFICATION_REFUSAL_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec![ + "Soul refusal receipts preserve why a verification request could not honestly be performed.", + ], + ), + mutation_contract( + LIFE_CONTINUITY_PACKET_TYPE, + LIFE_CONTINUITY_PACKET_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::IntentSubmit, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::Coordinator, + vec![LIFE_CONTINUITY_PACKET_TYPE], + vec![ + LIFE_COMPACTION_CHECKPOINT_TYPE, + LIFE_SLEEP_DISTILLATION_TYPE, + LIFE_RECOVERY_RECEIPT_TYPE, + LIFE_STALE_TURN_REPAIR_TYPE, + LIFE_CONTINUITY_REFUSAL_RECEIPT_TYPE, + ], + vec![ + "Life is the continuity organ: compaction, sleep, recovery, stale-turn repair, and handoff packets enter here.", + "Life preserves survival across rupture; Mind admits durable state.", + ], + ), + mutation_contract( + LIFE_COMPACTION_CHECKPOINT_TYPE, + LIFE_COMPACTION_CHECKPOINT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Compaction checkpoints preserve hot context before rupture."], + ), + mutation_contract( + LIFE_SLEEP_DISTILLATION_TYPE, + LIFE_SLEEP_DISTILLATION_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Sleep distillation receipts separate durable lessons from rumination residue."], + ), + mutation_contract( + LIFE_RECOVERY_RECEIPT_TYPE, + LIFE_RECOVERY_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Recovery receipts explain what survived and what must be regathered."], + ), + mutation_contract( + LIFE_STALE_TURN_REPAIR_TYPE, + LIFE_STALE_TURN_REPAIR_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec![ + "Stale-turn repair receipts close abandoned work without pretending it completed.", + ], + ), + mutation_contract( + LIFE_CONTINUITY_REFUSAL_RECEIPT_TYPE, + LIFE_CONTINUITY_REFUSAL_RECEIPT_SCHEMA_VERSION, + vec![ + CultNetDocumentOperation::Snapshot, + CultNetDocumentOperation::ReceiptWatch, + ], + CultNetMutationAuthority::ReadOnly, + vec![], + vec![], + vec!["Life refusal receipts preserve why a continuity packet could not be trusted."], + ), mutation_contract( RUNTIME_EVENT_TYPE, RUNTIME_SPINE_SCHEMA_VERSION, diff --git a/epiphany-core/src/soul_gateway.rs b/epiphany-core/src/soul_gateway.rs new file mode 100644 index 00000000..3e7ae6bf --- /dev/null +++ b/epiphany-core/src/soul_gateway.rs @@ -0,0 +1,140 @@ +use serde::Deserialize; +use serde::Serialize; + +pub const SOUL_VERIFICATION_REQUEST_TYPE: &str = "epiphany.soul.verification_request"; +pub const SOUL_INVARIANT_CHECK_TYPE: &str = "epiphany.soul.invariant_check"; +pub const SOUL_VERDICT_RECEIPT_TYPE: &str = "epiphany.soul.verdict_receipt"; +pub const SOUL_REGRESSION_RECEIPT_TYPE: &str = "epiphany.soul.regression_receipt"; +pub const SOUL_REVIEW_RECEIPT_TYPE: &str = "epiphany.soul.review_receipt"; +pub const SOUL_VERIFICATION_REFUSAL_RECEIPT_TYPE: &str = + "epiphany.soul.verification_refusal_receipt"; +pub const SOUL_VERIFICATION_REQUEST_SCHEMA_VERSION: &str = "epiphany.soul.verification_request.v0"; +pub const SOUL_INVARIANT_CHECK_SCHEMA_VERSION: &str = "epiphany.soul.invariant_check.v0"; +pub const SOUL_VERDICT_RECEIPT_SCHEMA_VERSION: &str = "epiphany.soul.verdict_receipt.v0"; +pub const SOUL_REGRESSION_RECEIPT_SCHEMA_VERSION: &str = "epiphany.soul.regression_receipt.v0"; +pub const SOUL_REVIEW_RECEIPT_SCHEMA_VERSION: &str = "epiphany.soul.review_receipt.v0"; +pub const SOUL_VERIFICATION_REFUSAL_RECEIPT_SCHEMA_VERSION: &str = + "epiphany.soul.verification_refusal_receipt.v0"; + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct SoulCultNetContract { + pub contract_id: String, + pub verse_id: String, + pub document_type: String, + pub payload_schema_version: String, + pub authority: String, + pub operations: Vec, + pub intent_document_types: Vec, + pub receipt_document_types: Vec, + pub notes: Vec, +} + +pub fn default_soul_cultnet_contracts() -> Vec { + vec![ + SoulCultNetContract { + contract_id: "epiphany.soul.verification.review".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: SOUL_VERIFICATION_REQUEST_TYPE.to_string(), + payload_schema_version: SOUL_VERIFICATION_REQUEST_SCHEMA_VERSION.to_string(), + authority: "soul".to_string(), + operations: vec![ + "intentSubmit".to_string(), + "receiptWatch".to_string(), + "snapshot".to_string(), + ], + intent_document_types: vec![SOUL_VERIFICATION_REQUEST_TYPE.to_string()], + receipt_document_types: vec![ + SOUL_INVARIANT_CHECK_TYPE.to_string(), + SOUL_VERDICT_RECEIPT_TYPE.to_string(), + SOUL_REGRESSION_RECEIPT_TYPE.to_string(), + SOUL_REVIEW_RECEIPT_TYPE.to_string(), + SOUL_VERIFICATION_REFUSAL_RECEIPT_TYPE.to_string(), + ], + notes: vec![ + "Soul is the verification organ: invariants, tests, review, falsification, and refusal enter here.".to_string(), + "Soul does not mutate state or repo by itself; Hands acts, Eyes grounds evidence, and Mind admits durable state after Soul's verdict.".to_string(), + ], + }, + SoulCultNetContract { + contract_id: "epiphany.soul.invariant_check.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: SOUL_INVARIANT_CHECK_TYPE.to_string(), + payload_schema_version: SOUL_INVARIANT_CHECK_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Invariant checks say which promise was tested, at which layer, and whether the old path can still violate it.".to_string(), + ], + }, + SoulCultNetContract { + contract_id: "epiphany.soul.verdict.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: SOUL_VERDICT_RECEIPT_TYPE.to_string(), + payload_schema_version: SOUL_VERDICT_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Verdict receipts are proof of sanctity or proof of failure; they are not cosmetic test summaries.".to_string(), + ], + }, + SoulCultNetContract { + contract_id: "epiphany.soul.regression.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: SOUL_REGRESSION_RECEIPT_TYPE.to_string(), + payload_schema_version: SOUL_REGRESSION_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Regression receipts preserve violated invariants and the old state path that still had authority.".to_string(), + ], + }, + SoulCultNetContract { + contract_id: "epiphany.soul.review.receipts".to_string(), + verse_id: "epiphany-internal".to_string(), + document_type: SOUL_REVIEW_RECEIPT_TYPE.to_string(), + payload_schema_version: SOUL_REVIEW_RECEIPT_SCHEMA_VERSION.to_string(), + authority: "readOnly".to_string(), + operations: vec!["snapshot".to_string(), "receiptWatch".to_string()], + intent_document_types: Vec::new(), + receipt_document_types: Vec::new(), + notes: vec![ + "Review receipts preserve risks, missing tests, and falsification notes for Mind before state admission.".to_string(), + ], + }, + ] +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn soul_contracts_make_internal_verse_the_verification_gate() { + let contracts = default_soul_cultnet_contracts(); + let verification = contracts + .iter() + .find(|contract| contract.contract_id == "epiphany.soul.verification.review") + .expect("soul verification review contract"); + + assert_eq!(verification.verse_id, "epiphany-internal"); + assert_eq!(verification.authority, "soul"); + assert!( + verification + .notes + .iter() + .any(|note| note.contains("verification organ")) + ); + assert!( + verification + .receipt_document_types + .contains(&SOUL_VERDICT_RECEIPT_TYPE.to_string()) + ); + } +} diff --git a/notes/epiphany-fork-implementation-plan.md b/notes/epiphany-fork-implementation-plan.md index a3281d7d..cdfc441f 100644 --- a/notes/epiphany-fork-implementation-plan.md +++ b/notes/epiphany-fork-implementation-plan.md @@ -86,6 +86,7 @@ The landed machine now has: - first auditable Phase 6 fixed-lane coordinator runner through native `epiphany-mvp-coordinator`, producing coordinator summary, JSONL steps, rendered snapshots, transcript, stderr, runtime-spine status, native runtime job/result receipts for launched work, and final next-action artifacts while keeping semantic findings review-gated by default - first Codex-independent native runtime vertebra through `epiphany-runtime-spine`, storing runtime identity, sessions, jobs, job results, and events as typed CultCache MessagePack documents, opening/completing native jobs, projecting job-result counts, and emitting a framed CultNet hello message for the native contract - first Rust CultMesh local-node integration: `vendor/cultmesh-rs` now provides the repo-contained CultMesh surface over vendored CultCache/CultNet, and `epiphany-core` depends on that surface for local `EpiphanyCultMeshStatusEntry`, `EpiphanyCultMeshVersePolicyEntry`, and `EpiphanyCultMeshGlobalRoomPolicyEntry` round-trip smokes instead of treating raw CultNet as the ergonomic app-facing database layer +- first Hands/Soul/Life contract catalogs: action, verification, and continuity now have native `epiphany-core` contract families, runtime-spine advertisement, CultMesh policy documents, and local CultMesh smoke coverage beside Mind/Body/Eyes - live-specialist runner must be rebuilt around heartbeat/runtime-spine result receipts - first Phase 6 Aquarium operator shell extracted to sibling repo `E:\Projects\EpiphanyAquarium`, a Tauri v2 + React/WebGL client over the existing status bridge, dogfood artifacts, and GUI action artifacts, with its own distilled interface state/memory/doctrine plus durable checkpoint preparation, bounded status/coordinator artifact buttons, fixed modeling/verification/reorient launch and read-back buttons, and explicit review-gated reorient acceptance - first Unity editor/runtime bridge through native `epiphany-unity-bridge`, native `epiphany-unity-bridge-smoke`, and the GUI Inspect Unity action, resolving exact project-pinned editors and writing runtime artifacts while refusing wrong or missing versions diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 580b0e84..aab5bab7 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1415,15 +1415,24 @@ grounding. Body can grant access to the repo, but Eyes decides what was actually looked at and emits evidence reviews, source lookup receipts, evidence packets, or refusals before Imagination, Hands, Mind, Face, Soul, Self, Body, or Life cite the material as known. +`notes/hands-cultnet-contracts.md`, `notes/soul-cultnet-contracts.md`, and +`notes/life-cultnet-contracts.md` are now the missing action, verification, and +continuity gates. The code surface now names Hands action intents/reviews plus +command, patch, commit, PR, rollback, and refusal receipts; Soul verification +requests plus invariant, verdict, regression, review, and refusal receipts; and +Life continuity packets plus compaction, sleep distillation, recovery, +stale-turn repair, and continuity refusal receipts. Runtime-spine advertises +those contracts, CultMesh stores matching Verse-scoped policy docs, and the +local CultMesh smoke writes them beside Mind/Body/Eyes. `notes/perfect-machine-audit-roadmap.md` is the current audit/path document. It compares Epiphany's named organ contracts against Void's current Face prompting shape and maps the route from contract catalog to executable organism. Main -finding: the boundaries are directionally right, but Mind/Body/Eyes are still -mostly advertised gates rather than mandatory runtime receipt chains; Hands, -Soul, and Life need their own contract families. The first dependency-body -repair is landed: the missing `E:\Projects\CultLib\crates\*` paths were replaced -with repo-contained vendored CultCache/CultNet/CultMesh crates, and the -`epiphany-core` library tests pass against that body. +finding: the boundaries are directionally right, but the organ contracts are +still mostly advertised gates rather than mandatory runtime receipt chains. The +first dependency-body repair is landed: the missing +`E:\Projects\CultLib\crates\*` paths were replaced with repo-contained vendored +CultCache/CultNet/CultMesh crates, and the `epiphany-core` library tests pass +against that body. ## Not Yet @@ -1436,7 +1445,7 @@ with repo-contained vendored CultCache/CultNet/CultMesh crates, and the - broader editor/runtime bridges beyond the first pinned Unity bridge - broad event stream beyond the landed state update notification - typed repetitive-work queues plus final-answer gates, so batch/tile/import/migration work cannot end merely because the pattern was demonstrated or the partial result sounds tidy -- public CultMesh Verse deployment or cross-app live sharing; only the local Rust CultMesh node/status smoke exists so far +- public CultMesh Verse deployment or cross-app live sharing; only the local Rust CultMesh node/status/contract smoke exists so far The machine is no longer cleared to move outward. Free it from the Codex organ first. diff --git a/notes/hands-cultnet-contracts.md b/notes/hands-cultnet-contracts.md new file mode 100644 index 00000000..0a2ff2e3 --- /dev/null +++ b/notes/hands-cultnet-contracts.md @@ -0,0 +1,44 @@ +# Hands CultNet Contracts + +Objective: make Hands the action organ. Commands, patches, commits, PRs, and +rollbacks are consequences, not thoughts. They enter as bounded action intents +and leave receipts that can be verified, refused, or admitted into Mind state. + +## Authority Map + +- Owner: Hands owns execution of bounded actions. +- Inputs: typed action intents, Body access grants, requested commands or + patches, current repo policy, Soul verification requirements, and coordinator + authority. +- Outputs: Hands action reviews, command receipts, patch receipts, commit + receipts, PR receipts, rollback receipts, and action refusal receipts. +- Derived state: diffs, command logs, commits, PR URLs, and rollback notes are + action receipts. They are not durable Mind state until Mind admits them. +- Forbidden writers: raw workers, Face, Eyes, Imagination, Self, compatibility + JSON-RPC routes, and bridge tools must not execute repo-affecting commands, + edit files, commit, publish, or roll back without the Hands path after Body + access. +- Shared path: file edits, shell commands, commits, PRs, and rollbacks should + share Hands action intent/review/receipt semantics. +- Deletion line: Body grants access; it does not execute. Soul verifies; it + does not execute. Mind records durable state; it does not execute. + +## Contract Families + +- `epiphany.hands.action_intent`: request for bounded action. +- `epiphany.hands.action_review`: Hands decision and execution plan. +- `epiphany.hands.command_receipt`: proof of command execution. +- `epiphany.hands.patch_receipt`: proof of file mutation. +- `epiphany.hands.commit_receipt`: proof of commit creation. +- `epiphany.hands.pr_receipt`: proof of pull-request publication. +- `epiphany.hands.rollback_receipt`: proof that failed action was unwound. +- `epiphany.hands.action_refusal_receipt`: proof that Hands refused to act. + +## Neighboring Gates + +Body grants substrate access before Hands touches the repo. Eyes packages +evidence for action reasoning. Soul verifies action results and invariants. +Mind admits durable state after the action and verification receipts exist. + +Hands is not a permission organ. It is the actuator. The wrench does not bless +itself. diff --git a/notes/life-cultnet-contracts.md b/notes/life-cultnet-contracts.md new file mode 100644 index 00000000..ebf03f6a --- /dev/null +++ b/notes/life-cultnet-contracts.md @@ -0,0 +1,42 @@ +# Life CultNet Contracts + +Objective: make Life the continuity organ. Compaction, sleep, recovery, +handoff, and stale-turn repair need their own receipts instead of hiding in +scratch notes or hopeful transcript memory. + +## Authority Map + +- Owner: Life owns continuity across rupture. +- Inputs: continuity packets, context pressure, compaction checkpoints, + heartbeat/sleep pressure, stale active turns, recovery context, handoff + surfaces, and Mind state context. +- Outputs: compaction checkpoints, sleep distillation receipts, recovery + receipts, stale-turn repair receipts, and continuity refusal receipts. +- Derived state: handoff summaries, scratch preservation, sleep residue, and + recovery notes are continuity receipts. They are not durable Mind state until + Mind admits them. +- Forbidden writers: raw workers, Face, Hands, Eyes, Soul, Self, compatibility + routes, and background loops must not silently rewrite continuity state or + pretend stale work completed cleanly. +- Shared path: compaction prep, sleep distillation, handoff, wake/reorient, and + stale-turn repair should share Life continuity packet/review semantics. +- Deletion line: transcript survival is not Life. Rehydration is not adoption. + "It was probably fine" is not a recovery receipt. + +## Contract Families + +- `epiphany.life.continuity_packet`: request or packet for continuity handling. +- `epiphany.life.compaction_checkpoint`: proof of pre-rupture preservation. +- `epiphany.life.sleep_distillation`: proof of sleep/rumination distillation. +- `epiphany.life.recovery_receipt`: proof of wake/recovery state. +- `epiphany.life.stale_turn_repair`: proof of abandoned-turn repair. +- `epiphany.life.continuity_refusal_receipt`: proof that Life refused to trust + or preserve a continuity packet. + +## Neighboring Gates + +Life preserves what survives rupture. Mind decides what preserved material +becomes durable state. Soul verifies continuity invariants. Self routes recovery +work. Body and Eyes regather reality when continuity is missing. + +Life is not nostalgia. It is survival with receipts. diff --git a/notes/perfect-machine-audit-roadmap.md b/notes/perfect-machine-audit-roadmap.md index d61baa65..27d88801 100644 --- a/notes/perfect-machine-audit-roadmap.md +++ b/notes/perfect-machine-audit-roadmap.md @@ -108,20 +108,21 @@ Need fact or action Today the chain is documented, not structurally unavoidable. -### 3. Hands, Soul, and Life Need First-Class Contracts +### 3. Hands, Soul, and Life Have First-Class Contract Catalogs -The current contract set names the gates around action but not action itself. -That leaves three weak organs: +The contract set now names the gates around action, verification, and +continuity: -- Hands needs action intent, execution receipt, patch receipt, command receipt, - commit/PR receipt, and refusal/rollback receipt contracts. -- Soul needs verification request, invariant check, evidence verdict, - regression/refusal, and review receipt contracts. -- Life needs compaction request, continuity packet, sleep/distillation, - recovery, stale-turn repair, and handoff receipt contracts. +- Hands has action intent/review plus command, patch, commit, PR, rollback, and + refusal receipts. +- Soul has verification request plus invariant check, verdict, regression, + review, and refusal receipts. +- Life has continuity packet plus compaction checkpoint, sleep distillation, + recovery, stale-turn repair, and continuity refusal receipts. -Without those, Body/Mind/Eyes become paper gates around action and continuity -paths they do not own. +Runtime-spine advertises those contracts and CultMesh persists Verse-scoped +policy documents for each. Remaining weakness: these are still contract +catalogs, not mandatory runtime receipt chains. ### 4. Self Still Shares A Throne With Compatibility Plumbing @@ -220,19 +221,22 @@ receipt. ### Phase 2: Give Hands, Soul, And Life Their Own Contracts Goal: action, verification, and continuity stop hiding behind neighbors. +Status: first contract catalog slice landed. -- Hands contracts: +- Hands contracts landed: - `epiphany.hands.action_intent` - `epiphany.hands.command_receipt` - `epiphany.hands.patch_receipt` - `epiphany.hands.commit_receipt` + - `epiphany.hands.pr_receipt` - `epiphany.hands.rollback_receipt` -- Soul contracts: +- Soul contracts landed: - `epiphany.soul.verification_request` - `epiphany.soul.invariant_check` - `epiphany.soul.verdict_receipt` - `epiphany.soul.regression_receipt` -- Life contracts: + - `epiphany.soul.review_receipt` +- Life contracts landed: - `epiphany.life.continuity_packet` - `epiphany.life.compaction_checkpoint` - `epiphany.life.sleep_distillation` @@ -240,7 +244,11 @@ Goal: action, verification, and continuity stop hiding behind neighbors. - `epiphany.life.stale_turn_repair` Definition of done: action, verification, and continuity have the same typed -contract dignity as Mind/Body/Eyes. +contract dignity as Mind/Body/Eyes. Verification: `cargo test --manifest-path +.\epiphany-core\Cargo.toml --lib` and `cargo run --manifest-path +.\epiphany-core\Cargo.toml --bin epiphany-cultmesh-smoke` pass. Next step: +make these contracts executable gates in the live worker/action/verification +and compaction paths. ### Phase 3: Port Void's Face Prompting Shape Properly diff --git a/notes/soul-cultnet-contracts.md b/notes/soul-cultnet-contracts.md new file mode 100644 index 00000000..9f72682d --- /dev/null +++ b/notes/soul-cultnet-contracts.md @@ -0,0 +1,42 @@ +# Soul CultNet Contracts + +Objective: make Soul the verification organ. Soul owns invariants, tests, +review, falsification, regression receipts, and useful refusal. It prevents +polish from impersonating truth. + +## Authority Map + +- Owner: Soul owns verification verdicts. +- Inputs: verification requests, Eyes evidence packets, Hands action receipts, + Body substrate receipts, expected invariants, test commands, review criteria, + and current risk context. +- Outputs: invariant checks, verdict receipts, regression receipts, review + receipts, and verification refusal receipts. +- Derived state: passing tests, review notes, risk lists, and regression traces + are verification receipts. They are not durable Mind state by themselves. +- Forbidden writers: Hands, Face, Imagination, Mind, Self, raw workers, + compatibility JSON-RPC routes, and bridge tools must not mark work verified + without a Soul receipt. +- Shared path: code review, invariant checks, smoke tests, negative checks, and + regression findings should all produce Soul receipts. +- Deletion line: a command exit code is not a Soul verdict. A final answer is + not a Soul verdict. A green local proxy is not a Soul verdict unless Soul says + what it proves and what it does not. + +## Contract Families + +- `epiphany.soul.verification_request`: request for verification. +- `epiphany.soul.invariant_check`: proof of a checked invariant. +- `epiphany.soul.verdict_receipt`: proof of accepted or failed verification. +- `epiphany.soul.regression_receipt`: proof of a violated invariant. +- `epiphany.soul.review_receipt`: proof of review findings and residual risk. +- `epiphany.soul.verification_refusal_receipt`: proof that Soul refused to + certify a claim. + +## Neighboring Gates + +Eyes says what was looked at. Hands says what changed. Soul says whether the +change and claim survive inspection. Mind decides what verification means for +durable state. Life preserves the verdict across rupture. + +Soul is not vibes with a test log. It is the refusal to let the machine lie. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 977cb6cae246411f2bb5b1f7f057f727bbebbfe5..50d6f233107d1c9d45ca9be92c97c08983345e2a 100644 GIT binary patch delta 245 zcmX@Tl=I+n&JALWyrxzL237{6g3_(h#Hv}@uxF2^+Nl8snNXslLF40ZSNh~f_@JP%{Db`U4&M(c;Q2??Pd@|Eg z6`V_RO8inw6q57vN{SMbfsDkG#GL%}VukX|l8osa{Fo#%b5rw5bigWoQ;Rbc3i5L@ zlPeWc@{>zJGC(tP@{<#D5Ju$Xm!twkL3V(Q2Wu+M&CgB+Dk)1XN=#2xNJ=fvOi5Mn T&CE;Dcgjzx)OW2+E!G17^!8LR delta 43 zcmX@Oob&Wj&JALWyvA0>7FI@ Face -> Mind Interpreter; for other organs, Mind still owns the output-to-state gateway even when they do not need narrative embodiment. - Treat VoidBot as reference lineage, not a runtime dependency. The useful organ is Epiphany-native Void routine physiology: heartbeat state owns sleep cycle, memory resonance, incubation, analytic/associative cognition lanes, bridge judgment, candidate interventions, dream residue, and Aquarium-visible routine receipts over typed role dossiers. - Preserve review gates for semantic findings; automatic CRRC may compact or launch the fixed reorient-worker, but not accept or promote. @@ -107,6 +110,7 @@ accepted_design: - Mind's CultNet contract surface is native enough for the next Aquarium/CultMesh cut: `epiphany-core::mind_gateway` defines thought, state-effect proposal, gateway-review, commit-receipt, rejection-receipt, and Verse-adoption document contracts; runtime-spine advertises those mutation/read contracts; CultMesh persists matching `EpiphanyCultMeshMindContractEntry` policy documents so the private state guardian boundary is inspectable as typed state. - Body's repo-access contract surface is now named beside Mind's state gate: `epiphany-core::body_gateway` defines repo access requests, access reviews, grant/refusal receipts, snapshot receipts, and mutation receipts; runtime-spine advertises those contracts; CultMesh persists matching `EpiphanyCultMeshBodyContractEntry` policy documents so repo substrate access has its own typed guardian instead of hiding behind worker launch scope. - Eyes' evidence contract surface is named beside Body and Mind: `epiphany-core::eyes_gateway` defines evidence requests, evidence reviews, source lookup receipts, evidence packets, and evidence refusal receipts; runtime-spine advertises those contracts; CultMesh persists matching `EpiphanyCultMeshEyesContractEntry` policy documents so retrieved snippets and source reads are not confused with inspected evidence. + - Hands, Soul, and Life now have first-class contract catalogs beside Mind/Body/Eyes. `epiphany-core::hands_gateway` defines action intents, reviews, command/patch/commit/PR/rollback/refusal receipts; `epiphany-core::soul_gateway` defines verification requests, invariant checks, verdict/regression/review/refusal receipts; `epiphany-core::life_gateway` defines continuity packets, compaction checkpoints, sleep distillation, recovery, stale-turn repair, and continuity refusal receipts. Runtime-spine advertises them and CultMesh persists matching Verse-scoped contract policy documents. - `notes/perfect-machine-audit-roadmap.md` is the current architectural audit. The main finding is that Mind/Body/Eyes/Imagination/Face dependency contracts are directionally coherent but not yet executable gates. The Rust dependency body repair is landed: the missing `E:\Projects\CultLib\crates\*` paths were replaced with repo-contained vendored CultCache/CultNet/CultMesh crates, and `cargo test --manifest-path .\epiphany-core\Cargo.toml --lib` passes. - `notes/codex-starvation-and-cultnet-liberation-plan.md` is the active foundation directive. It supersedes outward product/bridge/dogfood work and supersedes the weaker goal of merely making Codex app-server a cleaner adapter. Epiphany must become a native CultCache/CultNet runtime; Codex remains only as an OpenAI subscription auth/model-transport reliquary until that too can be replaced or minimized. - `notes/codex-auth-spine-inventory.md` is the current source-grounded inventory of the Codex organ that may survive. Corrected compliance invariant: Codex-compatible auth identity should remain anchored in retained vendored Codex-derived auth machinery, while Epiphany owns typed request/status/event/runtime surfaces around it. Codex app-server, apps, skills, marketplace, plugin UX, MCP OAuth handlers, and collaboration-mode surfaces are not part of the keeper spine.