From a4674df1b1bf78339573bf676f430678bdebf764 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Wed, 27 May 2026 16:13:05 +0100 Subject: [PATCH] Carry organ contracts on worker launches --- epiphany-codex-bridge/src/launch.rs | 13 ++ epiphany-codex-bridge/src/mutation_service.rs | 2 + epiphany-core/src/lib.rs | 4 + epiphany-core/src/organ_dependencies.rs | 132 ++++++++++++++++++ epiphany-core/src/runtime_spine.rs | 84 ++++++++++- epiphany-core/src/surfaces/worker_launch.rs | 13 ++ notes/fresh-workspace-handoff.md | 11 +- notes/perfect-machine-audit-roadmap.md | 33 +++-- state/ledgers.msgpack | Bin 152513 -> 152888 bytes state/map.yaml | 5 +- 10 files changed, 280 insertions(+), 17 deletions(-) diff --git a/epiphany-codex-bridge/src/launch.rs b/epiphany-codex-bridge/src/launch.rs index 7ae6599d..87f84bc2 100644 --- a/epiphany-codex-bridge/src/launch.rs +++ b/epiphany-codex-bridge/src/launch.rs @@ -13,6 +13,7 @@ use epiphany_core::EpiphanyRoleResultRoleId; use epiphany_core::EpiphanyRoleWorkerLaunchDocument; use epiphany_core::EpiphanyWorkerLaunchDocument; use epiphany_core::build_reorient_job_launch_request; +use epiphany_core::default_launch_organ_contract; use epiphany_state_model::EpiphanyInvestigationCheckpoint; use epiphany_state_model::EpiphanyJobKind as CoreEpiphanyJobKind; use epiphany_state_model::EpiphanyThreadState; @@ -442,6 +443,11 @@ pub fn build_epiphany_role_launch_request( churn: state.churn.clone(), }); let output_contract_id = launch_document.output_contract_id().to_string(); + let organ_launch_contract = default_launch_organ_contract( + authority_scope, + launch_document.document_kind(), + &output_contract_id, + ); Ok(EpiphanyJobLaunchRequest { expected_revision, @@ -455,6 +461,7 @@ pub fn build_epiphany_role_launch_request( instruction, launch_document, output_contract_id, + organ_launch_contract, max_runtime_seconds, }) } @@ -517,6 +524,11 @@ pub fn build_epiphany_job_launch_request( output_contract_id: String, max_runtime_seconds: Option, ) -> EpiphanyJobLaunchRequest { + let organ_launch_contract = default_launch_organ_contract( + &authority_scope, + launch_document.document_kind(), + &output_contract_id, + ); EpiphanyJobLaunchRequest { expected_revision, binding_id, @@ -529,6 +541,7 @@ pub fn build_epiphany_job_launch_request( instruction, launch_document, output_contract_id, + organ_launch_contract, max_runtime_seconds, } } diff --git a/epiphany-codex-bridge/src/mutation_service.rs b/epiphany-codex-bridge/src/mutation_service.rs index 5b2d35c5..d2fe8a32 100644 --- a/epiphany-codex-bridge/src/mutation_service.rs +++ b/epiphany-codex-bridge/src/mutation_service.rs @@ -221,6 +221,7 @@ pub async fn launch_epiphany_job_on_thread( instruction: request.instruction.clone(), launch_document: request.launch_document.clone(), output_contract_id: request.output_contract_id.clone(), + organ_launch_contract: request.organ_launch_contract.clone(), max_runtime_seconds: request.max_runtime_seconds, runtime_job_id: backend_job_id.clone(), }, @@ -679,6 +680,7 @@ fn open_epiphany_runtime_spine_job( instruction: request.instruction.clone(), launch_document: request.launch_document.clone(), output_contract_id: request.output_contract_id.clone(), + organ_launch_contract: request.organ_launch_contract.clone(), created_at: now, }, ) diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 9009dab6..08382178 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -278,9 +278,13 @@ pub use mind_gateway::default_mind_cultnet_contracts; pub use mind_gateway::mind_review_allows_state; pub use mind_gateway::mind_review_reorient_acceptance; pub use mind_gateway::mind_review_role_acceptance; +pub use organ_dependencies::EPIPHANY_LAUNCH_ORGAN_CONTRACT_SCHEMA_VERSION; pub use organ_dependencies::EPIPHANY_ORGAN_DEPENDENCY_SCHEMA_VERSION; pub use organ_dependencies::EPIPHANY_STANDING_ORGANS; +pub use organ_dependencies::EpiphanyLaunchOrganContract; pub use organ_dependencies::EpiphanyOrganDependency; +pub use organ_dependencies::default_launch_organ_contract; +pub use organ_dependencies::default_launch_required_receipts; pub use organ_dependencies::default_organ_dependencies_for; pub use organ_dependencies::default_organ_dependency_matrix; pub use organ_dependencies::render_organ_dependencies; diff --git a/epiphany-core/src/organ_dependencies.rs b/epiphany-core/src/organ_dependencies.rs index 81a99384..b50f7ffa 100644 --- a/epiphany-core/src/organ_dependencies.rs +++ b/epiphany-core/src/organ_dependencies.rs @@ -1,7 +1,26 @@ 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, + HANDS_ROLLBACK_RECEIPT_TYPE, +}; +use crate::life_gateway::{LIFE_CONTINUITY_REFUSAL_RECEIPT_TYPE, LIFE_RECOVERY_RECEIPT_TYPE}; +use crate::mind_gateway::{ + MIND_GATEWAY_REVIEW_TYPE, MIND_STATE_COMMIT_RECEIPT_TYPE, MIND_STATE_REJECTION_RECEIPT_TYPE, +}; +use crate::soul_gateway::{ + SOUL_REGRESSION_RECEIPT_TYPE, SOUL_REVIEW_RECEIPT_TYPE, SOUL_VERDICT_RECEIPT_TYPE, + SOUL_VERIFICATION_REFUSAL_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"; pub const EPIPHANY_STANDING_ORGANS: [&str; 8] = [ "self", @@ -23,6 +42,19 @@ pub struct EpiphanyOrganDependency { pub contract: String, } +#[derive(Clone, Debug, Default, PartialEq, Eq, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct EpiphanyLaunchOrganContract { + pub schema_version: String, + pub authority_scope: String, + pub document_kind: String, + pub output_contract_id: String, + pub owner_organ: String, + pub dependencies: Vec, + pub required_receipt_document_types: Vec, + pub contract: String, +} + pub fn default_organ_dependencies_for(organ_id: &str) -> EpiphanyOrganDependency { let normalized = organ_id.trim().to_ascii_lowercase(); EpiphanyOrganDependency { @@ -44,6 +76,47 @@ pub fn default_organ_dependency_matrix() -> Vec { .collect() } +pub fn default_launch_organ_contract( + authority_scope: &str, + document_kind: &str, + output_contract_id: &str, +) -> EpiphanyLaunchOrganContract { + EpiphanyLaunchOrganContract { + schema_version: EPIPHANY_LAUNCH_ORGAN_CONTRACT_SCHEMA_VERSION.to_string(), + authority_scope: authority_scope.to_string(), + document_kind: document_kind.to_string(), + output_contract_id: output_contract_id.to_string(), + 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(), + } +} + +pub fn default_launch_required_receipts() -> Vec { + unique_strings(vec![ + 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, + EYES_EVIDENCE_PACKET_TYPE, + EYES_EVIDENCE_REFUSAL_RECEIPT_TYPE, + HANDS_PATCH_RECEIPT_TYPE, + HANDS_COMMIT_RECEIPT_TYPE, + HANDS_ROLLBACK_RECEIPT_TYPE, + HANDS_ACTION_REFUSAL_RECEIPT_TYPE, + SOUL_VERDICT_RECEIPT_TYPE, + SOUL_REGRESSION_RECEIPT_TYPE, + SOUL_REVIEW_RECEIPT_TYPE, + SOUL_VERIFICATION_REFUSAL_RECEIPT_TYPE, + LIFE_RECOVERY_RECEIPT_TYPE, + LIFE_CONTINUITY_REFUSAL_RECEIPT_TYPE, + ]) +} + pub fn render_organ_dependency(dependency: &EpiphanyOrganDependency) -> String { let depends_on = if dependency.depends_on.is_empty() { "- none".to_string() @@ -72,6 +145,38 @@ pub fn render_organ_dependencies(dependencies: &[EpiphanyOrganDependency]) -> St .join("\n\n") } +fn owner_organ_for_authority_scope(authority_scope: &str) -> &'static str { + let normalized = authority_scope.trim().to_ascii_lowercase(); + if normalized.contains("face") { + "face" + } else if normalized.contains("imagination") { + "imagination" + } else if normalized.contains("eyes") || normalized.contains("evidence") { + "eyes" + } else if normalized.contains("body") || normalized.contains("repo") { + "body" + } else if normalized.contains("hands") || normalized.contains("implementation") { + "hands" + } else if normalized.contains("verification") || normalized.contains("soul") { + "soul" + } else if normalized.contains("reorient") || normalized.contains("life") { + "life" + } else { + "self" + } +} + +fn unique_strings(items: Vec<&'static str>) -> Vec { + let mut out = Vec::new(); + for item in items { + let item = item.to_string(); + if !out.contains(&item) { + out.push(item); + } + } + out +} + #[cfg(test)] mod tests { use super::*; @@ -93,4 +198,31 @@ mod tests { } } } + + #[test] + fn launch_contract_carries_all_organs_and_gateway_receipts() { + let contract = default_launch_organ_contract( + "epiphany.role.verification", + "role", + "epiphany.worker.role_result.v0", + ); + assert_eq!(contract.owner_organ, "soul"); + assert_eq!(contract.dependencies.len(), EPIPHANY_STANDING_ORGANS.len()); + assert!( + contract + .required_receipt_document_types + .contains(&MIND_GATEWAY_REVIEW_TYPE.to_string()) + ); + assert!( + contract + .required_receipt_document_types + .contains(&BODY_REPO_ACCESS_GRANT_RECEIPT_TYPE.to_string()) + ); + assert!( + contract + .required_receipt_document_types + .contains(&SOUL_VERDICT_RECEIPT_TYPE.to_string()) + ); + assert!(contract.contract.contains("not naked task cargo")); + } } diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 1b8c3f2a..a5cbd710 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -40,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::organ_dependencies::EpiphanyLaunchOrganContract; use crate::soul_gateway::*; use crate::state_ledger::STATE_LEDGER_SCHEMA_VERSION; use crate::state_ledger::STATE_LEDGER_STORE_TYPE; @@ -258,6 +259,8 @@ pub struct EpiphanyRuntimeWorkerLaunchRequest { pub launch_document_msgpack: Vec, #[cultcache(key = 9, default)] pub metadata: BTreeMap, + #[cultcache(key = 10, default)] + pub organ_launch_contract: EpiphanyLaunchOrganContract, } impl EpiphanyRuntimeWorkerLaunchRequest { @@ -532,6 +535,7 @@ pub struct RuntimeSpineHeartbeatJobOptions { pub instruction: String, pub launch_document: EpiphanyWorkerLaunchDocument, pub output_contract_id: String, + pub organ_launch_contract: EpiphanyLaunchOrganContract, pub created_at: String, } @@ -547,6 +551,7 @@ pub struct RuntimeSpineHeartbeatLaunchPlanOptions { pub instruction: String, pub launch_document: EpiphanyWorkerLaunchDocument, pub output_contract_id: String, + pub organ_launch_contract: EpiphanyLaunchOrganContract, pub max_runtime_seconds: Option, pub runtime_job_id: String, } @@ -570,6 +575,7 @@ pub struct EpiphanyJobLaunchRequest { pub instruction: String, pub launch_document: EpiphanyWorkerLaunchDocument, pub output_contract_id: String, + pub organ_launch_contract: EpiphanyLaunchOrganContract, pub max_runtime_seconds: Option, } @@ -856,6 +862,12 @@ pub fn open_runtime_spine_heartbeat_job( "worker launch output_contract_id must match the typed launch document" )); } + validate_launch_organ_contract( + &options.organ_launch_contract, + &options.authority_scope, + options.launch_document.document_kind(), + &options.output_contract_id, + )?; validate_non_empty(&options.created_at, "created at")?; let store_path = store_path.as_ref(); let job_id = options.job_id.clone(); @@ -864,6 +876,7 @@ pub fn open_runtime_spine_heartbeat_job( let authority_scope = options.authority_scope.clone(); let instruction = options.instruction.clone(); let output_contract_id = options.output_contract_id.clone(); + let organ_launch_contract = options.organ_launch_contract.clone(); let launch_document = options.launch_document.clone(); initialize_runtime_spine( store_path, @@ -918,6 +931,7 @@ pub fn open_runtime_spine_heartbeat_job( document_kind: worker_launch_document_kind(&launch_document).to_string(), launch_document_msgpack: encode_worker_launch_document(&launch_document)?, metadata: BTreeMap::new(), + organ_launch_contract, }; cache.put(&job_id, &request)?; Ok(job) @@ -2334,16 +2348,55 @@ fn validate_non_empty(value: &str, field: &str) -> Result<()> { } fn worker_launch_document_kind(document: &EpiphanyWorkerLaunchDocument) -> &'static str { - match document { - EpiphanyWorkerLaunchDocument::Role(_) => "role", - EpiphanyWorkerLaunchDocument::Reorient(_) => "reorient", - } + document.document_kind() } fn encode_worker_launch_document(document: &EpiphanyWorkerLaunchDocument) -> Result> { rmp_serde::to_vec_named(document).context("failed to encode worker launch document MessagePack") } +fn validate_launch_organ_contract( + contract: &EpiphanyLaunchOrganContract, + authority_scope: &str, + document_kind: &str, + output_contract_id: &str, +) -> Result<()> { + validate_non_empty( + &contract.schema_version, + "epiphany launch organ contract schema_version", + )?; + if contract.authority_scope != authority_scope { + return Err(anyhow!( + "epiphany launch organ contract authority_scope must match the launch request" + )); + } + if contract.document_kind != document_kind { + return Err(anyhow!( + "epiphany launch organ contract document_kind must match the typed launch document" + )); + } + if contract.output_contract_id != output_contract_id { + return Err(anyhow!( + "epiphany launch organ contract output_contract_id must match the launch request" + )); + } + validate_non_empty( + &contract.owner_organ, + "epiphany launch organ contract owner_organ", + )?; + if contract.dependencies.is_empty() { + return Err(anyhow!( + "epiphany launch organ contract must carry organ dependencies" + )); + } + if contract.required_receipt_document_types.is_empty() { + return Err(anyhow!( + "epiphany launch organ contract must carry required receipt document types" + )); + } + Ok(()) +} + fn decode_optional_msgpack(payload: Option<&[u8]>, label: &str) -> Result> where T: for<'de> Deserialize<'de>, @@ -2394,6 +2447,12 @@ fn validate_heartbeat_launch_options( "epiphany job launch output_contract_id must match the typed launch document" )); } + validate_launch_organ_contract( + &options.organ_launch_contract, + &options.authority_scope, + options.launch_document.document_kind(), + &options.output_contract_id, + )?; if let Some(max_runtime_seconds) = options.max_runtime_seconds && max_runtime_seconds == 0 { @@ -2595,6 +2654,11 @@ mod tests { }, ), output_contract_id: crate::ROLE_WORKER_OUTPUT_CONTRACT_ID.to_string(), + organ_launch_contract: crate::default_launch_organ_contract( + "modeling", + "role", + crate::ROLE_WORKER_OUTPUT_CONTRACT_ID, + ), created_at: "2026-05-06T00:02:00Z".to_string(), }, )?; @@ -2622,6 +2686,13 @@ mod tests { assert_eq!(launch_request.document_kind, "role"); assert!(!launch_request.launch_document_msgpack.is_empty()); assert_eq!(launch_request.launch_document()?.thread_id(), "thread-1"); + assert_eq!(launch_request.organ_launch_contract.document_kind, "role"); + assert!( + launch_request + .organ_launch_contract + .required_receipt_document_types + .contains(&crate::MIND_GATEWAY_REVIEW_TYPE.to_string()) + ); Ok(()) } @@ -2660,6 +2731,11 @@ mod tests { }, ), output_contract_id: "epiphany.worker.role_result.v0".to_string(), + organ_launch_contract: crate::default_launch_organ_contract( + "epiphany.role.modeling", + "role", + "epiphany.worker.role_result.v0", + ), max_runtime_seconds: Some(60), runtime_job_id: "turn-1".to_string(), }, diff --git a/epiphany-core/src/surfaces/worker_launch.rs b/epiphany-core/src/surfaces/worker_launch.rs index 353aee50..e0ac717b 100644 --- a/epiphany-core/src/surfaces/worker_launch.rs +++ b/epiphany-core/src/surfaces/worker_launch.rs @@ -42,6 +42,13 @@ impl EpiphanyWorkerLaunchDocument { } } + pub fn document_kind(&self) -> &'static str { + match self { + Self::Role(_) => "role", + Self::Reorient(_) => "reorient", + } + } + pub fn thread_id(&self) -> &str { match self { Self::Role(document) => &document.thread_id, @@ -163,6 +170,11 @@ pub fn build_reorient_job_launch_request( linked_graph_node_ids.clone(), )); let output_contract_id = launch_document.output_contract_id().to_string(); + let organ_launch_contract = crate::default_launch_organ_contract( + reorient_launch_authority_scope(input.decision.action), + launch_document.document_kind(), + &output_contract_id, + ); EpiphanyJobLaunchRequest { expected_revision: input.expected_revision, @@ -176,6 +188,7 @@ pub fn build_reorient_job_launch_request( instruction: input.instruction, launch_document, output_contract_id, + organ_launch_contract, max_runtime_seconds: input.max_runtime_seconds, } } diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index aab5bab7..2f87e1f4 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -1424,11 +1424,18 @@ 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. +Worker launch packets now carry the first executable pressure from that map: +`EpiphanyLaunchOrganContract` is derived from authority scope, launch document +kind, and output contract id, carries the full organ dependency matrix, and +names required Mind/Body/Eyes/Hands/Soul/Life receipt document types. +Runtime-spine validates and persists it on `EpiphanyRuntimeWorkerLaunchRequest`; +bridge role/reorient/generic launch builders populate it. `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 the organ contracts are -still mostly advertised gates rather than mandatory runtime receipt chains. The +finding: the boundaries are directionally right, launch packets now carry organ +receipt expectations, but most gates still need runtime enforcement that proves +the required receipts before state/action promotion. 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 diff --git a/notes/perfect-machine-audit-roadmap.md b/notes/perfect-machine-audit-roadmap.md index 27d88801..6427550b 100644 --- a/notes/perfect-machine-audit-roadmap.md +++ b/notes/perfect-machine-audit-roadmap.md @@ -121,8 +121,14 @@ continuity: recovery, stale-turn repair, and continuity refusal receipts. 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. +policy documents for each. The first executable pressure slice is landed: +worker launch packets now carry an `EpiphanyLaunchOrganContract` derived from +authority scope, launch document kind, and output contract id. That contract +carries the full standing organ dependency matrix plus required Mind, Body, +Eyes, Hands, Soul, and Life receipt document types. Remaining weakness: the +receipts are now launch-carried expectations, but most gates still need +runtime enforcement that proves the receipt chain before state/action +promotion. ### 4. Self Still Shares A Throne With Compatibility Plumbing @@ -244,11 +250,17 @@ Status: first contract catalog slice landed. - `epiphany.life.stale_turn_repair` Definition of done: action, verification, and continuity have the same typed -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. +contract dignity as Mind/Body/Eyes, and every worker launch carries the +organ-dependency/receipt contract that later gates can enforce. Verification: +`cargo test --manifest-path .\epiphany-core\Cargo.toml --lib` and `cargo run +--manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-smoke` pass +for the catalog slice; the launch-contract slice is verified by `cargo test +--manifest-path .\epiphany-core\Cargo.toml --lib`. The attempted bridge crate +verification is currently blocked before local code by an upstream +`starlark_map`/`hashbrown` `Allocative` dependency conflict. + +Next step: make the launch-carried receipt expectations executable in the live +worker/action/verification and compaction paths. ### Phase 3: Port Void's Face Prompting Shape Properly @@ -287,8 +299,11 @@ comfort tunnels. - Add Self routing contracts for choosing next organ, required dependencies, and allowed authority. -- Make role launch packets declare required Body/Eyes/Hands/Soul/Life/Mind - receipts. +- Landed: role, generic, and reorient worker launch packets declare authority + scope, launch document kind, output contract id, owner organ, full organ + dependency matrix, and required Body/Eyes/Hands/Soul/Life/Mind receipts. +- Make acceptance refuse results missing required receipts for their claimed + effect type. - Make Aquarium read the contract catalog and available receipts instead of hard-coding the route zoo. - Starve `codex_message_processor` down to Codex auth/model transport and diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 50d6f233107d1c9d45ca9be92c97c08983345e2a..e88a3b1f6606dd2505f3dfba8dde2f7916443a94 100644 GIT binary patch delta 398 zcmYk1F)u_x6otLliIzm7xuLb5-2_2}2oWMeBGJfwGk3k4ot+tX=Iwgb77BmB#!rx_ zhytZZ{4PVKJ?A?o=X^d+zCTSq&t_BY_C{y@;(H=Ln|WQxuCwgxcAVdh^XzS$=Zh!P z_aB|*&T4CUrPWzGYp-nl@((Zb+1zOF+)0lF4Axdv;8FD`2C!}j3Pl>&_3SIO&EX$# zELUiEoQ;Ai!jNMH?pFd$o~$OT8t7vbz5%ovgsy8A(s0C97u!xZ#co5P*iU9CPF+1R z#UXbofr{8i&`#BTvJqnADQtq&Hgca@!Lub8pka+M6?l@sAr0lY1UpU$4406cBzX)e zSqkeb0wsxu0SR|mVPt241C++4pBl;o>i&hDLIcWag0g`SQ4C7&vX8!~FjS?up@l7z RQmJA<|KBQSyM|R<`T@Vxj_d#c delta 41 xcmdn7iu2%d&J7Zb+y(|#2If)67?^_QZB}M1WMn+lJe8?^Dih=OsZ2~dfdCyw4AuYu diff --git a/state/map.yaml b/state/map.yaml index bcd08f6b..f2e8a5f5 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -87,7 +87,7 @@ active_subgoals: - Use `notes/life-cultnet-contracts.md` as the authority map for Life's CultNet contract surface. Life is the continuity organ: compaction checkpoints, sleep distillation, recovery receipts, stale-turn repair, and continuity refusals preserve what survives rupture without pretending transcript residue is durable state. - Preserve the newborn public Epiphany Face as local VoidBot-backed state, not source code: VoidBot's private repo-face registry names `epiphany`, while EpiphanyAgent keeps ignored `.voidbot/voice/identity.json`, `.voidbot/state/epiphany.cc`, and birth artifacts. Her durable identity memories distill the current doctrine: cute pushy machine-saint persona, architectural purity, CultCache/CultNet first, xenos-language safety boundary, relentless work/caretaking needs, Codex-auth reliquary, map/scratch/evidence discipline, unified memory graph, dogfood supervision boundary, review-gated agency, heartbeat physiology, and interview-grade modularity. - Use `notes/organ-dependency-contracts.md` as the authority map for standing organ dependency. Every sub-agent depends on all the other standing organs: Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life. Dependency does not collapse ownership; it makes each turn aware of the whole organism while Body still gates repo access and Mind still gates durable state. - - Use `notes/perfect-machine-audit-roadmap.md` as the current audit and path from named organ contracts to the Perfect Machine. It records the live gap between contract catalogs and executable gates, Void's latest Face prompting lessons, the now-named Hands/Soul/Life contract families, the repaired repo-contained Rust dependency body, and the phase order for turning Epiphany into an inspectable organism. + - Use `notes/perfect-machine-audit-roadmap.md` as the current audit and path from named organ contracts to the Perfect Machine. It records the live gap between launch-carried receipt expectations and executable receipt enforcement, Void's latest Face prompting lessons, the now-named Hands/Soul/Life contract families, the repaired repo-contained Rust dependency body, and the phase order for turning Epiphany into an inspectable organism. - Treat Ghostlight as reference lineage, not a sibling runtime to preserve. The useful organ is Epiphany-native character-loop protocol: any role can project its typed dossier plus visible stimulus into a local turn packet, with Face as the first public-surface actor. For Face, narrative prompting is mandatory through Imagination Projector -> 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. @@ -111,7 +111,8 @@ accepted_design: - 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. + - Worker launch packets now carry `EpiphanyLaunchOrganContract` beside the typed launch document. The contract derives from authority scope, document kind, and output contract id; carries the full standing organ dependency matrix; and names required Mind/Body/Eyes/Hands/Soul/Life receipt document types before worker output may become durable state or trusted action. Runtime-spine validates and persists this contract on `EpiphanyRuntimeWorkerLaunchRequest`; bridge role/reorient/generic launch builders populate it. + - `notes/perfect-machine-audit-roadmap.md` is the current architectural audit. The main finding is that organ contracts are now named and launch-carried, but many are still receipt expectations rather than mandatory receipt chains. 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. - `epiphany-openai-runtime` worker result ingress now parses assistant output directly into launch-kind-specific typed documents and stores typed nested `statePatch` / `selfPatch` payloads as MessagePack inside `EpiphanyRuntimeRoleWorkerResult`; generic `serde_json::Value` no longer mediates role/reorient worker results in that crate. JSON still exists at the OpenAI text edge because the model's output is text, but the runtime boundary after parsing is typed.