From 2ea573769b87bbf78f67e0f78e3381c519399c52 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 2 Jun 2026 13:15:27 +0100 Subject: [PATCH] Add local Verse context query --- epiphany-core/src/bin/epiphany-verse-query.rs | 96 +++++++ epiphany-core/src/cultmesh_integration.rs | 234 ++++++++++++++++++ epiphany-core/src/lib.rs | 4 + notes/epiphany-fork-implementation-plan.md | 1 + notes/epiphany-verse-architecture.md | 175 +++++++++++++ notes/fresh-workspace-handoff.md | 3 +- state/ledgers.msgpack | Bin 172224 -> 172518 bytes state/map.yaml | 1 + 8 files changed, 513 insertions(+), 1 deletion(-) create mode 100644 epiphany-core/src/bin/epiphany-verse-query.rs create mode 100644 notes/epiphany-verse-architecture.md diff --git a/epiphany-core/src/bin/epiphany-verse-query.rs b/epiphany-core/src/bin/epiphany-verse-query.rs new file mode 100644 index 00000000..48577e96 --- /dev/null +++ b/epiphany-core/src/bin/epiphany-verse-query.rs @@ -0,0 +1,96 @@ +use anyhow::Context; +use anyhow::Result; +use chrono::Utc; +use epiphany_core::query_epiphany_local_verse_context; +use epiphany_core::seed_epiphany_local_verse_context; +use serde_json::json; +use std::env; +use std::path::PathBuf; + +fn main() -> Result<()> { + let args = Args::parse()?; + match args.command.as_str() { + "seed" => { + seed_epiphany_local_verse_context( + &args.store, + args.runtime_id.clone(), + Utc::now().to_rfc3339(), + )?; + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id)?; + println!("{}", serde_json::to_string_pretty(&context)?); + } + "query" => { + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id)?; + println!("{}", serde_json::to_string_pretty(&context)?); + } + "smoke" => { + seed_epiphany_local_verse_context( + &args.store, + args.runtime_id.clone(), + "2026-06-02T00:00:00Z", + )?; + let context = query_epiphany_local_verse_context(&args.store, args.runtime_id)?; + if context.verse_policies.len() != 3 { + anyhow::bail!("local Verse query smoke expected three Verse policies"); + } + if !context.verse_policies.iter().any(|policy| { + policy.verse_id == "gamecult-local" && policy.yggdrasil_tunnel_allowed + }) { + anyhow::bail!("local Verse query smoke lost Yggdrasil tunnel policy"); + } + if context.contract_summaries.len() < 6 { + anyhow::bail!("local Verse query smoke expected organ contract summaries"); + } + println!( + "{}", + serde_json::to_string_pretty(&json!({ + "status": "ok", + "store": args.store, + "runtimeId": context.runtime_id, + "verses": context.verse_policies.len(), + "globalRooms": context.global_room_policies.len(), + "contracts": context.contract_summaries.len(), + }))? + ); + } + other => anyhow::bail!("unknown command {other:?}; use seed, query, or smoke"), + } + Ok(()) +} + +struct Args { + command: String, + store: PathBuf, + runtime_id: String, +} + +impl Args { + fn parse() -> Result { + let mut values = env::args().skip(1); + let command = values.next().unwrap_or_else(|| "query".to_string()); + let mut store = PathBuf::from(".epiphany-run/cultmesh/epiphany-local.ccmp"); + let mut runtime_id = "epiphany-local".to_string(); + + while let Some(arg) = values.next() { + match arg.as_str() { + "--store" => { + store = PathBuf::from(values.next().context("missing --store value")?); + } + "--runtime-id" => { + runtime_id = values.next().context("missing --runtime-id value")?; + } + _ => anyhow::bail!("unknown argument {arg:?}"), + } + } + + if let Some(parent) = store.parent() { + std::fs::create_dir_all(parent)?; + } + + Ok(Self { + command, + store, + runtime_id, + }) + } +} diff --git a/epiphany-core/src/cultmesh_integration.rs b/epiphany-core/src/cultmesh_integration.rs index eafcaa3f..a8af8715 100644 --- a/epiphany-core/src/cultmesh_integration.rs +++ b/epiphany-core/src/cultmesh_integration.rs @@ -11,6 +11,7 @@ use cultmesh_rs::CultMesh; use cultmesh_rs::CultMeshNode; use cultmesh_rs::CultMeshNodeOptions; use cultmesh_rs::cultmesh_documents; +use serde::Serialize; use serde_json::Value; use std::path::Path; @@ -464,6 +465,36 @@ pub struct EpiphanyCultMeshContinuityContractEntry { pub notes: Vec, } +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct EpiphanyLocalVerseContext { + pub schema_version: String, + pub runtime_id: String, + pub store_path: String, + pub summary: String, + pub odin_scope: String, + pub yggdrasil_scope: String, + pub prompt_assembly_note: String, + pub verse_policies: Vec, + pub global_room_policies: Vec, + pub operator_status: Option, + pub latest_operator_snapshot: Option, + pub latest_operator_run_intent: Option, + pub latest_operator_run_receipt: Option, + pub contract_summaries: Vec, +} + +#[derive(Clone, Debug, PartialEq, Eq, Serialize)] +#[serde(rename_all = "camelCase")] +pub struct EpiphanyLocalVerseContractSummary { + pub contract_id: String, + pub verse_id: String, + pub authority: String, + pub document_type: String, + pub operations: Vec, + pub receipt_document_types: Vec, +} + cultmesh_documents!(EpiphanyCultMeshDocuments { EpiphanyCultMeshStatusEntry => EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION, EpiphanyCultMeshOperatorStatusEntry => EPIPHANY_CULTMESH_OPERATOR_STATUS_SCHEMA_VERSION, @@ -683,6 +714,177 @@ pub fn load_latest_epiphany_cultmesh_operator_run_receipt( node.get(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_LATEST_KEY) } +pub fn seed_epiphany_local_verse_context( + store_path: impl AsRef, + runtime_id: impl Into, + generated_at_utc: impl Into, +) -> Result<()> { + let store_path = store_path.as_ref(); + let runtime_id = runtime_id.into(); + let status = EpiphanyCultMeshStatusEntry { + schema_version: EPIPHANY_CULTMESH_STATUS_SCHEMA_VERSION.to_string(), + runtime_id: runtime_id.clone(), + verse_id: EPIPHANY_CULTMESH_INTERNAL_VERSE_ID.to_string(), + verse_tier: EPIPHANY_CULTMESH_INTERNAL_TIER.to_string(), + app_id: "epiphany".to_string(), + note: "Epiphany local Verse query context is typed CultMesh state; prompt assembly may read it, but Mind still owns durable adoption.".to_string(), + }; + write_epiphany_cultmesh_status(store_path, status)?; + write_epiphany_cultmesh_verse_policies(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_global_room_policies(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_mind_contracts(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_substrate_gate_contracts(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_eyes_contracts(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_hands_contracts(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_soul_contracts(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_continuity_contracts(store_path, runtime_id.clone())?; + write_epiphany_cultmesh_operator_status( + store_path, + default_epiphany_cultmesh_operator_status(runtime_id, generated_at_utc), + )?; + Ok(()) +} + +pub fn query_epiphany_local_verse_context( + store_path: impl AsRef, + runtime_id: impl Into, +) -> Result { + let store_path = store_path.as_ref(); + let runtime_id = runtime_id.into(); + let node = open_epiphany_cultmesh_node(store_path, runtime_id.clone())?; + let mut verse_policies = Vec::new(); + for policy in epiphany_cultmesh_verse_policies() { + if let Some(loaded) = node.get::(&policy.verse_id)? { + verse_policies.push(loaded); + } + } + + let mut global_room_policies = Vec::new(); + for room in epiphany_cultmesh_global_room_policies() { + if let Some(loaded) = node.get::(&room.room_id)? { + global_room_policies.push(loaded); + } + } + + let mut contract_summaries = Vec::new(); + collect_contract_summaries( + &node, + epiphany_cultmesh_mind_contracts(), + &mut contract_summaries, + )?; + collect_contract_summaries( + &node, + epiphany_cultmesh_substrate_gate_contracts(), + &mut contract_summaries, + )?; + collect_contract_summaries( + &node, + epiphany_cultmesh_eyes_contracts(), + &mut contract_summaries, + )?; + collect_contract_summaries( + &node, + epiphany_cultmesh_hands_contracts(), + &mut contract_summaries, + )?; + collect_contract_summaries( + &node, + epiphany_cultmesh_soul_contracts(), + &mut contract_summaries, + )?; + collect_contract_summaries( + &node, + epiphany_cultmesh_continuity_contracts(), + &mut contract_summaries, + )?; + + Ok(EpiphanyLocalVerseContext { + schema_version: "epiphany.local_verse_context.v0".to_string(), + runtime_id: runtime_id.clone(), + store_path: store_path.display().to_string(), + summary: "Local Verse query context for compact Epiphany prompt assembly and operator inspection.".to_string(), + odin_scope: "Odin is the all-seer coordinator of Verse discovery: it may know every Verse's advertised public/operator-safe surface, but it must not bypass Verse trust boundaries or Mind adoption gates.".to_string(), + yggdrasil_scope: "Yggdrasil is the hosting spine for important trusted GameCult Verses such as Bifrost; local-area writes require explicit trusted tunnel/lease policy and never carry private internal state.".to_string(), + prompt_assembly_note: "Prompt assembly should query this compact typed bundle plus semantic memory context cuts; Verse context is injected dynamically as bounded context, not as durable truth.".to_string(), + verse_policies, + global_room_policies, + operator_status: node.get(EPIPHANY_CULTMESH_OPERATOR_STATUS_KEY)?, + latest_operator_snapshot: node.get(EPIPHANY_CULTMESH_OPERATOR_SNAPSHOT_LATEST_KEY)?, + latest_operator_run_intent: node.get(EPIPHANY_CULTMESH_OPERATOR_RUN_INTENT_LATEST_KEY)?, + latest_operator_run_receipt: node.get(EPIPHANY_CULTMESH_OPERATOR_RUN_RECEIPT_LATEST_KEY)?, + contract_summaries, + }) +} + +pub trait EpiphanyCultMeshContractSummarySource: DatabaseEntry { + fn contract_id(&self) -> &str; + fn verse_id(&self) -> &str; + fn authority(&self) -> &str; + fn document_type(&self) -> &str; + fn operations(&self) -> &[String]; + fn receipt_document_types(&self) -> &[String]; +} + +macro_rules! impl_contract_summary_source { + ($ty:ty) => { + impl EpiphanyCultMeshContractSummarySource for $ty { + fn contract_id(&self) -> &str { + &self.contract_id + } + + fn verse_id(&self) -> &str { + &self.verse_id + } + + fn authority(&self) -> &str { + &self.authority + } + + fn document_type(&self) -> &str { + &self.document_type + } + + fn operations(&self) -> &[String] { + &self.operations + } + + fn receipt_document_types(&self) -> &[String] { + &self.receipt_document_types + } + } + }; +} + +impl_contract_summary_source!(EpiphanyCultMeshMindContractEntry); +impl_contract_summary_source!(EpiphanyCultMeshSubstrateGateContractEntry); +impl_contract_summary_source!(EpiphanyCultMeshEyesContractEntry); +impl_contract_summary_source!(EpiphanyCultMeshHandsContractEntry); +impl_contract_summary_source!(EpiphanyCultMeshSoulContractEntry); +impl_contract_summary_source!(EpiphanyCultMeshContinuityContractEntry); + +fn collect_contract_summaries( + node: &CultMeshNode, + contracts: Vec, + out: &mut Vec, +) -> Result<()> +where + T: EpiphanyCultMeshContractSummarySource, +{ + for contract in contracts { + if let Some(loaded) = node.get::(contract.contract_id())? { + out.push(EpiphanyLocalVerseContractSummary { + contract_id: loaded.contract_id().to_string(), + verse_id: loaded.verse_id().to_string(), + authority: loaded.authority().to_string(), + document_type: loaded.document_type().to_string(), + operations: loaded.operations().to_vec(), + receipt_document_types: loaded.receipt_document_types().to_vec(), + }); + } + } + Ok(()) +} + fn epiphany_cultmesh_operator_snapshot_key(snapshot_id: &str) -> String { format!("epiphany-local/operator-snapshot/{snapshot_id}") } @@ -1248,6 +1450,38 @@ mod tests { Ok(()) } + #[test] + fn local_verse_context_queries_compact_policy_status_and_contracts() -> Result<()> { + let temp = tempfile::tempdir()?; + let store = temp.path().join("epiphany-local-verse.ccmp"); + seed_epiphany_local_verse_context(&store, "epiphany-test", "2026-06-02T00:00:00Z")?; + + let context = query_epiphany_local_verse_context(&store, "epiphany-test")?; + + assert_eq!(context.verse_policies.len(), 3); + assert!(context.verse_policies.iter().any(|policy| policy.verse_id + == EPIPHANY_CULTMESH_LOCAL_AREA_VERSE_ID + && policy.yggdrasil_tunnel_allowed)); + assert_eq!(context.global_room_policies.len(), 6); + assert!(context.operator_status.is_some()); + assert!( + context + .contract_summaries + .iter() + .any(|contract| contract.authority == "mind") + ); + assert!( + context + .contract_summaries + .iter() + .any(|contract| contract.authority == "substrateGate") + ); + assert!(context.odin_scope.contains("all-seer")); + assert!(context.yggdrasil_scope.contains("Bifrost")); + assert!(context.prompt_assembly_note.contains("bounded context")); + Ok(()) + } + #[test] fn mind_contracts_use_verses_to_keep_state_guarded() -> Result<()> { let temp = tempfile::tempdir()?; diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index bb20abd6..94fd42c4 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -153,6 +153,8 @@ pub use cultmesh_integration::EpiphanyCultMeshSoulContractEntry; pub use cultmesh_integration::EpiphanyCultMeshStatusEntry; pub use cultmesh_integration::EpiphanyCultMeshSubstrateGateContractEntry; pub use cultmesh_integration::EpiphanyCultMeshVersePolicyEntry; +pub use cultmesh_integration::EpiphanyLocalVerseContext; +pub use cultmesh_integration::EpiphanyLocalVerseContractSummary; pub use cultmesh_integration::default_epiphany_cultmesh_operator_status; pub use cultmesh_integration::epiphany_cultmesh_continuity_contracts; pub use cultmesh_integration::epiphany_cultmesh_eyes_contracts; @@ -170,6 +172,8 @@ 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::query_epiphany_local_verse_context; +pub use cultmesh_integration::seed_epiphany_local_verse_context; pub use cultmesh_integration::write_epiphany_cultmesh_continuity_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_eyes_contracts; pub use cultmesh_integration::write_epiphany_cultmesh_global_room_policies; diff --git a/notes/epiphany-fork-implementation-plan.md b/notes/epiphany-fork-implementation-plan.md index b1414325..1decc80f 100644 --- a/notes/epiphany-fork-implementation-plan.md +++ b/notes/epiphany-fork-implementation-plan.md @@ -86,6 +86,7 @@ The landed machine now has: - first auditable Phase 6 fixed-lane coordinator runner through native `epiphany-mvp-coordinator`, producing coordinator summary, JSONL steps, rendered snapshots, transcript, stderr, runtime-spine status, native runtime job/result receipts for launched work, and final next-action artifacts while keeping semantic findings review-gated by default - first Codex-independent native runtime vertebra through `epiphany-runtime-spine`, storing runtime identity, sessions, jobs, job results, and events as typed CultCache MessagePack documents, opening/completing native jobs, projecting job-result counts, and emitting a framed CultNet hello message for the native contract - first Rust CultMesh local-node integration: `vendor/cultmesh-rs` now provides the repo-contained CultMesh surface over vendored CultCache/CultNet, and `epiphany-core` depends on that surface for local `EpiphanyCultMeshStatusEntry`, `EpiphanyCultMeshVersePolicyEntry`, and `EpiphanyCultMeshGlobalRoomPolicyEntry` round-trip smokes instead of treating raw CultNet as the ergonomic app-facing database layer +- first local Verse query surface: `notes/epiphany-verse-architecture.md` names Verse/Odin/Yggdrasil ownership, and `epiphany-verse-query` can seed/query a compact CultMesh-backed local Verse context bundle for operator inspection and future dynamic prompt assembly without granting semantic memory, public sharing, or state-admission authority - first Hands/Soul/Continuity contract catalogs: action, verification, and continuity now have native `epiphany-core` contract families, runtime-spine advertisement, CultMesh policy documents, and local CultMesh smoke coverage beside Mind/Substrate Gate/Eyes - live-specialist runner must be rebuilt around heartbeat/runtime-spine result receipts - first Phase 6 Aquarium operator shell extracted to sibling repo `E:\Projects\EpiphanyAquarium`, a Tauri v2 + React/WebGL client over the existing status bridge, dogfood artifacts, and GUI action artifacts, with its own distilled interface state/memory/doctrine plus durable checkpoint preparation, bounded status/coordinator artifact buttons, fixed modeling/verification/reorient launch and read-back buttons, and explicit review-gated reorient acceptance diff --git a/notes/epiphany-verse-architecture.md b/notes/epiphany-verse-architecture.md new file mode 100644 index 00000000..ea329c94 --- /dev/null +++ b/notes/epiphany-verse-architecture.md @@ -0,0 +1,175 @@ +# Epiphany Verse Architecture + +This note names the Verse model Epiphany should grow into before the swarm is +migrated onto it. + +## Objective + +Make Epiphany light on prompt context by making its context dynamic, typed, and +queryable. + +An Epiphany should not carry every memory, repo fact, prompt scar, and project +doctrine in one swollen turn. It should query its local Verse, retrieve compact +semantic context cuts, and assemble only the state needed for the current rite. + +The machine should know more than it says. The prompt should carry only what it +must. + +## Current Mechanism + +Epiphany already has the first organs: + +- CultCache-shaped typed documents for thread state, runtime-spine jobs, + heartbeat physiology, role memory, memory graph state, and operator + receipts. +- CultMesh local stores for Verse policies, global room policies, organ + contracts, operator status, operator snapshots, and operator run + intents/receipts. +- Memory graph context cuts over repo, agent, heartbeat, incubation, agency, + and evidence profiles. +- Prompt assembly tests for bounded worker prompts, rendered Epiphany state, + and the Face Projector -> Face -> Mind Interpreter membrane. + +The missing organ is not another prompt rule. It is a local Verse query path +that prompt assembly, Aquarium, CLI tools, and future workers can use to fetch +compact state packets by authority and semantic relevance. + +## Vocabulary + +### Verse + +A Verse is a scoped typed-state world. + +It contains documents, policies, leases, receipts, rooms, and context surfaces +for one trust boundary. Every project is an extension of the Verse. Every +Epiphany is a series of nested Verses: + +- private sub-agent Verse +- trusted GameCult local-area Verse +- public/global dream Verse +- project/repo/topic/tool-specific sub-Verse surfaces + +Verse membership is authority-bearing. A document being visible in one Verse +does not make it safe to export into another. + +### Local Verse + +The local Verse is the Epiphany-owned queryable state surface for one instance. + +It should expose compact TUI/API packets for: + +- operator status +- role and heartbeat state +- runtime jobs and receipts +- memory graph context cuts +- organ contract policy +- local Verse policies +- admissible tool/query affordances + +Local Verse context is prompt input, not durable truth by itself. Mind still +owns durable adoption. + +### Odin + +Odin is the all-seer coordinator of Verse discovery. + +Odin may know every Verse's advertised public/operator-safe surface: schemas, +leases, status, public rooms, hosted services, and discovery metadata. Odin +must not bypass Verse trust boundaries, Mind adoption gates, Substrate Gate +access receipts, or private-state export rules. + +Odin sees the map. Odin does not get to steal the throne. + +### Yggdrasil + +Yggdrasil is the hosting spine for important trusted GameCult Verses. + +It hosts or tunnels key services such as Bifrost, schema publication, shared +CultNet/CultMesh nodes, and other infrastructure whose availability matters to +multiple projects. + +`gamecult-local` may use explicit Yggdrasil tunnel policy for trusted sharing. +`epiphany-internal` must not. `epiphany-global` is public thought weather, not +a private-state bridge. + +### Bifrost + +Bifrost is a hosted governance and labor Verse. + +It owns topics, work items, dispatch packets, review receipts, ledger/credit +pressure, and public operator-safe proof. It can consume Epiphany results, but +it does not become Epiphany's private memory or scheduler. + +## Prompt Assembly Direction + +Prompt assembly should become: + +```text +operator/human request +-> Self routes the authority question +-> local Verse query gathers compact typed context +-> memory graph semantic search retrieves relevant shared memories +-> Substrate Gate / Eyes provide source-grounded context when repo facts are needed +-> prompt assembler renders a bounded packet for the chosen organ +-> model output returns as thought/proposal/receipt +-> Mind reviews any durable state effect +``` + +The current smokes prove prompt rendering and bounded specialist prompt +ownership. They do not yet prove Verse-backed dynamic prompt assembly. That is +the next prompt proof to build after the local query surface exists. + +## Query Surface + +The first native query tool is: + +```powershell +cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- smoke +cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- seed +cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- query +``` + +This writes and reads a compact CultMesh-backed local Verse context bundle: + +- three Verse policies: `epiphany-internal`, `gamecult-local`, + `epiphany-global` +- Yggdrasil tunnel policy for `gamecult-local` +- public global room policies for Face/dream surfaces +- operator status +- latest operator run/snapshot receipts when present +- organ contract summaries for Mind, Substrate Gate, Eyes, Hands, Soul, and + Continuity + +This is not semantic search yet. It is the first typed inspection packet the +future prompt assembler can depend on. + +## Invariants + +- CultCache documents are the data. +- CultMesh is the ergonomic local/distributed Verse surface. +- CultNet is the wire. +- Qdrant/vector search is rebuildable resonance, not canonical memory. +- Private state is never exported by flipping a visibility flag. +- Foreign/public Verse material is thought weather until a reviewed local + adoption receipt digests it. +- Prompt assembly may read Verse context; it may not grant itself state, + action, repo, or public-speech authority. +- Every tool exposed to agents should have a compact, inspectable TUI/API + surface before it becomes ambient prompt power. + +## Migration Cut + +For swarm migration, the next useful chain is: + +1. Keep `epiphany-verse-query` as the local Verse context smoke. +2. Add semantic memory graph query packets beside the Verse policy/status + packet. +3. Teach worker launch prompt assembly to consume those packets explicitly. +4. Add a smoke that proves a worker prompt includes relevant Verse/memory + context and omits unrelated private sludge. +5. Move one Aquarium/local-run read path to the native Verse query before + increasing swarm cadence. + +No live swarm runner is cleared until pause/brake, stale active-turn recovery, +Face eligibility, and memory lifecycle receipts remain inspectable through the +same Verse model. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index a2f4569c..21c71b18 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -18,6 +18,7 @@ cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-state -- sta Get-Content '.\state\map.yaml' Get-Content '.\notes\fresh-workspace-handoff.md' Get-Content '.\notes\epiphany-current-algorithmic-map.md' +Get-Content '.\notes\epiphany-verse-architecture.md' Get-Content '.\notes\codex-starvation-and-cultnet-liberation-plan.md' Get-Content '.\notes\epiphany-fork-implementation-plan.md' Get-Content '.\notes\epiphany-anatomy.md' @@ -47,7 +48,7 @@ remembers doctrine; the branch remembers the blade. - Native status now exposes that quarantined bridge spine without granting it authority. `runtime_spine_status` counts tool invocation intents, receipts, and pending calls; `runtime_tool_invocation_statuses` derives read-only intent/receipt status rows; `epiphany-runtime-spine status` reports the counts; and `epiphany-mvp-status --runtime-store ` renders the latest tool calls under `tools`. This is operator visibility only. The model-runtime feedback seam is also now typed: MCP-shaped model tool calls preserve the original provider `call_id` plus source model request id; `epiphany-model-runtime tool-followup` builds a provider-neutral follow-up `EpiphanyModelRequest` from completed typed tool receipts using the previous provider response id; and `epiphany-model-runtime tool-followup-turn` derives and runs that continuation through the selected provider in one runtime-owned operation. `epiphany-model-runtime run-worker --auto-tools --tool-adapter-bin ` now lets a launched worker automatically execute typed MCP intents through the quarantined Codex MCP adapter, feed receipts back through follow-up model turns, and only then parse/complete the worker result. Codex still executes the quarantined MCP edge; Epiphany owns the continuation request shape and invocation boundary. - The active foundation directive is now `notes/codex-starvation-and-cultnet-liberation-plan.md`. The previous Codex app-server control-plane rebuild made Epiphany less rotten inside Codex, but that is not the destination. Epiphany must become a native CultCache/CultMesh/CultNet runtime while remaining an honest modified Codex-derived backend for subscription auth/model use. Codex should remain relatively vanilla and keep doing Codex things, including useful app-server and streaming bridge affordances, but it must not own Epiphany state, processes, prompts, scheduler decisions, or policy. The bridge handles interop; Codex and Epiphany do not get to rummage around in each other's organs. - `notes/epiphany-cultmesh-dreaming-roadmap.md` is the new concrete design for distributed Epiphany dreaming. The invariant is hard: private state stays local; public dreams are separately authored typed documents distributed through CultMesh/CultNet; foreign dreams are thought weather until a reviewed local adoption receipt digests them. The first code slice should be dream schemas plus a local CultMesh-backed store, not public fanout. -- CultMesh is now the preferred Rust abstraction for that local store work. The compile-time Rust substrate is repo-contained: `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`. The old `E:\Projects\CultLib\crates\*` dependency body is dead in this checkout and must not be revived by accident. Vendored CultCache reads/writes `cultcache.store.v1`, so `state/ledgers.msgpack` and `epiphany-state status` are aligned again. The first integrations are deliberately small: status, Verse policy, global room policy, organ contract policy, native operator status, native operator snapshots, and local operator run intent/receipt round-trip through CultMesh. Use `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-status -- smoke --store .\.epiphany-smoke\cultmesh\operator-status.ccmp --runtime-id epiphany-cultmesh-status-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-snapshot -- smoke --store .\.epiphany-smoke\cultmesh\operator-snapshots.ccmp --runtime-id epiphany-operator-snapshot-smoke --snapshot-id smoke-status`, and `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-run -- smoke --store .\.epiphany-smoke\cultmesh\operator-runs.ccmp --runtime-id epiphany-operator-run-smoke --run-id smoke-run` for the focused proofs. Future local dream/status/Verse work should start from CultMesh, not raw CultNet, unless the task is polishing the CultMesh internals themselves. Preserve the three Verse tiers: `epiphany-internal` for private sub-agent typed state, `gamecult-local` for trusted LAN/Yggdrasil-tunnel GameCult sharing, and `epiphany-global` for untrusted public dreams plus topic-specific threaded public rooms for Face posts. +- CultMesh is now the preferred Rust abstraction for that local store work. The compile-time Rust substrate is repo-contained: `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`. The old `E:\Projects\CultLib\crates\*` dependency body is dead in this checkout and must not be revived by accident. Vendored CultCache reads/writes `cultcache.store.v1`, so `state/ledgers.msgpack` and `epiphany-state status` are aligned again. The first integrations are deliberately small: status, Verse policy, global room policy, organ contract policy, native operator status, native operator snapshots, and local operator run intent/receipt round-trip through CultMesh. `notes/epiphany-verse-architecture.md` now names the local Verse/Odin/Yggdrasil architecture: Odin sees advertised Verse metadata without bypassing boundaries, Yggdrasil hosts important trusted GameCult Verses such as Bifrost, and prompt assembly should query compact local Verse plus semantic memory packets instead of carrying the whole archive. Use `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-cultmesh-status -- smoke --store .\.epiphany-smoke\cultmesh\operator-status.ccmp --runtime-id epiphany-cultmesh-status-smoke`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-snapshot -- smoke --store .\.epiphany-smoke\cultmesh\operator-snapshots.ccmp --runtime-id epiphany-operator-snapshot-smoke --snapshot-id smoke-status`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-operator-run -- smoke --store .\.epiphany-smoke\cultmesh\operator-runs.ccmp --runtime-id epiphany-operator-run-smoke --run-id smoke-run`, and `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- smoke` for the focused proofs. Future local dream/status/Verse work should start from CultMesh, not raw CultNet, unless the task is polishing the CultMesh internals themselves. Preserve the three Verse tiers: `epiphany-internal` for private sub-agent typed state, `gamecult-local` for trusted LAN/Yggdrasil-tunnel GameCult sharing, and `epiphany-global` for untrusted public dreams plus topic-specific threaded public rooms for Face posts. - `notes/codex-auth-spine-inventory.md` is the source-grounded keeper list for that reliquary. Corrected compliance invariant: Codex-compatible auth identity stays anchored in vendored Codex-derived auth machinery. `epiphany-openai-auth-spine` is now a thin Epiphany-named boundary over `codex-login`, not a clean-room clone of credential storage or token refresh. Codex apps, skills, marketplace, plugin UX, broad app-server workflow, and JSON-RPC sprawl remain cuttable because they are not subscription-auth legitimacy. - Edge JSON is allowed for schema description, hostile ingress before immediate typed parsing, sealed forensic artifacts, or named quarantine experiments. When both subsystems are ours, runtime data must remain typed CultCache documents and move over CultNet typed contracts. Generic `serde_json::Value` in worker launch/result/selfPatch/runtime flow is contamination until classified and replaced. - `notes/epiphany-swarm-readiness-plan.md` is the current live-fire direction gate. The local runner proves startup/status/coordinator wiring; it does not authorize unattended swarm operation. Carry VoidBot's lessons forward: one CTB-style initiative scheduler, typed pause/brake, active-turn freeze, cooldown after completion, stale active-turn recovery receipts, parent-side speech eligibility, memory lifecycle phases, and typed operation proposals instead of prompt-owned governance. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index 930aa761e0794ed80f2a27be0def1f7d62c056d3..9707f391e1d75b84e4eb6b69442bbfeeebd948b3 100644 GIT binary patch delta 323 zcmYL^Jx;_h5QRy~t@vpvMxtZ`*+@%~3PeqZkf58jXOjp!_WB3mih_a*5YZuyfJA|| z1FghSI0Cdd0f}StQBVZI|A4 zY4X~o>F(p^{j$i52>)8klMwT|2N+T~Y~_h}-?1X~@Q<)X3bQy;h=OQ69s2RRwO)HsUuw zLqiC|K8!(WGU${6>(Kd#S3=EVNu!jEQ{PFM3fm#u^#0aMi9_N%p3VL601qw7hJiM* Mg#)yf&#A0s*&` H0s