From 735e31f2a660c30dbe817ac019070671dde9459b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 18 May 2026 03:40:21 +0100 Subject: [PATCH] Replace role graph cargo with memory patch candidates --- epiphany-codex-bridge/src/launch.rs | 6 +++- .../src/prompts/epiphany_specialists.toml | 4 +-- epiphany-core/src/runtime_spine.rs | 10 ++++++ epiphany-core/src/surfaces/role_result.rs | 15 +++++++++ epiphany-openai-runtime/src/lib.rs | 29 ++++++++++++++++-- notes/epiphany-memory-graph-unified-plan.md | 11 ++++--- notes/fresh-workspace-handoff.md | 2 +- state/ledgers.msgpack | Bin 136175 -> 136749 bytes state/map.yaml | 2 +- 9 files changed, 67 insertions(+), 12 deletions(-) diff --git a/epiphany-codex-bridge/src/launch.rs b/epiphany-codex-bridge/src/launch.rs index ff9277c1..94a355ea 100644 --- a/epiphany-codex-bridge/src/launch.rs +++ b/epiphany-codex-bridge/src/launch.rs @@ -440,7 +440,7 @@ pub fn build_epiphany_role_launch_request( investigation_checkpoint: state.investigation_checkpoint.clone(), scratch: state.scratch.clone(), invariants: state.invariants.clone(), - graphs: Some(state.graphs.clone()), + graphs: None, recent_evidence: state.recent_evidence.iter().take(8).cloned().collect(), recent_observations: state.observations.iter().take(8).cloned().collect(), graph_frontier: state.graph_frontier.clone(), @@ -779,6 +779,10 @@ mod tests { let EpiphanyWorkerLaunchDocument::Role(document) = launch.launch_document else { panic!("expected role launch document"); }; + assert!( + document.graphs.is_none(), + "native role launch should use typed memoryContext instead of full graph cargo" + ); let context = document .memory_context .expect("role launch should carry typed memory context"); diff --git a/epiphany-codex-bridge/src/prompts/epiphany_specialists.toml b/epiphany-codex-bridge/src/prompts/epiphany_specialists.toml index 004d8365..c66170a5 100644 --- a/epiphany-codex-bridge/src/prompts/epiphany_specialists.toml +++ b/epiphany-codex-bridge/src/prompts/epiphany_specialists.toml @@ -83,8 +83,8 @@ The Body improves itself by becoming harder to misread. If the graph, checkpoint Inspect source before you trust the model; when the map feels warm but the source feels cold, believe the source and mark the wound. Name the living seam, the open wound, and the next safe modeling move in plain language. Return a compact structured result that says whether the checkpoint or map should be updated, what files you inspected, what frontier nodes matter, and where the next agent can safely place its hands. -`statePatch` is part of the modeling job. If you return `checkpoint-ready`, `checkpoint-update-needed`, or `regather-needed`, include a reviewable `thread/epiphany/update` patch using only modeling-safe fields (`graphs`, `graphFrontier`, `graphCheckpoint`, `scratch`, `investigationCheckpoint`, plus optional valid `observations` and `evidence`). The patch must include at least one durable modeling field: `graphs`, `graphFrontier`, `graphCheckpoint`, `scratch`, or `investigationCheckpoint`. Do not return an observations-only patch. Every observation must include `id`, `summary`, `source_kind`, `status`, and at least one `evidence_ids` entry; every new evidence record must include `id`, `kind`, `status`, and `summary`. For graph growth, return the full replacement graph object with the new or revised nodes/edges already woven into the current anatomy. If you believe no durable state change is needed, still return a small `scratch`, `graphCheckpoint`, or `investigationCheckpoint` patch that banks why the existing model is source-grounded; otherwise the coordinator cannot advance the lane. -Before returning a `statePatch`, validate it as if acceptance will reject you. `graphs.architecture.nodes[].id` defines the only valid `architecture_node_id` values. `graphs.dataflow.nodes[].id` defines the only valid `dataflow_node_id` values. Every `graphs.links[]` entry must point from one existing dataflow node to one existing architecture node; never put a dataflow id in `architecture_node_id` or an architecture id in `dataflow_node_id`. If a concept needs to exist in both layers, create or reuse one node in each layer and link them explicitly. Every frontier/checkpoint node id you name must exist in the graph you return. +`statePatch` is part of the modeling job. If you return `checkpoint-ready`, `checkpoint-update-needed`, or `regather-needed`, include a reviewable `thread/epiphany/update` patch using only modeling-safe fields (`graphCheckpoint`, `scratch`, `investigationCheckpoint`, plus optional valid `observations` and `evidence`; legacy `graphs` and `graphFrontier` are accepted only when the launch document explicitly gives enough graph state to validate them). The patch must include at least one durable modeling field: `graphCheckpoint`, `scratch`, `investigationCheckpoint`, `graphs`, or `graphFrontier`. Do not return an observations-only patch. Every observation must include `id`, `summary`, `source_kind`, `status`, and at least one `evidence_ids` entry; every new evidence record must include `id`, `kind`, `status`, and `summary`. For graph or memory growth, prefer `memoryPatchCandidates[]`: propose typed `EpiphanyMemoryPatchCandidate` records containing proposed nodes/edges and reasons. Do not invent a full replacement graph from partial prompt context. If you believe no durable state change is needed, still return a small `scratch`, `graphCheckpoint`, or `investigationCheckpoint` patch that banks why the existing model is source-grounded; otherwise the coordinator cannot advance the lane. +Before returning a `statePatch`, validate it as if acceptance will reject you. If you use legacy `graphs`, `graphs.architecture.nodes[].id` defines the only valid `architecture_node_id` values and `graphs.dataflow.nodes[].id` defines the only valid `dataflow_node_id` values. Every `graphs.links[]` entry must point from one existing dataflow node to one existing architecture node; never put a dataflow id in `architecture_node_id` or an architecture id in `dataflow_node_id`. Every frontier/checkpoint node id you name must exist in the graph you return or in the supplied typed `memoryContext`. Do not confuse the modeling verdict with checkpoint enum values. `verdict` may be `checkpoint-ready`, but `statePatch.investigationCheckpoint.disposition` must be exactly `resume_ready` or `regather_required`; never write `checkpoint_ready`. Do not edit files, do not implement product code, do not verify as if you were the reviewer, do not change jobs/subgoals/objective/invariants/churn/mode, and do not promote or accept your own output. ''' diff --git a/epiphany-core/src/runtime_spine.rs b/epiphany-core/src/runtime_spine.rs index ecd3e465..b91dac74 100644 --- a/epiphany-core/src/runtime_spine.rs +++ b/epiphany-core/src/runtime_spine.rs @@ -286,6 +286,8 @@ pub struct EpiphanyRuntimeRoleWorkerResult { pub item_error: Option, #[cultcache(key = 19, default)] pub metadata: BTreeMap, + #[cultcache(key = 20, default)] + pub memory_patch_candidates_msgpack: Option>, } impl EpiphanyRuntimeRoleWorkerResult { @@ -299,6 +301,14 @@ impl EpiphanyRuntimeRoleWorkerResult { pub fn self_patch(&self) -> Result> { decode_optional_msgpack(self.self_patch_msgpack.as_deref(), "role worker selfPatch") } + + pub fn memory_patch_candidates(&self) -> Result> { + decode_optional_msgpack( + self.memory_patch_candidates_msgpack.as_deref(), + "role worker memoryPatchCandidates", + ) + .map(|candidates| candidates.unwrap_or_default()) + } } #[derive(Clone, Debug, PartialEq, DatabaseEntry)] diff --git a/epiphany-core/src/surfaces/role_result.rs b/epiphany-core/src/surfaces/role_result.rs index 7163fde1..f7a26ad3 100644 --- a/epiphany-core/src/surfaces/role_result.rs +++ b/epiphany-core/src/surfaces/role_result.rs @@ -40,6 +40,7 @@ pub struct EpiphanyRoleFindingInterpretation { pub risks: Vec, pub state_patch: Option, pub self_patch: Option, + pub memory_patch_candidates: Vec, pub self_persistence: Option, pub job_error: Option, pub item_error: Option, @@ -167,6 +168,7 @@ fn interpret_role_finding( risks: json_string_array_field(raw_result, "risks"), state_patch, self_patch, + memory_patch_candidates: Vec::new(), self_persistence, job_error, item_error, @@ -211,6 +213,11 @@ pub fn interpret_runtime_role_worker_result( .as_ref() .ok() .and_then(|patch| patch.clone()); + let memory_patch_candidates_result = result.memory_patch_candidates(); + let memory_patch_candidates = memory_patch_candidates_result + .as_ref() + .cloned() + .unwrap_or_default(); let item_error = merge_item_error( result.item_error.clone(), state_patch_result.as_ref().err().map(ToString::to_string), @@ -219,6 +226,13 @@ pub fn interpret_runtime_role_worker_result( item_error, self_patch_result.as_ref().err().map(ToString::to_string), ); + let item_error = merge_item_error( + item_error, + memory_patch_candidates_result + .as_ref() + .err() + .map(ToString::to_string), + ); EpiphanyRoleFindingInterpretation { verdict: Some(result.verdict.clone()), summary: Some(result.summary.clone()), @@ -236,6 +250,7 @@ pub fn interpret_runtime_role_worker_result( risks: result.risks.clone(), state_patch: state_patch.clone(), self_patch, + memory_patch_candidates, self_persistence: None, job_error: None, item_error: match role_id { diff --git a/epiphany-openai-runtime/src/lib.rs b/epiphany-openai-runtime/src/lib.rs index f4e8430f..09dc19d9 100644 --- a/epiphany-openai-runtime/src/lib.rs +++ b/epiphany-openai-runtime/src/lib.rs @@ -541,7 +541,7 @@ fn worker_instructions( fn worker_output_contract_text(document: &EpiphanyWorkerLaunchDocument) -> &'static str { match document { EpiphanyWorkerLaunchDocument::Role(_) => { - "Required role-result fields: roleId, verdict, summary, nextSafeMove, filesInspected. Modeling and Imagination workers must include their required statePatch. Use arrays for frontierNodeIds, evidenceIds, openQuestions, evidenceGaps, risks, and artifactRefs when present." + "Required role-result fields: roleId, verdict, summary, nextSafeMove, filesInspected. Modeling and Imagination workers must include their required statePatch. Modeling workers should put proposed graph/memory changes in memoryPatchCandidates instead of relying on prompt-local full graph rewrites. Use arrays for frontierNodeIds, evidenceIds, openQuestions, evidenceGaps, risks, artifactRefs, and memoryPatchCandidates when present." } EpiphanyWorkerLaunchDocument::Reorient(_) => { "Required reorient-result fields: mode, summary, nextSafeMove. Include checkpointStillValid, filesInspected, frontierNodeIds, evidenceIds, openQuestions, and continuityRisks when present." @@ -567,6 +567,7 @@ struct RoleWorkerResultIngress { risks: Vec, state_patch: Option, self_patch: Option, + memory_patch_candidates: Vec, } #[derive(Debug, Clone, Default, serde::Deserialize)] @@ -660,6 +661,8 @@ fn role_worker_result_from_ingress( encode_optional_document(&result.state_patch, "statePatch"); let (self_patch_msgpack, self_patch_error) = encode_optional_document(&result.self_patch, "selfPatch"); + let (memory_patch_candidates_msgpack, memory_patch_candidates_error) = + encode_optional_vec_document(&result.memory_patch_candidates, "memoryPatchCandidates"); EpiphanyRuntimeRoleWorkerResult { schema_version: epiphany_core::RUNTIME_ROLE_WORKER_RESULT_SCHEMA_VERSION.to_string(), result_id: result_id.to_string(), @@ -684,8 +687,12 @@ fn role_worker_result_from_ingress( risks: clean_string_vec(&result.risks), state_patch_msgpack, self_patch_msgpack, - item_error: merge_optional_errors(state_patch_error, self_patch_error), + item_error: merge_optional_errors( + merge_optional_errors(state_patch_error, self_patch_error), + memory_patch_candidates_error, + ), metadata: std::collections::BTreeMap::new(), + memory_patch_candidates_msgpack, } } @@ -732,6 +739,19 @@ where } } +fn encode_optional_vec_document(value: &[T], key: &str) -> (Option>, Option) +where + T: serde::Serialize, +{ + if value.is_empty() { + return (None, None); + } + match rmp_serde::to_vec_named(value) { + Ok(payload) => (Some(payload), None), + Err(err) => (None, Some(format!("failed to encode {key}: {err}"))), + } +} + fn merge_optional_errors(left: Option, right: Option) -> Option { match (left, right) { (Some(left), Some(right)) => Some(format!("{left}; {right}")), @@ -932,7 +952,7 @@ mod tests { &launch_request, &model_request.request_id, &openai_summary, - r#"{"roleId":"modeling","verdict":"checkpoint-ready","summary":"Mapped.","nextSafeMove":"Review the patch.","filesInspected":["src/lib.rs"],"evidenceIds":["ev-1"],"artifactRefs":["artifact:model"],"statePatch":{"objective":"Keep the machine mapped."},"selfPatch":{"reason":"typed nested document"}} "#, + r#"{"roleId":"modeling","verdict":"checkpoint-ready","summary":"Mapped.","nextSafeMove":"Review the patch.","filesInspected":["src/lib.rs"],"evidenceIds":["ev-1"],"artifactRefs":["artifact:model"],"statePatch":{"objective":"Keep the machine mapped."},"selfPatch":{"reason":"typed nested document"},"memoryPatchCandidates":[{"id":"mempatch-auth-spine","profile":"repo_architecture","status":"proposed","proposedNodes":[{"id":"memnode-auth-spine","domainId":"memdom-repo","profile":"repo_architecture","kind":"module","title":"Auth spine","claim":"Codex remains responsible for OpenAI authentication.","question":"","tension":"","actionImplication":"","lifecycle":"proposed"}],"reasons":["Modeling proposes typed graph growth without full graph cargo."]}]} "#, )?; assert_eq!(result.job_id, "worker-job-1"); @@ -953,6 +973,9 @@ mod tests { typed_result.self_patch()?.expect("self patch").reason, Some("typed nested document".to_string()) ); + let memory_candidates = typed_result.memory_patch_candidates()?; + assert_eq!(memory_candidates.len(), 1); + assert_eq!(memory_candidates[0].id, "mempatch-auth-spine"); assert!( runtime_job_snapshot(&store, "worker-job-1")? .expect("snapshot") diff --git a/notes/epiphany-memory-graph-unified-plan.md b/notes/epiphany-memory-graph-unified-plan.md index 9e718796..e3748a19 100644 --- a/notes/epiphany-memory-graph-unified-plan.md +++ b/notes/epiphany-memory-graph-unified-plan.md @@ -385,10 +385,13 @@ order before lexical fallback, and if Qdrant is missing, falls back to typed graph traversal with an explicit warning. Still open: bridge/runtime prompt integration should consume these typed context -packets without serializing a second memory format. First landing: role worker -launch documents now include optional typed `memoryContext` packets derived -from the accepted graph through the memory graph substrate. The next cleanup is -to remove the old full-graph prompt cargo once result contracts are ready. +packets without serializing a second memory format. First landing: native role +worker launch documents now include typed `memoryContext` packets derived from +the accepted graph through the memory graph substrate and no longer carry full +`graphs` cargo. Runtime role results can persist typed +`memoryPatchCandidates`; the next cleanup is accepting/reviewing those +candidates into the unified graph so Modeling stops using full graph +replacement patches for ordinary graph growth. ### Phase 7: Sleep And Repo Refresh diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index e75c9934..ec789646 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -96,7 +96,7 @@ remembers doctrine; the branch remembers the blade. - The heartbeat initiative pass is landed as a bounded tool seam. `state/agent-heartbeats.msgpack` tracks Self, Face, Imagination, Eyes, Body, Hands, Soul, and Life as Ghostlight-style initiative participants with arena, participant kind, speed, next-ready time, reaction bias, interrupt threshold, load, status, constraints, personality cooldown, mood cooldown, effective cooldown, adaptive pacing, history, and pending turns through `epiphany-core::EpiphanyHeartbeatStateEntry` and the native `epiphany-heartbeat-store` binary. Role dossiers set baseline timing; appraisal mood/anxiety bends it through urgency, arousal, thought pressure, guardedness, and reaction intensity, so Hands-like work pressure and high-need anxious lanes recover sooner without being heartbeaten while a prior turn is running. `epiphany-heartbeat-store pump` computes pressure from external urgency, mood/anxiety, reaction intensity, thought pressure, and current pending load, then chooses tempo plus target concurrency: calm can launch zero and sleep slow; alarm can fill most active lanes. Idle turns are for rumination: light thought shuffling, role-quality attention, and candidate selfPatch pressure. Sleep/dream cycle passes are the intended distillation window for durable self-memory and doctrine. JSON heartbeat state and Python wrapper state are gone; general CultCache schema sync, polyglot domain loading, and debug display tools belong in CultLib. This is a callable scheduler seam, not yet an always-on daemon; a heart valve, not a whole circulatory god. - The first Ghostlight-derived timing slice is landed in Epiphany, but Ghostlight is reference lineage rather than a sibling runtime to preserve. `epiphany-heartbeat-store init --profile ghostlight-scene --scene-id --scene-participant ` creates a typed CultCache MessagePack scene heartbeat store whose participants are `arena=scene`, `participantKind=character`; `tick` emits `ghostlight.initiative_schedule.v0` receipts with `scene_turn` actions and local-affordance basis. The generic Epiphany maintenance lanes are not auto-patched into scene stores. - The first Void-derived routine slice is landed in Epiphany, but VoidBot is reference lineage rather than a runtime dependency. `epiphany-heartbeat-store routine --store .\state\agent-heartbeats.msgpack --artifact-dir .\.epiphany-heartbeats --agent-store .\state\agents.msgpack` reads typed role dossiers, computes bounded memory resonance, maintains incubation themes, runs analytic and associative cognition lanes, writes bridge syntheses/saturation/tension, projects the active thought cluster through each role's Ghostlight-shaped personality vectors, derives participant-local reactions, applies personality/mood timing, advances the sleep/dream cycle, updates the typed heartbeat store, and emits an auditable `epiphany.void_routine.v0` receipt. The routine now also carries anti-loop physiology imported from Void's calmer brain: `noveltyToSelf`, `noveltyToRoom`, source coverage, saturation pressure, refractory cooling, and explicit permission to let a live unsaturated thought deepen without forcing novelty theater every pass. This mutates only heartbeat physiology fields: project truth and role memory mutation remain on their reviewed surfaces. -- The next memory foundation must not build separate engines for repo graph and agent mind. Heartbeat cognition, role self-memory, repo architecture/dataflow, evidence scars, incubation, agency pressure, and context packets should converge through `EpiphanyMemoryGraph` profiles so one typed graph owns anchors, lifecycle, summaries, freshness, context cuts, and Qdrant embedding manifests. Repo, agent, and heartbeat profile producers now map accepted graph truth, reviewed role dossier memories/goals/values, and provisional heartbeat short-term/incubation/agency/candidate pressure into memory graph documents without scanner/model work. Heartbeat import deliberately does not mark durable promotion. Compose now merges profile snapshots into one validated graph and rejects duplicate authority; `epiphany-memory-graph compose` writes a composed typed CultCache graph from typed source graph stores; `epiphany-memory-graph refresh` can invoke live agent-memory plus heartbeat-cognition producers from their typed stores into one graph store; `epiphany-core` has a native typed `EpiphanyThreadState` CultCache store seam; the bridge mirrors loaded Codex-thread Epiphany state into `state/thread-state.msgpack`; CultNet advertises logical `EpiphanyThreadState` plus `EpiphanyMemoryGraph` snapshot contracts; memory graph nodes/edges/summaries project into deterministic typed embedding documents; `epiphany-memory-graph manifest` writes the embedding manifest back to the typed graph store; `epiphany-memory-graph index` fully rebuilds a Qdrant cache collection through the shared semantic cache transport; `epiphany-memory-graph semantic-context` uses ordered Qdrant IDs to seed typed graph context while falling back to graph traversal when the cache is absent; and role worker launch documents now carry an optional typed `memoryContext` packet derived from the accepted graph through the memory graph substrate. The next clean slice is replacing full legacy graph cargo in worker prompts with memory context once result contracts are updated. +- The next memory foundation must not build separate engines for repo graph and agent mind. Heartbeat cognition, role self-memory, repo architecture/dataflow, evidence scars, incubation, agency pressure, and context packets should converge through `EpiphanyMemoryGraph` profiles so one typed graph owns anchors, lifecycle, summaries, freshness, context cuts, and Qdrant embedding manifests. Repo, agent, and heartbeat profile producers now map accepted graph truth, reviewed role dossier memories/goals/values, and provisional heartbeat short-term/incubation/agency/candidate pressure into memory graph documents without scanner/model work. Heartbeat import deliberately does not mark durable promotion. Compose now merges profile snapshots into one validated graph and rejects duplicate authority; `epiphany-memory-graph compose` writes a composed typed CultCache graph from typed source graph stores; `epiphany-memory-graph refresh` can invoke live agent-memory plus heartbeat-cognition producers from their typed stores into one graph store; `epiphany-core` has a native typed `EpiphanyThreadState` CultCache store seam; the bridge mirrors loaded Codex-thread Epiphany state into `state/thread-state.msgpack`; CultNet advertises logical `EpiphanyThreadState` plus `EpiphanyMemoryGraph` snapshot contracts; memory graph nodes/edges/summaries project into deterministic typed embedding documents; `epiphany-memory-graph manifest` writes the embedding manifest back to the typed graph store; `epiphany-memory-graph index` fully rebuilds a Qdrant cache collection through the shared semantic cache transport; `epiphany-memory-graph semantic-context` uses ordered Qdrant IDs to seed typed graph context while falling back to graph traversal when the cache is absent; native role worker launch documents now carry typed `memoryContext` instead of full `graphs`; and typed runtime role results can persist `memoryPatchCandidates` for graph/memory growth proposals. The next clean slice is accepting/reviewing memory patch candidates into the unified graph rather than asking Modeling for full graph replacement patches. - Manual Codex-run rumination still has an explicit aftercare rule until Epiphany owns the full sleep consolidator. In the intended Epiphany cycle, sub-agents ruminate when idle and distill when they sleep; in this supervising Codex thread, a heartbeat/routine vigil is only physiology until a separate closing pass reviews the receipts and decides whether map, handoff, evidence, or role self-memory should change. - The Face public-surface pass is landed as a bounded lane. Face's role dossier lives in `state/agents.msgpack`; `epiphany_specialists.toml` gives it a VoidBot-heartbeat-derived prompt stripped of moderation authority; `state/face-discord.toml` and the native `epiphany-face-discord` binary enforce that Face may interact only through #aquarium. Missing channel id or token writes candidate chat artifacts instead of posting elsewhere. If a Face has a persona name/avatar, `post` uses the shared Discord webhook pipe so each Epiphany can speak with its own nickname and avatar without a separate bot identity. - The Void memory bridge is now native enough to keep the useful organs attached. `state/void-memory.toml` and `epiphany-void-memory` can check Void's Docker Postgres state spine, query Qdrant Discord-history and source/lore collections with the configured Ollama embedding model, and fetch raw archive context windows from Void's file-backed Discord archive. Native `epiphany-mvp-status` includes a `voidMemory` block so Aquarium/backend clients can inspect whether the mouth and memory are actually wired. diff --git a/state/ledgers.msgpack b/state/ledgers.msgpack index c91612ab8fcdd0a8c6e9b1c636ec9098a5161b69..7935134bd70a404059808daa33bfcbee09c2dc8d 100644 GIT binary patch delta 509 zcmZvZze^-B6vxRlZmlSyCpsP(Ky4UKgt^6t2CTko$cXJQ@JWV0C+$12ljS2deGSJ+s0|ZMcLdtV3 z5_G_|1TG~?@FNq>3^TH$9qvWa4KpRV4=PV!bM003_S~Y&Q|}tEMG{k`W6(4Ni{c1_ zMbLlP)g|rm(7!qfuEAI`4R2qp%Gl=e+0Y#F7A2TGzA2tBR`fp;BJjJX(96b?+O3gFcq;6kABD2u-v zY+;cMYOd<<4GhT+&<1JQ0fc(|a}yzK4-<`yNInSs}58Ek*`LX1WHZx`q}Z21Zr} JmR6>QQ2_7}5E1|Y diff --git a/state/map.yaml b/state/map.yaml index 8eb9f743..8a6ead49 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -297,4 +297,4 @@ current_status: freshness propagation, summary-versus-child context cuts, and a validated CultCache store entry; the native `epiphany-memory-graph` binary can status/validate/query/smoke the store without Qdrant. - next_action: Continue the memory graph build unless a more urgent Codex starvation regression appears. Repo, agent, and heartbeat profile producers now map accepted architecture/dataflow graph truth, reviewed role dossier memory/goals/values, and heartbeat cognition pressure into `EpiphanyMemoryGraph` documents; compose merges profile snapshots into one validated graph; `epiphany-memory-graph compose` writes from typed graph stores; `epiphany-memory-graph refresh` can invoke live agent-memory and heartbeat-cognition producers from their typed stores; `epiphany-core` has a native typed `EpiphanyThreadState` CultCache store seam; the bridge mirrors loaded Codex-thread Epiphany state into `state/thread-state.msgpack`; CultNet advertises logical `EpiphanyThreadState` plus `EpiphanyMemoryGraph` snapshot contracts; memory graph nodes/edges/summaries project into deterministic typed embedding documents; `epiphany-memory-graph manifest` writes the embedding manifest back to the typed graph store; `epiphany-core::semantic_cache` owns shared Qdrant/Ollama transport; `epiphany-memory-graph index` fully rebuilds Qdrant from typed graph documents while keeping the manifest in the graph store; `epiphany-memory-graph semantic-context` asks Qdrant for graph IDs only, preserves hit order, then resolves context from typed graph state with a no-cache fallback; and role worker launch documents now carry optional typed `memoryContext` derived through the memory graph substrate. The next clean slice is replacing full legacy graph cargo in worker prompts with memory context once result contracts are updated. + next_action: Continue the memory graph build unless a more urgent Codex starvation regression appears. Repo, agent, and heartbeat profile producers now map accepted architecture/dataflow graph truth, reviewed role dossier memory/goals/values, and heartbeat cognition pressure into `EpiphanyMemoryGraph` documents; compose merges profile snapshots into one validated graph; `epiphany-memory-graph compose` writes from typed graph stores; `epiphany-memory-graph refresh` can invoke live agent-memory and heartbeat-cognition producers from their typed stores; `epiphany-core` has a native typed `EpiphanyThreadState` CultCache store seam; the bridge mirrors loaded Codex-thread Epiphany state into `state/thread-state.msgpack`; CultNet advertises logical `EpiphanyThreadState` plus `EpiphanyMemoryGraph` snapshot contracts; memory graph nodes/edges/summaries project into deterministic typed embedding documents; `epiphany-memory-graph manifest` writes the embedding manifest back to the typed graph store; `epiphany-core::semantic_cache` owns shared Qdrant/Ollama transport; `epiphany-memory-graph index` fully rebuilds Qdrant from typed graph documents while keeping the manifest in the graph store; `epiphany-memory-graph semantic-context` asks Qdrant for graph IDs only, preserves hit order, then resolves context from typed graph state with a no-cache fallback; native role worker launches now carry typed `memoryContext` instead of full `graphs`; and typed runtime role results can persist `memoryPatchCandidates`. The next clean slice is accepting/reviewing memory patch candidates into the unified graph instead of asking Modeling for full graph replacement patches.