Use memory graph store for worker context
This commit is contained in:
parent
08db7512fe
commit
d1d7291a82
11 changed files with 175 additions and 9 deletions
|
|
@ -482,6 +482,7 @@ pub async fn select_epiphany_coordinator_automation(
|
|||
input.state,
|
||||
checkpoint,
|
||||
&reorient_decision,
|
||||
None,
|
||||
)
|
||||
}),
|
||||
EpiphanyCoordinatorAutomationAction::None
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ use epiphany_core::EpiphanyMemoryContextQuery;
|
|||
use epiphany_core::EpiphanyReorientWorkerLaunchDocument;
|
||||
use epiphany_core::EpiphanyRoleWorkerLaunchDocument;
|
||||
use epiphany_core::EpiphanyWorkerLaunchDocument;
|
||||
use epiphany_core::EpiphanyMemoryGraphSnapshot;
|
||||
use epiphany_core::memory_graph_from_epiphany_graphs;
|
||||
use epiphany_core::plan_memory_graph_context_cut;
|
||||
|
||||
|
|
@ -409,6 +410,7 @@ pub fn build_epiphany_role_launch_request(
|
|||
expected_revision: Option<u64>,
|
||||
max_runtime_seconds: Option<u64>,
|
||||
state: &EpiphanyThreadState,
|
||||
memory_graph_snapshot: Option<&EpiphanyMemoryGraphSnapshot>,
|
||||
) -> Result<EpiphanyJobLaunchRequest, String> {
|
||||
let binding_id = epiphany_role_binding_id(role_id)?;
|
||||
let owner_role = epiphany_role_owner(role_id)?;
|
||||
|
|
@ -447,7 +449,7 @@ pub fn build_epiphany_role_launch_request(
|
|||
.cloned()
|
||||
.collect(),
|
||||
active_graph_node_ids: linked_graph_node_ids.clone(),
|
||||
memory_context: build_role_memory_context(role_id, state),
|
||||
memory_context: build_role_memory_context(role_id, state, memory_graph_snapshot),
|
||||
investigation_checkpoint: state.investigation_checkpoint.clone(),
|
||||
scratch: state.scratch.clone(),
|
||||
invariants: state.invariants.clone(),
|
||||
|
|
@ -493,14 +495,22 @@ fn build_epiphany_role_launch_instruction(role_id: ThreadEpiphanyRoleId) -> Stri
|
|||
fn build_role_memory_context(
|
||||
role_id: ThreadEpiphanyRoleId,
|
||||
state: &EpiphanyThreadState,
|
||||
memory_graph_snapshot: Option<&EpiphanyMemoryGraphSnapshot>,
|
||||
) -> Option<EpiphanyMemoryContextPacket> {
|
||||
let snapshot = memory_graph_from_epiphany_graphs("role-launch-thread-graph", &state.graphs);
|
||||
let fallback_snapshot;
|
||||
let snapshot = if let Some(snapshot) = memory_graph_snapshot {
|
||||
snapshot
|
||||
} else {
|
||||
fallback_snapshot =
|
||||
memory_graph_from_epiphany_graphs("role-launch-thread-graph", &state.graphs);
|
||||
&fallback_snapshot
|
||||
};
|
||||
if snapshot.domains.is_empty() && snapshot.nodes.is_empty() && snapshot.edges.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let query_text = role_memory_context_query_text(role_id, state);
|
||||
let packet = plan_memory_graph_context_cut(
|
||||
&snapshot,
|
||||
snapshot,
|
||||
&EpiphanyMemoryContextQuery {
|
||||
id: format!(
|
||||
"role-launch-memory-context-{}",
|
||||
|
|
@ -546,6 +556,53 @@ fn role_memory_context_query_text(
|
|||
parts.join("\n")
|
||||
}
|
||||
|
||||
fn build_reorient_memory_context(
|
||||
state: &EpiphanyThreadState,
|
||||
checkpoint: &EpiphanyInvestigationCheckpoint,
|
||||
decision: &ThreadEpiphanyReorientDecision,
|
||||
memory_graph_snapshot: Option<&EpiphanyMemoryGraphSnapshot>,
|
||||
) -> Option<EpiphanyMemoryContextPacket> {
|
||||
let fallback_snapshot;
|
||||
let snapshot = if let Some(snapshot) = memory_graph_snapshot {
|
||||
snapshot
|
||||
} else {
|
||||
fallback_snapshot =
|
||||
memory_graph_from_epiphany_graphs("reorient-launch-thread-graph", &state.graphs);
|
||||
&fallback_snapshot
|
||||
};
|
||||
if snapshot.domains.is_empty() && snapshot.nodes.is_empty() && snapshot.edges.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let mut parts = vec![
|
||||
"reorientation".to_string(),
|
||||
reorient_action_label(decision.action).to_string(),
|
||||
checkpoint.focus.clone(),
|
||||
];
|
||||
if let Some(next_action) = &checkpoint.next_action {
|
||||
parts.push(next_action.clone());
|
||||
}
|
||||
if let Some(objective) = &state.objective {
|
||||
parts.push(objective.clone());
|
||||
}
|
||||
for node_id in decision
|
||||
.active_frontier_node_ids
|
||||
.iter()
|
||||
{
|
||||
parts.push(node_id.clone());
|
||||
}
|
||||
let packet = plan_memory_graph_context_cut(
|
||||
snapshot,
|
||||
&EpiphanyMemoryContextQuery {
|
||||
id: "reorient-launch-memory-context".to_string(),
|
||||
text: Some(parts.join("\n")),
|
||||
budget: Some(8),
|
||||
..Default::default()
|
||||
},
|
||||
);
|
||||
(!packet.nodes.is_empty() || !packet.edges.is_empty() || !packet.summaries.is_empty())
|
||||
.then_some(packet)
|
||||
}
|
||||
|
||||
pub fn build_epiphany_reorient_launch_request(
|
||||
thread_id: &str,
|
||||
expected_revision: Option<u64>,
|
||||
|
|
@ -553,6 +610,7 @@ pub fn build_epiphany_reorient_launch_request(
|
|||
state: &EpiphanyThreadState,
|
||||
checkpoint: &EpiphanyInvestigationCheckpoint,
|
||||
decision: &ThreadEpiphanyReorientDecision,
|
||||
memory_graph_snapshot: Option<&EpiphanyMemoryGraphSnapshot>,
|
||||
) -> EpiphanyJobLaunchRequest {
|
||||
let linked_subgoal_ids = epiphany_active_subgoal_ids(Some(state));
|
||||
let linked_graph_node_ids = unique_strings(
|
||||
|
|
@ -609,7 +667,8 @@ pub fn build_epiphany_reorient_launch_request(
|
|||
.map(path_to_display_string)
|
||||
.collect(),
|
||||
scratch: state.scratch.clone(),
|
||||
graphs: Some(state.graphs.clone()),
|
||||
memory_context: build_reorient_memory_context(state, checkpoint, decision, memory_graph_snapshot),
|
||||
graphs: None,
|
||||
recent_evidence: state.recent_evidence.iter().take(8).cloned().collect(),
|
||||
recent_observations: state.observations.iter().take(8).cloned().collect(),
|
||||
active_frontier_node_ids: decision.active_frontier_node_ids.clone(),
|
||||
|
|
@ -673,7 +732,7 @@ fn map_core_role_worker_launch_document(
|
|||
active_subgoal_id: document.active_subgoal_id,
|
||||
active_subgoals: document.active_subgoals,
|
||||
active_graph_node_ids: document.active_graph_node_ids,
|
||||
memory_context: None,
|
||||
memory_context: document.memory_context,
|
||||
investigation_checkpoint: document.investigation_checkpoint,
|
||||
scratch: document.scratch,
|
||||
invariants: document.invariants,
|
||||
|
|
@ -711,6 +770,7 @@ fn map_core_reorient_worker_launch_document(
|
|||
checkpoint_dirty_paths: document.checkpoint_dirty_paths,
|
||||
checkpoint_changed_paths: document.checkpoint_changed_paths,
|
||||
scratch: document.scratch,
|
||||
memory_context: document.memory_context,
|
||||
graphs: document.graphs,
|
||||
recent_evidence: document.recent_evidence,
|
||||
recent_observations: document.recent_observations,
|
||||
|
|
@ -755,9 +815,12 @@ pub fn render_epiphany_coordinator_note(
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use codex_app_server_protocol::ThreadEpiphanyReorientCheckpointStatus;
|
||||
use codex_protocol::protocol::EpiphanyGraph;
|
||||
use codex_protocol::protocol::EpiphanyGraphNode;
|
||||
use codex_protocol::protocol::EpiphanyGraphs;
|
||||
use codex_protocol::protocol::EpiphanyInvestigationCheckpoint;
|
||||
use codex_protocol::protocol::EpiphanyInvestigationDisposition;
|
||||
|
||||
#[test]
|
||||
fn role_launch_includes_typed_memory_context_from_accepted_graph() {
|
||||
|
|
@ -784,6 +847,7 @@ mod tests {
|
|||
Some(0),
|
||||
None,
|
||||
&state,
|
||||
None,
|
||||
)
|
||||
.expect("role launch should build");
|
||||
|
||||
|
|
@ -804,6 +868,75 @@ mod tests {
|
|||
.any(|node| node.claim.contains("OpenAI authentication"))
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn reorient_launch_includes_typed_memory_context_without_full_graph_cargo() {
|
||||
let state = EpiphanyThreadState {
|
||||
objective: Some("Resume the auth map cleanly.".to_string()),
|
||||
graphs: EpiphanyGraphs {
|
||||
architecture: EpiphanyGraph {
|
||||
nodes: vec![EpiphanyGraphNode {
|
||||
id: "auth-spine".to_string(),
|
||||
title: "Auth spine".to_string(),
|
||||
purpose: "Codex remains responsible for OpenAI authentication.".to_string(),
|
||||
..Default::default()
|
||||
}],
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
},
|
||||
..Default::default()
|
||||
};
|
||||
let checkpoint = EpiphanyInvestigationCheckpoint {
|
||||
checkpoint_id: "checkpoint-auth".to_string(),
|
||||
kind: "architecture".to_string(),
|
||||
disposition: EpiphanyInvestigationDisposition::ResumeReady,
|
||||
focus: "Auth spine".to_string(),
|
||||
summary: Some("Keep Codex auth as the vestigial organ.".to_string()),
|
||||
next_action: Some("Resume with typed memory context.".to_string()),
|
||||
..Default::default()
|
||||
};
|
||||
let decision = ThreadEpiphanyReorientDecision {
|
||||
action: ThreadEpiphanyReorientAction::Resume,
|
||||
checkpoint_status: ThreadEpiphanyReorientCheckpointStatus::ResumeReady,
|
||||
checkpoint_id: Some("checkpoint-auth".to_string()),
|
||||
pressure_level: ThreadEpiphanyPressureLevel::Low,
|
||||
retrieval_status: ThreadEpiphanyRetrievalFreshnessStatus::Ready,
|
||||
graph_status: ThreadEpiphanyGraphFreshnessStatus::Ready,
|
||||
watcher_status: ThreadEpiphanyInvalidationStatus::Clean,
|
||||
reasons: Vec::new(),
|
||||
checkpoint_dirty_paths: Vec::new(),
|
||||
checkpoint_changed_paths: Vec::new(),
|
||||
active_frontier_node_ids: vec!["auth-spine".to_string()],
|
||||
next_action: "Resume with typed memory context.".to_string(),
|
||||
note: "resume".to_string(),
|
||||
};
|
||||
|
||||
let launch = build_epiphany_reorient_launch_request(
|
||||
"thread-1",
|
||||
Some(0),
|
||||
None,
|
||||
&state,
|
||||
&checkpoint,
|
||||
&decision,
|
||||
None,
|
||||
);
|
||||
|
||||
let EpiphanyWorkerLaunchDocument::Reorient(document) = launch.launch_document else {
|
||||
panic!("expected reorient launch document");
|
||||
};
|
||||
assert!(
|
||||
document.graphs.is_none(),
|
||||
"native reorient launch should use typed memoryContext instead of full graph cargo"
|
||||
);
|
||||
let context = document
|
||||
.memory_context
|
||||
.expect("reorient launch should carry typed memory context");
|
||||
assert!(
|
||||
!context.nodes.is_empty() || !context.summaries.is_empty(),
|
||||
"reorient launch should carry a bounded typed memory context"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
pub fn unique_strings(values: impl IntoIterator<Item = String>) -> Vec<String> {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ use codex_protocol::protocol::EpiphanyThreadState;
|
|||
use codex_protocol::protocol::TokenUsageInfo as CoreTokenUsageInfo;
|
||||
use epiphany_core::EpiphanyJobInterruptRequest;
|
||||
use epiphany_core::EpiphanyJobLaunchRequest;
|
||||
use epiphany_core::EpiphanyMemoryGraphSnapshot;
|
||||
use epiphany_core::EpiphanyMemoryPatchReview;
|
||||
use epiphany_core::EpiphanyMemoryPatchReviewStatus;
|
||||
use epiphany_core::EpiphanyPromotionInput;
|
||||
|
|
@ -384,12 +385,14 @@ pub async fn launch_thread_epiphany_role(
|
|||
.to_string(),
|
||||
)
|
||||
})?;
|
||||
let memory_graph_snapshot = load_thread_memory_graph_snapshot(thread).await?;
|
||||
let launch_request = build_epiphany_role_launch_request(
|
||||
thread_id,
|
||||
role_id,
|
||||
expected_revision,
|
||||
max_runtime_seconds,
|
||||
&state,
|
||||
memory_graph_snapshot.as_ref(),
|
||||
)
|
||||
.map_err(CodexErr::InvalidRequest)?;
|
||||
launch_thread_epiphany_job(
|
||||
|
|
@ -491,6 +494,7 @@ pub async fn launch_thread_epiphany_reorient(
|
|||
state,
|
||||
checkpoint,
|
||||
&decision,
|
||||
load_thread_memory_graph_snapshot(thread).await?.as_ref(),
|
||||
);
|
||||
let changed_fields = epiphany_job_launch_changed_fields();
|
||||
let launched = thread.epiphany_launch_job(launch_request).await?;
|
||||
|
|
@ -520,6 +524,19 @@ pub async fn launch_thread_epiphany_reorient(
|
|||
})
|
||||
}
|
||||
|
||||
async fn load_thread_memory_graph_snapshot(
|
||||
thread: &CodexThread,
|
||||
) -> Result<Option<EpiphanyMemoryGraphSnapshot>, CodexErr> {
|
||||
let config = thread.config_snapshot().await;
|
||||
let store_path = memory_graph_store_path(config.cwd.as_path());
|
||||
load_memory_graph_snapshot(&store_path).map_err(|err| {
|
||||
CodexErr::InvalidRequest(format!(
|
||||
"failed to load memory graph store {}: {err}",
|
||||
store_path.display()
|
||||
))
|
||||
})
|
||||
}
|
||||
|
||||
fn validate_expected_revision(
|
||||
expected_revision: Option<u64>,
|
||||
actual_revision: u64,
|
||||
|
|
|
|||
|
|
@ -111,6 +111,8 @@ pub struct EpiphanyReorientWorkerLaunchDocument {
|
|||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub scratch: Option<EpiphanyScratchPad>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub memory_context: Option<EpiphanyMemoryContextPacket>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub graphs: Option<EpiphanyGraphs>,
|
||||
#[serde(default)]
|
||||
pub recent_evidence: Vec<EpiphanyEvidenceRecord>,
|
||||
|
|
|
|||
|
|
@ -407,7 +407,11 @@ policy and the specialist prompt routes graph growth through
|
|||
`statePatch.graphs`; graph replacement remains only a non-normal legacy surface
|
||||
outside Modeling acceptance. The next cleanup is removing remaining
|
||||
operator/UI assumptions that graph growth comes from thread-state graph
|
||||
replacement instead of the unified memory graph.
|
||||
replacement instead of the unified memory graph. Native role and reorientation
|
||||
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.
|
||||
|
||||
### Phase 7: Sleep And Repo Refresh
|
||||
|
||||
|
|
|
|||
|
|
@ -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. `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. `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.
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -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, profile/lifecycle 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. 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. 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 worker launches now carry typed `memoryContext` instead of full `graphs`; 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`; 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.
|
||||
|
|
|
|||
|
|
@ -3923,6 +3923,7 @@ mod tests {
|
|||
active_subgoal_id: Some("phase6".to_string()),
|
||||
active_subgoals: Vec::new(),
|
||||
active_graph_node_ids: vec!["job-surface".to_string()],
|
||||
memory_context: None,
|
||||
investigation_checkpoint: None,
|
||||
scratch: None,
|
||||
invariants: Vec::new(),
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ use codex_protocol::protocol::EpiphanyInvestigationCheckpoint as CoreEpiphanyInv
|
|||
use codex_protocol::protocol::EpiphanyInvestigationDisposition as CoreEpiphanyInvestigationDisposition;
|
||||
use codex_protocol::protocol::EpiphanyJobBinding as CoreEpiphanyJobBinding;
|
||||
use codex_protocol::protocol::EpiphanyJobKind as CoreEpiphanyJobKind;
|
||||
use codex_protocol::protocol::EpiphanyMemoryContextPacket as CoreEpiphanyMemoryContextPacket;
|
||||
use codex_protocol::protocol::EpiphanyMemoryPatchCandidate as CoreEpiphanyMemoryPatchCandidate;
|
||||
use codex_protocol::protocol::EpiphanyMemoryPatchReview as CoreEpiphanyMemoryPatchReview;
|
||||
use codex_protocol::protocol::EpiphanyModeState as CoreEpiphanyModeState;
|
||||
|
|
@ -5230,6 +5231,9 @@ pub struct ThreadEpiphanyRoleWorkerLaunchDocument {
|
|||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
pub active_graph_node_ids: Vec<String>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional = nullable, type = "CoreEpiphanyMemoryContextPacket | null")]
|
||||
pub memory_context: Option<CoreEpiphanyMemoryContextPacket>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional = nullable)]
|
||||
pub investigation_checkpoint: Option<CoreEpiphanyInvestigationCheckpoint>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
|
|
@ -5295,6 +5299,9 @@ pub struct ThreadEpiphanyReorientWorkerLaunchDocument {
|
|||
#[ts(optional = nullable)]
|
||||
pub scratch: Option<CoreEpiphanyScratchPad>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional = nullable, type = "CoreEpiphanyMemoryContextPacket | null")]
|
||||
pub memory_context: Option<CoreEpiphanyMemoryContextPacket>,
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
#[ts(optional = nullable)]
|
||||
pub graphs: Option<CoreEpiphanyGraphs>,
|
||||
#[serde(default, skip_serializing_if = "Vec::is_empty")]
|
||||
|
|
|
|||
|
|
@ -2964,6 +2964,7 @@ pub use epiphany_state_model::EpiphanyInvestigationCheckpoint;
|
|||
pub use epiphany_state_model::EpiphanyInvestigationDisposition;
|
||||
pub use epiphany_state_model::EpiphanyJobBinding;
|
||||
pub use epiphany_state_model::EpiphanyJobKind;
|
||||
pub use epiphany_state_model::EpiphanyMemoryContextPacket;
|
||||
pub use epiphany_state_model::EpiphanyMemoryPatchCandidate;
|
||||
pub use epiphany_state_model::EpiphanyMemoryPatchReview;
|
||||
pub use epiphany_state_model::EpiphanyMemoryPatchReviewStatus;
|
||||
|
|
|
|||
Reference in a new issue