Purge deleted Epiphany route contracts

This commit is contained in:
Meta Vens 2026-07-12 07:01:13 +01:00
commit 3c92272d22
210 changed files with 57975 additions and 59891 deletions

View file

@ -33,7 +33,6 @@ pub mod protocol_edge;
pub mod reorient;
pub mod results;
pub mod retrieve;
pub mod retrieve_protocol;
pub mod runtime_results;
pub mod scene;
pub mod scene_protocol;

View file

@ -14,7 +14,6 @@ use crate::cultnet::EpiphanyReorientStateStatus;
use crate::cultnet::EpiphanyRetrievalFreshnessStatus;
use crate::cultnet::EpiphanySurfaceSource;
use codex_app_server_protocol::ThreadEpiphanyContextParams;
use codex_app_server_protocol::ThreadEpiphanyDistillParams;
use codex_app_server_protocol::ThreadEpiphanyFreshnessResponse;
use codex_app_server_protocol::ThreadEpiphanyFreshnessSource;
use codex_app_server_protocol::ThreadEpiphanyGraphFreshness;
@ -39,7 +38,6 @@ use codex_app_server_protocol::ThreadEpiphanyReorientReason;
use codex_app_server_protocol::ThreadEpiphanyReorientResultStatus;
use codex_app_server_protocol::ThreadEpiphanyReorientSource;
use codex_app_server_protocol::ThreadEpiphanyReorientStateStatus;
use codex_app_server_protocol::ThreadEpiphanyReorientWorkerLaunchDocument;
use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshness;
use codex_app_server_protocol::ThreadEpiphanyRetrievalFreshnessStatus;
use codex_app_server_protocol::ThreadEpiphanyRoleFinding;
@ -47,18 +45,15 @@ use codex_app_server_protocol::ThreadEpiphanyRoleId;
use codex_app_server_protocol::ThreadEpiphanyRoleResultStatus;
use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceReview;
use codex_app_server_protocol::ThreadEpiphanyRoleSelfPersistenceStatus;
use codex_app_server_protocol::ThreadEpiphanyRoleWorkerLaunchDocument;
use codex_app_server_protocol::ThreadEpiphanyRolesSource;
use codex_app_server_protocol::ThreadEpiphanyStateUpdatedField;
use codex_app_server_protocol::ThreadEpiphanyStateUpdatedNotification;
use codex_app_server_protocol::ThreadEpiphanyStateUpdatedSource;
use codex_app_server_protocol::ThreadEpiphanyUpdatePatch;
use codex_app_server_protocol::ThreadEpiphanyViewLens;
use codex_app_server_protocol::ThreadEpiphanyWorkerLaunchDocument;
use epiphany_core::EpiphanyContextParams;
use epiphany_core::EpiphanyCoordinatorRoleResultStatus;
use epiphany_core::EpiphanyCrrcResultStatus;
use epiphany_core::EpiphanyDistillInput;
use epiphany_core::EpiphanyGraphQuery;
use epiphany_core::EpiphanyGraphQueryDirection;
use epiphany_core::EpiphanyGraphQueryKind;
@ -67,16 +62,13 @@ use epiphany_core::EpiphanyPressureBasis;
use epiphany_core::EpiphanyPressureLevel;
use epiphany_core::EpiphanyPressureStatus;
use epiphany_core::EpiphanyReorientFindingInterpretation;
use epiphany_core::EpiphanyReorientWorkerLaunchDocument;
use epiphany_core::EpiphanyRoleFindingInterpretation;
use epiphany_core::EpiphanyRoleResultRoleId;
use epiphany_core::EpiphanyRoleSelfPersistenceReview;
use epiphany_core::EpiphanyRoleSelfPersistenceStatus;
use epiphany_core::EpiphanyRoleStatePatchDocument;
use epiphany_core::EpiphanyRoleWorkerLaunchDocument;
use epiphany_core::EpiphanyStateUpdatedField;
use epiphany_core::EpiphanyViewLens;
use epiphany_core::EpiphanyWorkerLaunchDocument;
use epiphany_core::default_epiphany_view_lenses;
use epiphany_core::epiphany_view_needs_jobs;
use epiphany_core::epiphany_view_needs_pressure;
@ -134,28 +126,6 @@ pub fn protocol_context_params_to_core(
}
}
pub fn protocol_distill_params_to_core(
params: ThreadEpiphanyDistillParams,
) -> EpiphanyDistillInput {
let ThreadEpiphanyDistillParams {
source_kind,
status,
text,
subject,
evidence_kind,
code_refs,
..
} = params;
EpiphanyDistillInput {
source_kind,
status,
text,
subject,
evidence_kind,
code_refs,
}
}
pub fn protocol_graph_query_to_core(query: &ThreadEpiphanyGraphQuery) -> EpiphanyGraphQuery {
EpiphanyGraphQuery {
kind: protocol_graph_query_kind_to_core(query.kind),
@ -170,21 +140,6 @@ pub fn protocol_graph_query_to_core(query: &ThreadEpiphanyGraphQuery) -> Epiphan
}
}
pub fn protocol_worker_launch_document_to_core(
document: ThreadEpiphanyWorkerLaunchDocument,
) -> EpiphanyWorkerLaunchDocument {
match document {
ThreadEpiphanyWorkerLaunchDocument::Role(document) => EpiphanyWorkerLaunchDocument::Role(
protocol_role_worker_launch_document_to_core(document),
),
ThreadEpiphanyWorkerLaunchDocument::Reorient(document) => {
EpiphanyWorkerLaunchDocument::Reorient(
protocol_reorient_worker_launch_document_to_core(document),
)
}
}
}
pub fn protocol_update_patch_to_core(
patch: &ThreadEpiphanyUpdatePatch,
) -> EpiphanyRoleStatePatchDocument {
@ -657,65 +612,6 @@ fn protocol_graph_query_direction_to_core(
}
}
fn protocol_role_worker_launch_document_to_core(
document: ThreadEpiphanyRoleWorkerLaunchDocument,
) -> EpiphanyRoleWorkerLaunchDocument {
EpiphanyRoleWorkerLaunchDocument {
thread_id: document.thread_id,
role_id: document.role_id,
state_revision: document.state_revision,
objective: document.objective,
dynamic_prompt_context: None,
active_subgoal_id: document.active_subgoal_id,
active_subgoals: document.active_subgoals,
active_graph_node_ids: document.active_graph_node_ids,
investigation_checkpoint: document.investigation_checkpoint,
scratch: document.scratch,
invariants: document.invariants,
graphs: document.graphs,
recent_evidence: document.recent_evidence,
recent_observations: document.recent_observations,
graph_frontier: document.graph_frontier,
graph_checkpoint: document.graph_checkpoint,
planning: document.planning,
churn: document.churn,
}
}
fn protocol_reorient_worker_launch_document_to_core(
document: ThreadEpiphanyReorientWorkerLaunchDocument,
) -> EpiphanyReorientWorkerLaunchDocument {
EpiphanyReorientWorkerLaunchDocument {
thread_id: document.thread_id,
mode: document.mode,
checkpoint_id: document.checkpoint_id,
checkpoint_kind: document.checkpoint_kind,
checkpoint_disposition: document.checkpoint_disposition,
dynamic_prompt_context: None,
checkpoint_focus: document.checkpoint_focus,
checkpoint_summary: document.checkpoint_summary,
checkpoint_next_action: document.checkpoint_next_action,
checkpoint_open_questions: document.checkpoint_open_questions,
checkpoint_evidence_ids: document.checkpoint_evidence_ids,
checkpoint_code_refs: document.checkpoint_code_refs,
decision_reasons: document.decision_reasons,
decision_note: document.decision_note,
pressure_level: document.pressure_level,
retrieval_status: document.retrieval_status,
graph_status: document.graph_status,
watcher_status: document.watcher_status,
checkpoint_dirty_paths: document.checkpoint_dirty_paths,
checkpoint_changed_paths: document.checkpoint_changed_paths,
scratch: document.scratch,
graphs: document.graphs,
recent_evidence: document.recent_evidence,
recent_observations: document.recent_observations,
active_frontier_node_ids: document.active_frontier_node_ids,
linked_subgoal_ids: document.linked_subgoal_ids,
linked_graph_node_ids: document.linked_graph_node_ids,
}
}
fn protocol_reorient_retrieval_status(
status: EpiphanyReorientFreshnessStatus,
) -> ThreadEpiphanyRetrievalFreshnessStatus {

View file

@ -1,83 +0,0 @@
use codex_app_server_protocol::ThreadEpiphanyIndexResponse;
use codex_app_server_protocol::ThreadEpiphanyRetrieveIndexSummary;
use codex_app_server_protocol::ThreadEpiphanyRetrieveResponse;
use codex_app_server_protocol::ThreadEpiphanyRetrieveResult;
use codex_app_server_protocol::ThreadEpiphanyRetrieveResultKind;
use codex_app_server_protocol::ThreadEpiphanyRetrieveShardSummary;
use codex_utils_absolute_path::AbsolutePathBuf;
use epiphany_core::EpiphanyRetrieveResponse as CoreEpiphanyRetrieveResponse;
use epiphany_core::EpiphanyRetrieveResult as CoreEpiphanyRetrieveResult;
use epiphany_core::EpiphanyRetrieveResultKind as CoreEpiphanyRetrieveResultKind;
use epiphany_state_model::EpiphanyRetrievalState;
pub fn protocol_retrieve_response(
response: CoreEpiphanyRetrieveResponse,
) -> anyhow::Result<ThreadEpiphanyRetrieveResponse> {
Ok(ThreadEpiphanyRetrieveResponse {
query: response.query,
index_summary: protocol_retrieve_index_summary(response.index_summary)?,
results: response
.results
.into_iter()
.map(protocol_retrieve_result)
.collect(),
})
}
pub fn protocol_index_response(
index_summary: EpiphanyRetrievalState,
) -> anyhow::Result<ThreadEpiphanyIndexResponse> {
Ok(ThreadEpiphanyIndexResponse {
index_summary: protocol_retrieve_index_summary(index_summary)?,
})
}
pub fn protocol_retrieve_index_summary(
summary: EpiphanyRetrievalState,
) -> anyhow::Result<ThreadEpiphanyRetrieveIndexSummary> {
Ok(ThreadEpiphanyRetrieveIndexSummary {
workspace_root: AbsolutePathBuf::from_absolute_path(summary.workspace_root)
.map_err(anyhow::Error::from)?,
index_revision: summary.index_revision,
status: summary.status,
semantic_available: summary.semantic_available,
last_indexed_at_unix_seconds: summary.last_indexed_at_unix_seconds,
indexed_file_count: summary.indexed_file_count,
indexed_chunk_count: summary.indexed_chunk_count,
shards: summary
.shards
.into_iter()
.map(|shard| ThreadEpiphanyRetrieveShardSummary {
shard_id: shard.shard_id,
path_prefix: shard.path_prefix,
indexed_file_count: shard.indexed_file_count,
indexed_chunk_count: shard.indexed_chunk_count,
status: shard.status,
exact_available: shard.exact_available,
semantic_available: shard.semantic_available,
})
.collect(),
dirty_paths: summary.dirty_paths,
})
}
fn protocol_retrieve_result(result: CoreEpiphanyRetrieveResult) -> ThreadEpiphanyRetrieveResult {
ThreadEpiphanyRetrieveResult {
kind: match result.kind {
CoreEpiphanyRetrieveResultKind::ExactFile => {
ThreadEpiphanyRetrieveResultKind::ExactFile
}
CoreEpiphanyRetrieveResultKind::ExactDirectory => {
ThreadEpiphanyRetrieveResultKind::ExactDirectory
}
CoreEpiphanyRetrieveResultKind::SemanticChunk => {
ThreadEpiphanyRetrieveResultKind::SemanticChunk
}
},
path: result.path,
score: result.score,
line_start: result.line_start,
line_end: result.line_end,
excerpt: result.excerpt,
}
}

View file

@ -3,19 +3,15 @@ use std::path::Path;
use codex_app_server_protocol::*;
use epiphany_core::EPIPHANY_REORIENT_LAUNCH_BINDING_ID;
use epiphany_core::EpiphanyContextParams;
use epiphany_core::EpiphanyDistillInput;
use epiphany_core::EpiphanyGraphQuery;
use epiphany_core::EpiphanyMapProposalInput;
use epiphany_core::EpiphanyRoleResultRoleId;
use epiphany_core::EpiphanySceneInput;
use epiphany_core::EpiphanyTokenUsageSnapshot;
use epiphany_core::EpiphanyViewLens;
use epiphany_core::derive_scene;
use epiphany_core::distill_observation;
use epiphany_core::epiphany_view_needs_jobs;
use epiphany_core::epiphany_view_needs_pressure;
use epiphany_core::epiphany_view_needs_reorientation_inputs;
use epiphany_core::propose_map_update;
use epiphany_core::reorient_finding_already_accepted;
use epiphany_state_model::EpiphanyRetrievalState;
use epiphany_state_model::EpiphanyThreadState;
@ -65,7 +61,6 @@ pub struct EpiphanyFreshnessResponseInput<'a> {
pub retrieval_override: Option<&'a EpiphanyRetrievalState>,
pub watcher_snapshot: Option<EpiphanyFreshnessWatcherSnapshot<'a>>,
}
pub fn derive_epiphany_freshness_surface(
input: EpiphanyFreshnessResponseInput<'_>,
) -> EpiphanyFreshnessSurface {
@ -553,43 +548,3 @@ pub async fn map_epiphany_reorient_result_response(
note: result.note,
}
}
pub fn map_epiphany_distill_response(
expected_revision: u64,
input: EpiphanyDistillInput,
) -> std::result::Result<ThreadEpiphanyDistillResponse, String> {
let proposal = distill_observation(input).map_err(|err| err.to_string())?;
Ok(ThreadEpiphanyDistillResponse {
expected_revision,
patch: ThreadEpiphanyUpdatePatch {
observations: vec![proposal.observation],
evidence: vec![proposal.evidence],
..Default::default()
},
})
}
pub fn map_epiphany_propose_response(
state: EpiphanyThreadState,
observation_ids: Vec<String>,
) -> std::result::Result<ThreadEpiphanyProposeResponse, String> {
let expected_revision = state.revision;
let proposal = propose_map_update(EpiphanyMapProposalInput {
state,
observation_ids,
})
.map_err(|err| err.to_string())?;
Ok(ThreadEpiphanyProposeResponse {
expected_revision,
patch: ThreadEpiphanyUpdatePatch {
observations: vec![proposal.observation],
evidence: vec![proposal.evidence],
graphs: Some(proposal.graphs),
graph_frontier: Some(proposal.graph_frontier),
churn: Some(proposal.churn),
..Default::default()
},
})
}