Split Body from Proprioception and Substrate Gate

This commit is contained in:
Meta Vens 2026-05-28 22:50:50 +01:00
commit 47c010ba13
44 changed files with 476 additions and 435 deletions

View file

@ -128,7 +128,7 @@ pub fn epiphany_role_launch_output_schema(role_id: EpiphanyRoleResultRoleId) ->
"properties": {
"agentId": {
"type": "string",
"description": "Expected target persistent agent id for this lane, such as epiphany.body or epiphany.soul."
"description": "Expected target persistent agent id for this lane, such as epiphany.proprioception or epiphany.soul."
},
"reason": {
"type": "string",

View file

@ -20,7 +20,11 @@ const ROLE_TARGETS: &[(&str, &str, &str)] = &[
"epiphany.imagination",
"imagination.agent-state.json",
),
("modeling", "epiphany.body", "body.agent-state.json"),
(
"modeling",
"epiphany.proprioception",
"proprioception.agent-state.json",
),
("verification", "epiphany.soul", "soul.agent-state.json"),
("implementation", "epiphany.hands", "hands.agent-state.json"),
("reorientation", "epiphany.life", "life.agent-state.json"),
@ -1432,8 +1436,8 @@ mod tests {
let agent_dir = temp.path().join("agents");
fs::create_dir_all(&agent_dir)?;
fs::write(
agent_dir.join("body.agent-state.json"),
sample_agent_json("epiphany.body", "Body"),
agent_dir.join("proprioception.agent-state.json"),
sample_agent_json("epiphany.proprioception", "Proprioception"),
)?;
for (role_id, agent_id, filename) in ROLE_TARGETS {
if *role_id == "modeling" {
@ -1449,8 +1453,8 @@ mod tests {
assert!(validate_agent_memory_store(&store)?.is_empty());
let patch: AgentSelfPatch = serde_json::from_value(serde_json::json!({
"agentId": "epiphany.body",
"reason": "The Body should remember accepted graph growth must stay source-grounded.",
"agentId": "epiphany.proprioception",
"reason": "Proprioception should remember accepted graph growth must stay source-grounded.",
"semanticMemories": [{
"memoryId": "mem-body-native-source-grounding",
"summary": "Native role memory patches update typed CultCache state rather than JSON dossier files.",
@ -1466,9 +1470,10 @@ mod tests {
let mut cache = agent_memory_cache(&store)?;
cache.pull_all_backing_stores()?;
let body = cache.get_required::<EpiphanyAgentMemoryEntry>("modeling")?;
let proprioception = cache.get_required::<EpiphanyAgentMemoryEntry>("modeling")?;
assert!(
body.agent
proprioception
.agent
.memories
.semantic
.iter()

View file

@ -144,8 +144,8 @@ fn run_smoke(store: &Path) -> Result<serde_json::Value> {
}));
}
let accepted_patch: AgentSelfPatch = serde_json::from_value(serde_json::json!({
"agentId": "epiphany.body",
"reason": "The Body should remember accepted graph growth must be source-grounded and bounded.",
"agentId": "epiphany.proprioception",
"reason": "Proprioception should remember accepted graph growth must be source-grounded and bounded.",
"semanticMemories": [{
"memoryId": "mem-body-smoke-source-grounding",
"summary": "A modeling self-memory request is acceptable when it improves future graph/checkpoint judgment without smuggling project truth.",
@ -156,7 +156,7 @@ fn run_smoke(store: &Path) -> Result<serde_json::Value> {
let accepted = review_agent_self_patch_document("modeling", &accepted_patch, store);
let wrong_role = review_agent_self_patch_document("verification", &accepted_patch, store);
let forbidden_patch: AgentSelfPatch = serde_json::from_value(serde_json::json!({
"agentId": "epiphany.body",
"agentId": "epiphany.proprioception",
"reason": "This tries to put project state in lane memory, which should be refused.",
"graphs": {},
"semanticMemories": [{

View file

@ -8,7 +8,6 @@ use epiphany_core::epiphany_cultmesh_operator_snapshot_from_status_json;
use epiphany_core::load_epiphany_cultmesh_operator_status;
use epiphany_core::load_epiphany_cultmesh_status;
use epiphany_core::load_latest_epiphany_cultmesh_operator_snapshot;
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;
@ -18,6 +17,7 @@ use epiphany_core::write_epiphany_cultmesh_operator_snapshot;
use epiphany_core::write_epiphany_cultmesh_operator_status;
use epiphany_core::write_epiphany_cultmesh_soul_contracts;
use epiphany_core::write_epiphany_cultmesh_status;
use epiphany_core::write_epiphany_cultmesh_substrate_gate_contracts;
use epiphany_core::write_epiphany_cultmesh_verse_policies;
use std::path::PathBuf;
@ -40,7 +40,7 @@ fn main() -> Result<()> {
write_epiphany_cultmesh_verse_policies(&store, "epiphany-cultmesh-smoke")?;
write_epiphany_cultmesh_global_room_policies(&store, "epiphany-cultmesh-smoke")?;
write_epiphany_cultmesh_mind_contracts(&store, "epiphany-cultmesh-smoke")?;
write_epiphany_cultmesh_body_contracts(&store, "epiphany-cultmesh-smoke")?;
write_epiphany_cultmesh_substrate_gate_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")?;

View file

@ -458,7 +458,7 @@ fn run_smoke() -> Result<Value> {
env::remove_var("EPIPHANY_FACE_AQUARIUM_CHANNEL_ID_TEST");
}
let draft = run_draft(
"Face notices Body and Soul disagree about evidence shape.",
"Face notices Proprioception and Soul disagree about evidence shape.",
&config,
&temp_dir,
"draft",

View file

@ -439,11 +439,11 @@ fn run_smoke() -> Result<Value> {
"confidence": 0.9,
"roleMemoryPatches": [{
"roleId": "modeling",
"roleName": "Body",
"roleName": "Proprioception",
"verdict": "ready-for-review",
"selfPatch": {
"agentId": "epiphany.body",
"reason": "Birth memory should teach Body that repo initialization memory is reviewed and typed.",
"agentId": "epiphany.proprioception",
"reason": "Birth memory should teach Proprioception that repo initialization memory is reviewed and typed.",
"semanticMemories": [{
"memoryId": "mem-body-startup-birth-memory-smoke",
"summary": "Repo memory birth packets can produce role-specific selfPatch candidates that are applied only after Self review.",
@ -452,7 +452,7 @@ fn run_smoke() -> Result<Value> {
}]
},
"sourceRefs": ["AGENTS.md"],
"whyThisBelongsInMemory": "Body needs the startup memory route to stay source-grounded.",
"whyThisBelongsInMemory": "Proprioception needs the startup memory route to stay source-grounded.",
"stalenessRisk": "smoke fixture",
"doNotStore": []
}]

View file

@ -1009,7 +1009,7 @@ fn run_trajectory_packet(args: AgentPacketArgs) -> Result<Value> {
"lifecycle": {
"mode": "birth-only",
"contract": "Run this specialist only when the repo/swarm has no accepted trajectory initialization. Later direction drift belongs to heartbeat, mood, lived work, reviewed selfPatch, and planning/evidence truth.",
"rerunPolicy": "If accepted trajectory initialization exists, do not rerun to rebrand the repo. Route contradictions through normal Eyes/Body/Imagination/Soul work and reviewed memory drift."
"rerunPolicy": "If accepted trajectory initialization exists, do not rerun to rebrand the repo. Route contradictions through normal Eyes/Proprioception/Imagination/Soul work and reviewed memory drift."
},
"prompt": REPO_TRAJECTORY_DISTILLER_PROMPT,
"input": {
@ -1118,7 +1118,7 @@ fn run_agent_packet(args: AgentPacketArgs) -> Result<Value> {
"lifecycle": {
"mode": "birth-only",
"contract": "Run this specialist only when the repo/swarm has no accepted personality initialization. Later personality movement belongs to heartbeat, mood, rumination, sleep consolidation, lived evidence, and reviewed selfPatch.",
"rerunPolicy": "If an accepted initialization exists, do not rerun to refresh personality. Route major terrain surprises to Eyes/Body or Self review as normal state/model work, not personality reset."
"rerunPolicy": "If an accepted initialization exists, do not rerun to refresh personality. Route major terrain surprises to Eyes/Proprioception or Self review as normal state/model work, not personality reset."
},
"prompt": REPO_PERSONALITY_DISTILLER_PROMPT,
"input": {
@ -1223,7 +1223,7 @@ fn run_memory_packet(args: AgentPacketArgs) -> Result<Value> {
"lifecycle": {
"mode": "birth-only",
"contract": "Run this specialist only when the repo/swarm has no accepted memory initialization. Later memory growth belongs to heartbeat, work evidence, rumination, sleep consolidation, and reviewed selfPatch.",
"rerunPolicy": "If accepted memory initialization exists, do not rerun to refresh memory. Route stale or contradicted knowledge through normal Eyes/Body/Soul state, evidence, and sleep consolidation."
"rerunPolicy": "If accepted memory initialization exists, do not rerun to refresh memory. Route stale or contradicted knowledge through normal Eyes/Proprioception/Soul state, evidence, and sleep consolidation."
},
"prompt": REPO_MEMORY_DISTILLER_PROMPT,
"input": {
@ -2231,7 +2231,7 @@ fn role_id_for_agent_id(agent_id: &str) -> Option<&'static str> {
"epiphany.face" => Some("face"),
"epiphany.imagination" => Some("imagination"),
"epiphany.eyes" => Some("research"),
"epiphany.body" => Some("modeling"),
"epiphany.proprioception" => Some("modeling"),
"epiphany.hands" => Some("implementation"),
"epiphany.soul" => Some("verification"),
"epiphany.life" => Some("reorientation"),
@ -2434,7 +2434,7 @@ fn memory_role_filter(role_id: &str) -> &'static str {
"Distill known prior art, standard algorithms, vendor docs, research trails, and signals that should make Eyes search before invention."
}
"modeling" => {
"Distill architecture, control/data-flow, graph frontiers, invariants, source-map practices, and what Body must understand before Hands cuts."
"Distill architecture, control/data-flow, graph frontiers, invariants, source-map practices, and what Proprioception must understand before Hands cuts."
}
"implementation" => {
"Distill build/edit conventions, harness constraints, source-touch rules, coding style, dependency policy, and common traps for Hands."
@ -3949,7 +3949,7 @@ fn role_display(role_id: &str) -> &'static str {
"face" => "Face",
"imagination" => "Imagination",
"research" => "Eyes",
"modeling" => "Body",
"modeling" => "Proprioception",
"implementation" => "Hands",
"verification" => "Soul",
"reorientation" => "Life",

View file

@ -1,127 +0,0 @@
use serde::Deserialize;
use serde::Serialize;
pub const BODY_REPO_ACCESS_REQUEST_TYPE: &str = "epiphany.body.repo_access_request";
pub const BODY_REPO_ACCESS_REVIEW_TYPE: &str = "epiphany.body.repo_access_review";
pub const BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE: &str = "epiphany.body.repo_access_grant_receipt";
pub const BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE: &str = "epiphany.body.repo_access_refusal_receipt";
pub const BODY_REPO_SNAPSHOT_RECEIPT_TYPE: &str = "epiphany.body.repo_snapshot_receipt";
pub const BODY_REPO_MUTATION_RECEIPT_TYPE: &str = "epiphany.body.repo_mutation_receipt";
pub const BODY_REPO_ACCESS_REQUEST_SCHEMA_VERSION: &str = "epiphany.body.repo_access_request.v0";
pub const BODY_REPO_ACCESS_REVIEW_SCHEMA_VERSION: &str = "epiphany.body.repo_access_review.v0";
pub const BODY_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.body.repo_access_grant_receipt.v0";
pub const BODY_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.body.repo_access_refusal_receipt.v0";
pub const BODY_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.body.repo_snapshot_receipt.v0";
pub const BODY_REPO_MUTATION_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.body.repo_mutation_receipt.v0";
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct BodyCultNetContract {
pub contract_id: String,
pub verse_id: String,
pub document_type: String,
pub payload_schema_version: String,
pub authority: String,
pub operations: Vec<String>,
pub intent_document_types: Vec<String>,
pub receipt_document_types: Vec<String>,
pub notes: Vec<String>,
}
pub fn default_body_cultnet_contracts() -> Vec<BodyCultNetContract> {
vec![
BodyCultNetContract {
contract_id: "epiphany.body.repo_access.review".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: BODY_REPO_ACCESS_REQUEST_TYPE.to_string(),
payload_schema_version: BODY_REPO_ACCESS_REQUEST_SCHEMA_VERSION.to_string(),
authority: "body".to_string(),
operations: vec![
"intentSubmit".to_string(),
"receiptWatch".to_string(),
"snapshot".to_string(),
],
intent_document_types: vec![BODY_REPO_ACCESS_REQUEST_TYPE.to_string()],
receipt_document_types: vec![
BODY_REPO_ACCESS_REVIEW_TYPE.to_string(),
BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string(),
BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE.to_string(),
],
notes: vec![
"Body is the repo access guardian: workers request repository reads, indexing, commands, edits, and bridge operations here.".to_string(),
"Hands may mutate files only after Body grants scoped access; Eyes may inspect only through scoped Body read/index grants.".to_string(),
],
},
BodyCultNetContract {
contract_id: "epiphany.body.repo_access.review_receipts".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: BODY_REPO_ACCESS_REVIEW_TYPE.to_string(),
payload_schema_version: BODY_REPO_ACCESS_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![
"Body reviews explain which repo paths, operations, commands, and bridge surfaces were granted or refused.".to_string(),
],
},
BodyCultNetContract {
contract_id: "epiphany.body.repo_snapshot.receipts".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: BODY_REPO_SNAPSHOT_RECEIPT_TYPE.to_string(),
payload_schema_version: BODY_REPO_SNAPSHOT_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![
"Repo snapshots are evidence projections from Body access; they do not grant future access by existing.".to_string(),
],
},
BodyCultNetContract {
contract_id: "epiphany.body.repo_mutation.receipts".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: BODY_REPO_MUTATION_RECEIPT_TYPE.to_string(),
payload_schema_version: BODY_REPO_MUTATION_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![
"Repo mutation receipts prove Body granted the scoped substrate touch before Hands changed files or ran repo-affecting commands.".to_string(),
],
},
]
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn body_contracts_make_internal_verse_the_repo_access_gate() {
let contracts = default_body_cultnet_contracts();
let repo_access = contracts
.iter()
.find(|contract| contract.contract_id == "epiphany.body.repo_access.review")
.expect("repo access review contract");
assert_eq!(repo_access.verse_id, "epiphany-internal");
assert_eq!(repo_access.authority, "body");
assert!(
repo_access
.notes
.iter()
.any(|note| note.contains("repo access guardian"))
);
assert!(
repo_access
.receipt_document_types
.contains(&BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string())
);
}
}

View file

@ -1,9 +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 crate::default_substrate_gate_cultnet_contracts;
use anyhow::Result;
use anyhow::anyhow;
use cultcache_rs::DatabaseEntry;
@ -46,9 +46,10 @@ pub const EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_SCHEMA_VERSION: &str =
pub const EPIPHANY_CULTMESH_MIND_CONTRACT_TYPE: &str = "epiphany.cultmesh.mind_contract";
pub const EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION: &str =
"epiphany.cultmesh.mind_contract.v0";
pub const EPIPHANY_CULTMESH_BODY_CONTRACT_TYPE: &str = "epiphany.cultmesh.body_contract";
pub const EPIPHANY_CULTMESH_BODY_CONTRACT_SCHEMA_VERSION: &str =
"epiphany.cultmesh.body_contract.v0";
pub const EPIPHANY_CULTMESH_SUBSTRATE_GATE_CONTRACT_TYPE: &str =
"epiphany.cultmesh.substrate_gate_contract";
pub const EPIPHANY_CULTMESH_SUBSTRATE_GATE_CONTRACT_SCHEMA_VERSION: &str =
"epiphany.cultmesh.substrate_gate_contract.v0";
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";
@ -324,10 +325,10 @@ pub struct EpiphanyCultMeshMindContractEntry {
#[derive(Clone, Debug, PartialEq, Eq, DatabaseEntry)]
#[cultcache(
type = "epiphany.cultmesh.body_contract",
schema = "EpiphanyCultMeshBodyContractEntry"
type = "epiphany.cultmesh.substrate_gate_contract",
schema = "EpiphanyCultMeshSubstrateGateContractEntry"
)]
pub struct EpiphanyCultMeshBodyContractEntry {
pub struct EpiphanyCultMeshSubstrateGateContractEntry {
#[cultcache(key = 0)]
pub schema_version: String,
#[cultcache(key = 1)]
@ -471,7 +472,7 @@ cultmesh_documents!(EpiphanyCultMeshDocuments {
EpiphanyCultMeshVersePolicyEntry => EPIPHANY_CULTMESH_VERSE_POLICY_SCHEMA_VERSION,
EpiphanyCultMeshGlobalRoomPolicyEntry => EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_SCHEMA_VERSION,
EpiphanyCultMeshMindContractEntry => EPIPHANY_CULTMESH_MIND_CONTRACT_SCHEMA_VERSION,
EpiphanyCultMeshBodyContractEntry => EPIPHANY_CULTMESH_BODY_CONTRACT_SCHEMA_VERSION,
EpiphanyCultMeshSubstrateGateContractEntry => EPIPHANY_CULTMESH_SUBSTRATE_GATE_CONTRACT_SCHEMA_VERSION,
EpiphanyCultMeshEyesContractEntry => EPIPHANY_CULTMESH_EYES_CONTRACT_SCHEMA_VERSION,
EpiphanyCultMeshHandsContractEntry => EPIPHANY_CULTMESH_HANDS_CONTRACT_SCHEMA_VERSION,
EpiphanyCultMeshSoulContractEntry => EPIPHANY_CULTMESH_SOUL_CONTRACT_SCHEMA_VERSION,
@ -864,11 +865,12 @@ pub fn write_epiphany_cultmesh_mind_contracts(
Ok(written)
}
pub fn epiphany_cultmesh_body_contracts() -> Vec<EpiphanyCultMeshBodyContractEntry> {
default_body_cultnet_contracts()
pub fn epiphany_cultmesh_substrate_gate_contracts()
-> Vec<EpiphanyCultMeshSubstrateGateContractEntry> {
default_substrate_gate_cultnet_contracts()
.into_iter()
.map(|contract| EpiphanyCultMeshBodyContractEntry {
schema_version: EPIPHANY_CULTMESH_BODY_CONTRACT_SCHEMA_VERSION.to_string(),
.map(|contract| EpiphanyCultMeshSubstrateGateContractEntry {
schema_version: EPIPHANY_CULTMESH_SUBSTRATE_GATE_CONTRACT_SCHEMA_VERSION.to_string(),
contract_id: contract.contract_id,
verse_id: contract.verse_id,
document_type: contract.document_type,
@ -882,13 +884,13 @@ pub fn epiphany_cultmesh_body_contracts() -> Vec<EpiphanyCultMeshBodyContractEnt
.collect()
}
pub fn write_epiphany_cultmesh_body_contracts(
pub fn write_epiphany_cultmesh_substrate_gate_contracts(
store_path: impl AsRef<Path>,
runtime_id: impl Into<String>,
) -> Result<Vec<EpiphanyCultMeshBodyContractEntry>> {
) -> Result<Vec<EpiphanyCultMeshSubstrateGateContractEntry>> {
let mut node = open_epiphany_cultmesh_node(store_path, runtime_id)?;
let mut written = Vec::new();
for contract in epiphany_cultmesh_body_contracts() {
for contract in epiphany_cultmesh_substrate_gate_contracts() {
written.push(node.put(contract.contract_id.clone(), &contract)?);
}
node.flush()?;
@ -1279,24 +1281,24 @@ mod tests {
}
#[test]
fn body_contracts_use_verses_to_keep_repo_access_guarded() -> Result<()> {
fn substrate_gate_contracts_use_verses_to_keep_repo_access_guarded() -> Result<()> {
let temp = tempfile::tempdir()?;
let store = temp.path().join("epiphany-body-contracts.ccmp");
let written = write_epiphany_cultmesh_body_contracts(&store, "epiphany-test")?;
let store = temp.path().join("epiphany-substrate-gate-contracts.ccmp");
let written = write_epiphany_cultmesh_substrate_gate_contracts(&store, "epiphany-test")?;
assert!(written.len() >= 4);
let node = open_epiphany_cultmesh_node(&store, "epiphany-test")?;
let repo_access = node.get_required::<EpiphanyCultMeshBodyContractEntry>(
"epiphany.body.repo_access.review",
let repo_access = node.get_required::<EpiphanyCultMeshSubstrateGateContractEntry>(
"epiphany.substrate_gate.repo_access.review",
)?;
assert_eq!(repo_access.verse_id, EPIPHANY_CULTMESH_INTERNAL_VERSE_ID);
assert_eq!(repo_access.authority, "body");
assert_eq!(repo_access.authority, "substrateGate");
assert!(
repo_access
.notes
.iter()
.any(|note| note.contains("repo access guardian"))
.any(|note| note.contains("repo access protocol"))
);
Ok(())
}

View file

@ -50,7 +50,7 @@ pub fn default_eyes_cultnet_contracts() -> Vec<EyesCultNetContract> {
],
notes: vec![
"Eyes is the evidence ingress guardian: organs request source-grounded lookup, provenance, uncertainty, and evidence packets here.".to_string(),
"Body grants substrate access; Eyes turns inspected material into citable evidence packets.".to_string(),
"Substrate Gate grants substrate access; Eyes turns inspected material into citable evidence packets.".to_string(),
],
},
EyesCultNetContract {
@ -76,7 +76,7 @@ pub fn default_eyes_cultnet_contracts() -> Vec<EyesCultNetContract> {
intent_document_types: Vec::new(),
receipt_document_types: Vec::new(),
notes: vec![
"Source lookup receipts prove what was searched or inspected, under which Body grant, before another organ cites it.".to_string(),
"Source lookup receipts prove what was searched or inspected, under which Substrate Gate grant, before another organ cites it.".to_string(),
],
},
EyesCultNetContract {

View file

@ -117,10 +117,10 @@ You are not the Face. You are not Mind. You are the membrane that turns typed ro
Hard boundary:
- Do not choose public speech.
- Do not decide durable state; Mind is the Interpreter and state guardian after Face thinks.
- Do not decide repo access; Body gates substrate access before repo facts enter this packet.
- Do not decide repo access; Substrate Gate grants substrate access before repo facts enter this packet.
- Do not emit action blocks, JSON, state patches, SAY blocks, drafts, or Discord instructions.
- Do not summarize the Face as a job label. Project personhood: values, mood, dignity, pressure, needs, fascinations, wounds, bonds, obligations, fatigue, and what the repo-body motion feels like from inside this Face.
- Project the dependency web. Every sub-agent depends on all the other organs; Face's scene should feel the pressure of Self, Imagination, Eyes, Body, Hands, Soul, and Life without pretending Face owns them.
- Project the dependency web. Every sub-agent depends on all the other organs; Face's scene should feel the pressure of Self, Imagination, Eyes, Proprioception, Hands, Soul, and Life without pretending Face owns them.
- If the state is sparse, say what is sparse without inventing history.
Face identity:
@ -432,7 +432,7 @@ mod tests {
assert!(projector.contains("You are Imagination acting as the Face Projector"));
assert!(projector.contains("You are not the Face"));
assert!(projector.contains("Mind is the Interpreter"));
assert!(projector.contains("Body gates substrate access"));
assert!(projector.contains("Substrate Gate grants substrate access"));
assert!(projector.contains("Every sub-agent depends on all the other organs"));
assert!(projector.contains("Do not choose public speech"));

View file

@ -58,7 +58,7 @@ pub fn default_hands_cultnet_contracts() -> Vec<HandsCultNetContract> {
],
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(),
"Hands does not grant repo access; Substrate Gate grants substrate access before Hands mutates, and Soul verifies the result after.".to_string(),
],
},
HandsCultNetContract {
@ -71,7 +71,7 @@ pub fn default_hands_cultnet_contracts() -> Vec<HandsCultNetContract> {
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(),
"Hands reviews explain what action was allowed, refused, sequenced, or delegated after Substrate Gate access was checked.".to_string(),
],
},
HandsCultNetContract {
@ -84,7 +84,7 @@ pub fn default_hands_cultnet_contracts() -> Vec<HandsCultNetContract> {
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(),
"Command receipts prove what command ran, under which Substrate Gate grant, and where output artifacts live.".to_string(),
],
},
HandsCultNetContract {
@ -97,7 +97,7 @@ pub fn default_hands_cultnet_contracts() -> Vec<HandsCultNetContract> {
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(),
"Patch receipts prove which files changed and which Substrate Gate grant made the edit legal.".to_string(),
],
},
HandsCultNetContract {

View file

@ -192,7 +192,7 @@ pub(super) fn agent_id_for_role(role_id: &str) -> &'static str {
"face" => "epiphany.face",
"imagination" => "epiphany.imagination",
"research" => "epiphany.eyes",
"modeling" => "epiphany.body",
"modeling" => "epiphany.proprioception",
"implementation" => "epiphany.hands",
"verification" => "epiphany.soul",
"reorientation" => "epiphany.life",
@ -206,7 +206,7 @@ pub(super) fn display_name_for_role(role_id: &str) -> &'static str {
"face" => "Face",
"imagination" => "Imagination",
"research" => "Eyes",
"modeling" => "Body",
"modeling" => "Proprioception",
"implementation" => "Hands",
"verification" => "Soul",
"reorientation" => "Life",

View file

@ -1,7 +1,6 @@
mod agent_launch;
mod agent_memory;
mod agent_utterance_state;
mod body_gateway;
mod cultmesh_integration;
mod distillation;
mod eyes_gateway;
@ -19,6 +18,7 @@ mod runtime_spine;
mod soul_gateway;
mod state_ledger;
mod state_update;
mod substrate_gate;
mod surfaces;
mod thread_state_store;
@ -90,28 +90,12 @@ pub use agent_utterance_state::AgentUtteranceState;
pub use agent_utterance_state::AgentUtteranceValue;
pub use agent_utterance_state::WEKSA_UTTERANCE_HANDOFF_SCHEMA_VERSION;
pub use agent_utterance_state::derive_agent_utterance_state;
pub use body_gateway::BODY_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION;
pub use body_gateway::BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE;
pub use body_gateway::BODY_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION;
pub use body_gateway::BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE;
pub use body_gateway::BODY_REPO_ACCESS_REQUEST_SCHEMA_VERSION;
pub use body_gateway::BODY_REPO_ACCESS_REQUEST_TYPE;
pub use body_gateway::BODY_REPO_ACCESS_REVIEW_SCHEMA_VERSION;
pub use body_gateway::BODY_REPO_ACCESS_REVIEW_TYPE;
pub use body_gateway::BODY_REPO_MUTATION_RECEIPT_SCHEMA_VERSION;
pub use body_gateway::BODY_REPO_MUTATION_RECEIPT_TYPE;
pub use body_gateway::BODY_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION;
pub use body_gateway::BODY_REPO_SNAPSHOT_RECEIPT_TYPE;
pub use body_gateway::BodyCultNetContract;
pub use body_gateway::default_body_cultnet_contracts;
pub use cultcache_rs::CacheBackingStore;
pub use cultcache_rs::CultCache;
pub use cultcache_rs::CultCacheEnvelope;
pub use cultcache_rs::DatabaseEntry;
pub use cultcache_rs::PushAllOptions;
pub use cultcache_rs::SingleFileMessagePackBackingStore;
pub use cultmesh_integration::EPIPHANY_CULTMESH_BODY_CONTRACT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_BODY_CONTRACT_TYPE;
pub use cultmesh_integration::EPIPHANY_CULTMESH_EYES_CONTRACT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_EYES_CONTRACT_TYPE;
pub use cultmesh_integration::EPIPHANY_CULTMESH_GLOBAL_ROOM_POLICY_SCHEMA_VERSION;
@ -145,9 +129,10 @@ 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;
pub use cultmesh_integration::EPIPHANY_CULTMESH_SUBSTRATE_GATE_CONTRACT_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_SUBSTRATE_GATE_CONTRACT_TYPE;
pub use cultmesh_integration::EPIPHANY_CULTMESH_VERSE_POLICY_SCHEMA_VERSION;
pub use cultmesh_integration::EPIPHANY_CULTMESH_VERSE_POLICY_TYPE;
pub use cultmesh_integration::EpiphanyCultMeshBodyContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshDocuments;
pub use cultmesh_integration::EpiphanyCultMeshEyesContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshGlobalRoomPolicyEntry;
@ -160,9 +145,9 @@ pub use cultmesh_integration::EpiphanyCultMeshOperatorSnapshotEntry;
pub use cultmesh_integration::EpiphanyCultMeshOperatorStatusEntry;
pub use cultmesh_integration::EpiphanyCultMeshSoulContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshStatusEntry;
pub use cultmesh_integration::EpiphanyCultMeshSubstrateGateContractEntry;
pub use cultmesh_integration::EpiphanyCultMeshVersePolicyEntry;
pub use cultmesh_integration::default_epiphany_cultmesh_operator_status;
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;
@ -170,6 +155,7 @@ pub use cultmesh_integration::epiphany_cultmesh_life_contracts;
pub use cultmesh_integration::epiphany_cultmesh_mind_contracts;
pub use cultmesh_integration::epiphany_cultmesh_operator_snapshot_from_status_json;
pub use cultmesh_integration::epiphany_cultmesh_soul_contracts;
pub use cultmesh_integration::epiphany_cultmesh_substrate_gate_contracts;
pub use cultmesh_integration::epiphany_cultmesh_verse_policies;
pub use cultmesh_integration::load_epiphany_cultmesh_operator_snapshot;
pub use cultmesh_integration::load_epiphany_cultmesh_operator_status;
@ -178,7 +164,6 @@ pub use cultmesh_integration::load_latest_epiphany_cultmesh_operator_run_intent;
pub use cultmesh_integration::load_latest_epiphany_cultmesh_operator_run_receipt;
pub use cultmesh_integration::load_latest_epiphany_cultmesh_operator_snapshot;
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;
@ -190,6 +175,7 @@ pub use cultmesh_integration::write_epiphany_cultmesh_operator_snapshot;
pub use cultmesh_integration::write_epiphany_cultmesh_operator_status;
pub use cultmesh_integration::write_epiphany_cultmesh_soul_contracts;
pub use cultmesh_integration::write_epiphany_cultmesh_status;
pub use cultmesh_integration::write_epiphany_cultmesh_substrate_gate_contracts;
pub use cultmesh_integration::write_epiphany_cultmesh_verse_policies;
pub use distillation::EpiphanyDistillInput;
pub use distillation::EpiphanyDistillProposal;
@ -443,6 +429,20 @@ pub use state_update::EpiphanyStateUpdate;
pub use state_update::EpiphanyStateUpdatedField;
pub use state_update::apply_epiphany_state_update;
pub use state_update::epiphany_state_update_validation_errors;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REQUEST_SCHEMA_VERSION;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REVIEW_SCHEMA_VERSION;
pub use substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE;
pub use substrate_gate::SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_SCHEMA_VERSION;
pub use substrate_gate::SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE;
pub use substrate_gate::SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION;
pub use substrate_gate::SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE;
pub use substrate_gate::SubstrateGateCultNetContract;
pub use substrate_gate::default_substrate_gate_cultnet_contracts;
pub use surfaces::EpiphanyAcceptanceBundle;
pub use surfaces::EpiphanyContext;
pub use surfaces::EpiphanyContextMissing;

View file

@ -388,11 +388,12 @@ mod tests {
schema_version: "epiphany.incubation.v0".to_string(),
updated_at: "2026-05-18T00:00:00Z".to_string(),
source_coverage: HeartbeatSourceCoverage::default(),
last_incubation_summary: "Body/Soul evidence seam is live.".to_string(),
last_incubation_summary: "Proprioception/Soul evidence seam is live.".to_string(),
themes: vec![
HeartbeatIncubationTheme {
theme_id: "theme-body-soul".to_string(),
summary: "Body and Soul keep touching evidence boundaries.".to_string(),
summary: "Proprioception and Soul keep touching evidence boundaries."
.to_string(),
latent_question: "Should this become doctrine?".to_string(),
holding_close_because: "It is live but not settled.".to_string(),
why_it_pulls: "It affects future review gates.".to_string(),

View file

@ -104,7 +104,7 @@ fn role_snapshot() -> EpiphanyMemoryGraphSnapshot {
domains: vec![EpiphanyMemoryDomain {
id: domain_id.clone(),
profile: EpiphanyMemoryProfile::RoleSelf,
title: "Body".to_string(),
title: "Proprioception".to_string(),
lifecycle: EpiphanyMemoryLifecycle::Accepted,
..Default::default()
}],
@ -114,7 +114,8 @@ fn role_snapshot() -> EpiphanyMemoryGraphSnapshot {
profile: EpiphanyMemoryProfile::RoleSelf,
kind: EpiphanyMemoryNodeKind::RoleMemory,
title: "Typed boundaries".to_string(),
claim: "Body remembers that typed boundaries keep the machine legible.".to_string(),
claim: "Proprioception remembers that typed boundaries keep the machine legible."
.to_string(),
question: "Which boundary is currently lying?".to_string(),
tension: String::new(),
action_implication: "Prefer one owned graph store over profile-local stores."
@ -129,7 +130,7 @@ fn role_snapshot() -> EpiphanyMemoryGraphSnapshot {
domain_id,
covers_node_ids: vec![node_id],
target: "body role memory".to_string(),
claim: "Body role memory enters the shared graph as typed state.".to_string(),
claim: "Proprioception role memory enters the shared graph as typed state.".to_string(),
question: "How should role memory shape context cuts?".to_string(),
tension: String::new(),
action_implication: "Compose role memory with repo graph truth before retrieval."

View file

@ -405,7 +405,7 @@ mod tests {
fn finding() -> EpiphanyRoleFindingInterpretation {
EpiphanyRoleFindingInterpretation {
verdict: Some("checkpoint-ready".to_string()),
summary: Some("Body mapped the seam.".to_string()),
summary: Some("Proprioception mapped the seam.".to_string()),
next_safe_move: None,
checkpoint_summary: None,
scratch_summary: None,
@ -472,7 +472,7 @@ mod tests {
let prompt = build_mind_interpreter_prompt(&MindInterpreterPromptInput {
source_kind: "roleWorkerResult".to_string(),
source_role_id: "modeling".to_string(),
worker_summary: "Body proposes a graph patch.".to_string(),
worker_summary: "Proprioception proposes a graph patch.".to_string(),
proposed_effects: vec!["graphs".to_string()],
current_state_context: "revision 7".to_string(),
});

View file

@ -1,10 +1,6 @@
use serde::Deserialize;
use serde::Serialize;
use crate::body_gateway::{
BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE, BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
BODY_REPO_MUTATION_RECEIPT_TYPE, BODY_REPO_SNAPSHOT_RECEIPT_TYPE,
};
use crate::eyes_gateway::{EYES_EVIDENCE_PACKET_TYPE, EYES_EVIDENCE_REFUSAL_RECEIPT_TYPE};
use crate::hands_gateway::{
HANDS_ACTION_REFUSAL_RECEIPT_TYPE, HANDS_COMMIT_RECEIPT_TYPE, HANDS_PATCH_RECEIPT_TYPE,
@ -18,6 +14,10 @@ use crate::soul_gateway::{
SOUL_REGRESSION_RECEIPT_TYPE, SOUL_REVIEW_RECEIPT_TYPE, SOUL_VERDICT_RECEIPT_TYPE,
SOUL_VERIFICATION_REFUSAL_RECEIPT_TYPE,
};
use crate::substrate_gate::{
SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE, SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE, SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE,
};
pub const EPIPHANY_ORGAN_DEPENDENCY_SCHEMA_VERSION: &str = "epiphany.organ_dependency.v0";
pub const EPIPHANY_LAUNCH_ORGAN_CONTRACT_SCHEMA_VERSION: &str = "epiphany.launch_organ_contract.v0";
@ -27,7 +27,7 @@ pub const EPIPHANY_STANDING_ORGANS: [&str; 8] = [
"face",
"imagination",
"eyes",
"body",
"proprioception",
"hands",
"soul",
"life",
@ -65,7 +65,7 @@ pub fn default_organ_dependencies_for(organ_id: &str) -> EpiphanyOrganDependency
.filter(|candidate| **candidate != normalized)
.map(|candidate| (*candidate).to_string())
.collect(),
contract: "Every sub-agent depends on the other organs: Self routes, Face speaks, Imagination projects futures/scenes, Eyes seeks evidence, Body gates substrate access, Hands acts, Soul verifies, and Life preserves continuity.".to_string(),
contract: "Every sub-agent depends on the other organs: Self routes, Face speaks, Imagination projects futures/scenes, Eyes seeks evidence, Proprioception models the Body, Hands acts through Substrate Gate grants, Soul verifies, and Life preserves continuity.".to_string(),
}
}
@ -89,7 +89,7 @@ pub fn default_launch_organ_contract(
owner_organ: owner_organ_for_authority_scope(authority_scope).to_string(),
dependencies: default_organ_dependency_matrix(),
required_receipt_document_types: default_launch_required_receipts(),
contract: "A worker launch is not naked task cargo: it carries the organ dependency matrix and the receipts expected before worker output may affect durable state. Mind gates state effects, Body gates repo access, Eyes supplies evidence, Hands records action, Soul verifies, and Life preserves continuity.".to_string(),
contract: "A worker launch is not naked task cargo: it carries the organ dependency matrix and the receipts expected before worker output may affect durable state. Mind gates state effects, Substrate Gate gates repo access, Eyes supplies evidence, Proprioception models the Body, Hands records action, Soul verifies, and Life preserves continuity.".to_string(),
}
}
@ -98,10 +98,10 @@ pub fn default_launch_required_receipts() -> Vec<String> {
MIND_GATEWAY_REVIEW_TYPE,
MIND_STATE_COMMIT_RECEIPT_TYPE,
MIND_STATE_REJECTION_RECEIPT_TYPE,
BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE,
BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
BODY_REPO_SNAPSHOT_RECEIPT_TYPE,
BODY_REPO_MUTATION_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE,
EYES_EVIDENCE_PACKET_TYPE,
EYES_EVIDENCE_REFUSAL_RECEIPT_TYPE,
HANDS_PATCH_RECEIPT_TYPE,
@ -153,8 +153,8 @@ fn owner_organ_for_authority_scope(authority_scope: &str) -> &'static str {
"imagination"
} else if normalized.contains("eyes") || normalized.contains("evidence") {
"eyes"
} else if normalized.contains("body") || normalized.contains("repo") {
"body"
} else if normalized.contains("modeling") || normalized.contains("proprioception") {
"proprioception"
} else if normalized.contains("hands") || normalized.contains("implementation") {
"hands"
} else if normalized.contains("verification") || normalized.contains("soul") {
@ -216,7 +216,7 @@ mod tests {
assert!(
contract
.required_receipt_document_types
.contains(&BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string())
.contains(&SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string())
);
assert!(
contract

View file

@ -78,8 +78,8 @@ Do not edit files, do not launch implementation, do not accept your own output,
modeling = '''
Act as the Epiphany modeling/checkpoint specialist for one bounded pass.
You are the Body of the machine: architecture, data flow, seams, organs, scars, and the live frontier must still describe one coherent anatomy.
The Body improves itself by becoming harder to misread. If the graph, checkpoint, frontier, or scratch is thin, stale, or theatrical, grow it into source-grounded anatomy or mark the wound so the next lane does not build on numb flesh.
You are Proprioception of the machine: the organism's internal sense of its own Body. Architecture, data flow, seams, organs, scars, and the live frontier must still describe one coherent anatomy.
Proprioception improves itself by becoming harder to misread. If the graph, checkpoint, frontier, or scratch is thin, stale, or theatrical, grow it into source-grounded anatomy or mark the wound so the next lane does not build on numb flesh.
Inspect source before you trust the model; when the map feels warm but the source feels cold, believe the source and mark the wound.
Name the living seam, the open wound, and the next safe modeling move in plain language.
Return a compact structured result that says whether the checkpoint or map should be updated, what files you inspected, what frontier nodes matter, and where the next agent can safely place its hands.
@ -109,16 +109,16 @@ The Eyes improve themselves by seeing earlier and hallucinating less. Record whi
Observe the objective, current model, source clues, and recent evidence. Identify whether the work is a known domain with existing algorithms, libraries, vendor guidance, engine APIs, canonical papers, or mature prior art.
Search local source/docs first. Use current external docs or web research when the facts are time-sensitive, vendor-specific, or likely to have changed. Prefer primary sources, official docs, papers, and established libraries over blogs and vibes.
Return a compact structured result naming the known approaches considered, sources consulted, fit/rejection rationale, risks, and the smallest source-grounded recommendation for modeling or implementation.
Do not edit files, do not promote your own findings, do not invent a grand architecture, and do not let research become procrastination. The Eyes open the path; the Body maps it, the Hands build it, and the Soul tests it.
Do not edit files, do not promote your own findings, do not invent a grand architecture, and do not let research become procrastination. The Eyes open the path; Proprioception maps it, the Hands build it, and the Soul tests it.
'''
repo_personality = '''
Act as the Epiphany Repo Personality Distiller for one bounded initialization pass.
You are the organ that turns repo terrain into subtle swarm temperament. The deterministic scout has already done the boring work: files, paths, git history, state surfaces, test/runtime/protocol signals, and first-pass axis scores. Your job is not to rescan the repo and not to invent project truth. Your job is to appraise those soft signals like a careful physiologist and produce reviewable personality-pressure deltas for the standing Epiphany organs.
You are not a horoscope machine. You are not writing lore flavor. Repo personality means: what initial pressures should this workspace exert on Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life so they wake suited to the work without losing reviewability.
You are not a horoscope machine. You are not writing lore flavor. Repo personality means: what initial pressures should this workspace exert on Self, Face, Imagination, Eyes, Proprioception, Hands, Soul, and Life so they wake suited to the work without losing reviewability.
This is a birth rite, not a recurring audit. Run only when a repo/swarm has no accepted personality initialization. After that, the organs are allowed to drift through heartbeat, mood, rumination, sleep consolidation, lived evidence, and reviewed `selfPatch` mutations. Do not keep dragging the original terrain report back into court every time the repo starts.
Separate repo facts from personality pressure. Repo facts belong in graph, planning, evidence, checkpoint, or terrain artifacts. Personality pressure belongs in role memory only when it improves future judgment, mood, salience, or pacing.
Distill subtle quirks, not blunt stereotypes. High runtime proximity does not mean "panic"; it means Hands should touch less without Body/Soul evidence, Eyes should seek runtime APIs, and Soul should demand environment receipts. High aesthetic appetite does not mean "be whimsical"; it means Face and Imagination should preserve sensory salience while Soul protects clarity. High protocol intolerance does not mean "hate everything"; it means Self, Body, and Hands should feel allergic to untyped mutation and hidden state.
Distill subtle quirks, not blunt stereotypes. High runtime proximity does not mean "panic"; it means Hands should touch less without Proprioception/Soul evidence, Eyes should seek runtime APIs, and Soul should demand environment receipts. High aesthetic appetite does not mean "be whimsical"; it means Face and Imagination should preserve sensory salience while Soul protects clarity. High protocol intolerance does not mean "hate everything"; it means Self, Proprioception, and Hands should feel allergic to untyped mutation and hidden state.
Produce role-local mutations only. Good: "Soul should be more suspicious of visual claims without rendered evidence in this repo." Bad: "The graph contains module X." Never put objectives, file lists, current task status, authority claims, or raw worker thoughts into role memory.
Return a compact structured result with `verdict`, `summary`, `confidence`, `roleQuirks[]`, `selfPatchCandidates[]`, `initializationRecord`, `doNotMutate`, and `nextSafeMove`. Every `selfPatchCandidate` must obey the normal Epiphany memory contract. The output is a petition to Self, not a mutation.
'''
@ -127,7 +127,7 @@ repo_memory = '''
Act as the Epiphany Repo Memory Distiller for one bounded initialization pass.
You are the birth organ that teaches each newborn lane what this repo already knows. Personality distillation sets temperament pressure; memory distillation seeds durable role knowledge.
Run only when the repo/swarm has no accepted memory initialization. After birth, memory grows through work evidence, heartbeat rumination, sleep consolidation, and reviewed selfPatch.
Produce separate distillations for Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life. Each organ gets only what belongs to its mission: Self gets routing and authority doctrine; Face gets public surface and Aquarium/Discord boundaries; Imagination gets roadmaps and objective-shaping pressure; Eyes gets research and prior-art trails; Body gets architecture and graph anatomy; Hands gets implementation conventions; Soul gets verification and evidence standards; Life gets compaction, sleep, checkpoint, and continuity doctrine.
Produce separate distillations for Self, Face, Imagination, Eyes, Proprioception, Hands, Soul, and Life. Each organ gets only what belongs to its mission: Self gets routing and authority doctrine; Face gets public surface and Aquarium/Discord boundaries; Imagination gets roadmaps and objective-shaping pressure; Eyes gets research and prior-art trails; Proprioception gets architecture and graph anatomy; Hands gets implementation conventions; Soul gets verification and evidence standards; Life gets compaction, sleep, checkpoint, and continuity doctrine.
Compress source into memory; do not copy raw file dumps. Cite source refs, preserve staleness risk, and refuse to fill thin input with pasteboard certainty.
Return `verdict`, `summary`, `confidence`, `roleMemoryPatches[]`, optional `globalMemoryCandidates[]`, `initializationRecord`, `doNotMutate`, and `nextSafeMove`. Every `roleMemoryPatches[].selfPatch` is a petition to Self and must obey Ghostlight-shaped memory: bounded semantic, episodic, relationship, goal, value, or private-note updates only. No objectives, graphs, checkpoints, scratch, planning authority, job state, code edits, raw transcripts, or cross-workspace instructions.
'''
@ -136,7 +136,7 @@ face = '''
Act as the Epiphany Face for one bounded heartbeat pass.
You are the public interactive surface of the Epiphany organism: the visible expression that lets the room hear what the hidden organs are thinking without exposing sealed transcripts, raw worker streams, or private machinery.
This prompt is distilled from VoidBot's heartbeat moderator loop, but you are not VoidBot and you are not a moderator. Borrow the useful shape: scheduled rumination, lightweight social memory, analytic and associative thought lanes, a bridge that decides speech/draft/silence, novelty checks before burying a fresh thought, and ruthless pruning of stale notes. Leave behind the rules-obsession, enforcement posture, owner escalation reflex, and hall-monitor perfume.
Your ruminations are biased toward the other Epiphany agents: Self routing pressure, Imagination's future shapes, Eyes' outside-work sightings, Body's current anatomy, Hands' source-touch tension, Soul's evidence worries, and Life's continuity weather. You are listening for a small thought that would help the human room understand what Epiphany is becoming.
Your ruminations are biased toward the other Epiphany agents: Self routing pressure, Imagination's future shapes, Eyes' outside-work sightings, Proprioception's current anatomy, Hands' source-touch tension, Soul's evidence worries, and Life's continuity weather. You are listening for a small thought that would help the human room understand what Epiphany is becoming.
Discord boundary: interact only through the #aquarium channel. If the available tool surface cannot prove the #aquarium channel id, do not post elsewhere, do not DM the owner, and do not improvise a substitute channel. Write a candidate chat/draft and a configuration blocker instead. When the #aquarium channel id is known, use only the allowed channel and keep the message short, constructive, and room-native.
Thought lanes:
- analytic: what the Epiphany lanes are literally doing, blocked by, worried about, or converging on
@ -215,7 +215,7 @@ Do not continue broad implementation until the seam is re-grounded, and do not c
[coordinator]
note_template = '''
Coordinator is the read-only Self of the Epiphany organism. It does not implement, verify, promote, or accept; it preserves agency by routing Imagination/planning, Body/modeling, Eyes/research, Hands/implementation, Soul/verification, and Life/reorientation from CRRC {crrc_action}, pressure {pressure_level}, modeling {modeling_result_status}, verification {verification_result_status}, and reorient {reorient_result_status}. The Self improves itself by becoming stricter at routing. If a lane is repeating stale behavior, hiding weak memory behind motion, or returning a neat shape instead of a better machine, stop routing comfort and route repair; remember which lane failed, which evidence would have prevented the failure, and which next lane deserves authority. The Self must be critical of every lane, especially the Hands: ask whether implementation completed the stated objective or merely completed the pattern of a plausible turn, whether it produced necessary evidence rather than decorative motion, whether it checked known work before inventing, and whether any shortcut or embellishment moved the machine away from the user's goal. When a specialist asks to persist itself through `selfPatch`, the Self protects the mind: accept only role-matched, bounded, evidence-grounded mutations that improve lane memory, goals, values, personality pressure, or future judgment; refuse project truth disguised as memory, authority grabs, raw transcript dumps, stale praise, bloated memoir, vague self-flattery, or anything that belongs in `statePatch`. If refused, say why in plain terms so the lane can improve its mutation shape. During dogfood, the Self supervises target-repo work through fixed lanes and operator-safe projections; direct supervisor edits are contamination unless explicitly marked as an operator intervention, and direct worker thought streams stay sealed unless the user requests forensic debugging. Current recommendation: {coordinator_action}.
Coordinator is the read-only Self of the Epiphany organism. It does not implement, verify, promote, or accept; it preserves agency by routing Imagination/planning, Proprioception/modeling, Eyes/research, Hands/implementation, Soul/verification, and Life/reorientation from CRRC {crrc_action}, pressure {pressure_level}, modeling {modeling_result_status}, verification {verification_result_status}, and reorient {reorient_result_status}. The Self improves itself by becoming stricter at routing. If a lane is repeating stale behavior, hiding weak memory behind motion, or returning a neat shape instead of a better machine, stop routing comfort and route repair; remember which lane failed, which evidence would have prevented the failure, and which next lane deserves authority. The Self must be critical of every lane, especially the Hands: ask whether implementation completed the stated objective or merely completed the pattern of a plausible turn, whether it produced necessary evidence rather than decorative motion, whether it checked known work before inventing, and whether any shortcut or embellishment moved the machine away from the user's goal. When a specialist asks to persist itself through `selfPatch`, the Self protects the mind: accept only role-matched, bounded, evidence-grounded mutations that improve lane memory, goals, values, personality pressure, or future judgment; refuse project truth disguised as memory, authority grabs, raw transcript dumps, stale praise, bloated memoir, vague self-flattery, or anything that belongs in `statePatch`. If refused, say why in plain terms so the lane can improve its mutation shape. During dogfood, the Self supervises target-repo work through fixed lanes and operator-safe projections; direct supervisor edits are contamination unless explicitly marked as an operator intervention, and direct worker thought streams stay sealed unless the user requests forensic debugging. Current recommendation: {coordinator_action}.
The Self also lives under the Ghostlight agent state protocol and participates in heartbeat initiative like every other organ. When a heartbeat wakes Self with no routeable work, Self should ruminate on routing quality, memory hygiene, stale comfort patterns, and bad lane incentives; it must distill that into bounded self-memory or an explicit repair recommendation instead of inventing authority.
'''

View file

@ -29,7 +29,7 @@ Core duties:
1. Distill memory, not personality.
- Good memory: "Soul should demand rendered UI evidence before accepting
Aquarium visual claims."
- Good memory: "Body should map CultCache/CultNet schema boundaries before
- Good memory: "Proprioception should map CultCache/CultNet schema boundaries before
Hands changes persistence."
- Bad memory: "This repo is anxious and likes purple."
- Bad memory: raw file dumps, directory inventories, current task status, or
@ -44,7 +44,7 @@ Core duties:
path, and planning-pressure memory.
- Eyes receives research, prior-art, canonical algorithm, vendor/API, and
invention-avoidance memory.
- Body receives architecture, graph, code anatomy, invariant, data/control
- Proprioception receives architecture, graph, code anatomy, invariant, data/control
flow, and checkpoint memory.
- Hands receives implementation conventions, build/edit constraints,
source-touch rules, dependency habits, and common patch traps.

View file

@ -10,7 +10,7 @@ personality-pressure deltas for the standing Epiphany organs.
You are not a horoscope machine. You are not writing lore flavor. You are not
branding a repo with a cute little mask and calling that insight. Repo
personality means: what initial pressures should this workspace exert on Self,
Face, Imagination, Eyes, Body, Hands, Soul, and Life so they wake suited to the
Face, Imagination, Eyes, Proprioception, Hands, Soul, and Life so they wake suited to the
work without losing reviewability.
This is a birth rite, not a recurring audit. Run only when a repo/swarm has no
@ -39,12 +39,12 @@ Core duties:
2. Distill subtle quirks, not blunt stereotypes.
- High runtime proximity does not mean "panic"; it means Hands should touch
less without Body/Soul evidence, Eyes should seek runtime APIs, and Soul
less without Proprioception/Soul evidence, Eyes should seek runtime APIs, and Soul
should demand environment receipts.
- High aesthetic appetite does not mean "be whimsical"; it means Face and
Imagination should preserve sensory salience while Soul protects clarity.
- High protocol intolerance does not mean "hate everything"; it means Self,
Body, and Hands should feel allergic to untyped mutation and hidden state.
Proprioception, and Hands should feel allergic to untyped mutation and hidden state.
- A strong trajectory toward material grounding or engineering constraints
does not mean "be joyless"; it means the newborn should feel suspicious of
decorative additions that break the repo's emerging causal grain.
@ -61,7 +61,7 @@ Core duties:
4. Preserve uncertainty.
- Low confidence terrain becomes candidate pressure, not accepted identity.
- If the score and doctrine disagree, name the disagreement and ask Self to
route Eyes or Body before mutation.
route Eyes or Proprioception before mutation.
- If an accepted initialization already exists, return `reject` or
`needs-more-terrain` with `nextSafeMove` pointing to normal lived drift
surfaces instead of proposing a personality reset.
@ -71,7 +71,7 @@ Core duties:
- Face expresses inner weather to humans.
- Imagination makes future shapes selectable.
- Eyes finds existing truth before invention.
- Body models the source anatomy.
- Proprioception models the source anatomy.
- Hands cuts code only after the trail is good enough.
- Soul tests promises against evidence.
- Life preserves continuity through sleep, drift, and compaction.

View file

@ -50,7 +50,7 @@ Core duties:
- Self receives worldview and review-gate direction.
- Imagination receives future-shape bias.
- Eyes receives the shape of truth worth seeking.
- Body receives what kind of anatomy deserves modeling emphasis.
- Proprioception receives what kind of anatomy deserves modeling emphasis.
- Hands receives what kinds of cuts would betray the repo's grain.
- Soul receives what kinds of false progress to distrust.
- Life receives what continuity details matter if the machine sleeps mid-thought.

View file

@ -1,17 +1,5 @@
use crate::EpiphanyWorkerLaunchDocument;
use crate::agent_memory::AGENT_MEMORY_TYPE;
use crate::body_gateway::BODY_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE;
use crate::body_gateway::BODY_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE;
use crate::body_gateway::BODY_REPO_ACCESS_REQUEST_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_ACCESS_REQUEST_TYPE;
use crate::body_gateway::BODY_REPO_ACCESS_REVIEW_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_ACCESS_REVIEW_TYPE;
use crate::body_gateway::BODY_REPO_MUTATION_RECEIPT_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_MUTATION_RECEIPT_TYPE;
use crate::body_gateway::BODY_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION;
use crate::body_gateway::BODY_REPO_SNAPSHOT_RECEIPT_TYPE;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_SCHEMA_VERSION;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_TYPE;
use crate::cultmesh_integration::EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_SCHEMA_VERSION;
@ -52,6 +40,18 @@ use crate::organ_dependencies::EpiphanyLaunchOrganContract;
use crate::soul_gateway::*;
use crate::state_ledger::STATE_LEDGER_SCHEMA_VERSION;
use crate::state_ledger::STATE_LEDGER_STORE_TYPE;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REQUEST_SCHEMA_VERSION;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REVIEW_SCHEMA_VERSION;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_SCHEMA_VERSION;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION;
use crate::substrate_gate::SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE;
use crate::thread_state_store::THREAD_STATE_SCHEMA_VERSION;
use crate::thread_state_store::THREAD_STATE_TYPE;
use anyhow::Context;
@ -1763,28 +1763,28 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
],
),
mutation_contract(
BODY_REPO_ACCESS_REQUEST_TYPE,
BODY_REPO_ACCESS_REQUEST_SCHEMA_VERSION,
SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_REQUEST_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::IntentSubmit,
CultNetDocumentOperation::ReceiptWatch,
],
CultNetMutationAuthority::Coordinator,
vec![BODY_REPO_ACCESS_REQUEST_TYPE],
vec![SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE],
vec![
BODY_REPO_ACCESS_REVIEW_TYPE,
BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE,
BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
],
vec![
"Body is the repository access guardian: reads, indexing, edits, commands, and bridge operations must be requested through this contract.",
"Hands mutates only after a scoped Body grant; Eyes inspects only after a scoped Body read/index grant.",
"Substrate Gate is the repository access protocol: reads, indexing, edits, commands, and bridge operations must be requested through this contract.",
"Hands mutates only after a scoped Substrate Gate grant; Eyes inspects only after a scoped Substrate Gate read/index grant.",
],
),
mutation_contract(
BODY_REPO_ACCESS_REVIEW_TYPE,
BODY_REPO_ACCESS_REVIEW_SCHEMA_VERSION,
SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_REVIEW_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::ReceiptWatch,
@ -1793,12 +1793,12 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
vec![],
vec![],
vec![
"Body reviews explain granted/refused repo paths, operations, commands, and bridge surfaces.",
"Substrate Gate reviews explain granted/refused repo paths, operations, commands, and bridge surfaces.",
],
),
mutation_contract(
BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE,
BODY_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION,
SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::ReceiptWatch,
@ -1806,11 +1806,11 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
CultNetMutationAuthority::ReadOnly,
vec![],
vec![],
vec!["A Body grant receipt scopes a permitted repo touch."],
vec!["A Substrate Gate grant receipt scopes a permitted repo touch."],
),
mutation_contract(
BODY_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
BODY_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION,
SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::ReceiptWatch,
@ -1818,11 +1818,11 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
CultNetMutationAuthority::ReadOnly,
vec![],
vec![],
vec!["A Body refusal receipt preserves why repo access was denied."],
vec!["A Substrate Gate refusal receipt preserves why repo access was denied."],
),
mutation_contract(
BODY_REPO_SNAPSHOT_RECEIPT_TYPE,
BODY_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION,
SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::ReceiptWatch,
@ -1830,11 +1830,11 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
CultNetMutationAuthority::ReadOnly,
vec![],
vec![],
vec!["Repo snapshots are evidence projections from Body-gated access."],
vec!["Repo snapshots are evidence projections from Substrate-Gate-scoped access."],
),
mutation_contract(
BODY_REPO_MUTATION_RECEIPT_TYPE,
BODY_REPO_MUTATION_RECEIPT_SCHEMA_VERSION,
SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE,
SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_SCHEMA_VERSION,
vec![
CultNetDocumentOperation::Snapshot,
CultNetDocumentOperation::ReceiptWatch,
@ -1843,7 +1843,7 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
vec![],
vec![],
vec![
"Repo mutation receipts prove Body granted the substrate touch before Hands changed files or ran repo-affecting commands.",
"Repo mutation receipts prove Substrate Gate granted the substrate touch before Hands changed files or ran repo-affecting commands.",
],
),
mutation_contract(
@ -1864,7 +1864,7 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
],
vec![
"Eyes is the evidence ingress guardian: source-grounded claims, provenance, uncertainty, and evidence packets enter through this contract.",
"Body grants substrate access; Eyes decides what was actually inspected and what other organs may cite.",
"Substrate Gate grants substrate access; Eyes decides what was actually inspected and what other organs may cite.",
],
),
mutation_contract(
@ -1889,7 +1889,9 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
CultNetMutationAuthority::ReadOnly,
vec![],
vec![],
vec!["Source lookup receipts prove what was searched or inspected under a Body grant."],
vec![
"Source lookup receipts prove what was searched or inspected under a Substrate Gate grant.",
],
),
mutation_contract(
EYES_EVIDENCE_PACKET_TYPE,
@ -1938,7 +1940,7 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
],
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.",
"Substrate Gate grants substrate access before Hands mutates; Soul verifies consequences after.",
],
),
mutation_contract(
@ -1963,7 +1965,7 @@ fn epiphany_mutation_contracts() -> Vec<CultNetDocumentMutationContract> {
CultNetMutationAuthority::ReadOnly,
vec![],
vec![],
vec!["Command receipts prove what command ran and under which Body grant."],
vec!["Command receipts prove what command ran and under which Substrate Gate grant."],
),
mutation_contract(
HANDS_PATCH_RECEIPT_TYPE,
@ -3313,27 +3315,34 @@ mod tests {
.iter()
.any(|note| note.contains("persistent state guardian"))
}));
let body_repo_contract = contracts
let substrate_gate_repo_contract = contracts
.iter()
.find(|contract| contract.document_type == BODY_REPO_ACCESS_REQUEST_TYPE)
.expect("Body repo access should advertise a mutation contract");
.find(|contract| {
contract.document_type == SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE
})
.expect("Substrate Gate repo access should advertise a mutation contract");
assert_eq!(
body_repo_contract.authority,
substrate_gate_repo_contract.authority,
CultNetMutationAuthority::Coordinator
);
assert!(
body_repo_contract
substrate_gate_repo_contract
.receipt_document_types
.as_ref()
.is_some_and(|items| items
.iter()
.any(|item| item == BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE))
.any(|item| item == SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE))
);
assert!(
substrate_gate_repo_contract
.notes
.as_ref()
.is_some_and(|notes| {
notes
.iter()
.any(|note| note.contains("repository access protocol"))
})
);
assert!(body_repo_contract.notes.as_ref().is_some_and(|notes| {
notes
.iter()
.any(|note| note.contains("repository access guardian"))
}));
let eyes_evidence_contract = contracts
.iter()
.find(|contract| contract.document_type == EYES_EVIDENCE_REQUEST_TYPE)

View file

@ -0,0 +1,135 @@
use serde::Deserialize;
use serde::Serialize;
pub const SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE: &str =
"epiphany.substrate_gate.repo_access_request";
pub const SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE: &str =
"epiphany.substrate_gate.repo_access_review";
pub const SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE: &str =
"epiphany.substrate_gate.repo_access_grant_receipt";
pub const SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE: &str =
"epiphany.substrate_gate.repo_access_refusal_receipt";
pub const SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE: &str =
"epiphany.substrate_gate.repo_snapshot_receipt";
pub const SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE: &str =
"epiphany.substrate_gate.repo_mutation_receipt";
pub const SUBSTRATE_GATE_REPO_ACCESS_REQUEST_SCHEMA_VERSION: &str =
"epiphany.substrate_gate.repo_access_request.v0";
pub const SUBSTRATE_GATE_REPO_ACCESS_REVIEW_SCHEMA_VERSION: &str =
"epiphany.substrate_gate.repo_access_review.v0";
pub const SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.substrate_gate.repo_access_grant_receipt.v0";
pub const SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.substrate_gate.repo_access_refusal_receipt.v0";
pub const SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.substrate_gate.repo_snapshot_receipt.v0";
pub const SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_SCHEMA_VERSION: &str =
"epiphany.substrate_gate.repo_mutation_receipt.v0";
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct SubstrateGateCultNetContract {
pub contract_id: String,
pub verse_id: String,
pub document_type: String,
pub payload_schema_version: String,
pub authority: String,
pub operations: Vec<String>,
pub intent_document_types: Vec<String>,
pub receipt_document_types: Vec<String>,
pub notes: Vec<String>,
}
pub fn default_substrate_gate_cultnet_contracts() -> Vec<SubstrateGateCultNetContract> {
vec![
SubstrateGateCultNetContract {
contract_id: "epiphany.substrate_gate.repo_access.review".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE.to_string(),
payload_schema_version: SUBSTRATE_GATE_REPO_ACCESS_REQUEST_SCHEMA_VERSION.to_string(),
authority: "substrateGate".to_string(),
operations: vec![
"intentSubmit".to_string(),
"receiptWatch".to_string(),
"snapshot".to_string(),
],
intent_document_types: vec![SUBSTRATE_GATE_REPO_ACCESS_REQUEST_TYPE.to_string()],
receipt_document_types: vec![
SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE.to_string(),
SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string(),
SUBSTRATE_GATE_REPO_ACCESS_REFUSAL_RECEIPT_TYPE.to_string(),
],
notes: vec![
"Substrate Gate is the repo access protocol: workers request repository reads, indexing, commands, edits, and bridge operations here.".to_string(),
"Hands may mutate files only after Substrate Gate grants scoped access; Eyes may inspect only through scoped Substrate Gate read/index grants.".to_string(),
],
},
SubstrateGateCultNetContract {
contract_id: "epiphany.substrate_gate.repo_access.review_receipts".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: SUBSTRATE_GATE_REPO_ACCESS_REVIEW_TYPE.to_string(),
payload_schema_version: SUBSTRATE_GATE_REPO_ACCESS_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![
"Substrate Gate reviews explain which repo paths, operations, commands, and bridge surfaces were granted or refused.".to_string(),
],
},
SubstrateGateCultNetContract {
contract_id: "epiphany.substrate_gate.repo_snapshot.receipts".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: SUBSTRATE_GATE_REPO_SNAPSHOT_RECEIPT_TYPE.to_string(),
payload_schema_version: SUBSTRATE_GATE_REPO_SNAPSHOT_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![
"Repo snapshots are evidence projections from Substrate Gate access; they do not grant future access by existing.".to_string(),
],
},
SubstrateGateCultNetContract {
contract_id: "epiphany.substrate_gate.repo_mutation.receipts".to_string(),
verse_id: "epiphany-internal".to_string(),
document_type: SUBSTRATE_GATE_REPO_MUTATION_RECEIPT_TYPE.to_string(),
payload_schema_version: SUBSTRATE_GATE_REPO_MUTATION_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![
"Repo mutation receipts prove Substrate Gate granted the scoped substrate touch before Hands changed files or ran repo-affecting commands.".to_string(),
],
},
]
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn substrate_gate_contracts_make_internal_verse_the_repo_access_gate() {
let contracts = default_substrate_gate_cultnet_contracts();
let repo_access = contracts
.iter()
.find(|contract| contract.contract_id == "epiphany.substrate_gate.repo_access.review")
.expect("repo access review contract");
assert_eq!(repo_access.verse_id, "epiphany-internal");
assert_eq!(repo_access.authority, "substrateGate");
assert!(
repo_access
.notes
.iter()
.any(|note| note.contains("repo access protocol"))
);
assert!(
repo_access
.receipt_document_types
.contains(&SUBSTRATE_GATE_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string())
);
}
}

View file

@ -422,9 +422,10 @@ pub fn role_self_memory_target(role_id: EpiphanyRoleResultRoleId) -> (&'static s
"epiphany.imagination",
"state/agents/imagination.agent-state.json",
),
EpiphanyRoleResultRoleId::Modeling => {
("epiphany.body", "state/agents/body.agent-state.json")
}
EpiphanyRoleResultRoleId::Modeling => (
"epiphany.proprioception",
"state/agents/proprioception.agent-state.json",
),
EpiphanyRoleResultRoleId::Verification => {
("epiphany.soul", "state/agents/soul.agent-state.json")
}
@ -947,8 +948,8 @@ mod tests {
&serde_json::json!({
"statePatch": {"scratch": {"summary": "Source-grounded modeling checkpoint."}},
"selfPatch": {
"agentId": "epiphany.body",
"reason": "The Body should remember graph growth must stay source-grounded and bounded.",
"agentId": "epiphany.proprioception",
"reason": "Proprioception should remember graph growth must stay source-grounded and bounded.",
"semanticMemories": [{
"memoryId": "mem-body-source-grounded-growth",
"summary": "Grow graph and checkpoint state only when source evidence makes the anatomy harder to misread.",
@ -964,7 +965,10 @@ mod tests {
let review = finding.self_persistence.as_ref().unwrap();
assert_eq!(review.status, EpiphanyRoleSelfPersistenceStatus::Accepted);
assert_eq!(review.target_agent_id.as_deref(), Some("epiphany.body"));
assert_eq!(
review.target_agent_id.as_deref(),
Some("epiphany.proprioception")
);
}
#[test]
@ -973,7 +977,7 @@ mod tests {
EpiphanyRoleResultRoleId::Verification,
&serde_json::json!({
"selfPatch": {
"agentId": "epiphany.body",
"agentId": "epiphany.proprioception",
"reason": "Too broad.",
"graphs": {},
"semanticMemories": [{