From e9631cd8b2df5e6a0d1d007fc9271a935a2ca130 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 22 May 2026 23:31:14 +0100 Subject: [PATCH] Pin Epiphany-Codex bridge boundary --- epiphany-codex-bridge/src/lib.rs | 17 +++++++++++++++++ epiphany-codex-bridge/src/mutation_service.rs | 13 +++++++++++++ epiphany-core/src/runtime_spine.rs | 4 ++-- ...epiphany.swarm-control-receipt.schema.json | 2 +- state/ledgers.msgpack | Bin 149093 -> 149403 bytes 5 files changed, 33 insertions(+), 3 deletions(-) diff --git a/epiphany-codex-bridge/src/lib.rs b/epiphany-codex-bridge/src/lib.rs index 22fbd62b..cbe37e65 100644 --- a/epiphany-codex-bridge/src/lib.rs +++ b/epiphany-codex-bridge/src/lib.rs @@ -1,3 +1,20 @@ +//! Compatibility bridge between Epiphany's typed CultNet/CultCache-shaped +//! contracts and the vendored Codex JSON-RPC/app-server shell. +//! +//! This crate is a bridge, not an authority organ. Its job is to translate +//! Codex `ThreadEpiphany*` DTOs into Epiphany core documents, project typed +//! Epiphany surfaces back into legacy Codex responses, and call the narrow +//! host trait needed while Codex still owns thread persistence. Verdicts, +//! launch policy, reorientation policy, acceptance rules, runtime-spine +//! lifecycle semantics, and durable state invariants belong in `epiphany-core` +//! or `epiphany-state-model`. +//! +//! Host facts and side effects that still pass through this crate are +//! quarantine scaffolding for the current Codex shell. Do not let them become +//! a second policy throne. The long cut is to replace these adapters with +//! native CultNet intents and receipts, leaving Codex only as the OpenAI +//! subscription auth/model transport reliquary. + pub mod checkpoint; pub mod context; pub mod context_protocol; diff --git a/epiphany-codex-bridge/src/mutation_service.rs b/epiphany-codex-bridge/src/mutation_service.rs index b5d429c6..5b2d35c5 100644 --- a/epiphany-codex-bridge/src/mutation_service.rs +++ b/epiphany-codex-bridge/src/mutation_service.rs @@ -59,13 +59,23 @@ use uuid::Uuid; #[allow(async_fn_in_trait)] pub trait EpiphanyMutationHost { + /// Read the Codex-hosted compatibility snapshot. + /// + /// The bridge may request host state so core can evaluate typed policy. The + /// host snapshot is an input fact, not a bridge-owned source of truth. async fn epiphany_state(&self) -> Option; async fn epiphany_reference_turn_id(&self) -> Option; + /// Persist a state document already validated by Epiphany core policy. + /// + /// This is the Codex JSON-RPC shell's current persistence hook. It must not + /// grow mutation policy of its own. async fn epiphany_persist_state( &self, next_state: EpiphanyThreadState, ) -> BridgeResult; + /// Locate the native runtime-spine store while Codex still hosts the turn. async fn epiphany_runtime_spine_store_path(&self) -> PathBuf; + /// Project the already-typed state into Codex's current client-visible view. async fn client_visible_epiphany_state( &self, fallback: EpiphanyThreadState, @@ -190,6 +200,9 @@ pub async fn launch_epiphany_job_on_thread( thread: &impl EpiphanyMutationHost, request: EpiphanyJobLaunchRequest, ) -> BridgeResult { + // Compatibility choreography only: core validates the launch plan and + // runtime-spine opens the typed job. The bridge stitches those typed + // documents into Codex's JSON-RPC thread shell until CultNet owns the route. let current_state = thread.epiphany_state().await.unwrap_or_default(); validate_expected_revision(request.expected_revision, current_state.revision)?; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 35e98064..8301648d 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -1387,8 +1387,8 @@ fn epiphany_mutation_contracts() -> Vec { vec![RUNTIME_JOB_TYPE], vec![ "Worker launch requests are typed task-intent documents; runtime jobs are lifecycle receipts, not the source of work intent.", - "Core/coordinator policy owns the launch yes/no; transport bridges translate and carry orders/receipts only.", - "Host executors gather host facts and perform side effects after the verdict, with readable receipts.", + "Core/coordinator policy owns the launch yes/no; the Epiphany-Codex bridge translates between CultNet-shaped intent and Codex JSON only.", + "Codex-hosted executors may gather host facts and perform side effects after the verdict, with readable receipts.", ], ), mutation_contract( diff --git a/schemas/cultnet/epiphany.swarm-control-receipt.schema.json b/schemas/cultnet/epiphany.swarm-control-receipt.schema.json index f1cefd98..f36f4f5b 100644 --- a/schemas/cultnet/epiphany.swarm-control-receipt.schema.json +++ b/schemas/cultnet/epiphany.swarm-control-receipt.schema.json @@ -24,7 +24,7 @@ }, "transportRole": { "type": "string", - "description": "What the transport bridge did for this action. Expected values are translate, carryOrder, carryReceipt, or a '+' joined combination. It must not make the launch/reorient verdict, gather host facts, or execute side effects." + "description": "What the Epiphany-Codex transport bridge did for this action. Expected values are translateCultNetToCodexJson, translateCodexJsonToCultNet, carryOrder, carryReceipt, or a '+' joined combination. It must not make the launch/reorient verdict, gather host facts, or execute side effects." }, "hostExecutorRole": { "type": [ diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 55334a5db499913b1febe95aaff560e3200c6a2f..085a1f7c19a322733f6cc1c1b35295a8de92798a 100644 GIT binary patch delta 324 zcmZXQze>bF5Qo_-gzE(hn-Q@yCa!;qSVj>n&O@)V+hiy1!n&KwPS8{q7B+&y2`PLE zL6AI<58xZPcgIy$!@zv={bqh%h99rPx9!2X_}rN?)<1RZxnu0RV}t&5{k`W2KaP^4 zi1P{O>A`-Q%(nO@UmI&{Q35FhQBWfcoK?C~!nRT7BtAf1Yk7;1yT(dUw`upAvW-XW zp>TJVAf0QYsRgQq^(OSrLXLEgXd!D1jgaDb%|xLv@=8>}wo-&0Hh=|r5LUuccyWC> zimt|4T-A