diff --git a/epiphany-codex-bridge/src/view.rs b/epiphany-codex-bridge/src/view.rs index 2b83b3c3..b3ee2347 100644 --- a/epiphany-codex-bridge/src/view.rs +++ b/epiphany-codex-bridge/src/view.rs @@ -546,15 +546,19 @@ pub fn map_epiphany_propose_response( }) .map_err(|err| err.to_string())?; + let graph_frontier = proposal + .memory_patch_candidates + .is_empty() + .then_some(proposal.graph_frontier); Ok(ThreadEpiphanyProposeResponse { expected_revision, patch: ThreadEpiphanyUpdatePatch { observations: vec![proposal.observation], evidence: vec![proposal.evidence], - graphs: Some(proposal.graphs), - graph_frontier: Some(proposal.graph_frontier), + graph_frontier, churn: Some(proposal.churn), ..Default::default() }, + memory_patch_candidates: proposal.memory_patch_candidates, }) } diff --git a/epiphany-core/src/proposal.rs b/epiphany-core/src/proposal.rs index 41920c69..ec021294 100644 --- a/epiphany-core/src/proposal.rs +++ b/epiphany-core/src/proposal.rs @@ -7,6 +7,8 @@ use epiphany_state_model::EpiphanyGraphEdge; use epiphany_state_model::EpiphanyGraphFrontier; use epiphany_state_model::EpiphanyGraphNode; use epiphany_state_model::EpiphanyGraphs; +use epiphany_state_model::EpiphanyMemoryPatchCandidate; +use epiphany_state_model::EpiphanyMemoryProfile; use epiphany_state_model::EpiphanyObservation; use epiphany_state_model::EpiphanyThreadState; use sha1::Digest; @@ -15,6 +17,8 @@ use std::collections::HashSet; use std::path::Path; use std::path::PathBuf; +use crate::memory_graph::memory_graph_from_epiphany_graphs; + const SUMMARY_LIMIT: usize = 220; const SEMANTIC_REUSE_MIN_SCORE: usize = 4; const AUTO_OBSERVATION_SELECTION_LIMIT: usize = 4; @@ -110,6 +114,7 @@ pub struct EpiphanyMapProposal { pub graphs: EpiphanyGraphs, pub graph_frontier: EpiphanyGraphFrontier, pub churn: EpiphanyChurnState, + pub memory_patch_candidates: Vec, } pub fn propose_map_update(input: EpiphanyMapProposalInput) -> Result { @@ -119,7 +124,8 @@ pub fn propose_map_update(input: EpiphanyMapProposalInput) -> Result Result Vec { + let base = memory_graph_from_epiphany_graphs("map-proposal-base", base_graphs); + let proposed = memory_graph_from_epiphany_graphs("map-proposal-proposed", proposed_graphs); + let base_domain_ids = base + .domains + .iter() + .map(|domain| domain.id.as_str()) + .collect::>(); + let base_node_ids = base + .nodes + .iter() + .map(|node| node.id.as_str()) + .collect::>(); + let base_edge_ids = base + .edges + .iter() + .map(|edge| edge.id.as_str()) + .collect::>(); + + [ + EpiphanyMemoryProfile::RepoArchitecture, + EpiphanyMemoryProfile::RepoDataflow, + ] + .into_iter() + .filter_map(|profile| { + let proposed_domains = proposed + .domains + .iter() + .filter(|domain| domain.profile == profile) + .filter(|domain| !base_domain_ids.contains(domain.id.as_str())) + .cloned() + .collect::>(); + let proposed_nodes = proposed + .nodes + .iter() + .filter(|node| node.profile == profile) + .filter(|node| !base_node_ids.contains(node.id.as_str())) + .cloned() + .collect::>(); + let proposed_edges = proposed + .edges + .iter() + .filter(|edge| edge.profile == profile) + .filter(|edge| !base_edge_ids.contains(edge.id.as_str())) + .cloned() + .collect::>(); + if proposed_domains.is_empty() && proposed_nodes.is_empty() && proposed_edges.is_empty() { + return None; + } + Some(EpiphanyMemoryPatchCandidate { + id: format!("mempatch-map-proposal-{fingerprint}-{}", memory_profile_label(profile)), + profile, + status: "proposed".to_string(), + proposed_domains, + proposed_nodes, + proposed_edges, + reasons: vec![format!( + "Map proposal derived from {selection_summary}; graph growth is represented as typed memory patch candidates, not state graph replacement." + )], + }) + }) + .collect() +} + +fn memory_profile_label(profile: EpiphanyMemoryProfile) -> &'static str { + match profile { + EpiphanyMemoryProfile::RepoArchitecture => "repo-architecture", + EpiphanyMemoryProfile::RepoDataflow => "repo-dataflow", + EpiphanyMemoryProfile::RoleSelf => "role-self", + EpiphanyMemoryProfile::ShortTerm => "short-term", + EpiphanyMemoryProfile::Incubation => "incubation", + EpiphanyMemoryProfile::AgencyPressure => "agency-pressure", + EpiphanyMemoryProfile::CandidateIntervention => "candidate-intervention", + EpiphanyMemoryProfile::Evidence => "evidence", + EpiphanyMemoryProfile::Identity => "identity", + } +} + fn proposal_observation_ids( state: &EpiphanyThreadState, observation_ids: Vec, @@ -1187,6 +1282,12 @@ mod tests { assert_eq!(proposal.graph_frontier.active_node_ids.len(), 1); assert_eq!(proposal.churn.understanding_status, "proposal_expands_map"); assert_eq!(proposal.churn.diff_pressure, "medium"); + assert_eq!(proposal.memory_patch_candidates.len(), 1); + assert_eq!( + proposal.memory_patch_candidates[0].profile, + EpiphanyMemoryProfile::RepoArchitecture + ); + assert_eq!(proposal.memory_patch_candidates[0].proposed_nodes.len(), 1); } #[test] @@ -1228,6 +1329,10 @@ mod tests { proposal.churn.graph_freshness.as_deref(), Some("proposal-refined") ); + assert!( + proposal.memory_patch_candidates.is_empty(), + "existing graph revisions need a separate reviewer, not append-only memory patch candidates" + ); } #[test] diff --git a/notes/epiphany-memory-graph-unified-plan.md b/notes/epiphany-memory-graph-unified-plan.md index bd31df71..af81ff2e 100644 --- a/notes/epiphany-memory-graph-unified-plan.md +++ b/notes/epiphany-memory-graph-unified-plan.md @@ -259,7 +259,7 @@ Generic graph operations: Profile-specific operations: -- repo profiles may propose architecture/dataflow graph patches +- repo profiles may propose architecture/dataflow memory patch candidates - role profiles may apply reviewed selfPatch-derived memory - short-term profile may cluster/prune/distill - incubation profile may deepen/cool/promote/retire @@ -412,6 +412,10 @@ launch now prefer the persisted `state/memory-graph.msgpack` snapshot for typed `memoryContext` cuts, falling back to accepted thread graphs only as bootstrap scaffolding when the store is absent. Reorientation launch no longer carries full `graphs` cargo; the legacy field remains only for compatibility ingress. +The old `thread/epiphany/propose` route no longer returns replacement `graphs` +in its patch; graph growth is exposed as typed `memoryPatchCandidates` and +frontier updates are withheld when the proposal depends on unapplied memory +growth. ### Phase 7: Sleep And Repo Refresh diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index e1c32de6..4643b62c 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -39,7 +39,7 @@ remembers doctrine; the branch remembers the blade. - `epiphany-openai-runtime` worker result ingress now parses assistant output directly into typed role/reorient ingress structs selected from the durable launch document, stores nested `statePatch` and `selfPatch` as typed MessagePack in `EpiphanyRuntimeRoleWorkerResult`, and no longer passes worker result data through generic `serde_json::Value`. JSON survives there only as the OpenAI text-output edge before typed deserialization. - Agent self-memory review/application now has typed `AgentSelfPatch` core APIs. JSON-value selfPatch functions are compatibility wrappers for CLI/artifact ingress; native callers should parse once at the edge and then call `review_agent_self_patch_document` / `apply_agent_self_patch_document`. Role-result self-persistence no longer exports a JSON-value reviewer; the live API is `review_role_self_patch_document`. - `epiphany-openai-codex-spine` no longer uses Codex's Responses client, model-provider layer, `codex-api`, `codex-model-provider`, `codex-model-provider-info`, or `codex-protocol` for outbound model requests. It reaches `codex-login` only through `epiphany-openai-auth-spine` so credential loading/refresh stays Codex-compatible while request/status/event/runtime surfaces stay typed Epiphany documents. -- `notes/epiphany-memory-graph-unified-plan.md` is the current memory architecture direction drawn from `Fractal Domains And The Cache That Bites` plus the VoidBot memory scar tissue. The repo semantic architecture/dataflow graph and agent memory are one `EpiphanyMemoryGraph` substrate with repo, role, short-term, incubation, agency, candidate-intervention, and evidence profiles. The first native skeleton is landed: `epiphany-state-model` owns shared graph document types, `epiphany-core::memory_graph` owns stable ids, validation, freshness, context cuts, and CultCache persistence, and `epiphany-memory-graph` can status/validate/context/semantic-context/smoke/index the store. `epiphany-core::semantic_cache` now owns the shared Qdrant/Ollama transport used by workspace retrieval and memory graph indexing, so Qdrant remains a rebuildable contribution cache for typed graph documents, not truth. Runtime role results expose typed `memoryPatchCandidates`; Modeling `roleAccept` applies them to `state/memory-graph.msgpack`; native role/reorientation launches now prefer that persisted memory graph for bounded typed `memoryContext` cuts and only fall back to legacy accepted thread graphs for bootstrap. Reorientation launch no longer carries full `graphs` cargo. `notes/repo-fractal-dataflow-cache-plan.md` and `notes/agent-memory-fractal-cache-plan.md` are profile plans, not rival organs. +- `notes/epiphany-memory-graph-unified-plan.md` is the current memory architecture direction drawn from `Fractal Domains And The Cache That Bites` plus the VoidBot memory scar tissue. The repo semantic architecture/dataflow graph and agent memory are one `EpiphanyMemoryGraph` substrate with repo, role, short-term, incubation, agency, candidate-intervention, and evidence profiles. The first native skeleton is landed: `epiphany-state-model` owns shared graph document types, `epiphany-core::memory_graph` owns stable ids, validation, freshness, context cuts, and CultCache persistence, and `epiphany-memory-graph` can status/validate/context/semantic-context/smoke/index the store. `epiphany-core::semantic_cache` now owns the shared Qdrant/Ollama transport used by workspace retrieval and memory graph indexing, so Qdrant remains a rebuildable contribution cache for typed graph documents, not truth. Runtime role results expose typed `memoryPatchCandidates`; Modeling `roleAccept` applies them to `state/memory-graph.msgpack`; native role/reorientation launches now prefer that persisted memory graph for bounded typed `memoryContext` cuts and only fall back to legacy accepted thread graphs for bootstrap. Reorientation launch no longer carries full `graphs` cargo. The old `thread/epiphany/propose` read route no longer returns replacement `graphs`; it exposes graph growth as typed `memoryPatchCandidates` and withholds frontier updates that depend on unapplied memory growth. `notes/repo-fractal-dataflow-cache-plan.md` and `notes/agent-memory-fractal-cache-plan.md` are profile plans, not rival organs. - Durable Epiphany state types now live in root crate `epiphany-state-model`. `codex-protocol` re-exports them only so old rollout/API callers keep compiling; do not add new durable `Epiphany*` state structs under `vendor/codex`. `epiphany-core` imports the native model directly and no longer depends on `codex-protocol`. Pressure derives from native `EpiphanyTokenUsageSnapshot`; Codex token telemetry is mapped at the bridge. Codex rollout/event reconstruction now lives in `codex-core::epiphany_rollout`, where the Codex `RolloutItem` / `EventMsg` types belong. Exact retrieval path matching is native to `epiphany-core`, so `epiphany-core` has no direct vendored Codex crate dependency. - State-update contract proof and job launch/interrupt DTO ownership now live in native `epiphany-core`. The old giant `codex_thread.rs` Epiphany state-update test fixture was cut, and `epiphany-codex-bridge` no longer imports Epiphany job launch request types from `codex_core`; vendored `CodexThread` may call the native mutation/launch law for compatibility, but it must not regain ownership of state-update semantics, heartbeat launch-plan policy, or Epiphany DTOs. - MCP remains JSON because MCP is a JSON protocol. The latest processor cut only moved MCP refresh/OAuth/status/resource/tool-call route handling into `codex_message_processor/mcp_routes.rs`, reducing the root processor to about 8,977 lines; it did not claim MCP payloads are CultNet or make MCP an Epiphany-owned runtime contract. @@ -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; native role worker launch documents now carry typed `memoryContext` instead of full `graphs`; typed runtime role results can persist `memoryPatchCandidates` for graph/memory growth proposals; `epiphany-core` reviews/appends candidate domains/nodes/edges against the typed graph with lifecycle receipts; `epiphany-memory-graph review-candidate` / `apply-candidate` expose that law for typed candidate files; roleResult findings expose typed `memoryPatchCandidates` for pre-acceptance operator review; bridge Modeling `roleAccept` applies runtime-spine memory patch candidates into `state/memory-graph.msgpack` through the same graph law, bootstrapping from accepted thread graphs when needed; roleAccept responses expose typed `memoryPatchReviews`; and Modeling `statePatch.graphs` is rejected by policy/prompt/schema so graph growth uses memory patch candidates. The next clean slice is removing remaining operator/UI assumptions that graph growth comes from thread-state graph replacement instead of the unified memory graph. +- 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/reorientation worker launch documents now prefer persisted typed `memoryContext` instead of full `graphs`; typed runtime role results can persist `memoryPatchCandidates` for graph/memory growth proposals; `epiphany-core` reviews/appends candidate domains/nodes/edges against the typed graph with lifecycle receipts; `epiphany-memory-graph review-candidate` / `apply-candidate` expose that law for typed candidate files; roleResult findings expose typed `memoryPatchCandidates` for pre-acceptance operator review; bridge Modeling `roleAccept` applies runtime-spine memory patch candidates into `state/memory-graph.msgpack` through the same graph law, bootstrapping from accepted thread graphs when needed; roleAccept responses expose typed `memoryPatchReviews`; Modeling `statePatch.graphs` is rejected by policy/prompt/schema; and `thread/epiphany/propose` exposes typed `memoryPatchCandidates` instead of replacement `graphs`. The next clean slice is removing remaining operator/UI assumptions that graph growth comes from thread-state graph replacement instead of the unified memory graph. - 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 a3864365..cfef8bbd 100644 Binary files a/state/ledgers.msgpack and b/state/ledgers.msgpack differ diff --git a/state/map.yaml b/state/map.yaml index 7b12531c..b65d6e45 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -75,7 +75,7 @@ active_subgoals: - The May 2026 teardown/rebuild migration in `notes/epiphany-ideal-architecture-rebuild-plan.md` is closed unless a concrete regression reopens it. Preserve the new foundation: Epiphany view/coordinator policy lives in `epiphany-core`, runtime-spine owns job/result lifecycle identity through `runtime_links`, duplicate acceptance is receipt-keyed, public findings stay typed/sealed, view expansion requires a core contract, and app-server remains routing/adaptation rather than a second policy throne. - Treat Phase 5 update/distill/propose/promote/read/notification as complete enough unless a concrete regression appears. - Preserve read-only boundaries for retrieve, distill, propose, freshness, context, graphQuery, roleResult, reorientResult, and the canonical view lenses for scene, jobs, roles, planning, pressure, reorient, crrc, and coordinator. - - Use `notes/epiphany-memory-graph-unified-plan.md` as the source-grounded memory architecture direction. The repo fractal dataflow graph and agent memory are one `EpiphanyMemoryGraph` substrate with repo, role, short-term, incubation, agency, candidate-intervention, and evidence profiles. Qdrant stores rebuildable semantic embeddings for typed graph documents; it is never canonical memory. The first live skeleton now exists in `epiphany-state-model` plus `epiphany-core::memory_graph`: typed graph documents, stable ids, validation, freshness propagation, context cuts, a CultCache store seam, deterministic embedding documents, manifest persistence, Qdrant rebuild through shared semantic-cache transport, and semantic context fallback that resolves cache hits back through the typed graph. Modeling graph growth now travels as typed `memoryPatchCandidates`, is applied during `roleAccept` into `state/memory-graph.msgpack`, and future role/reorientation launches prefer that persisted graph for bounded typed `memoryContext` cuts; accepted thread graphs are only bootstrap fallback. Do not add repo scanners, sleep runners, prompt integration, or ranking shortcuts before routing them through this shared substrate. + - Use `notes/epiphany-memory-graph-unified-plan.md` as the source-grounded memory architecture direction. The repo fractal dataflow graph and agent memory are one `EpiphanyMemoryGraph` substrate with repo, role, short-term, incubation, agency, candidate-intervention, and evidence profiles. Qdrant stores rebuildable semantic embeddings for typed graph documents; it is never canonical memory. The first live skeleton now exists in `epiphany-state-model` plus `epiphany-core::memory_graph`: typed graph documents, stable ids, validation, freshness propagation, context cuts, a CultCache store seam, deterministic embedding documents, manifest persistence, Qdrant rebuild through shared semantic-cache transport, and semantic context fallback that resolves cache hits back through the typed graph. Modeling graph growth now travels as typed `memoryPatchCandidates`, is applied during `roleAccept` into `state/memory-graph.msgpack`, and future role/reorientation launches prefer that persisted graph for bounded typed `memoryContext` cuts; accepted thread graphs are only bootstrap fallback. The old `thread/epiphany/propose` read route now exposes graph growth as typed `memoryPatchCandidates` instead of replacement `graphs`. Do not add repo scanners, sleep runners, prompt integration, or ranking shortcuts before routing them through this shared substrate. - Keep the landed Phase 6 coordinator, limited safe-boundary CRRC automation, and pre-compaction checkpoint intervention ready for the next bridge-equipped dogfood run. - Preserve the Ghostlight-derived heartbeat initiative seam: every lane, including coordinator/Self and Face, has a role dossier and competes for heartbeat slots through readiness/reaction timing; idle winners ruminate instead of inventing project work, and sleep windows distill the accumulated thought pressure into reviewed self-memory or doctrine. - Treat Ghostlight as reference lineage, not a sibling runtime to preserve. The useful organ is Epiphany-native character-loop protocol: any role can project its typed dossier plus visible stimulus into a local turn packet, with Face as the first public-surface actor. @@ -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; native role/reorientation worker launches now prefer persisted `state/memory-graph.msgpack` for typed `memoryContext` and no longer carry full graph cargo on native paths; typed runtime role results can persist `memoryPatchCandidates`; `epiphany-core` can review/apply append-only candidate graph growth with lifecycle receipts; `epiphany-memory-graph review-candidate` / `apply-candidate` expose that law for typed candidate files; roleResult findings expose typed `memoryPatchCandidates` for pre-acceptance operator review; bridge Modeling `roleAccept` applies runtime-spine memory patch candidates into `state/memory-graph.msgpack` through the same graph law; roleAccept responses expose typed `memoryPatchReviews`; and Modeling `statePatch.graphs` is rejected by policy/prompt/schema so graph growth uses memory patch candidates. The next clean slice is removing remaining operator/UI assumptions that graph growth comes from thread-state graph replacement instead of the unified memory graph. + 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/reorientation worker launches now prefer persisted `state/memory-graph.msgpack` for typed `memoryContext` and no longer carry full graph cargo on native paths; typed runtime role results can persist `memoryPatchCandidates`; `epiphany-core` can review/apply append-only candidate graph growth with lifecycle receipts; `epiphany-memory-graph review-candidate` / `apply-candidate` expose that law for typed candidate files; roleResult findings expose typed `memoryPatchCandidates` for pre-acceptance operator review; bridge Modeling `roleAccept` applies runtime-spine memory patch candidates into `state/memory-graph.msgpack` through the same graph law; roleAccept responses expose typed `memoryPatchReviews`; Modeling `statePatch.graphs` is rejected by policy/prompt/schema; and `thread/epiphany/propose` now exposes graph growth as typed `memoryPatchCandidates` instead of replacement `graphs`. The next clean slice is cutting or quarantining the remaining generic update/promote graph replacement authority. diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs index f5801851..a4498bac 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/common.rs @@ -2821,6 +2821,7 @@ mod tests { }), ..Default::default() }, + memory_patch_candidates: Vec::new(), }, }; diff --git a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs index 7ac62b5a..7d16704b 100644 --- a/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs +++ b/vendor/codex/codex-rs/app-server-protocol/src/protocol/v2.rs @@ -5013,6 +5013,9 @@ pub struct ThreadEpiphanyProposeParams { pub struct ThreadEpiphanyProposeResponse { pub expected_revision: u64, pub patch: ThreadEpiphanyUpdatePatch, + #[serde(default, skip_serializing_if = "Vec::is_empty")] + #[ts(type = "Array")] + pub memory_patch_candidates: Vec, } #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]