From edd93a11b9d477ab207ef9074b4199cd776ba3f8 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Tue, 2 Jun 2026 13:57:47 +0100 Subject: [PATCH] Carry dynamic Verse context in worker launches --- epiphany-codex-bridge/src/protocol_edge.rs | 2 + epiphany-core/src/agent_launch.rs | 40 ++++++++++++++++++ .../src/bin/epiphany-prompt-context-smoke.rs | 25 +++++++++++ epiphany-core/src/lib.rs | 2 + epiphany-core/src/runtime_spine.rs | 3 ++ epiphany-core/src/substrate_gate.rs | 1 + epiphany-core/src/surfaces/worker_launch.rs | 25 +++++++++++ epiphany-openai-runtime/src/lib.rs | 24 +++++++++-- notes/epiphany-fork-implementation-plan.md | 1 + notes/epiphany-verse-architecture.md | 27 +++++++----- notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 172828 -> 173137 bytes state/map.yaml | 4 +- 13 files changed, 140 insertions(+), 16 deletions(-) diff --git a/epiphany-codex-bridge/src/protocol_edge.rs b/epiphany-codex-bridge/src/protocol_edge.rs index 5b928497..f5f556a9 100644 --- a/epiphany-codex-bridge/src/protocol_edge.rs +++ b/epiphany-codex-bridge/src/protocol_edge.rs @@ -665,6 +665,7 @@ fn protocol_role_worker_launch_document_to_core( role_id: document.role_id, state_revision: document.state_revision, objective: document.objective, + dynamic_prompt_context: None, active_subgoal_id: document.active_subgoal_id, active_subgoals: document.active_subgoals, active_graph_node_ids: document.active_graph_node_ids, @@ -690,6 +691,7 @@ fn protocol_reorient_worker_launch_document_to_core( checkpoint_id: document.checkpoint_id, checkpoint_kind: document.checkpoint_kind, checkpoint_disposition: document.checkpoint_disposition, + dynamic_prompt_context: None, checkpoint_focus: document.checkpoint_focus, checkpoint_summary: document.checkpoint_summary, checkpoint_next_action: document.checkpoint_next_action, diff --git a/epiphany-core/src/agent_launch.rs b/epiphany-core/src/agent_launch.rs index 28972388..a21b4aca 100644 --- a/epiphany-core/src/agent_launch.rs +++ b/epiphany-core/src/agent_launch.rs @@ -452,6 +452,24 @@ pub fn build_epiphany_role_launch_request( expected_revision: Option, max_runtime_seconds: Option, state: &EpiphanyThreadState, +) -> Result { + build_epiphany_role_launch_request_with_dynamic_context( + thread_id, + role_id, + expected_revision, + max_runtime_seconds, + state, + None, + ) +} + +pub fn build_epiphany_role_launch_request_with_dynamic_context( + thread_id: &str, + role_id: EpiphanyRoleResultRoleId, + expected_revision: Option, + max_runtime_seconds: Option, + state: &EpiphanyThreadState, + dynamic_prompt_context: Option, ) -> Result { let binding_id = epiphany_role_binding_id(role_id)?; let owner_role = epiphany_role_owner(role_id)?; @@ -487,6 +505,7 @@ pub fn build_epiphany_role_launch_request( role_id: epiphany_role_label(role_id).to_string(), state_revision: state.revision, objective: state.objective.clone(), + dynamic_prompt_context, active_subgoal_id: state.active_subgoal_id.clone(), active_subgoals: state .subgoals @@ -551,6 +570,26 @@ pub fn build_epiphany_reorient_launch_request( state: &EpiphanyThreadState, checkpoint: &EpiphanyInvestigationCheckpoint, decision: &CoreEpiphanyReorientDecision, +) -> EpiphanyJobLaunchRequest { + build_epiphany_reorient_launch_request_with_dynamic_context( + thread_id, + expected_revision, + max_runtime_seconds, + state, + checkpoint, + decision, + None, + ) +} + +pub fn build_epiphany_reorient_launch_request_with_dynamic_context( + thread_id: &str, + expected_revision: Option, + max_runtime_seconds: Option, + state: &EpiphanyThreadState, + checkpoint: &EpiphanyInvestigationCheckpoint, + decision: &CoreEpiphanyReorientDecision, + dynamic_prompt_context: Option, ) -> EpiphanyJobLaunchRequest { let instruction = build_epiphany_reorient_launch_instruction(decision.action); build_reorient_job_launch_request(EpiphanyReorientLaunchRequestInput { @@ -563,6 +602,7 @@ pub fn build_epiphany_reorient_launch_request( state, checkpoint, decision, + dynamic_prompt_context, }) } diff --git a/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs b/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs index 02cc1100..7c5c43c9 100644 --- a/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs +++ b/epiphany-core/src/bin/epiphany-prompt-context-smoke.rs @@ -9,6 +9,10 @@ use epiphany_core::EpiphanyMemoryNodeKind; use epiphany_core::EpiphanyMemoryProfile; use epiphany_core::EpiphanyMemorySummary; use epiphany_core::EpiphanyPromptContextInput; +use epiphany_core::EpiphanyRoleResultRoleId; +use epiphany_core::EpiphanyThreadState; +use epiphany_core::EpiphanyWorkerLaunchDocument; +use epiphany_core::build_epiphany_role_launch_request_with_dynamic_context; use epiphany_core::memory_graph_domain_id; use epiphany_core::memory_graph_node_id; use epiphany_core::plan_memory_graph_context_cut; @@ -65,6 +69,26 @@ fn main() -> Result<()> { anyhow::bail!("prompt context smoke failed rendered packet checks:\n{rendered}"); } + let launch_request = build_epiphany_role_launch_request_with_dynamic_context( + "thread-prompt-context-smoke", + EpiphanyRoleResultRoleId::Modeling, + Some(1), + Some(60), + &EpiphanyThreadState { + revision: 1, + objective: Some("Launch a worker with bounded dynamic context.".to_string()), + ..Default::default() + }, + Some(rendered.clone()), + ) + .map_err(anyhow::Error::msg)?; + let EpiphanyWorkerLaunchDocument::Role(role_document) = &launch_request.launch_document else { + anyhow::bail!("prompt context smoke expected a role launch document"); + }; + if role_document.dynamic_prompt_context.as_deref() != Some(rendered.as_str()) { + anyhow::bail!("prompt context smoke failed to preserve dynamic launch context"); + } + println!( "{}", serde_json::to_string_pretty(&json!({ @@ -73,6 +97,7 @@ fn main() -> Result<()> { "renderedBytes": rendered.len(), "containsVerseContext": true, "containsMemoryContext": true, + "launchDocumentCarriesContext": true, "omitsUnselectedPrivateText": true, }))? ); diff --git a/epiphany-core/src/lib.rs b/epiphany-core/src/lib.rs index 0ae9f915..b7a1aad6 100644 --- a/epiphany-core/src/lib.rs +++ b/epiphany-core/src/lib.rs @@ -43,7 +43,9 @@ pub use agent_launch::EpiphanySpecialistPromptConfig; pub use agent_launch::build_epiphany_job_launch_request; pub use agent_launch::build_epiphany_reorient_launch_instruction; pub use agent_launch::build_epiphany_reorient_launch_request; +pub use agent_launch::build_epiphany_reorient_launch_request_with_dynamic_context; pub use agent_launch::build_epiphany_role_launch_request; +pub use agent_launch::build_epiphany_role_launch_request_with_dynamic_context; pub use agent_launch::epiphany_agent_prompt_with_memory; pub use agent_launch::epiphany_reorient_launch_output_schema; pub use agent_launch::epiphany_role_binding_id; diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index 7471f23c..90155e09 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -3365,6 +3365,7 @@ mod tests { role_id: "modeling".to_string(), state_revision: 7, objective: Some("Run heartbeat worker.".to_string()), + dynamic_prompt_context: None, active_subgoal_id: None, active_subgoals: Vec::new(), active_graph_node_ids: vec!["node-model".to_string()], @@ -3453,6 +3454,7 @@ mod tests { role_id: "modeling".to_string(), state_revision: 7, objective: Some("keep state typed".to_string()), + dynamic_prompt_context: None, active_subgoal_id: None, active_subgoals: Vec::new(), active_graph_node_ids: vec!["runtime-spine".to_string()], @@ -3536,6 +3538,7 @@ mod tests { role_id: "modeling".to_string(), state_revision: 7, objective: None, + dynamic_prompt_context: None, active_subgoal_id: None, active_subgoals: Vec::new(), active_graph_node_ids: Vec::new(), diff --git a/epiphany-core/src/substrate_gate.rs b/epiphany-core/src/substrate_gate.rs index c2c6a014..69613c7f 100644 --- a/epiphany-core/src/substrate_gate.rs +++ b/epiphany-core/src/substrate_gate.rs @@ -201,6 +201,7 @@ mod tests { role_id: "research".to_string(), state_revision: 7, objective: None, + dynamic_prompt_context: None, active_subgoal_id: None, active_subgoals: Vec::new(), active_graph_node_ids: Vec::new(), diff --git a/epiphany-core/src/surfaces/worker_launch.rs b/epiphany-core/src/surfaces/worker_launch.rs index e0ac717b..82ffd2a2 100644 --- a/epiphany-core/src/surfaces/worker_launch.rs +++ b/epiphany-core/src/surfaces/worker_launch.rs @@ -55,6 +55,15 @@ impl EpiphanyWorkerLaunchDocument { Self::Reorient(document) => &document.thread_id, } } + + pub fn dynamic_prompt_context(&self) -> Option<&str> { + match self { + Self::Role(document) => document.dynamic_prompt_context.as_deref(), + Self::Reorient(document) => document.dynamic_prompt_context.as_deref(), + } + .map(str::trim) + .filter(|context| !context.is_empty()) + } } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -66,6 +75,8 @@ pub struct EpiphanyRoleWorkerLaunchDocument { #[serde(default, skip_serializing_if = "Option::is_none")] pub objective: Option, #[serde(default, skip_serializing_if = "Option::is_none")] + pub dynamic_prompt_context: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] pub active_subgoal_id: Option, #[serde(default)] pub active_subgoals: Vec, @@ -102,6 +113,8 @@ pub struct EpiphanyReorientWorkerLaunchDocument { pub checkpoint_kind: String, pub checkpoint_disposition: String, #[serde(default, skip_serializing_if = "Option::is_none")] + pub dynamic_prompt_context: Option, + #[serde(default, skip_serializing_if = "Option::is_none")] pub checkpoint_focus: Option, #[serde(default, skip_serializing_if = "Option::is_none")] pub checkpoint_summary: Option, @@ -149,6 +162,7 @@ pub struct EpiphanyReorientLaunchRequestInput<'a> { pub state: &'a EpiphanyThreadState, pub checkpoint: &'a EpiphanyInvestigationCheckpoint, pub decision: &'a EpiphanyReorientDecision, + pub dynamic_prompt_context: Option, } pub fn build_reorient_job_launch_request( @@ -168,6 +182,7 @@ pub fn build_reorient_job_launch_request( input.decision, linked_subgoal_ids.clone(), linked_graph_node_ids.clone(), + input.dynamic_prompt_context, )); let output_contract_id = launch_document.output_contract_id().to_string(); let organ_launch_contract = crate::default_launch_organ_contract( @@ -200,6 +215,7 @@ fn build_reorient_worker_launch_document( decision: &EpiphanyReorientDecision, linked_subgoal_ids: Vec, linked_graph_node_ids: Vec, + dynamic_prompt_context: Option, ) -> EpiphanyReorientWorkerLaunchDocument { EpiphanyReorientWorkerLaunchDocument { thread_id: thread_id.to_string(), @@ -207,6 +223,7 @@ fn build_reorient_worker_launch_document( checkpoint_id: checkpoint.checkpoint_id.clone(), checkpoint_kind: checkpoint.kind.clone(), checkpoint_disposition: investigation_disposition_label(checkpoint.disposition).to_string(), + dynamic_prompt_context, checkpoint_focus: Some(checkpoint.focus.clone()), checkpoint_summary: checkpoint.summary.clone(), checkpoint_next_action: checkpoint @@ -404,6 +421,10 @@ mod tests { state: &state, checkpoint: &checkpoint, decision: &decision, + dynamic_prompt_context: Some( + "\ncheckpoint weather\n" + .to_string(), + ), }); assert_eq!(request.binding_id, "reorient-worker"); @@ -424,5 +445,9 @@ mod tests { assert_eq!(document.retrieval_status, "stale"); assert_eq!(document.graph_status, "changed"); assert_eq!(document.watcher_status, "dirty"); + assert_eq!( + document.dynamic_prompt_context.as_deref(), + Some("\ncheckpoint weather\n") + ); } } diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index b5ef645a..7e3e878f 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -500,7 +500,11 @@ fn flush_text_buffer( ) { if !buffer.is_empty() { let text = std::mem::take(buffer); - push_compacted_event(compacted, source, EpiphanyOpenAiStreamPayload::TextDelta { text }); + push_compacted_event( + compacted, + source, + EpiphanyOpenAiStreamPayload::TextDelta { text }, + ); } } @@ -1176,9 +1180,13 @@ fn worker_instructions( launch_document: &EpiphanyWorkerLaunchDocument, ) -> String { let output_contract = worker_output_contract_text(launch_document); + let dynamic_context = launch_document + .dynamic_prompt_context() + .map(|context| format!("\n\n{context}")) + .unwrap_or_default(); format!( - "{}\n\nReturn only one JSON object. No Markdown, no commentary.\n\n{}", - launch_request.instruction, output_contract + "{}{}\n\nReturn only one JSON object. No Markdown, no commentary.\n\n{}", + launch_request.instruction, dynamic_context, output_contract ) } @@ -1614,6 +1622,10 @@ mod tests { role_id: "modeling".to_string(), state_revision: 1, objective: Some("Map the machine.".to_string()), + dynamic_prompt_context: Some( + "\nlocal Verse: bounded\n" + .to_string(), + ), active_subgoal_id: None, active_subgoals: Vec::new(), active_graph_node_ids: Vec::new(), @@ -1647,6 +1659,12 @@ mod tests { ); assert_eq!(model_request.reasoning_effort.as_deref(), Some("low")); assert_eq!(model_request.reasoning_summary.as_deref(), Some("concise")); + assert!( + model_request + .instructions + .contains("") + ); + assert!(model_request.instructions.contains("local Verse: bounded")); let openai_summary = EpiphanyOpenAiRuntimeRunSummary { store: store.display().to_string(), session_id: "openai-worker-session-modeling-checkpoint-worker".to_string(), diff --git a/notes/epiphany-fork-implementation-plan.md b/notes/epiphany-fork-implementation-plan.md index 1decc80f..66ca09ce 100644 --- a/notes/epiphany-fork-implementation-plan.md +++ b/notes/epiphany-fork-implementation-plan.md @@ -87,6 +87,7 @@ The landed machine now has: - 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 dynamic prompt launch handoff: role/reorient worker launch documents carry optional `dynamicPromptContext`, runtime prompt assembly consumes that field into worker instructions, and `epiphany-prompt-context-smoke` proves rendered Verse/memory context can ride a role launch document without admitting unrelated private-looking text - 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 index b271e6b4..d8c29bdf 100644 --- a/notes/epiphany-verse-architecture.md +++ b/notes/epiphany-verse-architecture.md @@ -115,9 +115,10 @@ operator/human request -> 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. +The current smokes prove prompt rendering, bounded specialist prompt ownership, +and the first launch-document handoff: `epiphany-prompt-context-smoke` renders +Verse plus semantic-memory context and proves a fixed role launch document can +carry that bounded packet. ## Query Surface @@ -146,10 +147,16 @@ future prompt assembler can depend on. `epiphany-prompt-context-smoke` is the first prompt-context proof on top of that packet. It seeds local Verse context, builds a memory graph context cut, -renders the combined dynamic prompt packet, and asserts that Verse/Odin/ +renders the combined dynamic prompt packet, asserts that Verse/Odin/ Yggdrasil/Bifrost context plus relevant semantic memory appear while unrelated -private-looking text stays absent. It is still a local proof, not a live swarm -runner. +private-looking text stays absent, and proves the packet is preserved on a role +worker launch document. It is still a local proof, not a live swarm runner. + +Role and reorient worker launch documents now carry optional +`dynamicPromptContext`. The launch document owns this context for one worker +launch. Runtime prompt assembly reads that field and inserts it between the +role-local instruction and the output contract, so dynamic Verse/memory context +is executable worker input without becoming durable state authority. ## Invariants @@ -172,10 +179,10 @@ 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. Extend the prompt-context smoke into a launch-document smoke that proves a - worker prompt includes relevant Verse/memory context and omits unrelated - private sludge. +3. Feed `dynamicPromptContext` from the real coordinator/local-run launch path, + not only the smoke binary. +4. Add a launch/runtime smoke that proves a persisted worker request 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. diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 5d7761de..6e93de51 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -48,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. `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`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- smoke`, and `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-prompt-context-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. +- 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. Role/reorient launch documents now have optional `dynamicPromptContext`; runtime prompt assembly consumes that field into worker instructions, and `epiphany-prompt-context-smoke` proves a rendered Verse/memory packet is preserved on a role launch document. 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`, `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-verse-query -- smoke`, and `cargo run --manifest-path .\epiphany-core\Cargo.toml --bin epiphany-prompt-context-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 7e53e84831daa3fbf771934a158ae9904ceb32e8..5f0bdbe6283c88b57ff9d2bd8ac9b813df3bc385 100644 GIT binary patch delta 329 zcmYk1u}Z{15Qa@akh3|gY=i;9%3R{YDV(J~fQ49Gw`>M(O?EfVZgQr&!r~r4(^&|< zfM6lMz+vm#T##soUq1>7N7j1?+FH56o2;XoMe@X>)bb0C?b z1y>iC0+}3RLPHX@gPfOI%pf(QRQ|S5Ne-rP(rBJTy5Zk+#H$VP5~$QpDul({P=*9j zTSuj6Gq%-Qj{-Nt9v*GsP;ilau@n%^47h3 H?4+YVayfYm delta 41 zcmV+^0M`G}$O@ds3a}Uf3o|)7H8xtt00N=;vm*g<0Ri`el>&#A0s*&`0s@DiIY$nn diff --git a/state/map.yaml b/state/map.yaml index 299a4e0d..12e17b4e 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -72,7 +72,7 @@ data_flow: active_subgoals: - Use `notes/epiphany-cultmesh-dreaming-roadmap.md` as the design authority for distributed Epiphany dreaming. Public dreams are separately authored typed documents distributed through CultMesh/CultNet; private state remains local and cannot be shared by flipping a visibility flag. Foreign dreams are external thought weather until a reviewed local adoption receipt digests them into memory, planning, doctrine, or governance. - CultMesh is now the preferred ergonomic Rust abstraction over CultCache and CultNet for Epiphany-owned local database surfaces. The Rust substrate is repo-contained under `vendor/cultcache-rs`, `vendor/cultnet-rs`, and `vendor/cultmesh-rs`; the old `E:\Projects\CultLib\crates\*` path is dead in this checkout and must not be reintroduced as a compile-time dependency. Future local Verse/dream/status work should start at CultMesh unless it is explicitly polishing CultMesh internals. Preserve the three-Verse boundary: `epiphany-internal` for private sub-agent typed state, `gamecult-local` for trusted LAN/Yggdrasil-tunnel GameCult project sharing, and `epiphany-global` for untrusted public dreams plus topic-specific threaded public rooms for Face posts. - - Use `notes/epiphany-verse-architecture.md` as the source note for local Verse/Odin/Yggdrasil prompt-context architecture. Odin is the all-seer discovery/coordinator surface for advertised Verse metadata, not a trust-boundary bypass. Yggdrasil is the hosted spine for important trusted GameCult Verses such as Bifrost. The first native local Verse query surface is `epiphany-verse-query`, which seeds/queries compact CultMesh policy/status/contract context for future dynamic prompt assembly; `epiphany-prompt-context-smoke` now proves that compact local Verse context plus a semantic memory graph context cut can render a bounded dynamic prompt packet while omitting unrelated private-looking text. + - Use `notes/epiphany-verse-architecture.md` as the source note for local Verse/Odin/Yggdrasil prompt-context architecture. Odin is the all-seer discovery/coordinator surface for advertised Verse metadata, not a trust-boundary bypass. Yggdrasil is the hosted spine for important trusted GameCult Verses such as Bifrost. The first native local Verse query surface is `epiphany-verse-query`, which seeds/queries compact CultMesh policy/status/contract context for future dynamic prompt assembly; `epiphany-prompt-context-smoke` now proves that compact local Verse context plus a semantic memory graph context cut can render a bounded dynamic prompt packet, omit unrelated private-looking text, and preserve the packet inside a role worker launch document. - The active priority is Codex starvation and CultNet liberation. Use `notes/codex-starvation-and-cultnet-liberation-plan.md` as the directive and `notes/codex-auth-spine-inventory.md` as the source-grounded keeper list for the retained OpenAI subscription auth/model transport bridge. Classify all Epiphany-relevant JSON contamination, define the native CultNet runtime boundary, keep worker launch/result/selfPatch cargo as typed documents, evacuate Epiphany operator/state/process authority from Codex JSON-RPC, wrap MCP's unavoidable JSON protocol edge in typed Epiphany intent/result/receipt documents, and keep cutting until Epiphany can run its own state and processes without `codex_message_processor.rs` except for bridge compatibility. - Use `notes/epiphany-anatomy.md` as the canonical anatomy map. Embodied sub-agents are Self, Face, Imagination, Eyes, Proprioception, Hands, and Soul. Body is substrate, Mind is persistent state/state admission, Continuity is recovery/compaction/sleep protocol machinery, and Substrate Gate is substrate access protocol. - Organ state now has a hard profile split: resident Epiphany sub-agents use lean `work_organ` state, public/person-shaped agents use portable `persona` state, and heartbeat/swarm machinery owns scheduling/coordination physiology. Face is the Epiphany organ; Persona is the shared GameCult contract for Epiphany Face, VoidBot repo Faces, and Ghostlight characters. Persona documents carry provenance, required public presentation metadata, `date-time` timestamps, typed `candidateActions`, strict anchored thoughts with non-authoritative extensions, custom enum companion labels, and typed affect subrecords for bonds/status reads/doctrine stances. Work organs must not inherit Persona affect/social-bond/status-read machinery just because the old Ghostlight-derived shape had room for it. @@ -591,4 +591,4 @@ current_status: cargo and rejects modeling/planning/graph/checkpoint authority. MVP status and coordinator smokes pass with six lanes, and the smoke harness now rebuilds stale coordinator/app-server binaries before using them. - next_action: Continue the Perfect Machine rebuild by choosing the next chain carefully. Research evidence promotion now has Substrate Gate + Eyes + Mind proof, Verification has Soul + Mind proof, and reorient acceptance has Continuity + Mind proof. The next likely fork is Hands action proof once implementation/action lanes become live versus collapsing Mind review/state mutation/commit into one storage-owner admission primitive. + next_action: Wire dynamic Verse/memory prompt context into the real coordinator/local-run launch path after the smoke-proved launch-document handoff, then choose the next chain carefully: Hands action proof once implementation/action lanes become live versus collapsing Mind review/state mutation/commit into one storage-owner admission primitive.